impact-nova 1.7.2 → 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.
Files changed (37) hide show
  1. package/dist/components/ui/accordion.d.ts +5 -0
  2. package/dist/components/ui/accordion.js +51 -39
  3. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +207 -209
  4. package/dist/components/ui/ag-grid-react/index.js +86 -84
  5. package/dist/components/ui/ag-grid-react/theme.js +3 -0
  6. package/dist/components/ui/data-table/data-table-column-list.js +84 -78
  7. package/dist/components/ui/expandable-sku/expandable-sku.d.ts +38 -0
  8. package/dist/components/ui/expandable-sku/expandable-sku.js +244 -0
  9. package/dist/components/ui/expandable-sku/expandable-sku.types.d.ts +35 -0
  10. package/dist/components/ui/expandable-sku/index.d.ts +2 -0
  11. package/dist/components/ui/expandable-sku/index.js +4 -0
  12. package/dist/components/ui/filter-strip/filter-tag-list.d.ts +8 -1
  13. package/dist/components/ui/filter-strip/filter-tag-list.js +1 -0
  14. package/dist/components/ui/select/select.js +221 -210
  15. package/dist/impact-nova.css +1 -1
  16. package/dist/index.d.ts +57 -0
  17. package/dist/index.js +318 -300
  18. package/dist/lib/virtualized/index.d.ts +9 -0
  19. package/dist/lib/virtualized/sectioned.d.ts +37 -0
  20. package/dist/lib/virtualized/sectioned.js +38 -0
  21. package/dist/lib/virtualized/selection-counts.d.ts +14 -0
  22. package/dist/lib/virtualized/selection-counts.js +12 -0
  23. package/dist/lib/virtualized/types.d.ts +131 -0
  24. package/dist/lib/virtualized/useDataGrid.d.ts +15 -0
  25. package/dist/lib/virtualized/useDataGrid.js +12 -0
  26. package/dist/lib/virtualized/useDataSource.d.ts +8 -0
  27. package/dist/lib/virtualized/useDataSource.js +34 -0
  28. package/dist/lib/virtualized/useDebouncedValue.d.ts +4 -0
  29. package/dist/lib/virtualized/useDebouncedValue.js +11 -0
  30. package/dist/lib/virtualized/useRowState.d.ts +15 -0
  31. package/dist/lib/virtualized/useRowState.js +127 -0
  32. package/dist/lib/virtualized/useVirtualizedList.d.ts +72 -0
  33. package/dist/lib/virtualized/useVirtualizedList.js +155 -0
  34. package/dist/lib/virtualized/useVirtualizedRows.d.ts +22 -0
  35. package/dist/lib/virtualized/useVirtualizedRows.js +27 -0
  36. package/package.json +23 -1
  37. package/tailwind.config.js +2 -0
