@datum-cloud/datum-ui 0.5.0 → 0.6.0-alpha.a9a8815
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 +78 -40
- package/dist/adapter-context-rWveHhDd.mjs +25 -0
- package/dist/combobox/index.mjs +2 -0
- package/dist/combobox-cKTFK4uN.mjs +96 -0
- package/dist/components/features/combobox/combobox.d.ts +27 -0
- package/dist/components/features/combobox/combobox.d.ts.map +1 -0
- package/dist/components/features/combobox/index.d.ts +3 -0
- package/dist/components/features/combobox/index.d.ts.map +1 -0
- package/dist/components/features/combobox/types.d.ts +78 -0
- package/dist/components/features/combobox/types.d.ts.map +1 -0
- package/dist/components/features/date-time-picker/date-time-picker.d.ts +9 -0
- package/dist/components/features/date-time-picker/date-time-picker.d.ts.map +1 -0
- package/dist/components/features/date-time-picker/index.d.ts +3 -0
- package/dist/components/features/date-time-picker/index.d.ts.map +1 -0
- package/dist/components/features/date-time-picker/types.d.ts +53 -0
- package/dist/components/features/date-time-picker/types.d.ts.map +1 -0
- package/dist/components/features/date-time-picker/utils/format.d.ts +13 -0
- package/dist/components/features/date-time-picker/utils/format.d.ts.map +1 -0
- package/dist/components/features/date-time-picker/utils/index.d.ts +3 -0
- package/dist/components/features/date-time-picker/utils/index.d.ts.map +1 -0
- package/dist/components/features/date-time-picker/utils/timezone.d.ts +23 -0
- package/dist/components/features/date-time-picker/utils/timezone.d.ts.map +1 -0
- package/dist/components/features/form/adapter-context.d.ts +17 -0
- package/dist/components/features/form/adapter-context.d.ts.map +1 -0
- package/dist/components/features/form/adapter-types.d.ts +120 -0
- package/dist/components/features/form/adapter-types.d.ts.map +1 -0
- package/dist/components/features/form/adapters/conform/conform-adapter.d.ts +9 -0
- package/dist/components/features/form/adapters/conform/conform-adapter.d.ts.map +1 -0
- package/dist/components/features/form/adapters/conform/conform-provider.d.ts +22 -0
- package/dist/components/features/form/adapters/conform/conform-provider.d.ts.map +1 -0
- package/dist/components/features/form/adapters/conform/index.d.ts +3 -0
- package/dist/components/features/form/adapters/conform/index.d.ts.map +1 -0
- package/dist/components/features/form/adapters/rhf/index.d.ts +3 -0
- package/dist/components/features/form/adapters/rhf/index.d.ts.map +1 -0
- package/dist/components/features/form/adapters/rhf/rhf-adapter.d.ts +10 -0
- package/dist/components/features/form/adapters/rhf/rhf-adapter.d.ts.map +1 -0
- package/dist/components/features/form/adapters/rhf/rhf-provider.d.ts +22 -0
- package/dist/components/features/form/adapters/rhf/rhf-provider.d.ts.map +1 -0
- package/dist/components/features/form/components/form-autocomplete.d.ts.map +1 -1
- package/dist/components/features/form/components/form-autosearch.d.ts +25 -0
- package/dist/components/features/form/components/form-autosearch.d.ts.map +1 -0
- package/dist/components/features/form/components/form-checkbox.d.ts.map +1 -1
- package/dist/components/features/form/components/form-combobox.d.ts +76 -0
- package/dist/components/features/form/components/form-combobox.d.ts.map +1 -0
- package/dist/components/features/form/components/form-copy-box.d.ts.map +1 -1
- package/dist/components/features/form/components/form-custom.d.ts.map +1 -1
- package/dist/components/features/form/components/form-date-picker.d.ts +38 -0
- package/dist/components/features/form/components/form-date-picker.d.ts.map +1 -0
- package/dist/components/features/form/components/form-date-time-picker.d.ts +37 -0
- package/dist/components/features/form/components/form-date-time-picker.d.ts.map +1 -0
- package/dist/components/features/form/components/form-field-array.d.ts +5 -17
- package/dist/components/features/form/components/form-field-array.d.ts.map +1 -1
- package/dist/components/features/form/components/form-field.d.ts +7 -21
- package/dist/components/features/form/components/form-field.d.ts.map +1 -1
- package/dist/components/features/form/components/form-input-group.d.ts +4 -4
- package/dist/components/features/form/components/form-input-group.d.ts.map +1 -1
- package/dist/components/features/form/components/form-input.d.ts.map +1 -1
- package/dist/components/features/form/components/form-radio-group.d.ts.map +1 -1
- package/dist/components/features/form/components/form-root.d.ts +5 -25
- package/dist/components/features/form/components/form-root.d.ts.map +1 -1
- package/dist/components/features/form/components/form-select.d.ts.map +1 -1
- package/dist/components/features/form/components/form-switch.d.ts.map +1 -1
- package/dist/components/features/form/components/form-textarea.d.ts.map +1 -1
- package/dist/components/features/form/components/form-time-picker.d.ts +21 -0
- package/dist/components/features/form/components/form-time-picker.d.ts.map +1 -0
- package/dist/components/features/form/components/form-transfer.d.ts +37 -0
- package/dist/components/features/form/components/form-transfer.d.ts.map +1 -0
- package/dist/components/features/form/components/index.d.ts +6 -1
- package/dist/components/features/form/components/index.d.ts.map +1 -1
- package/dist/components/features/form/components/stepper/form-stepper.d.ts.map +1 -1
- package/dist/components/features/form/context/form-context.d.ts +2 -2
- package/dist/components/features/form/context/form-context.d.ts.map +1 -1
- package/dist/components/features/form/hooks/index.d.ts +1 -1
- package/dist/components/features/form/hooks/index.d.ts.map +1 -1
- package/dist/components/features/form/hooks/use-field.d.ts +12 -18
- package/dist/components/features/form/hooks/use-field.d.ts.map +1 -1
- package/dist/components/features/form/hooks/use-form-state.d.ts +36 -0
- package/dist/components/features/form/hooks/use-form-state.d.ts.map +1 -0
- package/dist/components/features/form/hooks/use-watch.d.ts +9 -20
- package/dist/components/features/form/hooks/use-watch.d.ts.map +1 -1
- package/dist/components/features/form/index.d.ts +69 -44
- package/dist/components/features/form/index.d.ts.map +1 -1
- package/dist/components/features/form/stepper/index.d.ts +17 -0
- package/dist/components/features/form/stepper/index.d.ts.map +1 -0
- package/dist/components/features/form/types/index.d.ts +68 -32
- package/dist/components/features/form/types/index.d.ts.map +1 -1
- package/dist/components/features/form/utils/get-field-constraints.d.ts +43 -0
- package/dist/components/features/form/utils/get-field-constraints.d.ts.map +1 -0
- package/dist/components/features/form/utils/get-schema-defaults.d.ts +24 -0
- package/dist/components/features/form/utils/get-schema-defaults.d.ts.map +1 -0
- package/dist/components/features/time-picker/index.d.ts +3 -0
- package/dist/components/features/time-picker/index.d.ts.map +1 -0
- package/dist/components/features/time-picker/time-picker.d.ts +22 -0
- package/dist/components/features/time-picker/time-picker.d.ts.map +1 -0
- package/dist/components/features/time-picker/types.d.ts +31 -0
- package/dist/components/features/time-picker/types.d.ts.map +1 -0
- package/dist/components/features/transfer/components/index.d.ts +9 -0
- package/dist/components/features/transfer/components/index.d.ts.map +1 -0
- package/dist/components/features/transfer/components/transfer-group.d.ts +7 -0
- package/dist/components/features/transfer/components/transfer-group.d.ts.map +1 -0
- package/dist/components/features/transfer/components/transfer-item.d.ts +10 -0
- package/dist/components/features/transfer/components/transfer-item.d.ts.map +1 -0
- package/dist/components/features/transfer/components/transfer-panel.d.ts +18 -0
- package/dist/components/features/transfer/components/transfer-panel.d.ts.map +1 -0
- package/dist/components/features/transfer/components/transfer-search.d.ts +9 -0
- package/dist/components/features/transfer/components/transfer-search.d.ts.map +1 -0
- package/dist/components/features/transfer/hooks/use-transfer-dnd.d.ts +26 -0
- package/dist/components/features/transfer/hooks/use-transfer-dnd.d.ts.map +1 -0
- package/dist/components/features/transfer/hooks/use-transfer-state.d.ts +20 -0
- package/dist/components/features/transfer/hooks/use-transfer-state.d.ts.map +1 -0
- package/dist/components/features/transfer/index.d.ts +3 -0
- package/dist/components/features/transfer/index.d.ts.map +1 -0
- package/dist/components/features/transfer/transfer.d.ts +6 -0
- package/dist/components/features/transfer/transfer.d.ts.map +1 -0
- package/dist/components/features/transfer/types.d.ts +69 -0
- package/dist/components/features/transfer/types.d.ts.map +1 -0
- package/dist/date-picker/index.mjs +1 -1
- package/dist/date-time-picker/index.mjs +2 -0
- package/dist/date-time-picker-Bx_n4nEJ.mjs +177 -0
- package/dist/form/adapters/conform/index.mjs +326 -0
- package/dist/form/adapters/rhf/index.mjs +275 -0
- package/dist/form/index.mjs +3 -2
- package/dist/form/stepper/index.mjs +542 -0
- package/dist/form-context-Ccxm-wqL.mjs +17 -0
- package/dist/form-zf5QOnAk.mjs +1611 -0
- package/dist/get-field-constraints-CxfZ753o.mjs +49 -0
- package/dist/grid/index.mjs +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/index.mjs +14 -13
- package/dist/input-number/index.mjs +1 -1
- package/dist/map/index.mjs +1 -1
- package/dist/{map-ClxB41Hg.mjs → map-CWIQ-eql.mjs} +1 -1
- package/dist/more-actions/index.mjs +1 -1
- package/dist/page-title/index.mjs +1 -1
- package/dist/stepper/index.mjs +1 -320
- package/dist/stepper-DvIOp0hh.mjs +321 -0
- package/dist/tag-input/index.mjs +1 -1
- package/dist/task-queue/index.mjs +1 -1
- package/dist/time-picker/index.mjs +2 -0
- package/dist/time-picker-BoF7pZZ2.mjs +43 -0
- package/dist/transfer/index.mjs +2 -0
- package/dist/transfer-C55XfEXy.mjs +243 -0
- package/package.json +58 -2
- package/dist/form-Co3fM4B7.mjs +0 -2114
- /package/dist/{col-q-J99UHe.mjs → col-1T0Q3SlH.mjs} +0 -0
- /package/dist/{hooks-Cb7YlxN4.mjs → hooks-D8r2M2U6.mjs} +0 -0
- /package/dist/{input-number-mDB-5M5C.mjs → input-number-a7uydAsw.mjs} +0 -0
- /package/dist/{map-leaflet-imports-CaMm_rdF.mjs → map-leaflet-imports-CRSKA79m.mjs} +0 -0
- /package/dist/{more-actions-CGagbIDT.mjs → more-actions-ILnEZq_E.mjs} +0 -0
- /package/dist/{page-title-R7QbfbWp.mjs → page-title-ChsnpBiH.mjs} +0 -0
- /package/dist/{tag-input-BVSwNcRd.mjs → tag-input-T9cUX9-G.mjs} +0 -0
- /package/dist/{task-queue-dropdown-DyM5R8KF.mjs → task-queue-dropdown-Wcbj-f0V.mjs} +0 -0
- /package/dist/{to-api-format-BnbRFYQI.mjs → to-api-format-Bh3c01gr.mjs} +0 -0
- /package/dist/{use-copy-to-clipboard-BGdTmkFV.mjs → use-copy-to-clipboard-uNeeVHC4.mjs} +0 -0
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
2
|
import type { FormRootProps } from '../types';
|
|
3
3
|
/**
|
|
4
|
-
* Form.Root -
|
|
5
|
-
*
|
|
6
|
-
* Provides form context to all children with built-in:
|
|
7
|
-
* - Zod schema validation
|
|
8
|
-
* - Conform integration
|
|
9
|
-
* - Optional telemetry callbacks
|
|
10
|
-
*
|
|
11
|
-
* Supports two patterns:
|
|
12
|
-
* 1. ReactNode children - for standard forms
|
|
13
|
-
* 2. Render function - for forms needing access to form state
|
|
4
|
+
* Form.Root - Root form container that integrates with the active adapter.
|
|
14
5
|
*
|
|
15
6
|
* @example Standard usage
|
|
16
7
|
* ```tsx
|
|
17
|
-
* <Form.Root schema={
|
|
18
|
-
* <Form.Field name="email" label="Email"
|
|
8
|
+
* <Form.Root schema={schema} onSubmit={handleSubmit}>
|
|
9
|
+
* <Form.Field name="email" label="Email">
|
|
19
10
|
* <Form.Input type="email" />
|
|
20
11
|
* </Form.Field>
|
|
21
12
|
* <Form.Submit>Save</Form.Submit>
|
|
@@ -24,20 +15,9 @@ import type { FormRootProps } from '../types';
|
|
|
24
15
|
*
|
|
25
16
|
* @example Render function for form state access
|
|
26
17
|
* ```tsx
|
|
27
|
-
* <Form.Root schema={
|
|
18
|
+
* <Form.Root schema={schema}>
|
|
28
19
|
* {({ form, fields, isSubmitting }) => (
|
|
29
|
-
*
|
|
30
|
-
* <Form.Field name="email" label="Email" required>
|
|
31
|
-
* <Form.Input type="email" />
|
|
32
|
-
* </Form.Field>
|
|
33
|
-
* <Button
|
|
34
|
-
* disabled={isSubmitting}
|
|
35
|
-
* onClick={() => form.update({ value: { email: '' } })}
|
|
36
|
-
* >
|
|
37
|
-
* Cancel
|
|
38
|
-
* </Button>
|
|
39
|
-
* <Form.Submit>Save</Form.Submit>
|
|
40
|
-
* </>
|
|
20
|
+
* <Form.Field name="email"><Form.Input /></Form.Field>
|
|
41
21
|
* )}
|
|
42
22
|
* </Form.Root>
|
|
43
23
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-root.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/form-root.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"form-root.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/form-root.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,UAAU,CAAA;AAMlE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,EAC5C,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAe,EACf,aAAa,EAAE,QAAiB,EAChC,EAAE,EACF,IAAI,EACJ,aAAa,EACb,IAAe,EACf,YAAY,EAAE,oBAAoB,EAClC,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,GACV,EAAE,aAAa,CAAC,CAAC,CAAC,2CAoHlB;yBApIe,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-select.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/form-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"form-select.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/form-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAYpE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,eAAe,2CA2BzF;yBA3Be,UAAU;;;AA+B1B;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CAMhF;yBANe,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-switch.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/form-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"form-switch.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/form-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAO/C;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,2CA+BzE;yBA/Be,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-textarea.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/form-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"form-textarea.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/form-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAA;CAAE,2CAqBvJ;yBArBe,YAAY"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TimePickerProps } from '../../time-picker/types';
|
|
2
|
+
/**
|
|
3
|
+
* Form.TimePicker - Simple time input component for forms
|
|
4
|
+
*
|
|
5
|
+
* Automatically wired to the parent Form.Field context.
|
|
6
|
+
* Value format: "HH:mm" (e.g., "14:30")
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <Form.Field name="time" label="Time">
|
|
11
|
+
* <Form.TimePicker />
|
|
12
|
+
* </Form.Field>
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export interface FormTimePickerProps extends Omit<TimePickerProps, 'value' | 'onChange' | 'id' | 'aria-invalid' | 'aria-describedby'> {
|
|
16
|
+
}
|
|
17
|
+
export declare function FormTimePicker({ min, max, step, placeholder, disabled, className, }: FormTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare namespace FormTimePicker {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=form-time-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-time-picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/form-time-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAM9D;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,GAAG,cAAc,GAAG,kBAAkB,CAAC;CAEpI;AAED,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,GAAG,EACH,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,SAAS,GACV,EAAE,mBAAmB,2CA+BrB;yBAtCe,cAAc"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { TransferProps } from '../../transfer/types';
|
|
2
|
+
export interface FormTransferProps<T> extends Omit<TransferProps<T>, 'value' | 'onChange'> {
|
|
3
|
+
/**
|
|
4
|
+
* Minimum number of items that must be selected (for display purposes).
|
|
5
|
+
* Extracted automatically from schema but can be overridden.
|
|
6
|
+
*/
|
|
7
|
+
minItems?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Maximum number of items that can be selected (for display purposes).
|
|
10
|
+
* Extracted automatically from schema but can be overridden.
|
|
11
|
+
*/
|
|
12
|
+
maxItems?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Form.Transfer - Transfer list component for selecting multiple items
|
|
16
|
+
*
|
|
17
|
+
* Automatically wired to the parent Form.Field context.
|
|
18
|
+
* Displays minItems/maxItems constraints when provided.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <Form.Field name="teams" label="Select Teams">
|
|
23
|
+
* <Form.Transfer
|
|
24
|
+
* items={teams}
|
|
25
|
+
* itemKey="id"
|
|
26
|
+
* itemLabel="name"
|
|
27
|
+
* minItems={2}
|
|
28
|
+
* maxItems={5}
|
|
29
|
+
* />
|
|
30
|
+
* </Form.Field>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function FormTransfer<T>({ disabled, minItems, maxItems, ...props }: FormTransferProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare namespace FormTransfer {
|
|
35
|
+
var displayName: string;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=form-transfer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-transfer.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/form-transfer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAKzD,MAAM,WAAW,iBAAiB,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACxF;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CA6B/F;yBA7Be,YAAY"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export { FormAutocomplete } from './form-autocomplete';
|
|
2
|
+
export { FormAutosearch } from './form-autosearch';
|
|
2
3
|
export { FormButton } from './form-button';
|
|
3
4
|
export { FormCheckbox } from './form-checkbox';
|
|
5
|
+
export { FormCombobox } from './form-combobox';
|
|
4
6
|
export { FormCopyBox } from './form-copy-box';
|
|
5
7
|
export { FormCustom } from './form-custom';
|
|
8
|
+
export { FormDatePicker } from './form-date-picker';
|
|
9
|
+
export { FormDateTimePicker } from './form-date-time-picker';
|
|
6
10
|
export { FormDescription } from './form-description';
|
|
7
11
|
export { FormDialog } from './form-dialog';
|
|
8
12
|
export { FormError } from './form-error';
|
|
@@ -15,6 +19,7 @@ export { FormSelect, FormSelectItem } from './form-select';
|
|
|
15
19
|
export { FormSubmit } from './form-submit';
|
|
16
20
|
export { FormSwitch } from './form-switch';
|
|
17
21
|
export { FormTextarea } from './form-textarea';
|
|
22
|
+
export { FormTimePicker } from './form-time-picker';
|
|
23
|
+
export { FormTransfer } from './form-transfer';
|
|
18
24
|
export { FormWhen } from './form-when';
|
|
19
|
-
export { FormStep, FormStepper, StepperControls, StepperNavigation } from './stepper';
|
|
20
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-stepper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/features/form/components/stepper/form-stepper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAA0B,UAAU,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"form-stepper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/features/form/components/stepper/form-stepper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAA0B,UAAU,EAAE,MAAM,aAAa,CAAA;AACvF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,UAAU,uBAAuB;IAC/B,8BAA8B;IAC9B,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,0BAA0B;IAC1B,OAAO,EAAE,UAAU,CAAA;IACnB,yBAAyB;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,sBAAsB;IACtB,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,gCAAgC;IAChC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB,mCAAmC;IACnC,MAAM,EAAE,OAAO,CAAA;IACf,uCAAuC;IACvC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;IACpE,sCAAsC;IACtC,cAAc,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7C,uBAAuB;IACvB,KAAK,EAAE;QACL,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAA;KACjC,CAAA;CACF;AAQD,wBAAgB,qBAAqB,IAAI,uBAAuB,CAM/D;AAwED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,aAAa,EACb,EAAE,EACF,aAAa,GACd,EAAE,gBAAgB,GAAG;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAClC,2CAqCA;yBAnDe,WAAW"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NormalizedFieldMeta } from '../adapter-types';
|
|
2
2
|
import type { FormContextValue } from '../types';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const FormContext: React.Context<FormContextValue<Record<string, unknown>> | null>;
|
|
@@ -11,7 +11,7 @@ export declare function useFormContext<T extends Record<string, unknown> = Recor
|
|
|
11
11
|
/**
|
|
12
12
|
* Get a specific field from the form context
|
|
13
13
|
*/
|
|
14
|
-
export declare function useFormField(name: string):
|
|
14
|
+
export declare function useFormField(name: string): NormalizedFieldMeta | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Check if the form is currently submitting
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/context/form-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"form-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/context/form-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,QAAA,MAAM,WAAW,iEAAqD,CAAA;AAEtE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,EAAE,gBAAgB,CAAA;CACxB;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,iBAAiB,2CAElE;AAED,wBAAgB,cAAc,CAC5B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACxD,gBAAgB,CAAC,CAAC,CAAC,CAQvB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAG1E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAG3C;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { useField } from './use-field';
|
|
2
2
|
export { useFieldContext } from './use-field-context';
|
|
3
3
|
export { useFormContext } from './use-form-context';
|
|
4
|
-
export {
|
|
4
|
+
export { useFormState } from './use-form-state';
|
|
5
5
|
export { useWatch, useWatchAll } from './use-watch';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
import type { UseFieldReturn } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* Hook to access and control a specific field
|
|
4
|
-
*
|
|
3
|
+
* Hook to access and control a specific field.
|
|
4
|
+
* Delegates to the active adapter's useField implementation.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```tsx
|
|
8
8
|
* function MyCustomInput({ name }: { name: string }) {
|
|
9
|
-
* const { field, control, meta, errors } = useField(name)
|
|
10
|
-
*
|
|
9
|
+
* const { field, control, meta, errors } = useField(name)
|
|
11
10
|
* return (
|
|
12
|
-
* <
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* {errors?.map((error) => (
|
|
22
|
-
* <span key={error} className="text-red-500">{error}</span>
|
|
23
|
-
* ))}
|
|
24
|
-
* </div>
|
|
25
|
-
* );
|
|
11
|
+
* <input
|
|
12
|
+
* name={meta.name}
|
|
13
|
+
* id={meta.id}
|
|
14
|
+
* value={control.value ?? ''}
|
|
15
|
+
* onChange={(e) => control.change(e.target.value)}
|
|
16
|
+
* onBlur={control.blur}
|
|
17
|
+
* aria-invalid={!!errors?.length}
|
|
18
|
+
* />
|
|
19
|
+
* )
|
|
26
20
|
* }
|
|
27
21
|
* ```
|
|
28
22
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-field.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/hooks/use-field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"use-field.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/hooks/use-field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAqBrD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to access form-level state (dirty, valid, submitted, etc.)
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* function SaveButton() {
|
|
7
|
+
* const { isDirty, isSubmitting, isValid } = useFormState()
|
|
8
|
+
*
|
|
9
|
+
* return (
|
|
10
|
+
* <button
|
|
11
|
+
* type="submit"
|
|
12
|
+
* disabled={!isDirty || isSubmitting || !isValid}
|
|
13
|
+
* >
|
|
14
|
+
* Save Changes
|
|
15
|
+
* </button>
|
|
16
|
+
* )
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function useFormState(): {
|
|
21
|
+
/** Whether any field value differs from its default value */
|
|
22
|
+
isDirty: boolean;
|
|
23
|
+
/** Whether the form currently passes validation */
|
|
24
|
+
isValid: boolean;
|
|
25
|
+
/** Whether the form is currently submitting */
|
|
26
|
+
isSubmitting: boolean;
|
|
27
|
+
/** Whether the form has been submitted at least once */
|
|
28
|
+
isSubmitted: boolean;
|
|
29
|
+
/** Number of times the form has been submitted */
|
|
30
|
+
submitCount: number;
|
|
31
|
+
/** Record of which fields have been modified from defaults */
|
|
32
|
+
dirtyFields: Record<string, boolean>;
|
|
33
|
+
/** Record of which fields have been focused and blurred */
|
|
34
|
+
touchedFields: Record<string, boolean>;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=use-form-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-form-state.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/hooks/use-form-state.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY;IAIxB,6DAA6D;;IAE7D,mDAAmD;;IAEnD,+CAA+C;;IAE/C,wDAAwD;;IAExD,kDAAkD;;IAElD,8DAA8D;;IAE9D,2DAA2D;;EAG9D"}
|
|
@@ -1,39 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hook to watch a field's value
|
|
3
|
-
*
|
|
2
|
+
* Hook to watch a field's value reactively.
|
|
3
|
+
* Delegates to the active adapter's useWatch implementation.
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* ```tsx
|
|
7
7
|
* function ConditionalField() {
|
|
8
|
-
* const contactMethod = useWatch('contactMethod')
|
|
9
|
-
*
|
|
8
|
+
* const contactMethod = useWatch('contactMethod')
|
|
10
9
|
* if (contactMethod === 'email') {
|
|
11
|
-
* return <Form.Field name="email"><Form.Input type="email" /></Form.Field
|
|
12
|
-
* }
|
|
13
|
-
*
|
|
14
|
-
* if (contactMethod === 'phone') {
|
|
15
|
-
* return <Form.Field name="phone"><Form.Input type="tel" /></Form.Field>;
|
|
10
|
+
* return <Form.Field name="email"><Form.Input type="email" /></Form.Field>
|
|
16
11
|
* }
|
|
17
|
-
*
|
|
18
|
-
* return null;
|
|
12
|
+
* return null
|
|
19
13
|
* }
|
|
20
14
|
* ```
|
|
21
15
|
*/
|
|
22
16
|
export declare function useWatch<T = unknown>(name: string): T | undefined;
|
|
23
17
|
/**
|
|
24
|
-
* Hook to watch multiple fields at once
|
|
18
|
+
* Hook to watch multiple fields at once.
|
|
19
|
+
* Delegates to the active adapter's useWatchAll implementation.
|
|
25
20
|
*
|
|
26
21
|
* @example
|
|
27
22
|
* ```tsx
|
|
28
23
|
* function Summary() {
|
|
29
|
-
* const values = useWatchAll(['firstName', 'lastName', 'email'])
|
|
30
|
-
*
|
|
31
|
-
* return (
|
|
32
|
-
* <div>
|
|
33
|
-
* Name: {values.firstName} {values.lastName}
|
|
34
|
-
* Email: {values.email}
|
|
35
|
-
* </div>
|
|
36
|
-
* );
|
|
24
|
+
* const values = useWatchAll(['firstName', 'lastName', 'email'])
|
|
25
|
+
* return <div>Name: {values.firstName} {values.lastName}</div>
|
|
37
26
|
* }
|
|
38
27
|
* ```
|
|
39
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-watch.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/hooks/use-watch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-watch.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/hooks/use-watch.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAGjE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAG1F"}
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Datum Form Library
|
|
3
3
|
*
|
|
4
|
-
* A compound component pattern form library
|
|
5
|
-
*
|
|
4
|
+
* A compound component pattern form library with pluggable adapter support.
|
|
5
|
+
* Choose between Conform.js or React Hook Form as your form backend,
|
|
6
|
+
* with Zod for schema validation.
|
|
7
|
+
*
|
|
8
|
+
* ## Adapter Setup
|
|
9
|
+
*
|
|
10
|
+
* Wrap your app with an adapter provider:
|
|
11
|
+
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Conform adapter
|
|
14
|
+
* import { ConformAdapter } from '@datum-cloud/datum-ui/form/adapters/conform'
|
|
15
|
+
* <ConformAdapter><App /></ConformAdapter>
|
|
16
|
+
*
|
|
17
|
+
* // React Hook Form adapter
|
|
18
|
+
* import { RHFAdapter } from '@datum-cloud/datum-ui/form/adapters/rhf'
|
|
19
|
+
* <RHFAdapter><App /></RHFAdapter>
|
|
20
|
+
* ```
|
|
6
21
|
*
|
|
7
22
|
* @example Basic Usage
|
|
8
23
|
* ```tsx
|
|
9
|
-
* import { Form } from '
|
|
24
|
+
* import { Form } from '@datum-cloud/datum-ui/form';
|
|
10
25
|
* import { z } from 'zod';
|
|
11
26
|
*
|
|
12
27
|
* const userSchema = z.object({
|
|
@@ -29,19 +44,34 @@
|
|
|
29
44
|
* }
|
|
30
45
|
* ```
|
|
31
46
|
*
|
|
32
|
-
* @example Multi-Step Form
|
|
47
|
+
* @example Multi-Step Form (separate import)
|
|
33
48
|
* ```tsx
|
|
49
|
+
* import { FormStepper, FormStep, StepperNavigation, StepperControls } from '@datum-cloud/datum-ui/form/stepper';
|
|
50
|
+
*
|
|
34
51
|
* const steps = [
|
|
35
52
|
* { id: 'account', label: 'Account', schema: accountSchema },
|
|
36
53
|
* { id: 'profile', label: 'Profile', schema: profileSchema },
|
|
37
54
|
* ];
|
|
38
55
|
*
|
|
39
|
-
* <
|
|
40
|
-
* <
|
|
41
|
-
* <
|
|
42
|
-
* <
|
|
43
|
-
* <
|
|
44
|
-
* </
|
|
56
|
+
* <FormStepper steps={steps} onComplete={handleComplete}>
|
|
57
|
+
* <StepperNavigation />
|
|
58
|
+
* <FormStep id="account">...</FormStep>
|
|
59
|
+
* <FormStep id="profile">...</FormStep>
|
|
60
|
+
* <StepperControls />
|
|
61
|
+
* </FormStepper>
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example Form State
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <Form.Root schema={schema} onSubmit={handleSubmit}>
|
|
67
|
+
* {({ isDirty, isValid, isSubmitted, submitCount }) => (
|
|
68
|
+
* <>
|
|
69
|
+
* <Form.Field name="name"><Form.Input /></Form.Field>
|
|
70
|
+
* <Form.Submit disabled={!isDirty || !isValid}>Save</Form.Submit>
|
|
71
|
+
* {isSubmitted && <p>Submitted {submitCount} time(s)</p>}
|
|
72
|
+
* </>
|
|
73
|
+
* )}
|
|
74
|
+
* </Form.Root>
|
|
45
75
|
* ```
|
|
46
76
|
*
|
|
47
77
|
* @example Conditional Fields
|
|
@@ -58,42 +88,33 @@
|
|
|
58
88
|
* </Form.When>
|
|
59
89
|
* ```
|
|
60
90
|
*/
|
|
61
|
-
import { FormAutocomplete, FormButton, FormCheckbox, FormCopyBox, FormCustom, FormDescription, FormDialog, FormError, FormField, FormFieldArray, FormInput, FormRadioGroup, FormRadioItem, FormRoot, FormSelect, FormSelectItem,
|
|
91
|
+
import { FormAutocomplete, FormAutosearch, FormButton, FormCheckbox, FormCombobox, FormCopyBox, FormCustom, FormDatePicker, FormDateTimePicker, FormDescription, FormDialog, FormError, FormField, FormFieldArray, FormInput, FormRadioGroup, FormRadioItem, FormRoot, FormSelect, FormSelectItem, FormSubmit, FormSwitch, FormTextarea, FormTimePicker, FormTransfer, FormWhen } from './components';
|
|
62
92
|
import { FormInputGroup } from './components/form-input-group';
|
|
63
|
-
import { useField, useFieldContext, useFormContext,
|
|
93
|
+
import { useField, useFieldContext, useFormContext, useFormState, useWatch, useWatchAll } from './hooks';
|
|
64
94
|
/**
|
|
65
95
|
* Form compound component
|
|
66
96
|
*
|
|
67
|
-
*
|
|
97
|
+
* Requires an adapter provider at the application root:
|
|
98
|
+
* - `<ConformAdapter>` from `@datum-cloud/datum-ui/form/adapters/conform`
|
|
99
|
+
* - `<RHFAdapter>` from `@datum-cloud/datum-ui/form/adapters/rhf`
|
|
100
|
+
*
|
|
101
|
+
* Components:
|
|
68
102
|
* - Form.Root - Main form container
|
|
69
103
|
* - Form.Field - Field wrapper with label and error handling
|
|
70
|
-
* - Form.Input
|
|
71
|
-
* - Form.
|
|
72
|
-
* - Form.Select - Dropdown select
|
|
73
|
-
* - Form.SelectItem - Select option
|
|
74
|
-
* - Form.Checkbox - Checkbox input
|
|
75
|
-
* - Form.Switch - Toggle switch
|
|
76
|
-
* - Form.RadioGroup - Radio button group
|
|
77
|
-
* - Form.RadioItem - Radio button option
|
|
78
|
-
* - Form.Submit - Submit button with loading state
|
|
79
|
-
* - Form.Error - Error display
|
|
80
|
-
* - Form.Description - Helper text
|
|
81
|
-
* - Form.Autocomplete - Searchable select with virtualization
|
|
104
|
+
* - Form.Input, Form.Textarea, Form.Select, Form.Checkbox, Form.Switch, Form.RadioGroup
|
|
105
|
+
* - Form.Autocomplete, Form.CopyBox, Form.InputGroup
|
|
82
106
|
* - Form.When - Conditional rendering
|
|
83
107
|
* - Form.FieldArray - Dynamic array of fields
|
|
84
108
|
* - Form.Custom - Escape hatch for custom implementations
|
|
85
|
-
* - Form.
|
|
86
|
-
* - Form.
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* - Form.
|
|
93
|
-
* - Form.
|
|
94
|
-
* - Form.useWatch - Watch a field's value
|
|
95
|
-
* - Form.useWatchAll - Watch multiple fields
|
|
96
|
-
* - Form.useStepper - Access stepper context
|
|
109
|
+
* - Form.Dialog - Form rendered inside a Dialog
|
|
110
|
+
* - Form.Submit, Form.Button, Form.Error, Form.Description
|
|
111
|
+
*
|
|
112
|
+
* Stepper (separate import):
|
|
113
|
+
* - `@datum-cloud/datum-ui/form/stepper` provides FormStepper, FormStep, StepperNavigation, StepperControls, useStepper
|
|
114
|
+
*
|
|
115
|
+
* Hooks:
|
|
116
|
+
* - Form.useFormContext, Form.useFormState, Form.useFieldContext, Form.useField
|
|
117
|
+
* - Form.useWatch, Form.useWatchAll
|
|
97
118
|
*/
|
|
98
119
|
export declare const Form: {
|
|
99
120
|
readonly Root: typeof FormRoot;
|
|
@@ -112,22 +133,26 @@ export declare const Form: {
|
|
|
112
133
|
readonly RadioItem: typeof FormRadioItem;
|
|
113
134
|
readonly CopyBox: typeof FormCopyBox;
|
|
114
135
|
readonly Autocomplete: typeof FormAutocomplete;
|
|
136
|
+
readonly Autosearch: typeof FormAutosearch;
|
|
137
|
+
readonly Combobox: typeof FormCombobox;
|
|
115
138
|
readonly InputGroup: typeof FormInputGroup;
|
|
139
|
+
readonly DatePicker: typeof FormDatePicker;
|
|
140
|
+
readonly DateTimePicker: typeof FormDateTimePicker;
|
|
141
|
+
readonly TimePicker: typeof FormTimePicker;
|
|
142
|
+
readonly Transfer: typeof FormTransfer;
|
|
116
143
|
readonly When: typeof FormWhen;
|
|
117
144
|
readonly FieldArray: typeof FormFieldArray;
|
|
118
145
|
readonly Custom: typeof FormCustom;
|
|
119
|
-
readonly Stepper: typeof FormStepper;
|
|
120
|
-
readonly Step: typeof FormStep;
|
|
121
|
-
readonly StepperNavigation: typeof StepperNavigation;
|
|
122
|
-
readonly StepperControls: typeof StepperControls;
|
|
123
146
|
readonly Dialog: typeof FormDialog;
|
|
124
147
|
readonly useFormContext: typeof useFormContext;
|
|
148
|
+
readonly useFormState: typeof useFormState;
|
|
125
149
|
readonly useFieldContext: typeof useFieldContext;
|
|
126
150
|
readonly useField: typeof useField;
|
|
127
151
|
readonly useWatch: typeof useWatch;
|
|
128
152
|
readonly useWatchAll: typeof useWatchAll;
|
|
129
|
-
readonly useStepper: typeof useStepper;
|
|
130
153
|
};
|
|
131
|
-
export { FormAutocomplete, FormButton, FormCheckbox, FormCopyBox, FormCustom, FormDescription, FormDialog, FormError, FormField, FormFieldArray, FormInput, FormRadioGroup, FormRadioItem, FormRoot, FormSelect, FormSelectItem,
|
|
132
|
-
export
|
|
154
|
+
export { FormAutocomplete, FormAutosearch, FormButton, FormCheckbox, FormCombobox, FormCopyBox, FormCustom, FormDatePicker, FormDateTimePicker, FormDescription, FormDialog, FormError, FormField, FormFieldArray, FormInput, FormRadioGroup, FormRadioItem, FormRoot, FormSelect, FormSelectItem, FormSubmit, FormSwitch, FormTextarea, FormTimePicker, FormTransfer, FormWhen, useField, useFieldContext, useFormContext, useFormState, useWatch, useWatchAll, };
|
|
155
|
+
export { FormAdapterProvider, useAdapter } from './adapter-context';
|
|
156
|
+
export type { CreateFormProps, FormAdapter, NormalizedFieldArray, NormalizedFieldMeta, NormalizedFieldState, NormalizedFormInstance, NormalizedFormState, } from './adapter-types';
|
|
157
|
+
export type { AutocompleteGroup, AutocompleteOption, AutocompleteProps, FormAutocompleteProps, FormButtonProps, FormCheckboxProps, FormContextValue, FormCopyBoxProps, FormCustomProps, FormCustomRenderProps, FormDescriptionProps, FormDialogProps, FormErrorProps, FormFieldArrayProps, FormFieldArrayRenderProps, FormFieldContextValue, FormFieldProps, FormFieldRenderProps, FormInputProps, FormRadioGroupProps, FormRadioItemProps, FormRootProps, FormRootRenderProps, FormSelectItemProps, FormSelectProps, FormSubmitProps, FormSwitchProps, FormTelemetry, FormTextareaProps, FormWhenProps, UseFieldReturn, UseWatchReturn, } from './types';
|
|
133
158
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/features/form/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/features/form/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,SAAS,EACT,SAAS,EACT,cAAc,EACd,SAAS,EACT,cAAc,EACd,aAAa,EACb,QAAQ,EACR,UAAU,EACV,cAAc,EACd,UAAU,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,EACT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAE9D,OAAO,EACL,QAAQ,EACR,eAAe,EACf,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,WAAW,EACZ,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CP,CAAA;AAGV,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,eAAe,EAGf,UAAU,EACV,SAAS,EACT,SAAS,EACT,cAAc,EAEd,SAAS,EACT,cAAc,EACd,aAAa,EAEb,QAAQ,EACR,UAAU,EACV,cAAc,EACd,UAAU,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,EAEZ,QAAQ,EAER,QAAQ,EACR,eAAe,EAEf,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,WAAW,GACZ,CAAA;AAGD,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnE,YAAY,EACV,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AAGxB,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form Stepper sub-module
|
|
3
|
+
*
|
|
4
|
+
* Provides multi-step form components. This is a separate entry point
|
|
5
|
+
* so `@stepperize/react` is only loaded when stepper components are used.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { Form } from '@datum-cloud/datum-ui/form'
|
|
10
|
+
* // Or import directly:
|
|
11
|
+
* import { FormStepper, FormStep, StepperNavigation, StepperControls } from '@datum-cloud/datum-ui/form/stepper'
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export { FormStep, FormStepper, StepperControls, StepperNavigation, } from '../components/stepper';
|
|
15
|
+
export { useStepper } from '../hooks/use-stepper';
|
|
16
|
+
export type { FormStepperProps, FormStepperRenderProps, FormStepProps, StepConfig, StepperContextValue, StepperControlsProps, StepperNavigationProps, } from '../types';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/form/stepper/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,eAAe,EACf,iBAAiB,GAClB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAGjD,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,UAAU,CAAA"}
|