@pickle-ui/react 1.0.0-beta.13 → 1.0.0-beta.15
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/README.md +36 -12
- package/dist/components/Alert.d.ts +1 -1
- package/dist/components/Alert.d.ts.map +1 -1
- package/dist/components/Alert.js.map +1 -1
- package/dist/components/AlertDialog.d.ts.map +1 -1
- package/dist/components/AlertDialog.js +3 -3
- package/dist/components/AlertDialog.js.map +1 -1
- package/dist/components/Avatar.d.ts +1 -1
- package/dist/components/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/Badge.d.ts +2 -2
- package/dist/components/Badge.d.ts.map +1 -1
- package/dist/components/Badge.js.map +1 -1
- package/dist/components/Button.d.ts +2 -2
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.d.ts +1 -1
- package/dist/components/Card.d.ts.map +1 -1
- package/dist/components/Card.js +1 -1
- package/dist/components/Card.js.map +1 -1
- package/dist/components/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog.js.map +1 -1
- package/dist/components/Drawer.d.ts +2 -2
- package/dist/components/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer.js.map +1 -1
- package/dist/components/Flex.d.ts +7 -7
- package/dist/components/Flex.d.ts.map +1 -1
- package/dist/components/Grid.d.ts +42 -42
- package/dist/components/Grid.d.ts.map +1 -1
- package/dist/components/Grid.js +4 -3
- package/dist/components/Grid.js.map +1 -1
- package/dist/components/Group.d.ts.map +1 -1
- package/dist/components/Group.js.map +1 -1
- package/dist/components/Menu.d.ts +1 -1
- package/dist/components/Menu.d.ts.map +1 -1
- package/dist/components/Menu.js +1 -1
- package/dist/components/Menu.js.map +1 -1
- package/dist/components/Popover.d.ts.map +1 -1
- package/dist/components/Popover.js.map +1 -1
- package/dist/components/Progress.d.ts +1 -1
- package/dist/components/Progress.d.ts.map +1 -1
- package/dist/components/Progress.js +1 -1
- package/dist/components/Progress.js.map +1 -1
- package/dist/components/ScrollArea.d.ts.map +1 -1
- package/dist/components/ScrollArea.js +1 -1
- package/dist/components/ScrollArea.js.map +1 -1
- package/dist/components/Separator.d.ts.map +1 -1
- package/dist/components/Separator.js.map +1 -1
- package/dist/components/Sidebar.d.ts.map +1 -1
- package/dist/components/Sidebar.js +1 -1
- package/dist/components/Sidebar.js.map +1 -1
- package/dist/components/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner.js.map +1 -1
- package/dist/components/Table.d.ts +1 -1
- package/dist/components/Table.d.ts.map +1 -1
- package/dist/components/Table.js +2 -2
- package/dist/components/Table.js.map +1 -1
- package/dist/components/Text.d.ts.map +1 -1
- package/dist/components/Text.js.map +1 -1
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +1 -1
- package/dist/components/Toast.js.map +1 -1
- package/dist/components/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/XStack.d.ts.map +1 -1
- package/dist/components/XStack.js.map +1 -1
- package/dist/components/YStack.d.ts.map +1 -1
- package/dist/components/YStack.js.map +1 -1
- package/dist/components/_internal/VisuallyHiddenInput.d.ts.map +1 -1
- package/dist/components/_internal/VisuallyHiddenInput.js +2 -4
- package/dist/components/_internal/VisuallyHiddenInput.js.map +1 -1
- package/dist/components/_internal/dialog-styles.d.ts +1 -1
- package/dist/components/_internal/dialog-styles.d.ts.map +1 -1
- package/dist/components/_internal/dialog-styles.js.map +1 -1
- package/dist/components/_internal/layout.d.ts +27 -27
- package/dist/components/_internal/layout.d.ts.map +1 -1
- package/dist/components/_internal/layout.js +1 -1
- package/dist/components/_internal/layout.js.map +1 -1
- package/dist/components/_internal/separate.d.ts +1 -1
- package/dist/components/_internal/separate.d.ts.map +1 -1
- package/dist/components/_internal/separate.js.map +1 -1
- package/dist/components/form/Checkbox.d.ts.map +1 -1
- package/dist/components/form/Checkbox.js.map +1 -1
- package/dist/components/form/ColorPicker.d.ts.map +1 -1
- package/dist/components/form/ColorPicker.js.map +1 -1
- package/dist/components/form/ColorPickerPrimitive.d.ts.map +1 -1
- package/dist/components/form/ColorPickerPrimitive.js +9 -14
- package/dist/components/form/ColorPickerPrimitive.js.map +1 -1
- package/dist/components/form/Combobox.d.ts.map +1 -1
- package/dist/components/form/Combobox.js +11 -12
- package/dist/components/form/Combobox.js.map +1 -1
- package/dist/components/form/Form.context.d.ts.map +1 -1
- package/dist/components/form/Form.context.js +2 -4
- package/dist/components/form/Form.context.js.map +1 -1
- package/dist/components/form/Form.d.ts +6 -2
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/form/Form.js +2 -0
- package/dist/components/form/Form.js.map +1 -1
- package/dist/components/form/FormCheckbox.d.ts.map +1 -1
- package/dist/components/form/FormCheckbox.js.map +1 -1
- package/dist/components/form/FormCombobox.d.ts +1 -1
- package/dist/components/form/FormCombobox.d.ts.map +1 -1
- package/dist/components/form/FormCombobox.js +1 -1
- package/dist/components/form/FormCombobox.js.map +1 -1
- package/dist/components/form/FormField.d.ts +5 -2
- package/dist/components/form/FormField.d.ts.map +1 -1
- package/dist/components/form/FormField.js +20 -9
- package/dist/components/form/FormField.js.map +1 -1
- package/dist/components/form/FormGroupField.d.ts +13 -0
- package/dist/components/form/FormGroupField.d.ts.map +1 -0
- package/dist/components/form/FormGroupField.js +17 -0
- package/dist/components/form/FormGroupField.js.map +1 -0
- package/dist/components/form/FormInput.d.ts.map +1 -1
- package/dist/components/form/FormInput.js +1 -1
- package/dist/components/form/FormInput.js.map +1 -1
- package/dist/components/form/FormInputGroup.d.ts.map +1 -1
- package/dist/components/form/FormInputGroup.js +2 -6
- package/dist/components/form/FormInputGroup.js.map +1 -1
- package/dist/components/form/FormRadioGroup.d.ts +1 -1
- package/dist/components/form/FormRadioGroup.d.ts.map +1 -1
- package/dist/components/form/FormSwitch.d.ts.map +1 -1
- package/dist/components/form/FormSwitch.js.map +1 -1
- package/dist/components/form/FormTextarea.d.ts.map +1 -1
- package/dist/components/form/FormTextarea.js +1 -1
- package/dist/components/form/FormTextarea.js.map +1 -1
- package/dist/components/form/Input.d.ts.map +1 -1
- package/dist/components/form/Input.js.map +1 -1
- package/dist/components/form/InputGroup.d.ts +1 -1
- package/dist/components/form/InputGroup.d.ts.map +1 -1
- package/dist/components/form/InputGroup.js.map +1 -1
- package/dist/components/form/RadioGroup.d.ts.map +1 -1
- package/dist/components/form/RadioGroup.js.map +1 -1
- package/dist/components/form/Select.d.ts.map +1 -1
- package/dist/components/form/Select.js +1 -1
- package/dist/components/form/Select.js.map +1 -1
- package/dist/components/form/Slider.d.ts +1 -1
- package/dist/components/form/Slider.d.ts.map +1 -1
- package/dist/components/form/Slider.js.map +1 -1
- package/dist/components/form/Switch.d.ts.map +1 -1
- package/dist/components/form/Switch.js.map +1 -1
- package/dist/components/form/Textarea.d.ts.map +1 -1
- package/dist/components/form/Textarea.js.map +1 -1
- package/dist/entries/checkbox.d.ts +1 -1
- package/dist/entries/checkbox.d.ts.map +1 -1
- package/dist/entries/form.d.ts +1 -1
- package/dist/entries/form.d.ts.map +1 -1
- package/dist/entries/group.d.ts +1 -1
- package/dist/entries/group.d.ts.map +1 -1
- package/dist/entries/radio-group.d.ts +1 -1
- package/dist/entries/radio-group.d.ts.map +1 -1
- package/dist/lib/color.d.ts +1 -1
- package/dist/lib/color.d.ts.map +1 -1
- package/dist/lib/color.js +1 -3
- package/dist/lib/color.js.map +1 -1
- package/dist/lib/compose-refs.js +1 -1
- package/dist/lib/compose-refs.js.map +1 -1
- package/package.json +35 -34
- package/skills/pickle-ui-react/SKILL.md +38 -0
- package/src/agent-skill.test.ts +30 -0
- package/src/components/Alert.test.tsx +3 -12
- package/src/components/Alert.tsx +2 -4
- package/src/components/AlertDialog.stories.tsx +10 -35
- package/src/components/AlertDialog.test.tsx +6 -23
- package/src/components/AlertDialog.tsx +12 -40
- package/src/components/Avatar.stories.tsx +3 -8
- package/src/components/Avatar.tsx +4 -18
- package/src/components/Badge.stories.tsx +1 -5
- package/src/components/Badge.test.tsx +1 -4
- package/src/components/Badge.tsx +5 -14
- package/src/components/Button.stories.tsx +4 -16
- package/src/components/Button.test.tsx +8 -9
- package/src/components/Button.tsx +2 -7
- package/src/components/Card.stories.tsx +1 -3
- package/src/components/Card.test.tsx +1 -3
- package/src/components/Card.tsx +1 -9
- package/src/components/Dialog.stories.tsx +9 -23
- package/src/components/Dialog.test.tsx +6 -23
- package/src/components/Dialog.tsx +4 -17
- package/src/components/Drawer.stories.tsx +9 -34
- package/src/components/Drawer.test.tsx +8 -29
- package/src/components/Drawer.tsx +4 -15
- package/src/components/Grid.stories.tsx +1 -4
- package/src/components/Grid.test.tsx +1 -3
- package/src/components/Grid.tsx +4 -4
- package/src/components/Group.stories.tsx +4 -20
- package/src/components/Group.test.tsx +2 -9
- package/src/components/Group.tsx +3 -12
- package/src/components/Menu.stories.tsx +5 -18
- package/src/components/Menu.test.tsx +11 -17
- package/src/components/Menu.tsx +7 -27
- package/src/components/Popover.stories.tsx +4 -10
- package/src/components/Popover.tsx +3 -13
- package/src/components/Progress.tsx +5 -24
- package/src/components/ScrollArea.test.tsx +4 -6
- package/src/components/ScrollArea.tsx +10 -28
- package/src/components/Separator.test.tsx +2 -8
- package/src/components/Separator.tsx +1 -5
- package/src/components/Sidebar.stories.tsx +1 -5
- package/src/components/Sidebar.tsx +4 -22
- package/src/components/Spinner.tsx +1 -5
- package/src/components/Table.stories.tsx +1 -3
- package/src/components/Table.tsx +5 -30
- package/src/components/Text.stories.tsx +8 -13
- package/src/components/Text.tsx +1 -4
- package/src/components/Toast.test.tsx +6 -17
- package/src/components/Toast.tsx +4 -17
- package/src/components/Tooltip.stories.tsx +6 -28
- package/src/components/Tooltip.test.tsx +2 -8
- package/src/components/Tooltip.tsx +3 -12
- package/src/components/XStack.stories.tsx +4 -8
- package/src/components/XStack.test.tsx +9 -20
- package/src/components/XStack.tsx +2 -13
- package/src/components/YStack.stories.tsx +2 -8
- package/src/components/YStack.tsx +2 -13
- package/src/components/_internal/Story.tsx +6 -23
- package/src/components/_internal/VisuallyHiddenInput.tsx +4 -9
- package/src/components/_internal/dialog-styles.ts +1 -2
- package/src/components/_internal/layout.ts +1 -7
- package/src/components/_internal/separate.tsx +6 -9
- package/src/components/form/Checkbox.test.tsx +5 -16
- package/src/components/form/Checkbox.tsx +1 -4
- package/src/components/form/ColorPicker.stories.tsx +3 -10
- package/src/components/form/ColorPicker.test.tsx +1 -3
- package/src/components/form/ColorPicker.tsx +2 -6
- package/src/components/form/ColorPickerPrimitive.tsx +40 -151
- package/src/components/form/Combobox.stories.tsx +7 -31
- package/src/components/form/Combobox.test.tsx +10 -27
- package/src/components/form/Combobox.tsx +31 -89
- package/src/components/form/Form.context.ts +5 -19
- package/src/components/form/Form.stories.tsx +34 -23
- package/src/components/form/Form.test.tsx +105 -23
- package/src/components/form/Form.tsx +8 -0
- package/src/components/form/FormCheckbox.tsx +1 -5
- package/src/components/form/FormCombobox.tsx +4 -10
- package/src/components/form/FormField.tsx +50 -31
- package/src/components/form/FormGroupField.tsx +25 -0
- package/src/components/form/FormInput.tsx +2 -12
- package/src/components/form/FormInputGroup.tsx +3 -11
- package/src/components/form/FormSwitch.tsx +1 -5
- package/src/components/form/FormTextarea.tsx +3 -11
- package/src/components/form/Input.stories.tsx +1 -5
- package/src/components/form/Input.test.tsx +20 -31
- package/src/components/form/Input.tsx +1 -4
- package/src/components/form/InputGroup.stories.tsx +4 -23
- package/src/components/form/InputGroup.tsx +5 -10
- package/src/components/form/RadioGroup.test.tsx +14 -28
- package/src/components/form/RadioGroup.tsx +1 -5
- package/src/components/form/Select.stories.tsx +2 -10
- package/src/components/form/Select.test.tsx +4 -14
- package/src/components/form/Select.tsx +9 -38
- package/src/components/form/Slider.stories.tsx +7 -17
- package/src/components/form/Slider.test.tsx +4 -12
- package/src/components/form/Slider.tsx +4 -20
- package/src/components/form/Switch.test.tsx +3 -9
- package/src/components/form/Switch.tsx +2 -9
- package/src/components/form/Textarea.test.tsx +2 -6
- package/src/components/form/Textarea.tsx +1 -6
- package/src/entries/checkbox.ts +1 -4
- package/src/entries/form.ts +2 -0
- package/src/entries/group.ts +1 -5
- package/src/entries/radio-group.ts +1 -4
- package/src/lib/color.test.ts +2 -6
- package/src/lib/color.ts +3 -11
- package/src/lib/compose-refs.ts +1 -1
- package/src/public-api.test.ts +7 -8
package/src/components/Group.tsx
CHANGED
|
@@ -25,18 +25,13 @@ const groupVariants = cva(
|
|
|
25
25
|
},
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
type GroupProps = React.ComponentProps<'div'> &
|
|
29
|
-
VariantProps<typeof groupVariants>;
|
|
28
|
+
type GroupProps = React.ComponentProps<'div'> & VariantProps<typeof groupVariants>;
|
|
30
29
|
|
|
31
30
|
type GroupSeparatorProps = SeparatorProps;
|
|
32
31
|
|
|
33
32
|
type GroupTextProps = useRender.ComponentProps<'div'>;
|
|
34
33
|
|
|
35
|
-
function GroupRoot({
|
|
36
|
-
className,
|
|
37
|
-
orientation = 'horizontal',
|
|
38
|
-
...props
|
|
39
|
-
}: GroupProps) {
|
|
34
|
+
function GroupRoot({ className, orientation = 'horizontal', ...props }: GroupProps) {
|
|
40
35
|
return (
|
|
41
36
|
<div
|
|
42
37
|
className={cn(groupVariants({ orientation }), className)}
|
|
@@ -49,11 +44,7 @@ function GroupRoot({
|
|
|
49
44
|
);
|
|
50
45
|
}
|
|
51
46
|
|
|
52
|
-
function GroupSeparator({
|
|
53
|
-
className,
|
|
54
|
-
orientation = 'vertical',
|
|
55
|
-
...props
|
|
56
|
-
}: GroupSeparatorProps) {
|
|
47
|
+
function GroupSeparator({ className, orientation = 'vertical', ...props }: GroupSeparatorProps) {
|
|
57
48
|
return (
|
|
58
49
|
<Separator
|
|
59
50
|
className={cn(
|
|
@@ -33,9 +33,7 @@ function AccountMenu() {
|
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<Menu>
|
|
36
|
-
<Menu.Trigger render={<Button variant="outline" />}>
|
|
37
|
-
My account
|
|
38
|
-
</Menu.Trigger>
|
|
36
|
+
<Menu.Trigger render={<Button variant="outline" />}>My account</Menu.Trigger>
|
|
39
37
|
<Menu.Content className="w-56">
|
|
40
38
|
<Menu.Group>
|
|
41
39
|
<Menu.GroupLabel>Account</Menu.GroupLabel>
|
|
@@ -74,26 +72,17 @@ function AccountMenu() {
|
|
|
74
72
|
<Menu.Separator />
|
|
75
73
|
<Menu.Group>
|
|
76
74
|
<Menu.GroupLabel>View</Menu.GroupLabel>
|
|
77
|
-
<Menu.CheckboxItem
|
|
78
|
-
checked={showStatusBar}
|
|
79
|
-
onCheckedChange={setShowStatusBar}
|
|
80
|
-
>
|
|
75
|
+
<Menu.CheckboxItem checked={showStatusBar} onCheckedChange={setShowStatusBar}>
|
|
81
76
|
Status bar
|
|
82
77
|
</Menu.CheckboxItem>
|
|
83
|
-
<Menu.CheckboxItem
|
|
84
|
-
checked={showActivity}
|
|
85
|
-
onCheckedChange={setShowActivity}
|
|
86
|
-
>
|
|
78
|
+
<Menu.CheckboxItem checked={showActivity} onCheckedChange={setShowActivity}>
|
|
87
79
|
Activity panel
|
|
88
80
|
</Menu.CheckboxItem>
|
|
89
81
|
</Menu.Group>
|
|
90
82
|
<Menu.Separator />
|
|
91
83
|
<Menu.Group>
|
|
92
84
|
<Menu.GroupLabel>Theme</Menu.GroupLabel>
|
|
93
|
-
<Menu.RadioGroup
|
|
94
|
-
onValueChange={(value) => setTheme(value as string)}
|
|
95
|
-
value={theme}
|
|
96
|
-
>
|
|
85
|
+
<Menu.RadioGroup onValueChange={(value) => setTheme(value as string)} value={theme}>
|
|
97
86
|
<Menu.RadioItem value="light">Light</Menu.RadioItem>
|
|
98
87
|
<Menu.RadioItem value="dark">Dark</Menu.RadioItem>
|
|
99
88
|
<Menu.RadioItem value="system">System</Menu.RadioItem>
|
|
@@ -120,9 +109,7 @@ export const All: StoryDefinition = {
|
|
|
120
109
|
<div className="flex gap-4">
|
|
121
110
|
{(['start', 'center', 'end'] as const).map((align) => (
|
|
122
111
|
<Menu key={align}>
|
|
123
|
-
<Menu.Trigger render={<Button variant="outline" />}>
|
|
124
|
-
Align {align}
|
|
125
|
-
</Menu.Trigger>
|
|
112
|
+
<Menu.Trigger render={<Button variant="outline" />}>Align {align}</Menu.Trigger>
|
|
126
113
|
<Menu.Content align={align}>
|
|
127
114
|
<Menu.Item>Rename</Menu.Item>
|
|
128
115
|
<Menu.Item>Duplicate</Menu.Item>
|
|
@@ -21,9 +21,10 @@ describe('Menu', () => {
|
|
|
21
21
|
|
|
22
22
|
fireEvent.click(screen.getByRole('button', { name: 'Actions' }));
|
|
23
23
|
|
|
24
|
-
expect(await screen.findByRole('menu')).toHaveAttribute(
|
|
25
|
-
|
|
26
|
-
'
|
|
24
|
+
expect(await screen.findByRole('menu')).toHaveAttribute('data-slot', 'menu-content');
|
|
25
|
+
expect(screen.getByRole('button', { name: 'Actions' })).toHaveAttribute(
|
|
26
|
+
'aria-expanded',
|
|
27
|
+
'true',
|
|
27
28
|
);
|
|
28
29
|
expect(screen.getAllByRole('menuitem')).toHaveLength(2);
|
|
29
30
|
expect(screen.getByRole('menuitem', { name: 'Delete' })).toHaveAttribute(
|
|
@@ -58,21 +59,16 @@ describe('Menu', () => {
|
|
|
58
59
|
</Menu>,
|
|
59
60
|
);
|
|
60
61
|
|
|
61
|
-
expect(
|
|
62
|
-
screen.getByRole('menuitemcheckbox', { name: 'Status bar' }),
|
|
63
|
-
).toHaveAttribute('aria-checked', 'true');
|
|
64
|
-
expect(screen.getByRole('menuitemradio', { name: 'Dark' })).toHaveAttribute(
|
|
62
|
+
expect(screen.getByRole('menuitemcheckbox', { name: 'Status bar' })).toHaveAttribute(
|
|
65
63
|
'aria-checked',
|
|
66
64
|
'true',
|
|
67
65
|
);
|
|
68
|
-
expect(screen.
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
);
|
|
72
|
-
expect(screen.getByText('⌘,')).toHaveAttribute(
|
|
73
|
-
'data-slot',
|
|
74
|
-
'menu-shortcut',
|
|
66
|
+
expect(screen.getByRole('menuitemradio', { name: 'Dark' })).toHaveAttribute(
|
|
67
|
+
'aria-checked',
|
|
68
|
+
'true',
|
|
75
69
|
);
|
|
70
|
+
expect(screen.getByText('Panels')).toHaveAttribute('data-slot', 'menu-group-label');
|
|
71
|
+
expect(screen.getByText('⌘,')).toHaveAttribute('data-slot', 'menu-shortcut');
|
|
76
72
|
});
|
|
77
73
|
|
|
78
74
|
it('opens a submenu from its sub trigger', async () => {
|
|
@@ -96,8 +92,6 @@ describe('Menu', () => {
|
|
|
96
92
|
|
|
97
93
|
fireEvent.click(subTrigger);
|
|
98
94
|
|
|
99
|
-
expect(
|
|
100
|
-
await screen.findByRole('menuitem', { name: 'Email' }),
|
|
101
|
-
).toBeInTheDocument();
|
|
95
|
+
expect(await screen.findByRole('menuitem', { name: 'Email' })).toBeInTheDocument();
|
|
102
96
|
});
|
|
103
97
|
});
|
package/src/components/Menu.tsx
CHANGED
|
@@ -1,41 +1,29 @@
|
|
|
1
1
|
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
2
|
-
import {
|
|
3
|
-
IconCheck,
|
|
4
|
-
IconChevronRight,
|
|
5
|
-
IconCircleFilled,
|
|
6
|
-
} from '@tabler/icons-react';
|
|
2
|
+
import { IconCheck, IconChevronRight, IconCircleFilled } from '@tabler/icons-react';
|
|
7
3
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
8
4
|
import * as React from 'react';
|
|
9
5
|
|
|
10
6
|
import { cn } from '../lib/utils';
|
|
11
7
|
import { Text, type TextProps } from './Text';
|
|
12
8
|
|
|
13
|
-
type MenuCheckboxItemProps = React.ComponentProps<
|
|
14
|
-
typeof MenuPrimitive.CheckboxItem
|
|
15
|
-
>;
|
|
9
|
+
type MenuCheckboxItemProps = React.ComponentProps<typeof MenuPrimitive.CheckboxItem>;
|
|
16
10
|
type MenuContentProps = Pick<
|
|
17
11
|
React.ComponentProps<typeof MenuPrimitive.Positioner>,
|
|
18
12
|
'align' | 'alignOffset' | 'side' | 'sideOffset'
|
|
19
13
|
> &
|
|
20
14
|
React.ComponentProps<typeof MenuPrimitive.Popup>;
|
|
21
|
-
type MenuGroupLabelProps = React.ComponentProps<
|
|
22
|
-
typeof MenuPrimitive.GroupLabel
|
|
23
|
-
>;
|
|
15
|
+
type MenuGroupLabelProps = React.ComponentProps<typeof MenuPrimitive.GroupLabel>;
|
|
24
16
|
type MenuGroupProps = React.ComponentProps<typeof MenuPrimitive.Group>;
|
|
25
17
|
type MenuItemProps = React.ComponentProps<typeof MenuPrimitive.Item> &
|
|
26
18
|
VariantProps<typeof menuItemVariants>;
|
|
27
19
|
type MenuProps = React.ComponentProps<typeof MenuPrimitive.Root>;
|
|
28
|
-
type MenuRadioGroupProps = React.ComponentProps<
|
|
29
|
-
typeof MenuPrimitive.RadioGroup
|
|
30
|
-
>;
|
|
20
|
+
type MenuRadioGroupProps = React.ComponentProps<typeof MenuPrimitive.RadioGroup>;
|
|
31
21
|
type MenuRadioItemProps = React.ComponentProps<typeof MenuPrimitive.RadioItem>;
|
|
32
22
|
type MenuSeparatorProps = React.ComponentProps<typeof MenuPrimitive.Separator>;
|
|
33
23
|
type MenuShortcutProps = Omit<TextProps, 'as'>;
|
|
34
24
|
type MenuSubContentProps = MenuContentProps;
|
|
35
25
|
type MenuSubProps = React.ComponentProps<typeof MenuPrimitive.SubmenuRoot>;
|
|
36
|
-
type MenuSubTriggerProps = React.ComponentProps<
|
|
37
|
-
typeof MenuPrimitive.SubmenuTrigger
|
|
38
|
-
>;
|
|
26
|
+
type MenuSubTriggerProps = React.ComponentProps<typeof MenuPrimitive.SubmenuTrigger>;
|
|
39
27
|
type MenuTriggerProps = React.ComponentProps<typeof MenuPrimitive.Trigger>;
|
|
40
28
|
|
|
41
29
|
const menuPopupClassName =
|
|
@@ -57,11 +45,7 @@ const menuItemVariants = cva(menuItemBaseClassName, {
|
|
|
57
45
|
},
|
|
58
46
|
});
|
|
59
47
|
|
|
60
|
-
function MenuCheckboxItem({
|
|
61
|
-
children,
|
|
62
|
-
className,
|
|
63
|
-
...props
|
|
64
|
-
}: MenuCheckboxItemProps) {
|
|
48
|
+
function MenuCheckboxItem({ children, className, ...props }: MenuCheckboxItemProps) {
|
|
65
49
|
return (
|
|
66
50
|
<MenuPrimitive.CheckboxItem
|
|
67
51
|
className={cn(menuItemBaseClassName, 'pr-8', className)}
|
|
@@ -214,11 +198,7 @@ function MenuSubContent({
|
|
|
214
198
|
);
|
|
215
199
|
}
|
|
216
200
|
|
|
217
|
-
function MenuSubTrigger({
|
|
218
|
-
children,
|
|
219
|
-
className,
|
|
220
|
-
...props
|
|
221
|
-
}: MenuSubTriggerProps) {
|
|
201
|
+
function MenuSubTrigger({ children, className, ...props }: MenuSubTriggerProps) {
|
|
222
202
|
return (
|
|
223
203
|
<MenuPrimitive.SubmenuTrigger
|
|
224
204
|
className={cn(
|
|
@@ -34,9 +34,7 @@ function PopoverMatrixCell({ column, row }: ComponentMatrixCellProps) {
|
|
|
34
34
|
return (
|
|
35
35
|
<Popover>
|
|
36
36
|
<Popover.Trigger
|
|
37
|
-
render={
|
|
38
|
-
<Button variant={column.key as NonNullable<ButtonProps['variant']>} />
|
|
39
|
-
}
|
|
37
|
+
render={<Button variant={column.key as NonNullable<ButtonProps['variant']>} />}
|
|
40
38
|
>
|
|
41
39
|
Open
|
|
42
40
|
</Popover.Trigger>
|
|
@@ -44,8 +42,8 @@ function PopoverMatrixCell({ column, row }: ComponentMatrixCellProps) {
|
|
|
44
42
|
<Popover.Header>
|
|
45
43
|
<Popover.Title>{row.label}</Popover.Title>
|
|
46
44
|
<Popover.Description>
|
|
47
|
-
Contextual content keeps the same spacing, radius, and border
|
|
48
|
-
|
|
45
|
+
Contextual content keeps the same spacing, radius, and border treatment across trigger
|
|
46
|
+
styles.
|
|
49
47
|
</Popover.Description>
|
|
50
48
|
</Popover.Header>
|
|
51
49
|
<div className="flex justify-end gap-2">
|
|
@@ -61,11 +59,7 @@ export const All: StoryDefinition = {
|
|
|
61
59
|
render: () => (
|
|
62
60
|
<Story.Layout className="max-w-6xl" title="Popover">
|
|
63
61
|
<Story.Section title="Alignment and trigger styles">
|
|
64
|
-
<Story.Matrix
|
|
65
|
-
Cell={PopoverMatrixCell}
|
|
66
|
-
columns={TRIGGER_COLUMNS}
|
|
67
|
-
rows={ALIGN_ROWS}
|
|
68
|
-
/>
|
|
62
|
+
<Story.Matrix Cell={PopoverMatrixCell} columns={TRIGGER_COLUMNS} rows={ALIGN_ROWS} />
|
|
69
63
|
</Story.Section>
|
|
70
64
|
</Story.Layout>
|
|
71
65
|
),
|
|
@@ -13,9 +13,7 @@ type PopoverDescriptionProps = React.ComponentProps<'p'>;
|
|
|
13
13
|
type PopoverHeaderProps = React.ComponentProps<'div'>;
|
|
14
14
|
type PopoverProps = React.ComponentProps<typeof PopoverPrimitive.Root>;
|
|
15
15
|
type PopoverTitleProps = React.ComponentProps<'h2'>;
|
|
16
|
-
type PopoverTriggerProps = React.ComponentProps<
|
|
17
|
-
typeof PopoverPrimitive.Trigger
|
|
18
|
-
>;
|
|
16
|
+
type PopoverTriggerProps = React.ComponentProps<typeof PopoverPrimitive.Trigger>;
|
|
19
17
|
|
|
20
18
|
function PopoverAnchor({ ...props }: PopoverAnchorProps) {
|
|
21
19
|
return <div data-slot="popover-anchor" {...props} />;
|
|
@@ -30,11 +28,7 @@ function PopoverContent({
|
|
|
30
28
|
}: PopoverContentProps) {
|
|
31
29
|
return (
|
|
32
30
|
<PopoverPrimitive.Portal>
|
|
33
|
-
<PopoverPrimitive.Positioner
|
|
34
|
-
align={align}
|
|
35
|
-
side={side}
|
|
36
|
-
sideOffset={sideOffset}
|
|
37
|
-
>
|
|
31
|
+
<PopoverPrimitive.Positioner align={align} side={side} sideOffset={sideOffset}>
|
|
38
32
|
<PopoverPrimitive.Popup
|
|
39
33
|
className={cn(
|
|
40
34
|
'border-border bg-popover text-popover-foreground data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md border p-4 text-sm shadow-lg duration-100 outline-none',
|
|
@@ -74,11 +68,7 @@ function PopoverRoot({ ...props }: PopoverProps) {
|
|
|
74
68
|
|
|
75
69
|
function PopoverTitle({ children, className, ...props }: PopoverTitleProps) {
|
|
76
70
|
return (
|
|
77
|
-
<h2
|
|
78
|
-
className={cn('text-base font-medium', className)}
|
|
79
|
-
data-slot="popover-title"
|
|
80
|
-
{...props}
|
|
81
|
-
>
|
|
71
|
+
<h2 className={cn('text-base font-medium', className)} data-slot="popover-title" {...props}>
|
|
82
72
|
{children}
|
|
83
73
|
</h2>
|
|
84
74
|
);
|
|
@@ -3,9 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { cn } from '../lib/utils';
|
|
5
5
|
|
|
6
|
-
type ProgressIndicatorProps = React.ComponentProps<
|
|
7
|
-
typeof ProgressPrimitive.Indicator
|
|
8
|
-
> & {
|
|
6
|
+
type ProgressIndicatorProps = React.ComponentProps<typeof ProgressPrimitive.Indicator> & {
|
|
9
7
|
indicatorClassName?: string;
|
|
10
8
|
};
|
|
11
9
|
|
|
@@ -15,11 +13,7 @@ type ProgressTrackProps = React.ComponentProps<typeof ProgressPrimitive.Track>;
|
|
|
15
13
|
|
|
16
14
|
type ProgressValueProps = React.ComponentProps<typeof ProgressPrimitive.Value>;
|
|
17
15
|
|
|
18
|
-
function ProgressIndicator({
|
|
19
|
-
className,
|
|
20
|
-
indicatorClassName,
|
|
21
|
-
...props
|
|
22
|
-
}: ProgressIndicatorProps) {
|
|
16
|
+
function ProgressIndicator({ className, indicatorClassName, ...props }: ProgressIndicatorProps) {
|
|
23
17
|
return (
|
|
24
18
|
<ProgressPrimitive.Indicator
|
|
25
19
|
className={cn(
|
|
@@ -62,10 +56,7 @@ function ProgressRoot({ children, className, ...props }: ProgressProps) {
|
|
|
62
56
|
function ProgressTrack({ children, className, ...props }: ProgressTrackProps) {
|
|
63
57
|
return (
|
|
64
58
|
<ProgressPrimitive.Track
|
|
65
|
-
className={cn(
|
|
66
|
-
'bg-muted h-2 w-full overflow-hidden rounded-full',
|
|
67
|
-
className,
|
|
68
|
-
)}
|
|
59
|
+
className={cn('bg-muted h-2 w-full overflow-hidden rounded-full', className)}
|
|
69
60
|
data-slot="progress-track"
|
|
70
61
|
{...props}
|
|
71
62
|
>
|
|
@@ -77,10 +68,7 @@ function ProgressTrack({ children, className, ...props }: ProgressTrackProps) {
|
|
|
77
68
|
function ProgressValue({ className, ...props }: ProgressValueProps) {
|
|
78
69
|
return (
|
|
79
70
|
<ProgressPrimitive.Value
|
|
80
|
-
className={cn(
|
|
81
|
-
'text-muted-foreground text-right text-sm tabular-nums',
|
|
82
|
-
className,
|
|
83
|
-
)}
|
|
71
|
+
className={cn('text-muted-foreground text-right text-sm tabular-nums', className)}
|
|
84
72
|
data-slot="progress-value"
|
|
85
73
|
{...props}
|
|
86
74
|
/>
|
|
@@ -94,14 +82,7 @@ const Progress = Object.assign(ProgressRoot, {
|
|
|
94
82
|
Value: ProgressValue,
|
|
95
83
|
});
|
|
96
84
|
|
|
97
|
-
export {
|
|
98
|
-
Progress,
|
|
99
|
-
ProgressIndicator,
|
|
100
|
-
ProgressLabel,
|
|
101
|
-
ProgressRoot,
|
|
102
|
-
ProgressTrack,
|
|
103
|
-
ProgressValue,
|
|
104
|
-
};
|
|
85
|
+
export { Progress, ProgressIndicator, ProgressLabel, ProgressRoot, ProgressTrack, ProgressValue };
|
|
105
86
|
export type {
|
|
106
87
|
ProgressIndicatorProps,
|
|
107
88
|
ProgressLabelProps,
|
|
@@ -8,9 +8,9 @@ describe('ScrollArea', () => {
|
|
|
8
8
|
const { container } = render(<ScrollArea>Scrollable content</ScrollArea>);
|
|
9
9
|
|
|
10
10
|
await waitFor(() =>
|
|
11
|
-
expect(
|
|
12
|
-
|
|
13
|
-
)
|
|
11
|
+
expect(container.querySelector('[data-slot="scroll-area-viewport"]')).toContainElement(
|
|
12
|
+
screen.getByText('Scrollable content'),
|
|
13
|
+
),
|
|
14
14
|
);
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -24,9 +24,7 @@ describe('ScrollArea', () => {
|
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
await waitFor(() =>
|
|
27
|
-
expect(screen.getByTestId('custom-viewport')).toHaveTextContent(
|
|
28
|
-
'Custom content',
|
|
29
|
-
),
|
|
27
|
+
expect(screen.getByTestId('custom-viewport')).toHaveTextContent('Custom content'),
|
|
30
28
|
);
|
|
31
29
|
});
|
|
32
30
|
});
|
|
@@ -3,30 +3,18 @@ import * as React from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { cn } from '../lib/utils';
|
|
5
5
|
|
|
6
|
-
type ScrollAreaContentProps = React.ComponentProps<
|
|
7
|
-
|
|
8
|
-
>;
|
|
9
|
-
type ScrollAreaCornerProps = React.ComponentProps<
|
|
10
|
-
typeof ScrollAreaPrimitive.Corner
|
|
11
|
-
>;
|
|
6
|
+
type ScrollAreaContentProps = React.ComponentProps<typeof ScrollAreaPrimitive.Content>;
|
|
7
|
+
type ScrollAreaCornerProps = React.ComponentProps<typeof ScrollAreaPrimitive.Corner>;
|
|
12
8
|
type ScrollAreaProps = Omit<ScrollAreaRootProps, 'children'> & {
|
|
13
9
|
children?: React.ReactNode;
|
|
14
10
|
contentClassName?: string;
|
|
15
11
|
orientation?: 'both' | 'horizontal' | 'vertical';
|
|
16
12
|
viewportClassName?: string;
|
|
17
13
|
};
|
|
18
|
-
type ScrollAreaRootProps = React.ComponentProps<
|
|
19
|
-
|
|
20
|
-
>;
|
|
21
|
-
type
|
|
22
|
-
typeof ScrollAreaPrimitive.Scrollbar
|
|
23
|
-
>;
|
|
24
|
-
type ScrollAreaThumbProps = React.ComponentProps<
|
|
25
|
-
typeof ScrollAreaPrimitive.Thumb
|
|
26
|
-
>;
|
|
27
|
-
type ScrollAreaViewportProps = React.ComponentProps<
|
|
28
|
-
typeof ScrollAreaPrimitive.Viewport
|
|
29
|
-
>;
|
|
14
|
+
type ScrollAreaRootProps = React.ComponentProps<typeof ScrollAreaPrimitive.Root>;
|
|
15
|
+
type ScrollAreaScrollbarProps = React.ComponentProps<typeof ScrollAreaPrimitive.Scrollbar>;
|
|
16
|
+
type ScrollAreaThumbProps = React.ComponentProps<typeof ScrollAreaPrimitive.Thumb>;
|
|
17
|
+
type ScrollAreaViewportProps = React.ComponentProps<typeof ScrollAreaPrimitive.Viewport>;
|
|
30
18
|
|
|
31
19
|
function ScrollAreaContent({ className, ...props }: ScrollAreaContentProps) {
|
|
32
20
|
return (
|
|
@@ -55,22 +43,16 @@ function ScrollAreaFacade({
|
|
|
55
43
|
viewportClassName,
|
|
56
44
|
...props
|
|
57
45
|
}: ScrollAreaProps) {
|
|
58
|
-
const hasHorizontalScrollbar =
|
|
59
|
-
|
|
60
|
-
const hasVerticalScrollbar =
|
|
61
|
-
orientation === 'vertical' || orientation === 'both';
|
|
46
|
+
const hasHorizontalScrollbar = orientation === 'horizontal' || orientation === 'both';
|
|
47
|
+
const hasVerticalScrollbar = orientation === 'vertical' || orientation === 'both';
|
|
62
48
|
|
|
63
49
|
return (
|
|
64
50
|
<ScrollAreaRoot {...props}>
|
|
65
51
|
<ScrollAreaViewport className={viewportClassName}>
|
|
66
|
-
<ScrollAreaContent className={contentClassName}>
|
|
67
|
-
{children}
|
|
68
|
-
</ScrollAreaContent>
|
|
52
|
+
<ScrollAreaContent className={contentClassName}>{children}</ScrollAreaContent>
|
|
69
53
|
</ScrollAreaViewport>
|
|
70
54
|
{hasVerticalScrollbar ? <ScrollAreaScrollbar /> : null}
|
|
71
|
-
{hasHorizontalScrollbar ?
|
|
72
|
-
<ScrollAreaScrollbar orientation="horizontal" />
|
|
73
|
-
) : null}
|
|
55
|
+
{hasHorizontalScrollbar ? <ScrollAreaScrollbar orientation="horizontal" /> : null}
|
|
74
56
|
{orientation === 'both' ? <ScrollAreaCorner /> : null}
|
|
75
57
|
</ScrollAreaRoot>
|
|
76
58
|
);
|
|
@@ -7,18 +7,12 @@ describe('Separator', () => {
|
|
|
7
7
|
it('renders a horizontal separator by default', () => {
|
|
8
8
|
render(<Separator />);
|
|
9
9
|
|
|
10
|
-
expect(screen.getByRole('separator')).toHaveAttribute(
|
|
11
|
-
'data-orientation',
|
|
12
|
-
'horizontal',
|
|
13
|
-
);
|
|
10
|
+
expect(screen.getByRole('separator')).toHaveAttribute('data-orientation', 'horizontal');
|
|
14
11
|
});
|
|
15
12
|
|
|
16
13
|
it('renders a vertical separator', () => {
|
|
17
14
|
render(<Separator orientation="vertical" />);
|
|
18
15
|
|
|
19
|
-
expect(screen.getByRole('separator')).toHaveAttribute(
|
|
20
|
-
'aria-orientation',
|
|
21
|
-
'vertical',
|
|
22
|
-
);
|
|
16
|
+
expect(screen.getByRole('separator')).toHaveAttribute('aria-orientation', 'vertical');
|
|
23
17
|
});
|
|
24
18
|
});
|
|
@@ -5,11 +5,7 @@ import { cn } from '../lib/utils';
|
|
|
5
5
|
|
|
6
6
|
type SeparatorProps = React.ComponentProps<typeof SeparatorPrimitive>;
|
|
7
7
|
|
|
8
|
-
function Separator({
|
|
9
|
-
className,
|
|
10
|
-
orientation = 'horizontal',
|
|
11
|
-
...props
|
|
12
|
-
}: SeparatorProps) {
|
|
8
|
+
function Separator({ className, orientation = 'horizontal', ...props }: SeparatorProps) {
|
|
13
9
|
return (
|
|
14
10
|
<SeparatorPrimitive
|
|
15
11
|
className={cn(
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
IconLayoutDashboard,
|
|
5
|
-
IconSearch,
|
|
6
|
-
IconSettings,
|
|
7
|
-
} from '@tabler/icons-react';
|
|
3
|
+
import { IconLayoutDashboard, IconSearch, IconSettings } from '@tabler/icons-react';
|
|
8
4
|
|
|
9
5
|
import { Story } from './_internal/Story';
|
|
10
6
|
import { Sidebar } from './Sidebar';
|
|
@@ -35,11 +35,7 @@ function SidebarFooter({ className, ...props }: SidebarFooterProps) {
|
|
|
35
35
|
|
|
36
36
|
function SidebarGroup({ className, ...props }: SidebarGroupProps) {
|
|
37
37
|
return (
|
|
38
|
-
<div
|
|
39
|
-
className={cn('flex flex-col gap-1', className)}
|
|
40
|
-
data-slot="sidebar-group"
|
|
41
|
-
{...props}
|
|
42
|
-
/>
|
|
38
|
+
<div className={cn('flex flex-col gap-1', className)} data-slot="sidebar-group" {...props} />
|
|
43
39
|
);
|
|
44
40
|
}
|
|
45
41
|
|
|
@@ -68,29 +64,15 @@ function SidebarHeader({ className, ...props }: SidebarHeaderProps) {
|
|
|
68
64
|
|
|
69
65
|
function SidebarMenu({ className, ...props }: SidebarMenuProps) {
|
|
70
66
|
return (
|
|
71
|
-
<nav
|
|
72
|
-
className={cn('flex flex-col gap-1', className)}
|
|
73
|
-
data-slot="sidebar-menu"
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
67
|
+
<nav className={cn('flex flex-col gap-1', className)} data-slot="sidebar-menu" {...props} />
|
|
76
68
|
);
|
|
77
69
|
}
|
|
78
70
|
|
|
79
71
|
function SidebarMenuItem({ className, ...props }: SidebarMenuItemProps) {
|
|
80
|
-
return (
|
|
81
|
-
<li
|
|
82
|
-
className={cn('w-full', className)}
|
|
83
|
-
data-slot="sidebar-menu-item"
|
|
84
|
-
{...props}
|
|
85
|
-
/>
|
|
86
|
-
);
|
|
72
|
+
return <li className={cn('w-full', className)} data-slot="sidebar-menu-item" {...props} />;
|
|
87
73
|
}
|
|
88
74
|
|
|
89
|
-
function SidebarMenuLink({
|
|
90
|
-
children,
|
|
91
|
-
className,
|
|
92
|
-
...props
|
|
93
|
-
}: SidebarMenuLinkProps) {
|
|
75
|
+
function SidebarMenuLink({ children, className, ...props }: SidebarMenuLinkProps) {
|
|
94
76
|
return (
|
|
95
77
|
<a
|
|
96
78
|
className={cn(
|
|
@@ -9,11 +9,7 @@ type SpinnerProps = React.ComponentProps<typeof IconLoader2>;
|
|
|
9
9
|
* Announced as a loading status by default. Pass `aria-hidden` when visible
|
|
10
10
|
* text already says what is loading, and it becomes purely decorative.
|
|
11
11
|
*/
|
|
12
|
-
function Spinner({
|
|
13
|
-
'aria-hidden': ariaHidden,
|
|
14
|
-
className,
|
|
15
|
-
...props
|
|
16
|
-
}: SpinnerProps) {
|
|
12
|
+
function Spinner({ 'aria-hidden': ariaHidden, className, ...props }: SpinnerProps) {
|
|
17
13
|
const decorative = ariaHidden === true || ariaHidden === 'true';
|
|
18
14
|
|
|
19
15
|
return (
|
|
@@ -62,9 +62,7 @@ export const All: StoryDefinition = {
|
|
|
62
62
|
<Text variant="code">{deployment.branch}</Text>
|
|
63
63
|
</Table.Cell>
|
|
64
64
|
<Table.Cell>
|
|
65
|
-
<Badge variant={deployment.statusVariant}>
|
|
66
|
-
{deployment.status}
|
|
67
|
-
</Badge>
|
|
65
|
+
<Badge variant={deployment.statusVariant}>{deployment.status}</Badge>
|
|
68
66
|
</Table.Cell>
|
|
69
67
|
</Table.Row>
|
|
70
68
|
))}
|
package/src/components/Table.tsx
CHANGED
|
@@ -36,21 +36,14 @@ function TableCaption({ className, ...props }: TableCaptionProps) {
|
|
|
36
36
|
|
|
37
37
|
function TableCell({ className, ...props }: TableCellProps) {
|
|
38
38
|
return (
|
|
39
|
-
<td
|
|
40
|
-
className={cn('p-4 align-middle text-sm', className)}
|
|
41
|
-
data-slot="table-cell"
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
39
|
+
<td className={cn('p-4 align-middle text-sm', className)} data-slot="table-cell" {...props} />
|
|
44
40
|
);
|
|
45
41
|
}
|
|
46
42
|
|
|
47
43
|
function TableFooter({ className, ...props }: TableFooterProps) {
|
|
48
44
|
return (
|
|
49
45
|
<tfoot
|
|
50
|
-
className={cn(
|
|
51
|
-
'bg-muted/50 border-t font-medium [&>tr]:last:border-b-0',
|
|
52
|
-
className,
|
|
53
|
-
)}
|
|
46
|
+
className={cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className)}
|
|
54
47
|
data-slot="table-footer"
|
|
55
48
|
{...props}
|
|
56
49
|
/>
|
|
@@ -71,13 +64,7 @@ function TableHead({ className, ...props }: TableHeadProps) {
|
|
|
71
64
|
}
|
|
72
65
|
|
|
73
66
|
function TableHeader({ className, ...props }: TableHeaderProps) {
|
|
74
|
-
return (
|
|
75
|
-
<thead
|
|
76
|
-
className={cn('[&_tr]:border-b', className)}
|
|
77
|
-
data-slot="table-header"
|
|
78
|
-
{...props}
|
|
79
|
-
/>
|
|
80
|
-
);
|
|
67
|
+
return <thead className={cn('[&_tr]:border-b', className)} data-slot="table-header" {...props} />;
|
|
81
68
|
}
|
|
82
69
|
|
|
83
70
|
function TableRoot({
|
|
@@ -109,10 +96,7 @@ function TableRoot({
|
|
|
109
96
|
function TableRow({ className, ...props }: TableRowProps) {
|
|
110
97
|
return (
|
|
111
98
|
<tr
|
|
112
|
-
className={cn(
|
|
113
|
-
'border-border hover:bg-muted/30 border-b transition-none',
|
|
114
|
-
className,
|
|
115
|
-
)}
|
|
99
|
+
className={cn('border-border hover:bg-muted/30 border-b transition-none', className)}
|
|
116
100
|
data-slot="table-row"
|
|
117
101
|
{...props}
|
|
118
102
|
/>
|
|
@@ -129,16 +113,7 @@ const Table = Object.assign(TableRoot, {
|
|
|
129
113
|
Row: TableRow,
|
|
130
114
|
});
|
|
131
115
|
|
|
132
|
-
export {
|
|
133
|
-
Table,
|
|
134
|
-
TableBody,
|
|
135
|
-
TableCaption,
|
|
136
|
-
TableCell,
|
|
137
|
-
TableFooter,
|
|
138
|
-
TableHead,
|
|
139
|
-
TableHeader,
|
|
140
|
-
TableRow,
|
|
141
|
-
};
|
|
116
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
142
117
|
export type {
|
|
143
118
|
TableBodyProps,
|
|
144
119
|
TableCaptionProps,
|