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.
Files changed (60) hide show
  1. package/dist/assets/empty-state-1-3H9kriwm.webp +0 -0
  2. package/dist/assets/empty-state-2-Brn6WD3e.webp +0 -0
  3. package/dist/assets/empty-state-3-CqLldG5q.webp +0 -0
  4. package/dist/assets/empty-state-4-Br-xaUJO.webp +0 -0
  5. package/dist/assets/empty-state-5-BanvbHv1.webp +0 -0
  6. package/dist/assets/empty-state-6-Egbfj9Fe.webp +0 -0
  7. package/dist/components/ui/accordion.d.ts +13 -0
  8. package/dist/components/ui/accordion.js +50 -33
  9. package/dist/components/ui/ag-grid-react/cell-renderers/percent-progress-display-renderer.js +24 -23
  10. package/dist/components/ui/ag-grid-react/headers/components/header-info.d.ts +8 -6
  11. package/dist/components/ui/ag-grid-react/headers/components/header-info.js +69 -60
  12. package/dist/components/ui/ag-grid-react/headers/custom-header.js +23 -22
  13. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +43 -35
  14. package/dist/components/ui/ag-grid-react/index.js +44 -42
  15. package/dist/components/ui/breadcrumb.d.ts +5 -1
  16. package/dist/components/ui/breadcrumb.js +59 -51
  17. package/dist/components/ui/date-picker/date-picker.js +14 -14
  18. package/dist/components/ui/date-picker/date-range-picker.js +25 -25
  19. package/dist/components/ui/date-picker/month-picker.js +4 -4
  20. package/dist/components/ui/date-picker/month-range-picker.js +7 -7
  21. package/dist/components/ui/date-picker/multi-date-picker.js +9 -9
  22. package/dist/components/ui/date-picker/multi-month-picker.js +29 -29
  23. package/dist/components/ui/date-picker/multi-week-picker.js +20 -20
  24. package/dist/components/ui/date-picker/week-picker.js +31 -31
  25. package/dist/components/ui/date-picker/week-range-picker.js +22 -22
  26. package/dist/components/ui/dynamic-layout.d.ts +1 -1
  27. package/dist/components/ui/empty-container/assets/empty-state-1.webp.js +1 -1
  28. package/dist/components/ui/empty-container/assets/empty-state-2.webp.js +2 -2
  29. package/dist/components/ui/empty-container/assets/empty-state-3.webp.js +1 -1
  30. package/dist/components/ui/empty-container/assets/empty-state-4.webp.js +1 -1
  31. package/dist/components/ui/empty-container/assets/empty-state-5.webp.js +1 -1
  32. package/dist/components/ui/empty-container/assets/empty-state-6.webp.js +2 -2
  33. package/dist/components/ui/empty-container/emptyStateIllustrations.d.ts +2 -2
  34. package/dist/components/ui/empty-container/emptyStateIllustrations.js +32 -20
  35. package/dist/components/ui/empty-container.js +82 -58
  36. package/dist/components/ui/filter-strip/filter-summary.js +28 -29
  37. package/dist/components/ui/filter-strip/filter-tag-list.js +87 -96
  38. package/dist/components/ui/radio-group.js +19 -19
  39. package/dist/components/ui/select/select.js +29 -28
  40. package/dist/components/ui/sidebar.d.ts +2 -1
  41. package/dist/components/ui/sidebar.js +212 -202
  42. package/dist/components/ui/tag.d.ts +3 -1
  43. package/dist/components/ui/tag.js +65 -44
  44. package/dist/components/ui/types/empty-container.types.d.ts +2 -0
  45. package/dist/i18n/defaultMessages.d.ts +1 -0
  46. package/dist/i18n/defaultMessages.js +1 -0
  47. package/dist/i18n/locales/de.js +1 -0
  48. package/dist/i18n/locales/es.js +1 -0
  49. package/dist/i18n/locales/hi.js +1 -0
  50. package/dist/i18n/locales/kn.js +1 -0
  51. package/dist/impact-nova-components.css +4 -0
  52. package/dist/impact-nova.css +1 -1
  53. package/dist/index.js +441 -439
  54. package/package.json +4 -1
  55. package/dist/assets/empty-state-1-Bqh-20pq.webp +0 -0
  56. package/dist/assets/empty-state-2-DPMRkOBw.webp +0 -0
  57. package/dist/assets/empty-state-3-BqSOh0-t.webp +0 -0
  58. package/dist/assets/empty-state-4-CjN-c01q.webp +0 -0
  59. package/dist/assets/empty-state-5-D4RMA1H1.webp +0 -0
  60. package/dist/assets/empty-state-6-Dlnf1-2W.webp +0 -0
