impact-nova 1.3.0 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +49 -0
  2. package/dist/components/layout/dashboard-layout.d.ts +15 -1
  3. package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +65 -64
  4. package/dist/components/ui/accordion.js +38 -34
  5. package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +1 -1
  6. package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.d.ts +58 -0
  7. package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.js +104 -0
  8. package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +62 -54
  9. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +4 -6
  10. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +54 -68
  11. package/dist/components/ui/ag-grid-react/cell-renderers/index.d.ts +3 -1
  12. package/dist/components/ui/ag-grid-react/cell-renderers/index.js +33 -27
  13. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +3 -0
  14. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +28 -12
  15. package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.d.ts +2 -0
  16. package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +45 -44
  17. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.d.ts +4 -6
  18. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +23 -37
  19. package/dist/components/ui/ag-grid-react/cell-renderers/types.d.ts +33 -17
  20. package/dist/components/ui/ag-grid-react/editable-utils.d.ts +27 -0
  21. package/dist/components/ui/ag-grid-react/editable-utils.js +62 -0
  22. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +99 -98
  23. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +110 -143
  24. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +72 -69
  25. package/dist/components/ui/ag-grid-react/headers/components/header-info.js +36 -35
  26. package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +14 -12
  27. package/dist/components/ui/ag-grid-react/headers/custom-header.js +111 -110
  28. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +204 -203
  29. package/dist/components/ui/alert.js +62 -58
  30. package/dist/components/ui/breadcrumb.js +81 -74
  31. package/dist/components/ui/calendar.js +354 -354
  32. package/dist/components/ui/chart/chart.js +63 -62
  33. package/dist/components/ui/chips.js +42 -38
  34. package/dist/components/ui/command-palette/command-palette-context.d.ts +52 -0
  35. package/dist/components/ui/command-palette/command-palette-context.js +110 -0
  36. package/dist/components/ui/command-palette/command-palette.d.ts +67 -0
  37. package/dist/components/ui/command-palette/command-palette.js +402 -0
  38. package/dist/components/ui/command-palette/index.d.ts +23 -0
  39. package/dist/components/ui/command-palette/index.js +44 -0
  40. package/dist/components/ui/command-palette/kbd.d.ts +28 -0
  41. package/dist/components/ui/command-palette/kbd.js +52 -0
  42. package/dist/components/ui/command-palette/shortcut-registry.d.ts +68 -0
  43. package/dist/components/ui/command-palette/shortcut-registry.js +183 -0
  44. package/dist/components/ui/command-palette/shortcut-scope-provider.d.ts +55 -0
  45. package/dist/components/ui/command-palette/shortcut-scope-provider.js +55 -0
  46. package/dist/components/ui/command-palette/shortcut-settings.d.ts +27 -0
  47. package/dist/components/ui/command-palette/shortcut-settings.js +266 -0
  48. package/dist/components/ui/command-palette/use-browser-shortcuts.d.ts +32 -0
  49. package/dist/components/ui/command-palette/use-browser-shortcuts.js +48 -0
  50. package/dist/components/ui/command-palette/use-global-shortcut.d.ts +3 -0
  51. package/dist/components/ui/command-palette/use-global-shortcut.js +7 -0
  52. package/dist/components/ui/command-palette/use-shortcut.d.ts +47 -0
  53. package/dist/components/ui/command-palette/use-shortcut.js +49 -0
  54. package/dist/components/ui/command-palette/utils.d.ts +119 -0
  55. package/dist/components/ui/command-palette/utils.js +248 -0
  56. package/dist/components/ui/data-table/data-table-column-list.js +87 -86
  57. package/dist/components/ui/data-table/data-table-format-options.js +45 -44
  58. package/dist/components/ui/data-table/data-table-view-options.js +39 -38
  59. package/dist/components/ui/date-picker/date-picker.js +89 -87
  60. package/dist/components/ui/date-picker/date-range-picker.js +140 -138
  61. package/dist/components/ui/date-picker/month-picker.js +82 -81
  62. package/dist/components/ui/date-picker/month-range-picker.js +108 -105
  63. package/dist/components/ui/date-picker/multi-date-picker.js +68 -66
  64. package/dist/components/ui/date-picker/multi-month-picker.js +59 -58
  65. package/dist/components/ui/date-picker/multi-week-picker.js +80 -78
  66. package/dist/components/ui/date-picker/week-picker.js +117 -115
  67. package/dist/components/ui/date-picker/week-range-picker.js +166 -164
  68. package/dist/components/ui/dialog.js +78 -73
  69. package/dist/components/ui/drawer.js +71 -66
  70. package/dist/components/ui/file-upload.js +131 -127
  71. package/dist/components/ui/filter-panel/filter-panel.js +98 -94
  72. package/dist/components/ui/filter-strip/filter-strip.js +95 -91
  73. package/dist/components/ui/filter-strip/filter-summary.js +91 -90
  74. package/dist/components/ui/header.js +57 -53
  75. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +78 -76
  76. package/dist/components/ui/loader.js +17 -16
  77. package/dist/components/ui/nested-list/components/NestedListHeader.d.ts +1 -0
  78. package/dist/components/ui/nested-list/components/NestedListHeader.js +51 -48
  79. package/dist/components/ui/nested-list/components/SortableItem.js +60 -59
  80. package/dist/components/ui/nested-list/nested-list.js +184 -182
  81. package/dist/components/ui/notification-panel/notification-panel.js +60 -53
  82. package/dist/components/ui/popover.js +45 -40
  83. package/dist/components/ui/prompt.js +90 -86
  84. package/dist/components/ui/select/select.js +206 -209
  85. package/dist/components/ui/sheet.d.ts +1 -0
  86. package/dist/components/ui/sheet.js +50 -48
  87. package/dist/components/ui/sidebar.js +273 -267
  88. package/dist/components/ui/stepper.js +75 -63
  89. package/dist/components/ui/tag.js +48 -44
  90. package/dist/components/ui/toast.js +46 -41
  91. package/dist/i18n/ImpactNovaI18nContext.d.ts +21 -0
  92. package/dist/i18n/ImpactNovaI18nContext.js +76 -0
  93. package/dist/i18n/defaultMessages.d.ts +231 -0
  94. package/dist/i18n/defaultMessages.js +206 -0
  95. package/dist/i18n/getDateFnsLocale.d.ts +11 -0
  96. package/dist/i18n/getDateFnsLocale.js +21 -0
  97. package/dist/i18n/index.d.ts +5 -0
  98. package/dist/i18n/locales/de.d.ts +2 -0
  99. package/dist/i18n/locales/de.js +206 -0
  100. package/dist/i18n/locales/es.d.ts +2 -0
  101. package/dist/i18n/locales/es.js +206 -0
  102. package/dist/i18n/locales/hi.d.ts +2 -0
  103. package/dist/i18n/locales/hi.js +206 -0
  104. package/dist/i18n/locales/index.d.ts +4 -0
  105. package/dist/i18n/locales/kn.d.ts +2 -0
  106. package/dist/i18n/locales/kn.js +206 -0
  107. package/dist/icons/assets/boxAdd.svg.js +5 -0
  108. package/dist/icons/assets/boxed.svg.js +5 -0
  109. package/dist/icons/assets/trolley.svg.js +5 -0
  110. package/dist/icons/assets/unlocked.svg.js +5 -0
  111. package/dist/icons/index.d.ts +4 -0
  112. package/dist/icons/index.js +179 -171
  113. package/dist/impact-nova.css +1 -1
  114. package/dist/index.d.ts +4 -0
  115. package/dist/index.js +232 -172
  116. package/package.json +36 -4
  117. package/dist/components/ui/ag-grid-react/cell-renderers/types.js +0 -74
