@luscii-healthtech/web-ui 60.1.0 → 60.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/esm/components/Checkbox/LabeledCheckboxCardGroup.js +2 -2
  2. package/dist/esm/components/Checkbox/LabeledCheckboxCardGroup.js.map +1 -1
  3. package/dist/esm/components/Checkbox/LabeledCheckboxGroup.js +2 -2
  4. package/dist/esm/components/Checkbox/LabeledCheckboxGroup.js.map +1 -1
  5. package/dist/esm/components/DatePicker/LabeledDatePicker.js +1 -1
  6. package/dist/esm/components/DatePicker/LabeledDatePicker.js.map +1 -1
  7. package/dist/esm/components/Input/Input.js.map +1 -1
  8. package/dist/esm/components/Input/LabeledInput.js +4 -2
  9. package/dist/esm/components/Input/LabeledInput.js.map +1 -1
  10. package/dist/esm/components/Input/SearchInput.js +1 -1
  11. package/dist/esm/components/Input/SearchInput.js.map +1 -1
  12. package/dist/esm/components/Input/StyledInput.js +71 -28
  13. package/dist/esm/components/Input/StyledInput.js.map +1 -1
  14. package/dist/esm/components/Radio/LabeledRadioCardGroup.js +2 -2
  15. package/dist/esm/components/Radio/LabeledRadioCardGroup.js.map +1 -1
  16. package/dist/esm/components/Radio/LabeledRadioGroup.js +2 -2
  17. package/dist/esm/components/Radio/LabeledRadioGroup.js.map +1 -1
  18. package/dist/esm/components/Select/LabeledSelect.js +1 -1
  19. package/dist/esm/components/Select/LabeledSelect.js.map +1 -1
  20. package/dist/esm/components/Select/LabeledSelectSearchable.js +2 -1
  21. package/dist/esm/components/Select/LabeledSelectSearchable.js.map +1 -1
  22. package/dist/esm/components/forms/shared/FieldsetLegend.js +17 -0
  23. package/dist/esm/components/forms/shared/FieldsetLegend.js.map +1 -0
  24. package/dist/esm/components/forms/shared/HelperAndErrorText.js +1 -1
  25. package/dist/esm/components/forms/shared/HelperAndErrorText.js.map +1 -1
  26. package/dist/index.development.js +95 -39
  27. package/dist/index.development.js.map +1 -1
  28. package/dist/index.js +1 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/src/components/Checkbox/LabeledCheckboxCardGroup.d.ts +10 -2
  31. package/dist/src/components/Checkbox/LabeledCheckboxGroup.d.ts +9 -1
  32. package/dist/src/components/DatePicker/LabeledDatePicker.d.ts +9 -1
  33. package/dist/src/components/Input/Input.d.ts +2 -0
  34. package/dist/src/components/Input/LabeledInput.d.ts +11 -1
  35. package/dist/src/components/Input/StyledInput.d.ts +2 -0
  36. package/dist/src/components/InputSelect/InputSelect.d.ts +1 -0
  37. package/dist/src/components/InputSelect/InputSelectInput.d.ts +1 -0
  38. package/dist/src/components/NaturalLanguageForm/NaturalLanguageForm.d.ts +2 -0
  39. package/dist/src/components/NaturalLanguageForm/NaturalLanguageFormInput.d.ts +1 -0
  40. package/dist/src/components/NaturalLanguageForm/NaturalLanguageFormInputSelect.d.ts +1 -0
  41. package/dist/src/components/Radio/LabeledRadioCardGroup.d.ts +10 -2
  42. package/dist/src/components/Radio/LabeledRadioGroup.d.ts +9 -1
  43. package/dist/src/components/Select/LabeledSelect.d.ts +9 -1
  44. package/dist/src/components/Select/LabeledSelectSearchable.d.ts +8 -1
  45. package/dist/src/components/forms/shared/FieldsetLegend.d.ts +22 -0
  46. package/dist/src/generated/components/Checkbox/LabeledCheckboxCardGroup.d.ts +10 -2
  47. package/dist/src/generated/components/Checkbox/LabeledCheckboxGroup.d.ts +9 -1
  48. package/dist/src/generated/components/DatePicker/LabeledDatePicker.d.ts +9 -1
  49. package/dist/src/generated/components/Input/Input.d.ts +2 -0
  50. package/dist/src/generated/components/Input/LabeledInput.d.ts +11 -1
  51. package/dist/src/generated/components/Input/StyledInput.d.ts +2 -0
  52. package/dist/src/generated/components/InputSelect/InputSelect.d.ts +1 -0
  53. package/dist/src/generated/components/InputSelect/InputSelectInput.d.ts +1 -0
  54. package/dist/src/generated/components/NaturalLanguageForm/NaturalLanguageForm.d.ts +2 -0
  55. package/dist/src/generated/components/NaturalLanguageForm/NaturalLanguageFormInput.d.ts +1 -0
  56. package/dist/src/generated/components/NaturalLanguageForm/NaturalLanguageFormInputSelect.d.ts +1 -0
  57. package/dist/src/generated/components/Radio/LabeledRadioCardGroup.d.ts +10 -2
  58. package/dist/src/generated/components/Radio/LabeledRadioGroup.d.ts +9 -1
  59. package/dist/src/generated/components/Select/LabeledSelect.d.ts +9 -1
  60. package/dist/src/generated/components/Select/LabeledSelectSearchable.d.ts +8 -1
  61. package/dist/src/generated/components/forms/shared/FieldsetLegend.d.ts +22 -0
  62. package/dist/stories/InputSelect.stories.d.ts +1 -0
  63. package/dist/stories/LabeledCheckbox.stories.d.ts +5 -0
  64. package/dist/stories/LabeledDatePicker.stories.d.ts +6 -1
  65. package/dist/stories/LabeledInput.stories.d.ts +14 -1
  66. package/dist/stories/LabeledRadio.stories.d.ts +10 -0
  67. package/dist/stories/LabeledSelectSearchable.stories.d.ts +6 -1
  68. package/dist/stories/NaturalLanguageForm.stories.d.ts +2 -0
  69. package/dist/stories/SearchInput.stories.d.ts +1 -0
  70. package/dist/stories/Select.stories.d.ts +5 -0
  71. package/dist/web-ui-tailwind.css +32 -0
  72. package/package.json +1 -1
