@itwin/itwinui-react 3.4.2 → 3.6.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 (79) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/cjs/core/Carousel/Carousel.d.ts +4 -4
  3. package/cjs/core/Carousel/CarouselNavigation.d.ts +4 -4
  4. package/cjs/core/Dialog/Dialog.js +19 -17
  5. package/cjs/core/Dialog/DialogContext.d.ts +4 -0
  6. package/cjs/core/Dialog/DialogMain.js +1 -1
  7. package/cjs/core/Dialog/DialogTitleBar.js +1 -1
  8. package/cjs/core/InputGroup/InputGroup.d.ts +4 -0
  9. package/cjs/core/InputGroup/InputGroup.js +20 -4
  10. package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +18 -62
  11. package/cjs/core/InputWithDecorations/InputWithDecorations.js +21 -6
  12. package/cjs/core/LabeledSelect/LabeledSelect.d.ts +376 -4
  13. package/cjs/core/LabeledSelect/LabeledSelect.js +1 -1
  14. package/cjs/core/Popover/Popover.d.ts +6 -3
  15. package/cjs/core/ProgressIndicators/ProgressLinear.js +6 -1
  16. package/cjs/core/ProgressIndicators/ProgressRadial.js +8 -3
  17. package/cjs/core/SearchBox/SearchBox.js +4 -6
  18. package/cjs/core/Select/Select.d.ts +197 -102
  19. package/cjs/core/Select/Select.js +72 -19
  20. package/cjs/core/Table/Table.js +2 -1
  21. package/cjs/core/Tabs/Tabs.js +19 -3
  22. package/cjs/core/Tile/Tile.d.ts +2 -2
  23. package/cjs/core/ToggleSwitch/ToggleSwitch.d.ts +4 -2
  24. package/cjs/core/ToggleSwitch/ToggleSwitch.js +5 -11
  25. package/cjs/core/Typography/Anchor.d.ts +21 -1
  26. package/cjs/core/Typography/Anchor.js +38 -3
  27. package/cjs/core/VisuallyHidden/VisuallyHidden.js +19 -3
  28. package/cjs/core/utils/components/InputFlexContainer.d.ts +25 -0
  29. package/cjs/core/utils/components/InputFlexContainer.js +19 -1
  30. package/cjs/core/utils/components/LineClamp.d.ts +5 -0
  31. package/cjs/core/utils/components/LineClamp.js +49 -0
  32. package/cjs/core/utils/components/ShadowRoot.d.ts +2 -1
  33. package/cjs/core/utils/components/ShadowRoot.js +19 -4
  34. package/cjs/core/utils/components/index.d.ts +1 -0
  35. package/cjs/core/utils/components/index.js +1 -0
  36. package/cjs/core/utils/functions/polymorphic.d.ts +5 -3
  37. package/cjs/core/utils/functions/polymorphic.js +20 -5
  38. package/cjs/core/utils/icons/Svg.js +5 -1
  39. package/cjs/core/utils/icons/SvgStatusError.js +1 -1
  40. package/esm/core/Carousel/Carousel.d.ts +4 -4
  41. package/esm/core/Carousel/CarouselNavigation.d.ts +4 -4
  42. package/esm/core/Dialog/Dialog.js +19 -17
  43. package/esm/core/Dialog/DialogContext.d.ts +4 -0
  44. package/esm/core/Dialog/DialogMain.js +1 -1
  45. package/esm/core/Dialog/DialogTitleBar.js +1 -1
  46. package/esm/core/InputGroup/InputGroup.d.ts +4 -0
  47. package/esm/core/InputGroup/InputGroup.js +20 -4
  48. package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +18 -62
  49. package/esm/core/InputWithDecorations/InputWithDecorations.js +22 -7
  50. package/esm/core/LabeledSelect/LabeledSelect.d.ts +376 -4
  51. package/esm/core/LabeledSelect/LabeledSelect.js +1 -1
  52. package/esm/core/Popover/Popover.d.ts +6 -3
  53. package/esm/core/ProgressIndicators/ProgressLinear.js +7 -2
  54. package/esm/core/ProgressIndicators/ProgressRadial.js +9 -4
  55. package/esm/core/SearchBox/SearchBox.js +5 -7
  56. package/esm/core/Select/Select.d.ts +197 -102
  57. package/esm/core/Select/Select.js +73 -20
  58. package/esm/core/Table/Table.js +2 -1
  59. package/esm/core/Tabs/Tabs.js +19 -3
  60. package/esm/core/Tile/Tile.d.ts +2 -2
  61. package/esm/core/ToggleSwitch/ToggleSwitch.d.ts +4 -2
  62. package/esm/core/ToggleSwitch/ToggleSwitch.js +6 -12
  63. package/esm/core/Typography/Anchor.d.ts +21 -1
  64. package/esm/core/Typography/Anchor.js +11 -2
  65. package/esm/core/VisuallyHidden/VisuallyHidden.js +19 -3
  66. package/esm/core/utils/components/InputFlexContainer.d.ts +25 -0
  67. package/esm/core/utils/components/InputFlexContainer.js +18 -0
  68. package/esm/core/utils/components/LineClamp.d.ts +5 -0
  69. package/esm/core/utils/components/LineClamp.js +23 -0
  70. package/esm/core/utils/components/ShadowRoot.d.ts +2 -1
  71. package/esm/core/utils/components/ShadowRoot.js +19 -4
  72. package/esm/core/utils/components/index.d.ts +1 -0
  73. package/esm/core/utils/components/index.js +1 -0
  74. package/esm/core/utils/functions/polymorphic.d.ts +5 -3
  75. package/esm/core/utils/functions/polymorphic.js +20 -5
  76. package/esm/core/utils/icons/Svg.js +5 -1
  77. package/esm/core/utils/icons/SvgStatusError.js +1 -1
  78. package/package.json +27 -27
  79. package/styles.css +39 -38
