impact-nova 2.0.1 → 2.0.3
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/assets/empty-state-1-3H9kriwm.webp +0 -0
- package/dist/assets/empty-state-2-Brn6WD3e.webp +0 -0
- package/dist/assets/empty-state-3-CqLldG5q.webp +0 -0
- package/dist/assets/empty-state-4-Br-xaUJO.webp +0 -0
- package/dist/assets/empty-state-5-BanvbHv1.webp +0 -0
- package/dist/assets/empty-state-6-Egbfj9Fe.webp +0 -0
- package/dist/components/ui/accordion.d.ts +13 -0
- package/dist/components/ui/accordion.js +50 -33
- package/dist/components/ui/ag-grid-react/cell-renderers/percent-progress-display-renderer.js +24 -23
- package/dist/components/ui/ag-grid-react/headers/components/header-info.d.ts +8 -6
- package/dist/components/ui/ag-grid-react/headers/components/header-info.js +69 -60
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +23 -22
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +43 -35
- package/dist/components/ui/ag-grid-react/index.js +44 -42
- package/dist/components/ui/breadcrumb.d.ts +5 -1
- package/dist/components/ui/breadcrumb.js +59 -51
- package/dist/components/ui/date-picker/date-picker.js +14 -14
- package/dist/components/ui/date-picker/date-range-picker.js +25 -25
- package/dist/components/ui/date-picker/month-picker.js +4 -4
- package/dist/components/ui/date-picker/month-range-picker.js +7 -7
- package/dist/components/ui/date-picker/multi-date-picker.js +9 -9
- package/dist/components/ui/date-picker/multi-month-picker.js +29 -29
- package/dist/components/ui/date-picker/multi-week-picker.js +20 -20
- package/dist/components/ui/date-picker/week-picker.js +31 -31
- package/dist/components/ui/date-picker/week-range-picker.js +22 -22
- package/dist/components/ui/dynamic-layout.d.ts +1 -1
- package/dist/components/ui/empty-container/assets/empty-state-1.webp.js +1 -1
- package/dist/components/ui/empty-container/assets/empty-state-2.webp.js +2 -2
- package/dist/components/ui/empty-container/assets/empty-state-3.webp.js +1 -1
- package/dist/components/ui/empty-container/assets/empty-state-4.webp.js +1 -1
- package/dist/components/ui/empty-container/assets/empty-state-5.webp.js +1 -1
- package/dist/components/ui/empty-container/assets/empty-state-6.webp.js +2 -2
- package/dist/components/ui/empty-container/emptyStateIllustrations.d.ts +2 -2
- package/dist/components/ui/empty-container/emptyStateIllustrations.js +32 -20
- package/dist/components/ui/empty-container.js +82 -58
- package/dist/components/ui/filter-strip/filter-summary.js +28 -29
- package/dist/components/ui/filter-strip/filter-tag-list.js +87 -96
- package/dist/components/ui/radio-group.js +19 -19
- package/dist/components/ui/select/select.js +29 -28
- package/dist/components/ui/sidebar.d.ts +2 -1
- package/dist/components/ui/sidebar.js +212 -202
- package/dist/components/ui/tag.d.ts +3 -1
- package/dist/components/ui/tag.js +65 -44
- package/dist/components/ui/types/empty-container.types.d.ts +2 -0
- package/dist/i18n/defaultMessages.d.ts +1 -0
- package/dist/i18n/defaultMessages.js +1 -0
- package/dist/i18n/locales/de.js +1 -0
- package/dist/i18n/locales/es.js +1 -0
- package/dist/i18n/locales/hi.js +1 -0
- package/dist/i18n/locales/kn.js +1 -0
- package/dist/impact-nova-components.css +4 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +441 -439
- package/package.json +4 -1
- package/dist/assets/empty-state-1-Bqh-20pq.webp +0 -0
- package/dist/assets/empty-state-2-DPMRkOBw.webp +0 -0
- package/dist/assets/empty-state-3-BqSOh0-t.webp +0 -0
- package/dist/assets/empty-state-4-CjN-c01q.webp +0 -0
- package/dist/assets/empty-state-5-D4RMA1H1.webp +0 -0
- package/dist/assets/empty-state-6-Dlnf1-2W.webp +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as g, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import { Cross as te, CalendarMonth as oe } from "impact-nova-icons";
|
|
4
4
|
import { isValid as w, parse as P, format as B } from "date-fns";
|
|
5
5
|
import { cn as re, padValidDateString as se, maskDate as ie } from "../../../lib/utils.js";
|
|
6
6
|
import { Input as ce } from "../input.js";
|
|
7
|
-
import { Popover as le,
|
|
7
|
+
import { Popover as le, PopoverAnchor as ae, PopoverContent as pe } from "../popover.js";
|
|
8
8
|
import { Calendar as de } from "../calendar.js";
|
|
9
9
|
import { Tooltip as E, TooltipTrigger as O, TooltipContent as $ } from "../tooltip.js";
|
|
10
10
|
import { resolveWeekSelection as fe } from "../../../lib/fiscal-calendar.js";
|
|
11
|
-
import { getDateFnsLocale as
|
|
12
|
-
import { useImpactNovaI18n as
|
|
11
|
+
import { getDateFnsLocale as he } from "../../../i18n/getDateFnsLocale.js";
|
|
12
|
+
import { useImpactNovaI18n as ue } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
13
13
|
const p = (e, i = "MM/dd/yyyy", n) => {
|
|
14
14
|
const y = B(e.startDate, i, n ? { locale: n } : {}), C = B(e.endDate, i, n ? { locale: n } : {});
|
|
15
15
|
return `${y} - ${C}`;
|
|
@@ -28,43 +28,43 @@ const p = (e, i = "MM/dd/yyyy", n) => {
|
|
|
28
28
|
fiscalMode: S = "basic",
|
|
29
29
|
selectionMode: N = "week",
|
|
30
30
|
fiscalMonthPattern: b,
|
|
31
|
-
fiscalYearStartMonth:
|
|
32
|
-
weekStartsOn:
|
|
31
|
+
fiscalYearStartMonth: V = 1,
|
|
32
|
+
weekStartsOn: A = 1,
|
|
33
33
|
disabled: D,
|
|
34
34
|
className: J,
|
|
35
35
|
...K
|
|
36
36
|
}, Q) => {
|
|
37
|
-
const { locale: M, t:
|
|
38
|
-
s.useRef(null), s.useImperativeHandle(Q, () =>
|
|
39
|
-
const [c,
|
|
37
|
+
const { locale: M, t: k } = ue(), o = s.useMemo(() => he(M), [M]), U = y ?? k("datePicker.selectWeek"), T = s.useRef(null);
|
|
38
|
+
s.useRef(null), s.useImperativeHandle(Q, () => T.current);
|
|
39
|
+
const [c, u] = s.useState(!1), [L, l] = s.useState(e), [f, a] = s.useState(e ? p(e, n, o) : ""), [X, W] = s.useState(e?.startDate || /* @__PURE__ */ new Date());
|
|
40
40
|
s.useEffect(() => {
|
|
41
41
|
c || (a(e ? p(e, n, o) : ""), l(e));
|
|
42
42
|
}, [c, e, n, o]), s.useEffect(() => {
|
|
43
43
|
c && (l(e), W(e?.startDate || /* @__PURE__ */ new Date()), a(e ? p(e, n, o) : ""));
|
|
44
44
|
}, [c, e, n, o]);
|
|
45
45
|
const Z = (t) => {
|
|
46
|
-
l(t), t && a(p(t, n, o)), d || (i?.(t),
|
|
46
|
+
l(t), t && a(p(t, n, o)), d || (i?.(t), u(!1));
|
|
47
47
|
}, _ = (t) => {
|
|
48
|
-
i?.(t !== void 0 ? t : L),
|
|
48
|
+
i?.(t !== void 0 ? t : L), u(!1);
|
|
49
49
|
}, Y = () => {
|
|
50
|
-
l(e), a(e ? p(e, n, o) : ""),
|
|
50
|
+
l(e), a(e ? p(e, n, o) : ""), u(!1);
|
|
51
51
|
}, R = () => {
|
|
52
|
-
l(void 0), a(""), i?.(void 0), d ||
|
|
52
|
+
l(void 0), a(""), i?.(void 0), d || u(!1);
|
|
53
53
|
}, j = (t) => fe(t, {
|
|
54
54
|
calendarType: I,
|
|
55
55
|
fiscalMode: S,
|
|
56
56
|
selectionMode: N,
|
|
57
57
|
fiscalMonthPattern: b,
|
|
58
|
-
fiscalYearStartMonth:
|
|
59
|
-
weekStartsOn:
|
|
58
|
+
fiscalYearStartMonth: V,
|
|
59
|
+
weekStartsOn: A
|
|
60
60
|
}), F = (t) => {
|
|
61
|
-
const m = t.target.value,
|
|
62
|
-
if (a(
|
|
61
|
+
const m = t.target.value, h = ie(m, n, f);
|
|
62
|
+
if (a(h), h === "") {
|
|
63
63
|
l(void 0), d || i?.(void 0);
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
const x = P(
|
|
67
|
-
if (w(x) &&
|
|
66
|
+
const x = P(h, n, /* @__PURE__ */ new Date(), { locale: o });
|
|
67
|
+
if (w(x) && h.length === n.length) {
|
|
68
68
|
const z = j(x);
|
|
69
69
|
l(z), W(x), d || i?.(z);
|
|
70
70
|
}
|
|
@@ -74,15 +74,15 @@ const p = (e, i = "MM/dd/yyyy", n) => {
|
|
|
74
74
|
if (!w(m) || t.length !== n.length)
|
|
75
75
|
a(e ? p(e, n, o) : ""), l(e);
|
|
76
76
|
else if (a(t), !d) {
|
|
77
|
-
const
|
|
78
|
-
i?.(
|
|
77
|
+
const h = j(m);
|
|
78
|
+
i?.(h);
|
|
79
79
|
}
|
|
80
80
|
}, v = (e ? p(e, n, o) : "") !== f, ne = f.length === n.length && !w(P(f, n, /* @__PURE__ */ new Date(), { locale: o }));
|
|
81
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ g(le, { open: c, onOpenChange: (t) => !D && u(t), children: [
|
|
82
82
|
/* @__PURE__ */ r(ae, { asChild: !0, children: /* @__PURE__ */ r("div", { "data-component": "week-picker", "data-state": c ? "open" : "closed", "data-pending": v || void 0, children: /* @__PURE__ */ r(
|
|
83
83
|
ce,
|
|
84
84
|
{
|
|
85
|
-
ref:
|
|
85
|
+
ref: T,
|
|
86
86
|
value: f,
|
|
87
87
|
onChange: F,
|
|
88
88
|
onBlur: ee,
|
|
@@ -95,14 +95,14 @@ const p = (e, i = "MM/dd/yyyy", n) => {
|
|
|
95
95
|
ne ? "text-destructive" : v ? "text-content-muted" : "",
|
|
96
96
|
J
|
|
97
97
|
),
|
|
98
|
-
suffix: /* @__PURE__ */
|
|
99
|
-
e && !D && /* @__PURE__ */
|
|
98
|
+
suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
|
|
99
|
+
e && !D && /* @__PURE__ */ g(E, { children: [
|
|
100
100
|
/* @__PURE__ */ r(O, { asChild: !0, children: /* @__PURE__ */ r(
|
|
101
101
|
"button",
|
|
102
102
|
{
|
|
103
103
|
type: "button",
|
|
104
104
|
tabIndex: 0,
|
|
105
|
-
"aria-label":
|
|
105
|
+
"aria-label": k("calendar.clear"),
|
|
106
106
|
onClick: (t) => {
|
|
107
107
|
t.stopPropagation(), R();
|
|
108
108
|
},
|
|
@@ -110,11 +110,11 @@ const p = (e, i = "MM/dd/yyyy", n) => {
|
|
|
110
110
|
children: /* @__PURE__ */ r(te, { className: "size-3 hover:text-content" })
|
|
111
111
|
}
|
|
112
112
|
) }),
|
|
113
|
-
/* @__PURE__ */ r($, { variant: "tertiary", side: "top", children:
|
|
113
|
+
/* @__PURE__ */ r($, { variant: "tertiary", side: "top", children: k("calendar.clear") })
|
|
114
114
|
] }),
|
|
115
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ g(E, { children: [
|
|
116
116
|
/* @__PURE__ */ r(O, { asChild: !0, children: /* @__PURE__ */ r(oe, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
117
|
-
/* @__PURE__ */ r($, { variant: "tertiary", side: "top", children:
|
|
117
|
+
/* @__PURE__ */ r($, { variant: "tertiary", side: "top", children: k("datePicker.selectWeek") })
|
|
118
118
|
] })
|
|
119
119
|
] }),
|
|
120
120
|
...K
|
|
@@ -143,8 +143,8 @@ const p = (e, i = "MM/dd/yyyy", n) => {
|
|
|
143
143
|
fiscalMode: S,
|
|
144
144
|
selectionMode: N,
|
|
145
145
|
fiscalMonthPattern: b,
|
|
146
|
-
fiscalYearStartMonth:
|
|
147
|
-
weekStartsOn:
|
|
146
|
+
fiscalYearStartMonth: V,
|
|
147
|
+
weekStartsOn: A,
|
|
148
148
|
onApply: _,
|
|
149
149
|
onCancel: Y,
|
|
150
150
|
onClear: R,
|
|
@@ -3,7 +3,7 @@ import * as c from "react";
|
|
|
3
3
|
import { Cross as Ne, CalendarMonth as Re, Info as Z } from "impact-nova-icons";
|
|
4
4
|
import { format as s, isValid as C, parse as I } from "date-fns";
|
|
5
5
|
import { cn as p, padValidDateString as $, maskDate as Y } from "../../../lib/utils.js";
|
|
6
|
-
import { Popover as Se,
|
|
6
|
+
import { Popover as Se, PopoverAnchor as Ce, PopoverContent as Ie } from "../popover.js";
|
|
7
7
|
import { Calendar as Pe } from "../calendar.js";
|
|
8
8
|
import { Tooltip as _, TooltipTrigger as F, TooltipContent as ee } from "../tooltip.js";
|
|
9
9
|
import { resolveWeekSelection as We } from "../../../lib/fiscal-calendar.js";
|
|
@@ -24,8 +24,8 @@ const a = (t) => t?.from ? t.to ? t.to.endDate : t.from.endDate : void 0, Ae = c
|
|
|
24
24
|
fiscalMode: K = "basic",
|
|
25
25
|
selectionMode: M = "week",
|
|
26
26
|
fiscalMonthPattern: B,
|
|
27
|
-
fiscalYearStartMonth:
|
|
28
|
-
weekStartsOn:
|
|
27
|
+
fiscalYearStartMonth: O = 1,
|
|
28
|
+
weekStartsOn: T = 1,
|
|
29
29
|
disabled: i,
|
|
30
30
|
className: se,
|
|
31
31
|
isError: D,
|
|
@@ -59,42 +59,42 @@ const a = (t) => t?.from ? t.to ? t.to.endDate : t.from.endDate : void 0, Ae = c
|
|
|
59
59
|
fiscalMode: K,
|
|
60
60
|
selectionMode: M,
|
|
61
61
|
fiscalMonthPattern: B,
|
|
62
|
-
fiscalYearStartMonth:
|
|
63
|
-
weekStartsOn:
|
|
62
|
+
fiscalYearStartMonth: O,
|
|
63
|
+
weekStartsOn: T
|
|
64
64
|
}), ue = (e) => {
|
|
65
65
|
const w = e.target.value, d = Y(w, n, R);
|
|
66
66
|
if (u(d), d === "") {
|
|
67
|
-
const
|
|
68
|
-
m(
|
|
67
|
+
const g = { from: void 0, to: v?.to };
|
|
68
|
+
m(g), y || b?.(g);
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
if (C(
|
|
73
|
-
const N = { from: E(
|
|
71
|
+
const h = I(d, n, /* @__PURE__ */ new Date(), { locale: o });
|
|
72
|
+
if (C(h) && d.length === n.length) {
|
|
73
|
+
const N = { from: E(h), to: v?.to };
|
|
74
74
|
m(N), x(s(a(N), n, { locale: o })), y || b?.(N);
|
|
75
75
|
}
|
|
76
76
|
}, xe = (e) => {
|
|
77
77
|
const w = e.target.value, d = Y(w, n, S);
|
|
78
78
|
if (x(d), d === "") {
|
|
79
|
-
const
|
|
80
|
-
m(
|
|
79
|
+
const g = { from: v?.from, to: void 0 };
|
|
80
|
+
m(g), y || b?.(g);
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
const
|
|
84
|
-
if (C(
|
|
85
|
-
const
|
|
86
|
-
m(N), v?.from && u(s(v.from.startDate, n, { locale: o })),
|
|
83
|
+
const h = I(d, n, /* @__PURE__ */ new Date(), { locale: o });
|
|
84
|
+
if (C(h) && d.length === n.length) {
|
|
85
|
+
const g = E(h), N = { from: v?.from, to: g };
|
|
86
|
+
m(N), v?.from && u(s(v.from.startDate, n, { locale: o })), h && j(h), y || b?.(N);
|
|
87
87
|
}
|
|
88
88
|
}, X = () => {
|
|
89
89
|
if (r) return;
|
|
90
|
-
const e = $(R, n), w = $(S, n), d = I(e, n, /* @__PURE__ */ new Date(), { locale: o }),
|
|
91
|
-
if (!
|
|
90
|
+
const e = $(R, n), w = $(S, n), d = I(e, n, /* @__PURE__ */ new Date(), { locale: o }), h = I(w, n, /* @__PURE__ */ new Date(), { locale: o }), g = C(d) && e.length === n.length, N = C(h) && w.length === n.length;
|
|
91
|
+
if (!g || !N)
|
|
92
92
|
u(t?.from ? s(t.from.startDate, n, { locale: o }) : ""), x(a(t) ? s(a(t), n, { locale: o }) : ""), m(t);
|
|
93
93
|
else if (u(e), x(w), !y) {
|
|
94
|
-
const De = E(d), ve = E(
|
|
94
|
+
const De = E(d), ve = E(h);
|
|
95
95
|
b?.({ from: De, to: ve });
|
|
96
96
|
}
|
|
97
|
-
},
|
|
97
|
+
}, he = t?.from ? s(t.from.startDate, n, { locale: o }) : "", ge = a(t) ? s(a(t), n, { locale: o }) : "", ke = he !== R, we = ge !== S, be = R.length === n.length && !C(I(R, n, /* @__PURE__ */ new Date(), { locale: o })), ye = S.length === n.length && !C(I(S, n, /* @__PURE__ */ new Date(), { locale: o }));
|
|
98
98
|
return /* @__PURE__ */ f("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", "data-component": "week-range-picker", "data-disabled": i || void 0, children: [
|
|
99
99
|
/* @__PURE__ */ f("div", { className: "flex flex-col gap-[6px]", children: [
|
|
100
100
|
q && /* @__PURE__ */ f(
|
|
@@ -237,8 +237,8 @@ const a = (t) => t?.from ? t.to ? t.to.endDate : t.from.endDate : void 0, Ae = c
|
|
|
237
237
|
fiscalMode: K,
|
|
238
238
|
selectionMode: M,
|
|
239
239
|
fiscalMonthPattern: B,
|
|
240
|
-
fiscalYearStartMonth:
|
|
241
|
-
weekStartsOn:
|
|
240
|
+
fiscalYearStartMonth: O,
|
|
241
|
+
weekStartsOn: T,
|
|
242
242
|
onApply: me,
|
|
243
243
|
onCancel: z,
|
|
244
244
|
onClear: U,
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const dynamicLayoutVariants: (props?: {
|
|
4
4
|
layout?: "grid" | "flex" | "stack";
|
|
5
|
-
columns?: 1 | 4 | 3 | 2 |
|
|
5
|
+
columns?: 1 | 4 | 3 | 2 | 6 | 12;
|
|
6
6
|
gap?: "none" | "sm" | "md" | "lg" | "xl";
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) => string;
|
|
8
8
|
export interface DynamicLayoutProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof dynamicLayoutVariants> {
|
|
@@ -7,7 +7,7 @@ import { default as emptyState6Url } from './assets/empty-state-6.webp?url';
|
|
|
7
7
|
export interface EmptyStateImageEntry {
|
|
8
8
|
width: number;
|
|
9
9
|
height: number;
|
|
10
|
-
|
|
10
|
+
loadSrc: () => Promise<string>;
|
|
11
11
|
}
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const EMPTY_STATE_IMAGE_LOADERS: EmptyStateImageEntry[];
|
|
13
13
|
export { emptyState1Url as EmptyState1Url, emptyState2Url as EmptyState2Url, emptyState3Url as EmptyState3Url, emptyState4Url as EmptyState4Url, emptyState5Url as EmptyState5Url, emptyState6Url as EmptyState6Url, };
|
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
|
|
1
|
+
const h = [
|
|
2
|
+
{
|
|
3
|
+
width: 225,
|
|
4
|
+
height: 150,
|
|
5
|
+
loadSrc: () => import("./assets/empty-state-1.webp.js").then((t) => t.default)
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
width: 200,
|
|
9
|
+
height: 200,
|
|
10
|
+
loadSrc: () => import("./assets/empty-state-2.webp.js").then((t) => t.default)
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
width: 225,
|
|
14
|
+
height: 150,
|
|
15
|
+
loadSrc: () => import("./assets/empty-state-3.webp.js").then((t) => t.default)
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
width: 250,
|
|
19
|
+
height: 180,
|
|
20
|
+
loadSrc: () => import("./assets/empty-state-4.webp.js").then((t) => t.default)
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
width: 225,
|
|
24
|
+
height: 150,
|
|
25
|
+
loadSrc: () => import("./assets/empty-state-5.webp.js").then((t) => t.default)
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
width: 225,
|
|
29
|
+
height: 150,
|
|
30
|
+
loadSrc: () => import("./assets/empty-state-6.webp.js").then((t) => t.default)
|
|
31
|
+
}
|
|
14
32
|
];
|
|
15
33
|
export {
|
|
16
|
-
|
|
17
|
-
t as EmptyState1Url,
|
|
18
|
-
r as EmptyState2Url,
|
|
19
|
-
e as EmptyState3Url,
|
|
20
|
-
m as EmptyState4Url,
|
|
21
|
-
p as EmptyState5Url,
|
|
22
|
-
a as EmptyState6Url
|
|
34
|
+
h as EMPTY_STATE_IMAGE_LOADERS
|
|
23
35
|
};
|
|
@@ -1,93 +1,117 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { cn as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
({ className: a, children: t, asChild: e = !1, ...o }, n) => /* @__PURE__ */
|
|
8
|
-
e ?
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { Slot as f } from "@radix-ui/react-slot";
|
|
4
|
+
import { cn as d } from "../../lib/utils.js";
|
|
5
|
+
import { EMPTY_STATE_IMAGE_LOADERS as y } from "./empty-container/emptyStateIllustrations.js";
|
|
6
|
+
const b = i.forwardRef(
|
|
7
|
+
({ className: a, children: t, asChild: e = !1, ...o }, n) => /* @__PURE__ */ s(
|
|
8
|
+
e ? f : "div",
|
|
9
9
|
{
|
|
10
10
|
ref: n,
|
|
11
|
-
className:
|
|
11
|
+
className: d(
|
|
12
12
|
"flex flex-col items-center justify-center py-16 px-5 text-center animate-in fade-in zoom-in duration-300 border border-stroke-subtle rounded-xl bg-canvas-elevated w-[884px] min-w-[884px] h-auto",
|
|
13
13
|
a
|
|
14
14
|
),
|
|
15
15
|
"data-component": "empty-container",
|
|
16
16
|
...o,
|
|
17
|
-
children: /* @__PURE__ */
|
|
17
|
+
children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center max-w-[650px]", children: t })
|
|
18
18
|
}
|
|
19
19
|
)
|
|
20
20
|
);
|
|
21
|
-
|
|
22
|
-
const
|
|
21
|
+
b.displayName = "EmptyContainer";
|
|
22
|
+
const S = i.forwardRef(
|
|
23
23
|
({
|
|
24
24
|
className: a,
|
|
25
25
|
children: t,
|
|
26
26
|
src: e,
|
|
27
27
|
alt: o = "",
|
|
28
28
|
width: n,
|
|
29
|
-
height:
|
|
30
|
-
asChild:
|
|
31
|
-
...
|
|
32
|
-
},
|
|
33
|
-
const [
|
|
29
|
+
height: m,
|
|
30
|
+
asChild: p = !1,
|
|
31
|
+
...u
|
|
32
|
+
}, g) => {
|
|
33
|
+
const [h] = i.useState(() => t || e ? null : Math.floor(Math.random() * y.length)), [l, x] = i.useState(null), r = h !== null ? y[h] : null;
|
|
34
|
+
i.useEffect(() => {
|
|
35
|
+
if (t || e || !r)
|
|
36
|
+
return;
|
|
37
|
+
let c = !1;
|
|
38
|
+
return r.loadSrc().then((N) => {
|
|
39
|
+
c || x({
|
|
40
|
+
imageSource: N,
|
|
41
|
+
width: r.width,
|
|
42
|
+
height: r.height
|
|
43
|
+
});
|
|
44
|
+
}), () => {
|
|
45
|
+
c = !0;
|
|
46
|
+
};
|
|
47
|
+
}, [t, r, e]);
|
|
48
|
+
const C = n || (t ? "auto" : l?.width ?? r?.width ?? 225), E = m || (t ? "auto" : l?.height ?? r?.height ?? 150), w = () => {
|
|
34
49
|
if (t)
|
|
35
50
|
return t;
|
|
36
|
-
const
|
|
37
|
-
return
|
|
51
|
+
const c = e ?? l?.imageSource;
|
|
52
|
+
return c ? /* @__PURE__ */ s(
|
|
38
53
|
"img",
|
|
39
54
|
{
|
|
40
|
-
src:
|
|
55
|
+
src: c,
|
|
41
56
|
alt: o,
|
|
42
57
|
className: "object-contain shrink-0 select-none",
|
|
43
58
|
style: {
|
|
44
|
-
width: n ||
|
|
45
|
-
height:
|
|
59
|
+
width: n || l?.width || r?.width || "100%",
|
|
60
|
+
height: m || l?.height || r?.height || "100%"
|
|
46
61
|
}
|
|
47
62
|
}
|
|
48
63
|
) : null;
|
|
49
64
|
};
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
|
|
65
|
+
return /* @__PURE__ */ s(
|
|
66
|
+
p ? f : "div",
|
|
52
67
|
{
|
|
53
|
-
ref:
|
|
54
|
-
className:
|
|
68
|
+
ref: g,
|
|
69
|
+
className: d(
|
|
55
70
|
"mb-4 flex items-center justify-center relative",
|
|
56
71
|
"after:absolute after:inset-0 after:bg-brand/5 after:blur-3xl after:-z-10 after:rounded-full",
|
|
57
72
|
a
|
|
58
73
|
),
|
|
59
74
|
style: {
|
|
60
75
|
width: C,
|
|
61
|
-
height:
|
|
62
|
-
...
|
|
76
|
+
height: E,
|
|
77
|
+
...u.style
|
|
63
78
|
},
|
|
64
79
|
"data-component": "empty-container-image",
|
|
65
|
-
...
|
|
66
|
-
children:
|
|
80
|
+
...u,
|
|
81
|
+
children: w()
|
|
67
82
|
}
|
|
68
83
|
);
|
|
69
84
|
}
|
|
70
85
|
);
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
S.displayName = "EmptyContainerImage";
|
|
87
|
+
const I = {
|
|
88
|
+
2: "h2",
|
|
89
|
+
3: "h3",
|
|
90
|
+
4: "h4",
|
|
91
|
+
5: "h5",
|
|
92
|
+
6: "h6"
|
|
93
|
+
}, A = i.forwardRef(({ className: a, children: t, asChild: e = !1, headingLevel: o = 2, ...n }, m) => {
|
|
94
|
+
const p = e ? f : I[o];
|
|
95
|
+
return /* @__PURE__ */ s(
|
|
96
|
+
p,
|
|
97
|
+
{
|
|
98
|
+
ref: m,
|
|
99
|
+
className: d(
|
|
100
|
+
"text-xl font-bold tracking-tight leading-[30px] text-content",
|
|
101
|
+
a
|
|
102
|
+
),
|
|
103
|
+
"data-component": "empty-container-title",
|
|
104
|
+
...n,
|
|
105
|
+
children: t
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
A.displayName = "EmptyContainerTitle";
|
|
110
|
+
const R = i.forwardRef(({ className: a, children: t, asChild: e = !1, ...o }, n) => /* @__PURE__ */ s(
|
|
111
|
+
e ? f : "p",
|
|
88
112
|
{
|
|
89
113
|
ref: n,
|
|
90
|
-
className:
|
|
114
|
+
className: d(
|
|
91
115
|
"text-base leading-[21px] mt-1 font-medium text-secondary-foreground",
|
|
92
116
|
a
|
|
93
117
|
),
|
|
@@ -96,12 +120,12 @@ const N = m.forwardRef(({ className: a, children: t, asChild: e = !1, ...o }, n)
|
|
|
96
120
|
children: t
|
|
97
121
|
}
|
|
98
122
|
));
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
e ?
|
|
123
|
+
R.displayName = "EmptyContainerDescription";
|
|
124
|
+
const T = i.forwardRef(({ className: a, children: t, asChild: e = !1, ...o }, n) => /* @__PURE__ */ s(
|
|
125
|
+
e ? f : "div",
|
|
102
126
|
{
|
|
103
127
|
ref: n,
|
|
104
|
-
className:
|
|
128
|
+
className: d(
|
|
105
129
|
"mt-6 flex flex-wrap items-center justify-center gap-3",
|
|
106
130
|
a
|
|
107
131
|
),
|
|
@@ -110,11 +134,11 @@ const v = m.forwardRef(({ className: a, children: t, asChild: e = !1, ...o }, n)
|
|
|
110
134
|
children: t
|
|
111
135
|
}
|
|
112
136
|
));
|
|
113
|
-
|
|
137
|
+
T.displayName = "EmptyContainerAction";
|
|
114
138
|
export {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
139
|
+
b as EmptyContainer,
|
|
140
|
+
T as EmptyContainerAction,
|
|
141
|
+
R as EmptyContainerDescription,
|
|
142
|
+
S as EmptyContainerImage,
|
|
143
|
+
A as EmptyContainerTitle
|
|
120
144
|
};
|