@iress-oss/ids-components 6.0.0-beta.2 → 6.0.0-beta.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/.ai/components/tag.md +43 -3
- package/.ai/skills/figma-to-ids.md +2 -1
- package/.ai/skills/ui-translation.md +2 -2
- package/README.md +16 -1
- package/dist/{Autocomplete-JZcorz66.js → Autocomplete-CuUjmIAw.js} +66 -63
- package/dist/Shadow-DdGxqWgh.js +56 -0
- package/dist/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +1 -1
- package/dist/components/Autocomplete/index.js +2 -2
- package/dist/components/Icon/helpers/getMaterialSymbolsList.js +1 -1
- package/dist/components/Menu/Menu.js +4 -7
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/components/SelectOptions.js +2 -2
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Slider/components/SliderTicks.js +2 -2
- package/dist/components/Tag/Tag.d.ts +15 -23
- package/dist/components/Tag/Tag.js +28 -31
- package/dist/components/Tag/Tag.styles.d.ts +8 -9
- package/dist/components/Tag/Tag.styles.js +26 -14
- package/dist/index.d-BJM5_ZcV.js +4 -0
- package/dist/main.js +3 -3
- package/dist/patterns/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/patterns/Shadow/Shadow.js +1 -1
- package/dist/patterns/Shadow/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useAutocompleteSearch-Dl1-OeQy.js → useAutocompleteSearch-BJ_hhoKp.js} +3 -3
- package/package.json +10 -10
- package/dist/Shadow-BGGBsmrn.js +0 -56
- package/dist/index.d-Dsa3mJDa.js +0 -4
package/.ai/components/tag.md
CHANGED
|
@@ -63,12 +63,46 @@ Use semantic status values (`danger`, `info`, `success`, `warning`) when tags ne
|
|
|
63
63
|
|
|
64
64
|
[View "Status" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-tag--status)
|
|
65
65
|
|
|
66
|
+
### Bordered tags
|
|
67
|
+
|
|
68
|
+
Set `bordered` to render a tag with a visible border using the tag's current
|
|
69
|
+
colour, without altering its background. This enhances visibility and makes tags
|
|
70
|
+
look more interactive — useful for dropdown filter tags or any context where
|
|
71
|
+
tags need to stand out.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
<IressInline gap="sm">
|
|
75
|
+
<IressTag bordered>
|
|
76
|
+
No mode
|
|
77
|
+
</IressTag>
|
|
78
|
+
{BADGE_MODES.map((mode) => (
|
|
79
|
+
<IressTag key={mode} mode={mode} bordered>
|
|
80
|
+
{mode}
|
|
81
|
+
</IressTag>
|
|
82
|
+
))}
|
|
83
|
+
{STATUSES.map((status) => (
|
|
84
|
+
<IressTag key={status} mode={status} bordered>
|
|
85
|
+
{status}
|
|
86
|
+
</IressTag>
|
|
87
|
+
))}
|
|
88
|
+
</IressInline>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
[View "Bordered" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-tag--bordered)
|
|
92
|
+
|
|
66
93
|
### Clickable tags
|
|
67
94
|
|
|
68
|
-
Tags can be made clickable by
|
|
95
|
+
Tags can be made clickable by setting `element="button"`. This is the
|
|
96
|
+
recommended, explicit API and renders the tag as a `<button>` with hover
|
|
97
|
+
styles to indicate it is clickable.
|
|
98
|
+
|
|
99
|
+
For backwards compatibility, passing `onClick` without setting `element` is
|
|
100
|
+
also supported and will automatically render the tag as a `<button>`.
|
|
101
|
+
|
|
102
|
+
Use `element="a"` to render the tag as a link.
|
|
69
103
|
|
|
70
104
|
```tsx
|
|
71
|
-
<IressTag>
|
|
105
|
+
<IressTag bordered>
|
|
72
106
|
Tag
|
|
73
107
|
</IressTag>
|
|
74
108
|
```
|
|
@@ -124,12 +158,18 @@ Query tags by their text content:
|
|
|
124
158
|
const tag = screen.getByText('Category');
|
|
125
159
|
```
|
|
126
160
|
|
|
127
|
-
When `
|
|
161
|
+
When `element="button"` is set, the tag renders as a `<button>`:
|
|
128
162
|
|
|
129
163
|
```tsx
|
|
130
164
|
const tag = screen.getByRole('button', { name: 'Category' });
|
|
131
165
|
```
|
|
132
166
|
|
|
167
|
+
When `element="a"` is set, the tag renders as a link:
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
const tag = screen.getByRole('link', { name: 'Category' });
|
|
171
|
+
```
|
|
172
|
+
|
|
133
173
|
For deletable tags, query the delete button:
|
|
134
174
|
|
|
135
175
|
```tsx
|
|
@@ -16,6 +16,7 @@ Translate Figma design properties and structures into IDS (Iress Design System)
|
|
|
16
16
|
>
|
|
17
17
|
> ```bash
|
|
18
18
|
> npm install @iress-oss/ids-components@beta
|
|
19
|
+
> npm install @iress-oss/ids-tokens@beta # if using tokens directly (e.g. cssVars or CSS vars import)
|
|
19
20
|
> ```
|
|
20
21
|
|
|
21
22
|
## Figma → IDS Mapping
|
|
@@ -65,7 +66,7 @@ When mapping Figma components to IDS, read references/component-mapping.md for t
|
|
|
65
66
|
| Slideout / Drawer | `IressSlideout` | |
|
|
66
67
|
| Tabs | `IressTabSet` + `IressTab` | |
|
|
67
68
|
| Table | `IressTable` | Head, Body, Row, Cell |
|
|
68
|
-
| Tag | `IressTag` | clickable
|
|
69
|
+
| Tag | `IressTag` | `bordered` for visible border; `element="button"` for clickable, `element="a"` for link; `onClick` alone also auto-renders as button |
|
|
69
70
|
| Pill | `IressPill` | |
|
|
70
71
|
| Tooltip | `IressTooltip` | |
|
|
71
72
|
| Icon | `IressIcon name="..."` | Material Symbols name |
|
|
@@ -67,7 +67,7 @@ Translate natural language UI descriptions into IDS (Iress Design System) compon
|
|
|
67
67
|
| Progress bar | `IressProgress` | `<IressProgress value={75} max={100} />` |
|
|
68
68
|
| Image | `IressImage` | `<IressImage src="..." alt="..." />` |
|
|
69
69
|
| Icon | `IressIcon` | `<IressIcon name="settings" />` |
|
|
70
|
-
| Tag / badge | `IressTag` | `<IressTag>New</IressTag>`
|
|
70
|
+
| Tag / badge | `IressTag` | `<IressTag>New</IressTag>`; use `bordered` for visible-border style; use `element="button"` for clickable tag, `element="a"` for link tag; `onClick` alone also auto-renders as `<button>` |
|
|
71
71
|
| Pill | `IressPill` | `<IressPill>Category</IressPill>` |
|
|
72
72
|
| Tooltip | `IressTooltip` | `<IressTooltip content="Help text"><IressButton>Hover me</IressButton></IressTooltip>` |
|
|
73
73
|
|
|
@@ -226,7 +226,7 @@ When you need to find the right IDS component for a UI element, read references/
|
|
|
226
226
|
| Progress bar | `IressProgress` | `<IressProgress value={75} max={100} />` |
|
|
227
227
|
| Image | `IressImage` | `<IressImage src="..." alt="..." />` |
|
|
228
228
|
| Icon | `IressIcon` | `<IressIcon name="settings" />` |
|
|
229
|
-
| Tag / badge | `IressTag` | `<IressTag>New</IressTag>`
|
|
229
|
+
| Tag / badge | `IressTag` | `<IressTag>New</IressTag>`; use `bordered` for visible-border style; use `element="button"` for clickable tag, `element="a"` for link tag; `onClick` alone also auto-renders as `<button>` |
|
|
230
230
|
| Pill | `IressPill` | `<IressPill>Category</IressPill>` |
|
|
231
231
|
| Tooltip | `IressTooltip` | `<IressTooltip content="Help text"><IressButton>Hover me</IressButton></IressTooltip>` |
|
|
232
232
|
|
package/README.md
CHANGED
|
@@ -10,11 +10,26 @@ This is the component library for the Iress Design System (IDS). You can use thi
|
|
|
10
10
|
|
|
11
11
|
## Set up the component library
|
|
12
12
|
|
|
13
|
-
1. Install using: `yarn add @iress-oss/ids-components`
|
|
13
|
+
1. Install using: `yarn add @iress-oss/ids-components@beta`
|
|
14
14
|
2. Import the styles: `import '@iress-oss/ids-components/dist/style.css'`
|
|
15
15
|
3. Import the components: `import { IressButton, IressText } from '@iress-oss/ids-components'`
|
|
16
16
|
4. Use the components: `<IressButton>Click me</IressButton>`
|
|
17
17
|
|
|
18
|
+
> **Note:** IDS v6 is currently in beta — install with the `@beta` tag as shown above.
|
|
19
|
+
>
|
|
20
|
+
> If you need to use design tokens directly in your application code (for custom CSS or inline styles), also install the tokens package:
|
|
21
|
+
>
|
|
22
|
+
> ```bash
|
|
23
|
+
> yarn add @iress-oss/ids-tokens@beta
|
|
24
|
+
> ```
|
|
25
|
+
>
|
|
26
|
+
> Then import the CSS variables stylesheet and use `cssVars` in your code:
|
|
27
|
+
>
|
|
28
|
+
> ```ts
|
|
29
|
+
> import '@iress-oss/ids-tokens/build/css-vars.css';
|
|
30
|
+
> import { cssVars } from '@iress-oss/ids-tokens';
|
|
31
|
+
> ```
|
|
32
|
+
|
|
18
33
|
## Contributing
|
|
19
34
|
|
|
20
35
|
The component library is part of the Iress Design System (IDS) monorepo. Please refer to the root [README](../../README.md) for more information on contributing to IDS.
|
|
@@ -9,22 +9,22 @@ import { useResponsiveProps as ee } from "./hooks/useResponsiveProps.js";
|
|
|
9
9
|
import { IressPopover as te } from "./components/Popover/Popover.js";
|
|
10
10
|
import { IressInputPopover as s } from "./components/Popover/InputPopover/InputPopover.js";
|
|
11
11
|
import { IressAlert as ne } from "./components/Alert/Alert.js";
|
|
12
|
-
import { autoComplete as
|
|
13
|
-
import { getFormControlValueAsStringIfDefined as
|
|
14
|
-
import { useNoDefaultValueInForms as
|
|
15
|
-
import { IressReadonly as
|
|
16
|
-
import { IressInput as
|
|
17
|
-
import { getValueAsEvent as
|
|
18
|
-
import { t as
|
|
19
|
-
import { AutocompleteInstructions as
|
|
20
|
-
import { select as
|
|
21
|
-
import { SelectActivator as
|
|
22
|
-
import { IressSelectMenu as
|
|
23
|
-
import { SelectOptions as
|
|
24
|
-
import { SelectHiddenInput as
|
|
25
|
-
import { NativeSelect as
|
|
26
|
-
import { useSelectState as
|
|
27
|
-
import { forwardRef as
|
|
12
|
+
import { autoComplete as re } from "./components/Autocomplete/Autocomplete.styles.js";
|
|
13
|
+
import { getFormControlValueAsStringIfDefined as c } from "./helpers/form/getFormControlValueAsStringIfDefined.js";
|
|
14
|
+
import { useNoDefaultValueInForms as ie } from "./patterns/Form/hooks/useNoDefaultValueInForms.js";
|
|
15
|
+
import { IressReadonly as ae } from "./components/Readonly/Readonly.js";
|
|
16
|
+
import { IressInput as oe } from "./components/Input/Input.js";
|
|
17
|
+
import { getValueAsEvent as l } from "./helpers/form/getValueAsEvent.js";
|
|
18
|
+
import { t as se } from "./useAutocompleteSearch-BJ_hhoKp.js";
|
|
19
|
+
import { AutocompleteInstructions as u } from "./components/Autocomplete/components/AutocompleteInstructions.js";
|
|
20
|
+
import { select as d } from "./components/Select/Select.styles.js";
|
|
21
|
+
import { SelectActivator as f } from "./components/Select/components/SelectActivator.js";
|
|
22
|
+
import { IressSelectMenu as p } from "./components/Select/SelectMenu/SelectMenu.js";
|
|
23
|
+
import { SelectOptions as m } from "./components/Select/components/SelectOptions.js";
|
|
24
|
+
import { SelectHiddenInput as ce } from "./components/Select/components/SelectHiddenInput.js";
|
|
25
|
+
import { NativeSelect as le } from "./components/Select/components/NativeSelect.js";
|
|
26
|
+
import { useSelectState as ue } from "./components/Select/hooks/useSelectState.js";
|
|
27
|
+
import { forwardRef as h, useCallback as g, useEffect as _, useImperativeHandle as de, useMemo as v, useRef as y, useState as b } from "react";
|
|
28
28
|
import { Fragment as fe, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
29
29
|
//#region src/components/Select/Select.tsx
|
|
30
30
|
var C = (e) => typeof e == "object" && !!e && "label" in e, w = (e, t) => {
|
|
@@ -43,8 +43,8 @@ var C = (e) => typeof e == "object" && !!e && "label" in e, w = (e, t) => {
|
|
|
43
43
|
}
|
|
44
44
|
return T(e, t);
|
|
45
45
|
}
|
|
46
|
-
}, D =
|
|
47
|
-
|
|
46
|
+
}, D = h(({ align: r = "bottom-start", autoHighlight: i = !0, className: a, defaultValue: o, disabled: s, footer: ne, header: re, id: c, matchActivatorWidth: oe = !0, multiSelect: l, multiSelectLimit: u, name: p, onChange: h, onBlur: w, options: T, native: D, placeholder: O, readOnly: k, renderHiddenInput: A, renderLabel: j, renderOptions: pe, required: M, type: me, value: N, virtualFocus: P, width: F, ...I }, L) => {
|
|
47
|
+
ie({
|
|
48
48
|
component: "IressSelect",
|
|
49
49
|
defaultValue: o
|
|
50
50
|
});
|
|
@@ -56,15 +56,15 @@ var C = (e) => typeof e == "object" && !!e && "label" in e, w = (e, t) => {
|
|
|
56
56
|
H,
|
|
57
57
|
T
|
|
58
58
|
]);
|
|
59
|
-
let { value: U, setValue: W, getValuesString: G, getLabelsString: _e } =
|
|
59
|
+
let { value: U, setValue: W, getValuesString: G, getLabelsString: _e } = ue({
|
|
60
60
|
component: "IressSelect",
|
|
61
61
|
defaultValue: ge,
|
|
62
|
-
multiple:
|
|
62
|
+
multiple: l,
|
|
63
63
|
value: H
|
|
64
64
|
}), K = y(null), q = y(null), J = y(null), { value: Y } = ee(typeof D == "string" ? {
|
|
65
65
|
xs: !0,
|
|
66
66
|
[D]: !1
|
|
67
|
-
} : { xs: D }, { disabled: !D }), { append: ve, debounceThreshold: X, initialOptions: ye, minSearchLength: be, onActivated: xe, onDeactivated: Se, prepend: Ce, selectedOptionsText: we, ...Z } = I, { debouncedQuery: Te, error: Ee, results: De, stopSearch: Oe, loading: ke, shouldShowInstructions: Ae, shouldShowNoResults: je } =
|
|
67
|
+
} : { xs: D }, { disabled: !D }), { append: ve, debounceThreshold: X, initialOptions: ye, minSearchLength: be, onActivated: xe, onDeactivated: Se, prepend: Ce, selectedOptionsText: we, ...Z } = I, { debouncedQuery: Te, error: Ee, results: De, stopSearch: Oe, loading: ke, shouldShowInstructions: Ae, shouldShowNoResults: je } = se({
|
|
68
68
|
debounceThreshold: X,
|
|
69
69
|
disabled: !R || !!Y,
|
|
70
70
|
initialOptions: ye,
|
|
@@ -94,28 +94,31 @@ var C = (e) => typeof e == "object" && !!e && "label" in e, w = (e, t) => {
|
|
|
94
94
|
Se,
|
|
95
95
|
R
|
|
96
96
|
]);
|
|
97
|
-
let Me =
|
|
97
|
+
let Me = g((e) => {
|
|
98
98
|
if (!w) return;
|
|
99
99
|
let t = e.currentTarget, n = e.relatedTarget;
|
|
100
100
|
!R && (!n || !t.contains(n)) && w(e), e.stopPropagation();
|
|
101
101
|
}, [w, R]);
|
|
102
|
-
if (k) return /* @__PURE__ */ x(
|
|
102
|
+
if (k) return /* @__PURE__ */ x(ae, {
|
|
103
103
|
value: G(),
|
|
104
104
|
ref: J,
|
|
105
105
|
variant: k,
|
|
106
|
+
name: p,
|
|
107
|
+
disabled: s,
|
|
108
|
+
required: M,
|
|
106
109
|
children: _e(", ")
|
|
107
110
|
});
|
|
108
111
|
if (Y) {
|
|
109
112
|
if (T instanceof Function) throw Error("[IressSelect] The native select does not support asynchronous options. Please provide options as an array.");
|
|
110
|
-
if (
|
|
111
|
-
return /* @__PURE__ */ x(
|
|
113
|
+
if (l) throw Error("[IressSelect] The native select does not support multiple selection. Please remove the multiSelect prop or use the non-native select.");
|
|
114
|
+
return /* @__PURE__ */ x(le, {
|
|
112
115
|
className: e(a, t.Select),
|
|
113
116
|
"data-testid": Z["data-testid"],
|
|
114
117
|
disabled: s,
|
|
115
|
-
id:
|
|
116
|
-
name:
|
|
118
|
+
id: c,
|
|
119
|
+
name: p,
|
|
117
120
|
onChange: (e, t) => {
|
|
118
|
-
|
|
121
|
+
h?.(e, t?.value ?? null, t), W(t);
|
|
119
122
|
},
|
|
120
123
|
options: T,
|
|
121
124
|
placeholder: typeof D == "string" ? O ?? "" : O,
|
|
@@ -125,15 +128,15 @@ var C = (e) => typeof e == "object" && !!e && "label" in e, w = (e, t) => {
|
|
|
125
128
|
ref: q
|
|
126
129
|
});
|
|
127
130
|
}
|
|
128
|
-
let Q = typeof T == "function", Ne = P ?? !Q, Pe = me ?? (Q ? void 0 : "listbox"), $ =
|
|
131
|
+
let Q = typeof T == "function", Ne = P ?? !Q, Pe = me ?? (Q ? void 0 : "listbox"), $ = d({ width: F }), Fe = () => {
|
|
129
132
|
z(!0);
|
|
130
133
|
}, Ie = () => {
|
|
131
134
|
z(!1), Oe();
|
|
132
135
|
};
|
|
133
|
-
return /* @__PURE__ */ S(fe, { children: [/* @__PURE__ */ x(
|
|
136
|
+
return /* @__PURE__ */ S(fe, { children: [/* @__PURE__ */ x(ce, {
|
|
134
137
|
"data-testid": Z["data-testid"],
|
|
135
138
|
getValuesString: G,
|
|
136
|
-
name:
|
|
139
|
+
name: p,
|
|
137
140
|
renderHiddenInput: A,
|
|
138
141
|
required: M,
|
|
139
142
|
value: U,
|
|
@@ -141,16 +144,16 @@ var C = (e) => typeof e == "object" && !!e && "label" in e, w = (e, t) => {
|
|
|
141
144
|
ref: J
|
|
142
145
|
}), /* @__PURE__ */ x(te, {
|
|
143
146
|
...Z,
|
|
144
|
-
activator: /* @__PURE__ */ x(
|
|
147
|
+
activator: /* @__PURE__ */ x(f, {
|
|
145
148
|
append: ve,
|
|
146
149
|
async: Q,
|
|
147
150
|
disabled: s,
|
|
148
151
|
error: Ee,
|
|
149
|
-
id:
|
|
152
|
+
id: c,
|
|
150
153
|
loading: ke,
|
|
151
|
-
multiSelect:
|
|
152
|
-
multiSelectLimit:
|
|
153
|
-
onChange:
|
|
154
|
+
multiSelect: l,
|
|
155
|
+
multiSelectLimit: u,
|
|
156
|
+
onChange: h,
|
|
154
157
|
placeholder: O,
|
|
155
158
|
prepend: Ce,
|
|
156
159
|
renderLabel: j,
|
|
@@ -167,7 +170,7 @@ var C = (e) => typeof e == "object" && !!e && "label" in e, w = (e, t) => {
|
|
|
167
170
|
...Z.contentStyle,
|
|
168
171
|
p: "none"
|
|
169
172
|
},
|
|
170
|
-
matchActivatorWidth:
|
|
173
|
+
matchActivatorWidth: oe,
|
|
171
174
|
onActivated: Fe,
|
|
172
175
|
onDeactivated: Ie,
|
|
173
176
|
ref: K,
|
|
@@ -178,16 +181,16 @@ var C = (e) => typeof e == "object" && !!e && "label" in e, w = (e, t) => {
|
|
|
178
181
|
children: /* @__PURE__ */ S("div", {
|
|
179
182
|
className: $.wrapper,
|
|
180
183
|
children: [
|
|
181
|
-
|
|
182
|
-
/* @__PURE__ */ x(
|
|
184
|
+
re,
|
|
185
|
+
/* @__PURE__ */ x(m, {
|
|
183
186
|
autoHighlight: i,
|
|
184
187
|
debouncedQuery: Te,
|
|
185
188
|
error: Ee,
|
|
186
189
|
initialOptions: ye,
|
|
187
190
|
loading: ke,
|
|
188
191
|
minSearchLength: be,
|
|
189
|
-
multiSelect:
|
|
190
|
-
onChange:
|
|
192
|
+
multiSelect: l,
|
|
193
|
+
onChange: h,
|
|
191
194
|
options: T,
|
|
192
195
|
query: V,
|
|
193
196
|
renderOptions: pe,
|
|
@@ -208,22 +211,22 @@ var C = (e) => typeof e == "object" && !!e && "label" in e, w = (e, t) => {
|
|
|
208
211
|
D.displayName = "IressSelect";
|
|
209
212
|
//#endregion
|
|
210
213
|
//#region src/components/Autocomplete/Autocomplete.tsx
|
|
211
|
-
var O =
|
|
214
|
+
var O = h(({ alwaysShowOnFocus: n, append: ee = /* @__PURE__ */ x(r, { name: "search" }), autoComplete: te = "off", autoSelect: ie = !0, className: d, clearable: f = !0, "data-testid": m, debounceThreshold: ce, defaultValue: le, errorText: ue = /* @__PURE__ */ x(ne, {
|
|
212
215
|
status: "danger",
|
|
213
216
|
mb: "none",
|
|
214
217
|
borderRadius: "radius.system.form",
|
|
215
218
|
children: "An unknown error occurred. Please contact support if the error persists."
|
|
216
|
-
}), initialOptions:
|
|
219
|
+
}), initialOptions: h, limitDesktop: g = 12, limitMobile: de = 6, minSearchLength: v, noResultsText: y, onChange: C, onClear: w, onFocus: T, options: E, popoverProps: { autoHighlight: D = !1, append: O, prepend: k, ...A } = {}, readOnly: j, value: pe, ...M }, me) => {
|
|
217
220
|
let [N, P] = b(!1), { value: F, setValue: I } = o({
|
|
218
221
|
component: "IressAutocomplete",
|
|
219
|
-
defaultValue:
|
|
222
|
+
defaultValue: le,
|
|
220
223
|
value: pe
|
|
221
|
-
}), [L, R] = b(!1), { clearError: z, debouncedQuery: B, error: V, loading: he, results: H, startSearch: ge, stopSearch: U, shouldShowInstructions: W, shouldShowNoResults: G } =
|
|
222
|
-
debounceThreshold:
|
|
223
|
-
initialOptions:
|
|
224
|
+
}), [L, R] = b(!1), { clearError: z, debouncedQuery: B, error: V, loading: he, results: H, startSearch: ge, stopSearch: U, shouldShowInstructions: W, shouldShowNoResults: G } = se({
|
|
225
|
+
debounceThreshold: ce,
|
|
226
|
+
initialOptions: h,
|
|
224
227
|
minSearchLength: v,
|
|
225
228
|
options: E,
|
|
226
|
-
query:
|
|
229
|
+
query: c(F)
|
|
227
230
|
});
|
|
228
231
|
if (_(() => {
|
|
229
232
|
L && !N && H.length > 0 && F && P(!0);
|
|
@@ -234,7 +237,7 @@ var O = g(({ alwaysShowOnFocus: n, append: ee = /* @__PURE__ */ x(r, { name: "se
|
|
|
234
237
|
F
|
|
235
238
|
]), _(() => {
|
|
236
239
|
V && P(!0);
|
|
237
|
-
}, [V]), j) return /* @__PURE__ */ x(
|
|
240
|
+
}, [V]), j) return /* @__PURE__ */ x(ae, {
|
|
238
241
|
value: F,
|
|
239
242
|
variant: j
|
|
240
243
|
});
|
|
@@ -243,23 +246,23 @@ var O = g(({ alwaysShowOnFocus: n, append: ee = /* @__PURE__ */ x(r, { name: "se
|
|
|
243
246
|
}, K = (e) => {
|
|
244
247
|
w?.(e), I("");
|
|
245
248
|
}, q = (e) => {
|
|
246
|
-
T?.(e),
|
|
249
|
+
T?.(e), h?.length && P(!0);
|
|
247
250
|
}, J = (e) => {
|
|
248
251
|
let t = a(e)?.[0];
|
|
249
|
-
C?.(
|
|
252
|
+
C?.(l(t?.label), t?.label, t), I(t?.label), P(!1), R(!1);
|
|
250
253
|
}, Y = () => {
|
|
251
254
|
(!n || !F) && U(), z(), P(!1), F && R(!1);
|
|
252
255
|
}, ve = (e) => {
|
|
253
256
|
M.onKeyDown?.(e), e.key === "ArrowDown" && (!N || !L) && (H.length || ge(!0), R(!0), P(!0));
|
|
254
|
-
}, X =
|
|
257
|
+
}, X = re({ isEmpty: H.length === 0 && !V && !W && !G });
|
|
255
258
|
return /* @__PURE__ */ S(s, {
|
|
256
259
|
...A,
|
|
257
|
-
activator: /* @__PURE__ */ x(
|
|
260
|
+
activator: /* @__PURE__ */ x(oe, {
|
|
258
261
|
...M,
|
|
259
262
|
append: ee,
|
|
260
263
|
autoComplete: te,
|
|
261
|
-
clearable:
|
|
262
|
-
"data-testid": i(
|
|
264
|
+
clearable: f,
|
|
265
|
+
"data-testid": i(m, "input"),
|
|
263
266
|
loading: he,
|
|
264
267
|
onChange: _e,
|
|
265
268
|
onClear: K,
|
|
@@ -269,10 +272,10 @@ var O = g(({ alwaysShowOnFocus: n, append: ee = /* @__PURE__ */ x(r, { name: "se
|
|
|
269
272
|
ref: me
|
|
270
273
|
}),
|
|
271
274
|
autoHighlight: D,
|
|
272
|
-
className: e(
|
|
275
|
+
className: e(d, A.className, X.root, t.Autocomplete),
|
|
273
276
|
contentClassName: e(A.contentClassName, X.popoverContent),
|
|
274
277
|
contentStyle: A.contentStyle,
|
|
275
|
-
"data-testid":
|
|
278
|
+
"data-testid": m,
|
|
276
279
|
minLength: 0,
|
|
277
280
|
onActivated: () => (L || n) && P(!0),
|
|
278
281
|
onDeactivated: Y,
|
|
@@ -282,20 +285,20 @@ var O = g(({ alwaysShowOnFocus: n, append: ee = /* @__PURE__ */ x(r, { name: "se
|
|
|
282
285
|
children: [
|
|
283
286
|
H.length > 0 && /* @__PURE__ */ S(fe, { children: [
|
|
284
287
|
k,
|
|
285
|
-
/* @__PURE__ */ x(
|
|
286
|
-
changeOnBlur:
|
|
288
|
+
/* @__PURE__ */ x(p, {
|
|
289
|
+
changeOnBlur: ie,
|
|
287
290
|
className: e(X.optionList),
|
|
288
|
-
"data-testid": i(
|
|
291
|
+
"data-testid": i(m, "menu"),
|
|
289
292
|
items: H,
|
|
290
|
-
limitDesktop:
|
|
293
|
+
limitDesktop: g,
|
|
291
294
|
limitMobile: de,
|
|
292
295
|
onChange: J,
|
|
293
296
|
selected: { label: B }
|
|
294
297
|
}),
|
|
295
298
|
O
|
|
296
299
|
] }),
|
|
297
|
-
V &&
|
|
298
|
-
W && !V && /* @__PURE__ */ x(
|
|
300
|
+
V && ue,
|
|
301
|
+
W && !V && /* @__PURE__ */ x(u, { minSearchLength: v ?? 1 }),
|
|
299
302
|
G && !V && y
|
|
300
303
|
]
|
|
301
304
|
});
|