@harpercollins/harpercollins-design-system 1.30.1 → 1.32.0

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 (26) hide show
  1. package/dist/cjs/components/data-display/AspectRatio/AspectRatio.cjs +1 -0
  2. package/dist/cjs/components/data-display/AspectRatio/index.cjs +1 -0
  3. package/dist/cjs/components/data-display/Table/Table.cjs +1 -1
  4. package/dist/cjs/components/data-display/Table/Table.styles.cjs +1 -1
  5. package/dist/cjs/components/data-display/Table/filters/FilterComponents.cjs +4 -4
  6. package/dist/cjs/components/inputs/ButtonGroup/ButtonGroup.cjs +1 -0
  7. package/dist/cjs/components/inputs/ButtonGroup/index.cjs +1 -0
  8. package/dist/cjs/index.cjs +1 -1
  9. package/dist/cjs/node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/AspectRatio/AspectRatio.cjs +1 -0
  10. package/dist/cjs/node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/AspectRatio/aspectRatioClasses.cjs +1 -0
  11. package/dist/cjs/node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/ButtonGroup/ButtonGroup.cjs +1 -0
  12. package/dist/cjs/node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/ButtonGroup/buttonGroupClasses.cjs +1 -0
  13. package/dist/esm/components/data-display/AspectRatio/AspectRatio.js +8 -0
  14. package/dist/esm/components/data-display/AspectRatio/index.js +4 -0
  15. package/dist/esm/components/data-display/Table/Table.js +27 -26
  16. package/dist/esm/components/data-display/Table/Table.styles.js +6 -6
  17. package/dist/esm/components/data-display/Table/filters/FilterComponents.js +217 -194
  18. package/dist/esm/components/inputs/ButtonGroup/ButtonGroup.js +8 -0
  19. package/dist/esm/components/inputs/ButtonGroup/index.js +4 -0
  20. package/dist/esm/index.js +204 -200
  21. package/dist/esm/node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/AspectRatio/AspectRatio.js +202 -0
  22. package/dist/esm/node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/AspectRatio/aspectRatioClasses.js +8 -0
  23. package/dist/esm/node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/ButtonGroup/ButtonGroup.js +280 -0
  24. package/dist/esm/node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/ButtonGroup/buttonGroupClasses.js +8 -0
  25. package/dist/index.d.ts +11 -1
  26. package/package.json +1 -1
@@ -1,38 +1,38 @@
1
- import { jsx as t, jsxs as h } from "react/jsx-runtime";
2
- import { faFilter as V } from "../../../../node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.js";
3
- import o from "react";
4
- import v from "styled-components";
5
- import w from "../../../inputs/RadioButton/RadioButton.js";
1
+ import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
+ import { faFilter as I } from "../../../../node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.js";
3
+ import r from "react";
4
+ import C from "styled-components";
5
+ import z from "../../../inputs/RadioButton/RadioButton.js";
6
6
  import D from "../../../navigation/Dropdown/Dropdown.js";
