@codefast/ui 0.3.10 → 0.3.11-canary.0
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/CHANGELOG.md +19 -0
- package/README.md +277 -167
- package/dist/components/accordion.cjs +5 -5
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +5 -5
- package/dist/components/alert-dialog.cjs +9 -9
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +9 -9
- package/dist/components/alert.cjs +5 -5
- package/dist/components/alert.d.ts +5 -5
- package/dist/components/alert.js +5 -5
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/avatar.cjs +3 -3
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.cjs +7 -7
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +7 -7
- package/dist/components/breadcrumb.cjs +6 -8
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +6 -8
- package/dist/components/button-group.cjs +8 -8
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +8 -8
- package/dist/components/button.cjs +17 -17
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +17 -17
- package/dist/components/calendar.cjs +35 -35
- package/dist/components/calendar.d.ts +5 -5
- package/dist/components/calendar.js +35 -35
- package/dist/components/card.cjs +7 -7
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +7 -7
- package/dist/components/carousel.cjs +20 -20
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +20 -20
- package/dist/components/chart.cjs +42 -42
- package/dist/components/chart.d.ts +12 -11
- package/dist/components/chart.js +42 -42
- package/dist/components/checkbox-cards.cjs +2 -2
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +2 -2
- package/dist/components/checkbox-group.cjs +2 -2
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/command.cjs +10 -10
- package/dist/components/command.d.ts +4 -4
- package/dist/components/command.js +10 -10
- package/dist/components/context-menu.cjs +10 -10
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +10 -10
- package/dist/components/dialog.cjs +12 -12
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +12 -12
- package/dist/components/drawer.cjs +9 -9
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +9 -9
- package/dist/components/dropdown-menu.cjs +10 -10
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +10 -10
- package/dist/components/empty.cjs +10 -10
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +10 -10
- package/dist/components/field.cjs +17 -17
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +17 -17
- package/dist/components/form.cjs +8 -8
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +8 -8
- package/dist/components/hover-card.cjs +3 -3
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +3 -3
- package/dist/components/input-group.cjs +20 -20
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +20 -20
- package/dist/components/input-number.cjs +7 -7
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +7 -7
- package/dist/components/input-otp.cjs +4 -4
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +4 -4
- package/dist/components/input-password.cjs +6 -6
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +6 -6
- package/dist/components/input-search.cjs +4 -4
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +4 -4
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +1 -1
- package/dist/components/item.cjs +23 -23
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +23 -23
- package/dist/components/kbd.cjs +2 -2
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +2 -2
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +1 -1
- package/dist/components/menubar.cjs +13 -13
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +13 -13
- package/dist/components/native-select.cjs +2 -2
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +2 -2
- package/dist/components/navigation-menu.cjs +10 -10
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +10 -10
- package/dist/components/pagination.cjs +6 -6
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +6 -6
- package/dist/components/popover.cjs +3 -3
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +3 -3
- package/dist/components/progress-circle.cjs +22 -22
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +22 -22
- package/dist/components/progress.cjs +2 -2
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-cards.cjs +3 -3
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +3 -3
- package/dist/components/radio-group.cjs +3 -3
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +3 -3
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +1 -1
- package/dist/components/resizable.cjs +3 -3
- package/dist/components/resizable.d.ts +2 -2
- package/dist/components/resizable.js +3 -3
- package/dist/components/scroll-area.cjs +31 -31
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +31 -31
- package/dist/components/select.cjs +9 -9
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +9 -9
- package/dist/components/separator.cjs +9 -9
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +9 -9
- package/dist/components/sheet.cjs +17 -17
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +17 -17
- package/dist/components/sidebar.cjs +65 -65
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +65 -65
- package/dist/components/skeleton.cjs +1 -1
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.cjs +4 -4
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +4 -4
- package/dist/components/sonner.cjs +4 -4
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +4 -4
- package/dist/components/spinner.cjs +5 -5
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +5 -5
- package/dist/components/switch.cjs +2 -2
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +2 -2
- package/dist/components/table.cjs +8 -8
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +8 -8
- package/dist/components/tabs.cjs +4 -4
- package/dist/components/tabs.d.ts +2 -2
- package/dist/components/tabs.js +4 -4
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.cjs +5 -5
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle-group.js +5 -5
- package/dist/components/toggle.cjs +8 -8
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/toggle.js +8 -8
- package/dist/components/tooltip.cjs +2 -2
- package/dist/components/tooltip.d.ts +3 -3
- package/dist/components/tooltip.js +2 -2
- package/dist/css/preset.css +4 -4
- package/dist/css/style.css +3 -3
- package/dist/hooks/use-copy-to-clipboard.cjs +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -1
- package/dist/hooks/use-media-query.cjs +3 -3
- package/dist/hooks/use-media-query.js +3 -3
- package/dist/hooks/use-mutation-observer.d.ts +1 -1
- package/dist/hooks/use-pagination.cjs +1 -1
- package/dist/hooks/use-pagination.js +1 -1
- package/dist/index.d.ts +130 -130
- package/dist/primitives/checkbox-group.cjs +3 -3
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +3 -3
- package/dist/primitives/input-number.cjs +46 -46
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +46 -46
- package/dist/primitives/input.cjs +7 -7
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +7 -7
- package/dist/primitives/progress-circle.cjs +8 -8
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +8 -8
- package/package.json +38 -42
|
@@ -37,7 +37,7 @@ function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaul
|
|
|
37
37
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(input_number_cjs_namespaceObject.Root, {
|
|
38
38
|
ariaDecrementLabel: ariaDecrementLabel,
|
|
39
39
|
ariaIncrementLabel: ariaIncrementLabel,
|
|
40
|
-
className: (0, tailwind_variants_namespaceObject.cn)("group border-input
|
|
40
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group peer flex h-9 w-full grow items-center gap-3 rounded-lg border border-input px-3 pr-0 text-base transition not-has-disabled:shadow-xs focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 hover:not-has-disabled:not-focus-within:border-ring/60 has-disabled:opacity-50 has-aria-invalid:border-destructive focus-within:has-aria-invalid:ring-destructive/20 hover:not-has-disabled:not-focus-within:has-aria-invalid:border-destructive/60 md:text-sm dark:bg-input/30 dark:focus-within:has-aria-invalid:ring-destructive/40 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>svg]:text-muted-foreground", className),
|
|
41
41
|
"data-slot": "input-number",
|
|
42
42
|
defaultValue: defaultValue,
|
|
43
43
|
disabled: disabled,
|
|
@@ -59,19 +59,19 @@ function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaul
|
|
|
59
59
|
autoCapitalize: "none",
|
|
60
60
|
autoComplete: "off",
|
|
61
61
|
autoCorrect: "off",
|
|
62
|
-
className: "
|
|
62
|
+
className: "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
63
63
|
spellCheck: "false",
|
|
64
64
|
...props
|
|
65
65
|
}),
|
|
66
66
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
67
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
67
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group-hover:not-group-focus-within:not-has-disabled:border-l-border-ring/60 group-hover:not-group-focus-within:not-has-disabled:divide-border-ring/60 order-last ml-auto grid h-full shrink-0 divide-y divide-input border-l border-l-input transition group-focus-within:divide-ring group-focus-within:border-l-ring group-has-aria-invalid:divide-destructive group-has-aria-invalid:border-l-destructive group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:divide-destructive/60 group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:border-l-destructive/60", "*:[button]:focus-visible:bg-ring/50 *:[button]:focus-visible:ring-0 group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/20 dark:group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/40"),
|
|
68
68
|
"data-slot": "input-number-buttons",
|
|
69
69
|
children: [
|
|
70
70
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(input_number_cjs_namespaceObject.IncrementButton, {
|
|
71
71
|
"aria-label": "Increment",
|
|
72
72
|
className: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
73
|
-
className:
|
|
74
|
-
variant:
|
|
73
|
+
className: "text-muted-foreground h-auto rounded-none rounded-tr-[calc(var(--radius-lg)-1px)]",
|
|
74
|
+
variant: "ghost"
|
|
75
75
|
}),
|
|
76
76
|
"data-slot": "input-number-increment-button",
|
|
77
77
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronUpIcon, {})
|
|
@@ -79,8 +79,8 @@ function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaul
|
|
|
79
79
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(input_number_cjs_namespaceObject.DecrementButton, {
|
|
80
80
|
"aria-label": "Decrement",
|
|
81
81
|
className: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
82
|
-
className:
|
|
83
|
-
variant:
|
|
82
|
+
className: "text-muted-foreground h-auto rounded-none rounded-br-[calc(var(--radius-lg)-1px)]",
|
|
83
|
+
variant: "ghost"
|
|
84
84
|
}),
|
|
85
85
|
"data-slot": "input-number-decrement-button",
|
|
86
86
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDownIcon, {})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as InputNumberPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as InputNumberPrimitive from "../primitives/input-number";
|
|
3
3
|
interface InputNumberProps extends ComponentProps<typeof InputNumberPrimitive.Field>, ComponentProps<typeof InputNumberPrimitive.Root> {
|
|
4
4
|
}
|
|
5
5
|
declare function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaultValue, disabled, formatOptions, id, loaderPosition, loading, max, min, onChange, prefix, readOnly, spinner, step, suffix, value, ...props }: InputNumberProps): JSX.Element;
|
|
@@ -9,7 +9,7 @@ function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaul
|
|
|
9
9
|
return /*#__PURE__*/ jsxs(Root, {
|
|
10
10
|
ariaDecrementLabel: ariaDecrementLabel,
|
|
11
11
|
ariaIncrementLabel: ariaIncrementLabel,
|
|
12
|
-
className: cn("group border-input
|
|
12
|
+
className: cn("group peer flex h-9 w-full grow items-center gap-3 rounded-lg border border-input px-3 pr-0 text-base transition not-has-disabled:shadow-xs focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 hover:not-has-disabled:not-focus-within:border-ring/60 has-disabled:opacity-50 has-aria-invalid:border-destructive focus-within:has-aria-invalid:ring-destructive/20 hover:not-has-disabled:not-focus-within:has-aria-invalid:border-destructive/60 md:text-sm dark:bg-input/30 dark:focus-within:has-aria-invalid:ring-destructive/40 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>svg]:text-muted-foreground", className),
|
|
13
13
|
"data-slot": "input-number",
|
|
14
14
|
defaultValue: defaultValue,
|
|
15
15
|
disabled: disabled,
|
|
@@ -31,19 +31,19 @@ function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaul
|
|
|
31
31
|
autoCapitalize: "none",
|
|
32
32
|
autoComplete: "off",
|
|
33
33
|
autoCorrect: "off",
|
|
34
|
-
className: "
|
|
34
|
+
className: "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
35
35
|
spellCheck: "false",
|
|
36
36
|
...props
|
|
37
37
|
}),
|
|
38
38
|
/*#__PURE__*/ jsxs("div", {
|
|
39
|
-
className: cn(
|
|
39
|
+
className: cn("group-hover:not-group-focus-within:not-has-disabled:border-l-border-ring/60 group-hover:not-group-focus-within:not-has-disabled:divide-border-ring/60 order-last ml-auto grid h-full shrink-0 divide-y divide-input border-l border-l-input transition group-focus-within:divide-ring group-focus-within:border-l-ring group-has-aria-invalid:divide-destructive group-has-aria-invalid:border-l-destructive group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:divide-destructive/60 group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:border-l-destructive/60", "*:[button]:focus-visible:bg-ring/50 *:[button]:focus-visible:ring-0 group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/20 dark:group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/40"),
|
|
40
40
|
"data-slot": "input-number-buttons",
|
|
41
41
|
children: [
|
|
42
42
|
/*#__PURE__*/ jsx(IncrementButton, {
|
|
43
43
|
"aria-label": "Increment",
|
|
44
44
|
className: buttonVariants({
|
|
45
|
-
className:
|
|
46
|
-
variant:
|
|
45
|
+
className: "text-muted-foreground h-auto rounded-none rounded-tr-[calc(var(--radius-lg)-1px)]",
|
|
46
|
+
variant: "ghost"
|
|
47
47
|
}),
|
|
48
48
|
"data-slot": "input-number-increment-button",
|
|
49
49
|
children: /*#__PURE__*/ jsx(ChevronUpIcon, {})
|
|
@@ -51,8 +51,8 @@ function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaul
|
|
|
51
51
|
/*#__PURE__*/ jsx(DecrementButton, {
|
|
52
52
|
"aria-label": "Decrement",
|
|
53
53
|
className: buttonVariants({
|
|
54
|
-
className:
|
|
55
|
-
variant:
|
|
54
|
+
className: "text-muted-foreground h-auto rounded-none rounded-br-[calc(var(--radius-lg)-1px)]",
|
|
55
|
+
variant: "ghost"
|
|
56
56
|
}),
|
|
57
57
|
"data-slot": "input-number-decrement-button",
|
|
58
58
|
children: /*#__PURE__*/ jsx(ChevronDownIcon, {})
|
|
@@ -42,14 +42,14 @@ function InputOTP({ className, containerClassName, ...props }) {
|
|
|
42
42
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_otp_namespaceObject.OTPInput, {
|
|
43
43
|
"aria-label": "One-time password",
|
|
44
44
|
className: (0, tailwind_variants_namespaceObject.cn)(className),
|
|
45
|
-
containerClassName: (0, tailwind_variants_namespaceObject.cn)(
|
|
45
|
+
containerClassName: (0, tailwind_variants_namespaceObject.cn)("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
|
|
46
46
|
"data-slot": "input-otp",
|
|
47
47
|
...props
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
function InputOTPGroup({ className, ...props }) {
|
|
51
51
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
52
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
52
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex items-center -space-x-px", className),
|
|
53
53
|
"data-slot": "input-otp-group",
|
|
54
54
|
role: "group",
|
|
55
55
|
...props
|
|
@@ -59,7 +59,7 @@ function InputOTPSlot({ className, index, ...props }) {
|
|
|
59
59
|
const inputOTPContext = (0, external_react_namespaceObject.use)(external_input_otp_namespaceObject.OTPInputContext);
|
|
60
60
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
61
61
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
62
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
62
|
+
className: (0, tailwind_variants_namespaceObject.cn)("relative flex size-9 items-center justify-center border border-input text-sm outline-hidden transition-all not-has-disabled:shadow-xs first:rounded-l-lg last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", className),
|
|
63
63
|
"data-active": isActive,
|
|
64
64
|
"data-slot": "input-otp-slot",
|
|
65
65
|
...props,
|
|
@@ -68,7 +68,7 @@ function InputOTPSlot({ className, index, ...props }) {
|
|
|
68
68
|
hasFakeCaret ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
69
69
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
70
70
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
71
|
-
className: "animate-caret-blink bg-foreground animation-duration-1000
|
|
71
|
+
className: "h-4 w-px animate-caret-blink bg-foreground animation-duration-1000"
|
|
72
72
|
})
|
|
73
73
|
}) : null
|
|
74
74
|
]
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import { OTPInput } from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import { OTPInput } from "input-otp";
|
|
3
3
|
type InputOTPProps = ComponentProps<typeof OTPInput>;
|
|
4
4
|
declare function InputOTP({ className, containerClassName, ...props }: InputOTPProps): JSX.Element;
|
|
5
|
-
type InputOTPGroupProps = ComponentProps<
|
|
5
|
+
type InputOTPGroupProps = ComponentProps<"div">;
|
|
6
6
|
declare function InputOTPGroup({ className, ...props }: InputOTPGroupProps): JSX.Element;
|
|
7
|
-
interface InputOTPSlotProps extends ComponentProps<
|
|
7
|
+
interface InputOTPSlotProps extends ComponentProps<"div"> {
|
|
8
8
|
index: number;
|
|
9
9
|
}
|
|
10
10
|
declare function InputOTPSlot({ className, index, ...props }: InputOTPSlotProps): JSX.Element;
|
|
11
|
-
type InputOTPSeparatorProps = ComponentProps<
|
|
11
|
+
type InputOTPSeparatorProps = ComponentProps<"div">;
|
|
12
12
|
declare function InputOTPSeparator({ ...props }: InputOTPSeparatorProps): JSX.Element;
|
|
13
|
-
export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from
|
|
13
|
+
export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
|
|
14
14
|
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
15
15
|
export type { InputOTPGroupProps, InputOTPProps, InputOTPSeparatorProps, InputOTPSlotProps };
|
|
@@ -8,14 +8,14 @@ function InputOTP({ className, containerClassName, ...props }) {
|
|
|
8
8
|
return /*#__PURE__*/ jsx(OTPInput, {
|
|
9
9
|
"aria-label": "One-time password",
|
|
10
10
|
className: cn(className),
|
|
11
|
-
containerClassName: cn(
|
|
11
|
+
containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
|
|
12
12
|
"data-slot": "input-otp",
|
|
13
13
|
...props
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
function InputOTPGroup({ className, ...props }) {
|
|
17
17
|
return /*#__PURE__*/ jsx("div", {
|
|
18
|
-
className: cn(
|
|
18
|
+
className: cn("flex items-center -space-x-px", className),
|
|
19
19
|
"data-slot": "input-otp-group",
|
|
20
20
|
role: "group",
|
|
21
21
|
...props
|
|
@@ -25,7 +25,7 @@ function InputOTPSlot({ className, index, ...props }) {
|
|
|
25
25
|
const inputOTPContext = use(OTPInputContext);
|
|
26
26
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
27
27
|
return /*#__PURE__*/ jsxs("div", {
|
|
28
|
-
className: cn(
|
|
28
|
+
className: cn("relative flex size-9 items-center justify-center border border-input text-sm outline-hidden transition-all not-has-disabled:shadow-xs first:rounded-l-lg last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", className),
|
|
29
29
|
"data-active": isActive,
|
|
30
30
|
"data-slot": "input-otp-slot",
|
|
31
31
|
...props,
|
|
@@ -34,7 +34,7 @@ function InputOTPSlot({ className, index, ...props }) {
|
|
|
34
34
|
hasFakeCaret ? /*#__PURE__*/ jsx("div", {
|
|
35
35
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
36
36
|
children: /*#__PURE__*/ jsx("div", {
|
|
37
|
-
className: "animate-caret-blink bg-foreground animation-duration-1000
|
|
37
|
+
className: "h-4 w-px animate-caret-blink bg-foreground animation-duration-1000"
|
|
38
38
|
})
|
|
39
39
|
}) : null
|
|
40
40
|
]
|
|
@@ -32,13 +32,13 @@ const external_lucide_react_namespaceObject = require("lucide-react");
|
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
33
|
const external_input_group_cjs_namespaceObject = require("./input-group.cjs");
|
|
34
34
|
function InputPassword({ className, disabled, readOnly, ...props }) {
|
|
35
|
-
const [type, setType] = (0, external_react_namespaceObject.useState)(
|
|
35
|
+
const [type, setType] = (0, external_react_namespaceObject.useState)("password");
|
|
36
36
|
const togglePasswordVisibility = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
37
|
-
setType((previous)=>
|
|
37
|
+
setType((previous)=>"password" === previous ? "text" : "password");
|
|
38
38
|
}, []);
|
|
39
39
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
|
|
40
40
|
className: className,
|
|
41
|
-
"data-disabled": disabled ?
|
|
41
|
+
"data-disabled": disabled ? "true" : void 0,
|
|
42
42
|
"data-slot": "input-password",
|
|
43
43
|
children: [
|
|
44
44
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupInput, {
|
|
@@ -50,15 +50,15 @@ function InputPassword({ className, disabled, readOnly, ...props }) {
|
|
|
50
50
|
...props
|
|
51
51
|
}),
|
|
52
52
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupButton, {
|
|
53
|
-
"aria-label":
|
|
54
|
-
className: "focus-visible:not-disabled:bg-input
|
|
53
|
+
"aria-label": "password" === type ? "Show password" : "Hide password",
|
|
54
|
+
className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
|
|
55
55
|
"data-slot": "input-password-toggle",
|
|
56
56
|
disabled: disabled,
|
|
57
57
|
size: "icon-sm",
|
|
58
58
|
type: "button",
|
|
59
59
|
variant: "ghost",
|
|
60
60
|
onClick: togglePasswordVisibility,
|
|
61
|
-
children:
|
|
61
|
+
children: "password" === type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.EyeOffIcon, {}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.EyeIcon, {})
|
|
62
62
|
})
|
|
63
63
|
]
|
|
64
64
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import { InputGroupInput } from
|
|
3
|
-
type InputPasswordProps = Omit<ComponentProps<typeof InputGroupInput>,
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import { InputGroupInput } from "./input-group";
|
|
3
|
+
type InputPasswordProps = Omit<ComponentProps<typeof InputGroupInput>, "type">;
|
|
4
4
|
declare function InputPassword({ className, disabled, readOnly, ...props }: InputPasswordProps): JSX.Element;
|
|
5
5
|
export { InputPassword };
|
|
6
6
|
export type { InputPasswordProps };
|
|
@@ -4,13 +4,13 @@ import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
|
4
4
|
import { useCallback, useState } from "react";
|
|
5
5
|
import { InputGroup, InputGroupButton, InputGroupInput } from "./input-group.js";
|
|
6
6
|
function InputPassword({ className, disabled, readOnly, ...props }) {
|
|
7
|
-
const [type, setType] = useState(
|
|
7
|
+
const [type, setType] = useState("password");
|
|
8
8
|
const togglePasswordVisibility = useCallback(()=>{
|
|
9
|
-
setType((previous)=>
|
|
9
|
+
setType((previous)=>"password" === previous ? "text" : "password");
|
|
10
10
|
}, []);
|
|
11
11
|
return /*#__PURE__*/ jsxs(InputGroup, {
|
|
12
12
|
className: className,
|
|
13
|
-
"data-disabled": disabled ?
|
|
13
|
+
"data-disabled": disabled ? "true" : void 0,
|
|
14
14
|
"data-slot": "input-password",
|
|
15
15
|
children: [
|
|
16
16
|
/*#__PURE__*/ jsx(InputGroupInput, {
|
|
@@ -22,15 +22,15 @@ function InputPassword({ className, disabled, readOnly, ...props }) {
|
|
|
22
22
|
...props
|
|
23
23
|
}),
|
|
24
24
|
/*#__PURE__*/ jsx(InputGroupButton, {
|
|
25
|
-
"aria-label":
|
|
26
|
-
className: "focus-visible:not-disabled:bg-input
|
|
25
|
+
"aria-label": "password" === type ? "Show password" : "Hide password",
|
|
26
|
+
className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
|
|
27
27
|
"data-slot": "input-password-toggle",
|
|
28
28
|
disabled: disabled,
|
|
29
29
|
size: "icon-sm",
|
|
30
30
|
type: "button",
|
|
31
31
|
variant: "ghost",
|
|
32
32
|
onClick: togglePasswordVisibility,
|
|
33
|
-
children:
|
|
33
|
+
children: "password" === type ? /*#__PURE__*/ jsx(EyeOffIcon, {}) : /*#__PURE__*/ jsx(EyeIcon, {})
|
|
34
34
|
})
|
|
35
35
|
]
|
|
36
36
|
});
|
|
@@ -39,7 +39,7 @@ function InputSearch({ className, defaultValue, disabled, onChange, readOnly, va
|
|
|
39
39
|
});
|
|
40
40
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
|
|
41
41
|
className: className,
|
|
42
|
-
"data-disabled": disabled ?
|
|
42
|
+
"data-disabled": disabled ? "true" : void 0,
|
|
43
43
|
"data-slot": "input-search",
|
|
44
44
|
children: [
|
|
45
45
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
@@ -51,7 +51,7 @@ function InputSearch({ className, defaultValue, disabled, onChange, readOnly, va
|
|
|
51
51
|
disabled: disabled,
|
|
52
52
|
readOnly: readOnly,
|
|
53
53
|
type: "search",
|
|
54
|
-
value: value ??
|
|
54
|
+
value: value ?? "",
|
|
55
55
|
onChange: (event)=>{
|
|
56
56
|
setValue(event.target.value);
|
|
57
57
|
},
|
|
@@ -59,13 +59,13 @@ function InputSearch({ className, defaultValue, disabled, onChange, readOnly, va
|
|
|
59
59
|
}),
|
|
60
60
|
value ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupButton, {
|
|
61
61
|
"aria-label": "Clear search",
|
|
62
|
-
className: "focus-visible:not-disabled:bg-input
|
|
62
|
+
className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
|
|
63
63
|
"data-slot": "input-search-clear",
|
|
64
64
|
disabled: disabled ?? readOnly,
|
|
65
65
|
size: "icon-sm",
|
|
66
66
|
variant: "ghost",
|
|
67
67
|
onClick: ()=>{
|
|
68
|
-
setValue(
|
|
68
|
+
setValue("");
|
|
69
69
|
},
|
|
70
70
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.XIcon, {})
|
|
71
71
|
}) : null
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import { InputGroupInput } from
|
|
3
|
-
interface InputSearchProps extends Omit<ComponentProps<typeof InputGroupInput>,
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import { InputGroupInput } from "./input-group";
|
|
3
|
+
interface InputSearchProps extends Omit<ComponentProps<typeof InputGroupInput>, "defaultValue" | "onChange" | "type" | "value"> {
|
|
4
4
|
defaultValue?: string;
|
|
5
5
|
onChange?: (value?: string) => void;
|
|
6
6
|
value?: string;
|
|
@@ -11,7 +11,7 @@ function InputSearch({ className, defaultValue, disabled, onChange, readOnly, va
|
|
|
11
11
|
});
|
|
12
12
|
return /*#__PURE__*/ jsxs(InputGroup, {
|
|
13
13
|
className: className,
|
|
14
|
-
"data-disabled": disabled ?
|
|
14
|
+
"data-disabled": disabled ? "true" : void 0,
|
|
15
15
|
"data-slot": "input-search",
|
|
16
16
|
children: [
|
|
17
17
|
/*#__PURE__*/ jsx(InputGroupAddon, {
|
|
@@ -23,7 +23,7 @@ function InputSearch({ className, defaultValue, disabled, onChange, readOnly, va
|
|
|
23
23
|
disabled: disabled,
|
|
24
24
|
readOnly: readOnly,
|
|
25
25
|
type: "search",
|
|
26
|
-
value: value ??
|
|
26
|
+
value: value ?? "",
|
|
27
27
|
onChange: (event)=>{
|
|
28
28
|
setValue(event.target.value);
|
|
29
29
|
},
|
|
@@ -31,13 +31,13 @@ function InputSearch({ className, defaultValue, disabled, onChange, readOnly, va
|
|
|
31
31
|
}),
|
|
32
32
|
value ? /*#__PURE__*/ jsx(InputGroupButton, {
|
|
33
33
|
"aria-label": "Clear search",
|
|
34
|
-
className: "focus-visible:not-disabled:bg-input
|
|
34
|
+
className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
|
|
35
35
|
"data-slot": "input-search-clear",
|
|
36
36
|
disabled: disabled ?? readOnly,
|
|
37
37
|
size: "icon-sm",
|
|
38
38
|
variant: "ghost",
|
|
39
39
|
onClick: ()=>{
|
|
40
|
-
setValue(
|
|
40
|
+
setValue("");
|
|
41
41
|
},
|
|
42
42
|
children: /*#__PURE__*/ jsx(XIcon, {})
|
|
43
43
|
}) : null
|
|
@@ -31,7 +31,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
31
31
|
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
32
32
|
function Input({ className, type, ...props }) {
|
|
33
33
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", {
|
|
34
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
34
|
+
className: (0, tailwind_variants_namespaceObject.cn)("h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className),
|
|
35
35
|
"data-slot": "input",
|
|
36
36
|
type: type,
|
|
37
37
|
...props
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
type InputProps = ComponentProps<
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
type InputProps = ComponentProps<"input">;
|
|
3
3
|
declare function Input({ className, type, ...props }: InputProps): JSX.Element;
|
|
4
4
|
export { Input };
|
|
5
5
|
export type { InputProps };
|
package/dist/components/input.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
4
4
|
function Input({ className, type, ...props }) {
|
|
5
5
|
return /*#__PURE__*/ jsx("input", {
|
|
6
|
-
className: cn(
|
|
6
|
+
className: cn("h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className),
|
|
7
7
|
"data-slot": "input",
|
|
8
8
|
type: type,
|
|
9
9
|
...props
|
package/dist/components/item.cjs
CHANGED
|
@@ -42,39 +42,39 @@ const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants")
|
|
|
42
42
|
const react_slot_namespaceObject = require("@radix-ui/react-slot");
|
|
43
43
|
const external_separator_cjs_namespaceObject = require("./separator.cjs");
|
|
44
44
|
const itemVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
45
|
-
base: (0, tailwind_variants_namespaceObject.cn)(
|
|
45
|
+
base: (0, tailwind_variants_namespaceObject.cn)("group/item flex flex-wrap items-center rounded-lg border border-transparent text-sm outline-hidden transition-colors duration-100", "[a]:transition-colors [a]:hover:bg-accent/50", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50"),
|
|
46
46
|
defaultVariants: {
|
|
47
|
-
size:
|
|
48
|
-
variant:
|
|
47
|
+
size: "default",
|
|
48
|
+
variant: "default"
|
|
49
49
|
},
|
|
50
50
|
variants: {
|
|
51
51
|
size: {
|
|
52
|
-
default:
|
|
53
|
-
sm:
|
|
52
|
+
default: "gap-4 p-4",
|
|
53
|
+
sm: "gap-2.5 px-4 py-3"
|
|
54
54
|
},
|
|
55
55
|
variant: {
|
|
56
|
-
default:
|
|
57
|
-
muted:
|
|
58
|
-
outline:
|
|
56
|
+
default: "bg-transparent",
|
|
57
|
+
muted: "bg-muted/50",
|
|
58
|
+
outline: "border-border"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
const itemMediaVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
63
|
-
base: (0, tailwind_variants_namespaceObject.cn)("group-has-[[data-slot=item-description]]/item:self-start
|
|
63
|
+
base: (0, tailwind_variants_namespaceObject.cn)("flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start", "group-has-[[data-slot=item-description]]/item:translate-y-0.5 [&_svg]:pointer-events-none"),
|
|
64
64
|
defaultVariants: {
|
|
65
|
-
variant:
|
|
65
|
+
variant: "default"
|
|
66
66
|
},
|
|
67
67
|
variants: {
|
|
68
68
|
variant: {
|
|
69
|
-
default:
|
|
69
|
+
default: "bg-transparent",
|
|
70
70
|
icon: "size-8 shrink-0 rounded-md border bg-muted [&_svg:not([class*='size-'])]:size-4",
|
|
71
|
-
image:
|
|
71
|
+
image: "size-10 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover"
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
function ItemGroup({ className, ...props }) {
|
|
76
76
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
77
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
77
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/item-group flex flex-col", className),
|
|
78
78
|
"data-slot": "item-group",
|
|
79
79
|
role: "list",
|
|
80
80
|
...props
|
|
@@ -82,14 +82,14 @@ function ItemGroup({ className, ...props }) {
|
|
|
82
82
|
}
|
|
83
83
|
function ItemSeparator({ className, ...props }) {
|
|
84
84
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_separator_cjs_namespaceObject.Separator, {
|
|
85
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
85
|
+
className: (0, tailwind_variants_namespaceObject.cn)("my-0", className),
|
|
86
86
|
"data-slot": "item-separator",
|
|
87
87
|
orientation: "horizontal",
|
|
88
88
|
...props
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
function Item({ asChild = false, className, size =
|
|
92
|
-
const Component = asChild ? react_slot_namespaceObject.Slot :
|
|
91
|
+
function Item({ asChild = false, className, size = "default", variant = "default", ...props }) {
|
|
92
|
+
const Component = asChild ? react_slot_namespaceObject.Slot : "div";
|
|
93
93
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, {
|
|
94
94
|
className: itemVariants({
|
|
95
95
|
className,
|
|
@@ -102,7 +102,7 @@ function Item({ asChild = false, className, size = 'default', variant = 'default
|
|
|
102
102
|
...props
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
function ItemMedia({ className, variant =
|
|
105
|
+
function ItemMedia({ className, variant = "default", ...props }) {
|
|
106
106
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
107
107
|
className: itemMediaVariants({
|
|
108
108
|
className,
|
|
@@ -115,42 +115,42 @@ function ItemMedia({ className, variant = 'default', ...props }) {
|
|
|
115
115
|
}
|
|
116
116
|
function ItemContent({ className, ...props }) {
|
|
117
117
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
118
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
118
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none", className),
|
|
119
119
|
"data-slot": "item-content",
|
|
120
120
|
...props
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
function ItemTitle({ className, ...props }) {
|
|
124
124
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
125
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
125
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex w-fit items-center gap-2 text-sm leading-snug font-medium", className),
|
|
126
126
|
"data-slot": "item-title",
|
|
127
127
|
...props
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
function ItemDescription({ className, ...props }) {
|
|
131
131
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
132
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
132
|
+
className: (0, tailwind_variants_namespaceObject.cn)("line-clamp-2 text-sm leading-normal font-normal text-balance text-muted-foreground", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
133
133
|
"data-slot": "item-description",
|
|
134
134
|
...props
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
function ItemActions({ className, ...props }) {
|
|
138
138
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
139
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
139
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex items-center gap-2", className),
|
|
140
140
|
"data-slot": "item-actions",
|
|
141
141
|
...props
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
function ItemHeader({ className, ...props }) {
|
|
145
145
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
146
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
146
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex basis-full items-center justify-between gap-2", className),
|
|
147
147
|
"data-slot": "item-header",
|
|
148
148
|
...props
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
function ItemFooter({ className, ...props }) {
|
|
152
152
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
153
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
153
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex basis-full items-center justify-between gap-2", className),
|
|
154
154
|
"data-slot": "item-footer",
|
|
155
155
|
...props
|
|
156
156
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import { Separator } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import { Separator } from "./separator";
|
|
4
4
|
declare const itemVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
5
|
size: {
|
|
6
6
|
default: string;
|
|
@@ -19,27 +19,27 @@ declare const itemMediaVariants: import("@codefast/tailwind-variants").VariantFu
|
|
|
19
19
|
image: string;
|
|
20
20
|
};
|
|
21
21
|
}, Record<string, never>>;
|
|
22
|
-
type ItemGroupProps = ComponentProps<
|
|
22
|
+
type ItemGroupProps = ComponentProps<"div">;
|
|
23
23
|
declare function ItemGroup({ className, ...props }: ItemGroupProps): JSX.Element;
|
|
24
24
|
type ItemSeparatorProps = ComponentProps<typeof Separator>;
|
|
25
25
|
declare function ItemSeparator({ className, ...props }: ItemSeparatorProps): JSX.Element;
|
|
26
|
-
type ItemProps = ComponentProps<
|
|
26
|
+
type ItemProps = ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
27
27
|
asChild?: boolean;
|
|
28
28
|
};
|
|
29
29
|
declare function Item({ asChild, className, size, variant, ...props }: ItemProps): JSX.Element;
|
|
30
|
-
type ItemMediaProps = ComponentProps<
|
|
30
|
+
type ItemMediaProps = ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>;
|
|
31
31
|
declare function ItemMedia({ className, variant, ...props }: ItemMediaProps): JSX.Element;
|
|
32
|
-
type ItemContentProps = ComponentProps<
|
|
32
|
+
type ItemContentProps = ComponentProps<"div">;
|
|
33
33
|
declare function ItemContent({ className, ...props }: ItemContentProps): JSX.Element;
|
|
34
|
-
type ItemTitleProps = ComponentProps<
|
|
34
|
+
type ItemTitleProps = ComponentProps<"div">;
|
|
35
35
|
declare function ItemTitle({ className, ...props }: ItemTitleProps): JSX.Element;
|
|
36
|
-
type ItemDescriptionProps = ComponentProps<
|
|
36
|
+
type ItemDescriptionProps = ComponentProps<"p">;
|
|
37
37
|
declare function ItemDescription({ className, ...props }: ItemDescriptionProps): JSX.Element;
|
|
38
|
-
type ItemActionsProps = ComponentProps<
|
|
38
|
+
type ItemActionsProps = ComponentProps<"div">;
|
|
39
39
|
declare function ItemActions({ className, ...props }: ItemActionsProps): JSX.Element;
|
|
40
|
-
type ItemHeaderProps = ComponentProps<
|
|
40
|
+
type ItemHeaderProps = ComponentProps<"div">;
|
|
41
41
|
declare function ItemHeader({ className, ...props }: ItemHeaderProps): JSX.Element;
|
|
42
|
-
type ItemFooterProps = ComponentProps<
|
|
42
|
+
type ItemFooterProps = ComponentProps<"div">;
|
|
43
43
|
declare function ItemFooter({ className, ...props }: ItemFooterProps): JSX.Element;
|
|
44
44
|
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, itemMediaVariants, ItemSeparator, ItemTitle, itemVariants, };
|
|
45
45
|
export type { ItemActionsProps, ItemContentProps, ItemDescriptionProps, ItemFooterProps, ItemGroupProps, ItemHeaderProps, ItemMediaProps, ItemProps, ItemSeparatorProps, ItemTitleProps, };
|