@iress-oss/ids-components 6.3.0 → 6.4.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/.ai/components/modal.md +6 -1
- package/.ai/components/select.md +22 -0
- package/.ai/skills/ui-translation.md +4 -4
- package/dist/Autocomplete-CfNw4UXr.js +328 -0
- package/dist/{Button-BY2qzshw.js → Button-x1_YRAyD.js} +3 -3
- package/dist/{Shadow-DAfthdT2.js → Shadow-BKrsbwQE.js} +8 -6
- package/dist/Slideout-DuFGU2C8.js +197 -0
- package/dist/{Table.styles-CKD_vWqh.js → Table.styles-CeUw7q9b.js} +3 -3
- package/dist/{TableProvider-C8bDaWu2.js → TableProvider-DLIQWfLq.js} +1 -1
- package/dist/{TableRows-DXoiLfwt.js → TableRows-RGC4_RRZ.js} +8 -6
- package/dist/{Text.styles-DUvXBRio.js → Text.styles-CVKI4cU7.js} +2 -2
- package/dist/components/Alert/Alert.js +12 -8
- package/dist/components/Alert/Alert.styles.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.styles.js +1 -1
- package/dist/components/Autocomplete/components/AutocompleteInstructions.js +7 -4
- package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +1 -1
- package/dist/components/Autocomplete/index.js +2 -2
- package/dist/components/Avatar/Avatar.js +2 -2
- package/dist/components/Avatar/Avatar.styles.js +1 -1
- package/dist/components/Avatar/AvatarGroup/AvatarGroup.js +2 -2
- package/dist/components/Avatar/AvatarGroup/AvatarGroup.styles.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/CloseButton/CloseButton.js +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +3 -3
- package/dist/components/ButtonGroup/ButtonGroup.styles.js +1 -1
- package/dist/components/Card/Card.js +4 -4
- package/dist/components/Card/Card.styles.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +3 -3
- package/dist/components/Checkbox/Checkbox.styles.js +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.styles.js +1 -1
- package/dist/components/CheckboxMark/CheckboxMark.js +2 -2
- package/dist/components/CheckboxMark/CheckboxMark.styles.js +1 -1
- package/dist/components/Col/Col.js +1 -1
- package/dist/components/Col/Col.styles.js +1 -1
- package/dist/components/Container/Container.js +1 -1
- package/dist/components/Container/Container.styles.js +1 -1
- package/dist/components/Divider/Divider.js +2 -2
- package/dist/components/Divider/Divider.styles.js +1 -1
- package/dist/components/Expander/Expander.js +3 -3
- package/dist/components/Expander/Expander.styles.js +1 -1
- package/dist/components/ExpanderChevron/ExpanderChevron.styles.js +1 -1
- package/dist/components/Field/Field.js +3 -3
- package/dist/components/Field/Field.styles.js +1 -1
- package/dist/components/Field/components/FieldFooter.js +2 -2
- package/dist/components/Field/components/FieldHint.js +3 -3
- package/dist/components/FieldGroup/FieldGroup.js +3 -3
- package/dist/components/FieldGroup/FieldGroup.styles.js +1 -1
- package/dist/components/Hide/Hide.js +1 -1
- package/dist/components/Icon/Icon.js +4 -4
- package/dist/components/Icon/Icon.styles.js +1 -1
- package/dist/components/Image/Image.js +1 -1
- package/dist/components/Image/Image.styles.js +1 -1
- package/dist/components/Inline/Inline.js +1 -1
- package/dist/components/Inline/Inline.styles.js +1 -1
- package/dist/components/Input/Input.js +85 -79
- package/dist/components/Input/Input.styles.js +1 -1
- package/dist/components/Input/InputBase/InputBase.js +1 -1
- package/dist/components/Label/Label.styles.js +1 -1
- package/dist/components/Label/LabelBase/LabelBase.js +3 -3
- package/dist/components/Link/Link.js +4 -4
- package/dist/components/Link/Link.styles.js +1 -1
- package/dist/components/Menu/Menu.js +2 -2
- package/dist/components/Menu/Menu.styles.js +1 -1
- package/dist/components/Menu/MenuGroup/MenuGroup.styles.js +1 -1
- package/dist/components/Menu/MenuItem/MenuItem.js +121 -121
- package/dist/components/Menu/MenuItem/MenuItem.styles.js +1 -1
- package/dist/components/Menu/MenuText/MenuText.js +2 -2
- package/dist/components/Modal/Modal.d.ts +3 -2
- package/dist/components/Modal/Modal.js +46 -46
- package/dist/components/Modal/Modal.styles.js +1 -1
- package/dist/components/Pill/Pill.js +3 -3
- package/dist/components/Pill/Pill.styles.js +1 -1
- package/dist/components/Placeholder/Placeholder.styles.js +1 -1
- package/dist/components/Popover/InputPopover/InputPopover.js +1 -1
- package/dist/components/Popover/Popover.js +3 -3
- package/dist/components/Popover/Popover.styles.js +1 -1
- package/dist/components/Popover/components/PopoverContent.js +2 -2
- package/dist/components/Popover/helpers/handlePopoverTabKey.js +2 -2
- package/dist/components/Popover/hooks/useFloatingPopover.js +66 -66
- package/dist/components/Popover/hooks/usePopoverItem.js +1 -1
- package/dist/components/Popover/hooks/usePopoverNavigation.js +1 -1
- package/dist/components/Progress/Progress.js +3 -3
- package/dist/components/Progress/Progress.styles.js +1 -1
- package/dist/components/Radio/Radio.js +3 -3
- package/dist/components/Radio/Radio.styles.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.styles.js +1 -1
- package/dist/components/RadioMark/RadioMark.js +2 -2
- package/dist/components/RadioMark/RadioMark.styles.js +1 -1
- package/dist/components/Readonly/Readonly.js +3 -3
- package/dist/components/Readonly/Readonly.styles.js +1 -1
- package/dist/components/Row/Row.js +1 -1
- package/dist/components/Row/Row.styles.js +1 -1
- package/dist/components/Select/Select.d.ts +10 -0
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/Select.styles.js +1 -1
- package/dist/components/Select/SelectBody/SelectBody.styles.js +1 -1
- package/dist/components/Select/SelectHeading/SelectHeading.js +1 -1
- package/dist/components/Select/SelectLabel/SelectLabel.styles.js +1 -1
- package/dist/components/Select/SelectMenu/SelectMenu.styles.js +1 -1
- package/dist/components/Select/SelectSearch/SelectSearch.styles.js +1 -1
- package/dist/components/Select/SelectSearchInput/SelectSearchInput.styles.js +1 -1
- package/dist/components/Select/SelectTags/SelectTags.js +1 -1
- package/dist/components/Select/SelectTags/SelectTags.styles.js +1 -1
- package/dist/components/Select/components/NativeSelect.js +2 -2
- package/dist/components/Select/components/NativeSelect.styles.js +1 -1
- package/dist/components/Select/components/SelectOptions.d.ts +2 -2
- package/dist/components/Select/components/SelectOptions.js +89 -74
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Skeleton/Skeleton.styles.js +1 -1
- package/dist/components/SkipLink/SkipLink.js +1 -1
- package/dist/components/SkipLink/SkipLink.styles.js +1 -1
- package/dist/components/Slideout/Slideout.js +1 -1
- package/dist/components/Slideout/Slideout.styles.js +1 -1
- package/dist/components/Slideout/components/SlideoutInner.js +2 -2
- package/dist/components/Slideout/index.js +1 -1
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Slider/Slider.styles.js +1 -1
- package/dist/components/Slider/components/SliderTicks.js +16 -13
- package/dist/components/Spinner/Spinner.styles.js +2 -2
- package/dist/components/Stack/Stack.js +11 -8
- package/dist/components/Stack/Stack.styles.js +1 -1
- package/dist/components/Styled/Styled.js +8 -5
- package/dist/components/TabSet/Tab/Tab.js +2 -2
- package/dist/components/TabSet/Tab/Tab.styles.js +1 -1
- package/dist/components/TabSet/TabSet.js +2 -2
- package/dist/components/TabSet/TabSet.styles.js +1 -1
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/Table.styles.js +1 -1
- package/dist/components/Table/TableBody/TableBody.js +1 -1
- package/dist/components/Table/TableProvider.js +1 -1
- package/dist/components/Table/components/TableEmpty.js +1 -1
- package/dist/components/Table/components/TableFilterButton.js +1 -1
- package/dist/components/Table/components/TableHeader.js +1 -1
- package/dist/components/Table/components/TableHeaderCell.js +1 -1
- package/dist/components/Table/components/TableRows.js +1 -1
- package/dist/components/Table/components/TableSortButton.js +1 -1
- package/dist/components/Table/helpers/composeTableColumnDefs.js +1 -1
- package/dist/components/Table/helpers/composeTableInitialColumnFilters.js +1 -1
- package/dist/components/Table/hooks/useTable.js +1 -1
- package/dist/components/Table/hooks/useTableColumnFilter.js +3 -3
- package/dist/components/Table/hooks/useTableColumnSort.js +1 -1
- package/dist/components/Table/hooks/useTableColumnStyles.js +4 -4
- package/dist/components/Table/index.js +2 -2
- package/dist/components/Tag/Tag.js +2 -2
- package/dist/components/Tag/Tag.styles.js +1 -1
- package/dist/components/TagInput/TagInput.styles.js +1 -1
- package/dist/components/Text/Text.js +9 -6
- package/dist/components/Text/Text.styles.js +1 -1
- package/dist/components/Text/index.js +1 -1
- package/dist/components/Toaster/Toaster.js +2 -2
- package/dist/components/Toaster/Toaster.styles.js +1 -1
- package/dist/components/Toaster/components/Toast/Toast.js +1 -1
- package/dist/components/Toaster/components/Toast/Toast.styles.js +1 -1
- package/dist/components/Toggle/Toggle.js +2 -2
- package/dist/components/Toggle/Toggle.styles.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +16 -16
- package/dist/components/Tooltip/Tooltip.styles.js +1 -1
- package/dist/components/ValidationMessage/ValidationMessage.js +1 -1
- package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.js +1 -1
- package/dist/{composeTableColumnDefs-DzUn8D5f.js → composeTableColumnDefs-Ds00wPMn.js} +3 -3
- package/dist/{create-recipe-A316lnq3.js → create-recipe-BWTPSpll.js} +2 -2
- package/dist/{css-R34N3rft.js → css-BRrgGHqo.js} +1 -1
- package/dist/{cva-DcOwIar2.js → cva-1V8NmPTA.js} +1 -1
- package/dist/{factory-BKr3zaf6.js → factory-Dbc35N0_.js} +5 -5
- package/dist/{floating-ui.react-TDMXDOBr.js → floating-ui.react-DP-wD-Nz.js} +70 -59
- package/dist/helpers/formatting/formatDateTime.js +3 -3
- package/dist/helpers/label-value/highlightQueryInLabel.js +1 -1
- package/dist/helpers/label-value/searchLabelValues.js +1 -1
- package/dist/helpers/styling/iressCss.js +1 -1
- package/dist/{index.esm-CapMi3wi.js → index.esm-Bl8pnHUv.js} +16 -14
- package/dist/{is-valid-prop-BVyYPT21.js → is-valid-prop-CvqUuuBB.js} +1 -1
- package/dist/{main-TklToXNs.js → main-BY3nH2iz.js} +7 -7
- package/dist/main.js +8 -8
- package/dist/patterns/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/patterns/Breadcrumbs/Breadcrumbs.styles.js +1 -1
- package/dist/patterns/ContextualMenu/ContextualMenu.js +4 -4
- package/dist/patterns/ContextualMenu/ContextualMenu.styles.js +1 -1
- package/dist/patterns/DropdownMenu/DropdownMenu.js +4 -4
- package/dist/patterns/DropdownMenu/DropdownMenu.styles.js +1 -1
- package/dist/patterns/Form/Form.styles.js +1 -1
- package/dist/patterns/Form/FormValidationSummary/FormValidationSummary.js +1 -1
- package/dist/patterns/Form/HookForm/HookForm.js +1 -1
- package/dist/patterns/Loading/Loading.styles.js +1 -1
- package/dist/patterns/Loading/components/ComponentLoading.js +3 -3
- package/dist/patterns/Loading/components/DefaultLoading.js +1 -1
- package/dist/patterns/Loading/components/LongLoading.js +19 -19
- package/dist/patterns/Loading/components/PageLoading.js +1 -1
- package/dist/patterns/Loading/components/StartUpLoading.js +7 -7
- package/dist/patterns/Loading/components/ValidateLoading.js +2 -2
- package/dist/patterns/Shadow/Shadow.js +1 -1
- package/dist/patterns/Shadow/index.js +1 -1
- package/dist/patterns/SideNav/SideNav.js +3 -3
- package/dist/patterns/SideNav/SideNav.styles.js +1 -1
- package/dist/{rolldown-runtime-3b4jIN3o.js → rolldown-runtime-DtPi1Y-2.js} +2 -2
- package/dist/{sva-DGhdmNso.js → sva-CG-TbBow.js} +2 -2
- package/dist/{useAutocompleteSearch-BYzUn7Ag.js → useAutocompleteSearch-m33c4lI7.js} +7 -5
- package/package.json +6 -6
- package/dist/Autocomplete-ZqkibVwt.js +0 -327
- package/dist/Slideout-BOH2gwIN.js +0 -194
package/.ai/components/modal.md
CHANGED
|
@@ -148,7 +148,12 @@ When `status` is set:
|
|
|
148
148
|
|
|
149
149
|
### Disable closing
|
|
150
150
|
|
|
151
|
-
For instances where you require the user's full attention and you want to
|
|
151
|
+
For instances where you require the user's full attention and you want to
|
|
152
|
+
ensure they continue the current task before closing the modal, you can use
|
|
153
|
+
`disableBackdropClick={true}` to disable backdrop clicks while still allowing
|
|
154
|
+
Escape key dismissal. If you need to disable both backdrop clicks and Escape
|
|
155
|
+
dismissal, set `disableBackdropClick="no-esc"`. You can also hide the close
|
|
156
|
+
button using `noCloseButton`.
|
|
152
157
|
|
|
153
158
|
**Note:** As these options remove the default handling of the closing the modal, please ensure you provide a clear way for the user to close the modal.
|
|
154
159
|
|
package/.ai/components/select.md
CHANGED
|
@@ -79,6 +79,28 @@ The user experience slightly changes as well. Instead of displaying the options
|
|
|
79
79
|
|
|
80
80
|
No filtering is done for asynchronous options, you must filter the options yourself using the query. However, the results are automatically highlighted based on the query when rendered in the UI.
|
|
81
81
|
|
|
82
|
+
If you need to constrain or annotate the visible search field, use
|
|
83
|
+
`searchInputProps` to pass supported passive input props to the internal async
|
|
84
|
+
search input. This is useful for cases such as enforcing a maximum query length
|
|
85
|
+
without recreating the built-in search UI via `renderOptions`.
|
|
86
|
+
|
|
87
|
+
Supported `searchInputProps` keys are:
|
|
88
|
+
`className`, `data-testid`, `inputMode`, `maxLength`, `minLength`, `pattern`,
|
|
89
|
+
and `spellCheck`.
|
|
90
|
+
|
|
91
|
+
Do not use `searchInputProps` for interactive or controlled input behaviour
|
|
92
|
+
such as `value`, `onChange`, `placeholder`, `aria-label`, `disabled`,
|
|
93
|
+
`readOnly`, or refs. `IressSelect` keeps the async combobox query state,
|
|
94
|
+
placeholder text, and accessibility labelling under its own control. Only use
|
|
95
|
+
`renderOptions` when you need to replace the full built-in async options UI.
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
<IressSelect
|
|
99
|
+
options={searchOptions}
|
|
100
|
+
searchInputProps={{ maxLength: 100 }}
|
|
101
|
+
/>
|
|
102
|
+
```
|
|
103
|
+
|
|
82
104
|
```tsx
|
|
83
105
|
<SelectAsync />
|
|
84
106
|
```
|
|
@@ -28,7 +28,7 @@ Translate natural language UI descriptions into IDS (Iress Design System) compon
|
|
|
28
28
|
| Description | IDS Component | Example |
|
|
29
29
|
| ------------------------ | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
30
30
|
| Labelled text input | `IressField` + `IressInput` | See Form example below |
|
|
31
|
-
| Select dropdown (static or async) | `IressField` + `IressSelect` | `<IressField label="Country"><IressSelect>...</IressSelect></IressField>` — supports static options and async loading via an `options` function |
|
|
31
|
+
| Select dropdown (static or async) | `IressField` + `IressSelect` | `<IressField label="Country"><IressSelect>...</IressSelect></IressField>` — supports static options and async loading via an `options` function. For async search field constraints or annotations, prefer `searchInputProps` (`className`, `data-testid`, `inputMode`, `maxLength`, `minLength`, `pattern`, `spellCheck`) instead of rebuilding the UI with `renderOptions`. |
|
|
32
32
|
| Freetext input with suggestions | `IressField` + `IressAutocomplete` | `<IressField label="Search"><IressAutocomplete /></IressField>` — allows any text input; suggestions are optional |
|
|
33
33
|
| Currency input | `IressField` + `IressInputCurrency` | `<IressField label="Amount"><IressInputCurrency /></IressField>` |
|
|
34
34
|
| Checkbox | `IressCheckbox` | `<IressCheckbox value="agree">I agree</IressCheckbox>` |
|
|
@@ -40,7 +40,7 @@ Translate natural language UI descriptions into IDS (Iress Design System) compon
|
|
|
40
40
|
|
|
41
41
|
### Select vs Autocomplete Decision Guide
|
|
42
42
|
|
|
43
|
-
- **Need to restrict to valid options?** → `IressSelect` — supports static options and async loading via an `options` function. Use this for most selection use cases. Always read the component doc to understand filtering behaviour for your use case.
|
|
43
|
+
- **Need to restrict to valid options?** → `IressSelect` — supports static options and async loading via an `options` function. For async selects, `searchInputProps` is only for safe passive search-input attributes; `IressSelect` still controls query state, placeholder text, and accessibility labels. Use this for most selection use cases. Always read the component doc to understand filtering behaviour for your use case.
|
|
44
44
|
- **Need freetext with optional suggestions?** → `IressAutocomplete` — allows any text input; suggestions are offered but not enforced.
|
|
45
45
|
|
|
46
46
|
## Layout
|
|
@@ -189,7 +189,7 @@ When you need to find the right IDS component for a UI element, read references/
|
|
|
189
189
|
| Description | IDS Component | Example |
|
|
190
190
|
| ------------------------ | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
191
191
|
| Labelled text input | `IressField` + `IressInput` | See Form example below |
|
|
192
|
-
| Select dropdown (static or async) | `IressField` + `IressSelect` | `<IressField label="Country"><IressSelect>...</IressSelect></IressField>` — supports static options and async loading via an `options` function |
|
|
192
|
+
| Select dropdown (static or async) | `IressField` + `IressSelect` | `<IressField label="Country"><IressSelect>...</IressSelect></IressField>` — supports static options and async loading via an `options` function. For async search field constraints or annotations, prefer `searchInputProps` (`className`, `data-testid`, `inputMode`, `maxLength`, `minLength`, `pattern`, `spellCheck`) instead of rebuilding the UI with `renderOptions`. |
|
|
193
193
|
| Freetext input with suggestions | `IressField` + `IressAutocomplete` | `<IressField label="Search"><IressAutocomplete /></IressField>` — allows any text input; suggestions are optional |
|
|
194
194
|
| Currency input | `IressField` + `IressInputCurrency` | `<IressField label="Amount"><IressInputCurrency /></IressField>` |
|
|
195
195
|
| Checkbox | `IressCheckbox` | `<IressCheckbox value="agree">I agree</IressCheckbox>` |
|
|
@@ -201,7 +201,7 @@ When you need to find the right IDS component for a UI element, read references/
|
|
|
201
201
|
|
|
202
202
|
### Select vs Autocomplete Decision Guide
|
|
203
203
|
|
|
204
|
-
- **Need to restrict to valid options?** → `IressSelect` — supports static options and async loading via an `options` function. Use this for most selection use cases. Always read the component doc to understand filtering behaviour for your use case.
|
|
204
|
+
- **Need to restrict to valid options?** → `IressSelect` — supports static options and async loading via an `options` function. For async selects, `searchInputProps` is only for safe passive search-input attributes; `IressSelect` still controls query state, placeholder text, and accessibility labels. Use this for most selection use cases. Always read the component doc to understand filtering behaviour for your use case.
|
|
205
205
|
- **Need freetext with optional suggestions?** → `IressAutocomplete` — allows any text input; suggestions are offered but not enforced.
|
|
206
206
|
|
|
207
207
|
## Layout
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { t as e } from "./cx-QcEwjve6.js";
|
|
2
|
+
import { GlobalCSSClass as t } from "./enums.js";
|
|
3
|
+
import { idsLogger as n } from "./helpers/utility/idsLogger.js";
|
|
4
|
+
import { IressIcon as r } from "./components/Icon/Icon.js";
|
|
5
|
+
import { IressText as i } from "./components/Text/Text.js";
|
|
6
|
+
import { propagateTestid as a } from "./helpers/utility/propagateTestid.js";
|
|
7
|
+
import { IressSpinner as o } from "./components/Spinner/Spinner.js";
|
|
8
|
+
import { toArray as s } from "./helpers/formatting/toArray.js";
|
|
9
|
+
import { useControlledState as ee } from "./hooks/useControlledState.js";
|
|
10
|
+
import { useResponsiveProps as te } from "./hooks/useResponsiveProps.js";
|
|
11
|
+
import { IressPopover as c } from "./components/Popover/Popover.js";
|
|
12
|
+
import { IressInputPopover as ne } from "./components/Popover/InputPopover/InputPopover.js";
|
|
13
|
+
import { IressAlert as re } from "./components/Alert/Alert.js";
|
|
14
|
+
import { autoComplete as l } from "./components/Autocomplete/Autocomplete.styles.js";
|
|
15
|
+
import { getFormControlValueAsStringIfDefined as ie } from "./helpers/form/getFormControlValueAsStringIfDefined.js";
|
|
16
|
+
import { useNoDefaultValueInForms as ae } from "./patterns/Form/hooks/useNoDefaultValueInForms.js";
|
|
17
|
+
import { IressReadonly as oe } from "./components/Readonly/Readonly.js";
|
|
18
|
+
import { IressInput as u } from "./components/Input/Input.js";
|
|
19
|
+
import { getValueAsEvent as se } from "./helpers/form/getValueAsEvent.js";
|
|
20
|
+
import { t as ce } from "./useAutocompleteSearch-m33c4lI7.js";
|
|
21
|
+
import { AutocompleteInstructions as d } from "./components/Autocomplete/components/AutocompleteInstructions.js";
|
|
22
|
+
import { select as f } from "./components/Select/Select.styles.js";
|
|
23
|
+
import { IressInline as p } from "./components/Inline/Inline.js";
|
|
24
|
+
import { SelectActivator as le } from "./components/Select/components/SelectActivator.js";
|
|
25
|
+
import { IressSelectMenu as m } from "./components/Select/SelectMenu/SelectMenu.js";
|
|
26
|
+
import { SelectOptions as h } from "./components/Select/components/SelectOptions.js";
|
|
27
|
+
import { SelectHiddenInput as ue } from "./components/Select/components/SelectHiddenInput.js";
|
|
28
|
+
import { NativeSelect as de } from "./components/Select/components/NativeSelect.js";
|
|
29
|
+
import { useSelectState as fe } from "./components/Select/hooks/useSelectState.js";
|
|
30
|
+
import { forwardRef as g, useCallback as pe, useEffect as _, useImperativeHandle as me, useMemo as v, useRef as y, useState as b } from "react";
|
|
31
|
+
import { Fragment as he, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
32
|
+
//#region src/components/Select/Select.tsx
|
|
33
|
+
var C = (e) => typeof e == "object" && !!e && "label" in e, w = (e, t) => {
|
|
34
|
+
for (let n of t) if (n.children) {
|
|
35
|
+
let t = w(e, n.children);
|
|
36
|
+
if (t) return t;
|
|
37
|
+
} else if (n.value !== void 0 && n.value === e) return n;
|
|
38
|
+
}, T = (e, t) => {
|
|
39
|
+
if (C(e)) return e;
|
|
40
|
+
if (typeof t != "function") return w(e, t) ?? (typeof e == "number" ? w(String(e), t) : void 0);
|
|
41
|
+
}, E = (e, t) => {
|
|
42
|
+
if (e !== void 0) {
|
|
43
|
+
if (Array.isArray(e)) {
|
|
44
|
+
let r = e, i = r.map((e) => T(e, t)).filter((e) => e !== void 0);
|
|
45
|
+
return i.length < r.length && typeof t != "function" && n(`IressSelect: ${r.length - i.length} value(s) could not be resolved to matching options and were dropped.`, "warn"), i;
|
|
46
|
+
}
|
|
47
|
+
return T(e, t);
|
|
48
|
+
}
|
|
49
|
+
}, D = g(({ align: r = "bottom-start", autoHighlight: i = !0, className: a, defaultValue: o, disabled: s, errorText: ee, footer: ne, header: re, id: l, matchActivatorWidth: ie = !0, multiSelect: u, multiSelectLimit: se, name: d, onChange: p, onBlur: m, options: g, native: w, placeholder: T, readOnly: D, renderHiddenInput: O, renderLabel: ge, renderOptions: _e, searchInputProps: k, required: A, type: ve, value: j, virtualFocus: ye, width: M, ...N }, P) => {
|
|
50
|
+
ae({
|
|
51
|
+
component: "IressSelect",
|
|
52
|
+
defaultValue: o
|
|
53
|
+
});
|
|
54
|
+
let [F, I] = b(!1), L = F && !s, [R, be] = b(""), z = v(() => E(j, g), [j, g]), B = v(() => E(o, g), [o, g]);
|
|
55
|
+
_(() => {
|
|
56
|
+
j !== void 0 && !C(j) && z === void 0 && typeof g == "function" && n("IressSelect: A primitive value was passed but cannot be resolved because options are asynchronous. Pass a LabelValueMeta object instead when using async options, otherwise the component will behave as uncontrolled.", "warn");
|
|
57
|
+
}, [
|
|
58
|
+
j,
|
|
59
|
+
z,
|
|
60
|
+
g
|
|
61
|
+
]);
|
|
62
|
+
let { value: V, setValue: H, getValuesString: U, getLabelsString: W } = fe({
|
|
63
|
+
component: "IressSelect",
|
|
64
|
+
defaultValue: B,
|
|
65
|
+
multiple: u,
|
|
66
|
+
value: z
|
|
67
|
+
}), G = y(null), K = y(null), q = y(null), { value: J } = te(typeof w == "string" ? {
|
|
68
|
+
xs: !0,
|
|
69
|
+
[w]: !1
|
|
70
|
+
} : { xs: w }, { disabled: !w }), { append: xe, container: Y, debounceThreshold: Se, initialOptions: X, loadingDelay: Ce, minSearchLength: we, onActivated: Te, onDeactivated: Ee, prepend: De, selectedOptionsText: Oe, ...Z } = N, { debouncedQuery: ke, error: Ae, results: je, stopSearch: Me, loading: Ne, shouldShowInstructions: Pe, shouldShowNoResults: Fe } = ce({
|
|
71
|
+
debounceThreshold: Se,
|
|
72
|
+
disabled: !F || !!J,
|
|
73
|
+
initialOptions: X,
|
|
74
|
+
loadingDelay: Ce,
|
|
75
|
+
minSearchLength: we,
|
|
76
|
+
options: g,
|
|
77
|
+
query: R
|
|
78
|
+
});
|
|
79
|
+
me(P, () => J ? {
|
|
80
|
+
focus: () => K.current?.focus(),
|
|
81
|
+
blur: () => K.current?.blur(),
|
|
82
|
+
input: K.current ?? null
|
|
83
|
+
} : G.current ? {
|
|
84
|
+
...G.current,
|
|
85
|
+
focus: () => G.current?.getActivator()?.focus(),
|
|
86
|
+
blur: () => G.current?.getActivator()?.blur(),
|
|
87
|
+
hiddenInput: q.current ?? void 0,
|
|
88
|
+
input: q.current ?? null
|
|
89
|
+
} : {
|
|
90
|
+
hiddenInput: q.current ?? void 0,
|
|
91
|
+
input: q.current ?? null,
|
|
92
|
+
focus: () => q.current?.focus(),
|
|
93
|
+
blur: () => q.current?.blur()
|
|
94
|
+
}, [J]), _(() => {
|
|
95
|
+
F ? Te?.() : Ee?.();
|
|
96
|
+
}, [
|
|
97
|
+
Te,
|
|
98
|
+
Ee,
|
|
99
|
+
F
|
|
100
|
+
]);
|
|
101
|
+
let Ie = pe((e) => {
|
|
102
|
+
if (!m) return;
|
|
103
|
+
let t = e.currentTarget, n = e.relatedTarget;
|
|
104
|
+
!F && (!n || !t.contains(n)) && m(e), e.stopPropagation();
|
|
105
|
+
}, [m, F]);
|
|
106
|
+
if (D) return /* @__PURE__ */ x(oe, {
|
|
107
|
+
value: U(),
|
|
108
|
+
ref: q,
|
|
109
|
+
variant: D,
|
|
110
|
+
name: d,
|
|
111
|
+
disabled: s,
|
|
112
|
+
required: A,
|
|
113
|
+
children: W(", ")
|
|
114
|
+
});
|
|
115
|
+
if (J) {
|
|
116
|
+
if (g instanceof Function) throw Error("[IressSelect] The native select does not support asynchronous options. Please provide options as an array.");
|
|
117
|
+
if (u) throw Error("[IressSelect] The native select does not support multiple selection. Please remove the multiSelect prop or use the non-native select.");
|
|
118
|
+
return /* @__PURE__ */ x(de, {
|
|
119
|
+
className: e(a, t.Select),
|
|
120
|
+
"data-testid": Z["data-testid"],
|
|
121
|
+
disabled: s,
|
|
122
|
+
id: l,
|
|
123
|
+
name: d,
|
|
124
|
+
onBlur: m,
|
|
125
|
+
onChange: (e, t) => {
|
|
126
|
+
p?.(e, t?.value ?? null, t), H(t);
|
|
127
|
+
},
|
|
128
|
+
options: g,
|
|
129
|
+
placeholder: typeof w == "string" ? T ?? "" : T,
|
|
130
|
+
style: Z.style,
|
|
131
|
+
value: V,
|
|
132
|
+
width: M,
|
|
133
|
+
ref: K
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
let Q = typeof g == "function", Le = ye ?? !Q, Re = ve ?? (Q ? void 0 : "listbox"), $ = f({ width: M }), ze = () => {
|
|
137
|
+
I(!0);
|
|
138
|
+
}, Be = () => {
|
|
139
|
+
I(!1), Me();
|
|
140
|
+
};
|
|
141
|
+
return /* @__PURE__ */ S(he, { children: [/* @__PURE__ */ x(ue, {
|
|
142
|
+
"data-testid": Z["data-testid"],
|
|
143
|
+
getValuesString: U,
|
|
144
|
+
name: d,
|
|
145
|
+
renderHiddenInput: O,
|
|
146
|
+
required: A,
|
|
147
|
+
value: V,
|
|
148
|
+
disabled: s,
|
|
149
|
+
ref: q
|
|
150
|
+
}), /* @__PURE__ */ x(c, {
|
|
151
|
+
...Z,
|
|
152
|
+
activator: /* @__PURE__ */ x(le, {
|
|
153
|
+
append: xe,
|
|
154
|
+
async: Q,
|
|
155
|
+
disabled: s,
|
|
156
|
+
error: Ae,
|
|
157
|
+
id: l,
|
|
158
|
+
loading: Ne,
|
|
159
|
+
multiSelect: u,
|
|
160
|
+
multiSelectLimit: se,
|
|
161
|
+
onChange: p,
|
|
162
|
+
placeholder: T,
|
|
163
|
+
popoverContainer: Y,
|
|
164
|
+
prepend: De,
|
|
165
|
+
renderLabel: ge,
|
|
166
|
+
selectedOptionsText: Oe,
|
|
167
|
+
setValue: H,
|
|
168
|
+
setShow: I,
|
|
169
|
+
show: F,
|
|
170
|
+
value: V
|
|
171
|
+
}),
|
|
172
|
+
align: r,
|
|
173
|
+
className: e(a, $.root, t.Select),
|
|
174
|
+
container: Y,
|
|
175
|
+
contentClassName: e($.popoverContent),
|
|
176
|
+
contentStyle: {
|
|
177
|
+
...Z.contentStyle,
|
|
178
|
+
p: "none"
|
|
179
|
+
},
|
|
180
|
+
matchActivatorWidth: ie,
|
|
181
|
+
onActivated: ze,
|
|
182
|
+
onDeactivated: Be,
|
|
183
|
+
ref: G,
|
|
184
|
+
show: L,
|
|
185
|
+
type: Re,
|
|
186
|
+
virtualFocus: Le,
|
|
187
|
+
onBlur: Ie,
|
|
188
|
+
children: /* @__PURE__ */ S("div", {
|
|
189
|
+
className: $.wrapper,
|
|
190
|
+
children: [
|
|
191
|
+
re,
|
|
192
|
+
/* @__PURE__ */ x(h, {
|
|
193
|
+
autoHighlight: i,
|
|
194
|
+
debouncedQuery: ke,
|
|
195
|
+
error: Ae,
|
|
196
|
+
errorText: ee,
|
|
197
|
+
initialOptions: X,
|
|
198
|
+
loading: Ne,
|
|
199
|
+
minSearchLength: we,
|
|
200
|
+
multiSelect: u,
|
|
201
|
+
onChange: p,
|
|
202
|
+
options: g,
|
|
203
|
+
query: R,
|
|
204
|
+
renderOptions: _e,
|
|
205
|
+
results: je,
|
|
206
|
+
searchInputProps: k,
|
|
207
|
+
setQuery: be,
|
|
208
|
+
setShow: I,
|
|
209
|
+
setValue: H,
|
|
210
|
+
shouldShowInstructions: Pe,
|
|
211
|
+
shouldShowNoResults: Fe,
|
|
212
|
+
show: L,
|
|
213
|
+
value: V
|
|
214
|
+
}),
|
|
215
|
+
ne
|
|
216
|
+
]
|
|
217
|
+
})
|
|
218
|
+
})] });
|
|
219
|
+
});
|
|
220
|
+
D.displayName = "IressSelect";
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/components/Autocomplete/Autocomplete.tsx
|
|
223
|
+
var O = g(({ alwaysShowOnFocus: n, append: te = /* @__PURE__ */ x(r, { name: "search" }), autoComplete: c = "off", autoSelect: ae = !0, className: f, clearable: le = !0, "data-testid": h, debounceThreshold: ue, defaultValue: de, errorText: fe = /* @__PURE__ */ x(re, {
|
|
224
|
+
status: "danger",
|
|
225
|
+
mb: "none",
|
|
226
|
+
variant: "full-width",
|
|
227
|
+
children: "An unknown error occurred. Please contact support if the error persists."
|
|
228
|
+
}), initialOptions: g, loadingDelay: pe, limitDesktop: me = 12, limitMobile: v = 6, minSearchLength: y, noResultsText: C, onChange: w, onClear: T, onFocus: E, options: D, popoverProps: { autoHighlight: O = !1, append: ge, prepend: _e, ...k } = {}, readOnly: A, value: ve, ...j }, ye) => {
|
|
229
|
+
let [M, N] = b(!1), { value: P, setValue: F } = ee({
|
|
230
|
+
component: "IressAutocomplete",
|
|
231
|
+
defaultValue: de,
|
|
232
|
+
value: ve
|
|
233
|
+
}), [I, L] = b(!1), { clearError: R, debouncedQuery: be, error: z, loading: B, results: V, startSearch: H, stopSearch: U, shouldShowInstructions: W, shouldShowNoResults: G } = ce({
|
|
234
|
+
debounceThreshold: ue,
|
|
235
|
+
initialOptions: g,
|
|
236
|
+
loadingDelay: pe,
|
|
237
|
+
minSearchLength: y,
|
|
238
|
+
options: D,
|
|
239
|
+
query: ie(P)
|
|
240
|
+
});
|
|
241
|
+
if (_(() => {
|
|
242
|
+
I && !M && V.length > 0 && P && N(!0);
|
|
243
|
+
}, [
|
|
244
|
+
V.length,
|
|
245
|
+
M,
|
|
246
|
+
I,
|
|
247
|
+
P
|
|
248
|
+
]), _(() => {
|
|
249
|
+
B && I && N(!0);
|
|
250
|
+
}, [B, I]), _(() => {
|
|
251
|
+
z && N(!0);
|
|
252
|
+
}, [z]), A) return /* @__PURE__ */ x(oe, {
|
|
253
|
+
value: P,
|
|
254
|
+
variant: A
|
|
255
|
+
});
|
|
256
|
+
let K = (e, t) => {
|
|
257
|
+
w?.(e, t), F(t), L(!!t);
|
|
258
|
+
}, q = (e) => {
|
|
259
|
+
T?.(e), F("");
|
|
260
|
+
}, J = (e) => {
|
|
261
|
+
E?.(e), g?.length && N(!0);
|
|
262
|
+
}, xe = (e) => {
|
|
263
|
+
let t = s(e)?.[0];
|
|
264
|
+
w?.(se(t?.label), t?.label, t), F(t?.label), N(!1), L(!1);
|
|
265
|
+
}, Y = () => {
|
|
266
|
+
(!n || !P) && U(), R(), N(!1), P && L(!1);
|
|
267
|
+
}, Se = (e) => {
|
|
268
|
+
j.onKeyDown?.(e), e.key === "ArrowDown" && (!M || !I) && (V.length || H(!0), L(!0), N(!0));
|
|
269
|
+
}, X = l({ isEmpty: V.length === 0 && !B && !z && !W && !G });
|
|
270
|
+
return /* @__PURE__ */ S(ne, {
|
|
271
|
+
...k,
|
|
272
|
+
activator: /* @__PURE__ */ x(u, {
|
|
273
|
+
...j,
|
|
274
|
+
append: te,
|
|
275
|
+
autoComplete: c,
|
|
276
|
+
clearable: le,
|
|
277
|
+
"data-testid": a(h, "input"),
|
|
278
|
+
onChange: K,
|
|
279
|
+
onClear: q,
|
|
280
|
+
onFocus: J,
|
|
281
|
+
onKeyDown: Se,
|
|
282
|
+
value: P,
|
|
283
|
+
ref: ye
|
|
284
|
+
}),
|
|
285
|
+
autoHighlight: O,
|
|
286
|
+
className: e(f, k.className, X.root, t.Autocomplete),
|
|
287
|
+
contentClassName: e(k.contentClassName, X.popoverContent),
|
|
288
|
+
contentStyle: k.contentStyle,
|
|
289
|
+
"data-testid": h,
|
|
290
|
+
minLength: 0,
|
|
291
|
+
onActivated: () => (I || n) && N(!0),
|
|
292
|
+
onDeactivated: Y,
|
|
293
|
+
show: M,
|
|
294
|
+
type: "listbox",
|
|
295
|
+
focusStartIndex: 0,
|
|
296
|
+
children: [
|
|
297
|
+
B && !V.length && /* @__PURE__ */ S(p, {
|
|
298
|
+
gap: "sm",
|
|
299
|
+
verticalAlign: "middle",
|
|
300
|
+
p: "spacing.3",
|
|
301
|
+
children: [/* @__PURE__ */ x(o, { color: "colour.neutral.70" }), /* @__PURE__ */ x(i, {
|
|
302
|
+
color: "colour.neutral.70",
|
|
303
|
+
children: "Loading results..."
|
|
304
|
+
})]
|
|
305
|
+
}),
|
|
306
|
+
V.length > 0 && /* @__PURE__ */ S(he, { children: [
|
|
307
|
+
_e,
|
|
308
|
+
/* @__PURE__ */ x(m, {
|
|
309
|
+
changeOnBlur: ae,
|
|
310
|
+
className: e(X.optionList),
|
|
311
|
+
"data-testid": a(h, "menu"),
|
|
312
|
+
items: V,
|
|
313
|
+
limitDesktop: me,
|
|
314
|
+
limitMobile: v,
|
|
315
|
+
onChange: xe,
|
|
316
|
+
selected: { label: be }
|
|
317
|
+
}),
|
|
318
|
+
ge
|
|
319
|
+
] }),
|
|
320
|
+
z && fe,
|
|
321
|
+
W && !z && /* @__PURE__ */ x(d, { minSearchLength: y ?? 1 }),
|
|
322
|
+
G && !z && C
|
|
323
|
+
]
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
O.displayName = "IressAutocomplete";
|
|
327
|
+
//#endregion
|
|
328
|
+
export { D as n, O as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as e, f as t, l as n, s as r, t as i } from "./css-
|
|
1
|
+
import { a as e, f as t, l as n, s as r, t as i } from "./css-BRrgGHqo.js";
|
|
2
2
|
import { t as a } from "./cx-QcEwjve6.js";
|
|
3
|
-
import { n as o } from "./is-valid-prop-
|
|
3
|
+
import { n as o } from "./is-valid-prop-CvqUuuBB.js";
|
|
4
4
|
import { GlobalCSSClass as s } from "./enums.js";
|
|
5
5
|
import { IressIcon as c } from "./components/Icon/Icon.js";
|
|
6
|
-
import { t as l } from "./create-recipe-
|
|
6
|
+
import { t as l } from "./create-recipe-BWTPSpll.js";
|
|
7
7
|
import { IressSpinner as u } from "./components/Spinner/Spinner.js";
|
|
8
8
|
import { useButtonGroupItem as d } from "./components/ButtonGroup/hooks/useButtonGroupItem.js";
|
|
9
9
|
import { usePopover as f } from "./components/Popover/hooks/usePopover.js";
|