@@ -5,9 +5,9 @@ import type { InputProps } from '../Input/Input.js';
5
5
  * Input component with various additional decorations.
6
6
  * You can add icons, buttons and other various subcomponents to it.
7
7
  *
8
- * If you are not using default InputWithDecorations.Icon and InputWithDecorations.Button, use borderless versions of other components.
8
+ * If you are not using default `InputWithDecorations.Icon` and `InputWithDecorations.Button`, use borderless versions of other components.
9
9
  *
10
- * @usage
10
+ * @example
11
11
  * <InputWithDecorations>
12
12
  * <InputWithDecorations.Input />
13
13
  * <InputWithDecorations.Icon>
@@ -26,68 +26,24 @@ export declare const InputWithDecorations: PolymorphicForwardRefComponent<"div",
26
26
  Input: PolymorphicForwardRefComponent<"input", InputProps>;
27
27
  /**
28
28
  * Subcomponent to include button in your InputWithDecorations
29
+ *
30
+ * Although similar to `IconButton`, this subcomponent additionally collapses the padding between the button and the input/textarea
31
+ * in `InputWithDecorations`.
29
32
  */
30
- Button: PolymorphicForwardRefComponent<"span", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
33
+ Button: PolymorphicForwardRefComponent<"button", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
31
34
  ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
32
- }, "label" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "isActive" | "iconProps"> & {
33
- isActive?: boolean | undefined;
34
- label?: React.ReactNode;
35
- labelProps?: Omit<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
36
- ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
37
- }, "as" | "children" | "content" | "portal" | keyof {
38
- placement?: import("@floating-ui/utils").Placement | undefined;
39
- visible?: boolean | undefined;
40
- onVisibleChange?: ((visible: boolean) => void) | undefined;
41
- autoUpdateOptions?: {
42
- ancestorScroll?: boolean | undefined;
43
- ancestorResize?: boolean | undefined;
44
- elementResize?: boolean | undefined;
45
- animationFrame?: boolean | undefined;
46
- layoutShift?: boolean | undefined;
47
- } | undefined;
48
- middleware?: {
49
- offset?: number | undefined;
50
- flip?: boolean | undefined;
51
- shift?: boolean | undefined;
52
- size?: boolean | undefined;
53
- autoPlacement?: boolean | undefined;
54
- hide?: boolean | undefined;
55
- inline?: boolean | undefined;
56
- } | undefined;
57
- reference?: HTMLElement | null | undefined;
58
- ariaStrategy?: "label" | "description" | "none" | undefined;
59
- id?: string | undefined;
60
- }> & {
61
- content: React.ReactNode;
62
- children?: React.ReactNode;
63
- } & import("../utils/index.js").PortalProps & {
64
- placement?: import("@floating-ui/utils").Placement | undefined;
65
- visible?: boolean | undefined;
66
- onVisibleChange?: ((visible: boolean) => void) | undefined;
67
- autoUpdateOptions?: {
68
- ancestorScroll?: boolean | undefined;
69
- ancestorResize?: boolean | undefined;
70
- elementResize?: boolean | undefined;
71
- animationFrame?: boolean | undefined;
72
- layoutShift?: boolean | undefined;
73
- } | undefined;
74
- middleware?: {
75
- offset?: number | undefined;
76
- flip?: boolean | undefined;
77
- shift?: boolean | undefined;
78
- size?: boolean | undefined;
79
- autoPlacement?: boolean | undefined;
80
- hide?: boolean | undefined;
81
- inline?: boolean | undefined;
82
- } | undefined;
83
- reference?: HTMLElement | null | undefined;
84
- ariaStrategy?: "label" | "description" | "none" | undefined;
85
- id?: string | undefined;
86
- } & {
87
- as?: "div" | undefined;
88
- }, "ref">, "children" | "content" | "reference" | "ariaStrategy"> | undefined;
89
- iconProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> | undefined;
90
- } & Omit<import("../Buttons/Button.js").ButtonProps, "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
35
+ }, "label" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "isActive" | "iconProps"> & Omit<import("../Buttons/IconButton.js").IconButtonProps, "styleType"> & {
36
+ styleType?: "default" | "cta" | "high-visibility" | "borderless" | undefined;
37
+ } & {
91
38
  as?: "button" | undefined;
92
39
  }>;
