impact-nova 1.7.9 → 1.7.11

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.
@@ -1,110 +1,113 @@
1
- import { jsxs as l, Fragment as ne, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as l, Fragment as le, jsx as a } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
- import { ChevronDown as le, Star as w, Search as ie, Pencil as se, Trash2 as re, Bookmark as oe } from "lucide-react";
3
+ import { ChevronDown as ie, Star as w, Search as se, Pencil as re, Trash2 as oe, Bookmark as de } from "lucide-react";
4
4
  import { cn as T } from "../../../lib/utils.js";
5
- import { Popover as de, PopoverTrigger as ce, PopoverContent as me } from "../popover.js";
6
- import { Tooltip as I, TooltipTrigger as O, TooltipContent as _ } from "../tooltip.js";
5
+ import { Popover as ce, PopoverTrigger as me, PopoverContent as pe } from "../popover.js";
6
+ import { Tooltip as _, TooltipTrigger as F, TooltipContent as L } from "../tooltip.js";
7
7
  import { Button as o } from "../button.js";
8
8
  import { Badge as C } from "../badge.js";
9
- import { Input as pe } from "../input.js";
10
- import { Separator as ue } from "../separator.js";
11
- import { Skeleton as fe } from "../skeleton.js";
9
+ import { Input as ue } from "../input.js";
10
+ import { Separator as fe } from "../separator.js";
11
+ import { Skeleton as k } from "../skeleton.js";
12
12
  import { Prompt as he } from "../prompt.js";
