@auto-engineer/generate-react-client 1.34.0 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/dist/starter/package.json +2 -1
- package/dist/starter/scripts/build-component-db.ts +157 -0
- package/dist/starter/src/components/ui/Accordion.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Accordion.tsx +4 -0
- package/dist/starter/src/components/ui/Alert.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Alert.tsx +7 -0
- package/dist/starter/src/components/ui/AlertDialog.stories.tsx +2 -0
- package/dist/starter/src/components/ui/AlertDialog.tsx +15 -0
- package/dist/starter/src/components/ui/AspectRatio.stories.tsx +2 -0
- package/dist/starter/src/components/ui/AspectRatio.tsx +4 -0
- package/dist/starter/src/components/ui/Avatar.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Avatar.tsx +11 -0
- package/dist/starter/src/components/ui/Badge.stories.tsx +5 -0
- package/dist/starter/src/components/ui/Badge.tsx +5 -0
- package/dist/starter/src/components/ui/Breadcrumb.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Breadcrumb.tsx +12 -0
- package/dist/starter/src/components/ui/Button.stories.tsx +10 -0
- package/dist/starter/src/components/ui/Button.tsx +5 -0
- package/dist/starter/src/components/ui/ButtonGroup.stories.tsx +2 -0
- package/dist/starter/src/components/ui/ButtonGroup.tsx +6 -0
- package/dist/starter/src/components/ui/Calendar.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Calendar.tsx +6 -0
- package/dist/starter/src/components/ui/Card.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Card.tsx +10 -0
- package/dist/starter/src/components/ui/Carousel.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Carousel.tsx +9 -0
- package/dist/starter/src/components/ui/Chart.stories.tsx +1 -0
- package/dist/starter/src/components/ui/Chart.tsx +9 -0
- package/dist/starter/src/components/ui/Checkbox.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Checkbox.tsx +1 -0
- package/dist/starter/src/components/ui/Collapsible.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Collapsible.tsx +3 -0
- package/dist/starter/src/components/ui/Combobox.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Combobox.tsx +29 -0
- package/dist/starter/src/components/ui/Command.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Command.tsx +20 -0
- package/dist/starter/src/components/ui/ContextMenu.stories.tsx +2 -0
- package/dist/starter/src/components/ui/ContextMenu.tsx +20 -0
- package/dist/starter/src/components/ui/Dialog.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Dialog.tsx +18 -0
- package/dist/starter/src/components/ui/Direction.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Direction.tsx +6 -0
- package/dist/starter/src/components/ui/Drawer.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Drawer.tsx +18 -0
- package/dist/starter/src/components/ui/DropdownMenu.stories.tsx +2 -0
- package/dist/starter/src/components/ui/DropdownMenu.tsx +20 -0
- package/dist/starter/src/components/ui/Empty.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Empty.tsx +13 -0
- package/dist/starter/src/components/ui/Field.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Field.tsx +25 -0
- package/dist/starter/src/components/ui/Form.stories.tsx +1 -0
- package/dist/starter/src/components/ui/Form.tsx +15 -3
- package/dist/starter/src/components/ui/HoverCard.stories.tsx +2 -0
- package/dist/starter/src/components/ui/HoverCard.tsx +3 -0
- package/dist/starter/src/components/ui/Input.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Input.tsx +1 -0
- package/dist/starter/src/components/ui/InputGroup.stories.tsx +3 -0
- package/dist/starter/src/components/ui/InputGroup.tsx +6 -0
- package/dist/starter/src/components/ui/InputOTP.stories.tsx +2 -0
- package/dist/starter/src/components/ui/InputOTP.tsx +4 -0
- package/dist/starter/src/components/ui/Item.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Item.tsx +10 -0
- package/dist/starter/src/components/ui/Kbd.stories.tsx +5 -0
- package/dist/starter/src/components/ui/Kbd.tsx +4 -0
- package/dist/starter/src/components/ui/Label.stories.tsx +5 -0
- package/dist/starter/src/components/ui/Label.tsx +4 -0
- package/dist/starter/src/components/ui/Menubar.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Menubar.tsx +15 -0
- package/dist/starter/src/components/ui/NativeSelect.stories.tsx +3 -0
- package/dist/starter/src/components/ui/NativeSelect.tsx +6 -0
- package/dist/starter/src/components/ui/NavigationMenu.stories.tsx +2 -0
- package/dist/starter/src/components/ui/NavigationMenu.tsx +10 -0
- package/dist/starter/src/components/ui/Pagination.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Pagination.tsx +8 -0
- package/dist/starter/src/components/ui/Popover.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Popover.tsx +5 -0
- package/dist/starter/src/components/ui/Progress.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Progress.tsx +1 -0
- package/dist/starter/src/components/ui/RadioGroup.stories.tsx +2 -0
- package/dist/starter/src/components/ui/RadioGroup.tsx +5 -0
- package/dist/starter/src/components/ui/Resizable.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Resizable.tsx +7 -0
- package/dist/starter/src/components/ui/ScrollArea.stories.tsx +2 -0
- package/dist/starter/src/components/ui/ScrollArea.tsx +5 -0
- package/dist/starter/src/components/ui/Select.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Select.tsx +9 -0
- package/dist/starter/src/components/ui/Separator.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Separator.tsx +1 -0
- package/dist/starter/src/components/ui/Sheet.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Sheet.tsx +8 -0
- package/dist/starter/src/components/ui/Sidebar.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Sidebar.tsx +20 -0
- package/dist/starter/src/components/ui/Skeleton.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Skeleton.tsx +4 -0
- package/dist/starter/src/components/ui/Slider.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Slider.tsx +1 -0
- package/dist/starter/src/components/ui/Sonner.stories.tsx +1 -0
- package/dist/starter/src/components/ui/Sonner.tsx +4 -0
- package/dist/starter/src/components/ui/Spinner.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Spinner.tsx +4 -0
- package/dist/starter/src/components/ui/Switch.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Switch.tsx +2 -0
- package/dist/starter/src/components/ui/Table.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Table.tsx +11 -0
- package/dist/starter/src/components/ui/Tabs.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Tabs.tsx +6 -0
- package/dist/starter/src/components/ui/Textarea.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Textarea.tsx +4 -0
- package/dist/starter/src/components/ui/Toast.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Toast.tsx +9 -0
- package/dist/starter/src/components/ui/Toaster.tsx +4 -0
- package/dist/starter/src/components/ui/Toggle.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Toggle.tsx +1 -0
- package/dist/starter/src/components/ui/ToggleGroup.stories.tsx +3 -0
- package/dist/starter/src/components/ui/ToggleGroup.tsx +3 -0
- package/dist/starter/src/components/ui/Tooltip.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Tooltip.tsx +6 -0
- package/package.json +2 -2
|
@@ -15,6 +15,7 @@ const invoices = [
|
|
|
15
15
|
{ invoice: 'INV004', status: 'Paid', method: 'Credit Card', amount: '$450.00' },
|
|
16
16
|
];
|
|
17
17
|
|
|
18
|
+
/** Shows a full table with header, body, and caption using invoice data. */
|
|
18
19
|
export const Default: Story = {
|
|
19
20
|
render: () => (
|
|
20
21
|
<Table>
|
|
@@ -41,6 +42,7 @@ export const Default: Story = {
|
|
|
41
42
|
),
|
|
42
43
|
};
|
|
43
44
|
|
|
45
|
+
/** Shows a minimal two-column table without caption or footer. */
|
|
44
46
|
export const Minimal: Story = {
|
|
45
47
|
render: () => (
|
|
46
48
|
<Table>
|
|
@@ -4,6 +4,10 @@ import * as React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { cn } from '@/lib/utils';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* A responsive data table with horizontal scroll overflow.
|
|
9
|
+
* Compose with TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, and TableCaption subcomponents.
|
|
10
|
+
*/
|
|
7
11
|
function Table({ className, ...props }: React.ComponentProps<'table'>) {
|
|
8
12
|
return (
|
|
9
13
|
<div data-slot="table-container" className="relative w-full overflow-x-auto">
|
|
@@ -12,14 +16,17 @@ function Table({ className, ...props }: React.ComponentProps<'table'>) {
|
|
|
12
16
|
);
|
|
13
17
|
}
|
|
14
18
|
|
|
19
|
+
/** The header section of a Table, rendering a thead with bottom-bordered rows. */
|
|
15
20
|
function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
|
|
16
21
|
return <thead data-slot="table-header" className={cn('[&_tr]:border-b', className)} {...props} />;
|
|
17
22
|
}
|
|
18
23
|
|
|
24
|
+
/** The body section of a Table, rendering a tbody with no border on the last row. */
|
|
19
25
|
function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
|
|
20
26
|
return <tbody data-slot="table-body" className={cn('[&_tr:last-child]:border-0', className)} {...props} />;
|
|
21
27
|
}
|
|
22
28
|
|
|
29
|
+
/** The footer section of a Table, rendering a tfoot with a muted background and top border. */
|
|
23
30
|
function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
|
|
24
31
|
return (
|
|
25
32
|
<tfoot
|
|
@@ -30,6 +37,7 @@ function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
|
|
|
30
37
|
);
|
|
31
38
|
}
|
|
32
39
|
|
|
40
|
+
/** A table row with hover highlight and selected state styling via data-state="selected". */
|
|
33
41
|
function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
|
|
34
42
|
return (
|
|
35
43
|
<tr
|
|
@@ -40,6 +48,7 @@ function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
|
|
|
40
48
|
);
|
|
41
49
|
}
|
|
42
50
|
|
|
51
|
+
/** A table header cell with bold text and left alignment. Automatically adjusts padding when containing a checkbox. */
|
|
43
52
|
function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
|
|
44
53
|
return (
|
|
45
54
|
<th
|
|
@@ -53,6 +62,7 @@ function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
|
|
|
53
62
|
);
|
|
54
63
|
}
|
|
55
64
|
|
|
65
|
+
/** A table data cell with standard padding and vertical alignment. */
|
|
56
66
|
function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
|
|
57
67
|
return (
|
|
58
68
|
<td
|
|
@@ -66,6 +76,7 @@ function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
|
|
|
66
76
|
);
|
|
67
77
|
}
|
|
68
78
|
|
|
79
|
+
/** A table caption rendered below the table body in muted text. */
|
|
69
80
|
function TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {
|
|
70
81
|
return (
|
|
71
82
|
<caption data-slot="table-caption" className={cn('text-muted-foreground mt-4 text-sm', className)} {...props} />
|
|
@@ -8,6 +8,7 @@ const meta: Meta<typeof Tabs> = {
|
|
|
8
8
|
export default meta;
|
|
9
9
|
type Story = StoryObj<typeof Tabs>;
|
|
10
10
|
|
|
11
|
+
/** Shows the default pill-style tabs with three panels. */
|
|
11
12
|
export const Default: Story = {
|
|
12
13
|
render: () => (
|
|
13
14
|
<Tabs defaultValue="account" className="w-[400px]">
|
|
@@ -29,6 +30,7 @@ export const Default: Story = {
|
|
|
29
30
|
),
|
|
30
31
|
};
|
|
31
32
|
|
|
33
|
+
/** Shows the line variant where the active tab is indicated by an underline rather than a background. */
|
|
32
34
|
export const LineVariant: Story = {
|
|
33
35
|
render: () => (
|
|
34
36
|
<Tabs defaultValue="overview" className="w-[400px]">
|
|
@@ -4,6 +4,7 @@ import { Tabs as TabsPrimitive } from 'radix-ui';
|
|
|
4
4
|
|
|
5
5
|
import { cn } from '@/lib/utils';
|
|
6
6
|
|
|
7
|
+
/** Layered content panels activated by tab triggers. Supports horizontal and vertical orientations with keyboard navigation. */
|
|
7
8
|
function Tabs({ className, orientation = 'horizontal', ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
8
9
|
return (
|
|
9
10
|
<TabsPrimitive.Root
|
|
@@ -31,6 +32,9 @@ const tabsListVariants = cva(
|
|
|
31
32
|
},
|
|
32
33
|
);
|
|
33
34
|
|
|
35
|
+
/**
|
|
36
|
+
* The container for tab triggers. Supports "default" (pill background) and "line" (underline indicator) variants.
|
|
37
|
+
*/
|
|
34
38
|
function TabsList({
|
|
35
39
|
className,
|
|
36
40
|
variant = 'default',
|
|
@@ -46,6 +50,7 @@ function TabsList({
|
|
|
46
50
|
);
|
|
47
51
|
}
|
|
48
52
|
|
|
53
|
+
/** A clickable tab button that activates its associated TabsContent panel. */
|
|
49
54
|
function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
50
55
|
return (
|
|
51
56
|
<TabsPrimitive.Trigger
|
|
@@ -62,6 +67,7 @@ function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPr
|
|
|
62
67
|
);
|
|
63
68
|
}
|
|
64
69
|
|
|
70
|
+
/** The content panel associated with a tab trigger, shown when its corresponding trigger is active. */
|
|
65
71
|
function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
66
72
|
return <TabsPrimitive.Content data-slot="tabs-content" className={cn('flex-1 outline-none', className)} {...props} />;
|
|
67
73
|
}
|
|
@@ -8,14 +8,17 @@ const meta: Meta<typeof Textarea> = {
|
|
|
8
8
|
export default meta;
|
|
9
9
|
type Story = StoryObj<typeof Textarea>;
|
|
10
10
|
|
|
11
|
+
/** Shows the textarea in its default empty state. */
|
|
11
12
|
export const Default: Story = {};
|
|
12
13
|
|
|
14
|
+
/** Shows the textarea with placeholder text. */
|
|
13
15
|
export const WithPlaceholder: Story = {
|
|
14
16
|
args: {
|
|
15
17
|
placeholder: 'Type your message here...',
|
|
16
18
|
},
|
|
17
19
|
};
|
|
18
20
|
|
|
21
|
+
/** Shows a disabled textarea that cannot receive input. */
|
|
19
22
|
export const Disabled: Story = {
|
|
20
23
|
args: {
|
|
21
24
|
placeholder: 'This textarea is disabled',
|
|
@@ -2,6 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { cn } from '@/lib/utils';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* A multi-line text input that auto-sizes to its content via field-sizing-content.
|
|
7
|
+
* Supports aria-invalid styling for form validation errors.
|
|
8
|
+
*/
|
|
5
9
|
function Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {
|
|
6
10
|
return (
|
|
7
11
|
<textarea
|
|
@@ -40,6 +40,7 @@ function ToastDemo() {
|
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/** Demonstrates triggering a basic toast notification with a title and description. */
|
|
43
44
|
export const Default: Story = {
|
|
44
45
|
render: () => <ToastDemo />,
|
|
45
46
|
};
|
|
@@ -66,6 +67,7 @@ function ToastDestructiveDemo() {
|
|
|
66
67
|
);
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
/** Shows a destructive-variant toast for error or warning scenarios. */
|
|
69
71
|
export const Destructive: Story = {
|
|
70
72
|
render: () => <ToastDestructiveDemo />,
|
|
71
73
|
};
|
|
@@ -92,10 +94,12 @@ function ToastWithActionDemo() {
|
|
|
92
94
|
);
|
|
93
95
|
}
|
|
94
96
|
|
|
97
|
+
/** Shows a toast with an action button (e.g., "Undo") alongside the message. */
|
|
95
98
|
export const WithAction: Story = {
|
|
96
99
|
render: () => <ToastWithActionDemo />,
|
|
97
100
|
};
|
|
98
101
|
|
|
102
|
+
/** Shows a toast rendered inline (always open) using the primitive subcomponents directly. */
|
|
99
103
|
export const Inline: Story = {
|
|
100
104
|
render: () => (
|
|
101
105
|
<ToastProvider>
|
|
@@ -7,10 +7,14 @@ import { Toast as ToastPrimitive } from 'radix-ui';
|
|
|
7
7
|
|
|
8
8
|
import { cn } from '@/lib/utils';
|
|
9
9
|
|
|
10
|
+
/** Temporary notification at screen edge with swipe-to-dismiss. Supports default and destructive variants. */
|
|
11
|
+
|
|
12
|
+
/** Provides the toast context for managing toast state and swipe behavior. */
|
|
10
13
|
function ToastProvider({ ...props }: React.ComponentProps<typeof ToastPrimitive.Provider>) {
|
|
11
14
|
return <ToastPrimitive.Provider data-slot="toast-provider" {...props} />;
|
|
12
15
|
}
|
|
13
16
|
|
|
17
|
+
/** The fixed-position viewport where toasts are rendered, positioned at bottom-right on larger screens. */
|
|
14
18
|
function ToastViewport({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Viewport>) {
|
|
15
19
|
return (
|
|
16
20
|
<ToastPrimitive.Viewport
|
|
@@ -39,6 +43,7 @@ const toastVariants = cva(
|
|
|
39
43
|
},
|
|
40
44
|
);
|
|
41
45
|
|
|
46
|
+
/** An individual toast notification with default or destructive variant styling. */
|
|
42
47
|
function Toast({
|
|
43
48
|
className,
|
|
44
49
|
variant,
|
|
@@ -47,6 +52,7 @@ function Toast({
|
|
|
47
52
|
return <ToastPrimitive.Root data-slot="toast" className={cn(toastVariants({ variant }), className)} {...props} />;
|
|
48
53
|
}
|
|
49
54
|
|
|
55
|
+
/** An action button displayed within a toast, such as "Undo" or "Retry". */
|
|
50
56
|
function ToastAction({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Action>) {
|
|
51
57
|
return (
|
|
52
58
|
<ToastPrimitive.Action
|
|
@@ -60,6 +66,7 @@ function ToastAction({ className, ...props }: React.ComponentProps<typeof ToastP
|
|
|
60
66
|
);
|
|
61
67
|
}
|
|
62
68
|
|
|
69
|
+
/** A close button positioned in the top-right corner of a toast, visible on hover. */
|
|
63
70
|
function ToastClose({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Close>) {
|
|
64
71
|
return (
|
|
65
72
|
<ToastPrimitive.Close
|
|
@@ -76,6 +83,7 @@ function ToastClose({ className, ...props }: React.ComponentProps<typeof ToastPr
|
|
|
76
83
|
);
|
|
77
84
|
}
|
|
78
85
|
|
|
86
|
+
/** The bold heading text of a toast notification. */
|
|
79
87
|
function ToastTitle({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Title>) {
|
|
80
88
|
return (
|
|
81
89
|
<ToastPrimitive.Title
|
|
@@ -86,6 +94,7 @@ function ToastTitle({ className, ...props }: React.ComponentProps<typeof ToastPr
|
|
|
86
94
|
);
|
|
87
95
|
}
|
|
88
96
|
|
|
97
|
+
/** The secondary descriptive text of a toast notification. */
|
|
89
98
|
function ToastDescription({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Description>) {
|
|
90
99
|
return (
|
|
91
100
|
<ToastPrimitive.Description
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
import { useToast } from '@/hooks/use-toast';
|
|
4
4
|
import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport } from '@/components/ui/Toast';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Renders all active toasts from the useToast hook into a fixed-position viewport.
|
|
8
|
+
* Place once at the app root to enable imperative toast notifications via the useToast hook.
|
|
9
|
+
*/
|
|
6
10
|
function Toaster() {
|
|
7
11
|
const { toasts } = useToast();
|
|
8
12
|
|
|
@@ -9,6 +9,7 @@ const meta: Meta<typeof Toggle> = {
|
|
|
9
9
|
export default meta;
|
|
10
10
|
type Story = StoryObj<typeof Toggle>;
|
|
11
11
|
|
|
12
|
+
/** Shows a toggle button with a bold icon in the default ghost variant. */
|
|
12
13
|
export const Default: Story = {
|
|
13
14
|
args: {
|
|
14
15
|
'aria-label': 'Toggle bold',
|
|
@@ -16,6 +17,7 @@ export const Default: Story = {
|
|
|
16
17
|
},
|
|
17
18
|
};
|
|
18
19
|
|
|
20
|
+
/** Shows the outline variant with a visible border. */
|
|
19
21
|
export const Outline: Story = {
|
|
20
22
|
args: {
|
|
21
23
|
variant: 'outline',
|
|
@@ -24,6 +26,7 @@ export const Outline: Story = {
|
|
|
24
26
|
},
|
|
25
27
|
};
|
|
26
28
|
|
|
29
|
+
/** Shows a toggle with a text label instead of an icon. */
|
|
27
30
|
export const WithText: Story = {
|
|
28
31
|
args: {
|
|
29
32
|
'aria-label': 'Toggle italic',
|
|
@@ -31,6 +34,7 @@ export const WithText: Story = {
|
|
|
31
34
|
},
|
|
32
35
|
};
|
|
33
36
|
|
|
37
|
+
/** Shows a toggle in its initially pressed (on) state. */
|
|
34
38
|
export const Pressed: Story = {
|
|
35
39
|
args: {
|
|
36
40
|
defaultPressed: true,
|
|
@@ -9,6 +9,7 @@ const meta: Meta<typeof ToggleGroup> = {
|
|
|
9
9
|
export default meta;
|
|
10
10
|
type Story = StoryObj<typeof ToggleGroup>;
|
|
11
11
|
|
|
12
|
+
/** Shows a single-selection toggle group where only one item can be active at a time. */
|
|
12
13
|
export const Single: Story = {
|
|
13
14
|
render: () => (
|
|
14
15
|
<ToggleGroup type="single">
|
|
@@ -25,6 +26,7 @@ export const Single: Story = {
|
|
|
25
26
|
),
|
|
26
27
|
};
|
|
27
28
|
|
|
29
|
+
/** Shows a multi-selection toggle group with bold and italic pre-selected. */
|
|
28
30
|
export const Multiple: Story = {
|
|
29
31
|
render: () => (
|
|
30
32
|
<ToggleGroup type="multiple" defaultValue={['bold', 'italic']}>
|
|
@@ -41,6 +43,7 @@ export const Multiple: Story = {
|
|
|
41
43
|
),
|
|
42
44
|
};
|
|
43
45
|
|
|
46
|
+
/** Shows a toggle group using the outline variant with visible borders. */
|
|
44
47
|
export const Outline: Story = {
|
|
45
48
|
render: () => (
|
|
46
49
|
<ToggleGroup type="single" variant="outline">
|
|
@@ -17,10 +17,12 @@ const ToggleGroupContext = React.createContext<
|
|
|
17
17
|
spacing: 0,
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
/** A group of toggles where one (`type="single"`) or multiple (`type="multiple"`) can be active. */
|
|
20
21
|
function ToggleGroup({
|
|
21
22
|
className,
|
|
22
23
|
variant,
|
|
23
24
|
size,
|
|
25
|
+
/** Controls gap between items. When 0, items are visually joined with shared borders. */
|
|
24
26
|
spacing = 0,
|
|
25
27
|
children,
|
|
26
28
|
...props
|
|
@@ -46,6 +48,7 @@ function ToggleGroup({
|
|
|
46
48
|
);
|
|
47
49
|
}
|
|
48
50
|
|
|
51
|
+
/** An individual toggle button within a ToggleGroup. Inherits variant and size from the parent group context. */
|
|
49
52
|
function ToggleGroupItem({
|
|
50
53
|
className,
|
|
51
54
|
children,
|
|
@@ -9,6 +9,7 @@ const meta: Meta<typeof Tooltip> = {
|
|
|
9
9
|
export default meta;
|
|
10
10
|
type Story = StoryObj<typeof Tooltip>;
|
|
11
11
|
|
|
12
|
+
/** Shows a basic tooltip appearing on hover over a button. */
|
|
12
13
|
export const Default: Story = {
|
|
13
14
|
render: () => (
|
|
14
15
|
<TooltipProvider>
|
|
@@ -24,6 +25,7 @@ export const Default: Story = {
|
|
|
24
25
|
),
|
|
25
26
|
};
|
|
26
27
|
|
|
28
|
+
/** Shows a tooltip with additional spacing between the trigger and content via sideOffset. */
|
|
27
29
|
export const WithSideOffset: Story = {
|
|
28
30
|
render: () => (
|
|
29
31
|
<TooltipProvider>
|
|
@@ -3,18 +3,24 @@ import { Tooltip as TooltipPrimitive } from 'radix-ui';
|
|
|
3
3
|
|
|
4
4
|
import { cn } from '@/lib/utils';
|
|
5
5
|
|
|
6
|
+
/** Brief descriptive popup on hover/focus. Has enter/exit animations and arrow indicator. Wrap app in TooltipProvider first. */
|
|
7
|
+
|
|
8
|
+
/** Provides shared tooltip configuration (e.g., delay duration) for all nested Tooltip instances. */
|
|
6
9
|
function TooltipProvider({ delayDuration = 0, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
7
10
|
return <TooltipPrimitive.Provider data-slot="tooltip-provider" delayDuration={delayDuration} {...props} />;
|
|
8
11
|
}
|
|
9
12
|
|
|
13
|
+
/** The root component that manages open/close state for a single tooltip. */
|
|
10
14
|
function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
11
15
|
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />;
|
|
12
16
|
}
|
|
13
17
|
|
|
18
|
+
/** The element that triggers the tooltip on hover or focus. */
|
|
14
19
|
function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
15
20
|
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
|
|
16
21
|
}
|
|
17
22
|
|
|
23
|
+
/** The popup content panel rendered via a portal with an arrow indicator. */
|
|
18
24
|
function TooltipContent({
|
|
19
25
|
className,
|
|
20
26
|
sideOffset = 0,
|
package/package.json
CHANGED
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"debug": "^4.4.1",
|
|
22
|
-
"@auto-engineer/message-bus": "1.
|
|
22
|
+
"@auto-engineer/message-bus": "1.36.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/debug": "^4.1.12"
|
|
26
26
|
},
|
|
27
|
-
"version": "1.
|
|
27
|
+
"version": "1.36.0",
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsc && tsx ../../scripts/fix-esm-imports.ts && cp -r starter dist/",
|
|
30
30
|
"test-cli": "tsx test-cli.ts",
|