40
+ /**
41
+ * Subcomponent to include button in your InputWithDecorations.
42
+ *
43
+ * Although similar to `Icon`, this subcomponent additionally collapses the padding between the icon and the input/textarea
44
+ * in `InputWithDecorations`.
45
+ */
46
+ Icon: PolymorphicForwardRefComponent<"span", Omit<import("../Icon/Icon.js").IconProps, "padded"> & {
47
+ padded?: boolean | undefined;
48
+ }>;
93
49
  };
@@ -3,33 +3,38 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import * as React from 'react';
6
- import { Box, InputFlexContainer, useSafeContext } from '../utils/index.js';
7
- import { IconButton } from '../Buttons/IconButton.js';
6
+ import { Box, InputFlexContainer, InputFlexContainerButton, InputFlexContainerIcon, useSafeContext, } from '../utils/index.js';
8
7
  const InputWithDecorationsContext = React.createContext(undefined);
9
8
  const InputWithDecorationsComponent = React.forwardRef((props, ref) => {
10
9
  const { children, size, isDisabled, ...rest } = props;
11
10
  return (React.createElement(InputWithDecorationsContext.Provider, { value: { size, isDisabled } },
12
11
  React.createElement(InputFlexContainer, { isDisabled: isDisabled, size: size, ref: ref, ...rest }, children)));
13
12
  });
14
- //-------------------------------------------------------------------------------
13
+ // ----------------------------------------------------------------------------
15
14
  const InputWithDecorationsInput = React.forwardRef((props, ref) => {
16
15
  const { id: idProp, size, disabled: localDisabled, ...rest } = props;
17
16
  const { size: contextSize, isDisabled } = useSafeContext(InputWithDecorationsContext);
18
17
  return (React.createElement(Box, { as: 'input', ref: ref, "data-iui-size": size ?? contextSize, disabled: localDisabled ?? isDisabled, id: idProp, ...rest }));
19
18
  });
20
- //-------------------------------------------------------------------------------
19
+ InputWithDecorationsInput.displayName = 'InputWithDecorations.Input';
20
+ // ----------------------------------------------------------------------------
21
21
  const InputWithDecorationsButton = React.forwardRef((props, ref) => {
22
22
  const { children, size, disabled: localDisabled, ...rest } = props;
23
23
  const { size: contextSize, isDisabled } = useSafeContext(InputWithDecorationsContext);
24
- return (React.createElement(IconButton, { ref: ref, size: size ?? contextSize, styleType: 'borderless', disabled: localDisabled ?? isDisabled, ...rest }, children));
24
+ return (React.createElement(InputFlexContainerButton, { ref: ref, size: size ?? contextSize, disabled: localDisabled ?? isDisabled, ...rest }, children));
25
25
  });
26
+ InputWithDecorationsButton.displayName = 'InputWithDecorations.Button';
27
+ // ----------------------------------------------------------------------------
28
+ const InputWithDecorationsIcon = InputFlexContainerIcon;
29
+ InputWithDecorationsIcon.displayName = 'InputWithDecorations.Icon';
30
+ // ----------------------------------------------------------------------------
26
31
  /**
27
32
  * Input component with various additional decorations.
28
33
  * You can add icons, buttons and other various subcomponents to it.
29
34
  *
30
- * If you are not using default InputWithDecorations.Icon and InputWithDecorations.Button, use borderless versions of other components.
35
+ * If you are not using default `InputWithDecorations.Icon` and `InputWithDecorations.Button`, use borderless versions of other components.
31
36
  *
32
- * @usage
37
+ * @example
33
38
  * <InputWithDecorations>
34
39
  * <InputWithDecorations.Input />
35
40
  * <InputWithDecorations.Icon>
@@ -44,6 +49,16 @@ export const InputWithDecorations = Object.assign(InputWithDecorationsComponent,
44
49
  Input: InputWithDecorationsInput,
45
50
  /**
46
51
  * Subcomponent to include button in your InputWithDecorations
52
+ *
53
+ * Although similar to `IconButton`, this subcomponent additionally collapses the padding between the button and the input/textarea
54
+ * in `InputWithDecorations`.
47
55
  */
