impact-nova 1.7.1 → 1.7.3
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/ui/accordion.d.ts +5 -0
- package/dist/components/ui/accordion.js +51 -39
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +207 -209
- package/dist/components/ui/ag-grid-react/index.js +86 -84
- package/dist/components/ui/ag-grid-react/theme.js +4 -0
- package/dist/components/ui/data-table/data-table-column-list.js +84 -78
- package/dist/components/ui/expandable-sku/expandable-sku.d.ts +38 -0
- package/dist/components/ui/expandable-sku/expandable-sku.js +244 -0
- package/dist/components/ui/expandable-sku/expandable-sku.types.d.ts +35 -0
- package/dist/components/ui/expandable-sku/index.d.ts +2 -0
- package/dist/components/ui/expandable-sku/index.js +4 -0
- package/dist/components/ui/filter-strip/filter-tag-list.d.ts +8 -1
- package/dist/components/ui/filter-strip/filter-tag-list.js +1 -0
- package/dist/components/ui/select/select.js +221 -210
- package/dist/icons/assets/eye.svg.js +5 -0
- package/dist/icons/assets/eyeOff.svg.js +5 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +203 -199
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +57 -0
- package/dist/index.js +318 -300
- package/dist/lib/virtualized/index.d.ts +9 -0
- package/dist/lib/virtualized/sectioned.d.ts +37 -0
- package/dist/lib/virtualized/sectioned.js +38 -0
- package/dist/lib/virtualized/selection-counts.d.ts +14 -0
- package/dist/lib/virtualized/selection-counts.js +12 -0
- package/dist/lib/virtualized/types.d.ts +131 -0
- package/dist/lib/virtualized/useDataGrid.d.ts +15 -0
- package/dist/lib/virtualized/useDataGrid.js +12 -0
- package/dist/lib/virtualized/useDataSource.d.ts +8 -0
- package/dist/lib/virtualized/useDataSource.js +34 -0
- package/dist/lib/virtualized/useDebouncedValue.d.ts +4 -0
- package/dist/lib/virtualized/useDebouncedValue.js +11 -0
- package/dist/lib/virtualized/useRowState.d.ts +15 -0
- package/dist/lib/virtualized/useRowState.js +127 -0
- package/dist/lib/virtualized/useVirtualizedList.d.ts +72 -0
- package/dist/lib/virtualized/useVirtualizedList.js +155 -0
- package/dist/lib/virtualized/useVirtualizedRows.d.ts +22 -0
- package/dist/lib/virtualized/useVirtualizedRows.js +27 -0
- package/package.json +23 -1
- package/tailwind.config.js +2 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { useRef as c, useCallback as d, useEffect as ne } from "react";
|
|
2
|
+
import { useDataSource as se } from "./useDataSource.js";
|
|
3
|
+
import { useRowState as ae } from "./useRowState.js";
|
|
4
|
+
import { useVirtualizedRows as ie } from "./useVirtualizedRows.js";
|
|
5
|
+
function fe(M) {
|
|
6
|
+
const {
|
|
7
|
+
rowCount: u,
|
|
8
|
+
getRowData: T,
|
|
9
|
+
isRowLoaded: _,
|
|
10
|
+
prefetchRange: $,
|
|
11
|
+
getRowError: D,
|
|
12
|
+
selectionMode: A,
|
|
13
|
+
selectedIds: H,
|
|
14
|
+
onSelectedIdsChange: L,
|
|
15
|
+
defaultSelectedIds: B,
|
|
16
|
+
selectAll: K,
|
|
17
|
+
toggledIds: P,
|
|
18
|
+
onSelectionStateChange: X,
|
|
19
|
+
defaultSelectAll: Y,
|
|
20
|
+
defaultToggledIds: j,
|
|
21
|
+
expandedIds: q,
|
|
22
|
+
onExpandedIdsChange: F,
|
|
23
|
+
defaultExpandedIds: G,
|
|
24
|
+
scrollElementRef: J,
|
|
25
|
+
getRowId: R,
|
|
26
|
+
estimateSize: N,
|
|
27
|
+
overscan: Q,
|
|
28
|
+
getItemKey: U,
|
|
29
|
+
endReachedThreshold: m = 3,
|
|
30
|
+
onEndReached: w,
|
|
31
|
+
hasMore: S = !0,
|
|
32
|
+
onChange: x,
|
|
33
|
+
...W
|
|
34
|
+
} = M, r = se({
|
|
35
|
+
rowCount: u,
|
|
36
|
+
getRowData: T,
|
|
37
|
+
isRowLoaded: _,
|
|
38
|
+
prefetchRange: $,
|
|
39
|
+
getRowError: D
|
|
40
|
+
}), E = ae({
|
|
41
|
+
selectionMode: A,
|
|
42
|
+
selectedIds: H,
|
|
43
|
+
onSelectedIdsChange: L,
|
|
44
|
+
defaultSelectedIds: B,
|
|
45
|
+
selectAll: K,
|
|
46
|
+
toggledIds: P,
|
|
47
|
+
onSelectionStateChange: X,
|
|
48
|
+
defaultSelectAll: Y,
|
|
49
|
+
defaultToggledIds: j,
|
|
50
|
+
expandedIds: q,
|
|
51
|
+
onExpandedIdsChange: F,
|
|
52
|
+
defaultExpandedIds: G
|
|
53
|
+
}), z = c(u), C = c(S), b = c(m), g = c(w);
|
|
54
|
+
z.current = u, C.current = S, b.current = m, g.current = w;
|
|
55
|
+
const Z = d(
|
|
56
|
+
(e, o) => {
|
|
57
|
+
if (x?.(e, o), !g.current || !C.current) return;
|
|
58
|
+
const t = e.getVirtualItems(), n = t[t.length - 1];
|
|
59
|
+
n && n.index >= z.current - b.current - 1 && g.current();
|
|
60
|
+
},
|
|
61
|
+
[x]
|
|
62
|
+
), { virtualizer: i, virtualItems: s, totalSize: y, measureElement: f } = ie({
|
|
63
|
+
scrollElementRef: J,
|
|
64
|
+
rowCount: r.rowCount,
|
|
65
|
+
estimateSize: N,
|
|
66
|
+
overscan: Q,
|
|
67
|
+
getItemKey: U,
|
|
68
|
+
onChange: Z,
|
|
69
|
+
...W
|
|
70
|
+
}), h = s[0]?.index, p = s[s.length - 1]?.index;
|
|
71
|
+
ne(() => {
|
|
72
|
+
r.prefetchRange && (h === void 0 || p === void 0 || r.prefetchRange(h, p));
|
|
73
|
+
}, [r.prefetchRange, h, p]);
|
|
74
|
+
const { isSelected: I, isExpanded: v, toggleSelect: V, toggleExpand: k } = E, O = d(
|
|
75
|
+
(e) => {
|
|
76
|
+
const o = R(e), t = r.getRowStatus(e), n = r.getRowData(e), l = r.getRowError(e);
|
|
77
|
+
return {
|
|
78
|
+
index: e,
|
|
79
|
+
id: o,
|
|
80
|
+
data: n,
|
|
81
|
+
item: n,
|
|
82
|
+
status: t,
|
|
83
|
+
error: t === "error" ? l : void 0,
|
|
84
|
+
isSelected: I(o),
|
|
85
|
+
isExpanded: v(o),
|
|
86
|
+
toggleSelect: () => V(o),
|
|
87
|
+
toggleExpand: () => k(o)
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
[R, r, I, v, V, k]
|
|
91
|
+
), ee = d(
|
|
92
|
+
(e, o) => {
|
|
93
|
+
const t = typeof e == "number" ? s.find((a) => a.index === e) : e, n = !!i.options.horizontal, l = o?.measure !== !1;
|
|
94
|
+
if (!t) {
|
|
95
|
+
const a = typeof e == "number" ? e : -1;
|
|
96
|
+
return {
|
|
97
|
+
key: a >= 0 ? a : "__missing__",
|
|
98
|
+
role: "row",
|
|
99
|
+
"data-index": a >= 0 ? a : 0,
|
|
100
|
+
ref: void 0,
|
|
101
|
+
style: {}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const oe = {
|
|
105
|
+
position: "absolute",
|
|
106
|
+
top: 0,
|
|
107
|
+
left: 0,
|
|
108
|
+
width: "100%",
|
|
109
|
+
transform: `translateY(${t.start}px)`
|
|
110
|
+
}, re = {
|
|
111
|
+
position: "absolute",
|
|
112
|
+
top: 0,
|
|
113
|
+
left: 0,
|
|
114
|
+
height: "100%",
|
|
115
|
+
transform: `translateX(${t.start}px)`
|
|
116
|
+
};
|
|
117
|
+
return {
|
|
118
|
+
key: t.key,
|
|
119
|
+
role: "row",
|
|
120
|
+
"data-index": t.index,
|
|
121
|
+
ref: l ? f : void 0,
|
|
122
|
+
style: n ? {
|
|
123
|
+
...re,
|
|
124
|
+
// Fixed span when not measuring; dynamic width uses measureElement.
|
|
125
|
+
...l ? {} : { width: `${t.size}px` }
|
|
126
|
+
} : {
|
|
127
|
+
...oe,
|
|
128
|
+
// Do not set fixed height when measuring — expanded rows must grow and
|
|
129
|
+
// ResizeObserver can update layout so following virtual rows move down.
|
|
130
|
+
...l ? {} : { height: `${t.size}px` }
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
[s, i.options.horizontal, f]
|
|
135
|
+
), te = d(
|
|
136
|
+
(...e) => {
|
|
137
|
+
i.scrollToIndex(...e);
|
|
138
|
+
},
|
|
139
|
+
[i]
|
|
140
|
+
);
|
|
141
|
+
return {
|
|
142
|
+
virtualItems: s,
|
|
143
|
+
totalHeight: y,
|
|
144
|
+
totalSize: y,
|
|
145
|
+
measureElement: f,
|
|
146
|
+
virtualizer: i,
|
|
147
|
+
scrollToIndex: te,
|
|
148
|
+
getRow: O,
|
|
149
|
+
getItemProps: ee,
|
|
150
|
+
rowState: E
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
export {
|
|
154
|
+
fe as useVirtualizedList
|
|
155
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactVirtualizerOptions } from '@tanstack/react-virtual';
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
|
+
import { VirtualListKey } from './types';
|
|
4
|
+
export type UseVirtualizedRowsOptions<TScrollElement extends Element = HTMLDivElement, TItemElement extends Element = HTMLDivElement> = {
|
|
5
|
+
scrollElementRef: RefObject<TScrollElement | null>;
|
|
6
|
+
rowCount: number;
|
|
7
|
+
estimateSize: (index: number) => number;
|
|
8
|
+
overscan?: number;
|
|
9
|
+
getItemKey?: (index: number) => VirtualListKey;
|
|
10
|
+
} & Omit<Partial<ReactVirtualizerOptions<TScrollElement, TItemElement>>, "count" | "getScrollElement" | "estimateSize" | "overscan" | "getItemKey">;
|
|
11
|
+
/**
|
|
12
|
+
* Thin wrapper around TanStack `useVirtualizer` for row lists.
|
|
13
|
+
*
|
|
14
|
+
* Extra virtualizer options (`initialRect` for SSR, `horizontal`, `gap`, `rangeExtractor`, etc.)
|
|
15
|
+
* are accepted via the rest of `UseVirtualizedRowsOptions`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useVirtualizedRows<TScrollElement extends Element = HTMLDivElement, TItemElement extends Element = HTMLDivElement>(options: UseVirtualizedRowsOptions<TScrollElement, TItemElement>): {
|
|
18
|
+
virtualizer: import('@tanstack/virtual-core').Virtualizer<TScrollElement, TItemElement>;
|
|
19
|
+
virtualItems: import('@tanstack/virtual-core').VirtualItem[];
|
|
20
|
+
totalSize: number;
|
|
21
|
+
measureElement: (node: TItemElement) => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useVirtualizer as s } from "@tanstack/react-virtual";
|
|
2
|
+
function m(t) {
|
|
3
|
+
const {
|
|
4
|
+
scrollElementRef: r,
|
|
5
|
+
rowCount: i,
|
|
6
|
+
estimateSize: l,
|
|
7
|
+
overscan: o,
|
|
8
|
+
getItemKey: u,
|
|
9
|
+
...n
|
|
10
|
+
} = t, e = s({
|
|
11
|
+
count: i,
|
|
12
|
+
getScrollElement: () => r.current,
|
|
13
|
+
estimateSize: l,
|
|
14
|
+
overscan: o,
|
|
15
|
+
getItemKey: u,
|
|
16
|
+
...n
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
virtualizer: e,
|
|
20
|
+
virtualItems: e.getVirtualItems(),
|
|
21
|
+
totalSize: e.getTotalSize(),
|
|
22
|
+
measureElement: e.measureElement
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
m as useVirtualizedRows
|
|
27
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impact-nova",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"description": "Enterprise-grade React design system built with React 19, Vite, Tailwind CSS, and Radix UI. Built-in internationalization (i18n) and comprehensive UI component library for scalable, accessible, and performant applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -196,6 +196,10 @@
|
|
|
196
196
|
"types": "./dist/components/ui/empty-container.d.ts",
|
|
197
197
|
"import": "./dist/components/ui/empty-container.js"
|
|
198
198
|
},
|
|
199
|
+
"./expandable-sku": {
|
|
200
|
+
"types": "./dist/components/ui/expandable-sku/index.d.ts",
|
|
201
|
+
"import": "./dist/components/ui/expandable-sku/index.js"
|
|
202
|
+
},
|
|
199
203
|
"./file-upload": {
|
|
200
204
|
"types": "./dist/components/ui/file-upload.d.ts",
|
|
201
205
|
"import": "./dist/components/ui/file-upload.js"
|
|
@@ -324,6 +328,10 @@
|
|
|
324
328
|
"types": "./dist/components/ui/tooltip.d.ts",
|
|
325
329
|
"import": "./dist/components/ui/tooltip.js"
|
|
326
330
|
},
|
|
331
|
+
"./virtualized": {
|
|
332
|
+
"types": "./dist/lib/virtualized/index.d.ts",
|
|
333
|
+
"import": "./dist/lib/virtualized/index.js"
|
|
334
|
+
},
|
|
327
335
|
"./ag-grid-react": {
|
|
328
336
|
"types": "./dist/components/ui/ag-grid-react/index.d.ts",
|
|
329
337
|
"import": "./dist/components/ui/ag-grid-react/index.js"
|
|
@@ -420,6 +428,9 @@
|
|
|
420
428
|
"empty-container": [
|
|
421
429
|
"dist/components/ui/empty-container.d.ts"
|
|
422
430
|
],
|
|
431
|
+
"expandable-sku": [
|
|
432
|
+
"dist/components/ui/expandable-sku/index.d.ts"
|
|
433
|
+
],
|
|
423
434
|
"file-upload": [
|
|
424
435
|
"dist/components/ui/file-upload.d.ts"
|
|
425
436
|
],
|
|
@@ -516,6 +527,9 @@
|
|
|
516
527
|
"tooltip": [
|
|
517
528
|
"dist/components/ui/tooltip.d.ts"
|
|
518
529
|
],
|
|
530
|
+
"virtualized": [
|
|
531
|
+
"dist/lib/virtualized/index.d.ts"
|
|
532
|
+
],
|
|
519
533
|
"ag-grid-react": [
|
|
520
534
|
"dist/components/ui/ag-grid-react/index.d.ts"
|
|
521
535
|
],
|
|
@@ -581,6 +595,8 @@
|
|
|
581
595
|
"@storybook/addon-vitest": "^10.2.0",
|
|
582
596
|
"@storybook/react-vite": "^10.2.0",
|
|
583
597
|
"@tailwindcss/vite": "^4.1.18",
|
|
598
|
+
"@tanstack/react-query": "^5.97.0",
|
|
599
|
+
"@tanstack/react-table": "^8.21.3",
|
|
584
600
|
"@types/node": "^24.10.9",
|
|
585
601
|
"@types/react": "^19.2.5",
|
|
586
602
|
"@types/react-dom": "^19.2.3",
|
|
@@ -611,6 +627,7 @@
|
|
|
611
627
|
"vitest": "^4.0.18"
|
|
612
628
|
},
|
|
613
629
|
"peerDependencies": {
|
|
630
|
+
"@tanstack/react-table": "^8.20.0",
|
|
614
631
|
"ag-grid-enterprise": "35.0.1",
|
|
615
632
|
"ag-grid-react": "35.0.1",
|
|
616
633
|
"highcharts": "^12.5.0",
|
|
@@ -618,5 +635,10 @@
|
|
|
618
635
|
"highcharts-react-official": "^3.2.3",
|
|
619
636
|
"react": "^19.2.0",
|
|
620
637
|
"react-dom": "^19.2.0"
|
|
638
|
+
},
|
|
639
|
+
"peerDependenciesMeta": {
|
|
640
|
+
"@tanstack/react-table": {
|
|
641
|
+
"optional": true
|
|
642
|
+
}
|
|
621
643
|
}
|
|
622
644
|
}
|
package/tailwind.config.js
CHANGED
|
@@ -83,6 +83,8 @@ const baseConfig = {
|
|
|
83
83
|
"header-notification": cssVar("--color-header-notification-icon"),
|
|
84
84
|
charcoal: cssVar("--color-neutral-charcoal"),
|
|
85
85
|
badge: cssVar("--color-neutral-badge"),
|
|
86
|
+
heading: cssVar("--color-header-notification-icon"),
|
|
87
|
+
subheading: cssVar("--color-secondary"),
|
|
86
88
|
},
|
|
87
89
|
|
|
88
90
|
/* Brand / primary interactive */
|