@schandlergarcia/sf-web-components 1.1.2 → 1.1.4

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.
Files changed (57) hide show
  1. package/dist/components/library/cards/ListCard.js +15 -15
  2. package/dist/components/library/cards/TableCard.js +22 -22
  3. package/dist/components/library/cards/TableCard.js.map +1 -1
  4. package/dist/components/library/cards/WidgetCard.js +4 -4
  5. package/dist/components/library/charts/D3Chart.js.map +1 -1
  6. package/dist/components/library/data/DataModeProvider.js +9 -9
  7. package/dist/components/library/data/DataModeProvider.js.map +1 -1
  8. package/dist/components/library/index.d.ts +17 -4
  9. package/dist/components/library/theme/AppThemeProvider.js +4 -4
  10. package/dist/components/library/theme/AppThemeProvider.js.map +1 -1
  11. package/dist/components/library/ui/Avatar.js +8 -8
  12. package/dist/components/library/ui/BreadcrumbExtras.d.ts +9 -0
  13. package/dist/components/library/ui/BreadcrumbExtras.js +109 -0
  14. package/dist/components/library/ui/BreadcrumbExtras.js.map +1 -0
  15. package/dist/components/library/ui/Card.d.ts +37 -11
  16. package/dist/components/library/ui/FieldGroup.d.ts +5 -0
  17. package/dist/components/library/ui/FieldGroup.js +19 -0
  18. package/dist/components/library/ui/FieldGroup.js.map +1 -0
  19. package/dist/components/library/ui/PaginationExtras.d.ts +11 -0
  20. package/dist/components/library/ui/PaginationExtras.js +138 -0
  21. package/dist/components/library/ui/PaginationExtras.js.map +1 -0
  22. package/dist/components/library/ui/alert.d.ts +21 -10
  23. package/dist/components/library/ui/alert.js +51 -56
  24. package/dist/components/library/ui/alert.js.map +1 -1
  25. package/dist/components/library/ui/card.js +72 -55
  26. package/dist/components/library/ui/card.js.map +1 -1
  27. package/dist/components/library/ui/checkbox.d.ts +4 -4
  28. package/dist/components/library/ui/checkbox.js +14 -26
  29. package/dist/components/library/ui/checkbox.js.map +1 -1
  30. package/dist/components/library/ui/collapsible.d.ts +5 -4
  31. package/dist/components/library/ui/collapsible.js +18 -24
  32. package/dist/components/library/ui/collapsible.js.map +1 -1
  33. package/dist/components/library/ui/datePicker.d.ts +10 -18
  34. package/dist/components/library/ui/datePicker.js +18 -85
  35. package/dist/components/library/ui/datePicker.js.map +1 -1
  36. package/dist/components/library/ui/dialog.d.ts +5 -7
  37. package/dist/components/library/ui/dialog.js +94 -108
  38. package/dist/components/library/ui/dialog.js.map +1 -1
  39. package/dist/components/library/ui/field.d.ts +6 -25
  40. package/dist/components/library/ui/field.js +52 -184
  41. package/dist/components/library/ui/field.js.map +1 -1
  42. package/dist/components/library/ui/label.d.ts +6 -4
  43. package/dist/components/library/ui/label.js +12 -15
  44. package/dist/components/library/ui/label.js.map +1 -1
  45. package/dist/components/library/ui/popover.d.ts +3 -7
  46. package/dist/components/library/ui/popover.js +24 -28
  47. package/dist/components/library/ui/popover.js.map +1 -1
  48. package/dist/components/library/ui/select.d.ts +5 -12
  49. package/dist/components/library/ui/select.js +79 -155
  50. package/dist/components/library/ui/select.js.map +1 -1
  51. package/dist/index.js +227 -153
  52. package/dist/index.js.map +1 -1
  53. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +25 -23
  54. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js.map +1 -1
  55. package/dist/node_modules/@radix-ui/react-select/dist/index.js +252 -257
  56. package/dist/node_modules/@radix-ui/react-select/dist/index.js.map +1 -1
  57. package/package.json +1 -1
