@health-samurai/react-components 0.0.0-alpha.3 → 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/carousel.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/carousel.js +1 -0
- package/dist/src/shadcn/components/ui/carousel.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-otp.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/input-otp.js +1 -0
- package/dist/src/shadcn/components/ui/input-otp.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/resizable.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.js +1 -0
- package/dist/src/shadcn/components/ui/resizable.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 +7 -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/carousel.tsx +1 -0
- 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-otp.tsx +1 -0
- 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/resizable.tsx +1 -0
- 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 +28 -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,65 @@ import type * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
+
// Accordion item styles
|
|
8
|
+
const accordionItemStyles = cn(
|
|
9
|
+
"border-b",
|
|
10
|
+
"border-border-primary",
|
|
11
|
+
"last:border-b-0",
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
// Accordion trigger styles
|
|
15
|
+
const accordionTriggerStyles = cn(
|
|
16
|
+
// Layout
|
|
17
|
+
"flex",
|
|
18
|
+
"flex-1",
|
|
19
|
+
"items-start",
|
|
20
|
+
"justify-between",
|
|
21
|
+
"gap-4",
|
|
22
|
+
// Shape
|
|
23
|
+
"rounded-md",
|
|
24
|
+
// Spacing
|
|
25
|
+
"py-4",
|
|
26
|
+
// Typography
|
|
27
|
+
"text-left",
|
|
28
|
+
"text-sm",
|
|
29
|
+
"font-medium",
|
|
30
|
+
// Interaction
|
|
31
|
+
"transition-all",
|
|
32
|
+
"outline-none",
|
|
33
|
+
"hover:underline",
|
|
34
|
+
// Focus
|
|
35
|
+
"focus-visible:ring-2",
|
|
36
|
+
"focus-visible:ring-utility-blue/70",
|
|
37
|
+
// Disabled
|
|
38
|
+
"disabled:pointer-events-none",
|
|
39
|
+
"disabled:opacity-50",
|
|
40
|
+
// Icon rotation
|
|
41
|
+
"[&[data-state=open]>svg]:rotate-180",
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
// Accordion content styles
|
|
45
|
+
const accordionContentStyles = cn(
|
|
46
|
+
"data-[state=closed]:animate-accordion-up",
|
|
47
|
+
"data-[state=open]:animate-accordion-down",
|
|
48
|
+
"overflow-hidden",
|
|
49
|
+
"text-sm",
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
// Accordion content inner styles
|
|
53
|
+
const accordionContentInnerStyles = cn("pt-0", "pb-4");
|
|
54
|
+
|
|
55
|
+
// Accordion chevron styles
|
|
56
|
+
const accordionChevronStyles = cn(
|
|
57
|
+
"text-text-secondary",
|
|
58
|
+
"pointer-events-none",
|
|
59
|
+
"size-4",
|
|
60
|
+
"shrink-0",
|
|
61
|
+
"translate-y-0.5",
|
|
62
|
+
"transition-transform",
|
|
63
|
+
"duration-200",
|
|
64
|
+
);
|
|
65
|
+
|
|
7
66
|
function Accordion({
|
|
8
67
|
...props
|
|
9
68
|
}: React.ComponentProps<typeof AccordionPrimitive.Root>) {
|
|
@@ -17,7 +76,7 @@ function AccordionItem({
|
|
|
17
76
|
return (
|
|
18
77
|
<AccordionPrimitive.Item
|
|
19
78
|
data-slot="accordion-item"
|
|
20
|
-
className={cn(
|
|
79
|
+
className={cn(accordionItemStyles, className)}
|
|
21
80
|
{...props}
|
|
22
81
|
/>
|
|
23
82
|
);
|
|
@@ -32,14 +91,11 @@ function AccordionTrigger({
|
|
|
32
91
|
<AccordionPrimitive.Header className="flex">
|
|
33
92
|
<AccordionPrimitive.Trigger
|
|
34
93
|
data-slot="accordion-trigger"
|
|
35
|
-
className={cn(
|
|
36
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
37
|
-
className,
|
|
38
|
-
)}
|
|
94
|
+
className={cn(accordionTriggerStyles, className)}
|
|
39
95
|
{...props}
|
|
40
96
|
>
|
|
41
97
|
{children}
|
|
42
|
-
<ChevronDownIcon className=
|
|
98
|
+
<ChevronDownIcon className={accordionChevronStyles} />
|
|
43
99
|
</AccordionPrimitive.Trigger>
|
|
44
100
|
</AccordionPrimitive.Header>
|
|
45
101
|
);
|
|
@@ -53,10 +109,12 @@ function AccordionContent({
|
|
|
53
109
|
return (
|
|
54
110
|
<AccordionPrimitive.Content
|
|
55
111
|
data-slot="accordion-content"
|
|
56
|
-
className=
|
|
112
|
+
className={accordionContentStyles}
|
|
57
113
|
{...props}
|
|
58
114
|
>
|
|
59
|
-
<div className={cn(
|
|
115
|
+
<div className={cn(accordionContentInnerStyles, className)}>
|
|
116
|
+
{children}
|
|
117
|
+
</div>
|
|
60
118
|
</AccordionPrimitive.Content>
|
|
61
119
|
);
|
|
62
120
|
}
|
|
@@ -3,21 +3,49 @@ import type * as React from "react";
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "#shadcn/lib/utils";
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
const baseAlertStyles = cn(
|
|
7
|
+
// Layout
|
|
8
|
+
"relative",
|
|
9
|
+
"w-full",
|
|
10
|
+
"grid",
|
|
11
|
+
"items-start",
|
|
12
|
+
"grid-cols-[0_1fr]",
|
|
13
|
+
"has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr]",
|
|
14
|
+
"gap-y-0.5",
|
|
15
|
+
"has-[>svg]:gap-x-3",
|
|
16
|
+
// Shape
|
|
17
|
+
"rounded-lg",
|
|
18
|
+
// Borders
|
|
19
|
+
"border",
|
|
20
|
+
"border-border-primary",
|
|
21
|
+
// Spacing
|
|
22
|
+
"px-4",
|
|
23
|
+
"py-3",
|
|
24
|
+
// Typography
|
|
25
|
+
"text-sm",
|
|
26
|
+
// SVG styles
|
|
27
|
+
"[&>svg]:size-4",
|
|
28
|
+
"[&>svg]:translate-y-0.5",
|
|
29
|
+
"[&>svg]:text-current",
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const alertVariants = cva(baseAlertStyles, {
|
|
33
|
+
variants: {
|
|
34
|
+
variant: {
|
|
35
|
+
default: cn("bg-bg-primary", "text-text-primary"),
|
|
36
|
+
destructive: cn(
|
|
37
|
+
"text-text-error-primary",
|
|
38
|
+
"bg-bg-error-primary",
|
|
39
|
+
"border-border-error",
|
|
40
|
+
"[&>svg]:text-current",
|
|
41
|
+
"*:data-[slot=alert-description]:text-fg-error-secondary",
|
|
42
|
+
),
|
|
18
43
|
},
|
|
19
44
|
},
|
|
20
|
-
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
variant: "default",
|
|
47
|
+
},
|
|
48
|
+
});
|
|
21
49
|
|
|
22
50
|
function Alert({
|
|
23
51
|
className,
|
|
@@ -39,7 +67,11 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
39
67
|
<div
|
|
40
68
|
data-slot="alert-title"
|
|
41
69
|
className={cn(
|
|
42
|
-
"col-start-2
|
|
70
|
+
"col-start-2",
|
|
71
|
+
"line-clamp-1",
|
|
72
|
+
"min-h-4",
|
|
73
|
+
"font-medium",
|
|
74
|
+
"tracking-tight",
|
|
43
75
|
className,
|
|
44
76
|
)}
|
|
45
77
|
{...props}
|
|
@@ -55,7 +87,13 @@ function AlertDescription({
|
|
|
55
87
|
<div
|
|
56
88
|
data-slot="alert-description"
|
|
57
89
|
className={cn(
|
|
58
|
-
"text-
|
|
90
|
+
"text-text-secondary",
|
|
91
|
+
"col-start-2",
|
|
92
|
+
"grid",
|
|
93
|
+
"justify-items-start",
|
|
94
|
+
"gap-1",
|
|
95
|
+
"text-sm",
|
|
96
|
+
"[&_p]:leading-relaxed",
|
|
59
97
|
className,
|
|
60
98
|
)}
|
|
61
99
|
{...props}
|
|
@@ -3,6 +3,15 @@ import type * as React from "react";
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "#shadcn/lib/utils";
|
|
5
5
|
|
|
6
|
+
const avatarStyles = cn(
|
|
7
|
+
"relative",
|
|
8
|
+
"flex",
|
|
9
|
+
"size-8",
|
|
10
|
+
"shrink-0",
|
|
11
|
+
"overflow-hidden",
|
|
12
|
+
"rounded-full",
|
|
13
|
+
);
|
|
14
|
+
|
|
6
15
|
function Avatar({
|
|
7
16
|
className,
|
|
8
17
|
...props
|
|
@@ -10,10 +19,7 @@ function Avatar({
|
|
|
10
19
|
return (
|
|
11
20
|
<AvatarPrimitive.Root
|
|
12
21
|
data-slot="avatar"
|
|
13
|
-
className={cn(
|
|
14
|
-
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
|
|
15
|
-
className,
|
|
16
|
-
)}
|
|
22
|
+
className={cn(avatarStyles, className)}
|
|
17
23
|
{...props}
|
|
18
24
|
/>
|
|
19
25
|
);
|
|
@@ -26,7 +32,7 @@ function AvatarImage({
|
|
|
26
32
|
return (
|
|
27
33
|
<AvatarPrimitive.Image
|
|
28
34
|
data-slot="avatar-image"
|
|
29
|
-
className={cn("aspect-square size-full", className)}
|
|
35
|
+
className={cn("aspect-square", "size-full", className)}
|
|
30
36
|
{...props}
|
|
31
37
|
/>
|
|
32
38
|
);
|
|
@@ -40,7 +46,12 @@ function AvatarFallback({
|
|
|
40
46
|
<AvatarPrimitive.Fallback
|
|
41
47
|
data-slot="avatar-fallback"
|
|
42
48
|
className={cn(
|
|
43
|
-
"bg-
|
|
49
|
+
"bg-bg-tertiary",
|
|
50
|
+
"flex",
|
|
51
|
+
"size-full",
|
|
52
|
+
"items-center",
|
|
53
|
+
"justify-center",
|
|
54
|
+
"rounded-full",
|
|
44
55
|
className,
|
|
45
56
|
)}
|
|
46
57
|
{...props}
|
|
@@ -4,26 +4,75 @@ import type * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
// Base badge styles
|
|
8
|
+
const baseBadgeStyles = cn(
|
|
9
|
+
// Layout
|
|
10
|
+
"inline-flex",
|
|
11
|
+
"items-center",
|
|
12
|
+
"justify-center",
|
|
13
|
+
"w-fit",
|
|
14
|
+
"whitespace-nowrap",
|
|
15
|
+
"shrink-0",
|
|
16
|
+
"gap-1",
|
|
17
|
+
"overflow-hidden",
|
|
18
|
+
// Shape
|
|
19
|
+
"rounded-md",
|
|
20
|
+
// Borders
|
|
21
|
+
"border",
|
|
22
|
+
// Spacing
|
|
23
|
+
"px-2",
|
|
24
|
+
"py-0.5",
|
|
25
|
+
// Typography
|
|
26
|
+
"text-xs",
|
|
27
|
+
"font-medium",
|
|
28
|
+
// SVG
|
|
29
|
+
"[&>svg]:size-3",
|
|
30
|
+
"[&>svg]:pointer-events-none",
|
|
31
|
+
// Transitions
|
|
32
|
+
"transition-[color,box-shadow]",
|
|
33
|
+
// Focus
|
|
34
|
+
"focus-visible:ring-2",
|
|
35
|
+
"focus-visible:ring-utility-blue/70",
|
|
36
|
+
// Invalid
|
|
37
|
+
"aria-invalid:ring-2",
|
|
38
|
+
"aria-invalid:ring-utility-red/70",
|
|
39
|
+
"aria-invalid:border-border-error",
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const badgeVariants = cva(baseBadgeStyles, {
|
|
43
|
+
variants: {
|
|
44
|
+
variant: {
|
|
45
|
+
default: cn(
|
|
46
|
+
"border-transparent",
|
|
47
|
+
"bg-bg-link",
|
|
48
|
+
"text-text-primary_on-brand",
|
|
49
|
+
"[a&]:hover:bg-bg-link_hover",
|
|
50
|
+
),
|
|
51
|
+
secondary: cn(
|
|
52
|
+
"border-transparent",
|
|
53
|
+
"bg-bg-secondary",
|
|
54
|
+
"text-text-secondary",
|
|
55
|
+
"[a&]:hover:bg-bg-tertiary",
|
|
56
|
+
),
|
|
57
|
+
destructive: cn(
|
|
58
|
+
"border-transparent",
|
|
59
|
+
"bg-bg-error-primary_inverse",
|
|
60
|
+
"text-text-primary_on-brand",
|
|
61
|
+
"[a&]:hover:bg-bg-error-primary_inverse_hover",
|
|
62
|
+
"focus-visible:ring-utility-red/70",
|
|
63
|
+
),
|
|
64
|
+
outline: cn(
|
|
65
|
+
"text-text-primary",
|
|
66
|
+
"border-border-primary",
|
|
67
|
+
"[a&]:hover:bg-bg-secondary",
|
|
68
|
+
"[a&]:hover:text-text-primary",
|
|
69
|
+
),
|
|
24
70
|
},
|
|
25
71
|
},
|
|
26
|
-
|
|
72
|
+
defaultVariants: {
|
|
73
|
+
variant: "default",
|
|
74
|
+
},
|
|
75
|
+
});
|
|
27
76
|
|
|
28
77
|
function Badge({
|
|
29
78
|
className,
|
|
@@ -13,7 +13,13 @@ function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
|
13
13
|
<ol
|
|
14
14
|
data-slot="breadcrumb-list"
|
|
15
15
|
className={cn(
|
|
16
|
-
"text-text-tertiary
|
|
16
|
+
"text-text-tertiary",
|
|
17
|
+
"typo-body",
|
|
18
|
+
"flex",
|
|
19
|
+
"flex-wrap",
|
|
20
|
+
"items-center",
|
|
21
|
+
"break-words",
|
|
22
|
+
"gap-2",
|
|
17
23
|
className,
|
|
18
24
|
)}
|
|
19
25
|
{...props}
|
|
@@ -25,7 +31,7 @@ function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
|
25
31
|
return (
|
|
26
32
|
<li
|
|
27
33
|
data-slot="breadcrumb-item"
|
|
28
|
-
className={cn("inline-flex items-center", className)}
|
|
34
|
+
className={cn("inline-flex", "items-center", className)}
|
|
29
35
|
{...props}
|
|
30
36
|
/>
|
|
31
37
|
);
|
|
@@ -44,9 +50,17 @@ function BreadcrumbLink({
|
|
|
44
50
|
<Comp
|
|
45
51
|
data-slot="breadcrumb-link"
|
|
46
52
|
className={cn(
|
|
47
|
-
"typo-body
|
|
53
|
+
"typo-body",
|
|
54
|
+
"bg-bg-tertiary",
|
|
55
|
+
"text-text-tertiary",
|
|
56
|
+
"rounded-md",
|
|
57
|
+
"px-2",
|
|
58
|
+
"py-1",
|
|
59
|
+
"transition-colors",
|
|
48
60
|
"hover:text-text-secondary",
|
|
49
|
-
"focus-visible:outline-none
|
|
61
|
+
"focus-visible:outline-none",
|
|
62
|
+
"focus-visible:ring-2",
|
|
63
|
+
"focus-visible:ring-utility-blue/70",
|
|
50
64
|
className,
|
|
51
65
|
)}
|
|
52
66
|
{...props}
|
|
@@ -64,7 +78,10 @@ function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
|
|
|
64
78
|
aria-disabled="true"
|
|
65
79
|
aria-current="page"
|
|
66
80
|
className={cn(
|
|
67
|
-
"typo-page-header
|
|
81
|
+
"typo-page-header",
|
|
82
|
+
"text-text-primary",
|
|
83
|
+
"px-0",
|
|
84
|
+
"py-0.5",
|
|
68
85
|
className,
|
|
69
86
|
)}
|
|
70
87
|
{...props}
|
|
@@ -82,7 +99,12 @@ function BreadcrumbSeparator({
|
|
|
82
99
|
data-slot="breadcrumb-separator"
|
|
83
100
|
role="presentation"
|
|
84
101
|
aria-hidden="true"
|
|
85
|
-
className={cn(
|
|
102
|
+
className={cn(
|
|
103
|
+
"[&>svg]:size-3.5",
|
|
104
|
+
"text-text-tertiary",
|
|
105
|
+
"text-xs",
|
|
106
|
+
className,
|
|
107
|
+
)}
|
|
86
108
|
{...props}
|
|
87
109
|
>
|
|
88
110
|
{children ?? "/"}
|
|
@@ -99,7 +121,13 @@ function BreadcrumbEllipsis({
|
|
|
99
121
|
data-slot="breadcrumb-ellipsis"
|
|
100
122
|
role="presentation"
|
|
101
123
|
aria-hidden="true"
|
|
102
|
-
className={cn(
|
|
124
|
+
className={cn(
|
|
125
|
+
"flex",
|
|
126
|
+
"size-9",
|
|
127
|
+
"items-center",
|
|
128
|
+
"justify-center",
|
|
129
|
+
className,
|
|
130
|
+
)}
|
|
103
131
|
{...props}
|
|
104
132
|
>
|
|
105
133
|
<MoreHorizontal className="size-4" />
|
|
@@ -4,67 +4,128 @@ import type * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
7
|
+
const baseButtonStyles = cn(
|
|
8
|
+
// Layout
|
|
9
|
+
"inline-flex",
|
|
10
|
+
"items-center",
|
|
11
|
+
"justify-center",
|
|
12
|
+
"gap-2",
|
|
13
|
+
"whitespace-nowrap",
|
|
14
|
+
"shrink-0",
|
|
15
|
+
// Shape
|
|
16
|
+
"rounded-lg",
|
|
17
|
+
// Interaction
|
|
18
|
+
"transition-all",
|
|
19
|
+
"outline-none",
|
|
20
|
+
"cursor-pointer",
|
|
21
|
+
// Disabled states
|
|
22
|
+
"disabled:cursor-not-allowed",
|
|
23
|
+
// Icon styles
|
|
24
|
+
"[&_svg]:pointer-events-none",
|
|
25
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
26
|
+
"[&_svg]:shrink-0",
|
|
27
|
+
// Focus states
|
|
28
|
+
"focus-visible:ring-2",
|
|
29
|
+
"focus-visible:ring-utility-blue/70",
|
|
30
|
+
// Invalid states
|
|
31
|
+
"aria-invalid:ring-2",
|
|
32
|
+
"aria-invalid:ring-utility-red/70",
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const buttonVariants = cva(baseButtonStyles, {
|
|
36
|
+
variants: {
|
|
37
|
+
variant: {
|
|
38
|
+
primary: cn(
|
|
39
|
+
"bg-bg-link",
|
|
40
|
+
"text-text-primary_on-brand",
|
|
41
|
+
"hover:bg-bg-link_hover",
|
|
42
|
+
"active:bg-bg-link",
|
|
43
|
+
"disabled:bg-bg-disabled",
|
|
44
|
+
"disabled:text-text-disabled",
|
|
45
|
+
),
|
|
46
|
+
secondary: cn(
|
|
47
|
+
"border",
|
|
48
|
+
"border-border-primary",
|
|
49
|
+
"bg-bg-primary",
|
|
50
|
+
"text-text-secondary",
|
|
51
|
+
"hover:text-text-primary",
|
|
52
|
+
"hover:bg-bg-secondary",
|
|
53
|
+
"active:bg-bg-primary",
|
|
54
|
+
"active:text-text-tertiary",
|
|
55
|
+
"disabled:text-text-disabled",
|
|
56
|
+
"disabled:border-border-disabled",
|
|
57
|
+
"disabled:hover:bg-bg-primary",
|
|
58
|
+
),
|
|
59
|
+
link: cn(
|
|
60
|
+
"text-text-secondary",
|
|
61
|
+
"hover:text-text-primary",
|
|
62
|
+
"disabled:text-text-disabled",
|
|
63
|
+
"rounded-none",
|
|
64
|
+
),
|
|
65
|
+
ghost: cn(
|
|
66
|
+
"text-text-secondary",
|
|
67
|
+
"hover:text-text-primary",
|
|
68
|
+
"hover:bg-bg-secondary",
|
|
69
|
+
"active:bg-bg-tertiary",
|
|
70
|
+
"disabled:text-text-disabled",
|
|
71
|
+
"disabled:hover:bg-bg-primary",
|
|
72
|
+
),
|
|
73
|
+
},
|
|
74
|
+
size: {
|
|
75
|
+
regular: cn("h-9", "px-4", "typo-label"),
|
|
76
|
+
small: cn("h-6", "px-2", "gap-1", "typo-button-label-xs"),
|
|
35
77
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{
|
|
44
|
-
variant: "secondary",
|
|
45
|
-
danger: true,
|
|
46
|
-
class:
|
|
47
|
-
"border-border-error text-text-error-primary hover:text-text-error-primary_hover hover:bg-bg-error-secondary active:bg-bg-primary active:text-text-error-primary_on-brand",
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
variant: "link",
|
|
51
|
-
danger: true,
|
|
52
|
-
class: "text-text-error-secondary hover:text-text-error-primary",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
variant: "ghost",
|
|
56
|
-
danger: true,
|
|
57
|
-
class:
|
|
58
|
-
"text-text-error-secondary hover:text-text-error-primary hover:bg-bg-error-secondary active:bg-bg-error-tertiary",
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
defaultVariants: {
|
|
78
|
+
danger: {
|
|
79
|
+
true: "",
|
|
80
|
+
false: "",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
compoundVariants: [
|
|
84
|
+
{
|
|
62
85
|
variant: "primary",
|
|
63
|
-
|
|
64
|
-
|
|
86
|
+
danger: true,
|
|
87
|
+
class: cn(
|
|
88
|
+
"bg-bg-error-primary_inverse",
|
|
89
|
+
"text-text-primary_on-brand",
|
|
90
|
+
"hover:bg-bg-error-primary_inverse_hover",
|
|
91
|
+
"active:bg-bg-error-primary_inverse",
|
|
92
|
+
"disabled:bg-bg-disabled",
|
|
93
|
+
),
|
|
65
94
|
},
|
|
95
|
+
{
|
|
96
|
+
variant: "secondary",
|
|
97
|
+
danger: true,
|
|
98
|
+
class: cn(
|
|
99
|
+
"border-border-error",
|
|
100
|
+
"text-text-error-primary",
|
|
101
|
+
"hover:text-text-error-primary",
|
|
102
|
+
"hover:bg-bg-error-secondary",
|
|
103
|
+
"active:bg-bg-primary",
|
|
104
|
+
"active:text-text-error-primary",
|
|
105
|
+
),
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
variant: "link",
|
|
109
|
+
danger: true,
|
|
110
|
+
class: cn("text-text-error-secondary", "hover:text-text-error-primary"),
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
variant: "ghost",
|
|
114
|
+
danger: true,
|
|
115
|
+
class: cn(
|
|
116
|
+
"text-text-error-secondary",
|
|
117
|
+
"hover:text-text-error-primary",
|
|
118
|
+
"hover:bg-bg-error-secondary",
|
|
119
|
+
"active:bg-bg-error-tertiary",
|
|
120
|
+
),
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
defaultVariants: {
|
|
124
|
+
variant: "primary",
|
|
125
|
+
size: "regular",
|
|
126
|
+
danger: false,
|
|
66
127
|
},
|
|
67
|
-
);
|
|
128
|
+
});
|
|
68
129
|
|
|
69
130
|
function Button({
|
|
70
131
|
className,
|