@allxsmith/bestax-bulma 5.27.1 → 5.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/esm/form/Autocomplete.js.map +1 -1
  2. package/dist/esm/form/Checkboxes.js +1 -0
  3. package/dist/esm/form/Checkboxes.js.map +1 -1
  4. package/dist/esm/form/DateInput.js +2 -1
  5. package/dist/esm/form/DateInput.js.map +1 -1
  6. package/dist/esm/form/DateRangeInput.js +1 -0
  7. package/dist/esm/form/DateRangeInput.js.map +1 -1
  8. package/dist/esm/form/DateTimeInput.js +2 -1
  9. package/dist/esm/form/DateTimeInput.js.map +1 -1
  10. package/dist/esm/form/Field.js +18 -4
  11. package/dist/esm/form/Field.js.map +1 -1
  12. package/dist/esm/form/File.js +4 -1
  13. package/dist/esm/form/File.js.map +1 -1
  14. package/dist/esm/form/FormContext.js +27 -3
  15. package/dist/esm/form/FormContext.js.map +1 -1
  16. package/dist/esm/form/Input.js +1 -1
  17. package/dist/esm/form/Input.js.map +1 -1
  18. package/dist/esm/form/Numberinput.js +3 -1
  19. package/dist/esm/form/Numberinput.js.map +1 -1
  20. package/dist/esm/form/Radios.js +1 -0
  21. package/dist/esm/form/Radios.js.map +1 -1
  22. package/dist/esm/form/Rate.js +1 -0
  23. package/dist/esm/form/Rate.js.map +1 -1
  24. package/dist/esm/form/Select.js +1 -1
  25. package/dist/esm/form/Select.js.map +1 -1
  26. package/dist/esm/form/Slider.js +4 -2
  27. package/dist/esm/form/Slider.js.map +1 -1
  28. package/dist/esm/form/Taginput.js +4 -5
  29. package/dist/esm/form/Taginput.js.map +1 -1
  30. package/dist/esm/form/TextArea.js +1 -1
  31. package/dist/esm/form/TextArea.js.map +1 -1
  32. package/dist/esm/form/TimeInput.js +2 -1
  33. package/dist/esm/form/TimeInput.js.map +1 -1
  34. package/dist/esm/form/useAutoLabelId.js +42 -8
  35. package/dist/esm/form/useAutoLabelId.js.map +1 -1
  36. package/dist/esm/helpers/Config.js.map +1 -1
  37. package/dist/esm/helpers/Theme.js.map +1 -1
  38. package/dist/index.cjs +112 -28
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/types/form/Autocomplete.d.ts +1 -1
  41. package/dist/types/form/Checkboxes.d.ts +1 -1
  42. package/dist/types/form/DateInput.d.ts +1 -1
  43. package/dist/types/form/DateRangeInput.d.ts +1 -1
  44. package/dist/types/form/DateTimeInput.d.ts +1 -1
  45. package/dist/types/form/Field.d.ts +2 -2
  46. package/dist/types/form/File.d.ts +1 -1
  47. package/dist/types/form/FormContext.d.ts +24 -2
  48. package/dist/types/form/Numberinput.d.ts +1 -1
  49. package/dist/types/form/Radios.d.ts +1 -1
  50. package/dist/types/form/Rate.d.ts +1 -1
  51. package/dist/types/form/Slider.d.ts +1 -1
  52. package/dist/types/form/Taginput.d.ts +1 -1
  53. package/dist/types/form/TimeInput.d.ts +1 -1
  54. package/dist/types/form/useAutoLabelId.d.ts +25 -4
  55. package/dist/types/helpers/Config.d.ts +3 -4
  56. package/dist/types/helpers/Theme.d.ts +44 -40
  57. package/dist/types-cjs/form/Autocomplete.d.ts +1 -1
  58. package/dist/types-cjs/form/Checkboxes.d.ts +1 -1
  59. package/dist/types-cjs/form/DateInput.d.ts +1 -1
  60. package/dist/types-cjs/form/DateRangeInput.d.ts +1 -1
  61. package/dist/types-cjs/form/DateTimeInput.d.ts +1 -1
  62. package/dist/types-cjs/form/Field.d.ts +2 -2
  63. package/dist/types-cjs/form/File.d.ts +1 -1
  64. package/dist/types-cjs/form/FormContext.d.ts +24 -2
  65. package/dist/types-cjs/form/Numberinput.d.ts +1 -1
  66. package/dist/types-cjs/form/Radios.d.ts +1 -1
  67. package/dist/types-cjs/form/Rate.d.ts +1 -1
  68. package/dist/types-cjs/form/Slider.d.ts +1 -1
  69. package/dist/types-cjs/form/Taginput.d.ts +1 -1
  70. package/dist/types-cjs/form/TimeInput.d.ts +1 -1
  71. package/dist/types-cjs/form/useAutoLabelId.d.ts +25 -4
  72. package/dist/types-cjs/helpers/Config.d.ts +3 -4
  73. package/dist/types-cjs/helpers/Theme.d.ts +44 -40
  74. package/package.json +1 -1
