@skybin-tech/nebula-ui 0.0.25 → 0.0.27
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/cjs/_virtual/_rolldown/runtime.cjs +24 -0
- package/dist/cjs/components/Accordion/Accordion.cjs +20 -10
- package/dist/cjs/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/cjs/components/Alert/Alert.cjs +19 -9
- package/dist/cjs/components/Alert/Alert.cjs.map +1 -1
- package/dist/cjs/components/Avatar/Avatar.cjs +19 -9
- package/dist/cjs/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/cjs/components/Badge/Badge.cjs +8 -7
- package/dist/cjs/components/Badge/Badge.cjs.map +1 -1
- package/dist/cjs/components/Button/Button.cjs +37 -47
- package/dist/cjs/components/Button/Button.cjs.map +1 -1
- package/dist/cjs/components/Card/Card.cjs +31 -12
- package/dist/cjs/components/Card/Card.cjs.map +1 -1
- package/dist/cjs/components/Checkbox/Checkbox.cjs +12 -7
- package/dist/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +55 -21
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
- package/dist/cjs/components/Form/Checkbox.cjs +128 -142
- package/dist/cjs/components/Form/Checkbox.cjs.map +1 -1
- package/dist/cjs/components/Form/Form.cjs +106 -105
- package/dist/cjs/components/Form/Form.cjs.map +1 -1
- package/dist/cjs/components/Form/FormSwitch.cjs +126 -0
- package/dist/cjs/components/Form/FormSwitch.cjs.map +1 -0
- package/dist/cjs/components/Form/Radio.cjs +157 -172
- package/dist/cjs/components/Form/Radio.cjs.map +1 -1
- package/dist/cjs/components/Form/TextArea.cjs +137 -152
- package/dist/cjs/components/Form/TextArea.cjs.map +1 -1
- package/dist/cjs/components/Form/TextBox.cjs +184 -206
- package/dist/cjs/components/Form/TextBox.cjs.map +1 -1
- package/dist/cjs/components/Form/context.cjs +109 -122
- package/dist/cjs/components/Form/context.cjs.map +1 -1
- package/dist/cjs/components/Form/hooks.cjs +34 -24
- package/dist/cjs/components/Form/hooks.cjs.map +1 -1
- package/dist/cjs/components/Form/variants.cjs +14 -14
- package/dist/cjs/components/Form/variants.cjs.map +1 -1
- package/dist/cjs/components/Input/Input.cjs +11 -7
- package/dist/cjs/components/Input/Input.cjs.map +1 -1
- package/dist/cjs/components/Label/Label.cjs +11 -7
- package/dist/cjs/components/Label/Label.cjs.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.cjs +58 -95
- package/dist/cjs/components/Pagination/Pagination.cjs.map +1 -1
- package/dist/cjs/components/Separator/Separator.cjs +11 -7
- package/dist/cjs/components/Separator/Separator.cjs.map +1 -1
- package/dist/cjs/components/Skeleton/Skeleton.cjs +7 -6
- package/dist/cjs/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/cjs/components/Switch/Switch.cjs +14 -0
- package/dist/cjs/components/Switch/Switch.cjs.map +1 -0
- package/dist/cjs/components/Tabs/Tabs.cjs +23 -10
- package/dist/cjs/components/Tabs/Tabs.cjs.map +1 -1
- package/dist/cjs/components/Textarea/Textarea.cjs +11 -7
- package/dist/cjs/components/Textarea/Textarea.cjs.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.cjs +14 -10
- package/dist/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/cjs/hooks/useDebounce.cjs +22 -14
- package/dist/cjs/hooks/useDebounce.cjs.map +1 -1
- package/dist/cjs/hooks/useToast.cjs +105 -84
- package/dist/cjs/hooks/useToast.cjs.map +1 -1
- package/dist/cjs/hooks/useToggle.cjs +15 -9
- package/dist/cjs/hooks/useToggle.cjs.map +1 -1
- package/dist/cjs/index.cjs +170 -170
- package/dist/cjs/primitives/accordion.cjs +38 -61
- package/dist/cjs/primitives/accordion.cjs.map +1 -1
- package/dist/cjs/primitives/alert.cjs +33 -63
- package/dist/cjs/primitives/alert.cjs.map +1 -1
- package/dist/cjs/primitives/avatar.cjs +29 -58
- package/dist/cjs/primitives/avatar.cjs.map +1 -1
- package/dist/cjs/primitives/badge.cjs +26 -27
- package/dist/cjs/primitives/badge.cjs.map +1 -1
- package/dist/cjs/primitives/button.cjs +44 -63
- package/dist/cjs/primitives/button.cjs.map +1 -1
- package/dist/cjs/primitives/calendar.cjs +41 -44
- package/dist/cjs/primitives/calendar.cjs.map +1 -1
- package/dist/cjs/primitives/card.cjs +39 -70
- package/dist/cjs/primitives/card.cjs.map +1 -1
- package/dist/cjs/primitives/checkbox.cjs +22 -45
- package/dist/cjs/primitives/checkbox.cjs.map +1 -1
- package/dist/cjs/primitives/command.cjs +65 -73
- package/dist/cjs/primitives/command.cjs.map +1 -1
- package/dist/cjs/primitives/dialog.cjs +55 -84
- package/dist/cjs/primitives/dialog.cjs.map +1 -1
- package/dist/cjs/primitives/dropdown-menu.cjs +82 -153
- package/dist/cjs/primitives/dropdown-menu.cjs.map +1 -1
- package/dist/cjs/primitives/input.cjs +17 -39
- package/dist/cjs/primitives/input.cjs.map +1 -1
- package/dist/cjs/primitives/label.cjs +19 -38
- package/dist/cjs/primitives/label.cjs.map +1 -1
- package/dist/cjs/primitives/popover.cjs +22 -42
- package/dist/cjs/primitives/popover.cjs.map +1 -1
- package/dist/cjs/primitives/radio-group.cjs +31 -50
- package/dist/cjs/primitives/radio-group.cjs.map +1 -1
- package/dist/cjs/primitives/scroll-area.cjs +33 -55
- package/dist/cjs/primitives/scroll-area.cjs.map +1 -1
- package/dist/cjs/primitives/select.cjs +76 -133
- package/dist/cjs/primitives/select.cjs.map +1 -1
- package/dist/cjs/primitives/separator.cjs +20 -42
- package/dist/cjs/primitives/separator.cjs.map +1 -1
- package/dist/cjs/primitives/skeleton.cjs +10 -12
- package/dist/cjs/primitives/skeleton.cjs.map +1 -1
- package/dist/cjs/primitives/sonner.cjs +16 -20
- package/dist/cjs/primitives/sonner.cjs.map +1 -1
- package/dist/cjs/primitives/switch.cjs +19 -45
- package/dist/cjs/primitives/switch.cjs.map +1 -1
- package/dist/cjs/primitives/table.cjs +52 -61
- package/dist/cjs/primitives/table.cjs.map +1 -1
- package/dist/cjs/primitives/tabs.cjs +30 -62
- package/dist/cjs/primitives/tabs.cjs.map +1 -1
- package/dist/cjs/primitives/textarea.cjs +15 -35
- package/dist/cjs/primitives/textarea.cjs.map +1 -1
- package/dist/cjs/primitives/textbox.cjs +17 -39
- package/dist/cjs/primitives/textbox.cjs.map +1 -1
- package/dist/cjs/primitives/toast.cjs +59 -107
- package/dist/cjs/primitives/toast.cjs.map +1 -1
- package/dist/cjs/primitives/toggle.cjs +39 -55
- package/dist/cjs/primitives/toggle.cjs.map +1 -1
- package/dist/cjs/primitives/tooltip.cjs +21 -41
- package/dist/cjs/primitives/tooltip.cjs.map +1 -1
- package/dist/cjs/utils/cn.cjs +11 -6
- package/dist/cjs/utils/cn.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.js +20 -13
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Alert/Alert.js +19 -11
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Avatar/Avatar.js +19 -11
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +8 -8
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Button/Button.js +37 -48
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Card/Card.js +31 -17
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +12 -7
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +4 -4
- package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +55 -35
- package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/components/Form/Checkbox.js +126 -140
- package/dist/components/Form/Checkbox.js.map +1 -1
- package/dist/components/Form/Form.d.ts +1 -1
- package/dist/components/Form/Form.d.ts.map +1 -1
- package/dist/components/Form/Form.js +104 -103
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/{Switch.d.ts → FormSwitch.d.ts} +3 -3
- package/dist/components/Form/FormSwitch.d.ts.map +1 -0
- package/dist/components/Form/FormSwitch.js +126 -0
- package/dist/components/Form/FormSwitch.js.map +1 -0
- package/dist/components/Form/Radio.d.ts +1 -1
- package/dist/components/Form/Radio.d.ts.map +1 -1
- package/dist/components/Form/Radio.js +155 -171
- package/dist/components/Form/Radio.js.map +1 -1
- package/dist/components/Form/Select.d.ts +1 -1
- package/dist/components/Form/Select.d.ts.map +1 -1
- package/dist/components/Form/TextArea.js +134 -149
- package/dist/components/Form/TextArea.js.map +1 -1
- package/dist/components/Form/TextBox.js +179 -201
- package/dist/components/Form/TextBox.js.map +1 -1
- package/dist/components/Form/context.d.ts +3 -5
- package/dist/components/Form/context.d.ts.map +1 -1
- package/dist/components/Form/context.js +109 -125
- package/dist/components/Form/context.js.map +1 -1
- package/dist/components/Form/hooks.js +35 -28
- package/dist/components/Form/hooks.js.map +1 -1
- package/dist/components/Form/index.d.ts +2 -2
- package/dist/components/Form/index.d.ts.map +1 -1
- package/dist/components/Form/variants.js +15 -14
- package/dist/components/Form/variants.js.map +1 -1
- package/dist/components/Input/Input.js +11 -7
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Label/Label.js +11 -7
- package/dist/components/Label/Label.js.map +1 -1
- package/dist/components/Pagination/Pagination.d.ts +5 -5
- package/dist/components/Pagination/Pagination.js +55 -83
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Separator/Separator.js +11 -7
- package/dist/components/Separator/Separator.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.js +7 -6
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +4 -1
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.js +14 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +23 -13
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Textarea/Textarea.js +11 -7
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +14 -13
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/hooks/useDebounce.js +23 -15
- package/dist/hooks/useDebounce.js.map +1 -1
- package/dist/hooks/useToast.js +103 -69
- package/dist/hooks/useToast.js.map +1 -1
- package/dist/hooks/useToggle.js +16 -10
- package/dist/hooks/useToggle.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -160
- package/dist/primitives/accordion.js +32 -43
- package/dist/primitives/accordion.js.map +1 -1
- package/dist/primitives/alert.js +30 -47
- package/dist/primitives/alert.js.map +1 -1
- package/dist/primitives/avatar.js +22 -38
- package/dist/primitives/avatar.js.map +1 -1
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/badge.d.ts.map +1 -1
- package/dist/primitives/badge.js +23 -27
- package/dist/primitives/badge.js.map +1 -1
- package/dist/primitives/button.js +41 -46
- package/dist/primitives/button.js.map +1 -1
- package/dist/primitives/calendar.d.ts +1 -1
- package/dist/primitives/calendar.d.ts.map +1 -1
- package/dist/primitives/calendar.js +37 -42
- package/dist/primitives/calendar.js.map +1 -1
- package/dist/primitives/card.js +37 -58
- package/dist/primitives/card.js.map +1 -1
- package/dist/primitives/checkbox.js +17 -25
- package/dist/primitives/checkbox.js.map +1 -1
- package/dist/primitives/command.d.ts +2 -2
- package/dist/primitives/command.d.ts.map +1 -1
- package/dist/primitives/command.js +70 -71
- package/dist/primitives/command.js.map +1 -1
- package/dist/primitives/dialog.d.ts +2 -2
- package/dist/primitives/dialog.js +47 -70
- package/dist/primitives/dialog.js.map +1 -1
- package/dist/primitives/dropdown-menu.d.ts +1 -1
- package/dist/primitives/dropdown-menu.js +70 -140
- package/dist/primitives/dropdown-menu.js.map +1 -1
- package/dist/primitives/input.js +15 -22
- package/dist/primitives/input.js.map +1 -1
- package/dist/primitives/label.js +14 -18
- package/dist/primitives/label.js.map +1 -1
- package/dist/primitives/popover.js +17 -25
- package/dist/primitives/popover.js.map +1 -1
- package/dist/primitives/radio-group.js +25 -30
- package/dist/primitives/radio-group.js.map +1 -1
- package/dist/primitives/scroll-area.js +27 -35
- package/dist/primitives/scroll-area.js.map +1 -1
- package/dist/primitives/select.js +65 -116
- package/dist/primitives/select.js.map +1 -1
- package/dist/primitives/separator.js +15 -22
- package/dist/primitives/separator.js.map +1 -1
- package/dist/primitives/skeleton.d.ts +1 -1
- package/dist/primitives/skeleton.d.ts.map +1 -1
- package/dist/primitives/skeleton.js +10 -12
- package/dist/primitives/skeleton.js.map +1 -1
- package/dist/primitives/sonner.d.ts +1 -1
- package/dist/primitives/sonner.d.ts.map +1 -1
- package/dist/primitives/sonner.js +17 -21
- package/dist/primitives/sonner.js.map +1 -1
- package/dist/primitives/switch.js +14 -25
- package/dist/primitives/switch.js.map +1 -1
- package/dist/primitives/table.js +50 -51
- package/dist/primitives/table.js.map +1 -1
- package/dist/primitives/tabs.js +23 -43
- package/dist/primitives/tabs.js.map +1 -1
- package/dist/primitives/textarea.js +13 -18
- package/dist/primitives/textarea.js.map +1 -1
- package/dist/primitives/textbox.js +15 -22
- package/dist/primitives/textbox.js.map +1 -1
- package/dist/primitives/toast.js +48 -87
- package/dist/primitives/toast.js.map +1 -1
- package/dist/primitives/toggle.js +34 -36
- package/dist/primitives/toggle.js.map +1 -1
- package/dist/primitives/tooltip.js +16 -24
- package/dist/primitives/tooltip.js.map +1 -1
- package/dist/stories/Button.d.ts +1 -1
- package/dist/stories/Button.d.ts.map +1 -1
- package/dist/stories/Button.stories.d.ts +1 -1
- package/dist/stories/Header.d.ts +1 -1
- package/dist/stories/Header.d.ts.map +1 -1
- package/dist/stories/Header.stories.d.ts +1 -1
- package/dist/utils/cn.js +10 -5
- package/dist/utils/cn.js.map +1 -1
- package/package.json +504 -497
- package/dist/cjs/components/Form/Switch.cjs +0 -126
- package/dist/cjs/components/Form/Switch.cjs.map +0 -1
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/components/Form/Switch.d.ts.map +0 -1
- package/dist/components/Form/Switch.js +0 -126
- package/dist/components/Form/Switch.js.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -1,146 +1,132 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
{
|
|
127
|
-
id: `${inputId}-error`,
|
|
128
|
-
className: "text-sm text-destructive ml-7",
|
|
129
|
-
role: "alert",
|
|
130
|
-
children: errorMessage
|
|
131
|
-
}
|
|
132
|
-
),
|
|
133
|
-
helperText && !hasError && /* @__PURE__ */ jsxRuntime.jsx(
|
|
134
|
-
"p",
|
|
135
|
-
{
|
|
136
|
-
id: `${inputId}-helper`,
|
|
137
|
-
className: "text-sm text-muted-foreground ml-7",
|
|
138
|
-
children: helperText
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
] });
|
|
2
|
+
"use client";
|
|
3
|
+
const require_cn = require("../../utils/cn.cjs");
|
|
4
|
+
const require_context = require("./context.cjs");
|
|
5
|
+
const require_label = require("../../primitives/label.cjs");
|
|
6
|
+
const require_checkbox = require("../../primitives/checkbox.cjs");
|
|
7
|
+
let react = require("react");
|
|
8
|
+
let class_variance_authority = require("class-variance-authority");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
let react_hook_form = require("react-hook-form");
|
|
11
|
+
//#region src/components/Form/Checkbox.tsx
|
|
12
|
+
var checkboxSizeVariants = (0, class_variance_authority.cva)("", {
|
|
13
|
+
variants: { size: {
|
|
14
|
+
sm: "h-4 w-4",
|
|
15
|
+
md: "h-5 w-5",
|
|
16
|
+
lg: "h-6 w-6"
|
|
17
|
+
} },
|
|
18
|
+
defaultVariants: { size: "md" }
|
|
19
|
+
});
|
|
20
|
+
var labelVariants = (0, class_variance_authority.cva)("text-sm font-medium cursor-pointer select-none", {
|
|
21
|
+
variants: {
|
|
22
|
+
required: {
|
|
23
|
+
true: "after:content-['*'] after:ml-0.5 after:text-destructive",
|
|
24
|
+
false: ""
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
true: "cursor-not-allowed opacity-50",
|
|
28
|
+
false: ""
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
required: false,
|
|
33
|
+
disabled: false
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Checkbox component with form integration
|
|
38
|
+
*
|
|
39
|
+
* This is a wrapper around the shadcn/ui Checkbox primitive that adds:
|
|
40
|
+
* - Form integration with react-hook-form
|
|
41
|
+
* - Automatic validation registration
|
|
42
|
+
* - Label, helper text, and error message support
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // Inside a Form component
|
|
47
|
+
* <Checkbox name="terms" label="I agree to the terms and conditions" required />
|
|
48
|
+
* <Checkbox name="newsletter" label="Subscribe to newsletter" />
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
function CheckboxInner({ name, label, helperText, showError = true, error: customError, size, variant, className, disabled, id: providedId, control: externalControl, required, validate, ...props }, ref) {
|
|
52
|
+
const generatedId = (0, react.useId)();
|
|
53
|
+
const inputId = providedId ?? generatedId;
|
|
54
|
+
const formConfigContext = (0, react.useContext)(require_context.FormConfigContext);
|
|
55
|
+
const formConfig = formConfigContext ?? {};
|
|
56
|
+
const rhfContext = (0, react_hook_form.useFormContext)();
|
|
57
|
+
const control = externalControl ?? rhfContext?.control;
|
|
58
|
+
(0, react.useEffect)(() => {
|
|
59
|
+
if (formConfigContext?.registerFieldValidation) {
|
|
60
|
+
const rules = {};
|
|
61
|
+
if (required !== void 0) rules.required = required;
|
|
62
|
+
if (validate !== void 0) rules.validate = validate;
|
|
63
|
+
formConfigContext.registerFieldValidation({
|
|
64
|
+
name,
|
|
65
|
+
type: "boolean",
|
|
66
|
+
rules
|
|
67
|
+
});
|
|
68
|
+
return () => {
|
|
69
|
+
formConfigContext.unregisterFieldValidation(name);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}, [
|
|
73
|
+
formConfigContext,
|
|
74
|
+
name,
|
|
75
|
+
required,
|
|
76
|
+
validate
|
|
77
|
+
]);
|
|
78
|
+
const { field, fieldState } = (0, react_hook_form.useController)({
|
|
79
|
+
name,
|
|
80
|
+
control
|
|
81
|
+
});
|
|
82
|
+
const fieldError = fieldState.error?.message;
|
|
83
|
+
const errorMessage = customError ?? fieldError;
|
|
84
|
+
const hasError = !!errorMessage;
|
|
85
|
+
const effectiveSize = size ?? formConfig.size ?? "md";
|
|
86
|
+
const effectiveDisabled = disabled ?? formConfig.disabled;
|
|
87
|
+
const effectiveVariant = hasError ? "error" : variant;
|
|
88
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
89
|
+
className: "space-y-1.5",
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
92
|
+
className: "flex items-center gap-2",
|
|
93
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_checkbox.Checkbox, {
|
|
94
|
+
...props,
|
|
95
|
+
ref,
|
|
96
|
+
id: inputId,
|
|
97
|
+
checked: field.value ?? false,
|
|
98
|
+
onCheckedChange: (checked) => field.onChange(checked === true),
|
|
99
|
+
onBlur: field.onBlur,
|
|
100
|
+
disabled: effectiveDisabled,
|
|
101
|
+
"aria-invalid": hasError,
|
|
102
|
+
"aria-describedby": hasError ? `${inputId}-error` : helperText ? `${inputId}-helper` : void 0,
|
|
103
|
+
className: require_cn.cn(checkboxSizeVariants({ size: effectiveSize }), effectiveVariant === "error" && "border-destructive", className)
|
|
104
|
+
}), label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_label.Label, {
|
|
105
|
+
htmlFor: inputId,
|
|
106
|
+
className: labelVariants({
|
|
107
|
+
required: !!required,
|
|
108
|
+
disabled: effectiveDisabled
|
|
109
|
+
}),
|
|
110
|
+
children: label
|
|
111
|
+
})]
|
|
112
|
+
}),
|
|
113
|
+
showError && hasError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
114
|
+
id: `${inputId}-error`,
|
|
115
|
+
className: "text-sm text-destructive ml-7",
|
|
116
|
+
role: "alert",
|
|
117
|
+
children: errorMessage
|
|
118
|
+
}),
|
|
119
|
+
helperText && !hasError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
120
|
+
id: `${inputId}-helper`,
|
|
121
|
+
className: "text-sm text-muted-foreground ml-7",
|
|
122
|
+
children: helperText
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
});
|
|
142
126
|
}
|
|
143
|
-
|
|
127
|
+
var Checkbox = (0, react.forwardRef)(CheckboxInner);
|
|
144
128
|
Checkbox.displayName = "Checkbox";
|
|
129
|
+
//#endregion
|
|
145
130
|
exports.Checkbox = Checkbox;
|
|
146
|
-
|
|
131
|
+
|
|
132
|
+
//# sourceMappingURL=Checkbox.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.cjs","sources":["../../../../src/components/Form/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useId, useContext, useEffect } from \"react\";\nimport type { ReactNode, ComponentPropsWithoutRef } from \"react\";\nimport { useController, useFormContext as useRHFFormContext, type FieldValues, type FieldPath, type Control } from \"react-hook-form\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\nimport { FormConfigContext, type FormConfig, type FieldValidationRules } from \"../Form/context\";\nimport { Checkbox as ShadcnCheckbox } from \"../../primitives/checkbox\";\nimport { Label } from \"../../primitives/label\";\nimport type * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\n\nconst checkboxSizeVariants = cva(\n \"\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n }\n);\n\nconst labelVariants = cva(\n \"text-sm font-medium cursor-pointer select-none\",\n {\n variants: {\n required: {\n true: \"after:content-['*'] after:ml-0.5 after:text-destructive\",\n false: \"\",\n },\n disabled: {\n true: \"cursor-not-allowed opacity-50\",\n false: \"\",\n },\n },\n defaultVariants: {\n required: false,\n disabled: false,\n },\n }\n);\n\nexport interface CheckboxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> extends Omit<ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, \"name\" | \"checked\" | \"onCheckedChange\" | \"required\">,\n VariantProps<typeof checkboxSizeVariants> {\n /** Field name - required for form integration */\n name: TName;\n /** Label text for the checkbox */\n label?: ReactNode;\n /** Helper text displayed below the checkbox */\n helperText?: string;\n /** Whether to show the error message */\n showError?: boolean;\n /** Custom error message (overrides form error) */\n error?: string;\n /** External control (for use outside Form) */\n control?: Control<TFieldValues>;\n /** Variant style */\n variant?: \"default\" | \"error\";\n \n // Validation props\n /** Field is required (must be checked) */\n required?: boolean | string;\n /** Custom validation function */\n validate?: (value: unknown) => boolean | string | Promise<boolean | string>;\n}\n\n/**\n * Checkbox component with form integration\n * \n * This is a wrapper around the shadcn/ui Checkbox primitive that adds:\n * - Form integration with react-hook-form\n * - Automatic validation registration\n * - Label, helper text, and error message support\n * \n * @example\n * ```tsx\n * // Inside a Form component\n * <Checkbox name=\"terms\" label=\"I agree to the terms and conditions\" required />\n * <Checkbox name=\"newsletter\" label=\"Subscribe to newsletter\" />\n * ```\n */\nfunction CheckboxInner<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n {\n name,\n label,\n helperText,\n showError = true,\n error: customError,\n size,\n variant,\n className,\n disabled,\n id: providedId,\n control: externalControl,\n // Validation props\n required,\n validate,\n ...props\n }: CheckboxProps<TFieldValues, TName>,\n ref: React.ForwardedRef<React.ElementRef<typeof CheckboxPrimitive.Root>>\n) {\n const generatedId = useId();\n const inputId = providedId ?? generatedId;\n \n // Try to get form context\n const formConfigContext = useContext(FormConfigContext);\n const formConfig: FormConfig = formConfigContext ?? {};\n \n // Get form context from react-hook-form\n const rhfContext = useRHFFormContext<TFieldValues>();\n const control = externalControl ?? rhfContext?.control;\n\n // Register validation rules with the form\n useEffect(() => {\n if (formConfigContext?.registerFieldValidation) {\n const rules: FieldValidationRules = {};\n \n if (required !== undefined) rules.required = required;\n if (validate !== undefined) rules.validate = validate;\n\n formConfigContext.registerFieldValidation({\n name: name as string,\n type: \"boolean\",\n rules,\n });\n\n return () => {\n formConfigContext.unregisterFieldValidation(name as string);\n };\n }\n }, [formConfigContext, name, required, validate]);\n\n // Use controller for form integration\n const { field, fieldState } = useController<TFieldValues, TName>({\n name,\n control,\n });\n\n const fieldError = fieldState.error?.message;\n const errorMessage = customError ?? fieldError;\n const hasError = !!errorMessage;\n \n // Merge sizes - prop takes precedence over form config\n const effectiveSize = size ?? formConfig.size ?? \"md\";\n const effectiveDisabled = disabled ?? formConfig.disabled;\n \n // Determine variant based on error state\n const effectiveVariant = hasError ? \"error\" : variant;\n\n return (\n <div className=\"space-y-1.5\">\n <div className=\"flex items-center gap-2\">\n <ShadcnCheckbox\n {...props}\n ref={ref}\n id={inputId}\n checked={field.value ?? false}\n onCheckedChange={(checked) => field.onChange(checked === true)}\n onBlur={field.onBlur}\n disabled={effectiveDisabled}\n aria-invalid={hasError}\n aria-describedby={\n hasError\n ? `${inputId}-error`\n : helperText\n ? `${inputId}-helper`\n : undefined\n }\n className={cn(\n checkboxSizeVariants({ size: effectiveSize }),\n effectiveVariant === \"error\" && \"border-destructive\",\n className\n )}\n />\n \n {label && (\n <Label\n htmlFor={inputId}\n className={labelVariants({ required: !!required, disabled: effectiveDisabled })}\n >\n {label}\n </Label>\n )}\n </div>\n\n {showError && hasError && (\n <p\n id={`${inputId}-error`}\n className=\"text-sm text-destructive ml-7\"\n role=\"alert\"\n >\n {errorMessage}\n </p>\n )}\n \n {helperText && !hasError && (\n <p\n id={`${inputId}-helper`}\n className=\"text-sm text-muted-foreground ml-7\"\n >\n {helperText}\n </p>\n )}\n </div>\n );\n}\n\n// Use forwardRef with generic support\nexport const Checkbox = forwardRef(CheckboxInner) as <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n props: CheckboxProps<TFieldValues, TName> & { ref?: React.ForwardedRef<React.ElementRef<typeof CheckboxPrimitive.Root>> }\n) => React.ReactElement;\n\n(Checkbox as React.FC).displayName = \"Checkbox\";\n"],"
|
|
1
|
+
{"version":3,"file":"Checkbox.cjs","names":[],"sources":["../../../../src/components/Form/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useId, useContext, useEffect } from \"react\";\nimport type { ReactNode, ComponentPropsWithoutRef } from \"react\";\nimport { useController, useFormContext as useRHFFormContext, type FieldValues, type FieldPath, type Control } from \"react-hook-form\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../utils/cn\";\nimport { FormConfigContext, type FormConfig, type FieldValidationRules } from \"../Form/context\";\nimport { Checkbox as ShadcnCheckbox } from \"../../primitives/checkbox\";\nimport { Label } from \"../../primitives/label\";\nimport type * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\n\nconst checkboxSizeVariants = cva(\n \"\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n }\n);\n\nconst labelVariants = cva(\n \"text-sm font-medium cursor-pointer select-none\",\n {\n variants: {\n required: {\n true: \"after:content-['*'] after:ml-0.5 after:text-destructive\",\n false: \"\",\n },\n disabled: {\n true: \"cursor-not-allowed opacity-50\",\n false: \"\",\n },\n },\n defaultVariants: {\n required: false,\n disabled: false,\n },\n }\n);\n\nexport interface CheckboxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> extends Omit<ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, \"name\" | \"checked\" | \"onCheckedChange\" | \"required\">,\n VariantProps<typeof checkboxSizeVariants> {\n /** Field name - required for form integration */\n name: TName;\n /** Label text for the checkbox */\n label?: ReactNode;\n /** Helper text displayed below the checkbox */\n helperText?: string;\n /** Whether to show the error message */\n showError?: boolean;\n /** Custom error message (overrides form error) */\n error?: string;\n /** External control (for use outside Form) */\n control?: Control<TFieldValues>;\n /** Variant style */\n variant?: \"default\" | \"error\";\n \n // Validation props\n /** Field is required (must be checked) */\n required?: boolean | string;\n /** Custom validation function */\n validate?: (value: unknown) => boolean | string | Promise<boolean | string>;\n}\n\n/**\n * Checkbox component with form integration\n * \n * This is a wrapper around the shadcn/ui Checkbox primitive that adds:\n * - Form integration with react-hook-form\n * - Automatic validation registration\n * - Label, helper text, and error message support\n * \n * @example\n * ```tsx\n * // Inside a Form component\n * <Checkbox name=\"terms\" label=\"I agree to the terms and conditions\" required />\n * <Checkbox name=\"newsletter\" label=\"Subscribe to newsletter\" />\n * ```\n */\nfunction CheckboxInner<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n {\n name,\n label,\n helperText,\n showError = true,\n error: customError,\n size,\n variant,\n className,\n disabled,\n id: providedId,\n control: externalControl,\n // Validation props\n required,\n validate,\n ...props\n }: CheckboxProps<TFieldValues, TName>,\n ref: React.ForwardedRef<React.ElementRef<typeof CheckboxPrimitive.Root>>\n) {\n const generatedId = useId();\n const inputId = providedId ?? generatedId;\n \n // Try to get form context\n const formConfigContext = useContext(FormConfigContext);\n const formConfig: FormConfig = formConfigContext ?? {};\n \n // Get form context from react-hook-form\n const rhfContext = useRHFFormContext<TFieldValues>();\n const control = externalControl ?? rhfContext?.control;\n\n // Register validation rules with the form\n useEffect(() => {\n if (formConfigContext?.registerFieldValidation) {\n const rules: FieldValidationRules = {};\n \n if (required !== undefined) rules.required = required;\n if (validate !== undefined) rules.validate = validate;\n\n formConfigContext.registerFieldValidation({\n name: name as string,\n type: \"boolean\",\n rules,\n });\n\n return () => {\n formConfigContext.unregisterFieldValidation(name as string);\n };\n }\n }, [formConfigContext, name, required, validate]);\n\n // Use controller for form integration\n const { field, fieldState } = useController<TFieldValues, TName>({\n name,\n control,\n });\n\n const fieldError = fieldState.error?.message;\n const errorMessage = customError ?? fieldError;\n const hasError = !!errorMessage;\n \n // Merge sizes - prop takes precedence over form config\n const effectiveSize = size ?? formConfig.size ?? \"md\";\n const effectiveDisabled = disabled ?? formConfig.disabled;\n \n // Determine variant based on error state\n const effectiveVariant = hasError ? \"error\" : variant;\n\n return (\n <div className=\"space-y-1.5\">\n <div className=\"flex items-center gap-2\">\n <ShadcnCheckbox\n {...props}\n ref={ref}\n id={inputId}\n checked={field.value ?? false}\n onCheckedChange={(checked) => field.onChange(checked === true)}\n onBlur={field.onBlur}\n disabled={effectiveDisabled}\n aria-invalid={hasError}\n aria-describedby={\n hasError\n ? `${inputId}-error`\n : helperText\n ? `${inputId}-helper`\n : undefined\n }\n className={cn(\n checkboxSizeVariants({ size: effectiveSize }),\n effectiveVariant === \"error\" && \"border-destructive\",\n className\n )}\n />\n \n {label && (\n <Label\n htmlFor={inputId}\n className={labelVariants({ required: !!required, disabled: effectiveDisabled })}\n >\n {label}\n </Label>\n )}\n </div>\n\n {showError && hasError && (\n <p\n id={`${inputId}-error`}\n className=\"text-sm text-destructive ml-7\"\n role=\"alert\"\n >\n {errorMessage}\n </p>\n )}\n \n {helperText && !hasError && (\n <p\n id={`${inputId}-helper`}\n className=\"text-sm text-muted-foreground ml-7\"\n >\n {helperText}\n </p>\n )}\n </div>\n );\n}\n\n// Use forwardRef with generic support\nexport const Checkbox = forwardRef(CheckboxInner) as <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>(\n props: CheckboxProps<TFieldValues, TName> & { ref?: React.ForwardedRef<React.ElementRef<typeof CheckboxPrimitive.Root>> }\n) => React.ReactElement;\n\n(Checkbox as React.FC).displayName = \"Checkbox\";\n"],"mappings":";;;;;;;;;;;AAYA,IAAM,wBAAA,GAAA,yBAAA,IAAA,CACJ,IACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;CACN,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CACF;AAEA,IAAM,iBAAA,GAAA,yBAAA,IAAA,CACJ,kDACA;CACE,UAAU;EACR,UAAU;GACR,MAAM;GACN,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,OAAO;EACT;CACF;CACA,iBAAiB;EACf,UAAU;EACV,UAAU;CACZ;AACF,CACF;;;;;;;;;;;;;;;;AA4CA,SAAS,cAIP,EACE,MACA,OACA,YACA,YAAY,MACZ,OAAO,aACP,MACA,SACA,WACA,UACA,IAAI,YACJ,SAAS,iBAET,UACA,UACA,GAAG,SAEL,KACA;CACA,MAAM,eAAA,GAAA,MAAA,MAAA,CAAoB;CAC1B,MAAM,UAAU,cAAc;CAG9B,MAAM,qBAAA,GAAA,MAAA,WAAA,CAA+B,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
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
) }) });
|
|
2
|
+
"use client";
|
|
3
|
+
const require_context = require("./context.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let react_hook_form = require("react-hook-form");
|
|
7
|
+
let _hookform_resolvers_zod = require("@hookform/resolvers/zod");
|
|
8
|
+
let zod = require("zod");
|
|
9
|
+
//#region src/components/Form/Form.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Form component that provides form context and validation
|
|
12
|
+
*
|
|
13
|
+
* Child components like TextBox can register their validation rules automatically.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* // Validation is automatically built from component props
|
|
18
|
+
* <Form onSubmit={handleSubmit} defaultValues={{ username: "", email: "" }}>
|
|
19
|
+
* <TextBox name="username" label="Username" required minLength={3} maxLength={50} />
|
|
20
|
+
* <TextBox name="email" label="Email" type="email" required email />
|
|
21
|
+
* <Button type="submit">Submit</Button>
|
|
22
|
+
* </Form>
|
|
23
|
+
*
|
|
24
|
+
* // Or with a base schema that gets extended
|
|
25
|
+
* const baseSchema = z.object({
|
|
26
|
+
* username: z.string(),
|
|
27
|
+
* email: z.string(),
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* <Form schema={baseSchema} onSubmit={handleSubmit}>
|
|
31
|
+
* <TextBox name="username" required minLength={3} /> // Adds required + minLength
|
|
32
|
+
* <TextBox name="email" required email /> // Adds required + email validation
|
|
33
|
+
* </Form>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
function Form({ schema: baseSchema, defaultValues, values, onSubmit, onError, config, children, form: externalForm, mode = "onBlur", reValidateMode = "onChange", resolver: customResolver, ...formProps }) {
|
|
37
|
+
const mergedConfig = {
|
|
38
|
+
...require_context.defaultFormConfig,
|
|
39
|
+
...config
|
|
40
|
+
};
|
|
41
|
+
const { registerFieldValidation, unregisterFieldValidation, getValidationSchema } = require_context.useFieldValidationRegistry();
|
|
42
|
+
const internalForm = (0, react_hook_form.useForm)({
|
|
43
|
+
resolver: (0, react.useCallback)(async (vals, context, options) => {
|
|
44
|
+
if (customResolver) return customResolver(vals, context, options);
|
|
45
|
+
const fieldSchema = getValidationSchema();
|
|
46
|
+
let finalSchema;
|
|
47
|
+
if (baseSchema instanceof zod.z.ZodObject) finalSchema = baseSchema.merge(fieldSchema);
|
|
48
|
+
else finalSchema = baseSchema ?? fieldSchema;
|
|
49
|
+
return (0, _hookform_resolvers_zod.zodResolver)(finalSchema)(vals, context, options);
|
|
50
|
+
}, [baseSchema, customResolver]),
|
|
51
|
+
defaultValues,
|
|
52
|
+
values,
|
|
53
|
+
mode,
|
|
54
|
+
reValidateMode
|
|
55
|
+
});
|
|
56
|
+
const form = externalForm ?? internalForm;
|
|
57
|
+
const triggerValidation = (0, react.useCallback)(async (name) => {
|
|
58
|
+
return form.trigger(name);
|
|
59
|
+
}, [form]);
|
|
60
|
+
const handleSubmit = (e) => {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
if (onSubmit) form.handleSubmit(onSubmit, onError)(e);
|
|
63
|
+
};
|
|
64
|
+
const contextValue = (0, react.useMemo)(() => ({
|
|
65
|
+
form,
|
|
66
|
+
registerFieldValidation,
|
|
67
|
+
unregisterFieldValidation,
|
|
68
|
+
getValidationSchema,
|
|
69
|
+
triggerValidation,
|
|
70
|
+
showInlineErrors: mergedConfig.showInlineErrors,
|
|
71
|
+
validateOnBlur: mergedConfig.validateOnBlur,
|
|
72
|
+
validateOnChange: mergedConfig.validateOnChange,
|
|
73
|
+
size: mergedConfig.size,
|
|
74
|
+
layout: mergedConfig.layout,
|
|
75
|
+
labelWidth: mergedConfig.labelWidth,
|
|
76
|
+
disabled: mergedConfig.disabled,
|
|
77
|
+
colon: mergedConfig.colon
|
|
78
|
+
}), [
|
|
79
|
+
form,
|
|
80
|
+
registerFieldValidation,
|
|
81
|
+
unregisterFieldValidation,
|
|
82
|
+
getValidationSchema,
|
|
83
|
+
triggerValidation,
|
|
84
|
+
mergedConfig.showInlineErrors,
|
|
85
|
+
mergedConfig.validateOnBlur,
|
|
86
|
+
mergedConfig.validateOnChange,
|
|
87
|
+
mergedConfig.size,
|
|
88
|
+
mergedConfig.layout,
|
|
89
|
+
mergedConfig.labelWidth,
|
|
90
|
+
mergedConfig.disabled,
|
|
91
|
+
mergedConfig.colon
|
|
92
|
+
]);
|
|
93
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_context.FormConfigContext.Provider, {
|
|
94
|
+
value: contextValue,
|
|
95
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_hook_form.FormProvider, {
|
|
96
|
+
...form,
|
|
97
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("form", {
|
|
98
|
+
...formProps,
|
|
99
|
+
onSubmit: handleSubmit,
|
|
100
|
+
noValidate: true,
|
|
101
|
+
children
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
});
|
|
106
105
|
}
|
|
107
106
|
Form.displayName = "Form";
|
|
107
|
+
//#endregion
|
|
108
108
|
exports.Form = Form;
|
|
109
|
-
|
|
109
|
+
|
|
110
|
+
//# sourceMappingURL=Form.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.cjs","sources":["../../../../src/components/Form/Form.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback, useMemo, type ReactNode } from \"react\";\r\nimport {\r\n useForm,\r\n FormProvider as RHFFormProvider,\r\n type UseFormReturn,\r\n type FieldValues,\r\n type UseFormProps,\r\n type SubmitHandler,\r\n type SubmitErrorHandler,\r\n type Resolver,\r\n type Path,\r\n} from \"react-hook-form\";\r\nimport { zodResolver } from \"@hookform/resolvers/zod\";\r\nimport { z } from \"zod\";\r\nimport { \r\n FormConfigContext, \r\n defaultFormConfig, \r\n useFieldValidationRegistry,\r\n type FormConfig, \r\n type FormContextValue \r\n} from \"./context\";\r\n\r\n/**\r\n * Props for the Form component\r\n */\r\nexport interface FormProps<\r\n TFieldValues extends FieldValues = FieldValues,\r\n TContext = unknown\r\n> extends Omit<React.FormHTMLAttributes<HTMLFormElement>, \"onSubmit\" | \"onError\"> {\r\n /** Base Zod schema for validation (will be extended by field props) */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n schema?: z.ZodType<TFieldValues, any, any>;\r\n /** Default values for the form */\r\n defaultValues?: UseFormProps<TFieldValues, TContext>[\"defaultValues\"];\r\n /** Values to reset the form to */\r\n values?: UseFormProps<TFieldValues, TContext>[\"values\"];\r\n /** Submit handler */\r\n onSubmit?: SubmitHandler<TFieldValues>;\r\n /** Error handler */\r\n onError?: SubmitErrorHandler<TFieldValues>;\r\n /** Form configuration */\r\n config?: FormConfig;\r\n /** Children */\r\n children?: ReactNode;\r\n /** External form instance (for controlled forms) */\r\n form?: UseFormReturn<TFieldValues>;\r\n /** Validation mode */\r\n mode?: UseFormProps<TFieldValues, TContext>[\"mode\"];\r\n /** Revalidation mode */\r\n reValidateMode?: UseFormProps<TFieldValues, TContext>[\"reValidateMode\"];\r\n /** Custom resolver (overrides schema) */\r\n resolver?: Resolver<TFieldValues>;\r\n}\r\n\r\n/**\r\n * Form component that provides form context and validation\r\n * \r\n * Child components like TextBox can register their validation rules automatically.\r\n * \r\n * @example\r\n * ```tsx\r\n * // Validation is automatically built from component props\r\n * <Form onSubmit={handleSubmit} defaultValues={{ username: \"\", email: \"\" }}>\r\n * <TextBox name=\"username\" label=\"Username\" required minLength={3} maxLength={50} />\r\n * <TextBox name=\"email\" label=\"Email\" type=\"email\" required email />\r\n * <Button type=\"submit\">Submit</Button>\r\n * </Form>\r\n * \r\n * // Or with a base schema that gets extended\r\n * const baseSchema = z.object({\r\n * username: z.string(),\r\n * email: z.string(),\r\n * });\r\n * \r\n * <Form schema={baseSchema} onSubmit={handleSubmit}>\r\n * <TextBox name=\"username\" required minLength={3} /> // Adds required + minLength\r\n * <TextBox name=\"email\" required email /> // Adds required + email validation\r\n * </Form>\r\n * ```\r\n */\r\nexport function Form<\r\n TFieldValues extends FieldValues = FieldValues,\r\n TContext = unknown\r\n>({\r\n schema: baseSchema,\r\n defaultValues,\r\n values,\r\n onSubmit,\r\n onError,\r\n config,\r\n children,\r\n form: externalForm,\r\n mode = \"onBlur\",\r\n reValidateMode = \"onChange\",\r\n resolver: customResolver,\r\n ...formProps\r\n}: FormProps<TFieldValues, TContext>) {\r\n const mergedConfig = { ...defaultFormConfig, ...config };\r\n\r\n const {\r\n registerFieldValidation,\r\n unregisterFieldValidation,\r\n getValidationSchema,\r\n } = useFieldValidationRegistry();\r\n\r\n // Stable resolver that reads from fieldsRef at validation time — no re-renders\r\n // needed on field registration, and no race condition with useEffect timing.\r\n const dynamicResolver = useCallback<Resolver<TFieldValues>>(\r\n async (vals, context, options) => {\r\n if (customResolver) {\r\n return customResolver(vals, context, options);\r\n }\r\n const fieldSchema = getValidationSchema();\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n let finalSchema: z.ZodType<any, any, any>;\r\n if (baseSchema instanceof z.ZodObject) {\r\n finalSchema = baseSchema.merge(fieldSchema);\r\n } else {\r\n finalSchema = baseSchema ?? fieldSchema;\r\n }\r\n return zodResolver(finalSchema)(vals, context, options);\r\n },\r\n // getValidationSchema reads a ref — always current, intentionally omitted.\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [baseSchema, customResolver]\r\n );\r\n\r\n const internalForm = useForm<TFieldValues>({\r\n resolver: dynamicResolver,\r\n defaultValues,\r\n values,\r\n mode,\r\n reValidateMode,\r\n });\r\n\r\n const form = externalForm ?? internalForm;\r\n\r\n // Trigger validation for a specific field\r\n const triggerValidation = useCallback(async (name: string) => {\r\n return form.trigger(name as Path<TFieldValues>);\r\n }, [form]);\r\n\r\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\r\n e.preventDefault();\r\n if (onSubmit) {\r\n form.handleSubmit(onSubmit, onError)(e);\r\n }\r\n };\r\n\r\n const contextValue = useMemo<FormContextValue<TFieldValues>>(\r\n () => ({\r\n form,\r\n registerFieldValidation,\r\n unregisterFieldValidation,\r\n getValidationSchema,\r\n triggerValidation,\r\n showInlineErrors: mergedConfig.showInlineErrors,\r\n validateOnBlur: mergedConfig.validateOnBlur,\r\n validateOnChange: mergedConfig.validateOnChange,\r\n size: mergedConfig.size,\r\n layout: mergedConfig.layout,\r\n labelWidth: mergedConfig.labelWidth,\r\n disabled: mergedConfig.disabled,\r\n colon: mergedConfig.colon,\r\n }),\r\n [\r\n form,\r\n registerFieldValidation,\r\n unregisterFieldValidation,\r\n getValidationSchema,\r\n triggerValidation,\r\n mergedConfig.showInlineErrors,\r\n mergedConfig.validateOnBlur,\r\n mergedConfig.validateOnChange,\r\n mergedConfig.size,\r\n mergedConfig.layout,\r\n mergedConfig.labelWidth,\r\n mergedConfig.disabled,\r\n mergedConfig.colon,\r\n ]\r\n );\r\n\r\n return (\r\n <FormConfigContext.Provider value={contextValue as FormContextValue}>\r\n <RHFFormProvider {...form}>\r\n <form\r\n {...formProps}\r\n onSubmit={handleSubmit}\r\n noValidate\r\n >\r\n {children}\r\n </form>\r\n </RHFFormProvider>\r\n </FormConfigContext.Provider>\r\n );\r\n}\r\n\r\nForm.displayName = \"Form\";\r\n"],"
|
|
1
|
+
{"version":3,"file":"Form.cjs","names":[],"sources":["../../../../src/components/Form/Form.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback, useMemo, type ReactNode } from \"react\";\r\nimport {\r\n useForm,\r\n FormProvider as RHFFormProvider,\r\n type UseFormReturn,\r\n type FieldValues,\r\n type UseFormProps,\r\n type SubmitHandler,\r\n type SubmitErrorHandler,\r\n type Resolver,\r\n type Path,\r\n} from \"react-hook-form\";\r\nimport { zodResolver } from \"@hookform/resolvers/zod\";\r\nimport { z } from \"zod\";\r\nimport { \r\n FormConfigContext, \r\n defaultFormConfig, \r\n useFieldValidationRegistry,\r\n type FormConfig, \r\n type FormContextValue \r\n} from \"./context\";\r\n\r\n/**\r\n * Props for the Form component\r\n */\r\nexport interface FormProps<\r\n TFieldValues extends FieldValues = FieldValues,\r\n TContext = unknown\r\n> extends Omit<React.FormHTMLAttributes<HTMLFormElement>, \"onSubmit\" | \"onError\"> {\r\n /** Base Zod schema for validation (will be extended by field props) */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n schema?: z.ZodType<TFieldValues, any, any>;\r\n /** Default values for the form */\r\n defaultValues?: UseFormProps<TFieldValues, TContext>[\"defaultValues\"];\r\n /** Values to reset the form to */\r\n values?: UseFormProps<TFieldValues, TContext>[\"values\"];\r\n /** Submit handler */\r\n onSubmit?: SubmitHandler<TFieldValues>;\r\n /** Error handler */\r\n onError?: SubmitErrorHandler<TFieldValues>;\r\n /** Form configuration */\r\n config?: FormConfig;\r\n /** Children */\r\n children?: ReactNode;\r\n /** External form instance (for controlled forms) */\r\n form?: UseFormReturn<TFieldValues>;\r\n /** Validation mode */\r\n mode?: UseFormProps<TFieldValues, TContext>[\"mode\"];\r\n /** Revalidation mode */\r\n reValidateMode?: UseFormProps<TFieldValues, TContext>[\"reValidateMode\"];\r\n /** Custom resolver (overrides schema) */\r\n resolver?: Resolver<TFieldValues>;\r\n}\r\n\r\n/**\r\n * Form component that provides form context and validation\r\n * \r\n * Child components like TextBox can register their validation rules automatically.\r\n * \r\n * @example\r\n * ```tsx\r\n * // Validation is automatically built from component props\r\n * <Form onSubmit={handleSubmit} defaultValues={{ username: \"\", email: \"\" }}>\r\n * <TextBox name=\"username\" label=\"Username\" required minLength={3} maxLength={50} />\r\n * <TextBox name=\"email\" label=\"Email\" type=\"email\" required email />\r\n * <Button type=\"submit\">Submit</Button>\r\n * </Form>\r\n * \r\n * // Or with a base schema that gets extended\r\n * const baseSchema = z.object({\r\n * username: z.string(),\r\n * email: z.string(),\r\n * });\r\n * \r\n * <Form schema={baseSchema} onSubmit={handleSubmit}>\r\n * <TextBox name=\"username\" required minLength={3} /> // Adds required + minLength\r\n * <TextBox name=\"email\" required email /> // Adds required + email validation\r\n * </Form>\r\n * ```\r\n */\r\nexport function Form<\r\n TFieldValues extends FieldValues = FieldValues,\r\n TContext = unknown\r\n>({\r\n schema: baseSchema,\r\n defaultValues,\r\n values,\r\n onSubmit,\r\n onError,\r\n config,\r\n children,\r\n form: externalForm,\r\n mode = \"onBlur\",\r\n reValidateMode = \"onChange\",\r\n resolver: customResolver,\r\n ...formProps\r\n}: FormProps<TFieldValues, TContext>) {\r\n const mergedConfig = { ...defaultFormConfig, ...config };\r\n\r\n const {\r\n registerFieldValidation,\r\n unregisterFieldValidation,\r\n getValidationSchema,\r\n } = useFieldValidationRegistry();\r\n\r\n // Stable resolver that reads from fieldsRef at validation time — no re-renders\r\n // needed on field registration, and no race condition with useEffect timing.\r\n const dynamicResolver = useCallback<Resolver<TFieldValues>>(\r\n async (vals, context, options) => {\r\n if (customResolver) {\r\n return customResolver(vals, context, options);\r\n }\r\n const fieldSchema = getValidationSchema();\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n let finalSchema: z.ZodType<any, any, any>;\r\n if (baseSchema instanceof z.ZodObject) {\r\n finalSchema = baseSchema.merge(fieldSchema);\r\n } else {\r\n finalSchema = baseSchema ?? fieldSchema;\r\n }\r\n return zodResolver(finalSchema)(vals, context, options);\r\n },\r\n // getValidationSchema reads a ref — always current, intentionally omitted.\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [baseSchema, customResolver]\r\n );\r\n\r\n const internalForm = useForm<TFieldValues>({\r\n resolver: dynamicResolver,\r\n defaultValues,\r\n values,\r\n mode,\r\n reValidateMode,\r\n });\r\n\r\n const form = externalForm ?? internalForm;\r\n\r\n // Trigger validation for a specific field\r\n const triggerValidation = useCallback(async (name: string) => {\r\n return form.trigger(name as Path<TFieldValues>);\r\n }, [form]);\r\n\r\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\r\n e.preventDefault();\r\n if (onSubmit) {\r\n form.handleSubmit(onSubmit, onError)(e);\r\n }\r\n };\r\n\r\n const contextValue = useMemo<FormContextValue<TFieldValues>>(\r\n () => ({\r\n form,\r\n registerFieldValidation,\r\n unregisterFieldValidation,\r\n getValidationSchema,\r\n triggerValidation,\r\n showInlineErrors: mergedConfig.showInlineErrors,\r\n validateOnBlur: mergedConfig.validateOnBlur,\r\n validateOnChange: mergedConfig.validateOnChange,\r\n size: mergedConfig.size,\r\n layout: mergedConfig.layout,\r\n labelWidth: mergedConfig.labelWidth,\r\n disabled: mergedConfig.disabled,\r\n colon: mergedConfig.colon,\r\n }),\r\n [\r\n form,\r\n registerFieldValidation,\r\n unregisterFieldValidation,\r\n getValidationSchema,\r\n triggerValidation,\r\n mergedConfig.showInlineErrors,\r\n mergedConfig.validateOnBlur,\r\n mergedConfig.validateOnChange,\r\n mergedConfig.size,\r\n mergedConfig.layout,\r\n mergedConfig.labelWidth,\r\n mergedConfig.disabled,\r\n mergedConfig.colon,\r\n ]\r\n );\r\n\r\n return (\r\n <FormConfigContext.Provider value={contextValue as FormContextValue}>\r\n <RHFFormProvider {...form}>\r\n <form\r\n {...formProps}\r\n onSubmit={handleSubmit}\r\n noValidate\r\n >\r\n {children}\r\n </form>\r\n </RHFFormProvider>\r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