7
- import I from "../../../navigation/Menu/Menu.js";
8
- import z from "../../Icon/Icon.js";
9
- import x from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.js";
10
- import C from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/List/List.js";
11
- import S from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/ListItem/ListItem.js";
12
- import A from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Checkbox/Checkbox.js";
13
- import m from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Input/Input.js";
14
- import F from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Button/Button.js";
15
- import R from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Badge/Badge.js";
16
- import E from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/MenuButton/MenuButton.js";
17
- import k from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/IconButton/IconButton.js";
18
- function b(e) {
19
- const { header: l } = e.columnDef;
20
- return String(typeof l == "function" ? l({ column: e }) : l);
7
+ import A from "../../../navigation/Menu/Menu.js";
8
+ import R from "../../Icon/Icon.js";
9
+ import g from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.js";
10
+ import b from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/List/List.js";
11
+ import F from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/ListItem/ListItem.js";
12
+ import E from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Checkbox/Checkbox.js";
13
+ import x from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Input/Input.js";
14
+ import S from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Button/Button.js";
15
+ import k from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Badge/Badge.js";
16
+ import M from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/MenuButton/MenuButton.js";
17
+ import L from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/IconButton/IconButton.js";
18
+ function V(e) {
19
+ const { header: i } = e.columnDef;
20
+ return String(typeof i == "function" ? i({ column: e }) : i);
21
21
  }
22
- const M = v(x)`
22
+ const B = C(g)`
23
23
  padding: 12px;
24
24
  min-width: 250px;
25
25
  display: flex;
26
26
  flex-direction: column;
27
27
  gap: 12px;
28
- `, B = v(x)`
28
+ `, H = C(g)`
29
29
  display: flex;
30
30
  justify-content: space-between;
31
31
  align-items: center;
32
32
  font-weight: 600;
33
33
  font-size: 14px;
34
34
  margin-bottom: 4px;
35
- `, H = v(x)`
35
+ `, T = C(g)`
36
36
  display: flex;
37
37
  gap: 8px;
38
38
  justify-content: flex-end;
@@ -40,99 +40,99 @@ const M = v(x)`
40
40
  padding-top: 8px;
41
41
  border-top: 1px solid var(--palette-divider);
42
42
  `;
43
- function g({
43
+ function v({
44
44
  column: e,
45
- onApply: l,
46
- onClear: r,
47
- children: n
45
+ onApply: i,
46
+ onClear: n,
47
+ children: l
48
48
  }) {
49
- return /* @__PURE__ */ h(M, { children: [
50
- /* @__PURE__ */ h(B, { children: [
49
+ return /* @__PURE__ */ m(B, { children: [
50
+ /* @__PURE__ */ m(H, { children: [
51
51
  "Filter by ",
52
- b(e)
52
+ V(e)
53
53
  ] }),
54
- n,
55
- /* @__PURE__ */ h(H, { children: [
54
+ l,
55
+ /* @__PURE__ */ m(T, { children: [
56
56
  /* @__PURE__ */ t(
57
- F,
57
+ S,
58
58
  {
59
59
  "aria-label": "Clear filter",
60
60
  size: "sm",
61
61
  variant: "plain",
62
- onClick: r,
62
+ onClick: n,
63
63
  children: "Clear"
64
64
  }
65
65
  ),
66
66
  /* @__PURE__ */ t(
67
- F,
67
+ S,
68
68
  {
69
69
  "aria-label": "Apply filter",
70
70
  size: "sm",
71
71
  variant: "solid",
72
72
  color: "primary",
73
- onClick: l,
73
+ onClick: i,
74
74
  children: "Apply"
75
75
  }
76
76
  )
77
77
  ] })
78
78
  ] });
79
79
  }
80
- function T({
80
+ function K({
81
81
  column: e,
82
- onClose: l
82
+ onClose: i
83
83
  }) {
84
- const [r, n] = o.useState(
84
+ const [n, l] = r.useState(
85
85
  e.getFilterValue() ?? ""
86
- ), i = () => {
87
- e.setFilterValue(r || void 0), l?.();
86
+ ), p = () => {
87
+ e.setFilterValue(n || void 0), i?.();
88
88
  };
89
- return /* @__PURE__ */ t(g, { column: e, onApply: i, onClear: () => {
90
- n(""), e.setFilterValue(void 0);
89
+ return /* @__PURE__ */ t(v, { column: e, onApply: p, onClear: () => {
90
+ l(""), e.setFilterValue(void 0);
91
91
  }, children: /* @__PURE__ */ t(
92
- m,
92
+ x,
93
93
  {
94
94
  placeholder: "Search...",
95
- value: r,
96
- onChange: (c) => n(c.target.value),
97
- onKeyDown: (c) => {
98
- c.key === "Enter" && i();
95
+ value: n,
96
+ onChange: (a) => l(a.target.value),
97
+ onKeyDown: (a) => {
98
+ a.key === "Enter" && p();
99
99
  },
100
100
  size: "sm",
101
101
  autoFocus: !0
102
102
  }
103
103
  ) });
104
104
  }
105
- function K({
105
+ function O({
106
106
  column: e,
107
- onClose: l
107
+ onClose: i
108
108
  }) {
109
- const r = e.getFilterValue(), [n, i] = o.useState(
110
- r?.min?.toString() ?? ""
111
- ), [a, c] = o.useState(
112
- r?.max?.toString() ?? ""
113
- ), f = o.useRef(null);
114
- o.useEffect(() => {
109
+ const n = e.getFilterValue(), [l, p] = r.useState(
110
+ n?.min?.toString() ?? ""
111
+ ), [d, a] = r.useState(
112
+ n?.max?.toString() ?? ""
113
+ ), f = r.useRef(null);
114
+ r.useEffect(() => {
115
115
  f.current?.focus({
116
116
  preventScroll: !0
117
117
  });
118
118
  }, []);
119
- const u = () => {
120
- const d = n ? parseFloat(n) : void 0, p = a ? parseFloat(a) : void 0;
121
- d !== void 0 || p !== void 0 ? e.setFilterValue({ min: d, max: p }) : e.setFilterValue(void 0), l?.();
119
+ const c = () => {
120
+ const s = l ? parseFloat(l) : void 0, u = d ? parseFloat(d) : void 0;
121
+ s !== void 0 || u !== void 0 ? e.setFilterValue({ min: s, max: u }) : e.setFilterValue(void 0), i?.();
122
122
  };
123
- return /* @__PURE__ */ t(g, { column: e, onApply: u, onClear: () => {
124
- i(""), c(""), e.setFilterValue(void 0);
125
- }, children: /* @__PURE__ */ h(x, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [
123
+ return /* @__PURE__ */ t(v, { column: e, onApply: c, onClear: () => {
124
+ p(""), a(""), e.setFilterValue(void 0);
125
+ }, children: /* @__PURE__ */ m(g, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [
126
126
  /* @__PURE__ */ t(
127
- m,
127
+ x,
128
128
  {
129
129
  slotProps: { input: { ref: f } },
130
130
  placeholder: "Min",
131
131
  type: "number",
132
- value: n,
133
- onChange: (d) => i(d.target.value),
134
- onKeyDown: (d) => {
135
- d.key === "Enter" && u();
132
+ value: l,
133
+ onChange: (s) => p(s.target.value),
134
+ onKeyDown: (s) => {
135
+ s.key === "Enter" && c();
136
136
  },
137
137
  size: "sm",
138
138
  sx: { flex: 1 }
@@ -140,14 +140,14 @@ function K({
140
140
  ),
141
141
  /* @__PURE__ */ t("span", { children: "-" }),
142
142
  /* @__PURE__ */ t(
143
- m,
143
+ x,
144
144
  {
145
145
  placeholder: "Max",
146
146
  type: "number",
147
- value: a,
148
- onChange: (d) => c(d.target.value),
149
- onKeyDown: (d) => {
150
- d.key === "Enter" && u();
147
+ value: d,
148
+ onChange: (s) => a(s.target.value),
149
+ onKeyDown: (s) => {
150
+ s.key === "Enter" && c();
151
151
  },
152
152
  size: "sm",
153
153
  sx: { flex: 1 }
@@ -155,28 +155,28 @@ function K({
155
155
  )
156
156
  ] }) });
157
157
  }
158
- function L({
158
+ function P({
159
159
  column: e,
160
- onClose: l
160
+ onClose: i
161
161
  }) {
162
- const r = e.getFilterValue(), [n, i] = o.useState(
163
- r?.start ? r.start.toISOString().split("T")[0] : ""
164
- ), [a, c] = o.useState(
165
- r?.end ? r.end.toISOString().split("T")[0] : ""
166
- ), f = o.useRef(null), u = o.useRef(null);
167
- o.useEffect(() => {
168
- u.current?.focus({
162
+ const n = e.getFilterValue(), [l, p] = r.useState(
163
+ n?.start ? n.start.toISOString().split("T")[0] : ""
164
+ ), [d, a] = r.useState(
165
+ n?.end ? n.end.toISOString().split("T")[0] : ""
166
+ ), f = r.useRef(null), c = r.useRef(null);
167
+ r.useEffect(() => {
168
+ c.current?.focus({
169
169
  preventScroll: !0
170
170
  });
171
171
  }, []);
172
- const s = () => {
173
- const p = n ? new Date(n) : void 0, y = a ? new Date(a) : void 0;
174
- p !== void 0 || y !== void 0 ? e.setFilterValue({ start: p, end: y }) : e.setFilterValue(void 0), l?.();
172
+ const o = () => {
173
+ const u = l ? new Date(l) : void 0, y = d ? new Date(d) : void 0;
174
+ u !== void 0 || y !== void 0 ? e.setFilterValue({ start: u, end: y }) : e.setFilterValue(void 0), i?.();
175
175
  };
176
- return /* @__PURE__ */ t(g, { column: e, onApply: s, onClear: () => {
177
- i(""), c(""), e.setFilterValue(void 0);
178
- }, children: /* @__PURE__ */ h(
179
- x,
176
+ return /* @__PURE__ */ t(v, { column: e, onApply: o, onClear: () => {
177
+ p(""), a(""), e.setFilterValue(void 0);
178
+ }, children: /* @__PURE__ */ m(
179
+ g,
180
180
  {
181
181
  ref: f,
182
182
  tabIndex: 0,
@@ -191,14 +191,14 @@ function L({
191
191
  },
192
192
  children: [
193
193
  /* @__PURE__ */ t(
194
- m,
194
+ x,
195
195
  {
196
196
  type: "date",
197
- value: n,
198
- ref: u,
199
- onChange: (p) => i(p.target.value),
200
- onKeyDown: (p) => {
201
- p.key === "Enter" && s();
197
+ value: l,
198
+ ref: c,
199
+ onChange: (u) => p(u.target.value),
200
+ onKeyDown: (u) => {
201
+ u.key === "Enter" && o();
202
202
  },
203
203
  size: "sm",
204
204
  slotProps: {
@@ -210,13 +210,13 @@ function L({
210
210
  }
211
211
  ),
212
212
  /* @__PURE__ */ t(
213
- m,
213
+ x,
214
214
  {
215
215
  type: "date",
216
- value: a,
217
- onChange: (p) => c(p.target.value),
218
- onKeyDown: (p) => {
219
- p.key === "Enter" && s();
216
+ value: d,
217
+ onChange: (u) => a(u.target.value),
218
+ onKeyDown: (u) => {
219
+ u.key === "Enter" && o();
220
220
  },
221
221
  size: "sm",
222
222
  slotProps: {
@@ -232,82 +232,103 @@ function L({
232
232
  }
233
233
  function j({
234
234
  column: e,
235
- options: l,
236
- onClose: r
235
+ options: i,
236
+ searchable: n = !1,
237
+ onClose: l
237
238
  }) {
238
- const [n, i] = o.useState(
239
+ const [p, d] = r.useState(
239
240
  e.getFilterValue() ?? ""
240
- ), a = o.useRef(null);
241
- return o.useEffect(() => {
242
- a.current?.focus();
243
- }, []), /* @__PURE__ */ t(g, { column: e, onApply: () => {
244
- e.setFilterValue(n || void 0), r?.();
241
+ ), [a, f] = r.useState(""), c = r.useRef(null), o = r.useRef(null);
242
+ r.useEffect(() => {
243
+ n ? c.current?.focus({ preventScroll: !0 }) : o.current?.focus({ preventScroll: !0 });
244
+ }, [n]);
245
+ const s = r.useMemo(
246
+ () => a ? i.filter(
247
+ (h) => h.label.toLowerCase().includes(a.toLowerCase())
248
+ ) : i,
249
+ [i, a]
250
+ );
251
+ return /* @__PURE__ */ m(v, { column: e, onApply: () => {
252
+ e.setFilterValue(p || void 0), l?.();
245
253
  }, onClear: () => {
246
- i(""), e.setFilterValue(void 0);
247
- }, children: /* @__PURE__ */ t(
248
- C,
249
- {
250
- ref: a,
251
- component: "ul",
252
- size: "sm",
253
- tabIndex: 0,
254
- role: "group",
255
- sx: {
256
- maxHeight: "240px",
257
- overflowY: "auto",
258
- outline: "none",
259
- "&:focus": {
260
- outline: "none"
261
- }
262
- },
263
- children: l.map((u) => /* @__PURE__ */ t(
264
- S,
265
- {
266
- component: "li",
267
- sx: { paddingLeft: 0, paddingTop: 0 },
268
- children: /* @__PURE__ */ t(
269
- w,
270
- {
271
- value: u,
272
- label: u,
273
- size: "sm",
274
- checked: n === u,
275
- onChange: (s) => i(s.target.value),
276
- sx: {
277
- width: "100%"
278
- }
279
- }
280
- )
254
+ d(""), f(""), e.setFilterValue(void 0);
255
+ }, children: [
256
+ n && /* @__PURE__ */ t(
257
+ x,
258
+ {
259
+ slotProps: { input: { ref: c } },
260
+ placeholder: "Search...",
261
+ value: a,
262
+ onChange: (h) => f(h.target.value),
263
+ size: "sm"
264
+ }
265
+ ),
266
+ /* @__PURE__ */ m(
267
+ b,
268
+ {
269
+ ref: o,
270
+ component: "ul",
271
+ size: "sm",
272
+ role: "group",
273
+ tabIndex: 0,
274
+ sx: {
275
+ maxHeight: n ? "200px" : "240px",
276
+ overflowY: "auto",
277
+ outline: "none",
278
+ "&:focus": { outline: "none" }
281
279
  },
282
- u
283
- ))
284
- }
285
- ) });
280
+ children: [
281
+ s.map((h) => /* @__PURE__ */ t(
282
+ F,
283
+ {
284
+ component: "li",
285
+ sx: { paddingLeft: 0, paddingTop: 0 },
286
+ children: /* @__PURE__ */ t(
287
+ z,
288
+ {
289
+ value: h.value,
290
+ label: h.label,
291
+ size: "sm",
292
+ checked: p === h.value,
293
+ onChange: (w) => d(w.target.value),
294
+ sx: {
295
+ width: "100%"
296
+ }
297
+ }
298
+ )
299
+ },
300
+ h.value
301
+ )),
302
+ s.length === 0 && /* @__PURE__ */ t(F, { component: "li", sx: { color: "text.tertiary" }, children: "No options match" })
303
+ ]
304
+ }
305
+ )
306
+ ] });
286
307
  }
287
- function O({
308
+ function N({
288
309
  column: e,
289
- options: l,
290
- onClose: r
310
+ options: i,
311
+ onClose: n
291
312
  }) {
292
- const [n, i] = o.useState(
313
+ const [l, p] = r.useState(
293
314
  e.getFilterValue() ?? []
294
- ), a = o.useRef(null);
295
- o.useEffect(() => {
296
- a.current?.focus();
315
+ ), d = r.useRef(null);
316
+ r.useEffect(() => {
317
+ d.current?.focus();
297
318
  }, []);
298
- const c = (s) => {
299
- i(
300
- (d) => d.includes(s) ? d.filter((p) => p !== s) : [...d, s]
319
+ const a = (o) => {
320
+ p(
321
+ (s) => s.includes(o) ? s.filter((u) => u !== o) : [...s, o]
301
322
  );
302
323
  };
303
- return /* @__PURE__ */ t(g, { column: e, onApply: () => {
304
- e.setFilterValue(n.length > 0 ? n : void 0), r?.();
324
+ return /* @__PURE__ */ t(v, { column: e, onApply: () => {
325
+ e.setFilterValue(l.length > 0 ? l : void 0), n?.();
305
326
  }, onClear: () => {
306
- i([]), e.setFilterValue(void 0);
327
+ p([]), e.setFilterValue(void 0);
307
328
  }, children: /* @__PURE__ */ t(
308
- C,
329
+ b,
309
330
  {
310
- ref: a,
331
+ ref: d,
311
332
  component: "ul",
312
333
  size: "sm",
313
334
  tabIndex: 0,
@@ -320,48 +341,49 @@ function O({
320
341
  outline: "none"
321
342
  }
322
343
  },
323
- children: l.map((s) => /* @__PURE__ */ t(
324
- S,
344
+ children: i.map((o) => /* @__PURE__ */ t(
345
+ F,
325
346
  {
326
347
  component: "li",
327
348
  sx: { paddingLeft: 0, paddingTop: 0 },
328
349
  children: /* @__PURE__ */ t(
329
- A,
350
+ E,
330
351
  {
331
- label: s,
332
- checked: n.includes(s),
333
- onChange: () => c(s),
352
+ label: o.label,
353
+ checked: l.includes(o.value),
354
+ onChange: () => a(o.value),
334
355
  size: "sm",
335
356
  sx: {
336
357
  width: "100%"
337
358
  }
338
359
  },
339
- s
360
+ o.value
340
361
  )
341
362
  },
342
- s
363
+ o.value
343
364
  ))
344
365
  }
345
366
  ) });
346
367
  }
347
- const P = {
348
- text: T,
349
- number: K,
350
- date: L,
368
+ const W = {
369
+ text: K,
370
+ number: O,
371
+ date: P,
351
372
  select: j,
352
- multiselect: O
373
+ multiselect: N
353
374
  };
354
- function ie({
375
+ function ae({
355
376
  column: e,
356
- filterType: l = "text",
357
- filterOptions: r = []
377
+ filterType: i = "text",
378
+ filterOptions: n = [],
379
+ filterSearchable: l
358
380
  }) {
359
- const [n, i] = o.useState(!1), a = () => {
360
- i(!1);
361
- }, c = P[l];
362
- return /* @__PURE__ */ h(D, { open: n, onOpenChange: (f, u) => i(u), children: [
381
+ const [p, d] = r.useState(!1), a = () => {
382
+ d(!1);
383
+ }, f = W[i];
384
+ return /* @__PURE__ */ m(D, { open: p, onOpenChange: (c, o) => d(o), children: [
363
385
  /* @__PURE__ */ t(
364
- R,
386
+ k,
365
387
  {
366
388
  badgeContent: "",
367
389
  invisible: !e.getIsFiltered(),
@@ -377,12 +399,12 @@ function ie({
377
399
  }
378
400
  },
379
401
  children: /* @__PURE__ */ t(
380
- E,
402
+ M,
381
403
  {
382
- "aria-label": `${e.getIsFiltered() ? "Filtered" : "Filter"} by ${b(
404
+ "aria-label": `${e.getIsFiltered() ? "Filtered" : "Filter"} by ${V(
383
405
  e
384
406
  )}`,
385
- slots: { root: k },
407
+ slots: { root: L },
386
408
  slotProps: {
387
409
  root: {
388
410
  size: "sm",
@@ -403,27 +425,28 @@ function ie({
403
425
  }
404
426
  }
405
427
  },
406
- children: /* @__PURE__ */ t(z, { icon: V, size: "xs" })
428
+ children: /* @__PURE__ */ t(R, { icon: I, size: "xs" })
407
429
  }
408
430
  )
409
431
  }
410
432
  ),
411
- /* @__PURE__ */ t(I, { placement: "bottom-start", children: /* @__PURE__ */ t(
412
- c,
433
+ /* @__PURE__ */ t(A, { placement: "bottom-start", children: /* @__PURE__ */ t(
434
+ f,
413
435
  {
414
436
  column: e,
415
437
  onClose: a,
416
- options: r
438
+ options: n,
439
+ searchable: l
417
440
  }
418
441
  ) })
419
442
  ] });
420
443
  }
421
444
  export {
422
- ie as ColumnFilter,
423
- L as DateFilter,
424
- O as MultiSelectFilter,
425
- K as NumericFilter,
445
+ ae as ColumnFilter,
446
+ P as DateFilter,
447
+ N as MultiSelectFilter,
448
+ O as NumericFilter,
426
449
  j as SelectFilter,
427
- T as TextFilter,
428
- P as filterComponentMap
450
+ K as TextFilter,
451
+ W as filterComponentMap
429
452
  };
@@ -0,0 +1,8 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import r from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/ButtonGroup/ButtonGroup.js";
3
+ function p(o) {
4
+ return /* @__PURE__ */ t(r, { ...o });
5
+ }
6
+ export {
7
+ p as default
8
+ };
@@ -0,0 +1,4 @@
1
+ import t from "./ButtonGroup.js";
2
+ export {
3
+ t as default
4
+ };