@@ -1,7 +1,15 @@
1
1
  import React from "react";
2
- type Props = React.ComponentPropsWithoutRef<"fieldset"> & {
2
+ type Props = Omit<React.ComponentPropsWithoutRef<"fieldset">, "title"> & {
3
3
  children: React.ReactNode;
4
- title?: string;
4
+ /**
5
+ * The group's title, rendered as the fieldset's `<legend>`. A string is
6
+ * rendered as body text; pass a node for anything else, such as a
7
+ * `Heading` or an info icon next to the text.
8
+ *
9
+ * All of the title's text names the group, including the label of an
10
+ * (info) button inside it.
11
+ */
12
+ title?: React.ReactNode;
5
13
  className?: string;
6
14
  /**
7
15
  * Over how many columns the checkbox cards should be distributed.
@@ -1,7 +1,15 @@
1
1
  import React from "react";
2
2
  type Props = {
3
3
  children: React.ReactNode;
4
- title?: string;
4
+ /**
5
+ * The group's title, rendered as the fieldset's `<legend>`. A string is
6
+ * rendered as body text; pass a node for anything else, such as a
7
+ * `Heading` or an info icon next to the text.
8
+ *
9
+ * All of the title's text names the group, including the label of an
10
+ * (info) button inside it.
11
+ */
12
+ title?: React.ReactNode;
5
13
  className?: string;
6
14
  /**
7
15
  * Any additional information to show underneath the radio group.
@@ -1,7 +1,15 @@
1
1
  import React from "react";
2
2
  import { type DatePickerProps } from "./DatePicker";
3
3
  type Props = DatePickerProps & {
4
- label?: string;
4
+ /**
5
+ * The visible label above the date picker.
6
+ *
7
+ * Besides a string, this can be a node, for example to add an icon next to
8
+ * the text. It's rendered inside a `<label>`, so keep it phrasing content
9
+ * (no headings or blocks) and non-interactive: interactive content would
10
+ * become part of the field's accessible name.
11
+ */
12
+ label?: React.ReactNode;
5
13
  helperText?: React.ReactNode;
6
14
  errorText?: React.ReactNode;
7
15
  /**
@@ -21,6 +21,8 @@ export type FakeEventTarget = {
21
21
  };
22
22
  export interface InputProps extends CustomHTMLInputProps {
23
23
  clearable?: boolean;
24
+ /** Accessible name of the clear button shown when `clearable`. Defaults to "Clear". */
25
+ clearButtonLabel?: string;
24
26
  isDisabled?: boolean;
25
27
  withPrefix?: string;
26
28
  withSuffix?: string;
@@ -11,8 +11,18 @@ export declare const LabeledInput: React.ForwardRefExoticComponent<Omit<Omit<Omi
11
11
  isError?: boolean;
12
12
  isClearIconVisible?: boolean;
13
13
  onClickClearField?: () => void;
14
+ clearButtonLabel?: string;
14
15
  } & React.RefAttributes<HTMLInputElement>, "ref">, "width" | "icon"> & {
15
- label?: string;
16
+ /**
17
+ * The visible label, linked to the input with `htmlFor`. When omitted, give
18
+ * the input an accessible name with `aria-label` or `aria-labelledby`.
19
+ *
20
+ * Besides a string, this can be a node, for example to add an icon next to
21
+ * the text. It's rendered inside a `<label>`, so keep it phrasing content
22
+ * (no headings or blocks) and non-interactive: interactive content would
23
+ * become part of the field's accessible name.
24
+ */
25
+ label?: React.ReactNode;
16
26
  icon?: React.FC<IconProps>;
17
27
  /**
18
28
  * Any additional information to show underneath the input.
@@ -25,4 +25,6 @@ export declare const StyledInput: React.ForwardRefExoticComponent<Omit<Omit<Reac
25
25
  isError?: boolean;
26
26
  isClearIconVisible?: boolean;
27
27
  onClickClearField?: () => void;
28
+ /** Accessible name of the clear button. */
29
+ clearButtonLabel?: string;
28
30
  } & React.RefAttributes<HTMLInputElement>>;
@@ -24,6 +24,7 @@ declare const InputSelectWithSubComponents: React.ForwardRefExoticComponent<Inpu
24
24
  isError?: boolean;
25
25
  isClearIconVisible?: boolean;
26
26
  onClickClearField?: () => void;
27
+ clearButtonLabel?: string;
27
28
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
28
29
  Select: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "width"> & {
29
30
  children?: React.ReactNode;
@@ -8,4 +8,5 @@ export declare const InputSelectInput: React.ForwardRefExoticComponent<Omit<Omit
8
8
  isError?: boolean;
9
9
  isClearIconVisible?: boolean;
10
10
  onClickClearField?: () => void;
11
+ clearButtonLabel?: string;
11
12
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -25,6 +25,7 @@ declare const NaturalLanguageFormWithSubComponents: React.ForwardRefExoticCompon
25
25
  isError?: boolean;
26
26
  isClearIconVisible?: boolean;
27
27
  onClickClearField?: () => void;
28
+ clearButtonLabel?: string;
28
29
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
29
30
  Select: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "width"> & {
30
31
  children?: React.ReactNode;
@@ -59,6 +60,7 @@ declare const NaturalLanguageFormWithSubComponents: React.ForwardRefExoticCompon
59
60
  isError?: boolean;
60
61
  isClearIconVisible?: boolean;
61
62
  onClickClearField?: () => void;
63
+ clearButtonLabel?: string;
62
64
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
63
65
  Select: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "width"> & {
64
66
  children?: React.ReactNode;
@@ -8,4 +8,5 @@ export declare const NaturalLanguageFormInput: React.ForwardRefExoticComponent<O
8
8
  isError?: boolean;
9
9
  isClearIconVisible?: boolean;
10
10
  onClickClearField?: () => void;
11
+ clearButtonLabel?: string;
11
12
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -9,6 +9,7 @@ export declare const NaturalLanguageFormInputSelect: React.ForwardRefExoticCompo
9
9
  isError?: boolean;
10
10
  isClearIconVisible?: boolean;
11
11
  onClickClearField?: () => void;
12
+ clearButtonLabel?: string;
12
13
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
13
14
  Select: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "width"> & {
14
15
  children?: React.ReactNode;
@@ -1,7 +1,15 @@
1
1
  import React from "react";
2
- type Props = React.ComponentPropsWithoutRef<"fieldset"> & {
2
+ type Props = Omit<React.ComponentPropsWithoutRef<"fieldset">, "title"> & {
3
3
  children: React.ReactNode;
4
- title?: string;
4
+ /**
5
+ * The group's title, rendered as the fieldset's `<legend>`. A string is
6
+ * rendered as body text; pass a node for anything else, such as a
7
+ * `Heading` or an info icon next to the text.
8
+ *
9
+ * All of the title's text names the group, including the label of an
10
+ * (info) button inside it.
11
+ */
12
+ title?: React.ReactNode;
5
13
  className?: string;
6
14
  /**
7
15
  * Over how many columns the radio cards should be distributed.
@@ -1,7 +1,15 @@
1
1
  import React from "react";
2
2
  type Props = {
3
3
  children: React.ReactNode;
4
- title?: string;
4
+ /**
5
+ * The group's title, rendered as the fieldset's `<legend>`. A string is
6
+ * rendered as body text; pass a node for anything else, such as a
7
+ * `Heading` or an info icon next to the text.
8
+ *
9
+ * All of the title's text names the group, including the label of an
10
+ * (info) button inside it.
11
+ */
12
+ title?: React.ReactNode;
5
13
  className?: string;
6
14
  /**
7
15
  * The orientation of the radio buttons in the group. This only has a
@@ -8,7 +8,15 @@ export declare const LabeledSelect: React.ForwardRefExoticComponent<Omit<Omit<Om
8
8
  height?: import("../../system/Sizes").FormHeightNames;
9
9
  isError?: boolean;
10
10
  } & React.RefAttributes<HTMLSelectElement>, "ref">, "width" | "icon"> & {
11
- label?: string;
11
+ /**
12
+ * The visible label above the select.
13
+ *
14
+ * Besides a string, this can be a node, for example to add an icon next to
15
+ * the text. It's rendered inside a `<label>`, so keep it phrasing content
16
+ * (no headings or blocks) and non-interactive: interactive content would
17
+ * become part of the field's accessible name.
18
+ */
19
+ label?: React.ReactNode;
12
20
  icon?: React.FC<IconProps>;
13
21
  /**
14
22
  * Any additional information to show underneath the input.
@@ -1,7 +1,14 @@
1
1
  import React from "react";
2
2
  import { type SelectProps } from "./Select";
3
3
  export declare const LabeledSelectSearchable: React.ForwardRefExoticComponent<Omit<SelectProps<import("./Select.types").OptionMinimal, any, import("react-select").GroupBase<import("./Select.types").OptionMinimal>>, "isError"> & {
4
- label?: string;
4
+ /**
5
+ * The visible label above the select, linked to it with `aria-labelledby`.
6
+ *
7
+ * Besides a string, this can be a node, for example to add an icon next to
8
+ * the text. Keep it phrasing content (no headings or blocks) and
9
+ * non-interactive: all of its text becomes the select's accessible name.
10
+ */
11
+ label?: React.ReactNode;
5
12
  /**
6
13
  * Any additional information to show underneath the select.
7
14
  */
@@ -0,0 +1,22 @@
1
+ import { type FC, type ReactNode } from "react";
2
+ type Props = {
3
+ /**
4
+ * A string is rendered as body text. Any other node is rendered as-is, so
5
+ * it can be a `Heading` or contain an icon. A `<legend>` may contain
6
+ * phrasing and heading content.
7
+ */
8
+ children: ReactNode;
9
+ };
10
+ /**
11
+ * The title of a labelled group (radio group, checkbox group, …), rendered as
12
+ * the `<legend>` of its `<fieldset>`, so it names the group.
13
+ *
14
+ * Browsers render a fieldset's legend outside of the fieldset's (flex)
15
+ * layout, so the legend gets `display: contents` and its content becomes the
16
+ * flex item instead. That content must be a single element to stay one item
17
+ * that follows the parent `Stack`'s gap: a string is wrapped in `Text`, a
18
+ * single element is rendered as-is, and anything else (a fragment, several
19
+ * nodes) is wrapped in a block `span`.
20
+ */
21
+ export declare const FieldsetLegend: FC<Props>;
22
+ export {};
@@ -1,7 +1,15 @@
1
1
  import React from "react";
2
- type Props = React.ComponentPropsWithoutRef<"fieldset"> & {
2
+ type Props = Omit<React.ComponentPropsWithoutRef<"fieldset">, "title"> & {
3
3
  children: React.ReactNode;
4
- title?: string;
4
+ /**
5
+ * The group's title, rendered as the fieldset's `<legend>`. A string is
6
+ * rendered as body text; pass a node for anything else, such as a
7
+ * `Heading` or an info icon next to the text.
8
+ *
9
+ * All of the title's text names the group, including the label of an
10
+ * (info) button inside it.
11
+ */
12
+ title?: React.ReactNode;
5
13
  className?: string;
6
14
  /**
7
15
  * Over how many columns the checkbox cards should be distributed.
@@ -1,7 +1,15 @@
1
1
  import React from "react";
2
2
  type Props = {
3
3
  children: React.ReactNode;
4
- title?: string;
4
+ /**
5
+ * The group's title, rendered as the fieldset's `<legend>`. A string is
6
+ * rendered as body text; pass a node for anything else, such as a
7
+ * `Heading` or an info icon next to the text.
8
+ *
9
+ * All of the title's text names the group, including the label of an
10
+ * (info) button inside it.
11
+ */
12
+ title?: React.ReactNode;
5
13
  className?: string;
6
14
  /**
7
15
  * Any additional information to show underneath the radio group.
@@ -1,7 +1,15 @@
1
1
  import React from "react";
2
2
  import { type DatePickerProps } from "./DatePicker";
3
3
  type Props = DatePickerProps & {
4
- label?: string;
4
+ /**
5
+ * The visible label above the date picker.
6
+ *
7
+ * Besides a string, this can be a node, for example to add an icon next to
8
+ * the text. It's rendered inside a `<label>`, so keep it phrasing content
9
+ * (no headings or blocks) and non-interactive: interactive content would
10
+ * become part of the field's accessible name.
11
+ */
12
+ label?: React.ReactNode;
5
13
  helperText?: React.ReactNode;
6
14
  errorText?: React.ReactNode;
7
15
  /**
@@ -21,6 +21,8 @@ export type FakeEventTarget = {
21
21
  };
22
22
  export interface InputProps extends CustomHTMLInputProps {
23
23
  clearable?: boolean;
24
+ /** Accessible name of the clear button shown when `clearable`. Defaults to "Clear". */
25
+ clearButtonLabel?: string;
24
26
  isDisabled?: boolean;
25
27
  withPrefix?: string;
26
28
  withSuffix?: string;
@@ -11,8 +11,18 @@ export declare const LabeledInput: React.ForwardRefExoticComponent<Omit<Omit<Omi
11
11
  isError?: boolean;
12
12
  isClearIconVisible?: boolean;
13
13
  onClickClearField?: () => void;
14
+ clearButtonLabel?: string;
14
15
  } & React.RefAttributes<HTMLInputElement>, "ref">, "width" | "icon"> & {
15
- label?: string;
16
+ /**
17
+ * The visible label, linked to the input with `htmlFor`. When omitted, give
18
+ * the input an accessible name with `aria-label` or `aria-labelledby`.
19
+ *
20
+ * Besides a string, this can be a node, for example to add an icon next to
21
+ * the text. It's rendered inside a `<label>`, so keep it phrasing content
22
+ * (no headings or blocks) and non-interactive: interactive content would
23
+ * become part of the field's accessible name.
24
+ */
25
+ label?: React.ReactNode;
16
26
  icon?: React.FC<IconProps>;
17
27
  /**
18
28
  * Any additional information to show underneath the input.
@@ -25,4 +25,6 @@ export declare const StyledInput: React.ForwardRefExoticComponent<Omit<Omit<Reac
25
25
  isError?: boolean;
26
26
  isClearIconVisible?: boolean;
27
27
  onClickClearField?: () => void;
28
+ /** Accessible name of the clear button. */
29
+ clearButtonLabel?: string;
28
30
  } & React.RefAttributes<HTMLInputElement>>;
@@ -24,6 +24,7 @@ declare const InputSelectWithSubComponents: React.ForwardRefExoticComponent<Inpu
24
24
  isError?: boolean;
25
25
  isClearIconVisible?: boolean;
26
26
  onClickClearField?: () => void;
27
+ clearButtonLabel?: string;
27
28
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
28
29
  Select: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "width"> & {
29
30
  children?: React.ReactNode;
@@ -8,4 +8,5 @@ export declare const InputSelectInput: React.ForwardRefExoticComponent<Omit<Omit
8
8
  isError?: boolean;
9
9
  isClearIconVisible?: boolean;
10
10
  onClickClearField?: () => void;
11
+ clearButtonLabel?: string;
11
12
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -25,6 +25,7 @@ declare const NaturalLanguageFormWithSubComponents: React.ForwardRefExoticCompon
25
25
  isError?: boolean;
26
26
  isClearIconVisible?: boolean;
27
27
  onClickClearField?: () => void;
28
+ clearButtonLabel?: string;
28
29
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
29
30
  Select: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "width"> & {
30
31
  children?: React.ReactNode;
@@ -59,6 +60,7 @@ declare const NaturalLanguageFormWithSubComponents: React.ForwardRefExoticCompon
59
60
  isError?: boolean;
60
61
  isClearIconVisible?: boolean;
61
62
  onClickClearField?: () => void;
63
+ clearButtonLabel?: string;
62
64
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
63
65
  Select: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "width"> & {
64
66
  children?: React.ReactNode;
@@ -8,4 +8,5 @@ export declare const NaturalLanguageFormInput: React.ForwardRefExoticComponent<O
8
8
  isError?: boolean;
9
9
  isClearIconVisible?: boolean;
10
10
  onClickClearField?: () => void;
11
+ clearButtonLabel?: string;
11
12
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -9,6 +9,7 @@ export declare const NaturalLanguageFormInputSelect: React.ForwardRefExoticCompo
9
9
  isError?: boolean;
10
10
  isClearIconVisible?: boolean;
11
11
  onClickClearField?: () => void;
12
+ clearButtonLabel?: string;
12
13
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
13
14
  Select: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "width"> & {
14
15
  children?: React.ReactNode;
@@ -1,7 +1,15 @@
1
1
  import React from "react";
2
- type Props = React.ComponentPropsWithoutRef<"fieldset"> & {
2
+ type Props = Omit<React.ComponentPropsWithoutRef<"fieldset">, "title"> & {
3
3
  children: React.ReactNode;
4
- title?: string;
4
+ /**
5
+ * The group's title, rendered as the fieldset's `<legend>`. A string is
6
+ * rendered as body text; pass a node for anything else, such as a
7
+ * `Heading` or an info icon next to the text.
8
+ *
9
+ * All of the title's text names the group, including the label of an
10
+ * (info) button inside it.
11
+ */
12
+ title?: React.ReactNode;
5
13
  className?: string;
6
14
  /**
7
15
  * Over how many columns the radio cards should be distributed.
@@ -1,7 +1,15 @@
1
1
  import React from "react";
2
2
  type Props = {
3
3
  children: React.ReactNode;
4
- title?: string;
4
+ /**
5
+ * The group's title, rendered as the fieldset's `<legend>`. A string is
6
+ * rendered as body text; pass a node for anything else, such as a
7
+ * `Heading` or an info icon next to the text.
8
+ *
9
+ * All of the title's text names the group, including the label of an
10
+ * (info) button inside it.
11
+ */
12
+ title?: React.ReactNode;
5
13
  className?: string;
6
14
  /**
7
15
  * The orientation of the radio buttons in the group. This only has a
@@ -8,7 +8,15 @@ export declare const LabeledSelect: React.ForwardRefExoticComponent<Omit<Omit<Om
8
8
  height?: import("../../system/Sizes").FormHeightNames;
9
9
  isError?: boolean;
10
10
  } & React.RefAttributes<HTMLSelectElement>, "ref">, "width" | "icon"> & {
11
- label?: string;
11
+ /**
12
+ * The visible label above the select.
13
+ *
14
+ * Besides a string, this can be a node, for example to add an icon next to
15
+ * the text. It's rendered inside a `<label>`, so keep it phrasing content
16
+ * (no headings or blocks) and non-interactive: interactive content would
17
+ * become part of the field's accessible name.
18
+ */
19
+ label?: React.ReactNode;
12
20
  icon?: React.FC<IconProps>;
13
21
  /**
14
22
  * Any additional information to show underneath the input.
@@ -1,7 +1,14 @@
1
1
  import React from "react";
2
2
  import { type SelectProps } from "./Select";
3
3
  export declare const LabeledSelectSearchable: React.ForwardRefExoticComponent<Omit<SelectProps<import("./Select.types").OptionMinimal, any, import("react-select").GroupBase<import("./Select.types").OptionMinimal>>, "isError"> & {
4
- label?: string;
4
+ /**
5
+ * The visible label above the select, linked to it with `aria-labelledby`.
6
+ *
7
+ * Besides a string, this can be a node, for example to add an icon next to
8
+ * the text. Keep it phrasing content (no headings or blocks) and
9
+ * non-interactive: all of its text becomes the select's accessible name.
10
+ */
11
+ label?: React.ReactNode;
5
12
  /**
6
13
  * Any additional information to show underneath the select.
7
14
  */
@@ -0,0 +1,22 @@
1
+ import { type FC, type ReactNode } from "react";
2
+ type Props = {
3
+ /**
4
+ * A string is rendered as body text. Any other node is rendered as-is, so
5
+ * it can be a `Heading` or contain an icon. A `<legend>` may contain
6
+ * phrasing and heading content.
7
+ */
8
+ children: ReactNode;
9
+ };
10
+ /**
11
+ * The title of a labelled group (radio group, checkbox group, …), rendered as
12
+ * the `<legend>` of its `<fieldset>`, so it names the group.
13
+ *
14
+ * Browsers render a fieldset's legend outside of the fieldset's (flex)
15
+ * layout, so the legend gets `display: contents` and its content becomes the
16
+ * flex item instead. That content must be a single element to stay one item
17
+ * that follows the parent `Stack`'s gap: a string is wrapped in `Text`, a
18
+ * single element is rendered as-is, and anything else (a fragment, several
19
+ * nodes) is wrapped in a block `span`.
20
+ */
21
+ export declare const FieldsetLegend: FC<Props>;
22
+ export {};
@@ -12,6 +12,7 @@ declare const meta: {
12
12
  isError?: boolean;
13
13
  isClearIconVisible?: boolean;
14
14
  onClickClearField?: () => void;
15
+ clearButtonLabel?: string;
15
16
  } & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
16
17
  Select: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "width"> & {
17
18
  children?: React.ReactNode;
@@ -41,3 +41,8 @@ export declare const Disabled: Story;
41
41
  export declare const Indeterminate: Story;
42
42
  export declare const MultipleCheckboxes: Story;
43
43
  export declare const WithHelperAndErrorText: Story;
44
+ /**
45
+ * Besides a string, `title` takes a node, such as a `Heading`. It's still
46
+ * rendered as the fieldset's `<legend>`, so it names the group.
47
+ */
48
+ export declare const GroupTitleAsNode: Story;
@@ -24,7 +24,7 @@ declare const meta: {
24
24
  zIndex?: 10 | 20 | 30 | 40 | 50;
25
25
  popperZIndex?: 10 | 20 | 30 | 40 | 50;
26
26
  } & {
27
- label?: string;
27
+ label?: React.ReactNode;
28
28
  helperText?: React.ReactNode;
29
29
  errorText?: React.ReactNode;
30
30
  fullWidth?: boolean;
@@ -53,3 +53,8 @@ type Story = StoryObj<typeof meta>;
53
53
  export declare const Base: Story;
54
54
  export declare const HelperText: Story;
55
55
  export declare const ErrorText: Story;
56
+ /**
57
+ * Besides a string, `label` takes a node, for example to add a muted
58
+ * "(optional)" next to the text. Keep it phrasing content and non-interactive.
59
+ */
60
+ export declare const LabelAsNode: Story;
@@ -10,8 +10,9 @@ declare const meta: {
10
10
  isError?: boolean;
11
11
  isClearIconVisible?: boolean;
12
12
  onClickClearField?: () => void;
13
+ clearButtonLabel?: string;
13
14
  } & import("react").RefAttributes<HTMLInputElement>, "ref">, "width" | "icon"> & {
14
- label?: string;
15
+ label?: React.ReactNode;
15
16
  icon?: React.FC<import("../src").IconProps>;
16
17
  helperText?: React.ReactNode;
17
18
  errorText?: React.ReactNode;
@@ -52,6 +53,18 @@ export declare const HelperText: Story;
52
53
  * their own, more specific CSS if needed.
53
54
  */
54
55
  export declare const HelperTextWithHtml: Story;
56
+ /**
57
+ * The prefix, suffix and icon are visually part of the field, so clicking
58
+ * them focuses the input.
59
+ */
60
+ export declare const PrefixSuffixAndIcon: Story;
61
+ /**
62
+ * Besides a string, `label` takes a node, for example to add a muted
63
+ * "(optional)" next to the text. It's rendered inside the `<label>`, so keep
64
+ * it phrasing content and non-interactive: all of its text becomes the
65
+ * input's accessible name.
66
+ */
67
+ export declare const LabelAsNode: Story;
55
68
  export declare const ErrorText: Story;
56
69
  /**
57
70
  * Demonstrates the `fullWidth` prop. The input, helper text, and error text
@@ -37,3 +37,13 @@ export declare const OverviewLabeledRadioCard: Story;
37
37
  export declare const UsingLabelAndSubtitleProps: Story;
38
38
  export declare const UsingChildrenPropForCustomContent: Story;
39
39
  export declare const SingleColumnWithIcons: Story;
40
+ /**
41
+ * Besides a string, `title` takes a node, such as a `Heading` with an info
42
+ * icon. It's still rendered as the fieldset's `<legend>`, so it names the
43
+ * group. All of its text names the group, including the info button's label
44
+ * (screen readers announce "Frequency, About frequency").
45
+ *
46
+ * `Heading as="h4"` adds a real heading to the page outline; pick a level
47
+ * that fits the page, or use `as="span"` when only the styling is wanted.
48
+ */
49
+ export declare const GroupTitleAsNode: Story;
@@ -2,7 +2,7 @@ import type { StoryObj } from "@storybook/react-vite";
2
2
  declare const meta: {
3
3
  title: string;
4
4
  component: import("react").ForwardRefExoticComponent<Omit<import("../src").SelectProps<import("../src").OptionMinimal, any, import("react-select").GroupBase<import("../src").OptionMinimal>>, "isError"> & {
5
- label?: string;
5
+ label?: React.ReactNode;
6
6
  helperText?: React.ReactNode;
7
7
  errorText?: React.ReactNode;
8
8
  fullWidth?: boolean;
@@ -38,3 +38,8 @@ export declare const Disabled: Story;
38
38
  * stretch to fill the container width instead of taking their intrinsic size.
39
39
  */
40
40
  export declare const FullWidth: Story;
41
+ /**
42
+ * Besides a string, `label` takes a node, for example to add a muted
43
+ * "(optional)" next to the text. Keep it phrasing content and non-interactive.
44
+ */
45
+ export declare const LabelAsNode: Story;
@@ -16,6 +16,7 @@ declare const meta: {
16
16
  isError?: boolean;
17
17
  isClearIconVisible?: boolean;
18
18
  onClickClearField?: () => void;
19
+ clearButtonLabel?: string;
19
20
  } & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
20
21
  Select: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "width"> & {
21
22
  children?: React.ReactNode;
@@ -50,6 +51,7 @@ declare const meta: {
50
51
  isError?: boolean;
51
52
  isClearIconVisible?: boolean;
52
53
  onClickClearField?: () => void;
54
+ clearButtonLabel?: string;
53
55
  } & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
54
56
  Select: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "width"> & {
55
57
  children?: React.ReactNode;
@@ -9,3 +9,4 @@ type Story = StoryObj<typeof meta>;
9
9
  export declare const Base: Story;
10
10
  export declare const SearchExample: Story;
11
11
  export declare const WithQuery: Story;
12
+ export declare const ClearWithKeyboard: Story;
@@ -234,6 +234,11 @@ export declare const LabeledSelect: {
234
234
  name: string;
235
235
  render: (args: any) => import("react").JSX.Element;
236
236
  };
237
+ /**
238
+ * Besides a string, `label` takes a node, for example to add a muted
239
+ * "(optional)" next to the text. Keep it phrasing content and non-interactive.
240
+ */
241
+ export declare const LabeledSelectLabelAsNode: Story;
237
242
  export declare const HIDE_Docs_ListGoodLength: Story;
238
243
  export declare const HIDE_Docs_ListTooLong: Story;
239
244
  export declare const HIDE_Docs_Sorted: Story;