@ostack.tech/ui 0.6.4 → 0.7.0

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 (45) hide show
  1. package/dist/chunks/{en-C2peM913.js → en-BfgHKQwn.js} +2 -1
  2. package/dist/chunks/en-BfgHKQwn.js.map +1 -0
  3. package/dist/locales/en-GB.js +1 -1
  4. package/dist/locales/en-US.js +1 -1
  5. package/dist/locales/fr-FR.js +1 -0
  6. package/dist/locales/fr-FR.js.map +1 -1
  7. package/dist/locales/pt-PT.js +1 -0
  8. package/dist/locales/pt-PT.js.map +1 -1
  9. package/dist/ostack-ui.css +16 -10
  10. package/dist/ostack-ui.css.map +1 -1
  11. package/dist/ostack-ui.js +1065 -909
  12. package/dist/ostack-ui.js.map +1 -1
  13. package/dist/types/components/Button/Button.d.ts +35 -10
  14. package/dist/types/components/Checkbox/Checkbox.d.ts +26 -2
  15. package/dist/types/components/CheckboxGroup/CheckboxGroup.d.ts +29 -2
  16. package/dist/types/components/CheckboxGroup/CheckboxGroupContext.d.ts +4 -0
  17. package/dist/types/components/CommandMenu/CommandMenuItem.d.ts +1 -1
  18. package/dist/types/components/DateRangeInput/DateRangeInput.d.ts +47 -12
  19. package/dist/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
  20. package/dist/types/components/DropdownMenu/DropdownMenuItem.d.ts +1 -1
  21. package/dist/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
  22. package/dist/types/components/Field/FieldContext.d.ts +1 -0
  23. package/dist/types/components/IconButton/IconButton.d.ts +35 -8
  24. package/dist/types/components/Input/Input.d.ts +32 -2
  25. package/dist/types/components/MenuList/MenuListItem.d.ts +30 -13
  26. package/dist/types/components/Output/Output.d.ts +20 -2
  27. package/dist/types/components/RadioGroup/Radio.d.ts +26 -2
  28. package/dist/types/components/RadioGroup/RadioGroup.d.ts +26 -2
  29. package/dist/types/components/Select/Select.d.ts +1 -1
  30. package/dist/types/index.d.ts +2 -1
  31. package/dist/types/providers/LocalizationProvider/LocalizationObject.d.ts +1 -1
  32. package/dist/types/utils/combineAriaIds.d.ts +2 -0
  33. package/dist/types/utils/control.d.ts +1 -0
  34. package/dist/types/utils/setNativeProperty.d.ts +8 -0
  35. package/package.json +1 -1
  36. package/scss/components/Checkbox/_Checkbox.scss +1 -1
  37. package/scss/components/DropdownMenu/_DropdownMenu.scss +1 -1
  38. package/scss/components/RadioGroup/_Radio.scss +1 -1
  39. package/scss/components/Root/_Root.scss +5 -0
  40. package/scss/scss/placeholders/checkable/_checkable.scss +3 -3
  41. package/scss/scss/placeholders/control/_control.scss +1 -1
  42. package/scss/scss/placeholders/menu/_menu.scss +8 -3
  43. package/dist/chunks/en-C2peM913.js.map +0 -1
  44. package/dist/types/utils/mergeAriaIds.d.ts +0 -2
  45. package/dist/types/utils/setNativeValue.d.ts +0 -7
@@ -70,25 +70,50 @@ export interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
70
70
  */
71
71
  disabled?: boolean;
72
72
  /**
73
- * Whether to display the button in "loading" state by presenting a spinner as
74
- * icon. The position of the spinner may be controlled via `iconPlacement`.
73
+ * Renders the button in a **loading** state.
75
74
  *
76
- * Setting this property will automatically disable the button.
75
+ * When `true`, the button is “soft-disabled”: it looks disabled and ignores
76
+ * user interaction but remains focusable. By default, a spinner is shown as
77
+ * the button's icon (_i.e._, `showSpinner` is set to `true` unless
78
+ * overridden).
77
79
  *
78
- * @default false
79
- */
80
- loading?: boolean;
81
- /**
82
- * Whether the button should be enabled when `loading` is `true`.
80
+ * The button's content while loading can be controlled via `loadingContent`.
81
+ * The position of the spinner may be controlled via `iconPlacement`.
82
+ *
83
+ * To only show a spinner without “soft-disabling” the button, set
84
+ * `showSpinner` instead.
85
+ *
86
+ * @example
87
+ *
88
+ * ```tsx
89
+ * <Button loading={saving} loadingContent="Saving…">
90
+ * Save
91
+ * </Button>;
92
+ * ```
83
93
  *
84
94
  * @default false
85
95
  */
