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.
- package/README.md +49 -0
- package/dist/components/layout/dashboard-layout.d.ts +15 -1
- package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +65 -64
- package/dist/components/ui/accordion.js +38 -34
- package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.d.ts +58 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.js +104 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +62 -54
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +4 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +54 -68
- package/dist/components/ui/ag-grid-react/cell-renderers/index.d.ts +3 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/index.js +33 -27
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +3 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +28 -12
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.d.ts +2 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +45 -44
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.d.ts +4 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +23 -37
- package/dist/components/ui/ag-grid-react/cell-renderers/types.d.ts +33 -17
- package/dist/components/ui/ag-grid-react/editable-utils.d.ts +27 -0
- package/dist/components/ui/ag-grid-react/editable-utils.js +62 -0
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +99 -98
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +110 -143
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +72 -69
- package/dist/components/ui/ag-grid-react/headers/components/header-info.js +36 -35
- package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +14 -12
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +111 -110
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +204 -203
- package/dist/components/ui/alert.js +62 -58
- package/dist/components/ui/breadcrumb.js +81 -74
- package/dist/components/ui/calendar.js +354 -354
- package/dist/components/ui/chart/chart.js +63 -62
- package/dist/components/ui/chips.js +42 -38
- package/dist/components/ui/command-palette/command-palette-context.d.ts +52 -0
- package/dist/components/ui/command-palette/command-palette-context.js +110 -0
- package/dist/components/ui/command-palette/command-palette.d.ts +67 -0
- package/dist/components/ui/command-palette/command-palette.js +402 -0
- package/dist/components/ui/command-palette/index.d.ts +23 -0
- package/dist/components/ui/command-palette/index.js +44 -0
- package/dist/components/ui/command-palette/kbd.d.ts +28 -0
- package/dist/components/ui/command-palette/kbd.js +52 -0
- package/dist/components/ui/command-palette/shortcut-registry.d.ts +68 -0
- package/dist/components/ui/command-palette/shortcut-registry.js +183 -0
- package/dist/components/ui/command-palette/shortcut-scope-provider.d.ts +55 -0
- package/dist/components/ui/command-palette/shortcut-scope-provider.js +55 -0
- package/dist/components/ui/command-palette/shortcut-settings.d.ts +27 -0
- package/dist/components/ui/command-palette/shortcut-settings.js +266 -0
- package/dist/components/ui/command-palette/use-browser-shortcuts.d.ts +32 -0
- package/dist/components/ui/command-palette/use-browser-shortcuts.js +48 -0
- package/dist/components/ui/command-palette/use-global-shortcut.d.ts +3 -0
- package/dist/components/ui/command-palette/use-global-shortcut.js +7 -0
- package/dist/components/ui/command-palette/use-shortcut.d.ts +47 -0
- package/dist/components/ui/command-palette/use-shortcut.js +49 -0
- package/dist/components/ui/command-palette/utils.d.ts +119 -0
- package/dist/components/ui/command-palette/utils.js +248 -0
- package/dist/components/ui/data-table/data-table-column-list.js +87 -86
- package/dist/components/ui/data-table/data-table-format-options.js +45 -44
- package/dist/components/ui/data-table/data-table-view-options.js +39 -38
- package/dist/components/ui/date-picker/date-picker.js +89 -87
- package/dist/components/ui/date-picker/date-range-picker.js +140 -138
- package/dist/components/ui/date-picker/month-picker.js +82 -81
- package/dist/components/ui/date-picker/month-range-picker.js +108 -105
- package/dist/components/ui/date-picker/multi-date-picker.js +68 -66
- package/dist/components/ui/date-picker/multi-month-picker.js +59 -58
- package/dist/components/ui/date-picker/multi-week-picker.js +80 -78
- package/dist/components/ui/date-picker/week-picker.js +117 -115
- package/dist/components/ui/date-picker/week-range-picker.js +166 -164
- package/dist/components/ui/dialog.js +78 -73
- package/dist/components/ui/drawer.js +71 -66
- package/dist/components/ui/file-upload.js +131 -127
- package/dist/components/ui/filter-panel/filter-panel.js +98 -94
- package/dist/components/ui/filter-strip/filter-strip.js +95 -91
- package/dist/components/ui/filter-strip/filter-summary.js +91 -90
- package/dist/components/ui/header.js +57 -53
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +78 -76
- package/dist/components/ui/loader.js +17 -16
- package/dist/components/ui/nested-list/components/NestedListHeader.d.ts +1 -0
- package/dist/components/ui/nested-list/components/NestedListHeader.js +51 -48
- package/dist/components/ui/nested-list/components/SortableItem.js +60 -59
- package/dist/components/ui/nested-list/nested-list.js +184 -182
- package/dist/components/ui/notification-panel/notification-panel.js +60 -53
- package/dist/components/ui/popover.js +45 -40
- package/dist/components/ui/prompt.js +90 -86
- package/dist/components/ui/select/select.js +206 -209
- package/dist/components/ui/sheet.d.ts +1 -0
- package/dist/components/ui/sheet.js +50 -48
- package/dist/components/ui/sidebar.js +273 -267
- package/dist/components/ui/stepper.js +75 -63
- package/dist/components/ui/tag.js +48 -44
- package/dist/components/ui/toast.js +46 -41
- package/dist/i18n/ImpactNovaI18nContext.d.ts +21 -0
- package/dist/i18n/ImpactNovaI18nContext.js +76 -0
- package/dist/i18n/defaultMessages.d.ts +231 -0
- package/dist/i18n/defaultMessages.js +206 -0
- package/dist/i18n/getDateFnsLocale.d.ts +11 -0
- package/dist/i18n/getDateFnsLocale.js +21 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/locales/de.d.ts +2 -0
- package/dist/i18n/locales/de.js +206 -0
- package/dist/i18n/locales/es.d.ts +2 -0
- package/dist/i18n/locales/es.js +206 -0
- package/dist/i18n/locales/hi.d.ts +2 -0
- package/dist/i18n/locales/hi.js +206 -0
- package/dist/i18n/locales/index.d.ts +4 -0
- package/dist/i18n/locales/kn.d.ts +2 -0
- package/dist/i18n/locales/kn.js +206 -0
- package/dist/icons/assets/boxAdd.svg.js +5 -0
- package/dist/icons/assets/boxed.svg.js +5 -0
- package/dist/icons/assets/trolley.svg.js +5 -0
- package/dist/icons/assets/unlocked.svg.js +5 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +179 -171
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +232 -172
- package/package.json +36 -4
- package/dist/components/ui/ag-grid-react/cell-renderers/types.js +0 -74
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { Check as
|
|
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
|
-
|
|
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
|
-
}),
|
|
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
|
-
),
|
|
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
|
-
),
|
|
84
|
-
({ className:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
), children:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
148
|
+
k.displayName = "Stepper";
|
|
137
149
|
export {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
150
|
+
k as Stepper,
|
|
151
|
+
_ as stepVariants,
|
|
152
|
+
I as stepperVariants
|
|
141
153
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { X as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { cn as
|
|
8
|
-
|
|
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
|
-
),
|
|
42
|
-
({ className: i, variant: r, size: t, shape: o, leftIcon: a, rightIcon: n, removable: s, onRemove: d, asChild: l = !1, children: p, ...f }, g) =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
b.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
79
|
+
k.displayName = "Tag";
|
|
76
80
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
k as Tag,
|
|
82
|
+
j as tagVariants
|
|
79
83
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
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
|
|
5
|
-
import { X as
|
|
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
|
|
8
|
-
|
|
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
|
-
|
|
23
|
-
const
|
|
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
|
-
),
|
|
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(
|
|
49
|
+
className: i(g({ variant: e }), t),
|
|
49
50
|
...r
|
|
50
51
|
}
|
|
51
52
|
));
|
|
52
|
-
|
|
53
|
-
const
|
|
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
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
94
|
-
const
|
|
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
|
-
|
|
108
|
+
_.displayName = o.Description.displayName;
|
|
104
109
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
+
};
|