48
56
  Button: InputWithDecorationsButton,
57
+ /**
58
+ * Subcomponent to include button in your InputWithDecorations.
59
+ *
60
+ * Although similar to `Icon`, this subcomponent additionally collapses the padding between the icon and the input/textarea
61
+ * in `InputWithDecorations`.
62
+ */
63
+ Icon: InputWithDecorationsIcon,
49
64
  });
@@ -40,7 +40,10 @@ export type LabeledSelectProps<T> = {
40
40
  */
41
41
  svgIcon?: JSX.Element;
42
42
  /**
43
- * If true, shows a red asterisk but does not prevent form submission.
43
+ * If true, shows a red asterisk.
44
+ *
45
+ * Form submission is only disabled when using the `native` prop (i.e. `<LabeledSelect native>`).
46
+ *
44
47
  * @default false
45
48
  */
46
49
  required?: boolean;
@@ -60,7 +63,12 @@ export type LabeledSelectProps<T> = {
60
63
  * Passes properties for message icon.
61
64
  */
62
65
  messageIconProps?: React.ComponentProps<typeof Icon>;
63
- } & Pick<LabeledInputProps, 'displayStyle'> & SelectProps<T>;
66
+ } & Pick<LabeledInputProps, 'displayStyle'> & SelectProps<T> & {
67
+ /**
68
+ * LabeledSelect does not support `styleType`.
69
+ */
70
+ styleType?: never;
71
+ };
64
72
  /**
65
73
  * Labeled select component to select value from options.
66
74
  * @example
@@ -94,6 +102,370 @@ export type LabeledSelectProps<T> = {
94
102
  * svgIcon={<SvgCamera />}
95
103
  * />
96
104
  */
