@open-slide/core 1.17.1 → 1.18.0

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.
@@ -1,4 +1,4 @@
1
- import { Locale } from "./types-Di7nvL8V.js";
1
+ import { Locale } from "./types-Wz88-Fe1.js";
2
2
 
3
3
  //#region src/config.d.ts
4
4
  type OpenSlideBuildConfig = {
@@ -390,6 +390,32 @@ const en = {
390
390
  generating: "Building presentation…",
391
391
  done: "Done"
392
392
  },
393
+ commandMenu: {
394
+ trigger: "Commands",
395
+ triggerAria: "Open command menu",
396
+ triggerTooltip: "Search",
397
+ placeholder: "Search slides or run a command…",
398
+ slidePlaceholder: "Search this deck or run a command…",
399
+ empty: "No results.",
400
+ groupSlides: "Slides",
401
+ groupFolders: "Folders",
402
+ groupNavigation: "Go to",
403
+ groupPresent: "Present",
404
+ groupDeck: "This deck",
405
+ groupExport: "Export",
406
+ groupPages: "Pages",
407
+ groupAppearance: "Appearance",
408
+ groupDeveloper: "Developer",
409
+ goToPage: "Page {n}",
410
+ overview: "Slide overview",
411
+ designPanel: "Toggle design panel",
412
+ backToSlides: "Back to all slides",
413
+ themeItem: "Theme: {name}",
414
+ languageItem: "Language: {name}",
415
+ hintNavigate: "Navigate",
416
+ hintSelect: "Select",
417
+ hintClose: "Close"
418
+ },
393
419
  themeToggle: {
394
420
  toggleAria: "Toggle theme",
395
421
  title: "Theme",
@@ -827,6 +853,32 @@ const ja = {
827
853
  generating: "プレゼンテーションを構築中…",
828
854
  done: "完了"
829
855
  },
856
+ commandMenu: {
857
+ trigger: "コマンド",
858
+ triggerAria: "コマンドメニューを開く",
859
+ triggerTooltip: "検索",
860
+ placeholder: "スライドを検索、またはコマンドを実行…",
861
+ slidePlaceholder: "このデッキを検索、またはコマンドを実行…",
862
+ empty: "結果がありません。",
863
+ groupSlides: "スライド",
864
+ groupFolders: "フォルダ",
865
+ groupNavigation: "移動",
866
+ groupPresent: "発表",
867
+ groupDeck: "このデッキ",
868
+ groupExport: "エクスポート",
869
+ groupPages: "ページ",
870
+ groupAppearance: "外観",
871
+ groupDeveloper: "開発",
872
+ goToPage: "{n} ページ目",
873
+ overview: "ページ一覧",
874
+ designPanel: "デザインパネルの切り替え",
875
+ backToSlides: "すべてのスライドへ戻る",
876
+ themeItem: "テーマ: {name}",
877
+ languageItem: "言語: {name}",
878
+ hintNavigate: "移動",
879
+ hintSelect: "選択",
880
+ hintClose: "閉じる"
881
+ },
830
882
  themeToggle: {
831
883
  toggleAria: "テーマを切り替え",
832
884
  title: "テーマ",
@@ -1264,6 +1316,32 @@ const zhCN = {
1264
1316
  generating: "正在组合演示文稿…",
1265
1317
  done: "完成"
1266
1318
  },
1319
+ commandMenu: {
1320
+ trigger: "命令",
1321
+ triggerAria: "打开命令菜单",
1322
+ triggerTooltip: "搜索",
1323
+ placeholder: "搜索幻灯片或执行命令…",
1324
+ slidePlaceholder: "搜索这份幻灯片或执行命令…",
1325
+ empty: "没有匹配的结果。",
1326
+ groupSlides: "幻灯片",
1327
+ groupFolders: "文件夹",
1328
+ groupNavigation: "前往",
1329
+ groupPresent: "放映",
1330
+ groupDeck: "这份幻灯片",
1331
+ groupExport: "导出",
1332
+ groupPages: "页面",
1333
+ groupAppearance: "外观",
1334
+ groupDeveloper: "开发",
1335
+ goToPage: "第 {n} 页",
1336
+ overview: "页面总览",
1337
+ designPanel: "切换设计面板",
1338
+ backToSlides: "回到所有幻灯片",
1339
+ themeItem: "主题:{name}",
1340
+ languageItem: "语言:{name}",
1341
+ hintNavigate: "移动",
1342
+ hintSelect: "选择",
1343
+ hintClose: "关闭"
1344
+ },
1267
1345
  themeToggle: {
1268
1346
  toggleAria: "切换主题",
1269
1347
  title: "主题",
@@ -1701,6 +1779,32 @@ const zhTW = {
1701
1779
  generating: "正在組合簡報…",
1702
1780
  done: "完成"
1703
1781
  },
1782
+ commandMenu: {
1783
+ trigger: "指令",
1784
+ triggerAria: "開啟指令選單",
1785
+ triggerTooltip: "搜尋",
1786
+ placeholder: "搜尋簡報或執行指令…",
1787
+ slidePlaceholder: "搜尋這份簡報或執行指令…",
1788
+ empty: "沒有符合的結果。",
1789
+ groupSlides: "簡報",
1790
+ groupFolders: "資料夾",
1791
+ groupNavigation: "前往",
1792
+ groupPresent: "播放",
1793
+ groupDeck: "這份簡報",
1794
+ groupExport: "匯出",
1795
+ groupPages: "頁面",
1796
+ groupAppearance: "外觀",
1797
+ groupDeveloper: "開發",
1798
+ goToPage: "第 {n} 頁",
1799
+ overview: "頁面總覽",
1800
+ designPanel: "切換設計面板",
1801
+ backToSlides: "回到所有簡報",
1802
+ themeItem: "主題:{name}",
1803
+ languageItem: "語言:{name}",
1804
+ hintNavigate: "移動",
1805
+ hintSelect: "選擇",
1806
+ hintClose: "關閉"
1807
+ },
1704
1808
  themeToggle: {
1705
1809
  toggleAria: "切換主題",
1706
1810
  title: "主題",
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { Locale, Plural } from "./types-Di7nvL8V.js";
2
- import { OpenSlideConfig } from "./config-DIvIP8vY.js";
1
+ import { Locale, Plural } from "./types-Wz88-Fe1.js";
2
+ import { OpenSlideConfig } from "./config-CYs4WJfL.js";
3
3
  import { CSSProperties, ComponentType, HTMLAttributes, PropsWithChildren, ReactNode } from "react";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
5
  import * as react_jsx_runtime1 from "react/jsx-runtime";
5
- import * as react_jsx_runtime2 from "react/jsx-runtime";
6
6
  import * as react_jsx_runtime4 from "react/jsx-runtime";
7
7
  import * as react_jsx_runtime5 from "react/jsx-runtime";
8
8
 
@@ -21,7 +21,7 @@ declare function ImagePlaceholder({
21
21
  style,
22
22
  className,
23
23
  ...rest
24
- }: ImagePlaceholderProps): react_jsx_runtime1.JSX.Element;
24
+ }: ImagePlaceholderProps): react_jsx_runtime0.JSX.Element;
25
25
 
26
26
  //#endregion
27
27
  //#region src/app/components/morph-element.d.ts
@@ -36,7 +36,7 @@ declare function MorphElement({
36
36
  children,
37
37
  className,
38
38
  style
39
- }: MorphElementProps): react_jsx_runtime2.JSX.Element;
39
+ }: MorphElementProps): react_jsx_runtime1.JSX.Element;
40
40
 
41
41
  //#endregion
42
42
  //#region src/app/lib/design.d.ts
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { en, ja, zhCN, zhTW } from "./format-CxmsgcBh.js";
1
+ import { en, ja, zhCN, zhTW } from "./format-CxPnpVRu.js";
2
2
  import { cssVarsToString, defaultDesign, designToCssVars } from "./design-cpzS8aud.js";
3
3
  import { Children, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
4
4
  import { toast } from "sonner";
@@ -1,4 +1,4 @@
1
- import { Locale, Plural } from "../types-Di7nvL8V.js";
1
+ import { Locale, Plural } from "../types-Wz88-Fe1.js";
2
2
 
3
3
  //#region src/locale/en.d.ts
4
4
  declare const en: Locale;
@@ -1,3 +1,3 @@
1
- import { en, format, ja, plural, zhCN, zhTW } from "../format-CxmsgcBh.js";
1
+ import { en, format, ja, plural, zhCN, zhTW } from "../format-CxPnpVRu.js";
2
2
 
3
3
  export { en, format, ja, plural, zhCN, zhTW };
@@ -423,6 +423,35 @@ type Locale = {
423
423
  generating: string;
424
424
  done: string;
425
425
  };
426
+ commandMenu: {
427
+ trigger: string;
428
+ triggerAria: string;
429
+ triggerTooltip: string;
430
+ placeholder: string;
431
+ slidePlaceholder: string;
432
+ empty: string;
433
+ groupSlides: string;
434
+ groupFolders: string;
435
+ groupNavigation: string;
436
+ groupPresent: string;
437
+ groupDeck: string;
438
+ groupExport: string;
439
+ groupPages: string;
440
+ groupAppearance: string;
441
+ groupDeveloper: string;
442
+ /** template: "Page {n}" */
443
+ goToPage: string;
444
+ overview: string;
445
+ designPanel: string;
446
+ backToSlides: string;
447
+ /** template: "Theme: {name}" */
448
+ themeItem: string;
449
+ /** template: "Language: {name}" */
450
+ languageItem: string;
451
+ hintNavigate: string;
452
+ hintSelect: string;
453
+ hintClose: string;
454
+ };
426
455
  themeToggle: {
427
456
  toggleAria: string;
428
457
  title: string;
@@ -1,5 +1,5 @@
1
- import "../types-Di7nvL8V.js";
2
- import { OpenSlideConfig } from "../config-DIvIP8vY.js";
1
+ import "../types-Wz88-Fe1.js";
2
+ import { OpenSlideConfig } from "../config-CYs4WJfL.js";
3
3
  import { InlineConfig } from "vite";
4
4
 
5
5
  //#region src/vite/config.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-slide/core",
3
- "version": "1.17.1",
3
+ "version": "1.18.0",
4
4
  "description": "Runtime and CLI for open-slide — write slides in slides/, we handle the rest.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -68,9 +68,10 @@
68
68
  "@fontsource-variable/geist": "^5.2.8",
69
69
  "@tailwindcss/vite": "^4.3.3",
70
70
  "@vitejs/plugin-react": "^4.3.3",
71
- "chalk": "^5.3.0",
71
+ "chalk": "^6.0.0",
72
72
  "class-variance-authority": "^0.7.1",
73
73
  "clsx": "^2.1.1",
74
+ "cmdk": "^1.1.1",
74
75
  "commander": "^15.0.0",
75
76
  "emoji-picker-react": "^4.19.1",
76
77
  "fast-glob": "^3.3.2",
@@ -91,6 +92,7 @@
91
92
  "vite": "^5.4.10"
92
93
  },
93
94
  "devDependencies": {
95
+ "@playwright/test": "~1.56.1",
94
96
  "@types/node": "^22.19.17",
95
97
  "@types/react": "^18.3.12",
96
98
  "@types/react-dom": "^18.3.1",
@@ -99,6 +101,7 @@
99
101
  },
100
102
  "scripts": {
101
103
  "build": "tsdown",
102
- "typecheck": "tsc --noEmit"
104
+ "typecheck": "tsc --noEmit",
105
+ "test:e2e": "pnpm run build && playwright test"
103
106
  }
104
107
  }
@@ -0,0 +1,227 @@
1
+ import { Check, Languages, Loader2, Monitor, Moon, RotateCw, Search, Sun } from 'lucide-react';
2
+ import { useTheme } from 'next-themes';
3
+ import { type ReactNode, useEffect, useMemo, useState } from 'react';
4
+ import { IconTooltip } from '@/components/icon-tooltip';
5
+ import { buttonVariants } from '@/components/ui/button';
6
+ import { TooltipTrigger } from '@/components/ui/tooltip';
7
+ import { LOCALE_OPTIONS, setLocale } from '@/lib/locale-store';
8
+ import { format, useLocale } from '@/lib/use-locale';
9
+ import { useRestartServer } from '@/lib/use-restart-server';
10
+ import {
11
+ Command,
12
+ CommandDialog,
13
+ CommandEmpty,
14
+ CommandGroup,
15
+ CommandInput,
16
+ CommandItem,
17
+ CommandList,
18
+ CommandShortcut,
19
+ } from './command';
20
+
21
+ export type CommandSpec = {
22
+ id: string;
23
+ label: string;
24
+ icon?: ReactNode;
25
+ /** Extra match terms — ASCII aliases keep commands findable under any locale. */
26
+ keywords?: string[];
27
+ shortcut?: string;
28
+ disabled?: boolean;
29
+ active?: boolean;
30
+ run: () => void | Promise<void>;
31
+ };
32
+
33
+ export type CommandGroupSpec = {
34
+ id: string;
35
+ heading: string;
36
+ items: CommandSpec[];
37
+ /** Long lists (deck pages) only surface once the user types, so the idle menu stays scannable. */
38
+ searchOnly?: boolean;
39
+ };
40
+
41
+ export function CommandMenu({
42
+ open,
43
+ onOpenChange,
44
+ groups,
45
+ placeholder,
46
+ }: {
47
+ open: boolean;
48
+ onOpenChange: (open: boolean) => void;
49
+ groups: CommandGroupSpec[];
50
+ placeholder: string;
51
+ }) {
52
+ const t = useLocale();
53
+ const [search, setSearch] = useState('');
54
+ const sharedGroups = useSharedCommandGroups();
55
+
56
+ useEffect(() => {
57
+ const onKey = (event: KeyboardEvent) => {
58
+ if (event.key !== 'k' && event.key !== 'K') return;
59
+ if (!event.metaKey && !event.ctrlKey) return;
60
+ // Auto-repeat while the combo is held would toggle the menu shut again.
61
+ if (event.repeat) return;
62
+ event.preventDefault();
63
+ onOpenChange(!open);
64
+ };
65
+ window.addEventListener('keydown', onKey);
66
+ return () => window.removeEventListener('keydown', onKey);
67
+ }, [open, onOpenChange]);
68
+
69
+ useEffect(() => {
70
+ if (!open) setSearch('');
71
+ }, [open]);
72
+
73
+ const searching = search.trim().length > 0;
74
+ const visibleGroups = [...groups, ...sharedGroups].filter(
75
+ (group) => group.items.length > 0 && (searching || !group.searchOnly),
76
+ );
77
+
78
+ const run = (item: CommandSpec) => {
79
+ if (item.disabled) return;
80
+ // Close first: exports, fullscreen and panels all expect an unobstructed page.
81
+ onOpenChange(false);
82
+ void item.run();
83
+ };
84
+
85
+ return (
86
+ <CommandDialog
87
+ open={open}
88
+ onOpenChange={onOpenChange}
89
+ title={t.commandMenu.trigger}
90
+ description={placeholder}
91
+ >
92
+ <Command label={t.commandMenu.trigger} loop>
93
+ <CommandInput value={search} onValueChange={setSearch} placeholder={placeholder} />
94
+ <CommandList>
95
+ <CommandEmpty>{t.commandMenu.empty}</CommandEmpty>
96
+ {visibleGroups.map((group) => (
97
+ <CommandGroup key={group.id} heading={group.heading}>
98
+ {group.items.map((item) => (
99
+ <CommandItem
100
+ key={item.id}
101
+ value={item.id}
102
+ keywords={[item.label, ...(item.keywords ?? [])]}
103
+ disabled={item.disabled}
104
+ onSelect={() => run(item)}
105
+ >
106
+ {item.icon}
107
+ <span className="min-w-0 flex-1 truncate">{item.label}</span>
108
+ {item.active && <Check className="ml-auto opacity-100 text-brand" aria-hidden />}
109
+ {item.shortcut && <CommandShortcut>{item.shortcut}</CommandShortcut>}
110
+ </CommandItem>
111
+ ))}
112
+ </CommandGroup>
113
+ ))}
114
+ </CommandList>
115
+ <CommandFooter />
116
+ </Command>
117
+ </CommandDialog>
118
+ );
119
+ }
120
+
121
+ const IS_APPLE =
122
+ typeof navigator !== 'undefined' && /Mac|iPhone|iPad|iPod/.test(navigator.userAgent);
123
+
124
+ export const COMMAND_MENU_SHORTCUT = IS_APPLE ? '⌘K' : 'Ctrl K';
125
+
126
+ export function CommandMenuTrigger({ onClick }: { onClick: () => void }) {
127
+ const t = useLocale();
128
+ return (
129
+ <IconTooltip label={t.commandMenu.triggerTooltip} shortcut={COMMAND_MENU_SHORTCUT}>
130
+ <TooltipTrigger
131
+ type="button"
132
+ onClick={onClick}
133
+ aria-label={t.commandMenu.triggerAria}
134
+ aria-haspopup="dialog"
135
+ className={buttonVariants({ variant: 'ghost', size: 'icon-sm' })}
136
+ >
137
+ <Search className="size-3.5" />
138
+ </TooltipTrigger>
139
+ </IconTooltip>
140
+ );
141
+ }
142
+
143
+ function CommandFooter() {
144
+ const t = useLocale();
145
+ return (
146
+ <div className="flex items-center justify-between gap-3 border-t border-hairline bg-muted/30 px-3 py-2 text-[10.5px] text-muted-foreground">
147
+ <Hint keys="esc" label={t.commandMenu.hintClose} />
148
+ <span className="inline-flex items-center gap-3">
149
+ <Hint keys="↑↓" label={t.commandMenu.hintNavigate} />
150
+ <Hint keys="↵" label={t.commandMenu.hintSelect} />
151
+ </span>
152
+ </div>
153
+ );
154
+ }
155
+
156
+ function Hint({ keys, label }: { keys: string; label: string }) {
157
+ return (
158
+ <span className="inline-flex items-center gap-1">
159
+ <kbd className="rounded-[3px] border border-hairline bg-card px-1 py-0.5 font-mono text-[9.5px] leading-none">
160
+ {keys}
161
+ </kbd>
162
+ {label}
163
+ </span>
164
+ );
165
+ }
166
+
167
+ function useSharedCommandGroups(): CommandGroupSpec[] {
168
+ const t = useLocale();
169
+ const { theme, setTheme } = useTheme();
170
+ const { canRestart, restarting, restartServer } = useRestartServer();
171
+
172
+ return useMemo(() => {
173
+ const appearance: CommandSpec[] = [
174
+ {
175
+ id: 'theme-light',
176
+ label: format(t.commandMenu.themeItem, { name: t.themeToggle.light }),
177
+ icon: <Sun />,
178
+ keywords: ['theme', 'light', 'appearance'],
179
+ active: theme === 'light',
180
+ run: () => setTheme('light'),
181
+ },
182
+ {
183
+ id: 'theme-dark',
184
+ label: format(t.commandMenu.themeItem, { name: t.themeToggle.dark }),
185
+ icon: <Moon />,
186
+ keywords: ['theme', 'dark', 'appearance'],
187
+ active: theme === 'dark',
188
+ run: () => setTheme('dark'),
189
+ },
190
+ {
191
+ id: 'theme-system',
192
+ label: format(t.commandMenu.themeItem, { name: t.themeToggle.system }),
193
+ icon: <Monitor />,
194
+ keywords: ['theme', 'system', 'appearance'],
195
+ active: theme === 'system',
196
+ run: () => setTheme('system'),
197
+ },
198
+ ...LOCALE_OPTIONS.map((option) => ({
199
+ id: `locale-${option.id}`,
200
+ label: format(t.commandMenu.languageItem, { name: option.label }),
201
+ icon: <Languages />,
202
+ keywords: ['language', 'locale', option.id],
203
+ active: t.id === option.id,
204
+ run: () => setLocale(option.id),
205
+ })),
206
+ ];
207
+
208
+ const developer: CommandSpec[] =
209
+ import.meta.env.DEV && canRestart
210
+ ? [
211
+ {
212
+ id: 'restart-dev-server',
213
+ label: restarting ? t.home.restartingServer : t.home.restartServer,
214
+ icon: restarting ? <Loader2 className="animate-spin" /> : <RotateCw />,
215
+ keywords: ['restart', 'dev', 'server', 'reload'],
216
+ disabled: restarting,
217
+ run: restartServer,
218
+ },
219
+ ]
220
+ : [];
221
+
222
+ return [
223
+ { id: 'appearance', heading: t.commandMenu.groupAppearance, items: appearance },
224
+ { id: 'developer', heading: t.commandMenu.groupDeveloper, items: developer },
225
+ ];
226
+ }, [t, theme, setTheme, canRestart, restarting, restartServer]);
227
+ }
@@ -0,0 +1,142 @@
1
+ import { Command as CommandPrimitive } from 'cmdk';
2
+ import { Search } from 'lucide-react';
3
+ import type * as React from 'react';
4
+ import { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/components/ui/dialog';
5
+ import { cn } from '@/lib/utils';
6
+
7
+ function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
8
+ return (
9
+ <CommandPrimitive
10
+ data-slot="command"
11
+ className={cn('flex h-full w-full flex-col overflow-hidden', className)}
12
+ {...props}
13
+ />
14
+ );
15
+ }
16
+
17
+ function CommandDialog({
18
+ open,
19
+ onOpenChange,
20
+ title,
21
+ description,
22
+ children,
23
+ }: {
24
+ open: boolean;
25
+ onOpenChange: (open: boolean) => void;
26
+ title: string;
27
+ description: string;
28
+ children: React.ReactNode;
29
+ }) {
30
+ return (
31
+ <Dialog open={open} onOpenChange={onOpenChange}>
32
+ <DialogContent
33
+ showCloseButton={false}
34
+ className="top-[14vh] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-[560px]"
35
+ >
36
+ <DialogTitle className="sr-only">{title}</DialogTitle>
37
+ <DialogDescription className="sr-only">{description}</DialogDescription>
38
+ {children}
39
+ </DialogContent>
40
+ </Dialog>
41
+ );
42
+ }
43
+
44
+ function CommandInput({
45
+ className,
46
+ ...props
47
+ }: React.ComponentProps<typeof CommandPrimitive.Input>) {
48
+ return (
49
+ <div className="flex items-center gap-2 border-b border-hairline px-3">
50
+ <Search className="size-3.5 shrink-0 text-muted-foreground" aria-hidden />
51
+ <CommandPrimitive.Input
52
+ data-slot="command-input"
53
+ className={cn(
54
+ 'h-11 w-full bg-transparent text-[13px] outline-none placeholder:text-muted-foreground/70 disabled:opacity-50',
55
+ className,
56
+ )}
57
+ {...props}
58
+ />
59
+ </div>
60
+ );
61
+ }
62
+
63
+ function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {
64
+ return (
65
+ <CommandPrimitive.List
66
+ data-slot="command-list"
67
+ className={cn(
68
+ 'max-h-[min(56vh,380px)] scroll-py-1 overflow-y-auto overscroll-contain p-1',
69
+ className,
70
+ )}
71
+ {...props}
72
+ />
73
+ );
74
+ }
75
+
76
+ function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
77
+ return (
78
+ <CommandPrimitive.Empty
79
+ data-slot="command-empty"
80
+ className="px-3 py-10 text-center text-[12.5px] text-muted-foreground"
81
+ {...props}
82
+ />
83
+ );
84
+ }
85
+
86
+ function CommandGroup({
87
+ className,
88
+ ...props
89
+ }: React.ComponentProps<typeof CommandPrimitive.Group>) {
90
+ return (
91
+ <CommandPrimitive.Group
92
+ data-slot="command-group"
93
+ className={cn(
94
+ 'overflow-hidden pt-1.5 pb-1 [&:not(:first-child)]:mt-1 [&:not(:first-child)]:border-t [&:not(:first-child)]:border-hairline',
95
+ '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pt-1 [&_[cmdk-group-heading]]:pb-1.5',
96
+ '[&_[cmdk-group-heading]]:text-[10px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:tracking-[0.08em] [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:text-muted-foreground/70',
97
+ className,
98
+ )}
99
+ {...props}
100
+ />
101
+ );
102
+ }
103
+
104
+ function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {
105
+ return (
106
+ <CommandPrimitive.Item
107
+ data-slot="command-item"
108
+ className={cn(
109
+ 'relative flex cursor-default select-none items-center gap-2 rounded-[5px] px-2 py-1.5 text-[12.5px] outline-none',
110
+ 'data-[selected=true]:bg-muted data-[selected=true]:text-foreground',
111
+ 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-45',
112
+ "[&_svg]:size-3.5 [&_svg]:shrink-0 [&_svg]:text-muted-foreground [&_svg:not([class*='opacity'])]:opacity-80",
113
+ className,
114
+ )}
115
+ {...props}
116
+ />
117
+ );
118
+ }
119
+
120
+ function CommandShortcut({ className, ...props }: React.ComponentProps<'kbd'>) {
121
+ return (
122
+ <kbd
123
+ data-slot="command-shortcut"
124
+ className={cn(
125
+ 'ml-auto shrink-0 rounded-[3px] bg-muted px-1.5 py-0.5 font-mono text-[9.5px] tracking-[0.04em] text-muted-foreground',
126
+ className,
127
+ )}
128
+ {...props}
129
+ />
130
+ );
131
+ }
132
+
133
+ export {
134
+ Command,
135
+ CommandDialog,
136
+ CommandEmpty,
137
+ CommandGroup,
138
+ CommandInput,
139
+ CommandItem,
140
+ CommandList,
141
+ CommandShortcut,
142
+ };