@iress-oss/ids-components 6.0.0-alpha.12 → 6.0.0-alpha.13

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.
@@ -1,133 +1,137 @@
1
- import { jsx as e, jsxs as n, Fragment as T } from "react/jsx-runtime";
2
- import { forwardRef as ee, useRef as te, useMemo as re, useState as C, useImperativeHandle as oe } from "react";
3
- import { c as se } from "../../cx-DN21T1EH.js";
4
- import { filter as ie } from "./Filter.styles.js";
1
+ import { jsx as e, jsxs as n, Fragment as re } from "react/jsx-runtime";
2
+ import { forwardRef as oe, useRef as se, useMemo as R, useState as I, useImperativeHandle as ie } from "react";
3
+ import { c as ae } from "../../cx-DN21T1EH.js";
4
+ import { filter as ne } from "./Filter.styles.js";
5
+ import { s as le } from "../../factory-CsinCTPr.js";
6
+ import { s as me } from "../../is-valid-prop-DweT-eOL.js";
5
7
  import { propagateTestid as o } from "../../helpers/utility/propagateTestid.js";
6
- import { IressPopover as ae } from "../Popover/Popover.js";
8
+ import { IressPopover as pe } from "../Popover/Popover.js";
7
9
  import "../Popover/Popover.styles.js";
8
10
  import "../Popover/InputPopover/InputPopover.js";
9
11
  import "../Popover/hooks/useFloatingPopover.js";
10
- import { I as ne } from "../../Button-ZGbOkyOo.js";
12
+ import { I as ce } from "../../Button-ZGbOkyOo.js";
11
13
  import "../Button/CloseButton/CloseButton.js";
12
- import { useRichSelectState as le } from "../RichSelect/hooks/useRichSelectState.js";
14
+ import { useRichSelectState as de } from "../RichSelect/hooks/useRichSelectState.js";
13
15
  import "../../Autocomplete-DUsna_OY.js";
14
16
  import "../RichSelect/SelectBody/SelectBody.js";
15
17
  import "../RichSelect/SelectCreate/SelectCreate.js";
16
18
  import "../RichSelect/SelectHeading/SelectHeading.js";
17
19
  import "../RichSelect/SelectLabel/SelectLabel.js";
18
- import { IressSelectMenu as me } from "../RichSelect/SelectMenu/SelectMenu.js";
20
+ import { IressSelectMenu as ue } from "../RichSelect/SelectMenu/SelectMenu.js";
19
21
  import "../RichSelect/SelectSearch/SelectSearch.js";
20
22
  import "../RichSelect/SelectSearchInput/SelectSearchInput.js";
21
23
  import "../RichSelect/SelectTags/SelectTags.js";
22
24
  import "../Autocomplete/Autocomplete.styles.js";
23
- import { useAutocompleteSearch as pe } from "../Autocomplete/hooks/useAutocompleteSearch.js";
24
- import { IressPanel as ce } from "../Panel/Panel.js";
25
+ import { useAutocompleteSearch as fe } from "../Autocomplete/hooks/useAutocompleteSearch.js";
26
+ import { IressPanel as he } from "../Panel/Panel.js";
25
27
  import "../Panel/Panel.styles.js";
26
- import { useFilterFlags as de } from "./hooks/useFilterFlags.js";
27
- import { useIdIfNeeded as ue } from "../../hooks/useIdIfNeeded.js";
28
- import { FilterSearch as fe } from "./components/FilterSearch.js";
29
- import { IressDivider as he } from "../Divider/Divider.js";
28
+ import { useFilterFlags as ve } from "./hooks/useFilterFlags.js";
29
+ import { useIdIfNeeded as ge } from "../../hooks/useIdIfNeeded.js";
30
+ import { FilterSearch as ye } from "./components/FilterSearch.js";
31
+ import { IressDivider as Fe } from "../Divider/Divider.js";
30
32
  import "../Divider/Divider.styles.js";