97
- export declare const LabeledSelect: <T>(props: LabeledSelectProps<T> & {
105
+ export declare const LabeledSelect: <T>(props: ({
106
+ /**
107
+ * Label of the select.
108
+ */
109
+ label?: React.ReactNode;
110
+ /**
111
+ * Message below the select. Does not apply to 'inline' select.
112
+ *
113
+ * @example
114
+ * <caption>strings</caption>
115
+ * <LabeledSelect message='Positive Message' … />
116
+ *
117
+ * @example
118
+ * <caption>Using StatusMessage for complete customization (e.g. icon)</caption>
119
+ * <LabeledSelect
120
+ * status="positive"
121
+ * message={
122
+ * <StatusMessage status="positive" startIcon={<SvgStar />}>
123
+ * Help message
124
+ * </StatusMessage>
125
+ * }
126
+ * …
127
+ * />
128
+ */
129
+ message?: React.ReactNode;
130
+ /**
131
+ * Status of the select.
132
+ * @default ''
133
+ */
134
+ status?: "negative" | "positive" | "warning" | undefined;
135
+ /**
136
+ * @deprecated Pass a `<StatusMessage startIcon={svgIcon} />` to the `message` prop instead.
137
+ *
138
+ * Custom svg icon. Will override status icon if specified.
139
+ */
140
+ svgIcon?: JSX.Element | undefined;
141
+ /**
142
+ * If true, shows a red asterisk.
143
+ *
144
+ * Form submission is only disabled when using the `native` prop (i.e. `<LabeledSelect native>`).
145
+ *
146
+ * @default false
147
+ */
148
+ required?: boolean | undefined;
149
+ /**
150
+ * Pass props to wrapper element.
151
+ */
152
+ wrapperProps?: (Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
153
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
154
+ }, "as" | "labelPlacement"> & {
155
+ labelPlacement?: "default" | "inline" | undefined;
156
+ } & {
157
+ as?: "div" | undefined;
158
+ }) | undefined;
159
+ /**
160
+ * Passes properties for label.
161
+ */
162
+ labelProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> | undefined;
163
+ /**
164
+ * Passes properties for message content.
165
+ */
166
+ messageContentProps?: (Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
167
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
168
+ }) | undefined;
169
+ /**
170
+ * Passes properties for message icon.
171
+ */
172
+ messageIconProps?: (Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
173
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
174
+ }, "fill" | "as" | "key" | "size" | keyof React.HTMLAttributes<HTMLSpanElement> | "padded"> & {
175
+ size?: "small" | "auto" | "medium" | "large" | import("../utils/types.js").AnyString | undefined;
176
+ fill?: "default" | "informational" | "negative" | "positive" | "warning" | import("../utils/types.js").AnyString | undefined;
177
+ padded?: boolean | undefined;
178
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
179
+ as?: "span" | undefined;
180
+ }) | undefined;
181
+ } & Pick<LabeledInputProps, "displayStyle"> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onChange" | "defaultValue" | "placeholder" | "value"> & {
182
+ native: true;
183
+ } & {
184
+ disabled?: boolean | undefined;
185
+ size?: "small" | "large" | undefined;
186
+ status?: "negative" | "positive" | "warning" | undefined;
187
+ } & {
188
+ value?: string | null | undefined;
189
+ onChange?: ((value: string, event: React.ChangeEvent<HTMLSelectElement>) => void) | undefined;
190
+ options: {
191
+ label: string;
192
+ value: string;
193
+ disabled?: boolean | undefined;
194
+ }[];
195
+ defaultValue?: string | undefined;
196
+ triggerProps?: Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & {
197
+ ref?: ((instance: HTMLSelectElement | null) => void) | React.RefObject<HTMLSelectElement> | null | undefined;
198
+ }, "size"> | undefined;
199
+ required?: boolean | undefined;
200
+ multiple?: undefined;
201
+ } & {
202
+ styleType?: "default" | undefined;
203
+ placeholder?: string | undefined;
204
+ } & {
205
+ /**
206
+ * LabeledSelect does not support `styleType`.
207
+ */
208
+ styleType?: undefined;
209
+ } & {
210
+ ref?: React.ForwardedRef<HTMLElement> | undefined;
211
+ }) | ({
212
+ /**
213
+ * Label of the select.
214
+ */
215
+ label?: React.ReactNode;
216
+ /**
217
+ * Message below the select. Does not apply to 'inline' select.
218
+ *
219
+ * @example
220
+ * <caption>strings</caption>
221
+ * <LabeledSelect message='Positive Message' … />
222
+ *
223
+ * @example
224
+ * <caption>Using StatusMessage for complete customization (e.g. icon)</caption>
225
+ * <LabeledSelect
226
+ * status="positive"
227
+ * message={
228
+ * <StatusMessage status="positive" startIcon={<SvgStar />}>
229
+ * Help message
230
+ * </StatusMessage>
231
+ * }
232
+ * …
233
+ * />
234
+ */
235
+ message?: React.ReactNode;
236
+ /**
237
+ * Status of the select.
238
+ * @default ''
239
+ */
240
+ status?: "negative" | "positive" | "warning" | undefined;
241
+ /**
242
+ * @deprecated Pass a `<StatusMessage startIcon={svgIcon} />` to the `message` prop instead.
243
+ *
244
+ * Custom svg icon. Will override status icon if specified.
245
+ */
246
+ svgIcon?: JSX.Element | undefined;
247
+ /**
248
+ * If true, shows a red asterisk.
249
+ *
250
+ * Form submission is only disabled when using the `native` prop (i.e. `<LabeledSelect native>`).
251
+ *
252
+ * @default false
253
+ */
254
+ required?: boolean | undefined;
255
+ /**
256
+ * Pass props to wrapper element.
257
+ */
258
+ wrapperProps?: (Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
259
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
260
+ }, "as" | "labelPlacement"> & {
261
+ labelPlacement?: "default" | "inline" | undefined;
262
+ } & {
263
+ as?: "div" | undefined;
264
+ }) | undefined;
265
+ /**
266
+ * Passes properties for label.
267
+ */
268
+ labelProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> | undefined;
269
+ /**
270
+ * Passes properties for message content.
271
+ */
272
+ messageContentProps?: (Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
273
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
274
+ }) | undefined;
275
+ /**
276
+ * Passes properties for message icon.
277
+ */
278
+ messageIconProps?: (Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
279
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
280
+ }, "fill" | "as" | "key" | "size" | keyof React.HTMLAttributes<HTMLSpanElement> | "padded"> & {
281
+ size?: "small" | "auto" | "medium" | "large" | import("../utils/types.js").AnyString | undefined;
282
+ fill?: "default" | "informational" | "negative" | "positive" | "warning" | import("../utils/types.js").AnyString | undefined;
283
+ padded?: boolean | undefined;
284
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
285
+ as?: "span" | undefined;
286
+ }) | undefined;
287
+ } & Pick<LabeledInputProps, "displayStyle"> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onChange" | "defaultValue" | "placeholder" | "value"> & {
288
+ native?: false | undefined;
289
+ } & {
290
+ disabled?: boolean | undefined;
291
+ size?: "small" | "large" | undefined;
292
+ status?: "negative" | "positive" | "warning" | undefined;
293
+ } & {
294
+ placeholder?: React.ReactNode;
295
+ options: import("../Select/Select.js").SelectOption<T>[];
296
+ itemRenderer?: ((option: import("../Select/Select.js").SelectOption<T>, itemProps: import("../Select/Select.js").ItemRendererProps) => JSX.Element) | undefined;
297
+ menuClassName?: string | undefined;
298
+ menuStyle?: React.CSSProperties | undefined;
299
+ popoverProps?: Pick<{
300
+ placement?: import("@floating-ui/core").Placement | undefined;
301
+ visible?: boolean | undefined;
302
+ onVisibleChange?: ((visible: boolean) => void) | undefined;
303
+ closeOnOutsideClick?: boolean | undefined;
304
+ middleware?: {
305
+ offset?: number | undefined;
306
+ flip?: boolean | undefined;
307
+ shift?: boolean | undefined;
308
+ autoPlacement?: boolean | undefined;
309
+ hide?: boolean | undefined;
310
+ inline?: boolean | undefined;
311
+ } | undefined;
312
+ } & {
313
+ autoUpdateOptions?: {
314
+ ancestorScroll?: boolean | undefined;
315
+ ancestorResize?: boolean | undefined;
316
+ elementResize?: boolean | undefined;
317
+ animationFrame?: boolean | undefined;
318
+ layoutShift?: boolean | undefined;
319
+ } | undefined;
320
+ trigger?: Partial<Record<"click" | "hover" | "focus", boolean>> | undefined;
321
+ role?: "dialog" | "menu" | "listbox" | undefined;
322
+ matchWidth?: boolean | undefined;
323
+ }, "placement" | "visible" | "onVisibleChange" | "closeOnOutsideClick" | "matchWidth"> | undefined;
324
+ triggerProps?: (Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
325
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
326
+ }) | undefined;
327
+ } & {
328
+ multiple?: false | undefined;
329
+ selectedItemRenderer?: ((option: import("../Select/Select.js").SelectOption<T>) => JSX.Element) | undefined;
330
+ value?: T | null | undefined;
331
+ onChange?: ((value: T) => void) | undefined;
332
+ } & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "disabled" | "onChange" | "placeholder" | "size"> & {
333
+ styleType?: undefined;
334
+ } & {
335
+ /**
336
+ * LabeledSelect does not support `styleType`.
337
+ */
338
+ styleType?: undefined;
339
+ } & {
340
+ ref?: React.ForwardedRef<HTMLElement> | undefined;
341
+ }) | ({
342
+ /**
343
+ * Label of the select.
344
+ */
345
+ label?: React.ReactNode;
346
+ /**
347
+ * Message below the select. Does not apply to 'inline' select.
348
+ *
349
+ * @example
350
+ * <caption>strings</caption>
351
+ * <LabeledSelect message='Positive Message' … />
352
+ *
353
+ * @example
354
+ * <caption>Using StatusMessage for complete customization (e.g. icon)</caption>
355
+ * <LabeledSelect
356
+ * status="positive"
357
+ * message={
358
+ * <StatusMessage status="positive" startIcon={<SvgStar />}>
359
+ * Help message
360
+ * </StatusMessage>
361
+ * }
362
+ * …
363
+ * />
364
+ */
365
+ message?: React.ReactNode;
366
+ /**
367
+ * Status of the select.
368
+ * @default ''
369
+ */
370
+ status?: "negative" | "positive" | "warning" | undefined;
371
+ /**
372
+ * @deprecated Pass a `<StatusMessage startIcon={svgIcon} />` to the `message` prop instead.
373
+ *
374
+ * Custom svg icon. Will override status icon if specified.
375
+ */
376
+ svgIcon?: JSX.Element | undefined;
377
+ /**
378
+ * If true, shows a red asterisk.
379
+ *
380
+ * Form submission is only disabled when using the `native` prop (i.e. `<LabeledSelect native>`).
381
+ *
382
+ * @default false
383
+ */
384
+ required?: boolean | undefined;
385
+ /**
386
+ * Pass props to wrapper element.
387
+ */
388
+ wrapperProps?: (Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
389
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
390
+ }, "as" | "labelPlacement"> & {
391
+ labelPlacement?: "default" | "inline" | undefined;
392
+ } & {
393
+ as?: "div" | undefined;
394
+ }) | undefined;
395
+ /**
396
+ * Passes properties for label.
397
+ */
398
+ labelProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> | undefined;
399
+ /**
400
+ * Passes properties for message content.
401
+ */
402
+ messageContentProps?: (Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
403
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
404
+ }) | undefined;
405
+ /**
406
+ * Passes properties for message icon.
407
+ */
408
+ messageIconProps?: (Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
409
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
410
+ }, "fill" | "as" | "key" | "size" | keyof React.HTMLAttributes<HTMLSpanElement> | "padded"> & {
411
+ size?: "small" | "auto" | "medium" | "large" | import("../utils/types.js").AnyString | undefined;
412
+ fill?: "default" | "informational" | "negative" | "positive" | "warning" | import("../utils/types.js").AnyString | undefined;
413
+ padded?: boolean | undefined;
414
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
415
+ as?: "span" | undefined;
416
+ }) | undefined;
417
+ } & Pick<LabeledInputProps, "displayStyle"> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onChange" | "defaultValue" | "placeholder" | "value"> & {
418
+ native?: false | undefined;
419
+ } & {
420
+ disabled?: boolean | undefined;
421
+ size?: "small" | "large" | undefined;
422
+ status?: "negative" | "positive" | "warning" | undefined;
423
+ } & {
424
+ placeholder?: React.ReactNode;
425
+ options: import("../Select/Select.js").SelectOption<T>[];
426
+ itemRenderer?: ((option: import("../Select/Select.js").SelectOption<T>, itemProps: import("../Select/Select.js").ItemRendererProps) => JSX.Element) | undefined;
427
+ menuClassName?: string | undefined;
428
+ menuStyle?: React.CSSProperties | undefined;
429
+ popoverProps?: Pick<{
430
+ placement?: import("@floating-ui/core").Placement | undefined;
431
+ visible?: boolean | undefined;
432
+ onVisibleChange?: ((visible: boolean) => void) | undefined;
433
+ closeOnOutsideClick?: boolean | undefined;
434
+ middleware?: {
435
+ offset?: number | undefined;
436
+ flip?: boolean | undefined;
437
+ shift?: boolean | undefined;
438
+ autoPlacement?: boolean | undefined;
439
+ hide?: boolean | undefined;
440
+ inline?: boolean | undefined;
441
+ } | undefined;
442
+ } & {
443
+ autoUpdateOptions?: {
444
+ ancestorScroll?: boolean | undefined;
445
+ ancestorResize?: boolean | undefined;
446
+ elementResize?: boolean | undefined;
447
+ animationFrame?: boolean | undefined;
448
+ layoutShift?: boolean | undefined;
449
+ } | undefined;
450
+ trigger?: Partial<Record<"click" | "hover" | "focus", boolean>> | undefined;
451
+ role?: "dialog" | "menu" | "listbox" | undefined;
452
+ matchWidth?: boolean | undefined;
453
+ }, "placement" | "visible" | "onVisibleChange" | "closeOnOutsideClick" | "matchWidth"> | undefined;
454
+ triggerProps?: (Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
455
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
456
+ }) | undefined;
457
+ } & {
458
+ multiple: true;
459
+ selectedItemRenderer?: ((options: import("../Select/Select.js").SelectOption<T>[]) => JSX.Element) | undefined;
460
+ value?: T[] | undefined;
461
+ onChange?: ((value: T, event: import("../Select/Select.js").SelectValueChangeEvent) => void) | undefined;
462
+ } & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "disabled" | "onChange" | "placeholder" | "size"> & {
463
+ styleType?: undefined;
464
+ } & {
465
+ /**
466
+ * LabeledSelect does not support `styleType`.
467
+ */
468
+ styleType?: undefined;
469
+ } & {
98
470
  ref?: React.ForwardedRef<HTMLElement> | undefined;
99
- }) => JSX.Element;
471
+ })) => JSX.Element;
@@ -45,6 +45,6 @@ export const LabeledSelect = React.forwardRef((props, forwardedRef) => {
45
45
  const { className, disabled = false, label, message, status, svgIcon, displayStyle = 'default', style, required = false, wrapperProps, labelProps, messageContentProps, messageIconProps, ...rest } = props;
46
46
  return (React.createElement(InputGrid, { labelPlacement: displayStyle, "data-iui-status": status, ...wrapperProps },
47
47
  label && (React.createElement(Label, { as: 'div', required: required, disabled: disabled, ...labelProps }, label)),
48
- React.createElement(Select, { disabled: disabled, className: className, style: style, ...rest, ref: forwardedRef }),
48
+ React.createElement(Select, { disabled: disabled, className: className, style: style, required: props.native ? required : undefined, ...rest, ref: forwardedRef, ...{ styleType: 'default' } }),
49
49
  typeof message === 'string' ? (React.createElement(StatusMessage, { status: status, startIcon: svgIcon, iconProps: messageIconProps, contentProps: messageContentProps }, message)) : (message)));
50
50
  });
