@gridui/form 3.0.2 → 4.1.0
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 +6 -61
- package/dist/field/field.d.ts +3 -3
- package/dist/field-counter/field-counter.d.ts +14 -0
- package/dist/field-grid/field-grid.d.ts +3 -4
- package/dist/index.d.ts +4 -0
- package/dist/index.js +88 -40
- package/dist/index.js.map +4 -4
- package/dist/shared/field-sizing.d.ts +4 -0
- package/dist/styles.css +23 -23
- package/dist/use-field/use-field.d.ts +30 -0
- package/docs/catalog.json +37 -3
- package/docs/guides/action-form.md +11 -0
- package/docs/guides/fields.md +35 -0
- package/docs/guides/form-state.md +23 -0
- package/docs/guides/search-form.md +14 -0
- package/docs/reference/README.md +11 -0
- package/docs/reference/action-form.md +71 -0
- package/docs/reference/field-counter.md +65 -0
- package/docs/reference/field-grid.md +61 -0
- package/docs/reference/field-note.md +63 -0
- package/docs/reference/field.md +69 -0
- package/docs/reference/fieldset.md +57 -0
- package/docs/reference/list-field-control.md +43 -0
- package/docs/reference/search-form.md +57 -0
- package/package.json +5 -5
package/docs/catalog.json
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/form",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.1.0",
|
|
5
5
|
"category": "core",
|
|
6
6
|
"description": "GridUI React form",
|
|
7
|
-
"usage": "
|
|
7
|
+
"usage": "Read Fields and native controls.",
|
|
8
8
|
"documentation": [
|
|
9
|
-
"README.md"
|
|
9
|
+
"README.md",
|
|
10
|
+
"docs/guides/action-form.md",
|
|
11
|
+
"docs/guides/fields.md",
|
|
12
|
+
"docs/guides/form-state.md",
|
|
13
|
+
"docs/guides/search-form.md",
|
|
14
|
+
"docs/reference/README.md",
|
|
15
|
+
"docs/reference/action-form.md",
|
|
16
|
+
"docs/reference/field-counter.md",
|
|
17
|
+
"docs/reference/field-grid.md",
|
|
18
|
+
"docs/reference/field-note.md",
|
|
19
|
+
"docs/reference/field.md",
|
|
20
|
+
"docs/reference/fieldset.md",
|
|
21
|
+
"docs/reference/list-field-control.md",
|
|
22
|
+
"docs/reference/search-form.md"
|
|
10
23
|
],
|
|
11
24
|
"exports": [
|
|
12
25
|
{
|
|
@@ -29,6 +42,16 @@
|
|
|
29
42
|
"kind": "function",
|
|
30
43
|
"importPath": "@gridui/form"
|
|
31
44
|
},
|
|
45
|
+
{
|
|
46
|
+
"name": "FieldCounter",
|
|
47
|
+
"kind": "component",
|
|
48
|
+
"importPath": "@gridui/form"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "FieldCounterProps",
|
|
52
|
+
"kind": "type",
|
|
53
|
+
"importPath": "@gridui/form"
|
|
54
|
+
},
|
|
32
55
|
{
|
|
33
56
|
"name": "FieldGrid",
|
|
34
57
|
"kind": "component",
|
|
@@ -99,6 +122,16 @@
|
|
|
99
122
|
"kind": "type",
|
|
100
123
|
"importPath": "@gridui/form"
|
|
101
124
|
},
|
|
125
|
+
{
|
|
126
|
+
"name": "useField",
|
|
127
|
+
"kind": "function",
|
|
128
|
+
"importPath": "@gridui/form"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "UseFieldOptions",
|
|
132
|
+
"kind": "type",
|
|
133
|
+
"importPath": "@gridui/form"
|
|
134
|
+
},
|
|
102
135
|
{
|
|
103
136
|
"name": "useFormReset",
|
|
104
137
|
"kind": "function",
|
|
@@ -116,6 +149,7 @@
|
|
|
116
149
|
],
|
|
117
150
|
"examples": [
|
|
118
151
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/stories/action-form.stories.tsx",
|
|
152
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/stories/field-counter.stories.tsx",
|
|
119
153
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/stories/search-form.stories.tsx"
|
|
120
154
|
]
|
|
121
155
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Action forms and asynchronous submission
|
|
2
|
+
|
|
3
|
+
[`useAsyncAction` from `@gridui/button`](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/button/README.md#action-helpers)
|
|
4
|
+
owns pending state and scheduling for caller-owned actions. `ActionForm` from
|
|
5
|
+
`@gridui/form` prevents native form navigation and invokes its declared
|
|
6
|
+
`onAction` unless disabled. Native form
|
|
7
|
+
validation still runs before submission. `onActionError(error)` receives synchronous
|
|
8
|
+
exceptions and promise rejections; without a handler, failures are logged to the
|
|
9
|
+
console. Applications own visible feedback. `Input.onValueChange` exposes text
|
|
10
|
+
values directly; native onChange props remain available for browser-level
|
|
11
|
+
consumers.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Fields and native controls
|
|
2
|
+
|
|
3
|
+
`@gridui/form` owns field presentation, ActionForm, shared form state helpers, and FieldGrid/SearchForm arrangements. Input and Label belong to `@gridui/input`; Select and Combobox belong to `@gridui/select`; FilePicker belongs to `@gridui/file-picker`.
|
|
4
|
+
Inputs preserve native form constraints, refs, labels, descriptions and invalid
|
|
5
|
+
state; controls use 2.75rem standard or 2.25rem small sizing. Select accepts explicit
|
|
6
|
+
options with managed keyboard navigation, focus, and native form integration. `Field`, `Fieldset`, and
|
|
7
|
+
`FieldNote` own field grouping and error presentation. Input Label owns label/icon alignment.
|
|
8
|
+
Fieldset keeps native disabled propagation and legend semantics.
|
|
9
|
+
|
|
10
|
+
`FilePicker` owns the bordered surface, drag state, native input, and optional
|
|
11
|
+
selection button. Callers supply `inputId`, `accept`, labels, hint, icon,
|
|
12
|
+
`disabled`, and `onFile`; `drop` enables drag-and-drop. Omitting `action` retains
|
|
13
|
+
the visible native input. `onFile` may return a promise. FilePicker owns its native input ref and clears
|
|
14
|
+
selection after that callback settles, including errors and cancelled
|
|
15
|
+
replacement. `onFileError(error)` receives synchronous reader exceptions and promise
|
|
16
|
+
rejections after input cleanup. Without a handler, failures are logged to the
|
|
17
|
+
console instead of becoming unhandled promise rejections. This permits repeated selection of the same file without DOM
|
|
18
|
+
access in business controllers. Parsing and exported bytes remain application-owned. Optional
|
|
19
|
+
`confirmSelection` requests native confirmation before replacing a pending file.
|
|
20
|
+
Invalid borders use the danger color token; keyboard focus remains owned by the theme.
|
|
21
|
+
|
|
22
|
+
## Associations and counters
|
|
23
|
+
|
|
24
|
+
`useField({ id, invalid, description, error, "aria-describedby" })` returns
|
|
25
|
+
`controlProps`, `labelProps`, `descriptionProps` and `errorProps`. Supply explicit
|
|
26
|
+
booleans only for help/error elements actually rendered. Error IDs participate
|
|
27
|
+
only while invalid. Existing external description IDs are retained and deduplicated.
|
|
28
|
+
The caller's id wins; otherwise React useId supplies a stable SSR identity.
|
|
29
|
+
Spread each result onto its corresponding control, Label or FieldNote. The hook
|
|
30
|
+
owns no validation, values, submission, touched state or error announcements.
|
|
31
|
+
|
|
32
|
+
`FieldCounter` receives value, optional maxLength and required localized
|
|
33
|
+
`formatCount(count, maxLength)`. It counts UTF-16 code units, matching native
|
|
34
|
+
maxLength, and marks externally supplied over-limit values. It never truncates
|
|
35
|
+
input or announces every keystroke. Connect its id through aria-describedby.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Native form state and reset
|
|
2
|
+
|
|
3
|
+
`useFormReset(elementRef, onReset, form?)` observes cancellable native resets using
|
|
4
|
+
the element's current form owner, including forms mounted later, replacement
|
|
5
|
+
forms, and controls moved between forms. Native controls supply their own form
|
|
6
|
+
association; composite roots use the optional form ID or their closest form.
|
|
7
|
+
The callback runs after native reset and cancellation handlers. Pending callbacks
|
|
8
|
+
are discarded on unmount or reassociation. Value ownership remains with each
|
|
9
|
+
control: selection families can request controlled resets, while ordinary
|
|
10
|
+
controlled inputs leave reset policy to their caller.
|
|
11
|
+
|
|
12
|
+
`focusInvalidControl(event, focus)` cancels the native invalid action for a hidden
|
|
13
|
+
input/select mirror and invokes the visible-control focus callback only when that
|
|
14
|
+
mirror is the form's first participating invalid control. Applications still own
|
|
15
|
+
validation messages and invalid appearance.
|
|
16
|
+
|
|
17
|
+
`ListFieldControl` renders the hidden multiple select shared by MultiSelect and
|
|
18
|
+
TagInput. It forwards `ref`, `name`, `form`, `required`, and `disabled`, accepts
|
|
19
|
+
`value` and caller-owned option children, and routes native changes through
|
|
20
|
+
`onValueChange` and invalid focus through `onInvalidFocus`. Pair it with
|
|
21
|
+
`useListField` for controlled/local values and cancellable reset synchronization.
|
|
22
|
+
Option membership, unavailable values, tag parsing, and visible focus targets
|
|
23
|
+
remain caller-owned. Single-value SelectionForm remains Select-owned.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Form arrangements and search
|
|
2
|
+
|
|
3
|
+
Import `FieldGrid` and `SearchForm` from `@gridui/form`.
|
|
4
|
+
FieldGrid supplies full-width field spans, two columns above 24rem, and one
|
|
5
|
+
column at or below 24rem. SearchForm aligns fields and submit actions.
|
|
6
|
+
Use `<Field grow>` or `<FieldGrid grow>` for a flexible search region; other
|
|
7
|
+
children retain their own sizing. Layout containers do not style arbitrary divs,
|
|
8
|
+
labels, or icons. Use Input's `<Label icon={...}>` for label/icon alignment.
|
|
9
|
+
Migration: add `grow` to former implicitly stretched SearchForm children and
|
|
10
|
+
use Label instead of relying on FieldGrid to restyle native labels.
|
|
11
|
+
Both forward native props and refs. The corresponding Core families own labels, constraints, invalid
|
|
12
|
+
state, field notes, and native fieldset semantics; applications own values,
|
|
13
|
+
validation, and submission actions. These local form arrangements do not own
|
|
14
|
+
page frames or shared region seams.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Generated by pnpm docs:storybook. -->
|
|
2
|
+
# Component reference
|
|
3
|
+
|
|
4
|
+
- [ActionForm](action-form.md)
|
|
5
|
+
- [Field](field.md)
|
|
6
|
+
- [FieldCounter](field-counter.md)
|
|
7
|
+
- [FieldGrid](field-grid.md)
|
|
8
|
+
- [FieldNote](field-note.md)
|
|
9
|
+
- [Fieldset](fieldset.md)
|
|
10
|
+
- [ListFieldControl](list-field-control.md)
|
|
11
|
+
- [SearchForm](search-form.md)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ActionForm
|
|
3
|
+
|
|
4
|
+
Invokes an action after native form validation. Pair it with useAsyncAction for pending state and application-owned save feedback.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/form`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ActionForm } from "@gridui/form";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/form/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/stories/action-form.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLFormElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLFormElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLFormElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onClick
|
|
47
|
+
|
|
48
|
+
``(event: MouseEvent<HTMLFormElement, MouseEvent>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onAction
|
|
53
|
+
|
|
54
|
+
``(): void | Promise<void>`` · Required
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### onActionError
|
|
59
|
+
|
|
60
|
+
``(error: unknown): void`` · Optional
|
|
61
|
+
|
|
62
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
63
|
+
|
|
64
|
+
### disabled
|
|
65
|
+
|
|
66
|
+
``boolean | undefined`` · Optional
|
|
67
|
+
|
|
68
|
+
Default: ``false``
|
|
69
|
+
|
|
70
|
+
Prevents interaction when enabled.
|
|
71
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# FieldCounter
|
|
3
|
+
|
|
4
|
+
Displays a caller-localized count using the same UTF-16 units as native maxLength. Associate it with a field as help text.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/form`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { FieldCounter } from "@gridui/form";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/form/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/stories/field-counter.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### onFocus
|
|
23
|
+
|
|
24
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
25
|
+
|
|
26
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
27
|
+
|
|
28
|
+
### onBlur
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onChange
|
|
35
|
+
|
|
36
|
+
``(event: ChangeEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onSubmit
|
|
41
|
+
|
|
42
|
+
``(event: SubmitEvent<HTMLSpanElement>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onClick
|
|
47
|
+
|
|
48
|
+
``(event: MouseEvent<HTMLSpanElement, MouseEvent>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### value
|
|
53
|
+
|
|
54
|
+
``string`` · Required
|
|
55
|
+
|
|
56
|
+
Controlled value. Pair with the corresponding change callback.
|
|
57
|
+
|
|
58
|
+
### maxLength
|
|
59
|
+
|
|
60
|
+
``number | undefined`` · Optional
|
|
61
|
+
|
|
62
|
+
### formatCount
|
|
63
|
+
|
|
64
|
+
``(count: number, maxLength: number | undefined) => ReactNode`` · Required
|
|
65
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# FieldGrid
|
|
3
|
+
|
|
4
|
+
Public FieldGrid component from @gridui/form. See the package guide for its composition contract.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/form`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { FieldGrid } from "@gridui/form";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/form/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
## API
|
|
17
|
+
|
|
18
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
19
|
+
|
|
20
|
+
### children
|
|
21
|
+
|
|
22
|
+
``ReactNode`` · Optional
|
|
23
|
+
|
|
24
|
+
Content rendered inside the component.
|
|
25
|
+
|
|
26
|
+
### onFocus
|
|
27
|
+
|
|
28
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
29
|
+
|
|
30
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
31
|
+
|
|
32
|
+
### onBlur
|
|
33
|
+
|
|
34
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
35
|
+
|
|
36
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
37
|
+
|
|
38
|
+
### onChange
|
|
39
|
+
|
|
40
|
+
``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
|
|
41
|
+
|
|
42
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
43
|
+
|
|
44
|
+
### onSubmit
|
|
45
|
+
|
|
46
|
+
``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
|
|
47
|
+
|
|
48
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
49
|
+
|
|
50
|
+
### onClick
|
|
51
|
+
|
|
52
|
+
``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
|
|
53
|
+
|
|
54
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
55
|
+
|
|
56
|
+
### grow
|
|
57
|
+
|
|
58
|
+
``boolean | undefined`` · Optional
|
|
59
|
+
|
|
60
|
+
Default: ``false``
|
|
61
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# FieldNote
|
|
3
|
+
|
|
4
|
+
Compose FieldNote with Input inside the same @gridui/form component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/form`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { FieldNote } from "@gridui/form";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/form/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/storybook/scenarios/controls/input.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLSpanElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLSpanElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### invalid
|
|
59
|
+
|
|
60
|
+
``boolean | undefined`` · Optional
|
|
61
|
+
|
|
62
|
+
Default: ``false``
|
|
63
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# Field
|
|
3
|
+
|
|
4
|
+
Compose Field with ActionForm inside the same @gridui/form component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/form`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { Field } from "@gridui/form";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/form/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/stories/action-form.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### grow
|
|
59
|
+
|
|
60
|
+
``boolean | undefined`` · Optional
|
|
61
|
+
|
|
62
|
+
Default: ``false``
|
|
63
|
+
|
|
64
|
+
### span
|
|
65
|
+
|
|
66
|
+
``"auto" | "full" | undefined`` · Optional
|
|
67
|
+
|
|
68
|
+
Default: ``"auto"``
|
|
69
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# Fieldset
|
|
3
|
+
|
|
4
|
+
Compose Fieldset with ActionForm inside the same @gridui/form component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/form`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { Fieldset } from "@gridui/form";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/form/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/stories/action-form.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLFieldSetElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLFieldSetElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLFieldSetElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLFieldSetElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLFieldSetElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# ListFieldControl
|
|
3
|
+
|
|
4
|
+
Public ListFieldControl component from @gridui/form. See the package guide for its composition contract.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/form`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { ListFieldControl } from "@gridui/form";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/form/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
## API
|
|
17
|
+
|
|
18
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
19
|
+
|
|
20
|
+
### children
|
|
21
|
+
|
|
22
|
+
``ReactNode`` · Optional
|
|
23
|
+
|
|
24
|
+
Content rendered inside the component.
|
|
25
|
+
|
|
26
|
+
### value
|
|
27
|
+
|
|
28
|
+
``readonly string[]`` · Required
|
|
29
|
+
|
|
30
|
+
Controlled value. Pair with the corresponding change callback.
|
|
31
|
+
|
|
32
|
+
### onValueChange
|
|
33
|
+
|
|
34
|
+
``(value: string[]): void`` · Optional
|
|
35
|
+
|
|
36
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
37
|
+
|
|
38
|
+
### onInvalidFocus
|
|
39
|
+
|
|
40
|
+
``(): void`` · Required
|
|
41
|
+
|
|
42
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
43
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# SearchForm
|
|
3
|
+
|
|
4
|
+
Combines a search field with submission behavior. Use it when users explicitly submit a query to search a collection.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/form`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { SearchForm } from "@gridui/form";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/form/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/form/stories/search-form.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLFormElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLFormElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLFormElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLFormElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLFormElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|