@canonical/react-ds-global-form 0.45.0 → 0.47.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 CHANGED
@@ -146,12 +146,16 @@ The `Field` component uses `inputType` to select the appropriate input component
146
146
  | `checkbox` | Checkbox | Boolean toggle |
147
147
  | `range` | Range | Slider input |
148
148
  | `select` | Select | Dropdown selection |
149
- | `simple-choices` | SimpleChoices | Radio buttons or checkboxes |
149
+ | `choices`, `rich-choices` | Choices | Radio buttons or checkboxes |
150
150
  | `combobox` | Combobox | Searchable dropdown |
151
151
  | `hidden` | Hidden | Hidden input |
152
152
  | `custom` | Your component | Pass via `CustomComponent` prop |
153
153
 
154
- All fields are wrapped with `withWrapper`, which provides form registration, labels, descriptions, error display, and middleware support.
154
+ Built-in fields provide form binding and field chrome. Custom fields are rendered directly and own their binding and chrome.
155
+
156
+ `FieldProps` is a discriminated union. When migrating from the previously unchecked type, preserve literal `inputType` values with `satisfies FieldProps[]`, provide `options` for selects (use `[]` when middleware supplies them) and a `label` or `controlLabel` for toggles. Extend it with a type intersection rather than `interface extends FieldProps`; use `FieldProps<CustomProps>` for a custom component with additional required props. Custom-field declarations require TypeScript 5.5 or newer: although `NoInfer` was introduced in 5.4, the reserved-prop conditional does not resolve correctly in 5.4.
157
+
158
+ Built-in `Field` variants determine the native input type from `inputType`; do not pass a separate native `type` prop. Custom components may define their own `type` prop.
155
159
 
156
160
  ### Custom Fields
157
161
 
@@ -169,7 +173,7 @@ import { MyColorPicker } from "./MyColorPicker";
169
173
  />
170
174
  ```
171
175
 
172
- Custom components must be wrapped with `withWrapper`. Custom components must satisfy the `InputProps` type and integrate with react-hook-form via `useFormContext`.
176
+ Custom components receive the supplied props except `inputType`, `CustomComponent` and React's `key`. They must implement any needed registration, labels, errors, conditions and middleware themselves; `withWrapper` is internal. JSX checks the custom component's props. For typed maps, use `FieldProps<MyCustomProps>[]`; a map with different custom components needs a union of those types and narrowing before rendering each custom variant. See the Creating Custom Fields guide for an example.
173
177
 
174
178
  ### Standalone Inputs
175
179
 
@@ -200,6 +204,7 @@ Middleware are higher-order components that wrap fields to add functionality. Th
200
204
  name="country"
201
205
  inputType="select"
202
206
  label="Country"
207
+ options={[]}
203
208
  middleware={[addRESTOptions("/api/countries")]}
204
209
  />
205
210
  ```
@@ -216,6 +221,7 @@ import { addRESTOptions } from "@canonical/react-ds-global-form";
216
221
  <Field
217
222
  name="category"
218
223
  inputType="select"