@@ -1,15 +1,15 @@
1
- import { jsxs as k, jsx as r } from "react/jsx-runtime";
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, PopoverTrigger as ae, PopoverContent as pe } from "../popover.js";
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 ue } from "../../../i18n/getDateFnsLocale.js";
12
- import { useImpactNovaI18n as he } from "../../../i18n/ImpactNovaI18nContext.js";
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: T = 1,
32
- weekStartsOn: V = 1,
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: g } = he(), o = s.useMemo(() => ue(M), [M]), U = y ?? g("datePicker.selectWeek"), A = s.useRef(null);
38
- s.useRef(null), s.useImperativeHandle(Q, () => A.current);
39
- const [c, h] = 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());
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), h(!1));
46
+ l(t), t && a(p(t, n, o)), d || (i?.(t), u(!1));
47
47
  }, _ = (t) => {
48
- i?.(t !== void 0 ? t : L), h(!1);
48
+ i?.(t !== void 0 ? t : L), u(!1);
49
49
  }, Y = () => {
50
- l(e), a(e ? p(e, n, o) : ""), h(!1);
50
+ l(e), a(e ? p(e, n, o) : ""), u(!1);
51
51
  }, R = () => {
52
- l(void 0), a(""), i?.(void 0), d || h(!1);
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: T,
59
- weekStartsOn: V
58
+ fiscalYearStartMonth: V,
59
+ weekStartsOn: A
60
60
  }), F = (t) => {
61
- const m = t.target.value, u = ie(m, n, f);
62
- if (a(u), u === "") {
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(u, n, /* @__PURE__ */ new Date(), { locale: o });
67
- if (w(x) && u.length === n.length) {
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 u = j(m);
78
- i?.(u);
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__ */ k(le, { open: c, onOpenChange: (t) => !D && h(t), children: [
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: A,
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__ */ k("div", { className: "flex items-center gap-1", children: [
99
- e && !D && /* @__PURE__ */ k(E, { children: [
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": g("calendar.clear"),
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: g("calendar.clear") })
113
+ /* @__PURE__ */ r($, { variant: "tertiary", side: "top", children: k("calendar.clear") })
114
114
  ] }),
115
- /* @__PURE__ */ k(E, { children: [
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: g("datePicker.selectWeek") })
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: T,
147
- weekStartsOn: V,
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, PopoverTrigger as Ce, PopoverContent as Ie } from "../popover.js";
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: T = 1,
28
- weekStartsOn: O = 1,
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: T,
63
- weekStartsOn: O
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 h = { from: void 0, to: v?.to };
68
- m(h), y || b?.(h);
67
+ const g = { from: void 0, to: v?.to };
68
+ m(g), y || b?.(g);
69
69
  return;
70
70
  }
71
- const g = I(d, n, /* @__PURE__ */ new Date(), { locale: o });
72
- if (C(g) && d.length === n.length) {
73
- const N = { from: E(g), to: v?.to };
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 h = { from: v?.from, to: void 0 };
80
- m(h), y || b?.(h);
79
+ const g = { from: v?.from, to: void 0 };
80
+ m(g), y || b?.(g);
81
81
  return;
82
82
  }
83
- const g = I(d, n, /* @__PURE__ */ new Date(), { locale: o });
84
- if (C(g) && d.length === n.length) {
85
- const h = E(g), N = { from: v?.from, to: h };
86
- m(N), v?.from && u(s(v.from.startDate, n, { locale: o })), g && j(g), y || b?.(N);
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 }), g = I(w, n, /* @__PURE__ */ new Date(), { locale: o }), h = C(d) && e.length === n.length, N = C(g) && w.length === n.length;
91
- if (!h || !N)
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(g);
94
+ const De = E(d), ve = E(h);
95
95
  b?.({ from: De, to: ve });
96
96
  }
97
- }, ge = t?.from ? s(t.from.startDate, n, { locale: o }) : "", he = a(t) ? s(a(t), n, { locale: o }) : "", ke = ge !== R, we = he !== 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 }));
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: T,
241
- weekStartsOn: O,
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 | 12 | 6;
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> {
@@ -1,4 +1,4 @@
1
- const t = new URL("../../../../assets/empty-state-1-Bqh-20pq.webp", import.meta.url).href;
1
+ const t = new URL("../../../../assets/empty-state-1-3H9kriwm.webp", import.meta.url).href;
2
2
  export {
3
3
  t as default
4
4
  };
@@ -1,4 +1,4 @@
1
- const t = new URL("../../../../assets/empty-state-2-DPMRkOBw.webp", import.meta.url).href;
1
+ const e = new URL("../../../../assets/empty-state-2-Brn6WD3e.webp", import.meta.url).href;
2
2
  export {
3
- t as default
3
+ e as default
4
4
  };
@@ -1,4 +1,4 @@
1
- const t = new URL("../../../../assets/empty-state-3-BqSOh0-t.webp", import.meta.url).href;
1
+ const t = new URL("../../../../assets/empty-state-3-CqLldG5q.webp", import.meta.url).href;
2
2
  export {
3
3
  t as default
4
4
  };
@@ -1,4 +1,4 @@
1
- const t = new URL("../../../../assets/empty-state-4-CjN-c01q.webp", import.meta.url).href;
1
+ const t = new URL("../../../../assets/empty-state-4-Br-xaUJO.webp", import.meta.url).href;
2
2
  export {
3
3
  t as default
4
4
  };
@@ -1,4 +1,4 @@
1
- const t = new URL("../../../../assets/empty-state-5-D4RMA1H1.webp", import.meta.url).href;
1
+ const t = new URL("../../../../assets/empty-state-5-BanvbHv1.webp", import.meta.url).href;
2
2
  export {
3
3
  t as default
4
4
  };
@@ -1,4 +1,4 @@
1
- const t = new URL("../../../../assets/empty-state-6-Dlnf1-2W.webp", import.meta.url).href;
1
+ const e = new URL("../../../../assets/empty-state-6-Egbfj9Fe.webp", import.meta.url).href;
2
2
  export {
3
- t as default
3
+ e as default
4
4
  };
@@ -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
- src: string;
10
+ loadSrc: () => Promise<string>;
11
11
  }
