@health-samurai/react-components 0.0.0-alpha.4 → 0.0.0-alpha.5
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 +687 -446
- 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 +13 -2
- package/dist/src/components/code-editor/index.d.ts.map +1 -1
- package/dist/src/components/code-editor/index.js +161 -20
- package/dist/src/components/code-editor/index.js.map +1 -1
- package/dist/src/components/code-editor.stories.js +3 -1
- package/dist/src/components/code-editor.stories.js.map +1 -1
- package/dist/src/components/request-line-editor.d.ts +11 -35
- package/dist/src/components/request-line-editor.d.ts.map +1 -1
- package/dist/src/components/request-line-editor.js +51 -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/tree-view.d.ts +16 -0
- package/dist/src/components/tree-view.d.ts.map +1 -0
- package/dist/src/components/tree-view.js +67 -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 +3 -0
- package/dist/src/icons.d.ts.map +1 -0
- package/dist/src/icons.js +47 -0
- package/dist/src/icons.js.map +1 -0
- package/dist/src/index.css +42 -3
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -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.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.map +1 -1
- package/dist/src/shadcn/components/ui/input.js +87 -16
- 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 +314 -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 +20 -0
- package/dist/src/shadcn/components/ui/tree.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/tree.js +111 -0
- package/dist/src/shadcn/components/ui/tree.js.map +1 -0
- package/package.json +9 -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 +182 -21
- package/src/components/code-editor.stories.tsx +1 -1
- package/src/components/request-line-editor.stories.tsx +17 -27
- package/src/components/request-line-editor.tsx +72 -61
- package/src/components/tree-view.stories.tsx +260 -0
- package/src/components/tree-view.tsx +101 -0
- package/src/icons.tsx +45 -0
- package/src/index.css +42 -3
- package/src/index.tsx +1 -1
- package/src/shadcn/components/ui/accordion.tsx +66 -8
- 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 +38 -9
- package/src/shadcn/components/ui/form.tsx +16 -4
- package/src/shadcn/components/ui/input.tsx +281 -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 +455 -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 +200 -0
|
@@ -4,6 +4,89 @@ import type * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
+
// Dialog overlay styles
|
|
8
|
+
const dialogOverlayStyles = cn(
|
|
9
|
+
// Layout
|
|
10
|
+
"fixed",
|
|
11
|
+
"inset-0",
|
|
12
|
+
"z-50",
|
|
13
|
+
// Background
|
|
14
|
+
"bg-black/50",
|
|
15
|
+
// Animations - open
|
|
16
|
+
"data-[state=open]:animate-in",
|
|
17
|
+
"data-[state=open]:fade-in-0",
|
|
18
|
+
// Animations - closed
|
|
19
|
+
"data-[state=closed]:animate-out",
|
|
20
|
+
"data-[state=closed]:fade-out-0",
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
// Dialog content styles
|
|
24
|
+
const dialogContentStyles = cn(
|
|
25
|
+
// Layout
|
|
26
|
+
"fixed",
|
|
27
|
+
"top-[50%]",
|
|
28
|
+
"left-[50%]",
|
|
29
|
+
"z-50",
|
|
30
|
+
"grid",
|
|
31
|
+
"w-full",
|
|
32
|
+
"max-w-[calc(100%-2rem)]",
|
|
33
|
+
"translate-x-[-50%]",
|
|
34
|
+
"translate-y-[-50%]",
|
|
35
|
+
"gap-4",
|
|
36
|
+
// Shape
|
|
37
|
+
"rounded-lg",
|
|
38
|
+
// Borders
|
|
39
|
+
"border",
|
|
40
|
+
"border-border-primary",
|
|
41
|
+
// Background & Colors
|
|
42
|
+
"bg-bg-primary",
|
|
43
|
+
// Spacing
|
|
44
|
+
"p-6",
|
|
45
|
+
// Shadow
|
|
46
|
+
"shadow-lg",
|
|
47
|
+
// Animation duration
|
|
48
|
+
"duration-200",
|
|
49
|
+
// Responsive
|
|
50
|
+
"sm:max-w-lg",
|
|
51
|
+
// Animations - open
|
|
52
|
+
"data-[state=open]:animate-in",
|
|
53
|
+
"data-[state=open]:fade-in-0",
|
|
54
|
+
"data-[state=open]:zoom-in-95",
|
|
55
|
+
// Animations - closed
|
|
56
|
+
"data-[state=closed]:animate-out",
|
|
57
|
+
"data-[state=closed]:fade-out-0",
|
|
58
|
+
"data-[state=closed]:zoom-out-95",
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
// Dialog close button styles
|
|
62
|
+
const dialogCloseButtonStyles = cn(
|
|
63
|
+
// Layout
|
|
64
|
+
"absolute",
|
|
65
|
+
"top-4",
|
|
66
|
+
"right-4",
|
|
67
|
+
// Shape
|
|
68
|
+
"rounded-xs",
|
|
69
|
+
// Opacity
|
|
70
|
+
"opacity-70",
|
|
71
|
+
"hover:opacity-100",
|
|
72
|
+
// Transitions
|
|
73
|
+
"transition-opacity",
|
|
74
|
+
// Focus
|
|
75
|
+
"focus:ring-2",
|
|
76
|
+
"focus:ring-utility-blue/70",
|
|
77
|
+
"focus:ring-offset-2",
|
|
78
|
+
"focus:outline-hidden",
|
|
79
|
+
// Disabled
|
|
80
|
+
"disabled:pointer-events-none",
|
|
81
|
+
// SVG styles
|
|
82
|
+
"[&_svg]:pointer-events-none",
|
|
83
|
+
"[&_svg]:shrink-0",
|
|
84
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
85
|
+
// States
|
|
86
|
+
"data-[state=open]:bg-bg-secondary",
|
|
87
|
+
"data-[state=open]:text-text-secondary",
|
|
88
|
+
);
|
|
89
|
+
|
|
7
90
|
function Dialog({
|
|
8
91
|
...props
|
|
9
92
|
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
@@ -35,10 +118,7 @@ function DialogOverlay({
|
|
|
35
118
|
return (
|
|
36
119
|
<DialogPrimitive.Overlay
|
|
37
120
|
data-slot="dialog-overlay"
|
|
38
|
-
className={cn(
|
|
39
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
40
|
-
className,
|
|
41
|
-
)}
|
|
121
|
+
className={cn(dialogOverlayStyles, className)}
|
|
42
122
|
{...props}
|
|
43
123
|
/>
|
|
44
124
|
);
|
|
@@ -57,17 +137,14 @@ function DialogContent({
|
|
|
57
137
|
<DialogOverlay />
|
|
58
138
|
<DialogPrimitive.Content
|
|
59
139
|
data-slot="dialog-content"
|
|
60
|
-
className={cn(
|
|
61
|
-
"bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
62
|
-
className,
|
|
63
|
-
)}
|
|
140
|
+
className={cn(dialogContentStyles, className)}
|
|
64
141
|
{...props}
|
|
65
142
|
>
|
|
66
143
|
{children}
|
|
67
144
|
{showCloseButton && (
|
|
68
145
|
<DialogPrimitive.Close
|
|
69
146
|
data-slot="dialog-close"
|
|
70
|
-
className=
|
|
147
|
+
className={dialogCloseButtonStyles}
|
|
71
148
|
>
|
|
72
149
|
<XIcon />
|
|
73
150
|
<span className="sr-only">Close</span>
|
|
@@ -82,7 +159,14 @@ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
82
159
|
return (
|
|
83
160
|
<div
|
|
84
161
|
data-slot="dialog-header"
|
|
85
|
-
className={cn(
|
|
162
|
+
className={cn(
|
|
163
|
+
"flex",
|
|
164
|
+
"flex-col",
|
|
165
|
+
"gap-2",
|
|
166
|
+
"text-center",
|
|
167
|
+
"sm:text-left",
|
|
168
|
+
className,
|
|
169
|
+
)}
|
|
86
170
|
{...props}
|
|
87
171
|
/>
|
|
88
172
|
);
|
|
@@ -93,7 +177,11 @@ function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
93
177
|
<div
|
|
94
178
|
data-slot="dialog-footer"
|
|
95
179
|
className={cn(
|
|
96
|
-
"flex
|
|
180
|
+
"flex",
|
|
181
|
+
"flex-col-reverse",
|
|
182
|
+
"gap-2",
|
|
183
|
+
"sm:flex-row",
|
|
184
|
+
"sm:justify-end",
|
|
97
185
|
className,
|
|
98
186
|
)}
|
|
99
187
|
{...props}
|
|
@@ -108,7 +196,7 @@ function DialogTitle({
|
|
|
108
196
|
return (
|
|
109
197
|
<DialogPrimitive.Title
|
|
110
198
|
data-slot="dialog-title"
|
|
111
|
-
className={cn("text-lg leading-none font-semibold", className)}
|
|
199
|
+
className={cn("text-lg", "leading-none", "font-semibold", className)}
|
|
112
200
|
{...props}
|
|
113
201
|
/>
|
|
114
202
|
);
|
|
@@ -121,7 +209,7 @@ function DialogDescription({
|
|
|
121
209
|
return (
|
|
122
210
|
<DialogPrimitive.Description
|
|
123
211
|
data-slot="dialog-description"
|
|
124
|
-
className={cn("text-
|
|
212
|
+
className={cn("text-text-secondary", "text-sm", className)}
|
|
125
213
|
{...props}
|
|
126
214
|
/>
|
|
127
215
|
);
|
|
@@ -4,6 +4,94 @@ import { Drawer as DrawerPrimitive } from "vaul";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
+
// Drawer overlay styles
|
|
8
|
+
const drawerOverlayStyles = cn(
|
|
9
|
+
// Layout
|
|
10
|
+
"fixed",
|
|
11
|
+
"inset-0",
|
|
12
|
+
"z-50",
|
|
13
|
+
// Background
|
|
14
|
+
"bg-black/50",
|
|
15
|
+
// Animations - open
|
|
16
|
+
"data-[state=open]:animate-in",
|
|
17
|
+
"data-[state=open]:fade-in-0",
|
|
18
|
+
// Animations - closed
|
|
19
|
+
"data-[state=closed]:animate-out",
|
|
20
|
+
"data-[state=closed]:fade-out-0",
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
// Drawer content styles
|
|
24
|
+
const drawerContentStyles = cn(
|
|
25
|
+
// Group
|
|
26
|
+
"group/drawer-content",
|
|
27
|
+
// Background
|
|
28
|
+
"bg-bg-primary",
|
|
29
|
+
// Layout
|
|
30
|
+
"fixed",
|
|
31
|
+
"z-50",
|
|
32
|
+
"flex",
|
|
33
|
+
"h-auto",
|
|
34
|
+
"flex-col",
|
|
35
|
+
// Top direction
|
|
36
|
+
"data-[vaul-drawer-direction=top]:inset-x-0",
|
|
37
|
+
"data-[vaul-drawer-direction=top]:top-0",
|
|
38
|
+
"data-[vaul-drawer-direction=top]:mb-24",
|
|
39
|
+
"data-[vaul-drawer-direction=top]:max-h-[80vh]",
|
|
40
|
+
"data-[vaul-drawer-direction=top]:rounded-b-lg",
|
|
41
|
+
"data-[vaul-drawer-direction=top]:border-b",
|
|
42
|
+
"data-[vaul-drawer-direction=top]:border-border-primary",
|
|
43
|
+
// Bottom direction
|
|
44
|
+
"data-[vaul-drawer-direction=bottom]:inset-x-0",
|
|
45
|
+
"data-[vaul-drawer-direction=bottom]:bottom-0",
|
|
46
|
+
"data-[vaul-drawer-direction=bottom]:mt-24",
|
|
47
|
+
"data-[vaul-drawer-direction=bottom]:max-h-[80vh]",
|
|
48
|
+
"data-[vaul-drawer-direction=bottom]:rounded-t-lg",
|
|
49
|
+
"data-[vaul-drawer-direction=bottom]:border-t",
|
|
50
|
+
"data-[vaul-drawer-direction=bottom]:border-border-primary",
|
|
51
|
+
// Right direction
|
|
52
|
+
"data-[vaul-drawer-direction=right]:inset-y-0",
|
|
53
|
+
"data-[vaul-drawer-direction=right]:right-0",
|
|
54
|
+
"data-[vaul-drawer-direction=right]:w-3/4",
|
|
55
|
+
"data-[vaul-drawer-direction=right]:border-l",
|
|
56
|
+
"data-[vaul-drawer-direction=right]:border-border-primary",
|
|
57
|
+
"data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
58
|
+
// Left direction
|
|
59
|
+
"data-[vaul-drawer-direction=left]:inset-y-0",
|
|
60
|
+
"data-[vaul-drawer-direction=left]:left-0",
|
|
61
|
+
"data-[vaul-drawer-direction=left]:w-3/4",
|
|
62
|
+
"data-[vaul-drawer-direction=left]:border-r",
|
|
63
|
+
"data-[vaul-drawer-direction=left]:border-border-primary",
|
|
64
|
+
"data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
// Drawer handle styles
|
|
68
|
+
const drawerHandleStyles = cn(
|
|
69
|
+
"bg-bg-tertiary",
|
|
70
|
+
"mx-auto",
|
|
71
|
+
"mt-4",
|
|
72
|
+
"hidden",
|
|
73
|
+
"h-2",
|
|
74
|
+
"w-[100px]",
|
|
75
|
+
"shrink-0",
|
|
76
|
+
"rounded-full",
|
|
77
|
+
"group-data-[vaul-drawer-direction=bottom]/drawer-content:block",
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
// Drawer header styles
|
|
81
|
+
const drawerHeaderStyles = cn(
|
|
82
|
+
"flex",
|
|
83
|
+
"flex-col",
|
|
84
|
+
"gap-0.5",
|
|
85
|
+
"p-4",
|
|
86
|
+
"group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center",
|
|
87
|
+
"group-data-[vaul-drawer-direction=top]/drawer-content:text-center",
|
|
88
|
+
"md:gap-1.5",
|
|
89
|
+
"md:text-left",
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// Drawer footer styles
|
|
93
|
+
const drawerFooterStyles = cn("mt-auto", "flex", "flex-col", "gap-2", "p-4");
|
|
94
|
+
|
|
7
95
|
function Drawer({
|
|
8
96
|
...props
|
|
9
97
|
}: React.ComponentProps<typeof DrawerPrimitive.Root>) {
|
|
@@ -35,10 +123,7 @@ function DrawerOverlay({
|
|
|
35
123
|
return (
|
|
36
124
|
<DrawerPrimitive.Overlay
|
|
37
125
|
data-slot="drawer-overlay"
|
|
38
|
-
className={cn(
|
|
39
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
40
|
-
className,
|
|
41
|
-
)}
|
|
126
|
+
className={cn(drawerOverlayStyles, className)}
|
|
42
127
|
{...props}
|
|
43
128
|
/>
|
|
44
129
|
);
|
|
@@ -54,17 +139,10 @@ function DrawerContent({
|
|
|
54
139
|
<DrawerOverlay />
|
|
55
140
|
<DrawerPrimitive.Content
|
|
56
141
|
data-slot="drawer-content"
|
|
57
|
-
className={cn(
|
|
58
|
-
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
59
|
-
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
60
|
-
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
61
|
-
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
62
|
-
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
63
|
-
className,
|
|
64
|
-
)}
|
|
142
|
+
className={cn(drawerContentStyles, className)}
|
|
65
143
|
{...props}
|
|
66
144
|
>
|
|
67
|
-
<div className=
|
|
145
|
+
<div className={drawerHandleStyles} />
|
|
68
146
|
{children}
|
|
69
147
|
</DrawerPrimitive.Content>
|
|
70
148
|
</DrawerPortal>
|
|
@@ -75,10 +153,7 @@ function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
75
153
|
return (
|
|
76
154
|
<div
|
|
77
155
|
data-slot="drawer-header"
|
|
78
|
-
className={cn(
|
|
79
|
-
"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",
|
|
80
|
-
className,
|
|
81
|
-
)}
|
|
156
|
+
className={cn(drawerHeaderStyles, className)}
|
|
82
157
|
{...props}
|
|
83
158
|
/>
|
|
84
159
|
);
|
|
@@ -88,7 +163,7 @@ function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
88
163
|
return (
|
|
89
164
|
<div
|
|
90
165
|
data-slot="drawer-footer"
|
|
91
|
-
className={cn(
|
|
166
|
+
className={cn(drawerFooterStyles, className)}
|
|
92
167
|
{...props}
|
|
93
168
|
/>
|
|
94
169
|
);
|
|
@@ -4,6 +4,43 @@ import type * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
+
// Dropdown menu content styles
|
|
8
|
+
const dropdownMenuContentStyles = cn(
|
|
9
|
+
// Background
|
|
10
|
+
"bg-bg-primary",
|
|
11
|
+
// Layout
|
|
12
|
+
"z-50",
|
|
13
|
+
"max-h-(--radix-dropdown-menu-content-available-height)",
|
|
14
|
+
"min-w-[8rem]",
|
|
15
|
+
"origin-(--radix-dropdown-menu-content-transform-origin)",
|
|
16
|
+
"overflow-x-hidden",
|
|
17
|
+
"overflow-y-auto",
|
|
18
|
+
// Shape
|
|
19
|
+
"rounded-md",
|
|
20
|
+
// Borders
|
|
21
|
+
"border",
|
|
22
|
+
"border-border-separator",
|
|
23
|
+
// Spacing
|
|
24
|
+
"px-2",
|
|
25
|
+
"py-3",
|
|
26
|
+
"space-y-0.5",
|
|
27
|
+
// Shadow
|
|
28
|
+
"shadow-lg",
|
|
29
|
+
// Animations - open
|
|
30
|
+
"data-[state=open]:animate-in",
|
|
31
|
+
"data-[state=open]:fade-in-0",
|
|
32
|
+
"data-[state=open]:zoom-in-95",
|
|
33
|
+
// Animations - closed
|
|
34
|
+
"data-[state=closed]:animate-out",
|
|
35
|
+
"data-[state=closed]:fade-out-0",
|
|
36
|
+
"data-[state=closed]:zoom-out-95",
|
|
37
|
+
// Slide animations
|
|
38
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
39
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
40
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
41
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
42
|
+
);
|
|
43
|
+
|
|
7
44
|
function DropdownMenu({
|
|
8
45
|
...props
|
|
9
46
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
@@ -39,15 +76,7 @@ function DropdownMenuContent({
|
|
|
39
76
|
<DropdownMenuPrimitive.Content
|
|
40
77
|
data-slot="dropdown-menu-content"
|
|
41
78
|
sideOffset={sideOffset}
|
|
42
|
-
className={cn(
|
|
43
|
-
"bg-bg-primary data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
44
|
-
"data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
45
|
-
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
46
|
-
"data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height)",
|
|
47
|
-
"min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin)",
|
|
48
|
-
"overflow-x-hidden overflow-y-auto rounded-md border border-border-separator px-2 py-3 shadow-lg space-y-0.5",
|
|
49
|
-
className,
|
|
50
|
-
)}
|
|
79
|
+
className={cn(dropdownMenuContentStyles, className)}
|
|
51
80
|
{...props}
|
|
52
81
|
/>
|
|
53
82
|
</DropdownMenuPrimitive.Portal>
|
|
@@ -14,6 +14,18 @@ import {
|
|
|
14
14
|
import { Label } from "#shadcn/components/ui/label";
|
|
15
15
|
import { cn } from "#shadcn/lib/utils";
|
|
16
16
|
|
|
17
|
+
// Form item styles
|
|
18
|
+
const formItemStyles = cn("grid", "gap-2");
|
|
19
|
+
|
|
20
|
+
// Form label error styles
|
|
21
|
+
const formLabelErrorStyles = cn("data-[error=true]:text-text-error-primary");
|
|
22
|
+
|
|
23
|
+
// Form description styles
|
|
24
|
+
const formDescriptionStyles = cn("text-text-secondary", "text-sm");
|
|
25
|
+
|
|
26
|
+
// Form message styles
|
|
27
|
+
const formMessageStyles = cn("text-text-error-primary", "text-sm");
|
|
28
|
+
|
|
17
29
|
const Form = FormProvider;
|
|
18
30
|
|
|
19
31
|
type FormFieldContextValue<
|
|
@@ -78,7 +90,7 @@ function FormItem({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
78
90
|
<FormItemContext.Provider value={{ id }}>
|
|
79
91
|
<div
|
|
80
92
|
data-slot="form-item"
|
|
81
|
-
className={cn(
|
|
93
|
+
className={cn(formItemStyles, className)}
|
|
82
94
|
{...props}
|
|
83
95
|
/>
|
|
84
96
|
</FormItemContext.Provider>
|
|
@@ -95,7 +107,7 @@ function FormLabel({
|
|
|
95
107
|
<Label
|
|
96
108
|
data-slot="form-label"
|
|
97
109
|
data-error={!!error}
|
|
98
|
-
className={cn(
|
|
110
|
+
className={cn(formLabelErrorStyles, className)}
|
|
99
111
|
htmlFor={formItemId}
|
|
100
112
|
{...props}
|
|
101
113
|
/>
|
|
@@ -128,7 +140,7 @@ function FormDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
|
128
140
|
<p
|
|
129
141
|
data-slot="form-description"
|
|
130
142
|
id={formDescriptionId}
|
|
131
|
-
className={cn(
|
|
143
|
+
className={cn(formDescriptionStyles, className)}
|
|
132
144
|
{...props}
|
|
133
145
|
/>
|
|
134
146
|
);
|
|
@@ -146,7 +158,7 @@ function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
|
|
|
146
158
|
<p
|
|
147
159
|
data-slot="form-message"
|
|
148
160
|
id={formMessageId}
|
|
149
|
-
className={cn(
|
|
161
|
+
className={cn(formMessageStyles, className)}
|
|
150
162
|
{...props}
|
|
151
163
|
>
|
|
152
164
|
{body}
|