13
- import { useImpactNovaI18n as xe } from "../../../i18n/ImpactNovaI18nContext.js";
13
+ import { useImpactNovaI18n as be } from "../../../i18n/ImpactNovaI18nContext.js";
14
14
  const Se = ({
15
- isSaveViewEnabled: L = !0,
15
+ isSaveViewEnabled: Q = !0,
16
16
  views: s,
17
- activeViewSummary: F,
18
- viewTypeOptions: Q,
19
- menuOpen: k,
20
- defaultMenuOpen: q = !1,
17
+ activeViewSummary: q,
18
+ viewTypeOptions: K,
19
+ menuOpen: D,
20
+ defaultMenuOpen: R = !1,
21
21
  onMenuOpenChange: V,
22
22
  onSearch: m,
23
- isLoadingViews: K = !1,
24
- customListContent: D,
25
- disableApply: R = !1,
26
- className: Y,
27
- onSaveViewClick: G,
28
- onApply: H,
29
- onCancel: J,
30
- onEditView: U,
31
- onDeleteView: W,
32
- onSetDefaultView: z
23
+ isLoadingViews: z = !1,
24
+ customListContent: S,
25
+ disableApply: Y = !1,
26
+ className: G,
27
+ onSaveViewClick: H,
28
+ onApply: J,
29
+ onCancel: U,
30
+ onEditView: W,
31
+ onDeleteView: X,
32
+ onSetDefaultView: M
33
33
  }) => {
34
- const { t: a } = xe(), x = k !== void 0, [X, Z] = i.useState(
35
- q
36
- ), p = x ? !!k : X, d = i.useCallback(
34
+ const { t } = be(), b = D !== void 0, [Z, $] = i.useState(
35
+ R
36
+ ), p = b ? !!D : Z, d = i.useCallback(
37
37
  (e) => {
38
- x || Z(e), V?.(e);
38
+ b || $(e), V?.(e);
39
39
  },
40
- [x, V]
41
- ), [u, b] = i.useState("All"), [v, g] = i.useState(""), [f, S] = i.useState("");
40
+ [b, V]
41
+ ), [u, x] = i.useState("All"), [v, g] = i.useState(""), [f, P] = i.useState("");
42
42
  i.useEffect(() => {
43
- const e = window.setTimeout(() => S(v), 300);
43
+ const e = window.setTimeout(() => P(v), 300);
44
44
  return () => window.clearTimeout(e);
45
45
  }, [v]), i.useEffect(() => {
46
46
  m && m(f);
47
47
  }, [f, m]);
48
- const M = i.useMemo(
48
+ const A = i.useMemo(
49
49
  () => s.find((e) => e.isActive),
50
50
  [s]
51
- ), r = M ?? null, P = F ?? M?.viewName ?? a("dataTable.savedViewsNotApplicable"), [y, N] = i.useState(null), [h, A] = i.useState(null);
51
+ ), r = A ?? null, E = q ?? A?.viewName ?? t("dataTable.savedViewsNotApplicable"), [N, y] = i.useState(null), [h, j] = i.useState(null);
52
52
  i.useEffect(() => {
53
53
  if (p) {
54
54
  const e = s.find((c) => c.isActive);
55
- N(e?.id ?? null), b("All"), g(""), S("");
55
+ y(e?.id ?? null), x("All"), g(""), P("");
56
56
  }
57
57
  }, [p, s]);
58
- const E = i.useMemo(() => u === "All" ? s : s.filter((e) => e.viewType === u), [s, u]), j = i.useMemo(() => {
59
- let e = E;
58
+ const B = i.useMemo(() => u === "All" ? s : s.filter((e) => e.viewType === u), [s, u]), I = i.useMemo(() => {
59
+ let e = B;
60
60
  if (!m && f.trim()) {
61
61
  const c = f.trim().toLowerCase();
62
62
  e = e.filter((n) => n.viewName.toLowerCase().includes(c));
63
63
  }
64
64
  return e;
65
- }, [E, f, m]), B = y === null ? null : s.find((e) => e.id === y) ?? null, $ = () => {
66
- H?.(B, { activeView: r }), d(!1);
67
- }, ee = () => {
68
- J?.({ activeView: r, pendingView: B }), d(!1);
65
+ }, [B, f, m]), O = N === null ? null : s.find((e) => e.id === N) ?? null, ee = () => {
66
+ J?.(O, { activeView: r }), d(!1);
67
+ }, ae = () => {
68
+ U?.({ activeView: r, pendingView: O }), d(!1);
69
69
  }, te = (e) => {
70
70
  d(e), e || g("");
71
71
  };
72
- if (!L)
72
+ if (!Q)
73
73
  return null;
74
- const ae = s.length > 0;
75
- return /* @__PURE__ */ l(ne, { children: [
74
+ const ne = s.length > 0;
75
+ return /* @__PURE__ */ l(le, { children: [
76
76
  /* @__PURE__ */ l(
77
77
  "div",
78
78
  {
79
79
  "data-component": "data-table-saved-views",
80
80
  className: T(
81
81
  "mb-2 mx-4 rounded-lg bg-[linear-gradient(83.74deg,#F5F9EC_72.68%,#D7E5B2_108.88%)] flex min-w-0 flex-wrap items-center justify-between gap-2 px-2 py-3",
82
- Y
82
+ G
83
83
  ),
84
84
  children: [
85
- ae ? /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 items-center gap-1 sm:flex-initial", children: /* @__PURE__ */ l(de, { open: p, onOpenChange: te, children: [
86
- /* @__PURE__ */ t(ce, { asChild: !0, children: /* @__PURE__ */ l(
85
+ z ? /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-center gap-1", children: [
86
+ /* @__PURE__ */ a(k, { className: "h-6 w-24 rounded-full bg-black/10" }),
87
+ /* @__PURE__ */ a(k, { className: "h-6 w-6 rounded-md bg-black/10" })
88
+ ] }) : ne ? /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-1 items-center gap-1 sm:flex-initial", children: /* @__PURE__ */ l(ce, { open: p, onOpenChange: te, children: [
89
+ /* @__PURE__ */ a(me, { asChild: !0, children: /* @__PURE__ */ l(
87
90
  "button",
88
91
  {
89
92
  type: "button",
90
93
  className: "flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-md border-none bg-transparent p-0 text-left outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2",
91
94
  "aria-expanded": p,
92
95
  "aria-haspopup": "dialog",
93
- "aria-label": a("dataTable.savedViewsOpenMenu"),
96
+ "aria-label": t("dataTable.savedViewsOpenMenu"),
94
97
  children: [
95
- /* @__PURE__ */ l(I, { children: [
96
- /* @__PURE__ */ t(O, { asChild: !0, children: /* @__PURE__ */ t(
98
+ /* @__PURE__ */ l(_, { children: [
99
+ /* @__PURE__ */ a(F, { asChild: !0, children: /* @__PURE__ */ a(
97
100
  C,
98
101
  {
99
102
  color: "success",
100
103
  variant: "outline",
101
104
  className: "max-w-[min(100%,200px)] shrink font-['Manrope']",
102
- children: /* @__PURE__ */ t("span", { className: "truncate", children: P })
105
+ children: /* @__PURE__ */ a("span", { className: "truncate", children: E })
103
106
  }
104
107
  ) }),
105
- /* @__PURE__ */ t(_, { variant: "tertiary", side: "top", children: P })
108
+ /* @__PURE__ */ a(L, { variant: "tertiary", side: "top", children: E })
106
109
  ] }),
107
- /* @__PURE__ */ t(
110
+ /* @__PURE__ */ a(
108
111
  "span",
109
112
  {
110
113
  className: T(
@@ -112,52 +115,52 @@ const Se = ({
112
115
  p && "rotate-180"
113
116
  ),
114
117
  "aria-hidden": !0,
115
- children: /* @__PURE__ */ t(le, { className: "size-3.5 text-content-charcoal" })
118
+ children: /* @__PURE__ */ a(ie, { className: "size-3.5 text-content-charcoal" })
116
119
  }
117
120
  )
118
121
  ]
119
122
  }
120
123
  ) }),
121
- /* @__PURE__ */ t(
122
- me,
124
+ /* @__PURE__ */ a(
125
+ pe,
123
126
  {
124
127
  align: "start",
125
- className: "z-[110] w-[min(100vw-24px,280px)] p-0 shadow-[0_0_4px_0_rgba(0,0,0,0.12)]",
128
+ className: "z-[110] w-[min(100vw-24px,280px)] p-0 shadow-[0_0_4px_0_rgba(0,0,0,0.12)] overflow-visible",
126
129
  sideOffset: 8,
127
130
  children: /* @__PURE__ */ l("div", { className: "flex flex-col py-2", children: [
128
131
  /* @__PURE__ */ l("div", { className: "flex items-start justify-between gap-2 px-3 pb-2", children: [
129
- /* @__PURE__ */ t("span", { className: "text-sm font-medium text-content-charcoal font-['Manrope']", children: a("dataTable.savedViewsTitle") }),
132
+ /* @__PURE__ */ a("span", { className: "text-sm font-medium text-content-charcoal font-['Manrope']", children: t("dataTable.savedViewsTitle") }),
130
133
  /* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-1 text-xs font-medium text-content-tertiary font-['Manrope']", children: [
131
- /* @__PURE__ */ t(w, { className: "size-3.5 text-badge-warning-ink" }),
132
- a("dataTable.savedViewsDefault")
134
+ /* @__PURE__ */ a(w, { className: "size-3.5 text-badge-warning-ink" }),
135
+ t("dataTable.savedViewsDefault")
133
136
  ] })
134
137
  ] }),
135
138
  /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1.5 px-3 pb-2", children: [
136
- /* @__PURE__ */ t(
139
+ /* @__PURE__ */ a(
137
140
  "button",
138
141
  {
139
142
  type: "button",
140
143
  className: "border-none bg-transparent p-0",
141
- onClick: () => b("All"),
142
- children: /* @__PURE__ */ t(
144
+ onClick: () => x("All"),
145
+ children: /* @__PURE__ */ a(
143
146
  C,
144
147
  {
145
148
  color: u === "All" ? "primary" : "neutral",
146
149
  variant: "outline",
147
150
  size: "sm",
148
151
  className: "cursor-pointer font-['Manrope']",
149
- children: a("dataTable.savedViewsAll")
152
+ children: t("dataTable.savedViewsAll")
150
153
  }
151
154
  )
152
155
  }
153
156
  ),
154
- Q?.map((e) => /* @__PURE__ */ t(
157
+ K?.map((e) => /* @__PURE__ */ a(
155
158
  "button",
156
159
  {
157
160
  type: "button",
158
161
  className: "border-none bg-transparent p-0",
159
- onClick: () => b(e.value),
160
- children: /* @__PURE__ */ t(
162
+ onClick: () => x(e.value),
163
+ children: /* @__PURE__ */ a(
161
164
  C,
162
165
  {
163
166
  color: u === e.value ? "primary" : "neutral",
@@ -171,26 +174,26 @@ const Se = ({
171
174
  e.value
172
175
  ))
173
176
  ] }),
174
- /* @__PURE__ */ t("div", { className: "px-3 pb-2", children: /* @__PURE__ */ t(
175
- pe,
177
+ /* @__PURE__ */ a("div", { className: "px-3 pb-2", children: /* @__PURE__ */ a(
178
+ ue,
176
179
  {
177
180
  size: "sm",
178
- placeholder: a("dataTable.savedViewsSearchPlaceholder"),
181
+ placeholder: t("dataTable.savedViewsSearchPlaceholder"),
179
182
  value: v,
180
183
  onChange: (e) => g(e.target.value),
181
- prefix: /* @__PURE__ */ t(
182
- ie,
184
+ prefix: /* @__PURE__ */ a(
185
+ se,
183
186
  {
184
187
  className: "size-4 shrink-0 text-content-muted",
185
188
  "aria-hidden": !0
186
189
  }
187
190
  ),
188
191
  className: "border-none shadow-none my-2 rounded-none",
189
- "aria-label": a("dataTable.savedViewsSearchPlaceholder")
192
+ "aria-label": t("dataTable.savedViewsSearchPlaceholder")
190
193
  }
191
194
  ) }),
192
- /* @__PURE__ */ t("div", { className: "min-h-[72px] px-1", children: D || (K ? /* @__PURE__ */ t("div", { className: "flex max-h-[160px] flex-col gap-2 overflow-y-auto px-2 py-1", children: [1, 2, 3, 4, 5].map((e) => /* @__PURE__ */ t(fe, { className: "h-9 w-full rounded-lg" }, e)) }) : j.length === 0 ? /* @__PURE__ */ t("div", { className: "flex min-h-[100px] flex-col items-center justify-center px-4 py-6 text-center", children: /* @__PURE__ */ t("span", { className: "text-sm leading-relaxed text-content-tertiary font-['Manrope']", children: a("dataTable.savedViewsEmptyList") }) }) : /* @__PURE__ */ t("div", { className: "flex max-h-[160px] flex-col overflow-y-auto", children: j.map((e) => {
193
- const c = y === e.id;
195
+ /* @__PURE__ */ a("div", { className: "min-h-[72px] px-1", children: S || (z ? /* @__PURE__ */ a("div", { className: "flex max-h-[160px] flex-col gap-2 overflow-y-auto px-2 py-1", children: [1, 2, 3, 4, 5].map((e) => /* @__PURE__ */ a(k, { className: "h-9 w-full rounded-lg" }, e)) }) : I.length === 0 ? /* @__PURE__ */ a("div", { className: "flex min-h-[100px] flex-col items-center justify-center px-4 py-6 text-center", children: /* @__PURE__ */ a("span", { className: "text-sm leading-relaxed text-content-tertiary font-['Manrope']", children: t("dataTable.savedViewsEmptyList") }) }) : /* @__PURE__ */ a("div", { className: "flex max-h-[160px] flex-col overflow-y-auto", children: I.map((e) => {
196
+ const c = N === e.id;
194
197
  return /* @__PURE__ */ l(
195
198
  "div",
196
199
  {
@@ -201,73 +204,73 @@ const Se = ({
201
204
  c && "bg-badge-info-muted text-badge-info-foreground",
202
205
  !c && "text-foreground"
203
206
  ),
204
- onClick: () => N(e.id),
207
+ onClick: () => y(e.id),
205
208
  onKeyDown: (n) => {
206
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), N(e.id));
209
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), y(e.id));
207
210
  },
208
211
  children: [
209
- /* @__PURE__ */ l(I, { children: [
210
- /* @__PURE__ */ t(O, { asChild: !0, children: /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", children: e.viewName }) }),
211
- /* @__PURE__ */ t(_, { variant: "tertiary", side: "right", children: e.viewName })
212
+ /* @__PURE__ */ l(_, { children: [
213
+ /* @__PURE__ */ a(F, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate", children: e.viewName }) }),
214
+ /* @__PURE__ */ a(L, { variant: "tertiary", side: "right", children: e.viewName })
212
215
  ] }),
213
216
  /* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-0.5", children: [
214
- e.isEditable ? /* @__PURE__ */ t(
217
+ e.isEditable ? /* @__PURE__ */ a(
215
218
  o,
216
219
  {
217
220
  type: "button",
218
221
  variant: "ghost",
219
222
  size: "iconSm",
220
223
  className: "text-foreground hover:text-content-charcoal",
221
- "aria-label": a("dataTable.savedViewsEdit"),
224
+ "aria-label": t("dataTable.savedViewsEdit"),
222
225
  onClick: (n) => {
223
- n.stopPropagation(), n.preventDefault(), d(!1), U?.(e, { activeView: r });
226
+ n.stopPropagation(), n.preventDefault(), d(!1), W?.(e, { activeView: r });
224
227
  },
225
- children: /* @__PURE__ */ t(se, { className: "size-3.5" })
228
+ children: /* @__PURE__ */ a(re, { className: "size-3.5" })
226
229
  }
227
230
  ) : null,
228
- e.isDeletable ? /* @__PURE__ */ t(
231
+ e.isDeletable ? /* @__PURE__ */ a(
229
232
  o,
230
233
  {
231
234
  type: "button",
232
235
  variant: "ghost",
233
236
  size: "iconSm",
234
237
  className: "text-foreground hover:text-destructive",
235
- "aria-label": a("dataTable.savedViewsDelete"),
238
+ "aria-label": t("dataTable.savedViewsDelete"),
236
239
  onClick: (n) => {
237
- n.stopPropagation(), n.preventDefault(), d(!1), A(e);
240
+ n.stopPropagation(), n.preventDefault(), d(!1), j(e);
238
241
  },
239
- children: /* @__PURE__ */ t(re, { className: "size-3.5" })
242
+ children: /* @__PURE__ */ a(oe, { className: "size-3.5" })
240
243
  }
241
244
  ) : null,
242
- e.hideDefaultStar ? null : e.isDefaultView ? /* @__PURE__ */ t(
245
+ e.hideDefaultStar ? null : e.isDefaultView ? /* @__PURE__ */ a(
243
246
  o,
244
247
  {
245
248
  type: "button",
246
249
  variant: "ghost",
247
250
  size: "iconSm",
248
251
  className: "text-yellow-500 hover:text-yellow-600",
249
- "aria-label": a(
252
+ "aria-label": t(
250
253
  "dataTable.savedViewsDefaultAction"
251
254
  ),
252
255
  onClick: (n) => {
253
- n.stopPropagation(), n.preventDefault(), z?.(e, { activeView: r });
256
+ n.stopPropagation(), n.preventDefault(), M?.(e, { activeView: r });
254
257
  },
255
- children: /* @__PURE__ */ t(w, { className: "size-3.5 fill-current" })
258
+ children: /* @__PURE__ */ a(w, { className: "size-3.5 fill-current" })
256
259
  }
257
- ) : /* @__PURE__ */ t(
260
+ ) : /* @__PURE__ */ a(
258
261
  o,
259
262
  {
260
263
  type: "button",
261
264
  variant: "ghost",
262
265
  size: "iconSm",
263
266
  className: "text-yellow-500 hover:text-yellow-600",
264
- "aria-label": a(
267
+ "aria-label": t(
265
268
  "dataTable.savedViewsSetDefault"
266
269
  ),
267
270
  onClick: (n) => {
268
- n.stopPropagation(), n.preventDefault(), z?.(e, { activeView: r });
271
+ n.stopPropagation(), n.preventDefault(), M?.(e, { activeView: r });
269
272
  },
270
- children: /* @__PURE__ */ t(w, { className: "size-3.5" })
273
+ children: /* @__PURE__ */ a(w, { className: "size-3.5" })
271
274
  }
272
275
  )
273
276
  ] })
@@ -276,27 +279,27 @@ const Se = ({
276
279
  e.id
277
280
  );
278
281
  }) })) }),
279
- /* @__PURE__ */ t(ue, { className: "my-1" }),
282
+ /* @__PURE__ */ a(fe, { className: "my-1" }),
280
283
  /* @__PURE__ */ l("div", { className: "flex justify-end gap-2 px-3 pt-1", children: [
281
- /* @__PURE__ */ t(
284
+ /* @__PURE__ */ a(
282
285
  o,
283
286
  {
284
287
  type: "button",
285
288
  variant: "tertiary",
286
289
  size: "md",
287
- onClick: ee,
288
- children: a("dataTable.savedViewsCancel")
290
+ onClick: ae,
291
+ children: t("dataTable.savedViewsCancel")
289
292
  }
290
293
  ),
291
- /* @__PURE__ */ t(
294
+ /* @__PURE__ */ a(
292
295
  o,
293
296
  {
294
297
  type: "button",
295
298
  variant: "default",
296
299
  size: "md",
297
- disabled: R,
298
- onClick: $,
299
- children: a("dataTable.savedViewsApply")
300
+ disabled: Y,
301
+ onClick: ee,
302
+ children: t("dataTable.savedViewsApply")
300
303
  }
301
304
  )
302
305
  ] })
@@ -304,10 +307,10 @@ const Se = ({
304
307
  }
305
308
  )
306
309
  ] }) }) : /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-center gap-2 text-content-tertiary", children: [
307
- /* @__PURE__ */ t(oe, { className: "size-4 shrink-0", "aria-hidden": !0 }),
308
- /* @__PURE__ */ t("span", { className: "text-sm font-medium font-['Manrope']", children: a("dataTable.savedViewsNoneYet") })
310
+ /* @__PURE__ */ a(de, { className: "size-4 shrink-0", "aria-hidden": !0 }),
311
+ /* @__PURE__ */ a("span", { className: "text-sm font-medium font-['Manrope']", children: t("dataTable.savedViewsNoneYet") })
309
312
  ] }),
310
- /* @__PURE__ */ t(
313
+ /* @__PURE__ */ a(
311
314
  o,
312
315
  {
313
316
  type: "button",
@@ -315,29 +318,29 @@ const Se = ({
315
318
  size: "sm",
316
319
  className: "shrink-0 font-['Manrope']",
317
320
  onClick: () => {
318
- d(!1), G?.({ activeView: r });
321
+ d(!1), H?.({ activeView: r });
319
322
  },
320
- children: a("dataTable.savedViewsSave")
323
+ children: t("dataTable.savedViewsSave")
321
324
  }
322
325
  )
323
326
  ]
324
327
  }
325
328
  ),
326
- /* @__PURE__ */ t(
329
+ /* @__PURE__ */ a(
327
330
  he,
328
331
  {
329
332
  variant: "destructive",
330
333
  open: h !== null,
331
334
  onOpenChange: (e) => {
332
- e || A(null);
335
+ e || j(null);
333
336
  },
334
- title: a("dataTable.savedViewsDeleteConfirmTitle"),
335
- description: h ? a("dataTable.savedViewsDeleteConfirmDescription", {
337
+ title: t("dataTable.savedViewsDeleteConfirmTitle"),
338
+ description: h ? t("dataTable.savedViewsDeleteConfirmDescription", {
336
339
  viewName: h.viewName
337
340
  }) : void 0,
338
- confirmLabel: a("dataTable.savedViewsDeleteConfirmButton"),
341
+ confirmLabel: t("dataTable.savedViewsDeleteConfirmButton"),
339
342
  onConfirm: () => {
340
- h && W?.(h, { activeView: r });
343
+ h && X?.(h, { activeView: r });
341
344
  }
342
345
  }
343
346
  )