86
- enabledWhenLoading?: boolean;
96
+ loading?: boolean;
87
97
  /**
88
- * Content of the button when it is in "loading" state. If not provided, the
98
+ * Content of the button when it is in loading state. If not provided, the
89
99
  * button content will remain unchanged.
90
100
  */
91
101
  loadingContent?: ReactNode;
102
+ /**
103
+ * Whether to show a spinner as the button's icon.
104
+ *
105
+ * Defaults to the value of the `loading` property. In most cases, prefer
106
+ * `loading`, which also “soft-disables” the button.
107
+ *
108
+ * Use `showSpinner` when you want a spinner **without** “soft-disabling” the
109
+ * button. To “soft-disable” **without** a spinner, set `loading` to `true`
110
+ * and `showSpinner` to `false`.
111
+ *
112
+ * The position of the spinner may be controlled via `iconPlacement`.
113
+ *
114
+ * @default loading
115
+ */
116
+ showSpinner?: boolean;
92
117
  /** Properties to pass to the icon component. */
93
118
  iconProps?: Omit<ComponentPropsWithRef<typeof Icon>, "icon">;
94
119
  /** Properties to pass to the spinner component. */
@@ -21,12 +21,36 @@ export interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof Chec
21
21
  /** Sets the checkbox as read-only. */
22
22
  readOnly?: boolean;
23
23
  /**
24
- * Adds a spinner to the checkbox to indicate activity. Note that it doesn't
25
- * automatically disable the checkbox.
24
+ * Renders the checkbox in a **loading** state.
25
+ *
26
+ * When `true`, the checkbox is “soft-disabled”: it looks disabled and ignores
27
+ * user interaction but remains focusable. By default, a spinner is shown
28
+ * (_i.e._, `showSpinner` is set to `true` unless overridden).
29
+ *
30
+ * The checkbox's accessible description while loading can be controlled via
31
+ * `loadingDescription`.
32
+ *
33
+ * To only show a spinner without “soft-disabling” the checkbox, set
34
+ * `showSpinner` instead.
26
35
  *
27
36
  * @default false
28
37
  */
29
38
  loading?: boolean;
39
+ /** Accessible description of the checkbox when it is in a “loading” state. */
40
+ loadingDescription?: ReactNode;
41
+ /**
42
+ * Whether to show a spinner next to the checkbox.
43
+ *
44
+ * Defaults to the value of the `loading` property. In most cases, prefer
45
+ * `loading`, which also “soft-disables” the checkbox.
46
+ *
47
+ * Use `showSpinner` when you want a spinner **without** “soft-disabling” the
48
+ * checkbox. To “soft-disable” **without** a spinner, set `loading` to `true`
49
+ * and `showSpinner` to `false`.
50
+ *
51
+ * @default loading
52
+ */
53
+ showSpinner?: boolean;
30
54
  /**
31
55
  * Function called when the focus moves out of the control as a whole.
32
56
  *
@@ -21,12 +21,39 @@ export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
21
21
  /** Checkbox group name. */
22
22
  name?: string;
23
23
  /**
24
- * Adds a spinner to the checkbox group to indicate activity. Note that it
25
- * doesn't automatically disable the control.
24
+ * Renders the checkbox group in a **loading** state.
25
+ *
26
+ * When `true`, the checkbox group is “soft-disabled”: it looks disabled and
27
+ * ignores user interaction but remains focusable. By default, a spinner is
28
+ * shown (_i.e._, `showSpinner` is set to `true` unless overridden).
29
+ *
30
+ * The checkbox group's accessible description while loading can be controlled
31
+ * via `loadingDescription`.
32
+ *
33
+ * To only show a spinner without “soft-disabling” the checkbox group, set
34
+ * `showSpinner` instead.
26
35
  *
27
36
  * @default false
28
37
  */
29
38
  loading?: boolean;
