@health-samurai/react-components 0.0.0-alpha.1 → 0.0.0-alpha.3
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 +100 -7
- package/dist/src/components/code-editor/index.js +53 -29
- package/dist/src/components/code-editor/index.js.map +1 -1
- package/dist/src/components/code-editor.stories.js +22 -7
- package/dist/src/components/code-editor.stories.js.map +1 -1
- package/dist/src/components/copy-icon.js +11 -4
- package/dist/src/components/copy-icon.js.map +1 -1
- package/dist/src/components/request-line-editor.js +56 -14
- package/dist/src/components/request-line-editor.js.map +1 -1
- package/dist/src/components/request-line-editor.stories.js +71 -22
- package/dist/src/components/request-line-editor.stories.js.map +1 -1
- package/dist/src/global.d.js +2 -0
- package/dist/src/global.d.js.map +1 -0
- package/dist/src/index.css +6 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +52 -50
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.stories.js +8 -5
- package/dist/src/index.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.js +34 -5
- package/dist/src/shadcn/components/ui/accordion.js.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.stories.js +68 -3
- package/dist/src/shadcn/components/ui/accordion.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.js +61 -14
- package/dist/src/shadcn/components/ui/alert-dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.stories.js +39 -4
- package/dist/src/shadcn/components/ui/alert-dialog.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert.js +24 -8
- package/dist/src/shadcn/components/ui/alert.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert.stories.js +57 -3
- package/dist/src/shadcn/components/ui/alert.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.js +6 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.js.map +1 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.js +12 -3
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.js +17 -4
- package/dist/src/shadcn/components/ui/avatar.js.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.stories.js +69 -3
- package/dist/src/shadcn/components/ui/avatar.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/badge.js +13 -6
- package/dist/src/shadcn/components/ui/badge.js.map +1 -1
- package/dist/src/shadcn/components/ui/badge.stories.js +55 -3
- package/dist/src/shadcn/components/ui/badge.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.js +56 -11
- package/dist/src/shadcn/components/ui/breadcrumb.js.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.stories.js +69 -4
- package/dist/src/shadcn/components/ui/breadcrumb.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/button.js +23 -13
- package/dist/src/shadcn/components/ui/button.js.map +1 -1
- package/dist/src/shadcn/components/ui/button.stories.js +190 -10
- package/dist/src/shadcn/components/ui/button.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/calendar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/calendar.js +76 -33
- package/dist/src/shadcn/components/ui/calendar.js.map +1 -1
- package/dist/src/shadcn/components/ui/calendar.stories.js +12 -5
- package/dist/src/shadcn/components/ui/calendar.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/card.js +38 -9
- package/dist/src/shadcn/components/ui/card.js.map +1 -1
- package/dist/src/shadcn/components/ui/card.stories.js +91 -6
- package/dist/src/shadcn/components/ui/card.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/carousel.js +99 -39
- package/dist/src/shadcn/components/ui/carousel.js.map +1 -1
- package/dist/src/shadcn/components/ui/carousel.stories.js +30 -6
- package/dist/src/shadcn/components/ui/carousel.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/chart.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/chart.js +119 -55
- package/dist/src/shadcn/components/ui/chart.js.map +1 -1
- package/dist/src/shadcn/components/ui/chart.stories.js +72 -12
- package/dist/src/shadcn/components/ui/chart.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.js +15 -2
- package/dist/src/shadcn/components/ui/checkbox.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.stories.js +79 -4
- package/dist/src/shadcn/components/ui/checkbox.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/collapsible.js +13 -3
- package/dist/src/shadcn/components/ui/collapsible.js.map +1 -1
- package/dist/src/shadcn/components/ui/collapsible.stories.js +54 -6
- package/dist/src/shadcn/components/ui/collapsible.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/command.js +77 -12
- package/dist/src/shadcn/components/ui/command.js.map +1 -1
- package/dist/src/shadcn/components/ui/command.stories.js +88 -4
- package/dist/src/shadcn/components/ui/command.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/context-menu.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/context-menu.js +107 -17
- package/dist/src/shadcn/components/ui/context-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/context-menu.stories.js +101 -3
- package/dist/src/shadcn/components/ui/context-menu.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.js +69 -12
- package/dist/src/shadcn/components/ui/dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.stories.js +82 -6
- package/dist/src/shadcn/components/ui/dialog.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.js +62 -12
- package/dist/src/shadcn/components/ui/drawer.js.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.stories.js +154 -21
- package/dist/src/shadcn/components/ui/drawer.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.js +107 -17
- package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.js +119 -4
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/form.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/form.js +59 -18
- package/dist/src/shadcn/components/ui/form.js.map +1 -1
- package/dist/src/shadcn/components/ui/form.stories.js +45 -11
- package/dist/src/shadcn/components/ui/form.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/hover-card.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/hover-card.js +21 -4
- package/dist/src/shadcn/components/ui/hover-card.js.map +1 -1
- package/dist/src/shadcn/components/ui/hover-card.stories.js +51 -5
- package/dist/src/shadcn/components/ui/hover-card.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/input-otp.js +35 -7
- package/dist/src/shadcn/components/ui/input-otp.js.map +1 -1
- package/dist/src/shadcn/components/ui/input-otp.stories.js +35 -3
- package/dist/src/shadcn/components/ui/input-otp.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/input.js +59 -40
- package/dist/src/shadcn/components/ui/input.js.map +1 -1
- package/dist/src/shadcn/components/ui/input.stories.js +391 -23
- package/dist/src/shadcn/components/ui/input.stories.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 -2
- package/dist/src/shadcn/components/ui/label.js.map +1 -1
- package/dist/src/shadcn/components/ui/label.stories.js +18 -4
- package/dist/src/shadcn/components/ui/label.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.js +116 -19
- package/dist/src/shadcn/components/ui/menubar.js.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.stories.js +216 -3
- package/dist/src/shadcn/components/ui/menubar.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/navigation-menu.js +62 -10
- package/dist/src/shadcn/components/ui/navigation-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/navigation-menu.stories.js +263 -11
- package/dist/src/shadcn/components/ui/navigation-menu.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.js +73 -16
- package/dist/src/shadcn/components/ui/pagination.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.stories.js +41 -3
- package/dist/src/shadcn/components/ui/pagination.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/popover.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/popover.js +24 -5
- package/dist/src/shadcn/components/ui/popover.js.map +1 -1
- package/dist/src/shadcn/components/ui/popover.stories.js +99 -6
- package/dist/src/shadcn/components/ui/popover.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/progress.js +14 -2
- package/dist/src/shadcn/components/ui/progress.js.map +1 -1
- package/dist/src/shadcn/components/ui/progress.stories.js +12 -8
- package/dist/src/shadcn/components/ui/progress.stories.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 +20 -3
- package/dist/src/shadcn/components/ui/radio-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.stories.js +48 -4
- package/dist/src/shadcn/components/ui/radio-group.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.js +22 -4
- package/dist/src/shadcn/components/ui/resizable.js.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.stories.js +49 -3
- package/dist/src/shadcn/components/ui/resizable.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 +27 -5
- package/dist/src/shadcn/components/ui/scroll-area.js.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.stories.js +30 -5
- package/dist/src/shadcn/components/ui/scroll-area.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.js +98 -19
- package/dist/src/shadcn/components/ui/select.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.stories.js +84 -5
- 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 +10 -2
- package/dist/src/shadcn/components/ui/separator.js.map +1 -1
- package/dist/src/shadcn/components/ui/separator.stories.js +43 -3
- package/dist/src/shadcn/components/ui/separator.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/sheet.js +69 -16
- package/dist/src/shadcn/components/ui/sheet.js.map +1 -1
- package/dist/src/shadcn/components/ui/sheet.stories.js +77 -6
- package/dist/src/shadcn/components/ui/sheet.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.js +305 -79
- package/dist/src/shadcn/components/ui/sidebar.js.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.stories.js +321 -59
- package/dist/src/shadcn/components/ui/sidebar.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.js +7 -2
- package/dist/src/shadcn/components/ui/skeleton.js.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.stories.js +22 -3
- package/dist/src/shadcn/components/ui/skeleton.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/slider.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/slider.js +41 -7
- package/dist/src/shadcn/components/ui/slider.js.map +1 -1
- package/dist/src/shadcn/components/ui/slider.stories.js +11 -3
- package/dist/src/shadcn/components/ui/slider.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.js +10 -4
- package/dist/src/shadcn/components/ui/sonner.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.stories.js +14 -9
- 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 +12 -2
- package/dist/src/shadcn/components/ui/switch.js.map +1 -1
- package/dist/src/shadcn/components/ui/switch.stories.js +16 -4
- package/dist/src/shadcn/components/ui/switch.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/table.js +47 -10
- package/dist/src/shadcn/components/ui/table.js.map +1 -1
- package/dist/src/shadcn/components/ui/table.stories.js +72 -11
- package/dist/src/shadcn/components/ui/table.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.d.ts +9 -5
- package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.js +76 -18
- package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts +6 -0
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.stories.js +221 -10
- package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.js +7 -2
- package/dist/src/shadcn/components/ui/textarea.js.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.stories.js +6 -3
- package/dist/src/shadcn/components/ui/textarea.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.js +29 -8
- package/dist/src/shadcn/components/ui/toggle-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.stories.js +30 -3
- package/dist/src/shadcn/components/ui/toggle-group.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.js +16 -7
- package/dist/src/shadcn/components/ui/toggle.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.stories.js +9 -3
- package/dist/src/shadcn/components/ui/toggle.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.js +27 -5
- package/dist/src/shadcn/components/ui/tooltip.js.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.stories.js +20 -4
- package/dist/src/shadcn/components/ui/tooltip.stories.js.map +1 -1
- package/dist/src/shadcn/hooks/use-mobile.js +4 -3
- package/dist/src/shadcn/hooks/use-mobile.js.map +1 -1
- package/dist/src/shadcn/lib/utils.js +1 -0
- package/dist/src/shadcn/lib/utils.js.map +1 -1
- package/package.json +8 -4
- package/src/index.css +6 -0
- package/src/index.tsx +1 -0
- package/src/shadcn/components/ui/aspect-ratio.tsx +1 -0
- package/src/shadcn/components/ui/calendar.tsx +1 -0
- package/src/shadcn/components/ui/chart.tsx +1 -0
- package/src/shadcn/components/ui/checkbox.tsx +1 -0
- package/src/shadcn/components/ui/context-menu.tsx +1 -0
- package/src/shadcn/components/ui/drawer.tsx +1 -0
- package/src/shadcn/components/ui/form.tsx +1 -0
- package/src/shadcn/components/ui/hover-card.tsx +1 -0
- package/src/shadcn/components/ui/label.tsx +1 -0
- package/src/shadcn/components/ui/popover.tsx +1 -0
- package/src/shadcn/components/ui/radio-group.tsx +1 -0
- package/src/shadcn/components/ui/scroll-area.tsx +1 -0
- package/src/shadcn/components/ui/separator.tsx +1 -0
- package/src/shadcn/components/ui/sidebar.tsx +1 -0
- package/src/shadcn/components/ui/slider.tsx +1 -0
- package/src/shadcn/components/ui/switch.tsx +1 -0
- package/src/shadcn/components/ui/tabs.stories.tsx +57 -0
- package/src/shadcn/components/ui/tabs.tsx +77 -26
- package/src/shadcn/components/ui/tooltip.tsx +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
-
import { cn } from "
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
4
|
const iconBaseClasses = "absolute top-1/2 -translate-y-1/2 cursor-pointer z-10 flex items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0";
|
|
5
5
|
const iconLeftPosition = "left-3 hover:text-text-tertiary hover:cursor-default transition-colors duration-300";
|
|
6
6
|
const iconRightContainer = "absolute right-3 top-1/2 -translate-y-1/2 flex gap-2 z-10";
|
|
@@ -15,65 +15,84 @@ const suffixInvalidClasses = "border-border-error bg-bg-secondary flex items-cen
|
|
|
15
15
|
const inputVariants = cva(cn("h-9 file:text-text-primary placeholder:text-text-quternary disabled:placeholder:text-text-disabled selection:bg-bg-primary selection:text-text-primary-foreground border-border-primary hover:border-border-primary_hover flex w-full min-w-0 border bg-transparent px-3 py-2 typo-body text-base transition-all duration-300 outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-md file:font-medium disabled:bg-bg-secondary disabled:cursor-not-allowed disabled:border-border-primary md:text-md selection:bg-selection", "focus-visible:ring-4 focus-visible:ring-ring-blue focus-visible:border-border-link", "aria-invalid:ring-destructive aria-invalid:text-text-error-primary aria-invalid:border-border-error-primary", "", "rounded-md"), {
|
|
16
16
|
variants: {
|
|
17
17
|
hasLeftSlot: {
|
|
18
|
-
true: "pl-9"
|
|
18
|
+
true: "pl-9"
|
|
19
19
|
},
|
|
20
20
|
hasRightSlot: {
|
|
21
|
-
true: "pr-9"
|
|
21
|
+
true: "pr-9"
|
|
22
22
|
},
|
|
23
23
|
hasSuffix: {
|
|
24
|
-
true: "border-r-0 focus-visible:ring-offset-0 rounded-l-md rounded-r-none focus-visible:border-r-1"
|
|
24
|
+
true: "border-r-0 focus-visible:ring-offset-0 rounded-l-md rounded-r-none focus-visible:border-r-1"
|
|
25
25
|
},
|
|
26
26
|
invalid: {
|
|
27
|
-
true: "border-border-error focus-visible:ring-4 focus-visible:ring-ring-red focus-visible:border-border-error hover:border-border-error_inverse transition-all duration-300"
|
|
28
|
-
}
|
|
27
|
+
true: "border-border-error focus-visible:ring-4 focus-visible:ring-ring-red focus-visible:border-border-error hover:border-border-error_inverse transition-all duration-300"
|
|
28
|
+
}
|
|
29
29
|
},
|
|
30
30
|
defaultVariants: {
|
|
31
31
|
hasSuffix: false,
|
|
32
|
-
invalid: false
|
|
33
|
-
}
|
|
32
|
+
invalid: false
|
|
33
|
+
}
|
|
34
34
|
});
|
|
35
35
|
function Input({ className, type, invalid, suffix, leftSlot, rightSlot, ...props }) {
|
|
36
36
|
const processedLeftSlot = leftSlot === "None" ? undefined : leftSlot;
|
|
37
37
|
const processedRightSlot = rightSlot === "None" ? undefined : rightSlot;
|
|
38
|
-
const hasLeftIcon = processedLeftSlot &&
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
? iconInvalidColor
|
|
51
|
-
: iconNormalColor;
|
|
52
|
-
return (_jsx("div", { className: `${iconBaseClasses} ${iconLeftPosition} ${colorClasses}`, children: _jsx("div", { className: iconWrapperClasses, children: processedLeftSlot }) }));
|
|
38
|
+
const hasLeftIcon = processedLeftSlot && processedLeftSlot !== null && processedLeftSlot !== undefined;
|
|
39
|
+
const hasRightIcon = processedRightSlot && processedRightSlot !== null && processedRightSlot !== undefined;
|
|
40
|
+
const renderLeftSlot = ()=>{
|
|
41
|
+
if (!hasLeftIcon) return null;
|
|
42
|
+
const colorClasses = props.disabled ? iconDisabledColor : invalid ? iconInvalidColor : iconNormalColor;
|
|
43
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
44
|
+
className: `${iconBaseClasses} ${iconLeftPosition} ${colorClasses}`,
|
|
45
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
46
|
+
className: iconWrapperClasses,
|
|
47
|
+
children: processedLeftSlot
|
|
48
|
+
})
|
|
49
|
+
});
|
|
53
50
|
};
|
|
54
|
-
const renderRightSlot = ()
|
|
55
|
-
if (!hasRightIcon)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
:
|
|
60
|
-
|
|
61
|
-
:
|
|
62
|
-
|
|
51
|
+
const renderRightSlot = ()=>{
|
|
52
|
+
if (!hasRightIcon) return null;
|
|
53
|
+
const colorClasses = props.disabled ? iconDisabledColor : invalid ? iconInvalidColor : iconNormalColor;
|
|
54
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
55
|
+
className: `${iconRightContainer} ${iconBaseClasses}`,
|
|
56
|
+
children: hasRightIcon && /*#__PURE__*/ _jsx("div", {
|
|
57
|
+
className: `${iconRightItemClasses} ${colorClasses}`,
|
|
58
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
59
|
+
className: iconWrapperClasses,
|
|
60
|
+
children: processedRightSlot
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
});
|
|
63
64
|
};
|
|
64
65
|
// Input tag
|
|
65
|
-
const inputElement =
|
|
66
|
+
const inputElement = /*#__PURE__*/ _jsx("input", {
|
|
67
|
+
type: type,
|
|
68
|
+
"data-slot": "input",
|
|
69
|
+
className: cn(inputVariants({
|
|
66
70
|
invalid,
|
|
67
71
|
hasLeftSlot: !!leftSlot,
|
|
68
72
|
hasRightSlot: !!rightSlot,
|
|
69
73
|
hasSuffix: !!suffix,
|
|
70
|
-
className
|
|
71
|
-
})),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
className
|
|
75
|
+
})),
|
|
76
|
+
...props
|
|
77
|
+
});
|
|
78
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
79
|
+
className: "flex w-full min-w-0",
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
82
|
+
className: "flex-1 relative",
|
|
83
|
+
children: [
|
|
84
|
+
renderLeftSlot(),
|
|
85
|
+
inputElement,
|
|
86
|
+
renderRightSlot()
|
|
87
|
+
]
|
|
88
|
+
}),
|
|
89
|
+
suffix && /*#__PURE__*/ _jsx("div", {
|
|
90
|
+
className: props.disabled ? suffixDisabledClasses : invalid ? suffixInvalidClasses : suffixClasses,
|
|
91
|
+
children: suffix
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
});
|
|
77
95
|
}
|
|
78
96
|
export { Input, inputVariants };
|
|
97
|
+
|
|
79
98
|
//# sourceMappingURL=input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/shadcn/components/ui/input.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\nconst iconBaseClasses =\n\t\"absolute top-1/2 -translate-y-1/2 cursor-pointer z-10 flex items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0\";\n\nconst iconLeftPosition =\n\t\"left-3 hover:text-text-tertiary hover:cursor-default transition-colors duration-300\";\n\nconst iconRightContainer =\n\t\"absolute right-3 top-1/2 -translate-y-1/2 flex gap-2 z-10\";\n\nconst iconNormalColor =\n\t\"text-text-tertiary hover:text-fg-secondary transition-colors duration-300\";\nconst iconInvalidColor =\n\t\"text-fg-tertiary hover:text-fg-secondary transition-colors duration-300\";\nconst iconDisabledColor =\n\t\"text-text-disabled hover:cursor-not-allowed transition-colors duration-300\";\n\nconst iconWrapperClasses = \"[&>svg]:w-full [&>svg]:h-full [&>svg]:stroke-[1.5]\";\n\nconst iconRightItemClasses =\n\t\"cursor-pointer flex items-center justify-center transition-colors duration-300\";\n\nconst suffixClasses =\n\t\"border-border-primary bg-bg-tertiary text-text-tertiary flex items-center rounded-r-md border px-3 py-1 typo-body cursor-default transition-colors duration-300\";\n\nconst suffixDisabledClasses =\n\t\"border-border-primary bg-bg-tertiary text-text-disabled flex items-center rounded-r-md border px-3 py-1 typo-body hover:cursor-not-allowed transition-colors duration-300\";\n\nconst suffixInvalidClasses =\n\t\"border-border-error bg-bg-secondary flex items-center rounded-r-md border px-3 py-1 text-text-tertiary typo-body cursor-default transition-colors duration-300\";\n\nconst inputVariants = cva(\n\tcn(\n\t\t\"h-9 file:text-text-primary placeholder:text-text-quternary disabled:placeholder:text-text-disabled selection:bg-bg-primary selection:text-text-primary-foreground border-border-primary hover:border-border-primary_hover flex w-full min-w-0 border bg-transparent px-3 py-2 typo-body text-base transition-all duration-300 outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-md file:font-medium disabled:bg-bg-secondary disabled:cursor-not-allowed disabled:border-border-primary md:text-md selection:bg-selection\",\n\t\t\"focus-visible:ring-4 focus-visible:ring-ring-blue focus-visible:border-border-link\",\n\t\t\"aria-invalid:ring-destructive aria-invalid:text-text-error-primary aria-invalid:border-border-error-primary\",\n\t\t\"\",\n\t\t\"rounded-md\",\n\t),\n\t{\n\t\tvariants: {\n\t\t\thasLeftSlot: {\n\t\t\t\ttrue: \"pl-9\",\n\t\t\t},\n\t\t\thasRightSlot: {\n\t\t\t\ttrue: \"pr-9\",\n\t\t\t},\n\t\t\thasSuffix: {\n\t\t\t\ttrue: \"border-r-0 focus-visible:ring-offset-0 rounded-l-md rounded-r-none focus-visible:border-r-1\",\n\t\t\t},\n\t\t\tinvalid: {\n\t\t\t\ttrue: \"border-border-error focus-visible:ring-4 focus-visible:ring-ring-red focus-visible:border-border-error hover:border-border-error_inverse transition-all duration-300\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\thasSuffix: false,\n\t\t\tinvalid: false,\n\t\t},\n\t},\n);\n\ninterface InputProps\n\textends React.ComponentProps<\"input\">,\n\t\tVariantProps<typeof inputVariants> {\n\ttype?: \"text\" | \"password\";\n\tsuffix?: string;\n\tinvalid?: boolean;\n\tleftSlot?: React.ReactNode;\n\trightSlot?: React.ReactNode;\n}\n\nfunction Input({\n\tclassName,\n\ttype,\n\tinvalid,\n\tsuffix,\n\tleftSlot,\n\trightSlot,\n\t...props\n}: InputProps) {\n\tconst processedLeftSlot = leftSlot === \"None\" ? undefined : leftSlot;\n\tconst processedRightSlot = rightSlot === \"None\" ? undefined : rightSlot;\n\n\tconst hasLeftIcon =\n\t\tprocessedLeftSlot &&\n\t\tprocessedLeftSlot !== null &&\n\t\tprocessedLeftSlot !== undefined;\n\tconst hasRightIcon =\n\t\tprocessedRightSlot &&\n\t\tprocessedRightSlot !== null &&\n\t\tprocessedRightSlot !== undefined;\n\n\tconst renderLeftSlot = () => {\n\t\tif (!hasLeftIcon) return null;\n\t\tconst colorClasses = props.disabled\n\t\t\t? iconDisabledColor\n\t\t\t: invalid\n\t\t\t\t? iconInvalidColor\n\t\t\t\t: iconNormalColor;\n\t\treturn (\n\t\t\t<div className={`${iconBaseClasses} ${iconLeftPosition} ${colorClasses}`}>\n\t\t\t\t<div className={iconWrapperClasses}>{processedLeftSlot}</div>\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderRightSlot = () => {\n\t\tif (!hasRightIcon) return null;\n\n\t\tconst colorClasses = props.disabled\n\t\t\t? iconDisabledColor\n\t\t\t: invalid\n\t\t\t\t? iconInvalidColor\n\t\t\t\t: iconNormalColor;\n\n\t\treturn (\n\t\t\t<div className={`${iconRightContainer} ${iconBaseClasses}`}>\n\t\t\t\t{hasRightIcon && (\n\t\t\t\t\t<div className={`${iconRightItemClasses} ${colorClasses}`}>\n\t\t\t\t\t\t<div className={iconWrapperClasses}>{processedRightSlot}</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// Input tag\n\tconst inputElement = (\n\t\t<input\n\t\t\ttype={type}\n\t\t\tdata-slot=\"input\"\n\t\t\tclassName={cn(\n\t\t\t\tinputVariants({\n\t\t\t\t\tinvalid,\n\t\t\t\t\thasLeftSlot: !!leftSlot,\n\t\t\t\t\thasRightSlot: !!rightSlot,\n\t\t\t\t\thasSuffix: !!suffix,\n\t\t\t\t\tclassName,\n\t\t\t\t}),\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n\n\treturn (\n\t\t<div className=\"flex w-full min-w-0\">\n\t\t\t<div className=\"flex-1 relative\">\n\t\t\t\t{renderLeftSlot()}\n\t\t\t\t{inputElement}\n\t\t\t\t{renderRightSlot()}\n\t\t\t</div>\n\t\t\t{suffix && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={\n\t\t\t\t\t\tprops.disabled\n\t\t\t\t\t\t\t? suffixDisabledClasses\n\t\t\t\t\t\t\t: invalid\n\t\t\t\t\t\t\t\t? suffixInvalidClasses\n\t\t\t\t\t\t\t\t: suffixClasses\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{suffix}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport { Input, inputVariants };\n"],"names":["cva","cn","iconBaseClasses","iconLeftPosition","iconRightContainer","iconNormalColor","iconInvalidColor","iconDisabledColor","iconWrapperClasses","iconRightItemClasses","suffixClasses","suffixDisabledClasses","suffixInvalidClasses","inputVariants","variants","hasLeftSlot","true","hasRightSlot","hasSuffix","invalid","defaultVariants","Input","className","type","suffix","leftSlot","rightSlot","props","processedLeftSlot","undefined","processedRightSlot","hasLeftIcon","hasRightIcon","renderLeftSlot","colorClasses","disabled","div","renderRightSlot","inputElement","input","data-slot"],"mappings":";AAAA,SAASA,GAAG,QAA2B,2BAA2B;AAGlE,SAASC,EAAE,QAAQ,qBAAoB;AAEvC,MAAMC,kBACL;AAED,MAAMC,mBACL;AAED,MAAMC,qBACL;AAED,MAAMC,kBACL;AACD,MAAMC,mBACL;AACD,MAAMC,oBACL;AAED,MAAMC,qBAAqB;AAE3B,MAAMC,uBACL;AAED,MAAMC,gBACL;AAED,MAAMC,wBACL;AAED,MAAMC,uBACL;AAED,MAAMC,gBAAgBb,IACrBC,GACC,8hBACA,sFACA,+GACA,IACA,eAED;IACCa,UAAU;QACTC,aAAa;YACZC,MAAM;QACP;QACAC,cAAc;YACbD,MAAM;QACP;QACAE,WAAW;YACVF,MAAM;QACP;QACAG,SAAS;YACRH,MAAM;QACP;IACD;IACAI,iBAAiB;QAChBF,WAAW;QACXC,SAAS;IACV;AACD;AAaD,SAASE,MAAM,EACdC,SAAS,EACTC,IAAI,EACJJ,OAAO,EACPK,MAAM,EACNC,QAAQ,EACRC,SAAS,EACT,GAAGC,OACS;IACZ,MAAMC,oBAAoBH,aAAa,SAASI,YAAYJ;IAC5D,MAAMK,qBAAqBJ,cAAc,SAASG,YAAYH;IAE9D,MAAMK,cACLH,qBACAA,sBAAsB,QACtBA,sBAAsBC;IACvB,MAAMG,eACLF,sBACAA,uBAAuB,QACvBA,uBAAuBD;IAExB,MAAMI,iBAAiB;QACtB,IAAI,CAACF,aAAa,OAAO;QACzB,MAAMG,eAAeP,MAAMQ,QAAQ,GAChC5B,oBACAY,UACCb,mBACAD;QACJ,qBACC,KAAC+B;YAAId,WAAW,GAAGpB,gBAAgB,CAAC,EAAEC,iBAAiB,CAAC,EAAE+B,cAAc;sBACvE,cAAA,KAACE;gBAAId,WAAWd;0BAAqBoB;;;IAGxC;IAEA,MAAMS,kBAAkB;QACvB,IAAI,CAACL,cAAc,OAAO;QAE1B,MAAME,eAAeP,MAAMQ,QAAQ,GAChC5B,oBACAY,UACCb,mBACAD;QAEJ,qBACC,KAAC+B;YAAId,WAAW,GAAGlB,mBAAmB,CAAC,EAAEF,iBAAiB;sBACxD8B,8BACA,KAACI;gBAAId,WAAW,GAAGb,qBAAqB,CAAC,EAAEyB,cAAc;0BACxD,cAAA,KAACE;oBAAId,WAAWd;8BAAqBsB;;;;IAK1C;IAEA,YAAY;IACZ,MAAMQ,6BACL,KAACC;QACAhB,MAAMA;QACNiB,aAAU;QACVlB,WAAWrB,GACVY,cAAc;YACbM;YACAJ,aAAa,CAAC,CAACU;YACfR,cAAc,CAAC,CAACS;YAChBR,WAAW,CAAC,CAACM;YACbF;QACD;QAEA,GAAGK,KAAK;;IAIX,qBACC,MAACS;QAAId,WAAU;;0BACd,MAACc;gBAAId,WAAU;;oBACbW;oBACAK;oBACAD;;;YAEDb,wBACA,KAACY;gBACAd,WACCK,MAAMQ,QAAQ,GACXxB,wBACAQ,UACCP,uBACAF;0BAGJc;;;;AAKN;AAEA,SAASH,KAAK,EAAER,aAAa,GAAG"}
|
|
@@ -1,19 +1,39 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CircleX, Copy, Mail } from "lucide-react";
|
|
3
|
-
import { Badge } from "
|
|
4
|
-
import { Input } from "
|
|
5
|
-
import { Label } from "
|
|
6
|
-
function InputWithLabel({ label = "Label", description = "This is a hint text to help user.", invalid = false, disabled = false, placeholder = "Placeholder", leftSlot, rightSlot, suffix
|
|
7
|
-
const descriptionColor = invalid
|
|
8
|
-
|
|
9
|
-
:
|
|
10
|
-
|
|
11
|
-
: "
|
|
12
|
-
|
|
3
|
+
import { Badge } from "./badge.js";
|
|
4
|
+
import { Input } from "./input.js";
|
|
5
|
+
import { Label } from "./label.js";
|
|
6
|
+
function InputWithLabel({ label = "Label", description = "This is a hint text to help user.", invalid = false, disabled = false, placeholder = "Placeholder", leftSlot, rightSlot, suffix }) {
|
|
7
|
+
const descriptionColor = invalid ? "text-text-error-primary" : disabled ? "text-text-disabled" : "text-text-secondary";
|
|
8
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
9
|
+
className: "flex w-full",
|
|
10
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
11
|
+
className: "space-y-2 w-full",
|
|
12
|
+
children: [
|
|
13
|
+
/*#__PURE__*/ _jsx(Label, {
|
|
14
|
+
children: label
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
17
|
+
placeholder: placeholder,
|
|
18
|
+
leftSlot: leftSlot,
|
|
19
|
+
rightSlot: rightSlot,
|
|
20
|
+
...suffix && {
|
|
21
|
+
suffix
|
|
22
|
+
},
|
|
23
|
+
invalid: invalid,
|
|
24
|
+
disabled: disabled
|
|
25
|
+
}),
|
|
26
|
+
/*#__PURE__*/ _jsx("p", {
|
|
27
|
+
className: `typo-body ${descriptionColor}`,
|
|
28
|
+
children: description
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
});
|
|
13
33
|
}
|
|
14
34
|
const meta = {
|
|
15
35
|
title: "Component/Input",
|
|
16
|
-
component: Input
|
|
36
|
+
component: Input
|
|
17
37
|
};
|
|
18
38
|
export default meta;
|
|
19
39
|
export const Default = {
|
|
@@ -21,19 +41,367 @@ export const Default = {
|
|
|
21
41
|
type: "text",
|
|
22
42
|
placeholder: "Placeholder",
|
|
23
43
|
leftSlot: undefined,
|
|
24
|
-
rightSlot: undefined
|
|
25
|
-
}
|
|
44
|
+
rightSlot: undefined
|
|
45
|
+
}
|
|
26
46
|
};
|
|
27
47
|
export const Demo = {
|
|
28
|
-
render: ()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
render: ()=>/*#__PURE__*/ _jsx("div", {
|
|
49
|
+
className: "p-6 min-h-screen flex justify-center items-center",
|
|
50
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
51
|
+
className: "rounded-lg p-6 shadow-sm w-280",
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
54
|
+
className: "flex items-center mb-4 justify-between",
|
|
55
|
+
children: [
|
|
56
|
+
/*#__PURE__*/ _jsx("div", {
|
|
57
|
+
className: "w-40 text-left",
|
|
58
|
+
children: "Inputs without labels"
|
|
59
|
+
}),
|
|
60
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
61
|
+
className: "w-70 text-left text-sm text-text-secondary",
|
|
62
|
+
children: [
|
|
63
|
+
"Invalid:",
|
|
64
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
65
|
+
variant: "outline",
|
|
66
|
+
className: "text-xs ml-2",
|
|
67
|
+
children: "false"
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
}),
|
|
71
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
72
|
+
className: "w-70 text-left text-sm text-text-secondary",
|
|
73
|
+
children: [
|
|
74
|
+
"Invalid:",
|
|
75
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
76
|
+
variant: "outline",
|
|
77
|
+
className: "text-xs ml-2",
|
|
78
|
+
children: "true"
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}),
|
|
82
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
83
|
+
className: "w-70 text-left text-sm text-text-secondary",
|
|
84
|
+
children: [
|
|
85
|
+
"Disabled:",
|
|
86
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
87
|
+
variant: "outline",
|
|
88
|
+
className: "text-xs ml-2",
|
|
89
|
+
children: "true"
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
}),
|
|
95
|
+
[
|
|
96
|
+
"none",
|
|
97
|
+
"left",
|
|
98
|
+
"right",
|
|
99
|
+
"both",
|
|
100
|
+
"left-double-right"
|
|
101
|
+
].map((variant)=>{
|
|
102
|
+
const variantLabel = {
|
|
103
|
+
none: "None",
|
|
104
|
+
left: "leftSlot",
|
|
105
|
+
right: "rightSlot",
|
|
106
|
+
both: "leftSlot + rightSlot",
|
|
107
|
+
"left-double-right": "BothPlusExtra"
|
|
108
|
+
}[variant];
|
|
109
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
110
|
+
className: "items-center gap-3 py-3 border-gray-l00 border-t border-border-separator",
|
|
111
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
112
|
+
className: "flex gap-3 items-center py-2 justify-between",
|
|
113
|
+
children: [
|
|
114
|
+
/*#__PURE__*/ _jsx("div", {
|
|
115
|
+
className: "w-40 text-sm text-text-secondary",
|
|
116
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
117
|
+
className: "flex",
|
|
118
|
+
children: [
|
|
119
|
+
/*#__PURE__*/ _jsx("div", {
|
|
120
|
+
className: "w-15",
|
|
121
|
+
children: "Slots:"
|
|
122
|
+
}),
|
|
123
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
124
|
+
variant: "outline",
|
|
125
|
+
className: "text-xs",
|
|
126
|
+
children: variantLabel
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
})
|
|
130
|
+
}),
|
|
131
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
132
|
+
className: "w-70 flex gap-3 justify-center",
|
|
133
|
+
children: [
|
|
134
|
+
variant === "none" && /*#__PURE__*/ _jsx(Input, {
|
|
135
|
+
placeholder: "Placeholder"
|
|
136
|
+
}),
|
|
137
|
+
variant === "left" && /*#__PURE__*/ _jsx(Input, {
|
|
138
|
+
placeholder: "Placeholder",
|
|
139
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {})
|
|
140
|
+
}),
|
|
141
|
+
variant === "right" && /*#__PURE__*/ _jsx(Input, {
|
|
142
|
+
placeholder: "Placeholder",
|
|
143
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {})
|
|
144
|
+
}),
|
|
145
|
+
variant === "both" && /*#__PURE__*/ _jsx(Input, {
|
|
146
|
+
placeholder: "Placeholder",
|
|
147
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
148
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {})
|
|
149
|
+
}),
|
|
150
|
+
variant === "left-double-right" && /*#__PURE__*/ _jsx(Input, {
|
|
151
|
+
placeholder: "Placeholder",
|
|
152
|
+
className: "pr-15",
|
|
153
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
154
|
+
rightSlot: /*#__PURE__*/ _jsxs("div", {
|
|
155
|
+
className: "flex items-center gap-2",
|
|
156
|
+
children: [
|
|
157
|
+
/*#__PURE__*/ _jsx(CircleX, {}),
|
|
158
|
+
/*#__PURE__*/ _jsx(Copy, {})
|
|
159
|
+
]
|
|
160
|
+
}),
|
|
161
|
+
suffix: "milliseconds"
|
|
162
|
+
})
|
|
163
|
+
]
|
|
164
|
+
}),
|
|
165
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
166
|
+
className: "w-70 flex gap-3 justify-center",
|
|
167
|
+
children: [
|
|
168
|
+
variant === "none" && /*#__PURE__*/ _jsx(Input, {
|
|
169
|
+
placeholder: "Placeholder",
|
|
170
|
+
invalid: true
|
|
171
|
+
}),
|
|
172
|
+
variant === "left" && /*#__PURE__*/ _jsx(Input, {
|
|
173
|
+
placeholder: "Placeholder",
|
|
174
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
175
|
+
invalid: true
|
|
176
|
+
}),
|
|
177
|
+
variant === "right" && /*#__PURE__*/ _jsx(Input, {
|
|
178
|
+
placeholder: "Placeholder",
|
|
179
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
180
|
+
invalid: true
|
|
181
|
+
}),
|
|
182
|
+
variant === "both" && /*#__PURE__*/ _jsx(Input, {
|
|
183
|
+
placeholder: "Placeholder",
|
|
184
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
185
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
186
|
+
invalid: true
|
|
187
|
+
}),
|
|
188
|
+
variant === "left-double-right" && /*#__PURE__*/ _jsx(Input, {
|
|
189
|
+
placeholder: "Placeholder",
|
|
190
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
191
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
192
|
+
suffix: "milliseconds",
|
|
193
|
+
invalid: true
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
}),
|
|
197
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
198
|
+
className: "w-70 flex gap-3 justify-center",
|
|
199
|
+
children: [
|
|
200
|
+
variant === "none" && /*#__PURE__*/ _jsx(Input, {
|
|
201
|
+
placeholder: "Aidbox",
|
|
202
|
+
disabled: true
|
|
203
|
+
}),
|
|
204
|
+
variant === "left" && /*#__PURE__*/ _jsx(Input, {
|
|
205
|
+
placeholder: "Aidbox",
|
|
206
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
207
|
+
disabled: true
|
|
208
|
+
}),
|
|
209
|
+
variant === "right" && /*#__PURE__*/ _jsx(Input, {
|
|
210
|
+
placeholder: "Aidbox",
|
|
211
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
212
|
+
disabled: true
|
|
213
|
+
}),
|
|
214
|
+
variant === "both" && /*#__PURE__*/ _jsx(Input, {
|
|
215
|
+
placeholder: "Aidbox",
|
|
216
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
217
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
218
|
+
disabled: true
|
|
219
|
+
}),
|
|
220
|
+
variant === "left-double-right" && /*#__PURE__*/ _jsx(Input, {
|
|
221
|
+
placeholder: "Aidbox",
|
|
222
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
223
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
224
|
+
suffix: "milliseconds",
|
|
225
|
+
disabled: true
|
|
226
|
+
})
|
|
227
|
+
]
|
|
228
|
+
})
|
|
229
|
+
]
|
|
230
|
+
})
|
|
231
|
+
}, variant);
|
|
232
|
+
}),
|
|
233
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
234
|
+
className: "mt-8",
|
|
235
|
+
children: [
|
|
236
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
237
|
+
className: "flex items-center mb-4 justify-between",
|
|
238
|
+
children: [
|
|
239
|
+
/*#__PURE__*/ _jsx("div", {
|
|
240
|
+
className: "w-40 text-left",
|
|
241
|
+
children: "Input + Label + Description"
|
|
242
|
+
}),
|
|
243
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
244
|
+
className: "w-70 text-left text-sm text-text-secondary",
|
|
245
|
+
children: [
|
|
246
|
+
"Invalid:",
|
|
247
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
248
|
+
variant: "outline",
|
|
249
|
+
className: "text-xs",
|
|
250
|
+
children: "false"
|
|
251
|
+
})
|
|
252
|
+
]
|
|
253
|
+
}),
|
|
254
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
255
|
+
className: "w-70 text-left text-sm text-text-secondary",
|
|
256
|
+
children: [
|
|
257
|
+
"Invalid:",
|
|
258
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
259
|
+
variant: "outline",
|
|
260
|
+
className: "text-xs",
|
|
261
|
+
children: "true"
|
|
262
|
+
})
|
|
263
|
+
]
|
|
264
|
+
}),
|
|
265
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
266
|
+
className: "w-70 text-left text-sm text-text-secondary",
|
|
267
|
+
children: [
|
|
268
|
+
"Disabled:",
|
|
269
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
270
|
+
variant: "outline",
|
|
271
|
+
className: "text-xs",
|
|
272
|
+
children: "true"
|
|
273
|
+
})
|
|
274
|
+
]
|
|
275
|
+
})
|
|
276
|
+
]
|
|
277
|
+
}),
|
|
278
|
+
[
|
|
279
|
+
"none",
|
|
280
|
+
"left",
|
|
281
|
+
"right",
|
|
282
|
+
"both",
|
|
283
|
+
"left-double-right"
|
|
284
|
+
].map((variant)=>/*#__PURE__*/ _jsx("div", {
|
|
285
|
+
className: "items-center gap-3 py-3 border-gray-l00 border-t border-border-separator",
|
|
286
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
287
|
+
className: "flex gap-3 items-center py-2 justify-between",
|
|
288
|
+
children: [
|
|
289
|
+
/*#__PURE__*/ _jsx("div", {
|
|
290
|
+
className: "w-40 text-sm text-text-secondary",
|
|
291
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
292
|
+
className: "flex",
|
|
293
|
+
children: [
|
|
294
|
+
/*#__PURE__*/ _jsx("div", {
|
|
295
|
+
className: "w-15",
|
|
296
|
+
children: "Slots:"
|
|
297
|
+
}),
|
|
298
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
299
|
+
variant: "outline",
|
|
300
|
+
className: "text-xs",
|
|
301
|
+
children: variant
|
|
302
|
+
})
|
|
303
|
+
]
|
|
304
|
+
})
|
|
305
|
+
}),
|
|
306
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
307
|
+
className: "w-70 flex gap-3 justify-center",
|
|
308
|
+
children: [
|
|
309
|
+
variant === "none" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
310
|
+
placeholder: "Placeholder"
|
|
311
|
+
}),
|
|
312
|
+
variant === "left" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
313
|
+
placeholder: "Placeholder",
|
|
314
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {})
|
|
315
|
+
}),
|
|
316
|
+
variant === "right" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
317
|
+
placeholder: "Placeholder",
|
|
318
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {})
|
|
319
|
+
}),
|
|
320
|
+
variant === "both" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
321
|
+
placeholder: "Placeholder",
|
|
322
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
323
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {})
|
|
324
|
+
}),
|
|
325
|
+
variant === "left-double-right" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
326
|
+
placeholder: "Placeholder",
|
|
327
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
328
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
329
|
+
suffix: "milliseconds"
|
|
330
|
+
})
|
|
331
|
+
]
|
|
332
|
+
}),
|
|
333
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
334
|
+
className: "w-70 flex gap-3 justify-center",
|
|
335
|
+
children: [
|
|
336
|
+
variant === "none" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
337
|
+
placeholder: "Placeholder",
|
|
338
|
+
invalid: true
|
|
339
|
+
}),
|
|
340
|
+
variant === "left" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
341
|
+
placeholder: "Placeholder",
|
|
342
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
343
|
+
invalid: true
|
|
344
|
+
}),
|
|
345
|
+
variant === "right" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
346
|
+
placeholder: "Placeholder",
|
|
347
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
348
|
+
invalid: true
|
|
349
|
+
}),
|
|
350
|
+
variant === "both" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
351
|
+
placeholder: "Placeholder",
|
|
352
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
353
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
354
|
+
invalid: true
|
|
355
|
+
}),
|
|
356
|
+
variant === "left-double-right" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
357
|
+
placeholder: "Placeholder",
|
|
358
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
359
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
360
|
+
suffix: "milliseconds",
|
|
361
|
+
invalid: true
|
|
362
|
+
})
|
|
363
|
+
]
|
|
364
|
+
}),
|
|
365
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
366
|
+
className: "w-70 flex gap-3 justify-center",
|
|
367
|
+
children: [
|
|
368
|
+
variant === "none" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
369
|
+
placeholder: "Aidbox",
|
|
370
|
+
disabled: true
|
|
371
|
+
}),
|
|
372
|
+
variant === "left" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
373
|
+
placeholder: "Aidbox",
|
|
374
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
375
|
+
disabled: true
|
|
376
|
+
}),
|
|
377
|
+
variant === "right" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
378
|
+
placeholder: "Aidbox",
|
|
379
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
380
|
+
disabled: true
|
|
381
|
+
}),
|
|
382
|
+
variant === "both" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
383
|
+
placeholder: "Aidbox",
|
|
384
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
385
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
386
|
+
disabled: true
|
|
387
|
+
}),
|
|
388
|
+
variant === "left-double-right" && /*#__PURE__*/ _jsx(InputWithLabel, {
|
|
389
|
+
placeholder: "Aidbox",
|
|
390
|
+
leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
|
|
391
|
+
rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
|
|
392
|
+
suffix: "milliseconds",
|
|
393
|
+
disabled: true
|
|
394
|
+
})
|
|
395
|
+
]
|
|
396
|
+
})
|
|
397
|
+
]
|
|
398
|
+
})
|
|
399
|
+
}, `label-${variant}`))
|
|
400
|
+
]
|
|
401
|
+
})
|
|
402
|
+
]
|
|
403
|
+
})
|
|
404
|
+
})
|
|
38
405
|
};
|
|
406
|
+
|
|
39
407
|
//# sourceMappingURL=input.stories.js.map
|