@health-samurai/react-components 0.0.0-alpha.4 → 0.0.0-alpha.6
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/dist/bundle.css +1375 -484
- package/dist/src/components/code-editor/http/grammar/http.d.ts +3 -0
- package/dist/src/components/code-editor/http/grammar/http.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.grammar +74 -0
- package/dist/src/components/code-editor/http/grammar/http.js +38 -0
- package/dist/src/components/code-editor/http/grammar/http.js.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.d.ts +2 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.js +4 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.js.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.test.d.ts +2 -0
- package/dist/src/components/code-editor/http/grammar/http.test.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.test.js +80 -0
- package/dist/src/components/code-editor/http/grammar/http.test.js.map +1 -0
- package/dist/src/components/code-editor/http/index.d.ts +4 -0
- package/dist/src/components/code-editor/http/index.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/index.js +66 -0
- package/dist/src/components/code-editor/http/index.js.map +1 -0
- package/dist/src/components/code-editor/index.d.ts +14 -2
- package/dist/src/components/code-editor/index.d.ts.map +1 -1
- package/dist/src/components/code-editor/index.js +309 -20
- package/dist/src/components/code-editor/index.js.map +1 -1
- package/dist/src/components/code-editor.stories.d.ts +1 -0
- package/dist/src/components/code-editor.stories.d.ts.map +1 -1
- package/dist/src/components/code-editor.stories.js +255 -2
- package/dist/src/components/code-editor.stories.js.map +1 -1
- package/dist/src/components/copy-icon.d.ts +5 -1
- package/dist/src/components/copy-icon.d.ts.map +1 -1
- package/dist/src/components/copy-icon.js +41 -3
- package/dist/src/components/copy-icon.js.map +1 -1
- package/dist/src/components/data-table.d.ts +8 -0
- package/dist/src/components/data-table.d.ts.map +1 -0
- package/dist/src/components/data-table.js +65 -0
- package/dist/src/components/data-table.js.map +1 -0
- package/dist/src/components/data-table.stories.d.ts +7 -0
- package/dist/src/components/data-table.stories.d.ts.map +1 -0
- package/dist/src/components/data-table.stories.js +44 -0
- package/dist/src/components/data-table.stories.js.map +1 -0
- package/dist/src/components/fhir-structure-view.d.ts +34 -0
- package/dist/src/components/fhir-structure-view.d.ts.map +1 -0
- package/dist/src/components/fhir-structure-view.js +229 -0
- package/dist/src/components/fhir-structure-view.js.map +1 -0
- package/dist/src/components/fhir-structure-view.stories.d.ts +7 -0
- package/dist/src/components/fhir-structure-view.stories.d.ts.map +1 -0
- package/dist/src/components/fhir-structure-view.stories.js +447 -0
- package/dist/src/components/fhir-structure-view.stories.js.map +1 -0
- package/dist/src/components/patient-table.d.ts +73 -0
- package/dist/src/components/patient-table.d.ts.map +1 -0
- package/dist/src/components/patient-table.js +921 -0
- package/dist/src/components/patient-table.js.map +1 -0
- package/dist/src/components/patient-table.stories.d.ts +111 -0
- package/dist/src/components/patient-table.stories.d.ts.map +1 -0
- package/dist/src/components/patient-table.stories.js +172 -0
- package/dist/src/components/patient-table.stories.js.map +1 -0
- package/dist/src/components/request-line-editor.d.ts +13 -35
- package/dist/src/components/request-line-editor.d.ts.map +1 -1
- package/dist/src/components/request-line-editor.js +72 -49
- package/dist/src/components/request-line-editor.js.map +1 -1
- package/dist/src/components/request-line-editor.stories.d.ts.map +1 -1
- package/dist/src/components/request-line-editor.stories.js +17 -53
- package/dist/src/components/request-line-editor.stories.js.map +1 -1
- package/dist/src/components/segment-control.d.ts +16 -0
- package/dist/src/components/segment-control.d.ts.map +1 -0
- package/dist/src/components/segment-control.js +48 -0
- package/dist/src/components/segment-control.js.map +1 -0
- package/dist/src/components/segment-control.stories.d.ts +15 -0
- package/dist/src/components/segment-control.stories.d.ts.map +1 -0
- package/dist/src/components/segment-control.stories.js +33 -0
- package/dist/src/components/segment-control.stories.js.map +1 -0
- package/dist/src/components/split-button.d.ts +5 -0
- package/dist/src/components/split-button.d.ts.map +1 -0
- package/dist/src/components/split-button.js +12 -0
- package/dist/src/components/split-button.js.map +1 -0
- package/dist/src/components/split-button.stories.d.ts +7 -0
- package/dist/src/components/split-button.stories.d.ts.map +1 -0
- package/dist/src/components/split-button.stories.js +57 -0
- package/dist/src/components/split-button.stories.js.map +1 -0
- package/dist/src/components/tree-view.d.ts +22 -0
- package/dist/src/components/tree-view.d.ts.map +1 -0
- package/dist/src/components/tree-view.js +101 -0
- package/dist/src/components/tree-view.js.map +1 -0
- package/dist/src/components/tree-view.stories.d.ts +13 -0
- package/dist/src/components/tree-view.stories.d.ts.map +1 -0
- package/dist/src/components/tree-view.stories.js +274 -0
- package/dist/src/components/tree-view.stories.js.map +1 -0
- package/dist/src/icons.d.ts +9 -0
- package/dist/src/icons.d.ts.map +1 -0
- package/dist/src/icons.js +279 -0
- package/dist/src/icons.js.map +1 -0
- package/dist/src/index.css +42 -3
- package/dist/src/index.d.ts +9 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.js +23 -5
- package/dist/src/shadcn/components/ui/accordion.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.d.ts +3 -1
- package/dist/src/shadcn/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.js +5 -2
- package/dist/src/shadcn/components/ui/alert-dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/alert.js +12 -5
- package/dist/src/shadcn/components/ui/alert.js.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.js +4 -3
- package/dist/src/shadcn/components/ui/avatar.js.map +1 -1
- package/dist/src/shadcn/components/ui/badge.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/badge.js +16 -5
- package/dist/src/shadcn/components/ui/badge.js.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.js +6 -6
- package/dist/src/shadcn/components/ui/breadcrumb.js.map +1 -1
- package/dist/src/shadcn/components/ui/button.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/button.js +19 -11
- package/dist/src/shadcn/components/ui/button.js.map +1 -1
- package/dist/src/shadcn/components/ui/card.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/card.js +14 -6
- package/dist/src/shadcn/components/ui/card.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.js +20 -5
- package/dist/src/shadcn/components/ui/checkbox.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.stories.js +44 -35
- package/dist/src/shadcn/components/ui/checkbox.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/combobox.d.ts +18 -0
- package/dist/src/shadcn/components/ui/combobox.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/combobox.js +121 -0
- package/dist/src/shadcn/components/ui/combobox.js.map +1 -0
- package/dist/src/shadcn/components/ui/combobox.stories.d.ts +11 -0
- package/dist/src/shadcn/components/ui/combobox.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/combobox.stories.js +16 -0
- package/dist/src/shadcn/components/ui/combobox.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/command.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/command.js +73 -12
- package/dist/src/shadcn/components/ui/command.js.map +1 -1
- package/dist/src/shadcn/components/ui/command.stories.js +0 -1
- package/dist/src/shadcn/components/ui/command.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.js +35 -7
- package/dist/src/shadcn/components/ui/dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.js +26 -5
- package/dist/src/shadcn/components/ui/drawer.js.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.js +12 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/form.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/form.js +12 -4
- package/dist/src/shadcn/components/ui/form.js.map +1 -1
- package/dist/src/shadcn/components/ui/input.d.ts +3 -1
- package/dist/src/shadcn/components/ui/input.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/input.js +126 -17
- package/dist/src/shadcn/components/ui/input.js.map +1 -1
- package/dist/src/shadcn/components/ui/label.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/label.js +8 -1
- package/dist/src/shadcn/components/ui/label.js.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.js +35 -13
- package/dist/src/shadcn/components/ui/menubar.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.js +6 -6
- package/dist/src/shadcn/components/ui/pagination.js.map +1 -1
- package/dist/src/shadcn/components/ui/popover.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/popover.js +12 -1
- package/dist/src/shadcn/components/ui/popover.js.map +1 -1
- package/dist/src/shadcn/components/ui/progress.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/progress.js +6 -2
- package/dist/src/shadcn/components/ui/progress.js.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.js +11 -6
- package/dist/src/shadcn/components/ui/radio-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.stories.js +57 -34
- package/dist/src/shadcn/components/ui/radio-group.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.js +9 -3
- package/dist/src/shadcn/components/ui/scroll-area.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/select.js +49 -14
- package/dist/src/shadcn/components/ui/select.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/select.stories.js +1 -4
- package/dist/src/shadcn/components/ui/select.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/separator.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/separator.js +7 -1
- package/dist/src/shadcn/components/ui/separator.js.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.js +20 -6
- package/dist/src/shadcn/components/ui/sidebar.js.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.js +3 -1
- package/dist/src/shadcn/components/ui/skeleton.js.map +1 -1
- package/dist/src/shadcn/components/ui/slider.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/slider.js +34 -4
- package/dist/src/shadcn/components/ui/slider.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.d.ts +16 -1
- package/dist/src/shadcn/components/ui/sonner.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.js +23 -3
- package/dist/src/shadcn/components/ui/sonner.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.stories.js +19 -11
- package/dist/src/shadcn/components/ui/sonner.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/switch.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/switch.js +18 -2
- package/dist/src/shadcn/components/ui/switch.js.map +1 -1
- package/dist/src/shadcn/components/ui/table.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/table.js +12 -8
- package/dist/src/shadcn/components/ui/table.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.d.ts +21 -3
- package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.js +315 -9
- package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.stories.js +50 -1
- package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.js +15 -1
- package/dist/src/shadcn/components/ui/textarea.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.js +6 -2
- package/dist/src/shadcn/components/ui/toggle-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.js +18 -6
- package/dist/src/shadcn/components/ui/toggle.js.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.js +11 -1
- package/dist/src/shadcn/components/ui/tooltip.js.map +1 -1
- package/dist/src/shadcn/components/ui/tree.d.ts +28 -0
- package/dist/src/shadcn/components/ui/tree.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/tree.js +122 -0
- package/dist/src/shadcn/components/ui/tree.js.map +1 -0
- package/dist/src/typography.css +12 -0
- package/package.json +13 -2
- package/src/components/code-editor/http/grammar/http.grammar +74 -0
- package/src/components/code-editor/http/grammar/http.terms.ts +9 -0
- package/src/components/code-editor/http/grammar/http.test.ts +110 -0
- package/src/components/code-editor/http/grammar/http.ts +21 -0
- package/src/components/code-editor/http/index.ts +87 -0
- package/src/components/code-editor/index.tsx +307 -21
- package/src/components/code-editor.stories.tsx +295 -1
- package/src/components/copy-icon.tsx +57 -3
- package/src/components/data-table.stories.tsx +38 -0
- package/src/components/data-table.tsx +117 -0
- package/src/components/fhir-structure-view.stories.tsx +439 -0
- package/src/components/fhir-structure-view.tsx +231 -0
- package/src/components/patient-table.stories.tsx +111 -0
- package/src/components/patient-table.tsx +1301 -0
- package/src/components/request-line-editor.stories.tsx +17 -27
- package/src/components/request-line-editor.tsx +98 -61
- package/src/components/segment-control.stories.tsx +29 -0
- package/src/components/segment-control.tsx +80 -0
- package/src/components/split-button.stories.tsx +49 -0
- package/src/components/split-button.tsx +17 -0
- package/src/components/tree-view.stories.tsx +259 -0
- package/src/components/tree-view.tsx +172 -0
- package/src/icons.tsx +287 -0
- package/src/index.css +42 -3
- package/src/index.tsx +9 -2
- package/src/shadcn/components/ui/accordion.tsx +66 -8
- package/src/shadcn/components/ui/alert-dialog.tsx +6 -2
- package/src/shadcn/components/ui/alert.tsx +53 -15
- package/src/shadcn/components/ui/avatar.tsx +17 -6
- package/src/shadcn/components/ui/badge.tsx +67 -18
- package/src/shadcn/components/ui/breadcrumb.tsx +35 -7
- package/src/shadcn/components/ui/button.tsx +118 -57
- package/src/shadcn/components/ui/card.tsx +44 -13
- package/src/shadcn/components/ui/checkbox.stories.tsx +20 -24
- package/src/shadcn/components/ui/checkbox.tsx +45 -4
- package/src/shadcn/components/ui/combobox.stories.tsx +19 -0
- package/src/shadcn/components/ui/combobox.tsx +142 -0
- package/src/shadcn/components/ui/command.stories.tsx +1 -1
- package/src/shadcn/components/ui/command.tsx +192 -36
- package/src/shadcn/components/ui/dialog.tsx +101 -13
- package/src/shadcn/components/ui/drawer.tsx +93 -18
- package/src/shadcn/components/ui/dropdown-menu.tsx +37 -9
- package/src/shadcn/components/ui/form.tsx +16 -4
- package/src/shadcn/components/ui/input.tsx +400 -29
- package/src/shadcn/components/ui/label.tsx +21 -4
- package/src/shadcn/components/ui/menubar.tsx +188 -43
- package/src/shadcn/components/ui/pagination.tsx +12 -6
- package/src/shadcn/components/ui/popover.tsx +35 -4
- package/src/shadcn/components/ui/progress.tsx +21 -5
- package/src/shadcn/components/ui/radio-group.stories.tsx +22 -14
- package/src/shadcn/components/ui/radio-group.tsx +42 -5
- package/src/shadcn/components/ui/scroll-area.tsx +33 -5
- package/src/shadcn/components/ui/select.stories.tsx +0 -2
- package/src/shadcn/components/ui/select.tsx +184 -33
- package/src/shadcn/components/ui/separator.tsx +15 -5
- package/src/shadcn/components/ui/sidebar.tsx +68 -26
- package/src/shadcn/components/ui/skeleton.tsx +4 -1
- package/src/shadcn/components/ui/slider.tsx +82 -11
- package/src/shadcn/components/ui/sonner.stories.tsx +19 -15
- package/src/shadcn/components/ui/sonner.tsx +53 -3
- package/src/shadcn/components/ui/switch.tsx +53 -7
- package/src/shadcn/components/ui/table.tsx +38 -11
- package/src/shadcn/components/ui/tabs.stories.tsx +32 -0
- package/src/shadcn/components/ui/tabs.tsx +456 -17
- package/src/shadcn/components/ui/textarea.tsx +42 -4
- package/src/shadcn/components/ui/toggle-group.tsx +27 -5
- package/src/shadcn/components/ui/toggle.tsx +59 -18
- package/src/shadcn/components/ui/tooltip.tsx +33 -8
- package/src/shadcn/components/ui/tree.tsx +233 -0
- package/src/typography.css +12 -0
|
@@ -4,6 +4,181 @@ import type * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
+
// Menubar styles
|
|
8
|
+
const menubarStyles = cn(
|
|
9
|
+
"bg-background",
|
|
10
|
+
"flex",
|
|
11
|
+
"h-9",
|
|
12
|
+
"items-center",
|
|
13
|
+
"gap-1",
|
|
14
|
+
"rounded-md",
|
|
15
|
+
"border",
|
|
16
|
+
"p-1",
|
|
17
|
+
"shadow-xs",
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// Menubar trigger styles
|
|
21
|
+
const menubarTriggerStyles = cn(
|
|
22
|
+
"focus:bg-accent",
|
|
23
|
+
"focus:text-accent-foreground",
|
|
24
|
+
"data-[state=open]:bg-accent",
|
|
25
|
+
"data-[state=open]:text-accent-foreground",
|
|
26
|
+
"flex",
|
|
27
|
+
"items-center",
|
|
28
|
+
"rounded-sm",
|
|
29
|
+
"px-2",
|
|
30
|
+
"py-1",
|
|
31
|
+
"text-sm",
|
|
32
|
+
"font-medium",
|
|
33
|
+
"outline-hidden",
|
|
34
|
+
"select-none",
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
// Menubar content styles
|
|
38
|
+
const menubarContentStyles = cn(
|
|
39
|
+
"bg-popover",
|
|
40
|
+
"text-popover-foreground",
|
|
41
|
+
"data-[state=open]:animate-in",
|
|
42
|
+
"data-[state=closed]:fade-out-0",
|
|
43
|
+
"data-[state=open]:fade-in-0",
|
|
44
|
+
"data-[state=closed]:zoom-out-95",
|
|
45
|
+
"data-[state=open]:zoom-in-95",
|
|
46
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
47
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
48
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
49
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
50
|
+
"z-50",
|
|
51
|
+
"min-w-[12rem]",
|
|
52
|
+
"origin-(--radix-menubar-content-transform-origin)",
|
|
53
|
+
"overflow-hidden",
|
|
54
|
+
"rounded-md",
|
|
55
|
+
"border",
|
|
56
|
+
"p-1",
|
|
57
|
+
"shadow-md",
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
// Menubar item styles
|
|
61
|
+
const menubarItemStyles = cn(
|
|
62
|
+
"focus:bg-accent",
|
|
63
|
+
"focus:text-accent-foreground",
|
|
64
|
+
"data-[variant=destructive]:text-destructive",
|
|
65
|
+
"data-[variant=destructive]:focus:bg-destructive/10",
|
|
66
|
+
"dark:data-[variant=destructive]:focus:bg-destructive/20",
|
|
67
|
+
"data-[variant=destructive]:focus:text-destructive",
|
|
68
|
+
"data-[variant=destructive]:*:[svg]:!text-destructive",
|
|
69
|
+
"[&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
70
|
+
"relative",
|
|
71
|
+
"flex",
|
|
72
|
+
"cursor-default",
|
|
73
|
+
"items-center",
|
|
74
|
+
"gap-2",
|
|
75
|
+
"rounded-sm",
|
|
76
|
+
"px-2",
|
|
77
|
+
"py-1.5",
|
|
78
|
+
"text-sm",
|
|
79
|
+
"outline-hidden",
|
|
80
|
+
"select-none",
|
|
81
|
+
"data-[disabled]:pointer-events-none",
|
|
82
|
+
"data-[disabled]:opacity-50",
|
|
83
|
+
"data-[inset]:pl-8",
|
|
84
|
+
"[&_svg]:pointer-events-none",
|
|
85
|
+
"[&_svg]:shrink-0",
|
|
86
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
// Menubar checkbox/radio item styles
|
|
90
|
+
const menubarCheckboxRadioItemStyles = cn(
|
|
91
|
+
"focus:bg-accent",
|
|
92
|
+
"focus:text-accent-foreground",
|
|
93
|
+
"relative",
|
|
94
|
+
"flex",
|
|
95
|
+
"cursor-default",
|
|
96
|
+
"items-center",
|
|
97
|
+
"gap-2",
|
|
98
|
+
"rounded-xs",
|
|
99
|
+
"py-1.5",
|
|
100
|
+
"pr-2",
|
|
101
|
+
"pl-8",
|
|
102
|
+
"text-sm",
|
|
103
|
+
"outline-hidden",
|
|
104
|
+
"select-none",
|
|
105
|
+
"data-[disabled]:pointer-events-none",
|
|
106
|
+
"data-[disabled]:opacity-50",
|
|
107
|
+
"[&_svg]:pointer-events-none",
|
|
108
|
+
"[&_svg]:shrink-0",
|
|
109
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
// Menubar indicator styles
|
|
113
|
+
const menubarIndicatorStyles = cn(
|
|
114
|
+
"pointer-events-none",
|
|
115
|
+
"absolute",
|
|
116
|
+
"left-2",
|
|
117
|
+
"flex",
|
|
118
|
+
"size-3.5",
|
|
119
|
+
"items-center",
|
|
120
|
+
"justify-center",
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
// Menubar label styles
|
|
124
|
+
const menubarLabelStyles = cn(
|
|
125
|
+
"px-2",
|
|
126
|
+
"py-1.5",
|
|
127
|
+
"text-sm",
|
|
128
|
+
"font-medium",
|
|
129
|
+
"data-[inset]:pl-8",
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
// Menubar separator styles
|
|
133
|
+
const menubarSeparatorStyles = cn("bg-border", "-mx-1", "my-1", "h-px");
|
|
134
|
+
|
|
135
|
+
// Menubar shortcut styles
|
|
136
|
+
const menubarShortcutStyles = cn(
|
|
137
|
+
"text-muted-foreground",
|
|
138
|
+
"ml-auto",
|
|
139
|
+
"text-xs",
|
|
140
|
+
"tracking-widest",
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
// Menubar sub trigger styles
|
|
144
|
+
const menubarSubTriggerStyles = cn(
|
|
145
|
+
"focus:bg-(--color-surface-1)",
|
|
146
|
+
"data-[state=open]:bg-(--color-surface-1)",
|
|
147
|
+
"flex",
|
|
148
|
+
"items-center",
|
|
149
|
+
"rounded-sm",
|
|
150
|
+
"px-2",
|
|
151
|
+
"py-1",
|
|
152
|
+
"text-sm",
|
|
153
|
+
"font-medium",
|
|
154
|
+
"outline-hidden",
|
|
155
|
+
"select-none",
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
// Menubar sub content styles
|
|
159
|
+
const menubarSubContentStyles = cn(
|
|
160
|
+
"bg-popover",
|
|
161
|
+
"text-popover-foreground",
|
|
162
|
+
"data-[state=open]:animate-in",
|
|
163
|
+
"data-[state=closed]:animate-out",
|
|
164
|
+
"data-[state=closed]:fade-out-0",
|
|
165
|
+
"data-[state=open]:fade-in-0",
|
|
166
|
+
"data-[state=closed]:zoom-out-95",
|
|
167
|
+
"data-[state=open]:zoom-in-95",
|
|
168
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
169
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
170
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
171
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
172
|
+
"z-50",
|
|
173
|
+
"min-w-[8rem]",
|
|
174
|
+
"origin-(--radix-menubar-content-transform-origin)",
|
|
175
|
+
"overflow-hidden",
|
|
176
|
+
"rounded-md",
|
|
177
|
+
"border",
|
|
178
|
+
"p-1",
|
|
179
|
+
"shadow-lg",
|
|
180
|
+
);
|
|
181
|
+
|
|
7
182
|
function Menubar({
|
|
8
183
|
className,
|
|
9
184
|
...props
|
|
@@ -11,10 +186,7 @@ function Menubar({
|
|
|
11
186
|
return (
|
|
12
187
|
<MenubarPrimitive.Root
|
|
13
188
|
data-slot="menubar"
|
|
14
|
-
className={cn(
|
|
15
|
-
"bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",
|
|
16
|
-
className,
|
|
17
|
-
)}
|
|
189
|
+
className={cn(menubarStyles, className)}
|
|
18
190
|
{...props}
|
|
19
191
|
/>
|
|
20
192
|
);
|
|
@@ -53,10 +225,7 @@ function MenubarTrigger({
|
|
|
53
225
|
return (
|
|
54
226
|
<MenubarPrimitive.Trigger
|
|
55
227
|
data-slot="menubar-trigger"
|
|
56
|
-
className={cn(
|
|
57
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",
|
|
58
|
-
className,
|
|
59
|
-
)}
|
|
228
|
+
className={cn(menubarTriggerStyles, className)}
|
|
60
229
|
{...props}
|
|
61
230
|
/>
|
|
62
231
|
);
|
|
@@ -76,10 +245,7 @@ function MenubarContent({
|
|
|
76
245
|
align={align}
|
|
77
246
|
alignOffset={alignOffset}
|
|
78
247
|
sideOffset={sideOffset}
|
|
79
|
-
className={cn(
|
|
80
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",
|
|
81
|
-
className,
|
|
82
|
-
)}
|
|
248
|
+
className={cn(menubarContentStyles, className)}
|
|
83
249
|
{...props}
|
|
84
250
|
/>
|
|
85
251
|
</MenubarPortal>
|
|
@@ -100,10 +266,7 @@ function MenubarItem({
|
|
|
100
266
|
data-slot="menubar-item"
|
|
101
267
|
data-inset={inset}
|
|
102
268
|
data-variant={variant}
|
|
103
|
-
className={cn(
|
|
104
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
105
|
-
className,
|
|
106
|
-
)}
|
|
269
|
+
className={cn(menubarItemStyles, className)}
|
|
107
270
|
{...props}
|
|
108
271
|
/>
|
|
109
272
|
);
|
|
@@ -117,13 +280,10 @@ function MenubarCheckboxItem({
|
|
|
117
280
|
return (
|
|
118
281
|
<MenubarPrimitive.CheckboxItem
|
|
119
282
|
data-slot="menubar-checkbox-item"
|
|
120
|
-
className={cn(
|
|
121
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
122
|
-
className,
|
|
123
|
-
)}
|
|
283
|
+
className={cn(menubarCheckboxRadioItemStyles, className)}
|
|
124
284
|
{...props}
|
|
125
285
|
>
|
|
126
|
-
<span className=
|
|
286
|
+
<span className={menubarIndicatorStyles}>
|
|
127
287
|
<MenubarPrimitive.ItemIndicator>
|
|
128
288
|
<CheckIcon className="size-4" />
|
|
129
289
|
</MenubarPrimitive.ItemIndicator>
|
|
@@ -141,13 +301,10 @@ function MenubarRadioItem({
|
|
|
141
301
|
return (
|
|
142
302
|
<MenubarPrimitive.RadioItem
|
|
143
303
|
data-slot="menubar-radio-item"
|
|
144
|
-
className={cn(
|
|
145
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
146
|
-
className,
|
|
147
|
-
)}
|
|
304
|
+
className={cn(menubarCheckboxRadioItemStyles, className)}
|
|
148
305
|
{...props}
|
|
149
306
|
>
|
|
150
|
-
<span className=
|
|
307
|
+
<span className={menubarIndicatorStyles}>
|
|
151
308
|
<MenubarPrimitive.ItemIndicator>
|
|
152
309
|
<CircleIcon className="size-2 fill-current" />
|
|
153
310
|
</MenubarPrimitive.ItemIndicator>
|
|
@@ -168,10 +325,7 @@ function MenubarLabel({
|
|
|
168
325
|
<MenubarPrimitive.Label
|
|
169
326
|
data-slot="menubar-label"
|
|
170
327
|
data-inset={inset}
|
|
171
|
-
className={cn(
|
|
172
|
-
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
173
|
-
className,
|
|
174
|
-
)}
|
|
328
|
+
className={cn(menubarLabelStyles, className)}
|
|
175
329
|
{...props}
|
|
176
330
|
/>
|
|
177
331
|
);
|
|
@@ -184,7 +338,7 @@ function MenubarSeparator({
|
|
|
184
338
|
return (
|
|
185
339
|
<MenubarPrimitive.Separator
|
|
186
340
|
data-slot="menubar-separator"
|
|
187
|
-
className={cn(
|
|
341
|
+
className={cn(menubarSeparatorStyles, className)}
|
|
188
342
|
{...props}
|
|
189
343
|
/>
|
|
190
344
|
);
|
|
@@ -197,10 +351,7 @@ function MenubarShortcut({
|
|
|
197
351
|
return (
|
|
198
352
|
<span
|
|
199
353
|
data-slot="menubar-shortcut"
|
|
200
|
-
className={cn(
|
|
201
|
-
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
202
|
-
className,
|
|
203
|
-
)}
|
|
354
|
+
className={cn(menubarShortcutStyles, className)}
|
|
204
355
|
{...props}
|
|
205
356
|
/>
|
|
206
357
|
);
|
|
@@ -224,10 +375,7 @@ function MenubarSubTrigger({
|
|
|
224
375
|
<MenubarPrimitive.SubTrigger
|
|
225
376
|
data-slot="menubar-sub-trigger"
|
|
226
377
|
data-inset={inset}
|
|
227
|
-
className={cn(
|
|
228
|
-
"focus:bg-(--color-surface-1) data-[state=open]:bg-(--color-surface-1) flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",
|
|
229
|
-
className,
|
|
230
|
-
)}
|
|
378
|
+
className={cn(menubarSubTriggerStyles, className)}
|
|
231
379
|
{...props}
|
|
232
380
|
>
|
|
233
381
|
{children}
|
|
@@ -243,10 +391,7 @@ function MenubarSubContent({
|
|
|
243
391
|
return (
|
|
244
392
|
<MenubarPrimitive.SubContent
|
|
245
393
|
data-slot="menubar-sub-content"
|
|
246
|
-
className={cn(
|
|
247
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
248
|
-
className,
|
|
249
|
-
)}
|
|
394
|
+
className={cn(menubarSubContentStyles, className)}
|
|
250
395
|
{...props}
|
|
251
396
|
/>
|
|
252
397
|
);
|
|
@@ -15,7 +15,7 @@ function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
|
|
|
15
15
|
role="navigation"
|
|
16
16
|
aria-label="pagination"
|
|
17
17
|
data-slot="pagination"
|
|
18
|
-
className={cn("mx-auto flex w-full justify-center", className)}
|
|
18
|
+
className={cn("mx-auto", "flex", "w-full", "justify-center", className)}
|
|
19
19
|
{...props}
|
|
20
20
|
/>
|
|
21
21
|
);
|
|
@@ -28,7 +28,7 @@ function PaginationContent({
|
|
|
28
28
|
return (
|
|
29
29
|
<ul
|
|
30
30
|
data-slot="pagination-content"
|
|
31
|
-
className={cn("flex flex-row items-center gap-1", className)}
|
|
31
|
+
className={cn("flex", "flex-row", "items-center", "gap-1", className)}
|
|
32
32
|
{...props}
|
|
33
33
|
/>
|
|
34
34
|
);
|
|
@@ -37,7 +37,7 @@ function PaginationContent({
|
|
|
37
37
|
function PaginationItem({ ...props }: React.ComponentProps<"li">) {
|
|
38
38
|
return (
|
|
39
39
|
<li
|
|
40
|
-
className="hover:bg-
|
|
40
|
+
className={cn("hover:bg-bg-secondary", "rounded-md")}
|
|
41
41
|
data-slot="pagination-item"
|
|
42
42
|
{...props}
|
|
43
43
|
/>
|
|
@@ -80,7 +80,7 @@ function PaginationPrevious({
|
|
|
80
80
|
<PaginationLink
|
|
81
81
|
aria-label="Go to previous page"
|
|
82
82
|
size="small"
|
|
83
|
-
className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
|
|
83
|
+
className={cn("gap-1", "px-2.5", "sm:pl-2.5", className)}
|
|
84
84
|
{...props}
|
|
85
85
|
>
|
|
86
86
|
<ChevronLeftIcon />
|
|
@@ -97,7 +97,7 @@ function PaginationNext({
|
|
|
97
97
|
<PaginationLink
|
|
98
98
|
aria-label="Go to next page"
|
|
99
99
|
size="regular"
|
|
100
|
-
className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
|
|
100
|
+
className={cn("gap-1", "px-2.5", "sm:pr-2.5", className)}
|
|
101
101
|
{...props}
|
|
102
102
|
>
|
|
103
103
|
<span className="hidden sm:block">Next</span>
|
|
@@ -114,7 +114,13 @@ function PaginationEllipsis({
|
|
|
114
114
|
<span
|
|
115
115
|
aria-hidden
|
|
116
116
|
data-slot="pagination-ellipsis"
|
|
117
|
-
className={cn(
|
|
117
|
+
className={cn(
|
|
118
|
+
"flex",
|
|
119
|
+
"size-9",
|
|
120
|
+
"items-center",
|
|
121
|
+
"justify-center",
|
|
122
|
+
className,
|
|
123
|
+
)}
|
|
118
124
|
{...props}
|
|
119
125
|
>
|
|
120
126
|
<MoreHorizontalIcon className="size-4" />
|
|
@@ -4,6 +4,40 @@ import type * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
+
// Popover content styles
|
|
8
|
+
const popoverContentStyles = cn(
|
|
9
|
+
// Layout
|
|
10
|
+
"z-50",
|
|
11
|
+
"w-72",
|
|
12
|
+
"origin-(--radix-popover-content-transform-origin)",
|
|
13
|
+
"outline-hidden",
|
|
14
|
+
// Shape
|
|
15
|
+
"rounded-md",
|
|
16
|
+
// Borders
|
|
17
|
+
"border",
|
|
18
|
+
"border-border-primary",
|
|
19
|
+
// Background & Colors
|
|
20
|
+
"bg-bg-primary",
|
|
21
|
+
"text-text-primary",
|
|
22
|
+
// Spacing
|
|
23
|
+
"p-4",
|
|
24
|
+
// Shadow
|
|
25
|
+
"shadow-md",
|
|
26
|
+
// Animations - open
|
|
27
|
+
"data-[state=open]:animate-in",
|
|
28
|
+
"data-[state=open]:fade-in-0",
|
|
29
|
+
"data-[state=open]:zoom-in-95",
|
|
30
|
+
// Animations - closed
|
|
31
|
+
"data-[state=closed]:animate-out",
|
|
32
|
+
"data-[state=closed]:fade-out-0",
|
|
33
|
+
"data-[state=closed]:zoom-out-95",
|
|
34
|
+
// Slide animations
|
|
35
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
36
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
37
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
38
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
39
|
+
);
|
|
40
|
+
|
|
7
41
|
function Popover({
|
|
8
42
|
...props
|
|
9
43
|
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
@@ -28,10 +62,7 @@ function PopoverContent({
|
|
|
28
62
|
data-slot="popover-content"
|
|
29
63
|
align={align}
|
|
30
64
|
sideOffset={sideOffset}
|
|
31
|
-
className={cn(
|
|
32
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
33
|
-
className,
|
|
34
|
-
)}
|
|
65
|
+
className={cn(popoverContentStyles, className)}
|
|
35
66
|
{...props}
|
|
36
67
|
/>
|
|
37
68
|
</PopoverPrimitive.Portal>
|
|
@@ -3,6 +3,25 @@ import type * as React from "react";
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "#shadcn/lib/utils";
|
|
5
5
|
|
|
6
|
+
// Progress root styles
|
|
7
|
+
const progressRootStyles = cn(
|
|
8
|
+
"relative",
|
|
9
|
+
"h-2",
|
|
10
|
+
"w-full",
|
|
11
|
+
"overflow-hidden",
|
|
12
|
+
"rounded-full",
|
|
13
|
+
"bg-bg-quaternary",
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
// Progress indicator styles
|
|
17
|
+
const progressIndicatorStyles = cn(
|
|
18
|
+
"bg-bg-link",
|
|
19
|
+
"h-full",
|
|
20
|
+
"w-full",
|
|
21
|
+
"flex-1",
|
|
22
|
+
"transition-all",
|
|
23
|
+
);
|
|
24
|
+
|
|
6
25
|
function Progress({
|
|
7
26
|
className,
|
|
8
27
|
value,
|
|
@@ -11,15 +30,12 @@ function Progress({
|
|
|
11
30
|
return (
|
|
12
31
|
<ProgressPrimitive.Root
|
|
13
32
|
data-slot="progress"
|
|
14
|
-
className={cn(
|
|
15
|
-
"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
|
|
16
|
-
className,
|
|
17
|
-
)}
|
|
33
|
+
className={cn(progressRootStyles, className)}
|
|
18
34
|
{...props}
|
|
19
35
|
>
|
|
20
36
|
<ProgressPrimitive.Indicator
|
|
21
37
|
data-slot="progress-indicator"
|
|
22
|
-
className=
|
|
38
|
+
className={progressIndicatorStyles}
|
|
23
39
|
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
24
40
|
/>
|
|
25
41
|
</ProgressPrimitive.Root>
|
|
@@ -11,19 +11,27 @@ type Story = StoryObj<typeof meta>;
|
|
|
11
11
|
|
|
12
12
|
export const Demo = {
|
|
13
13
|
render: () => (
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
<div className="space-y-6">
|
|
15
|
+
<RadioGroup defaultValue="checked">
|
|
16
|
+
<div className="flex items-center gap-3">
|
|
17
|
+
<RadioGroupItem value="default" id="r1" />
|
|
18
|
+
<Label htmlFor="r1">Default</Label>
|
|
19
|
+
</div>
|
|
20
|
+
<div className="flex items-center gap-3">
|
|
21
|
+
<RadioGroupItem value="checked" id="r2" />
|
|
22
|
+
<Label htmlFor="r2">Checked</Label>
|
|
23
|
+
</div>
|
|
24
|
+
<div className="flex items-center gap-3">
|
|
25
|
+
<RadioGroupItem value="disabled" id="r3" disabled />
|
|
26
|
+
<Label htmlFor="r3">Disabled</Label>
|
|
27
|
+
</div>
|
|
28
|
+
</RadioGroup>
|
|
29
|
+
<RadioGroup defaultValue="disabled-checked">
|
|
30
|
+
<div className="flex items-center gap-3">
|
|
31
|
+
<RadioGroupItem value="disabled-checked" id="r4" disabled />
|
|
32
|
+
<Label htmlFor="r4">Disabled Checked</Label>
|
|
33
|
+
</div>
|
|
34
|
+
</RadioGroup>
|
|
35
|
+
</div>
|
|
28
36
|
),
|
|
29
37
|
} satisfies Story;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
|
-
import { CircleIcon } from "lucide-react";
|
|
4
3
|
import type * as React from "react";
|
|
5
4
|
|
|
6
5
|
import { cn } from "#shadcn/lib/utils";
|
|
@@ -12,7 +11,7 @@ function RadioGroup({
|
|
|
12
11
|
return (
|
|
13
12
|
<RadioGroupPrimitive.Root
|
|
14
13
|
data-slot="radio-group"
|
|
15
|
-
className={cn("grid gap-3", className)}
|
|
14
|
+
className={cn("grid", "gap-3", className)}
|
|
16
15
|
{...props}
|
|
17
16
|
/>
|
|
18
17
|
);
|
|
@@ -26,16 +25,54 @@ function RadioGroupItem({
|
|
|
26
25
|
<RadioGroupPrimitive.Item
|
|
27
26
|
data-slot="radio-group-item"
|
|
28
27
|
className={cn(
|
|
29
|
-
|
|
28
|
+
// Base styles
|
|
29
|
+
"aspect-square",
|
|
30
|
+
"size-4",
|
|
31
|
+
"shrink-0",
|
|
32
|
+
"rounded-full",
|
|
33
|
+
"overflow-hidden",
|
|
34
|
+
"relative",
|
|
35
|
+
"outline-none",
|
|
36
|
+
"cursor-pointer",
|
|
37
|
+
// Animations
|
|
38
|
+
"transition-all",
|
|
39
|
+
"duration-200",
|
|
40
|
+
"active:scale-90",
|
|
41
|
+
"active:duration-75",
|
|
42
|
+
// Default state:
|
|
43
|
+
"bg-white",
|
|
44
|
+
"border-[1.6px]",
|
|
45
|
+
"border-solid",
|
|
46
|
+
"border-border-primary",
|
|
47
|
+
// Checked state:
|
|
48
|
+
"data-[state=checked]:bg-bg-link",
|
|
49
|
+
"data-[state=checked]:border-bg-link",
|
|
50
|
+
// Disabled states
|
|
51
|
+
"disabled:cursor-not-allowed",
|
|
52
|
+
"disabled:active:scale-100",
|
|
53
|
+
"disabled:bg-white",
|
|
54
|
+
"disabled:border-border-secondary",
|
|
55
|
+
"disabled:data-[state=checked]:bg-border-secondary",
|
|
56
|
+
"disabled:data-[state=checked]:border-border-secondary",
|
|
57
|
+
// Focus styles
|
|
58
|
+
"focus-visible:ring-2",
|
|
59
|
+
"focus-visible:ring-bg-link",
|
|
60
|
+
"focus-visible:ring-offset-2",
|
|
30
61
|
className,
|
|
31
62
|
)}
|
|
32
63
|
{...props}
|
|
33
64
|
>
|
|
34
65
|
<RadioGroupPrimitive.Indicator
|
|
35
66
|
data-slot="radio-group-indicator"
|
|
36
|
-
className=
|
|
67
|
+
className={cn(
|
|
68
|
+
"absolute",
|
|
69
|
+
"inset-0",
|
|
70
|
+
"flex",
|
|
71
|
+
"items-center",
|
|
72
|
+
"justify-center",
|
|
73
|
+
)}
|
|
37
74
|
>
|
|
38
|
-
<
|
|
75
|
+
<div className={cn("size-1.5", "rounded-full", "bg-white")} />
|
|
39
76
|
</RadioGroupPrimitive.Indicator>
|
|
40
77
|
</RadioGroupPrimitive.Item>
|
|
41
78
|
);
|
|
@@ -4,6 +4,34 @@ import type * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
+
// Scroll area viewport styles
|
|
8
|
+
const scrollAreaViewportStyles = cn(
|
|
9
|
+
"size-full",
|
|
10
|
+
"rounded-[inherit]",
|
|
11
|
+
"transition-[color,box-shadow]",
|
|
12
|
+
"outline-none",
|
|
13
|
+
"focus-visible:ring-2",
|
|
14
|
+
"focus-visible:ring-utility-blue/70",
|
|
15
|
+
"focus-visible:outline-1",
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
// Scroll bar base styles
|
|
19
|
+
const scrollBarBaseStyles = cn(
|
|
20
|
+
"flex",
|
|
21
|
+
"touch-none",
|
|
22
|
+
"p-px",
|
|
23
|
+
"transition-colors",
|
|
24
|
+
"select-none",
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
// Scroll bar thumb styles
|
|
28
|
+
const scrollBarThumbStyles = cn(
|
|
29
|
+
"bg-border-primary",
|
|
30
|
+
"relative",
|
|
31
|
+
"flex-1",
|
|
32
|
+
"rounded-full",
|
|
33
|
+
);
|
|
34
|
+
|
|
7
35
|
function ScrollArea({
|
|
8
36
|
className,
|
|
9
37
|
children,
|
|
@@ -17,7 +45,7 @@ function ScrollArea({
|
|
|
17
45
|
>
|
|
18
46
|
<ScrollAreaPrimitive.Viewport
|
|
19
47
|
data-slot="scroll-area-viewport"
|
|
20
|
-
className=
|
|
48
|
+
className={scrollAreaViewportStyles}
|
|
21
49
|
>
|
|
22
50
|
{children}
|
|
23
51
|
</ScrollAreaPrimitive.Viewport>
|
|
@@ -37,18 +65,18 @@ function ScrollBar({
|
|
|
37
65
|
data-slot="scroll-area-scrollbar"
|
|
38
66
|
orientation={orientation}
|
|
39
67
|
className={cn(
|
|
40
|
-
|
|
68
|
+
scrollBarBaseStyles,
|
|
41
69
|
orientation === "vertical" &&
|
|
42
|
-
"h-full w-2.5 border-l border-l-transparent",
|
|
70
|
+
cn("h-full", "w-2.5", "border-l", "border-l-transparent"),
|
|
43
71
|
orientation === "horizontal" &&
|
|
44
|
-
"h-2.5 flex-col border-t border-t-transparent",
|
|
72
|
+
cn("h-2.5", "flex-col", "border-t", "border-t-transparent"),
|
|
45
73
|
className,
|
|
46
74
|
)}
|
|
47
75
|
{...props}
|
|
48
76
|
>
|
|
49
77
|
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
50
78
|
data-slot="scroll-area-thumb"
|
|
51
|
-
className=
|
|
79
|
+
className={scrollBarThumbStyles}
|
|
52
80
|
/>
|
|
53
81
|
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
54
82
|
);
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
SelectContent,
|
|
6
6
|
SelectGroup,
|
|
7
7
|
SelectItem,
|
|
8
|
-
SelectLabel,
|
|
9
8
|
SelectTrigger,
|
|
10
9
|
SelectValue,
|
|
11
10
|
} from "#shadcn/components/ui/select";
|
|
@@ -25,7 +24,6 @@ export const Demo = {
|
|
|
25
24
|
</SelectTrigger>
|
|
26
25
|
<SelectContent>
|
|
27
26
|
<SelectGroup>
|
|
28
|
-
<SelectLabel>Fruits</SelectLabel>
|
|
29
27
|
<SelectItem value="apple">Apple</SelectItem>
|
|
30
28
|
<SelectItem value="banana">Banana</SelectItem>
|
|
31
29
|
<SelectItem value="blueberry">Blueberry</SelectItem>
|