@tedi-design-system/react 18.1.0-rc.21 → 18.1.0-rc.23

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.
Files changed (36) hide show
  1. package/bundle-stats.html +1 -1
  2. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
  3. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
  4. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  5. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
  6. package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
  7. package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
  8. package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
  9. package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
  10. package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  11. package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
  12. package/external/prop-types/external/react-is/index.cjs.js +1 -1
  13. package/external/prop-types/external/react-is/index.es.js +1 -1
  14. package/index.css +1 -1
  15. package/package.json +12 -6
  16. package/src/tedi/components/buttons/button-content/button-content.cjs.js +1 -1
  17. package/src/tedi/components/buttons/button-content/button-content.es.js +31 -30
  18. package/src/tedi/components/form/select/components/select-input.cjs.js +1 -1
  19. package/src/tedi/components/form/select/components/select-input.es.js +24 -15
  20. package/src/tedi/components/form/select/components/select-multi-value-remove.cjs.js +1 -1
  21. package/src/tedi/components/form/select/components/select-multi-value-remove.es.js +11 -11
  22. package/src/tedi/components/form/select/components/select-multi-value.cjs.js +1 -1
  23. package/src/tedi/components/form/select/components/select-multi-value.es.js +34 -30
  24. package/src/tedi/components/form/select/select.cjs.js +1 -1
  25. package/src/tedi/components/form/select/select.d.ts +14 -0
  26. package/src/tedi/components/form/select/select.es.js +274 -267
  27. package/src/tedi/components/loaders/spinner/spinner.cjs.js +1 -1
  28. package/src/tedi/components/loaders/spinner/spinner.d.ts +7 -0
  29. package/src/tedi/components/loaders/spinner/spinner.es.js +29 -18
  30. package/src/tedi/components/overlays/overlay/overlay-content.cjs.js +1 -1
  31. package/src/tedi/components/overlays/overlay/overlay-content.es.js +14 -12
  32. package/src/tedi/components/overlays/overlay/overlay-trigger.cjs.js +1 -1
  33. package/src/tedi/components/overlays/overlay/overlay-trigger.es.js +16 -16
  34. package/src/tedi/components/overlays/overlay/overlay.cjs.js +1 -1
  35. package/src/tedi/components/overlays/overlay/overlay.d.ts +10 -0
  36. package/src/tedi/components/overlays/overlay/overlay.es.js +74 -71
