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.
- package/dist/components/ui/accordion.js +37 -33
- package/dist/components/ui/alert.d.ts +2 -0
- package/dist/components/ui/alert.js +46 -31
- package/dist/components/ui/breadcrumb.d.ts +7 -2
- package/dist/components/ui/breadcrumb.js +98 -77
- package/dist/components/ui/calendar.js +198 -178
- package/dist/components/ui/date-picker/date-picker.js +94 -87
- package/dist/components/ui/date-picker/date-range-picker.js +124 -117
- package/dist/components/ui/date-picker/month-picker.js +98 -91
- package/dist/components/ui/date-picker/month-range-picker.js +118 -111
- package/dist/components/ui/date-picker/multi-date-picker.js +76 -69
- package/dist/components/ui/date-picker/multi-month-picker.js +72 -65
- package/dist/components/ui/date-picker/multi-week-picker.js +88 -81
- package/dist/components/ui/date-picker/week-picker.js +107 -100
- package/dist/components/ui/date-picker/week-range-picker.js +144 -137
- package/dist/components/ui/dialog.js +65 -61
- package/dist/components/ui/drawer.d.ts +3 -1
- package/dist/components/ui/drawer.js +44 -29
- package/dist/components/ui/file-upload.d.ts +2 -1
- package/dist/components/ui/file-upload.js +159 -135
- package/dist/components/ui/filter-panel/filter-panel.js +89 -70
- package/dist/components/ui/filter-strip/filter-summary.js +117 -104
- package/dist/components/ui/filter-strip/filter-tag-list.js +81 -65
- package/dist/components/ui/popover.js +52 -48
- package/dist/components/ui/prompt.d.ts +2 -1
- package/dist/components/ui/prompt.js +81 -64
- package/dist/components/ui/sheet.js +91 -84
- package/dist/components/ui/sidebar.js +9 -8
- package/dist/components/ui/tabs.d.ts +2 -0
- package/dist/components/ui/tabs.js +58 -55
- package/dist/components/ui/tag.js +21 -20
- package/dist/components/ui/toast.js +41 -37
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +250 -248
- package/package.json +1 -1
|
@@ -1,60 +1,61 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { FileUpload as
|
|
5
|
-
|
|
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
|
-
),
|
|
8
|
-
const a =
|
|
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
|
-
},
|
|
13
|
+
}, O = o.forwardRef(
|
|
13
14
|
({
|
|
14
15
|
className: a,
|
|
15
16
|
children: t,
|
|
16
17
|
onFilesChange: l,
|
|
17
|
-
maxFiles:
|
|
18
|
-
accept:
|
|
19
|
-
disabled:
|
|
20
|
-
value:
|
|
21
|
-
...
|
|
22
|
-
},
|
|
23
|
-
const [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
const y =
|
|
32
|
-
return 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
|
|
35
|
-
if (
|
|
36
|
-
const w =
|
|
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
|
|
39
|
-
|
|
39
|
+
const b = [...u, ...w];
|
|
40
|
+
i(b), l?.(b);
|
|
40
41
|
}
|
|
41
|
-
},
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
|
|
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
|
-
|
|
48
|
+
z.Provider,
|
|
48
49
|
{
|
|
49
|
-
value: { files:
|
|
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:
|
|
54
|
-
className:
|
|
54
|
+
ref: N,
|
|
55
|
+
className: n("w-full max-w-[550px]", a),
|
|
55
56
|
"data-component": "file-upload",
|
|
56
|
-
"data-disabled":
|
|
57
|
-
...
|
|
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
|
-
|
|
66
|
-
const
|
|
66
|
+
O.displayName = "FileUpload";
|
|
67
|
+
const S = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
|
|
67
68
|
"div",
|
|
68
69
|
{
|
|
69
|
-
ref:
|
|
70
|
-
className:
|
|
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
|
-
|
|
79
|
-
const
|
|
79
|
+
S.displayName = "FileUploadContent";
|
|
80
|
+
const _ = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
|
|
80
81
|
"div",
|
|
81
82
|
{
|
|
82
|
-
ref:
|
|
83
|
-
className:
|
|
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
|
-
|
|
89
|
-
const
|
|
89
|
+
_.displayName = "FileUploadHeader";
|
|
90
|
+
const E = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
|
|
90
91
|
"h3",
|
|
91
92
|
{
|
|
92
|
-
ref:
|
|
93
|
-
className:
|
|
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
|
-
|
|
99
|
-
const
|
|
99
|
+
E.displayName = "FileUploadTitle";
|
|
100
|
+
const H = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
|
|
100
101
|
"p",
|
|
101
102
|
{
|
|
102
|
-
ref:
|
|
103
|
-
className:
|
|
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
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
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
|
-
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
}, y =
|
|
125
|
-
return /* @__PURE__ */
|
|
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:
|
|
144
|
+
ref: g,
|
|
129
145
|
onClick: w,
|
|
130
|
-
onDragOver:
|
|
131
|
-
onDragLeave:
|
|
132
|
-
onDrop:
|
|
133
|
-
className:
|
|
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
|
-
|
|
136
|
-
|
|
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":
|
|
141
|
-
...
|
|
156
|
+
"data-state": i ? "drag-over" : "idle",
|
|
157
|
+
...r,
|
|
142
158
|
children: [
|
|
143
159
|
/* @__PURE__ */ e(
|
|
144
160
|
"input",
|
|
145
161
|
{
|
|
146
|
-
ref:
|
|
162
|
+
ref: v,
|
|
147
163
|
type: "file",
|
|
148
164
|
multiple: !0,
|
|
149
165
|
className: "hidden",
|
|
150
166
|
accept: y,
|
|
151
|
-
onChange:
|
|
152
|
-
disabled:
|
|
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(
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-[#1f2b4d] leading-5", children: t || /* @__PURE__ */
|
|
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
|
-
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
({ className: a, file: t, onRemove: l, ...
|
|
174
|
-
const { removeFile:
|
|
175
|
-
|
|
176
|
-
},
|
|
177
|
-
if (
|
|
178
|
-
const
|
|
179
|
-
return parseFloat((
|
|
180
|
-
},
|
|
181
|
-
switch (
|
|
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(
|
|
200
|
+
return /* @__PURE__ */ e(A, { size: 36 });
|
|
185
201
|
case "csv":
|
|
186
|
-
return /* @__PURE__ */ e(
|
|
202
|
+
return /* @__PURE__ */ e(M, { size: 36 });
|
|
187
203
|
case "txt":
|
|
188
|
-
return /* @__PURE__ */ e(
|
|
204
|
+
return /* @__PURE__ */ e(L, { size: 36 });
|
|
189
205
|
default:
|
|
190
|
-
return /* @__PURE__ */ e(
|
|
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:
|
|
197
|
-
className:
|
|
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
|
-
...
|
|
205
|
-
children: /* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
/* @__PURE__ */ e("div", { className: "w-9 h-9 shrink-0", children:
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
|
|
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
|
-
!
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
|
|
228
|
-
const
|
|
250
|
+
G.displayName = "FileUploadItem";
|
|
251
|
+
const K = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
|
|
229
252
|
"div",
|
|
230
253
|
{
|
|
231
|
-
ref:
|
|
232
|
-
className:
|
|
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
|
-
|
|
260
|
+
K.displayName = "FileUploadFooter";
|
|
238
261
|
export {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { Sheet as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { MultiColorFilter as
|
|
6
|
-
import { Button as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/* @__PURE__ */ e(
|
|
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__ */
|
|
13
|
-
|
|
14
|
-
/* @__PURE__ */ e(
|
|
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
|
-
] }),
|
|
17
|
-
open:
|
|
18
|
-
onOpenChange:
|
|
19
|
-
title:
|
|
20
|
-
children:
|
|
21
|
-
header:
|
|
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:
|
|
24
|
-
preventClose:
|
|
25
|
-
}) => /* @__PURE__ */ e(
|
|
26
|
-
|
|
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:
|
|
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
|
-
|
|
32
|
+
x
|
|
32
33
|
),
|
|
33
|
-
onInteractOutside: (
|
|
34
|
-
|
|
34
|
+
onInteractOutside: (f) => {
|
|
35
|
+
m && f.preventDefault();
|
|
35
36
|
},
|
|
36
|
-
onEscapeKeyDown: (
|
|
37
|
-
|
|
37
|
+
onEscapeKeyDown: (f) => {
|
|
38
|
+
m && f.preventDefault();
|
|
38
39
|
},
|
|
39
40
|
children: [
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */
|
|
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:
|
|
46
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-hidden", children: h })
|
|
46
47
|
] })
|
|
47
48
|
] })
|
|
48
49
|
]
|
|
49
50
|
}
|
|
50
|
-
) }),
|
|
51
|
-
items:
|
|
52
|
-
activeTab:
|
|
53
|
-
onTabChange:
|
|
54
|
-
className:
|
|
55
|
-
}) => /* @__PURE__ */ e("div", { "data-component": "filter-panel-sidebar", className:
|
|
56
|
-
const s =
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */
|
|
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: () =>
|
|
63
|
+
onClick: () => i(r.id),
|
|
63
64
|
"data-component": "filter-panel-sidebar-item",
|
|
64
65
|
"data-active": s ? "true" : "false",
|
|
65
|
-
"data-tab":
|
|
66
|
-
className:
|
|
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__ */
|
|
72
|
-
/* @__PURE__ */ e("span", { className:
|
|
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:
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
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__ */
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
] },
|
|
94
|
-
}) }) }),
|
|
95
|
-
/* @__PURE__ */ e("div", { children:
|
|
96
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-3", children:
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
118
|
+
E as FilterPanel,
|
|
119
|
+
R as FilterPanelBody,
|
|
120
|
+
_ as FilterPanelFooter,
|
|
121
|
+
j as FilterPanelHeader,
|
|
122
|
+
M as FilterPanelSidebar
|
|
104
123
|
};
|