impact-nova 1.7.50 → 1.8.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.
Files changed (31) hide show
  1. package/dist/components/ui/ag-grid-react/index.js +1 -1
  2. package/dist/components/ui/choice-card/choice-card.d.ts +45 -0
  3. package/dist/components/ui/choice-card/choice-card.js +282 -0
  4. package/dist/components/ui/choice-card/index.d.ts +1 -0
  5. package/dist/components/ui/choice-card/index.js +12 -0
  6. package/dist/components/ui/data-table/data-table-saved-views.js +53 -53
  7. package/dist/components/ui/nested-list/components/NestedListContent.d.ts +2 -1
  8. package/dist/components/ui/nested-list/components/NestedListContent.js +46 -46
  9. package/dist/components/ui/nested-list/components/SortableItem.d.ts +1 -0
  10. package/dist/components/ui/nested-list/components/SortableItem.js +72 -70
  11. package/dist/components/ui/nested-list/nested-list.js +166 -152
  12. package/dist/components/ui/select/select.js +126 -125
  13. package/dist/components/ui/sheet.js +6 -6
  14. package/dist/components/ui/types/select.types.d.ts +13 -0
  15. package/dist/components/ui/wizard/index.d.ts +1 -0
  16. package/dist/components/ui/wizard/index.js +17 -0
  17. package/dist/components/ui/wizard/wizard.d.ts +53 -0
  18. package/dist/components/ui/wizard/wizard.js +312 -0
  19. package/dist/impact-nova.css +1 -1
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +339 -336
  22. package/dist/llms/rules/real-world-patterns.js +1 -1
  23. package/package.json +11 -11
  24. package/dist/components/ui/create-item-flow/create-item-flow.d.ts +0 -46
  25. package/dist/components/ui/create-item-flow/create-item-flow.js +0 -231
  26. package/dist/components/ui/create-item-flow/index.d.ts +0 -1
  27. package/dist/components/ui/create-item-flow/index.js +0 -16
  28. package/dist/components/ui/report-card/index.d.ts +0 -1
  29. package/dist/components/ui/report-card/index.js +0 -10
  30. package/dist/components/ui/report-card/report-card.d.ts +0 -19
  31. package/dist/components/ui/report-card/report-card.js +0 -146
@@ -1,11 +1,11 @@
1
1
  import { jsxs as z, jsx as c } from "react/jsx-runtime";