@@ -1,58 +1,65 @@
1
- import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
- import { useContext as d, createContext as f } from "react";
3
- import { Sheet as m, SheetContent as h, SheetDescription as p, SheetTitle as x, SheetClose as u } from "../sheet.js";
4
- import { Button as N } from "../button.js";
5
- import { Bell as w, X as b } from "lucide-react";
6
- import { cn as a } from "../../../lib/utils.js";
7
- const l = f(null), S = () => {
8
- const e = d(l);
9
- if (!e)
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
+ import { useContext as m, createContext as h } from "react";
3
+ import { Sheet as p, SheetContent as x, SheetDescription as u, SheetTitle as N, SheetClose as w } from "../sheet.js";
4
+ import { Button as b } from "../button.js";
5
+ import { Bell as v, X as g } from "lucide-react";
6
+ import { cn as r } from "../../../lib/utils.js";
7
+ import { useImpactNovaI18n as s } from "../../../i18n/ImpactNovaI18nContext.js";
8
+ const d = h(null), B = () => {
9
+ const t = m(d);
10
+ if (!t)
10
11
  throw new Error("useNotificationContext must be used within a NotificationPanel");
11
- return e;
12
- }, D = ({
13
- open: e,
12
+ return t;
13
+ }, I = ({
14
+ open: t,
14
15
  onOpenChange: n,
15
- children: i,
16
- className: s,
17
- preventClose: c = !1
18
- }) => /* @__PURE__ */ t(l.Provider, { value: { setPreventClose: () => {
19
- } }, children: /* @__PURE__ */ t(m, { open: e, onOpenChange: n, children: /* @__PURE__ */ o(
20
- h,
21
- {
22
- side: "right",
23
- className: a(
24
- "w-full !max-w-[640px] p-0 sm:!max-w-[640px] gap-0 border-l shadow-xl transition-all duration-300 ease-in-out bg-white",
25
- s
26
- ),
27
- onInteractOutside: (r) => {
28
- c && r.preventDefault();
29
- },
30
- onEscapeKeyDown: (r) => {
31
- c && r.preventDefault();
32
- },
33
- children: [
34
- /* @__PURE__ */ t(p, { className: "sr-only", children: "Notifications" }),
35
- i
36
- ]
37
- }
38
- ) }) }), k = ({ children: e, className: n }) => /* @__PURE__ */ t("div", { "data-component": "notification-panel-content", className: a("flex h-full flex-col bg-white", n), children: e }), B = ({ title: e = "Notifications", children: n, className: i }) => /* @__PURE__ */ o("div", { "data-component": "notification-panel-header", className: a("flex shrink-0 items-center justify-between border-b px-4 py-3 bg-white", i), children: [
39
- /* @__PURE__ */ o("div", { className: "flex items-center gap-3", children: [
40
- /* @__PURE__ */ t("div", { className: "flex h-6 w-6 items-center justify-center", children: /* @__PURE__ */ t(w, { className: "h-5 w-5 text-gray-500" }) }),
41
- typeof e == "string" ? /* @__PURE__ */ t(x, { className: "text-lg font-bold text-[#1f2b4d]", children: e }) : e
42
- ] }),
43
- /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
44
- n,
45
- /* @__PURE__ */ t(u, { asChild: !0, children: /* @__PURE__ */ t(N, { variant: "secondary", size: "icon", "aria-label": "Close", "data-component": "notification-panel-close", children: /* @__PURE__ */ t(b, { className: "h-4 w-4" }) }) })
46
- ] })
47
- ] }), E = ({ children: e, className: n }) => /* @__PURE__ */ t("div", { "data-component": "notification-panel-body", className: a("flex flex-1 flex-col overflow-hidden bg-background", n), children: e }), z = ({ children: e, className: n, leftAction: i }) => /* @__PURE__ */ o("div", { "data-component": "notification-panel-footer", className: a("flex items-center justify-between border-t p-4 bg-white shrink-0 mt-auto shadow-md", n), children: [
48
- /* @__PURE__ */ t("div", { children: i }),
49
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: e })
16
+ children: o,
17
+ className: l,
18
+ preventClose: i = !1
19
+ }) => {
20
+ const { t: f } = s();
21
+ return /* @__PURE__ */ e(d.Provider, { value: { setPreventClose: () => {
22
+ } }, children: /* @__PURE__ */ e(p, { open: t, onOpenChange: n, children: /* @__PURE__ */ a(
23
+ x,
24
+ {
25
+ side: "right",
26
+ className: r(
27
+ "w-full !max-w-[640px] p-0 sm:!max-w-[640px] gap-0 border-l shadow-xl transition-all duration-300 ease-in-out bg-white",
28
+ l
29
+ ),
30
+ onInteractOutside: (c) => {
31
+ i && c.preventDefault();
32
+ },
33
+ onEscapeKeyDown: (c) => {
34
+ i && c.preventDefault();
35
+ },
36
+ children: [
37
+ /* @__PURE__ */ e(u, { className: "sr-only", children: f("notificationPanel.description") }),
38
+ o
39
+ ]
40
+ }
41
+ ) }) });
42
+ }, E = ({ children: t, className: n }) => /* @__PURE__ */ e("div", { "data-component": "notification-panel-content", className: r("flex h-full flex-col bg-white", n), children: t }), T = ({ title: t, children: n, className: o }) => {
43
+ const { t: l } = s(), i = t ?? l("notificationPanel.title");
44
+ return /* @__PURE__ */ a("div", { "data-component": "notification-panel-header", className: r("flex shrink-0 items-center justify-between border-b px-4 py-3 bg-white", o), children: [
45
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
46
+ /* @__PURE__ */ e("div", { className: "flex h-6 w-6 items-center justify-center", children: /* @__PURE__ */ e(v, { className: "h-5 w-5 text-gray-500" }) }),
47
+ typeof i == "string" ? /* @__PURE__ */ e(N, { className: "text-lg font-bold text-[#1f2b4d]", children: i }) : i
48
+ ] }),
49
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
50
+ n,
51
+ /* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ e(b, { variant: "secondary", size: "icon", "aria-label": l("aria.close"), "data-component": "notification-panel-close", children: /* @__PURE__ */ e(g, { className: "h-4 w-4" }) }) })
52
+ ] })
53
+ ] });
54
+ }, z = ({ children: t, className: n }) => /* @__PURE__ */ e("div", { "data-component": "notification-panel-body", className: r("flex flex-1 flex-col overflow-hidden bg-background", n), children: t }), F = ({ children: t, className: n, leftAction: o }) => /* @__PURE__ */ a("div", { "data-component": "notification-panel-footer", className: r("flex items-center justify-between border-t p-4 bg-white shrink-0 mt-auto shadow-md", n), children: [
55
+ /* @__PURE__ */ e("div", { children: o }),
56
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: t })
50
57
  ] });
