impact-nova 1.5.14 → 1.6.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.
- package/dist/components/ui/accordion.d.ts +4 -1
- package/dist/components/ui/accordion.js +28 -22
- package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +11 -11
- package/dist/components/ui/ag-grid-react/cell-renderers/checkbox-display-renderer.js +12 -12
- package/dist/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +30 -30
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/percent-progress-cell-editor.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +16 -16
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/textarea-cell-editor.js +17 -17
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +11 -11
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +2 -2
- package/dist/components/ui/ag-grid-react/cell-renderers/percent-progress-display-renderer.js +11 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/select-display-renderer.js +8 -8
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +6 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/status-badge-renderer.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/status-badge-renderer.js +14 -14
- package/dist/components/ui/ag-grid-react/cell-renderers/switch-display-renderer.js +18 -18
- package/dist/components/ui/ag-grid-react/cell-renderers/textarea-display-renderer.js +6 -6
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +14 -14
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +35 -35
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +49 -49
- package/dist/components/ui/ag-grid-react/headers/components/header-info.js +29 -29
- package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +9 -9
- package/dist/components/ui/ag-grid-react/headers/components/section-renderers.js +20 -20
- package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +10 -10
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +76 -76
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +118 -118
- package/dist/components/ui/ag-grid-react/index.js +121 -102
- package/dist/components/ui/alert-dialog.js +6 -6
- package/dist/components/ui/alert.d.ts +4 -3
- package/dist/components/ui/alert.js +182 -64
- package/dist/components/ui/avatar.js +5 -5
- package/dist/components/ui/badge.d.ts +7 -2
- package/dist/components/ui/badge.js +105 -32
- package/dist/components/ui/breadcrumb.js +26 -21
- package/dist/components/ui/button-group.d.ts +7 -0
- package/dist/components/ui/button-group.js +116 -91
- package/dist/components/ui/button-variants.d.ts +7 -2
- package/dist/components/ui/button-variants.js +31 -16
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/button.js +10 -10
- package/dist/components/ui/calendar.js +185 -184
- package/dist/components/ui/card.js +24 -24
- package/dist/components/ui/chart/chart.js +27 -27
- package/dist/components/ui/chart/chart.utils.js +50 -50
- package/dist/components/ui/checkbox.js +22 -22
- package/dist/components/ui/chips.d.ts +19 -3
- package/dist/components/ui/chips.js +140 -41
- package/dist/components/ui/command-palette/command-palette-layout.d.ts +28 -0
- package/dist/components/ui/command-palette/command-palette-layout.js +59 -0
- package/dist/components/ui/command-palette/command-palette.js +254 -264
- package/dist/components/ui/command-palette/index.d.ts +1 -1
- package/dist/components/ui/command-palette/index.js +42 -41
- package/dist/components/ui/command-palette/kbd.js +18 -18
- package/dist/components/ui/command-palette/shortcut-settings.d.ts +3 -3
- package/dist/components/ui/command-palette/shortcut-settings.js +105 -111
- package/dist/components/ui/command-palette/utils.d.ts +6 -1
- package/dist/components/ui/command-palette/utils.js +81 -74
- package/dist/components/ui/data-table/data-table-column-list.js +31 -31
- package/dist/components/ui/data-table/data-table-constants.d.ts +6 -0
- package/dist/components/ui/data-table/data-table-constants.js +4 -0
- package/dist/components/ui/data-table/data-table-context.d.ts +4 -0
- package/dist/components/ui/data-table/data-table-format-options.js +35 -35
- package/dist/components/ui/data-table/data-table-sheet.d.ts +4 -4
- package/dist/components/ui/data-table/data-table-sheet.js +91 -58
- package/dist/components/ui/data-table/data-table-view-options.js +29 -29
- package/dist/components/ui/data-table/data-table.js +84 -52
- package/dist/components/ui/data-table/index.d.ts +1 -0
- package/dist/components/ui/data-table/index.js +15 -13
- package/dist/components/ui/date-picker/date-picker.js +35 -35
- package/dist/components/ui/date-picker/date-range-picker.js +166 -164
- package/dist/components/ui/date-picker/month-picker.js +14 -14
- package/dist/components/ui/date-picker/month-range-picker.js +198 -189
- package/dist/components/ui/date-picker/multi-date-picker.js +14 -14
- package/dist/components/ui/date-picker/multi-month-picker.js +1 -1
- package/dist/components/ui/date-picker/multi-week-picker.js +1 -1
- package/dist/components/ui/date-picker/week-picker.js +2 -2
- package/dist/components/ui/date-picker/week-range-picker.js +164 -162
- package/dist/components/ui/dialog.js +25 -28
- package/dist/components/ui/drawer.js +40 -40
- package/dist/components/ui/dropdown-menu.js +72 -72
- package/dist/components/ui/empty-container.js +73 -69
- package/dist/components/ui/file-upload.js +137 -135
- package/dist/components/ui/filter-panel/filter-panel.d.ts +2 -2
- package/dist/components/ui/filter-panel/filter-panel.js +175 -97
- package/dist/components/ui/filter-strip/filter-strip.d.ts +1 -1
- package/dist/components/ui/filter-strip/filter-strip.js +63 -50
- package/dist/components/ui/filter-strip/filter-summary.d.ts +4 -1
- package/dist/components/ui/filter-strip/filter-summary.js +230 -146
- package/dist/components/ui/filter-strip/filter-tag-list.js +125 -91
- package/dist/components/ui/header.d.ts +7 -3
- package/dist/components/ui/header.js +87 -79
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +44 -44
- package/dist/components/ui/hover-card.js +10 -10
- package/dist/components/ui/input.js +79 -70
- package/dist/components/ui/loader.js +16 -16
- package/dist/components/ui/nested-list/components/NestedListCategoryFilters.js +16 -16
- package/dist/components/ui/nested-list/components/NestedListHeader.js +27 -27
- package/dist/components/ui/nested-list/components/SortableItem.js +58 -58
- package/dist/components/ui/notification-panel/notification-item.js +32 -32
- package/dist/components/ui/notification-panel/notification-list.js +24 -24
- package/dist/components/ui/notification-panel/notification-panel.js +26 -26
- package/dist/components/ui/popover.js +22 -22
- package/dist/components/ui/progress.js +34 -34
- package/dist/components/ui/prompt.js +48 -48
- package/dist/components/ui/radio-group.js +63 -54
- package/dist/components/ui/select/components/LabelWithSequence.js +6 -6
- package/dist/components/ui/select/components/Submenu.js +33 -33
- package/dist/components/ui/select/select.js +425 -376
- package/dist/components/ui/sheet.js +88 -66
- package/dist/components/ui/sidebar.js +342 -296
- package/dist/components/ui/skeleton.js +6 -6
- package/dist/components/ui/slider.js +17 -17
- package/dist/components/ui/statistics-card.d.ts +86 -0
- package/dist/components/ui/statistics-card.hooks.d.ts +150 -0
- package/dist/components/ui/statistics-card.hooks.js +100 -0
- package/dist/components/ui/statistics-card.js +259 -0
- package/dist/components/ui/stepper.js +51 -51
- package/dist/components/ui/switch.js +7 -7
- package/dist/components/ui/tabs.js +70 -70
- package/dist/components/ui/tag-group.d.ts +1 -0
- package/dist/components/ui/tag-group.js +14 -13
- package/dist/components/ui/tag.js +43 -43
- package/dist/components/ui/textarea.js +86 -58
- package/dist/components/ui/toast.js +39 -39
- package/dist/components/ui/tooltip.js +23 -23
- package/dist/components/ui/types/date-picker.types.d.ts +1 -0
- package/dist/components/ui/types/filter-panel.types.d.ts +3 -0
- package/dist/components/ui/types/filter-strip.types.d.ts +14 -0
- package/dist/components/ui/types/horizontal-scroller.types.d.ts +1 -1
- package/dist/components/ui/types/statistics-card.types.d.ts +1 -0
- package/dist/i18n/defaultMessages.d.ts +8 -0
- package/dist/i18n/defaultMessages.js +15 -9
- package/dist/i18n/locales/de.js +7 -1
- package/dist/i18n/locales/es.js +7 -1
- package/dist/i18n/locales/hi.js +7 -1
- package/dist/i18n/locales/kn.js +7 -1
- package/dist/icons/assets/bulk-edit.svg.js +5 -0
- package/dist/icons/assets/clock.svg.js +5 -0
- package/dist/icons/assets/statistics.svg.js +5 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.js +254 -206
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +361 -347
- package/package.json +3 -2
- package/tailwind.config.js +259 -152
- /package/dist/icons/assets/{PivotMode.svg.js → pivotMode.svg.js} +0 -0
|
@@ -1,58 +1,56 @@
|
|
|
1
1
|
import { jsx as e, jsxs as m, Fragment as T } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as n from "react";
|
|
3
3
|
import { cn as p } from "../../lib/utils.js";
|
|
4
4
|
import { Cross as k, FileUpload as I, Delete as L, Document as B, Text as M, Csv as A, Excel as O } from "../../icons/index.js";
|
|
5
5
|
import { Tooltip as U, TooltipTrigger as C, TooltipContent as D } from "./tooltip.js";
|
|
6
6
|
import { useImpactNovaI18n as z } from "../../i18n/ImpactNovaI18nContext.js";
|
|
7
|
-
const R =
|
|
8
|
-
|
|
9
|
-
), j = () => {
|
|
10
|
-
const a = o.useContext(R);
|
|
7
|
+
const R = n.createContext(void 0), j = () => {
|
|
8
|
+
const a = n.useContext(R);
|
|
11
9
|
if (!a)
|
|
12
10
|
throw new Error("useFileUpload must be used within a FileUpload component");
|
|
13
11
|
return a;
|
|
14
|
-
}, S =
|
|
12
|
+
}, S = n.forwardRef(
|
|
15
13
|
({
|
|
16
14
|
className: a,
|
|
17
15
|
children: t,
|
|
18
16
|
onFilesChange: l,
|
|
19
|
-
maxFiles:
|
|
17
|
+
maxFiles: o = 1,
|
|
20
18
|
accept: d = [],
|
|
21
19
|
disabled: c = !1,
|
|
22
20
|
value: u = [],
|
|
23
21
|
...f
|
|
24
|
-
},
|
|
25
|
-
const [x, h] =
|
|
26
|
-
|
|
22
|
+
}, w) => {
|
|
23
|
+
const [x, h] = n.useState(u);
|
|
24
|
+
n.useEffect(() => {
|
|
27
25
|
h(u);
|
|
28
26
|
}, [u]);
|
|
29
|
-
const
|
|
27
|
+
const r = (g) => {
|
|
30
28
|
if (c) return;
|
|
31
|
-
let
|
|
32
|
-
d.length > 0 && (
|
|
33
|
-
const y =
|
|
29
|
+
let s = g;
|
|
30
|
+
d.length > 0 && (s = s.filter((N) => {
|
|
31
|
+
const y = N.name.split(".").pop()?.toLowerCase();
|
|
34
32
|
return y && d.includes(y);
|
|
35
33
|
}));
|
|
36
|
-
const F =
|
|
34
|
+
const F = o - x.length;
|
|
37
35
|
if (F <= 0) return;
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
const
|
|
41
|
-
h(
|
|
36
|
+
const b = s.slice(0, F);
|
|
37
|
+
if (b.length > 0) {
|
|
38
|
+
const N = [...x, ...b];
|
|
39
|
+
h(N), l?.(N);
|
|
42
40
|
}
|
|
43
|
-
},
|
|
41
|
+
}, v = (g) => {
|
|
44
42
|
if (c) return;
|
|
45
|
-
const
|
|
46
|
-
h(
|
|
43
|
+
const s = x.filter((F) => F !== g);
|
|
44
|
+
h(s), l?.(s);
|
|
47
45
|
};
|
|
48
46
|
return /* @__PURE__ */ e(
|
|
49
47
|
R.Provider,
|
|
50
48
|
{
|
|
51
|
-
value: { files: x, addFiles:
|
|
49
|
+
value: { files: x, addFiles: r, removeFile: v, maxFiles: o, accept: d, disabled: c },
|
|
52
50
|
children: /* @__PURE__ */ e(
|
|
53
51
|
"div",
|
|
54
52
|
{
|
|
55
|
-
ref:
|
|
53
|
+
ref: w,
|
|
56
54
|
className: p("w-full max-w-[550px]", a),
|
|
57
55
|
"data-component": "file-upload",
|
|
58
56
|
"data-disabled": c || void 0,
|
|
@@ -65,57 +63,63 @@ const R = o.createContext(
|
|
|
65
63
|
}
|
|
66
64
|
);
|
|
67
65
|
S.displayName = "FileUpload";
|
|
68
|
-
const
|
|
66
|
+
const E = n.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
|
|
69
67
|
"div",
|
|
70
68
|
{
|
|
71
|
-
ref:
|
|
69
|
+
ref: o,
|
|
72
70
|
className: p(
|
|
73
|
-
"flex flex-col gap-4 p-4 min-h-[274px] bg-
|
|
71
|
+
"flex flex-col gap-4 p-4 min-h-[274px] bg-canvas-elevated rounded-2xl shadow-elevation-header",
|
|
74
72
|
a
|
|
75
73
|
),
|
|
76
74
|
...l,
|
|
77
75
|
children: t
|
|
78
76
|
}
|
|
79
77
|
));
|
|
80
|
-
|
|
81
|
-
const
|
|
78
|
+
E.displayName = "FileUploadContent";
|
|
79
|
+
const H = n.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
|
|
82
80
|
"div",
|
|
83
81
|
{
|
|
84
|
-
ref:
|
|
82
|
+
ref: o,
|
|
85
83
|
className: p("flex justify-between items-center w-full", a),
|
|
86
84
|
...l,
|
|
87
85
|
children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-[2px] w-full", children: t })
|
|
88
86
|
}
|
|
89
87
|
));
|
|
90
|
-
|
|
91
|
-
const
|
|
88
|
+
H.displayName = "FileUploadHeader";
|
|
89
|
+
const P = n.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
|
|
92
90
|
"h3",
|
|
93
91
|
{
|
|
94
|
-
ref:
|
|
95
|
-
className: p("text-base font-extrabold text-
|
|
92
|
+
ref: o,
|
|
93
|
+
className: p("text-base font-extrabold text-content leading-6", a),
|
|
96
94
|
...l,
|
|
97
95
|
children: t
|
|
98
96
|
}
|
|
99
97
|
));
|
|
100
|
-
|
|
101
|
-
const
|
|
98
|
+
P.displayName = "FileUploadTitle";
|
|
99
|
+
const Z = n.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
|
|
102
100
|
"p",
|
|
103
101
|
{
|
|
104
|
-
ref:
|
|
105
|
-
className: p(
|
|
102
|
+
ref: o,
|
|
103
|
+
className: p(
|
|
104
|
+
"text-sm font-medium text-navigation-muted leading-5",
|
|
105
|
+
a
|
|
106
|
+
),
|
|
106
107
|
...l,
|
|
107
108
|
children: t
|
|
108
109
|
}
|
|
109
110
|
));
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
const { t:
|
|
111
|
+
Z.displayName = "FileUploadDescription";
|
|
112
|
+
const $ = n.forwardRef(({ className: a, ...t }, l) => {
|
|
113
|
+
const { t: o } = z(), d = o("aria.close");
|
|
113
114
|
return /* @__PURE__ */ m(U, { children: [
|
|
114
115
|
/* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e(
|
|
115
116
|
"button",
|
|
116
117
|
{
|
|
117
118
|
ref: l,
|
|
118
|
-
className: p(
|
|
119
|
+
className: p(
|
|
120
|
+
"text-content-tertiary hover:text-content transition-colors",
|
|
121
|
+
a
|
|
122
|
+
),
|
|
119
123
|
type: "button",
|
|
120
124
|
"aria-label": d,
|
|
121
125
|
...t,
|
|
@@ -125,80 +129,78 @@ const Z = o.forwardRef(({ className: a, ...t }, l) => {
|
|
|
125
129
|
/* @__PURE__ */ e(D, { side: "top", variant: "tertiary", children: d })
|
|
126
130
|
] });
|
|
127
131
|
});
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
132
|
+
$.displayName = "FileUploadClose";
|
|
133
|
+
const G = n.forwardRef(({ className: a, label: t, subLabel: l, ...o }, d) => {
|
|
134
|
+
const { addFiles: c, accept: u, disabled: f, files: w, maxFiles: x } = j(), [h, r] = n.useState(!1), v = n.useRef(null);
|
|
135
|
+
if (w.length >= x)
|
|
136
|
+
return null;
|
|
137
|
+
const g = (i) => {
|
|
138
|
+
i.preventDefault(), f || r(!0);
|
|
139
|
+
}, s = (i) => {
|
|
140
|
+
i.preventDefault(), r(!1);
|
|
141
|
+
}, F = (i) => {
|
|
142
|
+
i.preventDefault(), r(!1), !f && i.dataTransfer.files?.length && c(Array.from(i.dataTransfer.files));
|
|
143
|
+
}, b = () => {
|
|
144
|
+
f || v.current?.click();
|
|
145
|
+
}, N = (i) => {
|
|
146
|
+
i.target.files?.length && (c(Array.from(i.target.files)), i.target.value = "");
|
|
147
|
+
}, y = u.length > 0 ? u.map((i) => `.${i}`).join(",") : void 0;
|
|
148
|
+
return /* @__PURE__ */ m(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
ref: d,
|
|
152
|
+
onClick: b,
|
|
153
|
+
onDragOver: g,
|
|
154
|
+
onDragLeave: s,
|
|
155
|
+
onDrop: F,
|
|
156
|
+
className: p(
|
|
157
|
+
"relative flex flex-col items-center justify-end p-4 pt-6 pb-6 gap-2 h-[148px] rounded-lg border border-dashed border-stroke-accent bg-transparent cursor-pointer transition-colors",
|
|
158
|
+
h && "border-brand bg-brand/5",
|
|
159
|
+
f && "opacity-50 cursor-not-allowed",
|
|
160
|
+
a
|
|
161
|
+
),
|
|
162
|
+
"data-component": "file-upload-dropzone",
|
|
163
|
+
"data-state": h ? "drag-over" : "idle",
|
|
164
|
+
...o,
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ e(
|
|
167
|
+
"input",
|
|
168
|
+
{
|
|
169
|
+
ref: v,
|
|
170
|
+
type: "file",
|
|
171
|
+
multiple: !0,
|
|
172
|
+
className: "hidden",
|
|
173
|
+
accept: y,
|
|
174
|
+
onChange: N,
|
|
175
|
+
disabled: f
|
|
176
|
+
}
|
|
158
177
|
),
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
"
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
);
|
|
189
|
-
$.displayName = "FileUploadDropZone";
|
|
190
|
-
const G = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e("div", { ref: r, className: p("flex flex-col gap-3", a), ...l, children: t }));
|
|
191
|
-
G.displayName = "FileUploadList";
|
|
192
|
-
const K = o.forwardRef(
|
|
193
|
-
({ className: a, file: t, onRemove: l, ...r }, d) => {
|
|
194
|
-
const { t: c } = z(), { removeFile: u, disabled: f } = j(), N = (i) => {
|
|
195
|
-
i.stopPropagation(), l ? l() : u(t);
|
|
196
|
-
}, x = (i) => {
|
|
197
|
-
if (i === 0) return "0 B";
|
|
198
|
-
const g = 1024, v = ["B", "KB", "MB", "GB"], n = Math.floor(Math.log(i) / Math.log(g));
|
|
199
|
-
return parseFloat((i / Math.pow(g, n)).toFixed(2)) + " " + v[n];
|
|
200
|
-
}, h = (i) => {
|
|
201
|
-
switch (i.split(".").pop()?.toLowerCase()) {
|
|
178
|
+
/* @__PURE__ */ e("div", { className: "absolute top-[24px] left-1/2 -translate-x-1/2 pointer-events-none", children: /* @__PURE__ */ e(I, { size: 56 }) }),
|
|
179
|
+
/* @__PURE__ */ m("div", { className: "text-center space-y-1 z-10 mt-auto", children: [
|
|
180
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-content leading-5", children: t || /* @__PURE__ */ m(T, { children: [
|
|
181
|
+
"Drag your files here or",
|
|
182
|
+
" ",
|
|
183
|
+
/* @__PURE__ */ e("span", { className: "text-brand text-sm font-medium hover:underline", children: "Choose File" })
|
|
184
|
+
] }) }),
|
|
185
|
+
l && /* @__PURE__ */ e("p", { className: "text-xs font-medium text-navigation-muted", children: l })
|
|
186
|
+
] })
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
});
|
|
191
|
+
G.displayName = "FileUploadDropZone";
|
|
192
|
+
const K = n.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e("div", { ref: o, className: p("flex flex-col gap-3", a), ...l, children: t }));
|
|
193
|
+
K.displayName = "FileUploadList";
|
|
194
|
+
const q = n.forwardRef(
|
|
195
|
+
({ className: a, file: t, onRemove: l, ...o }, d) => {
|
|
196
|
+
const { t: c } = z(), { removeFile: u, disabled: f } = j(), w = (r) => {
|
|
197
|
+
r.stopPropagation(), l ? l() : u(t);
|
|
198
|
+
}, x = (r) => {
|
|
199
|
+
if (r === 0) return "0 B";
|
|
200
|
+
const v = 1024, g = ["B", "KB", "MB", "GB"], s = Math.floor(Math.log(r) / Math.log(v));
|
|
201
|
+
return parseFloat((r / Math.pow(v, s)).toFixed(2)) + " " + g[s];
|
|
202
|
+
}, h = (r) => {
|
|
203
|
+
switch (r.split(".").pop()?.toLowerCase()) {
|
|
202
204
|
case "xls":
|
|
203
205
|
case "xlsx":
|
|
204
206
|
return /* @__PURE__ */ e(O, { size: 36 });
|
|
@@ -207,7 +209,7 @@ const K = o.forwardRef(
|
|
|
207
209
|
case "txt":
|
|
208
210
|
return /* @__PURE__ */ e(M, { size: 36 });
|
|
209
211
|
default:
|
|
210
|
-
return /* @__PURE__ */ e(B, { size: 36, className: "text-
|
|
212
|
+
return /* @__PURE__ */ e(B, { size: 36, className: "text-content-icon" });
|
|
211
213
|
}
|
|
212
214
|
};
|
|
213
215
|
return /* @__PURE__ */ e(
|
|
@@ -215,30 +217,30 @@ const K = o.forwardRef(
|
|
|
215
217
|
{
|
|
216
218
|
ref: d,
|
|
217
219
|
className: p(
|
|
218
|
-
"flex flex-col justify-between items-stretch gap-2 p-4 border border-
|
|
220
|
+
"flex flex-col justify-between items-stretch gap-2 p-4 border border-stroke-hairline rounded-xl bg-canvas-elevated",
|
|
219
221
|
a
|
|
220
222
|
),
|
|
221
223
|
"data-component": "file-upload-item",
|
|
222
224
|
"data-file-name": t.name,
|
|
223
225
|
"data-file-size": t.size,
|
|
224
|
-
...
|
|
226
|
+
...o,
|
|
225
227
|
children: /* @__PURE__ */ m("div", { className: "flex justify-between items-center gap-2 z-10", children: [
|
|
226
228
|
/* @__PURE__ */ m("div", { className: "flex gap-2 min-w-0", children: [
|
|
227
229
|
/* @__PURE__ */ e("div", { className: "w-9 h-9 shrink-0", children: h(t.name) }),
|
|
228
230
|
/* @__PURE__ */ m("div", { className: "flex flex-col justify-between gap-[2px] min-w-0", children: [
|
|
229
231
|
/* @__PURE__ */ m(U, { children: [
|
|
230
|
-
/* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "text-xs font-bold text-
|
|
232
|
+
/* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "text-xs font-bold text-content leading-[18px] line-clamp-1 break-all cursor-default", children: t.name }) }),
|
|
231
233
|
/* @__PURE__ */ e(D, { side: "top", variant: "tertiary", children: t.name })
|
|
232
234
|
] }),
|
|
233
|
-
/* @__PURE__ */ e("span", { className: "text-xs font-medium text-
|
|
235
|
+
/* @__PURE__ */ e("span", { className: "text-xs font-medium text-content-muted leading-[16px]", children: x(t.size) })
|
|
234
236
|
] })
|
|
235
237
|
] }),
|
|
236
238
|
!f && /* @__PURE__ */ m(U, { children: [
|
|
237
239
|
/* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e(
|
|
238
240
|
"button",
|
|
239
241
|
{
|
|
240
|
-
onClick:
|
|
241
|
-
className: "flex items-center justify-center text-
|
|
242
|
+
onClick: w,
|
|
243
|
+
className: "flex items-center justify-center text-content-tertiary hover:text-destructive transition-colors",
|
|
242
244
|
type: "button",
|
|
243
245
|
"aria-label": c("aria.removeFile"),
|
|
244
246
|
children: /* @__PURE__ */ e(L, { size: 14 })
|
|
@@ -251,26 +253,26 @@ const K = o.forwardRef(
|
|
|
251
253
|
);
|
|
252
254
|
}
|
|
253
255
|
);
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
+
q.displayName = "FileUploadItem";
|
|
257
|
+
const J = n.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
|
|
256
258
|
"div",
|
|
257
259
|
{
|
|
258
|
-
ref:
|
|
260
|
+
ref: o,
|
|
259
261
|
className: p("flex items-center justify-end gap-4 mt-auto", a),
|
|
260
262
|
...l,
|
|
261
263
|
children: t
|
|
262
264
|
}
|
|
263
265
|
));
|
|
264
|
-
|
|
266
|
+
J.displayName = "FileUploadFooter";
|
|
265
267
|
export {
|
|
266
268
|
S as FileUpload,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
269
|
+
$ as FileUploadClose,
|
|
270
|
+
E as FileUploadContent,
|
|
271
|
+
Z as FileUploadDescription,
|
|
272
|
+
G as FileUploadDropZone,
|
|
273
|
+
J as FileUploadFooter,
|
|
274
|
+
H as FileUploadHeader,
|
|
275
|
+
q as FileUploadItem,
|
|
276
|
+
K as FileUploadList,
|
|
277
|
+
P as FileUploadTitle
|
|
276
278
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FilterPanelHeaderProps, FilterPanelProps, FilterPanelSidebarProps, FilterPanelBodyProps, FilterPanelFooterProps } from '../types/filter-panel.types';
|
|
2
|
-
declare const FilterPanelHeader: ({ title, children, className }: FilterPanelHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const FilterPanelHeader: ({ title, children, className, }: FilterPanelHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
declare const FilterPanel: ({ open, onOpenChange, title, children, header, sidebar, className, preventClose, }: FilterPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const FilterPanelSidebar: ({ items, activeTab, onTabChange, className, }: FilterPanelSidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare const FilterPanelBody: ({ children, className }: FilterPanelBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare const FilterPanelFooter: ({ children, className, leftAction }: FilterPanelFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const FilterPanelFooter: ({ children, className, leftAction, }: FilterPanelFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { FilterPanel, FilterPanelHeader, FilterPanelSidebar, FilterPanelBody, FilterPanelFooter, };
|