@hyphen/hyphen-components 2.16.1 → 2.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/SelectInput/SelectInput.d.ts +8 -0
- package/dist/hyphen-components.cjs.development.js +8 -6
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +8 -6
- package/dist/hyphen-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Drawer/Drawer.tsx +5 -1
- package/src/components/SelectInput/SelectInput.tsx +13 -1
package/package.json
CHANGED
|
@@ -236,7 +236,11 @@ export const Drawer: React.FC<DrawerProps> = forwardRef<
|
|
|
236
236
|
}}
|
|
237
237
|
parentSelector={() => parentElement}
|
|
238
238
|
>
|
|
239
|
-
<Box
|
|
239
|
+
<Box
|
|
240
|
+
aria-label={ariaLabel}
|
|
241
|
+
aria-labelledby={ariaLabelledBy}
|
|
242
|
+
height="100%"
|
|
243
|
+
>
|
|
240
244
|
{renderHeader()}
|
|
241
245
|
{content}
|
|
242
246
|
</Box>
|
|
@@ -55,6 +55,10 @@ export interface SelectInputProps {
|
|
|
55
55
|
* The value(s) of select.
|
|
56
56
|
*/
|
|
57
57
|
value: any | any[]; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
58
|
+
/**
|
|
59
|
+
* Options for dropdown list.
|
|
60
|
+
*/
|
|
61
|
+
options: SelectInputOptions | AsyncOptions;
|
|
58
62
|
/**
|
|
59
63
|
* Autofocus select input on render.
|
|
60
64
|
*/
|
|
@@ -76,6 +80,10 @@ export interface SelectInputProps {
|
|
|
76
80
|
* Visually hide the label.
|
|
77
81
|
*/
|
|
78
82
|
hideLabel?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Load the input asynchronously.
|
|
85
|
+
*/
|
|
86
|
+
isAsync?: boolean;
|
|
79
87
|
/**
|
|
80
88
|
* If the input value is clearable programmatically.
|
|
81
89
|
*/
|
|
@@ -255,12 +263,16 @@ export function SelectInput(props: SelectInputProps): JSX.Element {
|
|
|
255
263
|
? AsyncSelect
|
|
256
264
|
: Select;
|
|
257
265
|
|
|
266
|
+
const selectOptions = isAsync
|
|
267
|
+
? ({ loadOptions: options } as { loadOptions: AsyncOptions })
|
|
268
|
+
: ({ options } as { options: SelectInputOptions });
|
|
269
|
+
|
|
258
270
|
return (
|
|
259
271
|
<Box width="100%" className={wrapperClasses}>
|
|
260
272
|
{label && !hideLabel && <FormLabel {...labelProps}>{label}</FormLabel>}
|
|
261
273
|
<Component
|
|
262
274
|
{...restProps}
|
|
263
|
-
{...
|
|
275
|
+
{...selectOptions}
|
|
264
276
|
inputId={id}
|
|
265
277
|
aria-label={label}
|
|
266
278
|
components={{ ClearIndicator }}
|