@page-speed/forms 0.8.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @page-speed/forms
|
|
2
|
+
|
|
3
|
+
## Type-safe, high-performance React form state and input components. Utilized by the [OpenSite Semantic UI](https://opensite.ai) website platform
|
|
2
4
|
|
|
3
5
|

|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
<br />
|
|
6
8
|
|
|
7
|
-
[](https://www.npmjs.com/package/@page-speed/forms)
|
|
10
|
+
[](https://www.npmjs.com/package/@page-speed/forms)
|
|
11
|
+
[](./LICENSE)
|
|
12
|
+
[](./tsconfig.json)
|
|
13
|
+
[](#tree-shaking)
|
|
10
14
|
|
|
11
15
|
## Highlights
|
|
12
16
|
|
|
@@ -26,7 +30,8 @@ pnpm add @page-speed/forms
|
|
|
26
30
|
npm install @page-speed/forms
|
|
27
31
|
```
|
|
28
32
|
|
|
29
|
-
Peer dependencies:
|
|
33
|
+
### Peer dependencies:
|
|
34
|
+
|
|
30
35
|
- `react >= 16.8.0`
|
|
31
36
|
- `react-dom >= 16.8.0`
|
|
32
37
|
|
|
@@ -43,7 +48,7 @@ import {
|
|
|
43
48
|
|
|
44
49
|
const fields: FormFieldConfig[] = [
|
|
45
50
|
{
|
|
46
|
-
name: "
|
|
51
|
+
name: "full_name",
|
|
47
52
|
type: "text",
|
|
48
53
|
label: "Full Name",
|
|
49
54
|
required: true,
|
|
@@ -65,7 +70,7 @@ const fields: FormFieldConfig[] = [
|
|
|
65
70
|
columnSpan: 6,
|
|
66
71
|
},
|
|
67
72
|
{
|
|
68
|
-
name: "
|
|
73
|
+
name: "content",
|
|
69
74
|
type: "textarea",
|
|
70
75
|
label: "Message",
|
|
71
76
|
required: true,
|
|
@@ -205,40 +210,49 @@ function ContactBlock({ formEngineSetup }: { formEngineSetup?: FormEngineSetup }
|
|
|
205
210
|
## Package Entry Points
|
|
206
211
|
|
|
207
212
|
### Main
|
|
213
|
+
|
|
208
214
|
- `@page-speed/forms`
|
|
209
215
|
|
|
210
|
-
Exports:
|
|
216
|
+
#### Exports:
|
|
217
|
+
|
|
211
218
|
- `useForm`, `useField`, `Form`, `Field`, `FormContext`
|
|
212
219
|
- Core form/types interfaces
|
|
213
220
|
|
|
214
221
|
### Integration (Recommended)
|
|
222
|
+
|
|
215
223
|
- `@page-speed/forms/integration`
|
|
216
224
|
|
|
217
|
-
Exports:
|
|
225
|
+
#### Exports:
|
|
226
|
+
|
|
218
227
|
- `FormEngine`, `FormEngineSetup`, `FormEngineProps`
|
|
219
228
|
- `FormFieldConfig`, `FormEngineStyleRules`, `FormEngineLayoutSettings`
|
|
220
229
|
- `DynamicFormField`, `useContactForm`, `useFileUpload`
|
|
221
230
|
|
|
222
231
|
### Inputs
|
|
232
|
+
|
|
223
233
|
- `@page-speed/forms/inputs`
|
|
224
234
|
|
|
225
|
-
Exports:
|
|
235
|
+
#### Exports:
|
|
236
|
+
|
|
226
237
|
- `TextInput`, `TextArea`, `Checkbox`, `CheckboxGroup`, `Radio`
|
|
227
238
|
- `Select`, `MultiSelect`, `DatePicker`, `DateRangePicker`, `TimePicker`
|
|
228
239
|
- `FileInput`
|
|
229
240
|
|
|
230
241
|
### Validation
|
|
242
|
+
|
|
231
243
|
- `@page-speed/forms/validation`
|
|
232
244
|
- `@page-speed/forms/validation/rules`
|
|
233
245
|
- `@page-speed/forms/validation/utils`
|
|
234
246
|
- `@page-speed/forms/validation/valibot`
|
|
235
247
|
|
|
236
248
|
### Upload
|
|
249
|
+
|
|
237
250
|
- `@page-speed/forms/upload`
|
|
238
251
|
|
|
239
252
|
## Input Notes
|
|
240
253
|
|
|
241
254
|
### `TimePicker`
|
|
255
|
+
|
|
242
256
|
`TimePicker` uses a native `input[type="time"]` UX internally.
|
|
243
257
|
|
|
244
258
|
- Accepts controlled values in `HH:mm` (24-hour) or `h:mm AM/PM` (12-hour)
|
|
@@ -246,11 +260,13 @@ Exports:
|
|
|
246
260
|
- Emits `h:mm AM/PM` when `use24Hour` is `false`
|
|
247
261
|
|
|
248
262
|
### `DatePicker` and `DateRangePicker`
|
|
263
|
+
|
|
249
264
|
- Calendar popovers close on outside click
|
|
250
265
|
- Compact month/day layout using tokenized Tailwind classes
|
|
251
266
|
- `DateRangePicker` renders two months and highlights endpoints + in-range dates
|
|
252
267
|
|
|
253
268
|
### `Select` and `MultiSelect`
|
|
269
|
+
|
|
254
270
|
- Close on outside click
|
|
255
271
|
- Search support
|
|
256
272
|
- Option groups
|
|
@@ -289,6 +305,7 @@ See `INPUT_AUTOFILL_RESET_CLASSES` in `src/utils.ts`.
|
|
|
289
305
|
### Token requirements
|
|
290
306
|
|
|
291
307
|
Ensure your app defines semantic tokens used in classes such as:
|
|
308
|
+
|
|
292
309
|
- `background`, `foreground`, `border`, `input`, `ring`
|
|
293
310
|
- `primary`, `primary-foreground`
|
|
294
311
|
- `muted`, `muted-foreground`
|
|
@@ -336,6 +353,7 @@ function CustomForm() {
|
|
|
336
353
|
## Validation Utilities
|
|
337
354
|
|
|
338
355
|
Use built-in rules:
|
|
356
|
+
|
|
339
357
|
- `required`, `email`, `url`, `phone`
|
|
340
358
|
- `minLength`, `maxLength`, `min`, `max`
|
|
341
359
|
- `pattern`, `matches`, `oneOf`
|
|
@@ -343,6 +361,7 @@ Use built-in rules:
|
|
|
343
361
|
- `compose`
|
|
344
362
|
|
|
345
363
|
Use utilities from `/validation/utils`:
|
|
364
|
+
|
|
346
365
|
- `debounce`, `asyncValidator`, `crossFieldValidator`, `when`
|
|
347
366
|
- `setErrorMessages`, `getErrorMessage`, `resetErrorMessages`
|
|
348
367
|
|
|
@@ -351,6 +370,7 @@ Use utilities from `/validation/utils`:
|
|
|
351
370
|
`FileInput` and `FormEngine` support validation, drag/drop, preview, and crop workflows.
|
|
352
371
|
|
|
353
372
|
For full two-phase upload patterns and serializer usage, see:
|
|
373
|
+
|
|
354
374
|
- [`docs/FILE_UPLOADS.md`](./docs/FILE_UPLOADS.md)
|
|
355
375
|
- `@page-speed/forms/integration`
|
|
356
376
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@page-speed/forms",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Ultra-high-performance React form library with field-level reactivity and tree-shakable architecture",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"url": "https://github.com/opensite-ai/page-speed-forms/issues"
|
|
23
23
|
},
|
|
24
24
|
"author": "OpenSite AI (https://opensite.ai)",
|
|
25
|
-
"license": "
|
|
25
|
+
"license": "BSD-3-Clause",
|
|
26
26
|
"type": "module",
|
|
27
27
|
"main": "./dist/index.cjs",
|
|
28
28
|
"module": "./dist/index.js",
|