@@ -1,151 +1,137 @@
1
- import { jsx as o, jsxs as l } from "react/jsx-runtime";
2
- import { cn as e } from "../../../lib/utils.js";
3
- import { Button as d } from "./button.js";
4
- import { XIcon as s } from "lucide-react";
5
- import { Root as u, Close as i, Content as c, Description as g, Overlay as f, Portal as m, Title as p, Trigger as x } from "../../../node_modules/@radix-ui/react-dialog/dist/index.js";
6
- function z({
7
- ...a
8
- }) {
9
- return /* @__PURE__ */ o(u, { "data-slot": "dialog", ...a });
1
+ import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
+ import { Root as i, Close as a, Content as s, Description as c, Overlay as f, Portal as d, Title as g, Trigger as u } from "../../../node_modules/@radix-ui/react-dialog/dist/index.js";
3
+ function D({ ...e }) {
4
+ return /* @__PURE__ */ t(i, { ...e });
10
5
  }
11
- function k({
12
- ...a
13
- }) {
14
- return /* @__PURE__ */ o(x, { "data-slot": "dialog-trigger", ...a });
6
+ function v({ ...e }) {
7
+ return /* @__PURE__ */ t(u, { ...e });
15
8
  }
16
- function h({
17
- ...a
18
- }) {
19
- return /* @__PURE__ */ o(m, { "data-slot": "dialog-portal", ...a });
9
+ function x({ ...e }) {
10
+ return /* @__PURE__ */ t(d, { ...e });
20
11
  }
21
- function w({
22
- ...a
23
- }) {
24
- return /* @__PURE__ */ o(i, { "data-slot": "dialog-close", ...a });
12
+ function m({ ...e }) {
13
+ return /* @__PURE__ */ t(a, { ...e });
25
14
  }
26
- function b({
27
- className: a,
28
- ...t
15
+ function h({
16
+ className: e,
17
+ ...o
29
18
  }) {
30
- return /* @__PURE__ */ o(
19
+ return /* @__PURE__ */ t(
31
20
  f,
32
21
  {
33
- "data-slot": "dialog-overlay",
34
- className: e(
35
- "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",
36
- a
37
- ),
38
- ...t
22
+ className: [
23
+ "fixed inset-0 z-50 bg-black/50",
24
+ e
25
+ ].filter(Boolean).join(" "),
26
+ ...o
39
27
  }
40
28
  );
41
29
  }
42
- function T({
43
- className: a,
44
- children: t,
45
- showCloseButton: n = !0,
46
- ...r
30
+ function b({
31
+ className: e,
32
+ children: o,
33
+ showCloseButton: r = !0,
34
+ ...n
47
35
  }) {
48
- return /* @__PURE__ */ l(h, { children: [
49
- /* @__PURE__ */ o(b, {}),
36
+ return /* @__PURE__ */ l(x, { children: [
37
+ /* @__PURE__ */ t(h, {}),
50
38
  /* @__PURE__ */ l(
51
- c,
39
+ s,
52
40
  {
53
- "data-slot": "dialog-content",
54
- className: e(
55
- "bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",
56
- a
57
- ),
58
- ...r,
41
+ className: [
42
+ "fixed left-1/2 top-1/2 z-50 max-h-[85vh] w-[90vw] max-w-[500px] -translate-x-1/2 -translate-y-1/2",
43
+ "rounded-lg border border-slate-200 bg-white p-6 shadow-lg",
44
+ "dark:border-slate-800 dark:bg-slate-900",
45
+ e
46
+ ].filter(Boolean).join(" "),
47
+ ...n,
59
48
  children: [
60
- t,
61
- n && /* @__PURE__ */ o(i, { "data-slot": "dialog-close", asChild: !0, children: /* @__PURE__ */ l(
62
- d,
63
- {
64
- variant: "ghost",
65
- className: "absolute top-2 right-2",
66
- size: "icon-sm",
67
- children: [
68
- /* @__PURE__ */ o(s, {}),
69
- /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
70
- ]
71
- }
72
- ) })
49
+ o,
50
+ r && /* @__PURE__ */ l(m, { className: "absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100", children: [
51
+ /* @__PURE__ */ t("span", { className: "sr-only", children: "Close" }),
52
+ /* @__PURE__ */ t("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", children: /* @__PURE__ */ t(
53
+ "path",
54
+ {
55
+ d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
56
+ fill: "currentColor"
57
+ }
58
+ ) })
59
+ ] })
73
60
  ]
74
61
  }
75
62
  )
76
63
  ] });
77
64
  }
78
- function j({ className: a, ...t }) {
79
- return /* @__PURE__ */ o(
65
+ function j({
66
+ className: e,
67
+ ...o
68
+ }) {
69
+ return /* @__PURE__ */ t(
80
70
  "div",
81
71
  {
82
- "data-slot": "dialog-header",
83
- className: e("gap-2 flex flex-col", a),
84
- ...t
72
+ className: [
73
+ "flex flex-col space-y-1.5 text-center sm:text-left",
74
+ e
75
+ ].filter(Boolean).join(" "),
76
+ ...o
85
77
  }
86
78
  );
87
79
  }
88
- function O({
89
- className: a,
90
- showCloseButton: t = !1,
91
- children: n,
92
- ...r
80
+ function w({
81
+ className: e,
82
+ ...o
93
83
  }) {
94
- return /* @__PURE__ */ l(
84
+ return /* @__PURE__ */ t(
95
85
  "div",
96
86
  {
97
- "data-slot": "dialog-footer",
98
- className: e(
99
- "bg-muted/50 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
100
- a
101
- ),
102
- ...r,
103
- children: [
104
- n,
105
- t && /* @__PURE__ */ o(i, { asChild: !0, children: /* @__PURE__ */ o(d, { variant: "outline", children: "Close" }) })
106
- ]
87
+ className: [
88
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
89
+ e
90
+ ].filter(Boolean).join(" "),
91
+ ...o
107
92
  }
108
93
  );
109
94
  }
110
- function P({
111
- className: a,
112
- ...t
95
+ function y({
96
+ className: e,
97
+ ...o
113
98
  }) {
114
- return /* @__PURE__ */ o(
115
- p,
99
+ return /* @__PURE__ */ t(
100
+ g,
116
101
  {
117
- "data-slot": "dialog-title",
118
- className: e("text-base leading-none font-medium", a),
119
- ...t
102
+ className: [
103
+ "text-lg font-semibold leading-none tracking-tight",
104
+ e
105
+ ].filter(Boolean).join(" "),
106
+ ...o
120
107
  }
121
108
  );
122
109
  }
123
- function B({
124
- className: a,
125
- ...t
110
+ function L({
111
+ className: e,
112
+ ...o
126
113
  }) {
127
- return /* @__PURE__ */ o(
128
- g,
114
+ return /* @__PURE__ */ t(
115
+ c,
129
116
  {
130
- "data-slot": "dialog-description",
131
- className: e(
132
- "text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",
133
- a
134
- ),
135
- ...t
117
+ className: [
118
+ "text-sm text-slate-500 dark:text-slate-400",
119
+ e
120
+ ].filter(Boolean).join(" "),
121
+ ...o
136
122
  }
137
123
  );
138
124
  }
139
125
  export {
140
- z as Dialog,
141
- w as DialogClose,
142
- T as DialogContent,
143
- B as DialogDescription,
144
- O as DialogFooter,
126
+ D as Dialog,
127
+ m as DialogClose,
128
+ b as DialogContent,
129
+ L as DialogDescription,
130
+ w as DialogFooter,
145
131
  j as DialogHeader,
146
- b as DialogOverlay,
147
- h as DialogPortal,
148
- P as DialogTitle,
149
- k as DialogTrigger
132
+ h as DialogOverlay,
133
+ x as DialogPortal,
134
+ y as DialogTitle,
135
+ v as DialogTrigger
150
136
  };
151
- //# sourceMappingURL=dialog.js.map
137
+ //# sourceMappingURL=Dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","sources":["../../../../src/components/library/ui/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { cn } from '../../../lib/utils';\nimport { Button } from './button';\nimport { XIcon } from 'lucide-react';\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none',\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close data-slot=\"dialog-close\" asChild>\n <Button\n variant=\"ghost\"\n className=\"absolute top-2 right-2\"\n size=\"icon-sm\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('gap-2 flex flex-col', className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<'div'> & {\n showCloseButton?: boolean;\n}) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'bg-muted/50 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-base leading-none font-medium', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\n 'text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3',\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"names":["Dialog","props","DialogPrimitive.Root","DialogTrigger","DialogPrimitive.Trigger","DialogPortal","DialogPrimitive.Portal","DialogClose","DialogPrimitive.Close","DialogOverlay","className","jsx","DialogPrimitive.Overlay","cn","DialogContent","children","showCloseButton","jsxs","DialogPrimitive.Content","Button","XIcon","DialogHeader","DialogFooter","DialogTitle","DialogPrimitive.Title","DialogDescription","DialogPrimitive.Description"],"mappings":";;;;;AAOA,SAASA,EAAO;AAAA,EACd,GAAGC;AACL,GAAsD;AACpD,2BAAQC,GAAA,EAAqB,aAAU,UAAU,GAAGD,GAAO;AAC7D;AAEA,SAASE,EAAc;AAAA,EACrB,GAAGF;AACL,GAAyD;AACvD,2BAAQG,GAAA,EAAwB,aAAU,kBAAkB,GAAGH,GAAO;AACxE;AAEA,SAASI,EAA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AAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWE,EAAG,uBAAuBH,CAAS;AAAA,MAC7C,GAAGT;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASqB,EAAa;AAAA,EACpB,WAAAZ;AAAA,EACA,iBAAAM,IAAkB;AAAA,EAClB,UAAAD;AAAA,EACA,GAAGd;AACL,GAEG;AACD,SACE,gBAAAgB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWJ;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGT;AAAA,MAEH,UAAA;AAAA,QAAAc;AAAA,QACAC,KACC,gBAAAL,EAACH,GAAA,EAAsB,SAAO,IAC5B,UAAA,gBAAAG,EAACQ,GAAA,EAAO,SAAQ,WAAU,UAAA,QAAA,CAAK,EAAA,CACjC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;AAEA,SAASI,EAAY;AAAA,EACnB,WAAAb;AAAA,EACA,GAAGT;AACL,GAAuD;AACrD,SACE,gBAAAU;AAAA,IAACa;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWX,EAAG,sCAAsCH,CAAS;AAAA,MAC5D,GAAGT;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASwB,EAAkB;AAAA,EACzB,WAAAf;AAAA,EACA,GAAGT;AACL,GAA6D;AAC3D,SACE,gBAAAU;AAAA,IAACe;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWb;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGT;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"Dialog.js","sources":["../../../../src/components/library/ui/Dialog.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\n\nfunction Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />;\n}\n\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger {...props} />;\n}\n\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n className={[\n \"fixed inset-0 z-50 bg-black/50\",\n className\n ].filter(Boolean).join(\" \")}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & { showCloseButton?: boolean }) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n className={[\n \"fixed left-1/2 top-1/2 z-50 max-h-[85vh] w-[90vw] max-w-[500px] -translate-x-1/2 -translate-y-1/2\",\n \"rounded-lg border border-slate-200 bg-white p-6 shadow-lg\",\n \"dark:border-slate-800 dark:bg-slate-900\",\n className\n ].filter(Boolean).join(\" \")}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogClose className=\"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100\">\n <span className=\"sr-only\">Close</span>\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" fill=\"none\">\n <path\n d=\"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\"\n fill=\"currentColor\"\n />\n </svg>\n </DialogClose>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={[\n \"flex flex-col space-y-1.5 text-center sm:text-left\",\n className\n ].filter(Boolean).join(\" \")}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={[\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n ].filter(Boolean).join(\" \")}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n className={[\n \"text-lg font-semibold leading-none tracking-tight\",\n className\n ].filter(Boolean).join(\" \")}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={[\n \"text-sm text-slate-500 dark:text-slate-400\",\n className\n ].filter(Boolean).join(\" \")}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogClose,\n DialogOverlay,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"names":["Dialog","props","jsx","DialogPrimitive.Root","DialogTrigger","DialogPrimitive.Trigger","DialogPortal","DialogPrimitive.Portal","DialogClose","DialogPrimitive.Close","DialogOverlay","className","DialogPrimitive.Overlay","DialogContent","children","showCloseButton","jsxs","DialogPrimitive.Content","DialogHeader","DialogFooter","DialogTitle","DialogPrimitive.Title","DialogDescription","DialogPrimitive.Description"],"mappings":";;AAGA,SAASA,EAAO,EAAE,GAAGC,KAA4D;AA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VariantProps } from 'class-variance-authority';
3
- import { Label } from './label';
4
- declare function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>): import("react/jsx-runtime").JSX.Element;
5
- declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<'legend'> & {
6
- variant?: 'legend' | 'label';
7
- }): import("react/jsx-runtime").JSX.Element;
8
- declare function FieldGroup({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
9
- declare const fieldVariants: (props?: ({
10
- orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
11
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
- declare function Field({ className, orientation, ...props }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>): import("react/jsx-runtime").JSX.Element;
13
- declare function FieldContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
14
- declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react/jsx-runtime").JSX.Element;
15
- declare function FieldTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
16
- declare function FieldDescription({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
17
- declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<'div'> & {
18
- children?: React.ReactNode;
19
- }): import("react/jsx-runtime").JSX.Element;
20
- declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<'div'> & {
21
- errors?: Array<{
22
- message?: string;
23
- } | undefined>;
24
- }): import("react/jsx-runtime").JSX.Element | null;
25
- export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
1
+ import * as React from "react";
2
+ declare function Field({ className, children, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
+ declare function FieldLabel({ className, htmlFor, children, ...props }: React.ComponentProps<"label">): import("react/jsx-runtime").JSX.Element;
4
+ declare function FieldDescription({ className, children, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
5
+ declare function FieldError({ className, children, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
6
+ export { Field, FieldLabel, FieldDescription, FieldError, };
@@ -1,210 +1,78 @@
1
- import { jsx as a, jsxs as f } from "react/jsx-runtime";
2
- import { useMemo as u } from "react";
3
- import { cva as c } from "../../../node_modules/class-variance-authority/dist/index.js";
4
- import { cn as l } from "../../../lib/utils.js";
5
- import { Label as m } from "./label.js";
6
- import { Separator as p } from "./separator.js";
7
- function k({ className: t, ...e }) {
8
- return /* @__PURE__ */ a(
9
- "fieldset",
10
- {
11
- "data-slot": "field-set",
12
- className: l(
13
- "gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col",
14
- t
15
- ),
16
- ...e
17
- }
18
- );
19
- }
20
- function y({
21
- className: t,
22
- variant: e = "legend",
23
- ...o
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ function n({
3
+ className: e,
4
+ children: t,
5
+ ...l
24
6
  }) {
25
- return /* @__PURE__ */ a(
26
- "legend",
27
- {
28
- "data-slot": "field-legend",
29
- "data-variant": e,
30
- className: l(
31
- "mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",
32
- t
33
- ),
34
- ...o
35
- }
36
- );
37
- }
38
- function F({ className: t, ...e }) {
39
- return /* @__PURE__ */ a(
7
+ return /* @__PURE__ */ o(
40
8
  "div",
41
9
  {
42
- "data-slot": "field-group",
43
- className: l(
44
- "gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col",
45
- t
46
- ),
47
- ...e
10
+ className: [
11
+ "flex flex-col gap-1.5",
12
+ e
13
+ ].filter(Boolean).join(" "),
14
+ ...l,
15
+ children: t
48
16
  }
49
17
  );
50
18
  }
51
- const g = c(
52
- "data-[invalid=true]:text-destructive gap-2 group/field flex w-full",
53
- {
54
- variants: {
55
- orientation: {
56
- vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
57
- horizontal: "flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
58
- responsive: "flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
59
- }
60
- },
61
- defaultVariants: {
62
- orientation: "vertical"
63
- }
64
- }
65
- );
66
- function L({
67
- className: t,
68
- orientation: e = "vertical",
69
- ...o
19
+ function i({
20
+ className: e,
21
+ htmlFor: t,
22
+ children: l,
23
+ ...r
70
24
  }) {
71
- return /* @__PURE__ */ a(
72
- "div",
73
- {
74
- role: "group",
75
- "data-slot": "field",
76
- "data-orientation": e,
77
- className: l(g({ orientation: e }), t),
78
- ...o
79
- }
80
- );
81
- }
82
- function S({ className: t, ...e }) {
83
- return /* @__PURE__ */ a(
84
- "div",
25
+ return /* @__PURE__ */ o(
26
+ "label",
85
27
  {
86
- "data-slot": "field-content",
87
- className: l(
88
- "gap-0.5 group/field-content flex flex-1 flex-col leading-snug",
89
- t
90
- ),
91
- ...e
28
+ htmlFor: t,
29
+ className: [
30
+ "block text-sm font-medium text-slate-700 dark:text-slate-200",
31
+ e
32
+ ].filter(Boolean).join(" "),
33
+ ...r,
34
+ children: l
92
35
  }
93
36
  );
94
37
  }
95
- function j({
96
- className: t,
97
- ...e
38
+ function s({
39
+ className: e,
40
+ children: t,
41
+ ...l
98
42
  }) {
99
- return /* @__PURE__ */ a(
100
- m,
101
- {
102
- "data-slot": "field-label",
103
- className: l(
104
- "has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 group/field-label peer/field-label flex w-fit leading-snug",
105
- "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",
106
- t
107
- ),
108
- ...e
109
- }
110
- );
111
- }
112
- function z({ className: t, ...e }) {
113
- return /* @__PURE__ */ a(
114
- "div",
115
- {
116
- "data-slot": "field-label",
117
- className: l(
118
- "gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug",
119
- t
120
- ),
121
- ...e
122
- }
123
- );
124
- }
125
- function E({ className: t, ...e }) {
126
- return /* @__PURE__ */ a(
43
+ return /* @__PURE__ */ o(
127
44
  "p",
128
45
  {
129
- "data-slot": "field-description",
130
- className: l(
131
- "text-muted-foreground text-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance",
132
- "last:mt-0 nth-last-2:-mt-1",
133
- "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
134
- t
135
- ),
136
- ...e
46
+ className: [
47
+ "text-xs text-slate-500 dark:text-slate-400",
48
+ e
49
+ ].filter(Boolean).join(" "),
50
+ ...l,
51
+ children: t
137
52
  }
138
53
  );
139
54
  }
140
- function M({
141
- children: t,
55
+ function x({
142
56
  className: e,
143
- ...o
57
+ children: t,
58
+ ...l
144
59
  }) {
145
- return /* @__PURE__ */ f(
146
- "div",
60
+ return /* @__PURE__ */ o(
61
+ "p",
147
62
  {
148
- "data-slot": "field-separator",
149
- "data-content": !!t,
150
- className: l(
151
- "-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative",
63
+ className: [
64
+ "text-xs text-red-600 dark:text-red-400",
152
65
  e
153
- ),
154
- ...o,
155
- children: [
156
- /* @__PURE__ */ a(p, { className: "absolute inset-0 top-1/2" }),
157
- t && /* @__PURE__ */ a(
158
- "span",
159
- {
160
- className: "text-muted-foreground px-2 bg-background relative mx-auto block w-fit",
161
- "data-slot": "field-separator-content",
162
- children: t
163
- }
164
- )
165
- ]
66
+ ].filter(Boolean).join(" "),
67
+ ...l,
68
+ children: t
166
69
  }
167
70
  );
168
71
  }
169
- function V({
170
- className: t,
171
- children: e,
172
- errors: o,
173
- ...n
174
- }) {
175
- const i = u(() => {
176
- if (e)
177
- return e;
178
- if (!o?.length)
179
- return null;
180
- const d = [
181
- ...new Map(o.map((r) => [r?.message, r])).values()
182
- ];
183
- return d?.length == 1 ? d[0]?.message : /* @__PURE__ */ a("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: d.map(
184
- (r, s) => r?.message && /* @__PURE__ */ a("li", { children: r.message }, s)
185
- ) });
186
- }, [e, o]);
187
- return i ? /* @__PURE__ */ a(
188
- "div",
189
- {
190
- role: "alert",
191
- "data-slot": "field-error",
192
- className: l("text-destructive text-sm font-normal", t),
193
- ...n,
194
- children: i
195
- }
196
- ) : null;
197
- }
198
72
  export {
199
- L as Field,
200
- S as FieldContent,
201
- E as FieldDescription,
202
- V as FieldError,
203
- F as FieldGroup,
204
- j as FieldLabel,
205
- y as FieldLegend,
206
- M as FieldSeparator,
207
- k as FieldSet,
208
- z as FieldTitle
73
+ n as Field,
74
+ s as FieldDescription,
75
+ x as FieldError,
76
+ i as FieldLabel
209
77
  };
210
- //# sourceMappingURL=field.js.map
78
+ //# sourceMappingURL=Field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","sources":["../../../../src/components/library/ui/field.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMemo } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../../lib/utils';\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 'gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col',\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 'gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col',\n className\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\n 'data-[invalid=true]:text-destructive gap-2 group/field flex w-full',\n {\n variants: {\n orientation: {\n vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',\n horizontal:\n 'flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n responsive:\n 'flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @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 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 'gap-0.5 group/field-content flex flex-1 flex-col 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 'has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 group/field-label peer/field-label flex w-fit leading-snug',\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 'gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug',\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-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1',\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 '-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative',\n className\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"text-muted-foreground px-2 bg-background relative mx-auto block w-fit\"\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 FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n};\n"],"names":["FieldSet","className","props","jsx","cn","FieldLegend","variant","FieldGroup","fieldVariants","cva","Field","orientation","FieldContent","FieldLabel","Label","FieldTitle","FieldDescription","FieldSeparator","children","jsxs","Separator","FieldError","errors","content","useMemo","uniqueErrors","error","index"],"mappings":";;;;;;AAQA,SAASA,EAAS,EAAE,WAAAC,GAAW,GAAGC,KAA2C;AAC3E,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASG,EAAY;AAAA,EACnB,WAAAJ;AAAA,EACA,SAAAK,IAAU;AAAA,EACV,GAAGJ;AACL,GAAsE;AACpE,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,gBAAcG;AAAA,MACd,WAAWF;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASK,EAAW,EAAE,WAAAN,GAAW,GAAGC,KAAsC;AACxE,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AA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AsB,EAAa;AAAA,MACZ,CAACC,GAAOC,MACND,GAAO,WAAW,gBAAAvB,EAAC,MAAA,EAAgB,UAAAuB,EAAM,QAAA,GAAdC,CAAsB;AAAA,IAAA,GAEvD;AAAA,EAEJ,GAAG,CAACT,GAAUI,CAAM,CAAC;AAErB,SAAKC,IAKH,gBAAApB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,aAAU;AAAA,MACV,WAAWC,EAAG,wCAAwCH,CAAS;AAAA,MAC9D,GAAGC;AAAA,MAEH,UAAAqB;AAAA,IAAA;AAAA,EAAA,IAVI;AAaX;"}
1
+ {"version":3,"file":"Field.js","sources":["../../../../src/components/library/ui/Field.tsx"],"sourcesContent":["import * as React from \"react\";\n\nfunction Field({\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={[\n \"flex flex-col gap-1.5\",\n className\n ].filter(Boolean).join(\" \")}\n {...props}\n >\n {children}\n </div>\n );\n}\n\nfunction FieldLabel({\n className,\n htmlFor,\n children,\n ...props\n}: React.ComponentProps<\"label\">) {\n return (\n <label\n htmlFor={htmlFor}\n className={[\n \"block text-sm font-medium text-slate-700 dark:text-slate-200\",\n className\n ].filter(Boolean).join(\" \")}\n {...props}\n >\n {children}\n </label>\n );\n}\n\nfunction FieldDescription({\n className,\n children,\n ...props\n}: React.ComponentProps<\"p\">) {\n return (\n <p\n className={[\n \"text-xs text-slate-500 dark:text-slate-400\",\n className\n ].filter(Boolean).join(\" \")}\n {...props}\n >\n {children}\n </p>\n );\n}\n\nfunction FieldError({\n className,\n children,\n ...props\n}: React.ComponentProps<\"p\">) {\n return (\n <p\n className={[\n \"text-xs text-red-600 dark:text-red-400\",\n className\n ].filter(Boolean).join(\" \")}\n {...props}\n >\n {children}\n </p>\n );\n}\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n};\n"],"names":["Field","className","children","props","jsx","FieldLabel","htmlFor","FieldDescription","FieldError"],"mappings":";AAEA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from 'radix-ui';
3
- declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- export { Label };
1
+ export default function Label({ children, htmlFor, className, ...rest }: {
2
+ [x: string]: any;
3
+ children: any;
4
+ htmlFor: any;
5
+ className?: string | undefined;
6
+ }): import("react/jsx-runtime").JSX.Element;