@@ -71,7 +71,7 @@ type PopoverInternalProps = {
71
71
  };
72
72
  export declare const usePopover: (options: PopoverOptions & PopoverInternalProps) => {
73
73
  placement: Placement;
74
- strategy: import("@floating-ui/utils").Strategy;
74
+ strategy: import("@floating-ui/react").Strategy;
75
75
  middlewareData: import("@floating-ui/core").MiddlewareData;
76
76
  x: number;
77
77
  y: number;
@@ -92,7 +92,7 @@ export declare const usePopover: (options: PopoverOptions & PopoverInternalProps
92
92
  x: number;
93
93
  y: number;
94
94
  placement: Placement;
95
- strategy: import("@floating-ui/utils").Strategy;
95
+ strategy: import("@floating-ui/react").Strategy;
96
96
  middlewareData: import("@floating-ui/core").MiddlewareData;
97
97
  isPositioned: boolean;
98
98
  update: () => void;
@@ -108,7 +108,10 @@ export declare const usePopover: (options: PopoverOptions & PopoverInternalProps
108
108
  };
109
109
  getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
110
110
  getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => Record<string, unknown>;
111
- getItemProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
111
+ getItemProps: (userProps?: (Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
112
+ active?: boolean | undefined;
113
+ selected?: boolean | undefined;
114
+ }) | undefined) => Record<string, unknown>;
112
115
  open: boolean | undefined;
113
116
  onOpenChange: React.Dispatch<React.SetStateAction<boolean | undefined>>;
114
117
  };