@@ -19,7 +19,7 @@ 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. Automatically associated with the text input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field` (label that `Field` yourself). */
22
+ /** Field label. Automatically associated with the text input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
23
23
  label?: React.ReactNode;
24
24
  /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
25
25
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -12,7 +12,7 @@ import { FormFieldProps } from './fieldProps.js';
12
12
  * `Field`.
13
13
  */
14
14
  export interface CheckboxesProps extends Omit<BulmaClassesProps, 'color'>, FormFieldProps {
15
- /** Field label naming the whole group. Automatically associated via `aria-labelledby` on the `role="group"` wrapper — uses your `labelProps.id` when provided, otherwise a generated one. Dropped inside an outer `Field` (label that `Field` yourself). */
15
+ /** Field label naming the whole group. Automatically associated via `aria-labelledby` on the `role="group"` wrapper — uses your `labelProps.id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own. */
16
16
  label?: React.ReactNode;
17
17
  /** Props for the label element. An explicit `id` here is used as the `aria-labelledby` target instead of a generated one; any `htmlFor` is ignored (a group label names the group, never a single control). */
18
18
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -22,7 +22,7 @@ import { DateInputBaseProps } from './DateInputBase.js';
22
22
  * @extraProp {React.Ref<HTMLInputElement>} [ref] - Forwarded to the underlying `<input>`.
23
23
  */