224
+ options={[]}
219
225
  middleware={[
220
226
  addRESTOptions("/api/categories", {
221
227
  transformData: (data) => data.categories,
@@ -18,61 +18,68 @@ import { SwitchField } from "../../component/SwitchField/index.js";
18
18
  import { TextareaField } from "../../component/TextareaField/index.js";
19
19
  import { TextField } from "../../component/TextField/index.js";
20
20
  import { TimeField } from "../../component/TimeField/index.js";
21
+ const withoutRoutingProps = (props) => {
22
+ const { inputType: _, CustomComponent: _component, type: _type, ...rest } = props;
23
+ return rest;
24
+ };
21
25
  /**
22
- * description of the Field component
23
- * @returns {React.ReactElement} - Rendered Field
26
+ * A form field is the unit that pairs a single input with the surrounding meaning a user needs to act on it: a label naming what is being asked, optional descriptive guidance, the input itself, and validation feedback when an entry is rejected. It is the common frame every concrete form control adopts so that labelling, help text, optionality and error reporting behave the same across a form.
27
+ *
28
+ * This router has no single native root; the selected field renders its own root.
24
29
  *
25
30
  * `import { Field } from "@canonical/react-ds-global-form";`
31
+ *
32
+ * @implements ds:global.pattern.field
26
33
  */
27
- const Field = ({ inputType, CustomComponent, ...props }) => {
28
- switch (inputType) {
34
+ const Field = (props) => {
35
+ switch (props.inputType) {
29
36
  case "textarea":
30
- return _jsx(TextareaField, { ...props });
37
+ return _jsx(TextareaField, { ...withoutRoutingProps(props) });
31
38
  case "checkbox":
32
- return _jsx(CheckboxField, { ...props });
39
+ return _jsx(CheckboxField, { ...withoutRoutingProps(props) });
33
40
  case "switch":
34
- return _jsx(SwitchField, { ...props });
41
+ return _jsx(SwitchField, { ...withoutRoutingProps(props) });
35
42
  case "rating":
36
- return _jsx(RatingField, { ...props });
43
+ return _jsx(RatingField, { ...withoutRoutingProps(props) });
37
44
  case "range":
38
- return _jsx(RangeField, { ...props });
45
+ return _jsx(RangeField, { ...withoutRoutingProps(props) });
39
46
  case "select":
40
- return _jsx(SelectField, { ...props });
47
+ return _jsx(SelectField, { ...withoutRoutingProps(props) });
41
48
  case "choices":
42
- return _jsx(ChoicesField, { ...props });
49
+ return _jsx(ChoicesField, { ...withoutRoutingProps(props) });
43
50
  case "combobox":
44
- return _jsx(ComboboxField, { ...props });
51
+ return _jsx(ComboboxField, { ...withoutRoutingProps(props) });
45
52
  case "hidden":
46
- return _jsx(HiddenField, { ...props });
53
+ return _jsx(HiddenField, { ...withoutRoutingProps(props) });
47
54
  case "date":
48
- return _jsx(DateField, { ...props });
55
+ return _jsx(DateField, { ...withoutRoutingProps(props) });
49
56
  case "time":
50
- return _jsx(TimeField, { ...props });
57
+ return _jsx(TimeField, { ...withoutRoutingProps(props) });
51
58
  case "datetime":
52
- return _jsx(DateTimeField, { ...props });
59
+ return _jsx(DateTimeField, { ...withoutRoutingProps(props) });
53
60
  case "file":
54
- return _jsx(FileUploadField, { ...props });
61
+ return _jsx(FileUploadField, { ...withoutRoutingProps(props) });
55
62
  case "color":
56
- return _jsx(ColorField, { ...props });
63
+ return _jsx(ColorField, { ...withoutRoutingProps(props) });
57
64
  case "phone":
58
- return _jsx(PhoneField, { ...props });
65
+ return _jsx(PhoneField, { ...withoutRoutingProps(props) });
59
66
  case "password":
60
- return _jsx(PasswordField, { ...props });
67
+ return _jsx(PasswordField, { ...withoutRoutingProps(props) });
61
68
  case "number":
62
- return _jsx(NumberField, { ...props });
69
+ return _jsx(NumberField, { ...withoutRoutingProps(props) });
63
70
  case "rich-choices":
64
- return _jsx(RichChoicesField, { ...props });
71
+ return _jsx(RichChoicesField, { ...withoutRoutingProps(props) });
65
72
  case "custom":
66
- if (!CustomComponent) {
73
+ if (!props.CustomComponent) {
67
74
  throw new Error('Field with inputType="custom" requires a CustomComponent prop.');
68
75
  }
69
- return _jsx(CustomComponent, { ...props });
76
+ {
77
+ const { inputType: _, CustomComponent, ...customProps } = props;
78
+ return _jsx(CustomComponent, { ...customProps });
79
+ }
70
80
  default:
71
- return _jsx(TextField, { inputType: inputType, ...props });
81
+ return (_jsx(TextField, { ...withoutRoutingProps(props), inputType: props.inputType }));
72
82
  }
73
83
  };
74
- /**
75
- * @implements ds:global.pattern.field
76
- */
77
84
  export default Field;
78
85
  //# sourceMappingURL=Field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../../src/lib/pattern/Field/Field.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,WAAW,E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EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;gBAChE,OAAO,KAAC,eAAe,OAAM,WAA4B,GAAI,CAAC;YAChE,CAAC;QACH;YACE,OAAO,CACL,KAAC,SAAS,OACJ,mBAAmB,CAAC,KAAK,CAAC,EAC9B,SAAS,EAAE,KAAK,CAAC,SAAS,GAC1B,CACH,CAAC;IACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import type { ComponentType, FC } from "react";
2
- import type { BaseInputProps, ToggleLabelProps, WrapperProps } from "../types.js";
2
+ import type { BaseInputProps, ToggleLabelProps, WrappedComponentProps } from "../types.js";
3
3
  /**
4
4
  * Public props of a toggle field: everything the wrapper accepts, but with the
5
5
  * optional `label`/`controlLabel` replaced by the "at least one" union so a
6
6
  * label-less toggle is a compile error.
7
7
  */
8
- type ToggleWrapperProps<ComponentProps extends BaseInputProps> = Omit<WrapperProps<ComponentProps>, "Component" | "label" | "controlLabel"> & ToggleLabelProps;
8
+ type ToggleWrapperProps<ComponentProps extends BaseInputProps> = Omit<WrappedComponentProps<ComponentProps>, "Component" | "label" | "controlLabel"> & ToggleLabelProps;
9
9
  /**
10
10
  * Field HOC for toggle inputs (checkbox, switch). Like `withWrapper`, but bakes
11
11
  * in `ToggleWrapper` (control inline with its label) and types the result to
@@ -1 +1 @@
1
- {"version":3,"file":"withToggleWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withToggleWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACb,MAAM,aAAa,CAAC;AAIrB;;;;GAIG;AACH,KAAK,kBAAkB,CAAC,cAAc,SAAS,cAAc,IAAI,IAAI,CACnE,YAAY,CAAC,cAAc,CAAC,EAC5B,WAAW,GAAG,OAAO,GAAG,cAAc,CACvC,GACC,gBAAgB,CAAC;AAEnB;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,iBAAiB,GAAI,cAAc,SAAS,cAAc,aACnD,aAAa,CAAC,cAAc,CAAC,aAC7B,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,KACrD,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAWvC,CAAC;eAEa,iBAAiB"}
1
+ {"version":3,"file":"withToggleWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withToggleWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAIrB;;;;GAIG;AACH,KAAK,kBAAkB,CAAC,cAAc,SAAS,cAAc,IAAI,IAAI,CACnE,qBAAqB,CAAC,cAAc,CAAC,EACrC,WAAW,GAAG,OAAO,GAAG,cAAc,CACvC,GACC,gBAAgB,CAAC;AAEnB;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,iBAAiB,GAAI,cAAc,SAAS,cAAc,aACnD,aAAa,CAAC,cAAc,CAAC,aAC7B,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,KACrD,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAWvC,CAAC;eAEa,iBAAiB"}
@@ -11,6 +11,6 @@ type CheckboxInputFieldProps = InputProps<CheckboxInputProps>;
11
11
  *
12
12
  * @implements ds:global.component.checkbox_field
13
13
  */
14
- declare const _default: import("react").FC<Omit<import("../../common/types.js").WrapperProps<CheckboxInputFieldProps>, "Component" | "controlLabel" | "label"> & import("../../common/types.js").ToggleLabelProps>;
14
+ declare const _default: import("react").FC<Omit<import("../../common/types.js").WrappedComponentProps<CheckboxInputFieldProps>, "Component" | "controlLabel" | "label"> & import("../../common/types.js").ToggleLabelProps>;
15
15
  export default _default;
16
16
  //# sourceMappingURL=CheckboxField.d.ts.map
@@ -16,6 +16,6 @@ type SwitchInputFieldProps = InputProps<SwitchInputProps>;
16
16
  *
17
17
  * @implements ds:global.component.switch_field
18
18
  */
19
- declare const _default: import("react").FC<Omit<import("../../common/types.js").WrapperProps<SwitchInputFieldProps>, "Component" | "controlLabel" | "label"> & import("../../common/types.js").ToggleLabelProps>;
19
+ declare const _default: import("react").FC<Omit<import("../../common/types.js").WrappedComponentProps<SwitchInputFieldProps>, "Component" | "controlLabel" | "label"> & import("../../common/types.js").ToggleLabelProps>;
20
20
  export default _default;
21
21
  //# sourceMappingURL=SwitchField.d.ts.map
@@ -1,14 +1,18 @@
1
1
  import type React from "react";
2
2
  import type { FieldProps } from "./types.js";
3
3
  /**
4
- * description of the Field component
5
- * @returns {React.ReactElement} - Rendered Field
4
+ * A form field is the unit that pairs a single input with the surrounding meaning a user needs to act on it: a label naming what is being asked, optional descriptive guidance, the input itself, and validation feedback when an entry is rejected. It is the common frame every concrete form control adopts so that labelling, help text, optionality and error reporting behave the same across a form.
5
+ *
6
+ * This router has no single native root; the selected field renders its own root.
6
7
  *
7
8
  * `import { Field } from "@canonical/react-ds-global-form";`
8
- */
9
- declare const Field: ({ inputType, CustomComponent, ...props }: FieldProps) => React.ReactElement;
10
- /**
9
+ *
11
10
  * @implements ds:global.pattern.field
12
11
  */
12
+ declare const Field: <P extends {
13
+ name: string;
14
+ } = {
15
+ name: string;
16
+ }>(props: FieldProps<P>) => React.ReactElement;
13
17
  export default Field;
14
18
  //# sourceMappingURL=Field.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../../src/lib/pattern/Field/Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoB/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;GAKG;AACH,QAAA,MAAM,KAAK,6CAIR,UAAU,KAAG,KAAK,CAAC,YAgDrB,CAAC;AAEF;;GAEG;eACY,KAAK"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../../src/lib/pattern/Field/Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoB/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAqB7C;;;;;;;;GAQG;AACH,QAAA,MAAM,KAAK,GAAI,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,SACnD,UAAU,CAAC,CAAC,CAAC,KACnB,KAAK,CAAC,YAwDR,CAAC;eAEa,KAAK"}
@@ -1,66 +1,90 @@
1
- import type { InputProps } from "../../common/types.js";
2
- import type { CheckboxFieldProps } from "../../component/CheckboxField/index.js";
3
- import type { ChoicesFieldProps } from "../../component/ChoicesField/index.js";
4
- import type { ColorFieldProps } from "../../component/ColorField/index.js";
5
- import type { ComboboxFieldProps } from "../../component/ComboboxField/index.js";
6
- import type { DateFieldProps } from "../../component/DateField/index.js";
7
- import type { DateTimeFieldProps } from "../../component/DateTimeField/index.js";
8
- import type { FileUploadFieldProps } from "../../component/FileUploadField/index.js";
9
- import type { HiddenFieldProps } from "../../component/HiddenField/index.js";
10
- import type { NumberFieldProps } from "../../component/NumberField/index.js";
11
- import type { PasswordFieldProps } from "../../component/PasswordField/index.js";
12
- import type { PhoneFieldProps } from "../../component/PhoneField/index.js";
13
- import type { RangeFieldProps } from "../../component/RangeField/index.js";
14
- import type { RatingFieldProps } from "../../component/RatingField/index.js";
15
- import type { RichChoicesFieldProps } from "../../component/RichChoicesField/index.js";
16
- import type { SelectFieldProps } from "../../component/SelectField/index.js";
17
- import type { SwitchFieldProps } from "../../component/SwitchField/index.js";
18
- import type { TextareaFieldProps } from "../../component/TextareaField/index.js";
19
- import type { TextFieldProps } from "../../component/TextField/index.js";
20
- import type { TimeFieldProps } from "../../component/TimeField/index.js";
1
+ import type { ComponentProps, ComponentType } from "react";
2
+ import type { CheckboxField } from "../../component/CheckboxField/index.js";
3
+ import type { ChoicesField } from "../../component/ChoicesField/index.js";
4
+ import type { ColorField } from "../../component/ColorField/index.js";
5
+ import type { ComboboxField } from "../../component/ComboboxField/index.js";
6
+ import type { DateField } from "../../component/DateField/index.js";
7
+ import type { DateTimeField } from "../../component/DateTimeField/index.js";
8
+ import type { FileUploadField } from "../../component/FileUploadField/index.js";
9
+ import type { HiddenField } from "../../component/HiddenField/index.js";
10
+ import type { NumberField } from "../../component/NumberField/index.js";
11
+ import type { PasswordField } from "../../component/PasswordField/index.js";
12
+ import type { PhoneField } from "../../component/PhoneField/index.js";
13
+ import type { RangeField } from "../../component/RangeField/index.js";
14
+ import type { RatingField } from "../../component/RatingField/index.js";
15
+ import type { RichChoicesField } from "../../component/RichChoicesField/index.js";
16
+ import type { SelectField } from "../../component/SelectField/index.js";
17
+ import type { SwitchField } from "../../component/SwitchField/index.js";
18
+ import type { TextareaField } from "../../component/TextareaField/index.js";
19
+ import type { TextField } from "../../component/TextField/index.js";
20
+ import type { TimeField } from "../../component/TimeField/index.js";
21
21
  import type { NativeInputType } from "../../subcomponent/types.js";
22
22
  export type { BaseInputProps, BaseWrapperProps, Condition, InputProps, Middleware, WrappedComponentProps, WrapperHOCAdditionalProps, WrapperProps, } from "../../common/types.js";
23
23
  export type { BaseProps, NativeInputType, Option, OptionsProps, } from "../../subcomponent/types.js";
24
- export type FieldProps = ({
25
- inputType: Exclude<NativeInputType, "password" | "number">;
26
- } & TextFieldProps) | ({
24
+ type ReservedCustomKeys<P> = P extends unknown ? Extract<"inputType" | "CustomComponent" | "key", keyof P> : never;
25
+ type CustomVariant<P extends {
26
+ name: string;
27
+ }, Whole extends {
28
+ name: string;
29
+ } = P> = P extends unknown ? {
30
+ inputType: "custom";
31
+ CustomComponent: ComponentType<Whole>;
32
+ } & NoInfer<P> : never;
33
+ type TextInputType = Exclude<NativeInputType, "password" | "number">;
34
+ type TextVariants = {
35
+ [T in TextInputType]: {
36
+ inputType: T;
37
+ } & Omit<ComponentProps<typeof TextField>, "inputType">;
38
+ }[TextInputType];
39
+ type BuiltinFields = TextVariants | ({
27
40
  inputType: "password";
28
- } & PasswordFieldProps) | ({
41
+ } & ComponentProps<typeof PasswordField>) | ({
29
42
  inputType: "number";
30
- } & NumberFieldProps) | ({
43
+ } & ComponentProps<typeof NumberField>) | ({
31
44
  inputType: "checkbox";
32
- } & CheckboxFieldProps) | ({
45
+ } & ComponentProps<typeof CheckboxField>) | ({
33
46
  inputType: "switch";
34
- } & SwitchFieldProps) | ({
47
+ } & ComponentProps<typeof SwitchField>) | ({
35
48
  inputType: "hidden";
36
- } & HiddenFieldProps) | ({
49
+ } & ComponentProps<typeof HiddenField>) | ({
37
50
  inputType: "range";
38
- } & RangeFieldProps) | ({
51
+ } & ComponentProps<typeof RangeField>) | ({
39
52
  inputType: "rating";
40
- } & RatingFieldProps) | ({
53
+ } & ComponentProps<typeof RatingField>) | ({
41
54
  inputType: "select";
42
- } & SelectFieldProps) | ({
55
+ } & ComponentProps<typeof SelectField>) | ({
43
56
  inputType: "combobox";
44
- } & ComboboxFieldProps) | ({
57
+ } & ComponentProps<typeof ComboboxField>) | ({
45
58
  inputType: "choices";
46
- } & ChoicesFieldProps) | ({
59
+ } & ComponentProps<typeof ChoicesField>) | ({
47
60
  inputType: "textarea";
48
- } & TextareaFieldProps) | ({
61
+ } & ComponentProps<typeof TextareaField>) | ({
49
62
  inputType: "date";
50
- } & DateFieldProps) | ({
63
+ } & ComponentProps<typeof DateField>) | ({
51
64
  inputType: "time";
52
- } & TimeFieldProps) | ({
65
+ } & ComponentProps<typeof TimeField>) | ({
53
66
  inputType: "datetime";
54
- } & DateTimeFieldProps) | ({
67
+ } & ComponentProps<typeof DateTimeField>) | ({
55
68
  inputType: "file";
56
- } & FileUploadFieldProps) | ({
69
+ } & ComponentProps<typeof FileUploadField>) | ({
57
70
  inputType: "color";
58
- } & ColorFieldProps) | ({
71
+ } & ComponentProps<typeof ColorField>) | ({
59
72
  inputType: "phone";
60
- } & PhoneFieldProps) | ({
73
+ } & ComponentProps<typeof PhoneField>) | ({
61
74
  inputType: "rich-choices";
62
- } & RichChoicesFieldProps) | ({
63
- inputType: "custom";
64
- CustomComponent: React.ComponentType<InputProps<any>>;
65
- } & InputProps<any>);
75
+ } & ComponentProps<typeof RichChoicesField>);
76
+ type WithoutNativeType<T> = T extends unknown ? Omit<T, "type"> & {
77
+ type?: never;
78
+ } : never;
79
+ /**
80
+ * Props for a built-in or custom field. Custom props are inferred from the
81
+ * component in JSX or supplied as the type argument for a field map. They must
82
+ * include a string `name` and cannot declare `inputType`, `CustomComponent`,
83
+ * or React's `key`, which are consumed before the component is rendered.
84
+ */
85
+ export type FieldProps<P extends {
86
+ name: string;
87
+ } = {
88
+ name: string;
89
+ }> = WithoutNativeType<BuiltinFields> | ([ReservedCustomKeys<P>] extends [never] ? CustomVariant<P> : never);
66
90
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/pattern/Field/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,KAAK,EA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AAE,OAAO,CAAA;CAAE,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC,GAC5D,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC,GAC5D,CAAC;IAAE,SAAS,EAAE,cAAc,CAAA;CAAE,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC;AAG9E,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GACzC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,GAClC,KAAK,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,IAChE,iBAAiB,CAAC,aAAa,CAAC,GAChC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@canonical/react-ds-global-form",
3
- "version": "0.45.0",
3
+ "version": "0.47.0",
4
4
  "type": "module",
5
+ "sideEffects": [
6
+ "*.css"
7
+ ],
8
+ "main": "dist/esm/index.js",
5
9
  "module": "dist/esm/index.js",
6
10
  "types": "dist/types/index.d.ts",
7
11
  "style": "dist/esm/index.css",
@@ -43,11 +47,11 @@
43
47
  "test:vitest:watch": "vitest"
44
48
  },
45
49
  "dependencies": {
46
- "@canonical/ds-utils": "^0.45.0",
47
- "@canonical/react-ds-global": "^0.45.0",
48
- "@canonical/storybook-config": "^0.45.0",
49
- "@canonical/styles": "^0.45.0",
50
- "@canonical/utils": "0.43.0",
50
+ "@canonical/ds-utils": "^0.47.0",
51
+ "@canonical/react-ds-global": "^0.47.0",
52
+ "@canonical/storybook-config": "^0.47.0",
53
+ "@canonical/styles": "^0.47.0",
54
+ "@canonical/utils": "0.44.0",
51
55
  "downshift": "^9.3.2",
52
56
  "react": "^19.2.4",
53
57
  "react-dom": "^19.2.4",
@@ -56,13 +60,13 @@
56
60
  "devDependencies": {
57
61
  "@biomejs/biome": "2.5.15",
58
62
  "@canonical/biome-config": "0.43.0",
59
- "@canonical/design-tokens": "0.43.0",
60
- "@canonical/storybook-addon-form-state": "^0.45.0",
61
- "@canonical/storybook-addon-msw": "^0.45.0",
62
- "@canonical/storybook-helpers": "^0.45.0",
63
- "@canonical/typescript-config-react": "^0.45.0",
64
- "@canonical/vitest-config-react": "^0.45.0",
65
- "@canonical/webarchitect": "0.43.0",
63
+ "@canonical/design-tokens": "0.44.0",
64
+ "@canonical/storybook-addon-form-state": "^0.47.0",
65
+ "@canonical/storybook-addon-msw": "^0.47.0",
66
+ "@canonical/storybook-helpers": "^0.47.0",
67
+ "@canonical/typescript-config-react": "^0.47.0",
68
+ "@canonical/vitest-config-react": "^0.47.0",
69
+ "@canonical/webarchitect": "0.44.0",
66
70
  "@chromatic-com/storybook": "^5.0.1",
67
71
  "@storybook/addon-docs": "^10.6.0",
68
72
  "@storybook/react-vite": "^10.6.0",
@@ -76,11 +80,11 @@
76
80
  "copyfiles": "^2.4.1",
77
81
  "globals": "^17.4.0",
78
82
  "jsdom": "^28.1.0",
79
- "msw": "^2.12.10",
83
+ "msw": "^3.0.0",
80
84
  "storybook": "^10.6.0",
81
85
  "typescript": "^7.0.2",
82
86
  "vite": "^8.0.1",
83
87
  "vitest": "^5.0.0"
84
88
  },
85
- "gitHead": "f8c2473f9aa92d14c24f0976f2f02ebc4944f32f"
89
+ "gitHead": "f846e7e21001a0fcbc4cd9f28c14a55cea7f4974"
86
90
  }