@fluidattacks/design 9.8.0 → 9.9.1

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,4 +1,5 @@
1
- var e = { exports: {} };
1
+ import { __require as r } from "../node_modules/use-sync-external-store/shim/index.js";
2
+ var i = r();
2
3
  export {
3
- e as __module
4
+ i as s
4
5
  };
@@ -1,5 +1,7 @@
1
- import { __require as r } from "../node_modules/use-sync-external-store/shim/index.js";
2
- var i = r();
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as e } from "../node_modules/react-innertext/index.js";
3
+ var t = e();
4
+ const n = /* @__PURE__ */ r(t);
3
5
  export {
4
- i as s
6
+ n as default
5
7
  };
@@ -1,7 +1,7 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as e } from "../node_modules/react-innertext/index.js";
3
- var t = e();
4
- const n = /* @__PURE__ */ r(t);
1
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
2
+ import { __require as r } from "../node_modules/@fastify/deepmerge/index.js";
3
+ var o = r();
4
+ const p = /* @__PURE__ */ e(o);
5
5
  export {
6
- n as default
6
+ p as default
7
7
  };
@@ -1,7 +1,7 @@
1
- import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
2
- import { __require as r } from "../node_modules/@fastify/deepmerge/index.js";
3
- var o = r();
4
- const p = /* @__PURE__ */ e(o);
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as o } from "../node_modules/scroll/index.js";
3
+ var t = o();
4
+ const s = /* @__PURE__ */ r(t);
5
5
  export {
6
- p as default
6
+ s as default
7
7
  };
@@ -1,7 +1,4 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../node_modules/scroll/index.js";
3
- var t = o();
4
- const s = /* @__PURE__ */ r(t);
1
+ var e = { exports: {} };
5
2
  export {
6
- s as default
3
+ e as __module
7
4
  };
@@ -1,68 +1,68 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { useCallback as u, useEffect as O } from "react";
2
+ import { useCallback as k, useEffect as O } from "react";
3
3
  import { createPortal as L } from "react-dom";
4
4
  import { useTheme as P } from "styled-components";
5
5
  import { DrawerWrapper as K, DrawerPanel as q, DrawerBody as A } from "./styles.js";
6
6
  import { Button as F } from "../button/index.js";
7
7
  import { Container as i } from "../container/index.js";
8
8
  import { Icon as G } from "../icon/index.js";
9
- import { IconButton as $ } from "../icon-button/index.js";
9
+ import { IconButton as C } from "../icon-button/index.js";
10
10
  import { Tabs as H } from "../tabs/index.js";
11
11
  import "../typography/heading/index.js";
12
12
  import "../typography/span/index.js";
