impact-nova 1.6.1 → 1.6.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.
|
@@ -4,13 +4,12 @@ import { ChevronLeftIcon as we, ChevronRightIcon as ye } from "lucide-react";
|
|
|
4
4
|
import { getDefaultClassNames as He, DayPicker as Be } from "react-day-picker";
|
|
5
5
|
import { cn as f } from "../../lib/utils.js";
|
|
6
6
|
import { Button as R } from "./button.js";
|
|
7
|
-
import "./button-variants.js";
|
|
8
7
|
import ce from "./select/select.js";
|
|
9
8
|
import { FISCAL_PATTERNS as Fe, resolveWeekSelection as Te } from "../../lib/fiscal-calendar.js";
|
|
10
9
|
import { getIntlLocale as Ke, getDateFnsLocale as We } from "../../i18n/getDateFnsLocale.js";
|
|
11
10
|
import { useImpactNovaI18n as qe } from "../../i18n/ImpactNovaI18nContext.js";
|
|
12
11
|
const ue = d.createContext(0);
|
|
13
|
-
function
|
|
12
|
+
function at({
|
|
14
13
|
className: ae,
|
|
15
14
|
classNames: G,
|
|
16
15
|
showOutsideDays: y = !1,
|
|
@@ -756,6 +755,6 @@ function Ge({
|
|
|
756
755
|
);
|
|
757
756
|
}
|
|
758
757
|
export {
|
|
759
|
-
|
|
758
|
+
at as Calendar,
|
|
760
759
|
Ge as CalendarDayButton
|
|
761
760
|
};
|
|
@@ -1,174 +1,180 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { User as
|
|
4
|
-
import { cn as
|
|
1
|
+
import { jsx as r, jsxs as h, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { User as z, Monitor as G, AlertTriangle as U, Lock as F, RotateCcw as q } from "lucide-react";
|
|
4
|
+
import { cn as p } from "../../../lib/utils.js";
|
|
5
5
|
import { ModuleRegistry as B, AllCommunityModule as $ } from "ag-grid-community";
|
|
6
6
|
import { AllEnterpriseModule as H } from "ag-grid-enterprise";
|
|
7
|
-
import { DataTable as V, DataTableContent as
|
|
8
|
-
import { AG_CELL_NO_PADDING as
|
|
9
|
-
import { Kbd as
|
|
10
|
-
import { useCommandPalette as
|
|
11
|
-
import { COMMAND_SOURCE_LABELS as m, keybindingToString as
|
|
12
|
-
import { BadgeCellRenderer as
|
|
7
|
+
import { DataTable as V, DataTableContent as J } from "../data-table/data-table.js";
|
|
8
|
+
import { AG_CELL_NO_PADDING as A } from "../ag-grid-react/cell-renderers/index.js";
|
|
9
|
+
import { Kbd as Q } from "./kbd.js";
|
|
10
|
+
import { useCommandPalette as X } from "./command-palette-context.js";
|
|
11
|
+
import { COMMAND_SOURCE_LABELS as m, keybindingToString as Y, keybindingFromEvent as Z, isReservedShortcut as W } from "./utils.js";
|
|
12
|
+
import { BadgeCellRenderer as ee } from "../ag-grid-react/cell-renderers/badge-cell-renderer.js";
|
|
13
13
|
B.registerModules([$, H]);
|
|
14
|
-
function
|
|
15
|
-
const
|
|
16
|
-
return
|
|
17
|
-
!
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */ r("span", { className: "truncate font-medium text-content-charcoal text-xs leading-tight", children:
|
|
20
|
-
|
|
14
|
+
function te(l) {
|
|
15
|
+
const t = l.data;
|
|
16
|
+
return t ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2 min-w-0 h-full", children: [
|
|
17
|
+
!t.customisable && /* @__PURE__ */ r(F, { className: "h-3 w-3 text-content-muted shrink-0" }),
|
|
18
|
+
/* @__PURE__ */ h("div", { className: "flex flex-col min-w-0 gap-0", children: [
|
|
19
|
+
/* @__PURE__ */ r("span", { className: "truncate font-medium text-content-charcoal text-xs leading-tight", children: t.command }),
|
|
20
|
+
t.description && /* @__PURE__ */ r("span", { className: "truncate text-[10px] text-content-muted leading-tight", children: t.description })
|
|
21
21
|
] })
|
|
22
22
|
] }) : null;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
27
|
-
const
|
|
28
|
-
return /* @__PURE__ */ r("div", { className:
|
|
24
|
+
function re(l) {
|
|
25
|
+
const t = l.data;
|
|
26
|
+
if (!t) return null;
|
|
27
|
+
const u = l.recordingCommandId === t.id;
|
|
28
|
+
return /* @__PURE__ */ r("div", { className: p(
|
|
29
29
|
"w-full h-full flex items-center ag-cell-inner-padding",
|
|
30
|
-
|
|
30
|
+
t.customisable ? "in-ag-editable-cell-highlight" : ""
|
|
31
31
|
), children: /* @__PURE__ */ r(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
|
-
className:
|
|
34
|
+
className: p(
|
|
35
35
|
"flex items-center justify-between w-full h-7 rounded-[8px] px-1.5 group/row relative",
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
t.customisable ? "bg-canvas-elevated" : "bg-transparent",
|
|
37
|
+
u && "ring-1 ring-brand border border-brand"
|
|
38
38
|
),
|
|
39
|
-
children:
|
|
40
|
-
|
|
39
|
+
children: u ? /* @__PURE__ */ r("span", { className: "text-xs text-brand font-medium animate-pulse", children: l.recordingLabel ?? "Press desired shortcut..." }) : /* @__PURE__ */ h(j, { children: [
|
|
40
|
+
t.keybinding ? /* @__PURE__ */ r(
|
|
41
41
|
"button",
|
|
42
42
|
{
|
|
43
43
|
type: "button",
|
|
44
44
|
onClick: (o) => {
|
|
45
|
-
o.stopPropagation(),
|
|
45
|
+
o.stopPropagation(), t.customisable && l.onStartRecording(t.id);
|
|
46
46
|
},
|
|
47
|
-
disabled: !
|
|
48
|
-
className:
|
|
47
|
+
disabled: !t.customisable,
|
|
48
|
+
className: p(
|
|
49
49
|
"flex items-center justify-end h-full w-full text-right",
|
|
50
|
-
|
|
50
|
+
t.customisable ? "cursor-pointer" : "cursor-default opacity-70"
|
|
51
51
|
),
|
|
52
|
-
children: /* @__PURE__ */ r(
|
|
52
|
+
children: /* @__PURE__ */ r(Q, { keybinding: t.keybinding, size: "sm" })
|
|
53
53
|
}
|
|
54
|
-
) :
|
|
54
|
+
) : t.customisable ? /* @__PURE__ */ r(
|
|
55
55
|
"button",
|
|
56
56
|
{
|
|
57
57
|
type: "button",
|
|
58
58
|
onClick: (o) => {
|
|
59
|
-
o.stopPropagation(), l.onStartRecording(
|
|
59
|
+
o.stopPropagation(), l.onStartRecording(t.id);
|
|
60
60
|
},
|
|
61
61
|
className: "flex items-center justify-end h-full w-full text-xs text-content-muted hover:text-brand transition-colors cursor-pointer text-right",
|
|
62
62
|
children: l.addShortcutLabel ?? "Add shortcut"
|
|
63
63
|
}
|
|
64
64
|
) : /* @__PURE__ */ r("span", { className: "text-xs text-transparent", children: "--" }),
|
|
65
|
-
|
|
65
|
+
t.hasOverride && t.customisable && !u && /* @__PURE__ */ r(
|
|
66
66
|
"button",
|
|
67
67
|
{
|
|
68
68
|
type: "button",
|
|
69
69
|
onClick: (o) => {
|
|
70
|
-
o.stopPropagation(), l.onReset(
|
|
70
|
+
o.stopPropagation(), l.onReset(t.id);
|
|
71
71
|
},
|
|
72
72
|
className: "absolute right-1 p-0.5 rounded bg-canvas-elevated hover:bg-canvas-muted hover:text-destructive cursor-pointer opacity-0 group-hover/row:opacity-100 transition-opacity z-10",
|
|
73
73
|
title: "Reset to default",
|
|
74
|
-
children: /* @__PURE__ */ r(
|
|
74
|
+
children: /* @__PURE__ */ r(q, { className: "h-3 w-3" })
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
] })
|
|
78
78
|
}
|
|
79
79
|
) });
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const
|
|
83
|
-
return
|
|
81
|
+
function ne(l) {
|
|
82
|
+
const t = l.data;
|
|
83
|
+
return t ? /* @__PURE__ */ r("div", { className: "flex items-center h-full", children: /* @__PURE__ */ r("span", { className: "text-xs text-content-muted capitalize", children: t.scope }) }) : null;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function le({
|
|
86
86
|
className: l,
|
|
87
|
-
scopes:
|
|
88
|
-
sources:
|
|
87
|
+
scopes: t,
|
|
88
|
+
sources: u,
|
|
89
89
|
renderStatus: o,
|
|
90
|
-
recordingLabel:
|
|
91
|
-
pressShortcutLabel:
|
|
92
|
-
addShortcutLabel:
|
|
93
|
-
conflictWarnLabel:
|
|
90
|
+
recordingLabel: ae,
|
|
91
|
+
pressShortcutLabel: y,
|
|
92
|
+
addShortcutLabel: v,
|
|
93
|
+
conflictWarnLabel: w = "Conflicts with other shortcuts",
|
|
94
94
|
reservedWarnLabel: b = "This shortcut is reserved by the browser",
|
|
95
|
-
recordingInstruction:
|
|
96
|
-
...
|
|
95
|
+
recordingInstruction: L = "Recording: Press shortcut or Esc",
|
|
96
|
+
...se
|
|
97
97
|
}) {
|
|
98
98
|
const {
|
|
99
|
-
getSettingsCommands:
|
|
100
|
-
getEffectiveKeybinding:
|
|
101
|
-
updateKeybinding:
|
|
102
|
-
resetKeybinding:
|
|
103
|
-
version:
|
|
104
|
-
} =
|
|
105
|
-
let n =
|
|
106
|
-
return n = n.filter((
|
|
107
|
-
const
|
|
108
|
-
return
|
|
109
|
-
}),
|
|
110
|
-
const
|
|
99
|
+
getSettingsCommands: C,
|
|
100
|
+
getEffectiveKeybinding: S,
|
|
101
|
+
updateKeybinding: N,
|
|
102
|
+
resetKeybinding: R,
|
|
103
|
+
version: O
|
|
104
|
+
} = X(), [c, f] = i.useState(null), [d, a] = i.useState(null), x = i.useMemo(() => {
|
|
105
|
+
let n = C();
|
|
106
|
+
return n = n.filter((e) => {
|
|
107
|
+
const s = e.source ?? "user";
|
|
108
|
+
return s === "user" || s === "ag-grid";
|
|
109
|
+
}), t && (n = n.filter((e) => t.includes(e.scope))), u && (n = n.filter((e) => e.source && u.includes(e.source))), n.map((e) => {
|
|
110
|
+
const s = S(e.id), g = e.source ?? "user", D = m[g] ?? g ?? "User", T = D.toLowerCase() === "user";
|
|
111
111
|
return {
|
|
112
|
-
id:
|
|
113
|
-
command:
|
|
114
|
-
description:
|
|
115
|
-
category:
|
|
116
|
-
keybinding:
|
|
117
|
-
keybindingDisplay:
|
|
118
|
-
scope:
|
|
119
|
-
source:
|
|
120
|
-
sourceColor:
|
|
121
|
-
sourceIcon:
|
|
122
|
-
customisable:
|
|
123
|
-
passive:
|
|
124
|
-
hasOverride:
|
|
125
|
-
_def:
|
|
112
|
+
id: e.id,
|
|
113
|
+
command: e.label,
|
|
114
|
+
description: e.description || "",
|
|
115
|
+
category: e.category || "General",
|
|
116
|
+
keybinding: s,
|
|
117
|
+
keybindingDisplay: s ? Y(s) : "",
|
|
118
|
+
scope: e.scope,
|
|
119
|
+
source: D,
|
|
120
|
+
sourceColor: T ? "primary" : "neutral",
|
|
121
|
+
sourceIcon: T ? /* @__PURE__ */ r(z, { className: "h-3 w-3" }) : /* @__PURE__ */ r(G, { className: "h-3 w-3" }),
|
|
122
|
+
customisable: e.customisable !== !1,
|
|
123
|
+
passive: e.passive === !0,
|
|
124
|
+
hasOverride: e.keybinding !== void 0,
|
|
125
|
+
_def: e
|
|
126
126
|
};
|
|
127
127
|
});
|
|
128
|
-
}, [
|
|
128
|
+
}, [O, t, u, C, S]), k = i.useCallback((n) => {
|
|
129
129
|
f(n), a(null);
|
|
130
|
-
}, []),
|
|
131
|
-
|
|
132
|
-
}, [
|
|
133
|
-
|
|
130
|
+
}, []), M = i.useCallback((n) => {
|
|
131
|
+
R(n), a(null);
|
|
132
|
+
}, [R]);
|
|
133
|
+
i.useEffect(() => {
|
|
134
134
|
if (!c) return;
|
|
135
|
-
const n = (
|
|
136
|
-
if (
|
|
135
|
+
const n = (e) => {
|
|
136
|
+
if (e.preventDefault(), e.stopPropagation(), e.key === "Escape") {
|
|
137
137
|
f(null), a(null);
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
|
-
const
|
|
141
|
-
if (!
|
|
142
|
-
if (
|
|
140
|
+
const s = Z(e);
|
|
141
|
+
if (!s) return;
|
|
142
|
+
if (W(s)) {
|
|
143
143
|
a({ type: "reserved", text: b }), f(null), setTimeout(() => a(null), 3e3);
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
const g =
|
|
146
|
+
const g = N(c, s);
|
|
147
147
|
g.success ? (f(null), a(null)) : g.conflict ? (a({
|
|
148
148
|
type: "conflict",
|
|
149
|
-
text:
|
|
149
|
+
text: w
|
|
150
150
|
}), f(null), setTimeout(() => a(null), 3e3)) : g.reserved && (a({ type: "reserved", text: b }), f(null), setTimeout(() => a(null), 3e3));
|
|
151
151
|
};
|
|
152
152
|
return window.addEventListener("keydown", n, !0), () => window.removeEventListener("keydown", n, !0);
|
|
153
|
-
}, [c,
|
|
154
|
-
const _ =
|
|
153
|
+
}, [c, N, b, w]);
|
|
154
|
+
const E = i.useMemo(() => Array.from(new Set(x.map((e) => e.category))).sort().map((e) => ({ label: e, value: e })), [x]), _ = i.useMemo(() => [
|
|
155
155
|
{
|
|
156
156
|
field: "command",
|
|
157
157
|
headerName: "Command",
|
|
158
158
|
flex: 1,
|
|
159
159
|
minWidth: 200,
|
|
160
160
|
filter: "agTextColumnFilter",
|
|
161
|
-
cellRenderer:
|
|
161
|
+
cellRenderer: te,
|
|
162
162
|
filterValueGetter: (n) => {
|
|
163
|
-
const
|
|
164
|
-
return
|
|
163
|
+
const e = n.data;
|
|
164
|
+
return e ? `${e.command} ${e.description}` : "";
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
167
|
{
|
|
168
168
|
field: "category",
|
|
169
169
|
headerName: "Category",
|
|
170
170
|
width: 140,
|
|
171
|
-
filter: "agSetColumnFilter"
|
|
171
|
+
filter: "agSetColumnFilter",
|
|
172
|
+
headerComponentParams: {
|
|
173
|
+
isSearchable: !0,
|
|
174
|
+
advanceSearchEnabled: !0,
|
|
175
|
+
selectOptions: E,
|
|
176
|
+
isMultiSelect: !0
|
|
177
|
+
}
|
|
172
178
|
},
|
|
173
179
|
{
|
|
174
180
|
field: "keybindingDisplay",
|
|
@@ -176,14 +182,14 @@ function ne({
|
|
|
176
182
|
width: 180,
|
|
177
183
|
type: "rightAligned",
|
|
178
184
|
filter: "agTextColumnFilter",
|
|
179
|
-
cellRenderer:
|
|
180
|
-
cellClass:
|
|
185
|
+
cellRenderer: re,
|
|
186
|
+
cellClass: A,
|
|
181
187
|
cellRendererParams: {
|
|
182
188
|
recordingCommandId: c,
|
|
183
|
-
onStartRecording:
|
|
184
|
-
onReset:
|
|
185
|
-
recordingLabel:
|
|
186
|
-
addShortcutLabel:
|
|
189
|
+
onStartRecording: k,
|
|
190
|
+
onReset: M,
|
|
191
|
+
recordingLabel: y,
|
|
192
|
+
addShortcutLabel: v
|
|
187
193
|
},
|
|
188
194
|
sortable: !0
|
|
189
195
|
},
|
|
@@ -192,7 +198,7 @@ function ne({
|
|
|
192
198
|
headerName: "Scope",
|
|
193
199
|
width: 100,
|
|
194
200
|
filter: "agSetColumnFilter",
|
|
195
|
-
cellRenderer:
|
|
201
|
+
cellRenderer: ne,
|
|
196
202
|
headerComponentParams: {
|
|
197
203
|
isSearchable: !0,
|
|
198
204
|
advanceSearchEnabled: !0,
|
|
@@ -210,8 +216,8 @@ function ne({
|
|
|
210
216
|
headerName: "Source",
|
|
211
217
|
width: 130,
|
|
212
218
|
filter: "agSetColumnFilter",
|
|
213
|
-
cellClass:
|
|
214
|
-
cellRenderer:
|
|
219
|
+
cellClass: A,
|
|
220
|
+
cellRenderer: ee,
|
|
215
221
|
cellRendererParams: {
|
|
216
222
|
variant: "subtle",
|
|
217
223
|
colorField: "sourceColor",
|
|
@@ -229,7 +235,7 @@ function ne({
|
|
|
229
235
|
isMultiSelect: !0
|
|
230
236
|
}
|
|
231
237
|
}
|
|
232
|
-
], [c,
|
|
238
|
+
], [c, k, M, y, v, E]), I = i.useMemo(() => ({
|
|
233
239
|
filter: {
|
|
234
240
|
filterModel: {
|
|
235
241
|
source: {
|
|
@@ -238,7 +244,7 @@ function ne({
|
|
|
238
244
|
}
|
|
239
245
|
}
|
|
240
246
|
}
|
|
241
|
-
}), []),
|
|
247
|
+
}), []), K = i.useMemo(() => ({
|
|
242
248
|
sortable: !0,
|
|
243
249
|
resizable: !0,
|
|
244
250
|
filter: !0,
|
|
@@ -246,21 +252,21 @@ function ne({
|
|
|
246
252
|
isSearchable: !0,
|
|
247
253
|
advanceSearchEnabled: !0
|
|
248
254
|
}
|
|
249
|
-
}), []),
|
|
255
|
+
}), []), P = d || c ? /* @__PURE__ */ h("div", { className: p(
|
|
250
256
|
"px-3 py-1.5 text-[10px] md:text-sm font-medium rounded-md whitespace-nowrap flex items-center gap-2",
|
|
251
|
-
|
|
257
|
+
d?.type === "conflict" ? "bg-feedback-warning-surface text-content" : d?.type === "reserved" ? "bg-feedback-error-surface text-destructive" : c ? "bg-feedback-info-surface text-brand animate-[pulse_1.5s_ease-in-out_infinite]" : ""
|
|
252
258
|
), children: [
|
|
253
|
-
|
|
254
|
-
/* @__PURE__ */ r("span", { children:
|
|
259
|
+
d?.type === "conflict" ? /* @__PURE__ */ r(U, { className: "h-3.5 w-3.5 shrink-0" }) : d?.type === "reserved" ? /* @__PURE__ */ r(F, { className: "h-3.5 w-3.5 shrink-0" }) : c ? /* @__PURE__ */ r("span", { className: "shrink-0 text-base", children: "⌨️" }) : null,
|
|
260
|
+
/* @__PURE__ */ r("span", { children: d ? d.text : L })
|
|
255
261
|
] }) : null;
|
|
256
|
-
return /* @__PURE__ */
|
|
257
|
-
o ? o(
|
|
262
|
+
return /* @__PURE__ */ h(V, { className: p("flex flex-col w-full h-full border-t-0", l), children: [
|
|
263
|
+
o ? o(P) : P,
|
|
258
264
|
/* @__PURE__ */ r(
|
|
259
|
-
|
|
265
|
+
J,
|
|
260
266
|
{
|
|
261
|
-
rowData:
|
|
267
|
+
rowData: x,
|
|
262
268
|
columnDefs: _,
|
|
263
|
-
defaultColDef:
|
|
269
|
+
defaultColDef: K,
|
|
264
270
|
initialState: I,
|
|
265
271
|
rowHeight: 44,
|
|
266
272
|
animateRows: !1,
|
|
@@ -273,7 +279,7 @@ function ne({
|
|
|
273
279
|
)
|
|
274
280
|
] });
|
|
275
281
|
}
|
|
276
|
-
|
|
282
|
+
le.displayName = "ShortcutSettings";
|
|
277
283
|
export {
|
|
278
|
-
|
|
284
|
+
le as ShortcutSettings
|
|
279
285
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impact-nova",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Enterprise-grade React design system built with React 19, Vite, Tailwind CSS, and Radix UI. Built-in internationalization (i18n) and comprehensive UI component library for scalable, accessible, and performant applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|