12
- export declare const EMPTY_STATE_IMAGES: EmptyStateImageEntry[];
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
- import t from "./assets/empty-state-1.webp.js";
2
- import r from "./assets/empty-state-2.webp.js";
3
- import e from "./assets/empty-state-3.webp.js";
4
- import m from "./assets/empty-state-4.webp.js";
5
- import p from "./assets/empty-state-5.webp.js";
6
- import a from "./assets/empty-state-6.webp.js";
7
- const y = [
8
- { width: 225, height: 150, src: t },
9
- { width: 200, height: 200, src: r },
10
- { width: 225, height: 150, src: e },
11
- { width: 250, height: 180, src: m },
12
- { width: 225, height: 150, src: p },
13
- { width: 225, height: 150, src: a }
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
- y as EMPTY_STATE_IMAGES,
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 r } from "react/jsx-runtime";
2
- import * as m from "react";
3
- import { Slot as c } from "@radix-ui/react-slot";
4
- import { cn as l } from "../../lib/utils.js";
5
- import { EMPTY_STATE_IMAGES as u } from "./empty-container/emptyStateIllustrations.js";
6
- const E = m.forwardRef(
7
- ({ className: a, children: t, asChild: e = !1, ...o }, n) => /* @__PURE__ */ r(
8
- e ? c : "div",
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: l(
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__ */ r("div", { className: "flex flex-col items-center max-w-[650px]", children: t })
17
+ children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center max-w-[650px]", children: t })
18
18
  }
19
19
  )
20
20
  );
21
- E.displayName = "EmptyContainer";
22
- const b = m.forwardRef(
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: i,
30
- asChild: y = !1,
31
- ...p
32
- }, x) => {
33
- const [f] = m.useState(() => t || e ? null : Math.floor(Math.random() * u.length)), s = f !== null ? u[f] : null, C = n || (t ? "auto" : s?.width ?? 225), g = i || (t ? "auto" : s?.height ?? 150), h = () => {
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 d = e ?? s?.src;
37
- return d ? /* @__PURE__ */ r(
51
+ const c = e ?? l?.imageSource;
52
+ return c ? /* @__PURE__ */ s(
38
53
  "img",
39
54
  {
40
- src: d,
55
+ src: c,
41
56
  alt: o,
42
57
  className: "object-contain shrink-0 select-none",
43
58
  style: {
44
- width: n || s?.width || "100%",
45
- height: i || s?.height || "100%"
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__ */ r(
51
- y ? c : "div",
65
+ return /* @__PURE__ */ s(
66
+ p ? f : "div",
52
67
  {
53
- ref: x,
54
- className: l(
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: g,
62
- ...p.style
76
+ height: E,
77
+ ...u.style
63
78
  },
64
79
  "data-component": "empty-container-image",
65
- ...p,
66
- children: h()
80
+ ...u,
81
+ children: w()
67
82
  }
68
83
  );
69
84
  }
70
85
  );
71
- b.displayName = "EmptyContainerImage";
72
- const w = m.forwardRef(({ className: a, children: t, asChild: e = !1, ...o }, n) => /* @__PURE__ */ r(
73
- e ? c : "h3",
74
- {
75
- ref: n,
76
- className: l(
77
- "text-xl font-bold tracking-tight leading-[30px] text-content",
78
- a
79
- ),
80
- "data-component": "empty-container-title",
81
- ...o,
82
- children: t
83
- }
84
- ));
85
- w.displayName = "EmptyContainerTitle";
86
- const N = m.forwardRef(({ className: a, children: t, asChild: e = !1, ...o }, n) => /* @__PURE__ */ r(
87
- e ? c : "p",
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: l(
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
- N.displayName = "EmptyContainerDescription";
100
- const v = m.forwardRef(({ className: a, children: t, asChild: e = !1, ...o }, n) => /* @__PURE__ */ r(
101
- e ? c : "div",
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: l(
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
- v.displayName = "EmptyContainerAction";
137
+ T.displayName = "EmptyContainerAction";
114
138
  export {
115
- E as EmptyContainer,
116
- v as EmptyContainerAction,
117
- N as EmptyContainerDescription,
118
- b as EmptyContainerImage,
119
- w as EmptyContainerTitle
139
+ b as EmptyContainer,
140
+ T as EmptyContainerAction,
141
+ R as EmptyContainerDescription,
142
+ S as EmptyContainerImage,
143
+ A as EmptyContainerTitle
120
144
  };