39
+ /**
40
+ * Accessible description of the checkbox group when it is in a “loading”
41
+ * state.
42
+ */
43
+ loadingDescription?: ReactNode;
44
+ /**
45
+ * Whether to show a spinner next to the checkbox group.
46
+ *
47
+ * Defaults to the value of the `loading` property. In most cases, prefer
48
+ * `loading`, which also “soft-disables” the checkbox group.
49
+ *
50
+ * Use `showSpinner` when you want a spinner **without** “soft-disabling” the
51
+ * checkbox group. To “soft-disable” **without** a spinner, set `loading` to
52
+ * `true` and `showSpinner` to `false`.
53
+ *
54
+ * @default loading
55
+ */
56
+ showSpinner?: boolean;
30
57
  /** Whether the field is required. */
31
58
  required?: boolean;
32
59
  /** Whether to disable the checkbox group. */
@@ -2,6 +2,10 @@ export interface CheckboxGroupContextValue {
2
2
  name?: string;
3
3
  value: string[];
4
4
  onCheckedChange: (value: string, checked: boolean) => void;
5
+ loadingDescriptionId?: string;
6
+ errorMessageIds?: string[];
7
+ ariaDescribedBy?: string;
8
+ descriptionIds?: string[];
5
9
  }
6
10
  /** Checkbox group context. */
7
11
  export declare const CheckboxGroupContext: import('react').Context<CheckboxGroupContextValue | null>;
@@ -1,7 +1,7 @@
1
1
  import { Command as CommandPrimitive } from 'cmdk';
2
2
  import { ComponentPropsWithoutRef } from 'react';
3
3
  import { MenuListItemProps } from '../MenuList';
4
- export interface CommandMenuItemProps extends Omit<ComponentPropsWithoutRef<typeof CommandPrimitive.Item>, "asChild" | "color">, Pick<MenuListItemProps, "selected" | "color" | "loading" | "enabledWhenLoading" | "loadingContent" | "icon" | "iconPlacement" | "href" | "target" | "rel" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps"> {
4
+ export interface CommandMenuItemProps extends Omit<ComponentPropsWithoutRef<typeof CommandPrimitive.Item>, "asChild" | "color">, Pick<MenuListItemProps, "selected" | "color" | "loading" | "loadingContent" | "showSpinner" | "icon" | "iconPlacement" | "href" | "target" | "rel" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps"> {
5
5
  /**
6
6
  * Render the item as a link. When set, you can pass `href`, `target`, and
7
7
  * `rel` properties to the item.
@@ -54,26 +54,61 @@ export interface DateRangeInputProps extends Omit<ComponentPropsWithoutRef<"div"
54
54
  /** Maximum year allowed. */
55
55
  maxYear?: number;
56
56
  /**
57
- * Adds a spinner to the start/end inputs to indicate activity. Note that it
58
- * doesn't automatically disable the input.
57
+ * Renders the date-range input in a **loading** state.
58
+ *
59
+ * When `true`, the date-range input is “soft-disabled”: it looks disabled and
60
+ * ignores user interaction but remains focusable. By default, spinners are
61
+ * shown (_i.e._, `showSpinners` is set to `true` unless overridden).
62
+ *
63
+ * The date-range input's accessible description while loading can be
64
+ * controlled via `loadingDescription`.
65
+ *
66
+ * To only show spinners without “soft-disabling” the date-range input, set
67
+ * `showSpinners` instead.
68
+ *
69
+ * @example
70
+ *
71
+ * ```tsx
72
+ * <DateRangeInput loading={fetching} loadingDescription="Fetching…" />;
73
+ * ```
59
74
  *
60
75
  * @default false
61
76
  */
62
77
  loading?: boolean;
63
78
  /**
64
- * Adds a spinner to the start input to indicate activity. Note that it
65
- * doesn't automatically disable the input.
79
+ * Accessible description of the date-range input when it is in a “loading”
80
+ * state.
81
+ */
82
+ loadingDescription?: ReactNode;
83
+ /**
84
+ * Whether to show spinners in the start and end parts of the date-range
85
+ * input.
86
+ *
87
+ * Defaults to the value of the `loading` property. In most cases, prefer
88
+ * `loading`, which also “soft-disables” the date-range input.
89
+ *
90
+ * Use `showSpinners` when you want spinners **without** “soft-disabling” the
91
+ * date-range input. To “soft-disable” **without** spinners, set `loading` to
92
+ * `true` and `showSpinners` to `false`.
93
+ *
94
+ * Use `showStartSpinner` or `showEndSpinner` to individually control whether
95
+ * to show a spinner in the start or end parts of the date-range input.
66
96
  *
67
97
  * @default loading
68
98
  */
