@zentauri-ui/zentauri-components 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/cli/registry.json +1 -0
- package/dist/chunk-KEKMMNL5.mjs +600 -0
- package/dist/chunk-KEKMMNL5.mjs.map +1 -0
- package/dist/chunk-NZDHSIIC.js +616 -0
- package/dist/chunk-NZDHSIIC.js.map +1 -0
- package/dist/design-system/command.d.ts +41 -0
- package/dist/design-system/command.d.ts.map +1 -0
- package/dist/design-system/index.d.ts +1 -0
- package/dist/design-system/index.d.ts.map +1 -1
- package/dist/ui/command/animated/animations.d.ts +3 -0
- package/dist/ui/command/animated/animations.d.ts.map +1 -0
- package/dist/ui/command/animated/command-content-animated.d.ts +6 -0
- package/dist/ui/command/animated/command-content-animated.d.ts.map +1 -0
- package/dist/ui/command/animated/index.d.ts +4 -0
- package/dist/ui/command/animated/index.d.ts.map +1 -0
- package/dist/ui/command/animated/types.d.ts +9 -0
- package/dist/ui/command/animated/types.d.ts.map +1 -0
- package/dist/ui/command/animated.js +92 -0
- package/dist/ui/command/animated.js.map +1 -0
- package/dist/ui/command/animated.mjs +89 -0
- package/dist/ui/command/animated.mjs.map +1 -0
- package/dist/ui/command/command-base.d.ts +53 -0
- package/dist/ui/command/command-base.d.ts.map +1 -0
- package/dist/ui/command/command.d.ts +6 -0
- package/dist/ui/command/command.d.ts.map +1 -0
- package/dist/ui/command/index.d.ts +5 -0
- package/dist/ui/command/index.d.ts.map +1 -0
- package/dist/ui/command/types.d.ts +111 -0
- package/dist/ui/command/types.d.ts.map +1 -0
- package/dist/ui/command/variants.d.ts +15 -0
- package/dist/ui/command/variants.d.ts.map +1 -0
- package/dist/ui/command.js +69 -0
- package/dist/ui/command.js.map +1 -0
- package/dist/ui/command.mjs +16 -0
- package/dist/ui/command.mjs.map +1 -0
- package/package.json +1 -1
- package/src/design-system/command.ts +80 -0
- package/src/design-system/index.ts +1 -0
- package/src/ui/command/animated/animations.ts +29 -0
- package/src/ui/command/animated/command-content-animated.tsx +58 -0
- package/src/ui/command/animated/index.ts +10 -0
- package/src/ui/command/animated/types.ts +23 -0
- package/src/ui/command/command-base.tsx +660 -0
- package/src/ui/command/command.test.tsx +130 -0
- package/src/ui/command/command.tsx +8 -0
- package/src/ui/command/index.ts +34 -0
- package/src/ui/command/types.ts +129 -0
- package/src/ui/command/variants.ts +41 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { CSSProperties, ReactNode, Ref, RefObject } from "react";
|
|
3
|
+
import type { commandContentVariants } from "./variants";
|
|
4
|
+
export type CommandContentVariantProps = VariantProps<typeof commandContentVariants>;
|
|
5
|
+
export type CommandProps = {
|
|
6
|
+
open?: boolean;
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
9
|
+
/**
|
|
10
|
+
* When set, binds a global shortcut that toggles the palette: this key plus
|
|
11
|
+
* meta (⌘) or ctrl. Defaults to "k" when `hotkey` is `true`.
|
|
12
|
+
*/
|
|
13
|
+
hotkey?: string | boolean;
|
|
14
|
+
/** Accessible label for the dialog. */
|
|
15
|
+
label?: string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
export type CommandTriggerProps = {
|
|
19
|
+
className?: string;
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
ref?: Ref<HTMLButtonElement>;
|
|
22
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
23
|
+
};
|
|
24
|
+
export type CommandContentProps = CommandContentVariantProps & {
|
|
25
|
+
className?: string;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
ref?: Ref<HTMLDivElement>;
|
|
28
|
+
id?: string;
|
|
29
|
+
style?: CSSProperties;
|
|
30
|
+
};
|
|
31
|
+
export type CommandInputProps = {
|
|
32
|
+
className?: string;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
ref?: Ref<HTMLInputElement>;
|
|
35
|
+
};
|
|
36
|
+
export type CommandListProps = {
|
|
37
|
+
className?: string;
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
};
|
|
40
|
+
export type CommandGroupProps = {
|
|
41
|
+
className?: string;
|
|
42
|
+
heading?: ReactNode;
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
};
|
|
45
|
+
export type CommandItemProps = {
|
|
46
|
+
className?: string;
|
|
47
|
+
/** Stable identifier used for filtering, keyboard nav, and onSelect. */
|
|
48
|
+
value: string;
|
|
49
|
+
/** Extra terms used by the filter in addition to the rendered text. */
|
|
50
|
+
keywords?: string[];
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
onSelect?: (value: string) => void;
|
|
53
|
+
children?: ReactNode;
|
|
54
|
+
};
|
|
55
|
+
export type CommandSectionProps = {
|
|
56
|
+
className?: string;
|
|
57
|
+
children?: ReactNode;
|
|
58
|
+
};
|
|
59
|
+
export type ItemMeta = {
|
|
60
|
+
keywords?: string[];
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
onSelect?: (value: string) => void;
|
|
63
|
+
searchText?: string;
|
|
64
|
+
};
|
|
65
|
+
export type RegisteredItem = {
|
|
66
|
+
value: string;
|
|
67
|
+
metaRef: RefObject<ItemMeta>;
|
|
68
|
+
};
|
|
69
|
+
export type CommandCtx = {
|
|
70
|
+
open: boolean;
|
|
71
|
+
setOpen: (next: boolean) => void;
|
|
72
|
+
labelId: string;
|
|
73
|
+
listId: string;
|
|
74
|
+
query: string;
|
|
75
|
+
setQuery: (next: string) => void;
|
|
76
|
+
activeValue: string | null;
|
|
77
|
+
setActiveValue: (next: string | null) => void;
|
|
78
|
+
visibleValues: string[];
|
|
79
|
+
isVisible: (value: string) => boolean;
|
|
80
|
+
registerItem: (item: RegisteredItem) => () => void;
|
|
81
|
+
invalidateRegistry: () => void;
|
|
82
|
+
selectValue: (value: string) => boolean;
|
|
83
|
+
contentRef: RefObject<HTMLDivElement | null>;
|
|
84
|
+
triggerRef: RefObject<HTMLElement | null>;
|
|
85
|
+
inputRef: RefObject<HTMLInputElement | null>;
|
|
86
|
+
};
|
|
87
|
+
export type CommandContentOverlayRenderProps = {
|
|
88
|
+
role: "presentation";
|
|
89
|
+
"data-slot": "command-overlay";
|
|
90
|
+
className: string;
|
|
91
|
+
onClick: () => void;
|
|
92
|
+
};
|
|
93
|
+
export type CommandContentPanelRenderProps = {
|
|
94
|
+
ref: (node: HTMLDivElement | null) => void;
|
|
95
|
+
role: "dialog";
|
|
96
|
+
"aria-modal": true;
|
|
97
|
+
"aria-labelledby": string;
|
|
98
|
+
"data-slot": "command-content";
|
|
99
|
+
tabIndex: -1;
|
|
100
|
+
className: string;
|
|
101
|
+
id?: string;
|
|
102
|
+
style?: CommandContentProps["style"];
|
|
103
|
+
children: ReactNode;
|
|
104
|
+
};
|
|
105
|
+
export type CommandContentLayerProps = CommandContentProps & {
|
|
106
|
+
componentName: string;
|
|
107
|
+
renderPresence?: (children: ReactNode) => ReactNode;
|
|
108
|
+
renderOverlay?: (props: CommandContentOverlayRenderProps) => ReactNode;
|
|
109
|
+
renderPanel?: (props: CommandContentPanelRenderProps) => ReactNode;
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ui/command/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,MAAM,0BAA0B,GAAG,YAAY,CACnD,OAAO,sBAAsB,CAC9B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,C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C,KAAK,EAAE,gCAAgC,KAAK,SAAS,CAAC;IACvE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,SAAS,CAAC;CACpE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const commandOverlayVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const commandTriggerVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const commandContentVariants: (props?: ({
|
|
4
|
+
size?: "md" | "sm" | "lg" | null | undefined;
|
|
5
|
+
appearance?: "default" | "glass" | "sky" | "emerald" | "violet" | "amber" | "rose" | "gray" | "indigo" | "orange" | "pink" | "purple" | "teal" | "yellow" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export declare const commandInputRowVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
|
+
export declare const commandInputVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
9
|
+
export declare const commandListVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
10
|
+
export declare const commandGroupHeadingVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
11
|
+
export declare const commandItemVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
12
|
+
export declare const commandSeparatorVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
13
|
+
export declare const commandEmptyVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
14
|
+
export declare const commandFooterVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
15
|
+
//# sourceMappingURL=variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../src/ui/command/variants.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,sBAAsB,oFAA6B,CAAC;AAEjE,eAAO,MAAM,sBAAsB,oFAA6B,CAAC;AAEjE,eAAO,MAAM,sBAAsB;;;8EASjC,CAAC;AAEH,eAAO,MAAM,uBAAuB,oFAA8B,CAAC;AACnE,eAAO,MAAM,oBAAoB,oFAA2B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,oFAA0B,CAAC;AAC3D,eAAO,MAAM,2BAA2B,oFAAkC,CAAC;AAC3E,eAAO,MAAM,mBAAmB,oFAA0B,CAAC;AAC3D,eAAO,MAAM,wBAAwB,oFAA+B,CAAC;AACrE,eAAO,MAAM,oBAAoB,oFAA2B,CAAC;AAC7D,eAAO,MAAM,qBAAqB,oFAA4B,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunkNZDHSIIC_js = require('../chunk-NZDHSIIC.js');
|
|
5
|
+
require('../chunk-GBWGVNDA.js');
|
|
6
|
+
require('../chunk-UIYFEP3I.js');
|
|
7
|
+
require('../chunk-ZS5756ZC.js');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
|
|
10
|
+
var Command2 = (props) => {
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkNZDHSIIC_js.Command, { ...props });
|
|
12
|
+
};
|
|
13
|
+
Command2.displayName = "Command";
|
|
14
|
+
|
|
15
|
+
Object.defineProperty(exports, "CommandContent", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunkNZDHSIIC_js.CommandContent; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "CommandEmpty", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return chunkNZDHSIIC_js.CommandEmpty; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "CommandFooter", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkNZDHSIIC_js.CommandFooter; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "CommandGroup", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkNZDHSIIC_js.CommandGroup; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "CommandInput", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkNZDHSIIC_js.CommandInput; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "CommandItem", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return chunkNZDHSIIC_js.CommandItem; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "CommandList", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return chunkNZDHSIIC_js.CommandList; }
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "CommandSeparator", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return chunkNZDHSIIC_js.CommandSeparator; }
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, "CommandTrigger", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return chunkNZDHSIIC_js.CommandTrigger; }
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, "commandContentVariants", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () { return chunkNZDHSIIC_js.commandContentVariants; }
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "commandItemVariants", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () { return chunkNZDHSIIC_js.commandItemVariants; }
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(exports, "commandOverlayVariants", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function () { return chunkNZDHSIIC_js.commandOverlayVariants; }
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(exports, "useCommandContext", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function () { return chunkNZDHSIIC_js.useCommandContext; }
|
|
66
|
+
});
|
|
67
|
+
exports.Command = Command2;
|
|
68
|
+
//# sourceMappingURL=command.js.map
|
|
69
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/command/command.tsx"],"names":["Command","jsx"],"mappings":";;;;;;;;AAGO,IAAMA,QAAAA,GAAU,CAAC,KAAA,KAAwB;AAC9C,EAAA,uBAAOC,cAAA,CAACD,wBAAA,EAAA,EAAa,GAAG,KAAA,EAAO,CAAA;AACjC;AAEAA,QAAAA,CAAQ,WAAA,GAAc,SAAA","file":"command.js","sourcesContent":["import { Command as CommandBase } from \"./command-base\";\nimport type { CommandProps } from \"./types\";\n\nexport const Command = (props: CommandProps) => {\n return <CommandBase {...props} />;\n};\n\nCommand.displayName = \"Command\";\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Command } from '../chunk-KEKMMNL5.mjs';
|
|
3
|
+
export { CommandContent, CommandEmpty, CommandFooter, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandTrigger, commandContentVariants, commandItemVariants, commandOverlayVariants, useCommandContext } from '../chunk-KEKMMNL5.mjs';
|
|
4
|
+
import '../chunk-K6YI4FJO.mjs';
|
|
5
|
+
import '../chunk-PMAF6FBF.mjs';
|
|
6
|
+
import '../chunk-4D54YOL6.mjs';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var Command2 = (props) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(Command, { ...props });
|
|
11
|
+
};
|
|
12
|
+
Command2.displayName = "Command";
|
|
13
|
+
|
|
14
|
+
export { Command2 as Command };
|
|
15
|
+
//# sourceMappingURL=command.mjs.map
|
|
16
|
+
//# sourceMappingURL=command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/command/command.tsx"],"names":["Command"],"mappings":";;;;;;;AAGO,IAAMA,QAAAA,GAAU,CAAC,KAAA,KAAwB;AAC9C,EAAA,uBAAO,GAAA,CAAC,OAAA,EAAA,EAAa,GAAG,KAAA,EAAO,CAAA;AACjC;AAEAA,QAAAA,CAAQ,WAAA,GAAc,SAAA","file":"command.mjs","sourcesContent":["import { Command as CommandBase } from \"./command-base\";\nimport type { CommandProps } from \"./types\";\n\nexport const Command = (props: CommandProps) => {\n return <CommandBase {...props} />;\n};\n\nCommand.displayName = \"Command\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zentauri-ui/zentauri-components",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"description": "React + Tailwind UI kit with charts, ESM/CJS builds, per-entry exports, and a zentauri-components / zentauri-ui CLI to vendor UI or hook source into your app",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export const zuiCommandOverlayBase =
|
|
2
|
+
"fixed inset-0 z-9999 bg-[var(--zui-command-overlay-bg,oklch(12.9%_0.042_264.695_/_0.6))] backdrop-blur-sm";
|
|
3
|
+
|
|
4
|
+
export const zuiCommandTriggerBase =
|
|
5
|
+
"relative inline-flex shrink-0 cursor-pointer items-center gap-2 rounded-md border border-[color:var(--zui-command-trigger-border,#0000001a)] dark:border-[color:var(--zui-command-trigger-border-dark,#ffffff1a)] bg-[var(--zui-command-trigger-bg,oklch(98.4%_0.003_247.858))] dark:bg-[var(--zui-command-trigger-bg-dark,oklch(12.9%_0.042_264.695))] px-3 py-2 text-sm text-[color:var(--zui-command-trigger-fg,oklch(44.6%_0.03_256.802))] dark:text-[color:var(--zui-command-trigger-fg-dark,oklch(86.9%_0.022_252.894))] transition hover:bg-black/5 dark:hover:bg-white/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cyan-500/40";
|
|
6
|
+
|
|
7
|
+
export const zuiCommandContentBase =
|
|
8
|
+
"fixed left-1/2 top-[15%] z-9999 w-[calc(100%-2rem)] -translate-x-1/2 overflow-hidden rounded-xl border border-[color:var(--zui-command-content-border,#0000001a)] dark:border-[color:var(--zui-command-content-border-dark,#ffffff1a)] bg-[var(--zui-command-content-bg,oklch(98.4%_0.003_247.858))] dark:bg-[var(--zui-command-content-bg-dark,oklch(12.9%_0.042_264.695))] text-[color:var(--zui-command-content-fg,oklch(20.8%_0.042_265.755))] dark:text-[color:var(--zui-command-content-fg-dark,oklch(98.4%_0.003_247.858))] shadow-[var(--zui-command-content-shadow,0_12px_40px_rgba(15,23,42,0.18))] dark:shadow-[var(--zui-command-content-shadow-dark,0_24px_80px_rgba(15,23,42,0.6))] focus:outline-none";
|
|
9
|
+
|
|
10
|
+
export const zuiCommandContentSizes = {
|
|
11
|
+
sm: "max-w-md",
|
|
12
|
+
md: "max-w-lg",
|
|
13
|
+
lg: "max-w-2xl",
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
export const zuiCommandInputRowBase =
|
|
17
|
+
"flex items-center gap-2 border-b border-[color:var(--zui-command-input-border,#0000000f)] dark:border-[color:var(--zui-command-input-border-dark,#ffffff14)] px-4";
|
|
18
|
+
|
|
19
|
+
export const zuiCommandInputBase =
|
|
20
|
+
"h-12 w-full bg-transparent text-sm text-[color:var(--zui-command-input-fg,oklch(20.8%_0.042_265.755))] dark:text-[color:var(--zui-command-input-fg-dark,oklch(98.4%_0.003_247.858))] placeholder:text-[color:var(--zui-command-input-placeholder,oklch(55.1%_0.027_264.364))] dark:placeholder:text-[color:var(--zui-command-input-placeholder-dark,oklch(55.1%_0.027_264.364))] focus:outline-none";
|
|
21
|
+
|
|
22
|
+
export const zuiCommandListBase =
|
|
23
|
+
"max-h-[min(60vh,420px)] overflow-y-auto overscroll-contain p-2";
|
|
24
|
+
|
|
25
|
+
export const zuiCommandGroupHeadingBase =
|
|
26
|
+
"px-2 pb-1 pt-3 text-xs font-semibold uppercase tracking-[0.12em] text-[color:var(--zui-command-group-heading-fg,oklch(55.1%_0.027_264.364))] dark:text-[color:var(--zui-command-group-heading-fg-dark,oklch(70.7%_0.022_261.325))]";
|
|
27
|
+
|
|
28
|
+
export const zuiCommandItemBase =
|
|
29
|
+
"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2 text-sm text-[color:var(--zui-command-item-fg,oklch(27.8%_0.033_256.848))] dark:text-[color:var(--zui-command-item-fg-dark,oklch(86.9%_0.022_252.894))] transition-colors data-[active=true]:bg-[var(--zui-command-item-active-bg,oklch(95.1%_0.026_236.824))] dark:data-[active=true]:bg-[var(--zui-command-item-active-bg-dark,oklch(28.2%_0.091_267.935_/_0.55))] data-[active=true]:text-[color:var(--zui-command-item-active-fg,oklch(20.8%_0.042_265.755))] dark:data-[active=true]:text-[color:var(--zui-command-item-active-fg-dark,oklch(98.4%_0.003_247.858))] aria-disabled:cursor-not-allowed aria-disabled:opacity-50";
|
|
30
|
+
|
|
31
|
+
export const zuiCommandSeparatorBase =
|
|
32
|
+
"my-1 h-px bg-[var(--zui-command-separator-bg,#0000000f)] dark:bg-[var(--zui-command-separator-bg-dark,#ffffff14)]";
|
|
33
|
+
|
|
34
|
+
export const zuiCommandEmptyBase =
|
|
35
|
+
"px-3 py-8 text-center text-sm text-[color:var(--zui-command-empty-fg,oklch(55.1%_0.027_264.364))] dark:text-[color:var(--zui-command-empty-fg-dark,oklch(70.7%_0.022_261.325))]";
|
|
36
|
+
|
|
37
|
+
export const zuiCommandFooterBase =
|
|
38
|
+
"flex items-center gap-3 border-t border-[color:var(--zui-command-footer-border,#0000000f)] dark:border-[color:var(--zui-command-footer-border-dark,#ffffff14)] px-4 py-2 text-xs text-[color:var(--zui-command-footer-fg,oklch(55.1%_0.027_264.364))] dark:text-[color:var(--zui-command-footer-fg-dark,oklch(70.7%_0.022_261.325))]";
|
|
39
|
+
|
|
40
|
+
export const zuiCommandContentAppearances = {
|
|
41
|
+
default:
|
|
42
|
+
"bg-[var(--zui-command-content-default-bg,oklch(98.4%_0.003_247.858))] dark:bg-[var(--zui-command-content-default-bg-dark,oklch(12.9%_0.042_264.695))]",
|
|
43
|
+
glass:
|
|
44
|
+
"border-[color:var(--zui-command-content-glass-border,#00000026)] dark:border-[color:var(--zui-command-content-glass-border-dark,#ffffff26)] bg-[var(--zui-command-content-glass-bg,oklch(98.4%_0.003_247.858_/_0.7))] dark:bg-[var(--zui-command-content-glass-bg-dark,oklch(12.9%_0.042_264.695_/_0.7))] backdrop-blur-xl",
|
|
45
|
+
sky: "border-[color:var(--zui-command-content-sky-border,oklch(44.3%_0.11_240.79))] dark:border-[color:var(--zui-command-content-sky-border-dark,oklch(58.8%_0.158_241.966))] bg-[var(--zui-command-content-sky-bg,oklch(97.7%_0.013_236.62))] dark:bg-[var(--zui-command-content-sky-bg-dark,oklch(29.3%_0.066_243.157_/_0.7))] backdrop-blur-xl",
|
|
46
|
+
rose: "border-[color:var(--zui-command-content-rose-border,oklch(45.5%_0.188_13.697))] dark:border-[color:var(--zui-command-content-rose-border-dark,oklch(58.6%_0.253_17.585))] bg-[var(--zui-command-content-rose-bg,oklch(96.9%_0.015_12.422))] dark:bg-[var(--zui-command-content-rose-bg-dark,oklch(27.1%_0.105_12.094_/_0.7))] backdrop-blur-xl",
|
|
47
|
+
purple:
|
|
48
|
+
"border-[color:var(--zui-command-content-purple-border,oklch(43.8%_0.218_303.724))] dark:border-[color:var(--zui-command-content-purple-border-dark,oklch(55.8%_0.288_302.321))] bg-[var(--zui-command-content-purple-bg,oklch(97.7%_0.014_308.299))] dark:bg-[var(--zui-command-content-purple-bg-dark,oklch(29.1%_0.149_302.717_/_0.7))] backdrop-blur-xl",
|
|
49
|
+
pink: "border-[color:var(--zui-command-content-pink-border,oklch(45.9%_0.187_3.815))] dark:border-[color:var(--zui-command-content-pink-border-dark,oklch(59.2%_0.249_0.584))] bg-[var(--zui-command-content-pink-bg,oklch(97.1%_0.014_343.198))] dark:bg-[var(--zui-command-content-pink-bg-dark,oklch(28.4%_0.109_3.907_/_0.7))] backdrop-blur-xl",
|
|
50
|
+
orange:
|
|
51
|
+
"border-[color:var(--zui-command-content-orange-border,oklch(47%_0.157_37.304))] dark:border-[color:var(--zui-command-content-orange-border-dark,oklch(64.6%_0.222_41.116))] bg-[var(--zui-command-content-orange-bg,oklch(98%_0.016_73.684))] dark:bg-[var(--zui-command-content-orange-bg-dark,oklch(26.6%_0.079_36.259_/_0.7))] backdrop-blur-xl",
|
|
52
|
+
yellow:
|
|
53
|
+
"border-[color:var(--zui-command-content-yellow-border,oklch(47.6%_0.114_61.907))] dark:border-[color:var(--zui-command-content-yellow-border-dark,oklch(68.1%_0.162_75.834))] bg-[var(--zui-command-content-yellow-bg,oklch(98.7%_0.026_102.212))] dark:bg-[var(--zui-command-content-yellow-bg-dark,oklch(28.6%_0.066_53.813_/_0.7))] backdrop-blur-xl",
|
|
54
|
+
teal: "border-[color:var(--zui-command-content-teal-border,oklch(43.7%_0.078_188.216))] dark:border-[color:var(--zui-command-content-teal-border-dark,oklch(60%_0.118_184.704))] bg-[var(--zui-command-content-teal-bg,oklch(98.4%_0.014_180.72))] dark:bg-[var(--zui-command-content-teal-bg-dark,oklch(27.7%_0.046_192.524_/_0.7))] backdrop-blur-xl",
|
|
55
|
+
indigo:
|
|
56
|
+
"border-[color:var(--zui-command-content-indigo-border,oklch(39.8%_0.195_277.366))] dark:border-[color:var(--zui-command-content-indigo-border-dark,oklch(51.1%_0.262_276.966))] bg-[var(--zui-command-content-indigo-bg,oklch(96.2%_0.018_272.314))] dark:bg-[var(--zui-command-content-indigo-bg-dark,oklch(25.7%_0.09_281.288_/_0.7))] backdrop-blur-xl",
|
|
57
|
+
emerald:
|
|
58
|
+
"border-[color:var(--zui-command-content-emerald-border,oklch(43.2%_0.095_166.913))] dark:border-[color:var(--zui-command-content-emerald-border-dark,oklch(59.6%_0.145_163.225))] bg-[var(--zui-command-content-emerald-bg,oklch(97.9%_0.021_166.113))] dark:bg-[var(--zui-command-content-emerald-bg-dark,oklch(26.2%_0.051_172.552_/_0.7))] backdrop-blur-xl",
|
|
59
|
+
gray: "border-[color:var(--zui-command-content-gray-border,oklch(27.8%_0.033_256.848))] dark:border-[color:var(--zui-command-content-gray-border-dark,oklch(44.6%_0.03_256.802))] bg-[var(--zui-command-content-gray-bg,oklch(98.5%_0.002_247.839))] dark:bg-[var(--zui-command-content-gray-bg-dark,oklch(13%_0.028_261.692_/_0.7))] backdrop-blur-xl",
|
|
60
|
+
amber:
|
|
61
|
+
"border-[color:var(--zui-command-content-amber-border,oklch(47.3%_0.137_46.201))] dark:border-[color:var(--zui-command-content-amber-border-dark,oklch(66.6%_0.179_58.318))] bg-[var(--zui-command-content-amber-bg,oklch(98.7%_0.022_95.277))] dark:bg-[var(--zui-command-content-amber-bg-dark,oklch(27.9%_0.077_45.635_/_0.7))] backdrop-blur-xl",
|
|
62
|
+
violet:
|
|
63
|
+
"border-[color:var(--zui-command-content-violet-border,oklch(43.2%_0.232_292.759))] dark:border-[color:var(--zui-command-content-violet-border-dark,oklch(54.1%_0.281_293.009))] bg-[var(--zui-command-content-violet-bg,oklch(96.9%_0.016_293.756))] dark:bg-[var(--zui-command-content-violet-bg-dark,oklch(28.3%_0.141_291.089_/_0.7))] backdrop-blur-xl",
|
|
64
|
+
"gradient-blue":
|
|
65
|
+
"border-[color:var(--zui-command-content-gradient-blue-border,oklch(42.4%_0.199_265.638))] dark:border-[color:var(--zui-command-content-gradient-blue-border-dark,oklch(54.6%_0.245_262.881))] bg-linear-to-br from-[var(--zui-command-content-gradient-blue-from,oklch(97%_0.014_254.604))] dark:from-[var(--zui-command-content-gradient-blue-from-dark,oklch(28.2%_0.091_267.935_/_0.85))] to-[var(--zui-command-content-gradient-blue-to,oklch(97.7%_0.014_308.299))] dark:to-[var(--zui-command-content-gradient-blue-to-dark,oklch(29.1%_0.149_302.717_/_0.85))] backdrop-blur-xl",
|
|
66
|
+
"gradient-green":
|
|
67
|
+
"border-[color:var(--zui-command-content-gradient-green-border,oklch(44.8%_0.119_151.328))] dark:border-[color:var(--zui-command-content-gradient-green-border-dark,oklch(62.7%_0.194_149.214))] bg-linear-to-br from-[var(--zui-command-content-gradient-green-from,oklch(98.2%_0.018_155.826))] dark:from-[var(--zui-command-content-gradient-green-from-dark,oklch(26.6%_0.065_152.934_/_0.85))] to-[var(--zui-command-content-gradient-green-to,oklch(98.6%_0.031_120.757))] dark:to-[var(--zui-command-content-gradient-green-to-dark,oklch(27.4%_0.072_132.109_/_0.85))] backdrop-blur-xl",
|
|
68
|
+
"gradient-red":
|
|
69
|
+
"border-[color:var(--zui-command-content-gradient-red-border,oklch(44.4%_0.177_26.899))] dark:border-[color:var(--zui-command-content-gradient-red-border-dark,oklch(57.7%_0.245_27.325))] bg-linear-to-br from-[var(--zui-command-content-gradient-red-from,oklch(97.1%_0.013_17.38))] dark:from-[var(--zui-command-content-gradient-red-from-dark,oklch(25.8%_0.092_26.042_/_0.85))] to-[var(--zui-command-content-gradient-red-to,oklch(97.1%_0.014_343.198))] dark:to-[var(--zui-command-content-gradient-red-to-dark,oklch(28.4%_0.109_3.907_/_0.85))] backdrop-blur-xl",
|
|
70
|
+
"gradient-yellow":
|
|
71
|
+
"border-[color:var(--zui-command-content-gradient-yellow-border,oklch(47.6%_0.114_61.907))] dark:border-[color:var(--zui-command-content-gradient-yellow-border-dark,oklch(68.1%_0.162_75.834))] bg-linear-to-br from-[var(--zui-command-content-gradient-yellow-from,oklch(98.7%_0.026_102.212))] dark:from-[var(--zui-command-content-gradient-yellow-from-dark,oklch(28.6%_0.066_53.813_/_0.85))] to-[var(--zui-command-content-gradient-yellow-to,oklch(98%_0.016_73.684))] dark:to-[var(--zui-command-content-gradient-yellow-to-dark,oklch(26.6%_0.079_36.259_/_0.85))] backdrop-blur-xl",
|
|
72
|
+
"gradient-purple":
|
|
73
|
+
"border-[color:var(--zui-command-content-gradient-purple-border,oklch(43.8%_0.218_303.724))] dark:border-[color:var(--zui-command-content-gradient-purple-border-dark,oklch(55.8%_0.288_302.321))] bg-linear-to-br from-[var(--zui-command-content-gradient-purple-from,oklch(97.7%_0.014_308.299))] dark:from-[var(--zui-command-content-gradient-purple-from-dark,oklch(29.1%_0.149_302.717_/_0.85))] to-[var(--zui-command-content-gradient-purple-to,oklch(97.1%_0.014_343.198))] dark:to-[var(--zui-command-content-gradient-purple-to-dark,oklch(28.4%_0.109_3.907_/_0.85))] backdrop-blur-xl",
|
|
74
|
+
"gradient-teal":
|
|
75
|
+
"border-[color:var(--zui-command-content-gradient-teal-border,oklch(43.7%_0.078_188.216))] dark:border-[color:var(--zui-command-content-gradient-teal-border-dark,oklch(60%_0.118_184.704))] bg-linear-to-br from-[var(--zui-command-content-gradient-teal-from,oklch(98.4%_0.014_180.72))] dark:from-[var(--zui-command-content-gradient-teal-from-dark,oklch(27.7%_0.046_192.524_/_0.85))] to-[var(--zui-command-content-gradient-teal-to,oklch(98.4%_0.019_200.873))] dark:to-[var(--zui-command-content-gradient-teal-to-dark,oklch(30.2%_0.056_229.695_/_0.85))] backdrop-blur-xl",
|
|
76
|
+
"gradient-indigo":
|
|
77
|
+
"border-[color:var(--zui-command-content-gradient-indigo-border,oklch(39.8%_0.195_277.366))] dark:border-[color:var(--zui-command-content-gradient-indigo-border-dark,oklch(51.1%_0.262_276.966))] bg-linear-to-br from-[var(--zui-command-content-gradient-indigo-from,oklch(96.2%_0.018_272.314))] dark:from-[var(--zui-command-content-gradient-indigo-from-dark,oklch(25.7%_0.09_281.288_/_0.85))] to-[var(--zui-command-content-gradient-indigo-to,oklch(97.7%_0.014_308.299))] dark:to-[var(--zui-command-content-gradient-indigo-to-dark,oklch(29.1%_0.149_302.717_/_0.85))] backdrop-blur-xl",
|
|
78
|
+
"gradient-pink":
|
|
79
|
+
"border-[color:var(--zui-command-content-gradient-pink-border,oklch(45.9%_0.187_3.815))] dark:border-[color:var(--zui-command-content-gradient-pink-border-dark,oklch(59.2%_0.249_0.584))] bg-linear-to-br from-[var(--zui-command-content-gradient-pink-from,oklch(97.1%_0.014_343.198))] dark:from-[var(--zui-command-content-gradient-pink-from-dark,oklch(28.4%_0.109_3.907_/_0.85))] to-[var(--zui-command-content-gradient-pink-to,oklch(96.9%_0.015_12.422))] dark:to-[var(--zui-command-content-gradient-pink-to-dark,oklch(27.1%_0.105_12.094_/_0.85))] backdrop-blur-xl",
|
|
80
|
+
} as const;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CommandAnimationPresets } from "./types";
|
|
2
|
+
|
|
3
|
+
export const commandOverlayAnimationPresets: CommandAnimationPresets = {
|
|
4
|
+
none: {},
|
|
5
|
+
fade: {
|
|
6
|
+
initial: { opacity: 0 },
|
|
7
|
+
animate: { opacity: 1 },
|
|
8
|
+
exit: { opacity: 0 },
|
|
9
|
+
transition: { duration: 0.18 },
|
|
10
|
+
},
|
|
11
|
+
scale: {
|
|
12
|
+
initial: { opacity: 0, scale: 0.97 },
|
|
13
|
+
animate: { opacity: 1, scale: 1 },
|
|
14
|
+
exit: { opacity: 0, scale: 0.97 },
|
|
15
|
+
transition: { type: "spring", stiffness: 440, damping: 34 },
|
|
16
|
+
},
|
|
17
|
+
"slide-down": {
|
|
18
|
+
initial: { opacity: 0, y: -20 },
|
|
19
|
+
animate: { opacity: 1, y: 0 },
|
|
20
|
+
exit: { opacity: 0, y: -12 },
|
|
21
|
+
transition: { type: "spring", stiffness: 420, damping: 32 },
|
|
22
|
+
},
|
|
23
|
+
"slide-up": {
|
|
24
|
+
initial: { opacity: 0, y: 20 },
|
|
25
|
+
animate: { opacity: 1, y: 0 },
|
|
26
|
+
exit: { opacity: 0, y: 12 },
|
|
27
|
+
transition: { type: "spring", stiffness: 420, damping: 32 },
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
|
|
4
|
+
|
|
5
|
+
import { commandOverlayAnimationPresets } from "./animations";
|
|
6
|
+
import type { CommandContentAnimatedProps } from "./types";
|
|
7
|
+
import { CommandContentLayer } from "../command-base";
|
|
8
|
+
|
|
9
|
+
export function CommandContentAnimated({
|
|
10
|
+
className,
|
|
11
|
+
size,
|
|
12
|
+
appearance,
|
|
13
|
+
animation = "slide-down",
|
|
14
|
+
children,
|
|
15
|
+
ref,
|
|
16
|
+
id,
|
|
17
|
+
style,
|
|
18
|
+
}: CommandContentAnimatedProps) {
|
|
19
|
+
const reduceMotion = useReducedMotion();
|
|
20
|
+
const overlayMotion = commandOverlayAnimationPresets.fade;
|
|
21
|
+
const panelMotion =
|
|
22
|
+
commandOverlayAnimationPresets[reduceMotion ? "fade" : animation];
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<CommandContentLayer
|
|
26
|
+
appearance={appearance}
|
|
27
|
+
className={className}
|
|
28
|
+
componentName="CommandContent"
|
|
29
|
+
id={id}
|
|
30
|
+
ref={ref}
|
|
31
|
+
renderOverlay={(overlayProps) => (
|
|
32
|
+
<motion.div
|
|
33
|
+
{...overlayProps}
|
|
34
|
+
initial={overlayMotion.initial}
|
|
35
|
+
animate={overlayMotion.animate}
|
|
36
|
+
exit={overlayMotion.exit}
|
|
37
|
+
transition={overlayMotion.transition}
|
|
38
|
+
/>
|
|
39
|
+
)}
|
|
40
|
+
renderPanel={(panelProps) => (
|
|
41
|
+
<motion.div
|
|
42
|
+
{...panelProps}
|
|
43
|
+
initial={animation === "none" ? false : panelMotion.initial}
|
|
44
|
+
animate={animation === "none" ? undefined : panelMotion.animate}
|
|
45
|
+
exit={animation === "none" ? undefined : panelMotion.exit}
|
|
46
|
+
transition={panelMotion.transition}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
49
|
+
renderPresence={(content) => <AnimatePresence>{content}</AnimatePresence>}
|
|
50
|
+
size={size}
|
|
51
|
+
style={style}
|
|
52
|
+
>
|
|
53
|
+
{children}
|
|
54
|
+
</CommandContentLayer>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
CommandContentAnimated.displayName = "CommandContent";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
export { CommandContentAnimated } from "./command-content-animated";
|
|
4
|
+
export type {
|
|
5
|
+
CommandContentAnimatedProps,
|
|
6
|
+
CommandAnimation,
|
|
7
|
+
CommandAnimationPresets,
|
|
8
|
+
CommandPresetMotionProps,
|
|
9
|
+
} from "./types";
|
|
10
|
+
export { commandOverlayAnimationPresets } from "./animations";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLMotionProps } from "framer-motion";
|
|
2
|
+
import type { CommandContentProps } from "../types";
|
|
3
|
+
|
|
4
|
+
export type CommandAnimation =
|
|
5
|
+
| "none"
|
|
6
|
+
| "fade"
|
|
7
|
+
| "scale"
|
|
8
|
+
| "slide-down"
|
|
9
|
+
| "slide-up";
|
|
10
|
+
|
|
11
|
+
export type CommandContentAnimatedProps = CommandContentProps & {
|
|
12
|
+
animation?: CommandAnimation;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type CommandPresetMotionProps = Pick<
|
|
16
|
+
HTMLMotionProps<"div">,
|
|
17
|
+
"initial" | "animate" | "exit" | "transition"
|
|
18
|
+
>;
|
|
19
|
+
|
|
20
|
+
export type CommandAnimationPresets = Record<
|
|
21
|
+
CommandAnimation,
|
|
22
|
+
CommandPresetMotionProps
|
|
23
|
+
>;
|