impact-nova 1.5.14 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/accordion.d.ts +4 -1
- package/dist/components/ui/accordion.js +28 -22
- package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +11 -11
- package/dist/components/ui/ag-grid-react/cell-renderers/checkbox-display-renderer.js +12 -12
- package/dist/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +30 -30
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/percent-progress-cell-editor.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +16 -16
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/textarea-cell-editor.js +17 -17
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +11 -11
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +2 -2
- package/dist/components/ui/ag-grid-react/cell-renderers/percent-progress-display-renderer.js +11 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/select-display-renderer.js +8 -8
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +6 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/status-badge-renderer.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/status-badge-renderer.js +14 -14
- package/dist/components/ui/ag-grid-react/cell-renderers/switch-display-renderer.js +18 -18
- package/dist/components/ui/ag-grid-react/cell-renderers/textarea-display-renderer.js +6 -6
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +14 -14
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +35 -35
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +49 -49
- package/dist/components/ui/ag-grid-react/headers/components/header-info.js +29 -29
- package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +9 -9
- package/dist/components/ui/ag-grid-react/headers/components/section-renderers.js +20 -20
- package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +10 -10
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +76 -76
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +118 -118
- package/dist/components/ui/ag-grid-react/index.js +121 -102
- package/dist/components/ui/alert-dialog.js +6 -6
- package/dist/components/ui/alert.d.ts +4 -3
- package/dist/components/ui/alert.js +182 -64
- package/dist/components/ui/avatar.js +5 -5
- package/dist/components/ui/badge.d.ts +7 -2
- package/dist/components/ui/badge.js +105 -32
- package/dist/components/ui/breadcrumb.js +26 -21
- package/dist/components/ui/button-group.d.ts +7 -0
- package/dist/components/ui/button-group.js +116 -91
- package/dist/components/ui/button-variants.d.ts +7 -2
- package/dist/components/ui/button-variants.js +31 -16
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/button.js +10 -10
- package/dist/components/ui/calendar.js +185 -184
- package/dist/components/ui/card.js +24 -24
- package/dist/components/ui/chart/chart.js +27 -27
- package/dist/components/ui/chart/chart.utils.js +50 -50
- package/dist/components/ui/checkbox.js +22 -22
- package/dist/components/ui/chips.d.ts +19 -3
- package/dist/components/ui/chips.js +140 -41
- package/dist/components/ui/command-palette/command-palette-layout.d.ts +28 -0
- package/dist/components/ui/command-palette/command-palette-layout.js +59 -0
- package/dist/components/ui/command-palette/command-palette.js +254 -264
- package/dist/components/ui/command-palette/index.d.ts +1 -1
- package/dist/components/ui/command-palette/index.js +42 -41
- package/dist/components/ui/command-palette/kbd.js +18 -18
- package/dist/components/ui/command-palette/shortcut-settings.d.ts +3 -3
- package/dist/components/ui/command-palette/shortcut-settings.js +105 -111
- package/dist/components/ui/command-palette/utils.d.ts +6 -1
- package/dist/components/ui/command-palette/utils.js +81 -74
- package/dist/components/ui/data-table/data-table-column-list.js +31 -31
- package/dist/components/ui/data-table/data-table-constants.d.ts +6 -0
- package/dist/components/ui/data-table/data-table-constants.js +4 -0
- package/dist/components/ui/data-table/data-table-context.d.ts +4 -0
- package/dist/components/ui/data-table/data-table-format-options.js +35 -35
- package/dist/components/ui/data-table/data-table-sheet.d.ts +4 -4
- package/dist/components/ui/data-table/data-table-sheet.js +91 -58
- package/dist/components/ui/data-table/data-table-view-options.js +29 -29
- package/dist/components/ui/data-table/data-table.js +84 -52
- package/dist/components/ui/data-table/index.d.ts +1 -0
- package/dist/components/ui/data-table/index.js +15 -13
- package/dist/components/ui/date-picker/date-picker.js +35 -35
- package/dist/components/ui/date-picker/date-range-picker.js +166 -164
- package/dist/components/ui/date-picker/month-picker.js +14 -14
- package/dist/components/ui/date-picker/month-range-picker.js +198 -189
- package/dist/components/ui/date-picker/multi-date-picker.js +14 -14
- package/dist/components/ui/date-picker/multi-month-picker.js +1 -1
- package/dist/components/ui/date-picker/multi-week-picker.js +1 -1
- package/dist/components/ui/date-picker/week-picker.js +2 -2
- package/dist/components/ui/date-picker/week-range-picker.js +164 -162
- package/dist/components/ui/dialog.js +25 -28
- package/dist/components/ui/drawer.js +40 -40
- package/dist/components/ui/dropdown-menu.js +72 -72
- package/dist/components/ui/empty-container.js +73 -69
- package/dist/components/ui/file-upload.js +137 -135
- package/dist/components/ui/filter-panel/filter-panel.d.ts +2 -2
- package/dist/components/ui/filter-panel/filter-panel.js +175 -97
- package/dist/components/ui/filter-strip/filter-strip.d.ts +1 -1
- package/dist/components/ui/filter-strip/filter-strip.js +63 -50
- package/dist/components/ui/filter-strip/filter-summary.d.ts +4 -1
- package/dist/components/ui/filter-strip/filter-summary.js +230 -146
- package/dist/components/ui/filter-strip/filter-tag-list.js +125 -91
- package/dist/components/ui/header.d.ts +7 -3
- package/dist/components/ui/header.js +87 -79
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +44 -44
- package/dist/components/ui/hover-card.js +10 -10
- package/dist/components/ui/input.js +79 -70
- package/dist/components/ui/loader.js +16 -16
- package/dist/components/ui/nested-list/components/NestedListCategoryFilters.js +16 -16
- package/dist/components/ui/nested-list/components/NestedListHeader.js +27 -27
- package/dist/components/ui/nested-list/components/SortableItem.js +58 -58
- package/dist/components/ui/notification-panel/notification-item.js +32 -32
- package/dist/components/ui/notification-panel/notification-list.js +24 -24
- package/dist/components/ui/notification-panel/notification-panel.js +26 -26
- package/dist/components/ui/popover.js +22 -22
- package/dist/components/ui/progress.js +34 -34
- package/dist/components/ui/prompt.js +48 -48
- package/dist/components/ui/radio-group.js +63 -54
- package/dist/components/ui/select/components/LabelWithSequence.js +6 -6
- package/dist/components/ui/select/components/Submenu.js +33 -33
- package/dist/components/ui/select/select.js +425 -376
- package/dist/components/ui/sheet.js +88 -66
- package/dist/components/ui/sidebar.js +342 -296
- package/dist/components/ui/skeleton.js +6 -6
- package/dist/components/ui/slider.js +17 -17
- package/dist/components/ui/statistics-card.d.ts +86 -0
- package/dist/components/ui/statistics-card.hooks.d.ts +150 -0
- package/dist/components/ui/statistics-card.hooks.js +100 -0
- package/dist/components/ui/statistics-card.js +259 -0
- package/dist/components/ui/stepper.js +51 -51
- package/dist/components/ui/switch.js +7 -7
- package/dist/components/ui/tabs.js +70 -70
- package/dist/components/ui/tag-group.d.ts +1 -0
- package/dist/components/ui/tag-group.js +14 -13
- package/dist/components/ui/tag.js +43 -43
- package/dist/components/ui/textarea.js +86 -58
- package/dist/components/ui/toast.js +39 -39
- package/dist/components/ui/tooltip.js +23 -23
- package/dist/components/ui/types/date-picker.types.d.ts +1 -0
- package/dist/components/ui/types/filter-panel.types.d.ts +3 -0
- package/dist/components/ui/types/filter-strip.types.d.ts +14 -0
- package/dist/components/ui/types/horizontal-scroller.types.d.ts +1 -1
- package/dist/components/ui/types/statistics-card.types.d.ts +1 -0
- package/dist/i18n/defaultMessages.d.ts +8 -0
- package/dist/i18n/defaultMessages.js +15 -9
- package/dist/i18n/locales/de.js +7 -1
- package/dist/i18n/locales/es.js +7 -1
- package/dist/i18n/locales/hi.js +7 -1
- package/dist/i18n/locales/kn.js +7 -1
- package/dist/icons/assets/bulk-edit.svg.js +5 -0
- package/dist/icons/assets/clock.svg.js +5 -0
- package/dist/icons/assets/statistics.svg.js +5 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.js +254 -206
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +361 -347
- package/package.json +3 -2
- package/tailwind.config.js +259 -152
- /package/dist/icons/assets/{PivotMode.svg.js → pivotMode.svg.js} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as h, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
3
|
import { X as De } from "lucide-react";
|
|
4
4
|
import { CalendarMonth as ye, Info as Re } from "../../../icons/index.js";
|
|
5
|
-
import { format as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Popover as Se, PopoverTrigger as
|
|
5
|
+
import { format as l, isValid as S, parse as N } from "date-fns";
|
|
6
|
+
import { cn as C, padValidDateString as K, maskDate as Q } from "../../../lib/utils.js";
|
|
7
|
+
import { Popover as Se, PopoverTrigger as Ne, PopoverContent as Ce } from "../popover.js";
|
|
8
8
|
import { Calendar as Ie } from "../calendar.js";
|
|
9
9
|
import { Tooltip as U, TooltipTrigger as Z, TooltipContent as $ } from "../tooltip.js";
|
|
10
|
-
import { resolveWeekSelection as
|
|
11
|
-
import { getDateFnsLocale as
|
|
12
|
-
import { useImpactNovaI18n as
|
|
13
|
-
const c = (e) => e?.from ? e.to ? e.to.endDate : e.from.endDate : void 0,
|
|
10
|
+
import { resolveWeekSelection as ve } from "../../../lib/fiscal-calendar.js";
|
|
11
|
+
import { getDateFnsLocale as We } from "../../../i18n/getDateFnsLocale.js";
|
|
12
|
+
import { useImpactNovaI18n as Pe } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
13
|
+
const c = (e) => e?.from ? e.to ? e.to.endDate : e.from.endDate : void 0, Ve = r.forwardRef(
|
|
14
14
|
({
|
|
15
15
|
value: e,
|
|
16
16
|
onChange: x,
|
|
@@ -20,7 +20,7 @@ const c = (e) => e?.from ? e.to ? e.to.endDate : e.from.endDate : void 0, ve = l
|
|
|
20
20
|
maxDate: F,
|
|
21
21
|
startMonth: ee,
|
|
22
22
|
endMonth: te,
|
|
23
|
-
showFooter:
|
|
23
|
+
showFooter: k = !0,
|
|
24
24
|
calendarType: E = "calendar",
|
|
25
25
|
fiscalMode: T = "basic",
|
|
26
26
|
selectionMode: A = "week",
|
|
@@ -36,25 +36,25 @@ const c = (e) => e?.from ? e.to ? e.to.endDate : e.from.endDate : void 0, ve = l
|
|
|
36
36
|
required: oe,
|
|
37
37
|
prefix: Ee,
|
|
38
38
|
prefixClick: Te,
|
|
39
|
-
...
|
|
39
|
+
...le
|
|
40
40
|
}, se) => {
|
|
41
|
-
const { locale: H, t:
|
|
42
|
-
|
|
43
|
-
const [a,
|
|
44
|
-
|
|
45
|
-
a || (f(e?.from ?
|
|
46
|
-
}, [e, t, a, o]),
|
|
47
|
-
a && (d(e), f(e?.from ?
|
|
41
|
+
const { locale: H, t: P } = Pe(), o = r.useMemo(() => We(H), [H]), X = Y ?? P("datePicker.selectWeekRange"), q = r.useRef(null), re = r.useRef(null);
|
|
42
|
+
r.useRef(null), r.useRef(null), r.useImperativeHandle(se, () => q.current);
|
|
43
|
+
const [a, v] = r.useState(!1), [w, d] = r.useState(e), [y, f] = r.useState(e?.from ? l(e.from.startDate, t, { locale: o }) : ""), [R, p] = r.useState(c(e) ? l(c(e), t, { locale: o }) : ""), [ce, V] = r.useState(e?.from?.startDate || /* @__PURE__ */ new Date());
|
|
44
|
+
r.useEffect(() => {
|
|
45
|
+
a || (f(e?.from ? l(e.from.startDate, t, { locale: o }) : ""), p(c(e) ? l(c(e), t, { locale: o }) : ""), d(e));
|
|
46
|
+
}, [e, t, a, o]), r.useEffect(() => {
|
|
47
|
+
a && (d(e), f(e?.from ? l(e.from.startDate, t, { locale: o }) : ""), p(c(e) ? l(c(e), t, { locale: o }) : ""), V(e?.from?.startDate || /* @__PURE__ */ new Date()));
|
|
48
48
|
}, [a, e, t, o]);
|
|
49
49
|
const ie = (n) => {
|
|
50
|
-
d(n), n?.from ? (f(
|
|
50
|
+
d(n), n?.from ? (f(l(n.from.startDate, t, { locale: o })), p(l(c(n), t, { locale: o }))) : (f(""), p("")), !k && n?.from && n?.to && n.from.startDate.getTime() !== n.to.startDate.getTime() && (x?.(n), v(!1));
|
|
51
51
|
}, ae = (n) => {
|
|
52
|
-
x?.(n !== void 0 ? n : w),
|
|
52
|
+
x?.(n !== void 0 ? n : w), v(!1);
|
|
53
53
|
}, de = () => {
|
|
54
|
-
d(e), f(e?.from ?
|
|
54
|
+
d(e), f(e?.from ? l(e.from.startDate, t, { locale: o }) : ""), p(c(e) ? l(c(e), t, { locale: o }) : ""), v(!1);
|
|
55
55
|
}, G = () => {
|
|
56
|
-
d(void 0), f(""), p(""), x?.(void 0),
|
|
57
|
-
},
|
|
56
|
+
d(void 0), f(""), p(""), x?.(void 0), k || v(!1);
|
|
57
|
+
}, W = (n) => ve(n, {
|
|
58
58
|
calendarType: E,
|
|
59
59
|
fiscalMode: T,
|
|
60
60
|
selectionMode: A,
|
|
@@ -62,170 +62,172 @@ const c = (e) => e?.from ? e.to ? e.to.endDate : e.from.endDate : void 0, ve = l
|
|
|
62
62
|
fiscalYearStartMonth: M,
|
|
63
63
|
weekStartsOn: j
|
|
64
64
|
}), fe = (n) => {
|
|
65
|
-
const
|
|
65
|
+
const g = n.target.value, i = Q(g, t, y);
|
|
66
66
|
if (f(i), i === "") {
|
|
67
67
|
const u = { from: void 0, to: w?.to };
|
|
68
|
-
d(u),
|
|
68
|
+
d(u), k || x?.(u);
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const m =
|
|
71
|
+
const m = N(i, t, /* @__PURE__ */ new Date(), { locale: o });
|
|
72
72
|
if (S(m) && i.length === t.length) {
|
|
73
|
-
const
|
|
74
|
-
d(
|
|
73
|
+
const b = { from: W(m), to: w?.to };
|
|
74
|
+
d(b), p(l(c(b), t, { locale: o })), k || x?.(b);
|
|
75
75
|
}
|
|
76
76
|
}, pe = (n) => {
|
|
77
|
-
const
|
|
77
|
+
const g = n.target.value, i = Q(g, t, R);
|
|
78
78
|
if (p(i), i === "") {
|
|
79
79
|
const u = { from: w?.from, to: void 0 };
|
|
80
|
-
d(u),
|
|
80
|
+
d(u), k || x?.(u);
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
const m =
|
|
83
|
+
const m = N(i, t, /* @__PURE__ */ new Date(), { locale: o });
|
|
84
84
|
if (S(m) && i.length === t.length) {
|
|
85
|
-
const u =
|
|
86
|
-
d(
|
|
85
|
+
const u = W(m), b = { from: w?.from, to: u };
|
|
86
|
+
d(b), w?.from && f(l(w.from.startDate, t, { locale: o })), m && V(m), k || x?.(b);
|
|
87
87
|
}
|
|
88
88
|
}, J = () => {
|
|
89
89
|
if (a) return;
|
|
90
|
-
const n = K(y, t),
|
|
91
|
-
if (!u || !
|
|
92
|
-
f(e?.from ?
|
|
93
|
-
else if (f(n), p(
|
|
94
|
-
const we =
|
|
95
|
-
x?.({ from: we, to:
|
|
90
|
+
const n = K(y, t), g = K(R, t), i = N(n, t, /* @__PURE__ */ new Date(), { locale: o }), m = N(g, t, /* @__PURE__ */ new Date(), { locale: o }), u = S(i) && n.length === t.length, b = S(m) && g.length === t.length;
|
|
91
|
+
if (!u || !b)
|
|
92
|
+
f(e?.from ? l(e.from.startDate, t, { locale: o }) : ""), p(c(e) ? l(c(e), t, { locale: o }) : ""), d(e);
|
|
93
|
+
else if (f(n), p(g), !k) {
|
|
94
|
+
const we = W(i), be = W(m);
|
|
95
|
+
x?.({ from: we, to: be });
|
|
96
96
|
}
|
|
97
|
-
}, me = e?.from ?
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
className: N(
|
|
103
|
-
"text-xs font-medium leading-[18px] text-[#60697d]",
|
|
104
|
-
D && "opacity-70",
|
|
105
|
-
I && "text-destructive"
|
|
106
|
-
),
|
|
107
|
-
children: [
|
|
108
|
-
O,
|
|
109
|
-
" ",
|
|
110
|
-
oe && /* @__PURE__ */ s("span", { className: "text-destructive", children: "*" })
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
),
|
|
114
|
-
/* @__PURE__ */ g(Se, { open: a, onOpenChange: W, children: [
|
|
115
|
-
/* @__PURE__ */ s(Ce, { asChild: !0, children: /* @__PURE__ */ g(
|
|
116
|
-
"div",
|
|
97
|
+
}, me = e?.from ? l(e.from.startDate, t, { locale: o }) : "", ue = c(e) ? l(c(e), t, { locale: o }) : "", he = me !== y, ge = ue !== R, xe = y.length === t.length && !S(N(y, t, /* @__PURE__ */ new Date(), { locale: o })), ke = R.length === t.length && !S(N(R, t, /* @__PURE__ */ new Date(), { locale: o }));
|
|
98
|
+
return /* @__PURE__ */ h("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", "data-component": "week-range-picker", "data-disabled": D || void 0, children: [
|
|
99
|
+
/* @__PURE__ */ h("div", { className: "flex flex-col gap-[6px]", children: [
|
|
100
|
+
O && /* @__PURE__ */ h(
|
|
101
|
+
"label",
|
|
117
102
|
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
I
|
|
122
|
-
B === "sm" ? "h-6" : B === "md" ? "h-[28px]" : "h-8",
|
|
123
|
-
D && "pointer-events-none opacity-100 bg-disabled-secondary-bg border-border text-disabled-text hover:border-border",
|
|
124
|
-
"cursor-pointer",
|
|
125
|
-
ne
|
|
103
|
+
className: C(
|
|
104
|
+
"text-xs font-medium leading-[18px] text-content-tertiary",
|
|
105
|
+
D && "opacity-70",
|
|
106
|
+
I && "text-destructive"
|
|
126
107
|
),
|
|
127
108
|
children: [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
ref: le,
|
|
152
|
-
type: "text",
|
|
153
|
-
value: R,
|
|
154
|
-
onChange: pe,
|
|
155
|
-
onBlur: J,
|
|
156
|
-
onClick: (n) => a && n.stopPropagation(),
|
|
157
|
-
placeholder: a ? t : X,
|
|
158
|
-
disabled: !!D,
|
|
159
|
-
"data-field": "end",
|
|
160
|
-
className: N(
|
|
161
|
-
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-[#dfe2e7] disabled:cursor-not-allowed disabled:opacity-50",
|
|
162
|
-
be ? "text-destructive" : ge ? "text-muted-foreground" : ""
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
)
|
|
166
|
-
] }),
|
|
167
|
-
/* @__PURE__ */ g("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
168
|
-
e?.from && !D && /* @__PURE__ */ g(U, { children: [
|
|
169
|
-
/* @__PURE__ */ s(Z, { asChild: !0, children: /* @__PURE__ */ s(
|
|
170
|
-
De,
|
|
109
|
+
O,
|
|
110
|
+
" ",
|
|
111
|
+
oe && /* @__PURE__ */ s("span", { className: "text-destructive", children: "*" })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ h(Se, { open: a, onOpenChange: v, children: [
|
|
116
|
+
/* @__PURE__ */ s(Ne, { asChild: !0, children: /* @__PURE__ */ h(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
"data-state": a ? "open" : "closed",
|
|
120
|
+
className: C(
|
|
121
|
+
"flex w-full items-center justify-between gap-2 rounded-md border bg-canvas-elevated px-3 text-sm shadow-sm transition-colors hover:border-brand disabled:cursor-not-allowed disabled:bg-disabled-surface disabled:text-disabled-foreground disabled:border-stroke",
|
|
122
|
+
I ? "border-destructive hover:border-destructive" : "border-field",
|
|
123
|
+
B === "sm" ? "h-6" : B === "md" ? "h-[28px]" : "h-8",
|
|
124
|
+
D && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
|
|
125
|
+
"cursor-pointer",
|
|
126
|
+
ne
|
|
127
|
+
),
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
|
|
130
|
+
/* @__PURE__ */ s(
|
|
131
|
+
"input",
|
|
171
132
|
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
133
|
+
ref: q,
|
|
134
|
+
type: "text",
|
|
135
|
+
value: y,
|
|
136
|
+
onChange: fe,
|
|
137
|
+
onBlur: J,
|
|
138
|
+
onClick: (n) => a && n.stopPropagation(),
|
|
139
|
+
placeholder: a ? t : X,
|
|
140
|
+
disabled: !!D,
|
|
141
|
+
"data-field": "start",
|
|
142
|
+
className: C(
|
|
143
|
+
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
144
|
+
xe ? "text-destructive" : he ? "text-content-muted" : ""
|
|
145
|
+
),
|
|
146
|
+
...le
|
|
176
147
|
}
|
|
177
|
-
)
|
|
178
|
-
/* @__PURE__ */ s(
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ s(
|
|
150
|
+
"input",
|
|
151
|
+
{
|
|
152
|
+
ref: re,
|
|
153
|
+
type: "text",
|
|
154
|
+
value: R,
|
|
155
|
+
onChange: pe,
|
|
156
|
+
onBlur: J,
|
|
157
|
+
onClick: (n) => a && n.stopPropagation(),
|
|
158
|
+
placeholder: a ? t : X,
|
|
159
|
+
disabled: !!D,
|
|
160
|
+
"data-field": "end",
|
|
161
|
+
className: C(
|
|
162
|
+
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
163
|
+
ke ? "text-destructive" : ge ? "text-content-muted" : ""
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
)
|
|
179
167
|
] }),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
|
|
168
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
169
|
+
e?.from && !D && /* @__PURE__ */ h(U, { children: [
|
|
170
|
+
/* @__PURE__ */ s(Z, { asChild: !0, children: /* @__PURE__ */ s(
|
|
171
|
+
De,
|
|
172
|
+
{
|
|
173
|
+
className: "h-4 w-4 cursor-pointer hover:text-content text-content-muted",
|
|
174
|
+
onClick: (n) => {
|
|
175
|
+
n.stopPropagation(), G();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
) }),
|
|
179
|
+
/* @__PURE__ */ s($, { variant: "tertiary", side: "top", children: P("calendar.clear") })
|
|
180
|
+
] }),
|
|
181
|
+
/* @__PURE__ */ h(U, { children: [
|
|
182
|
+
/* @__PURE__ */ s(Z, { asChild: !0, children: /* @__PURE__ */ s(ye, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
183
|
+
/* @__PURE__ */ s($, { variant: "tertiary", side: "top", children: P("datePicker.selectWeekRange") })
|
|
184
|
+
] })
|
|
183
185
|
] })
|
|
184
|
-
]
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
)
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
) }),
|
|
189
|
+
/* @__PURE__ */ s(
|
|
190
|
+
Ce,
|
|
191
|
+
{
|
|
192
|
+
className: "w-auto p-0",
|
|
193
|
+
align: "start",
|
|
194
|
+
onOpenAutoFocus: (n) => n.preventDefault(),
|
|
195
|
+
children: /* @__PURE__ */ s(
|
|
196
|
+
Ie,
|
|
197
|
+
{
|
|
198
|
+
pickerType: "week",
|
|
199
|
+
weekMode: "range",
|
|
200
|
+
selectedWeeks: w,
|
|
201
|
+
onWeekSelect: ie,
|
|
202
|
+
month: ce,
|
|
203
|
+
onMonthChange: V,
|
|
204
|
+
disabled: { before: _, after: F },
|
|
205
|
+
startMonth: ee,
|
|
206
|
+
endMonth: te,
|
|
207
|
+
showFooter: k,
|
|
208
|
+
calendarType: E,
|
|
209
|
+
fiscalMode: T,
|
|
210
|
+
selectionMode: A,
|
|
211
|
+
fiscalMonthPattern: L,
|
|
212
|
+
fiscalYearStartMonth: M,
|
|
213
|
+
weekStartsOn: j,
|
|
214
|
+
onApply: ae,
|
|
215
|
+
onCancel: de,
|
|
216
|
+
onClear: G,
|
|
217
|
+
captionLayout: "dropdown"
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
] })
|
|
221
223
|
] }),
|
|
222
|
-
z && /* @__PURE__ */
|
|
223
|
-
!I && /* @__PURE__ */ s(Re, { size: 10, className: "shrink-0 text-muted
|
|
224
|
+
z && /* @__PURE__ */ h("div", { className: C("flex items-center gap-[6px]", I && "text-destructive"), children: [
|
|
225
|
+
!I && /* @__PURE__ */ s(Re, { size: 10, className: "shrink-0 text-content-muted" }),
|
|
224
226
|
/* @__PURE__ */ s(
|
|
225
227
|
"p",
|
|
226
228
|
{
|
|
227
|
-
className:
|
|
228
|
-
"text-[10px] text-
|
|
229
|
+
className: C(
|
|
230
|
+
"text-[10px] leading-4 text-navigation-muted",
|
|
229
231
|
I && "text-destructive"
|
|
230
232
|
),
|
|
231
233
|
children: z
|
|
@@ -235,7 +237,7 @@ const c = (e) => e?.from ? e.to ? e.to.endDate : e.from.endDate : void 0, ve = l
|
|
|
235
237
|
] });
|
|
236
238
|
}
|
|
237
239
|
);
|
|
238
|
-
|
|
240
|
+
Ve.displayName = "WeekRangePicker";
|
|
239
241
|
export {
|
|
240
|
-
|
|
242
|
+
Ve as WeekRangePicker
|
|
241
243
|
};
|
|
@@ -3,22 +3,22 @@ import * as n from "react";
|
|
|
3
3
|
import * as t from "@radix-ui/react-dialog";
|
|
4
4
|
import { X as f } from "lucide-react";
|
|
5
5
|
import { cn as i } from "../../lib/utils.js";
|
|
6
|
-
import { Tooltip as g, TooltipTrigger as
|
|
7
|
-
import { useImpactNovaI18n as
|
|
8
|
-
const
|
|
6
|
+
import { Tooltip as g, TooltipTrigger as y, TooltipContent as x } from "./tooltip.js";
|
|
7
|
+
import { useImpactNovaI18n as u } from "../../i18n/ImpactNovaI18nContext.js";
|
|
8
|
+
const P = t.Root, B = t.Trigger, N = t.Portal, F = t.Close, r = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
|
|
9
9
|
t.Overlay,
|
|
10
10
|
{
|
|
11
11
|
ref: s,
|
|
12
12
|
className: i(
|
|
13
|
-
"fixed inset-0 z-50 bg-
|
|
13
|
+
"fixed inset-0 z-50 bg-scrim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
14
14
|
e
|
|
15
15
|
),
|
|
16
16
|
...a
|
|
17
17
|
}
|
|
18
18
|
));
|
|
19
19
|
r.displayName = t.Overlay.displayName;
|
|
20
|
-
const
|
|
21
|
-
const { t: p } =
|
|
20
|
+
const v = n.forwardRef(({ className: e, children: a, hideClose: s, ...c }, m) => {
|
|
21
|
+
const { t: p } = u(), d = p("aria.close");
|
|
22
22
|
return /* @__PURE__ */ l(N, { children: [
|
|
23
23
|
/* @__PURE__ */ o(r, {}),
|
|
24
24
|
/* @__PURE__ */ l(
|
|
@@ -28,18 +28,18 @@ const b = n.forwardRef(({ className: e, children: a, hideClose: s, ...c }, m) =>
|
|
|
28
28
|
"aria-describedby": void 0,
|
|
29
29
|
"data-component": "dialog-content",
|
|
30
30
|
className: i(
|
|
31
|
-
"fixed left-[50%] top-[50%] z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-
|
|
31
|
+
"fixed left-[50%] top-[50%] z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-canvas shadow-xl duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg overflow-hidden",
|
|
32
32
|
e
|
|
33
33
|
),
|
|
34
34
|
...c,
|
|
35
35
|
children: [
|
|
36
36
|
a,
|
|
37
37
|
!s && /* @__PURE__ */ l(g, { children: [
|
|
38
|
-
/* @__PURE__ */ o(
|
|
38
|
+
/* @__PURE__ */ o(y, { asChild: !0, children: /* @__PURE__ */ l(
|
|
39
39
|
t.Close,
|
|
40
40
|
{
|
|
41
41
|
"data-component": "dialog-close",
|
|
42
|
-
className: "absolute right-4 top-4 rounded-sm opacity-50 ring-offset-
|
|
42
|
+
className: "absolute right-4 top-4 rounded-sm opacity-50 ring-offset-canvas transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-content-muted",
|
|
43
43
|
"aria-label": d,
|
|
44
44
|
children: [
|
|
45
45
|
/* @__PURE__ */ o(f, { className: "h-4 w-4" }),
|
|
@@ -54,7 +54,7 @@ const b = n.forwardRef(({ className: e, children: a, hideClose: s, ...c }, m) =>
|
|
|
54
54
|
)
|
|
55
55
|
] });
|
|
56
56
|
});
|
|
57
|
-
|
|
57
|
+
v.displayName = t.Content.displayName;
|
|
58
58
|
const D = ({
|
|
59
59
|
className: e,
|
|
60
60
|
...a
|
|
@@ -62,48 +62,45 @@ const D = ({
|
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
64
|
className: i(
|
|
65
|
-
"flex flex-col text-center sm:text-left bg-
|
|
65
|
+
"flex flex-col text-center sm:text-left bg-canvas-tint p-4 border-b",
|
|
66
66
|
e
|
|
67
67
|
),
|
|
68
68
|
...a
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
D.displayName = "DialogHeader";
|
|
72
|
-
const
|
|
72
|
+
const b = ({
|
|
73
73
|
className: e,
|
|
74
74
|
...a
|
|
75
75
|
}) => /* @__PURE__ */ o(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
78
|
-
className: i(
|
|
79
|
-
"px-6 py-6 flex-1 overflow-y-auto min-h-0",
|
|
80
|
-
e
|
|
81
|
-
),
|
|
78
|
+
className: i("px-6 py-6 flex-1 overflow-y-auto min-h-0", e),
|
|
82
79
|
...a
|
|
83
80
|
}
|
|
84
81
|
);
|
|
85
|
-
|
|
86
|
-
const
|
|
82
|
+
b.displayName = "DialogBody";
|
|
83
|
+
const h = ({
|
|
87
84
|
className: e,
|
|
88
85
|
...a
|
|
89
86
|
}) => /* @__PURE__ */ o(
|
|
90
87
|
"div",
|
|
91
88
|
{
|
|
92
89
|
className: i(
|
|
93
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:items-center sm:space-x-2 px-4 py-3
|
|
90
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:items-center sm:space-x-2 px-4 py-3 bg-canvas-elevated",
|
|
94
91
|
e
|
|
95
92
|
),
|
|
96
93
|
...a
|
|
97
94
|
}
|
|
98
95
|
);
|
|
99
|
-
|
|
96
|
+
h.displayName = "DialogFooter";
|
|
100
97
|
const w = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
|
|
101
98
|
t.Title,
|
|
102
99
|
{
|
|
103
100
|
ref: s,
|
|
104
101
|
"data-component": "dialog-title",
|
|
105
102
|
className: i(
|
|
106
|
-
"text-md font-bold leading-none tracking-tight text-
|
|
103
|
+
"text-md font-bold leading-none tracking-tight text-content",
|
|
107
104
|
e
|
|
108
105
|
),
|
|
109
106
|
...a
|
|
@@ -114,21 +111,21 @@ const T = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
|
|
|
114
111
|
t.Description,
|
|
115
112
|
{
|
|
116
113
|
ref: s,
|
|
117
|
-
className: i("text-sm text-
|
|
114
|
+
className: i("text-sm text-content-secondary leading-relaxed", e),
|
|
118
115
|
...a
|
|
119
116
|
}
|
|
120
117
|
));
|
|
121
118
|
T.displayName = t.Description.displayName;
|
|
122
119
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
P as Dialog,
|
|
121
|
+
b as DialogBody,
|
|
122
|
+
F as DialogClose,
|
|
123
|
+
v as DialogContent,
|
|
127
124
|
T as DialogDescription,
|
|
128
|
-
|
|
125
|
+
h as DialogFooter,
|
|
129
126
|
D as DialogHeader,
|
|
130
127
|
r as DialogOverlay,
|
|
131
128
|
N as DialogPortal,
|
|
132
129
|
w as DialogTitle,
|
|
133
|
-
|
|
130
|
+
B as DialogTrigger
|
|
134
131
|
};
|