ml-uikit 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/alert.d.ts +8 -2
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/icon-button.d.ts +9 -0
- package/dist/components/ui/icon-button.d.ts.map +1 -0
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs10.js +1 -1
- package/dist/index.cjs10.js.map +1 -1
- package/dist/index.cjs11.js +1 -1
- package/dist/index.cjs11.js.map +1 -1
- package/dist/index.cjs12.js +1 -1
- package/dist/index.cjs12.js.map +1 -1
- package/dist/index.cjs13.js +1 -1
- package/dist/index.cjs13.js.map +1 -1
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs14.js.map +1 -1
- package/dist/index.cjs15.js +1 -7
- package/dist/index.cjs15.js.map +1 -1
- package/dist/index.cjs16.js +7 -1
- package/dist/index.cjs16.js.map +1 -1
- package/dist/index.cjs17.js +1 -1
- package/dist/index.cjs17.js.map +1 -1
- package/dist/index.cjs18.js +1 -1
- package/dist/index.cjs18.js.map +1 -1
- package/dist/index.cjs19.js +1 -1
- package/dist/index.cjs19.js.map +1 -1
- package/dist/index.cjs2.js +1 -1
- package/dist/index.cjs20.js +1 -1
- package/dist/index.cjs20.js.map +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs21.js.map +1 -1
- package/dist/index.cjs22.js +1 -1
- package/dist/index.cjs22.js.map +1 -1
- package/dist/index.cjs23.js +1 -1
- package/dist/index.cjs23.js.map +1 -1
- package/dist/index.cjs24.js +1 -1
- package/dist/index.cjs24.js.map +1 -1
- package/dist/index.cjs25.js +1 -1
- package/dist/index.cjs25.js.map +1 -1
- package/dist/index.cjs26.js +1 -1
- package/dist/index.cjs26.js.map +1 -1
- package/dist/index.cjs27.js +1 -1
- package/dist/index.cjs27.js.map +1 -1
- package/dist/index.cjs28.js +1 -1
- package/dist/index.cjs28.js.map +1 -1
- package/dist/index.cjs29.js +1 -1
- package/dist/index.cjs29.js.map +1 -1
- package/dist/index.cjs3.js +1 -1
- package/dist/index.cjs30.js +1 -1
- package/dist/index.cjs30.js.map +1 -1
- package/dist/index.cjs31.js +1 -1
- package/dist/index.cjs31.js.map +1 -1
- package/dist/index.cjs32.js +1 -1
- package/dist/index.cjs32.js.map +1 -1
- package/dist/index.cjs33.js +1 -1
- package/dist/index.cjs33.js.map +1 -1
- package/dist/index.cjs34.js +1 -1
- package/dist/index.cjs34.js.map +1 -1
- package/dist/index.cjs35.js +1 -1
- package/dist/index.cjs35.js.map +1 -1
- package/dist/index.cjs36.js +1 -1
- package/dist/index.cjs36.js.map +1 -1
- package/dist/index.cjs37.js +1 -1
- package/dist/index.cjs37.js.map +1 -1
- package/dist/index.cjs38.js +1 -1
- package/dist/index.cjs38.js.map +1 -1
- package/dist/index.cjs39.js +1 -1
- package/dist/index.cjs39.js.map +1 -1
- package/dist/index.cjs4.js +1 -1
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs40.js +1 -1
- package/dist/index.cjs40.js.map +1 -1
- package/dist/index.cjs41.js +1 -1
- package/dist/index.cjs41.js.map +1 -1
- package/dist/index.cjs42.js +1 -1
- package/dist/index.cjs42.js.map +1 -1
- package/dist/index.cjs43.js +1 -1
- package/dist/index.cjs43.js.map +1 -1
- package/dist/index.cjs44.js +1 -1
- package/dist/index.cjs44.js.map +1 -1
- package/dist/index.cjs45.js +1 -1
- package/dist/index.cjs45.js.map +1 -1
- package/dist/index.cjs46.js +1 -1
- package/dist/index.cjs46.js.map +1 -1
- package/dist/index.cjs47.js +1 -1
- package/dist/index.cjs47.js.map +1 -1
- package/dist/index.cjs48.js +1 -1
- package/dist/index.cjs48.js.map +1 -1
- package/dist/index.cjs49.js +1 -1
- package/dist/index.cjs49.js.map +1 -1
- package/dist/index.cjs5.js +1 -1
- package/dist/index.cjs50.js +1 -1
- package/dist/index.cjs50.js.map +1 -1
- package/dist/index.cjs51.js +1 -1
- package/dist/index.cjs51.js.map +1 -1
- package/dist/index.cjs52.js +1 -1
- package/dist/index.cjs52.js.map +1 -1
- package/dist/index.cjs53.js +1 -1
- package/dist/index.cjs53.js.map +1 -1
- package/dist/index.cjs54.js +1 -1
- package/dist/index.cjs54.js.map +1 -1
- package/dist/index.cjs55.js +1 -1
- package/dist/index.cjs55.js.map +1 -1
- package/dist/index.cjs56.js +1 -1
- package/dist/index.cjs56.js.map +1 -1
- package/dist/index.cjs57.js +1 -1
- package/dist/index.cjs57.js.map +1 -1
- package/dist/index.cjs7.js +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs9.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +321 -312
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +27 -27
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es11.js +19 -72
- package/dist/index.es11.js.map +1 -1
- package/dist/index.es12.js +62 -157
- package/dist/index.es12.js.map +1 -1
- package/dist/index.es13.js +169 -58
- package/dist/index.es13.js.map +1 -1
- package/dist/index.es14.js +55 -157
- package/dist/index.es14.js.map +1 -1
- package/dist/index.es15.js +150 -181
- package/dist/index.es15.js.map +1 -1
- package/dist/index.es16.js +188 -21
- package/dist/index.es16.js.map +1 -1
- package/dist/index.es17.js +31 -5
- package/dist/index.es17.js.map +1 -1
- package/dist/index.es18.js +5 -103
- package/dist/index.es18.js.map +1 -1
- package/dist/index.es19.js +70 -103
- package/dist/index.es19.js.map +1 -1
- package/dist/index.es2.js +1 -1
- package/dist/index.es20.js +108 -61
- package/dist/index.es20.js.map +1 -1
- package/dist/index.es21.js +59 -60
- package/dist/index.es21.js.map +1 -1
- package/dist/index.es22.js +69 -114
- package/dist/index.es22.js.map +1 -1
- package/dist/index.es23.js +132 -97
- package/dist/index.es23.js.map +1 -1
- package/dist/index.es24.js +49 -156
- package/dist/index.es24.js.map +1 -1
- package/dist/index.es25.js +194 -76
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es26.js +89 -20
- package/dist/index.es26.js.map +1 -1
- package/dist/index.es27.js +20 -22
- package/dist/index.es27.js.map +1 -1
- package/dist/index.es28.js +17 -144
- package/dist/index.es28.js.map +1 -1
- package/dist/index.es29.js +145 -37
- package/dist/index.es29.js.map +1 -1
- package/dist/index.es3.js +1 -1
- package/dist/index.es30.js +37 -179
- package/dist/index.es30.js.map +1 -1
- package/dist/index.es31.js +174 -18
- package/dist/index.es31.js.map +1 -1
- package/dist/index.es32.js +29 -16
- package/dist/index.es32.js.map +1 -1
- package/dist/index.es33.js +15 -92
- package/dist/index.es33.js.map +1 -1
- package/dist/index.es34.js +91 -189
- package/dist/index.es34.js.map +1 -1
- package/dist/index.es35.js +165 -71
- package/dist/index.es35.js.map +1 -1
- package/dist/index.es36.js +85 -84
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +92 -17
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +19 -21
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +16 -21
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es4.js +65 -26
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es40.js +22 -25
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +25 -104
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +117 -20
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +19 -97
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +77 -509
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +552 -11
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +15 -18
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +44 -19
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es48.js +19 -12
- package/dist/index.es48.js.map +1 -1
- package/dist/index.es49.js +13 -22
- package/dist/index.es49.js.map +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/index.es50.js +23 -197
- package/dist/index.es50.js.map +1 -1
- package/dist/index.es51.js +191 -28
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es52.js +45 -14
- package/dist/index.es52.js.map +1 -1
- package/dist/index.es53.js +12 -28
- package/dist/index.es53.js.map +1 -1
- package/dist/index.es54.js +30 -34
- package/dist/index.es54.js.map +1 -1
- package/dist/index.es55.js +37 -19
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +20 -6
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es57.js +5 -11
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es7.js +1 -1
- package/dist/index.es8.js +1 -1
- package/dist/index.es9.js +1 -1
- package/dist/style.css +436 -172
- package/package.json +1 -1
- package/dist/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/use-mobile.d.ts.map +0 -1
package/dist/index.es25.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es25.js","sources":["../src/components/ui/
|
|
1
|
+
{"version":3,"file":"index.es25.js","sources":["../src/components/ui/field.tsx"],"sourcesContent":["\"use client\"\n\nimport { useMemo } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Label } from \"@/components/ui/label\"\nimport { Separator } from \"@/components/ui/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-6\",\n \"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-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\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-7 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-3\",\n {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start\",\n ],\n responsive: [\n \"@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\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-1.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 flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>[data-slot=field]]:p-4\",\n \"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10\",\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 text-sm font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5\",\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) {\n return null\n }\n\n if (errors?.length === 1 && errors[0]?.message) {\n return errors[0].message\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {errors.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 FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n}\n"],"names":["FieldSet","className","props","cn","FieldLegend","variant","FieldGroup","fieldVariants","cva","Field","orientation","FieldContent","FieldLabel","Label","FieldTitle","FieldDescription","FieldSeparator","children","Separator","FieldError","errors","content","useMemo","error","index"],"mappings":";;;;;AASA,SAASA,EAAS,EAAE,WAAAC,GAAW,GAAGC,KAA2C;AAC3E,SACE,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,QACAF;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASE,EAAY;AAAA,EACnB,WAAAH;AAAA,EACA,SAAAI,IAAU;AAAA,EACV,GAAGH;AACL,GAAsE;AACpE,SACE,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,gBAAcG;AAAA,MACd,WAAWF;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACAF;AAAA,MAAA;AAAA,MAED,GAAG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B,sBAAA,cAAC,MAAA,EAAG,WAAU,qCAAA,GACXA,EAAO;AAAA,IACN,CAACG,GAAOC,MACND,GAAO,+CAAY,MAAA,EAAG,KAAKC,EAAA,GAAQD,EAAM,OAAQ;AAAA,EAAA,CAEvD,IAbO,OAeR,CAACN,GAAUG,CAAM,CAAC;AAErB,SAAKC,IAKH,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,aAAU;AAAA,MACV,WAAWlB,EAAG,wCAAwCF,CAAS;AAAA,MAC9D,GAAGC;AAAA,IAAA;AAAA,IAEHmB;AAAA,EAAA,IAVI;AAaX;"}
|
package/dist/index.es26.js
CHANGED
|
@@ -1,23 +1,92 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { Slot as f } from "@radix-ui/react-slot";
|
|
3
|
+
import { FormProvider as u, useFormContext as F, Controller as p } from "react-hook-form";
|
|
4
|
+
import { cn as a } from "./index.es57.js";
|
|
5
|
+
import { Label as I } from "./index.es33.js";
|
|
6
|
+
const h = u, c = e.createContext(null), R = ({
|
|
7
|
+
...r
|
|
8
|
+
}) => /* @__PURE__ */ e.createElement(c.Provider, { value: { name: r.name } }, /* @__PURE__ */ e.createElement(p, { ...r })), i = () => {
|
|
9
|
+
const r = e.useContext(c), t = e.useContext(l), { getFieldState: o, formState: m } = F();
|
|
10
|
+
if (!r)
|
|
11
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
12
|
+
if (!t)
|
|
13
|
+
throw new Error("useFormField should be used within <FormItem>");
|
|
14
|
+
const n = o(r.name, m), { id: s } = t;
|
|
15
|
+
return {
|
|
16
|
+
id: s,
|
|
17
|
+
name: r.name,
|
|
18
|
+
formItemId: `${s}-form-item`,
|
|
19
|
+
formDescriptionId: `${s}-form-item-description`,
|
|
20
|
+
formMessageId: `${s}-form-item-message`,
|
|
21
|
+
...n
|
|
22
|
+
};
|
|
23
|
+
}, l = e.createContext(null), x = e.forwardRef(({ className: r, ...t }, o) => {
|
|
24
|
+
const m = e.useId();
|
|
25
|
+
return /* @__PURE__ */ e.createElement(l.Provider, { value: { id: m } }, /* @__PURE__ */ e.createElement("div", { ref: o, className: a("space-y-2", r), ...t }));
|
|
26
|
+
});
|
|
27
|
+
x.displayName = "FormItem";
|
|
28
|
+
const C = e.forwardRef(({ className: r, ...t }, o) => {
|
|
29
|
+
const { error: m, formItemId: n } = i();
|
|
30
|
+
return /* @__PURE__ */ e.createElement(
|
|
31
|
+
I,
|
|
32
|
+
{
|
|
33
|
+
ref: o,
|
|
34
|
+
className: a(m && "text-destructive", r),
|
|
35
|
+
htmlFor: n,
|
|
36
|
+
...t
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
C.displayName = "FormLabel";
|
|
41
|
+
const w = e.forwardRef(({ ...r }, t) => {
|
|
42
|
+
const { error: o, formItemId: m, formDescriptionId: n, formMessageId: s } = i();
|
|
43
|
+
return /* @__PURE__ */ e.createElement(
|
|
44
|
+
f,
|
|
45
|
+
{
|
|
46
|
+
ref: t,
|
|
47
|
+
id: m,
|
|
48
|
+
"aria-describedby": o ? `${n} ${s}` : `${n}`,
|
|
49
|
+
"aria-invalid": !!o,
|
|
50
|
+
...r
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
w.displayName = "FormControl";
|
|
55
|
+
const g = e.forwardRef(({ className: r, ...t }, o) => {
|
|
56
|
+
const { formDescriptionId: m } = i();
|
|
57
|
+
return /* @__PURE__ */ e.createElement(
|
|
58
|
+
"p",
|
|
59
|
+
{
|
|
60
|
+
ref: o,
|
|
61
|
+
id: m,
|
|
62
|
+
className: a("text-[0.8rem] text-muted-foreground", r),
|
|
63
|
+
...t
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
g.displayName = "FormDescription";
|
|
68
|
+
const E = e.forwardRef(({ className: r, children: t, ...o }, m) => {
|
|
69
|
+
const { error: n, formMessageId: s } = i(), d = n ? String(n?.message ?? "") : t;
|
|
70
|
+
return d ? /* @__PURE__ */ e.createElement(
|
|
71
|
+
"p",
|
|
72
|
+
{
|
|
73
|
+
ref: m,
|
|
74
|
+
id: s,
|
|
75
|
+
className: a("text-[0.8rem] font-medium text-destructive", r),
|
|
76
|
+
...o
|
|
77
|
+
},
|
|
78
|
+
d
|
|
79
|
+
) : null;
|
|
80
|
+
});
|
|
81
|
+
E.displayName = "FormMessage";
|
|
18
82
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
83
|
+
h as Form,
|
|
84
|
+
w as FormControl,
|
|
85
|
+
g as FormDescription,
|
|
86
|
+
R as FormField,
|
|
87
|
+
x as FormItem,
|
|
88
|
+
C as FormLabel,
|
|
89
|
+
E as FormMessage,
|
|
90
|
+
i as useFormField
|
|
22
91
|
};
|
|
23
92
|
//# sourceMappingURL=index.es26.js.map
|
package/dist/index.es26.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es26.js","sources":["../src/components/ui/
|
|
1
|
+
{"version":3,"file":"index.es26.js","sources":["../src/components/ui/form.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Label } from \"@/components/ui/label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null)\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\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n if (!itemContext) {\n throw new Error(\"useFormField should be used within <FormItem>\")\n }\n\n const fieldState = getFieldState(fieldContext.name, formState)\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\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null)\n\nconst FormItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n})\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-[0.8rem] text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-[0.8rem] font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n}\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"],"mappings":";;;;;AAeA,MAAMA,IAAOC,GASPC,IAAmBC,EAAM,cAA4C,IAAI,GAEzEC,IAAY,CAGhB;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAF,EAAA,cAACD,EAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAMG,EAAM,KAAA,EAAK,GACnD,gBAAAF,EAAA,cAACG,GAAA,EAAY,GAAGD,GAAO,CACzB,GAIE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ANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
)
|
|
20
|
-
);
|
|
21
|
-
a.displayName = "Input";
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import * as t from "@radix-ui/react-hover-card";
|
|
3
|
+
import { cn as n } from "./index.es57.js";
|
|
4
|
+
const p = t.Root, f = t.Trigger, s = o.forwardRef(({ className: e, align: a = "center", sideOffset: r = 4, ...d }, i) => /* @__PURE__ */ o.createElement(
|
|
5
|
+
t.Content,
|
|
6
|
+
{
|
|
7
|
+
ref: i,
|
|
8
|
+
align: a,
|
|
9
|
+
sideOffset: r,
|
|
10
|
+
className: n(
|
|
11
|
+
"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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 origin-[--radix-hover-card-content-transform-origin]",
|
|
12
|
+
e
|
|
13
|
+
),
|
|
14
|
+
...d
|
|
15
|
+
}
|
|
16
|
+
));
|
|
17
|
+
s.displayName = t.Content.displayName;
|
|
22
18
|
export {
|
|
23
|
-
|
|
19
|
+
p as HoverCard,
|
|
20
|
+
s as HoverCardContent,
|
|
21
|
+
f as HoverCardTrigger
|
|
24
22
|
};
|
|
25
23
|
//# sourceMappingURL=index.es27.js.map
|
package/dist/index.es27.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es27.js","sources":["../src/components/ui/
|
|
1
|
+
{"version":3,"file":"index.es27.js","sources":["../src/components/ui/hover-card.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst HoverCard = HoverCardPrimitive.Root\n\nconst HoverCardTrigger = HoverCardPrimitive.Trigger\n\nconst HoverCardContent = React.forwardRef<\n React.ElementRef<typeof HoverCardPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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 origin-[--radix-hover-card-content-transform-origin]\",\n className\n )}\n {...props}\n />\n))\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent }\n"],"names":["HoverCard","HoverCardPrimitive","HoverCardTrigger","HoverCardContent","React","className","align","sideOffset","props","ref","cn"],"mappings":";;;AAKA,MAAMA,IAAYC,EAAmB,MAE/BC,IAAmBD,EAAmB,SAEtCE,IAAmBC,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,OAAAC,IAAQ,UAAU,YAAAC,IAAa,GAAG,GAAGC,EAAA,GAASC,MAC5D,gBAAAL,EAAA;AAAA,EAACH,EAAmB;AAAA,EAAnB;AAAA,IACC,KAAAQ;AAAA,IACA,OAAAH;AAAA,IACA,YAAAC;AAAA,IACA,WAAWG;AAAA,MACT;AAAA,MACAL;AAAA,IAAA;AAAA,IAED,GAAGG;AAAA,EAAA;AACN,CACD;AACDL,EAAiB,cAAcF,EAAmB,QAAQ;"}
|
package/dist/index.es28.js
CHANGED
|
@@ -1,152 +1,25 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { Textarea as l } from "./index.es52.js";
|
|
7
|
-
function x({ className: a, ...t }) {
|
|
8
|
-
return /* @__PURE__ */ r.createElement(
|
|
9
|
-
"div",
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { cn as l } from "./index.es57.js";
|
|
3
|
+
const a = e.forwardRef(
|
|
4
|
+
({ className: i, type: r, ...t }, o) => /* @__PURE__ */ e.createElement(
|
|
5
|
+
"input",
|
|
10
6
|
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
20
|
-
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
21
|
-
// Focus state.
|
|
22
|
-
"has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot=input-group-control]:focus-visible]:ring-1",
|
|
23
|
-
// Error state.
|
|
24
|
-
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
|
|
25
|
-
a
|
|
7
|
+
type: r,
|
|
8
|
+
className: l(
|
|
9
|
+
"flex h-10 w-full rounded-[8px] border border-[#e6e6e6] bg-white px-3 py-2 text-[14px] leading-[20px] text-[#111111] transition-colors",
|
|
10
|
+
"file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground",
|
|
11
|
+
"placeholder:text-[#b3b3b3] focus-visible:outline-none focus-visible:border-[#1D1C20] focus-visible:ring-0",
|
|
12
|
+
"disabled:cursor-not-allowed disabled:bg-[#f2f2f2] disabled:text-[#9ca3af] disabled:placeholder:text-[#b3b3b3] disabled:opacity-100",
|
|
13
|
+
"aria-invalid:border-[#ff3b30] aria-invalid:focus-visible:border-[#ff3b30]",
|
|
14
|
+
i
|
|
26
15
|
),
|
|
16
|
+
ref: o,
|
|
27
17
|
...t
|
|
28
18
|
}
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
const d = s(
|
|
32
|
-
"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",
|
|
33
|
-
{
|
|
34
|
-
variants: {
|
|
35
|
-
align: {
|
|
36
|
-
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
37
|
-
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]",
|
|
38
|
-
"block-start": "[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5",
|
|
39
|
-
"block-end": "[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
defaultVariants: {
|
|
43
|
-
align: "inline-start"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
function v({
|
|
48
|
-
className: a,
|
|
49
|
-
align: t = "inline-start",
|
|
50
|
-
...o
|
|
51
|
-
}) {
|
|
52
|
-
return /* @__PURE__ */ r.createElement(
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
role: "group",
|
|
56
|
-
"data-slot": "input-group-addon",
|
|
57
|
-
"data-align": t,
|
|
58
|
-
className: e(d({ align: t }), a),
|
|
59
|
-
onClick: (n) => {
|
|
60
|
-
n.target.closest("button") || n.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
61
|
-
},
|
|
62
|
-
...o
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
const c = s(
|
|
67
|
-
"flex items-center gap-2 text-sm shadow-none",
|
|
68
|
-
{
|
|
69
|
-
variants: {
|
|
70
|
-
size: {
|
|
71
|
-
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
|
|
72
|
-
sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
|
|
73
|
-
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
74
|
-
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
defaultVariants: {
|
|
78
|
-
size: "xs"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
19
|
+
)
|
|
81
20
|
);
|
|
82
|
-
|
|
83
|
-
className: a,
|
|
84
|
-
type: t = "button",
|
|
85
|
-
variant: o = "ghost",
|
|
86
|
-
size: n = "xs",
|
|
87
|
-
...i
|
|
88
|
-
}) {
|
|
89
|
-
return /* @__PURE__ */ r.createElement(
|
|
90
|
-
u,
|
|
91
|
-
{
|
|
92
|
-
type: t,
|
|
93
|
-
"data-size": n,
|
|
94
|
-
variant: o,
|
|
95
|
-
className: e(c({ size: n }), a),
|
|
96
|
-
...i
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
function z({ className: a, ...t }) {
|
|
101
|
-
return /* @__PURE__ */ r.createElement(
|
|
102
|
-
"span",
|
|
103
|
-
{
|
|
104
|
-
className: e(
|
|
105
|
-
"text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
|
|
106
|
-
a
|
|
107
|
-
),
|
|
108
|
-
...t
|
|
109
|
-
}
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
function w({
|
|
113
|
-
className: a,
|
|
114
|
-
...t
|
|
115
|
-
}) {
|
|
116
|
-
return /* @__PURE__ */ r.createElement(
|
|
117
|
-
p,
|
|
118
|
-
{
|
|
119
|
-
"data-slot": "input-group-control",
|
|
120
|
-
className: e(
|
|
121
|
-
"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
122
|
-
a
|
|
123
|
-
),
|
|
124
|
-
...t
|
|
125
|
-
}
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
function G({
|
|
129
|
-
className: a,
|
|
130
|
-
...t
|
|
131
|
-
}) {
|
|
132
|
-
return /* @__PURE__ */ r.createElement(
|
|
133
|
-
l,
|
|
134
|
-
{
|
|
135
|
-
"data-slot": "input-group-control",
|
|
136
|
-
className: e(
|
|
137
|
-
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
138
|
-
a
|
|
139
|
-
),
|
|
140
|
-
...t
|
|
141
|
-
}
|
|
142
|
-
);
|
|
143
|
-
}
|
|
21
|
+
a.displayName = "Input";
|
|
144
22
|
export {
|
|
145
|
-
|
|
146
|
-
v as InputGroupAddon,
|
|
147
|
-
k as InputGroupButton,
|
|
148
|
-
w as InputGroupInput,
|
|
149
|
-
z as InputGroupText,
|
|
150
|
-
G as InputGroupTextarea
|
|
23
|
+
a as Input
|
|
151
24
|
};
|
|
152
25
|
//# sourceMappingURL=index.es28.js.map
|
package/dist/index.es28.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es28.js","sources":["../src/components/ui/input
|
|
1
|
+
{"version":3,"file":"index.es28.js","sources":["../src/components/ui/input.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-[8px] border border-[#e6e6e6] bg-white px-3 py-2 text-[14px] leading-[20px] text-[#111111] transition-colors\",\n \"file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground\",\n \"placeholder:text-[#b3b3b3] focus-visible:outline-none focus-visible:border-[#1D1C20] focus-visible:ring-0\",\n \"disabled:cursor-not-allowed disabled:bg-[#f2f2f2] disabled:text-[#9ca3af] disabled:placeholder:text-[#b3b3b3] disabled:opacity-100\",\n \"aria-invalid:border-[#ff3b30] aria-invalid:focus-visible:border-[#ff3b30]\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"],"names":["Input","React","className","type","props","ref","cn"],"mappings":";;AAIA,MAAMA,IAAQC,EAAM;AAAA,EAClB,CAAC,EAAE,WAAAC,GAAW,MAAAC,GAAM,GAAGC,EAAA,GAASC,MAE5B,gBAAAJ,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAAE;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAJ;AAAA,MAAA;AAAA,MAEF,KAAAG;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EAAA;AAIZ;AACAJ,EAAM,cAAc;"}
|