lynote-ui 0.0.2 → 0.0.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/README.md +110 -9
- package/dist/accordion/index.d.ts +1 -1
- package/dist/accordion/index.js +4 -4
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +4 -4
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/alert/index.d.ts +1 -1
- package/dist/alert/index.js +5 -5
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +5 -5
- package/dist/alert/index.mjs.map +1 -1
- package/dist/alert-dialog/index.js +8 -8
- package/dist/alert-dialog/index.js.map +1 -1
- package/dist/alert-dialog/index.mjs +8 -8
- package/dist/alert-dialog/index.mjs.map +1 -1
- package/dist/aspect-ratio/index.js +2 -2
- package/dist/aspect-ratio/index.js.map +1 -1
- package/dist/aspect-ratio/index.mjs +2 -2
- package/dist/aspect-ratio/index.mjs.map +1 -1
- package/dist/avatar/index.d.ts +1 -1
- package/dist/avatar/index.js +6 -6
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar/index.mjs +6 -6
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/badge/index.js +2 -2
- package/dist/badge/index.js.map +1 -1
- package/dist/badge/index.mjs +2 -2
- package/dist/badge/index.mjs.map +1 -1
- package/dist/breadcrumb/index.d.ts +1 -1
- package/dist/breadcrumb/index.js +3 -3
- package/dist/breadcrumb/index.js.map +1 -1
- package/dist/breadcrumb/index.mjs +3 -3
- package/dist/breadcrumb/index.mjs.map +1 -1
- package/dist/button/index.js +8 -8
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +8 -8
- package/dist/button/index.mjs.map +1 -1
- package/dist/button-group/index.js +3 -3
- package/dist/button-group/index.js.map +1 -1
- package/dist/button-group/index.mjs +3 -3
- package/dist/button-group/index.mjs.map +1 -1
- package/dist/calendar/index.js +4 -4
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs +4 -4
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/card/index.d.ts +1 -1
- package/dist/card/index.js +6 -6
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +6 -6
- package/dist/card/index.mjs.map +1 -1
- package/dist/carousel/index.d.ts +1 -1
- package/dist/carousel/index.js +3 -3
- package/dist/carousel/index.js.map +1 -1
- package/dist/carousel/index.mjs +3 -3
- package/dist/carousel/index.mjs.map +1 -1
- package/dist/chart/index.d.ts +1 -1
- package/dist/chart/index.js +7 -7
- package/dist/chart/index.js.map +1 -1
- package/dist/chart/index.mjs +7 -7
- package/dist/chart/index.mjs.map +1 -1
- package/dist/checkbox/index.js +2 -2
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs +2 -2
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/collapsible/index.d.ts +1 -1
- package/dist/collapsible/index.js.map +1 -1
- package/dist/collapsible/index.mjs.map +1 -1
- package/dist/combobox/index.d.ts +1 -1
- package/dist/combobox/index.js +10 -10
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +10 -10
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.d.ts +1 -1
- package/dist/command/index.js +10 -10
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +10 -10
- package/dist/command/index.mjs.map +1 -1
- package/dist/context-menu/index.d.ts +1 -1
- package/dist/context-menu/index.js +9 -9
- package/dist/context-menu/index.js.map +1 -1
- package/dist/context-menu/index.mjs +9 -9
- package/dist/context-menu/index.mjs.map +1 -1
- package/dist/date-picker/index.js.map +1 -1
- package/dist/date-picker/index.mjs.map +1 -1
- package/dist/dialog/index.js +7 -7
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +7 -7
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/drawer/index.d.ts +1 -1
- package/dist/drawer/index.js +6 -6
- package/dist/drawer/index.js.map +1 -1
- package/dist/drawer/index.mjs +6 -6
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/dropdown-menu/index.d.ts +1 -1
- package/dist/dropdown-menu/index.js +10 -10
- package/dist/dropdown-menu/index.js.map +1 -1
- package/dist/dropdown-menu/index.mjs +10 -10
- package/dist/dropdown-menu/index.mjs.map +1 -1
- package/dist/empty/index.d.ts +1 -1
- package/dist/empty/index.js +5 -5
- package/dist/empty/index.js.map +1 -1
- package/dist/empty/index.mjs +5 -5
- package/dist/empty/index.mjs.map +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.js +9 -9
- package/dist/field/index.js.map +1 -1
- package/dist/field/index.mjs +9 -9
- package/dist/field/index.mjs.map +1 -1
- package/dist/form/index.js +1 -1
- package/dist/form/index.mjs +1 -1
- package/dist/{form-DaFoHvkT.mjs → form-DLd4sOko.mjs} +2 -2
- package/dist/form-DLd4sOko.mjs.map +1 -0
- package/dist/{form-CJuxZz3w.js → form-h_cJBAwg.js} +2 -2
- package/dist/form-h_cJBAwg.js.map +1 -0
- package/dist/hover-card/index.d.ts +1 -1
- package/dist/hover-card/index.js +2 -2
- package/dist/hover-card/index.js.map +1 -1
- package/dist/hover-card/index.mjs +2 -2
- package/dist/hover-card/index.mjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/input/index.js +2 -2
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +2 -2
- package/dist/input/index.mjs.map +1 -1
- package/dist/input-group/index.d.ts +1 -1
- package/dist/input-group/index.js +8 -8
- package/dist/input-group/index.js.map +1 -1
- package/dist/input-group/index.mjs +8 -8
- package/dist/input-group/index.mjs.map +1 -1
- package/dist/input-otp/index.js +1 -1
- package/dist/input-otp/index.js.map +1 -1
- package/dist/input-otp/index.mjs +1 -1
- package/dist/input-otp/index.mjs.map +1 -1
- package/dist/item/index.d.ts +1 -1
- package/dist/item/index.js +8 -8
- package/dist/item/index.js.map +1 -1
- package/dist/item/index.mjs +8 -8
- package/dist/item/index.mjs.map +1 -1
- package/dist/kbd/index.js +2 -2
- package/dist/kbd/index.js.map +1 -1
- package/dist/kbd/index.mjs +2 -2
- package/dist/kbd/index.mjs.map +1 -1
- package/dist/label/index.js +2 -2
- package/dist/label/index.js.map +1 -1
- package/dist/label/index.mjs +2 -2
- package/dist/label/index.mjs.map +1 -1
- package/dist/menubar/index.d.ts +1 -1
- package/dist/menubar/index.js +11 -11
- package/dist/menubar/index.js.map +1 -1
- package/dist/menubar/index.mjs +11 -11
- package/dist/menubar/index.mjs.map +1 -1
- package/dist/native-select/index.js +3 -3
- package/dist/native-select/index.js.map +1 -1
- package/dist/native-select/index.mjs +3 -3
- package/dist/native-select/index.mjs.map +1 -1
- package/dist/navigation-menu/index.d.ts +1 -1
- package/dist/navigation-menu/index.js +10 -10
- package/dist/navigation-menu/index.js.map +1 -1
- package/dist/navigation-menu/index.mjs +10 -10
- package/dist/navigation-menu/index.mjs.map +1 -1
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/index.js.map +1 -1
- package/dist/pagination/index.mjs +1 -1
- package/dist/pagination/index.mjs.map +1 -1
- package/dist/popover/index.d.ts +7 -10
- package/dist/popover/index.js +19 -21
- package/dist/popover/index.js.map +1 -1
- package/dist/popover/index.mjs +18 -19
- package/dist/popover/index.mjs.map +1 -1
- package/dist/progress/index.d.ts +1 -1
- package/dist/progress/index.js +4 -4
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs +4 -4
- package/dist/progress/index.mjs.map +1 -1
- package/dist/radio-group/index.js +3 -3
- package/dist/radio-group/index.js.map +1 -1
- package/dist/radio-group/index.mjs +3 -3
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/resizable/index.js +3 -3
- package/dist/resizable/index.js.map +1 -1
- package/dist/resizable/index.mjs +3 -3
- package/dist/resizable/index.mjs.map +1 -1
- package/dist/scroll-area/index.js +4 -4
- package/dist/scroll-area/index.js.map +1 -1
- package/dist/scroll-area/index.mjs +4 -4
- package/dist/scroll-area/index.mjs.map +1 -1
- package/dist/select/index.js +9 -9
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +9 -9
- package/dist/select/index.mjs.map +1 -1
- package/dist/separator/index.js +2 -2
- package/dist/separator/index.js.map +1 -1
- package/dist/separator/index.mjs +2 -2
- package/dist/separator/index.mjs.map +1 -1
- package/dist/sheet/index.d.ts +1 -1
- package/dist/sheet/index.js +6 -6
- package/dist/sheet/index.js.map +1 -1
- package/dist/sheet/index.mjs +6 -6
- package/dist/sheet/index.mjs.map +1 -1
- package/dist/sidebar/index.js +1 -1
- package/dist/sidebar/index.mjs +1 -1
- package/dist/{sidebar-DypRvfnS.mjs → sidebar-Ddt6hBj_.mjs} +21 -21
- package/dist/sidebar-Ddt6hBj_.mjs.map +1 -0
- package/dist/{sidebar-DlE_DZYH.js → sidebar-E9uledix.js} +21 -21
- package/dist/sidebar-E9uledix.js.map +1 -0
- package/dist/skeleton/index.js +2 -2
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/index.mjs +2 -2
- package/dist/skeleton/index.mjs.map +1 -1
- package/dist/slider/index.js +5 -5
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/index.mjs +5 -5
- package/dist/slider/index.mjs.map +1 -1
- package/dist/sonner-BbeMMXzI.js.map +1 -1
- package/dist/sonner-CRcX7M_W.mjs.map +1 -1
- package/dist/spinner/index.js +1 -1
- package/dist/spinner/index.js.map +1 -1
- package/dist/spinner/index.mjs +1 -1
- package/dist/spinner/index.mjs.map +1 -1
- package/dist/switch/index.js +3 -3
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/index.mjs +3 -3
- package/dist/switch/index.mjs.map +1 -1
- package/dist/table/index.d.ts +1 -1
- package/dist/table/index.js +6 -6
- package/dist/table/index.js.map +1 -1
- package/dist/table/index.mjs +6 -6
- package/dist/table/index.mjs.map +1 -1
- package/dist/tabs/index.d.ts +1 -1
- package/dist/tabs/index.js +4 -4
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +4 -4
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.js +2 -2
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +2 -2
- package/dist/textarea/index.mjs.map +1 -1
- package/dist/toggle/index.js +3 -3
- package/dist/toggle/index.js.map +1 -1
- package/dist/toggle/index.mjs +3 -3
- package/dist/toggle/index.mjs.map +1 -1
- package/dist/toggle-group/index.js +3 -3
- package/dist/toggle-group/index.js.map +1 -1
- package/dist/toggle-group/index.mjs +3 -3
- package/dist/toggle-group/index.mjs.map +1 -1
- package/dist/tooltip/index.d.ts +1 -1
- package/dist/tooltip/index.js +3 -3
- package/dist/tooltip/index.js.map +1 -1
- package/dist/tooltip/index.mjs +3 -3
- package/dist/tooltip/index.mjs.map +1 -1
- package/dist/{utils-D5ml961t.js → utils-BGuEr0aP.js} +2 -2
- package/dist/utils-BGuEr0aP.js.map +1 -0
- package/dist/{utils-Dc9Lnfye.mjs → utils-TtTqRIUX.mjs} +2 -2
- package/dist/utils-TtTqRIUX.mjs.map +1 -0
- package/package.json +2 -28
- package/dist/form-CJuxZz3w.js.map +0 -1
- package/dist/form-DaFoHvkT.mjs.map +0 -1
- package/dist/hooks/use-mobile.d.ts +0 -1
- package/dist/lib/cva.d.ts +0 -1
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib/utils.d.ts +0 -2
- package/dist/sidebar-DlE_DZYH.js.map +0 -1
- package/dist/sidebar-DypRvfnS.mjs.map +0 -1
- package/dist/style.css +0 -6285
- package/dist/utils-D5ml961t.js.map +0 -1
- package/dist/utils-Dc9Lnfye.mjs.map +0 -1
package/dist/field/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as cn } from "../utils-
|
|
2
|
+
import { t as cn } from "../utils-TtTqRIUX.mjs";
|
|
3
3
|
import { Separator } from "../separator/index.mjs";
|
|
4
4
|
import { Label } from "../label/index.mjs";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
@@ -28,11 +28,11 @@ function FieldGroup({ className, ...props }) {
|
|
|
28
28
|
...props
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
var fieldVariants = cva("group/field
|
|
31
|
+
var fieldVariants = cva("group/field data-[invalid=true]:text-destructive flex w-full gap-2", {
|
|
32
32
|
variants: { orientation: {
|
|
33
33
|
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
34
|
-
horizontal: "
|
|
35
|
-
responsive: "
|
|
34
|
+
horizontal: "has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto",
|
|
35
|
+
responsive: "@md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px flex-col *:w-full [&>.sr-only]:w-auto"
|
|
36
36
|
} },
|
|
37
37
|
defaultVariants: { orientation: "vertical" }
|
|
38
38
|
});
|
|
@@ -55,21 +55,21 @@ function FieldContent({ className, ...props }) {
|
|
|
55
55
|
function FieldLabel({ className, ...props }) {
|
|
56
56
|
return /* @__PURE__ */ jsx(Label, {
|
|
57
57
|
"data-slot": "field-label",
|
|
58
|
-
className: cn("group/field-label peer/field-label
|
|
58
|
+
className: cn("group/field-label peer/field-label has-data-checked:border-primary/30 has-data-checked:bg-primary/5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 flex w-fit gap-2 leading-snug has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
|
|
59
59
|
...props
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
function FieldTitle({ className, ...props }) {
|
|
63
63
|
return /* @__PURE__ */ jsx("div", {
|
|
64
64
|
"data-slot": "field-label",
|
|
65
|
-
className: cn("flex w-fit items-center gap-2 text-sm leading-snug
|
|
65
|
+
className: cn("flex w-fit items-center gap-2 text-sm font-medium leading-snug group-data-[disabled=true]/field:opacity-50", className),
|
|
66
66
|
...props
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
function FieldDescription({ className, ...props }) {
|
|
70
70
|
return /* @__PURE__ */ jsx("p", {
|
|
71
71
|
"data-slot": "field-description",
|
|
72
|
-
className: cn("text-
|
|
72
|
+
className: cn("text-muted-foreground group-has-data-horizontal/field:text-balance text-left text-sm font-normal leading-normal [[data-variant=legend]+&]:-mt-1.5", "nth-last-2:-mt-1 last:mt-0", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className),
|
|
73
73
|
...props
|
|
74
74
|
});
|
|
75
75
|
}
|
|
@@ -80,7 +80,7 @@ function FieldSeparator({ children, className, ...props }) {
|
|
|
80
80
|
className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
81
81
|
...props,
|
|
82
82
|
children: [/* @__PURE__ */ jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && /* @__PURE__ */ jsx("span", {
|
|
83
|
-
className: "relative mx-auto block w-fit
|
|
83
|
+
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
84
84
|
"data-slot": "field-separator-content",
|
|
85
85
|
children
|
|
86
86
|
})]
|
|
@@ -101,7 +101,7 @@ function FieldError({ className, children, errors, ...props }) {
|
|
|
101
101
|
return /* @__PURE__ */ jsx("div", {
|
|
102
102
|
role: "alert",
|
|
103
103
|
"data-slot": "field-error",
|
|
104
|
-
className: cn("text-sm font-normal
|
|
104
|
+
className: cn("text-destructive text-sm font-normal", className),
|
|
105
105
|
...props,
|
|
106
106
|
children: content
|
|
107
107
|
});
|
package/dist/field/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/field/index.tsx"],"sourcesContent":["\"use client\"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/field/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { useMemo } from \"react\";\n\nimport { cn } from \"../../lib\";\nimport { Label } from \"../label\";\nimport { Separator } from \"../separator\";\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\n \"group/field data-[invalid=true]:text-destructive flex w-full gap-2\",\n {\n variants: {\n orientation: {\n vertical: \"flex-col *:w-full [&>.sr-only]:w-auto\",\n horizontal:\n \"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto\",\n responsive:\n \"@md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px flex-col *:w-full [&>.sr-only]:w-auto\",\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n },\n);\n\nfunction Field({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\n \"group/field-content flex flex-1 flex-col gap-0.5 leading-snug\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLabel({\n className,\n ...props\n}: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n \"group/field-label peer/field-label has-data-checked:border-primary/30 has-data-checked:bg-primary/5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 flex w-fit gap-2 leading-snug has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"flex w-fit items-center gap-2 text-sm font-medium leading-snug group-data-[disabled=true]/field:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-muted-foreground group-has-data-horizontal/field:text-balance text-left text-sm font-normal leading-normal [[data-variant=legend]+&]:-mt-1.5\",\n \"nth-last-2:-mt-1 last:mt-0\",\n \"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n className,\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"bg-background text-muted-foreground relative mx-auto block w-fit px-2\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n const uniqueErrors = [\n ...new Map(errors.map((error) => [error?.message, error])).values(),\n ];\n\n if (uniqueErrors?.length == 1) {\n return uniqueErrors[0]?.message;\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map(\n (error, index) =>\n error?.message && <li key={index}>{error.message}</li>,\n )}\n </ul>\n );\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"text-destructive text-sm font-normal\", className)}\n {...props}\n >\n {content}\n </div>\n );\n}\n\nexport {\n Field,\n FieldContent,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldTitle,\n};\n"],"mappings":";;;;;;;;AASA,SAAS,SAAS,EAAE,WAAW,GAAG,SAA2C;AAC3E,QACE,oBAAC,YAAD;EACE,aAAU;EACV,WAAW,GACT,oGACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,YAAY,EACnB,WACA,UAAU,UACV,GAAG,SACiE;AACpE,QACE,oBAAC,UAAD;EACE,aAAU;EACV,gBAA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jD,YACC,oBAAC,QAAD;GACE,WAAU;GACV,aAAU;GAET;GACI,CAAA,CAEL;;;AAIV,SAAS,WAAW,EAClB,WACA,UACA,QACA,GAAG,SAGF;CACD,MAAM,UAAU,cAAc;AAC5B,MAAI,SACF,QAAO;AAGT,MAAI,CAAC,QAAQ,OACX,QAAO;EAGT,MAAM,eAAe,CACnB,GAAG,IAAI,IAAI,OAAO,KAAK,UAAU,CAAC,OAAO,SAAS,MAAM,CAAC,CAAC,CAAC,QAAQ,CACpE;AAED,MAAI,cAAc,UAAU,EAC1B,QAAO,aAAa,IAAI;AAG1B,SACE,oBAAC,MAAD;GAAI,WAAU;aACX,aAAa,KACX,OAAO,UACN,OAAO,WAAW,oBAAC,MAAD,EAAA,UAAiB,MAAM,SAAa,EAA3B,MAA2B,CACzD;GACE,CAAA;IAEN,CAAC,UAAU,OAAO,CAAC;AAEtB,KAAI,CAAC,QACH,QAAO;AAGT,QACE,oBAAC,OAAD;EACE,MAAK;EACL,aAAU;EACV,WAAW,GAAG,wCAAwC,UAAU;EAChE,GAAI;YAEH;EACG,CAAA"}
|
package/dist/form/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_form = require("../form-
|
|
2
|
+
const require_form = require("../form-h_cJBAwg.js");
|
|
3
3
|
exports.FormControl = require_form.FormControl;
|
|
4
4
|
exports.FormDescription = require_form.FormDescription;
|
|
5
5
|
exports.FormField = require_form.FormField;
|
package/dist/form/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as FormDescription, c as FormRoot, i as FormField, n as FormMessage, o as FormControl, r as FormLabel, s as useFormField, t as FormItemWithRef } from "../form-
|
|
1
|
+
import { a as FormDescription, c as FormRoot, i as FormField, n as FormMessage, o as FormControl, r as FormLabel, s as useFormField, t as FormItemWithRef } from "../form-DLd4sOko.mjs";
|
|
2
2
|
export * from "react-hook-form";
|
|
3
3
|
export { FormControl, FormDescription, FormField, FormItemWithRef as FormItem, FormLabel, FormMessage, FormRoot, useFormField };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as cn } from "./utils-
|
|
1
|
+
import { t as cn } from "./utils-TtTqRIUX.mjs";
|
|
2
2
|
import { Label } from "./label/index.mjs";
|
|
3
3
|
import { cva as cva$1 } from "class-variance-authority";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -180,4 +180,4 @@ var FormItemWithRef = React.forwardRef(FormItem);
|
|
|
180
180
|
//#endregion
|
|
181
181
|
export { FormDescription as a, FormRoot as c, FormField as i, __exportAll as l, FormMessage as n, FormControl as o, FormLabel as r, useFormField as s, FormItemWithRef as t, __reExport as u };
|
|
182
182
|
|
|
183
|
-
//# sourceMappingURL=form-
|
|
183
|
+
//# sourceMappingURL=form-DLd4sOko.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-DLd4sOko.mjs","names":[],"sources":["../src/form/components/variants.ts","../src/form/components/Form.tsx","../src/form/context/index.ts","../src/form/hooks/useFormField.ts","../src/form/components/FormControl.tsx","../src/form/components/FormDescription.tsx","../src/form/components/FormField.tsx","../src/form/components/FormLabel.tsx","../src/form/components/FormMessage.tsx","../src/form/components/FormItem.tsx"],"sourcesContent":["import { cva } from \"../../../lib\";\n\nexport const formDescriptionVariants = cva(\"text-muted-foreground text-sm\");\n\nexport const formItemVariants = cva(\"relative grid gap-2\");\n\nexport const formItemMesVariants = cva(\n \"absolute bottom-0 left-0 translate-y-[calc(100%+2px)]\",\n);\n\nexport const formMessageVariants = cva(\"text-destructive text-sm\");\n\nexport const formRootVariants = cva(\"w-full space-y-6\");\n","import { type FieldValues, FormProvider } from \"react-hook-form\";\nimport { cn } from \"../../../lib\";\nimport type { FormPropsType } from \"../type\";\nimport { formRootVariants } from \"./variants\";\n\nconst FormRoot = <TFormValues extends FieldValues>({\n onSubmit = () => {},\n className,\n ...props\n}: FormPropsType<TFormValues>) => {\n return (\n <FormProvider {...props}>\n <form\n onSubmit={props.handleSubmit(onSubmit)}\n className={cn(formRootVariants({ className }))}\n >\n {props?.children || null}\n </form>\n </FormProvider>\n );\n};\nexport default FormRoot;\n","\"use client\";\n\nimport { createContext } from \"react\";\nimport type { FormFieldContextValue, FormItemContextValue } from \"../type\";\n\nexport const FormFieldContext = createContext<FormFieldContextValue>(\n {} as FormFieldContextValue,\n);\n\nexport const FormItemContext = createContext<FormItemContextValue>(\n {} as FormItemContextValue,\n);\n","import { useContext } from \"react\";\nimport { useFormContext, useFormState } from \"react-hook-form\";\nimport { FormFieldContext, FormItemContext } from \"../context\";\n\nconst useFormField = () => {\n const fieldContext = useContext(FormFieldContext);\n const itemContext = useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\nexport default useFormField;\n","import { Slot } from \"@radix-ui/react-slot\";\nimport useFormField from \"../hooks/useFormField\";\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n\n return (\n <Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\nexport default FormControl;\n","import { ComponentProps, forwardRef } from \"react\";\nimport { cn } from \"../../../lib\";\nimport useFormField from \"../hooks/useFormField\";\nimport { formDescriptionVariants } from \"./variants\";\n\nconst FormDescription = forwardRef<HTMLParagraphElement, ComponentProps<\"p\">>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n data-slot=\"form-description\"\n id={formDescriptionId}\n className={cn(formDescriptionVariants({ className }))}\n {...props}\n />\n );\n },\n);\n\nexport default FormDescription;\n","import {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n} from \"react-hook-form\";\nimport { FormFieldContext } from \"../context\";\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nexport default FormField;\n","import { ComponentProps, forwardRef } from \"react\";\nimport { cn } from \"../../../lib\";\nimport { Label } from \"../../label\";\nimport useFormField from \"../hooks/useFormField\";\n\nconst FormLabel = forwardRef<HTMLLabelElement, ComponentProps<typeof Label>>(\n ({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(className, \"inline gap-0\")}\n htmlFor={formItemId}\n {...props}\n />\n );\n },\n);\n\nexport default FormLabel;\n","import { forwardRef } from \"react\";\nimport { cn } from \"../../../lib\";\nimport useFormField from \"../hooks/useFormField\";\nimport type { FormMessageProps } from \"../type\";\nimport { formMessageVariants } from \"./variants\";\n\nconst FormMessage = forwardRef<HTMLParagraphElement, FormMessageProps>(\n ({ className, render, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = String(error?.message ?? \"\");\n\n if (!body) {\n return null;\n }\n\n return render ? (\n render(body)\n ) : (\n <p\n ref={ref}\n data-slot=\"form-message\"\n id={formMessageId}\n className={cn(formMessageVariants({ className }))}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\n\nexport default FormMessage;\n","import * as React from \"react\";\nimport { Controller, FieldPath, FieldValues } from \"react-hook-form\";\nimport { cn } from \"../../../lib\";\nimport { FormFieldContext, FormItemContext } from \"../context\";\nimport { FormItemPropsType } from \"../type\";\nimport FormControl from \"./FormControl\";\nimport FormDescription from \"./FormDescription\";\nimport FormLabel from \"./FormLabel\";\nimport FormMessage from \"./FormMessage\";\nimport { formItemMesVariants, formItemVariants } from \"./variants\";\n\nconst FormItem = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>(\n {\n className,\n children,\n label,\n showMessage = true,\n colon = true,\n required = false,\n render,\n noStyle = false,\n description,\n ...controllerProps\n }: FormItemPropsType<TFieldValues, TName>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const id = React.useId();\n\n // 如果没有提供render函数,则使用children作为内容\n const content = (\n <Controller\n name={controllerProps.name}\n control={controllerProps.control}\n rules={controllerProps.rules}\n shouldUnregister={controllerProps.shouldUnregister}\n defaultValue={controllerProps.defaultValue}\n disabled={controllerProps.disabled}\n exact={controllerProps.exact}\n render={(...res) => {\n return (\n <FormControl>\n {render\n ? render(...res)\n : React.isValidElement(children)\n ? React.cloneElement(children, res[0].field)\n : children}\n </FormControl>\n );\n }}\n />\n );\n\n if (noStyle) return content;\n\n const formItemContent = (\n <div\n ref={ref}\n data-slot=\"form-item\"\n className={cn(formItemVariants(), className)}\n >\n {label && (\n <div>\n <FormLabel>\n {required && <span className=\"mr-1 text-red-500\">*</span>}\n {label}\n {colon && \":\"}\n </FormLabel>\n </div>\n )}\n\n {content}\n {description && <FormDescription></FormDescription>}\n {showMessage && <FormMessage className={cn(formItemMesVariants())} />}\n </div>\n );\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <FormFieldContext.Provider value={{ name: controllerProps.name }}>\n {formItemContent}\n </FormFieldContext.Provider>\n </FormItemContext.Provider>\n );\n};\n\nconst FormItemWithRef = React.forwardRef(FormItem) as <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>(\n props: FormItemPropsType<TFieldValues, TName> & {\n ref?: React.Ref<HTM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AkB,gBAAgB;EAClC,cAAc,gBAAgB;EAC9B,UAAU,gBAAgB;EAC1B,OAAO,gBAAgB;EACvB,SAAS,GAAG,QAAQ;AAClB,UACE,oBAAC,aAAD,EAAA,UACG,SACG,OAAO,GAAG,IAAI,GACd,MAAM,eAAe,SAAS,GAC5B,MAAM,aAAa,UAAU,IAAI,GAAG,MAAM,GAC1C,UACM,CAAA;;EAGlB,CAAA;AAGJ,KAAI,QAAS,QAAO;CAEpB,MAAM,kBACJ,qBAAC,OAAD;EACO;EACL,aAAU;EACV,WAAW,GAAG,kBAAkB,EAAE,UAAU;YAH9C;GAKG,SACC,oBAAC,OAAD,EAAA,UACE,qBAAC,WAAD,EAAA,UAAA;IACG,YAAY,oBAAC,QAAD;KAAM,WAAU;eAAoB;KAAQ,CAAA;IACxD;IACA,SAAS;IACA,EAAA,CAAA,EACR,CAAA;GAGP;GACA,eAAe,oBAAC,iBAAD,EAAmC,CAAA;GAClD,eAAe,oBAAC,aAAD,EAAa,WAAW,GAAG,qBAAqB,CAAC,EAAI,CAAA;GACjE;;AAGR,QACE,oBAAC,gBAAgB,UAAjB;EAA0B,OAAO,EAAE,IAAI;YACrC,oBAAC,iBAAiB,UAAlB;GAA2B,OAAO,EAAE,MAAM,gBAAgB,MAAM;aAC7D;GACyB,CAAA;EACH,CAAA;;AAI/B,IAAM,kBAAkB,MAAM,WAAW,SAAS"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-CoQrYLCe.js");
|
|
2
|
-
const require_utils = require("./utils-
|
|
2
|
+
const require_utils = require("./utils-BGuEr0aP.js");
|
|
3
3
|
const require_label = require("./label/index.js");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
5
|
let react = require("react");
|
|
@@ -202,4 +202,4 @@ Object.defineProperty(exports, "useFormField", {
|
|
|
202
202
|
}
|
|
203
203
|
});
|
|
204
204
|
|
|
205
|
-
//# sourceMappingURL=form-
|
|
205
|
+
//# sourceMappingURL=form-h_cJBAwg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-h_cJBAwg.js","names":[],"sources":["../src/form/components/variants.ts","../src/form/components/Form.tsx","../src/form/context/index.ts","../src/form/hooks/useFormField.ts","../src/form/components/FormControl.tsx","../src/form/components/FormDescription.tsx","../src/form/components/FormField.tsx","../src/form/components/FormLabel.tsx","../src/form/components/FormMessage.tsx","../src/form/components/FormItem.tsx"],"sourcesContent":["import { cva } from \"../../../lib\";\n\nexport const formDescriptionVariants = cva(\"text-muted-foreground text-sm\");\n\nexport const formItemVariants = cva(\"relative grid gap-2\");\n\nexport const formItemMesVariants = cva(\n \"absolute bottom-0 left-0 translate-y-[calc(100%+2px)]\",\n);\n\nexport const formMessageVariants = cva(\"text-destructive text-sm\");\n\nexport const formRootVariants = cva(\"w-full space-y-6\");\n","import { type FieldValues, FormProvider } from \"react-hook-form\";\nimport { cn } from \"../../../lib\";\nimport type { FormPropsType } from \"../type\";\nimport { formRootVariants } from \"./variants\";\n\nconst FormRoot = <TFormValues extends FieldValues>({\n onSubmit = () => {},\n className,\n ...props\n}: FormPropsType<TFormValues>) => {\n return (\n <FormProvider {...props}>\n <form\n onSubmit={props.handleSubmit(onSubmit)}\n className={cn(formRootVariants({ className }))}\n >\n {props?.children || null}\n </form>\n </FormProvider>\n );\n};\nexport default FormRoot;\n","\"use client\";\n\nimport { createContext } from \"react\";\nimport type { FormFieldContextValue, FormItemContextValue } from \"../type\";\n\nexport const FormFieldContext = createContext<FormFieldContextValue>(\n {} as FormFieldContextValue,\n);\n\nexport const FormItemContext = createContext<FormItemContextValue>(\n {} as FormItemContextValue,\n);\n","import { useContext } from \"react\";\nimport { useFormContext, useFormState } from \"react-hook-form\";\nimport { FormFieldContext, FormItemContext } from \"../context\";\n\nconst useFormField = () => {\n const fieldContext = useContext(FormFieldContext);\n const itemContext = useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\nexport default useFormField;\n","import { Slot } from \"@radix-ui/react-slot\";\nimport useFormField from \"../hooks/useFormField\";\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n\n return (\n <Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\nexport default FormControl;\n","import { ComponentProps, forwardRef } from \"react\";\nimport { cn } from \"../../../lib\";\nimport useFormField from \"../hooks/useFormField\";\nimport { formDescriptionVariants } from \"./variants\";\n\nconst FormDescription = forwardRef<HTMLParagraphElement, ComponentProps<\"p\">>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n data-slot=\"form-description\"\n id={formDescriptionId}\n className={cn(formDescriptionVariants({ className }))}\n {...props}\n />\n );\n },\n);\n\nexport default FormDescription;\n","import {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n} from \"react-hook-form\";\nimport { FormFieldContext } from \"../context\";\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nexport default FormField;\n","import { ComponentProps, forwardRef } from \"react\";\nimport { cn } from \"../../../lib\";\nimport { Label } from \"../../label\";\nimport useFormField from \"../hooks/useFormField\";\n\nconst FormLabel = forwardRef<HTMLLabelElement, ComponentProps<typeof Label>>(\n ({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(className, \"inline gap-0\")}\n htmlFor={formItemId}\n {...props}\n />\n );\n },\n);\n\nexport default FormLabel;\n","import { forwardRef } from \"react\";\nimport { cn } from \"../../../lib\";\nimport useFormField from \"../hooks/useFormField\";\nimport type { FormMessageProps } from \"../type\";\nimport { formMessageVariants } from \"./variants\";\n\nconst FormMessage = forwardRef<HTMLParagraphElement, FormMessageProps>(\n ({ className, render, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = String(error?.message ?? \"\");\n\n if (!body) {\n return null;\n }\n\n return render ? (\n render(body)\n ) : (\n <p\n ref={ref}\n data-slot=\"form-message\"\n id={formMessageId}\n className={cn(formMessageVariants({ className }))}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\n\nexport default FormMessage;\n","import * as React from \"react\";\nimport { Controller, FieldPath, FieldValues } from \"react-hook-form\";\nimport { cn } from \"../../../lib\";\nimport { FormFieldContext, FormItemContext } from \"../context\";\nimport { FormItemPropsType } from \"../type\";\nimport FormControl from \"./FormControl\";\nimport FormDescription from \"./FormDescription\";\nimport FormLabel from \"./FormLabel\";\nimport FormMessage from \"./FormMessage\";\nimport { formItemMesVariants, formItemVariants } from \"./variants\";\n\nconst FormItem = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>(\n {\n className,\n children,\n label,\n showMessage = true,\n colon = true,\n required = false,\n render,\n noStyle = false,\n description,\n ...controllerProps\n }: FormItemPropsType<TFieldValues, TName>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const id = React.useId();\n\n // 如果没有提供render函数,则使用children作为内容\n const content = (\n <Controller\n name={controllerProps.name}\n control={controllerProps.control}\n rules={controllerProps.rules}\n shouldUnregister={controllerProps.shouldUnregister}\n defaultValue={controllerProps.defaultValue}\n disabled={controllerProps.disabled}\n exact={controllerProps.exact}\n render={(...res) => {\n return (\n <FormControl>\n {render\n ? render(...res)\n : React.isValidElement(children)\n ? React.cloneElement(children, res[0].field)\n : children}\n </FormControl>\n );\n }}\n />\n );\n\n if (noStyle) return content;\n\n const formItemContent = (\n <div\n ref={ref}\n data-slot=\"form-item\"\n className={cn(formItemVariants(), className)}\n >\n {label && (\n <div>\n <FormLabel>\n {required && <span className=\"mr-1 text-red-500\">*</span>}\n {label}\n {colon && \":\"}\n </FormLabel>\n </div>\n )}\n\n {content}\n {description && <FormDescription></FormDescription>}\n {showMessage && <FormMessage className={cn(formItemMesVariants())} />}\n </div>\n );\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <FormFieldContext.Provider value={{ name: controllerProps.name }}>\n {formItemContent}\n </FormFieldContext.Provider>\n </FormItemContext.Provider>\n );\n};\n\nconst FormItemWithRef = React.forwardRef(FormItem) as <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>(\n props: FormItemPropsType<TFieldValues, TName> & {\n ref?: React.Ref<HTMLDivElement>;\n },\n) => React.ReactElement;\n\nexport default FormItemWithRef;\n"],"mappings":";;;;;;;;;;AAEA,IAAa,2BAAA,GAAA,yBAAA,KAA8B,gCAAgC;AAE3E,IAAa,oBAAA,GAAA,yBAAA,KAAuB,sBAAsB;AAE1D,IAAa,uBAAA,GAAA,yBAAA,KACX,wDACD;AAED,IAAa,uBAAA,GAAA,yBAAA,KAA0B,2BAA2B;AAElE,IAAa,oBAAA,GAAA,yBAAA,KAAuB,mBAAmB;;;ACPvD,IAAM,YAA6C,EACjD,iBAAiB,IACjB,WACA,GAAG,YAC6B;AAChC,QACE,iBAAA,GAAA,kBAAA,KAAC,gBAAA,cAAD;EAAc,GAAI;YAChB,iBAAA,GAAA,kBAAA,KAAC,QAAD;GACE,UAAU,MAAM,aAAa,SAAS;GACtC,WAAW,cAAA,GAAG,iBAAiB,E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OAAO,GAAG,IAAI,GACd,MAAM,eAAe,SAAS,GAC5B,MAAM,aAAa,UAAU,IAAI,GAAG,MAAM,GAC1C,UACM,CAAA;;EAGlB,CAAA;AAGJ,KAAI,QAAS,QAAO;CAEpB,MAAM,kBACJ,iBAAA,GAAA,kBAAA,MAAC,OAAD;EACO;EACL,aAAU;EACV,WAAW,cAAA,GAAG,kBAAkB,EAAE,UAAU;YAH9C;GAKG,SACC,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,MAAC,WAAD,EAAA,UAAA;IACG,YAAY,iBAAA,GAAA,kBAAA,KAAC,QAAD;KAAM,WAAU;eAAoB;KAAQ,CAAA;IACxD;IACA,SAAS;IACA,EAAA,CAAA,EACR,CAAA;GAGP;GACA,eAAe,iBAAA,GAAA,kBAAA,KAAC,iBAAD,EAAmC,CAAA;GAClD,eAAe,iBAAA,GAAA,kBAAA,KAAC,aAAD,EAAa,WAAW,cAAA,GAAG,qBAAqB,CAAC,EAAI,CAAA;GACjE;;AAGR,QACE,iBAAA,GAAA,kBAAA,KAAC,gBAAgB,UAAjB;EAA0B,OAAO,EAAE,IAAI;YACrC,iBAAA,GAAA,kBAAA,KAAC,iBAAiB,UAAlB;GAA2B,OAAO,EAAE,MAAM,gBAAgB,MAAM;aAC7D;GACyB,CAAA;EACH,CAAA;;AAI/B,IAAM,kBAAkB,MAAM,WAAW,SAAS"}
|
|
@@ -2,4 +2,4 @@ import { PreviewCard as PreviewCardPrimitive } from '@base-ui/react/preview-card
|
|
|
2
2
|
declare function HoverCard({ ...props }: PreviewCardPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
declare function HoverCardTrigger({ ...props }: PreviewCardPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare function HoverCardContent({ className, side, sideOffset, align, alignOffset, ...props }: PreviewCardPrimitive.Popup.Props & Pick<PreviewCardPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export { HoverCard,
|
|
5
|
+
export { HoverCard, HoverCardContent, HoverCardTrigger };
|
package/dist/hover-card/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
require("../chunk-CoQrYLCe.js");
|
|
4
|
-
const require_utils = require("../utils-
|
|
4
|
+
const require_utils = require("../utils-BGuEr0aP.js");
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
let _base_ui_react_preview_card = require("@base-ui/react/preview-card");
|
|
7
7
|
//#region src/hover-card/index.tsx
|
|
@@ -28,7 +28,7 @@ function HoverCardContent({ className, side = "bottom", sideOffset = 4, align =
|
|
|
28
28
|
className: "isolate z-50",
|
|
29
29
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_preview_card.PreviewCard.Popup, {
|
|
30
30
|
"data-slot": "hover-card-content",
|
|
31
|
-
className: require_utils.cn("
|
|
31
|
+
className: require_utils.cn("origin-(--transform-origin) bg-popover text-popover-foreground ring-foreground/10 outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 w-64 rounded-lg p-2.5 text-sm shadow-md ring-1 duration-100", className),
|
|
32
32
|
...props
|
|
33
33
|
})
|
|
34
34
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/hover-card/index.tsx"],"sourcesContent":["\"use client\"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/hover-card/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { PreviewCard as PreviewCardPrimitive } from \"@base-ui/react/preview-card\";\n\nimport { cn } from \"../../lib\";\n\nfunction HoverCard({ ...props }: PreviewCardPrimitive.Root.Props) {\n return <PreviewCardPrimitive.Root data-slot=\"hover-card\" {...props} />;\n}\n\nfunction HoverCardTrigger({ ...props }: PreviewCardPrimitive.Trigger.Props) {\n return (\n <PreviewCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />\n );\n}\n\nfunction HoverCardContent({\n className,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 4,\n ...props\n}: PreviewCardPrimitive.Popup.Props &\n Pick<\n PreviewCardPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n >) {\n return (\n <PreviewCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <PreviewCardPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <PreviewCardPrimitive.Popup\n data-slot=\"hover-card-content\"\n className={cn(\n \"origin-(--transform-origin) bg-popover text-popover-foreground ring-foreground/10 outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 w-64 rounded-lg p-2.5 text-sm shadow-md ring-1 duration-100\",\n className,\n )}\n {...props}\n />\n </PreviewCardPrimitive.Positioner>\n </PreviewCardPrimitive.Portal>\n );\n}\n\nexport { HoverCard, HoverCardContent, HoverCardTrigger };\n"],"mappings":";;;;;;;AAMA,SAAS,UAAU,EAAE,GAAG,SAA0C;AAChE,QAAO,iBAAA,GAAA,kBAAA,KAAC,4BAAA,YAAqB,MAAtB;EAA2B,aAAU;EAAa,GAAI;EAAS,CAAA;;AAGxE,SAAS,iBAAiB,EAAE,GAAG,SAA6C;AAC1E,QACE,iBAAA,GAAA,kBAAA,KAAC,4BAAA,YAAqB,SAAtB;EAA8B,aAAU;EAAqB,GAAI;EAAS,CAAA;;AAI9E,SAAS,iBAAiB,EACxB,WACA,OAAO,UACP,aAAa,GACb,QAAQ,UACR,cAAc,GACd,GAAG,SAKA;AACH,QACE,iBAAA,GAAA,kBAAA,KAAC,4BAAA,YAAqB,QAAtB;EAA6B,aAAU;YACrC,iBAAA,GAAA,kBAAA,KAAC,4BAAA,YAAqB,YAAtB;GACS;GACM;GACP;GACM;GACZ,WAAU;aAEV,iBAAA,GAAA,kBAAA,KAAC,4BAAA,YAAqB,OAAtB;IACE,aAAU;IACV,WAAW,cAAA,GACT,iiBACA,UACD;IACD,GAAI;IACJ,CAAA;GAC8B,CAAA;EACN,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as cn } from "../utils-
|
|
2
|
+
import { t as cn } from "../utils-TtTqRIUX.mjs";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { PreviewCard } from "@base-ui/react/preview-card";
|
|
5
5
|
//#region src/hover-card/index.tsx
|
|
@@ -26,7 +26,7 @@ function HoverCardContent({ className, side = "bottom", sideOffset = 4, align =
|
|
|
26
26
|
className: "isolate z-50",
|
|
27
27
|
children: /* @__PURE__ */ jsx(PreviewCard.Popup, {
|
|
28
28
|
"data-slot": "hover-card-content",
|
|
29
|
-
className: cn("
|
|
29
|
+
className: cn("origin-(--transform-origin) bg-popover text-popover-foreground ring-foreground/10 outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 w-64 rounded-lg p-2.5 text-sm shadow-md ring-1 duration-100", className),
|
|
30
30
|
...props
|
|
31
31
|
})
|
|
32
32
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/hover-card/index.tsx"],"sourcesContent":["\"use client\"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/hover-card/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { PreviewCard as PreviewCardPrimitive } from \"@base-ui/react/preview-card\";\n\nimport { cn } from \"../../lib\";\n\nfunction HoverCard({ ...props }: PreviewCardPrimitive.Root.Props) {\n return <PreviewCardPrimitive.Root data-slot=\"hover-card\" {...props} />;\n}\n\nfunction HoverCardTrigger({ ...props }: PreviewCardPrimitive.Trigger.Props) {\n return (\n <PreviewCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />\n );\n}\n\nfunction HoverCardContent({\n className,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 4,\n ...props\n}: PreviewCardPrimitive.Popup.Props &\n Pick<\n PreviewCardPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n >) {\n return (\n <PreviewCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <PreviewCardPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <PreviewCardPrimitive.Popup\n data-slot=\"hover-card-content\"\n className={cn(\n \"origin-(--transform-origin) bg-popover text-popover-foreground ring-foreground/10 outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 w-64 rounded-lg p-2.5 text-sm shadow-md ring-1 duration-100\",\n className,\n )}\n {...props}\n />\n </PreviewCardPrimitive.Positioner>\n </PreviewCardPrimitive.Portal>\n );\n}\n\nexport { HoverCard, HoverCardContent, HoverCardTrigger };\n"],"mappings":";;;;;AAMA,SAAS,UAAU,EAAE,GAAG,SAA0C;AAChE,QAAO,oBAAC,YAAqB,MAAtB;EAA2B,aAAU;EAAa,GAAI;EAAS,CAAA;;AAGxE,SAAS,iBAAiB,EAAE,GAAG,SAA6C;AAC1E,QACE,oBAAC,YAAqB,SAAtB;EAA8B,aAAU;EAAqB,GAAI;EAAS,CAAA;;AAI9E,SAAS,iBAAiB,EACxB,WACA,OAAO,UACP,aAAa,GACb,QAAQ,UACR,cAAc,GACd,GAAG,SAKA;AACH,QACE,oBAAC,YAAqB,QAAtB;EAA6B,aAAU;YACrC,oBAAC,YAAqB,YAAtB;GACS;GACM;GACP;GACM;GACZ,WAAU;aAEV,oBAAC,YAAqB,OAAtB;IACE,aAAU;IACV,WAAW,GACT,iiBACA,UACD;IACD,GAAI;IACJ,CAAA;GAC8B,CAAA;EACN,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ export * from './combobox';
|
|
|
17
17
|
export * from './command';
|
|
18
18
|
export * from './context-menu';
|
|
19
19
|
export * from './date-picker';
|
|
20
|
-
export * from './direction';
|
|
21
20
|
export * from './dialog';
|
|
21
|
+
export * from './direction';
|
|
22
22
|
export * from './drawer';
|
|
23
23
|
export * from './dropdown-menu';
|
|
24
24
|
export * from './empty';
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ const require_dropdown_menu = require("./dropdown-menu/index.js");
|
|
|
31
31
|
const require_empty = require("./empty/index.js");
|
|
32
32
|
const require_label = require("./label/index.js");
|
|
33
33
|
const require_field = require("./field/index.js");
|
|
34
|
-
const require_form = require("./form-
|
|
34
|
+
const require_form = require("./form-h_cJBAwg.js");
|
|
35
35
|
const require_hover_card = require("./hover-card/index.js");
|
|
36
36
|
const require_input_otp = require("./input-otp/index.js");
|
|
37
37
|
const require_item = require("./item/index.js");
|
|
@@ -46,7 +46,7 @@ const require_resizable = require("./resizable/index.js");
|
|
|
46
46
|
const require_scroll_area = require("./scroll-area/index.js");
|
|
47
47
|
const require_select = require("./select/index.js");
|
|
48
48
|
const require_sheet = require("./sheet/index.js");
|
|
49
|
-
const require_sidebar = require("./sidebar-
|
|
49
|
+
const require_sidebar = require("./sidebar-E9uledix.js");
|
|
50
50
|
const require_skeleton = require("./skeleton/index.js");
|
|
51
51
|
const require_tooltip = require("./tooltip/index.js");
|
|
52
52
|
const require_slider = require("./slider/index.js");
|
|
@@ -289,7 +289,6 @@ exports.PaginationLink = require_pagination.PaginationLink;
|
|
|
289
289
|
exports.PaginationNext = require_pagination.PaginationNext;
|
|
290
290
|
exports.PaginationPrevious = require_pagination.PaginationPrevious;
|
|
291
291
|
exports.Popover = require_popover.Popover;
|
|
292
|
-
exports.PopoverAnchor = require_popover.PopoverAnchor;
|
|
293
292
|
exports.PopoverContent = require_popover.PopoverContent;
|
|
294
293
|
exports.PopoverDescription = require_popover.PopoverDescription;
|
|
295
294
|
exports.PopoverHeader = require_popover.PopoverHeader;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from \"./accordion\";\nexport * from \"./alert\";\nexport * from \"./alert-dialog\";\nexport * from \"./aspect-ratio\";\nexport * from \"./avatar\";\nexport * from \"./badge\";\nexport * from \"./breadcrumb\";\nexport * from \"./button\";\nexport * from \"./button-group\";\nexport * from \"./calendar\";\nexport * from \"./card\";\nexport * from \"./carousel\";\nexport * from \"./chart\";\nexport * from \"./checkbox\";\nexport * from \"./collapsible\";\nexport * from \"./combobox\";\nexport * from \"./command\";\nexport * from \"./context-menu\";\nexport * from \"./date-picker\";\nexport * from \"./dialog\";\nexport * from \"./direction\";\nexport * from \"./drawer\";\nexport * from \"./dropdown-menu\";\nexport * from \"./empty\";\nexport {\n Field,\n FieldContent,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldTitle,\n} from \"./field\";\nexport * from \"./form\";\nexport * from \"./hover-card\";\nexport * from \"./input\";\nexport * from \"./input-group\";\nexport * from \"./input-otp\";\nexport * from \"./item\";\nexport * from \"./kbd\";\nexport * from \"./label\";\nexport * from \"./menubar\";\nexport * from \"./native-select\";\nexport * from \"./navigation-menu\";\nexport * from \"./pagination\";\nexport * from \"./popover\";\nexport * from \"./progress\";\nexport * from \"./radio-group\";\nexport * from \"./resizable\";\nexport * from \"./scroll-area\";\nexport * from \"./select\";\nexport * from \"./separator\";\nexport * from \"./sheet\";\nexport * from \"./sidebar\";\nexport * from \"./skeleton\";\nexport * from \"./slider\";\nexport * from \"./sonner\";\nexport * from \"./spinner\";\nexport * from \"./switch\";\nexport * from \"./table\";\nexport * from \"./tabs\";\nexport * from \"./textarea\";\nexport * from \"./toggle\";\nexport * from \"./toggle-group\";\nexport * from \"./tooltip\";\n"],"mappings":""}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as FormDescription, c as FormRoot, i as FormField, n as FormMessage, o as FormControl, r as FormLabel, s as useFormField, t as FormItemWithRef } from "./form-
|
|
1
|
+
import { a as FormDescription, c as FormRoot, i as FormField, n as FormMessage, o as FormControl, r as FormLabel, s as useFormField, t as FormItemWithRef } from "./form-DLd4sOko.mjs";
|
|
2
2
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./accordion/index.mjs";
|
|
3
3
|
import { Alert, AlertAction, AlertDescription, AlertTitle } from "./alert/index.mjs";
|
|
4
4
|
import { Button, buttonVariants } from "./button/index.mjs";
|
|
@@ -22,7 +22,7 @@ import { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxColl
|
|
|
22
22
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./dialog/index.mjs";
|
|
23
23
|
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "./command/index.mjs";
|
|
24
24
|
import { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "./context-menu/index.mjs";
|
|
25
|
-
import { Popover,
|
|
25
|
+
import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from "./popover/index.mjs";
|
|
26
26
|
import { DatePicker } from "./date-picker/index.mjs";
|
|
27
27
|
import { DirectionProvider, useDirection } from "./direction/index.mjs";
|
|
28
28
|
import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from "./drawer/index.mjs";
|
|
@@ -44,7 +44,7 @@ import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "./resizabl
|
|
|
44
44
|
import { ScrollArea, ScrollBar } from "./scroll-area/index.mjs";
|
|
45
45
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./select/index.mjs";
|
|
46
46
|
import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./sheet/index.mjs";
|
|
47
|
-
import { C as SidebarTrigger, S as SidebarSeparator, _ as SidebarMenuSub, a as SidebarGroupAction, b as SidebarProvider, c as SidebarHeader, d as SidebarMenu, f as SidebarMenuAction, g as SidebarMenuSkeleton, h as SidebarMenuItem, i as SidebarGroup, l as SidebarInput, m as SidebarMenuButton, n as SidebarContent, o as SidebarGroupContent, p as SidebarMenuBadge, r as SidebarFooter, s as SidebarGroupLabel, t as Sidebar, u as SidebarInset, v as SidebarMenuSubButton, w as useSidebar, x as SidebarRail, y as SidebarMenuSubItem } from "./sidebar-
|
|
47
|
+
import { C as SidebarTrigger, S as SidebarSeparator, _ as SidebarMenuSub, a as SidebarGroupAction, b as SidebarProvider, c as SidebarHeader, d as SidebarMenu, f as SidebarMenuAction, g as SidebarMenuSkeleton, h as SidebarMenuItem, i as SidebarGroup, l as SidebarInput, m as SidebarMenuButton, n as SidebarContent, o as SidebarGroupContent, p as SidebarMenuBadge, r as SidebarFooter, s as SidebarGroupLabel, t as Sidebar, u as SidebarInset, v as SidebarMenuSubButton, w as useSidebar, x as SidebarRail, y as SidebarMenuSubItem } from "./sidebar-Ddt6hBj_.mjs";
|
|
48
48
|
import { Skeleton } from "./skeleton/index.mjs";
|
|
49
49
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip/index.mjs";
|
|
50
50
|
import { Slider } from "./slider/index.mjs";
|
|
@@ -57,6 +57,6 @@ import { Toggle, toggleVariants } from "./toggle/index.mjs";
|
|
|
57
57
|
import { ToggleGroup, ToggleGroupItem } from "./toggle-group/index.mjs";
|
|
58
58
|
export * from "react-hook-form";
|
|
59
59
|
//#endregion
|
|
60
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FormControl, FormDescription, FormField, FormItemWithRef as FormItem, FormLabel, FormMessage, FormRoot, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover,
|
|
60
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FormControl, FormDescription, FormField, FormItemWithRef as FormItem, FormLabel, FormMessage, FormRoot, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonGroupVariants, buttonVariants, navigationMenuTriggerStyle, tabsListVariants, toast, toggleVariants, useCarousel, useComboboxAnchor, useDirection, useFormField, useSidebar };
|
|
61
61
|
|
|
62
62
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from \"./accordion\";\nexport * from \"./alert\";\nexport * from \"./alert-dialog\";\nexport * from \"./aspect-ratio\";\nexport * from \"./avatar\";\nexport * from \"./badge\";\nexport * from \"./breadcrumb\";\nexport * from \"./button\";\nexport * from \"./button-group\";\nexport * from \"./calendar\";\nexport * from \"./card\";\nexport * from \"./carousel\";\nexport * from \"./chart\";\nexport * from \"./checkbox\";\nexport * from \"./collapsible\";\nexport * from \"./combobox\";\nexport * from \"./command\";\nexport * from \"./context-menu\";\nexport * from \"./date-picker\";\nexport * from \"./dialog\";\nexport * from \"./direction\";\nexport * from \"./drawer\";\nexport * from \"./dropdown-menu\";\nexport * from \"./empty\";\nexport {\n Field,\n FieldContent,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldTitle,\n} from \"./field\";\nexport * from \"./form\";\nexport * from \"./hover-card\";\nexport * from \"./input\";\nexport * from \"./input-group\";\nexport * from \"./input-otp\";\nexport * from \"./item\";\nexport * from \"./kbd\";\nexport * from \"./label\";\nexport * from \"./menubar\";\nexport * from \"./native-select\";\nexport * from \"./navigation-menu\";\nexport * from \"./pagination\";\nexport * from \"./popover\";\nexport * from \"./progress\";\nexport * from \"./radio-group\";\nexport * from \"./resizable\";\nexport * from \"./scroll-area\";\nexport * from \"./select\";\nexport * from \"./separator\";\nexport * from \"./sheet\";\nexport * from \"./sidebar\";\nexport * from \"./skeleton\";\nexport * from \"./slider\";\nexport * from \"./sonner\";\nexport * from \"./spinner\";\nexport * from \"./switch\";\nexport * from \"./table\";\nexport * from \"./tabs\";\nexport * from \"./textarea\";\nexport * from \"./toggle\";\nexport * from \"./toggle-group\";\nexport * from \"./tooltip\";\n"],"mappings":""}
|
package/dist/input/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../chunk-CoQrYLCe.js");
|
|
3
|
-
const require_utils = require("../utils-
|
|
3
|
+
const require_utils = require("../utils-BGuEr0aP.js");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
5
|
let react = require("react");
|
|
6
6
|
react = require_chunk.__toESM(react);
|
|
@@ -10,7 +10,7 @@ function Input({ className, type, ...props }) {
|
|
|
10
10
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_input.Input, {
|
|
11
11
|
type,
|
|
12
12
|
"data-slot": "input",
|
|
13
|
-
className: require_utils.cn("
|
|
13
|
+
className: require_utils.cn("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base outline-none transition-colors file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className),
|
|
14
14
|
...props
|
|
15
15
|
});
|
|
16
16
|
}
|
package/dist/input/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/input/index.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/input/index.tsx"],"sourcesContent":["import { Input as InputPrimitive } from \"@base-ui/react/input\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib\";\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <InputPrimitive\n type={type}\n data-slot=\"input\"\n className={cn(\n \"border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base outline-none transition-colors file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n"],"mappings":";;;;;;;;AAKA,SAAS,MAAM,EAAE,WAAW,MAAM,GAAG,SAAwC;AAC3E,QACE,iBAAA,GAAA,kBAAA,KAAC,qBAAA,OAAD;EACQ;EACN,aAAU;EACV,WAAW,cAAA,GACT,+oBACA,UACD;EACD,GAAI;EACJ,CAAA"}
|
package/dist/input/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as cn } from "../utils-
|
|
1
|
+
import { t as cn } from "../utils-TtTqRIUX.mjs";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import { Input as Input$1 } from "@base-ui/react/input";
|
|
@@ -7,7 +7,7 @@ function Input({ className, type, ...props }) {
|
|
|
7
7
|
return /* @__PURE__ */ jsx(Input$1, {
|
|
8
8
|
type,
|
|
9
9
|
"data-slot": "input",
|
|
10
|
-
className: cn("
|
|
10
|
+
className: cn("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base outline-none transition-colors file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className),
|
|
11
11
|
...props
|
|
12
12
|
});
|
|
13
13
|
}
|
package/dist/input/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/input/index.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/input/index.tsx"],"sourcesContent":["import { Input as InputPrimitive } from \"@base-ui/react/input\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib\";\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <InputPrimitive\n type={type}\n data-slot=\"input\"\n className={cn(\n \"border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base outline-none transition-colors file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n"],"mappings":";;;;;AAKA,SAAS,MAAM,EAAE,WAAW,MAAM,GAAG,SAAwC;AAC3E,QACE,oBAAC,SAAD;EACQ;EACN,aAAU;EACV,WAAW,GACT,+oBACA,UACD;EACD,GAAI;EACJ,CAAA"}
|
|
@@ -16,4 +16,4 @@ declare function InputGroupButton({ className, type, variant, size, ...props }:
|
|
|
16
16
|
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export { InputGroup, InputGroupAddon, InputGroupButton,
|
|
19
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const require_chunk = require("../chunk-CoQrYLCe.js");
|
|
4
|
-
const require_utils = require("../utils-
|
|
4
|
+
const require_utils = require("../utils-BGuEr0aP.js");
|
|
5
5
|
const require_button = require("../button/index.js");
|
|
6
6
|
const require_input = require("../input/index.js");
|
|
7
7
|
const require_textarea = require("../textarea/index.js");
|
|
@@ -14,16 +14,16 @@ function InputGroup({ className, ...props }) {
|
|
|
14
14
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
15
15
|
"data-slot": "input-group",
|
|
16
16
|
role: "group",
|
|
17
|
-
className: require_utils.cn("group/input-group
|
|
17
|
+
className: require_utils.cn("group/input-group border-input in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-8 w-full min-w-0 items-center rounded-lg border outline-none transition-colors has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-start]]:h-auto has-[>textarea]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className),
|
|
18
18
|
...props
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
var inputGroupAddonVariants = (0, class_variance_authority.cva)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium
|
|
21
|
+
var inputGroupAddonVariants = (0, class_variance_authority.cva)("text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
22
22
|
variants: { align: {
|
|
23
23
|
"inline-start": "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
|
|
24
24
|
"inline-end": "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
|
|
25
|
-
"block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2
|
|
26
|
-
"block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2
|
|
25
|
+
"block-start": "[.border-b]:pb-2 order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2",
|
|
26
|
+
"block-end": "[.border-t]:pt-2 order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2"
|
|
27
27
|
} },
|
|
28
28
|
defaultVariants: { align: "inline-start" }
|
|
29
29
|
});
|
|
@@ -60,21 +60,21 @@ function InputGroupButton({ className, type = "button", variant = "ghost", size
|
|
|
60
60
|
}
|
|
61
61
|
function InputGroupText({ className, ...props }) {
|
|
62
62
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
63
|
-
className: require_utils.cn("flex items-center gap-2 text-sm
|
|
63
|
+
className: require_utils.cn("text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none", className),
|
|
64
64
|
...props
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
function InputGroupInput({ className, ...props }) {
|
|
68
68
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input.Input, {
|
|
69
69
|
"data-slot": "input-group-control",
|
|
70
|
-
className: require_utils.cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent
|
|
70
|
+
className: require_utils.cn("aria-invalid:ring-0 flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent dark:bg-transparent dark:disabled:bg-transparent", className),
|
|
71
71
|
...props
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
function InputGroupTextarea({ className, ...props }) {
|
|
75
75
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_textarea.Textarea, {
|
|
76
76
|
"data-slot": "input-group-control",
|
|
77
|
-
className: require_utils.cn("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent
|
|
77
|
+
className: require_utils.cn("aria-invalid:ring-0 flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent dark:bg-transparent dark:disabled:bg-transparent", className),
|
|
78
78
|
...props
|
|
79
79
|
});
|
|
80
80
|
}
|