@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.
- package/dist/esm/components/Checkbox/LabeledCheckboxCardGroup.js +2 -2
- package/dist/esm/components/Checkbox/LabeledCheckboxCardGroup.js.map +1 -1
- package/dist/esm/components/Checkbox/LabeledCheckboxGroup.js +2 -2
- package/dist/esm/components/Checkbox/LabeledCheckboxGroup.js.map +1 -1
- package/dist/esm/components/DatePicker/LabeledDatePicker.js +1 -1
- package/dist/esm/components/DatePicker/LabeledDatePicker.js.map +1 -1
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Input/LabeledInput.js +4 -2
- package/dist/esm/components/Input/LabeledInput.js.map +1 -1
- package/dist/esm/components/Input/SearchInput.js +1 -1
- package/dist/esm/components/Input/SearchInput.js.map +1 -1
- package/dist/esm/components/Input/StyledInput.js +71 -28
- package/dist/esm/components/Input/StyledInput.js.map +1 -1
- package/dist/esm/components/Radio/LabeledRadioCardGroup.js +2 -2
- package/dist/esm/components/Radio/LabeledRadioCardGroup.js.map +1 -1
- package/dist/esm/components/Radio/LabeledRadioGroup.js +2 -2
- package/dist/esm/components/Radio/LabeledRadioGroup.js.map +1 -1
- package/dist/esm/components/Select/LabeledSelect.js +1 -1
- package/dist/esm/components/Select/LabeledSelect.js.map +1 -1
- package/dist/esm/components/Select/LabeledSelectSearchable.js +2 -1
- package/dist/esm/components/Select/LabeledSelectSearchable.js.map +1 -1
- package/dist/esm/components/forms/shared/FieldsetLegend.js +17 -0
- package/dist/esm/components/forms/shared/FieldsetLegend.js.map +1 -0
- package/dist/esm/components/forms/shared/HelperAndErrorText.js +1 -1
- package/dist/esm/components/forms/shared/HelperAndErrorText.js.map +1 -1
- package/dist/index.development.js +95 -39
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/Checkbox/LabeledCheckboxCardGroup.d.ts +10 -2
- package/dist/src/components/Checkbox/LabeledCheckboxGroup.d.ts +9 -1
- package/dist/src/components/DatePicker/LabeledDatePicker.d.ts +9 -1
- package/dist/src/components/Input/Input.d.ts +2 -0
- package/dist/src/components/Input/LabeledInput.d.ts +11 -1
- package/dist/src/components/Input/StyledInput.d.ts +2 -0
- package/dist/src/components/InputSelect/InputSelect.d.ts +1 -0
- package/dist/src/components/InputSelect/InputSelectInput.d.ts +1 -0
- package/dist/src/components/NaturalLanguageForm/NaturalLanguageForm.d.ts +2 -0
- package/dist/src/components/NaturalLanguageForm/NaturalLanguageFormInput.d.ts +1 -0
- package/dist/src/components/NaturalLanguageForm/NaturalLanguageFormInputSelect.d.ts +1 -0
- package/dist/src/components/Radio/LabeledRadioCardGroup.d.ts +10 -2
- package/dist/src/components/Radio/LabeledRadioGroup.d.ts +9 -1
- package/dist/src/components/Select/LabeledSelect.d.ts +9 -1
- package/dist/src/components/Select/LabeledSelectSearchable.d.ts +8 -1
- package/dist/src/components/forms/shared/FieldsetLegend.d.ts +22 -0
- package/dist/src/generated/components/Checkbox/LabeledCheckboxCardGroup.d.ts +10 -2
- package/dist/src/generated/components/Checkbox/LabeledCheckboxGroup.d.ts +9 -1
- package/dist/src/generated/components/DatePicker/LabeledDatePicker.d.ts +9 -1
- package/dist/src/generated/components/Input/Input.d.ts +2 -0
- package/dist/src/generated/components/Input/LabeledInput.d.ts +11 -1
- package/dist/src/generated/components/Input/StyledInput.d.ts +2 -0
- package/dist/src/generated/components/InputSelect/InputSelect.d.ts +1 -0
- package/dist/src/generated/components/InputSelect/InputSelectInput.d.ts +1 -0
- package/dist/src/generated/components/NaturalLanguageForm/NaturalLanguageForm.d.ts +2 -0
- package/dist/src/generated/components/NaturalLanguageForm/NaturalLanguageFormInput.d.ts +1 -0
- package/dist/src/generated/components/NaturalLanguageForm/NaturalLanguageFormInputSelect.d.ts +1 -0
- package/dist/src/generated/components/Radio/LabeledRadioCardGroup.d.ts +10 -2
- package/dist/src/generated/components/Radio/LabeledRadioGroup.d.ts +9 -1
- package/dist/src/generated/components/Select/LabeledSelect.d.ts +9 -1
- package/dist/src/generated/components/Select/LabeledSelectSearchable.d.ts +8 -1
- package/dist/src/generated/components/forms/shared/FieldsetLegend.d.ts +22 -0
- package/dist/stories/InputSelect.stories.d.ts +1 -0
- package/dist/stories/LabeledCheckbox.stories.d.ts +5 -0
- package/dist/stories/LabeledDatePicker.stories.d.ts +6 -1
- package/dist/stories/LabeledInput.stories.d.ts +14 -1
- package/dist/stories/LabeledRadio.stories.d.ts +10 -0
- package/dist/stories/LabeledSelectSearchable.stories.d.ts +6 -1
- package/dist/stories/NaturalLanguageForm.stories.d.ts +2 -0
- package/dist/stories/SearchInput.stories.d.ts +1 -0
- package/dist/stories/Select.stories.d.ts +5 -0
- package/dist/web-ui-tailwind.css +32 -0
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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>>;
|
package/dist/src/generated/components/NaturalLanguageForm/NaturalLanguageFormInputSelect.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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;
|
|
@@ -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;
|