@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
|
@@ -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}
|
|
@@ -3,57 +3,309 @@ import type * as React from "react";
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "#shadcn/lib/utils";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// Base icon styles
|
|
7
|
+
const iconBaseClasses = cn(
|
|
8
|
+
// Positioning
|
|
9
|
+
"absolute",
|
|
10
|
+
"top-1/2",
|
|
11
|
+
"-translate-y-1/2",
|
|
12
|
+
"z-10",
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
"
|
|
14
|
+
// Layout & Flexbox
|
|
15
|
+
"flex",
|
|
16
|
+
"items-center",
|
|
17
|
+
"justify-center",
|
|
11
18
|
|
|
12
|
-
|
|
13
|
-
"
|
|
19
|
+
// Cursor & Interactions
|
|
20
|
+
"cursor-default",
|
|
21
|
+
"[&_svg]:pointer-events-none",
|
|
14
22
|
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
// Sizing
|
|
24
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
25
|
+
"shrink-0",
|
|
26
|
+
"[&_svg]:shrink-0",
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
// Left icon positioning
|
|
30
|
+
const iconLeftPosition = cn(
|
|
31
|
+
// Positioning
|
|
32
|
+
"left-3",
|
|
33
|
+
|
|
34
|
+
// Transitions
|
|
35
|
+
"transition-colors",
|
|
36
|
+
"duration-300",
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// Right icon container
|
|
40
|
+
const iconRightContainer = cn(
|
|
41
|
+
// Positioning
|
|
42
|
+
"absolute",
|
|
43
|
+
"right-3",
|
|
44
|
+
"top-1/2",
|
|
45
|
+
"-translate-y-1/2",
|
|
46
|
+
|
|
47
|
+
// Layout & Flexbox
|
|
48
|
+
"flex",
|
|
49
|
+
"gap-2",
|
|
50
|
+
|
|
51
|
+
// Z-index
|
|
52
|
+
"z-10",
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
// Icon color states
|
|
56
|
+
const iconNormalColor = cn(
|
|
57
|
+
// Colors
|
|
58
|
+
"text-text-tertiary",
|
|
59
|
+
|
|
60
|
+
// Transitions
|
|
61
|
+
"transition-colors",
|
|
62
|
+
"duration-300",
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const iconInvalidColor = cn(
|
|
66
|
+
// Colors
|
|
67
|
+
"text-text-tertiary",
|
|
68
|
+
|
|
69
|
+
// Transitions
|
|
70
|
+
"transition-colors",
|
|
71
|
+
"duration-300",
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const iconDisabledColor = cn(
|
|
75
|
+
// Colors
|
|
76
|
+
"text-text-disabled",
|
|
77
|
+
|
|
78
|
+
// Cursor & Interactions
|
|
79
|
+
"hover:cursor-not-allowed",
|
|
80
|
+
|
|
81
|
+
// Transitions
|
|
82
|
+
"transition-colors",
|
|
83
|
+
"duration-300",
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
// Icon wrapper styles
|
|
87
|
+
const iconWrapperClasses = cn(
|
|
88
|
+
// Sizing
|
|
89
|
+
"flex",
|
|
90
|
+
"items-center",
|
|
91
|
+
"[&>svg]:w-full",
|
|
92
|
+
"[&>svg]:h-full",
|
|
93
|
+
"[&>svg]:stroke-[1.5]",
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
// Right icon item styles
|
|
97
|
+
const iconRightItemClasses = cn(
|
|
98
|
+
// Layout & Flexbox
|
|
99
|
+
"flex",
|
|
100
|
+
"items-center",
|
|
101
|
+
"justify-center",
|
|
102
|
+
|
|
103
|
+
// Transitions
|
|
104
|
+
"transition-colors",
|
|
105
|
+
"duration-300",
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
// Suffix styles
|
|
109
|
+
const suffixClasses = cn(
|
|
110
|
+
// Borders
|
|
111
|
+
"border-border-primary",
|
|
112
|
+
"border",
|
|
113
|
+
|
|
114
|
+
// Background & Colors
|
|
115
|
+
"bg-bg-tertiary",
|
|
116
|
+
"text-text-tertiary",
|
|
117
|
+
|
|
118
|
+
// Layout & Flexbox
|
|
119
|
+
"flex",
|
|
120
|
+
"items-center",
|
|
121
|
+
|
|
122
|
+
// Spacing & Sizing
|
|
123
|
+
"rounded-r-md",
|
|
124
|
+
"px-3",
|
|
125
|
+
"py-1",
|
|
126
|
+
|
|
127
|
+
// Typography
|
|
128
|
+
"typo-body",
|
|
129
|
+
|
|
130
|
+
// Cursor & Interactions
|
|
131
|
+
"cursor-default",
|
|
132
|
+
|
|
133
|
+
// Transitions
|
|
134
|
+
"transition-colors",
|
|
135
|
+
"duration-300",
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
// Disabled suffix styles
|
|
139
|
+
const suffixDisabledClasses = cn(
|
|
140
|
+
// Borders
|
|
141
|
+
"border-border-primary",
|
|
142
|
+
"border",
|
|
143
|
+
|
|
144
|
+
// Background & Colors
|
|
145
|
+
"bg-bg-tertiary",
|
|
146
|
+
"text-text-disabled",
|
|
147
|
+
|
|
148
|
+
// Layout & Flexbox
|
|
149
|
+
"flex",
|
|
150
|
+
"items-center",
|
|
21
151
|
|
|
22
|
-
|
|
152
|
+
// Spacing & Sizing
|
|
153
|
+
"rounded-r-md",
|
|
154
|
+
"px-3",
|
|
155
|
+
"py-1",
|
|
156
|
+
|
|
157
|
+
// Typography
|
|
158
|
+
"typo-body",
|
|
159
|
+
|
|
160
|
+
// Cursor & Interactions
|
|
161
|
+
"hover:cursor-not-allowed",
|
|
162
|
+
|
|
163
|
+
// Transitions
|
|
164
|
+
"transition-colors",
|
|
165
|
+
"duration-300",
|
|
166
|
+
);
|
|
23
167
|
|
|
24
|
-
|
|
25
|
-
|
|
168
|
+
// Invalid suffix styles
|
|
169
|
+
const suffixInvalidClasses = cn(
|
|
170
|
+
// Borders
|
|
171
|
+
"border-border-error",
|
|
172
|
+
"border",
|
|
26
173
|
|
|
27
|
-
|
|
28
|
-
"
|
|
174
|
+
// Background & Colors
|
|
175
|
+
"bg-bg-secondary",
|
|
176
|
+
"text-text-tertiary",
|
|
29
177
|
|
|
30
|
-
|
|
31
|
-
"
|
|
178
|
+
// Layout & Flexbox
|
|
179
|
+
"flex",
|
|
180
|
+
"items-center",
|
|
32
181
|
|
|
33
|
-
|
|
34
|
-
"
|
|
182
|
+
// Spacing & Sizing
|
|
183
|
+
"rounded-r-md",
|
|
184
|
+
"px-3",
|
|
185
|
+
"py-1",
|
|
186
|
+
|
|
187
|
+
// Typography
|
|
188
|
+
"typo-body",
|
|
189
|
+
|
|
190
|
+
// Cursor & Interactions
|
|
191
|
+
"cursor-default",
|
|
192
|
+
|
|
193
|
+
// Transitions
|
|
194
|
+
"transition-colors",
|
|
195
|
+
"duration-300",
|
|
196
|
+
);
|
|
35
197
|
|
|
36
198
|
const inputVariants = cva(
|
|
37
199
|
cn(
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"",
|
|
200
|
+
// Sizing & Layout
|
|
201
|
+
"h-9",
|
|
202
|
+
"flex",
|
|
203
|
+
"w-full",
|
|
204
|
+
"min-w-0",
|
|
205
|
+
|
|
206
|
+
// Spacing & Padding
|
|
207
|
+
"px-3",
|
|
208
|
+
"py-2",
|
|
209
|
+
|
|
210
|
+
// Borders
|
|
211
|
+
"border",
|
|
212
|
+
"border-border-primary",
|
|
213
|
+
|
|
214
|
+
// Background & Colors
|
|
215
|
+
"bg-transparent",
|
|
216
|
+
"text-base",
|
|
217
|
+
|
|
218
|
+
// Typography
|
|
219
|
+
"typo-body",
|
|
220
|
+
"md:text-md",
|
|
221
|
+
|
|
222
|
+
// File input styles
|
|
223
|
+
"file:text-text-primary",
|
|
224
|
+
"file:inline-flex",
|
|
225
|
+
"file:h-7",
|
|
226
|
+
"file:border-0",
|
|
227
|
+
"file:bg-transparent",
|
|
228
|
+
"file:text-md",
|
|
229
|
+
"file:font-medium",
|
|
230
|
+
|
|
231
|
+
// Placeholder styles
|
|
232
|
+
"placeholder:text-text-quternary",
|
|
233
|
+
|
|
234
|
+
// Selection styles
|
|
235
|
+
"selection:bg-bg-primary",
|
|
236
|
+
"selection:text-text-primary-foreground",
|
|
237
|
+
"selection:bg-selection",
|
|
238
|
+
|
|
239
|
+
// Hover states
|
|
240
|
+
"hover:border-border-primary_hover",
|
|
241
|
+
|
|
242
|
+
// Focus states
|
|
243
|
+
|
|
244
|
+
"focus-visible:border-border-link",
|
|
245
|
+
|
|
246
|
+
// Invalid states
|
|
247
|
+
"aria-invalid:ring-destructive",
|
|
248
|
+
"aria-invalid:text-text-error-primary",
|
|
249
|
+
"aria-invalid:border-border-error-primary",
|
|
250
|
+
|
|
251
|
+
// Disabled states
|
|
252
|
+
"disabled:bg-bg-secondary",
|
|
253
|
+
"disabled:cursor-not-allowed",
|
|
254
|
+
"disabled:border-border-primary",
|
|
255
|
+
"disabled:text-text-disabled",
|
|
256
|
+
"disabled:placeholder:text-text-disabled",
|
|
257
|
+
|
|
258
|
+
// Transitions
|
|
259
|
+
"transition-all",
|
|
260
|
+
"duration-300",
|
|
261
|
+
|
|
262
|
+
// Outline
|
|
263
|
+
"outline-none",
|
|
264
|
+
|
|
265
|
+
// Border radius
|
|
42
266
|
"rounded-md",
|
|
43
267
|
),
|
|
44
268
|
{
|
|
45
269
|
variants: {
|
|
46
270
|
hasLeftSlot: {
|
|
47
|
-
true:
|
|
271
|
+
true: cn(
|
|
272
|
+
// Left padding for icon
|
|
273
|
+
"pl-9",
|
|
274
|
+
),
|
|
48
275
|
},
|
|
49
276
|
hasRightSlot: {
|
|
50
|
-
true:
|
|
277
|
+
true: cn(
|
|
278
|
+
// Right padding for icon
|
|
279
|
+
"pr-9",
|
|
280
|
+
),
|
|
51
281
|
},
|
|
52
282
|
hasSuffix: {
|
|
53
|
-
true:
|
|
283
|
+
true: cn(
|
|
284
|
+
// Border adjustments for suffix
|
|
285
|
+
"border-r-0",
|
|
286
|
+
"rounded-l-md",
|
|
287
|
+
"rounded-r-none",
|
|
288
|
+
|
|
289
|
+
// Focus adjustments
|
|
290
|
+
"focus-visible:ring-offset-0",
|
|
291
|
+
"focus-visible:border-r-1",
|
|
292
|
+
),
|
|
54
293
|
},
|
|
55
294
|
invalid: {
|
|
56
|
-
true:
|
|
295
|
+
true: cn(
|
|
296
|
+
// Invalid border colors
|
|
297
|
+
"border-border-error",
|
|
298
|
+
"hover:border-border-error_inverse",
|
|
299
|
+
|
|
300
|
+
// Invalid focus states
|
|
301
|
+
"focus-visible:ring-4",
|
|
302
|
+
"focus-visible:ring-ring-red",
|
|
303
|
+
"focus-visible:border-border-error",
|
|
304
|
+
|
|
305
|
+
// Transitions
|
|
306
|
+
"transition-all",
|
|
307
|
+
"duration-300",
|
|
308
|
+
),
|
|
57
309
|
},
|
|
58
310
|
},
|
|
59
311
|
defaultVariants: {
|
|
@@ -4,6 +4,26 @@ import type * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "#shadcn/lib/utils";
|
|
6
6
|
|
|
7
|
+
// Label styles
|
|
8
|
+
const labelStyles = cn(
|
|
9
|
+
// Layout
|
|
10
|
+
"flex",
|
|
11
|
+
"items-center",
|
|
12
|
+
"gap-2",
|
|
13
|
+
// Typography
|
|
14
|
+
"text-text-primary",
|
|
15
|
+
"typo-label",
|
|
16
|
+
"leading-none",
|
|
17
|
+
// Interaction
|
|
18
|
+
"select-none",
|
|
19
|
+
// Group disabled states
|
|
20
|
+
"group-data-[disabled=true]:pointer-events-none",
|
|
21
|
+
"group-data-[disabled=true]:opacity-50",
|
|
22
|
+
// Peer disabled states
|
|
23
|
+
"peer-disabled:cursor-not-allowed",
|
|
24
|
+
"peer-disabled:opacity-50",
|
|
25
|
+
);
|
|
26
|
+
|
|
7
27
|
function Label({
|
|
8
28
|
className,
|
|
9
29
|
...props
|
|
@@ -11,10 +31,7 @@ function Label({
|
|
|
11
31
|
return (
|
|
12
32
|
<LabelPrimitive.Root
|
|
13
33
|
data-slot="label"
|
|
14
|
-
className={cn(
|
|
15
|
-
"flex items-center gap-2 text-text-primary typo-label leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
16
|
-
className,
|
|
17
|
-
)}
|
|
34
|
+
className={cn(labelStyles, className)}
|
|
18
35
|
{...props}
|
|
19
36
|
/>
|
|
20
37
|
);
|