69
- startLoading?: boolean;
99
+ showSpinners?: boolean;
70
100
  /**
71
- * Adds a spinner to the end input to indicate activity. Note that it doesn't
72
- * automatically disable the input.
101
+ * Whether to show the start input spinner.
73
102
  *
74
- * @default loading
103
+ * @default showSpinners
104
+ */
105
+ showStartSpinner?: boolean;
106
+ /**
107
+ * Whether to show the end input spinner.
108
+ *
109
+ * @default showSpinners
75
110
  */
76
- endLoading?: boolean;
111
+ showEndSpinner?: boolean;
77
112
  /** Sets the inputs' text align. */
78
113
  align?: Responsive<CSSProperties["textAlign"]>;
79
114
  /** Date-range input's start adornment. */
@@ -104,17 +139,17 @@ export interface DateRangeInputProps extends Omit<ComponentPropsWithoutRef<"div"
104
139
  */
105
140
  fullFormat?: string;
106
141
  /** Description of the short format provided to assistive technologies. */
107
- formatDescription?: string;
142
+ formatDescription?: ReactNode;
108
143
  /**
109
144
  * Label announced to assistive technologies for the start input (so that the
110
145
  * user knows that they are interacting with the start input).
111
146
  */
112
- startInputLabel?: string;
147
+ startInputLabel?: ReactNode;
113
148
  /**
114
149
  * Label announced to assistive technologies for the end input (so that the
115
150
  * user knows that they are interacting with the end input).
116
151
  */
117
- endInputLabel?: string;
152
+ endInputLabel?: ReactNode;
118
153
  /**
119
154
  * Function that should return the label to provide to the button that opens
120
155
  * the input's calendar.
@@ -4,7 +4,7 @@ import { CheckboxChecked } from '../Checkbox';
4
4
  import { Icon } from '../Icon';
5
5
  import { MenuListItemProps } from '../MenuList';
6
6
  /** Properties of the dropdown menu checkbox item. */
7
- export interface DropdownMenuCheckboxItemProps extends Omit<ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>, "asChild" | "color">, Pick<MenuListItemProps, "color" | "loading" | "enabledWhenLoading" | "loadingContent" | "iconPlacement" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps"> {
7
+ export interface DropdownMenuCheckboxItemProps extends Omit<ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>, "asChild" | "color">, Pick<MenuListItemProps, "color" | "loading" | "loadingContent" | "showSpinner" | "iconPlacement" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps"> {
8
8
  /**
9
9
  * Whether to show the checkbox.
10
10
  *
@@ -2,7 +2,7 @@ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
2
2
  import { ComponentPropsWithoutRef } from 'react';
3
3
  import { MenuListItemProps } from '../MenuList';
4
4
  /** Properties of the dropdown menu item. */
5
- export interface DropdownMenuItemProps extends Omit<ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item>, "asChild" | "color">, Pick<MenuListItemProps, "selected" | "color" | "loading" | "enabledWhenLoading" | "loadingContent" | "icon" | "iconPlacement" | "href" | "target" | "rel" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps"> {
5
+ export interface DropdownMenuItemProps extends Omit<ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item>, "asChild" | "color">, Pick<MenuListItemProps, "selected" | "color" | "loading" | "loadingContent" | "showSpinner" | "icon" | "iconPlacement" | "href" | "target" | "rel" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps"> {
6
6
  /**
7
7
  * Render the item as a link. When set, you can pass `href`, `target`, and
8
8
  * `rel` properties to the item.
@@ -2,7 +2,7 @@ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
2
2
  import { ComponentPropsWithoutRef, ComponentPropsWithRef } from 'react';
3
3
  import { MenuListItemProps } from '../MenuList';
4
4
  /** Properties of the dropdown menu radio item. */
5
- export interface DropdownMenuRadioItemProps extends Omit<ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>, "asChild" | "color">, Pick<MenuListItemProps, "color" | "loading" | "enabledWhenLoading" | "loadingContent" | "iconPlacement" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps"> {
5
+ export interface DropdownMenuRadioItemProps extends Omit<ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>, "asChild" | "color">, Pick<MenuListItemProps, "color" | "loading" | "loadingContent" | "showSpinner" | "iconPlacement" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps"> {
6
6
  /**
7
7
  * Whether to show the radio.
8
8
  *
@@ -61,6 +61,7 @@ export declare function useFieldDescriptionIds(): string[] | undefined;
61
61
  export declare function useFieldErrorMessageIds(): string[] | undefined;
62
62
  /** Hook that makes a field aware of its control's information. */