@@ -4,7 +4,8 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import * as React from 'react';
6
6
  import cx from 'classnames';
7
- import { Box, getBoundedValue } from '../utils/index.js';
7
+ import { Box, ShadowRoot, getBoundedValue } from '../utils/index.js';
8
+ import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
8
9
  /**
9
10
  * Shows progress on a linear bar
10
11
  * @example
@@ -33,5 +34,9 @@ export const ProgressLinear = React.forwardRef((props, forwardedRef) => {
33
34
  const boundedValue = getBoundedValue(value ?? 100, 0, 100);
34
35
  return (React.createElement(Box, { className: cx('iui-progress-indicator-linear', className), ref: forwardedRef, "data-iui-status": status, "data-iui-indeterminate": indeterminate ? 'true' : undefined, "data-iui-animated": isAnimated ? 'true' : undefined, style: {
35
36
  '--iui-progress-percentage': `${boundedValue}%`,
36
- }, ...rest }, labels.length > 0 && (React.createElement(Box, { as: 'div', ...labelGroupProps, className: cx('iui-progress-indicator-linear-label', labelGroupProps?.className) }, labels.map((label, index) => (React.createElement("span", { key: index }, label)))))));
37
+ }, ...rest },
38
+ React.createElement(ShadowRoot, null,
39
+ value !== 100 && React.createElement(VisuallyHidden, null, "Loading."),
40
+ React.createElement("slot", null)),
41
+ labels.length > 0 && (React.createElement(Box, { as: 'div', ...labelGroupProps, className: cx('iui-progress-indicator-linear-label', labelGroupProps?.className) }, labels.map((label, index) => (React.createElement("span", { key: index }, label)))))));
37
42
  });
@@ -4,7 +4,8 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import cx from 'classnames';
6
6
  import * as React from 'react';
7
- import { SvgCheckmarkSmall, SvgImportantSmall, Box, getBoundedValue, } from '../utils/index.js';
7
+ import { SvgCheckmarkSmall, SvgImportantSmall, Box, getBoundedValue, ShadowRoot, } from '../utils/index.js';
8
+ import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
8
9
  /**
9
10
  * Circular Progress Indicator
10
11
  * @example
@@ -33,7 +34,11 @@ export const ProgressRadial = React.forwardRef((props, forwardedRef) => {
33
34
  '--iui-progress-percentage': `${getBoundedValue(value, 0, 100)}%`,
34
35
  }),
35
36
  ...style,
36
- }, ...rest }, size !== 'x-small'
37
- ? children ?? (!!status ? statusMap[status] : null)
38
- : null));
37
+ }, ...rest },
38
+ React.createElement(ShadowRoot, null,
39
+ value !== 100 && React.createElement(VisuallyHidden, null, "Loading."),
40
+ React.createElement("slot", null)),
41
+ size !== 'x-small'
42
+ ? children ?? (!!status ? statusMap[status] : null)
43
+ : null));
39
44
  });