impact-nova 3.0.0-alpha.16 → 3.0.0-alpha.18
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.types.d.ts +9 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.d.ts +2 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.js +15 -14
- package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.d.ts +10 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.js +17 -0
- package/dist/components/data/ag-grid-react/cell-renderers/index.d.ts +45 -7
- package/dist/components/data/ag-grid-react/cell-renderers/index.js +70 -58
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.d.ts +5 -11
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.js +127 -51
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +150 -147
- package/dist/components/data/ag-grid-react/list-drag-grid-options.d.ts +14 -1
- package/dist/components/data/ag-grid-react/list-drag-grid-options.js +95 -31
- package/dist/components/data/ag-grid-react/list-drag-preview-card.d.ts +4 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-card.js +14 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.d.ts +20 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.js +42 -0
- package/dist/components/data/ag-grid-react/list-find-highlight.d.ts +6 -0
- package/dist/components/data/ag-grid-react/list-find-highlight.js +7 -0
- package/dist/components/data/ag-grid-react/process-backend-columndefs.d.ts +4 -0
- package/dist/components/data/ag-grid-react/process-backend-columndefs.js +78 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.d.ts +10 -2
- package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.js +130 -107
- package/dist/components/data/ag-grid-react/use-list-drag-preview.d.ts +4 -1
- package/dist/components/data/ag-grid-react/use-list-drag-preview.js +131 -32
- package/dist/components/data/ag-grid-react/use-list-find.d.ts +36 -0
- package/dist/components/data/ag-grid-react/use-list-row-drop-zones.d.ts +2 -0
- package/dist/components/data/ag-grid-react/use-list-row-drop-zones.js +60 -41
- package/dist/components/data/data-table/data-table-list-header.js +1 -1
- package/dist/components/data/data-table/data-table-overlay.d.ts +6 -0
- package/dist/components/data/data-table/data-table-overlay.js +18 -0
- package/dist/components/data/data-table/data-table.types.d.ts +1 -0
- package/dist/components/data/data-table/index.d.ts +3 -0
- package/dist/components/data/data-table/index.js +67 -63
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
- package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.d.ts +2 -0
- package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.js +16 -0
- package/dist/components/data/scenario-comparison/index.d.ts +3 -0
- package/dist/components/data/scenario-comparison/index.js +6 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-column.d.ts +12 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-column.js +172 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-label.d.ts +6 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-label.js +64 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.d.ts +5 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.js +127 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.types.d.ts +56 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.variants.d.ts +7 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.variants.js +29 -0
- package/dist/components/data-display/badge/index.d.ts +2 -0
- package/dist/components/data-display/badge/index.js +4 -2
- package/dist/components/data-display/badge/trophy-icon.d.ts +6 -0
- package/dist/components/data-display/badge/trophy-icon.js +28 -0
- package/dist/components/feedback/find-bar/collect-find-matches.d.ts +35 -0
- package/dist/components/feedback/find-bar/collect-find-matches.js +68 -0
- package/dist/components/feedback/find-bar/find-bar-shortcuts.d.ts +5 -0
- package/dist/components/feedback/find-bar/find-bar-shortcuts.js +27 -0
- package/dist/components/feedback/find-bar/find-bar.d.ts +7 -0
- package/dist/components/feedback/find-bar/find-bar.js +266 -0
- package/dist/components/feedback/find-bar/find-bar.types.d.ts +32 -0
- package/dist/components/feedback/find-bar/index.d.ts +4 -0
- package/dist/components/feedback/find-bar/index.js +11 -0
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/forms/choice-card/choice-card-compare-scroll.d.ts +4 -0
- package/dist/components/forms/choice-card/choice-card-compare-scroll.js +6 -0
- package/dist/components/forms/choice-card/choice-card.d.ts +13 -2
- package/dist/components/forms/choice-card/choice-card.js +432 -342
- package/dist/components/forms/choice-card/choice-card.types.d.ts +9 -2
- package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
- package/dist/components/forms/select/components/Submenu.js +3 -2
- package/dist/components/primitives/tabs/folder-tab-path.d.ts +6 -0
- package/dist/components/primitives/tabs/folder-tab-path.js +16 -0
- package/dist/components/primitives/tabs/tabs.js +164 -111
- package/dist/components/primitives/tabs/tabs.types.d.ts +1 -1
- package/dist/i18n/defaultMessages.d.ts +17 -0
- package/dist/i18n/defaultMessages.js +52 -38
- package/dist/i18n/impact-nova-i18n-defaults.d.ts +5 -0
- package/dist/i18n/impact-nova-i18n-defaults.js +4 -9
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +15 -1
- package/dist/i18n/locales/es.js +15 -1
- package/dist/i18n/locales/hi.js +15 -1
- package/dist/i18n/locales/kn.js +15 -1
- package/dist/impact-nova-components.css +189 -14
- package/dist/impact-nova-tokens.scss +2 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +621 -607
- package/dist/lib/virtualized/index.d.ts +2 -0
- package/dist/lib/virtualized/index.js +35 -31
- package/dist/lib/virtualized/list-index.d.ts +5 -0
- package/dist/lib/virtualized/list-index.js +13 -0
- package/dist/lib/virtualized/read-infinite-query-list.d.ts +14 -0
- package/dist/lib/virtualized/read-infinite-query-list.js +12 -0
- package/dist/lib/virtualized/types.d.ts +4 -2
- package/dist/lib/virtualized/useRowState.js +60 -56
- package/dist/lib/virtualized/useVirtualizedList.d.ts +5 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +16 -3
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FlatScenarioComparisonRow, ScenarioComparisonColumn as ScenarioComparisonColumnData, ScenarioComparisonProps } from './scenario-comparison.types';
|
|
3
|
+
export declare function ScenarioComparisonColumn({ column, rows, hoveredRowId, metricHeaders, selectLabel, selectedLabel, renderCell, onHoverChange, }: {
|
|
4
|
+
column: ScenarioComparisonColumnData;
|
|
5
|
+
rows: readonly FlatScenarioComparisonRow[];
|
|
6
|
+
hoveredRowId: string | null;
|
|
7
|
+
metricHeaders: readonly ReactNode[];
|
|
8
|
+
selectLabel: string;
|
|
9
|
+
selectedLabel: string;
|
|
10
|
+
renderCell?: ScenarioComparisonProps["renderCell"];
|
|
11
|
+
onHoverChange: (rowId: string | null) => void;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { jsxs as h, Fragment as x, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as g } from "../../data-display/badge/badge.js";
|
|
3
|
+
import { Button as w } from "../../primitives/button/button.js";
|
|
4
|
+
import { useChoiceCardCompare as N, ChoiceCardHeader as y, ChoiceCardFooter as S, useChoiceCardItem as v, ChoiceCardTitle as z, useChoiceCardGroup as j } from "../../forms/choice-card/choice-card.js";
|
|
5
|
+
import { cn as d } from "../../../lib/utils.js";
|
|
6
|
+
import { scenarioComparisonRowsClassName as R } from "./scenario-comparison.variants.js";
|
|
7
|
+
import { choiceCardCompareRowsScrollAccessibility as B } from "../../forms/choice-card/choice-card-compare-scroll.js";
|
|
8
|
+
function b(t) {
|
|
9
|
+
t.stopPropagation();
|
|
10
|
+
}
|
|
11
|
+
function M({
|
|
12
|
+
selectLabel: t,
|
|
13
|
+
selectedLabel: n
|
|
14
|
+
}) {
|
|
15
|
+
const i = j(), a = v();
|
|
16
|
+
return /* @__PURE__ */ e(
|
|
17
|
+
w,
|
|
18
|
+
{
|
|
19
|
+
type: "button",
|
|
20
|
+
variant: "outline",
|
|
21
|
+
disabled: a.disabled,
|
|
22
|
+
"aria-pressed": a.selected,
|
|
23
|
+
className: d(
|
|
24
|
+
"capitalize bg-canvas-elevated",
|
|
25
|
+
a.selected && "border-brand-hover bg-accent hover:bg-accent"
|
|
26
|
+
),
|
|
27
|
+
onPointerDown: b,
|
|
28
|
+
onClick: (r) => {
|
|
29
|
+
b(r), a.disabled || i.setValue(a.value);
|
|
30
|
+
},
|
|
31
|
+
children: a.selected ? n : t
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function T({
|
|
36
|
+
title: t,
|
|
37
|
+
selectedLabel: n
|
|
38
|
+
}) {
|
|
39
|
+
const i = v();
|
|
40
|
+
return /* @__PURE__ */ h("div", { className: "flex w-max min-w-full items-center gap-1", children: [
|
|
41
|
+
/* @__PURE__ */ e(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
"data-slot": "scenario-comparison-title",
|
|
45
|
+
className: "flex h-9 min-w-max flex-1 items-center justify-center rounded-lg bg-accent px-3 py-2",
|
|
46
|
+
children: /* @__PURE__ */ e(z, { className: "whitespace-nowrap text-center text-base font-semibold leading-6 text-content-charcoal", children: t })
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
i.selected ? /* @__PURE__ */ e(
|
|
50
|
+
g,
|
|
51
|
+
{
|
|
52
|
+
variant: "solid",
|
|
53
|
+
color: "success",
|
|
54
|
+
"data-slot": "scenario-comparison-selected",
|
|
55
|
+
className: "shrink-0",
|
|
56
|
+
children: n
|
|
57
|
+
}
|
|
58
|
+
) : null
|
|
59
|
+
] });
|
|
60
|
+
}
|
|
61
|
+
function k({
|
|
62
|
+
cell: t,
|
|
63
|
+
emphasized: n,
|
|
64
|
+
hovered: i,
|
|
65
|
+
isLastRow: a,
|
|
66
|
+
columnCount: r
|
|
67
|
+
}) {
|
|
68
|
+
const l = r > 0 ? r : t?.values?.length ?? 0;
|
|
69
|
+
return /* @__PURE__ */ e(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "scenario-comparison-values",
|
|
73
|
+
className: d(
|
|
74
|
+
"flex h-full w-full min-w-0 items-center justify-between px-4 py-1 transition-colors",
|
|
75
|
+
!a && "border-b border-canvas-tint",
|
|
76
|
+
i && "rounded-lg bg-accent"
|
|
77
|
+
),
|
|
78
|
+
children: Array.from({ length: l }, (f, s) => {
|
|
79
|
+
const c = t?.values?.[s];
|
|
80
|
+
return t?.badgeIndexes?.includes(s) && c != null ? /* @__PURE__ */ e(
|
|
81
|
+
g,
|
|
82
|
+
{
|
|
83
|
+
variant: "subtle",
|
|
84
|
+
color: "success",
|
|
85
|
+
size: "sm",
|
|
86
|
+
className: "capitalize",
|
|
87
|
+
children: c
|
|
88
|
+
},
|
|
89
|
+
s
|
|
90
|
+
) : /* @__PURE__ */ e(
|
|
91
|
+
"p",
|
|
92
|
+
{
|
|
93
|
+
className: d(
|
|
94
|
+
"text-sm leading-[21px]",
|
|
95
|
+
s === 0 && n ? "font-bold text-indicator-sort" : "font-medium text-content"
|
|
96
|
+
),
|
|
97
|
+
children: c ?? "—"
|
|
98
|
+
},
|
|
99
|
+
s
|
|
100
|
+
);
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function L({
|
|
106
|
+
column: t,
|
|
107
|
+
rows: n,
|
|
108
|
+
hoveredRowId: i,
|
|
109
|
+
metricHeaders: a,
|
|
110
|
+
selectLabel: r,
|
|
111
|
+
selectedLabel: l,
|
|
112
|
+
renderCell: f,
|
|
113
|
+
onHoverChange: s
|
|
114
|
+
}) {
|
|
115
|
+
const c = a.length, C = N();
|
|
116
|
+
return /* @__PURE__ */ h(x, { children: [
|
|
117
|
+
/* @__PURE__ */ h(y, { className: "flex-col items-stretch gap-3 overflow-visible pt-3 pb-3", children: [
|
|
118
|
+
/* @__PURE__ */ e(T, { title: t.title, selectedLabel: l }),
|
|
119
|
+
a.length > 0 ? /* @__PURE__ */ e(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
"data-slot": "scenario-comparison-metrics",
|
|
123
|
+
className: "flex w-full items-center justify-between rounded-lg border border-canvas-tint bg-canvas-wash p-2 text-xs font-bold leading-5 text-content-heading capitalize",
|
|
124
|
+
children: a.map((o, m) => /* @__PURE__ */ e("span", { className: "whitespace-nowrap", children: o }, m))
|
|
125
|
+
}
|
|
126
|
+
) : null
|
|
127
|
+
] }),
|
|
128
|
+
/* @__PURE__ */ e(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
"data-slot": "choice-card-compare-rows",
|
|
132
|
+
className: d(R, "[grid-row:3]"),
|
|
133
|
+
onScroll: C.syncRowsScroll,
|
|
134
|
+
...B,
|
|
135
|
+
children: n.map((o, m) => {
|
|
136
|
+
const p = t.values?.[o.id], u = i === o.id;
|
|
137
|
+
return /* @__PURE__ */ e(
|
|
138
|
+
"div",
|
|
139
|
+
{
|
|
140
|
+
"data-row-id": o.id,
|
|
141
|
+
"data-hovered": u || void 0,
|
|
142
|
+
className: "flex h-11 items-center",
|
|
143
|
+
onMouseEnter: () => s(o.id),
|
|
144
|
+
onMouseLeave: () => s(null),
|
|
145
|
+
children: f?.({ row: o, column: t, cell: p, hovered: u }) ?? /* @__PURE__ */ e(
|
|
146
|
+
k,
|
|
147
|
+
{
|
|
148
|
+
cell: p,
|
|
149
|
+
emphasized: p?.emphasized ?? o.emphasized,
|
|
150
|
+
hovered: u,
|
|
151
|
+
isLastRow: m === n.length - 1,
|
|
152
|
+
columnCount: c
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
},
|
|
156
|
+
o.id
|
|
157
|
+
);
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
/* @__PURE__ */ e(S, { className: "flex-nowrap items-center justify-center self-center py-3", children: /* @__PURE__ */ e(
|
|
162
|
+
M,
|
|
163
|
+
{
|
|
164
|
+
selectLabel: r,
|
|
165
|
+
selectedLabel: l
|
|
166
|
+
}
|
|
167
|
+
) })
|
|
168
|
+
] });
|
|
169
|
+
}
|
|
170
|
+
export {
|
|
171
|
+
L as ScenarioComparisonColumn
|
|
172
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FlatScenarioComparisonRow } from './scenario-comparison.types';
|
|
2
|
+
export declare function ScenarioComparisonLabel({ row, hovered, onHoverChange, }: {
|
|
3
|
+
row: FlatScenarioComparisonRow;
|
|
4
|
+
hovered: boolean;
|
|
5
|
+
onHoverChange: (rowId: string | null) => void;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { OverflowTooltip as c } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
4
|
+
import { cn as n } from "../../../lib/utils.js";
|
|
5
|
+
import { scenarioComparisonLabelVariants as t, scenarioComparisonConnectorClassName as d } from "./scenario-comparison.variants.js";
|
|
6
|
+
function b({
|
|
7
|
+
row: a,
|
|
8
|
+
hovered: r,
|
|
9
|
+
onHoverChange: s
|
|
10
|
+
}) {
|
|
11
|
+
const o = a.depth > 0 ? "child" : "parent", l = a.swatch ? {
|
|
12
|
+
backgroundColor: `color-mix(in srgb, ${a.swatch} 14%, var(--color-background))`,
|
|
13
|
+
borderColor: `color-mix(in srgb, ${a.swatch} 14%, var(--color-background))`,
|
|
14
|
+
color: a.swatch
|
|
15
|
+
} : void 0;
|
|
16
|
+
return /* @__PURE__ */ e(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
"data-slot": "scenario-comparison-label",
|
|
20
|
+
"data-row-id": a.id,
|
|
21
|
+
"data-hovered": r || void 0,
|
|
22
|
+
className: n(
|
|
23
|
+
"flex h-full w-full min-w-0 items-stretch justify-end self-stretch"
|
|
24
|
+
),
|
|
25
|
+
onMouseEnter: () => s(a.id),
|
|
26
|
+
onMouseLeave: () => s(null),
|
|
27
|
+
children: /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 items-center justify-end", children: [
|
|
28
|
+
/* @__PURE__ */ i(
|
|
29
|
+
"span",
|
|
30
|
+
{
|
|
31
|
+
className: n(
|
|
32
|
+
"self-center",
|
|
33
|
+
t({ kind: o })
|
|
34
|
+
),
|
|
35
|
+
style: o === "child" ? l : void 0,
|
|
36
|
+
children: [
|
|
37
|
+
a.icon ? /* @__PURE__ */ e("span", { className: "size-4 shrink-0 [&_svg]:size-4", children: a.icon }) : null,
|
|
38
|
+
a.swatch ? /* @__PURE__ */ e(
|
|
39
|
+
"span",
|
|
40
|
+
{
|
|
41
|
+
className: "size-3 shrink-0 rounded-full",
|
|
42
|
+
style: { backgroundColor: a.swatch },
|
|
43
|
+
"aria-hidden": "true"
|
|
44
|
+
}
|
|
45
|
+
) : null,
|
|
46
|
+
/* @__PURE__ */ e(c, { triggerClassName: "block max-w-[7.5rem] truncate", children: a.label })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ e(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "scenario-comparison-connector",
|
|
54
|
+
className: d,
|
|
55
|
+
"aria-hidden": "true"
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] })
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
b as ScenarioComparisonLabel
|
|
64
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ScenarioComparisonProps } from './scenario-comparison.types';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const ScenarioComparison: React.ForwardRefExoticComponent<ScenarioComparisonProps & React.RefAttributes<HTMLElement>>;
|
|
4
|
+
export { ScenarioComparison };
|
|
5
|
+
export type { ScenarioComparisonProps };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as j from "react";
|
|
3
|
+
import { OverflowTooltip as k } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
4
|
+
import { ChoiceCardGroup as y, ChoiceCardCompare as I, ChoiceCardCompareLabels as M, ChoiceCard as O } from "../../forms/choice-card/choice-card.js";
|
|
5
|
+
import { ScrollOverflowAffordance as V } from "../../layout/horizontal-scroller/scroll-overflow-affordance.js";
|
|
6
|
+
import { useImpactNovaI18n as A } from "../../../i18n/use-impact-nova-i18n.js";
|
|
7
|
+
import { createComponent as D } from "../../../lib/primitives/create-component.js";
|
|
8
|
+
import { cn as E } from "../../../lib/utils.js";
|
|
9
|
+
import { flattenScenarioComparisonRows as G } from "./flatten-scenario-comparison-rows.js";
|
|
10
|
+
import { ScenarioComparisonColumn as T } from "./scenario-comparison-column.js";
|
|
11
|
+
import { ScenarioComparisonLabel as q } from "./scenario-comparison-label.js";
|
|
12
|
+
import { scenarioComparisonCardVariants as z, scenarioComparisonRootVariants as B } from "./scenario-comparison.variants.js";
|
|
13
|
+
const $ = D(
|
|
14
|
+
"ScenarioComparison",
|
|
15
|
+
({
|
|
16
|
+
title: i,
|
|
17
|
+
badge: f,
|
|
18
|
+
toolbar: n,
|
|
19
|
+
rows: h,
|
|
20
|
+
columns: l,
|
|
21
|
+
value: C,
|
|
22
|
+
defaultValue: v,
|
|
23
|
+
onValueChange: x,
|
|
24
|
+
metricHeaders: u,
|
|
25
|
+
selectLabel: w,
|
|
26
|
+
selectedLabel: g,
|
|
27
|
+
renderLabel: s,
|
|
28
|
+
renderCell: N,
|
|
29
|
+
className: b,
|
|
30
|
+
disabled: t
|
|
31
|
+
}, S) => {
|
|
32
|
+
const { t: c } = A(), [m, o] = j.useState(null), d = G(h), R = w ?? c("scenarioComparison.select"), H = g ?? c("scenarioComparison.selected"), L = u ?? [];
|
|
33
|
+
return /* @__PURE__ */ a(
|
|
34
|
+
"section",
|
|
35
|
+
{
|
|
36
|
+
ref: S,
|
|
37
|
+
"data-component": "scenario-comparison",
|
|
38
|
+
className: E(B(), b),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ a("header", { className: "flex shrink-0 flex-wrap items-center justify-between gap-x-3 gap-y-2", children: [
|
|
41
|
+
/* @__PURE__ */ a("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
42
|
+
i ? /* @__PURE__ */ r("h2", { className: "min-w-0 max-w-full shrink-0 text-sm font-bold leading-[1.15] tracking-[-0.14px] text-content", children: /* @__PURE__ */ r(k, { triggerClassName: "block max-w-[14rem] truncate sm:max-w-none", children: i }) }) : null,
|
|
43
|
+
f
|
|
44
|
+
] }),
|
|
45
|
+
n ? /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1 flex-wrap items-center justify-end gap-3", children: n }) : null
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ r(
|
|
48
|
+
y,
|
|
49
|
+
{
|
|
50
|
+
value: C,
|
|
51
|
+
defaultValue: v,
|
|
52
|
+
onValueChange: x,
|
|
53
|
+
disabled: t,
|
|
54
|
+
orientation: "vertical",
|
|
55
|
+
className: "flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden !gap-0",
|
|
56
|
+
children: /* @__PURE__ */ r(
|
|
57
|
+
V,
|
|
58
|
+
{
|
|
59
|
+
className: "h-full min-h-0 flex-1",
|
|
60
|
+
viewportClassName: "h-full min-h-0",
|
|
61
|
+
hideScrollbar: !0,
|
|
62
|
+
contentDependency: l.length,
|
|
63
|
+
children: /* @__PURE__ */ a(
|
|
64
|
+
I,
|
|
65
|
+
{
|
|
66
|
+
fit: "fill",
|
|
67
|
+
scrollRows: !0,
|
|
68
|
+
rowMinHeight: "2.75rem",
|
|
69
|
+
className: "h-full min-h-0 overflow-visible bg-transparent pt-0 pb-0",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ r(M, { className: "bg-canvas-elevated", children: d.map((e) => {
|
|
72
|
+
const p = m === e.id;
|
|
73
|
+
return /* @__PURE__ */ r("div", { className: "flex h-11 w-full items-center", children: s ? /* @__PURE__ */ r(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
"data-row-id": e.id,
|
|
77
|
+
onMouseEnter: () => o(e.id),
|
|
78
|
+
onMouseLeave: () => o(null),
|
|
79
|
+
children: s({ row: e, hovered: p })
|
|
80
|
+
}
|
|
81
|
+
) : /* @__PURE__ */ r(
|
|
82
|
+
q,
|
|
83
|
+
{
|
|
84
|
+
row: e,
|
|
85
|
+
hovered: p,
|
|
86
|
+
onHoverChange: o
|
|
87
|
+
}
|
|
88
|
+
) }, e.id);
|
|
89
|
+
}) }),
|
|
90
|
+
l.map((e) => /* @__PURE__ */ r(
|
|
91
|
+
O,
|
|
92
|
+
{
|
|
93
|
+
value: e.id,
|
|
94
|
+
disabled: e.disabled || t,
|
|
95
|
+
variant: "compare",
|
|
96
|
+
className: z(),
|
|
97
|
+
children: /* @__PURE__ */ r(
|
|
98
|
+
T,
|
|
99
|
+
{
|
|
100
|
+
column: e,
|
|
101
|
+
rows: d,
|
|
102
|
+
hoveredRowId: m,
|
|
103
|
+
metricHeaders: L,
|
|
104
|
+
selectLabel: R,
|
|
105
|
+
selectedLabel: H,
|
|
106
|
+
renderCell: N,
|
|
107
|
+
onHoverChange: o
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
},
|
|
111
|
+
e.id
|
|
112
|
+
))
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
export {
|
|
126
|
+
$ as ScenarioComparison
|
|
127
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ScenarioComparisonCell {
|
|
3
|
+
/** One entry per metric header, in the same order. A third header needs a third entry. */
|
|
4
|
+
values?: readonly ReactNode[];
|
|
5
|
+
/** Indexes in `values` that render as a success badge. Omit to keep every value as text. */
|
|
6
|
+
badgeIndexes?: readonly number[];
|
|
7
|
+
emphasized?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ScenarioComparisonRow {
|
|
10
|
+
id: string;
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
swatch?: string;
|
|
14
|
+
children?: readonly ScenarioComparisonRow[];
|
|
15
|
+
}
|
|
16
|
+
export interface ScenarioComparisonColumn {
|
|
17
|
+
id: string;
|
|
18
|
+
title: ReactNode;
|
|
19
|
+
values?: Record<string, ScenarioComparisonCell>;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface FlatScenarioComparisonRow {
|
|
23
|
+
id: string;
|
|
24
|
+
label: ReactNode;
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
swatch?: string;
|
|
27
|
+
depth: number;
|
|
28
|
+
emphasized: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ScenarioComparisonLabelState {
|
|
31
|
+
row: FlatScenarioComparisonRow;
|
|
32
|
+
hovered: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface ScenarioComparisonCellState {
|
|
35
|
+
row: FlatScenarioComparisonRow;
|
|
36
|
+
column: ScenarioComparisonColumn;
|
|
37
|
+
cell?: ScenarioComparisonCell;
|
|
38
|
+
hovered: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface ScenarioComparisonProps {
|
|
41
|
+
title?: ReactNode;
|
|
42
|
+
badge?: ReactNode;
|
|
43
|
+
toolbar?: ReactNode;
|
|
44
|
+
rows: readonly ScenarioComparisonRow[];
|
|
45
|
+
columns: readonly ScenarioComparisonColumn[];
|
|
46
|
+
value?: string;
|
|
47
|
+
defaultValue?: string;
|
|
48
|
+
onValueChange?: (value: string) => void;
|
|
49
|
+
metricHeaders?: readonly ReactNode[];
|
|
50
|
+
selectLabel?: string;
|
|
51
|
+
selectedLabel?: string;
|
|
52
|
+
renderLabel?: (state: ScenarioComparisonLabelState) => ReactNode;
|
|
53
|
+
renderCell?: (state: ScenarioComparisonCellState) => ReactNode;
|
|
54
|
+
className?: string;
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const scenarioComparisonRootVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
2
|
+
export declare const scenarioComparisonCardVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
3
|
+
export declare const scenarioComparisonRowsClassName = "min-h-0 overflow-x-hidden overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
|
|
4
|
+
export declare const scenarioComparisonLabelVariants: (props?: ({
|
|
5
|
+
kind?: "child" | "parent" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export declare const scenarioComparisonConnectorClassName = "h-px w-10 shrink-0 border-t border-dotted border-stroke-accent";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cva as e } from "class-variance-authority";
|
|
2
|
+
const a = e(
|
|
3
|
+
"flex h-full min-h-0 min-w-0 flex-col gap-4 overflow-hidden rounded-lg bg-canvas-elevated px-4 py-3 shadow-elevation-header"
|
|
4
|
+
), o = e(
|
|
5
|
+
[
|
|
6
|
+
"grid h-full min-h-0 grid-rows-subgrid gap-0 overflow-hidden rounded-xl border border-solid border-stroke bg-none bg-canvas-elevated p-0 px-4 shadow-none [grid-row:1/-1]",
|
|
7
|
+
"data-[selected]:border-brand data-[selected]:bg-gradient-to-b data-[selected]:from-canvas-muted data-[selected]:to-canvas-elevated data-[selected]:shadow-[inset_3px_0_0_0_var(--color-primary)]"
|
|
8
|
+
]
|
|
9
|
+
), n = "min-h-0 overflow-x-hidden overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", d = e(
|
|
10
|
+
"inline-flex max-w-full min-w-0 items-center justify-center gap-1 rounded-full px-2 py-1 text-sm font-medium leading-[21px] capitalize",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
kind: {
|
|
14
|
+
parent: "border border-stroke-accent bg-accent text-accent-foreground",
|
|
15
|
+
child: "border-transparent"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
kind: "child"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
), t = "h-px w-10 shrink-0 border-t border-dotted border-stroke-accent";
|
|
23
|
+
export {
|
|
24
|
+
o as scenarioComparisonCardVariants,
|
|
25
|
+
t as scenarioComparisonConnectorClassName,
|
|
26
|
+
d as scenarioComparisonLabelVariants,
|
|
27
|
+
a as scenarioComparisonRootVariants,
|
|
28
|
+
n as scenarioComparisonRowsClassName
|
|
29
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Badge as e } from "./badge.js";
|
|
2
|
-
import { badgeVariants as
|
|
2
|
+
import { badgeVariants as p } from "./badge.variants.js";
|
|
3
|
+
import { Trophy as f } from "./trophy-icon.js";
|
|
3
4
|
export {
|
|
4
5
|
e as Badge,
|
|
5
|
-
|
|
6
|
+
f as Trophy,
|
|
7
|
+
p as badgeVariants
|
|
6
8
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
export interface TrophyIconProps extends SVGProps<SVGSVGElement> {
|
|
3
|
+
size?: number | string;
|
|
4
|
+
}
|
|
5
|
+
/** Outline trophy used on rank badges. The icon set has a medal, not this cup. */
|
|
6
|
+
export declare const Trophy: import('react').ForwardRefExoticComponent<Omit<TrophyIconProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
const h = n(function({ size: C = 16, className: t, ...e }, i) {
|
|
4
|
+
const r = typeof C == "number" ? C : 16;
|
|
5
|
+
return /* @__PURE__ */ o(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
ref: i,
|
|
9
|
+
width: r,
|
|
10
|
+
height: r,
|
|
11
|
+
viewBox: "0 0 16 16",
|
|
12
|
+
fill: "none",
|
|
13
|
+
"aria-hidden": !0,
|
|
14
|
+
className: t,
|
|
15
|
+
...e,
|
|
16
|
+
children: /* @__PURE__ */ o(
|
|
17
|
+
"path",
|
|
18
|
+
{
|
|
19
|
+
d: "M7.33333 12.6667V10.6C6.78889 10.4778 6.30278 10.2472 5.875 9.90833C5.44722 9.56944 5.13333 9.14444 4.93333 8.63333C4.1 8.53333 3.40278 8.16944 2.84167 7.54167C2.28056 6.91389 2 6.17778 2 5.33333V4.66667C2 4.3 2.13056 3.98611 2.39167 3.725C2.65278 3.46389 2.96667 3.33333 3.33333 3.33333H4.66667C4.66667 2.96667 4.79722 2.65278 5.05833 2.39167C5.31944 2.13056 5.63333 2 6 2H10C10.3667 2 10.6806 2.13056 10.9417 2.39167C11.2028 2.65278 11.3333 2.96667 11.3333 3.33333H12.6667C13.0333 3.33333 13.3472 3.46389 13.6083 3.725C13.8694 3.98611 14 4.3 14 4.66667V5.33333C14 6.17778 13.7194 6.91389 13.1583 7.54167C12.5972 8.16944 11.9 8.53333 11.0667 8.63333C10.8667 9.14444 10.5528 9.56944 10.125 9.90833C9.69722 10.2472 9.21111 10.4778 8.66667 10.6V12.6667H10.6667C10.8556 12.6667 11.0139 12.7306 11.1417 12.8583C11.2694 12.9861 11.3333 13.1444 11.3333 13.3333C11.3333 13.5222 11.2694 13.6806 11.1417 13.8083C11.0139 13.9361 10.8556 14 10.6667 14H5.33333C5.14444 14 4.98611 13.9361 4.85833 13.8083C4.73056 13.6806 4.66667 13.5222 4.66667 13.3333C4.66667 13.1444 4.73056 12.9861 4.85833 12.8583C4.98611 12.7306 5.14444 12.6667 5.33333 12.6667H7.33333ZM4.66667 7.2V4.66667H3.33333V5.33333C3.33333 5.75556 3.45556 6.13611 3.7 6.475C3.94444 6.81389 4.26667 7.05556 4.66667 7.2ZM9.41667 8.75C9.80556 8.36111 10 7.88889 10 7.33333V3.33333H6V7.33333C6 7.88889 6.19444 8.36111 6.58333 8.75C6.97222 9.13889 7.44444 9.33333 8 9.33333C8.55556 9.33333 9.02778 9.13889 9.41667 8.75ZM11.3333 7.2C11.7333 7.05556 12.0556 6.81389 12.3 6.475C12.5444 6.13611 12.6667 5.75556 12.6667 5.33333V4.66667H11.3333V7.2Z",
|
|
20
|
+
fill: "currentColor"
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
h as Trophy
|
|
28
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Case-insensitive substring match. Empty or whitespace-only queries match nothing. */
|
|
2
|
+
export declare function collectFindMatches<TItem>(items: TItem[], query: string, getText: (item: TItem) => string): TItem[];
|
|
3
|
+
export interface FindTextOccurrence<TItem> {
|
|
4
|
+
item: TItem;
|
|
5
|
+
/** 0-based index of this needle hit within getText(item) (Chrome find steps per occurrence). */
|
|
6
|
+
occurrenceIndexInText: number;
|
|
7
|
+
}
|
|
8
|
+
/** Flat list of every substring hit in order — use for match count and active index. */
|
|
9
|
+
export declare function collectFindMatchOccurrences<TItem>(items: TItem[], query: string, getText: (item: TItem) => string): FindTextOccurrence<TItem>[];
|
|
10
|
+
/** Clamp a 0-based index into `[0, matchCount)`. Returns 0 when there are no matches. */
|
|
11
|
+
export declare function clampFindMatchIndex(activeIndex: number, matchCount: number): number;
|
|
12
|
+
/** 0-based wrap. Stale indexes are clamped before stepping. Returns 0 when there are no matches. */
|
|
13
|
+
export declare function stepFindMatchIndex(activeIndex: number, matchCount: number, direction: "next" | "previous"): number;
|
|
14
|
+
export interface FindCounterState {
|
|
15
|
+
visible: boolean;
|
|
16
|
+
currentDisplay: number;
|
|
17
|
+
matchCount: number;
|
|
18
|
+
status: string;
|
|
19
|
+
noMatch: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Chrome/Safari: hide count while empty; "No results" when the query misses. */
|
|
22
|
+
export declare function getFindCounterState(options: {
|
|
23
|
+
query: string;
|
|
24
|
+
activeIndex: number;
|
|
25
|
+
matchCount: number;
|
|
26
|
+
noResultsLabel?: string;
|
|
27
|
+
}): FindCounterState;
|
|
28
|
+
/** Map an index in `text.toLowerCase()` back onto `text` when casing changes length (e.g. İ). */
|
|
29
|
+
export declare function mapLowerIndexToOriginal(text: string, lowerIndex: number): number;
|
|
30
|
+
export interface FindHighlightPart {
|
|
31
|
+
value: string;
|
|
32
|
+
match: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Split `text` so hosts can mark the matched substring like find-in-page. */
|
|
35
|
+
export declare function splitFindHighlight(text: string, query: string): FindHighlightPart[];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
function m(e, t, n) {
|
|
2
|
+
const r = t.trim().toLowerCase();
|
|
3
|
+
return r ? e.filter((l) => n(l).toLowerCase().includes(r)) : [];
|
|
4
|
+
}
|
|
5
|
+
function g(e, t, n) {
|
|
6
|
+
const r = t.trim();
|
|
7
|
+
if (!r) return [];
|
|
8
|
+
const l = r.toLowerCase(), c = [];
|
|
9
|
+
for (const o of e) {
|
|
10
|
+
const i = n(o).toLowerCase();
|
|
11
|
+
let u = 0, f = 0, a = i.indexOf(l, u);
|
|
12
|
+
for (; a !== -1; )
|
|
13
|
+
c.push({ item: o, occurrenceIndexInText: f }), f += 1, u = a + l.length, a = i.indexOf(l, u);
|
|
14
|
+
}
|
|
15
|
+
return c;
|
|
16
|
+
}
|
|
17
|
+
function d(e, t) {
|
|
18
|
+
return t <= 0 || e < 0 ? 0 : e >= t ? t - 1 : e;
|
|
19
|
+
}
|
|
20
|
+
function w(e, t, n) {
|
|
21
|
+
return t <= 0 ? 0 : (d(e, t) + (n === "next" ? 1 : -1) + t) % t;
|
|
22
|
+
}
|
|
23
|
+
function C(e) {
|
|
24
|
+
const t = e.noResultsLabel ?? "No results";
|
|
25
|
+
if (!e.query.trim())
|
|
26
|
+
return { visible: !1, currentDisplay: 0, matchCount: 0, status: "", noMatch: !1 };
|
|
27
|
+
if (e.matchCount <= 0)
|
|
28
|
+
return { visible: !0, currentDisplay: 0, matchCount: 0, status: t, noMatch: !0 };
|
|
29
|
+
const n = d(e.activeIndex, e.matchCount) + 1;
|
|
30
|
+
return {
|
|
31
|
+
visible: !0,
|
|
32
|
+
currentDisplay: n,
|
|
33
|
+
matchCount: e.matchCount,
|
|
34
|
+
status: `${n} of ${e.matchCount}`,
|
|
35
|
+
noMatch: !1
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function h(e, t) {
|
|
39
|
+
if (t <= 0) return 0;
|
|
40
|
+
let n = 0, r = 0;
|
|
41
|
+
for (; r < e.length && n < t; ) {
|
|
42
|
+
const l = e.codePointAt(r);
|
|
43
|
+
if (l == null) break;
|
|
44
|
+
const c = String.fromCodePoint(l);
|
|
45
|
+
n += c.toLowerCase().length, r += c.length;
|
|
46
|
+
}
|
|
47
|
+
return r;
|
|
48
|
+
}
|
|
49
|
+
function L(e, t) {
|
|
50
|
+
const n = t.trim();
|
|
51
|
+
if (!n || !e) return [{ value: e, match: !1 }];
|
|
52
|
+
const r = e.toLowerCase(), l = n.toLowerCase(), c = [];
|
|
53
|
+
let o = 0, s = r.indexOf(l, o);
|
|
54
|
+
for (; s !== -1; ) {
|
|
55
|
+
const i = h(e, s), u = h(e, s + l.length);
|
|
56
|
+
i > o && c.push({ value: e.slice(o, i), match: !1 }), c.push({ value: e.slice(i, u), match: !0 }), o = u, s = r.indexOf(l, s + l.length);
|
|
57
|
+
}
|
|
58
|
+
return o < e.length && c.push({ value: e.slice(o), match: !1 }), c;
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
d as clampFindMatchIndex,
|
|
62
|
+
g as collectFindMatchOccurrences,
|
|
63
|
+
m as collectFindMatches,
|
|
64
|
+
C as getFindCounterState,
|
|
65
|
+
h as mapLowerIndexToOriginal,
|
|
66
|
+
L as splitFindHighlight,
|
|
67
|
+
w as stepFindMatchIndex
|
|
68
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function createFindBarShortcutId(): symbol;
|
|
2
|
+
export declare function registerFindBarShortcutCapture(id: symbol): () => void;
|
|
3
|
+
export declare function setFindBarShortcutFocus(id: symbol, focused: boolean): void;
|
|
4
|
+
/** Focused capturing bar wins; otherwise the most recently mounted capturing bar. */
|
|
5
|
+
export declare function isFindBarShortcutOwner(id: symbol): boolean;
|