@bigbinary/neeto-atoms 1.0.58 → 1.0.59
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/Badge-DC6zxOwS.js.map +1 -1
- package/dist/Button-DV9xCqlc.js.map +1 -1
- package/dist/Callout-NVYmCwJL.js.map +1 -1
- package/dist/{Checkbox-C_Rd2-8Z.js → Checkbox-m4rEnxUz.js} +3 -2
- package/dist/Checkbox-m4rEnxUz.js.map +1 -0
- package/dist/Empty-Bfido_mq.js.map +1 -1
- package/dist/HelpIcon-Cm3ZgoCx.js +73 -0
- package/dist/HelpIcon-Cm3ZgoCx.js.map +1 -0
- package/dist/Label-mrNM2drW.js +17 -0
- package/dist/Label-mrNM2drW.js.map +1 -0
- package/dist/{RadioGroup-BTemSonO.js → RadioGroup-BRAVPPc3.js} +3 -2
- package/dist/RadioGroup-BRAVPPc3.js.map +1 -0
- package/dist/{Switch-OAB7pfNn.js → Switch-b4ZAjhRy.js} +7 -4
- package/dist/Switch-b4ZAjhRy.js.map +1 -0
- package/dist/Tabs-DTbbJITd.js.map +1 -1
- package/dist/cjs/Badge-Dz_Kb49L.js.map +1 -1
- package/dist/cjs/Button-8VH9p9RB.js.map +1 -1
- package/dist/cjs/Callout-CYIrflF1.js.map +1 -1
- package/dist/cjs/{Checkbox-CxqWOvFN.js → Checkbox-CymHP7QE.js} +3 -2
- package/dist/cjs/Checkbox-CymHP7QE.js.map +1 -0
- package/dist/cjs/Empty-aQaWK0p4.js.map +1 -1
- package/dist/cjs/HelpIcon-CIkKt2uy.js +75 -0
- package/dist/cjs/HelpIcon-CIkKt2uy.js.map +1 -0
- package/dist/cjs/Label-Dt7K54Ly.js +19 -0
- package/dist/cjs/Label-Dt7K54Ly.js.map +1 -0
- package/dist/cjs/{RadioGroup-CkKlLHnR.js → RadioGroup-6mpFVQr8.js} +3 -2
- package/dist/cjs/RadioGroup-6mpFVQr8.js.map +1 -0
- package/dist/cjs/{Switch-BTkncHw2.js → Switch-bY6bZw78.js} +7 -4
- package/dist/cjs/Switch-bY6bZw78.js.map +1 -0
- package/dist/cjs/Tabs-YPRmLtUM.js.map +1 -1
- package/dist/cjs/components/Checkbox.js +23 -1
- package/dist/cjs/components/Checkbox.js.map +1 -1
- package/dist/cjs/components/DatePicker.js +14 -1
- package/dist/cjs/components/DatePicker.js.map +1 -1
- package/dist/cjs/components/DropdownMenu.js.map +1 -1
- package/dist/cjs/components/Input.js +32 -5
- package/dist/cjs/components/Input.js.map +1 -1
- package/dist/cjs/components/Label.js +9 -8
- package/dist/cjs/components/Label.js.map +1 -1
- package/dist/cjs/components/MultiEmailInput.js +32 -4
- package/dist/cjs/components/MultiEmailInput.js.map +1 -1
- package/dist/cjs/components/RadioGroup.js +22 -1
- package/dist/cjs/components/RadioGroup.js.map +1 -1
- package/dist/cjs/components/Select.js +32 -10
- package/dist/cjs/components/Select.js.map +1 -1
- package/dist/cjs/components/Slider.js +24 -0
- package/dist/cjs/components/Slider.js.map +1 -1
- package/dist/cjs/components/Switch.js +33 -7
- package/dist/cjs/components/Switch.js.map +1 -1
- package/dist/cjs/components/Textarea.js +32 -3
- package/dist/cjs/components/Textarea.js.map +1 -1
- package/dist/cjs/components/TimePicker.js +17 -4
- package/dist/cjs/components/TimePicker.js.map +1 -1
- package/dist/cjs/components/TreeSelect.js +17 -2
- package/dist/cjs/components/TreeSelect.js.map +1 -1
- package/dist/cjs/components/index.js +14 -13
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/formik/Checkbox.js +23 -1
- package/dist/cjs/formik/Checkbox.js.map +1 -1
- package/dist/cjs/formik/Input.js +32 -5
- package/dist/cjs/formik/Input.js.map +1 -1
- package/dist/cjs/formik/MultiEmailInput.js +32 -4
- package/dist/cjs/formik/MultiEmailInput.js.map +1 -1
- package/dist/cjs/formik/RadioGroup.js +22 -1
- package/dist/cjs/formik/RadioGroup.js.map +1 -1
- package/dist/cjs/formik/Select.js +32 -10
- package/dist/cjs/formik/Select.js.map +1 -1
- package/dist/cjs/formik/Slider.js +24 -0
- package/dist/cjs/formik/Slider.js.map +1 -1
- package/dist/cjs/formik/Switch.js +33 -7
- package/dist/cjs/formik/Switch.js.map +1 -1
- package/dist/cjs/formik/Textarea.js +32 -3
- package/dist/cjs/formik/Textarea.js.map +1 -1
- package/dist/cjs/formik/TreeSelect.js +17 -2
- package/dist/cjs/formik/TreeSelect.js.map +1 -1
- package/dist/cjs/formik/index.js +35 -31
- package/dist/cjs/formik/index.js.map +1 -1
- package/dist/cjs/index.js +14 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/primitives/Field.js +34 -2
- package/dist/cjs/primitives/Field.js.map +1 -1
- package/dist/cjs/primitives/index.js +6 -0
- package/dist/cjs/primitives/index.js.map +1 -1
- package/dist/cjs/renderIcon-BRrpZu9a.js.map +1 -1
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Callout/Callout.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/Checkbox.js +23 -1
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/DatePicker.js +14 -1
- package/dist/components/DatePicker.js.map +1 -1
- package/dist/components/DropdownMenu/SubMenu.d.ts +1 -1
- package/dist/components/DropdownMenu/types.d.ts +1 -1
- package/dist/components/DropdownMenu.js.map +1 -1
- package/dist/components/Empty/Empty.d.ts +1 -1
- package/dist/components/Input.js +32 -5
- package/dist/components/Input.js.map +1 -1
- package/dist/components/Label/Label.d.ts +2 -28
- package/dist/components/Label.js +9 -8
- package/dist/components/Label.js.map +1 -1
- package/dist/components/MultiEmailInput.js +32 -4
- package/dist/components/MultiEmailInput.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/components/RadioGroup.js +22 -1
- package/dist/components/RadioGroup.js.map +1 -1
- package/dist/components/Select.js +32 -10
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Slider.js +24 -0
- package/dist/components/Slider.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +3 -0
- package/dist/components/Switch.js +33 -7
- package/dist/components/Switch.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Textarea.js +32 -3
- package/dist/components/Textarea.js.map +1 -1
- package/dist/components/TimePicker.js +17 -4
- package/dist/components/TimePicker.js.map +1 -1
- package/dist/components/TreeSelect.js +17 -2
- package/dist/components/TreeSelect.js.map +1 -1
- package/dist/components/index.js +5 -4
- package/dist/components/index.js.map +1 -1
- package/dist/formik/Checkbox.js +23 -1
- package/dist/formik/Checkbox.js.map +1 -1
- package/dist/formik/Input.js +32 -5
- package/dist/formik/Input.js.map +1 -1
- package/dist/formik/MultiEmailInput.js +32 -4
- package/dist/formik/MultiEmailInput.js.map +1 -1
- package/dist/formik/RadioGroup.js +22 -1
- package/dist/formik/RadioGroup.js.map +1 -1
- package/dist/formik/Select.js +32 -10
- package/dist/formik/Select.js.map +1 -1
- package/dist/formik/Slider.js +24 -0
- package/dist/formik/Slider.js.map +1 -1
- package/dist/formik/Switch.js +33 -7
- package/dist/formik/Switch.js.map +1 -1
- package/dist/formik/Textarea.js +32 -3
- package/dist/formik/Textarea.js.map +1 -1
- package/dist/formik/TreeSelect.js +17 -2
- package/dist/formik/TreeSelect.js.map +1 -1
- package/dist/formik/index.js +35 -31
- package/dist/formik/index.js.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/primitives/Field.d.ts +6 -1
- package/dist/primitives/Field.js +34 -2
- package/dist/primitives/Field.js.map +1 -1
- package/dist/primitives/index.js +6 -0
- package/dist/primitives/index.js.map +1 -1
- package/dist/renderIcon-C6twJSqH.js.map +1 -1
- package/dist/shared/HelpIcon.d.ts +30 -0
- package/package.json +1 -1
- package/dist/Checkbox-C_Rd2-8Z.js.map +0 -1
- package/dist/Label-DndePzSD.js +0 -87
- package/dist/Label-DndePzSD.js.map +0 -1
- package/dist/RadioGroup-BTemSonO.js.map +0 -1
- package/dist/Switch-OAB7pfNn.js.map +0 -1
- package/dist/cjs/Checkbox-CxqWOvFN.js.map +0 -1
- package/dist/cjs/Label-vpiQQn2A.js +0 -89
- package/dist/cjs/Label-vpiQQn2A.js.map +0 -1
- package/dist/cjs/RadioGroup-CkKlLHnR.js.map +0 -1
- package/dist/cjs/Switch-BTkncHw2.js.map +0 -1
- /package/dist/{lib → shared}/renderIcon.d.ts +0 -0
|
@@ -23,17 +23,32 @@ import '../index-yFgkK_AM.js';
|
|
|
23
23
|
import '../index-Cor698lu.js';
|
|
24
24
|
import '../SelectFieldWrapper-CiBARDsn.js';
|
|
25
25
|
import '../primitives/Field.js';
|
|
26
|
+
import '../HelpIcon-Cm3ZgoCx.js';
|
|
27
|
+
import '../primitives/Tooltip.js';
|
|
28
|
+
import '../tooltip-ChQ9xD1j.js';
|
|
29
|
+
import '../index-CSggBaQF.js';
|
|
30
|
+
import '../renderIcon-C6twJSqH.js';
|
|
31
|
+
import '../createLucideIcon-C8ycilSN.js';
|
|
32
|
+
import '../Popover-C1FNlRtU.js';
|
|
26
33
|
import '../index-Bo3AAQJp.js';
|
|
34
|
+
import '../primitives/HoverCard.js';
|
|
35
|
+
import '../Typography-CmILccNh.js';
|
|
36
|
+
import '../index-CfriMyrd.js';
|
|
37
|
+
import '../Button-DV9xCqlc.js';
|
|
38
|
+
import 'react-router-dom';
|
|
39
|
+
import '../primitives/Button.js';
|
|
40
|
+
import '../button-CrEMzWKw.js';
|
|
41
|
+
import '../primitives/Spinner.js';
|
|
42
|
+
import 'react-i18next';
|
|
43
|
+
import '../loader-circle-DycHUAWN.js';
|
|
27
44
|
import '../label-BgLSVt4u.js';
|
|
28
45
|
import '../separator-ByRsc-y-.js';
|
|
29
46
|
import '../Tree-BlzjThRi.js';
|
|
30
47
|
import '../chevron-down-BNi0ntys.js';
|
|
31
|
-
import '../createLucideIcon-C8ycilSN.js';
|
|
32
48
|
import '../chevron-right-DQnrO-ek.js';
|
|
33
49
|
import '../primitives/Checkbox.js';
|
|
34
50
|
import '../check-Cpkv29p1.js';
|
|
35
51
|
import '../index-30QpKM0j.js';
|
|
36
|
-
import '../loader-circle-DycHUAWN.js';
|
|
37
52
|
import '../index-DZXbzIgC.js';
|
|
38
53
|
import '../index-CSMSzzKM.js';
|
|
39
54
|
import '../redux-BKH6DnBB.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeSelect.js","sources":["../../src/formik/TreeSelect.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useField, useFormikContext, getIn } from \"formik\";\nimport { dissoc } from \"ramda\";\n\nimport { TreeSelect, TreeSelectProps } from \"src/components/TreeSelect\";\n\nexport interface FormikTreeSelectProps extends TreeSelectProps {\n /** Formik field name. */\n name: string;\n}\n\nconst FormikTreeSelect = forwardRef<HTMLButtonElement, FormikTreeSelectProps>(\n ({ name, onChange: onChangeProp, ...otherProps }, ref) => {\n const [field, meta, { setValue }] = useField(name);\n const { status = {}, setStatus } = useFormikContext();\n const fieldStatus = getIn(status, name);\n\n return (\n <TreeSelect\n ref={ref}\n error={meta.error || fieldStatus || \"\"}\n value={field.value}\n onChange={(value: string) => {\n setStatus(dissoc(name, status));\n setValue(value);\n onChangeProp?.(value);\n }}\n {...otherProps}\n />\n );\n }\n);\n\nFormikTreeSelect.displayName = \"FormikTreeSelect\";\n\nexport { FormikTreeSelect };\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TreeSelect.js","sources":["../../src/formik/TreeSelect.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useField, useFormikContext, getIn } from \"formik\";\nimport { dissoc } from \"ramda\";\n\nimport { TreeSelect, TreeSelectProps } from \"src/components/TreeSelect\";\n\nexport interface FormikTreeSelectProps extends TreeSelectProps {\n /** Formik field name. */\n name: string;\n}\n\nconst FormikTreeSelect = forwardRef<HTMLButtonElement, FormikTreeSelectProps>(\n ({ name, onChange: onChangeProp, ...otherProps }, ref) => {\n const [field, meta, { setValue }] = useField(name);\n const { status = {}, setStatus } = useFormikContext();\n const fieldStatus = getIn(status, name);\n\n return (\n <TreeSelect\n ref={ref}\n error={meta.error || fieldStatus || \"\"}\n value={field.value}\n onChange={(value: string) => {\n setStatus(dissoc(name, status));\n setValue(value);\n onChangeProp?.(value);\n }}\n {...otherProps}\n />\n );\n }\n);\n\nFormikTreeSelect.displayName = \"FormikTreeSelect\";\n\nexport { FormikTreeSelect };\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,gBAAA,GAAmB,UAAA;AAAA,EACvB,CAAC,EAAE,IAAA,EAAM,QAAA,EAAU,cAAc,GAAG,UAAA,IAAc,GAAA,KAAQ;AACxD,IAAA,MAAM,CAAC,OAAO,IAAA,EAAM,EAAE,UAAU,CAAA,GAAI,SAAS,IAAI,CAAA;AACjD,IAAA,MAAM,EAAE,MAAA,GAAS,EAAC,EAAG,SAAA,KAAc,gBAAA,EAAiB;AACpD,IAAA,MAAM,WAAA,GAAc,KAAA,CAAM,MAAA,EAAQ,IAAI,CAAA;AAEtC,IAAA,uBACE,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,KAAA,EAAO,IAAA,CAAK,KAAA,IAAS,WAAA,IAAe,EAAA;AAAA,QACpC,OAAO,KAAA,CAAM,KAAA;AAAA,QACb,QAAA,EAAU,CAAC,KAAA,KAAkB;AAC3B,UAAA,SAAA,CAAU,MAAA,CAAO,IAAA,EAAM,MAAM,CAAC,CAAA;AAC9B,UAAA,QAAA,CAAS,KAAK,CAAA;AACd,UAAA,YAAA,GAAe,KAAK,CAAA;AAAA,QACtB,CAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;AAEA,gBAAA,CAAiB,WAAA,GAAc,kBAAA;;;;"}
|
package/dist/formik/index.js
CHANGED
|
@@ -18,16 +18,43 @@ import 'ramda';
|
|
|
18
18
|
import '../Input-Bxs8n6xp.js';
|
|
19
19
|
import '../utils-BJnb9o5c.js';
|
|
20
20
|
import '../primitives/Field.js';
|
|
21
|
-
import '../
|
|
22
|
-
import '../
|
|
21
|
+
import '../HelpIcon-Cm3ZgoCx.js';
|
|
22
|
+
import '../primitives/Tooltip.js';
|
|
23
|
+
import '../tooltip-ChQ9xD1j.js';
|
|
24
|
+
import '../index-DNzunGHb.js';
|
|
25
|
+
import '../index-BtkPdosV.js';
|
|
26
|
+
import '../index-CiyxEyB0.js';
|
|
27
|
+
import '../index-BNPynZWM.js';
|
|
23
28
|
import '../index-DhnfW8wQ.js';
|
|
24
29
|
import 'react-dom';
|
|
25
|
-
import '../index-
|
|
30
|
+
import '../index-CSUSJzOJ.js';
|
|
31
|
+
import '../index-zW4GjM5L.js';
|
|
32
|
+
import '../index-DOzu5J1s.js';
|
|
33
|
+
import '../index-C3hByjk3.js';
|
|
34
|
+
import '../floating-ui.react-dom-D8_f_WWh.js';
|
|
35
|
+
import '../index-BYZaLNq1.js';
|
|
36
|
+
import '../index-fV_U4ZJM.js';
|
|
37
|
+
import '../index-yFgkK_AM.js';
|
|
38
|
+
import '../index-Cor698lu.js';
|
|
39
|
+
import '../index-CSggBaQF.js';
|
|
40
|
+
import '../renderIcon-C6twJSqH.js';
|
|
41
|
+
import '../createLucideIcon-C8ycilSN.js';
|
|
42
|
+
import '../Popover-C1FNlRtU.js';
|
|
43
|
+
import '../index-Bo3AAQJp.js';
|
|
44
|
+
import '../primitives/HoverCard.js';
|
|
45
|
+
import '../Typography-CmILccNh.js';
|
|
46
|
+
import '../index-CfriMyrd.js';
|
|
47
|
+
import '../Button-DV9xCqlc.js';
|
|
48
|
+
import 'react-router-dom';
|
|
49
|
+
import '../primitives/Button.js';
|
|
50
|
+
import '../button-CrEMzWKw.js';
|
|
51
|
+
import '../primitives/Spinner.js';
|
|
52
|
+
import 'react-i18next';
|
|
53
|
+
import '../loader-circle-DycHUAWN.js';
|
|
54
|
+
import '../label-BgLSVt4u.js';
|
|
26
55
|
import '../separator-ByRsc-y-.js';
|
|
27
56
|
import '../primitives/InputGroup.js';
|
|
28
57
|
import '../input-group-BKkj65Uq.js';
|
|
29
|
-
import '../button-CrEMzWKw.js';
|
|
30
|
-
import '../index-CfriMyrd.js';
|
|
31
58
|
import '../input-1J5oQa1u.js';
|
|
32
59
|
import '../textarea-B0vzA497.js';
|
|
33
60
|
import '../withIconSize-BonoFXeH.js';
|
|
@@ -37,55 +64,32 @@ import '../Select-BiyQTuiQ.js';
|
|
|
37
64
|
import '../SelectFieldWrapper-CiBARDsn.js';
|
|
38
65
|
import '../primitives/Combobox.js';
|
|
39
66
|
import '../check-Cpkv29p1.js';
|
|
40
|
-
import '../createLucideIcon-C8ycilSN.js';
|
|
41
67
|
import '../x-_o2T3n6D.js';
|
|
42
68
|
import '../chevron-down-BNi0ntys.js';
|
|
43
|
-
import '../floating-ui.react-dom-D8_f_WWh.js';
|
|
44
69
|
import '../index-DZXbzIgC.js';
|
|
45
70
|
import '../index-CSMSzzKM.js';
|
|
46
71
|
import '../with-selector-Dv0G_V_o.js';
|
|
47
|
-
import '../
|
|
48
|
-
import 'react-i18next';
|
|
49
|
-
import '../loader-circle-DycHUAWN.js';
|
|
50
|
-
import '../Checkbox-C_Rd2-8Z.js';
|
|
72
|
+
import '../Checkbox-m4rEnxUz.js';
|
|
51
73
|
import '../primitives/Checkbox.js';
|
|
52
|
-
import '../index-CiyxEyB0.js';
|
|
53
|
-
import '../index-DNzunGHb.js';
|
|
54
|
-
import '../index-Cor698lu.js';
|
|
55
|
-
import '../index-DOzu5J1s.js';
|
|
56
74
|
import '../index-30QpKM0j.js';
|
|
57
|
-
import '../
|
|
58
|
-
import '../index-yFgkK_AM.js';
|
|
59
|
-
import '../RadioGroup-BTemSonO.js';
|
|
75
|
+
import '../RadioGroup-BRAVPPc3.js';
|
|
60
76
|
import '../primitives/RadioGroup.js';
|
|
61
77
|
import '../index-DT56XkyA.js';
|
|
62
78
|
import '../index-Dd1i1d2M.js';
|
|
63
|
-
import '../index-zW4GjM5L.js';
|
|
64
|
-
import '../index-CSUSJzOJ.js';
|
|
65
79
|
import '../index-d0BBQf5t.js';
|
|
66
80
|
import '../primitives/Label.js';
|
|
67
|
-
import '../Switch-
|
|
81
|
+
import '../Switch-b4ZAjhRy.js';
|
|
68
82
|
import '../primitives/Switch.js';
|
|
69
83
|
import '../Slider-DNcH5X7b.js';
|
|
70
84
|
import '../primitives/Slider.js';
|
|
71
85
|
import '../index-BfAAoDv6.js';
|
|
72
86
|
import '../TreeSelect-BwF2rY6f.js';
|
|
73
87
|
import '../primitives/Popover.js';
|
|
74
|
-
import '../index-BNPynZWM.js';
|
|
75
88
|
import '../index-Jr4soqx3.js';
|
|
76
|
-
import '../index-C3hByjk3.js';
|
|
77
|
-
import '../index-fV_U4ZJM.js';
|
|
78
89
|
import '../Tree-BlzjThRi.js';
|
|
79
90
|
import '../chevron-right-DQnrO-ek.js';
|
|
80
91
|
import '../redux-BKH6DnBB.js';
|
|
81
92
|
import '../MultiEmailInput-Du1964Ka.js';
|
|
82
|
-
import '../Button-DV9xCqlc.js';
|
|
83
|
-
import 'react-router-dom';
|
|
84
|
-
import '../renderIcon-C6twJSqH.js';
|
|
85
|
-
import '../primitives/Button.js';
|
|
86
|
-
import '../primitives/Tooltip.js';
|
|
87
|
-
import '../tooltip-ChQ9xD1j.js';
|
|
88
|
-
import '../index-CSggBaQF.js';
|
|
89
93
|
import '../Dialog-BOcBeB8v.js';
|
|
90
94
|
import '../primitives/Dialog.js';
|
|
91
95
|
import '../dialog--Qm4MZDo.js';
|
package/dist/formik/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ export { A as Avatar } from './Avatar-D1hEMHgh.js';
|
|
|
10
10
|
export { B as Badge } from './Badge-DC6zxOwS.js';
|
|
11
11
|
export { b as Button } from './Button-DV9xCqlc.js';
|
|
12
12
|
export { C as Callout } from './Callout-NVYmCwJL.js';
|
|
13
|
-
export { C as Checkbox } from './Checkbox-
|
|
13
|
+
export { C as Checkbox } from './Checkbox-m4rEnxUz.js';
|
|
14
14
|
export { C as ColorPicker } from './ColorPicker-ClnRUq9y.js';
|
|
15
15
|
export { D as DataTable, u as useColumnOrdering, a as useColumnPinning, b as useColumnVisibility, c as useTablePagination, d as useTableSelection, e as useTableSort } from './DataTable-BTdSpJfs.js';
|
|
16
16
|
export { D as DatePicker } from './DatePicker-kulToqfM.js';
|
|
@@ -19,18 +19,18 @@ export { D as DirectionProvider } from './DirectionProvider-weqLz_BJ.js';
|
|
|
19
19
|
export { E as Empty } from './Empty-Bfido_mq.js';
|
|
20
20
|
export { I as Input } from './Input-Bxs8n6xp.js';
|
|
21
21
|
export { K as Kbd } from './Kbd-CAIAs4OO.js';
|
|
22
|
-
export { L as Label } from './Label-
|
|
22
|
+
export { L as Label } from './Label-mrNM2drW.js';
|
|
23
23
|
export { M as MultiEmailInput } from './MultiEmailInput-Du1964Ka.js';
|
|
24
24
|
export { P as Pagination } from './Pagination-C_X9kgc8.js';
|
|
25
25
|
export { P as Popover } from './Popover-C1FNlRtU.js';
|
|
26
26
|
export { P as Progress } from './Progress-DURemsl_.js';
|
|
27
|
-
export { R as RadioGroup } from './RadioGroup-
|
|
27
|
+
export { R as RadioGroup } from './RadioGroup-BRAVPPc3.js';
|
|
28
28
|
export { S as Select } from './Select-BiyQTuiQ.js';
|
|
29
29
|
export { S as Sheet } from './Sheet-Bw8GVQPS.js';
|
|
30
30
|
export { S as Slider } from './Slider-DNcH5X7b.js';
|
|
31
31
|
export { S as Spinner } from './Spinner-DgV3mILN.js';
|
|
32
32
|
export { S as Stepper } from './Stepper-7OpfOfas.js';
|
|
33
|
-
export { S as Switch } from './Switch-
|
|
33
|
+
export { S as Switch } from './Switch-b4ZAjhRy.js';
|
|
34
34
|
export { T as Tabs } from './Tabs-DTbbJITd.js';
|
|
35
35
|
export { T as Textarea } from './Textarea-B2Uhx-Yy.js';
|
|
36
36
|
export { T as TimePicker } from './TimePicker-DoL126Ql.js';
|
|
@@ -98,6 +98,7 @@ import './info-BlwkmMZr.js';
|
|
|
98
98
|
import './primitives/Checkbox.js';
|
|
99
99
|
import './index-30QpKM0j.js';
|
|
100
100
|
import './primitives/Field.js';
|
|
101
|
+
import './HelpIcon-Cm3ZgoCx.js';
|
|
101
102
|
import './label-BgLSVt4u.js';
|
|
102
103
|
import 'react-colorful';
|
|
103
104
|
import './primitives/Popover.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/utils/timezone.ts"],"sourcesContent":["import type { Dayjs } from \"dayjs\";\nimport { dayjs } from \"@bigbinary/neeto-commons-frontend/utils\";\n\n/**\n * Apply the configured timezone to a date value.\n * Strips the original timezone and reinterprets via neetocommons' dayjs wrapper.\n * Handles both single dates and arrays (for date ranges).\n */\nexport const getTimezoneAppliedDateTime = (\n inputDateTime: Dayjs | Dayjs[] | null\n): Dayjs | (Dayjs | null)[] | null => {\n const apply = (date: Dayjs | null): Dayjs | null =>\n date && typeof date.format === \"function\"\n ? dayjs(date.format(\"YYYY-MM-DD HH:mm:ss\"))\n : null;\n\n return Array.isArray(inputDateTime)\n ? inputDateTime.map(apply)\n : apply(inputDateTime);\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/utils/timezone.ts"],"sourcesContent":["import type { Dayjs } from \"dayjs\";\nimport { dayjs } from \"@bigbinary/neeto-commons-frontend/utils\";\n\n/**\n * Apply the configured timezone to a date value.\n * Strips the original timezone and reinterprets via neetocommons' dayjs wrapper.\n * Handles both single dates and arrays (for date ranges).\n */\nexport const getTimezoneAppliedDateTime = (\n inputDateTime: Dayjs | Dayjs[] | null\n): Dayjs | (Dayjs | null)[] | null => {\n const apply = (date: Dayjs | null): Dayjs | null =>\n date && typeof date.format === \"function\"\n ? dayjs(date.format(\"YYYY-MM-DD HH:mm:ss\"))\n : null;\n\n return Array.isArray(inputDateTime)\n ? inputDateTime.map(apply)\n : apply(inputDateTime);\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,MAAM,0BAAA,GAA6B,CACxC,aAAA,KACoC;AACpC,EAAA,MAAM,KAAA,GAAQ,CAAC,IAAA,KACb,IAAA,IAAQ,OAAO,IAAA,CAAK,MAAA,KAAW,UAAA,GAC3B,KAAA,CAAM,IAAA,CAAK,MAAA,CAAO,qBAAqB,CAAC,CAAA,GACxC,IAAA;AAEN,EAAA,OAAO,KAAA,CAAM,QAAQ,aAAa,CAAA,GAC9B,cAAc,GAAA,CAAI,KAAK,CAAA,GACvB,KAAA,CAAM,aAAa,CAAA;AACzB;;;;"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
+
import { type HelpIconProps } from "src/shared/HelpIcon";
|
|
2
3
|
import { Field as ShadcnField, FieldLabel as ShadcnFieldLabel, FieldDescription as ShadcnFieldDescription, FieldError as ShadcnFieldError, FieldGroup as ShadcnFieldGroup, FieldLegend as ShadcnFieldLegend, FieldSeparator as ShadcnFieldSeparator, FieldSet as ShadcnFieldSet, FieldContent as ShadcnFieldContent, FieldTitle as ShadcnFieldTitle } from "src/shadcn/components/field";
|
|
3
4
|
declare const Field: (props: React.ComponentProps<typeof ShadcnField>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
|
|
5
|
+
type FieldLabelProps = React.ComponentProps<typeof ShadcnFieldLabel> & {
|
|
6
|
+
/** Props for the help icon (tooltip or popover mode). */
|
|
7
|
+
helpIconProps?: HelpIconProps;
|
|
8
|
+
};
|
|
9
|
+
declare const FieldLabel: ({ helpIconProps, children, ...props }: FieldLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
10
|
declare const FieldDescription: (props: React.ComponentProps<typeof ShadcnFieldDescription>) => import("react/jsx-runtime").JSX.Element;
|
|
6
11
|
declare const FieldError: (props: React.ComponentProps<typeof ShadcnFieldError>) => import("react/jsx-runtime").JSX.Element;
|
|
7
12
|
declare const FieldGroup: (props: React.ComponentProps<typeof ShadcnFieldGroup>) => import("react/jsx-runtime").JSX.Element;
|
package/dist/primitives/Field.js
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { H as HelpIcon } from '../HelpIcon-Cm3ZgoCx.js';
|
|
2
3
|
import { useMemo } from 'react';
|
|
3
4
|
import { c as cva } from '../index-Bo3AAQJp.js';
|
|
4
5
|
import { c as cn } from '../utils-BJnb9o5c.js';
|
|
5
6
|
import { L as Label } from '../label-BgLSVt4u.js';
|
|
6
7
|
import { S as Separator } from '../separator-ByRsc-y-.js';
|
|
8
|
+
import './Tooltip.js';
|
|
9
|
+
import '../tooltip-ChQ9xD1j.js';
|
|
10
|
+
import '../index-DNzunGHb.js';
|
|
11
|
+
import '../index-BtkPdosV.js';
|
|
12
|
+
import '../index-CiyxEyB0.js';
|
|
13
|
+
import '../index-BNPynZWM.js';
|
|
7
14
|
import '../index-DhnfW8wQ.js';
|
|
8
15
|
import 'react-dom';
|
|
9
|
-
import '../index-
|
|
16
|
+
import '../index-CSUSJzOJ.js';
|
|
17
|
+
import '../index-zW4GjM5L.js';
|
|
18
|
+
import '../index-DOzu5J1s.js';
|
|
19
|
+
import '../index-C3hByjk3.js';
|
|
20
|
+
import '../floating-ui.react-dom-D8_f_WWh.js';
|
|
21
|
+
import '../index-BYZaLNq1.js';
|
|
22
|
+
import '../index-fV_U4ZJM.js';
|
|
23
|
+
import '../index-yFgkK_AM.js';
|
|
24
|
+
import '../index-Cor698lu.js';
|
|
25
|
+
import '../index-CSggBaQF.js';
|
|
26
|
+
import '../renderIcon-C6twJSqH.js';
|
|
27
|
+
import '../createLucideIcon-C8ycilSN.js';
|
|
28
|
+
import '../Popover-C1FNlRtU.js';
|
|
29
|
+
import './HoverCard.js';
|
|
30
|
+
import '../Typography-CmILccNh.js';
|
|
31
|
+
import '../index-CfriMyrd.js';
|
|
32
|
+
import '../Button-DV9xCqlc.js';
|
|
33
|
+
import 'react-router-dom';
|
|
34
|
+
import './Button.js';
|
|
35
|
+
import '../button-CrEMzWKw.js';
|
|
36
|
+
import './Spinner.js';
|
|
37
|
+
import 'react-i18next';
|
|
38
|
+
import '../loader-circle-DycHUAWN.js';
|
|
10
39
|
|
|
11
40
|
function FieldSet$1({ className, ...props }) {
|
|
12
41
|
return /* @__PURE__ */ jsx(
|
|
@@ -209,7 +238,10 @@ function FieldError$1({
|
|
|
209
238
|
}
|
|
210
239
|
|
|
211
240
|
const Field = (props) => /* @__PURE__ */ jsx(Field$1, { ...props });
|
|
212
|
-
const FieldLabel = (props) => /* @__PURE__ */
|
|
241
|
+
const FieldLabel = ({ helpIconProps, children, ...props }) => /* @__PURE__ */ jsxs(FieldLabel$1, { ...props, children: [
|
|
242
|
+
children,
|
|
243
|
+
helpIconProps && /* @__PURE__ */ jsx(HelpIcon, { ...helpIconProps })
|
|
244
|
+
] });
|
|
213
245
|
const FieldDescription = (props) => /* @__PURE__ */ jsx(FieldDescription$1, { ...props });
|
|
214
246
|
const FieldError = (props) => /* @__PURE__ */ jsx(FieldError$1, { ...props });
|
|
215
247
|
const FieldGroup = (props) => /* @__PURE__ */ jsx(FieldGroup$1, { ...props });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","sources":["../../src/shadcn/components/field.tsx","../../src/primitives/Field.tsx"],"sourcesContent":["import { useMemo } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"src/shadcn/lib/utils\"\nimport { Label } from \"src/shadcn/components/label\"\nimport { Separator } from \"src/shadcn/components/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 flex w-full gap-2 data-[invalid=true]:text-destructive\",\n {\n variants: {\n orientation: {\n vertical: \"flex-col *:w-full [&>.sr-only]:w-auto\",\n horizontal:\n \"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n responsive:\n \"flex-col *:w-full @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 [&>.sr-only]:w-auto @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 \"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 flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10\",\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 leading-snug font-medium 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-start text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5\",\n \"last:mt-0 nth-last-2:-mt-1\",\n \"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\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=\"relative mx-auto block w-fit bg-background px-2 text-muted-foreground\"\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=\"ms-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-sm font-normal text-destructive\", 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","import type React from \"react\";\n\nimport {\n Field as ShadcnField,\n FieldLabel as ShadcnFieldLabel,\n FieldDescription as ShadcnFieldDescription,\n FieldError as ShadcnFieldError,\n FieldGroup as ShadcnFieldGroup,\n FieldLegend as ShadcnFieldLegend,\n FieldSeparator as ShadcnFieldSeparator,\n FieldSet as ShadcnFieldSet,\n FieldContent as ShadcnFieldContent,\n FieldTitle as ShadcnFieldTitle,\n} from \"src/shadcn/components/field\";\n\nconst Field = (props: React.ComponentProps<typeof ShadcnField>) => (\n <ShadcnField {...props} />\n);\n\nconst FieldLabel = (props: React.ComponentProps<typeof ShadcnFieldLabel>) => (\n <ShadcnFieldLabel {...props} />\n);\n\nconst FieldDescription = (\n props: React.ComponentProps<typeof ShadcnFieldDescription>\n) => <ShadcnFieldDescription {...props} />;\n\nconst FieldError = (props: React.ComponentProps<typeof ShadcnFieldError>) => (\n <ShadcnFieldError {...props} />\n);\n\nconst FieldGroup = (props: React.ComponentProps<typeof ShadcnFieldGroup>) => (\n <ShadcnFieldGroup {...props} />\n);\n\nconst FieldLegend = (props: React.ComponentProps<typeof ShadcnFieldLegend>) => (\n <ShadcnFieldLegend {...props} />\n);\n\nconst FieldSeparator = (\n props: React.ComponentProps<typeof ShadcnFieldSeparator>\n) => <ShadcnFieldSeparator {...props} />;\n\nconst FieldSet = (props: React.ComponentProps<typeof ShadcnFieldSet>) => (\n <ShadcnFieldSet {...props} />\n);\n\nconst FieldContent = (\n props: React.ComponentProps<typeof ShadcnFieldContent>\n) => <ShadcnFieldContent {...props} />;\n\nconst FieldTitle = (props: React.ComponentProps<typeof ShadcnFieldTitle>) => (\n <ShadcnFieldTitle {...props} />\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","FieldLegend","FieldGroup","Field","FieldContent","FieldLabel","FieldTitle","FieldDescription","FieldSeparator","FieldError","ShadcnField","ShadcnFieldLabel","ShadcnFieldDescription","ShadcnFieldError","ShadcnFieldGroup","ShadcnFieldLegend","ShadcnFieldSeparator","ShadcnFieldSet","ShadcnFieldContent","ShadcnFieldTitle"],"mappings":";;;;;;;;;;AAOA,SAASA,UAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqC;AAC3E,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAW,EAAA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Ae,CACnB,KAAA,qBACG,GAAA,CAACC,cAAA,EAAA,EAAoB,GAAG,KAAA,EAAO;AAEpC,MAAM,aAAa,CAAC,KAAA,qBAClB,GAAA,CAACC,YAAA,EAAA,EAAkB,GAAG,KAAA,EAAO;;;;"}
|
|
1
|
+
{"version":3,"file":"Field.js","sources":["../../src/shadcn/components/field.tsx","../../src/primitives/Field.tsx"],"sourcesContent":["import { useMemo } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"src/shadcn/lib/utils\"\nimport { Label } from \"src/shadcn/components/label\"\nimport { Separator } from \"src/shadcn/components/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 flex w-full gap-2 data-[invalid=true]:text-destructive\",\n {\n variants: {\n orientation: {\n vertical: \"flex-col *:w-full [&>.sr-only]:w-auto\",\n horizontal:\n \"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n responsive:\n \"flex-col *:w-full @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 [&>.sr-only]:w-auto @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 \"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 flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10\",\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 leading-snug font-medium 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-start text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5\",\n \"last:mt-0 nth-last-2:-mt-1\",\n \"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\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=\"relative mx-auto block w-fit bg-background px-2 text-muted-foreground\"\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=\"ms-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-sm font-normal text-destructive\", 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","import type React from \"react\";\n\nimport { HelpIcon, type HelpIconProps } from \"src/shared/HelpIcon\";\nimport {\n Field as ShadcnField,\n FieldLabel as ShadcnFieldLabel,\n FieldDescription as ShadcnFieldDescription,\n FieldError as ShadcnFieldError,\n FieldGroup as ShadcnFieldGroup,\n FieldLegend as ShadcnFieldLegend,\n FieldSeparator as ShadcnFieldSeparator,\n FieldSet as ShadcnFieldSet,\n FieldContent as ShadcnFieldContent,\n FieldTitle as ShadcnFieldTitle,\n} from \"src/shadcn/components/field\";\n\nconst Field = (props: React.ComponentProps<typeof ShadcnField>) => (\n <ShadcnField {...props} />\n);\n\ntype FieldLabelProps = React.ComponentProps<typeof ShadcnFieldLabel> & {\n /** Props for the help icon (tooltip or popover mode). */\n helpIconProps?: HelpIconProps;\n};\n\nconst FieldLabel = ({ helpIconProps, children, ...props }: FieldLabelProps) => (\n <ShadcnFieldLabel {...props}>\n {children}\n {helpIconProps && <HelpIcon {...helpIconProps} />}\n </ShadcnFieldLabel>\n);\n\nconst FieldDescription = (\n props: React.ComponentProps<typeof ShadcnFieldDescription>\n) => <ShadcnFieldDescription {...props} />;\n\nconst FieldError = (props: React.ComponentProps<typeof ShadcnFieldError>) => (\n <ShadcnFieldError {...props} />\n);\n\nconst FieldGroup = (props: React.ComponentProps<typeof ShadcnFieldGroup>) => (\n <ShadcnFieldGroup {...props} />\n);\n\nconst FieldLegend = (props: React.ComponentProps<typeof ShadcnFieldLegend>) => (\n <ShadcnFieldLegend {...props} />\n);\n\nconst FieldSeparator = (\n props: React.ComponentProps<typeof ShadcnFieldSeparator>\n) => <ShadcnFieldSeparator {...props} />;\n\nconst FieldSet = (props: React.ComponentProps<typeof ShadcnFieldSet>) => (\n <ShadcnFieldSet {...props} />\n);\n\nconst FieldContent = (\n props: React.ComponentProps<typeof ShadcnFieldContent>\n) => <ShadcnFieldContent {...props} />;\n\nconst FieldTitle = (props: React.ComponentProps<typeof ShadcnFieldTitle>) => (\n <ShadcnFieldTitle {...props} />\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","FieldLegend","FieldGroup","Field","FieldContent","FieldLabel","FieldTitle","FieldDescription","FieldSeparator","FieldError","ShadcnField","ShadcnFieldLabel","ShadcnFieldDescription","ShadcnFieldError","ShadcnFieldGroup","ShadcnFieldLegend","ShadcnFieldSeparator","ShadcnFieldSet","ShadcnFieldContent","ShadcnFieldTitle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAASA,UAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqC;AAC3E,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,kGAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAASC,aAAA,CAAY;AAAA,EACnB,SAAA;AAAA,EACA,OAAA,GAAU,QAAA;AAAA,EACV,GAAG;AACL,CAAA,EAAsE;AACpE,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,cAAA;AAAA,MACV,cAAA,EAAc,OAAA;AAAA,MACd,SAAA,EAAW,EAAA;AAAA,QACT,iFAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAASC,YAAA,CAAW,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AACxE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,sIAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,MAAM,aAAA,GAAgB,GAAA;AAAA,EACpB,oEAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,WAAA,EAAa;AAAA,QACX,QAAA,EAAU,uCAAA;AAAA,QACV,UAAA,EACE,g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AG,aAAA,EAAe;AAAA,CAAA,EACjD;AAGF,MAAM,mBAAmB,CACvB,KAAA,qBACG,GAAA,CAACC,kBAAA,EAAA,EAAwB,GAAG,KAAA,EAAO;AAExC,MAAM,aAAa,CAAC,KAAA,qBAClB,GAAA,CAACC,YAAA,EAAA,EAAkB,GAAG,KAAA,EAAO;AAG/B,MAAM,aAAa,CAAC,KAAA,qBAClB,GAAA,CAACC,YAAA,EAAA,EAAkB,GAAG,KAAA,EAAO;AAG/B,MAAM,cAAc,CAAC,KAAA,qBACnB,GAAA,CAACC,aAAA,EAAA,EAAmB,GAAG,KAAA,EAAO;AAGhC,MAAM,iBAAiB,CACrB,KAAA,qBACG,GAAA,CAACC,gBAAA,EAAA,EAAsB,GAAG,KAAA,EAAO;AAEtC,MAAM,WAAW,CAAC,KAAA,qBAChB,GAAA,CAACC,UAAA,EAAA,EAAgB,GAAG,KAAA,EAAO;AAG7B,MAAM,eAAe,CACnB,KAAA,qBACG,GAAA,CAACC,cAAA,EAAA,EAAoB,GAAG,KAAA,EAAO;AAEpC,MAAM,aAAa,CAAC,KAAA,qBAClB,GAAA,CAACC,YAAA,EAAA,EAAkB,GAAG,KAAA,EAAO;;;;"}
|
package/dist/primitives/index.js
CHANGED
|
@@ -100,6 +100,12 @@ import '../dialog--Qm4MZDo.js';
|
|
|
100
100
|
import '../index-DnD7-4_R.js';
|
|
101
101
|
import '../index-C3hByjk3.js';
|
|
102
102
|
import '../index-DT56XkyA.js';
|
|
103
|
+
import '../HelpIcon-Cm3ZgoCx.js';
|
|
104
|
+
import '../renderIcon-C6twJSqH.js';
|
|
105
|
+
import '../Popover-C1FNlRtU.js';
|
|
106
|
+
import '../Typography-CmILccNh.js';
|
|
107
|
+
import '../Button-DV9xCqlc.js';
|
|
108
|
+
import 'react-router-dom';
|
|
103
109
|
import '../label-BgLSVt4u.js';
|
|
104
110
|
import '../index-CSggBaQF.js';
|
|
105
111
|
import '../index-BfAAoDv6.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderIcon-C6twJSqH.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"renderIcon-C6twJSqH.js","sources":["../src/shared/renderIcon.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\n\nexport type IconProp =\n | React.ComponentType<{ className?: string }>\n | string\n | React.ReactElement;\n\nexport function renderIcon(icon: IconProp, extraClassName?: string) {\n if (typeof icon === \"string\") {\n return <i className={cn(icon, extraClassName)} aria-hidden=\"true\" />;\n }\n\n if (React.isValidElement(icon)) {\n return React.cloneElement(\n icon as React.ReactElement<Record<string, unknown>>,\n {\n \"aria-hidden\": \"true\",\n className: cn(\n (icon as React.ReactElement<{ className?: string }>).props.className,\n extraClassName\n ),\n }\n );\n }\n\n const IconComp = icon as React.ComponentType<{ className?: string }>;\n return <IconComp aria-hidden=\"true\" className={extraClassName} />;\n}\n"],"names":["React"],"mappings":";;;;AASO,SAAS,UAAA,CAAW,MAAgB,cAAA,EAAyB;AAClE,EAAA,IAAI,OAAO,SAAS,QAAA,EAAU;AAC5B,IAAA,uBAAO,GAAA,CAAC,OAAE,SAAA,EAAW,EAAA,CAAG,MAAM,cAAc,CAAA,EAAG,eAAY,MAAA,EAAO,CAAA;AAAA,EACpE;AAEA,EAAA,IAAIA,cAAA,CAAM,cAAA,CAAe,IAAI,CAAA,EAAG;AAC9B,IAAA,OAAOA,cAAA,CAAM,YAAA;AAAA,MACX,IAAA;AAAA,MACA;AAAA,QACE,aAAA,EAAe,MAAA;AAAA,QACf,SAAA,EAAW,EAAA;AAAA,UACR,KAAoD,KAAA,CAAM,SAAA;AAAA,UAC3D;AAAA;AACF;AACF,KACF;AAAA,EACF;AAEA,EAAA,MAAM,QAAA,GAAW,IAAA;AACjB,EAAA,uBAAO,GAAA,CAAC,QAAA,EAAA,EAAS,aAAA,EAAY,MAAA,EAAO,WAAW,cAAA,EAAgB,CAAA;AACjE;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { type ButtonProps } from "src/components/Button";
|
|
3
|
+
import { type IconProp } from "src/shared/renderIcon";
|
|
4
|
+
export interface HelpIconTooltipProps {
|
|
5
|
+
/** Tooltip content. */
|
|
6
|
+
content?: React.ReactNode;
|
|
7
|
+
/** Tooltip position. */
|
|
8
|
+
position?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface HelpIconPopoverProps {
|
|
11
|
+
/** Popover title. */
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
/** Popover description. */
|
|
14
|
+
description?: React.ReactNode;
|
|
15
|
+
/** Props for an optional help link button inside the popover. */
|
|
16
|
+
helpLinkProps?: ButtonProps;
|
|
17
|
+
}
|
|
18
|
+
export interface HelpIconProps {
|
|
19
|
+
/** Click handler on the help icon. */
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
/** Custom icon. Defaults to CircleHelpIcon. */
|
|
22
|
+
icon?: IconProp;
|
|
23
|
+
/** Show a tooltip on hover. */
|
|
24
|
+
tooltipProps?: HelpIconTooltipProps;
|
|
25
|
+
/** Show a popover on hover with title, description, and optional link. */
|
|
26
|
+
popoverProps?: HelpIconPopoverProps;
|
|
27
|
+
/** Additional class name for the help icon. */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const HelpIcon: (helpIconProps: HelpIconProps) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox-C_Rd2-8Z.js","sources":["../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { forwardRef, useId } from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { Checkbox as PrimitiveCheckbox } from \"src/primitives/Checkbox\";\nimport {\n Field,\n FieldContent,\n FieldLabel,\n FieldDescription,\n FieldError,\n} from \"src/primitives/Field\";\n\nexport interface CheckboxProps extends React.ComponentProps<\n typeof PrimitiveCheckbox\n> {\n /** Text displayed next to the checkbox. */\n label?: string;\n /** Error message displayed below the checkbox. */\n error?: string;\n /** Helper text displayed below the label. Accepts string or ReactNode. */\n helpText?: React.ReactNode;\n /** Shows a required indicator next to the label. */\n required?: boolean;\n /** Additional class name for the outermost wrapper. */\n className?: string;\n}\n\nconst Checkbox = forwardRef<\n React.ComponentRef<typeof PrimitiveCheckbox>,\n CheckboxProps\n>(\n (\n {\n label,\n error,\n helpText,\n required = false,\n disabled = false,\n className,\n ...otherProps\n },\n ref\n ) => {\n const generatedId = useId();\n const id = otherProps.id ?? generatedId;\n const errorId = `error_${id}`;\n const helpTextId = `helpText_${id}`;\n\n const ariaDescribedBy =\n [error ? errorId : null, helpText ? helpTextId : null]\n .filter(Boolean)\n .join(\" \") || undefined;\n\n const hasField = !!(label || error || helpText);\n\n if (!hasField) {\n return (\n <PrimitiveCheckbox\n ref={ref}\n id={id}\n disabled={disabled}\n aria-invalid={!!error || undefined}\n aria-required={required || undefined}\n aria-describedby={ariaDescribedBy}\n className={className}\n {...otherProps}\n />\n );\n }\n\n return (\n <div\n className={cn(\"flex flex-col gap-1\", className)}\n data-disabled={disabled || undefined}\n data-invalid={!!error || undefined}\n >\n <Field orientation=\"horizontal\">\n <PrimitiveCheckbox\n ref={ref}\n id={id}\n disabled={disabled}\n aria-invalid={!!error || undefined}\n aria-required={required || undefined}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n <FieldContent>\n {label && (\n <FieldLabel htmlFor={id}>\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"text-destructive\">\n *\n </span>\n )}\n </FieldLabel>\n )}\n {helpText && (\n <FieldDescription id={helpTextId}>{helpText}</FieldDescription>\n )}\n </FieldContent>\n </Field>\n {error && <FieldError id={errorId}>{error}</FieldError>}\n </div>\n );\n }\n);\n\nCheckbox.displayName = \"Checkbox\";\n\nexport { Checkbox };\n"],"names":["PrimitiveCheckbox"],"mappings":";;;;;;AA2BA,MAAM,QAAA,GAAW,UAAA;AAAA,EAIf,CACE;AAAA,IACE,KAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA,GAAW,KAAA;AAAA,IACX,QAAA,GAAW,KAAA;AAAA,IACX,SAAA;AAAA,IACA,GAAG;AAAA,KAEL,GAAA,KACG;AACH,IAAA,MAAM,cAAc,KAAA,EAAM;AAC1B,IAAA,MAAM,EAAA,GAAK,WAAW,EAAA,IAAM,WAAA;AAC5B,IAAA,MAAM,OAAA,GAAU,SAAS,EAAE,CAAA,CAAA;AAC3B,IAAA,MAAM,UAAA,GAAa,YAAY,EAAE,CAAA,CAAA;AAEjC,IAAA,MAAM,eAAA,GACJ,CAAC,KAAA,GAAQ,OAAA,GAAU,MAAM,QAAA,GAAW,UAAA,GAAa,IAAI,CAAA,CAClD,MAAA,CAAO,OAAO,CAAA,CACd,IAAA,CAAK,GAAG,CAAA,IAAK,MAAA;AAElB,IAAA,MAAM,QAAA,GAAW,CAAC,EAAE,KAAA,IAAS,KAAA,IAAS,QAAA,CAAA;AAEtC,IAAA,IAAI,CAAC,QAAA,EAAU;AACb,MAAA,uBACE,GAAA;AAAA,QAACA,UAAA;AAAA,QAAA;AAAA,UACC,GAAA;AAAA,UACA,EAAA;AAAA,UACA,QAAA;AAAA,UACA,cAAA,EAAc,CAAC,CAAC,KAAA,IAAS,MAAA;AAAA,UACzB,iBAAe,QAAA,IAAY,MAAA;AAAA,UAC3B,kBAAA,EAAkB,eAAA;AAAA,UAClB,SAAA;AAAA,UACC,GAAG;AAAA;AAAA,OACN;A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-1,87 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { c as cn } from './utils-BJnb9o5c.js';
|
|
4
|
-
import { r as renderIcon } from './renderIcon-C6twJSqH.js';
|
|
5
|
-
import { Label as Label$1 } from './primitives/Label.js';
|
|
6
|
-
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from './primitives/Tooltip.js';
|
|
7
|
-
import { c as createLucideIcon } from './createLucideIcon-C8ycilSN.js';
|
|
8
|
-
import { P as Popover } from './Popover-C1FNlRtU.js';
|
|
9
|
-
import { b as Button } from './Button-DV9xCqlc.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @license lucide-react v0.577.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const __iconNode = [
|
|
20
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
21
|
-
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
22
|
-
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
23
|
-
];
|
|
24
|
-
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode);
|
|
25
|
-
|
|
26
|
-
const SIDE_MAP = {
|
|
27
|
-
top: "top",
|
|
28
|
-
bottom: "bottom",
|
|
29
|
-
left: "left",
|
|
30
|
-
right: "right",
|
|
31
|
-
auto: "top"
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const Label = forwardRef(
|
|
35
|
-
({ required, helpIconProps, className, children, ...otherProps }, ref) => {
|
|
36
|
-
const helpIcon = helpIconProps?.icon ?? CircleQuestionMark;
|
|
37
|
-
const iconElement = /* @__PURE__ */ jsx(
|
|
38
|
-
"span",
|
|
39
|
-
{
|
|
40
|
-
className: cn(
|
|
41
|
-
"inline-flex cursor-help text-muted-foreground transition-colors hover:text-foreground",
|
|
42
|
-
helpIconProps?.onClick && "cursor-pointer",
|
|
43
|
-
helpIconProps?.className
|
|
44
|
-
),
|
|
45
|
-
onClick: helpIconProps?.onClick,
|
|
46
|
-
children: renderIcon(helpIcon, "size-3.5")
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
const renderHelpIcon = () => {
|
|
50
|
-
if (!helpIconProps) return null;
|
|
51
|
-
if (helpIconProps.popoverProps) {
|
|
52
|
-
const { title, description, helpLinkProps } = helpIconProps.popoverProps;
|
|
53
|
-
return /* @__PURE__ */ jsxs(Popover, { trigger: iconElement, children: [
|
|
54
|
-
title && /* @__PURE__ */ jsx(Popover.Title, { children: title }),
|
|
55
|
-
description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }),
|
|
56
|
-
helpLinkProps && /* @__PURE__ */ jsx(
|
|
57
|
-
Button,
|
|
58
|
-
{
|
|
59
|
-
variant: "link",
|
|
60
|
-
size: "sm",
|
|
61
|
-
className: "mt-1 h-auto self-start p-0",
|
|
62
|
-
...helpLinkProps,
|
|
63
|
-
href: helpLinkProps.href
|
|
64
|
-
}
|
|
65
|
-
)
|
|
66
|
-
] });
|
|
67
|
-
}
|
|
68
|
-
if (helpIconProps.tooltipProps?.content) {
|
|
69
|
-
const side = SIDE_MAP[helpIconProps.tooltipProps.position ?? "auto"] ?? "top";
|
|
70
|
-
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
71
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: iconElement }),
|
|
72
|
-
/* @__PURE__ */ jsx(TooltipContent, { side, children: helpIconProps.tooltipProps.content })
|
|
73
|
-
] }) });
|
|
74
|
-
}
|
|
75
|
-
return iconElement;
|
|
76
|
-
};
|
|
77
|
-
return /* @__PURE__ */ jsxs(Label$1, { ref, className: cn(className), ...otherProps, children: [
|
|
78
|
-
children,
|
|
79
|
-
required && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-destructive", children: "*" }),
|
|
80
|
-
renderHelpIcon()
|
|
81
|
-
] });
|
|
82
|
-
}
|
|
83
|
-
);
|
|
84
|
-
Label.displayName = "Label";
|
|
85
|
-
|
|
86
|
-
export { Label as L };
|
|
87
|
-
//# sourceMappingURL=Label-DndePzSD.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Label-DndePzSD.js","sources":["../node_modules/lucide-react/dist/esm/icons/circle-question-mark.js","../src/components/Label/constants.ts","../src/components/Label/Label.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\", key: \"1u773s\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst CircleQuestionMark = createLucideIcon(\"circle-question-mark\", __iconNode);\n\nexport { __iconNode, CircleQuestionMark as default };\n//# sourceMappingURL=circle-question-mark.js.map\n","export const SIDE_MAP: Record<string, \"top\" | \"right\" | \"bottom\" | \"left\"> = {\n top: \"top\",\n bottom: \"bottom\",\n left: \"left\",\n right: \"right\",\n auto: \"top\",\n};\n","import React, { forwardRef } from \"react\";\n\nimport { CircleHelpIcon } from \"lucide-react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { renderIcon, type IconProp } from \"src/lib/renderIcon\";\nimport { Label as PrimitiveLabel } from \"src/primitives/Label\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"src/primitives/Tooltip\";\nimport { Popover } from \"src/components/Popover\";\nimport { Button, type ButtonProps } from \"src/components/Button\";\n\nimport { SIDE_MAP } from \"./constants\";\n\ninterface HelpIconTooltipProps {\n /** Tooltip content. */\n content?: React.ReactNode;\n /** Tooltip position. */\n position?: string;\n}\n\ninterface HelpIconPopoverProps {\n /** Popover title. */\n title?: React.ReactNode;\n /** Popover description. */\n description?: React.ReactNode;\n /** Props for an optional help link button inside the popover. */\n helpLinkProps?: ButtonProps;\n}\n\ninterface HelpIconProps {\n /** Click handler on the help icon. */\n onClick?: () => void;\n /** Custom icon. Defaults to CircleHelpIcon. */\n icon?: IconProp;\n /** Show a tooltip on hover. */\n tooltipProps?: HelpIconTooltipProps;\n /** Show a popover on hover with title, description, and optional link. */\n popoverProps?: HelpIconPopoverProps;\n /** Additional class name for the help icon. */\n className?: string;\n}\n\nexport interface LabelProps extends React.ComponentProps<\n typeof PrimitiveLabel\n> {\n /** Shows a red asterisk after the label text. */\n required?: boolean;\n /** Props for the help icon (tooltip or popover mode). */\n helpIconProps?: HelpIconProps;\n /** Additional CSS class names. */\n className?: string;\n}\n\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ required, helpIconProps, className, children, ...otherProps }, ref) => {\n const helpIcon = helpIconProps?.icon ?? CircleHelpIcon;\n\n const iconElement = (\n <span\n className={cn(\n \"inline-flex cursor-help text-muted-foreground transition-colors hover:text-foreground\",\n helpIconProps?.onClick && \"cursor-pointer\",\n helpIconProps?.className\n )}\n onClick={helpIconProps?.onClick}\n >\n {renderIcon(helpIcon, \"size-3.5\")}\n </span>\n );\n\n const renderHelpIcon = () => {\n if (!helpIconProps) return null;\n\n // Popover mode\n if (helpIconProps.popoverProps) {\n const { title, description, helpLinkProps } =\n helpIconProps.popoverProps;\n\n return (\n <Popover trigger={iconElement}>\n {title && <Popover.Title>{title}</Popover.Title>}\n {description && (\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n )}\n {helpLinkProps && (\n <Button\n variant=\"link\"\n size=\"sm\"\n className=\"mt-1 h-auto self-start p-0\"\n {...helpLinkProps}\n href={helpLinkProps.href}\n />\n )}\n </Popover>\n );\n }\n\n // Tooltip mode\n if (helpIconProps.tooltipProps?.content) {\n const side =\n SIDE_MAP[helpIconProps.tooltipProps.position ?? \"auto\"] ?? \"top\";\n\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>{iconElement}</TooltipTrigger>\n <TooltipContent side={side}>\n {helpIconProps.tooltipProps.content}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n }\n\n // Icon only (with optional onClick)\n return iconElement;\n };\n\n return (\n <PrimitiveLabel ref={ref} className={cn(className)} {...otherProps}>\n {children}\n {required && (\n <span aria-hidden=\"true\" className=\"text-destructive\">\n *\n </span>\n )}\n {renderHelpIcon()}\n </PrimitiveLabel>\n );\n }\n);\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n"],"names":["CircleHelpIcon","PrimitiveLabel"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC5D,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,sCAAsC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AACxE,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,QAAQ,EAAE;AAC7C,CAAC;AACD,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,sBAAsB,EAAE,UAAU,CAAC;;ACdxE,MAAM,QAAA,GAAgE;AAAA,EAC3E,GAAA,EAAK,KAAA;AAAA,EACL,MAAA,EAAQ,QAAA;AAAA,EACR,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,IAAA,EAAM;AACR,CAAA;;ACoDA,MAAM,KAAA,GAAQ,UAAA;AA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;AACvC,QAAA,MAAM,OACJ,QAAA,CAAS,aAAA,CAAc,YAAA,CAAa,QAAA,IAAY,MAAM,CAAA,IAAK,KAAA;AAE7D,QAAA,uBACE,GAAA,CAAC,eAAA,EAAA,EACC,QAAA,kBAAA,IAAA,CAAC,OAAA,EAAA,EACC,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,cAAA,EAAA,EAAe,OAAA,EAAO,IAAA,EAAE,QAAA,EAAA,WAAA,EAAY,CAAA;AAAA,0BACrC,GAAA,CAAC,cAAA,EAAA,EAAe,IAAA,EACb,QAAA,EAAA,aAAA,CAAc,aAAa,OAAA,EAC9B;AAAA,SAAA,EACF,CAAA,EACF,CAAA;AAAA,MAEJ;AAGA,MAAA,OAAO,WAAA;AAAA,IACT,CAAA;AAEA,IAAA,uBACE,IAAA,CAACC,WAAe,GAAA,EAAU,SAAA,EAAW,GAAG,SAAS,CAAA,EAAI,GAAG,UAAA,EACrD,QAAA,EAAA;AAAA,MAAA,QAAA;AAAA,MACA,4BACC,GAAA,CAAC,MAAA,EAAA,EAAK,eAAY,MAAA,EAAO,SAAA,EAAU,oBAAmB,QAAA,EAAA,GAAA,EAEtD,CAAA;AAAA,MAED,cAAA;AAAe,KAAA,EAClB,CAAA;AAAA,EAEJ;AACF;AAEA,KAAA,CAAM,WAAA,GAAc,OAAA;;;;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup-BTemSonO.js","sources":["../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import React, { forwardRef, useId } from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\nimport {\n RadioGroup as PrimitiveRadioGroup,\n RadioGroupItem as PrimitiveRadioGroupItem,\n} from \"src/primitives/RadioGroup\";\nimport { Label } from \"src/primitives/Label\";\nimport {\n Field,\n FieldLabel,\n FieldContent,\n FieldDescription,\n FieldError,\n} from \"src/primitives/Field\";\n\nexport interface RadioGroupProps extends Omit<\n React.ComponentProps<typeof PrimitiveRadioGroup>,\n \"children\"\n> {\n /** Group label displayed above the radio items. */\n label?: string;\n /** Error message displayed below the group. */\n error?: string;\n /** Helper text displayed below the group label. Accepts string or ReactNode. */\n helpText?: React.ReactNode;\n /** Layout orientation. Defaults to \"horizontal\". */\n orientation?: \"horizontal\" | \"vertical\";\n /** Additional class name for the outermost wrapper. */\n className?: string;\n /** RadioGroup.Item children. */\n children?: React.ReactNode;\n}\n\nexport interface RadioGroupItemProps extends React.ComponentProps<\n typeof PrimitiveRadioGroupItem\n> {\n /** Label displayed next to the radio. */\n label?: string;\n /** Helper text displayed below the item label. Accepts string or ReactNode. */\n helpText?: React.ReactNode;\n /** Radio value (required). */\n value: string;\n /** Additional class name for the item wrapper. */\n className?: string;\n /** Optional id override; auto-generated if omitted. */\n id?: string;\n}\n\nconst RadioGroupItem = forwardRef<\n React.ComponentRef<typeof PrimitiveRadioGroupItem>,\n RadioGroupItemProps\n>(({ label, helpText, value, className, id: idProp, ...props }, ref) => {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const helpTextId = `helpText_${id}`;\n\n return (\n <div\n className={cn(\n \"flex gap-2\",\n helpText ? \"items-start\" : \"items-center\",\n className\n )}\n >\n <PrimitiveRadioGroupItem\n ref={ref}\n id={id}\n value={value}\n aria-describedby={helpText ? helpTextId : undefined}\n className={helpText ? \"mt-0.5\" : undefined}\n {...props}\n />\n {(label || helpText) && (\n <div className=\"flex flex-col gap-0.5\">\n {label && (\n <Label htmlFor={id} className=\"cursor-pointer font-normal\">\n {label}\n </Label>\n )}\n {helpText && (\n <FieldDescription id={helpTextId}>{helpText}</FieldDescription>\n )}\n </div>\n )}\n </div>\n );\n});\n\nRadioGroupItem.displayName = \"RadioGroup.Item\";\n\nconst RadioGroupRoot = forwardRef<\n React.ComponentRef<typeof PrimitiveRadioGroup>,\n RadioGroupProps\n>(\n (\n {\n label,\n error,\n helpText,\n orientation = \"horizontal\",\n className,\n disabled,\n required,\n children,\n ...props\n },\n ref\n ) => {\n const generatedId = useId();\n const errorId = `error_${generatedId}`;\n const helpTextId = `helpText_${generatedId}`;\n\n const hasField = !!(label || error || helpText);\n\n const radioGroup = (\n <PrimitiveRadioGroup\n ref={ref}\n disabled={disabled}\n required={required}\n aria-invalid={!!error || undefined}\n aria-describedby={\n [error ? errorId : null, helpText ? helpTextId : null]\n .filter(Boolean)\n .join(\" \") || undefined\n }\n orientation={orientation}\n className={cn(\n \"data-[orientation=vertical]:grid data-[orientation=vertical]:gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:flex-row data-[orientation=horizontal]:flex-wrap data-[orientation=horizontal]:items-center data-[orientation=horizontal]:gap-4\",\n !hasField && className\n )}\n {...props}\n >\n {children}\n </PrimitiveRadioGroup>\n );\n\n if (!hasField) {\n return radioGroup;\n }\n\n return (\n <Field\n data-disabled={disabled || undefined}\n data-invalid={!!error || undefined}\n className={className}\n >\n {(label || helpText) && (\n <div>\n {label && (\n <FieldLabel>\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"text-destructive\">\n *\n </span>\n )}\n </FieldLabel>\n )}\n {helpText && (\n <FieldDescription id={helpTextId}>{helpText}</FieldDescription>\n )}\n </div>\n )}\n <FieldContent>\n {radioGroup}\n {!!error && <FieldError id={errorId}>{error}</FieldError>}\n </FieldContent>\n </Field>\n );\n }\n);\n\nRadioGroupRoot.displayName = \"RadioGroup\";\n\nconst RadioGroup = Object.assign(RadioGroupRoot, {\n Item: RadioGroupItem,\n});\n\nexport { RadioGroup };\n"],"names":["PrimitiveRadioGroupItem","PrimitiveRadioGroup"],"mappings":";;;;;;;AAiDA,MAAM,cAAA,GAAiB,UAAA,CAGrB,CAAC,EAAE,KAAA,EAAO,QAAA,EAAU,KAAA,EAAO,SAAA,EAAW,EAAA,EAAI,MAAA,EAAQ,GAAG,KAAA,IAAS,GAAA,KAAQ;AACtE,EAAA,MAAM,cAAc,KAAA,EAAM;AAC1B,EAAA,MAAM,KAAK,MAAA,IAAU,WAAA;AAC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,QAAA,EAAS;AAAA,WAAA,EAEhD,CAAA;AAAA,+BAED,YAAA,EAAA,EACE,QAAA,EAAA;AAAA,YAAA,UAAA;AAAA,YACA,CAAC,CAAC,KAAA,wBAAU,UAAA,EAAA,EAAW,EAAA,EAAI,SAAU,QAAA,EAAA,KAAA,EAAM;AAAA,WAAA,EAC9C;AAAA;AAAA;AAAA,KACF;AAAA,EAEJ;AACF,CAAA;AAEA,cAAA,CAAe,WAAA,GAAc,YAAA;AAE7B,MAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EAC/C,IAAA,EAAM;AACR,CAAC;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Switch-OAB7pfNn.js","sources":["../src/components/Switch/Switch.tsx"],"sourcesContent":["import React, { forwardRef, useId } from \"react\";\n\nimport { Switch as PrimitiveSwitch } from \"src/primitives/Switch\";\nimport { Label } from \"src/primitives/Label\";\nimport { cn } from \"src/shadcn/lib/utils\";\n\nexport interface SwitchProps extends Omit<\n React.ComponentProps<typeof PrimitiveSwitch>,\n \"children\"\n> {\n /** Text label displayed next to the switch. */\n label?: string;\n /** Error message displayed below the switch. */\n error?: string;\n /** Helper text displayed below the label. Accepts string or ReactNode. */\n helpText?: React.ReactNode;\n /** Shows a required indicator next to the label. */\n required?: boolean;\n /** Additional class name for the outermost wrapper. */\n className?: string;\n /** Size of the switch. */\n size?: \"sm\" | \"default\" | \"lg\";\n}\n\nconst Switch = forwardRef<\n React.ComponentRef<typeof PrimitiveSwitch>,\n SwitchProps\n>(\n (\n {\n label,\n error,\n helpText,\n required = false,\n className,\n size = \"default\",\n disabled,\n id: idProp,\n ...otherProps\n },\n ref\n ) => {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const errorId = `error_${id}`;\n const helpTextId = `helpText_${id}`;\n\n const ariaDescribedBy =\n [error ? errorId : null, helpText ? helpTextId : null]\n .filter(Boolean)\n .join(\" \") || undefined;\n\n return (\n <div\n className={cn(\"inline-flex flex-col gap-1.5\", className)}\n data-disabled={disabled || undefined}\n data-invalid={!!error || undefined}\n >\n <div\n className={cn(\n \"inline-flex gap-2\",\n helpText ? \"items-start\" : \"items-center\"\n )}\n >\n <PrimitiveSwitch\n ref={ref}\n id={id}\n size={size}\n disabled={disabled}\n aria-invalid={!!error || undefined}\n aria-describedby={ariaDescribedBy}\n aria-required={required || undefined}\n className={helpText ? \"mt-0.5\" : undefined}\n {...otherProps}\n />\n {(label || helpText) && (\n <div className=\"flex flex-col gap-0.5\">\n {label && (\n <Label\n htmlFor={id}\n className={cn(\n \"cursor-pointer\",\n disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"text-destructive\">\n *\n </span>\n )}\n </Label>\n )}\n {helpText && (\n <p id={helpTextId} className=\"text-sm text-muted-foreground\">\n {helpText}\n </p>\n )}\n </div>\n )}\n </div>\n {error && (\n <p id={errorId} role=\"alert\" className=\"text-xs text-destructive\">\n {error}\n </p>\n )}\n </div>\n );\n }\n);\n\nSwitch.displayName = \"Switch\";\n\nexport { Switch };\n"],"names":["PrimitiveSwitch"],"mappings":";;;;;;AAwBA,MAAM,MAAA,GAAS,UAAA;AAAA,EAIb,CACE;AAAA,IACE,KAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA,GAAW,KAAA;AAAA,IACX,SAAA;AAAA,IACA,IAAA,GAAO,SAAA;AAAA,IACP,QAAA;AAAA,IACA,EAAA,EAAI,MAAA;AAAA,IACJ,GAAG;AAAA,KAEL,GAAA,KACG;AACH,IAAA,MAAM,cAAc,KAAA,EAAM;AAC1B,IAAA,MAAM,KAAK,MAAA,IAAU,WAAA;AACrB,IAAA,MAAM,OAAA,GAAU,SAAS,EAAE,CAAA,CAAA;AAC3B,IAAA,MAAM,UAAA,GAAa,YAAY,EAAE,CAAA,CAAA;AAEjC,IAAA,MAAM,eAAA,GACJ,CAAC,KAAA,GAAQ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,EAAK,eAAY,MAAA,EAAO,SAAA,EAAU,oBAAmB,QAAA,EAAA,GAAA,EAEtD;AAAA;AAAA;AAAA,mBAEJ;AAAA,kBAED,4BACC,GAAA,CAAC,GAAA,EAAA,EAAE,IAAI,UAAA,EAAY,SAAA,EAAU,iCAC1B,QAAA,EAAA,QAAA,EACH;AAAA,iBAAA,EAEJ;AAAA;AAAA;AAAA,WAEJ;AAAA,UACC,KAAA,wBACE,GAAA,EAAA,EAAE,EAAA,EAAI,SAAS,IAAA,EAAK,OAAA,EAAQ,SAAA,EAAU,0BAAA,EACpC,QAAA,EAAA,KAAA,EACH;AAAA;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox-CxqWOvFN.js","sources":["../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { forwardRef, useId } from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { Checkbox as PrimitiveCheckbox } from \"src/primitives/Checkbox\";\nimport {\n Field,\n FieldContent,\n FieldLabel,\n FieldDescription,\n FieldError,\n} from \"src/primitives/Field\";\n\nexport interface CheckboxProps extends React.ComponentProps<\n typeof PrimitiveCheckbox\n> {\n /** Text displayed next to the checkbox. */\n label?: string;\n /** Error message displayed below the checkbox. */\n error?: string;\n /** Helper text displayed below the label. Accepts string or ReactNode. */\n helpText?: React.ReactNode;\n /** Shows a required indicator next to the label. */\n required?: boolean;\n /** Additional class name for the outermost wrapper. */\n className?: string;\n}\n\nconst Checkbox = forwardRef<\n React.ComponentRef<typeof PrimitiveCheckbox>,\n CheckboxProps\n>(\n (\n {\n label,\n error,\n helpText,\n required = false,\n disabled = false,\n className,\n ...otherProps\n },\n ref\n ) => {\n const generatedId = useId();\n const id = otherProps.id ?? generatedId;\n const errorId = `error_${id}`;\n const helpTextId = `helpText_${id}`;\n\n const ariaDescribedBy =\n [error ? errorId : null, helpText ? helpTextId : null]\n .filter(Boolean)\n .join(\" \") || undefined;\n\n const hasField = !!(label || error || helpText);\n\n if (!hasField) {\n return (\n <PrimitiveCheckbox\n ref={ref}\n id={id}\n disabled={disabled}\n aria-invalid={!!error || undefined}\n aria-required={required || undefined}\n aria-describedby={ariaDescribedBy}\n className={className}\n {...otherProps}\n />\n );\n }\n\n return (\n <div\n className={cn(\"flex flex-col gap-1\", className)}\n data-disabled={disabled || undefined}\n data-invalid={!!error || undefined}\n >\n <Field orientation=\"horizontal\">\n <PrimitiveCheckbox\n ref={ref}\n id={id}\n disabled={disabled}\n aria-invalid={!!error || undefined}\n aria-required={required || undefined}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n <FieldContent>\n {label && (\n <FieldLabel htmlFor={id}>\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"text-destructive\">\n *\n </span>\n )}\n </FieldLabel>\n )}\n {helpText && (\n <FieldDescription id={helpTextId}>{helpText}</FieldDescription>\n )}\n </FieldContent>\n </Field>\n {error && <FieldError id={errorId}>{error}</FieldError>}\n </div>\n );\n }\n);\n\nCheckbox.displayName = \"Checkbox\";\n\nexport { Checkbox };\n"],"names":["forwardRef","useId","jsx","PrimitiveCheckbox","jsxs","cn","Field","FieldContent","FieldLabel","FieldDescription","FieldError"],"mappings":";;;;;;;;AA2BA,MAAM,QAAA,GAAWA,gBAAA;AAAA,EAIf,CACE;AAAA,IACE,KAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA,GAAW,KAAA;AAAA,IACX,QAAA,GAAW,KAAA;AAAA,IACX,SAAA;AAAA,IACA,GAAG;AAAA,KAEL,GAAA,KACG;AACH,IAAA,MAAM,cAAcC,WAAA,EAAM;AAC1B,IAAA,MAAM,EAAA,GAAK,WAAW,EAAA,IAAM,WAAA;AAC5B,IAAA,MAAM,OAAA,GAAU,SAAS,EAAE,CAAA,CAAA;AAC3B,IAAA,MAAM,UAAA,GAAa,YAA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