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,9 +1,10 @@
1
- import { jsx as t, jsxs as d } from "react/jsx-runtime";
2
- import * as x from "react";
3
- import { cva as c } from "class-variance-authority";
4
- import { Check as w } from "lucide-react";
1
+ import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
+ import * as h from "react";
3
+ import { cva as m } from "class-variance-authority";
4
+ import { Check as V } from "lucide-react";
5
5
  import { cn as a } from "../../lib/utils.js";
6
- const N = c("flex w-full gap-0", {
6
+ import { useImpactNovaI18n as j } from "../../i18n/ImpactNovaI18nContext.js";
7
+ const I = m("flex w-full gap-0", {
7
8
  variants: {
8
9
  orientation: {
9
10
  horizontal: "flex-row items-center",
@@ -13,7 +14,7 @@ const N = c("flex w-full gap-0", {
13
14
  defaultVariants: {
14
15
  orientation: "horizontal"
15
16
  }
16
- }), y = c(
17
+ }), _ = m(
17
18
  "relative flex items-center transition-all duration-200",
18
19
  {
19
20
  variants: {
@@ -66,7 +67,7 @@ const N = c("flex w-full gap-0", {
66
67
  status: "default"
67
68
  }
68
69
  }
69
- ), z = c(
70
+ ), D = m(
70
71
  "flex h-6 w-6 shrink-0 items-center justify-center rounded-[8px] text-xs font-extrabold transition-all",
71
72
  {
72
73
  variants: {
@@ -80,62 +81,73 @@ const N = c("flex w-full gap-0", {
80
81
  status: "default"
81
82
  }
82
83
  }
83
- ), V = x.forwardRef(
84
- ({ className: u, currentStep: f, steps: p, orientation: e = "horizontal", onStepClick: m, ...h }, v) => /* @__PURE__ */ t(
85
- "div",
86
- {
87
- ref: v,
88
- className: a(N({ orientation: e }), u),
89
- "data-orientation": e,
90
- ...h,
91
- children: p.map((l, s) => {
92
- const o = typeof l == "string" ? { label: l } : l, i = s + 1, g = i === f, b = i < f, n = o.disabled, r = b ? "completed" : g ? "active" : "default";
93
- return /* @__PURE__ */ d(x.Fragment, { children: [
94
- /* @__PURE__ */ d(
95
- "div",
96
- {
97
- onClick: () => !n && m?.(s),
98
- "data-step": i,
99
- "data-status": r,
100
- "data-disabled": n || void 0,
101
- className: a(
102
- y({ orientation: e, status: r }),
103
- e === "horizontal" && "min-w-[140px]",
104
- n ? "opacity-80 cursor-not-allowed" : m ? "cursor-pointer" : "cursor-default"
105
- ),
106
- children: [
107
- /* @__PURE__ */ t("div", { className: a(z({ status: r }), "mr-2"), children: b ? /* @__PURE__ */ t(w, { className: "h-4 w-4 stroke-[3px]" }) : /* @__PURE__ */ t("span", { children: o.icon || i }) }),
108
- /* @__PURE__ */ d("div", { className: "flex flex-col justify-center overflow-hidden", children: [
109
- /* @__PURE__ */ t("div", { className: a(
110
- "text-[14px] leading-tight font-medium truncate max-w-[200px]",
111
- r === "completed" ? "text-[#3bb273]" : "text-foreground",
112
- r === "active" && e === "vertical" ? "text-primary" : ""
113
- ), children: o.label }),
114
- o.description && /* @__PURE__ */ t("div", { className: a(
115
- "text-[12px] leading-tight mt-0.5 truncate max-w-[200px]",
116
- r === "completed" ? "text-[#3bb273]" : "text-muted-foreground"
117
- ), children: o.description })
118
- ] })
119
- ]
120
- }
121
- ),
122
- s < p.length - 1 && /* @__PURE__ */ t(
123
- "div",
124
- {
125
- className: a(
126
- "border-t border-dashed border-[#d9dde7] transition-colors",
127
- e === "horizontal" ? "flex-1 min-w-[24px] mx-1 self-center" : "h-6 w-0 border-l ml-[12px] my-[-4px]"
128
- )
129
- }
130
- )
131
- ] }, s);
132
- })
133
- }
134
- )
84
+ ), k = h.forwardRef(
85
+ ({ className: v, currentStep: b, steps: d, orientation: e = "horizontal", onStepClick: o, ...g }, w) => {
86
+ const { t: y } = j(), N = d.length;
87
+ return /* @__PURE__ */ t(
88
+ "div",
89
+ {
90
+ ref: w,
91
+ className: a(I({ orientation: e }), v),
92
+ "data-orientation": e,
93
+ role: "list",
94
+ ...g,
95
+ children: d.map((c, s) => {
96
+ const i = typeof c == "string" ? { label: c } : c, l = s + 1, u = l === b, x = l < b, n = i.disabled, r = x ? "completed" : u ? "active" : "default", z = y("stepper.stepOfTotal", { current: l, total: N });
97
+ return /* @__PURE__ */ p(h.Fragment, { children: [
98
+ /* @__PURE__ */ p(
99
+ "div",
100
+ {
101
+ role: "listitem",
102
+ onClick: () => !n && o?.(s),
103
+ "aria-label": z,
104
+ "aria-current": u ? "step" : void 0,
105
+ tabIndex: o && !n ? 0 : void 0,
106
+ onKeyDown: o && !n ? (f) => {
107
+ (f.key === "Enter" || f.key === " ") && (f.preventDefault(), o(s));
108
+ } : void 0,
109
+ "data-step": l,
110
+ "data-status": r,
111
+ "data-disabled": n || void 0,
112
+ className: a(
113
+ _({ orientation: e, status: r }),
114
+ e === "horizontal" && "min-w-[140px]",
115
+ n ? "opacity-80 cursor-not-allowed" : o ? "cursor-pointer" : "cursor-default"
116
+ ),
117
+ children: [
118
+ /* @__PURE__ */ t("div", { className: a(D({ status: r }), "mr-2"), children: x ? /* @__PURE__ */ t(V, { className: "h-4 w-4 stroke-[3px]" }) : /* @__PURE__ */ t("span", { children: i.icon || l }) }),
119
+ /* @__PURE__ */ p("div", { className: "flex flex-col justify-center overflow-hidden", children: [
120
+ /* @__PURE__ */ t("div", { className: a(
121
+ "text-[14px] leading-tight font-medium truncate max-w-[200px]",
122
+ r === "completed" ? "text-[#3bb273]" : "text-foreground",
123
+ r === "active" && e === "vertical" ? "text-primary" : ""
124
+ ), children: i.label }),
125
+ i.description && /* @__PURE__ */ t("div", { className: a(
126
+ "text-[12px] leading-tight mt-0.5 truncate max-w-[200px]",
127
+ r === "completed" ? "text-[#3bb273]" : "text-muted-foreground"
128
+ ), children: i.description })
129
+ ] })
130
+ ]
131
+ }
132
+ ),
133
+ s < d.length - 1 && /* @__PURE__ */ t(
134
+ "div",
135
+ {
136
+ className: a(
137
+ "border-t border-dashed border-[#d9dde7] transition-colors",
138
+ e === "horizontal" ? "flex-1 min-w-[24px] mx-1 self-center" : "h-6 w-0 border-l ml-[12px] my-[-4px]"
139
+ )
140
+ }
141
+ )
142
+ ] }, s);
143
+ })
144
+ }
145
+ );
146
+ }
135
147
  );
136
- V.displayName = "Stepper";
148
+ k.displayName = "Stepper";
137
149
  export {
138
- V as Stepper,
139
- y as stepVariants,
140
- N as stepperVariants
150
+ k as Stepper,
151
+ _ as stepVariants,
152
+ I as stepperVariants
141
153
  };
@@ -1,11 +1,12 @@
1
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import * as m from "react";
3
- import { Slot as x } from "@radix-ui/react-slot";
4
- import { cva as h } from "class-variance-authority";
5
- import { X as u } from "lucide-react";
6
- import { Button as v } from "./button.js";
7
- import { cn as w } from "../../lib/utils.js";
8
- const y = h(
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import * as x from "react";
3
+ import { Slot as h } from "@radix-ui/react-slot";
4
+ import { cva as u } from "class-variance-authority";
5
+ import { X as v } from "lucide-react";
6
+ import { Button as w } from "./button.js";
7
+ import { cn as y } from "../../lib/utils.js";
8
+ import { useImpactNovaI18n as N } from "../../i18n/ImpactNovaI18nContext.js";
9
+ const j = u(
9
10
  "inline-flex items-center justify-center rounded-full transition-colors whitespace-nowrap focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
10
11
  {
11
12
  variants: {
@@ -38,42 +39,45 @@ const y = h(
38
39
  shape: "pill"
39
40
  }
40
41
  }
41
- ), j = m.forwardRef(
42
- ({ className: i, variant: r, size: t, shape: o, leftIcon: a, rightIcon: n, removable: s, onRemove: d, asChild: l = !1, children: p, ...f }, g) => /* @__PURE__ */ c(
43
- l ? x : "span",
44
- {
45
- ref: g,
46
- className: w(y({ variant: r, size: t, shape: o }), i),
47
- "data-component": "tag",
48
- "data-variant": r ?? "default",
49
- "data-size": t ?? "md",
50
- "data-shape": o ?? "pill",
51
- ...f,
52
- children: [
53
- a && /* @__PURE__ */ e("span", { className: "mr-1.5 flex shrink-0 items-center justify-center", children: a }),
54
- p,
55
- n && /* @__PURE__ */ e("span", { className: "ml-1.5 flex shrink-0 items-center justify-center", children: n }),
56
- s && /* @__PURE__ */ e(
57
- v,
58
- {
59
- type: "button",
60
- variant: "ghost",
61
- size: "icon",
62
- "aria-label": "Remove",
63
- onClick: (b) => {
64
- b.stopPropagation(), d?.();
65
- },
66
- className: "ml-1.5 h-4 w-4 shrink-0 rounded-full hover:bg-black/10 transition-colors p-0 [&_svg]:size-3",
67
- "data-component": "tag-remove",
68
- children: /* @__PURE__ */ e(u, {})
69
- }
70
- )
71
- ]
72
- }
73
- )
42
+ ), k = x.forwardRef(
43
+ ({ className: i, variant: r, size: t, shape: o, leftIcon: a, rightIcon: n, removable: s, onRemove: d, asChild: l = !1, children: p, ...f }, g) => {
44
+ const { t: b } = N();
45
+ return /* @__PURE__ */ m(
46
+ l ? h : "span",
47
+ {
48
+ ref: g,
49
+ className: y(j({ variant: r, size: t, shape: o }), i),
50
+ "data-component": "tag",
51
+ "data-variant": r ?? "default",
52
+ "data-size": t ?? "md",
53
+ "data-shape": o ?? "pill",
54
+ ...f,
55
+ children: [
56
+ a && /* @__PURE__ */ e("span", { className: "mr-1.5 flex shrink-0 items-center justify-center", children: a }),
57
+ p,
58
+ n && /* @__PURE__ */ e("span", { className: "ml-1.5 flex shrink-0 items-center justify-center", children: n }),
59
+ s && /* @__PURE__ */ e(
60
+ w,
61
+ {
62
+ type: "button",
63
+ variant: "ghost",
64
+ size: "icon",
65
+ "aria-label": b("aria.remove"),
66
+ onClick: (c) => {
67
+ c.stopPropagation(), d?.();
68
+ },
69
+ className: "ml-1.5 h-4 w-4 shrink-0 rounded-full hover:bg-black/10 transition-colors p-0 [&_svg]:size-3",
70
+ "data-component": "tag-remove",
71
+ children: /* @__PURE__ */ e(v, {})
72
+ }
73
+ )
74
+ ]
75
+ }
76
+ );
77
+ }
74
78
  );
75
- j.displayName = "Tag";
79
+ k.displayName = "Tag";
76
80
  export {
77
- j as Tag,
78
- y as tagVariants
81
+ k as Tag,
82
+ j as tagVariants
79
83
  };
@@ -1,11 +1,12 @@
1
- import { jsx as a, jsxs as d } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as p } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
3
  import * as o from "@radix-ui/react-toast";
4
- import { cva as p } from "class-variance-authority";
5
- import { X as c } from "lucide-react";
4
+ import { cva as c } from "class-variance-authority";
5
+ import { X as f } from "lucide-react";
6
6
  import { cn as i } from "../../lib/utils.js";
7
- import { Tooltip as f, TooltipTrigger as l, TooltipContent as u } from "./tooltip.js";
8
- const R = o.Provider, x = s.forwardRef(({ className: t, position: e = "top-right", ...r }, n) => /* @__PURE__ */ a(
7
+ import { Tooltip as l, TooltipTrigger as u, TooltipContent as m } from "./tooltip.js";
8
+ import { useImpactNovaI18n as x } from "../../i18n/ImpactNovaI18nContext.js";
9
+ const A = o.Provider, b = s.forwardRef(({ className: t, position: e = "top-right", ...r }, n) => /* @__PURE__ */ a(
9
10
  o.Viewport,
10
11
  {
11
12
  ref: n,
@@ -19,8 +20,8 @@ const R = o.Provider, x = s.forwardRef(({ className: t, position: e = "top-right
19
20
  ...r
20
21
  }
21
22
  ));
22
- x.displayName = o.Viewport.displayName;
23
- const m = p(
23
+ b.displayName = o.Viewport.displayName;
24
+ const g = c(
24
25
  "group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
25
26
  {
26
27
  variants: {
@@ -39,18 +40,18 @@ const m = p(
39
40
  variant: "default"
40
41
  }
41
42
  }
42
- ), b = s.forwardRef(({ className: t, variant: e, ...r }, n) => /* @__PURE__ */ a(
43
+ ), h = s.forwardRef(({ className: t, variant: e, ...r }, n) => /* @__PURE__ */ a(
43
44
  o.Root,
44
45
  {
45
46
  ref: n,
46
47
  "data-component": "toast",
47
48
  "data-variant": e ?? "default",
48
- className: i(m({ variant: e }), t),
49
+ className: i(g({ variant: e }), t),
49
50
  ...r
50
51
  }
51
52
  ));
52
- b.displayName = o.Root.displayName;
53
- const g = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
53
+ h.displayName = o.Root.displayName;
54
+ const v = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
54
55
  o.Action,
55
56
  {
56
57
  ref: r,
@@ -62,26 +63,30 @@ const g = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
62
63
  ...e
63
64
  }
64
65
  ));
65
- g.displayName = o.Action.displayName;
66
- const h = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ d(f, { children: [
67
- /* @__PURE__ */ a(l, { asChild: !0, children: /* @__PURE__ */ a(
68
- o.Close,
69
- {
70
- ref: r,
71
- "data-component": "toast-close",
72
- className: i(
73
- "absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
74
- t
75
- ),
76
- "toast-close": "",
77
- ...e,
78
- children: /* @__PURE__ */ a(c, { className: "h-4 w-4" })
79
- }
80
- ) }),
81
- /* @__PURE__ */ a(u, { variant: "tertiary", side: "top", children: "Close" })
82
- ] }));
83
- h.displayName = o.Close.displayName;
84
- const v = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
66
+ v.displayName = o.Action.displayName;
67
+ const w = s.forwardRef(({ className: t, ...e }, r) => {
68
+ const { t: n } = x(), d = n("aria.close");
69
+ return /* @__PURE__ */ p(l, { children: [
70
+ /* @__PURE__ */ a(u, { asChild: !0, children: /* @__PURE__ */ a(
71
+ o.Close,
72
+ {
73
+ ref: r,
74
+ "data-component": "toast-close",
75
+ className: i(
76
+ "absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
77
+ t
78
+ ),
79
+ "toast-close": "",
80
+ "aria-label": d,
81
+ ...e,
82
+ children: /* @__PURE__ */ a(f, { className: "h-4 w-4" })
83
+ }
84
+ ) }),
85
+ /* @__PURE__ */ a(m, { variant: "tertiary", side: "top", children: d })
86
+ ] });
87
+ });
88
+ w.displayName = o.Close.displayName;
89
+ const y = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
85
90
  o.Title,
86
91
  {
87
92
  ref: r,
@@ -90,8 +95,8 @@ const v = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
90
95
  ...e
91
96
  }
92
97
  ));
93
- v.displayName = o.Title.displayName;
94
- const w = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
98
+ y.displayName = o.Title.displayName;
99
+ const _ = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
95
100
  o.Description,
96
101
  {
97
102
  ref: r,
@@ -100,13 +105,13 @@ const w = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
100
105
  ...e
101
106
  }
102
107
  ));
103
- w.displayName = o.Description.displayName;
108
+ _.displayName = o.Description.displayName;
104
109
  export {
105
- b as Toast,
106
- g as ToastAction,
107
- h as ToastClose,
108
- w as ToastDescription,
109
- R as ToastProvider,
110
- v as ToastTitle,
111
- x as ToastViewport
110
+ h as Toast,
111
+ v as ToastAction,
112
+ w as ToastClose,
113
+ _ as ToastDescription,
114
+ A as ToastProvider,
115
+ y as ToastTitle,
116
+ b as ToastViewport
112
117
  };
@@ -0,0 +1,21 @@
1
+ import { ImpactNovaMessages } from './defaultMessages';
2
+ import * as React from 'react';
3
+ export type I18nParams = {
4
+ count?: number;
5
+ [key: string]: string | number | undefined;
6
+ };
7
+ export interface ImpactNovaI18nContextValue {
8
+ locale: string;
9
+ messages: ImpactNovaMessages;
10
+ /** Translate a key path (e.g. 'calendar.apply'). Supports {{count}}, {{current}}, {{total}}, etc. in values. */
11
+ t: (key: string, params?: I18nParams) => string;
12
+ }
13
+ export interface ImpactNovaI18nProviderProps {
14
+ children: React.ReactNode;
15
+ /** BCP 47 locale code (e.g. 'en', 'de'). Used for date/number formatting. Default 'en'. */
16
+ locale?: string;
17
+ /** Partial or full message overrides. Merged over built-in English defaults. */
18
+ messages?: Partial<ImpactNovaMessages>;
19
+ }
20
+ export declare function ImpactNovaI18nProvider({ children, locale, messages: messagesOverride, }: ImpactNovaI18nProviderProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function useImpactNovaI18n(): ImpactNovaI18nContextValue;
@@ -0,0 +1,76 @@
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import * as c from "react";
3
+ import { defaultMessages as u } from "./defaultMessages.js";
4
+ function f(o, n) {
5
+ const e = n.split(".");
6
+ let t = o;
7
+ for (const r of e) {
8
+ if (t == null || typeof t != "object") return;
9
+ t = t[r];
10
+ }
11
+ return typeof t == "string" ? t : void 0;
12
+ }
13
+ function g(o, n) {
14
+ const e = { ...o };
15
+ for (const t of Object.keys(n)) {
16
+ const r = n[t];
17
+ if (r != null && typeof r == "object" && !Array.isArray(r)) {
18
+ const s = e[t];
19
+ if (s != null && typeof s == "object" && !Array.isArray(s)) {
20
+ e[t] = g(
21
+ s,
22
+ r
23
+ );
24
+ continue;
25
+ }
26
+ }
27
+ r !== void 0 && (e[t] = r);
28
+ }
29
+ return e;
30
+ }
31
+ function l(o, n) {
32
+ if (n == null) return o;
33
+ let e = o;
34
+ for (const t of Object.keys(n)) {
35
+ const r = n[t];
36
+ r !== void 0 && (e = e.replace(new RegExp(`\\{\\{${t}\\}\\}`, "g"), String(r)));
37
+ }
38
+ return e;
39
+ }
40
+ const d = {
41
+ locale: "en",
42
+ messages: u,
43
+ t: (o, n) => {
44
+ const e = f(u, o);
45
+ return e == null ? o : l(e, n);
46
+ }
47
+ }, m = c.createContext(null);
48
+ function b({
49
+ children: o,
50
+ locale: n = "en",
51
+ messages: e
52
+ }) {
53
+ const t = c.useMemo(() => e ? g(
54
+ u,
55
+ e
56
+ ) : u, [e]), r = c.useMemo(() => ({
57
+ locale: n,
58
+ messages: t,
59
+ t: (s, i) => {
60
+ const a = f(t, s);
61
+ if (a == null) {
62
+ const p = f(u, s);
63
+ return p == null ? s : l(p, i);
64
+ }
65
+ return l(a, i);
66
+ }
67
+ }), [n, t]);
68
+ return /* @__PURE__ */ y(m.Provider, { value: r, children: o });
69
+ }
70
+ function j() {
71
+ return c.useContext(m) ?? d;
72
+ }
73
+ export {
74
+ b as ImpactNovaI18nProvider,
75
+ j as useImpactNovaI18n
76
+ };