31
- import { FilterResetButton as ve } from "./components/FilterResetButton.js";
32
- import { FilterLabel as ge } from "./components/FilterLabel.js";
33
- import { IressIcon as I } from "../Icon/Icon.js";
33
+ import { FilterResetButton as be } from "./components/FilterResetButton.js";
34
+ import { FilterLabel as Se } from "./components/FilterLabel.js";
35
+ import { IressIcon as w } from "../Icon/Icon.js";
34
36
  import "../Icon/Icon.styles.js";
35
- import { GlobalCSSClass as Fe } from "../../enums.js";
36
- import { FilterResultsDescriptor as be } from "./components/FilterResultsDescriptor.js";
37
- import { s as ye } from "../../factory-CsinCTPr.js";
38
- const w = {
37
+ import { GlobalCSSClass as Ce } from "../../enums.js";
38
+ import { FilterResultsDescriptor as Pe } from "./components/FilterResultsDescriptor.js";
39
+ const N = {
39
40
  align: "bottom-start"
40
41
  }, Re = ({
41
- children: P,
42
- className: N,
42
+ children: x,
43
+ className: D,
43
44
  "data-testid": t,
44
- debounceThreshold: x,
45
+ debounceThreshold: A,
45
46
  defaultValue: h,
46
- id: D,
47
- initialOptions: A,
48
- inputProps: O = {
47
+ id: O,
48
+ initialOptions: Q,
49
+ inputProps: _ = {
49
50
  clearable: !0,
50
- prepend: /* @__PURE__ */ e(I, { name: "search" })
51
+ prepend: /* @__PURE__ */ e(w, { name: "search" })
51
52
  },
52
- limitDesktop: Q = 12,
53
- limitMobile: _ = 6,
54
- label: L,
53
+ limitDesktop: L = 12,
54
+ limitMobile: M = 6,
55
+ label: j,
55
56
  multiSelect: s,
56
- onChange: M,
57
- onReset: j,
57
+ onChange: k,
58
+ onReset: E,
58
59
  options: i,
59
60
  popoverProps: {
60
- footer: k,
61
- header: E,
62
- ...H
63
- } = w,
61
+ footer: H,
62
+ header: W,
63
+ ...q
64
+ } = N,
64
65
  searchable: v,
65
66
  searchNoResultsText: g,
66
- selectedOptionsText: W,
67
- value: q,
67
+ selectedOptionsText: G,
68
+ value: U,
68
69
  visibleResetButton: l,
69
- ...G
70
- }, U) => {
71
- const F = ue({ id: D }), b = `${F}-sr-text`, y = te(null), R = re(
70
+ ...y
71
+ }, V) => {
72
+ const F = ge({ id: O }), b = `${F}-sr-text`, S = se(null), C = R(
72
73
  () => v ?? typeof i == "function",
73
74
  [i, v]
74
- ), V = {
75
+ ), $ = {
75
76
  clearable: !0,
76
- prepend: /* @__PURE__ */ e(I, { name: "search" }),
77
- ...O
78
- }, $ = { ...w, ...H }, { value: S, setValue: c } = le({
77
+ prepend: /* @__PURE__ */ e(w, { name: "search" }),
78
+ ..._
79
+ }, z = { ...N, ...q }, { value: P, setValue: c } = de({
79
80
  component: "IressFilter",
80
81
  defaultValue: h,
81
82
  multiple: s,
82
- value: q
83
- }), [z, d] = C(""), [J, a] = C(!1), K = (p) => {
83
+ value: U
84
+ }), [J, d] = I(""), [K, a] = I(!1), [X, Y] = R(
85
+ () => me(y),
86
+ [y]
87
+ ), Z = (p) => {
84
88
  d(p.target.value);
85
- }, X = () => {
89
+ }, B = () => {
86
90
  d("");
87
- }, Y = (p) => {
88
- M?.(p), c(p), s || a(!1);
89
- }, Z = () => {
90
- c(void 0), j?.(), s || a(!1);
91
+ }, T = (p) => {
92
+ k?.(p), c(p), s || a(!1);
93
+ }, ee = () => {
94
+ c(void 0), E?.(), s || a(!1);
91
95
  };
92
- oe(U, () => ({
93
- element: y.current ?? void 0,
96
+ ie(V, () => ({
97
+ element: S.current ?? void 0,
94
98
  clearSearch: () => d(""),
95
99
  reset: () => c(h)
96
100
  }));
97
101
  const {
98
- debouncedQuery: B,
102
+ debouncedQuery: te,
99
103
  loading: u,
100
104
  results: f,
101
- shouldShowInstructions: Ce,
102
- shouldShowDebounceWaiting: Ie,
103
- shouldShowNoResults: we
104
- } = pe({
105
- debounceThreshold: x,
106
- initialOptions: A ?? (typeof i == "function" ? void 0 : i),
105
+ shouldShowInstructions: we,
106
+ shouldShowDebounceWaiting: Ne,
107
+ shouldShowNoResults: xe
108
+ } = fe({
109
+ debounceThreshold: A,
110
+ initialOptions: Q ?? (typeof i == "function" ? void 0 : i),
107
111
  options: i,
108
- query: z
109
- }), m = de({
110
- debouncedQuery: B,
112
+ query: J
113
+ }), m = ve({
114
+ debouncedQuery: te,
111
115
  loading: u,
112
116
  results: f,
113
- searchable: R,
117
+ searchable: C,
114
118
  visibleResetButton: l
115
- }), r = ie();
119
+ }), r = ne();
116
120
  return /* @__PURE__ */ n(
117
- ye.div,
121
+ le.div,
118
122
  {
119
- ...G,
120
- className: se(N, r.root, Fe.Filter),
123
+ ...Y,
124
+ className: ae(D, r.root, Ce.Filter),
121
125
  "data-testid": t,
122
126
  id: F,
123
- ref: y,
127
+ ref: S,
124
128
  children: [
125
129
  /* @__PURE__ */ n(
126
- ae,
130
+ pe,
127
131
  {
128
- ...$,
132
+ ...z,
129
133
  activator: /* @__PURE__ */ n(
130
- ne,
134
+ ce,
131
135
  {
132
136
  "aria-describedby": b,
133
137
  "data-testid": o(
@@ -135,13 +139,14 @@ const w = {
135
139
  "activator-button__button"
136
140
  ),
137
141
  onClick: () => a(!0),
142
+ ...X,
138
143
  children: [
139
144
  /* @__PURE__ */ e(
140
- ge,
145
+ Se,
141
146
  {
142
- label: L,
143
- selectedOptionsText: W,
144
- value: S
147
+ label: j,
148
+ selectedOptionsText: G,
149
+ value: P
145
150
  }
146
151
  ),
147
152
  /* @__PURE__ */ e("span", { className: r.chevron })
@@ -150,59 +155,59 @@ const w = {
150
155
  ),
151
156
  contentStyle: { className: r.popoverContent },
152
157
  "data-testid": o(t, "popover"),
153
- show: J,
158
+ show: K,
154
159
  matchActivatorWidth: !0,
155
160
  onActivated: () => a(!0),
156
161
  onDeactivated: () => a(!1),
157
162
  type: "listbox",
158
163
  children: [
159
- E,
160
- m.showHeader && /* @__PURE__ */ n(T, { children: [
161
- /* @__PURE__ */ n(ce, { bg: "transparent", p: "spacing.2", children: [
162
- R && /* @__PURE__ */ e(
163
- fe,
164
+ W,
165
+ m.showHeader && /* @__PURE__ */ n(re, { children: [
166
+ /* @__PURE__ */ n(he, { bg: "transparent", p: "spacing.2", children: [
167
+ C && /* @__PURE__ */ e(
168
+ ye,
164
169
  {
165
- ...V,
170
+ ...$,
166
171
  className: r.searchInput,
167
172
  "data-testid": o(t, "input"),
168
173
  loading: u,
169
- onChange: K,
170
- onClear: X
174
+ onChange: Z,
175
+ onClear: B
171
176
  }
172
177
  ),
173
178
  l && /* @__PURE__ */ e(
174
- ve,
179
+ be,
175
180
  {
176
181
  "data-testid": o(t, "reset-button"),
177
- onClick: Z,
182
+ onClick: ee,
178
183
  children: typeof l == "string" ? l : "Reset filter"
179
184
  }
180
185
  )
181
186
  ] }),
182
- m.showResults && /* @__PURE__ */ e(he, {})
187
+ m.showResults && /* @__PURE__ */ e(Fe, {})
183
188
  ] }),
184
189
  m.showResults && /* @__PURE__ */ e(
185
- me,
190
+ ue,
186
191
  {
187
192
  className: r.optionList,
188
193
  "data-testid": o(t, "menu"),
189
194
  items: f,
190
- limitDesktop: Q,
191
- limitMobile: _,
195
+ limitDesktop: L,
196
+ limitMobile: M,
192
197
  multiSelect: s,
193
- onChange: Y,
194
- selected: S,
198
+ onChange: T,
199
+ selected: P,
195
200
  selectedFirst: s
196
201
  }
197
202
  ),
198
203
  m.showNoResults && /* @__PURE__ */ e("div", { className: r.noResults, children: g }),
199
- k
204
+ H
200
205
  ]
201
206
  }
202
207
  ),
203
- P,
208
+ x,
204
209
  /* @__PURE__ */ e(
205
- be,
210
+ Pe,
206
211
  {
207
212
  "data-testid": o(t, "results-sr-text"),
208
213
  id: b,
@@ -214,8 +219,8 @@ const w = {
214
219
  ]
215
220
  }
216
221
  );
217
- }, Se = ee(Re);
218
- Se.displayName = "IressFilter";
222
+ }, Ie = oe(Re);
223
+ Ie.displayName = "IressFilter";
219
224
  export {
220
- Se as IressFilter
225
+ Ie as IressFilter
221
226
  };
@@ -14,7 +14,6 @@ const e = ["root", "content", "prepend", "append", "spinner"], n = o({
14
14
  },
15
15
  root: {
16
16
  alignItems: "baseline",
17
- alignSelf: "flex-start",
18
17
  cursor: "pointer",
19
18
  display: "inline-flex",
20
19
  fontKerning: "none",
@@ -1,20 +1,20 @@
1
- import { useState as l, useEffect as A } from "react";
2
- const v = (r, t = !1, n, e = 0) => {
3
- const [o, c] = l(n ?? 0);
4
- return A(() => {
5
- if (t || n !== void 0)
1
+ import { useState as s, useEffect as v } from "react";
2
+ const i = (t, r = !1, n, o = 0) => {
3
+ const [u, l] = s(n ?? 0);
4
+ return v(() => {
5
+ if (r || n !== void 0)
6
6
  return;
7
- const m = performance.now();
8
- let a;
9
- const u = () => {
10
- const f = Math.max(performance.now() - m, 0);
11
- c(f), P(f, r, e) && (a = requestAnimationFrame(u));
7
+ const m = performance.now(), p = 50;
8
+ let f = 0, a;
9
+ const c = () => {
10
+ const e = Math.max(performance.now() - m, 0);
11
+ e - f >= p && (l(e), f = e), A(e, t, o) && (a = requestAnimationFrame(c));
12
12
  };
13
- return a = requestAnimationFrame(u), () => {
13
+ return a = requestAnimationFrame(c), () => {
14
14
  a && cancelAnimationFrame(a);
15
15
  };
16
- }, [r, t, e, n]), n !== void 0 ? t ? r : n : t || o >= r ? r : o;
17
- }, P = (r, t, n) => r < t || r < n;
16
+ }, [t, r, o, n]), n !== void 0 ? r ? t : n : r || u >= t ? t : u;
17
+ }, A = (t, r, n) => t < r || t < n;
18
18
  export {
19
- v as useEstimatedProgressValue
19
+ i as useEstimatedProgressValue
20
20
  };
@@ -4556,10 +4556,6 @@ const z = `@layer reset, base, tokens, recipes, utilities;
4556
4556
  align-items: baseline;
4557
4557
  }
4558
4558
 
4559
- .as_flex-start {
4560
- align-self: flex-start;
4561
- }
4562
-
4563
4559
  .fk_none {
4564
4560
  font-kerning: none;
4565
4561
  }