63
63
  export declare function useSetFieldControl(controlId: string | undefined, controlTagName: string | undefined, controlCodeId: string | undefined, controlHasCode?: boolean | undefined, controlRequired?: boolean | undefined): {
64
+ generatedId: string;
64
65
  controlId: string;
65
66
  codeId: string | undefined;
66
67
  };
@@ -61,23 +61,50 @@ export interface IconButtonProps extends Omit<ComponentPropsWithoutRef<"button">
61
61
  */
62
62
  disabled?: boolean;
63
63
  /**
64
- * Whether to display the button in "loading" state. This makes it so the icon
65
- * button displays a spinner instead of its icon.
64
+ * Renders the icon button in a **loading** state.
66
65
  *
67
- * @default false
68
- */
69
- loading?: boolean;
70
- /**
71
- * Whether the icon button should be enabled when `loading` is `true`.
66
+ * When `true`, the button is “soft-disabled”: it looks disabled and ignores
67
+ * user interaction but remains focusable. By default, a spinner is shown as
68
+ * the button's icon (_i.e._, `showSpinner` is set to `true` unless
69
+ * overridden).
70
+ *
71
+ * The button's label while loading can be controlled via `loadingLabel`.
72
+ *
73
+ * To only show a spinner without “soft-disabling” the button, set
74
+ * `showSpinner` instead.
75
+ *
76
+ * @example
77
+ *
78
+ * ```tsx
79
+ * <IconButton
80
+ * icon={faFloppyDisk}
81
+ * label="Save"
82
+ * loading={saving}
83
+ * loadingLabel="Saving…"
84
+ * />;
85
+ * ```
72
86
  *
73
87
  * @default false
74
88
  */
75
- enabledWhenLoading?: boolean;
89
+ loading?: boolean;
76
90
  /**
77
91
  * Label of the icon button when it is in "loading" state. If not provided,
78
92
  * the label will remain unchanged.
79
93
  */
80
94
  loadingLabel?: ReactNode;
95
+ /**
96
+ * Whether to show a spinner as the icon button's icon.
97
+ *
98
+ * Defaults to the value of the `loading` property. In most cases, prefer
99
+ * `loading`, which also “soft-disables” the button.
100
+ *
101
+ * Use `showSpinner` when you want a spinner **without** “soft-disabling” the
102
+ * button. To “soft-disable” **without** a spinner, set `loading` to `true`
103
+ * and `showSpinner` to `false`.
104
+ *
105
+ * @default loading
106
+ */
107
+ showSpinner?: boolean;
81
108
  /**
82
109
  * Whether to disable showing the icon button's label in a tooltip. Disabling
83
110
  * the tooltip does **not** affect the button's accessibility.
@@ -27,12 +27,42 @@ export interface InputPropsBase {
27
27
  /** Input code. */
28
28
  code?: ReactNode;
29
29
  /**
30
- * Adds a spinner to the input to indicate activity. Note that it doesn't
31
- * automatically disable the input.
30
+ * Renders the input in a **loading** state.
31
+ *
32
+ * When `true`, the input is “soft-disabled”: it looks disabled and ignores
33
+ * user interaction but remains focusable. By default, a spinner is shown
34
+ * (_i.e._, `showSpinner` is set to `true` unless overridden).
35
+ *
36
+ * The input's accessible description while loading can be controlled via
37
+ * `loadingDescription`.
38
+ *
39
+ * To only show a spinner without “soft-disabling” the input, set
40
+ * `showSpinner` instead.
41
+ *
42
+ * @example
43
+ *
44
+ * ```tsx
45
+ * <Input loading={fetching} loadingDescription="Fetching…" />;
46
+ * ```
32
47
  *
33
48
  * @default false
34
49
  */
35
50
  loading?: boolean;
51
+ /** Accessible description of the input when it is in a “loading” state. */
52
+ loadingDescription?: ReactNode;
53
+ /**
54
+ * Whether to show a spinner in the input.
55
+ *
56
+ * Defaults to the value of the `loading` property. In most cases, prefer
57
+ * `loading`, which also “soft-disables” the input.
58
+ *
59
+ * Use `showSpinner` when you want a spinner **without** “soft-disabling” the
60
+ * input. To “soft-disable” **without** a spinner, set `loading` to `true` and
61
+ * `showSpinner` to `false`.
62
+ *
63
+ * @default loading
64
+ */
65
+ showSpinner?: boolean;
36
66
  /** Sets the input's text align. */
37
67
  align?: Responsive<CSSProperties["textAlign"]>;
38
68
  /** Input's start adornment. */
@@ -30,25 +30,48 @@ export interface MenuListItemProps extends Omit<ComponentPropsWithoutRef<"li">,
30
30
  /** Accent colour of the menu list item. */
31
31
  color?: MenuListItemColor;
32
32
  /**
33
- * Whether to display the item in "loading" state by presenting a spinner as
34
- * icon. The position of the spinner may be controlled via `iconPlacement`.
35
- *
36
- * Setting this property will automatically disable the item.
33
+ * Whether the item should be disabled.
37
34
  *
38
35
  * @default false
39
36
  */
40
- loading?: boolean;
37
+ disabled?: boolean;
41
38
  /**
42
- * Whether the item should be enabled when `loading` is `true`.
39
+ * Renders the item in a **loading** state.
40
+ *
41
+ * When `true`, the item is “soft-disabled”: it looks disabled and ignores
42
+ * user interaction but remains focusable. By default, a spinner is shown as
43
+ * the item's icon (_i.e._, `showSpinner` is set to `true` unless
44
+ * overridden).
45
+ *
46
+ * The item's content while loading can be controlled via `loadingContent`.
47
+ * The position of the spinner may be controlled via `iconPlacement`.
48
+ *
49
+ * To only show a spinner without “soft-disabling” the item, set `showSpinner`
50
+ * instead.
43
51
  *
44
52
  * @default false
45
53
  */
46
- enabledWhenLoading?: boolean;
54
+ loading?: boolean;
47
55
  /**
48
56
  * Content of the item when it is in "loading" state. If not provided, the
49
57
  * item content will remain unchanged.
50
58
  */
51
59
  loadingContent?: ReactNode;
60
+ /**
61
+ * Whether to show a spinner as the item's icon.
62
+ *
63
+ * Defaults to the value of the `loading` property. In most cases, prefer
64
+ * `loading`, which also “soft-disables” the item.
65
+ *
66
+ * Use `showSpinner` when you want a spinner **without** “soft-disabling” the
67
+ * item. To “soft-disable” **without** a spinner, set `loading` to `true` and
68
+ * `showSpinner` to `false`.
69
+ *
70
+ * The position of the spinner may be controlled via `iconPlacement`.
71
+ *
72
+ * @default loading
73
+ */
74
+ showSpinner?: boolean;
52
75
  /**
53
76
  * Optional item icon.
54
77
  *
@@ -61,12 +84,6 @@ export interface MenuListItemProps extends Omit<ComponentPropsWithoutRef<"li">,
61
84
  * @default start
62
85
  */
63
86
  iconPlacement?: MenuListIconPlacement;
64
- /**
65
- * Whether the item should be disabled.
66
- *
67
- * @default false
68
- */
69
- disabled?: boolean;
70
87
  /** Href for the link, when `itemType` is set to `"link"`. */
71
88
  href?: ComponentProps<"a">["href"];
72
89
  /** Target of the link, when `itemType` is set to `"link"`. */