24
24
  export interface DateInputProps extends DateInputBaseProps {
25
- /** Field label (component auto-wraps in a `Field` if not already inside). Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label) and dropped inside an outer `Field`. */
25
+ /** Field label (component auto-wraps in a `Field` if not already inside). Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label). Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
26
26
  label?: React.ReactNode;
27
27
  /** Size for the label. */
28
28
  labelSize?: FieldProps['labelSize'];
@@ -19,7 +19,7 @@ import { DateRangeInputBaseProps } from './DateRangeInputBase.js';
19
19
  * @extraProp {React.Ref<HTMLInputElement>} [ref] - Forwarded to the start `<input>`.
20
20
  */
21
21
  export interface DateRangeInputProps extends DateRangeInputBaseProps {
22
- /** Field label naming the whole range. Associated through `aria-labelledby` on the `role="group"` root, since it names two inputs rather than one; uses your `labelProps.id` when provided, otherwise a generated one. Each input keeps its own name, "Start date" or "End date" (`labels.rangeStart` / `labels.rangeEnd`). Dropped inside an outer `Field`. */
22
+ /** Field label naming the whole range. Associated through `aria-labelledby` on the `role="group"` root, since it names two inputs rather than one; uses your `labelProps.id` when provided, otherwise a generated one. Each input keeps its own name, "Start date" or "End date" (`labels.rangeStart` / `labels.rangeEnd`). Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own. */
23
23
  label?: React.ReactNode;
24
24
  /** Size for the label. */
25
25
  labelSize?: FieldProps['labelSize'];
@@ -20,7 +20,7 @@ import { DateTimeInputBaseProps } from './DateTimeInputBase.js';
20
20
  * @extraProp {boolean} [required=false] - Marks the field as required for native HTML form validation.
21
21
  */
22
22
  export interface DateTimeInputProps extends DateTimeInputBaseProps {
23
- /** Field label. Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label) and dropped inside an outer `Field`. */
23
+ /** Field label. Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label). Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
24
24
  label?: React.ReactNode;
25
25
  /** Size for the label. */
26
26
  labelSize?: FieldProps['labelSize'];
@@ -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 associated with a single composed `InputBase`, `SelectBase`, or `TextAreaBase` via a generated id and `htmlFor`. Pass `labelProps={{ htmlFor }}` to wire your own `id`, or `labelProps={{ htmlFor: undefined }}` to opt out. Skipped for `grouped`/`hasAddons` fields (multiple controls). */
15
+ /** Field label, rendered above the widget. Automatically names the one control the Field holds: a composed `InputBase`, `SelectBase` or `TextAreaBase`, 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`. 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. An `id` here is the one a group control's `aria-labelledby` points at; otherwise the label gets a generated one while the association is on. 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
  };
@@ -11,7 +11,7 @@ import { FormFieldProps } from './fieldProps.js';
11
11
  * name on that `Field`.
12
12
  */
13
13
  export interface FileProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'color' | 'type'>, Omit<BulmaClassesProps, 'color'>, FormFieldProps {
14
- /** Field label. Automatically associated with the file input via `htmlFor` — uses your `id` when provided, otherwise a generated one. The input then has two labels (this one plus the wrapping `file-label`); assistive tech reads both. Dropped inside an outer `Field` (label that `Field` yourself). */
14
+ /** Field label. Automatically associated with the file input via `htmlFor` — uses your `id` when provided, otherwise a generated one. The input then has two labels (this one plus the wrapping `file-label`); assistive tech reads both. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
15
15
  label?: React.ReactNode;
16
16
  /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
17
17
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -105,12 +105,34 @@ 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 only by the single-control bases (InputBase, SelectBase,
109
- * TextAreaBase). Internal; not part of the public API.
108
+ * Consumed by the single-control bases (InputBase, SelectBase, TextAreaBase)
109
+ * and, through `useAutoLabelId`, by the convenience inputs that render an
110
+ * input of their own (#939). Internal; not part of the public API.
110
111
  */
111
112
  export declare const useFieldLabelId: () => string | undefined;
112
113
  /** Provider for the Field label-target id — used internally by Field. */
113
114
  export declare const FieldLabelIdProvider: React.Provider<string | undefined>;
115
+ /**
116
+ * The id of a labeled Field's own `<label>`, for a group control (Radios,
117
+ * Checkboxes, Rate, DateRangeInput) to point `aria-labelledby` at, since a group cannot take
118
+ * the label's `htmlFor` (#939). Set under the same conditions as
119
+ * {@link useFieldLabelId}. Consumed through `useAutoLabelledBy`.
120
+ * Internal; not part of the public API.
121
+ */
122
+ export declare const useFieldLabelElementId: () => string | undefined;
123
+ /** Provider for the Field label's own id, used internally by Field. */
124
+ export declare const FieldLabelElementIdProvider: React.Provider<string | undefined>;
125
+ /**
126
+ * What the nearest labeled Field's `<label>` points `htmlFor` at: the id it
127
+ * generated, or the caller's own `labelProps.htmlFor`. An unlabeled Field
128
+ * passes it through, so a control in the inner Field of a horizontal layout
129
+ * can tell the outer label names it. Only ever compared with a control's own
130
+ * id, never adopted, so it hands out no id. Internal; not part of the public
131
+ * API.
132
+ */
133
+ export declare const useFieldLabelFor: () => string | undefined;
134
+ /** Provider for the Field label's `htmlFor` target, used internally by Field. */
135
+ export declare const FieldLabelForProvider: React.Provider<string | undefined>;
114
136
  /**
115
137
  * Shape of the Radios group context. The group provides:
116
138
  * - `name`: shared form field name (Stage 1)
@@ -17,7 +17,7 @@ export type NumberinputVariant = 'plusminus' | 'stepper';
17
17
  * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the input element.
18
18
  */
19
19
  export interface NumberinputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'size' | 'onChange' | 'value' | 'defaultValue' | 'type'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'>, FormFieldProps {
20
- /** Field label. Automatically associated with the number input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired when no Field wrapper is rendered (inside a `Field`, or plusminus `bare`). */
20
+ /** Field label. Automatically associated with the number input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). Not rendered either by a plusminus `bare` Numberinput outside a `Field`. */
21
21
  label?: React.ReactNode;
22
22
  /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
23
23
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -12,7 +12,7 @@ import { FormFieldProps } from './fieldProps.js';
12
12
  * `Field`.
13
13
  */
14
14
  export interface RadiosProps extends Omit<BulmaClassesProps, 'color'>, FormFieldProps {
15
- /** Field label naming the whole group. Automatically associated via `aria-labelledby` on the `role="radiogroup"` wrapper — uses your `labelProps.id` when provided, otherwise a generated one. Dropped inside an outer `Field` (label that `Field` yourself). */
15
+ /** Field label naming the whole group. Automatically associated via `aria-labelledby` on the `role="radiogroup"` wrapper — uses your `labelProps.id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own. */
16
16
  label?: React.ReactNode;
17
17
  /** Props for the label element. An explicit `id` here is used as the `aria-labelledby` target instead of a generated one; any `htmlFor` is ignored (a group label names the group, never a single control). */
18
18
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -33,7 +33,7 @@ export interface RateIconProps {
33
33
  * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the container element.
34
34
  */
35
35
  export interface RateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'>, Omit<BulmaClassesProps, 'size'>, FormFieldProps {
36
- /** Field label naming the rating group. Automatically associated via `aria-labelledby` on the `role="radiogroup"` container — uses your `labelProps.id` when provided, otherwise a generated one; it also replaces the default `aria-label="Rating"`. Dropped inside an outer `Field` (label that `Field` yourself). */
36
+ /** Field label naming the rating group. Automatically associated via `aria-labelledby` on the `role="radiogroup"` container — uses your `labelProps.id` when provided, otherwise a generated one; it also replaces the default `aria-label="Rating"`. Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`), and replaces the `aria-label="Rating"` fallback too. An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own, and leaves the `"Rating"` fallback. */
37
37
  label?: React.ReactNode;
38
38
  /** Props for the label element. An explicit `id` here is used as the `aria-labelledby` target instead of a generated one; any `htmlFor` is ignored (a group label names the group, never a single control). */
39
39
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -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 label targets the low (minimum) thumb. Dropped inside an outer `Field` (label that `Field` yourself). */
25
+ /** Field label. Automatically associated with the slider input via `htmlFor` — uses your `id` when provided, otherwise a generated one. In range mode the label targets the low (minimum) thumb. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
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). */
28
28
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -26,7 +26,7 @@ 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) and dropped inside an outer `Field`. */
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`); it then replaces the `aria-label="Add tag"` fallback too. */
30
30
  label?: React.ReactNode;
31
31
  /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
32
32
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -22,7 +22,7 @@ import { TimeInputBaseProps } from './TimeInputBase.js';
22
22
  * @extraProp {React.Ref<HTMLInputElement>} [ref] - Forwarded to the underlying `<input>`.
23
23
  */
24
24
  export interface TimeInputProps extends TimeInputBaseProps {
25
- /** Field label. Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label) and dropped inside an outer `Field`. */
25
+ /** Field label. Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label). Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
26
26
  label?: React.ReactNode;
27
27
  /** Size for the label. */
28
28
  labelSize?: FieldProps['labelSize'];
@@ -13,6 +13,11 @@ interface UseAutoLabelIdOptions {
13
13
  * no Field, and in modes with no labellable control (e.g. inline pickers).
14
14
  */
15
15
  rendersLabel: boolean;
16
+ /**
17
+ * False when this render has no input to label at all (an inline picker),
18
+ * so it takes no id from a surrounding Field either. Defaults to true.
19
+ */
20
+ hasInput?: boolean;
16
21
  }
17
22
  /**
18
23
  * Associates the convenience `label` prop with its control (#368): generates
@@ -20,11 +25,16 @@ interface UseAutoLabelIdOptions {
20
25
  * A user-supplied `id` is used as the target instead of the generated one, and
21
26
  * an explicit `htmlFor` key in labelProps — even set to `undefined` — disables
22
27
  * generation entirely: the user has taken over the association (#495 presence
23
- * semantics). Internal; not part of the public API.
28
+ * semantics). When the control renders no label of its own, it adopts the id
29
+ * a labeled Field around it offers, the way the bases do, so that Field's
30
+ * label names it (#939); a user `id` still wins there.
31
+ * Internal; not part of the public API.
24
32
  */
25
- export declare function useAutoLabelId({ label, id, labelProps, rendersLabel, }: UseAutoLabelIdOptions): {
33
+ export declare function useAutoLabelId({ label, id, labelProps, rendersLabel, hasInput, }: UseAutoLabelIdOptions): {
26
34
  controlId: string | undefined;
27
35
  fieldLabelProps: FieldProps['labelProps'] | undefined;
36
+ /** Whether a rendered label, its own or a surrounding Field's, points at `controlId`. */
37
+ labelled: boolean;
28
38
  };
29
39
  interface UseAutoLabelledByOptions {
30
40
  /** The convenience `label` prop as passed by the caller. */
@@ -33,6 +43,13 @@ interface UseAutoLabelledByOptions {
33
43
  labelProps?: FieldProps['labelProps'];
34
44
  /** True when this render actually outputs the label naming the group. */
35
45
  rendersLabel: boolean;
46
+ /**
47
+ * The caller's remaining props. A non-empty `aria-label` among them names
48
+ * the group, and so does any `aria-labelledby` key, even an undefined one,
49
+ * since the group spreads them after its own attribute. Either keeps every
50
+ * label off the group, its own and a surrounding Field's alike.
51
+ */
52
+ callerProps: object;
36
53
  }
37
54
  /**
38
55
  * Group-input counterpart of {@link useAutoLabelId} (#494): a group of
@@ -41,10 +58,14 @@ interface UseAutoLabelledByOptions {
41
58
  * `aria-labelledby`. A user-supplied `labelProps.id` is used as the target
42
59
  * instead of generating one. Any caller `htmlFor` is stripped — a group label
43
60
  * names the group, never a single control — so the merged labelProps always
44
- * carry an explicit `htmlFor: undefined`.
61
+ * carry an explicit `htmlFor: undefined`. When the group renders no label of
62
+ * its own, it points at the label of a labeled Field around it instead
63
+ * (#939). A caller who named the group with `aria-label` or
64
+ * `aria-labelledby` gets no `aria-labelledby` from either label, so their
65
+ * name wins wherever the label sits.
45
66
  * Internal; not part of the public API.
46
67
  */
47
- export declare function useAutoLabelledBy({ label, labelProps, rendersLabel, }: UseAutoLabelledByOptions): {
68
+ export declare function useAutoLabelledBy({ label, labelProps, rendersLabel, callerProps, }: UseAutoLabelledByOptions): {
48
69
  ariaLabelledBy: string | undefined;
49
70
  fieldLabelProps: FieldProps['labelProps'] | undefined;
50
71
  };
@@ -20,14 +20,13 @@ export interface ConfigContextProps {
20
20
  export declare const useConfig: () => ConfigContextProps;
21
21
  /**
22
22
  * Props for the ConfigProvider component.
23
- *
24
- * @property {React.ReactNode} children - Child components to receive configuration.
25
- * @property {string} [classPrefix] - Prefix applied to all Bulma class names.
26
- * @property {IconLibrary} [iconLibrary] - Default icon library for Icon components.
27
23
  */
28
24
  export interface ConfigProviderProps {
25
+ /** Child components to receive configuration. */
29
26
  children: ReactNode;
27
+ /** Prefix applied to all Bulma class names. */
30
28
  classPrefix?: string;
29
+ /** Default icon library for Icon components. */
31
30
  iconLibrary?: IconLibrary;
32
31
  }
33
32
  /**
@@ -8,48 +8,9 @@ type BulmaVarKey = (typeof bulmaCssVars)[number];
8
8
  type BulmaVars = Partial<Record<BulmaVarKey, string>>;
9
9
  /**
10
10
  * Props for the Theme component.
11
- *
12
- * @property {React.ReactNode} children - Content to render inside the theme scope.
13
- * @property {string} [className] - Additional CSS classes (only when isRoot is false).
14
- * @property {BulmaVars} [bulmaVars] - Object mapping Bulma CSS variable names to values.
15
- * @property {string} [schemeH] - Scheme hue value.
16
- * @property {string} [schemeS] - Scheme saturation value.
17
- * @property {string} [lightL] - Light theme lightness value.
18
- * @property {string} [lightInvertL] - Light theme inverted lightness value.
19
- * @property {string} [darkL] - Dark theme lightness value.
20
- * @property {string} [darkInvertL] - Dark theme inverted lightness value.
21
- * @property {string} [softL] - Soft lightness value.
22
- * @property {string} [boldL] - Bold lightness value.
23
- * @property {string} [softInvertL] - Soft inverted lightness value.
24
- * @property {string} [boldInvertL] - Bold inverted lightness value.
25
- * @property {string} [hoverBackgroundLDelta] - Background lightness delta on hover.
26
- * @property {string} [activeBackgroundLDelta] - Background lightness delta on active.
27
- * @property {string} [hoverBorderLDelta] - Border lightness delta on hover.
28
- * @property {string} [activeBorderLDelta] - Border lightness delta on active.
29
- * @property {string} [hoverColorLDelta] - Text color lightness delta on hover.
30
- * @property {string} [activeColorLDelta] - Text color lightness delta on active.
31
- * @property {string} [hoverShadowADelta] - Shadow alpha delta on hover.
32
- * @property {string} [activeShadowADelta] - Shadow alpha delta on active.
33
- * @property {string} [primaryH] - Primary color hue.
34
- * @property {string} [primaryS] - Primary color saturation.
35
- * @property {string} [primaryL] - Primary color lightness.
36
- * @property {string} [linkH] - Link color hue.
37
- * @property {string} [linkS] - Link color saturation.
38
- * @property {string} [linkL] - Link color lightness.
39
- * @property {string} [infoH] - Info color hue.
40
- * @property {string} [infoS] - Info color saturation.
41
- * @property {string} [infoL] - Info color lightness.
42
- * @property {string} [successH] - Success color hue.
43
- * @property {string} [successS] - Success color saturation.
44
- * @property {string} [successL] - Success color lightness.
45
- * @property {string} [warningH] - Warning color hue.
46
- * @property {string} [warningS] - Warning color saturation.
47
- * @property {string} [warningL] - Warning color lightness.
48
- * @property {string} [dangerH] - Danger color hue.
49
- * @property {string} [dangerS] - Danger color saturation.
50
- * @property {string} [dangerL] - Danger color lightness.
51
11
  */
52
12
  export interface ThemeProps extends Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
13
+ /** The content the theme applies to. */
53
14
  children: ReactNode;
54
15
  /**
55
16
  * Additional CSS classes for the wrapper div. A root Theme (`isRoot`) has no
@@ -86,6 +47,13 @@ export interface ThemeProps extends Omit<BulmaClassesProps, 'color' | 'backgroun
86
47
  * write only `data-theme` and warn in development.
87
48
  */
88
49
  colorMode?: 'light' | 'dark' | 'system';
50
+ /**
51
+ * Bulma CSS variables to set, by name, such as
52
+ * `{ '--bulma-primary-h': '210' }`. Only Bulma's own variables, the keys
53
+ * the `BulmaVars` type allows, are applied, and an empty value is skipped.
54
+ * Where a variable prop, such as `primaryH`, sets the same variable, the
55
+ * prop wins.
56
+ */
89
57
  bulmaVars?: BulmaVars;
90
58
  /**
91
59
  * Border radius helper, as on every other component: `radiusless` adds
@@ -124,41 +92,77 @@ export interface ThemeProps extends Omit<BulmaClassesProps, 'color' | 'backgroun
124
92
  * now adds `is-column-gap-0` to the wrapper instead.
125
93
  */
126
94
  columnGap?: BulmaGapStep;
95
+ /** Base hue for the color scheme, 0 to 360. Sets `--bulma-scheme-h`. */
127
96
  schemeH?: string;
97
+ /** Base saturation for the color scheme, as a percentage. Sets `--bulma-scheme-s`. */
128
98
  schemeS?: string;
99
+ /** Lightness for light backgrounds. Sets `--bulma-light-l`. */
129
100
  lightL?: string;
101
+ /** Inverted lightness for light backgrounds. Sets `--bulma-light-invert-l`. */
130
102
  lightInvertL?: string;
103
+ /** Lightness for dark backgrounds. Sets `--bulma-dark-l`. */
131
104
  darkL?: string;
105
+ /** Inverted lightness for dark backgrounds. Sets `--bulma-dark-invert-l`. */
132
106
  darkInvertL?: string;
107
+ /** Lightness for soft colors. Sets `--bulma-soft-l`. */
133
108
  softL?: string;
109
+ /** Lightness for bold colors. Sets `--bulma-bold-l`. */
134
110
  boldL?: string;
111
+ /** Inverted lightness for soft colors. Sets `--bulma-soft-invert-l`. */
135
112
  softInvertL?: string;
113
+ /** Inverted lightness for bold colors. Sets `--bulma-bold-invert-l`. */
136
114
  boldInvertL?: string;
115
+ /** Lightness change of a background on hover. Sets `--bulma-hover-background-l-delta`. */
137
116
  hoverBackgroundLDelta?: string;
117
+ /** Lightness change of a background when active. Sets `--bulma-active-background-l-delta`. */
138
118
  activeBackgroundLDelta?: string;
119
+ /** Lightness change of a border on hover. Sets `--bulma-hover-border-l-delta`. */
139
120
  hoverBorderLDelta?: string;
121
+ /** Lightness change of a border when active. Sets `--bulma-active-border-l-delta`. */
140
122
  activeBorderLDelta?: string;
123
+ /** Lightness change of text color on hover. Sets `--bulma-hover-color-l-delta`. */
141
124
  hoverColorLDelta?: string;
125
+ /** Lightness change of text color when active. Sets `--bulma-active-color-l-delta`. */
142
126
  activeColorLDelta?: string;
127
+ /** Alpha change of a shadow on hover. Sets `--bulma-hover-shadow-a-delta`. */
143
128
  hoverShadowADelta?: string;
129
+ /** Alpha change of a shadow when active. Sets `--bulma-active-shadow-a-delta`. */
144
130
  activeShadowADelta?: string;
131
+ /** Primary color hue, 0 to 360. Sets `--bulma-primary-h`. */
145
132
  primaryH?: string;
133
+ /** Primary color saturation, as a percentage. Sets `--bulma-primary-s`. */
146
134
  primaryS?: string;
135
+ /** Primary color lightness, as a percentage. Sets `--bulma-primary-l`. */
147
136
  primaryL?: string;
137
+ /** Link color hue, 0 to 360. Sets `--bulma-link-h`. */
148
138
  linkH?: string;
139
+ /** Link color saturation, as a percentage. Sets `--bulma-link-s`. */
149
140
  linkS?: string;
141
+ /** Link color lightness, as a percentage. Sets `--bulma-link-l`. */
150
142
  linkL?: string;
143
+ /** Info color hue, 0 to 360. Sets `--bulma-info-h`. */
151
144
  infoH?: string;
145
+ /** Info color saturation, as a percentage. Sets `--bulma-info-s`. */
152
146
  infoS?: string;
147
+ /** Info color lightness, as a percentage. Sets `--bulma-info-l`. */
153
148
  infoL?: string;
149
+ /** Success color hue, 0 to 360. Sets `--bulma-success-h`. */
154
150
  successH?: string;
151
+ /** Success color saturation, as a percentage. Sets `--bulma-success-s`. */
155
152
  successS?: string;
153
+ /** Success color lightness, as a percentage. Sets `--bulma-success-l`. */
156
154
  successL?: string;
155
+ /** Warning color hue, 0 to 360. Sets `--bulma-warning-h`. */
157
156
  warningH?: string;
157
+ /** Warning color saturation, as a percentage. Sets `--bulma-warning-s`. */
158
158
  warningS?: string;
159
+ /** Warning color lightness, as a percentage. Sets `--bulma-warning-l`. */
159
160
  warningL?: string;
161
+ /** Danger color hue, 0 to 360. Sets `--bulma-danger-h`. */
160
162
  dangerH?: string;
163
+ /** Danger color saturation, as a percentage. Sets `--bulma-danger-s`. */
161
164
  dangerS?: string;
165
+ /** Danger color lightness, as a percentage. Sets `--bulma-danger-l`. */
162
166
  dangerL?: string;
163
167
  }
164
168
  /**
@@ -19,7 +19,7 @@ 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. Automatically associated with the text input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field` (label that `Field` yourself). */
22
+ /** Field label. Automatically associated with the text input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
23
23
  label?: React.ReactNode;
24
24
  /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
25
25
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -12,7 +12,7 @@ import { FormFieldProps } from './fieldProps.js';
12
12
  * `Field`.
13
13
  */
14
14
  export interface CheckboxesProps extends Omit<BulmaClassesProps, 'color'>, FormFieldProps {
15
- /** Field label naming the whole group. Automatically associated via `aria-labelledby` on the `role="group"` wrapper — uses your `labelProps.id` when provided, otherwise a generated one. Dropped inside an outer `Field` (label that `Field` yourself). */
15
+ /** Field label naming the whole group. Automatically associated via `aria-labelledby` on the `role="group"` wrapper — uses your `labelProps.id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own. */
16
16
  label?: React.ReactNode;
17
17
  /** Props for the label element. An explicit `id` here is used as the `aria-labelledby` target instead of a generated one; any `htmlFor` is ignored (a group label names the group, never a single control). */
18
18
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -22,7 +22,7 @@ import { DateInputBaseProps } from './DateInputBase.js';
22
22
  * @extraProp {React.Ref<HTMLInputElement>} [ref] - Forwarded to the underlying `<input>`.
23
23
  */
24
24
  export interface DateInputProps extends DateInputBaseProps {
25
- /** Field label (component auto-wraps in a `Field` if not already inside). Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label) and dropped inside an outer `Field`. */
25
+ /** Field label (component auto-wraps in a `Field` if not already inside). Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label). Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
26
26
  label?: React.ReactNode;
27
27
  /** Size for the label. */
28
28
  labelSize?: FieldProps['labelSize'];
@@ -19,7 +19,7 @@ import { DateRangeInputBaseProps } from './DateRangeInputBase.js';
19
19
  * @extraProp {React.Ref<HTMLInputElement>} [ref] - Forwarded to the start `<input>`.
20
20
  */
21
21
  export interface DateRangeInputProps extends DateRangeInputBaseProps {
22
- /** Field label naming the whole range. Associated through `aria-labelledby` on the `role="group"` root, since it names two inputs rather than one; uses your `labelProps.id` when provided, otherwise a generated one. Each input keeps its own name, "Start date" or "End date" (`labels.rangeStart` / `labels.rangeEnd`). Dropped inside an outer `Field`. */
22
+ /** Field label naming the whole range. Associated through `aria-labelledby` on the `role="group"` root, since it names two inputs rather than one; uses your `labelProps.id` when provided, otherwise a generated one. Each input keeps its own name, "Start date" or "End date" (`labels.rangeStart` / `labels.rangeEnd`). Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own. */
23
23
  label?: React.ReactNode;
24
24
  /** Size for the label. */
25
25
  labelSize?: FieldProps['labelSize'];
@@ -20,7 +20,7 @@ import { DateTimeInputBaseProps } from './DateTimeInputBase.js';
20
20
  * @extraProp {boolean} [required=false] - Marks the field as required for native HTML form validation.
21
21
  */
22
22
  export interface DateTimeInputProps extends DateTimeInputBaseProps {
23
- /** Field label. Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label) and dropped inside an outer `Field`. */
23
+ /** Field label. Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label). Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
24
24
  label?: React.ReactNode;
25
25
  /** Size for the label. */
26
26
  labelSize?: FieldProps['labelSize'];
@@ -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 associated with a single composed `InputBase`, `SelectBase`, or `TextAreaBase` via a generated id and `htmlFor`. Pass `labelProps={{ htmlFor }}` to wire your own `id`, or `labelProps={{ htmlFor: undefined }}` to opt out. Skipped for `grouped`/`hasAddons` fields (multiple controls). */
15
+ /** Field label, rendered above the widget. Automatically names the one control the Field holds: a composed `InputBase`, `SelectBase` or `TextAreaBase`, 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`. 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. An `id` here is the one a group control's `aria-labelledby` points at; otherwise the label gets a generated one while the association is on. 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
  };
@@ -11,7 +11,7 @@ import { FormFieldProps } from './fieldProps.js';
11
11
  * name on that `Field`.
12
12
  */
13
13
  export interface FileProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'color' | 'type'>, Omit<BulmaClassesProps, 'color'>, FormFieldProps {
14
- /** Field label. Automatically associated with the file input via `htmlFor` — uses your `id` when provided, otherwise a generated one. The input then has two labels (this one plus the wrapping `file-label`); assistive tech reads both. Dropped inside an outer `Field` (label that `Field` yourself). */
14
+ /** Field label. Automatically associated with the file input via `htmlFor` — uses your `id` when provided, otherwise a generated one. The input then has two labels (this one plus the wrapping `file-label`); assistive tech reads both. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
15
15
  label?: React.ReactNode;
16
16
  /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
17
17
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -105,12 +105,34 @@ 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 only by the single-control bases (InputBase, SelectBase,
109
- * TextAreaBase). Internal; not part of the public API.
108
+ * Consumed by the single-control bases (InputBase, SelectBase, TextAreaBase)
109
+ * and, through `useAutoLabelId`, by the convenience inputs that render an
110
+ * input of their own (#939). Internal; not part of the public API.
110
111
  */
111
112
  export declare const useFieldLabelId: () => string | undefined;
112
113
  /** Provider for the Field label-target id — used internally by Field. */
113
114
  export declare const FieldLabelIdProvider: React.Provider<string | undefined>;
115
+ /**
116
+ * The id of a labeled Field's own `<label>`, for a group control (Radios,
117
+ * Checkboxes, Rate, DateRangeInput) to point `aria-labelledby` at, since a group cannot take
118
+ * the label's `htmlFor` (#939). Set under the same conditions as
119
+ * {@link useFieldLabelId}. Consumed through `useAutoLabelledBy`.
120
+ * Internal; not part of the public API.
121
+ */
122
+ export declare const useFieldLabelElementId: () => string | undefined;
123
+ /** Provider for the Field label's own id, used internally by Field. */
124
+ export declare const FieldLabelElementIdProvider: React.Provider<string | undefined>;
125
+ /**
126
+ * What the nearest labeled Field's `<label>` points `htmlFor` at: the id it
127
+ * generated, or the caller's own `labelProps.htmlFor`. An unlabeled Field
128
+ * passes it through, so a control in the inner Field of a horizontal layout
129
+ * can tell the outer label names it. Only ever compared with a control's own
130
+ * id, never adopted, so it hands out no id. Internal; not part of the public
131
+ * API.
132
+ */
133
+ export declare const useFieldLabelFor: () => string | undefined;
134
+ /** Provider for the Field label's `htmlFor` target, used internally by Field. */
135
+ export declare const FieldLabelForProvider: React.Provider<string | undefined>;
114
136
  /**
115
137
  * Shape of the Radios group context. The group provides:
116
138
  * - `name`: shared form field name (Stage 1)
@@ -17,7 +17,7 @@ export type NumberinputVariant = 'plusminus' | 'stepper';
17
17
  * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the input element.
18
18
  */
19
19
  export interface NumberinputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'size' | 'onChange' | 'value' | 'defaultValue' | 'type'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'>, FormFieldProps {
20
- /** Field label. Automatically associated with the number input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired when no Field wrapper is rendered (inside a `Field`, or plusminus `bare`). */
20
+ /** Field label. Automatically associated with the number input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). Not rendered either by a plusminus `bare` Numberinput outside a `Field`. */
21
21
  label?: React.ReactNode;
22
22
  /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
23
23
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -12,7 +12,7 @@ import { FormFieldProps } from './fieldProps.js';
12
12
  * `Field`.
13
13
  */
14
14
  export interface RadiosProps extends Omit<BulmaClassesProps, 'color'>, FormFieldProps {
15
- /** Field label naming the whole group. Automatically associated via `aria-labelledby` on the `role="radiogroup"` wrapper — uses your `labelProps.id` when provided, otherwise a generated one. Dropped inside an outer `Field` (label that `Field` yourself). */
15
+ /** Field label naming the whole group. Automatically associated via `aria-labelledby` on the `role="radiogroup"` wrapper — uses your `labelProps.id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own. */
16
16
  label?: React.ReactNode;
17
17
  /** Props for the label element. An explicit `id` here is used as the `aria-labelledby` target instead of a generated one; any `htmlFor` is ignored (a group label names the group, never a single control). */
18
18
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -33,7 +33,7 @@ export interface RateIconProps {
33
33
  * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the container element.
34
34
  */
35
35
  export interface RateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'>, Omit<BulmaClassesProps, 'size'>, FormFieldProps {
36
- /** Field label naming the rating group. Automatically associated via `aria-labelledby` on the `role="radiogroup"` container — uses your `labelProps.id` when provided, otherwise a generated one; it also replaces the default `aria-label="Rating"`. Dropped inside an outer `Field` (label that `Field` yourself). */
36
+ /** Field label naming the rating group. Automatically associated via `aria-labelledby` on the `role="radiogroup"` container — uses your `labelProps.id` when provided, otherwise a generated one; it also replaces the default `aria-label="Rating"`. Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`), and replaces the `aria-label="Rating"` fallback too. An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own, and leaves the `"Rating"` fallback. */
37
37
  label?: React.ReactNode;
38
38
  /** Props for the label element. An explicit `id` here is used as the `aria-labelledby` target instead of a generated one; any `htmlFor` is ignored (a group label names the group, never a single control). */
39
39
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -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 label targets the low (minimum) thumb. Dropped inside an outer `Field` (label that `Field` yourself). */
25
+ /** Field label. Automatically associated with the slider input via `htmlFor` — uses your `id` when provided, otherwise a generated one. In range mode the label targets the low (minimum) thumb. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
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). */
28
28
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
@@ -26,7 +26,7 @@ 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) and dropped inside an outer `Field`. */
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`); it then replaces the `aria-label="Add tag"` fallback too. */
30
30
  label?: React.ReactNode;
31
31
  /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
32
32
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {