@mastra/playground-ui 45.0.0 → 45.1.0-alpha.1

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/dist/CommandPalette.css +135 -0
  3. package/dist/command-Duq1xsiS.js +168 -0
  4. package/dist/command-Duq1xsiS.js.map +1 -0
  5. package/dist/command-qsEykgml.cjs +197 -0
  6. package/dist/command-qsEykgml.cjs.map +1 -0
  7. package/dist/components/ChatShell.cjs.js +96 -0
  8. package/dist/components/ChatShell.cjs.js.map +1 -0
  9. package/dist/components/ChatShell.d.ts +2 -0
  10. package/dist/components/ChatShell.es.js +92 -0
  11. package/dist/components/ChatShell.es.js.map +1 -0
  12. package/dist/components/Command.cjs.js +10 -191
  13. package/dist/components/Command.cjs.js.map +1 -1
  14. package/dist/components/Command.es.js +1 -167
  15. package/dist/components/Command.es.js.map +1 -1
  16. package/dist/components/CommandPalette.cjs.js +180 -0
  17. package/dist/components/CommandPalette.cjs.js.map +1 -0
  18. package/dist/components/CommandPalette.d.ts +2 -0
  19. package/dist/components/CommandPalette.es.js +169 -0
  20. package/dist/components/CommandPalette.es.js.map +1 -0
  21. package/dist/components/Kbd.cjs.js +3 -24
  22. package/dist/components/Kbd.cjs.js.map +1 -1
  23. package/dist/components/Kbd.es.js +1 -26
  24. package/dist/components/Kbd.es.js.map +1 -1
  25. package/dist/components/MessageScroller.cjs.js +8 -524
  26. package/dist/components/MessageScroller.cjs.js.map +1 -1
  27. package/dist/components/MessageScroller.es.js +2 -504
  28. package/dist/components/MessageScroller.es.js.map +1 -1
  29. package/dist/components/ThreadRail.cjs.js +1 -1
  30. package/dist/components/ThreadRail.es.js +1 -1
  31. package/dist/kbd-Br7kdwaB.cjs +34 -0
  32. package/dist/kbd-Br7kdwaB.cjs.map +1 -0
  33. package/dist/kbd-DE0nj4DL.js +32 -0
  34. package/dist/kbd-DE0nj4DL.js.map +1 -0
  35. package/dist/message-scroller-BQpwFsqj.js +563 -0
  36. package/dist/message-scroller-BQpwFsqj.js.map +1 -0
  37. package/dist/message-scroller-DIgCd5n3.cjs +589 -0
  38. package/dist/message-scroller-DIgCd5n3.cjs.map +1 -0
  39. package/dist/{message-scroller-hooks-DdXqrmC2.cjs → message-scroller-context-_VfCYFBU.cjs} +6 -48
  40. package/dist/message-scroller-context-_VfCYFBU.cjs.map +1 -0
  41. package/dist/message-scroller-context-tTA6jxho.js +23 -0
  42. package/dist/message-scroller-context-tTA6jxho.js.map +1 -0
  43. package/dist/message-scroller-hooks-BxAf8k0Y.cjs +72 -0
  44. package/dist/message-scroller-hooks-BxAf8k0Y.cjs.map +1 -0
  45. package/dist/{message-scroller-hooks-CdsHnth6.js → message-scroller-hooks-D5yxCon2.js} +3 -19
  46. package/dist/message-scroller-hooks-D5yxCon2.js.map +1 -0
  47. package/dist/src/ds/components/ChatShell/chat-shell.d.ts +46 -0
  48. package/dist/src/ds/components/ChatShell/chat-shell.stories.d.ts +8 -0
  49. package/dist/src/ds/components/ChatShell/index.d.ts +11 -0
  50. package/dist/src/ds/components/CommandPalette/command-palette.d.ts +37 -0
  51. package/dist/src/ds/components/CommandPalette/command-palette.stories.d.ts +12 -0
  52. package/dist/src/ds/components/CommandPalette/index.d.ts +1 -0
  53. package/dist/src/ds/components/Kbd/kbd.d.ts +2 -1
  54. package/dist/src/ds/components/MessageScroller/message-scroller-context.d.ts +4 -0
  55. package/dist/src/ds/components/MessageScroller/message-scroller.d.ts +8 -7
  56. package/dist/style.css +343 -2
  57. package/package.json +6 -6
  58. package/dist/message-scroller-hooks-CdsHnth6.js.map +0 -1
  59. package/dist/message-scroller-hooks-DdXqrmC2.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,80 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 45.1.0-alpha.1
4
+
5
+ ### Minor Changes
6
+
7
+ - Added `ChatShell`, a chat page frame with a single scroll container. Bars sit above the scroller, the composer docks inside it as `sticky bottom-0`, and every region — transcript, notices, task list, composer — is centred by one `ChatShell.Column`. That removes the band of background that used to separate the transcript from the composer, and keeps absolutely positioned affordances such as jump-to-latest anchored to the shell instead of escaping to a full-width page wrapper and centring on the wrong axis. ([#20455](https://github.com/mastra-ai/mastra/pull/20455))
8
+
9
+ ```tsx
10
+ <ChatShell
11
+ className="[--chat-column:44rem]"
12
+ scroller={{ autoScroll: true, preserveScrollOnPrepend: true, onReachStart: loadOlderHistory }}
13
+ >
14
+ <ChatShell.Bar>
15
+ <SessionHeader />
16
+ </ChatShell.Bar>
17
+ <ChatShell.Stage>
18
+ <ChatShell.Viewport>
19
+ <ChatShell.Content>
20
+ <ChatShell.Column>{messages}</ChatShell.Column>
21
+ </ChatShell.Content>
22
+ <ChatShell.Dock>
23
+ <ChatShell.ScrollButton />
24
+ <ChatShell.Column>
25
+ <Composer />
26
+ </ChatShell.Column>
27
+ </ChatShell.Dock>
28
+ </ChatShell.Viewport>
29
+ </ChatShell.Stage>
30
+ </ChatShell>
31
+ ```
32
+
33
+ The dock keeps its place in flow, so its own height is the room the transcript scrolls behind and nothing has to measure it. A composer that grows as the reader types therefore leaves the transcript exactly where it was, instead of dragging it up a line at a time.
34
+
35
+ Custom properties tune it: `--chat-column` for the column width, `--chat-surface` for the page colour, `--chat-gutter` for the room kept above and below the composer, `--chat-veil` for what the dock paints with (translucent by default, so a line passing behind the composer stays faintly readable), and `--chat-inset-end` for room an overlay panel claims on the end edge.
36
+
37
+ **MessageScroller** `MessageScrollerProvider` gained `onReachStart`, called when the reader reaches the start of the transcript, and `preserveScrollOnPrepend`, which holds the reading position when older messages land above the current ones. `autoScroll` now also follows content that grows mid-stream, and leaves a reader who scrolled away alone instead of pulling them back to the end. `preserveScrollOnPrepend` moved off `MessageScrollerViewport`, where it set a data attribute and nothing else. `MessageScrollerItem` no longer throws outside a scroller, so the same row renderer can be reused on draft pages and previews. `MessageScrollerButton` now carries a minimum size and a soft two-layer shadow, so it reads as a floating control rather than a bare icon.
38
+
39
+ **Migration**
40
+
41
+ ```tsx
42
+ // Before
43
+ <MessageScrollerViewport preserveScrollOnPrepend />
44
+
45
+ // After
46
+ <MessageScrollerProvider preserveScrollOnPrepend>
47
+ <MessageScrollerViewport />
48
+ </MessageScrollerProvider>
49
+ ```
50
+
51
+ - Added reusable command palette primitives for consistent application search layouts. ([#20453](https://github.com/mastra-ai/mastra/pull/20453))
52
+
53
+ import { CommandPaletteDialog } from "@mastra/playground-ui/components/CommandPalette";
54
+
55
+ <CommandPaletteDialog open={open} onOpenChange={setOpen}>...</CommandPaletteDialog>
56
+
57
+ - Added `size` variants to `Kbd` so keyboard hints can sit inside compact controls without hand-written overrides. Sizes are `default` (24px), `sm` (20px) and `xs` (16px), each with a fixed height so the scale stays even across fonts. ([#20453](https://github.com/mastra-ai/mastra/pull/20453))
58
+
59
+ <Kbd size="sm">Esc</Kbd>
60
+ <Kbd size="xs">⌘ K</Kbd>
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [[`c5e56ff`](https://github.com/mastra-ai/mastra/commit/c5e56ff3bcabdf062708f2d48744fec304df6792), [`c5e56ff`](https://github.com/mastra-ai/mastra/commit/c5e56ff3bcabdf062708f2d48744fec304df6792), [`4e35a56`](https://github.com/mastra-ai/mastra/commit/4e35a56cdf8d74a5ff6d5eda01f2c1deaf6cc7be)]:
65
+ - @mastra/core@1.56.0-alpha.1
66
+ - @mastra/client-js@1.36.1-alpha.1
67
+ - @mastra/react@1.3.5-alpha.1
68
+
69
+ ## 45.0.1-alpha.0
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [[`7f4e26d`](https://github.com/mastra-ai/mastra/commit/7f4e26dd57bd9b23c278ea21235ab823a3810a6c), [`b582f7f`](https://github.com/mastra-ai/mastra/commit/b582f7fa2f9c1f87d19efc63d344fbe5dda2608c), [`b582f7f`](https://github.com/mastra-ai/mastra/commit/b582f7fa2f9c1f87d19efc63d344fbe5dda2608c)]:
74
+ - @mastra/core@1.56.0-alpha.0
75
+ - @mastra/client-js@1.36.1-alpha.0
76
+ - @mastra/react@1.3.5-alpha.0
77
+
3
78
  ## 45.0.0
4
79
 
5
80
  ### Patch Changes
@@ -0,0 +1,135 @@
1
+ /* Fixed height: dialog is centred, so a content-driven one slides the input while typing.
2
+ * Unlayered on purpose — `Command`'s own `size-full` height would otherwise win by utility order. */
3
+ .command-palette-shell {
4
+ height: var(--command-palette-height, min(34rem, calc(100dvh - 2rem)));
5
+ max-height: calc(100dvh - 2rem);
6
+ }
7
+
8
+ .command-palette-popup[data-open] {
9
+ animation: none !important;
10
+ }
11
+
12
+ .command-palette-popup[data-closed] {
13
+ animation: command-palette-popup-hold 260ms linear both !important;
14
+ }
15
+
16
+ .command-palette-surface {
17
+ --command-palette-enter-delay: 0ms;
18
+ --command-palette-exit-delay: 0ms;
19
+
20
+ transform-origin: center;
21
+ will-change: opacity, transform;
22
+ }
23
+
24
+ .command-palette-surface-input {
25
+ --command-palette-enter-delay: 20ms;
26
+ --command-palette-exit-delay: 80ms;
27
+ }
28
+
29
+ .command-palette-surface-rail {
30
+ --command-palette-enter-delay: 60ms;
31
+ --command-palette-exit-delay: 40ms;
32
+ }
33
+
34
+ .command-palette-surface-results {
35
+ --command-palette-enter-delay: 100ms;
36
+ --command-palette-exit-delay: 0ms;
37
+ }
38
+
39
+ .command-palette-results-panel {
40
+ --command-palette-footer-height: 4.75rem;
41
+
42
+ isolation: isolate;
43
+ }
44
+
45
+ .command-palette-results-panel::after {
46
+ position: absolute;
47
+ right: 0;
48
+ bottom: 0;
49
+ left: 0;
50
+ z-index: 10;
51
+ height: var(--command-palette-footer-height);
52
+ pointer-events: none;
53
+ content: '';
54
+ background: linear-gradient(
55
+ to top,
56
+ var(--surface2) 0%,
57
+ var(--surface2) 28%,
58
+ color-mix(in oklab, var(--surface2) 94%, transparent) 68%,
59
+ transparent 100%
60
+ );
61
+ border-bottom-right-radius: 1rem;
62
+ border-bottom-left-radius: 1rem;
63
+ }
64
+
65
+ .command-palette-list {
66
+ padding: 0.5rem 0.5rem var(--command-palette-footer-height);
67
+ }
68
+
69
+ .command-palette-scroll-viewport {
70
+ scroll-padding-bottom: var(--command-palette-footer-height);
71
+ }
72
+
73
+ .command-palette-footer {
74
+ min-height: calc(var(--command-palette-footer-height) - 1.25rem);
75
+ border-bottom-right-radius: 1rem;
76
+ border-bottom-left-radius: 1rem;
77
+ }
78
+
79
+ .command-palette-popup[data-open] .command-palette-surface {
80
+ animation: command-palette-surface-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
81
+ animation-delay: var(--command-palette-enter-delay);
82
+ }
83
+
84
+ .command-palette-popup[data-closed] .command-palette-surface {
85
+ animation: command-palette-surface-out 180ms cubic-bezier(0.5, 0, 0.75, 0) both;
86
+ animation-delay: var(--command-palette-exit-delay);
87
+ }
88
+
89
+ @keyframes command-palette-surface-in {
90
+ from {
91
+ opacity: 0;
92
+ transform: scale(1.02);
93
+ }
94
+
95
+ to {
96
+ opacity: 1;
97
+ transform: scale(1);
98
+ }
99
+ }
100
+
101
+ @keyframes command-palette-surface-out {
102
+ from {
103
+ opacity: 1;
104
+ transform: scale(1);
105
+ }
106
+
107
+ to {
108
+ opacity: 0;
109
+ transform: scale(1.01);
110
+ }
111
+ }
112
+
113
+ @keyframes command-palette-popup-hold {
114
+ from {
115
+ opacity: 1;
116
+ }
117
+
118
+ to {
119
+ opacity: 1;
120
+ }
121
+ }
122
+
123
+ @media (prefers-reduced-motion: reduce) {
124
+ .command-palette-popup[data-open],
125
+ .command-palette-popup[data-closed],
126
+ .command-palette-popup[data-open] .command-palette-surface,
127
+ .command-palette-popup[data-closed] .command-palette-surface {
128
+ animation: none !important;
129
+ }
130
+
131
+ .command-palette-surface {
132
+ opacity: 1;
133
+ transform: none;
134
+ }
135
+ }
@@ -0,0 +1,168 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { Command as Command$1 } from 'cmdk';
3
+ import { Search } from 'lucide-react';
4
+ import * as React from 'react';
5
+ import { D as Dialog, c as DialogContent, i as DialogTitle, d as DialogDescription } from './dialog-bnt6epW2.js';
6
+ import { S as ScrollArea } from './scroll-area-DZrEuKjC.js';
7
+ import { transitions } from './primitives/transitions.es.js';
8
+ import { c as cn } from './cn-BakJzhuv.js';
9
+
10
+ const Command = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
11
+ Command$1,
12
+ {
13
+ ref,
14
+ className: cn("flex size-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4", className),
15
+ ...props
16
+ }
17
+ ));
18
+ Command.displayName = Command$1.displayName;
19
+ const CommandDialog = ({
20
+ children,
21
+ title = "Command Palette",
22
+ description = "Search for commands and actions",
23
+ contentClassName,
24
+ commandClassName,
25
+ commandLabel,
26
+ showOverlay = false,
27
+ overlayClassName,
28
+ ...props
29
+ }) => {
30
+ const filter = React.useCallback((value, search) => {
31
+ const normalizedValue = value.toLowerCase();
32
+ const normalizedSearch = search.toLowerCase();
33
+ const searchTerms = normalizedSearch.split(/\s+/).filter(Boolean);
34
+ const matches = searchTerms.every((term) => normalizedValue.includes(term));
35
+ return matches ? 1 : 0;
36
+ }, []);
37
+ const handleKeyDown = React.useCallback((e) => {
38
+ if (e.key === "Escape") return;
39
+ e.stopPropagation();
40
+ }, []);
41
+ return /* @__PURE__ */ jsx(Dialog, { ...props, children: /* @__PURE__ */ jsxs(
42
+ DialogContent,
43
+ {
44
+ showOverlay,
45
+ overlayClassName,
46
+ className: cn("overflow-hidden p-0", contentClassName),
47
+ children: [
48
+ /* @__PURE__ */ jsx(DialogTitle, { className: "sr-only", children: title }),
49
+ /* @__PURE__ */ jsx(DialogDescription, { className: "sr-only", children: description }),
50
+ /* @__PURE__ */ jsx(
51
+ Command,
52
+ {
53
+ label: commandLabel,
54
+ loop: true,
55
+ filter,
56
+ onKeyDown: handleKeyDown,
57
+ className: cn(
58
+ "[&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:text-neutral3",
59
+ "[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2",
60
+ "[&_[data-slot=command-input-wrapper]_svg]:size-5",
61
+ "**:[[cmdk-input]]:h-12",
62
+ "**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3",
63
+ "[&_[cmdk-item]_svg]:size-5",
64
+ commandClassName
65
+ ),
66
+ children
67
+ }
68
+ )
69
+ ]
70
+ }
71
+ ) });
72
+ };
73
+ const CommandInput = React.forwardRef(
74
+ ({ className, rightSlot, wrapperClassName, ...props }, ref) => /* @__PURE__ */ jsxs(
75
+ "div",
76
+ {
77
+ "data-slot": "command-input-wrapper",
78
+ className: cn("flex items-center border-b border-border1 px-3", transitions.colors, wrapperClassName),
79
+ children: [
80
+ /* @__PURE__ */ jsx(Search, { className: cn("mr-2 size-4 shrink-0 text-neutral3", transitions.colors) }),
81
+ /* @__PURE__ */ jsx(
82
+ Command$1.Input,
83
+ {
84
+ ref,
85
+ className: cn(
86
+ "flex h-10 min-w-0 flex-1 rounded-md bg-transparent py-3 text-ui-smd leading-ui-sm text-neutral6",
87
+ "placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50",
88
+ "outline-none focus:outline-none focus-visible:outline-none",
89
+ transitions.colors,
90
+ className
91
+ ),
92
+ ...props
93
+ }
94
+ ),
95
+ rightSlot && /* @__PURE__ */ jsx("div", { "data-slot": "command-input-right-slot", className: "text-neutral3 ml-2 flex shrink-0 items-center", children: rightSlot })
96
+ ]
97
+ }
98
+ )
99
+ );
100
+ CommandInput.displayName = Command$1.Input.displayName;
101
+ const CommandList = React.forwardRef(
102
+ ({ className, scrollArea = false, scrollAreaClassName, scrollAreaViewportClassName, scrollAreaMask, ...props }, ref) => {
103
+ const list = /* @__PURE__ */ jsx(
104
+ Command$1.List,
105
+ {
106
+ ref,
107
+ className: cn(
108
+ "outline-none focus:outline-none focus-visible:outline-none",
109
+ scrollArea ? "overflow-visible" : "max-h-dropdown-max-height overflow-x-hidden overflow-y-auto",
110
+ className
111
+ ),
112
+ ...props
113
+ }
114
+ );
115
+ if (!scrollArea) return list;
116
+ return /* @__PURE__ */ jsx(
117
+ ScrollArea,
118
+ {
119
+ className: cn("min-h-0", scrollAreaClassName),
120
+ viewPortClassName: scrollAreaViewportClassName,
121
+ mask: scrollAreaMask,
122
+ children: list
123
+ }
124
+ );
125
+ }
126
+ );
127
+ CommandList.displayName = Command$1.List.displayName;
128
+ const CommandEmpty = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(Command$1.Empty, { ref, className: "text-ui-smd text-neutral3 py-6 text-center", ...props }));
129
+ CommandEmpty.displayName = Command$1.Empty.displayName;
130
+ const CommandGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
131
+ Command$1.Group,
132
+ {
133
+ ref,
134
+ className: cn(
135
+ "overflow-hidden p-1 text-neutral4",
136
+ "[&_[cmdk-group-heading]]:text-ui-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 **:[[cmdk-group-heading]]:tracking-wider **:[[cmdk-group-heading]]:text-neutral3 **:[[cmdk-group-heading]]:uppercase",
137
+ className
138
+ ),
139
+ ...props
140
+ }
141
+ ));
142
+ CommandGroup.displayName = Command$1.Group.displayName;
143
+ const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.Separator, { ref, className: cn("-mx-1 h-px bg-border1", className), ...props }));
144
+ CommandSeparator.displayName = Command$1.Separator.displayName;
145
+ const CommandItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
146
+ Command$1.Item,
147
+ {
148
+ ref,
149
+ className: cn(
150
+ "relative flex cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-ui-smd leading-ui-sm text-neutral4 select-none",
151
+ "outline-none focus:outline-none focus-visible:outline-none",
152
+ transitions.colors,
153
+ "data-[selected=true]:bg-surface4 data-[selected=true]:text-neutral6",
154
+ "data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
155
+ "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-neutral3 data-[selected=true]:[&_svg]:text-neutral6",
156
+ className
157
+ ),
158
+ ...props
159
+ }
160
+ ));
161
+ CommandItem.displayName = Command$1.Item.displayName;
162
+ const CommandShortcut = ({ className, ...props }) => {
163
+ return /* @__PURE__ */ jsx("span", { className: cn("ml-auto text-ui-xs tracking-wider text-neutral3 tabular-nums", className), ...props });
164
+ };
165
+ CommandShortcut.displayName = "CommandShortcut";
166
+
167
+ export { Command as C, CommandDialog as a, CommandEmpty as b, CommandGroup as c, CommandInput as d, CommandItem as e, CommandList as f, CommandSeparator as g, CommandShortcut as h };
168
+ //# sourceMappingURL=command-Duq1xsiS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-Duq1xsiS.js","sources":["../src/ds/components/Command/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport * as React from 'react';\n\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/ds/components/Dialog';\nimport { ScrollArea } from '@/ds/components/ScrollArea';\nimport type { ScrollAreaMask } from '@/ds/components/ScrollArea';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn('flex size-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4', className)}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ntype CommandDialogProps = Omit<React.ComponentPropsWithoutRef<typeof Dialog>, 'children'> & {\n children?: React.ReactNode;\n title?: string;\n description?: string;\n contentClassName?: string;\n commandClassName?: string;\n commandLabel?: string;\n showOverlay?: boolean;\n overlayClassName?: string;\n};\n\nconst CommandDialog = ({\n children,\n title = 'Command Palette',\n description = 'Search for commands and actions',\n contentClassName,\n commandClassName,\n commandLabel,\n showOverlay = false,\n overlayClassName,\n ...props\n}: CommandDialogProps) => {\n // Custom filter that preserves DOM order by returning 1 for all matches\n // This prevents cmdk from reordering items by match score\n const filter = React.useCallback((value: string, search: string) => {\n const normalizedValue = value.toLowerCase();\n const normalizedSearch = search.toLowerCase();\n const searchTerms = normalizedSearch.split(/\\s+/).filter(Boolean);\n\n // All search terms must be found in the value\n const matches = searchTerms.every(term => normalizedValue.includes(term));\n return matches ? 1 : 0;\n }, []);\n\n // Stop propagation to prevent keyboard events from reaching\n // global document-level listeners (e.g., table keyboard nav)\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Escape') return;\n\n e.stopPropagation();\n }, []);\n\n return (\n <Dialog {...props}>\n <DialogContent\n showOverlay={showOverlay}\n overlayClassName={overlayClassName}\n className={cn('overflow-hidden p-0', contentClassName)}\n >\n <DialogTitle className=\"sr-only\">{title}</DialogTitle>\n <DialogDescription className=\"sr-only\">{description}</DialogDescription>\n <Command\n label={commandLabel}\n loop\n filter={filter}\n onKeyDown={handleKeyDown}\n className={cn(\n '[&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:text-neutral3',\n '[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2',\n '[&_[data-slot=command-input-wrapper]_svg]:size-5',\n '**:[[cmdk-input]]:h-12',\n '**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3',\n '[&_[cmdk-item]_svg]:size-5',\n commandClassName,\n )}\n >\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\ntype CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & {\n rightSlot?: React.ReactNode;\n wrapperClassName?: string;\n};\n\nconst CommandInput = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Input>, CommandInputProps>(\n ({ className, rightSlot, wrapperClassName, ...props }, ref) => (\n <div\n data-slot=\"command-input-wrapper\"\n className={cn('flex items-center border-b border-border1 px-3', transitions.colors, wrapperClassName)}\n >\n <Search className={cn('mr-2 size-4 shrink-0 text-neutral3', transitions.colors)} />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-10 min-w-0 flex-1 rounded-md bg-transparent py-3 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n className,\n )}\n {...props}\n />\n {rightSlot && (\n <div data-slot=\"command-input-right-slot\" className=\"text-neutral3 ml-2 flex shrink-0 items-center\">\n {rightSlot}\n </div>\n )}\n </div>\n ),\n);\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\ntype CommandListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> & {\n scrollArea?: boolean;\n scrollAreaClassName?: string;\n scrollAreaViewportClassName?: string;\n scrollAreaMask?: ScrollAreaMask;\n};\n\nconst CommandList = React.forwardRef<React.ElementRef<typeof CommandPrimitive.List>, CommandListProps>(\n (\n { className, scrollArea = false, scrollAreaClassName, scrollAreaViewportClassName, scrollAreaMask, ...props },\n ref,\n ) => {\n const list = (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n 'outline-none focus:outline-none focus-visible:outline-none',\n scrollArea ? 'overflow-visible' : 'max-h-dropdown-max-height overflow-x-hidden overflow-y-auto',\n className,\n )}\n {...props}\n />\n );\n\n if (!scrollArea) return list;\n\n return (\n <ScrollArea\n className={cn('min-h-0', scrollAreaClassName)}\n viewPortClassName={scrollAreaViewportClassName}\n mask={scrollAreaMask}\n >\n {list}\n </ScrollArea>\n );\n },\n);\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"text-ui-smd text-neutral3 py-6 text-center\" {...props} />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'overflow-hidden p-1 text-neutral4',\n '[&_[cmdk-group-heading]]:text-ui-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 **:[[cmdk-group-heading]]:tracking-wider **:[[cmdk-group-heading]]:text-neutral3 **:[[cmdk-group-heading]]:uppercase',\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator ref={ref} className={cn('-mx-1 h-px bg-border1', className)} {...props} />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-ui-smd leading-ui-sm text-neutral4 select-none',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-[selected=true]:bg-surface4 data-[selected=true]:text-neutral6',\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-neutral3 data-[selected=true]:[&_svg]:text-neutral6',\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-ui-xs tracking-wider text-neutral3 tabular-nums', className)} {...props} />;\n};\nCommandShortcut.displayName = 'CommandShortcut';\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandSeparator,\n CommandShortcut,\n};\n"],"names":["CommandPrimitive"],"mappings":";;;;;;;;;AAUA,MAAM,OAAA,GAAU,MAAM,UAAA,CAGpB,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1B,GAAA;AAAA,EAACA,SAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,8EAAA,EAAgF,SAAS,CAAA;AAAA,IACtG,GAAG;AAAA;AACN,CACD;AACD,OAAA,CAAQ,cAAcA,SAAA,CAAiB,WAAA;AAavC,MAAM,gBAAgB,CAAC;AAAA,EACrB,QAAA;AAAA,EACA,KAAA,GAAQ,iBAAA;AAAA,EACR,WAAA,GAAc,iCAAA;AAAA,EACd,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA,GAAc,KAAA;AAAA,EACd,gBAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA0B;AAGxB,EAAA,MAAM,MAAA,GAAS,KAAA,CAAM,WAAA,CAAY,CAAC,OAAe,MAAA,KAAmB;AAClE,IAAA,MAAM,eAAA,GAAkB,MAAM,WAAA,EAAY;AAC1C,IAAA,MAAM,gBAAA,GAAmB,OAAO,WAAA,EAAY;AAC5C,IAAA,MAAM,cAAc,gBAAA,CAAiB,KAAA,CAAM,KAAK,CAAA,CAAE,OAAO,OAAO,CAAA;AAGhE,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AAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1B,GAAA;AAAA,EAACA,SAAA,CAAiB,IAAA;AAAA,EAAjB;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,8HAAA;AAAA,MACA,4DAAA;AAAA,MACA,WAAA,CAAY,MAAA;AAAA,MACZ,qEAAA;AAAA,MACA,0EAAA;AAAA,MACA,8HAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,WAAA,CAAY,WAAA,GAAcA,UAAiB,IAAA,CAAK,WAAA;AAEhD,MAAM,kBAAkB,CAAC,EAAE,SAAA,EAAW,GAAG,OAAM,KAA6C;AAC1F,EAAA,uBAAO,GAAA,CAAC,UAAK,SAAA,EAAW,EAAA,CAAG,gEAAgE,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AACpH;AACA,eAAA,CAAgB,WAAA,GAAc,iBAAA;;;;"}
@@ -0,0 +1,197 @@
1
+ 'use strict';
2
+
3
+ const jsxRuntime = require('react/jsx-runtime');
4
+ const cmdk = require('cmdk');
5
+ const lucideReact = require('lucide-react');
6
+ const React = require('react');
7
+ const dialog = require('./dialog-ClItuCFY.cjs');
8
+ const scrollArea = require('./scroll-area-Dv6QagXt.cjs');
9
+ const primitives_transitions = require('./primitives/transitions.cjs.js');
10
+ const utils_cn = require('./cn-vA5sWo9W.cjs');
11
+
12
+ function _interopNamespaceDefault(e) {
13
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
14
+ if (e) {
15
+ for (const k in e) {
16
+ if (k !== 'default') {
17
+ const d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: () => e[k]
21
+ });
22
+ }
23
+ }
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+
29
+ const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
30
+
31
+ const Command = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
32
+ cmdk.Command,
33
+ {
34
+ ref,
35
+ className: utils_cn.cn("flex size-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4", className),
36
+ ...props
37
+ }
38
+ ));
39
+ Command.displayName = cmdk.Command.displayName;
40
+ const CommandDialog = ({
41
+ children,
42
+ title = "Command Palette",
43
+ description = "Search for commands and actions",
44
+ contentClassName,
45
+ commandClassName,
46
+ commandLabel,
47
+ showOverlay = false,
48
+ overlayClassName,
49
+ ...props
50
+ }) => {
51
+ const filter = React__namespace.useCallback((value, search) => {
52
+ const normalizedValue = value.toLowerCase();
53
+ const normalizedSearch = search.toLowerCase();
54
+ const searchTerms = normalizedSearch.split(/\s+/).filter(Boolean);
55
+ const matches = searchTerms.every((term) => normalizedValue.includes(term));
56
+ return matches ? 1 : 0;
57
+ }, []);
58
+ const handleKeyDown = React__namespace.useCallback((e) => {
59
+ if (e.key === "Escape") return;
60
+ e.stopPropagation();
61
+ }, []);
62
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
63
+ dialog.DialogContent,
64
+ {
65
+ showOverlay,
66
+ overlayClassName,
67
+ className: utils_cn.cn("overflow-hidden p-0", contentClassName),
68
+ children: [
69
+ /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { className: "sr-only", children: title }),
70
+ /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogDescription, { className: "sr-only", children: description }),
71
+ /* @__PURE__ */ jsxRuntime.jsx(
72
+ Command,
73
+ {
74
+ label: commandLabel,
75
+ loop: true,
76
+ filter,
77
+ onKeyDown: handleKeyDown,
78
+ className: utils_cn.cn(
79
+ "[&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:text-neutral3",
80
+ "[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2",
81
+ "[&_[data-slot=command-input-wrapper]_svg]:size-5",
82
+ "**:[[cmdk-input]]:h-12",
83
+ "**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3",
84
+ "[&_[cmdk-item]_svg]:size-5",
85
+ commandClassName
86
+ ),
87
+ children
88
+ }
89
+ )
90
+ ]
91
+ }
92
+ ) });
93
+ };
94
+ const CommandInput = React__namespace.forwardRef(
95
+ ({ className, rightSlot, wrapperClassName, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
96
+ "div",
97
+ {
98
+ "data-slot": "command-input-wrapper",
99
+ className: utils_cn.cn("flex items-center border-b border-border1 px-3", primitives_transitions.transitions.colors, wrapperClassName),
100
+ children: [
101
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: utils_cn.cn("mr-2 size-4 shrink-0 text-neutral3", primitives_transitions.transitions.colors) }),
102
+ /* @__PURE__ */ jsxRuntime.jsx(
103
+ cmdk.Command.Input,
104
+ {
105
+ ref,
106
+ className: utils_cn.cn(
107
+ "flex h-10 min-w-0 flex-1 rounded-md bg-transparent py-3 text-ui-smd leading-ui-sm text-neutral6",
108
+ "placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50",
109
+ "outline-none focus:outline-none focus-visible:outline-none",
110
+ primitives_transitions.transitions.colors,
111
+ className
112
+ ),
113
+ ...props
114
+ }
115
+ ),
116
+ rightSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "command-input-right-slot", className: "text-neutral3 ml-2 flex shrink-0 items-center", children: rightSlot })
117
+ ]
118
+ }
119
+ )
120
+ );
121
+ CommandInput.displayName = cmdk.Command.Input.displayName;
122
+ const CommandList = React__namespace.forwardRef(
123
+ ({ className, scrollArea: scrollArea$1 = false, scrollAreaClassName, scrollAreaViewportClassName, scrollAreaMask, ...props }, ref) => {
124
+ const list = /* @__PURE__ */ jsxRuntime.jsx(
125
+ cmdk.Command.List,
126
+ {
127
+ ref,
128
+ className: utils_cn.cn(
129
+ "outline-none focus:outline-none focus-visible:outline-none",
130
+ scrollArea$1 ? "overflow-visible" : "max-h-dropdown-max-height overflow-x-hidden overflow-y-auto",
131
+ className
132
+ ),
133
+ ...props
134
+ }
135
+ );
136
+ if (!scrollArea$1) return list;
137
+ return /* @__PURE__ */ jsxRuntime.jsx(
138
+ scrollArea.ScrollArea,
139
+ {
140
+ className: utils_cn.cn("min-h-0", scrollAreaClassName),
141
+ viewPortClassName: scrollAreaViewportClassName,
142
+ mask: scrollAreaMask,
143
+ children: list
144
+ }
145
+ );
146
+ }
147
+ );
148
+ CommandList.displayName = cmdk.Command.List.displayName;
149
+ const CommandEmpty = React__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(cmdk.Command.Empty, { ref, className: "text-ui-smd text-neutral3 py-6 text-center", ...props }));
150
+ CommandEmpty.displayName = cmdk.Command.Empty.displayName;
151
+ const CommandGroup = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
152
+ cmdk.Command.Group,
153
+ {
154
+ ref,
155
+ className: utils_cn.cn(
156
+ "overflow-hidden p-1 text-neutral4",
157
+ "[&_[cmdk-group-heading]]:text-ui-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 **:[[cmdk-group-heading]]:tracking-wider **:[[cmdk-group-heading]]:text-neutral3 **:[[cmdk-group-heading]]:uppercase",
158
+ className
159
+ ),
160
+ ...props
161
+ }
162
+ ));
163
+ CommandGroup.displayName = cmdk.Command.Group.displayName;
164
+ const CommandSeparator = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(cmdk.Command.Separator, { ref, className: utils_cn.cn("-mx-1 h-px bg-border1", className), ...props }));
165
+ CommandSeparator.displayName = cmdk.Command.Separator.displayName;
166
+ const CommandItem = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
167
+ cmdk.Command.Item,
168
+ {
169
+ ref,
170
+ className: utils_cn.cn(
171
+ "relative flex cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-ui-smd leading-ui-sm text-neutral4 select-none",
172
+ "outline-none focus:outline-none focus-visible:outline-none",
173
+ primitives_transitions.transitions.colors,
174
+ "data-[selected=true]:bg-surface4 data-[selected=true]:text-neutral6",
175
+ "data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
176
+ "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-neutral3 data-[selected=true]:[&_svg]:text-neutral6",
177
+ className
178
+ ),
179
+ ...props
180
+ }
181
+ ));
182
+ CommandItem.displayName = cmdk.Command.Item.displayName;
183
+ const CommandShortcut = ({ className, ...props }) => {
184
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: utils_cn.cn("ml-auto text-ui-xs tracking-wider text-neutral3 tabular-nums", className), ...props });
185
+ };
186
+ CommandShortcut.displayName = "CommandShortcut";
187
+
188
+ exports.Command = Command;
189
+ exports.CommandDialog = CommandDialog;
190
+ exports.CommandEmpty = CommandEmpty;
191
+ exports.CommandGroup = CommandGroup;
192
+ exports.CommandInput = CommandInput;
193
+ exports.CommandItem = CommandItem;
194
+ exports.CommandList = CommandList;
195
+ exports.CommandSeparator = CommandSeparator;
196
+ exports.CommandShortcut = CommandShortcut;
197
+ //# sourceMappingURL=command-qsEykgml.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-qsEykgml.cjs","sources":["../src/ds/components/Command/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport * as React from 'react';\n\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/ds/components/Dialog';\nimport { ScrollArea } from '@/ds/components/ScrollArea';\nimport type { ScrollAreaMask } from '@/ds/components/ScrollArea';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn('flex size-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4', className)}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ntype CommandDialogProps = Omit<React.ComponentPropsWithoutRef<typeof Dialog>, 'children'> & {\n children?: React.ReactNode;\n title?: string;\n description?: string;\n contentClassName?: string;\n commandClassName?: string;\n commandLabel?: string;\n showOverlay?: boolean;\n overlayClassName?: string;\n};\n\nconst CommandDialog = ({\n children,\n title = 'Command Palette',\n description = 'Search for commands and actions',\n contentClassName,\n commandClassName,\n commandLabel,\n showOverlay = false,\n overlayClassName,\n ...props\n}: CommandDialogProps) => {\n // Custom filter that preserves DOM order by returning 1 for all matches\n // This prevents cmdk from reordering items by match score\n const filter = React.useCallback((value: string, search: string) => {\n const normalizedValue = value.toLowerCase();\n const normalizedSearch = search.toLowerCase();\n const searchTerms = normalizedSearch.split(/\\s+/).filter(Boolean);\n\n // All search terms must be found in the value\n const matches = searchTerms.every(term => normalizedValue.includes(term));\n return matches ? 1 : 0;\n }, []);\n\n // Stop propagation to prevent keyboard events from reaching\n // global document-level listeners (e.g., table keyboard nav)\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Escape') return;\n\n e.stopPropagation();\n }, []);\n\n return (\n <Dialog {...props}>\n <DialogContent\n showOverlay={showOverlay}\n overlayClassName={overlayClassName}\n className={cn('overflow-hidden p-0', contentClassName)}\n >\n <DialogTitle className=\"sr-only\">{title}</DialogTitle>\n <DialogDescription className=\"sr-only\">{description}</DialogDescription>\n <Command\n label={commandLabel}\n loop\n filter={filter}\n onKeyDown={handleKeyDown}\n className={cn(\n '[&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:text-neutral3',\n '[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2',\n '[&_[data-slot=command-input-wrapper]_svg]:size-5',\n '**:[[cmdk-input]]:h-12',\n '**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3',\n '[&_[cmdk-item]_svg]:size-5',\n commandClassName,\n )}\n >\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\ntype CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & {\n rightSlot?: React.ReactNode;\n wrapperClassName?: string;\n};\n\nconst CommandInput = React.forwardRef<React.ElementRef<typeof CommandPrimitive.Input>, CommandInputProps>(\n ({ className, rightSlot, wrapperClassName, ...props }, ref) => (\n <div\n data-slot=\"command-input-wrapper\"\n className={cn('flex items-center border-b border-border1 px-3', transitions.colors, wrapperClassName)}\n >\n <Search className={cn('mr-2 size-4 shrink-0 text-neutral3', transitions.colors)} />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-10 min-w-0 flex-1 rounded-md bg-transparent py-3 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n className,\n )}\n {...props}\n />\n {rightSlot && (\n <div data-slot=\"command-input-right-slot\" className=\"text-neutral3 ml-2 flex shrink-0 items-center\">\n {rightSlot}\n </div>\n )}\n </div>\n ),\n);\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\ntype CommandListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> & {\n scrollArea?: boolean;\n scrollAreaClassName?: string;\n scrollAreaViewportClassName?: string;\n scrollAreaMask?: ScrollAreaMask;\n};\n\nconst CommandList = React.forwardRef<React.ElementRef<typeof CommandPrimitive.List>, CommandListProps>(\n (\n { className, scrollArea = false, scrollAreaClassName, scrollAreaViewportClassName, scrollAreaMask, ...props },\n ref,\n ) => {\n const list = (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n 'outline-none focus:outline-none focus-visible:outline-none',\n scrollArea ? 'overflow-visible' : 'max-h-dropdown-max-height overflow-x-hidden overflow-y-auto',\n className,\n )}\n {...props}\n />\n );\n\n if (!scrollArea) return list;\n\n return (\n <ScrollArea\n className={cn('min-h-0', scrollAreaClassName)}\n viewPortClassName={scrollAreaViewportClassName}\n mask={scrollAreaMask}\n >\n {list}\n </ScrollArea>\n );\n },\n);\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"text-ui-smd text-neutral3 py-6 text-center\" {...props} />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'overflow-hidden p-1 text-neutral4',\n '[&_[cmdk-group-heading]]:text-ui-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 **:[[cmdk-group-heading]]:tracking-wider **:[[cmdk-group-heading]]:text-neutral3 **:[[cmdk-group-heading]]:uppercase',\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator ref={ref} className={cn('-mx-1 h-px bg-border1', className)} {...props} />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-ui-smd leading-ui-sm text-neutral4 select-none',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-[selected=true]:bg-surface4 data-[selected=true]:text-neutral6',\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-neutral3 data-[selected=true]:[&_svg]:text-neutral6',\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-ui-xs tracking-wider text-neutral3 tabular-nums', className)} {...props} />;\n};\nCommandShortcut.displayName = 'CommandShortcut';\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandSeparator,\n CommandShortcut,\n};\n"],"names":["React","jsx","CommandPrimitive","cn","Dialog","jsxs","DialogContent","DialogTitle","DialogDescription","transitions","Search","scrollArea","ScrollArea"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,OAAA,GAAUA,iBAAM,UAAA,CAGpB,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1BC,cAAA;AAAA,EAACC,YAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAWC,WAAA,CAAG,8EAAA,EAAgF,SAAS,CAAA;AAAA,IACtG,GAAG;AAAA;AACN,CACD;AACD,OAAA,CAAQ,cAAcD,YAAA,CAAiB,WAAA;AAavC,MAAM,gBAAgB,CAAC;AAAA,EACrB,QAAA;AAAA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