@@ -1,7 +1,25 @@
1
- import { ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  import { InputPropsBase } from '../Input';
3
3
  /** Properties of the output component. */
4
- export interface OutputProps extends Omit<InputPropsBase, "asChild" | "children" | "showClearButton" | "clearButtonLabel">, ComponentPropsWithoutRef<"output"> {
4
+ export interface OutputProps extends Omit<InputPropsBase, "asChild" | "disabled" | "loading" | "loadingDescription" | "showClearButton" | "clearButtonLabel" | "onValueChange" | "onBlurToOutside" | "clearButtonProps" | "children">, ComponentPropsWithoutRef<"output"> {
5
+ /**
6
+ * Renders the output in a **pending** state.
7
+ *
8
+ * When `true`, the value should be treated as not final (for example, it is
9
+ * still being calculated or refreshed). While pending, the output is marked
10
+ * as busy for assistive technologies.
11
+ *
12
+ * The output's content while pending can be controlled via `pendingContent`.
13
+ *
14
+ * To show a spinner without marking the output as `pending`, set
15
+ * `showSpinner` instead.
16
+ */
17
+ pending?: boolean;
18
+ /**
19
+ * Content to show while the output is in a **pending** state. If not
20
+ * provided, the output content will remain unchanged.
21
+ */
22
+ pendingContent?: ReactNode;
5
23
  }
6
24
  /**
7
25
  * The output component is used to display the result of a calculation or user
@@ -15,12 +15,36 @@ export interface RadioProps extends Omit<ComponentPropsWithoutRef<typeof RadioGr
15
15
  /** Sets the radio as read-only. */
16
16
  readOnly?: boolean;
17
17
  /**
18
- * Adds a spinner to the checkbox to indicate activity. Note that it doesn't
19
- * automatically disable the checkbox.
18
+ * Renders the radio in a **loading** state.
19
+ *
20
+ * When `true`, the radio is “soft-disabled”: it looks disabled and ignores
21
+ * user interaction but remains focusable. By default, a spinner is shown
22
+ * (_i.e._, `showSpinner` is set to `true` unless overridden).
23
+ *
24
+ * The radio's accessible description while loading can be controlled via
25
+ * `loadingDescription`.
26
+ *
27
+ * To only show a spinner without “soft-disabling” the radio, set
28
+ * `showSpinner` instead.
20
29
  *
21
30
  * @default false
22
31
  */
23
32
  loading?: boolean;
33
+ /** Accessible description of the radio when it is in a “loading” state. */
34
+ loadingDescription?: ReactNode;
35
+ /**
36
+ * Whether to show a spinner next to the radio.
37
+ *
38
+ * Defaults to the value of the `loading` property. In most cases, prefer
39
+ * `loading`, which also “soft-disables” the radio.
40
+ *
41
+ * Use `showSpinner` when you want a spinner **without** “soft-disabling” the
42
+ * radio. To “soft-disable” **without** a spinner, set `loading` to `true` and
43
+ * `showSpinner` to `false`.
44
+ *
45
+ * @default loading
46
+ */
47
+ showSpinner?: boolean;
24
48
  /** Properties to pass to the root component. */
25
49
  rootProps?: ComponentPropsWithRef<"div">;
26
50
  /** Properties to pass to the code component. */
@@ -19,12 +19,36 @@ export interface RadioGroupProps extends Omit<ComponentPropsWithoutRef<typeof Ra
19
19
  /** Sets the radio group as read-only. */
20
20
  readOnly?: boolean;
21
21
  /**
22
- * Adds a spinner to the radio group to indicate activity. Note that it
23
- * doesn't automatically disable the control.
22
+ * Renders the radio group in a **loading** state.
23
+ *
24
+ * When `true`, the radio group is “soft-disabled”: it looks disabled and
25
+ * ignores user interaction but remains focusable. By default, a spinner is
26
+ * shown (_i.e._, `showSpinner` is set to `true` unless overridden).
27
+ *
28
+ * The radio group's accessible description while loading can be controlled
29
+ * via `loadingDescription`.
30
+ *
31
+ * To only show a spinner without “soft-disabling” the radio group, set
32
+ * `showSpinner` instead.
24
33
  *
25
34
  * @default false
26
35
  */
27
36
  loading?: boolean;
37
+ /** Accessible description of the radio group when it is in a “loading” state. */
38
+ loadingDescription?: ReactNode;
39
+ /**
40
+ * Whether to show a spinner next to the radio group.
41
+ *
42
+ * Defaults to the value of the `loading` property. In most cases, prefer
43
+ * `loading`, which also “soft-disables” the radio group.
44
+ *
45
+ * Use `showSpinner` when you want a spinner **without** “soft-disabling” the
46
+ * radio group. To “soft-disable” **without** a spinner, set `loading` to
47
+ * `true` and `showSpinner` to `false`.
48
+ *
49
+ * @default loading
50
+ */
51
+ showSpinner?: boolean;
28
52
  /** Radio group code. */
29
53
  code?: ReactNode;
30
54
  /**
@@ -5,7 +5,7 @@ import { Input } from '../Input';
5
5
  import { PopoverContent, PopoverTrigger } from '../Popover';
6
6
  import { Tag } from '../Tag';
7
7
  /** Base properties of the select component. */
8
- export interface SelectPropsBase<T extends string | number | readonly string[] = string | number | readonly string[]> extends ComponentPropsWithoutRef<typeof PopoverTrigger>, Pick<ComponentPropsWithoutRef<typeof Input>, "name" | "required" | "variant" | "status" | "code" | "readOnly" | "loading" | "align" | "startAdornment" | "endAdornment" | "showClearButton" | "onBlurToOutside" | "rootProps" | "codeProps" | "containerProps" | "clearButtonProps" | "spinnerProps">, Pick<ComponentPropsWithoutRef<typeof CommandMenu>, "searchPlaceholder" | "searchValue" | "onSearchValueChange"> {
8
+ export interface SelectPropsBase<T extends string | number | readonly string[] = string | number | readonly string[]> extends ComponentPropsWithoutRef<typeof PopoverTrigger>, Pick<ComponentPropsWithoutRef<typeof Input>, "name" | "required" | "variant" | "status" | "code" | "readOnly" | "loading" | "loadingDescription" | "showSpinner" | "align" | "startAdornment" | "endAdornment" | "showClearButton" | "onBlurToOutside" | "rootProps" | "codeProps" | "containerProps" | "clearButtonProps" | "spinnerProps">, Pick<ComponentPropsWithoutRef<typeof CommandMenu>, "searchPlaceholder" | "searchValue" | "onSearchValueChange"> {
9
9
  /**
10
10
  * Whether multiple options can be selected. If not set, at most one option
11
11
  * can be selected at a time.
@@ -67,16 +67,17 @@ export * from './providers/PrefixProvider';
67
67
  export * from './providers/ToastManagerProvider';
68
68
  export * from './utils/boolDataAttr.ts';
69
69
  export * from './utils/breakpoints.ts';
70
+ export * from './utils/combineAriaIds.ts';
70
71
  export * from './utils/combineEventHandlers.ts';
71
72
  export * from './utils/control.ts';
72
73
  export * from './utils/cx.ts';
73
74
  export * from './utils/filtering.ts';
74
75
  export * from './utils/keyboardShortcut.ts';
75
- export * from './utils/mergeAriaIds.ts';
76
76
  export * from './utils/nativeControls.ts';
77
77
  export * from './utils/navigate.ts';
78
78
  export * from './utils/numericStringUtils.ts';
79
79
  export * from './utils/parseDateStrict.ts';
80
+ export * from './utils/setNativeProperty.ts';
80
81
  export * from './utils/sorting.ts';
81
82
  export * from './utils/stringHash.ts';
82
83
  export * from './utils/useCombinedRef.ts';
@@ -38,7 +38,7 @@ export interface LocalizationObject {
38
38
  Feedback: Pick<FeedbackProps, "visuallyHiddenPrefix">;
39
39
  FeedbackPopover: Pick<FeedbackPopoverProps, "label">;
40
40
  FieldGroupHeader: Pick<FieldGroupHeaderProps, "visuallyHiddenCodePrefix">;
41
- Input: Pick<InputProps, "clearButtonLabel">;
41
+ Input: Pick<InputProps, "loadingDescription" | "clearButtonLabel">;
42
42
  Label: Pick<LabelProps, "requiredIconLabel" | "helperButtonLabel">;
43
43
  NumericInput: Pick<NumericInputProps, "decimalSeparator" | "groupingStyle" | "groupSeparator">;
44
44
  Select: Pick<SelectProps, "searchPlaceholder" | "emptyMessage" | "optionsLabel" | "loadingOptionsLabel">;
@@ -0,0 +1,2 @@
1
+ /** Combines `aria` identifiers for usage in, for example, `aria-describedby`. */
2
+ export declare function combineAriaIds(...args: unknown[]): string | undefined;
@@ -12,6 +12,7 @@ export interface ControlContextValue {
12
12
  variant?: ControlVariant;
13
13
  status?: ControlStatus;
14
14
  disabled?: boolean;
15
+ loading?: boolean;
15
16
  readOnly?: boolean;
16
17
  }
17
18
  /** Control context. */
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Sets the native property of an HTML element in a way that bypasses React’s
3
+ * value tracker interference, meaning that we can then dispatch an event that
4
+ * React will handle.
5
+ *
6
+ * See: https://github.com/facebook/react/issues/10135
7
+ */
8
+ export declare function setNativeProperty(element: HTMLElement, prop: string, value: unknown): void;