13
- import { Text as k } from "../typography/text/index.js";
13
+ import { Text as T } from "../typography/text/index.js";
14
14
  const re = ({
15
- _containerId: C = "portals",
16
- _portal: T = !0,
17
- actions: D = void 0,
18
- children: S = void 0,
15
+ _containerId: D = "portals",
16
+ _portal: S = !0,
17
+ actions: W = void 0,
18
+ children: z = void 0,
19
19
  dismissable: a = !0,
20
- footer: m = void 0,
21
- footerMessage: h = void 0,
22
- header: W = void 0,
20
+ footer: s = void 0,
21
+ footerMessage: y = void 0,
22
+ header: B = void 0,
23
23
  id: d = "drawer-container",
24
- modalRef: l,
25
- side: f = "right",
26
- size: z = "md",
27
- subtitle: y = void 0,
28
- tabs: g = void 0,
29
- title: B,
30
- titleIcon: v = void 0,
31
- titleTag: I = void 0,
32
- onClose: w = void 0
24
+ modalRef: n,
25
+ side: g = "right",
26
+ size: I = "md",
27
+ subtitle: v = void 0,
28
+ tabs: w = void 0,
29
+ title: b,
30
+ titleIcon: x = void 0,
31
+ titleTag: j = void 0,
32
+ onClose: u = void 0
33
33
  }) => {
34
- const o = P(), p = u(() => {
35
- l.close(), w?.();
36
- }, [l, w]), b = u(
34
+ const o = P(), p = k(() => {
35
+ n.close(), u?.();
36
+ }, [n, u]), E = k(
37
37
  (r) => {
38
38
  a && r.target === r.currentTarget && p();
39
39
  },
40
40
  [a, p]
41
41
  );
42
42
  O(() => {
43
- if (!a || !l.isOpen)
43
+ if (!a || !n.isOpen)
44
44
  return () => {
45
45
  };
46
- const r = (n) => {
47
- n.key === "Escape" && p();
46
+ const r = (l) => {
47
+ l.key === "Escape" && p();
48
48
  };
49
49
  return window.addEventListener("keydown", r), () => {
50
50
  window.removeEventListener("keydown", r);
51
51
  };
52
- }, [a, p, l.isOpen]);
53
- const x = /* @__PURE__ */ e(
52
+ }, [a, p, n.isOpen]);
53
+ const $ = /* @__PURE__ */ e(
54
54
  K,
55
55
  {
56
- $side: f,
56
+ $side: g,
57
57
  id: `${d}-wrapper`,
58
- onClick: b,
58
+ onClick: E,
59
59
  role: "presentation",
60
60
  children: /* @__PURE__ */ t(
61
61
  q,
62
62
  {
63
- $side: f,
64
- $size: z,
65
- "aria-label": l.name,
63
+ $side: g,
64
+ $size: I,
65
+ "aria-label": n.name,
66
66
  "aria-modal": "true",
67
67
  "data-testid": d,
68
68
  id: d,
@@ -96,7 +96,7 @@ const re = ({
96
96
  gap: 0.5,
97
97
  minWidth: "0",
98
98
  children: [
99
- v === void 0 ? void 0 : /* @__PURE__ */ e(
99
+ x === void 0 ? void 0 : /* @__PURE__ */ e(
100
100
  i,
101
101
  {
102
102
  alignItems: "center",
@@ -110,7 +110,7 @@ const re = ({
110
110
  children: /* @__PURE__ */ e(
111
111
  G,
112
112
  {
113
- icon: v,
113
+ icon: x,
114
114
  iconColor: o.palette.gray[700],
115
115
  iconSize: "md",
116
116
  iconType: "fa-solid"
@@ -134,7 +134,7 @@ const re = ({
134
134
  minWidth: "0",
135
135
  children: [
136
136
  /* @__PURE__ */ e(
137
- k,
137
+ T,
138
138
  {
139
139
  color: o.palette.gray[800],
140
140
  display: "inline-block",
@@ -143,22 +143,22 @@ const re = ({
143
143
  size: "lg",
144
144
  textOverflow: "ellipsis",
145
145
  whiteSpace: "nowrap",
146
- children: B
146
+ children: b
147
147
  }
148
148
  ),
149
- I
149
+ j
150
150
  ]
151
151
  }
152
152
  ),
153
- y === void 0 ? void 0 : /* @__PURE__ */ e(
154
- k,
153
+ v === void 0 ? void 0 : /* @__PURE__ */ e(
154
+ T,
155
155
  {
156
156
  color: o.palette.gray[400],
157
157
  overflow: "hidden",
158
158
  size: "md",
159
159
  textOverflow: "ellipsis",
160
160
  whiteSpace: "nowrap",
161
- children: y
161
+ children: v
162
162
  }
163
163
  )
164
164
  ]
@@ -167,37 +167,37 @@ const re = ({
167
167
  ]
168
168
  }
169
169
  ),
170
- W
170
+ B
171
171
  ]
172
172
  }
173
173
  ),
174
174
  /* @__PURE__ */ t(i, { display: "flex", gap: 0.25, children: [
175
- D?.map(
175
+ W?.map(
176
176
  ({
177
177
  disabled: r,
178
- icon: n,
179
- iconColor: s,
178
+ icon: l,
179
+ iconColor: h,
180
180
  shadow: c,
181
- tooltip: j,
182
- onClick: E
181
+ tooltip: f,
182
+ onClick: m
183
183
  }) => /* @__PURE__ */ e(
184
- $,
184
+ C,
185
185
  {
186
186
  disabled: r,
187
- icon: n ?? "paper-plane",
188
- iconColor: s ?? o.palette.gray[400],
187
+ icon: l ?? "paper-plane",
188
+ iconColor: h ?? o.palette.gray[400],
189
189
  iconSize: "sm",
190
190
  iconType: "fa-light",
191
- onClick: E,
191
+ onClick: m,
192
192
  shadow: c,
193
- tooltip: j,
193
+ tooltip: f,
194
194
  variant: "ghost"
195
195
  },
196
- `${d}-${n}`
196
+ `${d}-${l}`
197
197
  )
198
198
  ),
199
199
  a ? /* @__PURE__ */ e(
200
- $,
200
+ C,
201
201
  {
202
202
  icon: "xmark",
203
203
  iconColor: o.palette.gray[400],
@@ -212,9 +212,9 @@ const re = ({
212
212
  ]
213
213
  }
214
214
  ),
215
- g ? /* @__PURE__ */ e(i, { display: "flex", pt: 0.25, width: "100%", children: /* @__PURE__ */ e(H, { items: g }) }) : void 0,
216
- /* @__PURE__ */ e(A, { children: S }),
217
- m || h ? /* @__PURE__ */ t(
215
+ w ? /* @__PURE__ */ e(i, { display: "flex", pt: 0.25, width: "100%", children: /* @__PURE__ */ e(H, { items: w }) }) : void 0,
216
+ /* @__PURE__ */ e(A, { children: z }),
217
+ s || y ? /* @__PURE__ */ t(
218
218
  i,
219
219
  {
220
220
  alignSelf: "stretch",
@@ -225,25 +225,29 @@ const re = ({
225
225
  px: 1.25,
226
226
  py: 1,
227
227
  children: [
228
- h,
229
- m ? /* @__PURE__ */ e(
228
+ y,
229
+ s ? /* @__PURE__ */ e(
230
230
  i,
231
231
  {
232
232
  display: "flex",
233
233
  gap: 0.5,
234
234
  justify: "end",
235
235
  width: "100%",
236
- children: m.map(({ icon: r, text: n, onClick: s }, c) => /* @__PURE__ */ e(
237
- F,
238
- {
239
- icon: r,
240
- onClick: s,
241
- variant: c === 0 ? "primary" : "tertiary",
242
- width: "100%",
243
- children: n
244
- },
245
- `${c}-${n}`
246
- ))
236
+ children: s.map(
237
+ ({ disabled: r, icon: l, id: h, text: c, onClick: f }, m) => /* @__PURE__ */ e(
238
+ F,
239
+ {
240
+ disabled: r,
241
+ icon: l,
242
+ id: h,
243
+ onClick: f,
244
+ variant: m === 0 ? "primary" : "tertiary",
245
+ width: "100%",
246
+ children: c
247
+ },
248
+ `${m}-${c}`
249
+ )
250
+ )
247
251
  }
248
252
  ) : void 0
249
253
  ]
@@ -254,10 +258,10 @@ const re = ({
254
258
  )
255
259
  }
256
260
  );
257
- return l.isOpen ? T ? L(
258
- x,
259
- document.getElementById(C) ?? document.body
260
- ) : x : null;
261
+ return n.isOpen ? S ? L(
262
+ $,
263
+ document.getElementById(D) ?? document.body
264
+ ) : $ : null;
261
265
  };
262
266
  export {
263
267
  re as Drawer
@@ -23,11 +23,13 @@ interface IDrawerActionProps extends Partial<IIconModifiable>, Pick<IDisplayModi
23
23
  * Drawer footer button props.
24
24
  * @interface IDrawerButtonProps
25
25
  * @extends IIconModifiable
26
+ * @property { boolean } [disabled] - Whether the button is disabled.
26
27
  * @property { string } [id] - Button id.
27
28
  * @property { string } [text] - Button text.
28
29
  * @property { Function } [onClick] - Button click handler.
29
30
  */
30
31
  interface IDrawerButtonProps extends Partial<IIconModifiable> {
32
+ disabled?: boolean;
31
33
  id?: string;
32
34
  onClick?: () => void;
33
35
  text?: string;
@@ -1,6 +1,6 @@
1
1
  import { ActiveFilters } from './active-filters';
2
- import { IFilterItem, IFilterProps, IFiltersImperativeHandle, IFiltersOptions, TFilterType } from './types';
2
+ import { IFilterItem, IFilterOptionProps, IFilterProps, IFiltersImperativeHandle, IFiltersOptions, TFilterType } from './types';
3
3
  import { partitionFilters } from './utils';
4
4
  declare const Filters: import('react').ForwardRefExoticComponent<IFilterProps & import('react').RefAttributes<IFiltersImperativeHandle>>;
5
- export type { IFilterItem, IFiltersImperativeHandle, IFiltersOptions, TFilterType, };
5
+ export type { IFilterItem, IFilterOptionProps, IFiltersImperativeHandle, IFiltersOptions, TFilterType, };
6
6
  export { Filters, ActiveFilters, partitionFilters };
@@ -1,4 +1,4 @@
1
- import { jsx as d, jsxs as g } from "react/jsx-runtime";
1
+ import { jsx as d, jsxs as p } from "react/jsx-runtime";
2
2
  import b from "../../../_virtual/dayjs.min.js";
3
3
  import { l as Q } from "../../../_virtual/lodash.js";
4
4
  import { forwardRef as U, useContext as Z, useMemo as ee, useCallback as C, Fragment as te } from "react";
@@ -17,20 +17,20 @@ import "../../typography/span/index.js";
17
17
  import { Text as H } from "../../typography/text/index.js";
18
18
  import { parseCheckboxesFilterValue as S, formatCheckboxesFilterValue as A } from "../../../utils/filters.js";
19
19
  const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
20
- const y = oe(), {
20
+ const w = oe(), {
21
21
  id: t,
22
22
  searchValues: { searchFilter: h },
23
23
  setSearchValues: I,
24
24
  values: Y,
25
25
  setValues: f,
26
26
  scrollState: z
27
- } = Z(re), { ref: B } = z, p = Y[t], k = (m ?? []).some(
27
+ } = Z(re), { ref: B } = z, g = Y[t], k = (m ?? []).some(
28
28
  (e) => e.type !== "combobox" && (e.items ?? []).length > de
29
29
  ), L = m?.find(
30
30
  (e) => e.type === "includeExclude"
31
- ), R = m?.find(
31
+ ), y = m?.find(
32
32
  (e) => e.type === "checkboxes" && e.excludeLabel
33
- ), { mode: D, values: T } = S(p ?? ""), W = D === "exclude", _ = T.length > 0, N = !x || k || R !== void 0, $ = ee(() => m?.map((e) => {
33
+ ), { mode: D, values: T } = S(g ?? ""), W = D === "exclude", _ = T.length > 0, N = !x || k || y !== void 0, $ = ee(() => m?.map((e) => {
34
34
  const s = e?.items ?? [];
35
35
  return e.type === "combobox" ? s : s.filter(
36
36
  (u) => u.label?.toLowerCase().includes(h.toLowerCase()) ?? !1
@@ -97,10 +97,10 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
97
97
  ), c = l.filter(
98
98
  (a) => a === "-" || RegExp(/^\d+$/).test(a.trim())
99
99
  ), n = ["-", "-"];
100
- c.forEach((a, w) => {
101
- if (w >= 2) return;
100
+ c.forEach((a, R) => {
101
+ if (R >= 2) return;
102
102
  const E = a.trim();
103
- RegExp(/^\d+$/).test(E) ? n[w] = Number(E) : E === "-" && (n[w] = "-");
103
+ RegExp(/^\d+$/).test(E) ? n[R] = Number(E) : E === "-" && (n[R] = "-");
104
104
  });
105
105
  const i = u ?? 0;
106
106
  if (e === "" || e === void 0 || e === null)
@@ -150,8 +150,8 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
150
150
  ref: F
151
151
  }
152
152
  );
153
- const P = p !== void 0 && p !== "" && h === "" || k && h !== "", O = /* @__PURE__ */ g(te, { children: [
154
- p && h === "" ? /* @__PURE__ */ d(
153
+ const P = g !== void 0 && g !== "" && h === "" || k && h !== "", O = /* @__PURE__ */ p(te, { children: [
154
+ g && h === "" ? /* @__PURE__ */ d(
155
155
  v,
156
156
  {
157
157
  $variant: "lowRelevance",
@@ -172,7 +172,7 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
172
172
  }
173
173
  ) : void 0
174
174
  ] });
175
- return /* @__PURE__ */ g(
175
+ return /* @__PURE__ */ p(
176
176
  le,
177
177
  {
178
178
  $left: "346px",
@@ -180,8 +180,8 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
180
180
  ref: F,
181
181
  children: [
182
182
  x && !N && P ? /* @__PURE__ */ d(ce, { "data-testid": "options-menu-floating-actions", children: O }) : void 0,
183
- N ? /* @__PURE__ */ g(ae, { "data-testid": "options-menu-header", children: [
184
- /* @__PURE__ */ g(
183
+ N ? /* @__PURE__ */ p(ae, { "data-testid": "options-menu-header", children: [
184
+ /* @__PURE__ */ p(
185
185
  j,
186
186
  {
187
187
  display: "flex",
@@ -191,7 +191,7 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
191
191
  x ? void 0 : /* @__PURE__ */ d(
192
192
  H,
193
193
  {
194
- color: y.palette.gray[800],
194
+ color: w.palette.gray[800],
195
195
  fontWeight: "bold",
196
196
  size: "md",
197
197
  children: `Select ${V}`
@@ -201,7 +201,7 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
201
201
  ]
202
202
  }
203
203
  ),
204
- R ? /* @__PURE__ */ d(
204
+ y ? /* @__PURE__ */ d(
205
205
  j,
206
206
  {
207
207
  "data-testid": "exclude-toggle-row",
@@ -214,7 +214,7 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
214
214
  defaultChecked: W,
215
215
  disabled: !_,
216
216
  justify: "space-between",
217
- leftText: R.excludeLabel,
217
+ leftText: y.excludeLabel,
218
218
  name: `${t}-exclude`,
219
219
  onChange: q,
220
220
  variant: "inline"
@@ -245,17 +245,17 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
245
245
  "div",
246
246
  {
247
247
  style: { position: "relative" },
248
- children: /* @__PURE__ */ g(
248
+ children: /* @__PURE__ */ p(
249
249
  ie,
250
250
  {
251
251
  $border: u.length > 1 && s > 0,
252
252
  $overflow: o,
253
- style: { padding: l ? y.spacing[0.875] : 0 },
253
+ style: { padding: l ? w.spacing[0.875] : 0 },
254
254
  children: [
255
- x || u.length > 1 && !o ? /* @__PURE__ */ d(
255
+ x || e.showLabel === !0 || u.length > 1 && !o ? /* @__PURE__ */ d(
256
256
  H,
257
257
  {
258
- color: y.palette.gray[x ? 800 : 400],
258
+ color: w.palette.gray[x ? 800 : 400],
259
259
  fontWeight: "bold",
260
260
  mb: 0.5,
261
261
  size: "md",
@@ -265,7 +265,7 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
265
265
  /* @__PURE__ */ d(
266
266
  ne,
267
267
  {
268
- filterValue: p,
268
+ filterValue: g,
269
269
  filteredItems: $[s] ?? [],
270
270
  id: t,
271
271
  label: V,
@@ -1,185 +1,189 @@
1
- import { jsx as a, Fragment as P, jsxs as T } from "react/jsx-runtime";
2
- import { useVirtualizer as I } from "../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
3
- import j from "../../../../_virtual/dayjs.min.js";
4
- import y from "../../../../_virtual/isNaN.js";
5
- import { useContext as A, useCallback as p, useState as N } from "react";
6
- import { FiltersContext as U } from "../../context/index.js";
7
- import { NoMatches as _ } from "../../search/no-matches/index.js";
8
- import { StyledItem as b, StyledItemCount as q } from "../../styles.js";
9
- import { SingleSelectSearch as B } from "../single-select/index.js";
10
- import { Checkbox as w } from "../../../checkbox/index.js";
11
- import { theme as z } from "../../../colors/index.js";
12
- import { Icon as R } from "../../../icon/index.js";
1
+ import { jsx as r, Fragment as q, jsxs as w } from "react/jsx-runtime";
2
+ import { useVirtualizer as H } from "../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
3
+ import J from "../../../../_virtual/dayjs.min.js";
4
+ import E from "../../../../_virtual/isNaN.js";
5
+ import { useContext as K, useCallback as p, useRef as Q, useState as T } from "react";
6
+ import { FiltersContext as W } from "../../context/index.js";
7
+ import { NoMatches as X } from "../../search/no-matches/index.js";
8
+ import { StyledItem as y, StyledItemCount as Y } from "../../styles.js";
9
+ import { SingleSelectSearch as Z } from "../single-select/index.js";
10
+ import { Checkbox as O } from "../../../checkbox/index.js";
11
+ import { theme as L } from "../../../colors/index.js";
12
+ import { Icon as z } from "../../../icon/index.js";
13
13
  import "styled-components";
14
14
  import "../../../../_virtual/lodash.js";
15
15
  import "react-dom";
16
16
  import "../../../typography/heading/index.js";
17
- import { Span as G } from "../../../typography/span/index.js";
17
+ import { Span as ee } from "../../../typography/span/index.js";
18
18
  import "../../../typography/text/index.js";
19
19
  import "../../../container/index.js";
20
- import { Tag as H } from "../../../tag/index.js";
20
+ import { Tag as te } from "../../../tag/index.js";
21
21
  import "../../../icon-button/index.js";
22
22
  import "../../../button/index.js";
23
- import { InputDateRange as J } from "../../../inputs/fields/date-range/index.js";
24
- import { TextInput as K } from "../../../inputs/fields/text-input/index.js";
23
+ import { InputDateRange as oe } from "../../../inputs/fields/date-range/index.js";
24
+ import { TextInput as ne } from "../../../inputs/fields/text-input/index.js";
25
25
  import "../../../layout/categories/buttons/index.js";
26
26
  import "../../../inputs/utils/action-button/index.js";
27
- import { InputNumberRange as Q } from "../../../inputs/fields/number-range/index.js";
27
+ import { InputNumberRange as re } from "../../../inputs/fields/number-range/index.js";
28
28
  import "../../../../node_modules/react-international-phone/dist/index.js";
29
- import { useDebouncedCallback as W } from "../../../../hooks/use-debounced-callback.js";
30
- import { parseCheckboxesFilterValue as X, parseTextFilterValue as Y } from "../../../../utils/filters.js";
31
- const Z = ({
29
+ import { useDebouncedCallback as le } from "../../../../hooks/use-debounced-callback.js";
30
+ import { useMountEffect as ae } from "../../../../hooks/use-mount-effect.js";
31
+ import { parseCheckboxesFilterValue as ie, parseTextFilterValue as se } from "../../../../utils/filters.js";
32
+ const ce = ({
32
33
  id: i,
33
- filterValue: n,
34
- label: l,
34
+ filterValue: l,
35
+ label: a,
35
36
  onTextValue: t,
36
37
  checkboxLabel: s,
37
38
  onCheckboxChange: e,
38
- debounceMs: o
39
+ debounceMs: n
39
40
  }) => {
40
- const { text: r, checked: m } = Y(
41
- n ?? ""
42
- ), [d, v] = N(r), [S, C] = N(r), h = Number.isFinite(o) && (o ?? 0) >= 0 ? Math.min(o ?? 0, 5e3) : 0, x = W(t, h);
43
- r !== S && (C(r), v(r), x.cancel());
41
+ const { text: c, checked: f } = se(
42
+ l ?? ""
43
+ ), [u, d] = T(c), [g, R] = T(c), h = Number.isFinite(n) && (n ?? 0) >= 0 ? Math.min(n ?? 0, 5e3) : 0, b = le(t, h);
44
+ c !== g && (R(c), d(c), b.cancel());
44
45
  const k = p(
45
- (u) => {
46
- u.stopPropagation(), u.preventDefault();
47
- const f = u.target.value;
48
- v(f), h > 0 ? x(f) : t(f);
46
+ (x) => {
47
+ x.stopPropagation(), x.preventDefault();
48
+ const v = x.target.value;
49
+ d(v), h > 0 ? b(v) : t(v);
49
50
  },
50
- [h, x, t]
51
+ [h, b, t]
51
52
  );
52
- return /* @__PURE__ */ T(
53
+ return /* @__PURE__ */ w(
53
54
  "div",
54
55
  {
55
56
  style: {
56
57
  display: "flex",
57
58
  flexDirection: "column",
58
- gap: z.spacing[0.25],
59
+ gap: L.spacing[0.25],
59
60
  width: "100%"
60
61
  },
61
62
  children: [
62
- s ? /* @__PURE__ */ a(
63
- w,
63
+ s ? /* @__PURE__ */ r(
64
+ O,
64
65
  {
65
- checked: m,
66
+ checked: f,
66
67
  label: s,
67
68
  name: `${i}-checkbox`,
68
69
  onChange: e,
69
70
  value: "textCheck"
70
71
  }
71
72
  ) : void 0,
72
- /* @__PURE__ */ a(
73
- K,
73
+ /* @__PURE__ */ r(
74
+ ne,
74
75
  {
75
76
  name: i,
76
77
  onChange: k,
77
- placeholder: `Type ${l}...`,
78
- value: d
78
+ placeholder: `Type ${a}...`,
79
+ value: u
79
80
  }
80
81
  )
81
82
  ]
82
83
  }
83
84
  );
84
- }, ee = {
85
+ }, me = {
85
86
  text: ({
86
87
  id: i,
87
- filterValue: n,
88
- label: l,
88
+ filterValue: l,
89
+ label: a,
89
90
  onTextValue: t,
90
91
  checkboxLabel: s,
91
92
  onCheckboxChange: e,
92
- debounceMs: o
93
- }) => t === void 0 ? null : /* @__PURE__ */ a(
94
- Z,
93
+ debounceMs: n
94
+ }) => t === void 0 ? null : /* @__PURE__ */ r(
95
+ ce,
95
96
  {
96
97
  checkboxLabel: s,
97
- debounceMs: o,
98
- filterValue: n,
98
+ debounceMs: n,
99
+ filterValue: l,
99
100
  id: i,
100
- label: l,
101
+ label: a,
101
102
  onCheckboxChange: e,
102
103
  onTextValue: t
103
104
  }
104
105
  ),
105
106
  checkboxes: ({
106
107
  items: i,
107
- virtualItems: n,
108
- filterValue: l,
109
- ref: t,
110
- totalSize: s,
111
- onChange: e
108
+ virtualItems: l,
109
+ filterValue: a,
110
+ listRef: t,
111
+ ref: s,
112
+ scrollMargin: e,
113
+ totalSize: n,
114
+ onChange: c
112
115
  }) => {
113
- const o = new Set(
114
- X(l ?? "").values
116
+ const f = new Set(
117
+ ie(a ?? "").values
115
118
  );
116
- return n.length > 0 ? (
119
+ return l.length > 0 ? (
117
120
  // Positioning context for the absolute rows, and it reserves their height
118
- /* @__PURE__ */ a(
121
+ /* @__PURE__ */ r(
119
122
  "div",
120
123
  {
121
124
  "data-testid": "options-virtual-list",
125
+ ref: t,
122
126
  style: {
123
- height: `${s}px`,
127
+ height: `${n}px`,
124
128
  position: "relative",
125
129
  width: "100%"
126
130
  },
127
- children: n.map((r) => {
128
- const m = i[r.index], d = o.has(m?.value);
129
- return /* @__PURE__ */ a(
131
+ children: l.map((u) => {
132
+ const d = i[u.index], g = f.has(d?.value);
133
+ return /* @__PURE__ */ r(
130
134
  "div",
131
135
  {
132
- "data-index": r.index,
133
- ref: t,
136
+ "data-index": u.index,
137
+ ref: s,
134
138
  style: {
135
139
  position: "absolute",
136
- top: `${r.start}px`,
140
+ top: `${u.start - e}px`,
137
141
  left: 0,
138
142
  width: "100%"
139
143
  },
140
- children: /* @__PURE__ */ a(b, { "aria-selected": d, children: /* @__PURE__ */ a(
141
- w,
144
+ children: /* @__PURE__ */ r(y, { "aria-selected": g, children: /* @__PURE__ */ r(
145
+ O,
142
146
  {
143
- checked: d,
144
- label: m?.label,
145
- name: m?.value,
146
- onChange: e,
147
- value: m?.value
147
+ checked: g,
148
+ label: d?.label,
149
+ name: d?.value,
150
+ onChange: c,
151
+ value: d?.value
148
152
  }
149
153
  ) })
150
154
  },
151
- `${r.index}-${m?.value}`
155
+ `${u.index}-${d?.value}`
152
156
  );
153
157
  })
154
158
  }
155
159
  )
156
- ) : /* @__PURE__ */ a(_, {});
160
+ ) : /* @__PURE__ */ r(X, {});
157
161
  },
158
162
  combobox: ({
159
163
  id: i,
160
- items: n,
161
- filterValue: l,
164
+ items: l,
165
+ filterValue: a,
162
166
  label: t,
163
167
  onSelectChange: s
164
- }) => /* @__PURE__ */ a(
165
- B,
168
+ }) => /* @__PURE__ */ r(
169
+ Z,
166
170
  {
167
- items: n,
171
+ items: l,
168
172
  name: i,
169
173
  onSelect: s,
170
174
  placeholder: `Search ${t}`,
171
- selected: l?.split(",").map((e) => e.trim()).find((e) => n.some((o) => o.value === e)) ?? null
175
+ selected: a?.split(",").map((e) => e.trim()).find((e) => l.some((n) => n.value === e)) ?? null
172
176
  }
173
177
  ),
174
- list: ({ items: i, filterValue: n, onListChange: l }) => i.map((t) => /* @__PURE__ */ T(
175
- b,
178
+ list: ({ items: i, filterValue: l, onListChange: a }) => i.map((t) => /* @__PURE__ */ w(
179
+ y,
176
180
  {
177
- "aria-selected": n?.split(",").includes(t?.value),
181
+ "aria-selected": l?.split(",").includes(t?.value),
178
182
  as: "button",
179
- onClick: l?.(t.value),
183
+ onClick: a?.(t.value),
180
184
  children: [
181
- t.icon ? /* @__PURE__ */ a(
182
- R,
185
+ t.icon ? /* @__PURE__ */ r(
186
+ z,
183
187
  {
184
188
  icon: t.icon,
185
189
  iconColor: t.iconColor,
@@ -187,10 +191,10 @@ const Z = ({
187
191
  iconType: t.iconType ?? "fa-light"
188
192
  }
189
193
  ) : void 0,
190
- /* @__PURE__ */ a(
191
- G,
194
+ /* @__PURE__ */ r(
195
+ ee,
192
196
  {
193
- color: z.palette.gray[800],
197
+ color: L.palette.gray[800],
194
198
  display: "block",
195
199
  overflow: "hidden",
196
200
  size: "md",
@@ -200,16 +204,16 @@ const Z = ({
200
204
  children: t.label
201
205
  }
202
206
  ),
203
- /* @__PURE__ */ a("span", { className: "filter-item" }),
204
- t.count === void 0 ? void 0 : /* @__PURE__ */ a(q, { children: /* @__PURE__ */ a(
205
- H,
207
+ /* @__PURE__ */ r("span", { className: "filter-item" }),
208
+ t.count === void 0 ? void 0 : /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(
209
+ te,
206
210
  {
207
211
  tagLabel: t.count.toLocaleString("en-US"),
208
212
  variant: "default"
209
213
  }
210
214
  ) }),
211
- n?.split(",").includes(t?.value) ? /* @__PURE__ */ a("div", { style: { marginLeft: "auto" }, children: /* @__PURE__ */ a(
212
- R,
215
+ l?.split(",").includes(t?.value) ? /* @__PURE__ */ r("div", { style: { marginLeft: "auto" }, children: /* @__PURE__ */ r(
216
+ z,
213
217
  {
214
218
  icon: "check",
215
219
  iconClass: "selected",
@@ -223,25 +227,25 @@ const Z = ({
223
227
  )),
224
228
  dateRange: ({
225
229
  id: i,
226
- filterValue: n,
227
- onRangeChange: l,
230
+ filterValue: l,
231
+ onRangeChange: a,
228
232
  updateCalendarState: t
229
233
  }) => {
230
- const [s, e] = n?.split(",").filter((o) => j(o).isValid() || o === "-") ?? [];
231
- return /* @__PURE__ */ a(b, { children: /* @__PURE__ */ a(
232
- J,
234
+ const [s, e] = l?.split(",").filter((n) => J(n).isValid() || n === "-") ?? [];
235
+ return /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(
236
+ oe,
233
237
  {
234
238
  name: i,
235
239
  onOpenCalendar: t,
236
240
  propsMax: {
237
241
  name: "maxValue",
238
242
  value: e !== "-" ? e : "",
239
- onChange: l?.(1)
243
+ onChange: a?.(1)
240
244
  },
241
245
  propsMin: {
242
246
  name: "minValue",
243
247
  value: s !== "-" ? s : "",
244
- onChange: l?.(0)
248
+ onChange: a?.(0)
245
249
  },
246
250
  variant: "filters"
247
251
  }
@@ -249,114 +253,144 @@ const Z = ({
249
253
  },
250
254
  numberRange: ({
251
255
  id: i,
252
- filterValue: n,
253
- minValue: l,
256
+ filterValue: l,
257
+ minValue: a,
254
258
  maxValue: t,
255
259
  onRangeNumberChange: s
256
260
  }) => {
257
- const e = n?.split(",") ?? [], o = e[0]?.trim(), r = e[1]?.trim(), m = o && o !== "" && o !== "-" && !y(Number(o)) ? Number(o) : void 0, d = r && r !== "" && r !== "-" && !y(Number(r)) ? Number(r) : void 0;
258
- return /* @__PURE__ */ a(b, { children: /* @__PURE__ */ a(
259
- Q,
261
+ const e = l?.split(",") ?? [], n = e[0]?.trim(), c = e[1]?.trim(), f = n && n !== "" && n !== "-" && !E(Number(n)) ? Number(n) : void 0, u = c && c !== "" && c !== "-" && !E(Number(c)) ? Number(c) : void 0;
262
+ return /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(
263
+ re,
260
264
  {
261
265
  name: i,
262
266
  propsMax: {
263
267
  name: "maxValue",
264
- min: l,
268
+ min: a,
265
269
  max: t,
266
270
  onChange: s?.(1),
267
271
  placeholder: "Max %",
268
- value: d
272
+ value: u
269
273
  },
270
274
  propsMin: {
271
275
  name: "minValue",
272
- min: l,
276
+ min: a,
273
277
  max: t,
274
278
  onChange: s?.(0),
275
279
  placeholder: "Min %",
276
- value: m
280
+ value: f
277
281
  },
278
282
  variant: "filters"
279
283
  }
280
284
  ) });
281
285
  }
282
- }, $e = ({
286
+ }, Ge = ({
283
287
  id: i,
284
- filteredItems: n,
285
- filterValue: l,
288
+ filteredItems: l,
289
+ filterValue: a,
286
290
  label: t,
287
291
  option: s,
288
292
  onChange: e
289
293
  }) => {
290
- const { type: o, minValue: r, maxValue: m, checkboxLabel: d, debounceMs: v } = s ?? {}, S = o && ee[o], {
291
- calendarState: { updateCalendarState: C },
294
+ const { type: n, minValue: c, maxValue: f, checkboxLabel: u, debounceMs: d } = s ?? {}, g = n && me[n], {
295
+ calendarState: { updateCalendarState: R },
292
296
  scrollState: h
293
- } = A(U), x = p(() => 36, []), k = p(
297
+ } = K(W), b = p(() => 36, []), k = p(
294
298
  () => h.ref.current,
295
299
  [h.ref]
296
- ), u = I({
297
- count: n.length,
298
- estimateSize: x,
300
+ ), x = Q(null), [v, V] = T(0), M = p(() => {
301
+ const o = h.ref.current, m = x.current;
302
+ if (o && m) {
303
+ const S = m.getBoundingClientRect().top - o.getBoundingClientRect().top + o.scrollTop;
304
+ V(
305
+ (C) => C === S ? C : S
306
+ );
307
+ }
308
+ }, [h.ref]), $ = p(
309
+ (o) => {
310
+ x.current = o, M();
311
+ },
312
+ [M]
313
+ );
314
+ ae(() => {
315
+ const o = h.ref.current;
316
+ if (o === null || typeof ResizeObserver > "u")
317
+ return;
318
+ const m = new ResizeObserver(M), S = () => {
319
+ m.disconnect(), Array.from(o.children).forEach((_) => {
320
+ m.observe(_);
321
+ });
322
+ }, C = new MutationObserver(S);
323
+ return C.observe(o, { childList: !0 }), S(), () => {
324
+ C.disconnect(), m.disconnect();
325
+ };
326
+ });
327
+ const N = H({
328
+ count: l.length,
329
+ estimateSize: b,
299
330
  getScrollElement: k,
331
+ scrollMargin: v,
300
332
  useFlushSync: !1
301
- }), f = u.getVirtualItems(), M = p(
302
- (c) => {
303
- c.stopPropagation(), c.preventDefault(), e(c.target.value, o ?? "");
333
+ }), D = N.getVirtualItems(), F = p(
334
+ (o) => {
335
+ o.stopPropagation(), o.preventDefault(), e(o.target.value, n ?? "");
304
336
  },
305
- [e, o]
306
- ), V = p(
307
- (c) => (g) => {
308
- e(g, "dateRange", c);
337
+ [e, n]
338
+ ), P = p(
339
+ (o) => (m) => {
340
+ e(m, "dateRange", o);
309
341
  },
310
342
  [e]
311
- ), $ = p(
312
- (c) => (g) => {
313
- g.stopPropagation(), g.preventDefault(), e(g.target.value, "numberRange", c);
343
+ ), I = p(
344
+ (o) => (m) => {
345
+ m.stopPropagation(), m.preventDefault(), e(m.target.value, "numberRange", o);
314
346
  },
315
347
  [e]
316
- ), D = p(
317
- (c) => () => {
318
- e(c, "list");
348
+ ), j = p(
349
+ (o) => () => {
350
+ e(o, "list");
319
351
  },
320
352
  [e]
321
- ), E = p(
322
- (c) => () => {
323
- e(c, "combobox");
353
+ ), A = p(
354
+ (o) => () => {
355
+ e(o, "combobox");
324
356
  },
325
357
  [e]
326
- ), F = p(
327
- (c) => {
328
- c.stopPropagation(), e(c.target.checked ? "true" : "false", "textCheckbox");
358
+ ), B = p(
359
+ (o) => {
360
+ o.stopPropagation(), e(o.target.checked ? "true" : "false", "textCheckbox");
329
361
  },
330
362
  [e]
331
- ), L = p(
332
- (c) => {
333
- e(c, o ?? "text");
363
+ ), G = p(
364
+ (o) => {
365
+ e(o, n ?? "text");
334
366
  },
335
- [e, o]
336
- ), O = u.getTotalSize();
337
- return /* @__PURE__ */ a(P, { children: S?.({
338
- items: n,
367
+ [e, n]
368
+ ), U = N.getTotalSize();
369
+ return /* @__PURE__ */ r(q, { children: g?.({
370
+ items: l,
339
371
  label: t,
340
- virtualItems: f,
372
+ virtualItems: D,
341
373
  id: i,
342
- filterValue: l,
343
- onChange: M,
344
- onListChange: D,
345
- onSelectChange: E,
346
- onRangeChange: V,
347
- onRangeNumberChange: $,
348
- onTextValue: L,
349
- debounceMs: v,
350
- ref: u.measureElement,
351
- totalSize: O,
352
- updateCalendarState: C,
353
- minValue: r,
354
- maxValue: m,
355
- checkboxLabel: d,
356
- onCheckboxChange: F
374
+ filterValue: a,
375
+ onChange: F,
376
+ onListChange: j,
377
+ onSelectChange: A,
378
+ onRangeChange: P,
379
+ onRangeNumberChange: I,
380
+ onTextValue: G,
381
+ debounceMs: d,
382
+ listRef: $,
383
+ ref: N.measureElement,
384
+ scrollMargin: v,
385
+ totalSize: U,
386
+ updateCalendarState: R,
387
+ minValue: c,
388
+ maxValue: f,
389
+ checkboxLabel: u,
390
+ onCheckboxChange: B
357
391
  }) ?? null });
358
392
  };
359
393
  export {
360
- $e as Options,
361
- Z as TextFilterRenderer
394
+ Ge as Options,
395
+ ce as TextFilterRenderer
362
396
  };
@@ -24,6 +24,8 @@ interface IRendererConfig {
24
24
  onRangeChange?: (index: number) => (value: string) => void;
25
25
  onRangeNumberChange?: (index: number) => (event: Readonly<ChangeEvent<HTMLInputElement>>) => void;
26
26
  ref: (node: Readonly<Element | null>) => void;
27
+ listRef: (node: Readonly<HTMLDivElement> | null) => void;
28
+ scrollMargin: number;
27
29
  totalSize: number;
28
30
  updateCalendarState: (isOpen: boolean) => void;
29
31
  minValue?: number | string;
@@ -77,6 +77,8 @@ interface IFilterOptionProps {
77
77
  includeLabel?: string;
78
78
  /** Debounce window in ms before committing typed value to filter state. Applies to type "text". */
79
79
  debounceMs?: number;
80
+ /** Whether the block shows its label as a heading under the menu title. Checkboxes blocks hide it by default. */
81
+ showLabel?: boolean;
80
82
  }
81
83
  /** Filter option properties. */
82
84
  interface IFiltersOptions {
@@ -1,9 +1,9 @@
1
- import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
- import { useCallback as c } from "react";
1
+ import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
+ import { useCallback as l } from "react";
3
3
  import { useTheme as f } from "styled-components";
4
4
  import { OptionBoxContainer as a } from "../styles.js";
5
- import { Container as d } from "../../container/index.js";
6
- import { Icon as s } from "../../icon/index.js";
5
+ import { Container as s } from "../../container/index.js";
6
+ import { Icon as d } from "../../icon/index.js";
7
7
  import { ItemAction as h } from "../../list-item/item-action/index.js";
8
8
  import "../../typography/heading/index.js";
9
9
  import "../../typography/span/index.js";
@@ -15,10 +15,10 @@ const T = ({
15
15
  onSelect: t,
16
16
  value: e
17
17
  }) => {
18
- const m = f(), p = c(() => {
18
+ const m = f(), p = l(() => {
19
19
  t && t(i);
20
20
  }, [t, i]);
21
- return /* @__PURE__ */ l(
21
+ return /* @__PURE__ */ c(
22
22
  a,
23
23
  {
24
24
  $hasAction: o !== void 0,
@@ -26,14 +26,14 @@ const T = ({
26
26
  onClick: p,
27
27
  children: [
28
28
  n && o === void 0 ? /* @__PURE__ */ r(
29
- s,
29
+ d,
30
30
  {
31
31
  icon: "check",
32
32
  iconColor: m.palette.gray[800],
33
33
  iconSize: "lg"
34
34
  }
35
35
  ) : null,
36
- /* @__PURE__ */ r(d, { flexGrow: o === void 0 ? void 0 : 1, children: /* @__PURE__ */ r(C, { color: m.palette.gray[800], fontWeight: "bold", size: "md", children: i }) }),
36
+ /* @__PURE__ */ r(s, { flexGrow: 1, children: /* @__PURE__ */ r(C, { color: m.palette.gray[800], fontWeight: "bold", size: "md", children: i }) }),
37
37
  o === void 0 ? null : /* @__PURE__ */ r(h, { action: o, value: e })
38
38
  ]
39
39
  }
@@ -42,7 +42,7 @@ const p = o.li`
42
42
  background-color: ${a.palette.gray[r ? 100 : 200]};
43
43
  }
44
44
 
45
- &:hover:not([aria-selected="true"]) {
45
+ &:hover${r ? "" : ':not([aria-selected="true"])'} {
46
46
  background-color: ${a.palette.gray[r ? 50 : 100]};
47
47
  }
48
48
  `}
@@ -1,11 +1,11 @@
1
1
  import E, { useMemo as J, useCallback as Q, useRef as N, useState as nt, useEffect as F, isValidElement as dt, cloneElement as ht } from "react";
2
2
  import { useMemoDeepCompare as $t, usePrevious as xt, useMount as Ut, useUpdateEffect as Mt, useWindowSize as jt } from "../../@gilbarbara/hooks/dist/index.js";
3
- import { s as Ht } from "../../../_virtual/index2.js";
3
+ import { s as Ht } from "../../../_virtual/index.js";
4
4
  import z from "../../is-lite/dist/index.js";
5
- import ut from "../../../_virtual/index3.js";
6
- import Yt from "../../../_virtual/index4.js";
5
+ import ut from "../../../_virtual/index2.js";
6
+ import Yt from "../../../_virtual/index3.js";
7
7
  import It from "../../@gilbarbara/deep-equal/dist/index.js";
8
- import zt from "../../../_virtual/index5.js";
8
+ import zt from "../../../_virtual/index4.js";
9
9
  import Nt from "../../../_virtual/scrollparent.js";
10
10
  import { createPortal as Wt } from "react-dom";
11
11
  import { offset as yt, shift as Kt, arrow as Gt, useFloating as Et, autoPlacement as Vt, flip as Jt } from "../../@floating-ui/react-dom/dist/floating-ui.react-dom.js";
@@ -1,4 +1,4 @@
1
- import { __module as r } from "../../../_virtual/index.js";
1
+ import { __module as r } from "../../../_virtual/index5.js";
2
2
  import { __require as o } from "../cjs/use-sync-external-store-shim.production.js";
3
3
  import { __require as i } from "../cjs/use-sync-external-store-shim.development.js";
4
4
  var e;
package/package.json CHANGED
@@ -135,5 +135,5 @@
135
135
  "./dist/index.js"
136
136
  ],
137
137
  "typings": "./dist/index.d.ts",
138
- "version": "9.8.0"
138
+ "version": "9.9.1"
139
139
  }