impact-nova 2.1.0-alpha.4 → 2.1.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +136 -127
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +7 -0
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +6 -0
- package/dist/components/data/ag-grid-react/theme.js +8 -4
- 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/build-column-tree-from-grid.d.ts +14 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +95 -0
- package/dist/components/data/data-table/data-table-column-apply.d.ts +29 -0
- package/dist/components/data/data-table/data-table-column-apply.js +102 -0
- package/dist/components/data/data-table/data-table-column-def-pin.d.ts +25 -0
- package/dist/components/data/data-table/data-table-column-def-pin.js +66 -0
- package/dist/components/data/data-table/data-table-column-list-sync.d.ts +8 -0
- package/dist/components/data/data-table/data-table-column-list-sync.js +15 -0
- package/dist/components/data/data-table/data-table-column-list.d.ts +14 -4
- package/dist/components/data/data-table/data-table-column-list.js +74 -277
- 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 +4 -2
- 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 +138 -111
- 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/data-table/use-data-table-column-list-sync.d.ts +16 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +222 -0
- 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 +70 -57
- package/dist/components/feedback/popover/popover.js +1 -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 +18 -20
- package/dist/components/forms/select/components/SelectTrigger.d.ts +9 -6
- package/dist/components/forms/select/components/SelectTrigger.js +120 -122
- package/dist/components/forms/select/components/Submenu.js +8 -8
- package/dist/components/forms/select/hooks/useSelectKeyboardHandlers.d.ts +1 -1
- package/dist/components/forms/select/hooks/useSelectValueState.d.ts +19 -0
- package/dist/components/forms/select/hooks/useSelectValueState.js +41 -0
- package/dist/components/forms/select/index.js +4 -3
- package/dist/components/forms/select/select.js +180 -175
- package/dist/components/forms/select/select.types.d.ts +3 -2
- package/dist/components/forms/select/select.variants.js +4 -4
- package/dist/components/forms/select/utils/select.d.ts +2 -1
- package/dist/components/forms/select/utils/select.js +47 -37
- 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/impact-nova-components.css +113 -7
- package/dist/impact-nova-tokens.scss +2 -4
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +467 -433
- 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/ag-grid.js +1 -1
- 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,45 +1,45 @@
|
|
|
1
1
|
import { jsx as i, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as r from "@radix-ui/react-tooltip";
|
|
4
4
|
import { wrapRadixPart as c } from "../../../lib/primitives/create-compound.js";
|
|
5
5
|
import { cn as a } from "../../../lib/utils.js";
|
|
6
6
|
import { tooltipVariants as f } from "./tooltip.variants.js";
|
|
7
|
-
function
|
|
8
|
-
return t === "primary" ? "default" : t ?? "
|
|
7
|
+
function g(t) {
|
|
8
|
+
return t === "primary" ? "default" : t ?? "tertiary";
|
|
9
9
|
}
|
|
10
|
-
const x =
|
|
10
|
+
const x = r.Provider, N = (t) => /* @__PURE__ */ i(r.Root, { "data-component": "tooltip", ...t }), R = c(
|
|
11
11
|
"tooltip",
|
|
12
12
|
"trigger",
|
|
13
13
|
"TooltipTrigger",
|
|
14
|
-
|
|
15
|
-
),
|
|
14
|
+
r.Trigger
|
|
15
|
+
), u = s.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
className: t,
|
|
18
18
|
sideOffset: n = 4,
|
|
19
|
-
variant: l = "
|
|
20
|
-
showArrow:
|
|
19
|
+
variant: l = "tertiary",
|
|
20
|
+
showArrow: p = !0,
|
|
21
21
|
...e
|
|
22
|
-
},
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */ i(
|
|
25
|
-
|
|
22
|
+
}, d) => {
|
|
23
|
+
const o = g(l);
|
|
24
|
+
return /* @__PURE__ */ i(r.Portal, { children: /* @__PURE__ */ m(
|
|
25
|
+
r.Content,
|
|
26
26
|
{
|
|
27
|
-
ref:
|
|
27
|
+
ref: d,
|
|
28
28
|
sideOffset: n,
|
|
29
29
|
"data-component": "tooltip-content",
|
|
30
|
-
"data-variant":
|
|
31
|
-
className: a(f({ variant:
|
|
30
|
+
"data-variant": o,
|
|
31
|
+
className: a(f({ variant: o }), t),
|
|
32
32
|
...e,
|
|
33
33
|
children: [
|
|
34
34
|
e.children,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
p && /* @__PURE__ */ i(
|
|
36
|
+
r.Arrow,
|
|
37
37
|
{
|
|
38
38
|
className: a(
|
|
39
39
|
"fill-current",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
o === "default" && "fill-brand",
|
|
41
|
+
o === "secondary" && "fill-background stroke-border",
|
|
42
|
+
o === "tertiary" && "fill-foreground"
|
|
43
43
|
)
|
|
44
44
|
}
|
|
45
45
|
)
|
|
@@ -48,10 +48,10 @@ const x = o.Provider, N = (t) => /* @__PURE__ */ i(o.Root, { "data-component": "
|
|
|
48
48
|
) });
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
|
-
|
|
51
|
+
u.displayName = r.Content.displayName;
|
|
52
52
|
export {
|
|
53
53
|
N as Tooltip,
|
|
54
|
-
|
|
54
|
+
u as TooltipContent,
|
|
55
55
|
x as TooltipProvider,
|
|
56
56
|
R as TooltipTrigger
|
|
57
57
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
3
|
import * as P from "@radix-ui/react-dialog";
|
|
4
4
|
import { Search as _ } from "impact-nova-icons";
|
|
5
5
|
import { cn as l } from "../../../lib/utils.js";
|
|
@@ -7,12 +7,12 @@ import { useCommandPalette as ie } from "./use-command-palette.js";
|
|
|
7
7
|
import { Kbd as v } from "../../primitives/kbd/kbd.js";
|
|
8
8
|
import { keybindingToSymbols as de } from "../../primitives/kbd/keybinding-display.js";
|
|
9
9
|
import { buildCommandPaletteLayout as le } from "./command-palette-layout.js";
|
|
10
|
-
import { COMMAND_SOURCE_LABELS as
|
|
10
|
+
import { COMMAND_SOURCE_LABELS as ce, fuzzyFilter as me } from "./utils.js";
|
|
11
11
|
const ue = /* @__PURE__ */ new Set(["browser", "system", "ag-grid"]);
|
|
12
|
-
function
|
|
12
|
+
function fe(o) {
|
|
13
13
|
return !!o && ue.has(o);
|
|
14
14
|
}
|
|
15
|
-
const R =
|
|
15
|
+
const R = n.createContext({
|
|
16
16
|
query: "",
|
|
17
17
|
setQuery: () => {
|
|
18
18
|
},
|
|
@@ -23,14 +23,14 @@ const R = a.createContext({
|
|
|
23
23
|
onExecute: () => {
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
function
|
|
26
|
+
function pe({
|
|
27
27
|
className: o,
|
|
28
|
-
children:
|
|
28
|
+
children: a,
|
|
29
29
|
commands: r,
|
|
30
30
|
placeholder: i = "Type a command or search...",
|
|
31
|
-
emptyTitle:
|
|
32
|
-
emptyDescription:
|
|
33
|
-
recentGroupLabel:
|
|
31
|
+
emptyTitle: m = "No results found",
|
|
32
|
+
emptyDescription: f = "Try a different search term",
|
|
33
|
+
recentGroupLabel: p = "Recently Used",
|
|
34
34
|
defaultGroupLabel: d = "Commands",
|
|
35
35
|
navigateLabel: z = "Navigate",
|
|
36
36
|
runLabel: M = "Run",
|
|
@@ -45,11 +45,11 @@ function fe({
|
|
|
45
45
|
getPaletteCommands: Z,
|
|
46
46
|
getEffectiveKeybinding: G,
|
|
47
47
|
registry: k
|
|
48
|
-
} = ie(), [y, j] =
|
|
48
|
+
} = ie(), [y, j] = n.useState(""), [N, g] = n.useState(0), q = n.useRef(null), T = n.useRef(null), K = n.useMemo(() => (r ?? Z()).filter((s) => {
|
|
49
49
|
const u = s.source ?? "user";
|
|
50
50
|
return u === "user" || u === "ag-grid";
|
|
51
|
-
}), [r, E]), Q =
|
|
52
|
-
const t =
|
|
51
|
+
}), [r, E]), Q = n.useMemo(() => {
|
|
52
|
+
const t = me(
|
|
53
53
|
K,
|
|
54
54
|
y,
|
|
55
55
|
(s) => `${s.category ? s.category + ": " : ""}${s.label}${s.description ? " " + s.description : ""}`
|
|
@@ -63,38 +63,38 @@ function fe({
|
|
|
63
63
|
), [...x, ...C];
|
|
64
64
|
}
|
|
65
65
|
return t;
|
|
66
|
-
}, [K, y, k]), U =
|
|
66
|
+
}, [K, y, k]), U = n.useMemo(
|
|
67
67
|
() => Q.map((t) => t.item),
|
|
68
68
|
[Q]
|
|
69
|
-
), ee =
|
|
69
|
+
), ee = n.useMemo(
|
|
70
70
|
() => le({
|
|
71
71
|
filteredCommands: U,
|
|
72
72
|
emptyQuery: !y.trim(),
|
|
73
73
|
recentCommandIds: k.getRecentCommandIds(),
|
|
74
|
-
recentGroupLabel:
|
|
74
|
+
recentGroupLabel: p,
|
|
75
75
|
defaultGroupLabel: d
|
|
76
76
|
}),
|
|
77
|
-
[U, y, k,
|
|
78
|
-
), { groups: te, orderedCommands: b } = ee, S =
|
|
77
|
+
[U, y, k, p, d]
|
|
78
|
+
), { groups: te, orderedCommands: b } = ee, S = n.useRef({
|
|
79
79
|
ordered: b,
|
|
80
80
|
index: N
|
|
81
81
|
});
|
|
82
|
-
S.current = { ordered: b, index: N },
|
|
82
|
+
S.current = { ordered: b, index: N }, n.useEffect(() => {
|
|
83
83
|
E && (j(""), g(0), requestAnimationFrame(() => {
|
|
84
84
|
q.current?.focus();
|
|
85
85
|
}));
|
|
86
86
|
}, [E]);
|
|
87
|
-
const I =
|
|
87
|
+
const I = n.useCallback(
|
|
88
88
|
(t) => {
|
|
89
89
|
F(t), A?.(t);
|
|
90
90
|
},
|
|
91
91
|
[A, F]
|
|
92
|
-
), w =
|
|
92
|
+
), w = n.useCallback(
|
|
93
93
|
(t) => {
|
|
94
94
|
t.handler(), k.addRecentCommand(t.id), $?.(t), I(!1);
|
|
95
95
|
},
|
|
96
96
|
[k, $, I]
|
|
97
|
-
),
|
|
97
|
+
), ae = n.useCallback(
|
|
98
98
|
(t) => {
|
|
99
99
|
const { ordered: s } = S.current, u = Math.max(s.length - 1, 0);
|
|
100
100
|
switch (t.key) {
|
|
@@ -124,12 +124,12 @@ function fe({
|
|
|
124
124
|
},
|
|
125
125
|
[w]
|
|
126
126
|
);
|
|
127
|
-
|
|
127
|
+
n.useEffect(() => {
|
|
128
128
|
g(0);
|
|
129
|
-
}, [y]),
|
|
129
|
+
}, [y]), n.useEffect(() => {
|
|
130
130
|
const t = b.length;
|
|
131
131
|
g((s) => t === 0 ? 0 : Math.min(s, t - 1));
|
|
132
|
-
}, [b.length]),
|
|
132
|
+
}, [b.length]), n.useLayoutEffect(() => {
|
|
133
133
|
const t = T.current;
|
|
134
134
|
if (!t) return;
|
|
135
135
|
const s = t.querySelector(
|
|
@@ -141,7 +141,7 @@ function fe({
|
|
|
141
141
|
behavior: "auto"
|
|
142
142
|
});
|
|
143
143
|
}, [N]);
|
|
144
|
-
const
|
|
144
|
+
const ne = n.useMemo(
|
|
145
145
|
() => ({
|
|
146
146
|
query: y,
|
|
147
147
|
setQuery: j,
|
|
@@ -150,9 +150,9 @@ function fe({
|
|
|
150
150
|
orderedCommands: b,
|
|
151
151
|
onExecute: w,
|
|
152
152
|
placeholder: i,
|
|
153
|
-
emptyTitle:
|
|
154
|
-
emptyDescription:
|
|
155
|
-
recentGroupLabel:
|
|
153
|
+
emptyTitle: m,
|
|
154
|
+
emptyDescription: f,
|
|
155
|
+
recentGroupLabel: p,
|
|
156
156
|
defaultGroupLabel: d,
|
|
157
157
|
navigateLabel: z,
|
|
158
158
|
runLabel: M,
|
|
@@ -165,25 +165,25 @@ function fe({
|
|
|
165
165
|
b,
|
|
166
166
|
w,
|
|
167
167
|
i,
|
|
168
|
-
|
|
169
|
-
p,
|
|
168
|
+
m,
|
|
170
169
|
f,
|
|
170
|
+
p,
|
|
171
171
|
d,
|
|
172
172
|
z,
|
|
173
173
|
M,
|
|
174
174
|
D,
|
|
175
175
|
O
|
|
176
176
|
]
|
|
177
|
-
), re =
|
|
178
|
-
return /* @__PURE__ */ e(P.Root, { open: E, onOpenChange: I, children: /* @__PURE__ */
|
|
177
|
+
), re = n.Children.count(a) > 0;
|
|
178
|
+
return /* @__PURE__ */ e(P.Root, { open: E, onOpenChange: I, children: /* @__PURE__ */ c(P.Portal, { children: [
|
|
179
179
|
/* @__PURE__ */ e(P.Overlay, { className: "fixed inset-0 z-50 bg-scrim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:animate-none motion-reduce:transition-none" }),
|
|
180
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ c(
|
|
181
181
|
P.Content,
|
|
182
182
|
{
|
|
183
183
|
"aria-describedby": void 0,
|
|
184
184
|
"data-command-palette": !0,
|
|
185
185
|
"data-component": "command-palette",
|
|
186
|
-
onKeyDown:
|
|
186
|
+
onKeyDown: ae,
|
|
187
187
|
className: l(
|
|
188
188
|
"fixed left-[50%] top-[20%] z-50 w-full max-w-[640px] -translate-x-1/2",
|
|
189
189
|
"rounded-xl border border-stroke-hairline bg-canvas-elevated shadow-2xl overflow-hidden",
|
|
@@ -199,10 +199,10 @@ function fe({
|
|
|
199
199
|
style: { transformOrigin: "top center" },
|
|
200
200
|
children: [
|
|
201
201
|
/* @__PURE__ */ e(P.Title, { className: "sr-only", children: "Command Palette" }),
|
|
202
|
-
/* @__PURE__ */ e(R.Provider, { value:
|
|
202
|
+
/* @__PURE__ */ e(R.Provider, { value: ne, children: re ? a : /* @__PURE__ */ c(se, { children: [
|
|
203
203
|
/* @__PURE__ */ e(B, { ref: q, placeholder: i }),
|
|
204
|
-
/* @__PURE__ */ e(H, { ref: T, children: b.length === 0 ? /* @__PURE__ */ e(J, {}) : te.map((t, s) => /* @__PURE__ */
|
|
205
|
-
|
|
204
|
+
/* @__PURE__ */ e(H, { ref: T, children: b.length === 0 ? /* @__PURE__ */ e(J, {}) : te.map((t, s) => /* @__PURE__ */ c(
|
|
205
|
+
n.Fragment,
|
|
206
206
|
{
|
|
207
207
|
children: [
|
|
208
208
|
s > 0 && /* @__PURE__ */ e(W, {}),
|
|
@@ -231,10 +231,10 @@ function fe({
|
|
|
231
231
|
)
|
|
232
232
|
] }) });
|
|
233
233
|
}
|
|
234
|
-
|
|
235
|
-
const B =
|
|
236
|
-
const { query:
|
|
237
|
-
return /* @__PURE__ */
|
|
234
|
+
pe.displayName = "CommandPalette";
|
|
235
|
+
const B = n.forwardRef(({ className: o, placeholder: a, onValueChange: r, ...i }, m) => {
|
|
236
|
+
const { query: f, setQuery: p } = n.useContext(R);
|
|
237
|
+
return /* @__PURE__ */ c(
|
|
238
238
|
"div",
|
|
239
239
|
{
|
|
240
240
|
className: l(
|
|
@@ -243,22 +243,22 @@ const B = a.forwardRef(({ className: o, placeholder: n, onValueChange: r, ...i }
|
|
|
243
243
|
),
|
|
244
244
|
"data-command-palette-input": !0,
|
|
245
245
|
children: [
|
|
246
|
-
/* @__PURE__ */ e(_, { className: "h-4 w-4 shrink-0 text-content-
|
|
246
|
+
/* @__PURE__ */ e(_, { className: "h-4 w-4 shrink-0 text-content-icon" }),
|
|
247
247
|
/* @__PURE__ */ e(
|
|
248
248
|
"input",
|
|
249
249
|
{
|
|
250
|
-
ref:
|
|
251
|
-
value:
|
|
250
|
+
ref: m,
|
|
251
|
+
value: f,
|
|
252
252
|
onChange: (d) => {
|
|
253
|
-
|
|
253
|
+
p(d.target.value), r?.(d.target.value);
|
|
254
254
|
},
|
|
255
|
-
placeholder:
|
|
255
|
+
placeholder: a,
|
|
256
256
|
autoComplete: "off",
|
|
257
257
|
autoCorrect: "off",
|
|
258
258
|
spellCheck: !1,
|
|
259
259
|
className: l(
|
|
260
260
|
"flex h-12 w-full bg-transparent py-3 text-sm font-medium outline-none",
|
|
261
|
-
"placeholder:text-content-
|
|
261
|
+
"placeholder:text-content-placeholder"
|
|
262
262
|
),
|
|
263
263
|
...i
|
|
264
264
|
}
|
|
@@ -277,7 +277,7 @@ const B = a.forwardRef(({ className: o, placeholder: n, onValueChange: r, ...i }
|
|
|
277
277
|
);
|
|
278
278
|
});
|
|
279
279
|
B.displayName = "CommandPaletteInput";
|
|
280
|
-
const H =
|
|
280
|
+
const H = n.forwardRef(({ className: o, children: a, ...r }, i) => /* @__PURE__ */ e(
|
|
281
281
|
"div",
|
|
282
282
|
{
|
|
283
283
|
ref: i,
|
|
@@ -288,21 +288,21 @@ const H = a.forwardRef(({ className: o, children: n, ...r }, i) => /* @__PURE__
|
|
|
288
288
|
o
|
|
289
289
|
),
|
|
290
290
|
...r,
|
|
291
|
-
children:
|
|
291
|
+
children: a
|
|
292
292
|
}
|
|
293
293
|
));
|
|
294
294
|
H.displayName = "CommandPaletteList";
|
|
295
|
-
const L =
|
|
295
|
+
const L = n.forwardRef(({ className: o, heading: a, children: r, ...i }, m) => /* @__PURE__ */ c(
|
|
296
296
|
"div",
|
|
297
297
|
{
|
|
298
|
-
ref:
|
|
298
|
+
ref: m,
|
|
299
299
|
role: "group",
|
|
300
|
-
"aria-label":
|
|
300
|
+
"aria-label": a,
|
|
301
301
|
"data-command-palette-group": !0,
|
|
302
302
|
className: l("py-1", o),
|
|
303
303
|
...i,
|
|
304
304
|
children: [
|
|
305
|
-
|
|
305
|
+
a && /* @__PURE__ */ e("div", { className: "px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-secondary-foreground", children: a }),
|
|
306
306
|
r
|
|
307
307
|
]
|
|
308
308
|
}
|
|
@@ -310,55 +310,55 @@ const L = a.forwardRef(({ className: o, heading: n, children: r, ...i }, c) => /
|
|
|
310
310
|
L.displayName = "CommandPaletteGroup";
|
|
311
311
|
function xe({
|
|
312
312
|
source: o,
|
|
313
|
-
isSelected:
|
|
313
|
+
isSelected: a
|
|
314
314
|
}) {
|
|
315
315
|
if (!o || o === "user") return null;
|
|
316
|
-
const r =
|
|
316
|
+
const r = ce[o];
|
|
317
317
|
return r ? /* @__PURE__ */ e(
|
|
318
318
|
"span",
|
|
319
319
|
{
|
|
320
320
|
className: l(
|
|
321
321
|
"shrink-0 rounded px-1.5 py-px text-[9px] font-medium leading-tight tracking-wide",
|
|
322
|
-
|
|
322
|
+
a ? "text-brand-foreground/50" : "text-secondary-foreground border border-stroke-hairline"
|
|
323
323
|
),
|
|
324
324
|
children: r
|
|
325
325
|
}
|
|
326
326
|
) : null;
|
|
327
327
|
}
|
|
328
|
-
const V =
|
|
329
|
-
|
|
330
|
-
({ className: o, command:
|
|
331
|
-
const d =
|
|
332
|
-
return /* @__PURE__ */
|
|
328
|
+
const V = n.memo(
|
|
329
|
+
n.forwardRef(
|
|
330
|
+
({ className: o, command: a, isSelected: r, onSelect: i, keybinding: m, ...f }, p) => {
|
|
331
|
+
const d = fe(a.source);
|
|
332
|
+
return /* @__PURE__ */ c(
|
|
333
333
|
"div",
|
|
334
334
|
{
|
|
335
|
-
ref:
|
|
335
|
+
ref: p,
|
|
336
336
|
role: "option",
|
|
337
337
|
"aria-selected": r,
|
|
338
338
|
"data-selected": r,
|
|
339
339
|
"data-command-palette-item": !0,
|
|
340
|
-
"data-command-id":
|
|
340
|
+
"data-command-id": a.id,
|
|
341
341
|
onClick: i,
|
|
342
342
|
className: l(
|
|
343
343
|
"flex items-center gap-3 cursor-pointer px-4 py-2 text-sm",
|
|
344
344
|
// Smooth selection shift; scroll-margin keeps row clear of list edges when scrolling into view
|
|
345
345
|
"transition-[color,background-color] duration-150 ease-out [scroll-margin-block:6px]",
|
|
346
|
-
r ? "bg-brand text-brand-foreground" : d ? "text-
|
|
346
|
+
r ? "bg-brand text-brand-foreground" : d ? "text-secondary-foreground hover:bg-canvas-muted" : "text-content-charcoal hover:bg-canvas-muted",
|
|
347
347
|
o
|
|
348
348
|
),
|
|
349
|
-
...
|
|
349
|
+
...f,
|
|
350
350
|
children: [
|
|
351
|
-
|
|
351
|
+
a.icon && /* @__PURE__ */ e(
|
|
352
352
|
"span",
|
|
353
353
|
{
|
|
354
354
|
className: l(
|
|
355
355
|
"flex h-4 w-4 shrink-0 items-center justify-center",
|
|
356
|
-
r ? "text-brand-foreground" : d ? "text-stroke-hairline" : "text-
|
|
356
|
+
r ? "text-brand-foreground" : d ? "text-stroke-hairline" : "text-secondary-foreground"
|
|
357
357
|
),
|
|
358
|
-
children:
|
|
358
|
+
children: a.icon
|
|
359
359
|
}
|
|
360
360
|
),
|
|
361
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ c("div", { className: "flex flex-1 flex-col min-w-0", children: [
|
|
362
362
|
/* @__PURE__ */ e(
|
|
363
363
|
"span",
|
|
364
364
|
{
|
|
@@ -366,25 +366,25 @@ const V = a.memo(
|
|
|
366
366
|
"truncate",
|
|
367
367
|
d && !r ? "font-normal" : "font-medium"
|
|
368
368
|
),
|
|
369
|
-
children:
|
|
369
|
+
children: a.label
|
|
370
370
|
}
|
|
371
371
|
),
|
|
372
|
-
|
|
372
|
+
a.description && /* @__PURE__ */ e(
|
|
373
373
|
"span",
|
|
374
374
|
{
|
|
375
375
|
className: l(
|
|
376
376
|
"truncate text-xs",
|
|
377
|
-
r ? "text-brand-foreground/70" : d ? "text-stroke-hairline" : "text-
|
|
377
|
+
r ? "text-brand-foreground/70" : d ? "text-stroke-hairline" : "text-secondary-foreground"
|
|
378
378
|
),
|
|
379
|
-
children:
|
|
379
|
+
children: a.description
|
|
380
380
|
}
|
|
381
381
|
)
|
|
382
382
|
] }),
|
|
383
|
-
/* @__PURE__ */ e(xe, { source:
|
|
384
|
-
|
|
383
|
+
/* @__PURE__ */ e(xe, { source: a.source, isSelected: r }),
|
|
384
|
+
m && /* @__PURE__ */ e(
|
|
385
385
|
X,
|
|
386
386
|
{
|
|
387
|
-
keybinding:
|
|
387
|
+
keybinding: m,
|
|
388
388
|
isSelected: r,
|
|
389
389
|
external: d
|
|
390
390
|
}
|
|
@@ -398,29 +398,29 @@ const V = a.memo(
|
|
|
398
398
|
V.displayName = "CommandPaletteItem";
|
|
399
399
|
function X({
|
|
400
400
|
keybinding: o,
|
|
401
|
-
isSelected:
|
|
401
|
+
isSelected: a,
|
|
402
402
|
external: r,
|
|
403
403
|
className: i,
|
|
404
|
-
...
|
|
404
|
+
...m
|
|
405
405
|
}) {
|
|
406
|
-
const
|
|
406
|
+
const f = de(o);
|
|
407
407
|
return /* @__PURE__ */ e(
|
|
408
408
|
"span",
|
|
409
409
|
{
|
|
410
410
|
className: l("ms-auto flex items-center gap-0.5 shrink-0", i),
|
|
411
411
|
"data-command-palette-shortcut": !0,
|
|
412
|
-
...
|
|
413
|
-
children:
|
|
412
|
+
...m,
|
|
413
|
+
children: f.map((p, d) => /* @__PURE__ */ e(
|
|
414
414
|
"kbd",
|
|
415
415
|
{
|
|
416
416
|
className: l(
|
|
417
417
|
"inline-flex min-w-[20px] items-center justify-center rounded px-1 h-[20px] text-[10px] font-mono leading-none",
|
|
418
418
|
"transition-[color,background-color,border-color] duration-150 ease-out",
|
|
419
|
-
|
|
419
|
+
a ? "bg-canvas-elevated/20 text-brand-foreground border border-brand-foreground/30" : r ? "bg-canvas-muted text-stroke-hairline border border-stroke-hairline" : "bg-canvas-muted text-secondary-foreground border border-stroke-hairline"
|
|
420
420
|
),
|
|
421
|
-
children:
|
|
421
|
+
children: p
|
|
422
422
|
},
|
|
423
|
-
`${
|
|
423
|
+
`${p}-${d}`
|
|
424
424
|
))
|
|
425
425
|
}
|
|
426
426
|
);
|
|
@@ -428,18 +428,18 @@ function X({
|
|
|
428
428
|
X.displayName = "CommandPaletteShortcut";
|
|
429
429
|
function J({
|
|
430
430
|
className: o,
|
|
431
|
-
...
|
|
431
|
+
...a
|
|
432
432
|
}) {
|
|
433
|
-
const { emptyTitle: r, emptyDescription: i } =
|
|
434
|
-
return /* @__PURE__ */
|
|
433
|
+
const { emptyTitle: r, emptyDescription: i } = n.useContext(R);
|
|
434
|
+
return /* @__PURE__ */ c(
|
|
435
435
|
"div",
|
|
436
436
|
{
|
|
437
437
|
"data-command-palette-empty": !0,
|
|
438
438
|
className: l(
|
|
439
|
-
"flex flex-col items-center justify-center py-12 text-center text-sm text-
|
|
439
|
+
"flex flex-col items-center justify-center py-12 text-center text-sm text-secondary-foreground",
|
|
440
440
|
o
|
|
441
441
|
),
|
|
442
|
-
...
|
|
442
|
+
...a,
|
|
443
443
|
children: [
|
|
444
444
|
/* @__PURE__ */ e(_, { className: "h-8 w-8 mb-3 text-stroke-hairline" }),
|
|
445
445
|
/* @__PURE__ */ e("p", { className: "font-medium", children: r }),
|
|
@@ -451,49 +451,49 @@ function J({
|
|
|
451
451
|
J.displayName = "CommandPaletteEmpty";
|
|
452
452
|
function W({
|
|
453
453
|
className: o,
|
|
454
|
-
...
|
|
454
|
+
...a
|
|
455
455
|
}) {
|
|
456
456
|
return /* @__PURE__ */ e(
|
|
457
457
|
"div",
|
|
458
458
|
{
|
|
459
459
|
"data-command-palette-separator": !0,
|
|
460
460
|
className: l("h-px bg-stroke-hairline mx-2", o),
|
|
461
|
-
...
|
|
461
|
+
...a
|
|
462
462
|
}
|
|
463
463
|
);
|
|
464
464
|
}
|
|
465
465
|
W.displayName = "CommandPaletteSeparator";
|
|
466
466
|
function Y({
|
|
467
467
|
className: o,
|
|
468
|
-
...
|
|
468
|
+
...a
|
|
469
469
|
}) {
|
|
470
|
-
const { navigateLabel: r, runLabel: i, closeLabel:
|
|
471
|
-
return /* @__PURE__ */
|
|
470
|
+
const { navigateLabel: r, runLabel: i, closeLabel: m, configureShortcutsLabel: f } = n.useContext(R);
|
|
471
|
+
return /* @__PURE__ */ c(
|
|
472
472
|
"div",
|
|
473
473
|
{
|
|
474
474
|
"data-command-palette-footer": !0,
|
|
475
475
|
className: l(
|
|
476
|
-
"flex items-center gap-4 border-t border-stroke-hairline px-4 py-2 text-[11px] text-
|
|
476
|
+
"flex items-center gap-4 border-t border-stroke-hairline px-4 py-2 text-[11px] text-secondary-foreground",
|
|
477
477
|
o
|
|
478
478
|
),
|
|
479
|
-
...
|
|
479
|
+
...a,
|
|
480
480
|
children: [
|
|
481
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ c("span", { className: "inline-flex items-center gap-1", children: [
|
|
482
482
|
/* @__PURE__ */ e(v, { keys: ["↑"], size: "sm", variant: "muted" }),
|
|
483
483
|
/* @__PURE__ */ e(v, { keys: ["↓"], size: "sm", variant: "muted" }),
|
|
484
484
|
/* @__PURE__ */ e("span", { children: r })
|
|
485
485
|
] }),
|
|
486
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ c("span", { className: "inline-flex items-center gap-1", children: [
|
|
487
487
|
/* @__PURE__ */ e(v, { keys: ["↵"], size: "sm", variant: "muted" }),
|
|
488
488
|
/* @__PURE__ */ e("span", { children: i })
|
|
489
489
|
] }),
|
|
490
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ c("span", { className: "inline-flex items-center gap-1", children: [
|
|
491
491
|
/* @__PURE__ */ e(v, { keys: ["Escape"], size: "sm", variant: "muted" }),
|
|
492
|
-
/* @__PURE__ */ e("span", { children:
|
|
492
|
+
/* @__PURE__ */ e("span", { children: m })
|
|
493
493
|
] }),
|
|
494
|
-
|
|
494
|
+
f && /* @__PURE__ */ c("span", { className: "ms-auto inline-flex items-center gap-1", children: [
|
|
495
495
|
/* @__PURE__ */ e(v, { keybinding: { key: "k", alt: !0 }, size: "sm", variant: "muted" }),
|
|
496
|
-
/* @__PURE__ */ e("span", { children:
|
|
496
|
+
/* @__PURE__ */ e("span", { children: f })
|
|
497
497
|
] })
|
|
498
498
|
]
|
|
499
499
|
}
|
|
@@ -501,7 +501,7 @@ function Y({
|
|
|
501
501
|
}
|
|
502
502
|
Y.displayName = "CommandPaletteFooter";
|
|
503
503
|
export {
|
|
504
|
-
|
|
504
|
+
pe as CommandPalette,
|
|
505
505
|
J as CommandPaletteEmpty,
|
|
506
506
|
Y as CommandPaletteFooter,
|
|
507
507
|
L as CommandPaletteGroup,
|