@axenstudio/axen-form 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -3
- package/dist/adapters/yupAdapter.cjs +29 -10
- package/dist/adapters/yupAdapter.d.ts +1 -2
- package/dist/adapters/yupAdapter.js +29 -10
- package/dist/adapters/zodAdapter.cjs +29 -10
- package/dist/adapters/zodAdapter.d.ts +1 -2
- package/dist/adapters/zodAdapter.js +29 -10
- package/dist/core/dateUtils.d.ts +0 -1
- package/dist/core/formStore.cjs +110 -39
- package/dist/core/formStore.d.ts +1 -1
- package/dist/core/formStore.js +110 -39
- package/dist/core/numberUtils.d.ts +0 -1
- package/dist/core/pathUtils.d.ts +0 -1
- package/dist/core/payloadUtils.d.ts +0 -1
- package/dist/core/semanticValidation.cjs +69 -0
- package/dist/core/semanticValidation.d.ts +5 -0
- package/dist/core/semanticValidation.js +69 -0
- package/dist/core/validation.cjs +4 -3
- package/dist/core/validation.d.ts +0 -1
- package/dist/core/validation.js +4 -3
- package/dist/fields/AutocompleteField/AutocompleteField.d.ts +1 -2
- package/dist/fields/AutocompleteMultiField/AutocompleteMultiField.d.ts +1 -2
- package/dist/fields/AutocompletePredictField/AutocompletePredictField.d.ts +1 -2
- package/dist/fields/CheckboxField/CheckboxField.d.ts +1 -2
- package/dist/fields/ColorField/ColorField.d.ts +1 -2
- package/dist/fields/CurrencyField/CurrencyField.d.ts +1 -2
- package/dist/fields/DateField/DateField.d.ts +1 -2
- package/dist/fields/DateField/DatePicker.d.ts +1 -2
- package/dist/fields/DateTimeField/DateTimeField.d.ts +1 -2
- package/dist/fields/EmailField/EmailField.d.ts +1 -2
- package/dist/fields/NumberField/NumberField.d.ts +1 -2
- package/dist/fields/PasswordField/PasswordField.d.ts +1 -2
- package/dist/fields/PhoneField/PhoneField.d.ts +1 -2
- package/dist/fields/RadioField/RadioField.d.ts +1 -2
- package/dist/fields/SelectField/SelectField.d.ts +1 -2
- package/dist/fields/SliderField/SliderField.d.ts +1 -2
- package/dist/fields/SwitchField/SwitchField.d.ts +1 -2
- package/dist/fields/TextField/TextField.d.ts +1 -2
- package/dist/fields/TextareaField/TextareaField.d.ts +1 -2
- package/dist/fields/TimeField/TimeField.d.ts +1 -2
- package/dist/fields/TimeField/TimePicker.d.ts +1 -2
- package/dist/fields/defaultComponentMap.cjs +3 -0
- package/dist/fields/defaultComponentMap.d.ts +0 -1
- package/dist/fields/defaultComponentMap.js +3 -0
- package/dist/fields/defaultPlaceholders.d.ts +0 -1
- package/dist/fields/fieldBase.module.css.cjs +92 -70
- package/dist/fields/fieldBase.module.css.js +92 -70
- package/dist/fields/fieldUtils.d.ts +0 -1
- package/dist/fields/iconUtils.d.ts +0 -1
- package/dist/fields/icons.d.ts +3 -4
- package/dist/index.cjs +31 -22
- package/dist/index.d.ts +3 -2
- package/dist/index.js +32 -23
- package/dist/layout/Box/Box.d.ts +1 -2
- package/dist/layout/Divider/Divider.d.ts +1 -2
- package/dist/layout/Grid/Grid.d.ts +1 -2
- package/dist/layout/Spacer/Spacer.d.ts +1 -2
- package/dist/layout/Stack/Stack.d.ts +1 -2
- package/dist/layout/index.d.ts +0 -1
- package/dist/react/AxenArrayField.d.ts +1 -2
- package/dist/react/AxenField.d.ts +1 -2
- package/dist/react/AxenForm.cjs +29 -23
- package/dist/react/AxenForm.d.ts +0 -1
- package/dist/react/AxenForm.js +30 -24
- package/dist/react/FormContext.d.ts +0 -1
- package/dist/react/useAxenForm.cjs +11 -4
- package/dist/react/useAxenForm.d.ts +1 -2
- package/dist/react/useAxenForm.js +11 -4
- package/dist/react/useField.cjs +3 -0
- package/dist/react/useField.d.ts +0 -1
- package/dist/react/useField.js +3 -0
- package/dist/react/useFieldArray.cjs +19 -13
- package/dist/react/useFieldArray.d.ts +0 -1
- package/dist/react/useFieldArray.js +19 -13
- package/dist/react/useFormState.cjs +18 -0
- package/dist/react/useFormState.d.ts +5 -0
- package/dist/react/useFormState.js +18 -0
- package/dist/types.d.ts +18 -2
- package/package.json +5 -2
- package/dist/adapters/yupAdapter.d.ts.map +0 -1
- package/dist/adapters/zodAdapter.d.ts.map +0 -1
- package/dist/core/dateUtils.d.ts.map +0 -1
- package/dist/core/formStore.d.ts.map +0 -1
- package/dist/core/numberUtils.d.ts.map +0 -1
- package/dist/core/pathUtils.d.ts.map +0 -1
- package/dist/core/payloadUtils.d.ts.map +0 -1
- package/dist/core/validation.d.ts.map +0 -1
- package/dist/fields/AutocompleteField/AutocompleteField.d.ts.map +0 -1
- package/dist/fields/AutocompleteMultiField/AutocompleteMultiField.d.ts.map +0 -1
- package/dist/fields/AutocompletePredictField/AutocompletePredictField.d.ts.map +0 -1
- package/dist/fields/CheckboxField/CheckboxField.d.ts.map +0 -1
- package/dist/fields/ColorField/ColorField.d.ts.map +0 -1
- package/dist/fields/CurrencyField/CurrencyField.d.ts.map +0 -1
- package/dist/fields/DateField/DateField.d.ts.map +0 -1
- package/dist/fields/DateField/DatePicker.d.ts.map +0 -1
- package/dist/fields/DateTimeField/DateTimeField.d.ts.map +0 -1
- package/dist/fields/EmailField/EmailField.d.ts.map +0 -1
- package/dist/fields/NumberField/NumberField.d.ts.map +0 -1
- package/dist/fields/PasswordField/PasswordField.d.ts.map +0 -1
- package/dist/fields/PhoneField/PhoneField.d.ts.map +0 -1
- package/dist/fields/RadioField/RadioField.d.ts.map +0 -1
- package/dist/fields/SelectField/SelectField.d.ts.map +0 -1
- package/dist/fields/SliderField/SliderField.d.ts.map +0 -1
- package/dist/fields/SwitchField/SwitchField.d.ts.map +0 -1
- package/dist/fields/TextField/TextField.d.ts.map +0 -1
- package/dist/fields/TextareaField/TextareaField.d.ts.map +0 -1
- package/dist/fields/TimeField/TimeField.d.ts.map +0 -1
- package/dist/fields/TimeField/TimePicker.d.ts.map +0 -1
- package/dist/fields/defaultComponentMap.d.ts.map +0 -1
- package/dist/fields/defaultPlaceholders.d.ts.map +0 -1
- package/dist/fields/fieldUtils.d.ts.map +0 -1
- package/dist/fields/iconUtils.d.ts.map +0 -1
- package/dist/fields/icons.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/layout/Box/Box.d.ts.map +0 -1
- package/dist/layout/Divider/Divider.d.ts.map +0 -1
- package/dist/layout/Grid/Grid.d.ts.map +0 -1
- package/dist/layout/Spacer/Spacer.d.ts.map +0 -1
- package/dist/layout/Stack/Stack.d.ts.map +0 -1
- package/dist/layout/index.d.ts.map +0 -1
- package/dist/react/AxenArrayField.d.ts.map +0 -1
- package/dist/react/AxenField.d.ts.map +0 -1
- package/dist/react/AxenForm.d.ts.map +0 -1
- package/dist/react/FormContext.d.ts.map +0 -1
- package/dist/react/useAxenForm.d.ts.map +0 -1
- package/dist/react/useField.d.ts.map +0 -1
- package/dist/react/useFieldArray.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
|
@@ -10,14 +10,36 @@
|
|
|
10
10
|
═══════════════════════════════════════════════ */
|
|
11
11
|
|
|
12
12
|
/* ── Field Wrapper ───────────────────────────── */
|
|
13
|
-
.
|
|
13
|
+
:where(._wrapper_18hu4_8),
|
|
14
|
+
:where(._wrapper_18hu4_8) *,
|
|
15
|
+
:where(._wrapper_18hu4_8) *::before,
|
|
16
|
+
:where(._wrapper_18hu4_8) *::after {
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:where(._wrapper_18hu4_8) {
|
|
21
|
+
color-scheme: light;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:where(._wrapper_18hu4_8) input,
|
|
25
|
+
:where(._wrapper_18hu4_8) textarea,
|
|
26
|
+
:where(._wrapper_18hu4_8) select,
|
|
27
|
+
:where(._wrapper_18hu4_8) button {
|
|
28
|
+
font-family: inherit;
|
|
29
|
+
font-size: inherit;
|
|
30
|
+
line-height: inherit;
|
|
31
|
+
color: inherit;
|
|
32
|
+
margin: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
._wrapper_18hu4_8 {
|
|
14
36
|
display: flex;
|
|
15
37
|
flex-direction: column;
|
|
16
38
|
width: 100%;
|
|
17
39
|
}
|
|
18
40
|
|
|
19
41
|
/* ── Label ───────────────────────────────────── */
|
|
20
|
-
.
|
|
42
|
+
._label_18hu4_37 {
|
|
21
43
|
display: block;
|
|
22
44
|
font-size: var(--axen-font-size-sm, 0.875rem);
|
|
23
45
|
font-weight: var(--axen-font-weight-medium, 500);
|
|
@@ -27,14 +49,14 @@
|
|
|
27
49
|
letter-spacing: 0.01em;
|
|
28
50
|
}
|
|
29
51
|
|
|
30
|
-
.
|
|
52
|
+
._labelRequired_18hu4_47::after {
|
|
31
53
|
content: ' *';
|
|
32
54
|
color: var(--axen-color-error, #d32f2f);
|
|
33
55
|
font-weight: var(--axen-font-weight-bold, 600);
|
|
34
56
|
}
|
|
35
57
|
|
|
36
58
|
/* ── Input Base ──────────────────────────────── */
|
|
37
|
-
.
|
|
59
|
+
._input_18hu4_54 {
|
|
38
60
|
display: block;
|
|
39
61
|
width: 100%;
|
|
40
62
|
height: var(--axen-field-height, 2.75rem);
|
|
@@ -62,22 +84,22 @@
|
|
|
62
84
|
outline: none;
|
|
63
85
|
}
|
|
64
86
|
|
|
65
|
-
.
|
|
87
|
+
._input_18hu4_54::placeholder {
|
|
66
88
|
color: var(--axen-color-text-disabled, #9e9e9e);
|
|
67
89
|
}
|
|
68
90
|
|
|
69
|
-
.
|
|
91
|
+
._input_18hu4_54:hover:not(:disabled):not(:read-only) {
|
|
70
92
|
border-color: var(--axen-color-border-hover, #888888);
|
|
71
93
|
}
|
|
72
94
|
|
|
73
95
|
/* Focus ring (keyboard + mouse) */
|
|
74
|
-
.
|
|
96
|
+
._input_18hu4_54:focus {
|
|
75
97
|
border-color: var(--axen-color-border-focus, var(--axen-color-primary, #1976d2));
|
|
76
98
|
box-shadow: var(--axen-shadow-focus, 0 0 0 2px rgba(25, 118, 210, 0.5));
|
|
77
99
|
outline: none;
|
|
78
100
|
}
|
|
79
101
|
|
|
80
|
-
.
|
|
102
|
+
._input_18hu4_54:disabled {
|
|
81
103
|
background-color: var(--axen-color-bg-disabled, #f5f5f5);
|
|
82
104
|
color: var(--axen-color-text-disabled, #9e9e9e);
|
|
83
105
|
cursor: not-allowed;
|
|
@@ -86,35 +108,35 @@
|
|
|
86
108
|
/* Scope :read-only to actual text inputs only.
|
|
87
109
|
<select> and <div> match :read-only by default in modern browsers,
|
|
88
110
|
which would incorrectly apply the disabled-looking background. */
|
|
89
|
-
input.
|
|
90
|
-
textarea.
|
|
111
|
+
input._input_18hu4_54:read-only,
|
|
112
|
+
textarea._input_18hu4_54:read-only {
|
|
91
113
|
background-color: var(--axen-color-bg-disabled, #f5f5f5);
|
|
92
114
|
}
|
|
93
115
|
|
|
94
116
|
/* Hide native browser picker icons for date/time/datetime inputs.
|
|
95
117
|
We provide our own custom pickers via DatePicker / TimePicker components,
|
|
96
118
|
so the native chromium dark-themed popups must not appear. */
|
|
97
|
-
.
|
|
119
|
+
._input_18hu4_54::-webkit-calendar-picker-indicator {
|
|
98
120
|
display: none;
|
|
99
121
|
-webkit-appearance: none;
|
|
100
122
|
}
|
|
101
123
|
|
|
102
|
-
.
|
|
124
|
+
._input_18hu4_54::-webkit-date-and-time-value {
|
|
103
125
|
text-align: left;
|
|
104
126
|
}
|
|
105
127
|
|
|
106
128
|
/* ── Error State ─────────────────────────────── */
|
|
107
|
-
.
|
|
129
|
+
._inputError_18hu4_124 {
|
|
108
130
|
border-color: var(--axen-color-error, #d32f2f);
|
|
109
131
|
}
|
|
110
132
|
|
|
111
|
-
.
|
|
133
|
+
._inputError_18hu4_124:focus {
|
|
112
134
|
border-color: var(--axen-color-error, #d32f2f);
|
|
113
135
|
box-shadow: 0 0 0 var(--axen-focus-ring-width, 2px) rgba(211, 47, 47, 0.3);
|
|
114
136
|
}
|
|
115
137
|
|
|
116
138
|
/* ── Helper Text ─────────────────────────────── */
|
|
117
|
-
.
|
|
139
|
+
._helperText_18hu4_134 {
|
|
118
140
|
display: block;
|
|
119
141
|
font-size: var(--axen-font-size-xs, 0.75rem);
|
|
120
142
|
color: var(--axen-color-text-secondary, #666666);
|
|
@@ -122,12 +144,12 @@ textarea._input_1sk2v_32:read-only {
|
|
|
122
144
|
line-height: var(--axen-line-height, 1.5);
|
|
123
145
|
}
|
|
124
146
|
|
|
125
|
-
.
|
|
147
|
+
._helperTextError_18hu4_142 {
|
|
126
148
|
color: var(--axen-color-error, #d32f2f);
|
|
127
149
|
}
|
|
128
150
|
|
|
129
151
|
/* ── Textarea ────────────────────────────────── */
|
|
130
|
-
.
|
|
152
|
+
._textarea_18hu4_147 {
|
|
131
153
|
height: auto;
|
|
132
154
|
min-height: calc(var(--axen-field-min-height, 44px) * 2);
|
|
133
155
|
resize: vertical;
|
|
@@ -135,7 +157,7 @@ textarea._input_1sk2v_32:read-only {
|
|
|
135
157
|
}
|
|
136
158
|
|
|
137
159
|
/* ── Select ──────────────────────────────────── */
|
|
138
|
-
.
|
|
160
|
+
._select_18hu4_155 {
|
|
139
161
|
appearance: none;
|
|
140
162
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
|
|
141
163
|
background-repeat: no-repeat;
|
|
@@ -144,11 +166,11 @@ textarea._input_1sk2v_32:read-only {
|
|
|
144
166
|
cursor: pointer;
|
|
145
167
|
}
|
|
146
168
|
|
|
147
|
-
.
|
|
169
|
+
._selectPlaceholder_18hu4_164 {
|
|
148
170
|
color: var(--axen-color-text-disabled, #9e9e9e);
|
|
149
171
|
}
|
|
150
172
|
|
|
151
|
-
.
|
|
173
|
+
._inputPlaceholder_18hu4_168 {
|
|
152
174
|
color: var(--axen-color-text-disabled, #9e9e9e);
|
|
153
175
|
}
|
|
154
176
|
|
|
@@ -156,17 +178,17 @@ textarea._input_1sk2v_32:read-only {
|
|
|
156
178
|
See tokens.css for color-scheme: light declaration. */
|
|
157
179
|
|
|
158
180
|
/* ── Input with prefix/suffix ────────────────── */
|
|
159
|
-
.
|
|
181
|
+
._inputGroup_18hu4_176 {
|
|
160
182
|
display: flex;
|
|
161
183
|
align-items: stretch;
|
|
162
184
|
}
|
|
163
185
|
|
|
164
186
|
/* ── Icon inside input ───────────────────────── */
|
|
165
|
-
.
|
|
187
|
+
._inputIconWrapper_18hu4_182 {
|
|
166
188
|
position: relative;
|
|
167
189
|
}
|
|
168
190
|
|
|
169
|
-
.
|
|
191
|
+
._fieldIcon_18hu4_186 {
|
|
170
192
|
position: absolute;
|
|
171
193
|
left: 0.75rem;
|
|
172
194
|
top: 50%;
|
|
@@ -182,7 +204,7 @@ textarea._input_1sk2v_32:read-only {
|
|
|
182
204
|
}
|
|
183
205
|
|
|
184
206
|
/* Clickable variant for icons that open pickers */
|
|
185
|
-
.
|
|
207
|
+
._fieldIconClickable_18hu4_202 {
|
|
186
208
|
position: absolute;
|
|
187
209
|
left: 0.75rem;
|
|
188
210
|
top: 50%;
|
|
@@ -201,18 +223,18 @@ textarea._input_1sk2v_32:read-only {
|
|
|
201
223
|
margin: 0;
|
|
202
224
|
}
|
|
203
225
|
|
|
204
|
-
.
|
|
226
|
+
._fieldIconClickable_18hu4_202:hover {
|
|
205
227
|
color: var(--axen-color-primary, #1976d2);
|
|
206
228
|
}
|
|
207
229
|
|
|
208
|
-
.
|
|
230
|
+
._fieldIconClickable_18hu4_202:focus-visible {
|
|
209
231
|
outline: var(--axen-focus-ring-width, 2px) solid var(--axen-focus-ring-color);
|
|
210
232
|
outline-offset: 2px;
|
|
211
233
|
border-radius: var(--axen-border-radius-sm, 4px);
|
|
212
234
|
}
|
|
213
235
|
|
|
214
236
|
/* Right-side picker trigger button inside inputIconWrapper */
|
|
215
|
-
.
|
|
237
|
+
._pickerTrigger_18hu4_232 {
|
|
216
238
|
position: absolute;
|
|
217
239
|
right: 0.5rem;
|
|
218
240
|
top: 50%;
|
|
@@ -231,27 +253,27 @@ textarea._input_1sk2v_32:read-only {
|
|
|
231
253
|
z-index: 1;
|
|
232
254
|
}
|
|
233
255
|
|
|
234
|
-
.
|
|
256
|
+
._pickerTrigger_18hu4_232:hover {
|
|
235
257
|
color: var(--axen-color-primary, #1976d2);
|
|
236
258
|
background-color: var(--axen-color-bg-hover, #fafafa);
|
|
237
259
|
}
|
|
238
260
|
|
|
239
|
-
.
|
|
261
|
+
._pickerTrigger_18hu4_232:focus-visible {
|
|
240
262
|
outline: var(--axen-focus-ring-width, 2px) solid var(--axen-focus-ring-color);
|
|
241
263
|
outline-offset: 2px;
|
|
242
264
|
}
|
|
243
265
|
|
|
244
266
|
/* Input with right-side picker trigger needs extra right padding */
|
|
245
|
-
.
|
|
267
|
+
._inputWithPicker_18hu4_262 {
|
|
246
268
|
padding-right: 2.25rem;
|
|
247
269
|
}
|
|
248
270
|
|
|
249
|
-
.
|
|
271
|
+
._inputWithIcon_18hu4_266 {
|
|
250
272
|
padding-left: 2.5rem;
|
|
251
273
|
}
|
|
252
274
|
|
|
253
|
-
.
|
|
254
|
-
.
|
|
275
|
+
._inputPrefix_18hu4_270,
|
|
276
|
+
._inputSuffix_18hu4_271 {
|
|
255
277
|
display: flex;
|
|
256
278
|
align-items: center;
|
|
257
279
|
padding: 0 var(--axen-space-sm, 0.5rem);
|
|
@@ -262,32 +284,32 @@ textarea._input_1sk2v_32:read-only {
|
|
|
262
284
|
white-space: nowrap;
|
|
263
285
|
}
|
|
264
286
|
|
|
265
|
-
.
|
|
287
|
+
._inputPrefix_18hu4_270 {
|
|
266
288
|
border-right: none;
|
|
267
289
|
border-radius: var(--axen-border-radius, 6px) 0 0 var(--axen-border-radius, 6px);
|
|
268
290
|
}
|
|
269
291
|
|
|
270
|
-
.
|
|
292
|
+
._inputSuffix_18hu4_271 {
|
|
271
293
|
border-left: none;
|
|
272
294
|
border-radius: 0 var(--axen-border-radius, 6px) var(--axen-border-radius, 6px) 0;
|
|
273
295
|
}
|
|
274
296
|
|
|
275
|
-
.
|
|
297
|
+
._inputGroupInput_18hu4_292 {
|
|
276
298
|
border-radius: 0;
|
|
277
299
|
}
|
|
278
300
|
|
|
279
|
-
.
|
|
301
|
+
._inputPrefix_18hu4_270 + ._inputGroupInput_18hu4_292 {
|
|
280
302
|
border-top-left-radius: 0;
|
|
281
303
|
border-bottom-left-radius: 0;
|
|
282
304
|
}
|
|
283
305
|
|
|
284
|
-
.
|
|
306
|
+
._inputGroupInput_18hu4_292:has(+ ._inputSuffix_18hu4_271) {
|
|
285
307
|
border-top-right-radius: 0;
|
|
286
308
|
border-bottom-right-radius: 0;
|
|
287
309
|
}
|
|
288
310
|
|
|
289
311
|
/* ── Checkbox/Radio/Switch shared ────────────── */
|
|
290
|
-
.
|
|
312
|
+
._inlineWrapper_18hu4_307 {
|
|
291
313
|
display: flex;
|
|
292
314
|
align-items: center;
|
|
293
315
|
gap: var(--axen-space-sm, 0.5rem);
|
|
@@ -295,12 +317,12 @@ textarea._input_1sk2v_32:read-only {
|
|
|
295
317
|
cursor: pointer;
|
|
296
318
|
}
|
|
297
319
|
|
|
298
|
-
.
|
|
320
|
+
._inlineWrapper_18hu4_307:has(:disabled) {
|
|
299
321
|
cursor: not-allowed;
|
|
300
322
|
opacity: 0.6;
|
|
301
323
|
}
|
|
302
324
|
|
|
303
|
-
.
|
|
325
|
+
._inlineLabel_18hu4_320 {
|
|
304
326
|
font-size: var(--axen-font-size-md, 1rem);
|
|
305
327
|
color: var(--axen-color-text, #1a1a1a);
|
|
306
328
|
user-select: none;
|
|
@@ -308,34 +330,34 @@ textarea._input_1sk2v_32:read-only {
|
|
|
308
330
|
|
|
309
331
|
/* ── Responsive: mobile touch targets ────────── */
|
|
310
332
|
@media (max-width: 599px) {
|
|
311
|
-
.
|
|
333
|
+
._input_18hu4_54 {
|
|
312
334
|
font-size: 16px; /* Prevent iOS zoom on focus */
|
|
313
335
|
min-height: 48px;
|
|
314
336
|
}
|
|
315
337
|
|
|
316
|
-
.
|
|
338
|
+
._inlineWrapper_18hu4_307 {
|
|
317
339
|
min-height: 48px;
|
|
318
340
|
}
|
|
319
341
|
}
|
|
320
342
|
|
|
321
343
|
/* ── High Contrast Mode ──────────────────────── */
|
|
322
344
|
@media (prefers-contrast: more) {
|
|
323
|
-
.
|
|
345
|
+
._input_18hu4_54 {
|
|
324
346
|
border-width: 2px;
|
|
325
347
|
}
|
|
326
348
|
|
|
327
|
-
.
|
|
349
|
+
._inputError_18hu4_124 {
|
|
328
350
|
border-width: 3px;
|
|
329
351
|
}
|
|
330
352
|
|
|
331
|
-
.
|
|
353
|
+
._helperTextError_18hu4_142 {
|
|
332
354
|
font-weight: var(--axen-font-weight-bold, 600);
|
|
333
355
|
}
|
|
334
356
|
}
|
|
335
357
|
|
|
336
358
|
/* ── Reduced Motion (A11y: WCAG 2.3.3) ──────── */
|
|
337
359
|
@media (prefers-reduced-motion: reduce) {
|
|
338
|
-
.
|
|
360
|
+
._input_18hu4_54 {
|
|
339
361
|
transition: none;
|
|
340
362
|
}
|
|
341
363
|
}`));
|
|
@@ -345,29 +367,29 @@ textarea._input_1sk2v_32:read-only {
|
|
|
345
367
|
console.error("vite-plugin-css-injected-by-js", e);
|
|
346
368
|
}
|
|
347
369
|
})();
|
|
348
|
-
const wrapper = "
|
|
349
|
-
const label = "
|
|
350
|
-
const labelRequired = "
|
|
351
|
-
const input = "
|
|
352
|
-
const inputError = "
|
|
353
|
-
const helperText = "
|
|
354
|
-
const helperTextError = "
|
|
355
|
-
const textarea = "
|
|
356
|
-
const select = "
|
|
357
|
-
const selectPlaceholder = "
|
|
358
|
-
const inputPlaceholder = "
|
|
359
|
-
const inputGroup = "
|
|
360
|
-
const inputIconWrapper = "
|
|
361
|
-
const fieldIcon = "
|
|
362
|
-
const fieldIconClickable = "
|
|
363
|
-
const pickerTrigger = "
|
|
364
|
-
const inputWithPicker = "
|
|
365
|
-
const inputWithIcon = "
|
|
366
|
-
const inputPrefix = "
|
|
367
|
-
const inputSuffix = "
|
|
368
|
-
const inputGroupInput = "
|
|
369
|
-
const inlineWrapper = "
|
|
370
|
-
const inlineLabel = "
|
|
370
|
+
const wrapper = "_wrapper_18hu4_8";
|
|
371
|
+
const label = "_label_18hu4_37";
|
|
372
|
+
const labelRequired = "_labelRequired_18hu4_47";
|
|
373
|
+
const input = "_input_18hu4_54";
|
|
374
|
+
const inputError = "_inputError_18hu4_124";
|
|
375
|
+
const helperText = "_helperText_18hu4_134";
|
|
376
|
+
const helperTextError = "_helperTextError_18hu4_142";
|
|
377
|
+
const textarea = "_textarea_18hu4_147";
|
|
378
|
+
const select = "_select_18hu4_155";
|
|
379
|
+
const selectPlaceholder = "_selectPlaceholder_18hu4_164";
|
|
380
|
+
const inputPlaceholder = "_inputPlaceholder_18hu4_168";
|
|
381
|
+
const inputGroup = "_inputGroup_18hu4_176";
|
|
382
|
+
const inputIconWrapper = "_inputIconWrapper_18hu4_182";
|
|
383
|
+
const fieldIcon = "_fieldIcon_18hu4_186";
|
|
384
|
+
const fieldIconClickable = "_fieldIconClickable_18hu4_202";
|
|
385
|
+
const pickerTrigger = "_pickerTrigger_18hu4_232";
|
|
386
|
+
const inputWithPicker = "_inputWithPicker_18hu4_262";
|
|
387
|
+
const inputWithIcon = "_inputWithIcon_18hu4_266";
|
|
388
|
+
const inputPrefix = "_inputPrefix_18hu4_270";
|
|
389
|
+
const inputSuffix = "_inputSuffix_18hu4_271";
|
|
390
|
+
const inputGroupInput = "_inputGroupInput_18hu4_292";
|
|
391
|
+
const inlineWrapper = "_inlineWrapper_18hu4_307";
|
|
392
|
+
const inlineLabel = "_inlineLabel_18hu4_320";
|
|
371
393
|
const styles = {
|
|
372
394
|
wrapper,
|
|
373
395
|
label,
|
package/dist/fields/icons.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BuiltInFieldType } from '../types';
|
|
3
3
|
/** Calendar icon */
|
|
4
|
-
export declare const CalendarIcon: import("react
|
|
4
|
+
export declare const CalendarIcon: import("react").JSX.Element;
|
|
5
5
|
/** Clock icon */
|
|
6
|
-
export declare const ClockIcon: import("react
|
|
6
|
+
export declare const ClockIcon: import("react").JSX.Element;
|
|
7
7
|
/** Link / URL icon */
|
|
8
|
-
export declare const LinkIcon: import("react
|
|
8
|
+
export declare const LinkIcon: import("react").JSX.Element;
|
|
9
9
|
export declare const defaultIcons: Partial<Record<BuiltInFieldType, ReactNode>>;
|
|
10
|
-
//# sourceMappingURL=icons.d.ts.map
|
package/dist/index.cjs
CHANGED
|
@@ -5,20 +5,21 @@
|
|
|
5
5
|
var elementStyle = document.createElement("style");
|
|
6
6
|
elementStyle.appendChild(document.createTextNode(`/* ═══════════════════════════════════════════════
|
|
7
7
|
axen-form CSS Reset
|
|
8
|
-
|
|
8
|
+
Reset only inside an Axen form or an explicit data-axen-theme wrapper
|
|
9
9
|
═══════════════════════════════════════════════ */
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*::
|
|
11
|
+
:where([data-axen-theme]),
|
|
12
|
+
:where([data-axen-theme]) *,
|
|
13
|
+
:where([data-axen-theme]) *::before,
|
|
14
|
+
:where([data-axen-theme]) *::after {
|
|
14
15
|
box-sizing: border-box;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
/* Reset form element defaults */
|
|
18
|
-
input,
|
|
19
|
-
textarea,
|
|
20
|
-
select,
|
|
21
|
-
button {
|
|
19
|
+
:where([data-axen-theme]) input,
|
|
20
|
+
:where([data-axen-theme]) textarea,
|
|
21
|
+
:where([data-axen-theme]) select,
|
|
22
|
+
:where([data-axen-theme]) button {
|
|
22
23
|
font-family: inherit;
|
|
23
24
|
font-size: inherit;
|
|
24
25
|
line-height: inherit;
|
|
@@ -27,46 +28,46 @@ button {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
/* Remove default styling from number inputs */
|
|
30
|
-
input[type='number']::-webkit-inner-spin-button,
|
|
31
|
-
input[type='number']::-webkit-outer-spin-button {
|
|
31
|
+
:where([data-axen-theme]) input[type='number']::-webkit-inner-spin-button,
|
|
32
|
+
:where([data-axen-theme]) input[type='number']::-webkit-outer-spin-button {
|
|
32
33
|
-webkit-appearance: none;
|
|
33
34
|
margin: 0;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
input[type='number'] {
|
|
37
|
+
:where([data-axen-theme]) input[type='number'] {
|
|
37
38
|
-moz-appearance: textfield;
|
|
38
39
|
appearance: textfield;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/* Remove default date/time input icons if using custom components */
|
|
42
|
-
input[type='date']::-webkit-calendar-picker-indicator,
|
|
43
|
-
input[type='time']::-webkit-calendar-picker-indicator,
|
|
44
|
-
input[type='datetime-local']::-webkit-calendar-picker-indicator {
|
|
43
|
+
:where([data-axen-theme]) input[type='date']::-webkit-calendar-picker-indicator,
|
|
44
|
+
:where([data-axen-theme]) input[type='time']::-webkit-calendar-picker-indicator,
|
|
45
|
+
:where([data-axen-theme]) input[type='datetime-local']::-webkit-calendar-picker-indicator {
|
|
45
46
|
cursor: pointer;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
/* Ensure fieldset/legend reset */
|
|
49
|
-
fieldset {
|
|
50
|
+
:where([data-axen-theme]) fieldset {
|
|
50
51
|
border: none;
|
|
51
52
|
padding: 0;
|
|
52
53
|
margin: 0;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
legend {
|
|
56
|
+
:where([data-axen-theme]) legend {
|
|
56
57
|
padding: 0;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
/* Remove textarea resize handle (can be overridden) */
|
|
60
|
-
textarea {
|
|
61
|
+
:where([data-axen-theme]) textarea {
|
|
61
62
|
resize: vertical;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
/* Focus visible only — keyboard navigation (A11y) */
|
|
65
|
-
:focus:not(:focus-visible) {
|
|
66
|
+
:where([data-axen-theme]) :focus:not(:focus-visible) {
|
|
66
67
|
outline: none;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
:focus-visible {
|
|
70
|
+
:where([data-axen-theme]) :focus-visible {
|
|
70
71
|
outline: var(--axen-focus-ring-width, 2px) solid
|
|
71
72
|
var(--axen-focus-ring-color, rgba(25, 118, 210, 0.5));
|
|
72
73
|
outline-offset: var(--axen-focus-ring-offset, 2px);
|
|
@@ -108,9 +109,6 @@ textarea {
|
|
|
108
109
|
═══════════════════════════════════════════════ */
|
|
109
110
|
|
|
110
111
|
:root {
|
|
111
|
-
/* Force light rendering for all native form controls (select, date, etc.) */
|
|
112
|
-
color-scheme: light;
|
|
113
|
-
|
|
114
112
|
/* ── Color Palette ─────────────────────────── */
|
|
115
113
|
--axen-color-primary: #1976d2;
|
|
116
114
|
--axen-color-primary-hover: #1565c0;
|
|
@@ -189,6 +187,11 @@ textarea {
|
|
|
189
187
|
--axen-z-tooltip: 200;
|
|
190
188
|
}
|
|
191
189
|
|
|
190
|
+
:where([data-axen-theme]) {
|
|
191
|
+
/* Keep native Axen controls light without changing the host document. */
|
|
192
|
+
color-scheme: light;
|
|
193
|
+
}
|
|
194
|
+
|
|
192
195
|
/* ── Dark Mode ───────────────────────────────
|
|
193
196
|
Removed: axen-form ships as light-only by default.
|
|
194
197
|
Form elements are locked to color-scheme: light above.
|
|
@@ -233,10 +236,12 @@ const numberUtils = require("./core/numberUtils.cjs");
|
|
|
233
236
|
const pathUtils = require("./core/pathUtils.cjs");
|
|
234
237
|
const payloadUtils = require("./core/payloadUtils.cjs");
|
|
235
238
|
const validation = require("./core/validation.cjs");
|
|
239
|
+
const semanticValidation = require("./core/semanticValidation.cjs");
|
|
236
240
|
const FormContext = require("./react/FormContext.cjs");
|
|
237
241
|
const useAxenForm = require("./react/useAxenForm.cjs");
|
|
238
242
|
const useField = require("./react/useField.cjs");
|
|
239
243
|
const useFieldArray = require("./react/useFieldArray.cjs");
|
|
244
|
+
const useFormState = require("./react/useFormState.cjs");
|
|
240
245
|
const AxenArrayField = require("./react/AxenArrayField.cjs");
|
|
241
246
|
const AxenField = require("./react/AxenField.cjs");
|
|
242
247
|
const AxenForm = require("./react/AxenForm.cjs");
|
|
@@ -293,11 +298,15 @@ exports.getStrippedFields = payloadUtils.getStrippedFields;
|
|
|
293
298
|
exports.mapPayload = payloadUtils.mapPayload;
|
|
294
299
|
exports.pickFields = payloadUtils.pickFields;
|
|
295
300
|
exports.simpleValidator = validation.simpleValidator;
|
|
301
|
+
exports.validateSemanticValue = semanticValidation.validateSemanticValue;
|
|
302
|
+
exports.withValidationPolicy = semanticValidation.withValidationPolicy;
|
|
296
303
|
exports.FormContext = FormContext.FormContext;
|
|
297
304
|
exports.useFormContext = FormContext.useFormContext;
|
|
298
305
|
exports.useAxenForm = useAxenForm.useAxenForm;
|
|
299
306
|
exports.useField = useField.useField;
|
|
300
307
|
exports.useFieldArray = useFieldArray.useFieldArray;
|
|
308
|
+
exports.useFormState = useFormState.useFormState;
|
|
309
|
+
exports.useWatch = useFormState.useWatch;
|
|
301
310
|
exports.AxenArrayField = AxenArrayField.AxenArrayField;
|
|
302
311
|
exports.AxenField = AxenField.AxenField;
|
|
303
312
|
exports.AxenForm = AxenForm.AxenForm;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ArrayFieldConfig, ArrayHelpers, AutocompleteOption, AxenFormProps, AxenFormRef, BoxProps, Breakpoint, BuiltInFieldType, DividerProps, FieldComponentProps, FieldConfig, FieldGroupConfig, FieldOption, FieldTypeComponentMap, FormApi, FormConfig, GridProps, GridSize, PayloadConfig, SpacerProps, StackProps, ValidationAdapter, } from './types';
|
|
1
|
+
export type { ArrayFieldConfig, ArrayHelpers, AutocompleteOption, AxenFormProps, AxenFormRef, BoxProps, Breakpoint, BuiltInFieldType, DividerProps, FieldComponentProps, FieldConfig, FieldGroupConfig, FieldOption, FieldTypeComponentMap, FormApi, FormConfig, GridProps, GridSize, PayloadConfig, SpacerProps, StackProps, ValidationAdapter, ValidationPolicy, ValidationRules, } from './types';
|
|
2
2
|
export { isFieldGroup } from './types';
|
|
3
3
|
export { formatDateLocale, formatDateTimeLocale, formatTimeLocale, getDefaultLocale, toISODateString, toISODateTimeLocalString, toISOTimeString, } from './core/dateUtils';
|
|
4
4
|
export { createFormStore } from './core/formStore';
|
|
@@ -6,11 +6,13 @@ export { calculateCursorPosition, formatNumber, getDecimalSeparator, getGroupSep
|
|
|
6
6
|
export { get, pathToString, set, toPathArray } from './core/pathUtils';
|
|
7
7
|
export { getStrippedFields, mapPayload, pickFields } from './core/payloadUtils';
|
|
8
8
|
export { simpleValidator } from './core/validation';
|
|
9
|
+
export { withValidationPolicy, validateSemanticValue } from './core/semanticValidation';
|
|
9
10
|
export { FormContext, useFormContext } from './react/FormContext';
|
|
10
11
|
export type { FormContextValue } from './react/FormContext';
|
|
11
12
|
export { useAxenForm } from './react/useAxenForm';
|
|
12
13
|
export { useField } from './react/useField';
|
|
13
14
|
export { useFieldArray } from './react/useFieldArray';
|
|
15
|
+
export { useFormState, useWatch } from './react/useFormState';
|
|
14
16
|
export { AxenArrayField } from './react/AxenArrayField';
|
|
15
17
|
export { AxenField } from './react/AxenField';
|
|
16
18
|
export { AxenForm } from './react/AxenForm';
|
|
@@ -45,4 +47,3 @@ export { defaultPlaceholders } from './fields/defaultPlaceholders';
|
|
|
45
47
|
export { ariaProps, cx, helperId, labelId } from './fields/fieldUtils';
|
|
46
48
|
export { defaultIcons } from './fields/icons';
|
|
47
49
|
export { resolveFieldIcon } from './fields/iconUtils';
|
|
48
|
-
//# sourceMappingURL=index.d.ts.map
|