impact-nova 2.1.0-alpha.4 → 2.1.0-alpha.6

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 (153) hide show
  1. package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.d.ts +3 -0
  2. package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.js +6 -0
  3. package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +15 -21
  4. package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +1 -1
  5. package/dist/components/data/ag-grid-react/cell-renderers/default-text-cell-renderer.d.ts +1 -2
  6. package/dist/components/data/ag-grid-react/cell-renderers/default-text-cell-renderer.js +12 -6
  7. package/dist/components/data/ag-grid-react/cell-renderers/editors/textarea-cell-editor.js +19 -19
  8. package/dist/components/data/ag-grid-react/cell-renderers/select-display-renderer.js +1 -1
  9. package/dist/components/data/ag-grid-react/cell-renderers/switch-display-renderer.js +15 -15
  10. package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +1 -1
  11. package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.js +33 -33
  12. package/dist/components/data/ag-grid-react/headers/components/header-info.js +66 -62
  13. package/dist/components/data/ag-grid-react/headers/components/info-modal.js +6 -6
  14. package/dist/components/data/ag-grid-react/headers/components/section-renderers.js +18 -18
  15. package/dist/components/data/ag-grid-react/headers/custom-header-group.js +40 -29
  16. package/dist/components/data/ag-grid-react/headers/custom-header.js +102 -98
  17. package/dist/components/data/ag-grid-react/index.d.ts +1 -1
  18. package/dist/components/data/ag-grid-react/index.js +136 -127
  19. package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +7 -0
  20. package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +6 -0
  21. package/dist/components/data/ag-grid-react/theme.js +8 -4
  22. package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.d.ts +5 -0
  23. package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.js +13 -0
  24. package/dist/components/data/ag-grid-react/useGridAutoSizeStrategyOnResize.js +8 -5
  25. package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +14 -0
  26. package/dist/components/data/data-table/build-column-tree-from-grid.js +95 -0
  27. package/dist/components/data/data-table/data-table-column-apply.d.ts +29 -0
  28. package/dist/components/data/data-table/data-table-column-apply.js +102 -0
  29. package/dist/components/data/data-table/data-table-column-def-pin.d.ts +25 -0
  30. package/dist/components/data/data-table/data-table-column-def-pin.js +66 -0
  31. package/dist/components/data/data-table/data-table-column-list-sync.d.ts +8 -0
  32. package/dist/components/data/data-table/data-table-column-list-sync.js +15 -0
  33. package/dist/components/data/data-table/data-table-column-list.d.ts +14 -4
  34. package/dist/components/data/data-table/data-table-column-list.js +74 -277
  35. package/dist/components/data/data-table/data-table-constants.d.ts +3 -4
  36. package/dist/components/data/data-table/data-table-context.d.ts +3 -6
  37. package/dist/components/data/data-table/data-table-context.js +21 -10
  38. package/dist/components/data/data-table/data-table-saved-views.js +26 -26
  39. package/dist/components/data/data-table/data-table-sheet-portal-store.d.ts +13 -0
  40. package/dist/components/data/data-table/data-table-sheet-portal-store.js +36 -0
  41. package/dist/components/data/data-table/data-table-sheet.d.ts +3 -6
  42. package/dist/components/data/data-table/data-table-sheet.js +4 -2
  43. package/dist/components/data/data-table/data-table-view-menu.js +40 -40
  44. package/dist/components/data/data-table/data-table.d.ts +8 -10
  45. package/dist/components/data/data-table/data-table.js +138 -111
  46. package/dist/components/data/data-table/data-table.types.d.ts +35 -0
  47. package/dist/components/data/data-table/index.js +28 -27
  48. package/dist/components/data/data-table/indicator-legend.js +6 -6
  49. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +16 -0
  50. package/dist/components/data/data-table/use-data-table-column-list-sync.js +222 -0
  51. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.d.ts +8 -0
  52. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +72 -0
  53. package/dist/components/data/expandable-list-item/expandable-list-item-context.d.ts +13 -0
  54. package/dist/components/data/expandable-list-item/expandable-list-item-context.js +25 -0
  55. package/dist/components/data/expandable-list-item/expandable-list-item-metrics.d.ts +6 -0
  56. package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +41 -0
  57. package/dist/components/data/expandable-list-item/expandable-list-item-parts.d.ts +31 -0
  58. package/dist/components/data/expandable-list-item/expandable-list-item-parts.js +233 -0
  59. package/dist/components/data/expandable-list-item/expandable-list-item-preset.d.ts +18 -0
  60. package/dist/components/data/expandable-list-item/expandable-list-item-preset.js +133 -0
  61. package/dist/components/data/expandable-list-item/expandable-list-item.d.ts +5 -0
  62. package/dist/components/data/{expandable-sku/expandable-sku.types.d.ts → expandable-list-item/expandable-list-item.types.d.ts} +7 -7
  63. package/dist/components/data/expandable-list-item/index.d.ts +5 -0
  64. package/dist/components/data/expandable-list-item/index.js +19 -0
  65. package/dist/components/data/nested-list/components/NestedListHeader.js +11 -11
  66. package/dist/components/data/nested-list/components/SortableItem.js +2 -2
  67. package/dist/components/data-display/avatar/avatar.types.d.ts +2 -0
  68. package/dist/components/data-display/badge/badge.types.d.ts +2 -0
  69. package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +11 -11
  70. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +7 -7
  71. package/dist/components/data-display/calendar/calendar-week-number-cell.js +31 -31
  72. package/dist/components/data-display/card/card.js +8 -8
  73. package/dist/components/data-display/chart/chart.types.d.ts +9 -0
  74. package/dist/components/data-display/skeleton/skeleton.js +6 -6
  75. package/dist/components/data-display/statistics-card/statistics-card.js +14 -14
  76. package/dist/components/feedback/alert-dialog/alert-dialog.js +19 -19
  77. package/dist/components/feedback/dialog/dialog.js +1 -1
  78. package/dist/components/feedback/drawer/drawer.js +18 -18
  79. package/dist/components/feedback/dropdown-menu/dropdown-menu.js +70 -57
  80. package/dist/components/feedback/popover/popover.js +1 -1
  81. package/dist/components/feedback/sheet/sheet.js +1 -1
  82. package/dist/components/feedback/tooltip/tooltip.js +22 -22
  83. package/dist/components/feedback/tooltip/tooltip.variants.js +1 -1
  84. package/dist/components/flows/command-palette/command-palette.js +104 -104
  85. package/dist/components/flows/command-palette/shortcut-settings.js +34 -34
  86. package/dist/components/flows/filter-strip/filter-tag-list.js +4 -4
  87. package/dist/components/flows/notification-panel/notification-list.js +17 -17
  88. package/dist/components/flows/notification-panel/notification-panel.js +4 -4
  89. package/dist/components/flows/notification-panel/notification-panel.types.d.ts +3 -0
  90. package/dist/components/flows/wizard/wizard.js +8 -8
  91. package/dist/components/forms/combobox/combobox.js +20 -20
  92. package/dist/components/forms/date-picker/date-picker.js +17 -17
  93. package/dist/components/forms/date-picker/date-range-picker.js +3 -3
  94. package/dist/components/forms/date-picker/month-picker.js +1 -1
  95. package/dist/components/forms/date-picker/month-range-picker.js +42 -42
  96. package/dist/components/forms/date-picker/week-picker.js +15 -15
  97. package/dist/components/forms/date-picker/week-range-picker.js +3 -3
  98. package/dist/components/forms/file-upload/file-upload.js +33 -33
  99. package/dist/components/forms/input/input.js +8 -8
  100. package/dist/components/forms/input/input.variants.js +3 -3
  101. package/dist/components/forms/select/components/SelectMenuPanel.d.ts +1 -2
  102. package/dist/components/forms/select/components/SelectMenuPanel.js +18 -20
  103. package/dist/components/forms/select/components/SelectTrigger.d.ts +9 -6
  104. package/dist/components/forms/select/components/SelectTrigger.js +120 -122
  105. package/dist/components/forms/select/components/Submenu.js +8 -8
  106. package/dist/components/forms/select/hooks/useSelectKeyboardHandlers.d.ts +1 -1
  107. package/dist/components/forms/select/hooks/useSelectValueState.d.ts +19 -0
  108. package/dist/components/forms/select/hooks/useSelectValueState.js +41 -0
  109. package/dist/components/forms/select/index.js +4 -3
  110. package/dist/components/forms/select/select.js +180 -175
  111. package/dist/components/forms/select/select.types.d.ts +3 -2
  112. package/dist/components/forms/select/select.variants.js +4 -4
  113. package/dist/components/forms/select/utils/select.d.ts +2 -1
  114. package/dist/components/forms/select/utils/select.js +47 -37
  115. package/dist/components/layout/sidebar/sidebar.d.ts +7 -50
  116. package/dist/components/layout/sidebar/sidebar.js +12 -11
  117. package/dist/components/layout/sidebar/sidebar.types.d.ts +35 -1
  118. package/dist/components/primitives/button-group/button-group.js +32 -32
  119. package/dist/components/primitives/chips/chips.variants.js +5 -5
  120. package/dist/components/primitives/empty-container/empty-container.types.d.ts +3 -0
  121. package/dist/components/primitives/kbd/kbd.variants.js +3 -3
  122. package/dist/components/primitives/stepper/stepper.js +6 -6
  123. package/dist/impact-nova-components.css +113 -7
  124. package/dist/impact-nova-tokens.scss +2 -4
  125. package/dist/impact-nova.css +1 -1
  126. package/dist/index.d.ts +1 -1
  127. package/dist/index.js +467 -433
  128. package/dist/lib/compose-refs.d.ts +8 -0
  129. package/dist/lib/compose-refs.js +14 -0
  130. package/dist/lib/primitives/field.types.d.ts +8 -2
  131. package/dist/lib/virtualized/index.d.ts +3 -0
  132. package/dist/lib/virtualized/index.js +33 -16
  133. package/dist/lib/virtualized/useVirtualizedList.d.ts +2 -0
  134. package/dist/lib/virtualized/useVirtualizedList.js +115 -109
  135. package/dist/lib/virtualized/virtualized-list-context.d.ts +12 -0
  136. package/dist/lib/virtualized/virtualized-list-context.js +21 -0
  137. package/dist/lib/virtualized/virtualized-list-parts.d.ts +51 -0
  138. package/dist/lib/virtualized/virtualized-list-parts.js +175 -0
  139. package/dist/lib/virtualized/virtualized-list-utils.d.ts +5 -0
  140. package/dist/lib/virtualized/virtualized-list-utils.js +6 -0
  141. package/dist/llms/rules/ag-grid.js +1 -1
  142. package/dist/llms/rules/installation.js +1 -1
  143. package/dist/llms/rules/migration.js +1 -1
  144. package/dist/llms/rules/real-world-patterns.js +1 -1
  145. package/dist/llms/rules/requirements.js +1 -1
  146. package/package.json +24 -15
  147. package/tailwind.config.js +1 -0
  148. package/dist/components/data/ag-grid-react/headers/components/truncated-text.d.ts +0 -15
  149. package/dist/components/data/ag-grid-react/headers/components/truncated-text.js +0 -27
  150. package/dist/components/data/expandable-sku/expandable-sku.d.ts +0 -38
  151. package/dist/components/data/expandable-sku/expandable-sku.js +0 -245
  152. package/dist/components/data/expandable-sku/index.d.ts +0 -2
  153. package/dist/components/data/expandable-sku/index.js +0 -4