51
58
  export {
52
- D as NotificationPanel,
53
- E as NotificationPanelBody,
54
- k as NotificationPanelContent,
55
- z as NotificationPanelFooter,
56
- B as NotificationPanelHeader,
57
- S as useNotificationContext
59
+ I as NotificationPanel,
60
+ z as NotificationPanelBody,
61
+ E as NotificationPanelContent,
62
+ F as NotificationPanelFooter,
63
+ T as NotificationPanelHeader,
64
+ B as useNotificationContext
58
65
  };
@@ -1,25 +1,26 @@
1
- import { jsx as t, jsxs as i } from "react/jsx-runtime";
2
- import * as s from "react";
1
+ import { jsx as t, jsxs as d } from "react/jsx-runtime";
2
+ import * as l from "react";
3
3
  import * as a from "@radix-ui/react-popover";
4
4
  import { X as p } from "lucide-react";
5
5
  import { Tooltip as m, TooltipTrigger as c, TooltipContent as f } from "./tooltip.js";
6
6
  import { cn as r } from "../../lib/utils.js";
7
- const w = a.Root, T = a.Trigger, j = a.Anchor, v = s.forwardRef(({ className: e, align: o = "center", sideOffset: n = 4, ...d }, l) => /* @__PURE__ */ t(a.Portal, { children: /* @__PURE__ */ t(
7
+ import { useImpactNovaI18n as v } from "../../i18n/ImpactNovaI18nContext.js";
8
+ const j = a.Root, R = a.Trigger, z = a.Anchor, h = l.forwardRef(({ className: e, align: o = "center", sideOffset: i = 4, ...s }, n) => /* @__PURE__ */ t(a.Portal, { children: /* @__PURE__ */ t(
8
9
  a.Content,
9
10
  {
10
- ref: l,
11
+ ref: n,
11
12
  align: o,
12
- sideOffset: n,
13
+ sideOffset: i,
13
14
  "data-component": "popover-content",
14
15
  className: r(
15
16
  "z-50 min-w-[240px] rounded-xl border bg-popover p-3 text-popover-foreground shadow-md outline-none overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin] pointer-events-auto",
16
17
  e
17
18
  ),
18
- ...d
19
+ ...s
19
20
  }
20
21
  ) }));
21
- v.displayName = a.Content.displayName;
22
- const h = ({
22
+ h.displayName = a.Content.displayName;
23
+ const N = ({
23
24
  className: e,
24
25
  ...o
25
26
  }) => /* @__PURE__ */ t(
@@ -29,7 +30,7 @@ const h = ({
29
30
  ...o
30
31
  }
31
32
  );
32
- h.displayName = "PopoverHeader";
33
+ N.displayName = "PopoverHeader";
33
34
  const g = ({
34
35
  className: e,
35
36
  ...o
@@ -45,47 +46,51 @@ const g = ({
45
46
  }
46
47
  );
47
48
  g.displayName = "PopoverTitle";
48
- const x = s.forwardRef(({ className: e, ...o }, n) => /* @__PURE__ */ i(m, { children: [
49
- /* @__PURE__ */ t(c, { asChild: !0, children: /* @__PURE__ */ i(
50
- a.Close,
51
- {
52
- ref: n,
53
- "data-component": "popover-close",
54
- className: r(
55
- "rounded-sm opacity-70 transition-opacity hover:opacity-100 outline-none focus:ring-0 disabled:pointer-events-none",
56
- e
57
- ),
58
- ...o,
59
- children: [
60
- /* @__PURE__ */ t(p, { className: "h-4 w-4 text-[#60697d]" }),
61
- /* @__PURE__ */ t("span", { className: "sr-only", children: "Close" })
62
- ]
63
- }
64
- ) }),
65
- /* @__PURE__ */ t(f, { variant: "tertiary", side: "top", children: "Close" })
66
- ] }));
49
+ const x = l.forwardRef(({ className: e, ...o }, i) => {
50
+ const { t: s } = v(), n = s("aria.close");
51
+ return /* @__PURE__ */ d(m, { children: [
52
+ /* @__PURE__ */ t(c, { asChild: !0, children: /* @__PURE__ */ d(
53
+ a.Close,
54
+ {
55
+ ref: i,
56
+ "data-component": "popover-close",
57
+ className: r(
58
+ "rounded-sm opacity-70 transition-opacity hover:opacity-100 outline-none focus:ring-0 disabled:pointer-events-none",
59
+ e
60
+ ),
61
+ "aria-label": n,
62
+ ...o,
63
+ children: [
64
+ /* @__PURE__ */ t(p, { className: "h-4 w-4 text-[#60697d]" }),
65
+ /* @__PURE__ */ t("span", { className: "sr-only", children: n })
66
+ ]
67
+ }
68
+ ) }),
69
+ /* @__PURE__ */ t(f, { variant: "tertiary", side: "top", children: n })
70
+ ] });
71
+ });
67
72
  x.displayName = a.Close.displayName;
68
- const N = ({
73
+ const y = ({
69
74
  className: e,
70
75
  ...o
71
76
  }) => /* @__PURE__ */ t("div", { className: r("text-sm", e), ...o });
72
- N.displayName = "PopoverBody";
73
- const y = ({
77
+ y.displayName = "PopoverBody";
78
+ const u = ({
74
79
  className: e,
75
80
  ...o
76
- }) => /* @__PURE__ */ i("div", { className: r("mt-4 flex flex-col gap-3", e), ...o, children: [
81
+ }) => /* @__PURE__ */ d("div", { className: r("mt-4 flex flex-col gap-3", e), ...o, children: [
77
82
  /* @__PURE__ */ t("div", { className: "h-[1px] w-full bg-[#f0f2f5]" }),
78
83
  /* @__PURE__ */ t("div", { className: "flex justify-end gap-2", children: o.children })
79
84
  ] });
80
- y.displayName = "PopoverFooter";
85
+ u.displayName = "PopoverFooter";
81
86
  export {
82
- w as Popover,
83
- j as PopoverAnchor,
84
- N as PopoverBody,
87
+ j as Popover,
88
+ z as PopoverAnchor,
89
+ y as PopoverBody,
85
90
  x as PopoverClose,
86
- v as PopoverContent,
87
- y as PopoverFooter,
88
- h as PopoverHeader,
91
+ h as PopoverContent,
92
+ u as PopoverFooter,
93
+ N as PopoverHeader,
89
94
  g as PopoverTitle,
90
- T as PopoverTrigger
95
+ R as PopoverTrigger
91
96
  };
@@ -1,13 +1,14 @@
1
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
- import * as m from "react";
3
- import { cva as T } from "class-variance-authority";
4
- import { X as R } from "lucide-react";
5
- import { Info3d as V, Success3d as k, Warning3d as B, Delete3d as F } from "../../icons/index.js";
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
+ import * as p from "react";
3
+ import { cva as V } from "class-variance-authority";
4
+ import { X as k } from "lucide-react";
5
+ import { Info3d as B, Success3d as F, Warning3d as H, Delete3d as S } from "../../icons/index.js";
6
6
  import { cn as r } from "../../lib/utils.js";
7
- import { Tooltip as H, TooltipTrigger as I, TooltipContent as S } from "./tooltip.js";
8
- import { Button as f } from "./button.js";
9
- import { Dialog as W, DialogContent as X, DialogHeader as q, DialogTitle as A, DialogDescription as E, DialogFooter as G } from "./dialog.js";
10
- const O = T("", {
7
+ import { Tooltip as W, TooltipTrigger as X, TooltipContent as q } from "./tooltip.js";
8
+ import { Button as m } from "./button.js";
9
+ import { Dialog as A, DialogContent as E, DialogHeader as G, DialogTitle as J, DialogDescription as K, DialogFooter as M } from "./dialog.js";
10
+ import { useImpactNovaI18n as u } from "../../i18n/ImpactNovaI18nContext.js";
11
+ const se = V("", {
11
12
  variants: {
12
13
  variant: {
13
14
  default: "",
@@ -20,64 +21,67 @@ const O = T("", {
20
21
  defaultVariants: {
21
22
  variant: "default"
22
23
  }
23
- }), J = m.forwardRef(({ className: l, ...i }, a) => /* @__PURE__ */ o(H, { children: [
24
- /* @__PURE__ */ e(I, { asChild: !0, children: /* @__PURE__ */ e(
25
- "button",
26
- {
27
- ref: a,
28
- className: r("text-[#60697d] hover:text-[#0d152c] transition-colors", l),
29
- type: "button",
30
- "aria-label": "Close",
31
- ...i,
32
- children: /* @__PURE__ */ e(R, { size: 16 })
33
- }
34
- ) }),
35
- /* @__PURE__ */ e(S, { side: "top", variant: "tertiary", children: "Close" })
36
- ] }));
37
- J.displayName = "PromptClose";
38
- const K = m.forwardRef(
24
+ }), Q = p.forwardRef(({ className: c, ...s }, l) => {
25
+ const { t: i } = u();
26
+ return /* @__PURE__ */ a(W, { children: [
27
+ /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ e(
28
+ "button",
29
+ {
30
+ ref: l,
31
+ className: r("text-[#60697d] hover:text-[#0d152c] transition-colors", c),
32
+ type: "button",
33
+ "aria-label": i("aria.close"),
34
+ ...s,
35
+ children: /* @__PURE__ */ e(k, { size: 16 })
36
+ }
37
+ ) }),
38
+ /* @__PURE__ */ e(q, { side: "top", variant: "tertiary", children: i("aria.close") })
39
+ ] });
40
+ });
41
+ Q.displayName = "PromptClose";
42
+ const U = p.forwardRef(
39
43
  ({
40
- open: l,
41
- onOpenChange: i,
42
- title: a,
43
- description: c,
44
- confirmLabel: p = "Confirm",
45
- cancelLabel: u = "Cancel",
46
- onConfirm: x,
47
- onCancel: h,
48
- confirmVariant: b,
49
- cancelVariant: g = "secondary",
44
+ open: c,
45
+ onOpenChange: s,
46
+ title: l,
47
+ description: i,
48
+ confirmLabel: x,
49
+ cancelLabel: b,
50
+ onConfirm: h,
51
+ onCancel: g,
52
+ confirmVariant: N,
53
+ cancelVariant: w = "secondary",
50
54
  variant: t = "default",
51
- showClose: C = !0,
52
- preventOutsideClick: w = !1,
55
+ showClose: v = !0,
56
+ preventOutsideClick: y = !1,
53
57
  footer: n,
54
58
  children: d,
55
- className: N,
56
- ...y
57
- }, v) => {
58
- const D = () => {
59
- x?.(), i?.(!1);
60
- }, j = () => {
61
- h?.(), i?.(!1);
62
- }, s = t !== "default", z = b || (t === "destructive" ? "destructive" : "default");
63
- return /* @__PURE__ */ e(W, { open: l, onOpenChange: i, ...y, children: /* @__PURE__ */ o(
64
- X,
59
+ className: C,
60
+ ...D
61
+ }, j) => {
62
+ const { t: f } = u(), z = b ?? f("prompt.cancel"), P = x ?? f("prompt.confirm"), T = () => {
63
+ h?.(), s?.(!1);
64
+ }, I = () => {
65
+ g?.(), s?.(!1);
66
+ }, o = t !== "default", L = N || (t === "destructive" ? "destructive" : "default");
67
+ return /* @__PURE__ */ e(A, { open: c, onOpenChange: s, ...D, children: /* @__PURE__ */ a(
68
+ E,
65
69
  {
66
- ref: v,
70
+ ref: j,
67
71
  "aria-describedby": void 0,
68
- hideClose: !C,
69
- onPointerDownOutside: (P) => {
70
- w && P.preventDefault();
72
+ hideClose: !v,
73
+ onPointerDownOutside: (R) => {
74
+ y && R.preventDefault();
71
75
  },
72
76
  className: r(
73
77
  "max-w-[400px] gap-0",
74
- s && "flex flex-col items-center p-6 pt-6 text-center",
75
- N
78
+ o && "flex flex-col items-center p-6 pt-6 text-center",
79
+ C
76
80
  ),
77
81
  "data-component": "prompt",
78
82
  "data-variant": t,
79
83
  children: [
80
- s && /* @__PURE__ */ o(
84
+ o && /* @__PURE__ */ a(
81
85
  "div",
82
86
  {
83
87
  className: r(
@@ -88,61 +92,61 @@ const K = m.forwardRef(
88
92
  t === "destructive" && "bg-[#fceeee] text-[#ef4444]"
89
93
  ),
90
94
  children: [
91
- t === "info" && /* @__PURE__ */ e(V, { size: 24 }),
92
- t === "success" && /* @__PURE__ */ e(k, { size: 24 }),
93
- t === "warning" && /* @__PURE__ */ e(B, { size: 24 }),
94
- t === "destructive" && /* @__PURE__ */ e(F, { size: 24 })
95
+ t === "info" && /* @__PURE__ */ e(B, { size: 24 }),
96
+ t === "success" && /* @__PURE__ */ e(F, { size: 24 }),
97
+ t === "warning" && /* @__PURE__ */ e(H, { size: 24 }),
98
+ t === "destructive" && /* @__PURE__ */ e(S, { size: 24 })
95
99
  ]
96
100
  }
97
101
  ),
98
- /* @__PURE__ */ o(
99
- q,
102
+ /* @__PURE__ */ a(
103
+ G,
100
104
  {
101
- className: r(s && "space-y-2 items-center bg-white border-none"),
105
+ className: r(o && "space-y-2 items-center bg-white border-none"),
102
106
  children: [
103
107
  /* @__PURE__ */ e(
104
- A,
108
+ J,
105
109
  {
106
110
  className: r(
107
- s && "text-[18px] font-extrabold text-[#1f2b4d]"
111
+ o && "text-[18px] font-extrabold text-[#1f2b4d]"
108
112
  ),
109
- children: a
113
+ children: l
110
114
  }
111
115
  ),
112
- c && /* @__PURE__ */ e(
113
- E,
116
+ i && /* @__PURE__ */ e(
117
+ K,
114
118
  {
115
- className: r(s && "text-sm text-[#60697d]"),
116
- children: c
119
+ className: r(o && "text-sm text-[#60697d]"),
120
+ children: i
117
121
  }
118
122
  )
119
123
  ]
120
124
  }
121
125
  ),
122
- d && /* @__PURE__ */ e("div", { className: r("w-full py-2", s && "text-center"), children: d }),
123
- n ? /* @__PURE__ */ e("div", { className: "w-full", children: n }) : /* @__PURE__ */ o(
124
- G,
126
+ d && /* @__PURE__ */ e("div", { className: r("w-full py-2", o && "text-center"), children: d }),
127
+ n ? /* @__PURE__ */ e("div", { className: "w-full", children: n }) : /* @__PURE__ */ a(
128
+ M,
125
129
  {
126
130
  className: r(
127
- s && "mt-6 flex flex-row justify-center gap-3 w-full sm:justify-center px-0 pb-0"
131
+ o && "mt-6 flex flex-row justify-center gap-3 w-full sm:justify-center px-0 pb-0"
128
132
  ),
129
133
  children: [
130
134
  /* @__PURE__ */ e(
131
- f,
135
+ m,
132
136
  {
133
- variant: g,
134
- onClick: j,
135
- className: r(s && "h-10 px-6"),
136
- children: u
137
+ variant: w,
138
+ onClick: I,
139
+ className: r(o && "h-10 px-6"),
140
+ children: z
137
141
  }
138
142
  ),
139
143
  /* @__PURE__ */ e(
140
- f,
144
+ m,
141
145
  {
142
- variant: z,
143
- onClick: D,
144
- className: r(s && "h-10 px-6"),
145
- children: p
146
+ variant: L,
147
+ onClick: T,
148
+ className: r(o && "h-10 px-6"),
149
+ children: P
146
150
  }
147
151
  )
148
152
  ]
@@ -153,9 +157,9 @@ const K = m.forwardRef(
153
157
  ) });
154
158
  }
155
159
  );
156
- K.displayName = "Prompt";
160
+ U.displayName = "Prompt";
157
161
  export {
158
- K as Prompt,
159
- J as PromptClose,
160
- O as promptVariants
162
+ U as Prompt,
163
+ Q as PromptClose,
164
+ se as promptVariants
161
165
  };