@allxsmith/bestax-bulma 5.34.0 → 5.34.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/Dropdown.js +8 -3
- package/dist/esm/components/Dropdown.js.map +1 -1
- package/dist/esm/components/Loading.js +5 -4
- package/dist/esm/components/Loading.js.map +1 -1
- package/dist/esm/components/Modal.js +11 -4
- package/dist/esm/components/Modal.js.map +1 -1
- package/dist/esm/components/Sidebar.js +5 -4
- package/dist/esm/components/Sidebar.js.map +1 -1
- package/dist/esm/components/Toast.js +7 -5
- package/dist/esm/components/Toast.js.map +1 -1
- package/dist/esm/form/Autocomplete.js +17 -2
- package/dist/esm/form/Autocomplete.js.map +1 -1
- package/dist/esm/form/Field.js +3 -3
- package/dist/esm/form/Field.js.map +1 -1
- package/dist/esm/form/FormContext.js +2 -1
- package/dist/esm/form/FormContext.js.map +1 -1
- package/dist/esm/form/Taginput.js +40 -6
- package/dist/esm/form/Taginput.js.map +1 -1
- package/dist/esm/form/_pickerInternals/PickerPopover.js +11 -3
- package/dist/esm/form/_pickerInternals/PickerPopover.js.map +1 -1
- package/dist/esm/form/useAutoLabelId.js.map +1 -1
- package/dist/index.cjs +107 -34
- package/dist/index.cjs.map +1 -1
- package/dist/types/components/Loading.d.ts +5 -1
- package/dist/types/components/Modal.d.ts +4 -1
- package/dist/types/components/Sidebar.d.ts +5 -1
- package/dist/types/components/Toast.d.ts +4 -1
- package/dist/types/form/Autocomplete.d.ts +13 -2
- package/dist/types/form/Field.d.ts +5 -5
- package/dist/types/form/FormContext.d.ts +2 -1
- package/dist/types/form/Taginput.d.ts +8 -3
- package/dist/types/form/useAutoLabelId.d.ts +2 -2
- package/dist/types-cjs/components/Loading.d.ts +5 -1
- package/dist/types-cjs/components/Modal.d.ts +4 -1
- package/dist/types-cjs/components/Sidebar.d.ts +5 -1
- package/dist/types-cjs/components/Toast.d.ts +4 -1
- package/dist/types-cjs/form/Autocomplete.d.ts +13 -2
- package/dist/types-cjs/form/Field.d.ts +5 -5
- package/dist/types-cjs/form/FormContext.d.ts +2 -1
- package/dist/types-cjs/form/Taginput.d.ts +8 -3
- package/dist/types-cjs/form/useAutoLabelId.d.ts +2 -2
- package/package.json +1 -1
|
@@ -22,7 +22,11 @@ export interface LoadingProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
22
22
|
size?: 'small' | 'medium' | 'large';
|
|
23
23
|
/** Color variant for the spinner. Default is light grey. */
|
|
24
24
|
color?: LoadingColor;
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Show a cancel button and allow closing, by a click on the overlay or by
|
|
27
|
+
* Escape. An Escape a popup on the page closed on, by calling
|
|
28
|
+
* `preventDefault()`, doesn't cancel.
|
|
29
|
+
*/
|
|
26
30
|
canCancel?: boolean;
|
|
27
31
|
/** Callback when cancel is triggered. */
|
|
28
32
|
onCancel?: () => void;
|
|
@@ -30,7 +30,10 @@ export interface ModalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
30
30
|
children?: React.ReactNode;
|
|
31
31
|
/**
|
|
32
32
|
* Close the modal when the Escape key is pressed (calls `onClose`). Only the
|
|
33
|
-
* topmost open modal responds, so Escape closes one layer at a time.
|
|
33
|
+
* topmost open modal responds, so Escape closes one layer at a time. A popup
|
|
34
|
+
* inside it, such as a Dropdown's menu or a date picker's calendar, takes
|
|
35
|
+
* its own Escape first, and so does content that calls `preventDefault()`
|
|
36
|
+
* on it.
|
|
34
37
|
* @defaultValue true
|
|
35
38
|
*/
|
|
36
39
|
closeOnEscape?: boolean;
|
|
@@ -24,7 +24,11 @@ export interface SidebarProps extends Omit<React.HTMLAttributes<HTMLElement>, 'c
|
|
|
24
24
|
overlay?: boolean;
|
|
25
25
|
/** Close sidebar when overlay is clicked. Default: true. */
|
|
26
26
|
overlayClose?: boolean;
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Close sidebar on Escape key. A popup inside it, such as a Dropdown's menu
|
|
29
|
+
* or a date picker's calendar, takes its own Escape first, and so does
|
|
30
|
+
* content that calls `preventDefault()` on it. Default: true.
|
|
31
|
+
*/
|
|
28
32
|
escapeClose?: boolean;
|
|
29
33
|
/** Allow closing the sidebar. Default: true. */
|
|
30
34
|
canCancel?: boolean;
|
|
@@ -34,7 +34,10 @@ export interface ToastProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
34
34
|
rounded?: boolean;
|
|
35
35
|
/** Pause auto-close timer on hover. Default: false. */
|
|
36
36
|
pauseOnHover?: boolean;
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Whether the toast can be dismissed with Escape. An Escape a popup on the
|
|
39
|
+
* page closed on, by calling `preventDefault()`, leaves it up. Default: true.
|
|
40
|
+
*/
|
|
38
41
|
cancelable?: boolean;
|
|
39
42
|
/** Text for an action button (e.g. "Undo"). */
|
|
40
43
|
actionText?: string;
|
|
@@ -31,7 +31,12 @@ export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
31
31
|
data: AutocompleteItem[] | string[];
|
|
32
32
|
/** The current input value (controlled). */
|
|
33
33
|
value?: string;
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Does nothing: Autocomplete doesn't read it.
|
|
36
|
+
*
|
|
37
|
+
* @deprecated Nothing reads it, and `onSelect` is what reports a pick. It
|
|
38
|
+
* will be removed in the next major version.
|
|
39
|
+
*/
|
|
35
40
|
selected?: AutocompleteItem | string | null;
|
|
36
41
|
/** Placeholder text for the input. */
|
|
37
42
|
placeholder?: string;
|
|
@@ -54,7 +59,13 @@ export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
54
59
|
selectOnClickOutside?: boolean;
|
|
55
60
|
/** Maximum dropdown height in pixels. */
|
|
56
61
|
maxHeight?: number;
|
|
57
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Does nothing: Autocomplete doesn't read it, and always shows its
|
|
64
|
+
* suggestions in a dropdown.
|
|
65
|
+
*
|
|
66
|
+
* @deprecated It will be removed in the next major version, with nothing
|
|
67
|
+
* in its place.
|
|
68
|
+
*/
|
|
58
69
|
dropdown?: boolean;
|
|
59
70
|
/**
|
|
60
71
|
* Show a loading spinner in the input.
|
|
@@ -12,11 +12,11 @@ export interface FieldProps extends React.HTMLAttributes<HTMLDivElement>, Omit<B
|
|
|
12
12
|
hasAddons?: boolean | 'centered' | 'right';
|
|
13
13
|
/** Constrains the field to its content's width (used inside horizontal field bodies). */
|
|
14
14
|
narrow?: boolean;
|
|
15
|
-
/** Field label, rendered above the widget. Automatically names the one control the Field holds: a composed `InputBase`, `SelectBase`, `TextAreaBase`, `DateInputBase`, `TimeInputBase` or `DateTimeInputBase` (an `inline` picker has no input, so it takes nothing), or a bestax input that renders a single input of its own (`Input`, `Select`, `TextArea`, `Numberinput`, `Slider`, `DateInput`, `TimeInput`, `DateTimeInput`, `Autocomplete`, `Taginput`, `File`), adopts a generated id that the label's `htmlFor` points at, and a group (`Radios`, `Checkboxes`, `Rate`, `DateRangeInput`, or a composed `DateRangeInputBase`, `inline` or not) points `aria-labelledby` at the label's own id unless you gave the group an `aria-label` or `aria-labelledby`. A range `Slider` takes the id on its low thumb and also starts each thumb's name with the label through `aria-labelledby`, unless its `ariaLabel` names that thumb or its own `aria-label` or `aria-labelledby` takes the label's place. An `Autocomplete` also names its open suggestion list after the label through `aria-labelledby`. Nothing else takes the label: `Checkbox`, `Radio` and `Switch` are named by their own children, and the label names one only when you wire it as you would any control with an `id` of its own, `labelProps={{ htmlFor }}` plus that control's `id`. Only the single inputs take the `htmlFor`, so once the Field's content has mounted the label keeps it only while one of them holds the id, and drops it over anything else: a group, a `Checkbox`, `Radio` or `Switch`, an `inline` picker, an inner `Field`, an input with an `id` of its own, markup of your own, or nothing at all. A server render, and the first render while hydrating, still write the `htmlFor`, which keeps hydration matching, and an input that mounts later puts it back. The label names an input with an `id` of your own only through `labelProps={{ htmlFor }}` set to that `id`, a `for` it always keeps; `labelProps={{ htmlFor: undefined }}` opts out. Skipped for `grouped`/`hasAddons` fields (multiple controls), and a nested `Field` starts its own scope, so a horizontal Field whose body holds an inner `Field` names the control there only when you wire it. Two controls in one plain labeled Field would both adopt the id, so give each an `id` of its own. */
|
|
15
|
+
/** Field label, rendered above the widget. Automatically names the one control the Field holds: a composed `InputBase`, `SelectBase`, `TextAreaBase`, `DateInputBase`, `TimeInputBase` or `DateTimeInputBase` (an `inline` picker has no input, so it takes nothing), or a bestax input that renders a single input of its own (`Input`, `Select`, `TextArea`, `Numberinput`, `Slider`, `DateInput`, `TimeInput`, `DateTimeInput`, `Autocomplete`, `Taginput`, `File`), adopts a generated id that the label's `htmlFor` points at, and a group (`Radios`, `Checkboxes`, `Rate`, `DateRangeInput`, or a composed `DateRangeInputBase`, `inline` or not) points `aria-labelledby` at the label's own id unless you gave the group an `aria-label` or `aria-labelledby`. A range `Slider` takes the id on its low thumb and also starts each thumb's name with the label through `aria-labelledby`, unless its `ariaLabel` names that thumb or its own `aria-label` or `aria-labelledby` takes the label's place. An `Autocomplete` or a `Taginput` also names its open suggestion list after the label through `aria-labelledby`. Nothing else takes the label: `Checkbox`, `Radio` and `Switch` are named by their own children, and the label names one only when you wire it as you would any control with an `id` of its own, `labelProps={{ htmlFor }}` plus that control's `id`. Only the single inputs take the `htmlFor`, so once the Field's content has mounted the label keeps it only while one of them holds the id, and drops it over anything else: a group, a `Checkbox`, `Radio` or `Switch`, an `inline` picker, an inner `Field`, an input with an `id` of its own, markup of your own, or nothing at all. A server render, and the first render while hydrating, still write the `htmlFor`, which keeps hydration matching, and an input that mounts later puts it back. The label names an input with an `id` of your own only through `labelProps={{ htmlFor }}` set to that `id`, a `for` it always keeps; `labelProps={{ htmlFor: undefined }}` opts out. Skipped for `grouped`/`hasAddons` fields (multiple controls), and a nested `Field` starts its own scope, so a horizontal Field whose body holds an inner `Field` names the control there only when you wire it. Two controls in one plain labeled Field would both adopt the id, so give each an `id` of its own. */
|
|
16
16
|
label?: React.ReactNode;
|
|
17
17
|
/** Size for the label. */
|
|
18
18
|
labelSize?: 'small' | 'normal' | 'medium' | 'large';
|
|
19
|
-
/** Props for the label element. An explicit `htmlFor` key — even set to `undefined` — takes over the association. While the association is on, the label renders with the `id` given here, or a generated one, and a group control, a range `Slider`'s thumbs and an `Autocomplete`'s suggestion list point `aria-labelledby` at it. A label you take over gets no generated id, and no group points at it on its own. With an `id` here, though, a range `Slider` or
|
|
19
|
+
/** Props for the label element. An explicit `htmlFor` key — even set to `undefined` — takes over the association. While the association is on, the label renders with the `id` given here, or a generated one, and a group control, a range `Slider`'s thumbs and an `Autocomplete`'s or `Taginput`'s suggestion list point `aria-labelledby` at it. A label you take over gets no generated id, and no group points at it on its own. With an `id` here, though, a range `Slider`, an `Autocomplete` or a `Taginput` whose `id` your `htmlFor` names still points its thumbs or its suggestion list at it, in a `grouped` or `hasAddons` Field too. To point a group in an inner `Field` at this label by hand, pass that `id`. Nothing in the inner `Field` takes the generated `htmlFor`, so the label drops it after mounting, and adding `htmlFor: undefined` keeps it out of server-rendered markup too. */
|
|
20
20
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
21
21
|
[key: string]: unknown;
|
|
22
22
|
};
|
|
@@ -71,9 +71,9 @@ export interface FieldBodyProps extends React.HTMLAttributes<HTMLDivElement>, Om
|
|
|
71
71
|
* `id`, or give the horizontal `Field` a `label` prop, which renders this
|
|
72
72
|
* column and its `<label>` for you. A `<label>` you put here names the
|
|
73
73
|
* control through its `htmlFor` alone: a range `Slider`'s thumbs and an
|
|
74
|
-
* `Autocomplete`'s suggestion list point `aria-labelledby` at
|
|
75
|
-
* label only when its `label` prop renders it and it names the
|
|
76
|
-
* Where it would not name the control on its own, as in an inner `Field`,
|
|
74
|
+
* `Autocomplete`'s or `Taginput`'s suggestion list point `aria-labelledby` at
|
|
75
|
+
* a `Field`'s label only when its `label` prop renders it and it names the
|
|
76
|
+
* control. Where it would not name the control on its own, as in an inner `Field`,
|
|
77
77
|
* pass `labelProps={{ htmlFor, id }}` with a matching `id` on the control.
|
|
78
78
|
*
|
|
79
79
|
* @function
|
|
@@ -141,7 +141,8 @@ export interface FieldLabelFor {
|
|
|
141
141
|
* renders with, if it has one. An unlabeled Field passes both through
|
|
142
142
|
* together, so a control in the inner Field of a horizontal layout can tell
|
|
143
143
|
* the outer label names it, and point at that label by its id, as a range
|
|
144
|
-
* Slider's thumbs (#981) and Autocomplete's
|
|
144
|
+
* Slider's thumbs (#981) and Autocomplete's and Taginput's suggestion lists
|
|
145
|
+
* (#998, #1082) do. The
|
|
145
146
|
* `htmlFor` is only ever compared with a control's own id, never adopted, so
|
|
146
147
|
* it hands out no id for a control. It keeps the generated id after the
|
|
147
148
|
* label drops a `for` nothing took (#1004), which no control's id matches
|
|
@@ -26,9 +26,9 @@ type IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';
|
|
|
26
26
|
* @extraProp {React.Ref<HTMLInputElement>} [ref] - Ref forwarded to the input element.
|
|
27
27
|
*/
|
|
28
28
|
export interface TaginputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'>, Omit<BulmaClassesProps, 'color'>, FormFieldProps {
|
|
29
|
-
/** Field label. Automatically associated with the text input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired when the tag limit is reached (the input is not rendered). Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`) and you set no `id` here; it then replaces the `aria-label="Add tag"` fallback too. */
|
|
29
|
+
/** Field label. Automatically associated with the text input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired when the tag limit is reached (the input is not rendered). Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`) and you set no `id` here; it then replaces the `aria-label="Add tag"` fallback too. With `data`, the label naming the input also names the open suggestion list, through `aria-labelledby`, when it has an id: this label always does, and an outer `Field`'s does unless you wired it by hand without an `id` in its `labelProps`. Otherwise the list is named "Suggestions". */
|
|
30
30
|
label?: React.ReactNode;
|
|
31
|
-
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
|
|
31
|
+
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). With `data`, while the label names the input, the suggestion list's `aria-labelledby` points at it, through an `id` here when you give one and a generated one otherwise. */
|
|
32
32
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
33
33
|
[key: string]: unknown;
|
|
34
34
|
};
|
|
@@ -38,7 +38,12 @@ export interface TaginputProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
38
38
|
value?: TaginputTag[];
|
|
39
39
|
/** Default tags (uncontrolled). */
|
|
40
40
|
defaultValue?: TaginputTag[];
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Autocomplete suggestions. With `data` set, even to an empty array, the
|
|
43
|
+
* text input is a `role="combobox"` that controls the suggestion list and
|
|
44
|
+
* points `aria-activedescendant` at the highlighted suggestion. Without it
|
|
45
|
+
* there's no list, so the input stays a plain text field.
|
|
46
|
+
*/
|
|
42
47
|
data?: string[];
|
|
43
48
|
/** Placeholder text when no tags. */
|
|
44
49
|
placeholder?: string;
|
|
@@ -20,8 +20,8 @@ interface UseAutoLabelIdOptions {
|
|
|
20
20
|
hasInput?: boolean;
|
|
21
21
|
/**
|
|
22
22
|
* True when the control also points `aria-labelledby` at the label, as a
|
|
23
|
-
* range Slider's thumbs (#981) and Autocomplete's
|
|
24
|
-
* do, so it needs the label's own id. Its own label then gets one
|
|
23
|
+
* range Slider's thumbs (#981) and Autocomplete's and Taginput's
|
|
24
|
+
* suggestion lists (#998, #1082) do, so it needs the label's own id. Its own label then gets one
|
|
25
25
|
* (`labelProps.id` when given, otherwise a generated one), and the hook
|
|
26
26
|
* returns it, or a surrounding Field's, as `labelId`.
|
|
27
27
|
*/
|
|
@@ -22,7 +22,11 @@ export interface LoadingProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
22
22
|
size?: 'small' | 'medium' | 'large';
|
|
23
23
|
/** Color variant for the spinner. Default is light grey. */
|
|
24
24
|
color?: LoadingColor;
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Show a cancel button and allow closing, by a click on the overlay or by
|
|
27
|
+
* Escape. An Escape a popup on the page closed on, by calling
|
|
28
|
+
* `preventDefault()`, doesn't cancel.
|
|
29
|
+
*/
|
|
26
30
|
canCancel?: boolean;
|
|
27
31
|
/** Callback when cancel is triggered. */
|
|
28
32
|
onCancel?: () => void;
|
|
@@ -30,7 +30,10 @@ export interface ModalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
30
30
|
children?: React.ReactNode;
|
|
31
31
|
/**
|
|
32
32
|
* Close the modal when the Escape key is pressed (calls `onClose`). Only the
|
|
33
|
-
* topmost open modal responds, so Escape closes one layer at a time.
|
|
33
|
+
* topmost open modal responds, so Escape closes one layer at a time. A popup
|
|
34
|
+
* inside it, such as a Dropdown's menu or a date picker's calendar, takes
|
|
35
|
+
* its own Escape first, and so does content that calls `preventDefault()`
|
|
36
|
+
* on it.
|
|
34
37
|
* @defaultValue true
|
|
35
38
|
*/
|
|
36
39
|
closeOnEscape?: boolean;
|
|
@@ -24,7 +24,11 @@ export interface SidebarProps extends Omit<React.HTMLAttributes<HTMLElement>, 'c
|
|
|
24
24
|
overlay?: boolean;
|
|
25
25
|
/** Close sidebar when overlay is clicked. Default: true. */
|
|
26
26
|
overlayClose?: boolean;
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Close sidebar on Escape key. A popup inside it, such as a Dropdown's menu
|
|
29
|
+
* or a date picker's calendar, takes its own Escape first, and so does
|
|
30
|
+
* content that calls `preventDefault()` on it. Default: true.
|
|
31
|
+
*/
|
|
28
32
|
escapeClose?: boolean;
|
|
29
33
|
/** Allow closing the sidebar. Default: true. */
|
|
30
34
|
canCancel?: boolean;
|
|
@@ -34,7 +34,10 @@ export interface ToastProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
34
34
|
rounded?: boolean;
|
|
35
35
|
/** Pause auto-close timer on hover. Default: false. */
|
|
36
36
|
pauseOnHover?: boolean;
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Whether the toast can be dismissed with Escape. An Escape a popup on the
|
|
39
|
+
* page closed on, by calling `preventDefault()`, leaves it up. Default: true.
|
|
40
|
+
*/
|
|
38
41
|
cancelable?: boolean;
|
|
39
42
|
/** Text for an action button (e.g. "Undo"). */
|
|
40
43
|
actionText?: string;
|
|
@@ -31,7 +31,12 @@ export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
31
31
|
data: AutocompleteItem[] | string[];
|
|
32
32
|
/** The current input value (controlled). */
|
|
33
33
|
value?: string;
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Does nothing: Autocomplete doesn't read it.
|
|
36
|
+
*
|
|
37
|
+
* @deprecated Nothing reads it, and `onSelect` is what reports a pick. It
|
|
38
|
+
* will be removed in the next major version.
|
|
39
|
+
*/
|
|
35
40
|
selected?: AutocompleteItem | string | null;
|
|
36
41
|
/** Placeholder text for the input. */
|
|
37
42
|
placeholder?: string;
|
|
@@ -54,7 +59,13 @@ export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
54
59
|
selectOnClickOutside?: boolean;
|
|
55
60
|
/** Maximum dropdown height in pixels. */
|
|
56
61
|
maxHeight?: number;
|
|
57
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Does nothing: Autocomplete doesn't read it, and always shows its
|
|
64
|
+
* suggestions in a dropdown.
|
|
65
|
+
*
|
|
66
|
+
* @deprecated It will be removed in the next major version, with nothing
|
|
67
|
+
* in its place.
|
|
68
|
+
*/
|
|
58
69
|
dropdown?: boolean;
|
|
59
70
|
/**
|
|
60
71
|
* Show a loading spinner in the input.
|
|
@@ -12,11 +12,11 @@ export interface FieldProps extends React.HTMLAttributes<HTMLDivElement>, Omit<B
|
|
|
12
12
|
hasAddons?: boolean | 'centered' | 'right';
|
|
13
13
|
/** Constrains the field to its content's width (used inside horizontal field bodies). */
|
|
14
14
|
narrow?: boolean;
|
|
15
|
-
/** Field label, rendered above the widget. Automatically names the one control the Field holds: a composed `InputBase`, `SelectBase`, `TextAreaBase`, `DateInputBase`, `TimeInputBase` or `DateTimeInputBase` (an `inline` picker has no input, so it takes nothing), or a bestax input that renders a single input of its own (`Input`, `Select`, `TextArea`, `Numberinput`, `Slider`, `DateInput`, `TimeInput`, `DateTimeInput`, `Autocomplete`, `Taginput`, `File`), adopts a generated id that the label's `htmlFor` points at, and a group (`Radios`, `Checkboxes`, `Rate`, `DateRangeInput`, or a composed `DateRangeInputBase`, `inline` or not) points `aria-labelledby` at the label's own id unless you gave the group an `aria-label` or `aria-labelledby`. A range `Slider` takes the id on its low thumb and also starts each thumb's name with the label through `aria-labelledby`, unless its `ariaLabel` names that thumb or its own `aria-label` or `aria-labelledby` takes the label's place. An `Autocomplete` also names its open suggestion list after the label through `aria-labelledby`. Nothing else takes the label: `Checkbox`, `Radio` and `Switch` are named by their own children, and the label names one only when you wire it as you would any control with an `id` of its own, `labelProps={{ htmlFor }}` plus that control's `id`. Only the single inputs take the `htmlFor`, so once the Field's content has mounted the label keeps it only while one of them holds the id, and drops it over anything else: a group, a `Checkbox`, `Radio` or `Switch`, an `inline` picker, an inner `Field`, an input with an `id` of its own, markup of your own, or nothing at all. A server render, and the first render while hydrating, still write the `htmlFor`, which keeps hydration matching, and an input that mounts later puts it back. The label names an input with an `id` of your own only through `labelProps={{ htmlFor }}` set to that `id`, a `for` it always keeps; `labelProps={{ htmlFor: undefined }}` opts out. Skipped for `grouped`/`hasAddons` fields (multiple controls), and a nested `Field` starts its own scope, so a horizontal Field whose body holds an inner `Field` names the control there only when you wire it. Two controls in one plain labeled Field would both adopt the id, so give each an `id` of its own. */
|
|
15
|
+
/** Field label, rendered above the widget. Automatically names the one control the Field holds: a composed `InputBase`, `SelectBase`, `TextAreaBase`, `DateInputBase`, `TimeInputBase` or `DateTimeInputBase` (an `inline` picker has no input, so it takes nothing), or a bestax input that renders a single input of its own (`Input`, `Select`, `TextArea`, `Numberinput`, `Slider`, `DateInput`, `TimeInput`, `DateTimeInput`, `Autocomplete`, `Taginput`, `File`), adopts a generated id that the label's `htmlFor` points at, and a group (`Radios`, `Checkboxes`, `Rate`, `DateRangeInput`, or a composed `DateRangeInputBase`, `inline` or not) points `aria-labelledby` at the label's own id unless you gave the group an `aria-label` or `aria-labelledby`. A range `Slider` takes the id on its low thumb and also starts each thumb's name with the label through `aria-labelledby`, unless its `ariaLabel` names that thumb or its own `aria-label` or `aria-labelledby` takes the label's place. An `Autocomplete` or a `Taginput` also names its open suggestion list after the label through `aria-labelledby`. Nothing else takes the label: `Checkbox`, `Radio` and `Switch` are named by their own children, and the label names one only when you wire it as you would any control with an `id` of its own, `labelProps={{ htmlFor }}` plus that control's `id`. Only the single inputs take the `htmlFor`, so once the Field's content has mounted the label keeps it only while one of them holds the id, and drops it over anything else: a group, a `Checkbox`, `Radio` or `Switch`, an `inline` picker, an inner `Field`, an input with an `id` of its own, markup of your own, or nothing at all. A server render, and the first render while hydrating, still write the `htmlFor`, which keeps hydration matching, and an input that mounts later puts it back. The label names an input with an `id` of your own only through `labelProps={{ htmlFor }}` set to that `id`, a `for` it always keeps; `labelProps={{ htmlFor: undefined }}` opts out. Skipped for `grouped`/`hasAddons` fields (multiple controls), and a nested `Field` starts its own scope, so a horizontal Field whose body holds an inner `Field` names the control there only when you wire it. Two controls in one plain labeled Field would both adopt the id, so give each an `id` of its own. */
|
|
16
16
|
label?: React.ReactNode;
|
|
17
17
|
/** Size for the label. */
|
|
18
18
|
labelSize?: 'small' | 'normal' | 'medium' | 'large';
|
|
19
|
-
/** Props for the label element. An explicit `htmlFor` key — even set to `undefined` — takes over the association. While the association is on, the label renders with the `id` given here, or a generated one, and a group control, a range `Slider`'s thumbs and an `Autocomplete`'s suggestion list point `aria-labelledby` at it. A label you take over gets no generated id, and no group points at it on its own. With an `id` here, though, a range `Slider` or
|
|
19
|
+
/** Props for the label element. An explicit `htmlFor` key — even set to `undefined` — takes over the association. While the association is on, the label renders with the `id` given here, or a generated one, and a group control, a range `Slider`'s thumbs and an `Autocomplete`'s or `Taginput`'s suggestion list point `aria-labelledby` at it. A label you take over gets no generated id, and no group points at it on its own. With an `id` here, though, a range `Slider`, an `Autocomplete` or a `Taginput` whose `id` your `htmlFor` names still points its thumbs or its suggestion list at it, in a `grouped` or `hasAddons` Field too. To point a group in an inner `Field` at this label by hand, pass that `id`. Nothing in the inner `Field` takes the generated `htmlFor`, so the label drops it after mounting, and adding `htmlFor: undefined` keeps it out of server-rendered markup too. */
|
|
20
20
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
21
21
|
[key: string]: unknown;
|
|
22
22
|
};
|
|
@@ -71,9 +71,9 @@ export interface FieldBodyProps extends React.HTMLAttributes<HTMLDivElement>, Om
|
|
|
71
71
|
* `id`, or give the horizontal `Field` a `label` prop, which renders this
|
|
72
72
|
* column and its `<label>` for you. A `<label>` you put here names the
|
|
73
73
|
* control through its `htmlFor` alone: a range `Slider`'s thumbs and an
|
|
74
|
-
* `Autocomplete`'s suggestion list point `aria-labelledby` at
|
|
75
|
-
* label only when its `label` prop renders it and it names the
|
|
76
|
-
* Where it would not name the control on its own, as in an inner `Field`,
|
|
74
|
+
* `Autocomplete`'s or `Taginput`'s suggestion list point `aria-labelledby` at
|
|
75
|
+
* a `Field`'s label only when its `label` prop renders it and it names the
|
|
76
|
+
* control. Where it would not name the control on its own, as in an inner `Field`,
|
|
77
77
|
* pass `labelProps={{ htmlFor, id }}` with a matching `id` on the control.
|
|
78
78
|
*
|
|
79
79
|
* @function
|
|
@@ -141,7 +141,8 @@ export interface FieldLabelFor {
|
|
|
141
141
|
* renders with, if it has one. An unlabeled Field passes both through
|
|
142
142
|
* together, so a control in the inner Field of a horizontal layout can tell
|
|
143
143
|
* the outer label names it, and point at that label by its id, as a range
|
|
144
|
-
* Slider's thumbs (#981) and Autocomplete's
|
|
144
|
+
* Slider's thumbs (#981) and Autocomplete's and Taginput's suggestion lists
|
|
145
|
+
* (#998, #1082) do. The
|
|
145
146
|
* `htmlFor` is only ever compared with a control's own id, never adopted, so
|
|
146
147
|
* it hands out no id for a control. It keeps the generated id after the
|
|
147
148
|
* label drops a `for` nothing took (#1004), which no control's id matches
|
|
@@ -26,9 +26,9 @@ type IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';
|
|
|
26
26
|
* @extraProp {React.Ref<HTMLInputElement>} [ref] - Ref forwarded to the input element.
|
|
27
27
|
*/
|
|
28
28
|
export interface TaginputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'>, Omit<BulmaClassesProps, 'color'>, FormFieldProps {
|
|
29
|
-
/** Field label. Automatically associated with the text input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired when the tag limit is reached (the input is not rendered). Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`) and you set no `id` here; it then replaces the `aria-label="Add tag"` fallback too. */
|
|
29
|
+
/** Field label. Automatically associated with the text input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired when the tag limit is reached (the input is not rendered). Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`) and you set no `id` here; it then replaces the `aria-label="Add tag"` fallback too. With `data`, the label naming the input also names the open suggestion list, through `aria-labelledby`, when it has an id: this label always does, and an outer `Field`'s does unless you wired it by hand without an `id` in its `labelProps`. Otherwise the list is named "Suggestions". */
|
|
30
30
|
label?: React.ReactNode;
|
|
31
|
-
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
|
|
31
|
+
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). With `data`, while the label names the input, the suggestion list's `aria-labelledby` points at it, through an `id` here when you give one and a generated one otherwise. */
|
|
32
32
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
33
33
|
[key: string]: unknown;
|
|
34
34
|
};
|
|
@@ -38,7 +38,12 @@ export interface TaginputProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
38
38
|
value?: TaginputTag[];
|
|
39
39
|
/** Default tags (uncontrolled). */
|
|
40
40
|
defaultValue?: TaginputTag[];
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Autocomplete suggestions. With `data` set, even to an empty array, the
|
|
43
|
+
* text input is a `role="combobox"` that controls the suggestion list and
|
|
44
|
+
* points `aria-activedescendant` at the highlighted suggestion. Without it
|
|
45
|
+
* there's no list, so the input stays a plain text field.
|
|
46
|
+
*/
|
|
42
47
|
data?: string[];
|
|
43
48
|
/** Placeholder text when no tags. */
|
|
44
49
|
placeholder?: string;
|
|
@@ -20,8 +20,8 @@ interface UseAutoLabelIdOptions {
|
|
|
20
20
|
hasInput?: boolean;
|
|
21
21
|
/**
|
|
22
22
|
* True when the control also points `aria-labelledby` at the label, as a
|
|
23
|
-
* range Slider's thumbs (#981) and Autocomplete's
|
|
24
|
-
* do, so it needs the label's own id. Its own label then gets one
|
|
23
|
+
* range Slider's thumbs (#981) and Autocomplete's and Taginput's
|
|
24
|
+
* suggestion lists (#998, #1082) do, so it needs the label's own id. Its own label then gets one
|
|
25
25
|
* (`labelProps.id` when given, otherwise a generated one), and the hook
|
|
26
26
|
* returns it, or a surrounding Field's, as `labelId`.
|
|
27
27
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allxsmith/bestax-bulma",
|
|
3
|
-
"version": "5.34.
|
|
3
|
+
"version": "5.34.2",
|
|
4
4
|
"description": "A fully-typed React component library for the Bulma CSS framework. Build modern UIs quickly with reusable, accessible, and customizable Bulma-based React components.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.esm.js",
|