@@ -0,0 +1,244 @@
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import * as B from "react";
3
+ import { ChevronDown as E } from "lucide-react";
4
+ import { Accordion as P, AccordionItem as V, AccordionTrigger as _, AccordionContent as R } from "../accordion.js";
5
+ import { Badge as I } from "../badge.js";
6
+ import { Checkbox as z } from "../checkbox.js";
7
+ import { FilterPopoverContent as D } from "../filter-strip/filter-tag-list.js";
8
+ import { Popover as M, PopoverTrigger as j } from "../popover.js";
9
+ import { Tag as K } from "../tag.js";
10
+ import { Tooltip as L, TooltipTrigger as O, TooltipContent as U } from "../tooltip.js";
11
+ import { cn as p } from "../../../lib/utils.js";
12
+ function W({ section: a }) {
13
+ return a.columns.length === 0 ? null : /* @__PURE__ */ e("div", { className: "min-w-0 bg-transparent", 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: a.columns.map((l, s) => /* @__PURE__ */ t(
14
+ "div",
15
+ {
16
+ 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",
17
+ children: [
18
+ /* @__PURE__ */ e("p", { className: "truncate text-xs font-semibold leading-5 text-content-heading", title: l.label, children: l.label }),
19
+ /* @__PURE__ */ e("p", { className: "truncate text-sm font-semibold leading-5 text-content", title: String(l.value), children: l.value })
20
+ ]
21
+ },
22
+ `${a.id}-metric-${s}`
23
+ )) }) }) });
24
+ }
25
+ function X({ section: a }) {
26
+ const i = a.maxVisibleTags ?? 4, l = a.tags, s = l.slice(0, i), n = l.slice(i), o = n.length, d = a.formatOverflow?.(o) ?? (o > 0 ? `+${o}` : null);
27
+ return /* @__PURE__ */ t("div", { className: "px-4 py-4 pt-0 sm:px-5", children: [
28
+ /* @__PURE__ */ e("p", { className: "text-xs font-semibold leading-5 text-content-heading", children: a.title ?? "Attributes" }),
29
+ /* @__PURE__ */ t("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [
30
+ s.map((c, u) => /* @__PURE__ */ e(
31
+ I,
32
+ {
33
+ variant: "subtle",
34
+ color: "neutral",
35
+ size: "sm",
36
+ shape: "circle",
37
+ className: "max-w-full",
38
+ children: c
39
+ },
40
+ `${u}-${c}`
41
+ )),
42
+ n.length > 0 ? /* @__PURE__ */ t(M, { children: [
43
+ /* @__PURE__ */ t(L, { children: [
44
+ /* @__PURE__ */ e(O, { asChild: !0, children: /* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ e(
45
+ K,
46
+ {
47
+ variant: "secondary",
48
+ size: "md",
49
+ shape: "rounded",
50
+ className: "whitespace-nowrap border-0 bg-[#eceefd] px-2 font-['Manrope'] text-xs font-medium text-[#4259ee] hover:bg-[#dce1fc] h-6 cursor-pointer",
51
+ tabIndex: 0,
52
+ role: "button",
53
+ "aria-label": `${n.length} more attributes for ${a.title ?? "Attributes"}`,
54
+ children: d
55
+ }
56
+ ) }) }),
57
+ /* @__PURE__ */ t(U, { variant: "tertiary", side: "top", children: [
58
+ n.length,
59
+ " more"
60
+ ] })
61
+ ] }),
62
+ /* @__PURE__ */ e(
63
+ D,
64
+ {
65
+ remainingValues: n,
66
+ onItemRemove: () => {
67
+ },
68
+ isRemovable: !1
69
+ }
70
+ )
71
+ ] }) : null
72
+ ] })
73
+ ] });
74
+ }
75
+ function q({ section: a }) {
76
+ return /* @__PURE__ */ e("div", { className: "px-4 py-4 sm:px-5", children: a.content });
77
+ }
78
+ const h = "expandable-sku-row-item";
79
+ function G(a) {
80
+ switch (a.type) {
81
+ case "metrics":
82
+ return /* @__PURE__ */ e(W, { section: a }, a.id);
83
+ case "attributes":
84
+ return /* @__PURE__ */ e(X, { section: a }, a.id);
85
+ case "custom":
86
+ return /* @__PURE__ */ e(q, { section: a }, a.id);
87
+ default:
88
+ return null;
89
+ }
90
+ }
91
+ const H = B.forwardRef(
92
+ ({
93
+ className: a,
94
+ sku: i,
95
+ subtitle: l,
96
+ badge: s,
97
+ selection: n,
98
+ selected: o,
99
+ expanded: d,
100
+ defaultExpanded: c = !1,
101
+ onExpandedChange: u,
102
+ disabled: x,
103
+ sections: f,
104
+ panelFooter: v,
105
+ expandAriaLabel: A = "Expand details",
106
+ collapseAriaLabel: T = "Collapse details",
107
+ ...b
108
+ }, g) => {
109
+ const w = d !== void 0, S = w ? d ? h : "" : void 0, m = !!(o || n?.checked), $ = f != null && f.length > 0 || v != null, N = (r) => /* @__PURE__ */ t(
110
+ "div",
111
+ {
112
+ className: p(
113
+ "min-w-0 flex-1",
114
+ r && "pointer-events-none opacity-50"
115
+ ),
116
+ children: [
117
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
118
+ /* @__PURE__ */ e(
119
+ "span",
120
+ {
121
+ className: p(
122
+ "text-sm font-semibold leading-6 text-content",
123
+ m && "tracking-tight"
124
+ ),
125
+ children: i
126
+ }
127
+ ),
128
+ s
129
+ ] }),
130
+ l ? /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-medium leading-4 text-[#60697d]", children: l }) : null
131
+ ]
132
+ }
133
+ ), k = p(
134
+ "rounded-xl transition-[background-color,border-color,box-shadow] duration-200",
135
+ m ? "border-stroke-accent/40 bg-canvas-accent shadow-sm" : "border-stroke bg-canvas-elevated",
136
+ a
137
+ ), C = n ? /* @__PURE__ */ e(
138
+ "div",
139
+ {
140
+ className: "pt-0.5",
141
+ onClick: (r) => r.stopPropagation(),
142
+ onKeyDown: (r) => r.stopPropagation(),
143
+ children: /* @__PURE__ */ e(
144
+ z,
145
+ {
146
+ checked: n.checked,
147
+ disabled: n.disabled,
148
+ onCheckedChange: (r) => {
149
+ const y = r === !0;
150
+ y !== n.checked && n.onCheckedChange(y);
151
+ },
152
+ "aria-label": n["aria-label"] ?? `Select ${i}`
153
+ }
154
+ )
155
+ }
156
+ ) : null;
157
+ return $ ? /* @__PURE__ */ e(
158
+ "div",
159
+ {
160
+ ref: g,
161
+ "data-component": "expandable-sku-row",
162
+ "data-expandable": "true",
163
+ "data-expanded": d ?? void 0,
164
+ "data-selected": o ? "" : void 0,
165
+ "data-selection-chrome": m ? "" : void 0,
166
+ className: k,
167
+ ...b,
168
+ children: /* @__PURE__ */ e(
169
+ P,
170
+ {
171
+ type: "single",
172
+ collapsible: !0,
173
+ disabled: x,
174
+ ...w ? { value: S } : {
175
+ defaultValue: c ? h : void 0
176
+ },
177
+ onValueChange: (r) => u?.(r === h),
178
+ children: /* @__PURE__ */ t(
179
+ V,
180
+ {
181
+ value: h,
182
+ className: "border-0 bg-transparent p-0 shadow-none rounded-none overflow-visible",
183
+ children: [
184
+ /* @__PURE__ */ t("div", { className: "flex items-start gap-3 px-3 py-3", children: [
185
+ C,
186
+ /* @__PURE__ */ t(
187
+ _,
188
+ {
189
+ variant: "plain",
190
+ className: p(
191
+ "min-w-0 gap-2 text-left items-center ",
192
+ x && "pointer-events-none opacity-50"
193
+ ),
194
+ children: [
195
+ N(!1),
196
+ /* @__PURE__ */ e(
197
+ "span",
198
+ {
199
+ className: "expandable-sku-row__chev mt-0.5 inline-flex shrink-0 text-content-muted transition-transform duration-200 group-data-[state=open]:rotate-180",
200
+ "aria-hidden": !0,
201
+ children: /* @__PURE__ */ e(E, { className: "size-4" })
202
+ }
203
+ ),
204
+ /* @__PURE__ */ t("span", { className: "sr-only", children: [
205
+ A,
206
+ " / ",
207
+ T
208
+ ] })
209
+ ]
210
+ }
211
+ )
212
+ ] }),
213
+ /* @__PURE__ */ e(R, { className: "border-0 bg-transparent p-0 pb-[0.01rem]", children: /* @__PURE__ */ t("div", { className: "mx-2 mb-2 overflow-hidden bg-[#f8f9fb] pt-2 rounded-lg", children: [
214
+ f?.map((r) => G(r)),
215
+ v ? /* @__PURE__ */ e("div", { className: "px-4 py-3 sm:px-5", children: v }) : null
216
+ ] }) })
217
+ ]
218
+ }
219
+ )
220
+ }
221
+ )
222
+ }
223
+ ) : /* @__PURE__ */ e(
224
+ "div",
225
+ {
226
+ ref: g,
227
+ "data-component": "expandable-sku-row",
228
+ "data-expandable": "false",
229
+ "data-selected": o ? "" : void 0,
230
+ "data-selection-chrome": m ? "" : void 0,
231
+ className: k,
232
+ ...b,
233
+ children: /* @__PURE__ */ t("div", { className: "flex items-start gap-3 px-3 py-3", children: [
234
+ C,
235
+ N(!!x)
236
+ ] })
237
+ }
238
+ );
239
+ }
240
+ );
241
+ H.displayName = "ExpandableSku";
242
+ export {
243
+ H as ExpandableSku
244
+ };
@@ -0,0 +1,35 @@
1
+ import { ReactNode } from 'react';
2
+ export type SkuRowMetricColumn = {
3
+ label: string;
4
+ value: string;
5
+ };
6
+ /** Horizontal metrics row (any column count). */
7
+ export type SkuRowMetricsSection = {
8
+ id: string;
9
+ type: "metrics";
10
+ columns: ReadonlyArray<SkuRowMetricColumn>;
11
+ };
12
+ /** Tag pills with optional overflow summary (e.g. `+64`). */
13
+ export type SkuRowAttributesSection = {
14
+ id: string;
15
+ type: "attributes";
16
+ title?: string;
17
+ tags: ReadonlyArray<string>;
18
+ /** Max tags before overflow pill (default 4). */
19
+ maxVisibleTags?: number;
20
+ /** Default: `(n) => \`+\${n}\``. */
21
+ formatOverflow?: (hiddenCount: number) => string;
22
+ };
23
+ /** Arbitrary block inside the expanded panel. */
24
+ export type SkuRowCustomSection = {
25
+ id: string;
26
+ type: "custom";
27
+ content: ReactNode;
28
+ };
29
+ export type SkuRowSection = SkuRowMetricsSection | SkuRowAttributesSection | SkuRowCustomSection;
30
+ export type SkuRowSelection = {
31
+ checked: boolean;
32
+ onCheckedChange: (checked: boolean) => void;
33
+ disabled?: boolean;
34
+ "aria-label"?: string;
35
+ };
@@ -0,0 +1,2 @@
1
+ export { ExpandableSku, type ExpandableSkuProps, } from './expandable-sku';
2
+ export type { SkuRowAttributesSection, SkuRowCustomSection, SkuRowMetricColumn, SkuRowMetricsSection, SkuRowSelection, SkuRowSection, } from './expandable-sku.types';
@@ -0,0 +1,4 @@
1
+ import { ExpandableSku as o } from "./expandable-sku.js";
2
+ export {
3
+ o as ExpandableSku
4
+ };
@@ -5,5 +5,12 @@ interface FilterTagListProps {
5
5
  onOverflowClick?: (id: string) => void;
6
6
  onViewAll?: () => void;
7
7
  }
8
+ declare const FilterPopoverContent: ({ remainingValues, viewAllTrigger, onViewAll, onItemRemove, isRemovable }: {
9
+ remainingValues: (string | number)[];
10
+ viewAllTrigger?: "expand" | "custom";
11
+ onViewAll?: () => void;
12
+ onItemRemove: (val: string | number) => void;
13
+ isRemovable?: boolean;
14
+ }) => import("react/jsx-runtime").JSX.Element;
8
15
  declare const FilterTagList: ({ filters, onFilterRemove: _onFilterRemove, onOverflowClick, onViewAll, }: FilterTagListProps) => import("react/jsx-runtime").JSX.Element;
9
- export { FilterTagList };
16
+ export { FilterTagList, FilterPopoverContent };
@@ -155,5 +155,6 @@ const j = ({
155
155
  }
156
156
  ) });
157
157
  export {
158
+ j as FilterPopoverContent,
158
159
  M as FilterTagList
159
160
  };