impact-nova 1.1.1 → 1.1.2

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/dist/components/ui/accordion.js +37 -33
  2. package/dist/components/ui/alert.d.ts +2 -0
  3. package/dist/components/ui/alert.js +46 -31
  4. package/dist/components/ui/breadcrumb.d.ts +7 -2
  5. package/dist/components/ui/breadcrumb.js +98 -77
  6. package/dist/components/ui/calendar.js +198 -178
  7. package/dist/components/ui/date-picker/date-picker.js +94 -87
  8. package/dist/components/ui/date-picker/date-range-picker.js +124 -117
  9. package/dist/components/ui/date-picker/month-picker.js +98 -91
  10. package/dist/components/ui/date-picker/month-range-picker.js +118 -111
  11. package/dist/components/ui/date-picker/multi-date-picker.js +76 -69
  12. package/dist/components/ui/date-picker/multi-month-picker.js +72 -65
  13. package/dist/components/ui/date-picker/multi-week-picker.js +88 -81
  14. package/dist/components/ui/date-picker/week-picker.js +107 -100
  15. package/dist/components/ui/date-picker/week-range-picker.js +144 -137
  16. package/dist/components/ui/dialog.js +65 -61
  17. package/dist/components/ui/drawer.d.ts +3 -1
  18. package/dist/components/ui/drawer.js +44 -29
  19. package/dist/components/ui/file-upload.d.ts +2 -1
  20. package/dist/components/ui/file-upload.js +159 -135
  21. package/dist/components/ui/filter-panel/filter-panel.js +89 -70
  22. package/dist/components/ui/filter-strip/filter-summary.js +117 -104
  23. package/dist/components/ui/filter-strip/filter-tag-list.js +81 -65
  24. package/dist/components/ui/popover.js +52 -48
  25. package/dist/components/ui/prompt.d.ts +2 -1
  26. package/dist/components/ui/prompt.js +81 -64
  27. package/dist/components/ui/sheet.js +91 -84
  28. package/dist/components/ui/sidebar.js +9 -8
  29. package/dist/components/ui/tabs.d.ts +2 -0
  30. package/dist/components/ui/tabs.js +58 -55
  31. package/dist/components/ui/tag.js +21 -20
  32. package/dist/components/ui/toast.js +41 -37
  33. package/dist/components/ui/tooltip.js +1 -1
  34. package/dist/impact-nova.css +1 -1
  35. package/dist/index.js +250 -248
  36. package/package.json +1 -1
