From baea035adca6b2fe389f34bd4cc44d4e3ad89557 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Fri, 16 Jan 2026 12:06:27 +1000 Subject: [PATCH] fix: correct component API usage in SectionComponents - Fix Drawer, Modal, Popover, Tooltip, DropdownMenu imports and usage - Use controlled component pattern with open/onClose props - Fix Breadcrumbs to use BreadcrumbItem children instead of items prop - Fix Slider onChange to handle ChangeEvent properly - Fix Pagination prop name from currentPage to page - Fix EmptyState icon from invalid "inbox" to valid "box" - Fix StatCard props to use value (number), label, and subtext --- .../style-guide/SectionComponents.tsx | 133 ++++++++---------- 1 file changed, 60 insertions(+), 73 deletions(-) diff --git a/apps/web/src/components/style-guide/SectionComponents.tsx b/apps/web/src/components/style-guide/SectionComponents.tsx index 7360055..f9ccd1c 100644 --- a/apps/web/src/components/style-guide/SectionComponents.tsx +++ b/apps/web/src/components/style-guide/SectionComponents.tsx @@ -7,7 +7,7 @@ import { AccordionTrigger, } from '@tpmjs/ui/Accordion/Accordion'; import { Badge } from '@tpmjs/ui/Badge/Badge'; -import { Breadcrumbs } from '@tpmjs/ui/Breadcrumbs/Breadcrumbs'; +import { Breadcrumbs, BreadcrumbItem } from '@tpmjs/ui/Breadcrumbs/Breadcrumbs'; import { Button } from '@tpmjs/ui/Button/Button'; import { Card, @@ -19,13 +19,11 @@ import { } from '@tpmjs/ui/Card/Card'; import { Checkbox } from '@tpmjs/ui/Checkbox/Checkbox'; import { CodeBlock } from '@tpmjs/ui/CodeBlock/CodeBlock'; -import { Drawer, DrawerContent, DrawerTrigger } from '@tpmjs/ui/Drawer/Drawer'; +import { Drawer } from '@tpmjs/ui/Drawer/Drawer'; import { DropdownMenu, - DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, - DropdownMenuTrigger, } from '@tpmjs/ui/DropdownMenu/DropdownMenu'; import { EmptyState } from '@tpmjs/ui/EmptyState/EmptyState'; import { ErrorState } from '@tpmjs/ui/ErrorState/ErrorState'; @@ -34,10 +32,10 @@ import { Icon } from '@tpmjs/ui/Icon/Icon'; import { Input } from '@tpmjs/ui/Input/Input'; import { InstallSnippet } from '@tpmjs/ui/InstallSnippet/InstallSnippet'; import { LoadingState } from '@tpmjs/ui/LoadingState/LoadingState'; -import { Modal, ModalContent, ModalTrigger } from '@tpmjs/ui/Modal/Modal'; +import { Modal } from '@tpmjs/ui/Modal/Modal'; import { PageHeader } from '@tpmjs/ui/PageHeader/PageHeader'; import { Pagination } from '@tpmjs/ui/Pagination/Pagination'; -import { Popover, PopoverContent, PopoverTrigger } from '@tpmjs/ui/Popover/Popover'; +import { Popover } from '@tpmjs/ui/Popover/Popover'; import { ProgressBar } from '@tpmjs/ui/ProgressBar/ProgressBar'; import { QualityScore } from '@tpmjs/ui/QualityScore/QualityScore'; import { Radio } from '@tpmjs/ui/Radio/Radio'; @@ -60,7 +58,7 @@ import { import { Tabs } from '@tpmjs/ui/Tabs/Tabs'; import { Textarea } from '@tpmjs/ui/Textarea/Textarea'; import { Toast, ToastProvider } from '@tpmjs/ui/Toast/Toast'; -import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@tpmjs/ui/Tooltip/Tooltip'; +import { Tooltip } from '@tpmjs/ui/Tooltip/Tooltip'; import { useState } from 'react'; import { FieldsetSection, SubSection } from './shared'; @@ -80,6 +78,8 @@ export function SectionComponents({ const [sliderValue, setSliderValue] = useState(50); const [currentPage, setCurrentPage] = useState(1); const [showToast, setShowToast] = useState(false); + const [showModal, setShowModal] = useState(false); + const [showDrawer, setShowDrawer] = useState(false); return ( @@ -203,14 +203,12 @@ export function SectionComponents({ {/* Breadcrumbs */}
- + + Home + Tools + Category + Current Page +
@@ -272,7 +270,7 @@ export function SectionComponents({ {/* Slider */}
- + setSliderValue(Number(e.target.value))} min={0} max={100} step={1} />

Value: {sliderValue}

@@ -353,7 +351,7 @@ export function SectionComponents({ {/* Pagination */} @@ -361,86 +359,75 @@ export function SectionComponents({ {/* Dropdown Menu */} - - + Open Menu - - - Profile - Settings - - Logout - + } + > + {}}>Profile + {}}>Settings + + {}}>Logout {/* Popover */} - - - - - +

Popover Title

This is the popover content. It can contain any elements.

-
+ } + > +
{/* Tooltip */} - -
- - - - - -

This is a tooltip

-
-
-
-
+
+ + + +
{/* Modal */} - - - - - -
-

Modal content goes here.

-
-
- - -
-
+ + setShowModal(false)} + title="Modal Title" + description="This is a modal dialog." + footer={ + <> + + + + } + > +

Modal content goes here.

{/* Drawer */} - - - - - -
-

Drawer Content

-

- This is the drawer content. It slides in from the bottom. -

-
-
+ + setShowDrawer(false)} + title="Drawer Content" + > +

+ This is the drawer content. It slides in from the side. +

@@ -492,7 +479,7 @@ export function SectionComponents({

empty state

Create Item} @@ -534,9 +521,9 @@ export function SectionComponents({ {/* Stat Card */}
- - - + + +