2
- import b, { useRef as P, useState as v, useEffect as R, useCallback as f } from "react";
3
- import { createPortal as T } from "react-dom";
4
- import { DndContext as X } from "@dnd-kit/core";
5
- import { SortableContext as $ } from "@dnd-kit/sortable";
6
- import { customCollisionDetection as j } from "../hooks/useNestedListDragDrop.js";
7
- import { Drag as H } from "../../../../icons/index.js";
8
- const q = "0 -2px 0 0 var(--color-primary)", G = "0 2px 0 0 var(--color-primary)", J = () => null, K = ({ item: u, pointerX: m, pointerY: p }) => T(
2
+ import b, { useRef as T, useState as v, useEffect as R, useCallback as f } from "react";
3
+ import { createPortal as X } from "react-dom";
4
+ import { DndContext as $ } from "@dnd-kit/core";
5
+ import { SortableContext as j } from "@dnd-kit/sortable";
6
+ import { customCollisionDetection as H } from "../hooks/useNestedListDragDrop.js";
7
+ import { Drag as q } from "../../../../icons/index.js";
8
+ const G = "0 -2px 0 0 var(--color-primary)", J = "0 2px 0 0 var(--color-primary)", K = () => null, Q = ({ item: u, pointerX: m, pointerY: p }) => X(
9
9
  /* @__PURE__ */ c(
10
10
  "div",
11
11
  {
@@ -16,7 +16,7 @@ const q = "0 -2px 0 0 var(--color-primary)", G = "0 2px 0 0 var(--color-primary)
16
16
  {
17
17
  className: "inline-flex items-center gap-1.5 bg-canvas-elevated border border-stroke-subtle rounded px-2.5 py-1 shadow-md",
18
18
  children: [
19
- /* @__PURE__ */ c(H, { size: "12px", className: "text-content-icon shrink-0" }),
19
+ /* @__PURE__ */ c(q, { size: "12px", className: "text-content-icon shrink-0" }),
20
20
  /* @__PURE__ */ c("span", { className: "text-[13px] text-content capitalize select-none whitespace-nowrap", children: u.label })
21
21
  ]
22
22
  }
@@ -24,66 +24,66 @@ const q = "0 -2px 0 0 var(--color-primary)", G = "0 2px 0 0 var(--color-primary)
24
24
  }
25
25
  ),
26
26
  document.body
27
- ), ne = ({
27
+ ), oe = ({
28
28
  isListCollapsed: u,
29
29
  enableDragDrop: m,
30
30
  sensors: p,
31
- items: n,
31
+ items: o,
32
32
  renderItem: L,
33
33
  onDragStart: w,
34
34
  onDragOver: y,
35
35
  onDragEnd: N,
36
36
  onDragCancel: C,
37
- activeId: o
37
+ activeId: r
38
38
  }) => {
39
- const E = P(null), [h, d] = v(null), [_, O] = v(0), [x, Y] = v(0);
39
+ const E = T(null), [h, d] = v(null), [_, O] = v(0), [x, Y] = v(0);
40
40
  R(() => {
41
- if (!o) return;
41
+ if (!r) return;
42
42
  const e = (t) => {
43
43
  O(t.clientX), Y(t.clientY);
44
44
  };
45
45
  return window.addEventListener("pointermove", e), () => window.removeEventListener("pointermove", e);
46
- }, [o]), R(() => {
47
- if (!o) return;
46
+ }, [r]), R(() => {
47
+ if (!r) return;
48
48
  const e = document.createElement("style");
49
49
  return e.setAttribute("data-drag-cursor", "true"), e.textContent = "body, body * { cursor: grabbing !important; }", document.head.appendChild(e), () => {
50
50
  e.remove();
51
51
  };
52
- }, [o]);
52
+ }, [r]);
53
53
  const g = b.useMemo(() => {
54
- if (!h || !o) return null;
54
+ if (!h || !r) return null;
55
55
  let e = h, t = "after";
56
56
  if (e === "root-frozen" || e === "root-scrollable") {
57
- const s = n.findIndex((l) => l.item.id === e);
58
- if (s !== -1) {
59
- const l = n.slice(s + 1).find(
60
- (i) => i.item.id !== "root-frozen" && i.item.id !== "root-scrollable"
57
+ const i = o.findIndex((s) => s.item.id === e);
58
+ if (i !== -1) {
59
+ const s = o.slice(i + 1).find(
60
+ (n) => n.item.id !== "root-frozen" && n.item.id !== "root-scrollable"
61
61
  );
62
- if (l)
63
- e = l.item.id, t = "before";
62
+ if (s)
63
+ e = s.item.id, t = "before";
64
64
  else {
65
- const i = n.slice(0, s).filter(
65
+ const n = o.slice(0, i).filter(
66
66
  (a) => a.item.id !== "root-frozen" && a.item.id !== "root-scrollable"
67
67
  );
68
- i.length > 0 && (e = i[i.length - 1].item.id, t = "after");
68
+ n.length > 0 && (e = n[n.length - 1].item.id, t = "after");
69
69
  }
70
70
  }
71
71
  } else {
72
- const s = E.current;
73
- if (s) {
74
- const l = s.querySelector(`[data-item-id="${e}"]`);
75
- if (l) {
76
- const i = l.getBoundingClientRect(), a = i.top + i.height / 2;
72
+ const i = E.current;
73
+ if (i) {
74
+ const s = i.querySelector(`[data-item-id="${e}"]`);
75
+ if (s) {
76
+ const n = s.getBoundingClientRect(), a = n.top + n.height / 2;
77
77
  t = x < a ? "before" : "after";
78
78
  }
79
79
  }
80
80
  }
81
81
  return { overId: e, position: t };
82
- }, [h, o, x, n]), k = b.useMemo(() => n.map((e) => e.item.id), [n]), S = b.useMemo(() => o && n.find((e) => e.item.id === o) || null, [o, n]), A = f((e) => {
82
+ }, [h, r, x, o]), k = b.useMemo(() => o.map((e) => e.item.id), [o]), S = b.useMemo(() => r && o.find((e) => e.item.id === r) || null, [r, o]), A = f((e) => {
83
83
  w(e);
84
84
  }, [w]), B = f((e) => {
85
- const { active: t, over: r } = e;
86
- !r || t.id === r.id ? d(null) : d(r.id), y(e);
85
+ const { active: t, over: l } = e;
86
+ !l || t.id === l.id ? d(null) : d(l.id), y(e);
87
87
  }, [y]), F = f((e) => {
88
88
  d(null), N(e);
89
89
  }, [N]), M = f(() => {
@@ -91,22 +91,22 @@ const q = "0 -2px 0 0 var(--color-primary)", G = "0 2px 0 0 var(--color-primary)
91
91
  }, [C]);
92
92
  if (u) return null;
93
93
  const D = () => {
94
- const e = o !== null;
94
+ const e = r !== null;
95
95
  let t = null;
96
96
  if (e && g) {
97
- const r = n.findIndex((s) => s.item.id === g.overId);
98
- r !== -1 && (t = g.position === "before" ? r : r + 1);
97
+ const l = o.findIndex((i) => i.item.id === g.overId);
98
+ l !== -1 && (t = g.position === "before" ? l : l + 1);
99
99
  }
100
- return /* @__PURE__ */ c("div", { className: "w-full pb-12", children: n.map(({ item: r, level: s }, l) => {
101
- const i = t === l, a = t === l + 1 && l === n.length - 1, I = i ? q : a ? G : void 0;
100
+ return /* @__PURE__ */ c("div", { className: "w-full pb-12", children: o.map(({ item: l, level: i, indentLevel: s }, n) => {
101
+ const a = t === n, P = t === n + 1 && n === o.length - 1, I = a ? G : P ? J : void 0;
102
102
  return /* @__PURE__ */ c(
103
103
  "div",
104
104
  {
105
105
  className: "relative",
106
106
  style: I ? { boxShadow: I } : void 0,
107
- children: L(r, s)
107
+ children: L(l, i, s)
108
108
  },
109
- r.id
109
+ l.id
110
110
  );
111
111
  }) });
112
112
  };
@@ -117,21 +117,21 @@ const q = "0 -2px 0 0 var(--color-primary)", G = "0 2px 0 0 var(--color-primary)
117
117
  ref: E,
118
118
  className: "flex-1 p-1 overflow-y-auto overflow-x-hidden relative",
119
119
  children: m ? /* @__PURE__ */ c(
120
- X,
120
+ $,
121
121
  {
122
122
  sensors: p,
123
- collisionDetection: j,
123
+ collisionDetection: H,
124
124
  onDragStart: A,
125
125
  onDragOver: B,
126
126
  onDragEnd: F,
127
127
  onDragCancel: M,
128
- children: /* @__PURE__ */ c($, { items: k, strategy: J, children: D() })
128
+ children: /* @__PURE__ */ c(j, { items: k, strategy: K, children: D() })
129
129
  }
130
130
  ) : D()
131
131
  }
132
132
  ),
133
- o && S && /* @__PURE__ */ c(
134
- K,
133
+ r && S && /* @__PURE__ */ c(
134
+ Q,
135
135
  {
136
136
  item: S.item,
137
137
  pointerX: _,
@@ -141,5 +141,5 @@ const q = "0 -2px 0 0 var(--color-primary)", G = "0 2px 0 0 var(--color-primary)
141
141
  ] });
142
142
  };
143
143
  export {
144
- ne as NestedListContent
144
+ oe as NestedListContent
145
145
  };
@@ -3,6 +3,7 @@ import { NestedListItem } from '../../types/nested-list.types';
3
3
  interface SortableItemProps {
4
4
  item: NestedListItem;
5
5
  level: number;
6
+ indentLevel: number;
6
7
  isCollapsed: boolean;
7
8
  onToggle: (itemId: string) => void;
8
9
  onToggleCollapse: (itemId: string) => void;
@@ -1,87 +1,88 @@
1
- import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
- import S, { useMemo as j } from "react";
1
+ import { jsx as t, jsxs as i } from "react/jsx-runtime";
2
+ import R, { useMemo as S } from "react";
3
3
  import { useSortable as z } from "@dnd-kit/sortable";
4
4
  import { useDroppable as D } from "@dnd-kit/core";
5
5
  import { Checkbox as H } from "../../checkbox.js";
6
6
  import { ChevronRight as P, Drag as _ } from "../../../../icons/index.js";
7
- import { cn as a } from "../../../../lib/utils.js";
8
- import { useImpactNovaI18n as g } from "../../../../i18n/ImpactNovaI18nContext.js";
7
+ import { cn as c } from "../../../../lib/utils.js";
8
+ import { useImpactNovaI18n as v } from "../../../../i18n/ImpactNovaI18nContext.js";
9
9
  const $ = (e, r) => {
10
- const n = "flex items-center gap-1 py-[3px] px-2 rounded transition-colors duration-150 min-w-0";
11
- return e ? a(n, "opacity-40 bg-canvas-muted") : r ? a(n, "bg-feedback-error-surface border border-destructive animate-pulse") : a(n, "hover:bg-canvas-muted");
10
+ const n = "flex items-start gap-1 py-[3px] pr-2 rounded transition-colors duration-150 min-w-0";
11
+ return e ? c(n, "opacity-40 bg-canvas-muted") : r ? c(n, "bg-feedback-error-surface border border-destructive animate-pulse") : c(n, "hover:bg-canvas-muted");
12
12
  }, E = ({ item: e, isAnyDragging: r, renderActions: n }) => {
13
- const { t: d } = g(), s = !e.children || e.children.length === 0, {
14
- setNodeRef: p,
15
- isOver: c
13
+ const { t: s } = v(), a = !e.children || e.children.length === 0, {
14
+ setNodeRef: l,
15
+ isOver: o
16
16
  } = D({
17
17
  id: `droppable-${e.id}`,
18
18
  data: { sectionId: e.id },
19
- disabled: !s
19
+ disabled: !a
20
20
  });
21
- return /* @__PURE__ */ l("div", { ref: s ? p : void 0, children: [
22
- /* @__PURE__ */ l(
21
+ return /* @__PURE__ */ i("div", { ref: a ? l : void 0, children: [
22
+ /* @__PURE__ */ i(
23
23
  "div",
24
24
  {
25
- className: a(
25
+ className: c(
26
26
  "flex items-center justify-between px-2 py-0 text-xs font-[500] leading-4 text-navigation-muted select-none",
27
27
  e.id === "root-scrollable" ? "mt-2 pt-2 pb-1 border-t border-solid border-stroke-subtle" : "mt-1 pb-1",
28
- c && r && s && "bg-canvas-tint rounded"
28
+ o && r && a && "bg-canvas-tint rounded"
29
29
  ),
30
30
  children: [
31
- /* @__PURE__ */ l("div", { className: "flex items-center", children: [
31
+ /* @__PURE__ */ i("div", { className: "flex items-center", children: [
32
32
  e.label,
33
- c && r && s && /* @__PURE__ */ t("span", { className: "ml-2 text-brand text-[11px]", children: d("nestedList.dropHere") })
33
+ o && r && a && /* @__PURE__ */ t("span", { className: "ml-2 text-brand text-[11px]", children: s("nestedList.dropHere") })
34
34
  ] }),
35
35
  n?.(e, { isLeaf: !1, level: 0 })
36
36
  ]
37
37
  }
38
38
  ),
39
- s && /* @__PURE__ */ t(
39
+ a && /* @__PURE__ */ t(
40
40
  "div",
41
41
  {
42
- className: a(
42
+ className: c(
43
43
  "mx-2 my-1 rounded border-2 border-dashed min-h-[36px] flex items-center justify-center text-[11px] transition-colors",
44
- c && r ? "border-brand bg-canvas-tint text-brand" : "border-stroke-hairline text-content-empty"
44
+ o && r ? "border-brand bg-canvas-tint text-brand" : "border-stroke-hairline text-content-empty"
45
45
  ),
46
- children: d(c && r ? "nestedList.releaseToDrop" : "nestedList.dragHere")
46
+ children: s(o && r ? "nestedList.releaseToDrop" : "nestedList.dragHere")
47
47
  }
48
48
  )
49
49
  ] });
50
50
  }, O = ({
51
51
  item: e,
52
52
  level: r,
53
- isCollapsed: n,
54
- onToggle: d,
55
- onToggleCollapse: s,
56
- isAnyDragging: p = !1,
57
- isOver: c = !1,
58
- isValidDrop: M = !1,
59
- enableDragDrop: k = !0,
60
- enableCollapse: h = !0,
53
+ indentLevel: n,
54
+ isCollapsed: s,
55
+ onToggle: a,
56
+ onToggleCollapse: l,
57
+ isAnyDragging: o = !1,
58
+ isOver: M = !1,
59
+ isValidDrop: F = !1,
60
+ enableDragDrop: g = !0,
61
+ enableCollapse: k = !0,
61
62
  shouldBlink: N = !1,
62
- isDragDisabled: u = !1,
63
+ isDragDisabled: b = !1,
63
64
  renderLabelExtras: y,
64
65
  renderActions: f
65
66
  }) => {
66
- const { t: m } = g(), x = e.category === "structure", i = e.children && e.children.length > 0, v = !i && e.category !== "structure", C = j(() => !e.children || e.children.length === 0 || e.children.every((b) => b.checked) ? !1 : e.children.some((b) => b.checked), [e.children]), {
67
- attributes: I,
68
- listeners: w,
67
+ const { t: m } = v(), u = e.category === "structure", p = e.children && e.children.length > 0, x = !p && e.category !== "structure", w = S(() => !e.children || e.children.length === 0 || e.children.every((h) => h.checked) ? !1 : e.children.some((h) => h.checked), [e.children]), {
68
+ attributes: C,
69
+ listeners: I,
69
70
  setNodeRef: L,
70
- isDragging: R,
71
+ isDragging: j,
71
72
  // transform and transition intentionally not applied — we use a custom
72
73
  // FloatingClone and manual insertion line instead of dnd-kit's built-in animations.
73
- transform: F,
74
- transition: T
74
+ transform: T,
75
+ transition: V
75
76
  } = z({
76
77
  id: e.id,
77
78
  data: {
78
79
  level: r,
79
- hasChildren: i,
80
- isExpanded: !n
80
+ hasChildren: p,
81
+ isExpanded: !s
81
82
  },
82
- disabled: x || e.disabled || u
83
+ disabled: u || e.disabled || b
83
84
  });
84
- return x ? /* @__PURE__ */ t(E, { item: e, isAnyDragging: p, renderActions: f }) : /* @__PURE__ */ t(
85
+ return u ? /* @__PURE__ */ t(E, { item: e, isAnyDragging: o, renderActions: f }) : /* @__PURE__ */ t(
85
86
  "div",
86
87
  {
87
88
  ref: L,
@@ -90,79 +91,80 @@ const $ = (e, r) => {
90
91
  "data-level": r,
91
92
  "data-checked": e.checked,
92
93
  "data-disabled": e.disabled,
93
- "data-collapsed": n,
94
- children: /* @__PURE__ */ l(
94
+ "data-collapsed": s,
95
+ children: /* @__PURE__ */ i(
95
96
  "div",
96
97
  {
97
- className: $(R, N),
98
+ className: $(j, N),
98
99
  style: {
99
- paddingLeft: `${8 + r * 20}px`
100
+ paddingLeft: `${8 + n * 20}px`
100
101
  },
101
102
  children: [
102
- h && i && /* @__PURE__ */ t(
103
+ /* @__PURE__ */ t("div", { className: "shrink-0 w-4 h-4 flex items-center justify-center", children: k && p && /* @__PURE__ */ t(
103
104
  "button",
104
105
  {
105
106
  type: "button",
106
- onClick: (o) => {
107
- o.stopPropagation(), s(e.id);
107
+ onClick: (d) => {
108
+ d.stopPropagation(), l(e.id);
108
109
  },
109
- onMouseDown: (o) => o.stopPropagation(),
110
- className: "p-1 hover:bg-muted rounded-full transition-colors flex items-center text-content-icon hover:text-brand",
111
- "aria-label": m(n ? "nestedList.expand" : "nestedList.collapse"),
110
+ onMouseDown: (d) => d.stopPropagation(),
111
+ className: "flex h-4 w-4 items-center justify-center rounded-full p-0 hover:bg-muted transition-colors text-content-icon hover:text-brand",
112
+ "aria-label": m(s ? "nestedList.expand" : "nestedList.collapse"),
112
113
  children: /* @__PURE__ */ t(
113
114
  P,
114
115
  {
115
116
  size: "16px",
116
- className: a("transition-transform", !n && "rotate-90")
117
+ className: c("transition-transform", !s && "rotate-90")
117
118
  }
118
119
  )
119
120
  }
120
- ),
121
- (!h || !i) && /* @__PURE__ */ t("div", { className: "w-6" }),
122
- /* @__PURE__ */ t(
121
+ ) }),
122
+ /* @__PURE__ */ t("div", { className: "shrink-0 mt-0.5", children: /* @__PURE__ */ t(
123
123
  H,
124
124
  {
125
125
  id: `checkbox-${e.id}`,
126
- checked: C ? "indeterminate" : e.checked,
127
- onCheckedChange: () => d(e.id),
128
- disabled: e.disabled
126
+ checked: w ? "indeterminate" : e.checked,
127
+ onCheckedChange: () => a(e.id),
128
+ disabled: e.disabled,
129
+ className: "mr-0"
129
130
  }
130
- ),
131
- k && !u && /* @__PURE__ */ t(
131
+ ) }),
132
+ g && !b && /* @__PURE__ */ t(
132
133
  "div",
133
134
  {
135
+ ...C,
134
136
  ...I,
135
- ...w,
136
- className: "cursor-grab active:cursor-grabbing p-0 hover:bg-muted rounded flex items-center",
137
+ className: "shrink-0 mt-0.5 cursor-grab active:cursor-grabbing p-0 hover:bg-muted rounded flex items-center h-4",
137
138
  style: {
138
139
  pointerEvents: "auto",
139
140
  position: "relative",
140
141
  zIndex: 30,
141
142
  touchAction: "none"
142
143
  },
143
- onPointerDown: (o) => {
144
- o.stopPropagation();
144
+ onPointerDown: (d) => {
145
+ d.stopPropagation();
145
146
  },
146
147
  children: /* @__PURE__ */ t(_, { size: "14px", className: "text-content-icon" })
147
148
  }
148
149
  ),
149
- /* @__PURE__ */ t(
150
+ /* @__PURE__ */ i(
150
151
  "label",
151
152
  {
152
153
  htmlFor: `checkbox-${e.id}`,
153
- className: "text-[13px] text-content capitalize ml-1 cursor-pointer select-none min-w-0",
154
- children: /* @__PURE__ */ t("span", { className: "break-words", children: e.label })
154
+ className: "min-w-0 flex-1 flex flex-wrap items-center gap-x-1.5 gap-y-0 text-[13px] leading-5 text-content capitalize cursor-pointer select-none",
155
+ children: [
156
+ /* @__PURE__ */ t("span", { className: "break-words", children: e.label }),
157
+ y?.(e, { isLeaf: x, level: r })
158
+ ]
155
159
  }
156
160
  ),
157
- y?.(e, { isLeaf: v, level: r }),
158
- /* @__PURE__ */ t("div", { className: "flex-1" }),
159
- f?.(e, { isLeaf: v, level: r })
161
+ /* @__PURE__ */ t("div", { className: "shrink-0 mt-0.5", children: f?.(e, { isLeaf: x, level: r }) })
160
162
  ]
161
163
  }
162
164
  )
163
165
  }
164
166
  );
165
- }, X = S.memo(O);
167
+ }, Y = R.memo(O);
166
168
  export {
167
- X as SortableItem
169
+ Y as SortableItem
168
170
  };