@@ -1,60 +1,61 @@
1
- import { jsx as e, jsxs as N, Fragment as z } from "react/jsx-runtime";
2
- import * as r from "react";
3
- import { cn as p } from "../../lib/utils.js";
4
- import { FileUpload as C, Delete as R, Document as j, Text as k, Csv as T, Excel as B } from "../../icons/index.js";
5
- const U = r.createContext(
1
+ import { jsx as e, jsxs as f, Fragment as j } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import { cn as n } from "../../lib/utils.js";
4
+ import { Cross as T, FileUpload as k, Delete as B, Document as I, Text as L, Csv as M, Excel as A } from "../../icons/index.js";
5
+ import { Tooltip as U, TooltipTrigger as C, TooltipContent as D } from "./tooltip.js";
6
+ const z = o.createContext(
6
7
  void 0
7
- ), D = () => {
8
- const a = r.useContext(U);
8
+ ), R = () => {
9
+ const a = o.useContext(z);
9
10
  if (!a)
10
11
  throw new Error("useFileUpload must be used within a FileUpload component");
11
12
  return a;
12
- }, I = r.forwardRef(
13
+ }, O = o.forwardRef(
13
14
  ({
14
15
  className: a,
15
16
  children: t,
16
17
  onFilesChange: l,
17
- maxFiles: o = 1,
18
- accept: h = [],
19
- disabled: n = !1,
20
- value: f = [],
21
- ...d
22
- }, b) => {
23
- const [m, s] = r.useState(f);
24
- r.useEffect(() => {
25
- s(f);
26
- }, [f]);
27
- const c = (u) => {
28
- if (n) return;
29
- let x = u;
30
- h.length > 0 && (x = x.filter((F) => {
31
- const y = F.name.split(".").pop()?.toLowerCase();
32
- return y && h.includes(y);
18
+ maxFiles: r = 1,
19
+ accept: g = [],
20
+ disabled: d = !1,
21
+ value: m = [],
22
+ ...c
23
+ }, N) => {
24
+ const [u, i] = o.useState(m);
25
+ o.useEffect(() => {
26
+ i(m);
27
+ }, [m]);
28
+ const p = (x) => {
29
+ if (d) return;
30
+ let h = x;
31
+ g.length > 0 && (h = h.filter((b) => {
32
+ const y = b.name.split(".").pop()?.toLowerCase();
33
+ return y && g.includes(y);
33
34
  }));
34
- const v = o - m.length;
35
- if (v <= 0) return;
36
- const w = x.slice(0, v);
35
+ const F = r - u.length;
36
+ if (F <= 0) return;
37
+ const w = h.slice(0, F);
37
38
  if (w.length > 0) {
38
- const F = [...m, ...w];
39
- s(F), l?.(F);
39
+ const b = [...u, ...w];
40
+ i(b), l?.(b);
40
41
  }
41
- }, g = (u) => {
42
- if (n) return;
43
- const x = m.filter((v) => v !== u);
44
- s(x), l?.(x);
42
+ }, v = (x) => {
43
+ if (d) return;
44
+ const h = u.filter((F) => F !== x);
45
+ i(h), l?.(h);
45
46
  };
46
47
  return /* @__PURE__ */ e(
47
- U.Provider,
48
+ z.Provider,
48
49
  {
49
- value: { files: m, addFiles: c, removeFile: g, maxFiles: o, accept: h, disabled: n },
50
+ value: { files: u, addFiles: p, removeFile: v, maxFiles: r, accept: g, disabled: d },
50
51
  children: /* @__PURE__ */ e(
51
52
  "div",
52
53
  {
53
- ref: b,
54
- className: p("w-full max-w-[550px]", a),
54
+ ref: N,
55
+ className: n("w-full max-w-[550px]", a),
55
56
  "data-component": "file-upload",
56
- "data-disabled": n || void 0,
57
- ...d,
57
+ "data-disabled": d || void 0,
58
+ ...c,
58
59
  children: t
59
60
  }
60
61
  )
@@ -62,12 +63,12 @@ const U = r.createContext(
62
63
  );
63
64
  }
64
65
  );
65
- I.displayName = "FileUpload";
66
- const L = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
66
+ O.displayName = "FileUpload";
67
+ const S = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
67
68
  "div",
68
69
  {
69
- ref: o,
70
- className: p(
70
+ ref: r,
71
+ className: n(
71
72
  "flex flex-col gap-4 p-4 min-h-[274px] bg-card border border-border rounded-2xl shadow-[0px_0px_16px_2px_rgba(0,0,0,0.0588)]",
72
73
  a
73
74
  ),
@@ -75,86 +76,101 @@ const L = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__
75
76
  children: t
76
77
  }
77
78
  ));
78
- L.displayName = "FileUploadContent";
79
- const M = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
79
+ S.displayName = "FileUploadContent";
80
+ const _ = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
80
81
  "div",
81
82
  {
82
- ref: o,
83
- className: p("flex justify-between items-center w-full", a),
83
+ ref: r,
84
+ className: n("flex justify-between items-center w-full", a),
84
85
  ...l,
85
86
  children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-[2px] w-full", children: t })
86
87
  }
87
88
  ));
88
- M.displayName = "FileUploadHeader";
89
- const A = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
89
+ _.displayName = "FileUploadHeader";
90
+ const E = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
90
91
  "h3",
91
92
  {
92
- ref: o,
93
- className: p("text-base font-extrabold text-foreground leading-6", a),
93
+ ref: r,
94
+ className: n("text-base font-extrabold text-foreground leading-6", a),
94
95
  ...l,
95
96
  children: t
96
97
  }
97
98
  ));
98
- A.displayName = "FileUploadTitle";
99
- const O = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
99
+ E.displayName = "FileUploadTitle";
100
+ const H = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
100
101
  "p",
101
102
  {
102
- ref: o,
103
- className: p("text-sm font-medium text-[#7a8294] leading-5", a),
103
+ ref: r,
104
+ className: n("text-sm font-medium text-[#7a8294] leading-5", a),
104
105
  ...l,
105
106
  children: t
106
107
  }
107
108
  ));
