impact-nova 2.1.0-alpha.3 → 2.1.0-alpha.5
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/data/ag-grid-react/ag-grid-tooltip-overflow.d.ts +3 -0
- package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.js +6 -0
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +15 -21
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +1 -1
- package/dist/components/data/ag-grid-react/cell-renderers/default-text-cell-renderer.d.ts +1 -2
- package/dist/components/data/ag-grid-react/cell-renderers/default-text-cell-renderer.js +12 -6
- package/dist/components/data/ag-grid-react/cell-renderers/editors/textarea-cell-editor.js +19 -19
- package/dist/components/data/ag-grid-react/cell-renderers/select-display-renderer.js +1 -1
- package/dist/components/data/ag-grid-react/cell-renderers/switch-display-renderer.js +15 -15
- package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +1 -1
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.js +33 -33
- package/dist/components/data/ag-grid-react/headers/components/header-info.js +66 -62
- package/dist/components/data/ag-grid-react/headers/components/info-modal.js +6 -6
- package/dist/components/data/ag-grid-react/headers/components/section-renderers.js +18 -18
- package/dist/components/data/ag-grid-react/headers/custom-header-group.js +40 -29
- package/dist/components/data/ag-grid-react/headers/custom-header.js +102 -98
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +156 -148
- package/dist/components/data/ag-grid-react/theme.js +3 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.d.ts +5 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.js +13 -0
- package/dist/components/data/ag-grid-react/useGridAutoSizeStrategyOnResize.js +8 -5
- package/dist/components/data/data-table/data-table-column-apply.d.ts +16 -0
- package/dist/components/data/data-table/data-table-column-apply.js +18 -0
- package/dist/components/data/data-table/data-table-column-list.d.ts +13 -3
- package/dist/components/data/data-table/data-table-column-list.js +198 -191
- package/dist/components/data/data-table/data-table-constants.d.ts +3 -4
- package/dist/components/data/data-table/data-table-context.d.ts +3 -6
- package/dist/components/data/data-table/data-table-context.js +21 -10
- package/dist/components/data/data-table/data-table-saved-views.js +26 -26
- package/dist/components/data/data-table/data-table-sheet-portal-store.d.ts +13 -0
- package/dist/components/data/data-table/data-table-sheet-portal-store.js +36 -0
- package/dist/components/data/data-table/data-table-sheet.d.ts +3 -6
- package/dist/components/data/data-table/data-table-sheet.js +1 -1
- package/dist/components/data/data-table/data-table-view-menu.js +40 -40
- package/dist/components/data/data-table/data-table.d.ts +8 -10
- package/dist/components/data/data-table/data-table.js +131 -113
- package/dist/components/data/data-table/data-table.types.d.ts +35 -0
- package/dist/components/data/data-table/index.js +28 -27
- package/dist/components/data/data-table/indicator-legend.js +6 -6
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.d.ts +8 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +72 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-context.d.ts +13 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-context.js +25 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.d.ts +6 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +41 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.d.ts +31 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.js +233 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-preset.d.ts +18 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-preset.js +133 -0
- package/dist/components/data/expandable-list-item/expandable-list-item.d.ts +5 -0
- package/dist/components/data/{expandable-sku/expandable-sku.types.d.ts → expandable-list-item/expandable-list-item.types.d.ts} +7 -7
- package/dist/components/data/expandable-list-item/index.d.ts +5 -0
- package/dist/components/data/expandable-list-item/index.js +19 -0
- package/dist/components/data/nested-list/components/NestedListHeader.js +11 -11
- package/dist/components/data/nested-list/components/SortableItem.js +2 -2
- package/dist/components/data-display/avatar/avatar.types.d.ts +2 -0
- package/dist/components/data-display/badge/badge.types.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +11 -11
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +7 -7
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +31 -31
- package/dist/components/data-display/card/card.js +8 -8
- package/dist/components/data-display/chart/chart.types.d.ts +9 -0
- package/dist/components/data-display/skeleton/skeleton.js +6 -6
- package/dist/components/data-display/statistics-card/statistics-card.js +14 -14
- package/dist/components/feedback/alert-dialog/alert-dialog.js +19 -19
- package/dist/components/feedback/dialog/dialog.js +1 -1
- package/dist/components/feedback/drawer/drawer.js +18 -18
- package/dist/components/feedback/dropdown-menu/dropdown-menu.js +68 -55
- package/dist/components/feedback/popover/popover.js +8 -1
- package/dist/components/feedback/sheet/sheet.js +1 -1
- package/dist/components/feedback/tooltip/tooltip.js +22 -22
- package/dist/components/feedback/tooltip/tooltip.variants.js +1 -1
- package/dist/components/flows/command-palette/command-palette.js +104 -104
- package/dist/components/flows/command-palette/shortcut-settings.js +34 -34
- package/dist/components/flows/filter-strip/filter-tag-list.js +4 -4
- package/dist/components/flows/notification-panel/notification-list.js +17 -17
- package/dist/components/flows/notification-panel/notification-panel.js +4 -4
- package/dist/components/flows/notification-panel/notification-panel.types.d.ts +3 -0
- package/dist/components/flows/wizard/wizard.js +8 -8
- package/dist/components/forms/combobox/combobox.js +20 -20
- package/dist/components/forms/date-picker/date-picker.js +17 -17
- package/dist/components/forms/date-picker/date-range-picker.js +3 -3
- package/dist/components/forms/date-picker/month-picker.js +1 -1
- package/dist/components/forms/date-picker/month-range-picker.js +42 -42
- package/dist/components/forms/date-picker/week-picker.js +15 -15
- package/dist/components/forms/date-picker/week-range-picker.js +3 -3
- package/dist/components/forms/file-upload/file-upload.js +33 -33
- package/dist/components/forms/input/input.js +8 -8
- package/dist/components/forms/input/input.variants.js +3 -3
- package/dist/components/forms/select/components/SelectMenuPanel.d.ts +1 -2
- package/dist/components/forms/select/components/SelectMenuPanel.js +17 -19
- package/dist/components/forms/select/components/SelectTrigger.d.ts +9 -6
- package/dist/components/forms/select/components/SelectTrigger.js +119 -116
- package/dist/components/forms/select/components/Submenu.js +7 -7
- package/dist/components/forms/select/hooks/useSelectKeyboardHandlers.d.ts +1 -1
- package/dist/components/forms/select/select.js +88 -88
- package/dist/components/forms/select/select.variants.js +5 -5
- package/dist/components/layout/sidebar/sidebar.d.ts +7 -50
- package/dist/components/layout/sidebar/sidebar.js +12 -11
- package/dist/components/layout/sidebar/sidebar.types.d.ts +35 -1
- package/dist/components/primitives/button-group/button-group.js +32 -32
- package/dist/components/primitives/chips/chips.variants.js +5 -5
- package/dist/components/primitives/empty-container/empty-container.types.d.ts +3 -0
- package/dist/components/primitives/kbd/kbd.variants.js +3 -3
- package/dist/components/primitives/stepper/stepper.js +6 -6
- package/dist/components/primitives/tag/tag.variants.js +2 -2
- package/dist/impact-nova-components.css +97 -0
- package/dist/impact-nova-tokens.scss +2 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +446 -413
- package/dist/lib/compose-refs.d.ts +8 -0
- package/dist/lib/compose-refs.js +14 -0
- package/dist/lib/primitives/field.types.d.ts +8 -2
- package/dist/lib/virtualized/index.d.ts +3 -0
- package/dist/lib/virtualized/index.js +33 -16
- package/dist/lib/virtualized/useVirtualizedList.d.ts +2 -0
- package/dist/lib/virtualized/useVirtualizedList.js +115 -109
- package/dist/lib/virtualized/virtualized-list-context.d.ts +12 -0
- package/dist/lib/virtualized/virtualized-list-context.js +21 -0
- package/dist/lib/virtualized/virtualized-list-parts.d.ts +51 -0
- package/dist/lib/virtualized/virtualized-list-parts.js +175 -0
- package/dist/lib/virtualized/virtualized-list-utils.d.ts +5 -0
- package/dist/lib/virtualized/virtualized-list-utils.js +6 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/migration.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +24 -15
- package/tailwind.config.js +1 -0
- package/dist/components/data/ag-grid-react/headers/components/truncated-text.d.ts +0 -15
- package/dist/components/data/ag-grid-react/headers/components/truncated-text.js +0 -27
- package/dist/components/data/expandable-sku/expandable-sku.d.ts +0 -38
- package/dist/components/data/expandable-sku/expandable-sku.js +0 -245
- package/dist/components/data/expandable-sku/index.d.ts +0 -2
- package/dist/components/data/expandable-sku/index.js +0 -4
|
@@ -1,170 +1,188 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { AgGridWrapper as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { DataTableContext as
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { jsx as n, jsxs as P } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useRef as _, useCallback as x, useMemo as y, useEffect as v, memo as S } from "react";
|
|
3
|
+
import { AgGridWrapper as G } from "../ag-grid-react/index.js";
|
|
4
|
+
import { cn as H } from "../../../lib/utils.js";
|
|
5
|
+
import { DataTableContext as C, DataTableSheetPortalStoreContext as R, useDataTable as E, useDataTableSheetPortal as w } from "./data-table-context.js";
|
|
6
|
+
import { createDataTableSheetPortalStore as O } from "./data-table-sheet-portal-store.js";
|
|
7
|
+
import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as F } from "./data-table-constants.js";
|
|
8
|
+
const A = {
|
|
8
9
|
default: 46,
|
|
9
10
|
compact: 30,
|
|
10
11
|
comfort: 52
|
|
11
|
-
},
|
|
12
|
-
children:
|
|
12
|
+
}, V = ({
|
|
13
|
+
children: a,
|
|
13
14
|
className: t
|
|
14
15
|
}) => {
|
|
15
|
-
const [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, []), S = H((b) => {
|
|
21
|
-
e(b);
|
|
22
|
-
}, []), s = {
|
|
16
|
+
const [r, e] = f(null), [o, c] = f("medium"), [s, p] = f("full"), [l, h] = f("default"), d = _(O()), m = x((i) => {
|
|
17
|
+
d.current.registerScopedSheetDepth(i);
|
|
18
|
+
}, []), u = x((i) => {
|
|
19
|
+
e(i);
|
|
20
|
+
}, []), g = {
|
|
23
21
|
small: "12px",
|
|
24
22
|
medium: "14px",
|
|
25
23
|
large: "16px"
|
|
26
|
-
}[
|
|
24
|
+
}[o], b = `${A[l]}px`, T = y(
|
|
27
25
|
() => ({
|
|
28
|
-
gridApi:
|
|
29
|
-
registerApi:
|
|
30
|
-
registerScopedSheetDepth:
|
|
31
|
-
fontSize:
|
|
26
|
+
gridApi: r,
|
|
27
|
+
registerApi: u,
|
|
28
|
+
registerScopedSheetDepth: m,
|
|
29
|
+
fontSize: o,
|
|
32
30
|
setFontSize: c,
|
|
33
|
-
numericFormat:
|
|
34
|
-
setNumericFormat:
|
|
35
|
-
rowHeight:
|
|
36
|
-
setRowHeight:
|
|
31
|
+
numericFormat: s,
|
|
32
|
+
setNumericFormat: p,
|
|
33
|
+
rowHeight: l,
|
|
34
|
+
setRowHeight: h
|
|
37
35
|
}),
|
|
38
36
|
[
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
x,
|
|
42
|
-
l,
|
|
43
|
-
c,
|
|
44
|
-
h,
|
|
45
|
-
d,
|
|
37
|
+
r,
|
|
38
|
+
u,
|
|
46
39
|
m,
|
|
47
|
-
|
|
40
|
+
o,
|
|
41
|
+
s,
|
|
42
|
+
l
|
|
48
43
|
]
|
|
49
|
-
), G = v(
|
|
50
|
-
() => ({
|
|
51
|
-
sheetTarget: r,
|
|
52
|
-
setSheetTarget: p,
|
|
53
|
-
scopedSheetOpen: g
|
|
54
|
-
}),
|
|
55
|
-
[r, p, g]
|
|
56
44
|
);
|
|
57
|
-
return /* @__PURE__ */ n(
|
|
58
|
-
|
|
45
|
+
return /* @__PURE__ */ n(C.Provider, { value: T, children: /* @__PURE__ */ n(
|
|
46
|
+
R.Provider,
|
|
59
47
|
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
48
|
+
value: d.current,
|
|
49
|
+
children: /* @__PURE__ */ n(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
"data-component": "data-table",
|
|
53
|
+
className: H(
|
|
54
|
+
"flex flex-col w-full min-h-0 rounded-[inherit]",
|
|
55
|
+
t
|
|
56
|
+
),
|
|
57
|
+
style: {
|
|
58
|
+
"--ag-font-size": g,
|
|
59
|
+
"--ag-row-height": b
|
|
60
|
+
},
|
|
61
|
+
children: a
|
|
62
|
+
}
|
|
63
|
+
)
|
|
70
64
|
}
|
|
71
|
-
) })
|
|
72
|
-
},
|
|
65
|
+
) });
|
|
66
|
+
}, D = {
|
|
73
67
|
full: "full_no",
|
|
74
68
|
k: "thou",
|
|
75
69
|
m: "mil",
|
|
76
70
|
b: "bil",
|
|
77
71
|
full_precision: "full_precision"
|
|
78
|
-
},
|
|
79
|
-
const { setSheetTarget: t
|
|
72
|
+
}, N = S(function() {
|
|
73
|
+
const { setSheetTarget: t } = w();
|
|
80
74
|
return /* @__PURE__ */ n(
|
|
81
75
|
"div",
|
|
82
76
|
{
|
|
83
77
|
ref: t,
|
|
84
|
-
className: "absolute inset-0 pointer-events-none z-[39] flex overflow-x-hidden overflow-y-visible"
|
|
85
|
-
|
|
78
|
+
className: "absolute inset-0 pointer-events-none z-[39] flex overflow-x-hidden overflow-y-visible"
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}), z = S(function({
|
|
82
|
+
className: t,
|
|
83
|
+
children: r
|
|
84
|
+
}) {
|
|
85
|
+
const { scopedSheetOpen: e } = w();
|
|
86
|
+
return /* @__PURE__ */ P(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: H(
|
|
90
|
+
"relative flex-1 min-h-0 w-full bg-canvas-elevated rounded-b-[inherit] grid-rounded-bottom",
|
|
91
|
+
t
|
|
92
|
+
),
|
|
93
|
+
style: e ? { minHeight: F } : void 0,
|
|
94
|
+
children: [
|
|
95
|
+
r,
|
|
96
|
+
/* @__PURE__ */ n(N, {})
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}), B = S(function({
|
|
101
|
+
resolvedRowHeight: t,
|
|
102
|
+
mergedContext: r,
|
|
103
|
+
onGridReady: e,
|
|
104
|
+
columnDefs: o,
|
|
105
|
+
maintainColumnOrder: c = !0,
|
|
106
|
+
...s
|
|
107
|
+
}) {
|
|
108
|
+
return /* @__PURE__ */ n(
|
|
109
|
+
G,
|
|
110
|
+
{
|
|
111
|
+
...s,
|
|
112
|
+
columnDefs: o,
|
|
113
|
+
rowHeight: t,
|
|
114
|
+
onGridReady: e,
|
|
115
|
+
context: r,
|
|
116
|
+
maintainColumnOrder: c
|
|
86
117
|
}
|
|
87
118
|
);
|
|
88
119
|
});
|
|
89
|
-
function
|
|
120
|
+
function Y(a) {
|
|
90
121
|
const {
|
|
91
122
|
registerApi: t,
|
|
92
|
-
rowHeight:
|
|
123
|
+
rowHeight: r,
|
|
93
124
|
gridApi: e,
|
|
94
|
-
numericFormat:
|
|
95
|
-
} =
|
|
96
|
-
className:
|
|
97
|
-
onGridReady:
|
|
98
|
-
rowHeight:
|
|
99
|
-
context:
|
|
100
|
-
columnDefs:
|
|
101
|
-
maintainColumnOrder:
|
|
102
|
-
...
|
|
103
|
-
} =
|
|
125
|
+
numericFormat: o
|
|
126
|
+
} = E(), {
|
|
127
|
+
className: c,
|
|
128
|
+
onGridReady: s,
|
|
129
|
+
rowHeight: p,
|
|
130
|
+
context: l,
|
|
131
|
+
columnDefs: h,
|
|
132
|
+
maintainColumnOrder: d = !0,
|
|
133
|
+
...m
|
|
134
|
+
} = a, u = A[r], g = p ?? u, b = y(
|
|
104
135
|
() => ({
|
|
105
|
-
...
|
|
106
|
-
formatType:
|
|
136
|
+
...l,
|
|
137
|
+
formatType: D[o]
|
|
107
138
|
}),
|
|
108
|
-
[
|
|
139
|
+
[l, o]
|
|
109
140
|
);
|
|
110
|
-
|
|
141
|
+
v(() => {
|
|
111
142
|
e?.resetRowHeights();
|
|
112
|
-
}, [
|
|
143
|
+
}, [r, e]), v(() => {
|
|
113
144
|
if (e) {
|
|
114
|
-
const
|
|
145
|
+
const i = e.getGridOption("context") || {};
|
|
115
146
|
e.setGridOption("context", {
|
|
116
|
-
...
|
|
117
|
-
formatType:
|
|
147
|
+
...i,
|
|
148
|
+
formatType: D[o]
|
|
118
149
|
}), e.refreshCells({ force: !0 });
|
|
119
150
|
}
|
|
120
|
-
}, [
|
|
121
|
-
const
|
|
122
|
-
(
|
|
123
|
-
t(
|
|
151
|
+
}, [o, e]);
|
|
152
|
+
const T = x(
|
|
153
|
+
(i) => {
|
|
154
|
+
t(i.api), s?.(i);
|
|
124
155
|
},
|
|
125
|
-
[t,
|
|
156
|
+
[t, s]
|
|
126
157
|
);
|
|
127
|
-
return /* @__PURE__ */
|
|
128
|
-
|
|
158
|
+
return /* @__PURE__ */ n(z, { className: c, children: /* @__PURE__ */ n(
|
|
159
|
+
B,
|
|
129
160
|
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
/* @__PURE__ */ n(
|
|
137
|
-
z,
|
|
138
|
-
{
|
|
139
|
-
...g,
|
|
140
|
-
columnDefs: m,
|
|
141
|
-
rowHeight: u,
|
|
142
|
-
onGridReady: S,
|
|
143
|
-
context: x,
|
|
144
|
-
maintainColumnOrder: f
|
|
145
|
-
}
|
|
146
|
-
),
|
|
147
|
-
/* @__PURE__ */ n(k, {})
|
|
148
|
-
]
|
|
161
|
+
...m,
|
|
162
|
+
columnDefs: h,
|
|
163
|
+
maintainColumnOrder: d,
|
|
164
|
+
resolvedRowHeight: g,
|
|
165
|
+
mergedContext: b,
|
|
166
|
+
onGridReady: T
|
|
149
167
|
}
|
|
150
|
-
);
|
|
168
|
+
) });
|
|
151
169
|
}
|
|
152
|
-
const
|
|
153
|
-
children:
|
|
170
|
+
const $ = ({
|
|
171
|
+
children: a,
|
|
154
172
|
className: t
|
|
155
173
|
}) => /* @__PURE__ */ n(
|
|
156
174
|
"div",
|
|
157
175
|
{
|
|
158
176
|
"data-component": "data-table-toolbar",
|
|
159
|
-
className:
|
|
177
|
+
className: H(
|
|
160
178
|
"flex items-center justify-between px-4 py-3 shrink-0 bg-canvas-elevated rounded-t-[inherit]",
|
|
161
179
|
t
|
|
162
180
|
),
|
|
163
|
-
children:
|
|
181
|
+
children: a
|
|
164
182
|
}
|
|
165
183
|
);
|
|
166
184
|
export {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
185
|
+
V as DataTable,
|
|
186
|
+
Y as DataTableContent,
|
|
187
|
+
$ as DataTableToolbar
|
|
170
188
|
};
|
|
@@ -1,9 +1,44 @@
|
|
|
1
1
|
import { AgGridWrapperProps } from '../ag-grid-react/ag-grid.types';
|
|
2
2
|
import type * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Root layout provider for data tables. Compose toolbar, sheet, and `DataTableContent` as children.
|
|
5
|
+
*/
|
|
3
6
|
export type DataTableProps = {
|
|
4
7
|
children: React.ReactNode;
|
|
5
8
|
className?: string;
|
|
6
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* AG Grid surface — forwards native `AgGridReact` props (rowData, columnDefs, rowModelType, treeData, …)
|
|
12
|
+
* with Impact Nova styling. See https://www.ag-grid.com/react-data-grid/grid-options/
|
|
13
|
+
*/
|
|
7
14
|
export type DataTableContentProps<TData = unknown> = AgGridWrapperProps<TData> & {
|
|
8
15
|
className?: string;
|
|
9
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Top bar above the grid. Optional — omit to remove the toolbar from the DOM.
|
|
19
|
+
*
|
|
20
|
+
* Layout is `justify-between`: place a title or context on the left, actions on the right
|
|
21
|
+
* (filter toggle, `DataTableSheet` / view menu, export, density, saved views).
|
|
22
|
+
*/
|
|
23
|
+
export type DataTableToolbarProps = {
|
|
24
|
+
/** Toolbar slots — typically title (left) and action buttons / `DataTableSheet` (right). */
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
/** Extra classes on the toolbar root (`data-component="data-table-toolbar"`). */
|
|
27
|
+
className?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Scoped settings panel state. Renders inside the `DataTable` container (not a viewport modal).
|
|
31
|
+
*
|
|
32
|
+
* Compose `DataTableSheetContent` for the slide-in panel, triggers from the toolbar or view menu,
|
|
33
|
+
* and optional `DataTableColumnList` / `DataTableSavedViews` inside the sheet body.
|
|
34
|
+
*/
|
|
35
|
+
export type DataTableSheetProps = {
|
|
36
|
+
/** Sheet subtree — typically `DataTableSheetContent`, triggers, and settings panels. */
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
/** Initial open state when `open` is not provided (uncontrolled). */
|
|
39
|
+
defaultOpen?: boolean;
|
|
40
|
+
/** Controlled open state. Pair with `onOpenChange`. */
|
|
41
|
+
open?: boolean;
|
|
42
|
+
/** Called when the user opens or closes the sheet. */
|
|
43
|
+
onOpenChange?: (open: boolean) => void;
|
|
44
|
+
};
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import { DataTable as t, DataTableContent as o, DataTableToolbar as r } from "./data-table.js";
|
|
2
2
|
import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as l, TABLE_VIEWPORT_SHELL_EXPANDED_CLASS as D } from "./data-table-constants.js";
|
|
3
|
-
import { DataTableColumnList as
|
|
4
|
-
import { DataTableContext as
|
|
5
|
-
import { DataTableFormatOptions as
|
|
6
|
-
import { DataTableSheet as
|
|
3
|
+
import { DataTableColumnList as n } from "./data-table-column-list.js";
|
|
4
|
+
import { DataTableContext as i, DataTableSheetPortalStoreContext as m, useDataTable as p, useDataTableSheetPortal as x, useDataTableSheetPortalStore as f } from "./data-table-context.js";
|
|
5
|
+
import { DataTableFormatOptions as E } from "./data-table-format-options.js";
|
|
6
|
+
import { DataTableSheet as h, DataTableSheetContent as s, DataTableSheetHeader as C, DataTableSheetTrigger as w } from "./data-table-sheet.js";
|
|
7
7
|
import { useDataTableSheet as V, useDataTableSheetApi as A } from "./data-table-sheet-context.js";
|
|
8
|
-
import { DataTableViewMenuContent as
|
|
9
|
-
import { DataTableSavedViews as
|
|
10
|
-
import { PinSwitch as
|
|
11
|
-
import { ColumnIndicator as
|
|
12
|
-
import { IndicatorLegend as
|
|
8
|
+
import { DataTableViewMenuContent as d, DataTableViewMenuDensity as g, DataTableViewMenuSettingsItem as H, DataTableViewMenuTrigger as I, DataTableViewMenuViewportExpand as M } from "./data-table-view-menu.js";
|
|
9
|
+
import { DataTableSavedViews as c } from "./data-table-saved-views.js";
|
|
10
|
+
import { PinSwitch as N } from "./pin-switch.js";
|
|
11
|
+
import { ColumnIndicator as v } from "./column-indicator.js";
|
|
12
|
+
import { IndicatorLegend as F } from "./indicator-legend.js";
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
v as ColumnIndicator,
|
|
15
15
|
l as DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX,
|
|
16
16
|
t as DataTable,
|
|
17
|
-
|
|
17
|
+
n as DataTableColumnList,
|
|
18
18
|
o as DataTableContent,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
m as
|
|
26
|
-
|
|
19
|
+
i as DataTableContext,
|
|
20
|
+
E as DataTableFormatOptions,
|
|
21
|
+
c as DataTableSavedViews,
|
|
22
|
+
h as DataTableSheet,
|
|
23
|
+
s as DataTableSheetContent,
|
|
24
|
+
C as DataTableSheetHeader,
|
|
25
|
+
m as DataTableSheetPortalStoreContext,
|
|
26
|
+
w as DataTableSheetTrigger,
|
|
27
27
|
r as DataTableToolbar,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
d as DataTableViewMenuContent,
|
|
29
|
+
g as DataTableViewMenuDensity,
|
|
30
|
+
H as DataTableViewMenuSettingsItem,
|
|
31
|
+
I as DataTableViewMenuTrigger,
|
|
32
|
+
M as DataTableViewMenuViewportExpand,
|
|
33
|
+
F as IndicatorLegend,
|
|
34
|
+
N as PinSwitch,
|
|
35
35
|
D as TABLE_VIEWPORT_SHELL_EXPANDED_CLASS,
|
|
36
36
|
p as useDataTable,
|
|
37
37
|
V as useDataTableSheet,
|
|
38
38
|
A as useDataTableSheetApi,
|
|
39
|
-
x as useDataTableSheetPortal
|
|
39
|
+
x as useDataTableSheetPortal,
|
|
40
|
+
f as useDataTableSheetPortalStore
|
|
40
41
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useImpactNovaI18n as
|
|
3
|
-
import { ColumnIndicator as
|
|
2
|
+
import { useImpactNovaI18n as n } from "../../../i18n/use-impact-nova-i18n.js";
|
|
3
|
+
import { ColumnIndicator as r } from "./column-indicator.js";
|
|
4
4
|
const i = () => {
|
|
5
|
-
const { t: a } =
|
|
6
|
-
return /* @__PURE__ */ t("div", { className: "flex items-center gap-3 text-[10px] text-
|
|
5
|
+
const { t: a } = n();
|
|
6
|
+
return /* @__PURE__ */ t("div", { className: "flex items-center gap-3 text-[10px] text-secondary-foreground", "data-component": "indicator-legend", children: [
|
|
7
7
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
|
|
8
|
-
/* @__PURE__ */ e(
|
|
8
|
+
/* @__PURE__ */ e(r, { type: "sort" }),
|
|
9
9
|
/* @__PURE__ */ e("span", { children: a("dataTable.indicatorSort") })
|
|
10
10
|
] }),
|
|
11
11
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
|
|
12
|
-
/* @__PURE__ */ e(
|
|
12
|
+
/* @__PURE__ */ e(r, { type: "filter" }),
|
|
13
13
|
/* @__PURE__ */ e("span", { children: a("dataTable.indicatorSearch") })
|
|
14
14
|
] })
|
|
15
15
|
] });
|
|
@@ -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>>;
|