@dust-tt/sparkle 0.2.449-pr → 0.2.449-rc-samuel
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/cjs/index.js +1 -1
- package/dist/esm/components/AppCommandPalette.d.ts +11 -0
- package/dist/esm/components/AppCommandPalette.d.ts.map +1 -0
- package/dist/esm/components/AppCommandPalette.js +44 -0
- package/dist/esm/components/AppCommandPalette.js.map +1 -0
- package/dist/esm/components/CommandPalette.d.ts +3 -0
- package/dist/esm/components/CommandPalette.d.ts.map +1 -0
- package/dist/esm/components/CommandPalette.js +61 -0
- package/dist/esm/components/CommandPalette.js.map +1 -0
- package/dist/esm/components/Input.d.ts +1 -0
- package/dist/esm/components/Input.d.ts.map +1 -1
- package/dist/esm/components/Input.js +2 -2
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/Resizable.d.ts +1 -1
- package/dist/esm/components/SamsCommandPalette.d.ts +81 -0
- package/dist/esm/components/SamsCommandPalette.d.ts.map +1 -0
- package/dist/esm/components/SamsCommandPalette.js +56 -0
- package/dist/esm/components/SamsCommandPalette.js.map +1 -0
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/markdown/List.d.ts.map +1 -1
- package/dist/esm/components/markdown/List.js +3 -7
- package/dist/esm/components/markdown/List.js.map +1 -1
- package/dist/esm/contexts/CommandPaletteContext.d.ts +28 -0
- package/dist/esm/contexts/CommandPaletteContext.d.ts.map +1 -0
- package/dist/esm/contexts/CommandPaletteContext.js +83 -0
- package/dist/esm/contexts/CommandPaletteContext.js.map +1 -0
- package/dist/esm/hooks/useCommandPalette.d.ts +27 -0
- package/dist/esm/hooks/useCommandPalette.d.ts.map +1 -0
- package/dist/esm/hooks/useCommandPalette.js +62 -0
- package/dist/esm/hooks/useCommandPalette.js.map +1 -0
- package/dist/esm/stories/SamsCommandPalette.stories.d.ts +25 -0
- package/dist/esm/stories/SamsCommandPalette.stories.d.ts.map +1 -0
- package/dist/esm/stories/SamsCommandPalette.stories.js +100 -0
- package/dist/esm/stories/SamsCommandPalette.stories.js.map +1 -0
- package/dist/sparkle.css +126 -0
- package/package.json +2 -1
- package/src/components/AppCommandPalette.tsx +58 -0
- package/src/components/CommandPalette.tsx +112 -0
- package/src/components/Input.tsx +8 -1
- package/src/components/SamsCommandPalette.tsx +166 -0
- package/src/components/index.ts +1 -0
- package/src/components/markdown/List.tsx +3 -7
- package/src/contexts/CommandPaletteContext.tsx +135 -0
- package/src/hooks/useCommandPalette.tsx +87 -0
- package/src/stories/SamsCommandPalette.stories.tsx +133 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Command } from "../contexts/CommandPaletteContext";
|
|
2
|
+
interface UseCommandPaletteProps {
|
|
3
|
+
commands?: Command[];
|
|
4
|
+
entityType?: string;
|
|
5
|
+
entityId?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Hook for interacting with the command palette
|
|
9
|
+
*
|
|
10
|
+
* Optionally register commands when the component mounts and
|
|
11
|
+
* automatically unregister them when the component unmounts.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useCommandPalette: (props?: UseCommandPaletteProps) => {
|
|
14
|
+
commands: Command[];
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
registerCommand: (command: Command) => void;
|
|
17
|
+
registerCommands: (commands: Command[]) => void;
|
|
18
|
+
unregisterCommand: (commandId: string) => void;
|
|
19
|
+
unregisterCommandsByEntityType: (entityType: string) => void;
|
|
20
|
+
unregisterCommandsByEntityId: (entityId: string) => void;
|
|
21
|
+
openCommandPalette: () => void;
|
|
22
|
+
closeCommandPalette: () => void;
|
|
23
|
+
toggleCommandPalette: () => void;
|
|
24
|
+
setOpen: (isOpen: boolean) => void;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=useCommandPalette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCommandPalette.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCommandPalette.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,OAAO,EAER,MAAM,mCAAmC,CAAC;AAE3C,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,WAAY,sBAAsB;;;;;;;;;;;;CAiE/D,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { useCommandPaletteContext, } from "../contexts/CommandPaletteContext";
|
|
4
|
+
/**
|
|
5
|
+
* Hook for interacting with the command palette
|
|
6
|
+
*
|
|
7
|
+
* Optionally register commands when the component mounts and
|
|
8
|
+
* automatically unregister them when the component unmounts.
|
|
9
|
+
*/
|
|
10
|
+
export var useCommandPalette = function (props) {
|
|
11
|
+
var _a = useCommandPaletteContext(), allCommands = _a.commands, isOpen = _a.isOpen, registerCommand = _a.registerCommand, registerCommands = _a.registerCommands, unregisterCommand = _a.unregisterCommand, unregisterCommandsByEntityType = _a.unregisterCommandsByEntityType, unregisterCommandsByEntityId = _a.unregisterCommandsByEntityId, setOpen = _a.setOpen;
|
|
12
|
+
// Register commands on mount, unregister on unmount
|
|
13
|
+
useEffect(function () {
|
|
14
|
+
var _a;
|
|
15
|
+
if ((_a = props === null || props === void 0 ? void 0 : props.commands) === null || _a === void 0 ? void 0 : _a.length) {
|
|
16
|
+
registerCommands(props.commands);
|
|
17
|
+
}
|
|
18
|
+
return function () {
|
|
19
|
+
// Clean up commands when component unmounts
|
|
20
|
+
if (props === null || props === void 0 ? void 0 : props.entityType) {
|
|
21
|
+
unregisterCommandsByEntityType(props.entityType);
|
|
22
|
+
}
|
|
23
|
+
if (props === null || props === void 0 ? void 0 : props.entityId) {
|
|
24
|
+
unregisterCommandsByEntityId(props.entityId);
|
|
25
|
+
}
|
|
26
|
+
if (props === null || props === void 0 ? void 0 : props.commands) {
|
|
27
|
+
props.commands.forEach(function (command) {
|
|
28
|
+
unregisterCommand(command.id);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}, [
|
|
33
|
+
props === null || props === void 0 ? void 0 : props.commands,
|
|
34
|
+
props === null || props === void 0 ? void 0 : props.entityType,
|
|
35
|
+
props === null || props === void 0 ? void 0 : props.entityId,
|
|
36
|
+
registerCommands,
|
|
37
|
+
unregisterCommand,
|
|
38
|
+
unregisterCommandsByEntityType,
|
|
39
|
+
unregisterCommandsByEntityId,
|
|
40
|
+
]);
|
|
41
|
+
// Utility functions
|
|
42
|
+
var openCommandPalette = function () { return setOpen(true); };
|
|
43
|
+
var closeCommandPalette = function () { return setOpen(false); };
|
|
44
|
+
var toggleCommandPalette = function () { return setOpen(!isOpen); };
|
|
45
|
+
return {
|
|
46
|
+
// State
|
|
47
|
+
commands: allCommands,
|
|
48
|
+
isOpen: isOpen,
|
|
49
|
+
// Register/unregister methods
|
|
50
|
+
registerCommand: registerCommand,
|
|
51
|
+
registerCommands: registerCommands,
|
|
52
|
+
unregisterCommand: unregisterCommand,
|
|
53
|
+
unregisterCommandsByEntityType: unregisterCommandsByEntityType,
|
|
54
|
+
unregisterCommandsByEntityId: unregisterCommandsByEntityId,
|
|
55
|
+
// Open/close controls
|
|
56
|
+
openCommandPalette: openCommandPalette,
|
|
57
|
+
closeCommandPalette: closeCommandPalette,
|
|
58
|
+
toggleCommandPalette: toggleCommandPalette,
|
|
59
|
+
setOpen: setOpen,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=useCommandPalette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCommandPalette.js","sourceRoot":"","sources":["../../../src/hooks/useCommandPalette.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAEL,wBAAwB,GACzB,MAAM,mCAAmC,CAAC;AAQ3C;;;;;GAKG;AACH,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAC,KAA8B;IACxD,IAAA,KASF,wBAAwB,EAAE,EARlB,WAAW,cAAA,EACrB,MAAM,YAAA,EACN,eAAe,qBAAA,EACf,gBAAgB,sBAAA,EAChB,iBAAiB,uBAAA,EACjB,8BAA8B,oCAAA,EAC9B,4BAA4B,kCAAA,EAC5B,OAAO,aACqB,CAAC;IAE/B,oDAAoD;IACpD,SAAS,CAAC;;QACR,IAAI,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,0CAAE,MAAM,EAAE,CAAC;YAC5B,gBAAgB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnC,CAAC;QAED,OAAO;YACL,4CAA4C;YAC5C,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,EAAE,CAAC;gBACtB,8BAA8B,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACnD,CAAC;YACD,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE,CAAC;gBACpB,4BAA4B,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC/C,CAAC;YACD,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE,CAAC;gBACpB,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAC,OAAO;oBAC7B,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBAChC,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE;QACD,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ;QACf,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU;QACjB,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ;QACf,gBAAgB;QAChB,iBAAiB;QACjB,8BAA8B;QAC9B,4BAA4B;KAC7B,CAAC,CAAC;IAEH,oBAAoB;IACpB,IAAM,kBAAkB,GAAG,cAAM,OAAA,OAAO,CAAC,IAAI,CAAC,EAAb,CAAa,CAAC;IAC/C,IAAM,mBAAmB,GAAG,cAAM,OAAA,OAAO,CAAC,KAAK,CAAC,EAAd,CAAc,CAAC;IACjD,IAAM,oBAAoB,GAAG,cAAM,OAAA,OAAO,CAAC,CAAC,MAAM,CAAC,EAAhB,CAAgB,CAAC;IAEpD,OAAO;QACL,QAAQ;QACR,QAAQ,EAAE,WAAW;QACrB,MAAM,QAAA;QAEN,8BAA8B;QAC9B,eAAe,iBAAA;QACf,gBAAgB,kBAAA;QAChB,iBAAiB,mBAAA;QACjB,8BAA8B,gCAAA;QAC9B,4BAA4B,8BAAA;QAE5B,sBAAsB;QACtB,kBAAkB,oBAAA;QAClB,mBAAmB,qBAAA;QACnB,oBAAoB,sBAAA;QACpB,OAAO,SAAA;KACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.ForwardRefExoticComponent<Omit<{
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
7
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
asChild?: boolean | undefined;
|
|
10
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
11
|
+
label?: string | undefined;
|
|
12
|
+
shouldFilter?: boolean | undefined;
|
|
13
|
+
filter?: ((value: string, search: string, keywords?: string[] | undefined) => number) | undefined;
|
|
14
|
+
defaultValue?: string | undefined;
|
|
15
|
+
value?: string | undefined;
|
|
16
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
17
|
+
loop?: boolean | undefined;
|
|
18
|
+
disablePointerSelection?: boolean | undefined;
|
|
19
|
+
vimBindings?: boolean | undefined;
|
|
20
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
};
|
|
22
|
+
export default meta;
|
|
23
|
+
export declare function SimpleExample(): React.JSX.Element;
|
|
24
|
+
export declare function EntitySpecificCommands(): React.JSX.Element;
|
|
25
|
+
//# sourceMappingURL=SamsCommandPalette.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SamsCommandPalette.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/SamsCommandPalette.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAgBxC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;CAG0B,CAAC;AAErC,eAAe,IAAI,CAAC;AAEpB,wBAAgB,aAAa,sBAS5B;AAGD,wBAAgB,sBAAsB,sBAMrC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { __read } from "tslib";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { CodeBlock, Icon, Label, RadioGroup, RadioGroupItem, } from "../components";
|
|
4
|
+
import { SamsCommand } from "../components/SamsCommandPalette";
|
|
5
|
+
import { useCommandPalette } from "../hooks/useCommandPalette";
|
|
6
|
+
import { FolderIcon } from "../icons";
|
|
7
|
+
import { AppCommandPalette } from "../components/AppCommandPalette";
|
|
8
|
+
var meta = {
|
|
9
|
+
title: "Primitives/Sam's CommandPalette",
|
|
10
|
+
component: SamsCommand,
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
export function SimpleExample() {
|
|
14
|
+
return (React.createElement(AppCommandPalette, null,
|
|
15
|
+
React.createElement(Label, null,
|
|
16
|
+
"Press ",
|
|
17
|
+
React.createElement(CodeBlock, { inline: true }, "\u2318 K"),
|
|
18
|
+
" to open the command palette"),
|
|
19
|
+
React.createElement(SamsCommand, null)));
|
|
20
|
+
}
|
|
21
|
+
// Example with entity-specific commands
|
|
22
|
+
export function EntitySpecificCommands() {
|
|
23
|
+
return (React.createElement(AppCommandPalette, null,
|
|
24
|
+
React.createElement(EntitySelector, null)));
|
|
25
|
+
}
|
|
26
|
+
// Predefined entity commands - moved outside component to avoid recreation
|
|
27
|
+
var entity1Commands = [
|
|
28
|
+
{
|
|
29
|
+
id: "entity1.actionA",
|
|
30
|
+
label: "Action A",
|
|
31
|
+
category: "Entity 1",
|
|
32
|
+
entityType: "entity1",
|
|
33
|
+
action: function () {
|
|
34
|
+
window.alert("Executing Action A for Entity 1");
|
|
35
|
+
},
|
|
36
|
+
priority: 0,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "entity1.actionB",
|
|
40
|
+
label: "Action B",
|
|
41
|
+
category: "Entity 1",
|
|
42
|
+
entityType: "entity1",
|
|
43
|
+
action: function () {
|
|
44
|
+
window.alert("Executing Action B for Entity 1");
|
|
45
|
+
},
|
|
46
|
+
priority: 1,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
var entity2Commands = [
|
|
50
|
+
{
|
|
51
|
+
id: "entity2.actionC.warning",
|
|
52
|
+
label: "Action C",
|
|
53
|
+
category: "Entity 2",
|
|
54
|
+
entityType: "entity2",
|
|
55
|
+
action: function () {
|
|
56
|
+
window.alert("Executing Action C for Entity 2");
|
|
57
|
+
},
|
|
58
|
+
priority: 0,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "entity2.actionD",
|
|
62
|
+
label: "Action D",
|
|
63
|
+
icon: React.createElement(Icon, { visual: FolderIcon }),
|
|
64
|
+
category: "Entity 2",
|
|
65
|
+
entityType: "entity2",
|
|
66
|
+
action: function () {
|
|
67
|
+
window.alert("Executing Action D for Entity 2");
|
|
68
|
+
},
|
|
69
|
+
priority: 1,
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
// Component to demonstrate entity selection and entity-specific commands
|
|
73
|
+
function EntitySelector() {
|
|
74
|
+
var _a = useCommandPalette(), registerCommands = _a.registerCommands, unregisterCommandsByEntityType = _a.unregisterCommandsByEntityType;
|
|
75
|
+
var _b = __read(useState(), 2), currentEntity = _b[0], setCurrentEntity = _b[1];
|
|
76
|
+
// Default to entity 1 commands
|
|
77
|
+
function handleEntityChange(newEntity) {
|
|
78
|
+
setCurrentEntity(function (previous) {
|
|
79
|
+
if (previous) {
|
|
80
|
+
unregisterCommandsByEntityType(previous);
|
|
81
|
+
}
|
|
82
|
+
registerCommands(newEntity === "entity1" ? entity1Commands : entity2Commands);
|
|
83
|
+
return newEntity;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return (React.createElement("div", { className: "s-flex s-flex-col s-gap-4" },
|
|
87
|
+
React.createElement("div", { className: "s-flex s-flex-col s-gap-2" },
|
|
88
|
+
React.createElement(Label, null, "Current Entity"),
|
|
89
|
+
React.createElement("div", { className: "s-flex s-gap-4" },
|
|
90
|
+
React.createElement(RadioGroup, { value: currentEntity, onValueChange: handleEntityChange },
|
|
91
|
+
React.createElement(RadioGroupItem, { value: "entity1", label: "Entity 1" }),
|
|
92
|
+
React.createElement(RadioGroupItem, { value: "entity2", label: "Entity 2" })))),
|
|
93
|
+
React.createElement("div", { className: "s-flex s-flex-col s-gap-2" },
|
|
94
|
+
React.createElement(Label, null, "Command Palette"),
|
|
95
|
+
React.createElement("p", { className: "s-text-sm s-text-muted-foreground" },
|
|
96
|
+
"Press ",
|
|
97
|
+
React.createElement(CodeBlock, { inline: true }, "\u2318 K"),
|
|
98
|
+
" to open the command palette. The commands change based on the selected entity."))));
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=SamsCommandPalette.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SamsCommandPalette.stories.js","sourceRoot":"","sources":["../../../src/stories/SamsCommandPalette.stories.tsx"],"names":[],"mappings":"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"}
|
package/dist/sparkle.css
CHANGED
|
@@ -1442,6 +1442,10 @@ select {
|
|
|
1442
1442
|
max-height: 18rem;
|
|
1443
1443
|
}
|
|
1444
1444
|
|
|
1445
|
+
.s-max-h-\[300px\] {
|
|
1446
|
+
max-height: 300px;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1445
1449
|
.s-max-h-\[500px\] {
|
|
1446
1450
|
max-height: 500px;
|
|
1447
1451
|
}
|
|
@@ -2284,6 +2288,11 @@ select {
|
|
|
2284
2288
|
border-radius: 0.75rem;
|
|
2285
2289
|
}
|
|
2286
2290
|
|
|
2291
|
+
.s-rounded-b-xl {
|
|
2292
|
+
border-bottom-right-radius: 0.75rem;
|
|
2293
|
+
border-bottom-left-radius: 0.75rem;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2287
2296
|
.s-rounded-l-none {
|
|
2288
2297
|
border-top-left-radius: 0px;
|
|
2289
2298
|
border-bottom-left-radius: 0px;
|
|
@@ -4362,6 +4371,10 @@ select {
|
|
|
4362
4371
|
object-position: center;
|
|
4363
4372
|
}
|
|
4364
4373
|
|
|
4374
|
+
.s-p-0 {
|
|
4375
|
+
padding: 0px;
|
|
4376
|
+
}
|
|
4377
|
+
|
|
4365
4378
|
.s-p-1 {
|
|
4366
4379
|
padding: 0.25rem;
|
|
4367
4380
|
}
|
|
@@ -4509,6 +4522,11 @@ select {
|
|
|
4509
4522
|
padding-bottom: 1rem;
|
|
4510
4523
|
}
|
|
4511
4524
|
|
|
4525
|
+
.s-py-6 {
|
|
4526
|
+
padding-top: 1.5rem;
|
|
4527
|
+
padding-bottom: 1.5rem;
|
|
4528
|
+
}
|
|
4529
|
+
|
|
4512
4530
|
.s-py-8 {
|
|
4513
4531
|
padding-top: 2rem;
|
|
4514
4532
|
padding-bottom: 2rem;
|
|
@@ -6316,6 +6334,10 @@ select {
|
|
|
6316
6334
|
opacity: 0.7;
|
|
6317
6335
|
}
|
|
6318
6336
|
|
|
6337
|
+
.data-\[disabled\=true\]\:s-pointer-events-none[data-disabled=true] {
|
|
6338
|
+
pointer-events: none;
|
|
6339
|
+
}
|
|
6340
|
+
|
|
6319
6341
|
.data-\[disabled\]\:s-pointer-events-none[data-disabled] {
|
|
6320
6342
|
pointer-events: none;
|
|
6321
6343
|
}
|
|
@@ -6379,6 +6401,16 @@ select {
|
|
|
6379
6401
|
border-color: rgb(42 50 65 / var(--tw-border-opacity));
|
|
6380
6402
|
}
|
|
6381
6403
|
|
|
6404
|
+
.data-\[selected\=true\]\:s-bg-muted-background[data-selected=true] {
|
|
6405
|
+
--tw-bg-opacity: 1;
|
|
6406
|
+
background-color: rgb(247 247 247 / var(--tw-bg-opacity));
|
|
6407
|
+
}
|
|
6408
|
+
|
|
6409
|
+
.data-\[selected\=true\]\:s-bg-warning-50[data-selected=true] {
|
|
6410
|
+
--tw-bg-opacity: 1;
|
|
6411
|
+
background-color: rgb(255 241 247 / var(--tw-bg-opacity));
|
|
6412
|
+
}
|
|
6413
|
+
|
|
6382
6414
|
.data-\[state\=checked\]\:s-bg-primary[data-state=checked] {
|
|
6383
6415
|
--tw-bg-opacity: 1;
|
|
6384
6416
|
background-color: rgb(42 50 65 / var(--tw-bg-opacity));
|
|
@@ -6399,6 +6431,16 @@ select {
|
|
|
6399
6431
|
color: rgb(150 156 165 / var(--tw-text-opacity));
|
|
6400
6432
|
}
|
|
6401
6433
|
|
|
6434
|
+
.data-\[selected\=true\]\:s-text-foreground[data-selected=true] {
|
|
6435
|
+
--tw-text-opacity: 1;
|
|
6436
|
+
color: rgb(17 20 24 / var(--tw-text-opacity));
|
|
6437
|
+
}
|
|
6438
|
+
|
|
6439
|
+
.data-\[selected\=true\]\:s-text-warning-500[data-selected=true] {
|
|
6440
|
+
--tw-text-opacity: 1;
|
|
6441
|
+
color: rgb(225 67 34 / var(--tw-text-opacity));
|
|
6442
|
+
}
|
|
6443
|
+
|
|
6402
6444
|
.data-\[state\=checked\]\:s-text-white[data-state=checked] {
|
|
6403
6445
|
--tw-text-opacity: 1;
|
|
6404
6446
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
@@ -6409,6 +6451,10 @@ select {
|
|
|
6409
6451
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
6410
6452
|
}
|
|
6411
6453
|
|
|
6454
|
+
.data-\[disabled\=true\]\:s-opacity-50[data-disabled=true] {
|
|
6455
|
+
opacity: 0.5;
|
|
6456
|
+
}
|
|
6457
|
+
|
|
6412
6458
|
.data-\[state\=closed\]\:s-duration-300[data-state=closed] {
|
|
6413
6459
|
transition-duration: 300ms;
|
|
6414
6460
|
}
|
|
@@ -9571,3 +9617,83 @@ select {
|
|
|
9571
9617
|
--tw-rotate: 90deg;
|
|
9572
9618
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
9573
9619
|
}
|
|
9620
|
+
|
|
9621
|
+
.\[\&_\[cmdk-group-heading\]\]\:s-p-2 [cmdk-group-heading] {
|
|
9622
|
+
padding: 0.5rem;
|
|
9623
|
+
}
|
|
9624
|
+
|
|
9625
|
+
.\[\&_\[cmdk-group-heading\]\]\:s-px-2 [cmdk-group-heading] {
|
|
9626
|
+
padding-left: 0.5rem;
|
|
9627
|
+
padding-right: 0.5rem;
|
|
9628
|
+
}
|
|
9629
|
+
|
|
9630
|
+
.\[\&_\[cmdk-group-heading\]\]\:s-py-1\.5 [cmdk-group-heading] {
|
|
9631
|
+
padding-top: 0.375rem;
|
|
9632
|
+
padding-bottom: 0.375rem;
|
|
9633
|
+
}
|
|
9634
|
+
|
|
9635
|
+
.\[\&_\[cmdk-group-heading\]\]\:s-text-xs [cmdk-group-heading] {
|
|
9636
|
+
font-size: 12px;
|
|
9637
|
+
line-height: 16px;
|
|
9638
|
+
letter-spacing: normal;
|
|
9639
|
+
}
|
|
9640
|
+
|
|
9641
|
+
.\[\&_\[cmdk-group-heading\]\]\:s-font-medium [cmdk-group-heading] {
|
|
9642
|
+
font-weight: 500;
|
|
9643
|
+
}
|
|
9644
|
+
|
|
9645
|
+
.\[\&_\[cmdk-group-heading\]\]\:s-text-muted-foreground [cmdk-group-heading] {
|
|
9646
|
+
--tw-text-opacity: 1;
|
|
9647
|
+
color: rgb(84 93 108 / var(--tw-text-opacity));
|
|
9648
|
+
}
|
|
9649
|
+
|
|
9650
|
+
.\[\&_\[cmdk-group-items\]\]\:s-pb-1 [cmdk-group-items] {
|
|
9651
|
+
padding-bottom: 0.25rem;
|
|
9652
|
+
}
|
|
9653
|
+
|
|
9654
|
+
.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:s-pt-0 [cmdk-group]:not([hidden]) ~[cmdk-group] {
|
|
9655
|
+
padding-top: 0px;
|
|
9656
|
+
}
|
|
9657
|
+
|
|
9658
|
+
.\[\&_\[cmdk-group\]\]\:s-px-2 [cmdk-group] {
|
|
9659
|
+
padding-left: 0.5rem;
|
|
9660
|
+
padding-right: 0.5rem;
|
|
9661
|
+
}
|
|
9662
|
+
|
|
9663
|
+
.\[\&_\[cmdk-input-wrapper\]_svg\]\:s-h-5 [cmdk-input-wrapper] svg {
|
|
9664
|
+
height: 1.25rem;
|
|
9665
|
+
}
|
|
9666
|
+
|
|
9667
|
+
.\[\&_\[cmdk-input-wrapper\]_svg\]\:s-w-5 [cmdk-input-wrapper] svg {
|
|
9668
|
+
width: 1.25rem;
|
|
9669
|
+
}
|
|
9670
|
+
|
|
9671
|
+
.\[\&_\[cmdk-input\]\]\:s-h-12 [cmdk-input] {
|
|
9672
|
+
height: 3rem;
|
|
9673
|
+
}
|
|
9674
|
+
|
|
9675
|
+
.\[\&_\[cmdk-item\]\]\:s-px-2 [cmdk-item] {
|
|
9676
|
+
padding-left: 0.5rem;
|
|
9677
|
+
padding-right: 0.5rem;
|
|
9678
|
+
}
|
|
9679
|
+
|
|
9680
|
+
.\[\&_\[cmdk-item\]\]\:s-py-3 [cmdk-item] {
|
|
9681
|
+
padding-top: 0.75rem;
|
|
9682
|
+
padding-bottom: 0.75rem;
|
|
9683
|
+
}
|
|
9684
|
+
|
|
9685
|
+
.\[\&_\[cmdk-item\]_svg\]\:s-h-5 [cmdk-item] svg {
|
|
9686
|
+
height: 1.25rem;
|
|
9687
|
+
}
|
|
9688
|
+
|
|
9689
|
+
.\[\&_\[cmdk-item\]_svg\]\:s-w-5 [cmdk-item] svg {
|
|
9690
|
+
width: 1.25rem;
|
|
9691
|
+
}
|
|
9692
|
+
|
|
9693
|
+
.\[\&_svg\]\:s-pointer-events-none svg {
|
|
9694
|
+
pointer-events: none;
|
|
9695
|
+
}
|
|
9696
|
+
|
|
9697
|
+
.\[\&_svg\]\:s-shrink-0 svg {
|
|
9698
|
+
flex-shrink: 0;
|
|
9699
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dust-tt/sparkle",
|
|
3
|
-
"version": "0.2.449-
|
|
3
|
+
"version": "0.2.449-rc-samuel",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs",
|
|
6
6
|
"tailwind": "tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css",
|
|
@@ -117,6 +117,7 @@
|
|
|
117
117
|
"@tanstack/react-table": "^8.13.0",
|
|
118
118
|
"class-variance-authority": "^0.7.1",
|
|
119
119
|
"clsx": "^2.1.1",
|
|
120
|
+
"cmdk": "^1.1.1",
|
|
120
121
|
"emoji-mart": "^5.5.2",
|
|
121
122
|
"lottie-react": "^2.4.0",
|
|
122
123
|
"lottie-web": "^5.12.2",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React, { useMemo } from "react";
|
|
4
|
+
|
|
5
|
+
import { CommandPaletteProvider } from "../contexts/CommandPaletteContext";
|
|
6
|
+
import { useCommandPalette } from "../hooks/useCommandPalette";
|
|
7
|
+
import { CommandPalette } from "./CommandPalette";
|
|
8
|
+
|
|
9
|
+
interface AppCommandPaletteProps {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function GlobalCommands() {
|
|
14
|
+
const globalCommands = useMemo(
|
|
15
|
+
() => [
|
|
16
|
+
{
|
|
17
|
+
id: "global.help",
|
|
18
|
+
label: "Help",
|
|
19
|
+
shortcut: "?",
|
|
20
|
+
category: "System",
|
|
21
|
+
action: () => {
|
|
22
|
+
window.alert("Help requested");
|
|
23
|
+
},
|
|
24
|
+
priority: 0,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "global.settings",
|
|
28
|
+
label: "Settings",
|
|
29
|
+
category: "System",
|
|
30
|
+
action: () => {
|
|
31
|
+
window.alert("Navigate to settings");
|
|
32
|
+
},
|
|
33
|
+
priority: 0,
|
|
34
|
+
},
|
|
35
|
+
// Add more global commands here
|
|
36
|
+
],
|
|
37
|
+
[]
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// Register global commands
|
|
41
|
+
useCommandPalette({ commands: globalCommands });
|
|
42
|
+
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* AppCommandPalette - Provides the command palette context to the entire app
|
|
48
|
+
* and initializes it with global commands
|
|
49
|
+
*/
|
|
50
|
+
export function AppCommandPalette({ children }: AppCommandPaletteProps) {
|
|
51
|
+
return (
|
|
52
|
+
<CommandPaletteProvider>
|
|
53
|
+
<GlobalCommands />
|
|
54
|
+
<CommandPalette />
|
|
55
|
+
{children}
|
|
56
|
+
</CommandPaletteProvider>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useRef } from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "@sparkle/lib/utils";
|
|
6
|
+
|
|
7
|
+
import { useCommandPalette } from "../hooks/useCommandPalette";
|
|
8
|
+
import {
|
|
9
|
+
SamsCommand,
|
|
10
|
+
SamsCommandDialog,
|
|
11
|
+
SamsCommandEmpty,
|
|
12
|
+
SamsCommandGroup,
|
|
13
|
+
SamsCommandInput,
|
|
14
|
+
SamsCommandItem,
|
|
15
|
+
SamsCommandList,
|
|
16
|
+
} from "./SamsCommandPalette";
|
|
17
|
+
|
|
18
|
+
export const CommandPalette: React.FC = () => {
|
|
19
|
+
const { commands, isOpen, setOpen, closeCommandPalette } =
|
|
20
|
+
useCommandPalette();
|
|
21
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
22
|
+
|
|
23
|
+
// Focus the input when the palette opens
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (isOpen) {
|
|
26
|
+
// Use a small timeout to ensure the dialog is fully rendered before focusing
|
|
27
|
+
const focusTimeout = setTimeout(() => {
|
|
28
|
+
inputRef.current?.focus();
|
|
29
|
+
}, 50);
|
|
30
|
+
|
|
31
|
+
return () => clearTimeout(focusTimeout);
|
|
32
|
+
}
|
|
33
|
+
}, [isOpen]);
|
|
34
|
+
|
|
35
|
+
// Group commands by category
|
|
36
|
+
const groupedCommands = commands.reduce<Record<string, typeof commands>>(
|
|
37
|
+
(acc, command) => {
|
|
38
|
+
const category = command.category || "General";
|
|
39
|
+
if (!acc[category]) {
|
|
40
|
+
acc[category] = [];
|
|
41
|
+
}
|
|
42
|
+
acc[category].push(command);
|
|
43
|
+
return acc;
|
|
44
|
+
},
|
|
45
|
+
{}
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
// Sort categories and commands
|
|
49
|
+
const sortedCategories = Object.keys(groupedCommands).sort();
|
|
50
|
+
|
|
51
|
+
// Sort commands by priority (if specified)
|
|
52
|
+
Object.keys(groupedCommands).forEach((category) => {
|
|
53
|
+
groupedCommands[category].sort((a, b) => {
|
|
54
|
+
const priorityA = a.priority ?? 0;
|
|
55
|
+
const priorityB = b.priority ?? 0;
|
|
56
|
+
return priorityA - priorityB; // Lower priority first
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<SamsCommandDialog open={isOpen} onOpenChange={setOpen}>
|
|
62
|
+
<SamsCommand>
|
|
63
|
+
<SamsCommandInput
|
|
64
|
+
ref={inputRef}
|
|
65
|
+
placeholder="Type a command or search..."
|
|
66
|
+
autoFocus
|
|
67
|
+
/>
|
|
68
|
+
<SamsCommandList>
|
|
69
|
+
<SamsCommandEmpty>No results found.</SamsCommandEmpty>
|
|
70
|
+
{sortedCategories.map((category, categoryIndex) => (
|
|
71
|
+
<SamsCommandGroup key={category} heading={category}>
|
|
72
|
+
{groupedCommands[category].map((command, commandIndex) => (
|
|
73
|
+
<SamsCommandItem
|
|
74
|
+
key={command.id}
|
|
75
|
+
onSelect={() => {
|
|
76
|
+
command.action();
|
|
77
|
+
// Optionally close the palette after executing a command
|
|
78
|
+
closeCommandPalette();
|
|
79
|
+
}}
|
|
80
|
+
className={cn(
|
|
81
|
+
"s-relative s-flex s-items-center s-gap-2 s-rounded-md s-px-2 s-py-1.5 s-text-sm s-font-medium",
|
|
82
|
+
command.id.includes("warning")
|
|
83
|
+
? "s-text-warning-500 data-[selected=true]:s-bg-warning-50 data-[selected=true]:s-text-warning-500"
|
|
84
|
+
: "s-text-foreground data-[selected=true]:s-bg-muted-background data-[selected=true]:s-text-foreground",
|
|
85
|
+
|
|
86
|
+
// if it's the last one, rounded-b-md"
|
|
87
|
+
categoryIndex === sortedCategories.length - 1 &&
|
|
88
|
+
commandIndex === groupedCommands[category].length - 1
|
|
89
|
+
? "s-rounded-b-xl"
|
|
90
|
+
: ""
|
|
91
|
+
)}
|
|
92
|
+
>
|
|
93
|
+
{command.icon && (
|
|
94
|
+
<span className="s-mr-2 s-flex s-h-5 s-w-5 s-items-center s-justify-center">
|
|
95
|
+
{command.icon}
|
|
96
|
+
</span>
|
|
97
|
+
)}
|
|
98
|
+
<span>{command.label}</span>
|
|
99
|
+
{command.shortcut && (
|
|
100
|
+
<span className="s-ml-auto s-text-xs s-tracking-widest s-text-muted-foreground">
|
|
101
|
+
{command.shortcut}
|
|
102
|
+
</span>
|
|
103
|
+
)}
|
|
104
|
+
</SamsCommandItem>
|
|
105
|
+
))}
|
|
106
|
+
</SamsCommandGroup>
|
|
107
|
+
))}
|
|
108
|
+
</SamsCommandList>
|
|
109
|
+
</SamsCommand>
|
|
110
|
+
</SamsCommandDialog>
|
|
111
|
+
);
|
|
112
|
+
};
|
package/src/components/Input.tsx
CHANGED
|
@@ -19,6 +19,7 @@ export interface InputProps
|
|
|
19
19
|
isError?: boolean;
|
|
20
20
|
className?: string;
|
|
21
21
|
label?: string;
|
|
22
|
+
isInCommandPalette?: boolean;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
const INPUT_STATES = ["error", "disabled", "default"];
|
|
@@ -91,6 +92,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
|
91
92
|
label,
|
|
92
93
|
isError,
|
|
93
94
|
disabled,
|
|
95
|
+
isInCommandPalette,
|
|
94
96
|
...props
|
|
95
97
|
},
|
|
96
98
|
ref
|
|
@@ -102,7 +104,12 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
|
102
104
|
? "disabled"
|
|
103
105
|
: "default";
|
|
104
106
|
return (
|
|
105
|
-
<div
|
|
107
|
+
<div
|
|
108
|
+
className={cn(
|
|
109
|
+
"s-flex s-flex-col s-gap-1",
|
|
110
|
+
isInCommandPalette && "s-w-full"
|
|
111
|
+
)}
|
|
112
|
+
>
|
|
106
113
|
{label && (
|
|
107
114
|
<Label htmlFor={props.name} className="s-mb-1">
|
|
108
115
|
{label}
|