@iress-oss/ids-components 6.0.0-beta.2 → 6.0.0-beta.4
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 +136 -61
- package/.ai/skills/ui-translation.md +98 -72
- 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/ContextualMenu/ContextualMenu.d.ts +1 -1
- package/dist/patterns/ContextualMenu/ContextualMenu.js +22 -21
- 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
|
@@ -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
|
});
|