@allxsmith/bestax-bulma 5.27.4 → 5.27.6
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/form/Autocomplete.js +9 -9
- package/dist/esm/form/Autocomplete.js.map +1 -1
- package/dist/esm/form/DateInputBase.js +8 -1
- package/dist/esm/form/DateInputBase.js.map +1 -1
- package/dist/esm/form/DateTimeInputBase.js +8 -1
- package/dist/esm/form/DateTimeInputBase.js.map +1 -1
- package/dist/esm/form/Field.js +29 -13
- package/dist/esm/form/Field.js.map +1 -1
- package/dist/esm/form/FormContext.js +20 -15
- package/dist/esm/form/FormContext.js.map +1 -1
- package/dist/esm/form/Slider.js.map +1 -1
- package/dist/esm/form/TimeInputBase.js +8 -1
- package/dist/esm/form/TimeInputBase.js.map +1 -1
- package/dist/esm/form/useAutoLabelId.js +6 -5
- package/dist/esm/form/useAutoLabelId.js.map +1 -1
- package/dist/index.cjs +85 -45
- package/dist/index.cjs.map +1 -1
- package/dist/types/form/Autocomplete.d.ts +2 -2
- package/dist/types/form/Field.d.ts +16 -4
- package/dist/types/form/FormContext.d.ts +28 -16
- package/dist/types/form/Slider.d.ts +1 -1
- package/dist/types/form/useAutoLabelId.d.ts +7 -5
- package/dist/types-cjs/form/Autocomplete.d.ts +2 -2
- package/dist/types-cjs/form/Field.d.ts +16 -4
- package/dist/types-cjs/form/FormContext.d.ts +28 -16
- package/dist/types-cjs/form/Slider.d.ts +1 -1
- package/dist/types-cjs/form/useAutoLabelId.d.ts +7 -5
- package/package.json +3 -3
|
@@ -19,9 +19,9 @@ export interface AutocompleteItem {
|
|
|
19
19
|
* @extraProp {React.Ref<HTMLInputElement>} [ref] - Ref forwarded to the input element.
|
|
20
20
|
*/
|
|
21
21
|
export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect' | 'onInput'>, Omit<BulmaClassesProps, 'color'>, FormFieldProps {
|
|
22
|
-
/** Field label
|
|
22
|
+
/** Field label, associated with the text input via `htmlFor`: through your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose label names the input instead when it points at it. The `Field` points its label there itself when the Autocomplete has no `id` and no inner `Field` sits between them (and the `Field` is not `grouped` or `hasAddons`); a label you wire by hand with `labelProps.htmlFor` points at the input with that `id`. 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". */
|
|
23
23
|
label?: React.ReactNode;
|
|
24
|
-
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id
|
|
24
|
+
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (the input then gets no generated id). 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. */
|
|
25
25
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
26
26
|
[key: string]: unknown;
|
|
27
27
|
};
|
|
@@ -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` or `
|
|
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`) 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. Only the single inputs take the `htmlFor`, so with a group or any other content it matches nothing. Pass `labelProps={{ htmlFor }}` to wire your own `id`, or `labelProps={{ htmlFor: undefined }}` to opt 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.
|
|
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 an `Autocomplete` 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` with `htmlFor: undefined`, or the label keeps a generated `htmlFor` that nothing takes. */
|
|
20
20
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
21
21
|
[key: string]: unknown;
|
|
22
22
|
};
|
|
@@ -64,14 +64,26 @@ export interface FieldBodyProps extends React.HTMLAttributes<HTMLDivElement>, Om
|
|
|
64
64
|
children?: React.ReactNode;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
|
-
* FieldLabel component for rendering a Bulma field label.
|
|
67
|
+
* FieldLabel component for rendering a Bulma field label. It renders the
|
|
68
|
+
* label column of a horizontal `Field` (a `div` with the `field-label` class),
|
|
69
|
+
* not a `<label>`, so text placed straight in it names nothing. Put a `<label>`
|
|
70
|
+
* with the `label` class inside it and point its `htmlFor` at the control's
|
|
71
|
+
* `id`, or give the horizontal `Field` a `label` prop, which renders this
|
|
72
|
+
* column and its `<label>` for you. A `<label>` you put here names the
|
|
73
|
+
* control through its `htmlFor` alone: a range `Slider`'s thumbs and an
|
|
74
|
+
* `Autocomplete`'s suggestion list point `aria-labelledby` at a `Field`'s
|
|
75
|
+
* label only when its `label` prop renders it and it names the control.
|
|
76
|
+
* Where it would not name the control on its own, as in an inner `Field`,
|
|
77
|
+
* pass `labelProps={{ htmlFor, id }}` with a matching `id` on the control.
|
|
68
78
|
*
|
|
69
79
|
* @function
|
|
70
80
|
* @param {FieldLabelProps} props - Props for the FieldLabel component.
|
|
71
81
|
* @returns {JSX.Element} The rendered field label.
|
|
72
82
|
*
|
|
73
83
|
* @example
|
|
74
|
-
* <FieldLabel size="normal">
|
|
84
|
+
* <FieldLabel size="normal">
|
|
85
|
+
* <label className="label" htmlFor="name">Name</label>
|
|
86
|
+
* </FieldLabel>
|
|
75
87
|
*/
|
|
76
88
|
export declare const FieldLabel: React.FC<FieldLabelProps>;
|
|
77
89
|
/**
|
|
@@ -105,9 +105,10 @@ export declare const rendersOwnControl: (component: string, options: OwnControlO
|
|
|
105
105
|
* The id a labeled Field wants its single composed control to adopt (#495).
|
|
106
106
|
* `undefined` outside a Field, in unlabeled/grouped/addons Fields, or when the
|
|
107
107
|
* user took over the association with an explicit `labelProps.htmlFor`.
|
|
108
|
-
* Consumed by the single-control bases (InputBase, SelectBase, TextAreaBase
|
|
109
|
-
* and
|
|
110
|
-
*
|
|
108
|
+
* Consumed by the single-control bases (InputBase, SelectBase, TextAreaBase,
|
|
109
|
+
* and the date and time picker bases unless inline, #968) and, through
|
|
110
|
+
* `useAutoLabelId`, by the convenience inputs that render an input of their
|
|
111
|
+
* own (#939). Internal; not part of the public API.
|
|
111
112
|
*/
|
|
112
113
|
export declare const useFieldLabelId: () => string | undefined;
|
|
113
114
|
/** Provider for the Field label-target id — used internally by Field. */
|
|
@@ -115,26 +116,37 @@ export declare const FieldLabelIdProvider: React.Provider<string | undefined>;
|
|
|
115
116
|
/**
|
|
116
117
|
* The id of a labeled Field's own `<label>`, for a group control (Radios,
|
|
117
118
|
* Checkboxes, Rate, DateRangeInput) to point `aria-labelledby` at, since a group cannot take
|
|
118
|
-
* the label's `htmlFor` (#939)
|
|
119
|
-
*
|
|
120
|
-
* as {@link useFieldLabelId}. Consumed through `useAutoLabelledBy` and
|
|
121
|
-
* `useAutoLabelId`.
|
|
119
|
+
* the label's `htmlFor` (#939). Set under the same conditions as
|
|
120
|
+
* {@link useFieldLabelId}. Consumed through `useAutoLabelledBy`.
|
|
122
121
|
* Internal; not part of the public API.
|
|
123
122
|
*/
|
|
124
123
|
export declare const useFieldLabelElementId: () => string | undefined;
|
|
125
124
|
/** Provider for the Field label's own id, used internally by Field. */
|
|
126
125
|
export declare const FieldLabelElementIdProvider: React.Provider<string | undefined>;
|
|
126
|
+
/** The nearest labeled Field's `<label>`, as {@link useFieldLabelFor} reads it. */
|
|
127
|
+
export interface FieldLabelFor {
|
|
128
|
+
/** What the label's `htmlFor` points at, generated or the caller's. */
|
|
129
|
+
htmlFor?: string;
|
|
130
|
+
/** The id the label renders with, the caller's or a generated one, if any. */
|
|
131
|
+
id?: string;
|
|
132
|
+
}
|
|
127
133
|
/**
|
|
128
|
-
*
|
|
129
|
-
* generated
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
+
* The nearest labeled Field's `<label>`: what it points `htmlFor` at, the id
|
|
135
|
+
* it generated or the caller's own `labelProps.htmlFor`, and the id the label
|
|
136
|
+
* renders with, if it has one. An unlabeled Field passes both through
|
|
137
|
+
* together, so a control in the inner Field of a horizontal layout can tell
|
|
138
|
+
* the outer label names it, and point at that label by its id, as a range
|
|
139
|
+
* Slider's thumbs (#981) and Autocomplete's suggestion list (#998) do. The
|
|
140
|
+
* `htmlFor` is only ever compared with a control's own id, never adopted, so
|
|
141
|
+
* it hands out no id for a control. The `id` is set only while that label
|
|
142
|
+
* renders with it. Unlike {@link useFieldLabelId}, it is set in a `grouped`
|
|
143
|
+
* or `hasAddons` Field too, so a label wired by hand names the control its
|
|
144
|
+
* `for` picks in those rows as well. Consumed through `useAutoLabelId`.
|
|
145
|
+
* Internal; not part of the public API.
|
|
134
146
|
*/
|
|
135
|
-
export declare const useFieldLabelFor: () =>
|
|
136
|
-
/** Provider for the Field label's `htmlFor` target, used internally by Field. */
|
|
137
|
-
export declare const FieldLabelForProvider: React.Provider<
|
|
147
|
+
export declare const useFieldLabelFor: () => FieldLabelFor;
|
|
148
|
+
/** Provider for the Field label's `htmlFor` target and id, used internally by Field. */
|
|
149
|
+
export declare const FieldLabelForProvider: React.Provider<FieldLabelFor>;
|
|
138
150
|
/**
|
|
139
151
|
* Shape of the Radios group context. The group provides:
|
|
140
152
|
* - `name`: shared form field name (Stage 1)
|
|
@@ -22,7 +22,7 @@ export interface SliderMark {
|
|
|
22
22
|
* Shared base props for single and range Slider modes.
|
|
23
23
|
*/
|
|
24
24
|
interface SliderBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'size' | 'onChange' | 'value' | 'defaultValue'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'>, FormFieldProps {
|
|
25
|
-
/** Field label. Automatically associated with the slider input via `htmlFor` — uses your `id` when provided, otherwise a generated one. In range mode the `htmlFor` targets the low (minimum) thumb, and the label also starts each thumb's name through `aria-labelledby`, as in "Price Minimum value" and "Price Maximum value", unless an `aria-label` or `aria-labelledby` on the Slider takes its place there. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`), naming a range Slider's thumbs the same way. */
|
|
25
|
+
/** Field label. Automatically associated with the slider input via `htmlFor` — uses your `id` when provided, otherwise a generated one. In range mode the `htmlFor` targets the low (minimum) thumb, and the label also starts each thumb's name through `aria-labelledby`, as in "Price Minimum value" and "Price Maximum value", unless an `aria-label` or `aria-labelledby` on the Slider takes its place there. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`), naming a range Slider's thumbs the same way. A `Field` label you wire by hand to the low thumb with `labelProps.htmlFor` names the thumbs too when you also give it an `id` there, since the `Field` generates none for it. */
|
|
26
26
|
label?: React.ReactNode;
|
|
27
27
|
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). In range mode an `id` here is the one the thumbs' `aria-labelledby` points at, in place of a generated one. */
|
|
28
28
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
@@ -20,9 +20,10 @@ 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
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* range Slider's thumbs (#981) and Autocomplete's suggestion list (#998)
|
|
24
|
+
* do, so it needs the label's own id. Its own label then gets one
|
|
25
|
+
* (`labelProps.id` when given, otherwise a generated one), and the hook
|
|
26
|
+
* returns it, or a surrounding Field's, as `labelId`.
|
|
26
27
|
*/
|
|
27
28
|
needsLabelId?: boolean;
|
|
28
29
|
}
|
|
@@ -45,8 +46,9 @@ export declare function useAutoLabelId({ label, id, labelProps, rendersLabel, ha
|
|
|
45
46
|
labelled: boolean;
|
|
46
47
|
/**
|
|
47
48
|
* With `needsLabelId`, the id of the label that names `controlId`, its own
|
|
48
|
-
* or a surrounding Field's. Undefined when no label names it, or when
|
|
49
|
-
* Field's label
|
|
49
|
+
* or a surrounding Field's. Undefined when no label names it, or when a
|
|
50
|
+
* Field's label wired by hand names it without an `id` in its labelProps,
|
|
51
|
+
* since the Field generates none for a label wired by hand.
|
|
50
52
|
*/
|
|
51
53
|
labelId: string | undefined;
|
|
52
54
|
};
|
|
@@ -19,9 +19,9 @@ export interface AutocompleteItem {
|
|
|
19
19
|
* @extraProp {React.Ref<HTMLInputElement>} [ref] - Ref forwarded to the input element.
|
|
20
20
|
*/
|
|
21
21
|
export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect' | 'onInput'>, Omit<BulmaClassesProps, 'color'>, FormFieldProps {
|
|
22
|
-
/** Field label
|
|
22
|
+
/** Field label, associated with the text input via `htmlFor`: through your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose label names the input instead when it points at it. The `Field` points its label there itself when the Autocomplete has no `id` and no inner `Field` sits between them (and the `Field` is not `grouped` or `hasAddons`); a label you wire by hand with `labelProps.htmlFor` points at the input with that `id`. 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". */
|
|
23
23
|
label?: React.ReactNode;
|
|
24
|
-
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id
|
|
24
|
+
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (the input then gets no generated id). 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. */
|
|
25
25
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
26
26
|
[key: string]: unknown;
|
|
27
27
|
};
|
|
@@ -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` or `
|
|
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`) 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. Only the single inputs take the `htmlFor`, so with a group or any other content it matches nothing. Pass `labelProps={{ htmlFor }}` to wire your own `id`, or `labelProps={{ htmlFor: undefined }}` to opt 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.
|
|
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 an `Autocomplete` 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` with `htmlFor: undefined`, or the label keeps a generated `htmlFor` that nothing takes. */
|
|
20
20
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
21
21
|
[key: string]: unknown;
|
|
22
22
|
};
|
|
@@ -64,14 +64,26 @@ export interface FieldBodyProps extends React.HTMLAttributes<HTMLDivElement>, Om
|
|
|
64
64
|
children?: React.ReactNode;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
|
-
* FieldLabel component for rendering a Bulma field label.
|
|
67
|
+
* FieldLabel component for rendering a Bulma field label. It renders the
|
|
68
|
+
* label column of a horizontal `Field` (a `div` with the `field-label` class),
|
|
69
|
+
* not a `<label>`, so text placed straight in it names nothing. Put a `<label>`
|
|
70
|
+
* with the `label` class inside it and point its `htmlFor` at the control's
|
|
71
|
+
* `id`, or give the horizontal `Field` a `label` prop, which renders this
|
|
72
|
+
* column and its `<label>` for you. A `<label>` you put here names the
|
|
73
|
+
* control through its `htmlFor` alone: a range `Slider`'s thumbs and an
|
|
74
|
+
* `Autocomplete`'s suggestion list point `aria-labelledby` at a `Field`'s
|
|
75
|
+
* label only when its `label` prop renders it and it names the control.
|
|
76
|
+
* Where it would not name the control on its own, as in an inner `Field`,
|
|
77
|
+
* pass `labelProps={{ htmlFor, id }}` with a matching `id` on the control.
|
|
68
78
|
*
|
|
69
79
|
* @function
|
|
70
80
|
* @param {FieldLabelProps} props - Props for the FieldLabel component.
|
|
71
81
|
* @returns {JSX.Element} The rendered field label.
|
|
72
82
|
*
|
|
73
83
|
* @example
|
|
74
|
-
* <FieldLabel size="normal">
|
|
84
|
+
* <FieldLabel size="normal">
|
|
85
|
+
* <label className="label" htmlFor="name">Name</label>
|
|
86
|
+
* </FieldLabel>
|
|
75
87
|
*/
|
|
76
88
|
export declare const FieldLabel: React.FC<FieldLabelProps>;
|
|
77
89
|
/**
|
|
@@ -105,9 +105,10 @@ export declare const rendersOwnControl: (component: string, options: OwnControlO
|
|
|
105
105
|
* The id a labeled Field wants its single composed control to adopt (#495).
|
|
106
106
|
* `undefined` outside a Field, in unlabeled/grouped/addons Fields, or when the
|
|
107
107
|
* user took over the association with an explicit `labelProps.htmlFor`.
|
|
108
|
-
* Consumed by the single-control bases (InputBase, SelectBase, TextAreaBase
|
|
109
|
-
* and
|
|
110
|
-
*
|
|
108
|
+
* Consumed by the single-control bases (InputBase, SelectBase, TextAreaBase,
|
|
109
|
+
* and the date and time picker bases unless inline, #968) and, through
|
|
110
|
+
* `useAutoLabelId`, by the convenience inputs that render an input of their
|
|
111
|
+
* own (#939). Internal; not part of the public API.
|
|
111
112
|
*/
|
|
112
113
|
export declare const useFieldLabelId: () => string | undefined;
|
|
113
114
|
/** Provider for the Field label-target id — used internally by Field. */
|
|
@@ -115,26 +116,37 @@ export declare const FieldLabelIdProvider: React.Provider<string | undefined>;
|
|
|
115
116
|
/**
|
|
116
117
|
* The id of a labeled Field's own `<label>`, for a group control (Radios,
|
|
117
118
|
* Checkboxes, Rate, DateRangeInput) to point `aria-labelledby` at, since a group cannot take
|
|
118
|
-
* the label's `htmlFor` (#939)
|
|
119
|
-
*
|
|
120
|
-
* as {@link useFieldLabelId}. Consumed through `useAutoLabelledBy` and
|
|
121
|
-
* `useAutoLabelId`.
|
|
119
|
+
* the label's `htmlFor` (#939). Set under the same conditions as
|
|
120
|
+
* {@link useFieldLabelId}. Consumed through `useAutoLabelledBy`.
|
|
122
121
|
* Internal; not part of the public API.
|
|
123
122
|
*/
|
|
124
123
|
export declare const useFieldLabelElementId: () => string | undefined;
|
|
125
124
|
/** Provider for the Field label's own id, used internally by Field. */
|
|
126
125
|
export declare const FieldLabelElementIdProvider: React.Provider<string | undefined>;
|
|
126
|
+
/** The nearest labeled Field's `<label>`, as {@link useFieldLabelFor} reads it. */
|
|
127
|
+
export interface FieldLabelFor {
|
|
128
|
+
/** What the label's `htmlFor` points at, generated or the caller's. */
|
|
129
|
+
htmlFor?: string;
|
|
130
|
+
/** The id the label renders with, the caller's or a generated one, if any. */
|
|
131
|
+
id?: string;
|
|
132
|
+
}
|
|
127
133
|
/**
|
|
128
|
-
*
|
|
129
|
-
* generated
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
+
* The nearest labeled Field's `<label>`: what it points `htmlFor` at, the id
|
|
135
|
+
* it generated or the caller's own `labelProps.htmlFor`, and the id the label
|
|
136
|
+
* renders with, if it has one. An unlabeled Field passes both through
|
|
137
|
+
* together, so a control in the inner Field of a horizontal layout can tell
|
|
138
|
+
* the outer label names it, and point at that label by its id, as a range
|
|
139
|
+
* Slider's thumbs (#981) and Autocomplete's suggestion list (#998) do. The
|
|
140
|
+
* `htmlFor` is only ever compared with a control's own id, never adopted, so
|
|
141
|
+
* it hands out no id for a control. The `id` is set only while that label
|
|
142
|
+
* renders with it. Unlike {@link useFieldLabelId}, it is set in a `grouped`
|
|
143
|
+
* or `hasAddons` Field too, so a label wired by hand names the control its
|
|
144
|
+
* `for` picks in those rows as well. Consumed through `useAutoLabelId`.
|
|
145
|
+
* Internal; not part of the public API.
|
|
134
146
|
*/
|
|
135
|
-
export declare const useFieldLabelFor: () =>
|
|
136
|
-
/** Provider for the Field label's `htmlFor` target, used internally by Field. */
|
|
137
|
-
export declare const FieldLabelForProvider: React.Provider<
|
|
147
|
+
export declare const useFieldLabelFor: () => FieldLabelFor;
|
|
148
|
+
/** Provider for the Field label's `htmlFor` target and id, used internally by Field. */
|
|
149
|
+
export declare const FieldLabelForProvider: React.Provider<FieldLabelFor>;
|
|
138
150
|
/**
|
|
139
151
|
* Shape of the Radios group context. The group provides:
|
|
140
152
|
* - `name`: shared form field name (Stage 1)
|
|
@@ -22,7 +22,7 @@ export interface SliderMark {
|
|
|
22
22
|
* Shared base props for single and range Slider modes.
|
|
23
23
|
*/
|
|
24
24
|
interface SliderBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'size' | 'onChange' | 'value' | 'defaultValue'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'>, FormFieldProps {
|
|
25
|
-
/** Field label. Automatically associated with the slider input via `htmlFor` — uses your `id` when provided, otherwise a generated one. In range mode the `htmlFor` targets the low (minimum) thumb, and the label also starts each thumb's name through `aria-labelledby`, as in "Price Minimum value" and "Price Maximum value", unless an `aria-label` or `aria-labelledby` on the Slider takes its place there. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`), naming a range Slider's thumbs the same way. */
|
|
25
|
+
/** Field label. Automatically associated with the slider input via `htmlFor` — uses your `id` when provided, otherwise a generated one. In range mode the `htmlFor` targets the low (minimum) thumb, and the label also starts each thumb's name through `aria-labelledby`, as in "Price Minimum value" and "Price Maximum value", unless an `aria-label` or `aria-labelledby` on the Slider takes its place there. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`), naming a range Slider's thumbs the same way. A `Field` label you wire by hand to the low thumb with `labelProps.htmlFor` names the thumbs too when you also give it an `id` there, since the `Field` generates none for it. */
|
|
26
26
|
label?: React.ReactNode;
|
|
27
27
|
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). In range mode an `id` here is the one the thumbs' `aria-labelledby` points at, in place of a generated one. */
|
|
28
28
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
@@ -20,9 +20,10 @@ 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
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* range Slider's thumbs (#981) and Autocomplete's suggestion list (#998)
|
|
24
|
+
* do, so it needs the label's own id. Its own label then gets one
|
|
25
|
+
* (`labelProps.id` when given, otherwise a generated one), and the hook
|
|
26
|
+
* returns it, or a surrounding Field's, as `labelId`.
|
|
26
27
|
*/
|
|
27
28
|
needsLabelId?: boolean;
|
|
28
29
|
}
|
|
@@ -45,8 +46,9 @@ export declare function useAutoLabelId({ label, id, labelProps, rendersLabel, ha
|
|
|
45
46
|
labelled: boolean;
|
|
46
47
|
/**
|
|
47
48
|
* With `needsLabelId`, the id of the label that names `controlId`, its own
|
|
48
|
-
* or a surrounding Field's. Undefined when no label names it, or when
|
|
49
|
-
* Field's label
|
|
49
|
+
* or a surrounding Field's. Undefined when no label names it, or when a
|
|
50
|
+
* Field's label wired by hand names it without an `id` in its labelProps,
|
|
51
|
+
* since the Field generates none for a label wired by hand.
|
|
50
52
|
*/
|
|
51
53
|
labelId: string | undefined;
|
|
52
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allxsmith/bestax-bulma",
|
|
3
|
-
"version": "5.27.
|
|
3
|
+
"version": "5.27.6",
|
|
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",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"jest": "^30.2.0",
|
|
47
47
|
"jest-environment-jsdom": "^30.2.0",
|
|
48
48
|
"material-icons": "^1.13.14",
|
|
49
|
-
"material-symbols": "^0.
|
|
49
|
+
"material-symbols": "^0.47.6",
|
|
50
50
|
"playwright": "^1.62.1",
|
|
51
51
|
"prettier": "^3.9.6",
|
|
52
52
|
"rimraf": "^6.0.1",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@mdi/font": "^7.4.47",
|
|
69
69
|
"ionicons": "^8.0.0",
|
|
70
70
|
"material-icons": "^1.13.10",
|
|
71
|
-
"material-symbols": "^0.34.1 || ^0.45.0 || ^0.46.0",
|
|
71
|
+
"material-symbols": "^0.34.1 || ^0.45.0 || ^0.46.0 || ^0.47.0",
|
|
72
72
|
"react": "^18.0.0 || ^19.0.0",
|
|
73
73
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
74
74
|
},
|