108
- O.displayName = "FileUploadDescription";
109
- const S = r.forwardRef(
110
- ({ className: a, label: t, subLabel: l, ...o }, h) => {
111
- const { addFiles: n, accept: f, disabled: d, files: b, maxFiles: m } = D(), [s, c] = r.useState(!1), g = r.useRef(null);
112
- if (b.length >= m)
109
+ H.displayName = "FileUploadDescription";
110
+ const P = o.forwardRef(({ className: a, ...t }, l) => /* @__PURE__ */ f(U, { children: [
111
+ /* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e(
112
+ "button",
113
+ {
114
+ ref: l,
115
+ className: n("text-[#60697d] hover:text-[#0d152c] transition-colors", a),
116
+ type: "button",
117
+ "aria-label": "Close",
118
+ ...t,
119
+ children: /* @__PURE__ */ e(T, { size: 16 })
120
+ }
121
+ ) }),
122
+ /* @__PURE__ */ e(D, { side: "top", variant: "tertiary", children: "Close" })
123
+ ] }));
124
+ P.displayName = "FileUploadClose";
125
+ const Z = o.forwardRef(
126
+ ({ className: a, label: t, subLabel: l, ...r }, g) => {
127
+ const { addFiles: d, accept: m, disabled: c, files: N, maxFiles: u } = R(), [i, p] = o.useState(!1), v = o.useRef(null);
128
+ if (N.length >= u)
113
129
  return null;
114
- const u = (i) => {
115
- i.preventDefault(), d || c(!0);
116
- }, x = (i) => {
117
- i.preventDefault(), c(!1);
118
- }, v = (i) => {
119
- i.preventDefault(), c(!1), !d && i.dataTransfer.files?.length && n(Array.from(i.dataTransfer.files));
130
+ const x = (s) => {
131
+ s.preventDefault(), c || p(!0);
132
+ }, h = (s) => {
133
+ s.preventDefault(), p(!1);
134
+ }, F = (s) => {
135
+ s.preventDefault(), p(!1), !c && s.dataTransfer.files?.length && d(Array.from(s.dataTransfer.files));
120
136
  }, w = () => {
121
- d || g.current?.click();
122
- }, F = (i) => {
123
- i.target.files?.length && (n(Array.from(i.target.files)), i.target.value = "");
124
- }, y = f.length > 0 ? f.map((i) => `.${i}`).join(",") : void 0;
125
- return /* @__PURE__ */ N(
137
+ c || v.current?.click();
138
+ }, b = (s) => {
139
+ s.target.files?.length && (d(Array.from(s.target.files)), s.target.value = "");
140
+ }, y = m.length > 0 ? m.map((s) => `.${s}`).join(",") : void 0;
141
+ return /* @__PURE__ */ f(
126
142
  "div",
127
143
  {
128
- ref: h,
144
+ ref: g,
129
145
  onClick: w,
130
- onDragOver: u,
131
- onDragLeave: x,
132
- onDrop: v,
133
- className: p(
146
+ onDragOver: x,
147
+ onDragLeave: h,
148
+ onDrop: F,
149
+ className: n(
134
150
  "relative flex flex-col items-center justify-end p-4 pt-6 pb-6 gap-2 h-[148px] rounded-lg border border-dashed border-[#b3bdf8] bg-transparent cursor-pointer transition-colors",
135
- s && "border-primary bg-primary/5",
136
- d && "opacity-50 cursor-not-allowed",
151
+ i && "border-primary bg-primary/5",
152
+ c && "opacity-50 cursor-not-allowed",
137
153
  a
138
154
  ),
139
155
  "data-component": "file-upload-dropzone",
140
- "data-state": s ? "drag-over" : "idle",
141
- ...o,
156
+ "data-state": i ? "drag-over" : "idle",
157
+ ...r,
142
158
  children: [
143
159
  /* @__PURE__ */ e(
144
160
  "input",
145
161
  {
146
- ref: g,
162
+ ref: v,
147
163
  type: "file",
148
164
  multiple: !0,
149
165
  className: "hidden",
150
166
  accept: y,
151
- onChange: F,
152
- disabled: d
167
+ onChange: b,
168
+ disabled: c
153
169
  }
154
170
  ),
155
- /* @__PURE__ */ e("div", { className: "absolute top-[24px] left-1/2 -translate-x-1/2 pointer-events-none", children: /* @__PURE__ */ e(C, { size: 56 }) }),
156
- /* @__PURE__ */ N("div", { className: "text-center space-y-1 z-10 mt-auto", children: [
157
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-[#1f2b4d] leading-5", children: t || /* @__PURE__ */ N(z, { children: [
171
+ /* @__PURE__ */ e("div", { className: "absolute top-[24px] left-1/2 -translate-x-1/2 pointer-events-none", children: /* @__PURE__ */ e(k, { size: 56 }) }),
172
+ /* @__PURE__ */ f("div", { className: "text-center space-y-1 z-10 mt-auto", children: [
173
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-[#1f2b4d] leading-5", children: t || /* @__PURE__ */ f(j, { children: [
158
174
  "Drag your files here or",
159
175
  " ",
160
176
  /* @__PURE__ */ e("span", { className: "text-primary font-bold hover:underline", children: "Choose File" })
@@ -166,83 +182,91 @@ const S = r.forwardRef(
166
182
  );
167
183
  }
168
184
  );
169
- S.displayName = "FileUploadDropZone";
170
- const _ = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e("div", { ref: o, className: p("flex flex-col gap-3", a), ...l, children: t }));
171
- _.displayName = "FileUploadList";
172
- const E = r.forwardRef(
173
- ({ className: a, file: t, onRemove: l, ...o }, h) => {
174
- const { removeFile: n, disabled: f } = D(), d = (s) => {
175
- s.stopPropagation(), l ? l() : n(t);
176
- }, b = (s) => {
177
- if (s === 0) return "0 B";
178
- const c = 1024, g = ["B", "KB", "MB", "GB"], u = Math.floor(Math.log(s) / Math.log(c));
179
- return parseFloat((s / Math.pow(c, u)).toFixed(2)) + " " + g[u];
180
- }, m = (s) => {
181
- switch (s.split(".").pop()?.toLowerCase()) {
185
+ Z.displayName = "FileUploadDropZone";
186
+ const $ = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e("div", { ref: r, className: n("flex flex-col gap-3", a), ...l, children: t }));
187
+ $.displayName = "FileUploadList";
188
+ const G = o.forwardRef(
189
+ ({ className: a, file: t, onRemove: l, ...r }, g) => {
190
+ const { removeFile: d, disabled: m } = R(), c = (i) => {
191
+ i.stopPropagation(), l ? l() : d(t);
192
+ }, N = (i) => {
193
+ if (i === 0) return "0 B";
194
+ const p = 1024, v = ["B", "KB", "MB", "GB"], x = Math.floor(Math.log(i) / Math.log(p));
195
+ return parseFloat((i / Math.pow(p, x)).toFixed(2)) + " " + v[x];
196
+ }, u = (i) => {
197
+ switch (i.split(".").pop()?.toLowerCase()) {
182
198
  case "xls":
183
199
  case "xlsx":
184
- return /* @__PURE__ */ e(B, { size: 36 });
200
+ return /* @__PURE__ */ e(A, { size: 36 });
185
201
  case "csv":
186
- return /* @__PURE__ */ e(T, { size: 36 });
202
+ return /* @__PURE__ */ e(M, { size: 36 });
187
203
  case "txt":
188
- return /* @__PURE__ */ e(k, { size: 36 });
204
+ return /* @__PURE__ */ e(L, { size: 36 });
189
205
  default:
190
- return /* @__PURE__ */ e(j, { size: 36, className: "text-gray-400" });
206
+ return /* @__PURE__ */ e(I, { size: 36, className: "text-gray-400" });
191
207
  }
192
208
  };
193
209
  return /* @__PURE__ */ e(
194
210
  "div",
195
211
  {
196
- ref: h,
197
- className: p(
212
+ ref: g,
213
+ className: n(
198
214
  "flex flex-col justify-between items-stretch gap-2 p-4 border border-[#e7e7e7] rounded-xl bg-white",
199
215
  a
200
216
  ),
201
217
  "data-component": "file-upload-item",
202
218
  "data-file-name": t.name,
203
219
  "data-file-size": t.size,
204
- ...o,
205
- children: /* @__PURE__ */ N("div", { className: "flex justify-between items-center gap-2 z-10", children: [
206
- /* @__PURE__ */ N("div", { className: "flex gap-2", children: [
207
- /* @__PURE__ */ e("div", { className: "w-9 h-9 shrink-0", children: m(t.name) }),
208
- /* @__PURE__ */ N("div", { className: "flex flex-col justify-between gap-[2px]", children: [
209
- /* @__PURE__ */ e("span", { className: "text-xs font-bold text-[#0b0b0b] leading-[18px] line-clamp-1 break-all", children: t.name }),
210
- /* @__PURE__ */ e("span", { className: "text-xs font-medium text-[#6d6d6d] leading-[16px]", children: b(t.size) })
220
+ ...r,
221
+ children: /* @__PURE__ */ f("div", { className: "flex justify-between items-center gap-2 z-10", children: [
222
+ /* @__PURE__ */ f("div", { className: "flex gap-2 min-w-0", children: [
223
+ /* @__PURE__ */ e("div", { className: "w-9 h-9 shrink-0", children: u(t.name) }),
224
+ /* @__PURE__ */ f("div", { className: "flex flex-col justify-between gap-[2px] min-w-0", children: [
225
+ /* @__PURE__ */ f(U, { children: [
226
+ /* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "text-xs font-bold text-[#0b0b0b] leading-[18px] line-clamp-1 break-all cursor-default", children: t.name }) }),
227
+ /* @__PURE__ */ e(D, { side: "top", variant: "tertiary", children: t.name })
228
+ ] }),
229
+ /* @__PURE__ */ e("span", { className: "text-xs font-medium text-[#6d6d6d] leading-[16px]", children: N(t.size) })
211
230
  ] })
212
231
  ] }),
213
- !f && /* @__PURE__ */ e(
214
- "button",
215
- {
216
- onClick: d,
217
- className: "flex items-center justify-center text-[#60697d] hover:text-destructive transition-colors",
218
- type: "button",
219
- children: /* @__PURE__ */ e(R, { size: 14 })
220
- }
221
- )
232
+ !m && /* @__PURE__ */ f(U, { children: [
233
+ /* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e(
234
+ "button",
235
+ {
236
+ onClick: c,
237
+ className: "flex items-center justify-center text-[#60697d] hover:text-destructive transition-colors",
238
+ type: "button",
239
+ "aria-label": "Remove file",
240
+ children: /* @__PURE__ */ e(B, { size: 14 })
241
+ }
242
+ ) }),
243
+ /* @__PURE__ */ e(D, { side: "top", variant: "tertiary", children: "Remove file" })
244
+ ] })
222
245
  ] })
223
246
  }
224
247
  );
225
248
  }
226
249
  );
227
- E.displayName = "FileUploadItem";
228
- const H = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
250
+ G.displayName = "FileUploadItem";
251
+ const K = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
229
252
  "div",
230
253
  {
231
- ref: o,
232
- className: p("flex items-center justify-end gap-4 mt-auto", a),
254
+ ref: r,
255
+ className: n("flex items-center justify-end gap-4 mt-auto", a),
233
256
  ...l,
234
257
  children: t
235
258
  }
236
259
  ));
237
- H.displayName = "FileUploadFooter";
260
+ K.displayName = "FileUploadFooter";
238
261
  export {
239
- I as FileUpload,
240
- L as FileUploadContent,
241
- O as FileUploadDescription,
242
- S as FileUploadDropZone,
243
- H as FileUploadFooter,
244
- M as FileUploadHeader,
245
- E as FileUploadItem,
246
- _ as FileUploadList,
247
- A as FileUploadTitle
262
+ O as FileUpload,
263
+ P as FileUploadClose,
264
+ S as FileUploadContent,
265
+ H as FileUploadDescription,
266
+ Z as FileUploadDropZone,
267
+ K as FileUploadFooter,
268
+ _ as FileUploadHeader,
269
+ G as FileUploadItem,
270
+ $ as FileUploadList,
271
+ E as FileUploadTitle
248
272
  };
@@ -1,104 +1,123 @@
1
- import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
- import m from "react";
3
- import { Sheet as x, SheetContent as p, SheetDescription as u, SheetTitle as b, SheetClose as g } from "../sheet.js";
4
- import { cn as i } from "../../../lib/utils.js";
5
- import { MultiColorFilter as v, Cross as w, Info as d } from "../../../icons/index.js";
6
- import { Button as N } from "../button.js";
7
- const y = ({ title: l, children: a, className: n }) => /* @__PURE__ */ r("div", { "data-component": "filter-panel-header", className: i("flex shrink-0 flex-row items-center justify-between border-b px-4 py-3 bg-white", n), children: [
8
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
9
- /* @__PURE__ */ e("div", { className: "flex h-6 w-6 items-center justify-center", children: /* @__PURE__ */ e(v, { className: "h-5 w-5" }) }),
10
- /* @__PURE__ */ e(b, { className: "text-lg font-bold text-[#1f2b4d]", children: l })
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import u from "react";
3
+ import { Sheet as b, SheetContent as v, SheetDescription as g, SheetTitle as w, SheetClose as y } from "../sheet.js";
4
+ import { cn as n } from "../../../lib/utils.js";
5
+ import { MultiColorFilter as N, Cross as C, Info as p } from "../../../icons/index.js";
6
+ import { Button as F } from "../button.js";
7
+ import { Tooltip as c, TooltipTrigger as o, TooltipContent as d } from "../tooltip.js";
8
+ const j = ({ title: a, children: l, className: i }) => /* @__PURE__ */ t("div", { "data-component": "filter-panel-header", className: n("flex shrink-0 flex-row items-center justify-between border-b px-4 py-3 bg-white", i), children: [
9
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
10
+ /* @__PURE__ */ e("div", { className: "flex h-6 w-6 items-center justify-center", children: /* @__PURE__ */ e(N, { className: "h-5 w-5" }) }),
11
+ /* @__PURE__ */ e(w, { className: "text-lg font-bold text-[#1f2b4d]", children: a })
11
12
  ] }),
12
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
13
- a,
14
- /* @__PURE__ */ e(g, { asChild: !0, children: /* @__PURE__ */ e(N, { variant: "secondary", size: "icon", "aria-label": "Close", "data-component": "filter-panel-close", children: /* @__PURE__ */ e(w, { className: "h-3 w-3" }) }) })
13
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
14
+ l,
15
+ /* @__PURE__ */ e(y, { asChild: !0, children: /* @__PURE__ */ e(F, { variant: "secondary", size: "icon", "aria-label": "Close", "data-component": "filter-panel-close", children: /* @__PURE__ */ e(C, { className: "h-3 w-3" }) }) })
15
16
  ] })
16
- ] }), D = ({
17
- open: l,
18
- onOpenChange: a,
19
- title: n = "Filter panel",
20
- children: c,
21
- header: t,
17
+ ] }), E = ({
18
+ open: a,
19
+ onOpenChange: l,
20
+ title: i = "Filter panel",
21
+ children: h,
22
+ header: r,
22
23
  sidebar: s,
23
- className: h,
24
- preventClose: f = !1
25
- }) => /* @__PURE__ */ e(x, { open: l, onOpenChange: a, children: /* @__PURE__ */ r(
26
- p,
24
+ className: x,
25
+ preventClose: m = !1
26
+ }) => /* @__PURE__ */ e(b, { open: a, onOpenChange: l, children: /* @__PURE__ */ t(
27
+ v,
27
28
  {
28
29
  side: "right",
29
- className: i(
30
+ className: n(
30
31
  "w-full !max-w-[840px] p-0 sm:!max-w-[840px] gap-0 border-l shadow-xl transition-all duration-300 ease-in-out bg-white",
31
- h
32
+ x
32
33
  ),
33
- onInteractOutside: (o) => {
34
- f && o.preventDefault();
34
+ onInteractOutside: (f) => {
35
+ m && f.preventDefault();
35
36
  },
36
- onEscapeKeyDown: (o) => {
37
- f && o.preventDefault();
37
+ onEscapeKeyDown: (f) => {
38
+ m && f.preventDefault();
38
39
  },
39
40
  children: [
40
- /* @__PURE__ */ e(u, { className: "sr-only", children: "Select filters to apply to the current view." }),
41
- /* @__PURE__ */ r("div", { className: "flex h-full flex-col bg-white", children: [
42
- t || /* @__PURE__ */ e(y, { title: n }),
43
- /* @__PURE__ */ r("div", { className: "flex flex-1 overflow-hidden", children: [
41
+ /* @__PURE__ */ e(g, { className: "sr-only", children: "Select filters to apply to the current view." }),
42
+ /* @__PURE__ */ t("div", { className: "flex h-full flex-col bg-white", children: [
43
+ r || /* @__PURE__ */ e(j, { title: i }),
44
+ /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: [
44
45
  s,
45
- /* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-hidden", children: c })
46
+ /* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-hidden", children: h })
46
47
  ] })
47
48
  ] })
48
49
  ]
49
50
  }
50
- ) }), I = ({
51
- items: l,
52
- activeTab: a,
53
- onTabChange: n,
54
- className: c
55
- }) => /* @__PURE__ */ e("div", { "data-component": "filter-panel-sidebar", className: i("flex w-[200px] shrink-0 flex-col border-r bg-sidebar-light", c), children: /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col py-2 gap-1 overflow-y-auto", children: l.map((t) => {
56
- const s = a === t.id;
57
- return /* @__PURE__ */ r(m.Fragment, { children: [
58
- t.separator && /* @__PURE__ */ e("div", { className: "my-2 h-px bg-gray-200" }),
59
- /* @__PURE__ */ r(
51
+ ) }), M = ({
52
+ items: a,
53
+ activeTab: l,
54
+ onTabChange: i,
55
+ className: h
56
+ }) => /* @__PURE__ */ e("div", { "data-component": "filter-panel-sidebar", className: n("flex w-[200px] shrink-0 flex-col border-r bg-sidebar-light", h), children: /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col py-2 gap-1 overflow-y-auto", children: a.map((r) => {
57
+ const s = l === r.id;
58
+ return /* @__PURE__ */ t(u.Fragment, { children: [
59
+ r.separator && /* @__PURE__ */ e("div", { className: "my-2 h-px bg-gray-200" }),
60
+ /* @__PURE__ */ t(
60
61
  "button",
61
62
  {
62
- onClick: () => n(t.id),
63
+ onClick: () => i(r.id),
63
64
  "data-component": "filter-panel-sidebar-item",
64
65
  "data-active": s ? "true" : "false",
65
- "data-tab": t.id,
66
- className: i(
66
+ "data-tab": r.id,
67
+ className: n(
67
68
  "group flex items-center justify-between px-3 py-[6px] mx-2 rounded-lg text-left text-sm font-medium transition-colors",
68
69
  s ? "bg-active-blue text-primary" : "text-text-secondary hover:bg-active-blue"
69
70
  ),
70
71
  children: [
71
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
72
- /* @__PURE__ */ e("span", { className: i(
72
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
73
+ /* @__PURE__ */ e("span", { className: n(
73
74
  "shrink-0",
74
75
  s ? "text-primary" : "text-text-secondary"
75
- ), children: t.icon }),
76
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1 min-w-0", children: [
77
- /* @__PURE__ */ e("span", { className: "truncate font-['Manrope']", children: t.label }),
78
- t.isRequired && /* @__PURE__ */ e("span", { className: "shrink-0 text-error", children: "*" })
76
+ ), children: r.icon }),
77
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-1 min-w-0", children: [
78
+ /* @__PURE__ */ t(c, { children: [
79
+ /* @__PURE__ */ e(o, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "truncate font-['Manrope']", children: r.label }) }),
80
+ /* @__PURE__ */ e(d, { variant: "tertiary", side: "right", children: r.label })
81
+ ] }),
82
+ r.isRequired && /* @__PURE__ */ e("span", { className: "shrink-0 text-error", children: "*" })
79
83
  ] })
80
84
  ] }),
81
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1 shrink-0 ml-1", children: [
82
- t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e("span", { className: i(
83
- "flex h-5 items-center justify-center rounded-full px-2 text-[11px]",
84
- s ? "bg-white text-[#4259ee] border border-gray-100" : "bg-white border border-gray-100"
85
- ), children: t.count }),
86
- t.hasError && /* @__PURE__ */ e(d, { className: "h-4 w-4 text-destructive" }),
87
- t.hasWarning && /* @__PURE__ */ e(d, { className: "h-4 w-4 text-warning" }),
88
- t.hasInfo && /* @__PURE__ */ e(d, { className: "h-4 w-4 text-icon-gray" })
85
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-1 shrink-0 ml-1", children: [
86
+ r.count !== void 0 && r.count > 0 && /* @__PURE__ */ t(c, { children: [
87
+ /* @__PURE__ */ e(o, { asChild: !0, children: /* @__PURE__ */ e("span", { className: n(
88
+ "flex h-5 items-center justify-center rounded-full px-2 text-[11px]",
89
+ s ? "bg-white text-[#4259ee] border border-gray-100" : "bg-white border border-gray-100"
90
+ ), children: r.count }) }),
91
+ /* @__PURE__ */ t(d, { variant: "tertiary", side: "top", children: [
92
+ r.count,
93
+ " filters applied"
94
+ ] })
95
+ ] }),
96
+ r.hasError && /* @__PURE__ */ t(c, { children: [
97
+ /* @__PURE__ */ e(o, { asChild: !0, children: /* @__PURE__ */ e(p, { className: "h-4 w-4 text-error" }) }),
98
+ /* @__PURE__ */ e(d, { variant: "tertiary", children: "This tab contains errors" })
99
+ ] }),
100
+ r.hasWarning && /* @__PURE__ */ t(c, { children: [
101
+ /* @__PURE__ */ e(o, { asChild: !0, children: /* @__PURE__ */ e(p, { className: "h-4 w-4 text-warning" }) }),
102
+ /* @__PURE__ */ e(d, { variant: "tertiary", children: "This tab has warnings" })
103
+ ] }),
104
+ r.hasInfo && /* @__PURE__ */ t(c, { children: [
105
+ /* @__PURE__ */ e(o, { asChild: !0, children: /* @__PURE__ */ e(p, { className: "h-4 w-4 text-icon-gray" }) }),
106
+ /* @__PURE__ */ e(d, { variant: "tertiary", children: "Additional information available" })
107
+ ] })
89
108
  ] })
90
109
  ]
91
110
  }
92
111
  )
93
- ] }, t.id);
94
- }) }) }), B = ({ children: l, className: a }) => /* @__PURE__ */ e("div", { "data-component": "filter-panel-body", className: i("flex flex-1 flex-col overflow-auto bg-white p-4", a), children: l }), E = ({ children: l, className: a, leftAction: n }) => /* @__PURE__ */ r("div", { "data-component": "filter-panel-footer", className: i("flex items-center justify-between border-t bg-white px-4 py-3 shrink-0", a), children: [
95
- /* @__PURE__ */ e("div", { children: n && n }),
96
- /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: l })
112
+ ] }, r.id);
113
+ }) }) }), R = ({ children: a, className: l }) => /* @__PURE__ */ e("div", { "data-component": "filter-panel-body", className: n("flex flex-1 flex-col overflow-auto bg-white p-4", l), children: a }), _ = ({ children: a, className: l, leftAction: i }) => /* @__PURE__ */ t("div", { "data-component": "filter-panel-footer", className: n("flex items-center justify-between border-t bg-white px-4 py-3 shrink-0", l), children: [
114
+ /* @__PURE__ */ e("div", { children: i && i }),
115
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: a })
97
116
  ] });
98
117
  export {
99
- D as FilterPanel,
100
- B as FilterPanelBody,
101
- E as FilterPanelFooter,
102
- y as FilterPanelHeader,
103
- I as FilterPanelSidebar
118
+ E as FilterPanel,
119
+ R as FilterPanelBody,
120
+ _ as FilterPanelFooter,
121
+ j as FilterPanelHeader,
122
+ M as FilterPanelSidebar
104
123
  };