@@ -0,0 +1,16 @@
1
+ import { GridApi } from 'ag-grid-community';
2
+ import { NestedListItem } from '../nested-list/nested-list.types';
3
+ export interface UseDataTableColumnListSyncOptions {
4
+ gridApi: GridApi | null;
5
+ frozenColumnsLabel: string;
6
+ scrollableColumnsLabel: string;
7
+ }
8
+ export declare function useDataTableColumnListSync({ gridApi, frozenColumnsLabel, scrollableColumnsLabel, }: UseDataTableColumnListSyncOptions): {
9
+ items: NestedListItem[];
10
+ isReady: boolean;
11
+ externalSyncKey: boolean;
12
+ listWrapperRef: import('react').RefObject<HTMLDivElement | null>;
13
+ handleChange: (currentItems: NestedListItem[], enableApplyDiscard: boolean) => void;
14
+ handleSubmit: (finalItems: NestedListItem[]) => void;
15
+ handlePinChange: (itemId: string, newPinned: "left" | "right" | null) => void;
16
+ };
@@ -0,0 +1,222 @@
1
+ import { useState as M, useRef as h, useCallback as a, useEffect as x } from "react";
2
+ import { mergePartialOrderedColumnState as L } from "./data-table-column-state.js";
3
+ import { afterSynchronousColumnApply as b, normalizeColumnPinned as q, GRID_AUTO_UNPIN_WAIT_MS as H, alignColumnTreePinMetadata as N, EXTERNAL_SYNC_DEBOUNCE_MS as J, readGridColumnPinned as Q } from "./data-table-column-apply.js";
4
+ import { buildColumnTreeFromGrid as Z } from "./build-column-tree-from-grid.js";
5
+ import { computeColumnListSyncFingerprints as z, resolveColumnListSyncMode as A } from "./data-table-column-list-sync.js";
6
+ import { subscribeGridApiEvent as j } from "../ag-grid-react/grid-api-event-subscription.js";
7
+ function se({
8
+ gridApi: n,
9
+ frozenColumnsLabel: O,
10
+ scrollableColumnsLabel: _
11
+ }) {
12
+ const [K, v] = M([]), [V, W] = M(!1), [w, B] = M(!1), i = h(!1), E = h(null), S = h(0), y = h(""), P = h(""), C = a(() => !n || i.current ? null : Z(n, {
13
+ frozenColumns: O,
14
+ scrollableColumns: _
15
+ }), [n, O, _]), g = a(
16
+ (t, e, o) => {
17
+ const l = y.current, c = z(t);
18
+ y.current = c.structural, P.current = c.indicators, v(t), W(!0), e === "structural" && l !== "" && B((d) => !d);
19
+ },
20
+ [n]
21
+ ), p = a(
22
+ (t = "unknown") => {
23
+ const e = C();
24
+ e && g(e, "structural", t);
25
+ },
26
+ [g, C, n]
27
+ ), D = a(
28
+ (t) => {
29
+ const e = C();
30
+ if (!e) return;
31
+ const o = A(
32
+ e,
33
+ y.current,
34
+ P.current
35
+ );
36
+ if (o !== "skip") {
37
+ if (o === "structural") {
38
+ const l = E.current?.querySelector(
39
+ '[data-component="nested-list"] .overflow-y-auto'
40
+ );
41
+ l && (S.current = l.scrollTop);
42
+ }
43
+ g(e, o, t);
44
+ }
45
+ },
46
+ [g, C]
47
+ );
48
+ x(() => {
49
+ if (!n) return;
50
+ queueMicrotask(() => p("initial"));
51
+ const t = [
52
+ "columnVisible",
53
+ "columnPinned",
54
+ "columnMoved",
55
+ "gridReady",
56
+ "columnGroupOpened",
57
+ "columnRowGroupChanged",
58
+ "columnPivotModeChanged",
59
+ "columnEverythingChanged",
60
+ "dragStopped",
61
+ "columnValueChanged",
62
+ "displayedColumnsChanged",
63
+ "sortChanged",
64
+ "filterChanged",
65
+ "newColumnsLoaded"
66
+ ];
67
+ let e = null;
68
+ const o = (c) => {
69
+ i.current || (e && clearTimeout(e), e = setTimeout(() => {
70
+ e = null, !(i.current || n.isDestroyed()) && D(`grid:${c}`);
71
+ }, J));
72
+ }, l = t.map(
73
+ (c) => j(n, c, () => {
74
+ o(c);
75
+ })
76
+ );
77
+ return () => {
78
+ e && clearTimeout(e), l.forEach((c) => c());
79
+ };
80
+ }, [n, p, D]), x(() => {
81
+ if (S.current === 0) return;
82
+ const t = requestAnimationFrame(() => {
83
+ const e = E.current?.querySelector(
84
+ '[data-component="nested-list"] .overflow-y-auto'
85
+ );
86
+ e && (e.scrollTop = S.current, S.current = 0);
87
+ });
88
+ return () => cancelAnimationFrame(t);
89
+ }, [w]);
90
+ const U = a(
91
+ (t) => {
92
+ const e = [], o = (l, c) => {
93
+ l.forEach((r) => {
94
+ if (r.id === "root-frozen") {
95
+ r.children && o(r.children, "left");
96
+ return;
97
+ }
98
+ if (r.id === "root-scrollable") {
99
+ r.children && o(r.children, null);
100
+ return;
101
+ }
102
+ if (r.category === "group" || r.children && r.children.length > 0)
103
+ r.children && o(r.children, c);
104
+ else {
105
+ let u;
106
+ if (c === null)
107
+ u = null;
108
+ else {
109
+ const f = r.data?.pinned;
110
+ u = f === "left" || f === "right" ? f : c;
111
+ }
112
+ e.push({
113
+ colId: r.id,
114
+ pinned: u,
115
+ hide: !r.checked
116
+ });
117
+ }
118
+ });
119
+ };
120
+ return o(t, null), e;
121
+ },
122
+ []
123
+ ), I = a(
124
+ (t) => {
125
+ if (!n) return;
126
+ i.current = !0;
127
+ const e = U(t);
128
+ if (e.length === 0) {
129
+ b(() => {
130
+ i.current = !1;
131
+ });
132
+ return;
133
+ }
134
+ const o = n.getColumnState(), l = L(o, e), c = new Set(
135
+ o.filter((s) => q(s.pinned)).map((s) => s.colId)
136
+ ), r = l.filter(
137
+ (s) => q(s.pinned) && !c.has(s.colId)
138
+ ), d = new Set(r.map((s) => s.colId));
139
+ n.applyColumnState({ state: l, applyOrder: !0 });
140
+ const u = () => {
141
+ i.current = !1, p("handleChanges:releaseLockAndSync");
142
+ };
143
+ if (d.size === 0) {
144
+ b(u);
145
+ return;
146
+ }
147
+ let T = !1, f = null, G = null;
148
+ G = j(n, "columnPinned", () => {
149
+ if (T || n.isDestroyed()) return;
150
+ const s = n.getColumnState();
151
+ if (r.filter((R) => {
152
+ const m = s.find((F) => F.colId === R.colId);
153
+ return m && !m.pinned;
154
+ }).length > 0) {
155
+ T = !0, f && clearTimeout(f), G?.();
156
+ const R = l.filter(
157
+ (m) => m.pinned && !d.has(m.colId)
158
+ );
159
+ if (R.length > 0) {
160
+ const m = R[0], F = l.map(
161
+ (k) => k.colId === m.colId ? { ...k, pinned: null } : k
162
+ );
163
+ n.applyColumnState({ state: F, applyOrder: !0 });
164
+ }
165
+ b(u);
166
+ }
167
+ }), f = setTimeout(() => {
168
+ G?.(), T || u();
169
+ }, H);
170
+ },
171
+ [n, U, p]
172
+ ), X = a(
173
+ (t) => {
174
+ I(N(t));
175
+ },
176
+ [I]
177
+ ), Y = a(
178
+ (t, e) => {
179
+ const o = N(t);
180
+ e || I(o), v(o);
181
+ const l = z(o);
182
+ y.current = l.structural, P.current = l.indicators;
183
+ },
184
+ [I]
185
+ ), $ = a(
186
+ (t, e) => {
187
+ if (v((c) => {
188
+ const r = (d) => d.map((u) => u.id === t ? {
189
+ ...u,
190
+ data: {
191
+ ...u.data,
192
+ pinned: e
193
+ }
194
+ } : u.children ? {
195
+ ...u,
196
+ children: r(u.children)
197
+ } : u);
198
+ return r(c);
199
+ }), !n) return;
200
+ i.current = !0;
201
+ const o = n.getColumnState(), l = L(o, [
202
+ { colId: t, pinned: e }
203
+ ]);
204
+ n.applyColumnState({ state: l, applyOrder: !0 }), b(() => {
205
+ i.current = !1, Q(n, t) !== e && p("handlePinChange");
206
+ });
207
+ },
208
+ [n, p]
209
+ );
210
+ return {
211
+ items: K,
212
+ isReady: V,
213
+ externalSyncKey: w,
214
+ listWrapperRef: E,
215
+ handleChange: Y,
216
+ handleSubmit: X,
217
+ handlePinChange: $
218
+ };
219
+ }
220
+ export {
221
+ se as useDataTableColumnListSync
222
+ };
@@ -0,0 +1,8 @@
1
+ import { ExpandableListItemAttributesSection } from './expandable-list-item.types';
2
+ export interface ExpandableListItemAttributesProps {
3
+ tags: ExpandableListItemAttributesSection["tags"];
4
+ title?: string;
5
+ maxVisibleTags?: number;
6
+ formatOverflow?: ExpandableListItemAttributesSection["formatOverflow"];
7
+ }
8
+ export declare function ExpandableListItemAttributes({ tags, title, maxVisibleTags, formatOverflow, }: ExpandableListItemAttributesProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,72 @@
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import { Badge as p } from "../../data-display/badge/badge.js";
3
+ import { FilterPopoverContent as h } from "../../flows/filter-strip/filter-tag-list.js";
4
+ import { Popover as u, PopoverTrigger as f } from "../../feedback/popover/popover.js";
5
+ import { Tag as x } from "../../primitives/tag/tag.js";
6
+ import { Tooltip as b, TooltipTrigger as g, TooltipContent as v } from "../../feedback/tooltip/tooltip.js";
7
+ function I({
8
+ tags: n,
9
+ title: i = "Attributes",
10
+ maxVisibleTags: a = 4,
11
+ formatOverflow: s
12
+ }) {
13
+ const c = n.slice(0, a), t = n.slice(a), o = t.length, d = s?.(o) ?? (o > 0 ? `+${o}` : null);
14
+ return /* @__PURE__ */ r(
15
+ "div",
16
+ {
17
+ className: "px-4 py-4 pt-0 sm:px-5",
18
+ "data-component": "expandable-list-item-attributes",
19
+ children: [
20
+ /* @__PURE__ */ e("p", { className: "text-xs font-semibold leading-5 text-content-heading", children: i }),
21
+ /* @__PURE__ */ r("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [
22
+ c.map((l, m) => /* @__PURE__ */ e(
23
+ p,
24
+ {
25
+ variant: "subtle",
26
+ color: "neutral",
27
+ size: "sm",
28
+ shape: "circle",
29
+ className: "max-w-full",
30
+ children: l
31
+ },
32
+ `${m}-${l}`
33
+ )),
34
+ t.length > 0 ? /* @__PURE__ */ r(u, { children: [
35
+ /* @__PURE__ */ r(b, { children: [
36
+ /* @__PURE__ */ e(g, { asChild: !0, children: /* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ e(
37
+ x,
38
+ {
39
+ variant: "secondary",
40
+ size: "md",
41
+ shape: "rounded",
42
+ className: "h-6 cursor-pointer whitespace-nowrap border-0 bg-accent px-2 font-['Manrope'] text-xs font-medium text-accent-foreground hover:bg-accent/80",
43
+ tabIndex: 0,
44
+ role: "button",
45
+ "aria-label": `${t.length} more attributes for ${i}`,
46
+ children: d
47
+ }
48
+ ) }) }),
49
+ /* @__PURE__ */ r(v, { variant: "tertiary", side: "top", children: [
50
+ t.length,
51
+ " more"
52
+ ] })
53
+ ] }),
54
+ /* @__PURE__ */ e(
55
+ h,
56
+ {
57
+ remainingValues: t,
58
+ onItemRemove: () => {
59
+ },
60
+ isRemovable: !1,
61
+ isCopyable: !0
62
+ }
63
+ )
64
+ ] }) : null
65
+ ] })
66
+ ]
67
+ }
68
+ );
69
+ }
70
+ export {
71
+ I as ExpandableListItemAttributes
72
+ };
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ export interface ExpandableListItemContextValue {
3
+ showSelectionChrome: boolean;
4
+ disabled?: boolean;
5
+ expandAriaLabel: string;
6
+ collapseAriaLabel: string;
7
+ }
8
+ export declare function ExpandableListItemProvider({ value, children, }: {
9
+ value: ExpandableListItemContextValue;
10
+ children: React.ReactNode;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ export declare function useExpandableListItemContext(): ExpandableListItemContextValue;
13
+ export declare const EXPANDABLE_LIST_ITEM_ACCORDION_VALUE = "expandable-list-item-row-item";
@@ -0,0 +1,25 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import * as e from "react";
3
+ const n = e.createContext(
4
+ null
5
+ );
6
+ function a({
7
+ value: t,
8
+ children: o
9
+ }) {
10
+ return /* @__PURE__ */ r(n.Provider, { value: t, children: o });
11
+ }
12
+ function s() {
13
+ const t = e.useContext(n);
14
+ if (!t)
15
+ throw new Error(
16
+ "ExpandableListItem compound parts must be used within ExpandableListItemRoot."
17
+ );
18
+ return t;
19
+ }
20
+ const m = "expandable-list-item-row-item";
21
+ export {
22
+ m as EXPANDABLE_LIST_ITEM_ACCORDION_VALUE,
23
+ a as ExpandableListItemProvider,
24
+ s as useExpandableListItemContext
25
+ };
@@ -0,0 +1,6 @@
1
+ import { ExpandableListItemMetricsSection } from './expandable-list-item.types';
2
+ export interface ExpandableListItemMetricsProps {
3
+ columns: ExpandableListItemMetricsSection["columns"];
4
+ sectionId?: string;
5
+ }
6
+ export declare function ExpandableListItemMetrics({ columns, sectionId, }: ExpandableListItemMetricsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,41 @@
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
+ function o({
3
+ columns: l,
4
+ sectionId: i = "metrics"
5
+ }) {
6
+ return l.length === 0 ? null : /* @__PURE__ */ e(
7
+ "div",
8
+ {
9
+ className: "min-w-0 bg-transparent",
10
+ "data-component": "expandable-list-item-metrics",
11
+ children: /* @__PURE__ */ e("div", { className: "scrollbar-hide overflow-x-auto overscroll-x-contain [-webkit-overflow-scrolling:touch]", children: /* @__PURE__ */ e("div", { className: "flex min-w-0 flex-nowrap divide-x divide-stroke-hairline px-4 py-4 sm:px-5", children: l.map((t, n) => /* @__PURE__ */ a(
12
+ "div",
13
+ {
14
+ className: "flex min-w-[7.5rem] flex-1 basis-0 flex-col gap-1 overflow-hidden px-3 first:pl-0 last:pr-0 sm:min-w-[8rem] sm:px-4",
15
+ children: [
16
+ /* @__PURE__ */ e(
17
+ "p",
18
+ {
19
+ className: "truncate text-xs font-semibold leading-5 text-content-heading",
20
+ title: t.label,
21
+ children: t.label
22
+ }
23
+ ),
24
+ /* @__PURE__ */ e(
25
+ "p",
26
+ {
27
+ className: "truncate text-sm font-semibold leading-5 text-content",
28
+ title: String(t.value),
29
+ children: t.value
30
+ }
31
+ )
32
+ ]
33
+ },
34
+ `${i}-metric-${n}`
35
+ )) }) })
36
+ }
37
+ );
38
+ }
39
+ export {
40
+ o as ExpandableListItemMetrics
41
+ };
@@ -0,0 +1,31 @@
1
+ import { Checkbox } from '../../forms/checkbox';
2
+ import * as React from "react";
3
+ export interface ExpandableListItemRootProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "onChange"> {
4
+ selected?: boolean;
5
+ expanded?: boolean;
6
+ defaultExpanded?: boolean;
7
+ onExpandedChange?: (open: boolean) => void;
8
+ disabled?: boolean;
9
+ expandAriaLabel?: string;
10
+ collapseAriaLabel?: string;
11
+ children: React.ReactNode;
12
+ }
13
+ export declare const ExpandableListItemRoot: React.ForwardRefExoticComponent<ExpandableListItemRootProps & React.RefAttributes<HTMLDivElement>>;
14
+ export declare const ExpandableListItemRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
15
+ export interface ExpandableListItemCheckboxProps extends Omit<React.ComponentPropsWithoutRef<typeof Checkbox>, "onCheckedChange"> {
16
+ onCheckedChange?: (checked: boolean) => void;
17
+ }
18
+ export declare const ExpandableListItemCheckbox: React.ForwardRefExoticComponent<ExpandableListItemCheckboxProps & React.RefAttributes<HTMLButtonElement>>;
19
+ export declare const ExpandableListItemTrigger: React.ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-accordion').AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
20
+ badge?: React.ReactNode;
21
+ rightActions?: React.ReactNode;
22
+ headingLevel?: import('../../..').AccordionHeadingLevel;
23
+ variant?: "default" | "plain";
24
+ renderChevronTooltip?: import('../../..').InfoTooltipRender;
25
+ } & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
26
+ export declare const ExpandableListItemTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
27
+ export declare const ExpandableListItemDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
28
+ export declare const ExpandableListItemMedia: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
29
+ export declare const ExpandableListItemHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
30
+ export declare const ExpandableListItemContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
31
+ export declare const ExpandableListItemFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,233 @@
1
+ import { jsx as n, jsxs as v } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { ChevronRight as y } from "impact-nova-icons";
4
+ import { AccordionContent as R, Accordion as A, AccordionItem as k, AccordionTrigger as T } from "../../primitives/accordion/accordion.js";
5
+ import { Checkbox as P } from "../../forms/checkbox/checkbox.js";
6
+ import { createCompoundPart as I } from "../../../lib/primitives/create-compound.js";
7
+ import { cn as r } from "../../../lib/utils.js";
8
+ import { useExpandableListItemContext as x, ExpandableListItemProvider as E, EXPANDABLE_LIST_ITEM_ACCORDION_VALUE as c } from "./expandable-list-item-context.js";
9
+ function N(e, t) {
10
+ return r(
11
+ "rounded-xl transition-[background-color,border-color,box-shadow] duration-200",
12
+ e ? "border-stroke-accent/40 bg-canvas-accent shadow-sm" : "border-stroke bg-canvas-elevated",
13
+ t
14
+ );
15
+ }
16
+ function V(e) {
17
+ return i.isValidElement(e) && e.type.displayName === "ExpandableListItemContent";
18
+ }
19
+ const D = i.forwardRef(
20
+ ({
21
+ className: e,
22
+ selected: t,
23
+ expanded: a,
24
+ defaultExpanded: o = !1,
25
+ onExpandedChange: s,
26
+ disabled: l,
27
+ expandAriaLabel: m = "Expand details",
28
+ collapseAriaLabel: b = "Collapse details",
29
+ children: p,
30
+ ...f
31
+ }, h) => {
32
+ const d = !!t, L = i.Children.toArray(p).find(V) != null, u = i.useMemo(
33
+ () => ({
34
+ showSelectionChrome: d,
35
+ disabled: l,
36
+ expandAriaLabel: m,
37
+ collapseAriaLabel: b
38
+ }),
39
+ [d, l, m, b]
40
+ );
41
+ if (!L)
42
+ return /* @__PURE__ */ n(E, { value: u, children: /* @__PURE__ */ n(
43
+ "div",
44
+ {
45
+ ref: h,
46
+ "data-component": "expandable-list-item-row",
47
+ "data-expandable": "false",
48
+ "data-selected": t ? "" : void 0,
49
+ "data-selection-chrome": d ? "" : void 0,
50
+ className: N(d, e),
51
+ ...f,
52
+ children: p
53
+ }
54
+ ) });
55
+ const g = a !== void 0, C = g ? a ? c : "" : void 0;
56
+ return /* @__PURE__ */ n(E, { value: u, children: /* @__PURE__ */ n(
57
+ "div",
58
+ {
59
+ ref: h,
60
+ "data-component": "expandable-list-item",
61
+ "data-expandable": "true",
62
+ "data-expanded": a ?? void 0,
63
+ "data-selected": t ? "" : void 0,
64
+ "data-selection-chrome": d ? "" : void 0,
65
+ className: N(d, e),
66
+ ...f,
67
+ children: /* @__PURE__ */ n(
68
+ A,
69
+ {
70
+ type: "single",
71
+ collapsible: !0,
72
+ disabled: l,
73
+ ...g ? { value: C } : {
74
+ defaultValue: o ? c : void 0
75
+ },
76
+ onValueChange: (w) => s?.(w === c),
77
+ children: /* @__PURE__ */ n(
78
+ k,
79
+ {
80
+ value: c,
81
+ className: "overflow-visible rounded-none border-0 bg-transparent p-0 shadow-none",
82
+ children: p
83
+ }
84
+ )
85
+ }
86
+ )
87
+ }
88
+ ) });
89
+ }
90
+ );
91
+ D.displayName = "ExpandableListItemRoot";
92
+ const W = I("expandable-list-item", {
93
+ part: "row",
94
+ displayName: "ExpandableListItemRow",
95
+ className: "flex items-start gap-3 px-3 py-3"
96
+ }), M = i.forwardRef(({ className: e, onCheckedChange: t, ...a }, o) => /* @__PURE__ */ n(
97
+ "div",
98
+ {
99
+ className: r("pt-0.5", e),
100
+ "data-component": "expandable-list-item-checkbox",
101
+ onClick: (s) => s.stopPropagation(),
102
+ onKeyDown: (s) => s.stopPropagation(),
103
+ children: /* @__PURE__ */ n(
104
+ P,
105
+ {
106
+ ref: o,
107
+ onCheckedChange: (s) => t?.(s === !0),
108
+ ...a
109
+ }
110
+ )
111
+ }
112
+ ));
113
+ M.displayName = "ExpandableListItemCheckbox";
114
+ const S = i.forwardRef(({ className: e, children: t, ...a }, o) => {
115
+ const { disabled: s, expandAriaLabel: l, collapseAriaLabel: m } = x();
116
+ return /* @__PURE__ */ v(
117
+ T,
118
+ {
119
+ ref: o,
120
+ variant: "plain",
121
+ "data-component": "expandable-list-item-trigger",
122
+ className: r(
123
+ "min-w-0 items-center gap-2 text-left",
124
+ s && "pointer-events-none opacity-50",
125
+ e
126
+ ),
127
+ disabled: s,
128
+ ...a,
129
+ children: [
130
+ t,
131
+ /* @__PURE__ */ n(
132
+ "span",
133
+ {
134
+ className: "mt-0.5 inline-flex shrink-0 text-content-icon transition-transform duration-200 motion-reduce:transition-none group-data-[state=open]:rotate-180",
135
+ "aria-hidden": !0,
136
+ children: /* @__PURE__ */ n(y, { className: "size-4 rotate-90" })
137
+ }
138
+ ),
139
+ /* @__PURE__ */ v("span", { className: "sr-only", children: [
140
+ l,
141
+ " / ",
142
+ m
143
+ ] })
144
+ ]
145
+ }
146
+ );
147
+ });
148
+ S.displayName = "ExpandableListItemTrigger";
149
+ const _ = i.forwardRef(({ className: e, ...t }, a) => {
150
+ const { showSelectionChrome: o } = x();
151
+ return /* @__PURE__ */ n(
152
+ "span",
153
+ {
154
+ ref: a,
155
+ "data-component": "expandable-list-item-title",
156
+ className: r(
157
+ "text-sm font-semibold leading-6 text-content",
158
+ o && "tracking-tight",
159
+ e
160
+ ),
161
+ ...t
162
+ }
163
+ );
164
+ });
165
+ _.displayName = "ExpandableListItemTitle";
166
+ const j = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ n(
167
+ "div",
168
+ {
169
+ ref: a,
170
+ "data-component": "expandable-list-item-description",
171
+ className: r("mt-0.5 text-xs font-medium leading-4 text-secondary-foreground", e),
172
+ ...t
173
+ }
174
+ ));
175
+ j.displayName = "ExpandableListItemDescription";
176
+ const B = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ n(
177
+ "div",
178
+ {
179
+ ref: a,
180
+ "data-component": "expandable-list-item-media",
181
+ className: r("flex flex-wrap items-center gap-2", e),
182
+ ...t
183
+ }
184
+ ));
185
+ B.displayName = "ExpandableListItemMedia";
186
+ const F = i.forwardRef(({ className: e, ...t }, a) => {
187
+ const { disabled: o } = x();
188
+ return /* @__PURE__ */ n(
189
+ "div",
190
+ {
191
+ ref: a,
192
+ "data-component": "expandable-list-item-header",
193
+ className: r(
194
+ "min-w-0 flex-1",
195
+ o && "pointer-events-none opacity-50",
196
+ e
197
+ ),
198
+ ...t
199
+ }
200
+ );
201
+ });
202
+ F.displayName = "ExpandableListItemHeader";
203
+ const H = i.forwardRef(({ className: e, children: t, ...a }, o) => /* @__PURE__ */ n(R, { className: "border-0 bg-transparent p-0 pb-[0.01rem]", children: /* @__PURE__ */ n(
204
+ "div",
205
+ {
206
+ ref: o,
207
+ "data-component": "expandable-list-item-content",
208
+ className: r(
209
+ "mx-2 mb-2 overflow-hidden rounded-lg bg-canvas-subtle pt-2",
210
+ e
211
+ ),
212
+ ...a,
213
+ children: t
214
+ }
215
+ ) }));
216
+ H.displayName = "ExpandableListItemContent";
217
+ const Y = I("expandable-list-item", {
218
+ part: "footer",
219
+ displayName: "ExpandableListItemFooter",
220
+ className: "px-4 py-3 sm:px-5"
221
+ });
222
+ export {
223
+ M as ExpandableListItemCheckbox,
224
+ H as ExpandableListItemContent,
225
+ j as ExpandableListItemDescription,
226
+ Y as ExpandableListItemFooter,
227
+ F as ExpandableListItemHeader,
228
+ B as ExpandableListItemMedia,
229
+ D as ExpandableListItemRoot,
230
+ W as ExpandableListItemRow,
231
+ _ as ExpandableListItemTitle,
232
+ S as ExpandableListItemTrigger
233
+ };