@@ -1,306 +1,313 @@
1
- import { jsx as C, jsxs as q } from "react/jsx-runtime";
2
- import W from "../../../../../external/classnames/index.es.js";
3
- import r, { forwardRef as Qe } from "react";
4
- import Ye from "../../../../../external/react-select/dist/react-select.esm.es.js";
5
- import Ze from "../../../../../external/react-select/async/dist/react-select-async.esm.es.js";
6
- import { FeedbackText as et } from "../feedback-text/feedback-text.es.js";
7
- import { FormLabel as tt } from "../form-label/form-label.es.js";
8
- import { useOptionalInputGroup as ot } from "../input-group/input-group.es.js";
9
- import lt from "../input-group/input-group.module.scss.es.js";
10
- import { SELECT_ALL_VALUE as v, GROUP_OPTION_PREFIX as nt, areAllSelected as X, getEnabledOptions as J, isGroupSentinel as Q } from "./components/select-bulk-helpers.es.js";
11
- import { SelectClearIndicator as st } from "./components/select-clear-indicator.es.js";
12
- import { SelectControl as rt } from "./components/select-control.es.js";
13
- import { SelectDropDownIndicator as at } from "./components/select-dropdown-indicator.es.js";
14
- import { SelectGroup as it } from "./components/select-group.es.js";
15
- import { SelectGroupHeading as ct } from "./components/select-group-heading.es.js";
16
- import { SelectIndicatorsContainer as ut } from "./components/select-indicators-container.es.js";
17
- import { SelectInput as dt } from "./components/select-input.es.js";
18
- import { SelectLoadingIndicator as pt } from "./components/select-loading-indicator.es.js";
19
- import { SelectMenu as mt } from "./components/select-menu.es.js";
20
- import { SelectMenuList as ft } from "./components/select-menu-list.es.js";
21
- import { SelectMenuPortal as gt } from "./components/select-menu-portal.es.js";
22
- import { SelectMultiValue as bt } from "./components/select-multi-value.es.js";
23
- import { SelectMultiValueRemove as St } from "./components/select-multi-value-remove.es.js";
24
- import { SelectOption as vt } from "./components/select-option.es.js";
25
- import { SelectSingleValue as yt } from "./components/select-single-value.es.js";
26
- import { SelectValueContainer as Mt } from "./components/select-value-container.es.js";
27
- import p from "./select.module.scss.es.js";
28
- import { useLabels as ht } from "../../../providers/label-provider/use-labels.es.js";
29
- const It = Qe(
30
- (k, Y) => {
31
- var z;
1
+ import { jsx as L, jsxs as J } from "react/jsx-runtime";
2
+ import Q from "../../../../../external/classnames/index.es.js";
3
+ import r, { forwardRef as nt } from "react";
4
+ import lt from "../../../../../external/react-select/dist/react-select.esm.es.js";
5
+ import st from "../../../../../external/react-select/async/dist/react-select-async.esm.es.js";
6
+ import { FeedbackText as rt } from "../feedback-text/feedback-text.es.js";
7
+ import { FormLabel as at } from "../form-label/form-label.es.js";
8
+ import { useOptionalInputGroup as it } from "../input-group/input-group.es.js";
9
+ import ct from "../input-group/input-group.module.scss.es.js";
10
+ import { SELECT_ALL_VALUE as M, GROUP_OPTION_PREFIX as ut, areAllSelected as Y, getEnabledOptions as Z, isGroupSentinel as ee } from "./components/select-bulk-helpers.es.js";
11
+ import { SelectClearIndicator as dt } from "./components/select-clear-indicator.es.js";
12
+ import { SelectControl as pt } from "./components/select-control.es.js";
13
+ import { SelectDropDownIndicator as mt } from "./components/select-dropdown-indicator.es.js";
14
+ import { SelectGroup as ft } from "./components/select-group.es.js";
15
+ import { SelectGroupHeading as gt } from "./components/select-group-heading.es.js";
16
+ import { SelectIndicatorsContainer as St } from "./components/select-indicators-container.es.js";
17
+ import { SelectInput as bt } from "./components/select-input.es.js";
18
+ import { SelectLoadingIndicator as yt } from "./components/select-loading-indicator.es.js";
19
+ import { SelectMenu as Mt } from "./components/select-menu.es.js";
20
+ import { SelectMenuList as vt } from "./components/select-menu-list.es.js";
21
+ import { SelectMenuPortal as ht } from "./components/select-menu-portal.es.js";
22
+ import { SelectMultiValue as It } from "./components/select-multi-value.es.js";
23
+ import { SelectMultiValueRemove as Ot } from "./components/select-multi-value-remove.es.js";
24
+ import { SelectOption as Ct } from "./components/select-option.es.js";
25
+ import { SelectSingleValue as wt } from "./components/select-single-value.es.js";
26
+ import { SelectValueContainer as Lt } from "./components/select-value-container.es.js";
27
+ import d from "./select.module.scss.es.js";
28
+ import { useLabels as Vt } from "../../../providers/label-provider/use-labels.es.js";
29
+ const At = nt(
30
+ (D, te) => {
31
+ var X;
32
32
  const {
33
33
  options: c,
34
- defaultOptions: Z,
35
- id: _,
36
- name: ee,
37
- iconName: te = "arrow_drop_down",
38
- label: oe,
39
- required: R,
40
- value: D,
41
- defaultValue: N,
42
- tagsDirection: L = "stack",
43
- onChange: V,
44
- onInputChange: le,
45
- inputValue: ne,
46
- loadOptions: se,
47
- isLoading: re,
48
- openMenuOnFocus: ae = !1,
49
- openMenuOnClick: ie = !0,
50
- tabSelectsValue: ce = !1,
34
+ defaultOptions: oe,
35
+ name: ne,
36
+ iconName: le = "arrow_drop_down",
37
+ label: se,
38
+ required: N,
39
+ value: P,
40
+ defaultValue: T,
41
+ tagsDirection: V = "stack",
42
+ onChange: A,
43
+ onInputChange: re,
44
+ inputValue: ae,
45
+ loadOptions: ie,
46
+ isLoading: ce,
47
+ openMenuOnFocus: ue = !1,
48
+ openMenuOnClick: de = !0,
49
+ tabSelectsValue: pe = !1,
51
50
  disabled: F = !1,
52
- className: ue,
53
- hideLabel: de = !1,
51
+ className: me,
52
+ hideLabel: fe = !1,
54
53
  helper: a,
55
- placeholder: pe,
56
- invalid: me,
57
- valid: fe,
58
- size: w,
59
- async: ge = !1,
60
- renderOption: be,
61
- renderMessageListFooter: x,
62
- noOptionsMessage: Se,
63
- loadingMessage: ve,
64
- multiple: y = !1,
65
- showSelectAll: G = !1,
66
- selectableGroups: P = !1,
67
- dropdownType: ye = "menu",
68
- renderValue: Me,
69
- closeMenuOnSelect: he = !y,
70
- blurInputOnSelect: E = !1,
71
- autoFocus: Ie = !1,
72
- isClearable: Oe = !0,
73
- isClearIndicatorVisible: Ce = !1,
74
- isSearchable: T = !0,
75
- menuIsOpen: Le,
76
- onMenuClose: Ve,
77
- onMenuOpen: we,
78
- onBlur: Ae,
79
- inputIsHidden: ke,
80
- isTagRemovable: _e = !1,
81
- tagsEllipsis: Re = !1,
82
- backspaceRemovesValue: De = !1,
83
- optionGroupHeadingText: Ne = { modifiers: "small", color: "tertiary" },
54
+ placeholder: ge,
55
+ invalid: Se,
56
+ valid: be,
57
+ size: _,
58
+ async: ye = !1,
59
+ renderOption: Me,
60
+ renderMessageListFooter: $,
61
+ noOptionsMessage: ve,
62
+ loadingMessage: he,
63
+ multiple: v = !1,
64
+ showSelectAll: x = !1,
65
+ selectableGroups: E = !1,
66
+ dropdownType: Ie = "menu",
67
+ renderValue: Oe,
68
+ closeMenuOnSelect: Ce = !v,
69
+ blurInputOnSelect: G = !1,
70
+ autoFocus: we = !1,
71
+ isClearable: Le = !0,
72
+ isClearIndicatorVisible: Ve = !1,
73
+ isSearchable: O = !0,
74
+ openKeyboardOnTouch: H = !0,
75
+ menuIsOpen: Ae,
76
+ onMenuClose: _e,
77
+ onMenuOpen: ke,
78
+ onBlur: k,
79
+ inputIsHidden: Re,
80
+ isTagRemovable: De = !1,
81
+ tagsEllipsis: Ne = !1,
82
+ backspaceRemovesValue: Pe = !1,
83
+ optionGroupHeadingText: Te = { modifiers: "small", color: "tertiary" },
84
84
  cacheOptions: Fe = !0,
85
- showRadioButtons: xe = !1,
86
- renderWithoutLabel: Ge,
87
- tooltip: Pe,
88
- classNames: $
89
- } = k, m = (z = ot) == null ? void 0 : z(), Ee = r.useId(), Te = m == null ? void 0 : m.hasExternalLabel, A = k.id ?? (m == null ? void 0 : m.inputId) ?? Ee, H = a ? (a == null ? void 0 : a.id) ?? `${A}-helper` : void 0, h = r.useRef(null), { getLabel: I } = ht();
85
+ showRadioButtons: $e = !1,
86
+ renderWithoutLabel: xe,
87
+ tooltip: Ee,
88
+ classNames: K
89
+ } = D, u = (X = it) == null ? void 0 : X(), Ge = r.useId(), R = u == null ? void 0 : u.hasExternalLabel, f = D.id ?? (u == null ? void 0 : u.inputId) ?? Ge, He = R ? (u == null ? void 0 : u.inputId) ?? f : `${f}-input`, Ke = R ? `${f}-container` : f, j = a ? (a == null ? void 0 : a.id) ?? `${f}-helper` : void 0, h = r.useRef(null), { getLabel: C } = Vt();
90
90
  r.useImperativeHandle(
91
- Y,
91
+ te,
92
92
  () => h.current
93
93
  );
94
- const g = !!G && y, [$e, He] = r.useState(N ?? null), j = D !== void 0, f = j ? D : $e, u = r.useMemo(() => Array.isArray(f) ? f : f ? [f] : [], [f]), O = r.useMemo(
95
- () => ({ value: v, label: I("select.select-all") }),
96
- [I]
97
- ), b = !!P && !!y, { groupFlattenedOptions: K, groupSentinelMap: M } = r.useMemo(() => {
94
+ const [je, U] = r.useState(!1), Ue = (t) => {
95
+ var e, o;
96
+ if (H || !O || t.pointerType !== "touch" && t.pointerType !== "pen") return;
97
+ const l = t.target;
98
+ if (!((e = l.closest) != null && e.call(l, `.${d["tedi-select__control"]}`))) return;
99
+ const n = (o = h.current) == null ? void 0 : o.inputRef, i = !!n && (t.target === n || n.contains(l));
100
+ U(!i);
101
+ }, Be = () => {
102
+ U(!1), k == null || k();
103
+ }, S = !!x && v, [ze, qe] = r.useState(T ?? null), B = P !== void 0, g = B ? P : ze, p = r.useMemo(() => Array.isArray(g) ? g : g ? [g] : [], [g]), w = r.useMemo(
104
+ () => ({ value: M, label: C("select.select-all") }),
105
+ [C]
106
+ ), b = !!E && !!v, { groupFlattenedOptions: z, groupSentinelMap: I } = r.useMemo(() => {
98
107
  const t = /* @__PURE__ */ new Map();
99
108
  if (!b || !c || c.length === 0)
100
109
  return { groupFlattenedOptions: null, groupSentinelMap: t };
101
110
  if (!c.some((e) => e && Array.isArray(e.options))) return { groupFlattenedOptions: null, groupSentinelMap: t };
102
- const l = [], i = /* @__PURE__ */ new Map();
111
+ const n = [], i = /* @__PURE__ */ new Map();
103
112
  for (const e of c)
104
113
  if (e && Array.isArray(e.options)) {
105
- const o = e, n = `${nt}${o.label ?? ""}`, d = o.options.filter((S) => !S.isDisabled);
106
- i.set(n, { enabled: d }), l.push({ value: n, label: o.label ?? "" });
107
- for (const S of o.options)
108
- l.push({
109
- ...S,
110
- customData: { ...S.customData ?? {}, __tediInGroup: !0 }
114
+ const o = e, s = `${ut}${o.label ?? ""}`, m = o.options.filter((y) => !y.isDisabled);
115
+ i.set(s, { enabled: m }), n.push({ value: s, label: o.label ?? "" });
116
+ for (const y of o.options)
117
+ n.push({
118
+ ...y,
119
+ customData: { ...y.customData ?? {}, __tediInGroup: !0 }
111
120
  });
112
121
  } else
113
- l.push(e);
114
- return { groupFlattenedOptions: l, groupSentinelMap: i };
115
- }, [c, b]), je = r.useMemo(() => {
116
- let t = K ?? c;
117
- return g && t && t.length > 0 && (t = [O, ...t]), t;
118
- }, [c, K, g, O]), Ke = r.useMemo(() => {
122
+ n.push(e);
123
+ return { groupFlattenedOptions: n, groupSentinelMap: i };
124
+ }, [c, b]), We = r.useMemo(() => {
125
+ let t = z ?? c;
126
+ return S && t && t.length > 0 && (t = [w, ...t]), t;
127
+ }, [c, z, S, w]), Xe = r.useMemo(() => {
119
128
  const t = [];
120
- if (b && M.size > 0)
121
- for (const [s, l] of M)
122
- l.enabled.length > 0 && X(u, l.enabled) && t.push({ value: s, label: "" });
123
- if (g) {
124
- const s = J(c ?? []);
125
- s.length > 0 && X(u, s) && t.push(O);
129
+ if (b && I.size > 0)
130
+ for (const [l, n] of I)
131
+ n.enabled.length > 0 && Y(p, n.enabled) && t.push({ value: l, label: "" });
132
+ if (S) {
133
+ const l = Z(c ?? []);
134
+ l.length > 0 && Y(p, l) && t.push(w);
126
135
  }
127
- return t.length === 0 ? f : [...u, ...t];
136
+ return t.length === 0 ? g : [...p, ...t];
128
137
  }, [
129
- f,
130
- u,
138
+ g,
139
+ p,
131
140
  c,
132
141
  b,
133
- M,
134
- g,
135
- O
136
- ]), Ue = (t, s) => {
137
- let l = t;
138
- const i = s.option;
139
- if (b && i && M.has(i.value)) {
140
- const e = M.get(i.value).enabled;
141
- if (s.action === "select-option") {
142
- const o = [...u];
143
- for (const n of e)
144
- o.some((d) => d.value === n.value) || o.push(n);
145
- l = o;
146
- } else s.action === "deselect-option" && (l = u.filter((o) => !e.some((n) => n.value === o.value)));
147
- } else if (g) {
148
- const e = J(c ?? []), o = (i == null ? void 0 : i.value) === v;
149
- o && s.action === "select-option" ? l = [...u.filter(
150
- (d) => d.value !== v && !e.some((S) => S.value === d.value)
151
- ), ...e] : o && s.action === "deselect-option" && (l = u.filter(
152
- (n) => n.value !== v && !e.some((d) => d.value === n.value)
142
+ I,
143
+ S,
144
+ w
145
+ ]), Je = (t, l) => {
146
+ let n = t;
147
+ const i = l.option;
148
+ if (b && i && I.has(i.value)) {
149
+ const e = I.get(i.value).enabled;
150
+ if (l.action === "select-option") {
151
+ const o = [...p];
152
+ for (const s of e)
153
+ o.some((m) => m.value === s.value) || o.push(s);
154
+ n = o;
155
+ } else l.action === "deselect-option" && (n = p.filter((o) => !e.some((s) => s.value === o.value)));
156
+ } else if (S) {
157
+ const e = Z(c ?? []), o = (i == null ? void 0 : i.value) === M;
158
+ o && l.action === "select-option" ? n = [...p.filter(
159
+ (m) => m.value !== M && !e.some((y) => y.value === m.value)
160
+ ), ...e] : o && l.action === "deselect-option" && (n = p.filter(
161
+ (s) => s.value !== M && !e.some((m) => m.value === s.value)
153
162
  ));
154
163
  }
155
- Array.isArray(l) && (l = l.filter((e) => e.value !== v && !Q(e))), j || He(l), V == null || V(l), !E && h.current && setTimeout(() => {
164
+ Array.isArray(n) && (n = n.filter((e) => e.value !== M && !ee(e))), B || qe(n), A == null || A(n), !G && h.current && setTimeout(() => {
156
165
  var e, o;
157
166
  return (o = (e = h.current) == null ? void 0 : e.inputRef) == null ? void 0 : o.focus();
158
167
  }, 0);
159
- }, Be = r.useCallback(
160
- (t, s) => t.data.value === v || Q(t.data) || !s ? !0 : String(t.label).toLowerCase().includes(s.toLowerCase()),
168
+ }, Qe = r.useCallback(
169
+ (t, l) => t.data.value === M || ee(t.data) || !l ? !0 : String(t.label).toLowerCase().includes(l.toLowerCase()),
161
170
  []
162
- ), [U, B] = r.useState(!1), ze = (t) => {
163
- (t.key === "ArrowUp" || t.key === "ArrowDown" || t.key === "Home" || t.key === "End" || t.key === "PageUp" || t.key === "PageDown" || t.key === "Tab") && (U || B(!0));
164
- }, qe = r.useCallback(() => {
165
- B((t) => t && !1);
166
- }, []), We = r.useCallback(
167
- (t) => /* @__PURE__ */ C(ft, { ...t, renderMessageListFooter: x }),
168
- [x]
169
- ), Xe = () => {
170
- const t = {
171
- ClearIndicator: (e) => st({ isClearIndicatorVisible: Ce, ...e }),
172
- DropdownIndicator: () => at({ iconName: te }),
173
- IndicatorSeparator: () => null,
174
- MenuPortal: gt,
175
- Menu: mt,
176
- MenuList: We,
177
- Option: (e) => vt({ renderOption: be, multiple: y, showRadioButtons: xe, ...e }),
178
- Control: rt,
179
- Input: dt,
180
- MultiValue: (e) => bt({ isTagRemovable: _e, tagsEllipsis: Re, ...e }),
181
- MultiValueRemove: St,
182
- SingleValue: yt,
183
- Group: it,
184
- GroupHeading: (e) => ct({ optionGroupHeadingText: Ne, ...e }),
185
- IndicatorsContainer: ut,
186
- ValueContainer: Mt,
187
- LoadingIndicator: pt
188
- }, s = ge ? Ze : Ye, l = () => I("select.no-options"), i = () => I("select.loading");
189
- return /* @__PURE__ */ C(
190
- s,
191
- {
192
- tagsDirection: L,
193
- showSelectAll: G,
194
- selectableGroups: P,
195
- dropdownType: ye,
196
- renderValue: Me,
197
- keyboardMode: U,
198
- exitKeyboardMode: qe,
199
- onKeyDown: ze,
200
- id: A,
201
- "aria-describedby": H,
202
- autoFocus: Ie,
203
- ref: h,
204
- instanceId: _,
205
- className: "tedi-select__wrapper",
206
- name: ee,
207
- options: je,
208
- defaultOptions: Z,
209
- value: Ke,
210
- defaultValue: N,
211
- cacheOptions: Fe,
212
- onChange: Ue,
213
- filterOption: g || b ? Be : void 0,
214
- onInputChange: le,
215
- onBlur: Ae,
216
- inputValue: ne,
217
- inputId: `${_}-input`,
218
- loadOptions: se,
219
- isLoading: re,
220
- noOptionsMessage: Se || l,
221
- loadingMessage: ve || i,
222
- classNamePrefix: "select",
223
- components: t,
224
- isDisabled: F,
225
- isSearchable: T,
226
- menuIsOpen: Le,
227
- openMenuOnFocus: ae,
228
- openMenuOnClick: ie,
229
- tabSelectsValue: ce,
230
- onMenuClose: Ve,
231
- onMenuOpen: we,
232
- placeholder: pe || "",
233
- isClearable: Oe,
234
- backspaceRemovesValue: De,
235
- menuShouldScrollIntoView: !0,
236
- isMulti: y,
237
- hideSelectedOptions: !1,
238
- closeMenuOnSelect: he,
239
- blurInputOnSelect: E,
240
- menuPlacement: "auto",
241
- inputIsHidden: ke,
242
- required: R,
243
- menuPortalTarget: document.body,
244
- menuPosition: "absolute",
245
- classNames: (() => {
246
- const e = {};
247
- if ($)
248
- for (const [o, n] of Object.entries($))
249
- e[o] = typeof n == "string" ? () => n : n;
250
- if (m) {
251
- const o = e.control;
252
- e.control = (n) => W(o == null ? void 0 : o(n), lt["tedi-input-group__input"]);
253
- }
254
- return Object.keys(e).length > 0 ? e : void 0;
255
- })(),
256
- theme: (e) => ({
257
- ...e,
258
- colors: {
259
- ...e.colors,
260
- primary: "var(--tedi-blue-600)",
261
- danger: "var(--tedi-red-600)",
262
- dangerLight: "var(--tedi-red-200)"
263
- }
264
- }),
265
- styles: {
266
- input: (e) => ({
267
- ...e,
268
- gridTemplateColumns: "0fr"
269
- })
171
+ ), [q, W] = r.useState(!1), Ye = (t) => {
172
+ (t.key === "ArrowUp" || t.key === "ArrowDown" || t.key === "Home" || t.key === "End" || t.key === "PageUp" || t.key === "PageDown" || t.key === "Tab") && (q || W(!0));
173
+ }, Ze = r.useCallback(() => {
174
+ W((t) => t && !1);
175
+ }, []), et = r.useCallback(
176
+ (t) => /* @__PURE__ */ L(vt, { ...t, renderMessageListFooter: $ }),
177
+ [$]
178
+ ), tt = () => /* @__PURE__ */ L(
179
+ ye ? st : lt,
180
+ {
181
+ tagsDirection: V,
182
+ showSelectAll: x,
183
+ selectableGroups: E,
184
+ dropdownType: Ie,
185
+ renderValue: Oe,
186
+ keyboardMode: q,
187
+ exitKeyboardMode: Ze,
188
+ onKeyDown: Ye,
189
+ id: Ke,
190
+ "aria-describedby": j,
191
+ autoFocus: we,
192
+ ref: h,
193
+ instanceId: f,
194
+ className: "tedi-select__wrapper",
195
+ name: ne,
196
+ options: We,
197
+ defaultOptions: oe,
198
+ value: Xe,
199
+ defaultValue: T,
200
+ cacheOptions: Fe,
201
+ onChange: Je,
202
+ filterOption: S || b ? Qe : void 0,
203
+ onInputChange: re,
204
+ onBlur: Be,
205
+ softKeyboardSuppressed: !H && O && je,
206
+ inputValue: ae,
207
+ inputId: He,
208
+ loadOptions: ie,
209
+ isLoading: ce,
210
+ noOptionsMessage: ve || (() => C("select.no-options")),
211
+ loadingMessage: he || (() => C("select.loading")),
212
+ classNamePrefix: "select",
213
+ components: {
214
+ ClearIndicator: (e) => dt({ isClearIndicatorVisible: Ve, ...e }),
215
+ DropdownIndicator: () => mt({ iconName: le }),
216
+ IndicatorSeparator: () => null,
217
+ MenuPortal: ht,
218
+ Menu: Mt,
219
+ MenuList: et,
220
+ Option: (e) => Ct({ renderOption: Me, multiple: v, showRadioButtons: $e, ...e }),
221
+ Control: pt,
222
+ Input: bt,
223
+ MultiValue: (e) => It({ isTagRemovable: De, tagsEllipsis: Ne, ...e }),
224
+ MultiValueRemove: Ot,
225
+ SingleValue: wt,
226
+ Group: ft,
227
+ GroupHeading: (e) => gt({ optionGroupHeadingText: Te, ...e }),
228
+ IndicatorsContainer: St,
229
+ ValueContainer: Lt,
230
+ LoadingIndicator: yt
231
+ },
232
+ isDisabled: F,
233
+ isSearchable: O,
234
+ menuIsOpen: Ae,
235
+ openMenuOnFocus: ue,
236
+ openMenuOnClick: de,
237
+ tabSelectsValue: pe,
238
+ onMenuClose: _e,
239
+ onMenuOpen: ke,
240
+ placeholder: ge || "",
241
+ isClearable: Le,
242
+ backspaceRemovesValue: Pe,
243
+ menuShouldScrollIntoView: !0,
244
+ isMulti: v,
245
+ hideSelectedOptions: !1,
246
+ closeMenuOnSelect: Ce,
247
+ blurInputOnSelect: G,
248
+ menuPlacement: "auto",
249
+ inputIsHidden: Re,
250
+ required: N,
251
+ menuPortalTarget: document.body,
252
+ menuPosition: "absolute",
253
+ classNames: (() => {
254
+ const e = {};
255
+ if (K)
256
+ for (const [o, s] of Object.entries(K))
257
+ e[o] = typeof s == "string" ? () => s : s;
258
+ if (u) {
259
+ const o = e.control;
260
+ e.control = (s) => Q(o == null ? void 0 : o(s), ct["tedi-input-group__input"]);
270
261
  }
262
+ return Object.keys(e).length > 0 ? e : void 0;
263
+ })(),
264
+ theme: (e) => ({
265
+ ...e,
266
+ colors: {
267
+ ...e.colors,
268
+ primary: "var(--tedi-blue-600)",
269
+ danger: "var(--tedi-red-600)",
270
+ dangerLight: "var(--tedi-red-200)"
271
+ }
272
+ }),
273
+ styles: {
274
+ input: (e) => ({
275
+ ...e,
276
+ gridTemplateColumns: "0fr"
277
+ })
271
278
  }
272
- );
273
- }, Je = W(
274
- p["tedi-select"],
275
- ue,
276
- { [p["tedi-select--invalid"]]: me || (a == null ? void 0 : a.type) === "error" },
277
- { [p["tedi-select--valid"]]: fe || (a == null ? void 0 : a.type) === "valid" },
278
- { [p[`tedi-select--${w}`]]: w },
279
- { [p[`tedi-select--tags-${L}`]]: L },
280
- { [p["tedi-select--searchable"]]: T },
281
- { [p["tedi-select--disabled"]]: F }
279
+ }
280
+ ), ot = Q(
281
+ d["tedi-select"],
282
+ me,
283
+ { [d["tedi-select--invalid"]]: Se || (a == null ? void 0 : a.type) === "error" },
284
+ { [d["tedi-select--valid"]]: be || (a == null ? void 0 : a.type) === "valid" },
285
+ { [d[`tedi-select--${_}`]]: _ },
286
+ { [d[`tedi-select--tags-${V}`]]: V },
287
+ { [d["tedi-select--searchable"]]: O },
288
+ { [d["tedi-select--disabled"]]: F }
282
289
  );
283
- return /* @__PURE__ */ q("div", { "data-name": "select", className: Je, children: [
284
- /* @__PURE__ */ q("div", { className: p["tedi-select__inner"], children: [
285
- !Te && /* @__PURE__ */ C(
286
- tt,
290
+ return /* @__PURE__ */ J("div", { "data-name": "select", className: ot, onPointerDownCapture: Ue, children: [
291
+ /* @__PURE__ */ J("div", { className: d["tedi-select__inner"], children: [
292
+ !R && /* @__PURE__ */ L(
293
+ at,
287
294
  {
288
- id: `${A}-input`,
289
- label: oe,
290
- required: R,
291
- hideLabel: de,
292
- size: w,
293
- renderWithoutLabel: Ge,
294
- tooltip: Pe
295
+ id: `${f}-input`,
296
+ label: se,
297
+ required: N,
298
+ hideLabel: fe,
299
+ size: _,
300
+ renderWithoutLabel: xe,
301
+ tooltip: Ee
295
302
  }
296
303
  ),
297
- Xe()
304
+ tt()
298
305
  ] }),
299
- a && /* @__PURE__ */ C(et, { ...a, id: H })
306
+ a && /* @__PURE__ */ L(rt, { ...a, id: j })
300
307
  ] });
301
308
  }
302
309
  );
303
- It.displayName = "Select";
310
+ At.displayName = "Select";
304
311
  export {
305
- It as Select
312
+ At as Select
306
313
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("../../../../../external/classnames/index.cjs.js"),e=require("./spinner.module.scss.cjs.js"),p=require("../../../providers/label-provider/use-labels.cjs.js"),f=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),m=s=>{const{getLabel:a}=p.useLabels(),{getCurrentBreakpointProps:l}=f.useBreakpointProps(s.defaultServerBreakpoint),{className:o,size:r=16,color:i="primary",label:c=a("spinner.loading"),position:t}=l(s),d=u.default(e.default["tedi-spinner"],o,t&&e.default[`tedi-spinner--${t}`],r&&e.default[`tedi-spinner--size-${r}`],i&&e.default[`tedi-spinner--color-${i}`]);return n.jsxs("span",{className:d,role:"status","aria-live":"polite","data-testid":"tedi-spinner",children:[n.jsx("svg",{viewBox:"22 22 44 44","aria-hidden":"true",children:n.jsx("circle",{className:e.default["tedi-spinner__inner"],cx:"44",cy:"44",r:"20",fill:"none"})}),n.jsx("span",{className:"sr-only",children:c})]})};exports.Spinner=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),p=require("../../../../../external/classnames/index.cjs.js"),e=require("./spinner.module.scss.cjs.js"),f=require("../../../providers/label-provider/use-labels.cjs.js"),v=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),m=r=>{const{getLabel:o}=f.useLabels(),{getCurrentBreakpointProps:l}=v.useBreakpointProps(r.defaultServerBreakpoint),{className:d,size:s=16,color:t="primary",label:c=o("spinner.loading"),position:a,decorative:i=!1}=l(r),u=p.default(e.default["tedi-spinner"],d,a&&e.default[`tedi-spinner--${a}`],s&&e.default[`tedi-spinner--size-${s}`],t&&e.default[`tedi-spinner--color-${t}`]);return n.jsxs("span",{className:u,role:i?void 0:"status","aria-live":i?void 0:"polite","aria-hidden":i||void 0,"data-testid":"tedi-spinner",children:[n.jsx("svg",{viewBox:"22 22 44 44","aria-hidden":"true",children:n.jsx("circle",{className:e.default["tedi-spinner__inner"],cx:"44",cy:"44",r:"20",fill:"none"})}),!i&&n.jsx("span",{className:"sr-only",children:c})]})};exports.Spinner=m;
@@ -33,6 +33,13 @@ export interface SpinnerProps extends BreakpointSupport<SpinnerBreakpointProps>
33
33
  * Provides a text label for screen readers to announce the spinner's purpose or status.
34
34
  */
35
35
  label?: string;
36
+ /**
37
+ * Renders the spinner as purely decorative — no `role="status"` live region and
38
+ * no screen-reader label. Use when the loading state is already announced by an
39
+ * ancestor (e.g. a button's `aria-busy`), so it isn't announced twice.
40
+ * @default false
41
+ */
42
+ decorative?: boolean;
36
43
  }
37
44
  export declare const Spinner: (props: SpinnerProps) => JSX.Element;
38
45
  export {};