@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.
- package/CHANGELOG.md +46 -0
- package/cjs/core/Carousel/Carousel.d.ts +4 -4
- package/cjs/core/Carousel/CarouselNavigation.d.ts +4 -4
- package/cjs/core/Dialog/Dialog.js +19 -17
- package/cjs/core/Dialog/DialogContext.d.ts +4 -0
- package/cjs/core/Dialog/DialogMain.js +1 -1
- package/cjs/core/Dialog/DialogTitleBar.js +1 -1
- package/cjs/core/InputGroup/InputGroup.d.ts +4 -0
- package/cjs/core/InputGroup/InputGroup.js +20 -4
- package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +18 -62
- package/cjs/core/InputWithDecorations/InputWithDecorations.js +21 -6
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +376 -4
- package/cjs/core/LabeledSelect/LabeledSelect.js +1 -1
- package/cjs/core/Popover/Popover.d.ts +6 -3
- package/cjs/core/ProgressIndicators/ProgressLinear.js +6 -1
- package/cjs/core/ProgressIndicators/ProgressRadial.js +8 -3
- package/cjs/core/SearchBox/SearchBox.js +4 -6
- package/cjs/core/Select/Select.d.ts +197 -102
- package/cjs/core/Select/Select.js +72 -19
- package/cjs/core/Table/Table.js +2 -1
- package/cjs/core/Tabs/Tabs.js +19 -3
- package/cjs/core/Tile/Tile.d.ts +2 -2
- package/cjs/core/ToggleSwitch/ToggleSwitch.d.ts +4 -2
- package/cjs/core/ToggleSwitch/ToggleSwitch.js +5 -11
- package/cjs/core/Typography/Anchor.d.ts +21 -1
- package/cjs/core/Typography/Anchor.js +38 -3
- package/cjs/core/VisuallyHidden/VisuallyHidden.js +19 -3
- package/cjs/core/utils/components/InputFlexContainer.d.ts +25 -0
- package/cjs/core/utils/components/InputFlexContainer.js +19 -1
- package/cjs/core/utils/components/LineClamp.d.ts +5 -0
- package/cjs/core/utils/components/LineClamp.js +49 -0
- package/cjs/core/utils/components/ShadowRoot.d.ts +2 -1
- package/cjs/core/utils/components/ShadowRoot.js +19 -4
- package/cjs/core/utils/components/index.d.ts +1 -0
- package/cjs/core/utils/components/index.js +1 -0
- package/cjs/core/utils/functions/polymorphic.d.ts +5 -3
- package/cjs/core/utils/functions/polymorphic.js +20 -5
- package/cjs/core/utils/icons/Svg.js +5 -1
- package/cjs/core/utils/icons/SvgStatusError.js +1 -1
- package/esm/core/Carousel/Carousel.d.ts +4 -4
- package/esm/core/Carousel/CarouselNavigation.d.ts +4 -4
- package/esm/core/Dialog/Dialog.js +19 -17
- package/esm/core/Dialog/DialogContext.d.ts +4 -0
- package/esm/core/Dialog/DialogMain.js +1 -1
- package/esm/core/Dialog/DialogTitleBar.js +1 -1
- package/esm/core/InputGroup/InputGroup.d.ts +4 -0
- package/esm/core/InputGroup/InputGroup.js +20 -4
- package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +18 -62
- package/esm/core/InputWithDecorations/InputWithDecorations.js +22 -7
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +376 -4
- package/esm/core/LabeledSelect/LabeledSelect.js +1 -1
- package/esm/core/Popover/Popover.d.ts +6 -3
- package/esm/core/ProgressIndicators/ProgressLinear.js +7 -2
- package/esm/core/ProgressIndicators/ProgressRadial.js +9 -4
- package/esm/core/SearchBox/SearchBox.js +5 -7
- package/esm/core/Select/Select.d.ts +197 -102
- package/esm/core/Select/Select.js +73 -20
- package/esm/core/Table/Table.js +2 -1
- package/esm/core/Tabs/Tabs.js +19 -3
- package/esm/core/Tile/Tile.d.ts +2 -2
- package/esm/core/ToggleSwitch/ToggleSwitch.d.ts +4 -2
- package/esm/core/ToggleSwitch/ToggleSwitch.js +6 -12
- package/esm/core/Typography/Anchor.d.ts +21 -1
- package/esm/core/Typography/Anchor.js +11 -2
- package/esm/core/VisuallyHidden/VisuallyHidden.js +19 -3
- package/esm/core/utils/components/InputFlexContainer.d.ts +25 -0
- package/esm/core/utils/components/InputFlexContainer.js +18 -0
- package/esm/core/utils/components/LineClamp.d.ts +5 -0
- package/esm/core/utils/components/LineClamp.js +23 -0
- package/esm/core/utils/components/ShadowRoot.d.ts +2 -1
- package/esm/core/utils/components/ShadowRoot.js +19 -4
- package/esm/core/utils/components/index.d.ts +1 -0
- package/esm/core/utils/components/index.js +1 -0
- package/esm/core/utils/functions/polymorphic.d.ts +5 -3
- package/esm/core/utils/functions/polymorphic.js +20 -5
- package/esm/core/utils/icons/Svg.js +5 -1
- package/esm/core/utils/icons/SvgStatusError.js +1 -1
- package/package.json +27 -27
- package/styles.css +39 -38
|
@@ -40,7 +40,10 @@ export type LabeledSelectProps<T> = {
|
|
|
40
40
|
*/
|
|
41
41
|
svgIcon?: JSX.Element;
|
|
42
42
|
/**
|
|
43
|
-
* If true, shows a red asterisk
|
|
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:
|
|
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;
|
|
@@ -70,6 +70,6 @@ exports.LabeledSelect = React.forwardRef((props, forwardedRef) => {
|
|
|
70
70
|
const { className, disabled = false, label, message, status, svgIcon, displayStyle = 'default', style, required = false, wrapperProps, labelProps, messageContentProps, messageIconProps, ...rest } = props;
|
|
71
71
|
return (React.createElement(InputGrid_js_1.InputGrid, { labelPlacement: displayStyle, "data-iui-status": status, ...wrapperProps },
|
|
72
72
|
label && (React.createElement(Label_js_1.Label, { as: 'div', required: required, disabled: disabled, ...labelProps }, label)),
|
|
73
|
-
React.createElement(Select_js_1.Select, { disabled: disabled, className: className, style: style, ...rest, ref: forwardedRef }),
|
|
73
|
+
React.createElement(Select_js_1.Select, { disabled: disabled, className: className, style: style, required: props.native ? required : undefined, ...rest, ref: forwardedRef, ...{ styleType: 'default' } }),
|
|
74
74
|
typeof message === 'string' ? (React.createElement(StatusMessage_js_1.StatusMessage, { status: status, startIcon: svgIcon, iconProps: messageIconProps, contentProps: messageContentProps }, message)) : (message)));
|
|
75
75
|
});
|
|
@@ -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/
|
|
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/
|
|
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
|
|
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
|
};
|
|
@@ -34,6 +34,7 @@ exports.ProgressLinear = void 0;
|
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
|
+
const VisuallyHidden_js_1 = require("../VisuallyHidden/VisuallyHidden.js");
|
|
37
38
|
/**
|
|
38
39
|
* Shows progress on a linear bar
|
|
39
40
|
* @example
|
|
@@ -62,5 +63,9 @@ exports.ProgressLinear = React.forwardRef((props, forwardedRef) => {
|
|
|
62
63
|
const boundedValue = (0, index_js_1.getBoundedValue)(value ?? 100, 0, 100);
|
|
63
64
|
return (React.createElement(index_js_1.Box, { className: (0, classnames_1.default)('iui-progress-indicator-linear', className), ref: forwardedRef, "data-iui-status": status, "data-iui-indeterminate": indeterminate ? 'true' : undefined, "data-iui-animated": isAnimated ? 'true' : undefined, style: {
|
|
64
65
|
'--iui-progress-percentage': `${boundedValue}%`,
|
|
65
|
-
}, ...rest },
|
|
66
|
+
}, ...rest },
|
|
67
|
+
React.createElement(index_js_1.ShadowRoot, null,
|
|
68
|
+
value !== 100 && React.createElement(VisuallyHidden_js_1.VisuallyHidden, null, "Loading."),
|
|
69
|
+
React.createElement("slot", null)),
|
|
70
|
+
labels.length > 0 && (React.createElement(index_js_1.Box, { as: 'div', ...labelGroupProps, className: (0, classnames_1.default)('iui-progress-indicator-linear-label', labelGroupProps?.className) }, labels.map((label, index) => (React.createElement("span", { key: index }, label)))))));
|
|
66
71
|
});
|
|
@@ -34,6 +34,7 @@ exports.ProgressRadial = void 0;
|
|
|
34
34
|
const classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
const React = __importStar(require("react"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
|
+
const VisuallyHidden_js_1 = require("../VisuallyHidden/VisuallyHidden.js");
|
|
37
38
|
/**
|
|
38
39
|
* Circular Progress Indicator
|
|
39
40
|
* @example
|
|
@@ -62,7 +63,11 @@ exports.ProgressRadial = React.forwardRef((props, forwardedRef) => {
|
|
|
62
63
|
'--iui-progress-percentage': `${(0, index_js_1.getBoundedValue)(value, 0, 100)}%`,
|
|
63
64
|
}),
|
|
64
65
|
...style,
|
|
65
|
-
}, ...rest },
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
}, ...rest },
|
|
67
|
+
React.createElement(index_js_1.ShadowRoot, null,
|
|
68
|
+
value !== 100 && React.createElement(VisuallyHidden_js_1.VisuallyHidden, null, "Loading."),
|
|
69
|
+
React.createElement("slot", null)),
|
|
70
|
+
size !== 'x-small'
|
|
71
|
+
? children ?? (!!status ? statusMap[status] : null)
|
|
72
|
+
: null));
|
|
68
73
|
});
|
|
@@ -34,8 +34,6 @@ exports.SearchBox = void 0;
|
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
|
-
const IconButton_js_1 = require("../Buttons/IconButton.js");
|
|
38
|
-
const Icon_js_1 = require("../Icon/Icon.js");
|
|
39
37
|
const SearchBoxContext = React.createContext(undefined);
|
|
40
38
|
const SearchBoxComponent = React.forwardRef((props, ref) => {
|
|
41
39
|
const { size, expandable = false, isDisabled = false, onCollapse: onCollapseProp, onExpand: onExpandProp, isExpanded: isExpandedProp, children, inputProps, className, ...rest } = props;
|
|
@@ -96,7 +94,7 @@ SearchBoxExpandedState.displayName = 'SearchBox.ExpandedState';
|
|
|
96
94
|
// ----------------------------------------------------------------------------
|
|
97
95
|
const SearchBoxIcon = React.forwardRef((props, ref) => {
|
|
98
96
|
const { className, children, ...rest } = props;
|
|
99
|
-
return (React.createElement(
|
|
97
|
+
return (React.createElement(index_js_1.InputFlexContainerIcon, { "aria-hidden": true, className: (0, classnames_1.default)('iui-search-icon', className), ref: ref, ...rest }, children ?? React.createElement(index_js_1.SvgSearch, null)));
|
|
100
98
|
});
|
|
101
99
|
SearchBoxIcon.displayName = 'SearchBox.Icon';
|
|
102
100
|
// ----------------------------------------------------------------------------
|
|
@@ -115,7 +113,7 @@ SearchBoxInput.displayName = 'SearchBox.Input';
|
|
|
115
113
|
const SearchBoxButton = React.forwardRef((props, ref) => {
|
|
116
114
|
const { children, ...rest } = props;
|
|
117
115
|
const { size: sizeContext, isDisabled } = (0, index_js_1.useSafeContext)(SearchBoxContext);
|
|
118
|
-
return (React.createElement(
|
|
116
|
+
return (React.createElement(index_js_1.InputFlexContainerButton, { size: sizeContext, ref: ref, disabled: isDisabled, ...rest }, children ?? React.createElement(index_js_1.SvgSearch, null)));
|
|
119
117
|
});
|
|
120
118
|
SearchBoxButton.displayName = 'SearchBox.Button';
|
|
121
119
|
// ----------------------------------------------------------------------------
|
|
@@ -127,9 +125,9 @@ const SearchBoxCollapseButton = React.forwardRef((props, ref) => {
|
|
|
127
125
|
SearchBoxCollapseButton.displayName = 'SearchBox.CollapseButton';
|
|
128
126
|
// ----------------------------------------------------------------------------
|
|
129
127
|
const SearchBoxExpandButton = React.forwardRef((props, ref) => {
|
|
130
|
-
const { children,
|
|
128
|
+
const { children, onClick: onClickProp, ...rest } = props;
|
|
131
129
|
const { onExpand, size: sizeContext, isDisabled, openButtonRef, } = (0, index_js_1.useSafeContext)(SearchBoxContext);
|
|
132
|
-
return (React.createElement(SearchBoxButton, { ref: (0, index_js_1.useMergedRefs)(ref, openButtonRef),
|
|
130
|
+
return (React.createElement(SearchBoxButton, { ref: (0, index_js_1.useMergedRefs)(ref, openButtonRef), "aria-label": 'Expand searchbox', size: sizeContext, disabled: isDisabled, onClick: (0, index_js_1.mergeEventHandlers)(onClickProp, onExpand), styleType: 'default', ...rest }, children ?? React.createElement(index_js_1.SvgSearch, null)));
|
|
133
131
|
});
|
|
134
132
|
SearchBoxExpandButton.displayName = 'SearchBox.ExpandButton';
|
|
135
133
|
// ----------------------------------------------------------------------------
|