@adea-ai/ui 0.162.16 → 0.162.18

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 +1 @@
1
- {"version":3,"file":"message-composer.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message-composer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAKvD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAkBrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IAC5E,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,iFAAiF;IACjF,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sDAAsD;IACtD,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACrB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACtB,iEAAiE;IACjE,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,0DAA0D;IAC1D,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,IAAI,CAAA;KAAE,CAAA;IAClD,iFAAiF;IACjF,QAAQ,CAAC,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAA;IACnC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gFAAgF;IAChF,SAAS,CAAC,EAAE,SAAS,GAAG,aAAa,CAAA;IACrC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAAA;CAC3C,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eA0K1D;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,eAkB1E;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,eAgBtD"}
1
+ {"version":3,"file":"message-composer.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message-composer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAKvD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAkBrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IAC5E,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,CAAC,KAAK,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,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,eAkB1E;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,eAgBtD"}
@@ -202,29 +202,32 @@ function MessageComposer(props) {
202
202
  },
203
203
  children: (leadingSlot) => memo(leadingSlot)
204
204
  });
205
- } }), createComponent(PromptInputTools, { get children() {
206
- return [createComponent(Show, {
207
- get when() {
208
- return local.trailing;
209
- },
210
- children: (trailingSlot) => memo(trailingSlot)
211
- }), createComponent(PromptInputSubmit, {
212
- get status() {
213
- return sending() ? "submitted" : "ready";
214
- },
215
- get disabled() {
216
- return !canSend();
217
- },
218
- get label() {
219
- return actionLabel();
220
- },
221
- get "aria-label"() {
222
- return memo(() => {
223
- return !!sending();
224
- })() ? pendingLabel() : actionLabel();
225
- }
226
- })];
227
- } })];
205
+ } }), createComponent(PromptInputTools, {
206
+ class: "shrink-0",
207
+ get children() {
208
+ return [createComponent(Show, {
209
+ get when() {
210
+ return local.trailing;
211
+ },
212
+ children: (trailingSlot) => memo(trailingSlot)
213
+ }), createComponent(PromptInputSubmit, {
214
+ get status() {
215
+ return sending() ? "submitted" : "ready";
216
+ },
217
+ get disabled() {
218
+ return !canSend();
219
+ },
220
+ get label() {
221
+ return actionLabel();
222
+ },
223
+ get "aria-label"() {
224
+ return memo(() => {
225
+ return !!sending();
226
+ })() ? pendingLabel() : actionLabel();
227
+ }
228
+ })];
229
+ }
230
+ })];
228
231
  } })
229
232
  ];
230
233
  } }));
@@ -1 +1 @@
1
- {"version":3,"file":"message-composer.js","names":["<PromptInput\n data-slot=\"message-composer\"\n class={local.class}\n disabled={local.disabled}\n onSubmit={() => send()}\n onKeyDown={onFormKeyDown}\n before={<Show when={local.menu}>{(menuSlot) => <div>{menuSlot()}</div>}</Show>}\n after={\n <>\n <Show when={local.showHint}>\n <p class=\"text-muted-foreground flex items-center gap-1.5 text-2xs\">\n <Kbd>Enter</Kbd> to send\n <span aria-hidden=\"true\">·</span>\n <Kbd>Shift</Kbd> <Kbd>Enter</Kbd> for a new line\n </p>\n </Show>\n\n {/* A live region, so the outcome is announced without moving focus out of the\n field the user is typing in. */}\n <div role=\"status\" aria-live=\"polite\" class=\"min-h-0\">\n <Show\n when={sending()}\n fallback={\n <Show when={composer.error()}>\n {(message) => (\n <p class=\"text-foreground border-s-2 border-destructive ps-2 text-xs\">\n {message()}\n </p>\n )}\n </Show>\n }\n >\n {pendingLabel()}…\n </Show>\n <Show when={local.status}>{(statusSlot) => <>{statusSlot()}</>}</Show>\n </div>\n </>\n }\n {...rest}\n >\n <Show when={local.replyTo}>\n {(reply) => (\n <PromptInputHeader>\n <span class=\"min-w-0 flex-1 truncate text-xs\">Replying to {reply().label}</span>\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n tooltip=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </ActionButton>\n </PromptInputHeader>\n )}\n </Show>\n\n <PromptInputTextarea\n ref={local.inputRef}\n id={local.inputId}\n submitOnEnter={false}\n onCompositionStart={composer.onCompositionStart}\n onCompositionEnd={composer.onCompositionEnd}\n onFocus={composer.onFocus}\n onBlur={composer.onBlur}\n value={local.value}\n onInput={(event) => local.onValueChange(event.currentTarget.value)}\n onKeyDown={onKeyDown}\n placeholder={local.placeholder ?? 'Write a message…'}\n disabled={local.disabled}\n aria-label={\n local.inputLabel ?? (local.submitLabel ? `${local.submitLabel} message` : 'Message')\n }\n aria-describedby={describedBy()}\n // InputGroupTextarea caps growth at max-h-48; `default` keeps Textarea's uncapped\n // default size, so it lifts that cap rather than just not adding one.\n class={cn('min-h-16', {\n 'max-h-48': (local.inputSize ?? 'comfortable') === 'comfortable',\n 'max-h-none': local.inputSize === 'default',\n 'resize-y': (local.inputResize ?? 'vertical') === 'vertical',\n resize: local.inputResize === 'both',\n })}\n />\n <Show when={local.inputDescription}>\n {(description) => (\n <span id={descriptionId} class=\"sr-only\">\n {description()}\n </span>\n )}\n </Show>\n\n <PromptInputFooter>\n <PromptInputTools>\n <Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>\n </PromptInputTools>\n <PromptInputTools>\n <Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>\n <PromptInputSubmit\n status={sending() ? 'submitted' : 'ready'}\n disabled={!canSend()}\n label={actionLabel()}\n aria-label={sending() ? pendingLabel() : actionLabel()}\n />\n </PromptInputTools>\n </PromptInputFooter>\n </PromptInput>","onSubmit={() => send()}","onKeyDown={onFormKeyDown}","<Show when={local.menu}>{(menuSlot) => <div>{menuSlot()}</div>}</Show>","<Show when={local.showHint}>\n <p class=\"text-muted-foreground flex items-center gap-1.5 text-2xs\">\n <Kbd>Enter</Kbd> to send\n <span aria-hidden=\"true\">·</span>\n <Kbd>Shift</Kbd> <Kbd>Enter</Kbd> for a new line\n </p>\n </Show>","<span aria-hidden=\"true\">·</span>","<Kbd>Enter</Kbd>","<p class=\"text-muted-foreground flex items-center gap-1.5 text-2xs\">\n <Kbd>Enter</Kbd> to send\n <span aria-hidden=\"true\">·</span>\n <Kbd>Shift</Kbd> <Kbd>Enter</Kbd> for a new line\n </p>","<Kbd>Shift</Kbd>","{pendingLabel()}","<Show when={composer.error()}>\n {(message) => (\n <p class=\"text-foreground border-s-2 border-destructive ps-2 text-xs\">\n {message()}\n </p>\n )}\n </Show>","<div role=\"status\" aria-live=\"polite\" class=\"min-h-0\">\n <Show\n when={sending()}\n fallback={\n <Show when={composer.error()}>\n {(message) => (\n <p class=\"text-foreground border-s-2 border-destructive ps-2 text-xs\">\n {message()}\n </p>\n )}\n </Show>\n }\n >\n {pendingLabel()}…\n </Show>\n <Show when={local.status}>{(statusSlot) => <>{statusSlot()}</>}</Show>\n </div>","<Show when={local.status}>{(statusSlot) => <>{statusSlot()}</>}</Show>","{statusSlot()}","<Show when={local.replyTo}>\n {(reply) => (\n <PromptInputHeader>\n <span class=\"min-w-0 flex-1 truncate text-xs\">Replying to {reply().label}</span>\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n tooltip=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </ActionButton>\n </PromptInputHeader>\n )}\n </Show>","<PromptInputHeader>\n <span class=\"min-w-0 flex-1 truncate text-xs\">Replying to {reply().label}</span>\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n tooltip=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </ActionButton>\n </PromptInputHeader>","<ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n tooltip=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </ActionButton>","type=\"button\"","variant=\"ghost\"","size=\"icon-2xs\"","tooltip=\"Cancel reply\"","onClick={() => reply().onDismiss()}","<X />","<PromptInputTextarea\n ref={local.inputRef}\n id={local.inputId}\n submitOnEnter={false}\n onCompositionStart={composer.onCompositionStart}\n onCompositionEnd={composer.onCompositionEnd}\n onFocus={composer.onFocus}\n onBlur={composer.onBlur}\n value={local.value}\n onInput={(event) => local.onValueChange(event.currentTarget.value)}\n onKeyDown={onKeyDown}\n placeholder={local.placeholder ?? 'Write a message…'}\n disabled={local.disabled}\n aria-label={\n local.inputLabel ?? (local.submitLabel ? `${local.submitLabel} message` : 'Message')\n }\n aria-describedby={describedBy()}\n // InputGroupTextarea caps growth at max-h-48; `default` keeps Textarea's uncapped\n // default size, so it lifts that cap rather than just not adding one.\n class={cn('min-h-16', {\n 'max-h-48': (local.inputSize ?? 'comfortable') === 'comfortable',\n 'max-h-none': local.inputSize === 'default',\n 'resize-y': (local.inputResize ?? 'vertical') === 'vertical',\n resize: local.inputResize === 'both',\n })}\n />","ref={local.inputRef}","submitOnEnter={false}","onInput={(event) => local.onValueChange(event.currentTarget.value)}","<Show when={local.inputDescription}>\n {(description) => (\n <span id={descriptionId} class=\"sr-only\">\n {description()}\n </span>\n )}\n </Show>","<PromptInputFooter>\n <PromptInputTools>\n <Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>\n </PromptInputTools>\n <PromptInputTools>\n <Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>\n <PromptInputSubmit\n status={sending() ? 'submitted' : 'ready'}\n disabled={!canSend()}\n label={actionLabel()}\n aria-label={sending() ? pendingLabel() : actionLabel()}\n />\n </PromptInputTools>\n </PromptInputFooter>","<PromptInputTools>\n <Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>\n </PromptInputTools>","<Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>","{leadingSlot()}","<PromptInputTools>\n <Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>\n <PromptInputSubmit\n status={sending() ? 'submitted' : 'ready'}\n disabled={!canSend()}\n label={actionLabel()}\n aria-label={sending() ? pendingLabel() : actionLabel()}\n />\n </PromptInputTools>","<Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>","{trailingSlot()}","<PromptInputSubmit\n status={sending() ? 'submitted' : 'ready'}\n disabled={!canSend()}\n label={actionLabel()}\n aria-label={sending() ? pendingLabel() : actionLabel()}\n />","sending() ? pendingLabel() : actionLabel()","<ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.count ? `${local.count} attached, add an attachment` : 'Add an attachment'}\n aria-expanded={local.open === undefined ? undefined : local.open ? 'true' : 'false'}\n tooltip=\"Add an attachment\"\n {...rest}\n >\n {local.children ?? <Paperclip />}\n </ActionButton>","size=\"icon-sm\"","local.count ? `${local.count} attached, add an attachment` : 'Add an attachment'","local.open === undefined ? undefined : local.open ? 'true' : 'false'","tooltip=\"Add an attachment\"","<Paperclip />","<CornerDownLeft aria-hidden=\"true\" class=\"size-3\" />","class=\"size-3\"","<p\n class={cn('text-muted-foreground flex items-center gap-1.5 text-2xs', local.class)}\n {...rest}\n >\n {local.children ?? (\n <>\n <CornerDownLeft aria-hidden=\"true\" class=\"size-3\" />\n <Kbd>Enter</Kbd> to send\n </>\n )}\n </p>","LucideCornerDownLeft","LucidePaperclip","LucideX","_$insert","_$setAttribute","_$spread"],"sources":["../../../src/components/conversation/message-composer.tsx"],"sourcesContent":["import {\n CornerDownLeft as LucideCornerDownLeft,\n Paperclip as LucidePaperclip,\n X as LucideX,\n} from '@lucide/solid'\nimport type { Ref } from 'solid-js'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { Show, createUniqueId, omit } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { ActionButton } from '../composites/action-button'\nimport { Button } from '../ui/button'\nimport { Kbd } from '../ui/kbd'\nimport {\n PromptInput,\n PromptInputFooter,\n PromptInputHeader,\n PromptInputSubmit,\n PromptInputTextarea,\n PromptInputTools,\n} from '../composites/prompt-input'\nimport { createComposerCore } from './composer-core'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst CornerDownLeft = fastIcon(LucideCornerDownLeft)\nconst Paperclip = fastIcon(LucidePaperclip)\nconst X = fastIcon(LucideX)\n\n/**\n * MessageComposer.\n *\n * The field a message is written in. It is a form, and it behaves like one: Enter\n * sends, Shift+Enter breaks the line, Escape clears the error from anywhere in\n * the composer unless a nested control or an active IME already owns the key.\n *\n * ## What it does not know\n *\n * No mention model, no attachment model, no dictation, no idempotency keys. The\n * first version of this composer was written against adea's agent and artifact\n * types, which meant it could only ever be used by adea. Here the attachment control\n * is a *slot*, the mention menu is a slot, and a caller that has an agent model\n * renders one; a caller that does not gets a composer without it.\n *\n * ## The three things it does own\n *\n * **Enter sends, Shift+Enter breaks the line.** That is the convention every chat\n * application shares, and getting it wrong is the single most irritating thing a\n * composer can do. `⌘`/`Ctrl`+Enter is accepted too, because someone arriving from an\n * editor will try it.\n *\n * **The send button is disabled when there is nothing to send.** A control that\n * accepts a press and does nothing is worse than one that says it cannot.\n *\n * **The status region is `aria-live`.** \"Sending…\" and a failure both land there, so\n * a screen reader hears the outcome without the composer stealing focus.\n *\n * Enter ownership follows KiroCrew's pinned IME latch: candidate commits keep\n * their native default action, and the post-composition Enter cannot send or\n * insert an accidental newline. Composition abandoned by focus/blur recovers;\n * the Solid owner's cleanup settles its timer. See ime-guard.ts for provenance.\n */\nexport type MessageComposerProps = Omit<ComponentProps<'form'>, 'onSubmit'> & {\n /** The draft. Controlled: the caller owns the text, because it usually persists. */\n value: string\n onValueChange: (value: string) => void\n /** Called on send. A rejection is surfaced as an error and the draft is kept. */\n onSubmit: () => void | Promise<void>\n placeholder?: string\n /** Disable the whole composer, e.g. while the channel is read-only. */\n disabled?: boolean\n /** Accessible name and tooltip for the action, e.g. \"Reply\". */\n submitLabel?: string\n showHint?: boolean\n /** A leading control group, e.g. an attach button. */\n leading?: JSX.Element\n /** A trailing group before the send button, e.g. a dictation toggle. */\n trailing?: JSX.Element\n /** A menu rendered above the field, e.g. mention suggestions. */\n menu?: JSX.Element\n /**\n * Host progress rendered in the composer's own live region, e.g. dictation\n * state — plain paragraphs are progress, a `role=\"alert\"` paragraph is a\n * failure. Sending and send-failure copy stays the composer's own.\n */\n status?: JSX.Element\n /** The reply target, drawn as a strip above the field. */\n replyTo?: { label: string; onDismiss: () => void }\n /** Ref to the actual message textarea, for host focus and selection behavior. */\n inputRef?: Ref<HTMLTextAreaElement>\n inputId?: string\n /** Accessible name for the actual textarea. Defaults to \"Message\" or \"Reply message\". */\n inputLabel?: string\n /** Additional help text associated with the actual textarea. */\n inputDescription?: string\n /** Existing host description id, combined with `inputDescription` when supplied. */\n inputDescribedBy?: string\n /** Comfortable uses the shared 4rem minimum and 12rem maximum field heights. */\n inputSize?: 'default' | 'comfortable'\n /** The shared resize behavior for the actual textarea. */\n inputResize?: 'vertical' | 'none' | 'both'\n}\n\nexport function MessageComposer(props: MessageComposerProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'value',\n 'onValueChange',\n 'onSubmit',\n 'placeholder',\n 'disabled',\n 'submitLabel',\n 'showHint',\n 'leading',\n 'trailing',\n 'menu',\n 'status',\n 'replyTo',\n 'inputRef',\n 'inputId',\n 'inputLabel',\n 'inputDescription',\n 'inputDescribedBy',\n 'inputSize',\n 'inputResize',\n 'onKeyDown'\n )\n\n const composer = createComposerCore({\n failureMessage: 'Message not sent. Your draft is kept.',\n })\n const sending = composer.pending\n const descriptionId = `message-composer-help-${createUniqueId()}`\n const describedBy = () =>\n [local.inputDescribedBy, local.inputDescription ? descriptionId : undefined]\n .filter(Boolean)\n .join(' ') || undefined\n const actionLabel = () => local.submitLabel ?? 'Send message'\n const pendingLabel = () =>\n `Sending ${local.submitLabel ? local.submitLabel.toLowerCase() : 'message'}`\n\n const canSend = () => local.value.trim().length > 0 && !local.disabled && !sending()\n\n const send = () => {\n if (canSend()) void composer.submit(() => local.onSubmit())\n }\n\n const onKeyDown: JSX.EventHandlerUnion<HTMLTextAreaElement, KeyboardEvent> = (event) => {\n if (event.defaultPrevented) return\n if (event.key !== 'Enter') return\n // Shift breaks the line; a bare Enter, or a modified one, sends.\n if (event.shiftKey && !event.metaKey && !event.ctrlKey) return\n if (composer.claimEnter(event)) send()\n }\n\n const onFormKeyDown: JSX.EventHandlerUnion<HTMLFormElement, KeyboardEvent> = (event) => {\n callHandler(local.onKeyDown, event)\n if (!composer.dismissError(event)) return\n event.preventDefault()\n event.stopPropagation()\n }\n\n return (\n <PromptInput\n data-slot=\"message-composer\"\n class={local.class}\n disabled={local.disabled}\n onSubmit={() => send()}\n onKeyDown={onFormKeyDown}\n before={<Show when={local.menu}>{(menuSlot) => <div>{menuSlot()}</div>}</Show>}\n after={\n <>\n <Show when={local.showHint}>\n <p class=\"text-muted-foreground flex items-center gap-1.5 text-2xs\">\n <Kbd>Enter</Kbd> to send\n <span aria-hidden=\"true\">·</span>\n <Kbd>Shift</Kbd> <Kbd>Enter</Kbd> for a new line\n </p>\n </Show>\n\n {/* A live region, so the outcome is announced without moving focus out of the\n field the user is typing in. */}\n <div role=\"status\" aria-live=\"polite\" class=\"min-h-0\">\n <Show\n when={sending()}\n fallback={\n <Show when={composer.error()}>\n {(message) => (\n <p class=\"text-foreground border-s-2 border-destructive ps-2 text-xs\">\n {message()}\n </p>\n )}\n </Show>\n }\n >\n {pendingLabel()}…\n </Show>\n <Show when={local.status}>{(statusSlot) => <>{statusSlot()}</>}</Show>\n </div>\n </>\n }\n {...rest}\n >\n <Show when={local.replyTo}>\n {(reply) => (\n <PromptInputHeader>\n <span class=\"min-w-0 flex-1 truncate text-xs\">Replying to {reply().label}</span>\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n tooltip=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </ActionButton>\n </PromptInputHeader>\n )}\n </Show>\n\n <PromptInputTextarea\n ref={local.inputRef}\n id={local.inputId}\n submitOnEnter={false}\n onCompositionStart={composer.onCompositionStart}\n onCompositionEnd={composer.onCompositionEnd}\n onFocus={composer.onFocus}\n onBlur={composer.onBlur}\n value={local.value}\n onInput={(event) => local.onValueChange(event.currentTarget.value)}\n onKeyDown={onKeyDown}\n placeholder={local.placeholder ?? 'Write a message…'}\n disabled={local.disabled}\n aria-label={\n local.inputLabel ?? (local.submitLabel ? `${local.submitLabel} message` : 'Message')\n }\n aria-describedby={describedBy()}\n // InputGroupTextarea caps growth at max-h-48; `default` keeps Textarea's uncapped\n // default size, so it lifts that cap rather than just not adding one.\n class={cn('min-h-16', {\n 'max-h-48': (local.inputSize ?? 'comfortable') === 'comfortable',\n 'max-h-none': local.inputSize === 'default',\n 'resize-y': (local.inputResize ?? 'vertical') === 'vertical',\n resize: local.inputResize === 'both',\n })}\n />\n <Show when={local.inputDescription}>\n {(description) => (\n <span id={descriptionId} class=\"sr-only\">\n {description()}\n </span>\n )}\n </Show>\n\n <PromptInputFooter>\n <PromptInputTools>\n <Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>\n </PromptInputTools>\n <PromptInputTools>\n <Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>\n <PromptInputSubmit\n status={sending() ? 'submitted' : 'ready'}\n disabled={!canSend()}\n label={actionLabel()}\n aria-label={sending() ? pendingLabel() : actionLabel()}\n />\n </PromptInputTools>\n </PromptInputFooter>\n </PromptInput>\n )\n}\n\n/**\n * The attachment control.\n *\n * A slot rather than a built-in, because what can be attached is the application's\n * business — but the *button* is shared, so it looks and behaves the same in both.\n * The count is announced, since a paperclip alone does not say whether anything is\n * attached.\n */\nexport function ComposerAttachmentButton(\n props: ComponentProps<typeof Button> & { count?: number; open?: boolean }\n) {\n const local = props\n const rest = omit(props, 'count', 'open', 'children')\n\n return (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.count ? `${local.count} attached, add an attachment` : 'Add an attachment'}\n aria-expanded={local.open === undefined ? undefined : local.open ? 'true' : 'false'}\n tooltip=\"Add an attachment\"\n {...rest}\n >\n {local.children ?? <Paperclip />}\n </ActionButton>\n )\n}\n\n/** The hint a composer shows when the field is empty, as a one-line prompt. */\nexport function ComposerHint(props: ComponentProps<'p'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <p\n class={cn('text-muted-foreground flex items-center gap-1.5 text-2xs', local.class)}\n {...rest}\n >\n {local.children ?? (\n <>\n <CornerDownLeft aria-hidden=\"true\" class=\"size-3\" />\n <Kbd>Enter</Kbd> to send\n </>\n )}\n </p>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,IAAM,iBAAiB,SAAS8C,gBAAoB;AACpD,IAAM,YAAY,SAASC,WAAe;AAC1C,IAAM,IAAI,SAASC,GAAO;AA4E1B,SAAgB,gBAAgB,OAA6B;CAC3D,MAA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AA,CAAA,CAAA;AAEjB;;;;;;;;;AAUA,SAAgB,yBACd,OACA;CACA,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,QAAQ,UAAU;CAEpD,OACEC,gBAAAA,cAAAA,WAAAA;EACEpB,MAAK;EACLC,SAAQ;EACRoB,MAAK;EACL,IAAA,eAAA;GAAYC,OAAAA,WAAAA;IAAM,OAAA,CAAA,CAAA,MAAA;GAAyE,CAAA,CAAC,CAAD,IAAjE,GAAG,MAAM,MAAM,gCAAgC;EAAmB;EAC5F,IAAA,kBAAA;GAAeC,OAAAA,WAAAA;IAAM,OAAA,MAAA,SAAS,KAAA;GAAoD,CAAA,CAAC,CAAD,IAAxC,KAAA,IAAY,MAAM,OAAO,SAAS;EAAO;EACnFC,SAAQ;CAII,GAHR,MAPN,EAAA,IAAA,WAAA;EASG,OAAA,MAAM,YAAYC,gBAAAA,WAAAA,CAAY,CAAA;CACnB,EAAA,CAAA,CAAA;AAElB;;AAGA,SAAgB,aAAa,OAA4B;CACvD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAE1C,IAAA,SAAA,QAUG;CARDS,OAAA,QAAA,CAAA,EADA,IAAA,UAAA;EAAO,OAAA,GAAG,4DAA4D,MAAM,KAAK;CAAC,EAC1E,GAAJ,IAAA,GAAA,IAAA;CAFNF,OAAA,cAIE;EAAC,OAAA,MAAM,YACH;GACAN,gBAAAA,gBAAAA;IAAgB,eAAY;IAAOC,OAAM;GAAU,CAAA;GACnDtC,gBAAAA,KAAAA,EAAAA,UAAK,QAAU,CAAA;GAAC;EADjB;CAGF,CACA;CAXL,OACEuC;AAYJ"}
1
+ {"version":3,"file":"message-composer.js","names":["<PromptInput\n data-slot=\"message-composer\"\n class={local.class}\n disabled={local.disabled}\n onSubmit={() => send()}\n onKeyDown={onFormKeyDown}\n before={<Show when={local.menu}>{(menuSlot) => <div>{menuSlot()}</div>}</Show>}\n after={\n <>\n <Show when={local.showHint}>\n <p class=\"text-muted-foreground flex items-center gap-1.5 text-2xs\">\n <Kbd>Enter</Kbd> to send\n <span aria-hidden=\"true\">·</span>\n <Kbd>Shift</Kbd> <Kbd>Enter</Kbd> for a new line\n </p>\n </Show>\n\n {/* A live region, so the outcome is announced without moving focus out of the\n field the user is typing in. */}\n <div role=\"status\" aria-live=\"polite\" class=\"min-h-0\">\n <Show\n when={sending()}\n fallback={\n <Show when={composer.error()}>\n {(message) => (\n <p class=\"text-foreground border-s-2 border-destructive ps-2 text-xs\">\n {message()}\n </p>\n )}\n </Show>\n }\n >\n {pendingLabel()}…\n </Show>\n <Show when={local.status}>{(statusSlot) => <>{statusSlot()}</>}</Show>\n </div>\n </>\n }\n {...rest}\n >\n <Show when={local.replyTo}>\n {(reply) => (\n <PromptInputHeader>\n <span class=\"min-w-0 flex-1 truncate text-xs\">Replying to {reply().label}</span>\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n tooltip=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </ActionButton>\n </PromptInputHeader>\n )}\n </Show>\n\n <PromptInputTextarea\n ref={local.inputRef}\n id={local.inputId}\n submitOnEnter={false}\n onCompositionStart={composer.onCompositionStart}\n onCompositionEnd={composer.onCompositionEnd}\n onFocus={composer.onFocus}\n onBlur={composer.onBlur}\n value={local.value}\n onInput={(event) => local.onValueChange(event.currentTarget.value)}\n onKeyDown={onKeyDown}\n placeholder={local.placeholder ?? 'Write a message…'}\n disabled={local.disabled}\n aria-label={\n local.inputLabel ?? (local.submitLabel ? `${local.submitLabel} message` : 'Message')\n }\n aria-describedby={describedBy()}\n // InputGroupTextarea caps growth at max-h-48; `default` keeps Textarea's uncapped\n // default size, so it lifts that cap rather than just not adding one.\n class={cn('min-h-16', {\n 'max-h-48': (local.inputSize ?? 'comfortable') === 'comfortable',\n 'max-h-none': local.inputSize === 'default',\n 'resize-y': (local.inputResize ?? 'vertical') === 'vertical',\n resize: local.inputResize === 'both',\n })}\n />\n <Show when={local.inputDescription}>\n {(description) => (\n <span id={descriptionId} class=\"sr-only\">\n {description()}\n </span>\n )}\n </Show>\n\n <PromptInputFooter>\n <PromptInputTools>\n <Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>\n </PromptInputTools>\n {/* The send control never gives way: when the row runs out of room the leading tools (a\n host's pills) truncate, while the trailing ones keep their size. */}\n <PromptInputTools class=\"shrink-0\">\n <Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>\n <PromptInputSubmit\n status={sending() ? 'submitted' : 'ready'}\n disabled={!canSend()}\n label={actionLabel()}\n aria-label={sending() ? pendingLabel() : actionLabel()}\n />\n </PromptInputTools>\n </PromptInputFooter>\n </PromptInput>","onSubmit={() => send()}","onKeyDown={onFormKeyDown}","<Show when={local.menu}>{(menuSlot) => <div>{menuSlot()}</div>}</Show>","<Show when={local.showHint}>\n <p class=\"text-muted-foreground flex items-center gap-1.5 text-2xs\">\n <Kbd>Enter</Kbd> to send\n <span aria-hidden=\"true\">·</span>\n <Kbd>Shift</Kbd> <Kbd>Enter</Kbd> for a new line\n </p>\n </Show>","<span aria-hidden=\"true\">·</span>","<Kbd>Enter</Kbd>","<p class=\"text-muted-foreground flex items-center gap-1.5 text-2xs\">\n <Kbd>Enter</Kbd> to send\n <span aria-hidden=\"true\">·</span>\n <Kbd>Shift</Kbd> <Kbd>Enter</Kbd> for a new line\n </p>","<Kbd>Shift</Kbd>","{pendingLabel()}","<Show when={composer.error()}>\n {(message) => (\n <p class=\"text-foreground border-s-2 border-destructive ps-2 text-xs\">\n {message()}\n </p>\n )}\n </Show>","<div role=\"status\" aria-live=\"polite\" class=\"min-h-0\">\n <Show\n when={sending()}\n fallback={\n <Show when={composer.error()}>\n {(message) => (\n <p class=\"text-foreground border-s-2 border-destructive ps-2 text-xs\">\n {message()}\n </p>\n )}\n </Show>\n }\n >\n {pendingLabel()}…\n </Show>\n <Show when={local.status}>{(statusSlot) => <>{statusSlot()}</>}</Show>\n </div>","<Show when={local.status}>{(statusSlot) => <>{statusSlot()}</>}</Show>","{statusSlot()}","<Show when={local.replyTo}>\n {(reply) => (\n <PromptInputHeader>\n <span class=\"min-w-0 flex-1 truncate text-xs\">Replying to {reply().label}</span>\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n tooltip=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </ActionButton>\n </PromptInputHeader>\n )}\n </Show>","<PromptInputHeader>\n <span class=\"min-w-0 flex-1 truncate text-xs\">Replying to {reply().label}</span>\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n tooltip=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </ActionButton>\n </PromptInputHeader>","<ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n tooltip=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </ActionButton>","type=\"button\"","variant=\"ghost\"","size=\"icon-2xs\"","tooltip=\"Cancel reply\"","onClick={() => reply().onDismiss()}","<X />","<PromptInputTextarea\n ref={local.inputRef}\n id={local.inputId}\n submitOnEnter={false}\n onCompositionStart={composer.onCompositionStart}\n onCompositionEnd={composer.onCompositionEnd}\n onFocus={composer.onFocus}\n onBlur={composer.onBlur}\n value={local.value}\n onInput={(event) => local.onValueChange(event.currentTarget.value)}\n onKeyDown={onKeyDown}\n placeholder={local.placeholder ?? 'Write a message…'}\n disabled={local.disabled}\n aria-label={\n local.inputLabel ?? (local.submitLabel ? `${local.submitLabel} message` : 'Message')\n }\n aria-describedby={describedBy()}\n // InputGroupTextarea caps growth at max-h-48; `default` keeps Textarea's uncapped\n // default size, so it lifts that cap rather than just not adding one.\n class={cn('min-h-16', {\n 'max-h-48': (local.inputSize ?? 'comfortable') === 'comfortable',\n 'max-h-none': local.inputSize === 'default',\n 'resize-y': (local.inputResize ?? 'vertical') === 'vertical',\n resize: local.inputResize === 'both',\n })}\n />","ref={local.inputRef}","submitOnEnter={false}","onInput={(event) => local.onValueChange(event.currentTarget.value)}","<Show when={local.inputDescription}>\n {(description) => (\n <span id={descriptionId} class=\"sr-only\">\n {description()}\n </span>\n )}\n </Show>","<PromptInputFooter>\n <PromptInputTools>\n <Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>\n </PromptInputTools>\n {/* The send control never gives way: when the row runs out of room the leading tools (a\n host's pills) truncate, while the trailing ones keep their size. */}\n <PromptInputTools class=\"shrink-0\">\n <Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>\n <PromptInputSubmit\n status={sending() ? 'submitted' : 'ready'}\n disabled={!canSend()}\n label={actionLabel()}\n aria-label={sending() ? pendingLabel() : actionLabel()}\n />\n </PromptInputTools>\n </PromptInputFooter>","<PromptInputTools>\n <Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>\n </PromptInputTools>","<Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>","{leadingSlot()}","<PromptInputTools class=\"shrink-0\">\n <Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>\n <PromptInputSubmit\n status={sending() ? 'submitted' : 'ready'}\n disabled={!canSend()}\n label={actionLabel()}\n aria-label={sending() ? pendingLabel() : actionLabel()}\n />\n </PromptInputTools>","class=\"shrink-0\"","<Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>","{trailingSlot()}","<PromptInputSubmit\n status={sending() ? 'submitted' : 'ready'}\n disabled={!canSend()}\n label={actionLabel()}\n aria-label={sending() ? pendingLabel() : actionLabel()}\n />","sending() ? pendingLabel() : actionLabel()","<ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.count ? `${local.count} attached, add an attachment` : 'Add an attachment'}\n aria-expanded={local.open === undefined ? undefined : local.open ? 'true' : 'false'}\n tooltip=\"Add an attachment\"\n {...rest}\n >\n {local.children ?? <Paperclip />}\n </ActionButton>","size=\"icon-sm\"","local.count ? `${local.count} attached, add an attachment` : 'Add an attachment'","local.open === undefined ? undefined : local.open ? 'true' : 'false'","tooltip=\"Add an attachment\"","<Paperclip />","<CornerDownLeft aria-hidden=\"true\" class=\"size-3\" />","class=\"size-3\"","<p\n class={cn('text-muted-foreground flex items-center gap-1.5 text-2xs', local.class)}\n {...rest}\n >\n {local.children ?? (\n <>\n <CornerDownLeft aria-hidden=\"true\" class=\"size-3\" />\n <Kbd>Enter</Kbd> to send\n </>\n )}\n </p>","LucideCornerDownLeft","LucidePaperclip","LucideX","_$insert","_$setAttribute","_$spread"],"sources":["../../../src/components/conversation/message-composer.tsx"],"sourcesContent":["import {\n CornerDownLeft as LucideCornerDownLeft,\n Paperclip as LucidePaperclip,\n X as LucideX,\n} from '@lucide/solid'\nimport type { Ref } from 'solid-js'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { Show, createUniqueId, omit } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { ActionButton } from '../composites/action-button'\nimport { Button } from '../ui/button'\nimport { Kbd } from '../ui/kbd'\nimport {\n PromptInput,\n PromptInputFooter,\n PromptInputHeader,\n PromptInputSubmit,\n PromptInputTextarea,\n PromptInputTools,\n} from '../composites/prompt-input'\nimport { createComposerCore } from './composer-core'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst CornerDownLeft = fastIcon(LucideCornerDownLeft)\nconst Paperclip = fastIcon(LucidePaperclip)\nconst X = fastIcon(LucideX)\n\n/**\n * MessageComposer.\n *\n * The field a message is written in. It is a form, and it behaves like one: Enter\n * sends, Shift+Enter breaks the line, Escape clears the error from anywhere in\n * the composer unless a nested control or an active IME already owns the key.\n *\n * ## What it does not know\n *\n * No mention model, no attachment model, no dictation, no idempotency keys. The\n * first version of this composer was written against adea's agent and artifact\n * types, which meant it could only ever be used by adea. Here the attachment control\n * is a *slot*, the mention menu is a slot, and a caller that has an agent model\n * renders one; a caller that does not gets a composer without it.\n *\n * ## The three things it does own\n *\n * **Enter sends, Shift+Enter breaks the line.** That is the convention every chat\n * application shares, and getting it wrong is the single most irritating thing a\n * composer can do. `⌘`/`Ctrl`+Enter is accepted too, because someone arriving from an\n * editor will try it.\n *\n * **The send button is disabled when there is nothing to send.** A control that\n * accepts a press and does nothing is worse than one that says it cannot.\n *\n * **The status region is `aria-live`.** \"Sending…\" and a failure both land there, so\n * a screen reader hears the outcome without the composer stealing focus.\n *\n * Enter ownership follows KiroCrew's pinned IME latch: candidate commits keep\n * their native default action, and the post-composition Enter cannot send or\n * insert an accidental newline. Composition abandoned by focus/blur recovers;\n * the Solid owner's cleanup settles its timer. See ime-guard.ts for provenance.\n */\nexport type MessageComposerProps = Omit<ComponentProps<'form'>, 'onSubmit'> & {\n /** The draft. Controlled: the caller owns the text, because it usually persists. */\n value: string\n onValueChange: (value: string) => void\n /** Called on send. A rejection is surfaced as an error and the draft is kept. */\n onSubmit: () => void | Promise<void>\n placeholder?: string\n /** Disable the whole composer, e.g. while the channel is read-only. */\n disabled?: boolean\n /** Accessible name and tooltip for the action, e.g. \"Reply\". */\n submitLabel?: string\n showHint?: boolean\n /** A leading control group, e.g. an attach button. */\n leading?: JSX.Element\n /** A trailing group before the send button, e.g. a dictation toggle. */\n trailing?: JSX.Element\n /** A menu rendered above the field, e.g. mention suggestions. */\n menu?: JSX.Element\n /**\n * Host progress rendered in the composer's own live region, e.g. dictation\n * state — plain paragraphs are progress, a `role=\"alert\"` paragraph is a\n * failure. Sending and send-failure copy stays the composer's own.\n */\n status?: JSX.Element\n /** The reply target, drawn as a strip above the field. */\n replyTo?: { label: string; onDismiss: () => void }\n /** Ref to the actual message textarea, for host focus and selection behavior. */\n inputRef?: Ref<HTMLTextAreaElement>\n inputId?: string\n /** Accessible name for the actual textarea. Defaults to \"Message\" or \"Reply message\". */\n inputLabel?: string\n /** Additional help text associated with the actual textarea. */\n inputDescription?: string\n /** Existing host description id, combined with `inputDescription` when supplied. */\n inputDescribedBy?: string\n /** Comfortable uses the shared 4rem minimum and 12rem maximum field heights. */\n inputSize?: 'default' | 'comfortable'\n /** The shared resize behavior for the actual textarea. */\n inputResize?: 'vertical' | 'none' | 'both'\n}\n\nexport function MessageComposer(props: MessageComposerProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'value',\n 'onValueChange',\n 'onSubmit',\n 'placeholder',\n 'disabled',\n 'submitLabel',\n 'showHint',\n 'leading',\n 'trailing',\n 'menu',\n 'status',\n 'replyTo',\n 'inputRef',\n 'inputId',\n 'inputLabel',\n 'inputDescription',\n 'inputDescribedBy',\n 'inputSize',\n 'inputResize',\n 'onKeyDown'\n )\n\n const composer = createComposerCore({\n failureMessage: 'Message not sent. Your draft is kept.',\n })\n const sending = composer.pending\n const descriptionId = `message-composer-help-${createUniqueId()}`\n const describedBy = () =>\n [local.inputDescribedBy, local.inputDescription ? descriptionId : undefined]\n .filter(Boolean)\n .join(' ') || undefined\n const actionLabel = () => local.submitLabel ?? 'Send message'\n const pendingLabel = () =>\n `Sending ${local.submitLabel ? local.submitLabel.toLowerCase() : 'message'}`\n\n const canSend = () => local.value.trim().length > 0 && !local.disabled && !sending()\n\n const send = () => {\n if (canSend()) void composer.submit(() => local.onSubmit())\n }\n\n const onKeyDown: JSX.EventHandlerUnion<HTMLTextAreaElement, KeyboardEvent> = (event) => {\n if (event.defaultPrevented) return\n if (event.key !== 'Enter') return\n // Shift breaks the line; a bare Enter, or a modified one, sends.\n if (event.shiftKey && !event.metaKey && !event.ctrlKey) return\n if (composer.claimEnter(event)) send()\n }\n\n const onFormKeyDown: JSX.EventHandlerUnion<HTMLFormElement, KeyboardEvent> = (event) => {\n callHandler(local.onKeyDown, event)\n if (!composer.dismissError(event)) return\n event.preventDefault()\n event.stopPropagation()\n }\n\n return (\n <PromptInput\n data-slot=\"message-composer\"\n class={local.class}\n disabled={local.disabled}\n onSubmit={() => send()}\n onKeyDown={onFormKeyDown}\n before={<Show when={local.menu}>{(menuSlot) => <div>{menuSlot()}</div>}</Show>}\n after={\n <>\n <Show when={local.showHint}>\n <p class=\"text-muted-foreground flex items-center gap-1.5 text-2xs\">\n <Kbd>Enter</Kbd> to send\n <span aria-hidden=\"true\">·</span>\n <Kbd>Shift</Kbd> <Kbd>Enter</Kbd> for a new line\n </p>\n </Show>\n\n {/* A live region, so the outcome is announced without moving focus out of the\n field the user is typing in. */}\n <div role=\"status\" aria-live=\"polite\" class=\"min-h-0\">\n <Show\n when={sending()}\n fallback={\n <Show when={composer.error()}>\n {(message) => (\n <p class=\"text-foreground border-s-2 border-destructive ps-2 text-xs\">\n {message()}\n </p>\n )}\n </Show>\n }\n >\n {pendingLabel()}…\n </Show>\n <Show when={local.status}>{(statusSlot) => <>{statusSlot()}</>}</Show>\n </div>\n </>\n }\n {...rest}\n >\n <Show when={local.replyTo}>\n {(reply) => (\n <PromptInputHeader>\n <span class=\"min-w-0 flex-1 truncate text-xs\">Replying to {reply().label}</span>\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n tooltip=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </ActionButton>\n </PromptInputHeader>\n )}\n </Show>\n\n <PromptInputTextarea\n ref={local.inputRef}\n id={local.inputId}\n submitOnEnter={false}\n onCompositionStart={composer.onCompositionStart}\n onCompositionEnd={composer.onCompositionEnd}\n onFocus={composer.onFocus}\n onBlur={composer.onBlur}\n value={local.value}\n onInput={(event) => local.onValueChange(event.currentTarget.value)}\n onKeyDown={onKeyDown}\n placeholder={local.placeholder ?? 'Write a message…'}\n disabled={local.disabled}\n aria-label={\n local.inputLabel ?? (local.submitLabel ? `${local.submitLabel} message` : 'Message')\n }\n aria-describedby={describedBy()}\n // InputGroupTextarea caps growth at max-h-48; `default` keeps Textarea's uncapped\n // default size, so it lifts that cap rather than just not adding one.\n class={cn('min-h-16', {\n 'max-h-48': (local.inputSize ?? 'comfortable') === 'comfortable',\n 'max-h-none': local.inputSize === 'default',\n 'resize-y': (local.inputResize ?? 'vertical') === 'vertical',\n resize: local.inputResize === 'both',\n })}\n />\n <Show when={local.inputDescription}>\n {(description) => (\n <span id={descriptionId} class=\"sr-only\">\n {description()}\n </span>\n )}\n </Show>\n\n <PromptInputFooter>\n <PromptInputTools>\n <Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>\n </PromptInputTools>\n {/* The send control never gives way: when the row runs out of room the leading tools (a\n host's pills) truncate, while the trailing ones keep their size. */}\n <PromptInputTools class=\"shrink-0\">\n <Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>\n <PromptInputSubmit\n status={sending() ? 'submitted' : 'ready'}\n disabled={!canSend()}\n label={actionLabel()}\n aria-label={sending() ? pendingLabel() : actionLabel()}\n />\n </PromptInputTools>\n </PromptInputFooter>\n </PromptInput>\n )\n}\n\n/**\n * The attachment control.\n *\n * A slot rather than a built-in, because what can be attached is the application's\n * business — but the *button* is shared, so it looks and behaves the same in both.\n * The count is announced, since a paperclip alone does not say whether anything is\n * attached.\n */\nexport function ComposerAttachmentButton(\n props: ComponentProps<typeof Button> & { count?: number; open?: boolean }\n) {\n const local = props\n const rest = omit(props, 'count', 'open', 'children')\n\n return (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={local.count ? `${local.count} attached, add an attachment` : 'Add an attachment'}\n aria-expanded={local.open === undefined ? undefined : local.open ? 'true' : 'false'}\n tooltip=\"Add an attachment\"\n {...rest}\n >\n {local.children ?? <Paperclip />}\n </ActionButton>\n )\n}\n\n/** The hint a composer shows when the field is empty, as a one-line prompt. */\nexport function ComposerHint(props: ComponentProps<'p'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <p\n class={cn('text-muted-foreground flex items-center gap-1.5 text-2xs', local.class)}\n {...rest}\n >\n {local.children ?? (\n <>\n <CornerDownLeft aria-hidden=\"true\" class=\"size-3\" />\n <Kbd>Enter</Kbd> to send\n </>\n )}\n </p>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,IAAM,iBAAiB,SAAS+C,gBAAoB;AACpD,IAAM,YAAY,SAASC,WAAe;AAC1C,IAAM,IAAI,SAASC,GAAO;AA4E1B,SAAgB,gBAAgB,OAA6B;CAC3D,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,SACA,SACA,iBACA,YACA,eACA,YACA,eACA,YACA,WACA,YACA,QACA,UACA,WACA,YACA,WACA,cACA,oBACA,oBACA,aACA,eACA,WACF;CAEA,MAAM,WAAW,mBAAmB,EAClC,gBAAgB,wCAClB,CAAC;CACD,MAAM,UAAU,SAAS;CACzB,MAAM,gBAAgB,yBAAyB,eAAe;CAC9D,MAAM,oBACJ,CAAC,MAAM,kBAAkB,MAAM,mBAAmB,gBAAgB,KAAA,CAAS,CAAC,CACzE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,KAAK,KAAA;CAClB,MAAM,oBAAoB,MAAM,eAAe;CAC/C,MAAM,qBACJ,WAAW,MAAM,cAAc,MAAM,YAAY,YAAY,IAAI;CAEnE,MAAM,gBAAgB,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,MAAM,YAAY,CAAC,QAAQ;CAEnF,MAAM,aAAa;EACjB,IAAI,QAAQ,GAAQ,SAAS,aAAa,MAAM,SAAS,CAAC;CAC5D;CAEA,MAAM,aAAwE,UAAU;EACtF,IAAI,MAAM,kBAAkB;EAC5B,IAAI,MAAM,QAAQ,SAAS;EAE3B,IAAI,MAAM,YAAY,CAAC,MAAM,WAAW,CAAC,MAAM,SAAS;EACxD,IAAI,SAAS,WAAW,KAAK,GAAG,KAAK;CACvC;CAEA,MAAM,iBAAwE,UAAU;EACtF,YAAY,MAAM,WAAW,KAAK;EAClC,IAAI,CAAC,SAA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C,OAAM;GAAU,CAAA;GACnDvC,gBAAAA,KAAAA,EAAAA,UAAK,QAAU,CAAA;GAAC;EADjB;CAGF,CACA;CAXL,OACEwC;AAYJ"}
@@ -13,7 +13,7 @@ import { fastIcon } from "../../../lib/fast-icon.js";
13
13
  // src/components/ui/command/command.tsx
14
14
  var _tmpl$ = /* @__PURE__ */ template(`<div cmdk-overlay aria-hidden=true>`);
15
15
  var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
16
- var _tmpl$3 = /* @__PURE__ */ template(`<div data-slot=command-input-wrapper class="flex h-11 items-center gap-2 border-b border-border px-3"><!><!>`);
16
+ var _tmpl$3 = /* @__PURE__ */ template(`<div data-slot=command-input-wrapper class="flex h-11 shrink-0 items-center gap-2 border-b border-border px-3"><!><!>`);
17
17
  var _tmpl$4 = /* @__PURE__ */ template(`<div><div aria-hidden=true>`);
18
18
  var _tmpl$5 = /* @__PURE__ */ template(`<span>`);
19
19
  var _tmpl$6 = /* @__PURE__ */ template(`<p>`);
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","names":["<CommandScopeContext value={{ controller, label: () => props.label, inputListener }}>\n <CommandPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-root=\"\"\n data-settling={settling() ? '' : undefined}\n ref={(element: HTMLDivElement) => {\n requestAnimationFrame(() => requestAnimationFrame(() => setSettling(false)))\n forwardRef(() => props.ref, element)\n }}\n controller={controller}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value: string | null) => props.onValueChange?.(value ?? '')}\n onQueryChange={(search: string) => inputListener.current?.(search)}\n onAction={(value: string) => props.onAction?.(value)}\n filter={filter()}\n loop={props.loop ?? false}\n class={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-xl',\n props.class\n )}\n >\n {props.children}\n </CommandPrimitive>\n </CommandScopeContext>","value={{ controller, label: () => props.label, inputListener }}","<CommandPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-root=\"\"\n data-settling={settling() ? '' : undefined}\n ref={(element: HTMLDivElement) => {\n requestAnimationFrame(() => requestAnimationFrame(() => setSettling(false)))\n forwardRef(() => props.ref, element)\n }}\n controller={controller}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value: string | null) => props.onValueChange?.(value ?? '')}\n onQueryChange={(search: string) => inputListener.current?.(search)}\n onAction={(value: string) => props.onAction?.(value)}\n filter={filter()}\n loop={props.loop ?? false}\n class={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-xl',\n props.class\n )}\n >\n {props.children}\n </CommandPrimitive>","ref={(element: HTMLDivElement) => {\n requestAnimationFrame(() => requestAnimationFrame(() => setSettling(false)))\n forwardRef(() => props.ref, element)\n }}","onValueChange={(value: string | null) => props.onValueChange?.(value ?? '')}","onQueryChange={(search: string) => inputListener.current?.(search)}","onAction={(value: string) => props.onAction?.(value)}","<Dialog\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={props.onOpenChange}\n modal={props.modal}\n >\n <CommandDialogContent\n label={props.label}\n class={cn(props.class, props.contentClassName)}\n overlayClassName={props.overlayClassName}\n container={props.container}\n onOpenAutoFocus={props.onOpenAutoFocus}\n onCloseAutoFocus={props.onCloseAutoFocus}\n >\n <Command {...commandProps} />\n </CommandDialogContent>\n </Dialog>","<CommandDialogContent\n label={props.label}\n class={cn(props.class, props.contentClassName)}\n overlayClassName={props.overlayClassName}\n container={props.container}\n onOpenAutoFocus={props.onOpenAutoFocus}\n onCloseAutoFocus={props.onCloseAutoFocus}\n >\n <Command {...commandProps} />\n </CommandDialogContent>","<Command {...commandProps} />","<Portal mount={props.container ?? overlayContainer()}>\n <UiDialogContent\n // Inline inside a top-layer positioner of its own, as the kit's\n // DialogContent does; the surface keeps its fixed placement.\n inline\n ref={(element: HTMLDivElement) => (panel = element)}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n aria-label={props.label}\n class={cn(\n overlaySurface,\n 'fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden shadow-xl',\n overlayZoom,\n props.class\n )}\n render={(panelProps: Record<string, unknown>, state: { open: boolean }) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n <div\n cmdk-overlay=\"\"\n aria-hidden=\"true\"\n data-expanded={state.open ? '' : undefined}\n data-closed={state.open ? undefined : ''}\n class={props.overlayClassName}\n />\n <div {...panelProps} cmdk-dialog=\"\" data-expanded={state.open ? '' : undefined} />\n </TopLayerPositioner>\n )}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiDialogContent>\n </Portal>","<UiDialogContent\n // Inline inside a top-layer positioner of its own, as the kit's\n // DialogContent does; the surface keeps its fixed placement.\n inline\n ref={(element: HTMLDivElement) => (panel = element)}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n aria-label={props.label}\n class={cn(\n overlaySurface,\n 'fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden shadow-xl',\n overlayZoom,\n props.class\n )}\n render={(panelProps: Record<string, unknown>, state: { open: boolean }) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n <div\n cmdk-overlay=\"\"\n aria-hidden=\"true\"\n data-expanded={state.open ? '' : undefined}\n data-closed={state.open ? undefined : ''}\n class={props.overlayClassName}\n />\n <div {...panelProps} cmdk-dialog=\"\" data-expanded={state.open ? '' : undefined} />\n </TopLayerPositioner>\n )}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiDialogContent>","ref={(element: HTMLDivElement) => (panel = element)}","render={(panelProps: Record<string, unknown>, state: { open: boolean }) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n <div\n cmdk-overlay=\"\"\n aria-hidden=\"true\"\n data-expanded={state.open ? '' : undefined}\n data-closed={state.open ? undefined : ''}\n class={props.overlayClassName}\n />\n <div {...panelProps} cmdk-dialog=\"\" data-expanded={state.open ? '' : undefined} />\n </TopLayerPositioner>\n )}","<TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n <div\n cmdk-overlay=\"\"\n aria-hidden=\"true\"\n data-expanded={state.open ? '' : undefined}\n data-closed={state.open ? undefined : ''}\n class={props.overlayClassName}\n />\n <div {...panelProps} cmdk-dialog=\"\" data-expanded={state.open ? '' : undefined} />\n </TopLayerPositioner>","class=\"fixed inset-0 z-(--z-dialog)\"","data-closed={state.open ? undefined : ''}","class={props.overlayClassName}","<LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>","element={() => panel}","<Search class=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />","class=\"size-4 shrink-0 text-muted-foreground\"","<div\n data-slot=\"command-input-wrapper\"\n class=\"flex h-11 items-center gap-2 border-b border-border px-3\"\n >\n <Search class=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <CommandInputPrimitive\n aria-label={scope?.label()}\n {...(rest as Record<string, unknown>)}\n onKeyDown={onKeyDown}\n cmdk-input=\"\"\n class={cn(\n 'h-full w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n props.class\n )}\n />\n </div>","<CommandInputPrimitive\n aria-label={scope?.label()}\n {...(rest as Record<string, unknown>)}\n onKeyDown={onKeyDown}\n cmdk-input=\"\"\n class={cn(\n 'h-full w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n props.class\n )}\n />","<CommandListPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-list=\"\"\n class={cn('max-h-80 scroll-py-1 overflow-y-auto overflow-x-hidden p-1', props.class)}\n />","<CommandEmptyPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-empty=\"\"\n class={cn(\n 'text-muted-foreground py-8 text-center text-sm not-data-[empty]:py-0',\n props.class\n )}\n />","<CommandGroupPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-group=\"\"\n class={cn(\n 'text-foreground overflow-hidden p-1',\n '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:uppercase',\n props.class\n )}\n >\n <Show when={heading()}>\n <CommandGroupLabelPrimitive cmdk-group-heading=\"\">{heading()}</CommandGroupLabelPrimitive>\n </Show>\n {props.children}\n </CommandGroupPrimitive>","<Show when={heading()}>\n <CommandGroupLabelPrimitive cmdk-group-heading=\"\">{heading()}</CommandGroupLabelPrimitive>\n </Show>","<CommandGroupLabelPrimitive cmdk-group-heading=\"\">{heading()}</CommandGroupLabelPrimitive>","props.children","<CommandItemPrimitive\n {...(rest as Record<string, unknown>)}\n ref={(node: HTMLDivElement) => {\n element = node\n callRef(props.ref, node)\n }}\n value={value()}\n label={value()}\n keywords={props.keywords}\n disabled={props.disabled}\n onSelect={() => props.onSelect?.(value() ?? element?.textContent?.trim() ?? '')}\n render={(\n part: Record<string, unknown>,\n state: { highlighted: boolean; disabled: boolean }\n ) => (\n <div\n {...part}\n cmdk-item=\"\"\n data-selected={state.highlighted ? 'true' : 'false'}\n data-disabled={state.disabled ? 'true' : 'false'}\n data-value={value()}\n />\n )}\n class={cn(\n commandItem,\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:text-muted-foreground',\n // The selected row sits on the accent rung, the same primary-subtle\n // fill the settings navigation's selected row owns, instead of the\n // popover rung, so what is chosen keeps the accent the checked menus\n // already carry in their indicators.\n 'group/command-item text-popover-foreground data-[selected=true]:bg-primary-subtle data-[selected=true]:text-foreground',\n 'in-data-settling:transition-none',\n props.class\n )}\n />","ref={(node: HTMLDivElement) => {\n element = node\n callRef(props.ref, node)\n }}","onSelect={() => props.onSelect?.(value() ?? element?.textContent?.trim() ?? '')}","render={(\n part: Record<string, unknown>,\n state: { highlighted: boolean; disabled: boolean }\n ) => (\n <div\n {...part}\n cmdk-item=\"\"\n data-selected={state.highlighted ? 'true' : 'false'}\n data-disabled={state.disabled ? 'true' : 'false'}\n data-value={value()}\n />\n )}","<CommandSeparatorPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-separator=\"\"\n // A listbox owns options and groups only; the hairline is presentation.\n render={(part: Record<string, unknown>) => (\n <div {...part} role=\"presentation\" aria-orientation={undefined} />\n )}\n class={cn('bg-border -mx-1 my-1 h-px', props.class)}\n />","render={(part: Record<string, unknown>) => (\n <div {...part} role=\"presentation\" aria-orientation={undefined} />\n )}","role=\"presentation\"","role=\"progressbar\"","<div\n {...rest}\n cmdk-loading=\"\"\n role=\"progressbar\"\n aria-valuenow={props.progress}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={props.label ?? 'Loading...'}\n class={cn('text-muted-foreground py-6 text-center text-sm', props.class)}\n >\n <div aria-hidden=\"true\">{props.children}</div>\n </div>","<span\n class={cn(\n menuShortcut,\n 'group-data-[selected=true]/command-item:text-foreground',\n props.class\n )}\n >\n {props.children}\n </span>","<p\n data-slot=\"command-status\"\n class={cn('text-muted-foreground px-4 py-4 text-center text-sm', props.class)}\n {...rest}\n />","<p\n data-slot=\"command-hint\"\n class={cn('text-muted-foreground px-4 pb-1.5 text-right text-xs', props.class)}\n {...rest}\n />","LucideSearch","_$effect","_$readShallow","_$setAttribute","_$className","_$spread","_$insert","resolveChildren"],"sources":["../../../../src/components/ui/command/command.tsx"],"sourcesContent":["import {\n Command as CommandPrimitive,\n CommandEmpty as CommandEmptyPrimitive,\n CommandGroup as CommandGroupPrimitive,\n CommandGroupLabel as CommandGroupLabelPrimitive,\n CommandInput as CommandInputPrimitive,\n CommandItem as CommandItemPrimitive,\n CommandList as CommandListPrimitive,\n CommandSeparator as CommandSeparatorPrimitive,\n createCommandController,\n type CommandController,\n} from '@ui-sdk/solid/command'\nimport { DialogContent as UiDialogContent } from '@ui-sdk/solid/dialog'\nimport { Search as LucideSearch } from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { Portal } from '@solidjs/web'\nimport {\n children as resolveChildren,\n createContext,\n createEffect,\n createSignal,\n omit,\n Show,\n useContext,\n} from 'solid-js'\nimport { Dialog } from '../dialog'\nimport {\n LayerEscapeTarget,\n type LayerHandlers,\n TopLayerPositioner,\n useLayerContent,\n} from '../dialog/dialog-layer'\nimport { overlayContainer } from '../tooltip/tooltip'\nimport { menuItem, menuShortcut, overlaySurface, overlayZoom } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { forwardRef } from '#lib/refs'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Search = fastIcon(LucideSearch)\n\n// The rows write `data-selected` and `data-disabled` as `\"true\"|\"false\"`, the\n// cmdk-era contract the classes below (and hosts' selectors) are written\n// against. The shared row's presence-only disabled styles come off for the\n// `=true` forms, and so does its `data-highlighted` hover fill: ui-sdk marks\n// the highlighted row with it too, and the selected row's accent fill is the\n// palette's one highlight.\nconst commandItem = menuItem\n .replace('data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground', '')\n .replace('data-[disabled]:pointer-events-none', '')\n .replace('data-[disabled]:text-muted-foreground', '')\n\ntype CommandScope = {\n controller: CommandController\n label: () => string | undefined\n /** The input's `onValueChange`, which the root calls as the search text changes. */\n inputListener: { current?: (search: string) => void }\n}\n\n/**\n * Calls a caller's `ref`, which Solid 2 hands over as a function or, once\n * merged with another (a tooltip trigger around a menu trigger), an array.\n */\nfunction callRef<T>(ref: unknown, element: T): void {\n if (typeof ref === 'function') ref(element)\n else if (Array.isArray(ref)) for (const each of ref) callRef(each, element)\n}\n\nconst CommandScopeContext = createContext<CommandScope | null>(null)\n\n/** The cmdk-era options the root kept. */\ntype CommandOwnProps = {\n /** The input's accessible name. */\n label?: string\n /** `false` keeps every item, for results a server already filtered. */\n shouldFilter?: boolean\n /** A custom ranking: a score above 0 keeps the item, higher first. */\n filter?: (value: string, search: string, keywords?: string[]) => number\n /** The highlighted item's value. */\n value?: string\n /** The item highlighted at first. */\n defaultValue?: string\n /** The highlight moved. */\n onValueChange?: (value: string) => void\n /** Whether arrow keys wrap from the last item to the first. Off by default, as under cmdk. */\n loop?: boolean\n /** Kept for the API; ui-sdk moves the highlight with the arrow keys only. */\n vimBindings?: boolean\n /** Kept for the API; the pointer always moves the highlight. */\n disablePointerSelection?: boolean\n /** Runs when an item runs, with its value, after the item's own `onSelect`. */\n onAction?: (value: string) => void\n children?: JSX.Element\n}\n\nexport type CommandProps = Omit<\n ComponentProps<'div'>,\n keyof CommandOwnProps | 'onChange' | 'onSelect'\n> &\n CommandOwnProps\n\n/**\n * Command.\n *\n * The command palette: a filtered list of everything the user can do, ranked\n * by fuzzy match. It is the one place in an app where a keyboard-first surface\n * is the *primary* one, so it carries rules the rest of the system does not:\n *\n * - Every item must be reachable by typing its name. If a user has to\n * remember which group it lives in, the palette has failed at its job.\n * - Groups exist for reading, not for navigation. The ranking crosses them.\n * - The empty state is not an apology: it should offer the closest thing\n * the app could guess, or say plainly that nothing matched.\n *\n * ui-sdk's Command supplies the filter, the scoring, the\n * `aria-activedescendant` wiring and the arrow-key navigation. The parts keep\n * the `cmdk-*` attributes and `data-selected=\"true\"` on the highlighted row,\n * which the kit's classes and hosts' selectors are written against.\n */\nexport function Command(props: CommandProps) {\n const controller = createCommandController()\n const inputListener: CommandScope['inputListener'] = {}\n // The first highlight paints without the rows' colour transition. ui-sdk\n // measures the list to keep the new row in view as soon as it highlights\n // one, and Solid writes the row's `data-selected` only after that, so the\n // browser has already styled the row unselected and fades the accent in\n // over 120ms when the palette opens; cmdk drew it selected at once. Two\n // frames after mount the initial highlight has painted, and later moves\n // keep their transition (ui-notes/ui-sdk-issue-highlight-reveal.md).\n const [settling, setSettling] = createSignal(true)\n const rest = omit(\n props,\n 'ref',\n 'class',\n 'children',\n 'label',\n 'shouldFilter',\n 'filter',\n 'value',\n 'defaultValue',\n 'onValueChange',\n 'loop',\n 'vimBindings',\n 'disablePointerSelection',\n 'onAction'\n )\n\n const filter = () => {\n if (props.shouldFilter === false) return false as const\n const rank = props.filter\n if (!rank) return undefined\n return (item: { label: string; keywords?: string[] }, search: string) =>\n rank(item.label, search, item.keywords)\n }\n\n return (\n <CommandScopeContext value={{ controller, label: () => props.label, inputListener }}>\n <CommandPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-root=\"\"\n data-settling={settling() ? '' : undefined}\n ref={(element: HTMLDivElement) => {\n requestAnimationFrame(() => requestAnimationFrame(() => setSettling(false)))\n forwardRef(() => props.ref, element)\n }}\n controller={controller}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value: string | null) => props.onValueChange?.(value ?? '')}\n onQueryChange={(search: string) => inputListener.current?.(search)}\n onAction={(value: string) => props.onAction?.(value)}\n filter={filter()}\n loop={props.loop ?? false}\n class={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-xl',\n props.class\n )}\n >\n {props.children}\n </CommandPrimitive>\n </CommandScopeContext>\n )\n}\n\ntype CommandDialogProps = CommandProps &\n Pick<LayerHandlers, 'onCloseAutoFocus' | 'onOpenAutoFocus'> &\n Pick<\n ComponentProps<typeof Dialog>,\n 'open' | 'defaultOpen' | 'onOpenChange' | 'modal' | 'preventScroll' | 'forceMount'\n > & {\n /** Adds to `class` on the dialog surface. */\n contentClassName?: string\n /** The layer under the panel, unstyled unless this names a class. */\n overlayClassName?: string\n /** Where the dialog mounts, `<body>` by default. */\n container?: Element\n translations?: unknown\n }\n\n/**\n * The palette in a modal: the kit's Dialog root (focus trap, Escape, an\n * outside press, scroll lock and focus return) around a surface drawn at a\n * third of the window's height, where the eye lands, not the centre.\n * `class` and `contentClassName` land on the surface; the rest of the props\n * are the nested Command's.\n */\nexport function CommandDialog(props: CommandDialogProps) {\n const dialogKeys = [\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'id',\n 'modal',\n 'preventScroll',\n 'forceMount',\n 'translations',\n ] as const\n const commandProps = omit(\n props as CommandDialogProps & { id?: string },\n 'class',\n 'contentClassName',\n 'overlayClassName',\n 'container',\n 'onCloseAutoFocus',\n 'onOpenAutoFocus',\n ...dialogKeys\n )\n\n return (\n <Dialog\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={props.onOpenChange}\n modal={props.modal}\n >\n <CommandDialogContent\n label={props.label}\n class={cn(props.class, props.contentClassName)}\n overlayClassName={props.overlayClassName}\n container={props.container}\n onOpenAutoFocus={props.onOpenAutoFocus}\n onCloseAutoFocus={props.onCloseAutoFocus}\n >\n <Command {...commandProps} />\n </CommandDialogContent>\n </Dialog>\n )\n}\n\nfunction CommandDialogContent(\n props: Pick<CommandDialogProps, 'onCloseAutoFocus' | 'onOpenAutoFocus' | 'children'> & {\n label?: string\n class?: string\n overlayClassName?: string\n container?: Element\n }\n) {\n let panel: HTMLDivElement | undefined\n const focus = useLayerContent({\n content: () => panel,\n handlers: () => ({\n onOpenAutoFocus: props.onOpenAutoFocus,\n onCloseAutoFocus: props.onCloseAutoFocus,\n }),\n })\n return (\n <Portal mount={props.container ?? overlayContainer()}>\n <UiDialogContent\n // Inline inside a top-layer positioner of its own, as the kit's\n // DialogContent does; the surface keeps its fixed placement.\n inline\n ref={(element: HTMLDivElement) => (panel = element)}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n aria-label={props.label}\n class={cn(\n overlaySurface,\n 'fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden shadow-xl',\n overlayZoom,\n props.class\n )}\n render={(panelProps: Record<string, unknown>, state: { open: boolean }) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n <div\n cmdk-overlay=\"\"\n aria-hidden=\"true\"\n data-expanded={state.open ? '' : undefined}\n data-closed={state.open ? undefined : ''}\n class={props.overlayClassName}\n />\n <div {...panelProps} cmdk-dialog=\"\" data-expanded={state.open ? '' : undefined} />\n </TopLayerPositioner>\n )}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiDialogContent>\n </Portal>\n )\n}\n\nexport type CommandInputProps = Omit<ComponentProps<'input'>, 'value' | 'onChange'> & {\n /** The search text. Pass it to control the search. */\n value?: string\n /** The search text changed. */\n onValueChange?: (search: string) => void\n}\n\nexport function CommandInput(props: CommandInputProps) {\n const scope = useContext(CommandScopeContext)\n const rest = omit(props, 'class', 'value', 'onValueChange', 'onKeyDown')\n if (scope) scope.inputListener.current = (search) => props.onValueChange?.(search)\n\n // Escape closes the layer around the palette (a popover, a dialog) in one press, search text\n // or not, as it did before ui-sdk. ui-sdk's input clears the search first and keeps the event;\n // with the search already cleared here, it leaves Escape to the layer. On a page it still\n // steps back.\n const onKeyDown: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (event) => {\n const handler = props.onKeyDown\n if (typeof handler === 'function') handler(event)\n else if (Array.isArray(handler)) handler[0](handler[1], event)\n if (event.defaultPrevented || event.key !== 'Escape' || !scope) return\n if (scope.controller.getPages().length > 0) return\n if (scope.controller.getQuery()) scope.controller.setQuery('', { event })\n }\n\n createEffect(\n () => props.value,\n (search) => {\n if (search === undefined || !scope || scope.controller.getQuery() === search) return\n scope.controller.setQuery(search)\n }\n )\n\n return (\n <div\n data-slot=\"command-input-wrapper\"\n class=\"flex h-11 items-center gap-2 border-b border-border px-3\"\n >\n <Search class=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <CommandInputPrimitive\n aria-label={scope?.label()}\n {...(rest as Record<string, unknown>)}\n onKeyDown={onKeyDown}\n cmdk-input=\"\"\n class={cn(\n 'h-full w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n props.class\n )}\n />\n </div>\n )\n}\n\n/**\n * The scrolling list: a listbox that owns the options, always shown. ui-sdk\n * keeps an empty search's listbox valid and announces the result count, so the\n * cmdk-era role corrections are gone with cmdk's sizer.\n */\nexport function CommandList(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return (\n <CommandListPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-list=\"\"\n class={cn('max-h-80 scroll-py-1 overflow-y-auto overflow-x-hidden p-1', props.class)}\n />\n )\n}\n\n/**\n * The no-match message. Place it beside `CommandList`, before it, not inside:\n * it is a `status` live region, which a listbox may not contain. ui-sdk keeps\n * it mounted so the announcement is reliable, and it collapses to no height\n * while the search has matches (`data-empty` marks a search with none).\n */\nexport function CommandEmpty(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return (\n <CommandEmptyPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-empty=\"\"\n class={cn(\n 'text-muted-foreground py-8 text-center text-sm not-data-[empty]:py-0',\n props.class\n )}\n />\n )\n}\n\nexport type CommandGroupProps = ComponentProps<'div'> & {\n /** The group's heading, which names it. */\n heading?: JSX.Element\n /** Kept for the API: a group hides while none of its items matches. */\n forceMount?: boolean\n /** Kept for the API. */\n value?: string\n}\n\nexport function CommandGroup(props: CommandGroupProps) {\n const rest = omit(props, 'class', 'children', 'heading', 'forceMount', 'value')\n const heading = resolveChildren(() => props.heading)\n return (\n <CommandGroupPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-group=\"\"\n class={cn(\n 'text-foreground overflow-hidden p-1',\n '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:uppercase',\n props.class\n )}\n >\n <Show when={heading()}>\n <CommandGroupLabelPrimitive cmdk-group-heading=\"\">{heading()}</CommandGroupLabelPrimitive>\n </Show>\n {props.children}\n </CommandGroupPrimitive>\n )\n}\n\nexport type CommandItemProps = Omit<ComponentProps<'div'>, 'onSelect' | 'value'> & {\n /** What the search matches and what `onSelect` reports. Defaults to the item's text. */\n value?: string\n /** More words the search matches. */\n keywords?: string[]\n disabled?: boolean\n /** The item ran: a click, or Enter while it is highlighted. */\n onSelect?: (value: string) => void\n /** Kept for the API: an item shows while it matches the search. */\n forceMount?: boolean\n}\n\nexport function CommandItem(props: CommandItemProps) {\n let element: HTMLDivElement | undefined\n const rest = omit(\n props,\n 'class',\n 'value',\n 'keywords',\n 'disabled',\n 'onSelect',\n 'forceMount',\n 'ref'\n )\n const value = () => props.value?.trim()\n return (\n <CommandItemPrimitive\n {...(rest as Record<string, unknown>)}\n ref={(node: HTMLDivElement) => {\n element = node\n callRef(props.ref, node)\n }}\n value={value()}\n label={value()}\n keywords={props.keywords}\n disabled={props.disabled}\n onSelect={() => props.onSelect?.(value() ?? element?.textContent?.trim() ?? '')}\n render={(\n part: Record<string, unknown>,\n state: { highlighted: boolean; disabled: boolean }\n ) => (\n <div\n {...part}\n cmdk-item=\"\"\n data-selected={state.highlighted ? 'true' : 'false'}\n data-disabled={state.disabled ? 'true' : 'false'}\n data-value={value()}\n />\n )}\n class={cn(\n commandItem,\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:text-muted-foreground',\n // The selected row sits on the accent rung, the same primary-subtle\n // fill the settings navigation's selected row owns, instead of the\n // popover rung, so what is chosen keeps the accent the checked menus\n // already carry in their indicators.\n 'group/command-item text-popover-foreground data-[selected=true]:bg-primary-subtle data-[selected=true]:text-foreground',\n 'in-data-settling:transition-none',\n props.class\n )}\n />\n )\n}\n\nexport function CommandSeparator(props: ComponentProps<'div'> & { alwaysRender?: boolean }) {\n const rest = omit(props, 'class', 'alwaysRender')\n return (\n <CommandSeparatorPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-separator=\"\"\n // A listbox owns options and groups only; the hairline is presentation.\n render={(part: Record<string, unknown>) => (\n <div {...part} role=\"presentation\" aria-orientation={undefined} />\n )}\n class={cn('bg-border -mx-1 my-1 h-px', props.class)}\n />\n )\n}\n\n/** A loading row: a progress bar named \"Loading…\" unless `label` says otherwise. */\nexport function CommandLoading(\n props: ComponentProps<'div'> & { progress?: number; label?: string }\n) {\n const rest = omit(props, 'class', 'children', 'progress', 'label')\n return (\n <div\n {...rest}\n cmdk-loading=\"\"\n role=\"progressbar\"\n aria-valuenow={props.progress}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={props.label ?? 'Loading...'}\n class={cn('text-muted-foreground py-6 text-center text-sm', props.class)}\n >\n <div aria-hidden=\"true\">{props.children}</div>\n </div>\n )\n}\n\n/** The keyboard hint a palette item usually carries. */\nexport function CommandShortcut(props: {\n class?: string\n children?: ComponentProps<'span'>['children']\n}) {\n return (\n <span\n class={cn(\n menuShortcut,\n 'group-data-[selected=true]/command-item:text-foreground',\n props.class\n )}\n >\n {props.children}\n </span>\n )\n}\n\n/**\n * The status line a command surface reports under its list: searching, offline,\n * a partial result caveat. The copy and the live-role semantics (`status`,\n * `alert`) are the caller's, a palette's failure modes are app facts, but the\n * line's shape is not something every caller should redraw.\n */\nexport function CommandStatus(props: ComponentProps<'p'>) {\n const rest = omit(props, 'class')\n\n return (\n <p\n data-slot=\"command-status\"\n class={cn('text-muted-foreground px-4 py-4 text-center text-sm', props.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The keyboard hint a palette footer carries, right-aligned under the list so\n * it reads as furniture rather than a result. Muted on purpose: the arrows are\n * what the user has already been doing by the time they read it.\n */\nexport function CommandHint(props: ComponentProps<'p'>) {\n const rest = omit(props, 'class')\n\n return (\n <p\n data-slot=\"command-hint\"\n class={cn('text-muted-foreground px-4 pb-1.5 text-right text-xs', props.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCA,IAAM,SAAS,SAAS0C,QAAY;AAQpC,IAAM,cAAc,SACjB,QAAQ,0EAA0E,EAAE,CAAC,CACrF,QAAQ,uCAAuC,EAAE,CAAC,CAClD,QAAQ,yCAAyC,EAAE;;;;;AAatD,SAAS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xD,MAAM,OAAO,KAAK,OAAO,OAAO;CAG9B,IAAA,SAAA,QAIC;CADCQ,OAAA,QAAA,CAAA;EAFA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,uDAAuD,MAAM,KAAK;EAAC;CACrE,GAAJ,IAAA,GAAA,KAAA;CAJR,OACEP;AAMJ;;;;;;AAOA,SAAgB,YAAY,OAA4B;CACtD,MAAM,OAAO,KAAK,OAAO,OAAO;CAG9B,IAAA,SAAA,QAIC;CADCO,OAAA,QAAA,CAAA;EAFA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,wDAAwD,MAAM,KAAK;EAAC;CACtE,GAAJ,IAAA,GAAA,KAAA;CAJR,OACEN;AAMJ"}
1
+ {"version":3,"file":"command.js","names":["<CommandScopeContext value={{ controller, label: () => props.label, inputListener }}>\n <CommandPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-root=\"\"\n data-settling={settling() ? '' : undefined}\n ref={(element: HTMLDivElement) => {\n requestAnimationFrame(() => requestAnimationFrame(() => setSettling(false)))\n forwardRef(() => props.ref, element)\n }}\n controller={controller}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value: string | null) => props.onValueChange?.(value ?? '')}\n onQueryChange={(search: string) => inputListener.current?.(search)}\n onAction={(value: string) => props.onAction?.(value)}\n filter={filter()}\n loop={props.loop ?? false}\n class={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-xl',\n props.class\n )}\n >\n {props.children}\n </CommandPrimitive>\n </CommandScopeContext>","value={{ controller, label: () => props.label, inputListener }}","<CommandPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-root=\"\"\n data-settling={settling() ? '' : undefined}\n ref={(element: HTMLDivElement) => {\n requestAnimationFrame(() => requestAnimationFrame(() => setSettling(false)))\n forwardRef(() => props.ref, element)\n }}\n controller={controller}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value: string | null) => props.onValueChange?.(value ?? '')}\n onQueryChange={(search: string) => inputListener.current?.(search)}\n onAction={(value: string) => props.onAction?.(value)}\n filter={filter()}\n loop={props.loop ?? false}\n class={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-xl',\n props.class\n )}\n >\n {props.children}\n </CommandPrimitive>","ref={(element: HTMLDivElement) => {\n requestAnimationFrame(() => requestAnimationFrame(() => setSettling(false)))\n forwardRef(() => props.ref, element)\n }}","onValueChange={(value: string | null) => props.onValueChange?.(value ?? '')}","onQueryChange={(search: string) => inputListener.current?.(search)}","onAction={(value: string) => props.onAction?.(value)}","<Dialog\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={props.onOpenChange}\n modal={props.modal}\n >\n <CommandDialogContent\n label={props.label}\n class={cn(props.class, props.contentClassName)}\n overlayClassName={props.overlayClassName}\n container={props.container}\n onOpenAutoFocus={props.onOpenAutoFocus}\n onCloseAutoFocus={props.onCloseAutoFocus}\n >\n <Command {...commandProps} />\n </CommandDialogContent>\n </Dialog>","<CommandDialogContent\n label={props.label}\n class={cn(props.class, props.contentClassName)}\n overlayClassName={props.overlayClassName}\n container={props.container}\n onOpenAutoFocus={props.onOpenAutoFocus}\n onCloseAutoFocus={props.onCloseAutoFocus}\n >\n <Command {...commandProps} />\n </CommandDialogContent>","<Command {...commandProps} />","<Portal mount={props.container ?? overlayContainer()}>\n <UiDialogContent\n // Inline inside a top-layer positioner of its own, as the kit's\n // DialogContent does; the surface keeps its fixed placement.\n inline\n ref={(element: HTMLDivElement) => (panel = element)}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n aria-label={props.label}\n class={cn(\n overlaySurface,\n 'fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden shadow-xl',\n overlayZoom,\n props.class\n )}\n render={(panelProps: Record<string, unknown>, state: { open: boolean }) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n <div\n cmdk-overlay=\"\"\n aria-hidden=\"true\"\n data-expanded={state.open ? '' : undefined}\n data-closed={state.open ? undefined : ''}\n class={props.overlayClassName}\n />\n <div {...panelProps} cmdk-dialog=\"\" data-expanded={state.open ? '' : undefined} />\n </TopLayerPositioner>\n )}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiDialogContent>\n </Portal>","<UiDialogContent\n // Inline inside a top-layer positioner of its own, as the kit's\n // DialogContent does; the surface keeps its fixed placement.\n inline\n ref={(element: HTMLDivElement) => (panel = element)}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n aria-label={props.label}\n class={cn(\n overlaySurface,\n 'fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden shadow-xl',\n overlayZoom,\n props.class\n )}\n render={(panelProps: Record<string, unknown>, state: { open: boolean }) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n <div\n cmdk-overlay=\"\"\n aria-hidden=\"true\"\n data-expanded={state.open ? '' : undefined}\n data-closed={state.open ? undefined : ''}\n class={props.overlayClassName}\n />\n <div {...panelProps} cmdk-dialog=\"\" data-expanded={state.open ? '' : undefined} />\n </TopLayerPositioner>\n )}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiDialogContent>","ref={(element: HTMLDivElement) => (panel = element)}","render={(panelProps: Record<string, unknown>, state: { open: boolean }) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n <div\n cmdk-overlay=\"\"\n aria-hidden=\"true\"\n data-expanded={state.open ? '' : undefined}\n data-closed={state.open ? undefined : ''}\n class={props.overlayClassName}\n />\n <div {...panelProps} cmdk-dialog=\"\" data-expanded={state.open ? '' : undefined} />\n </TopLayerPositioner>\n )}","<TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n <div\n cmdk-overlay=\"\"\n aria-hidden=\"true\"\n data-expanded={state.open ? '' : undefined}\n data-closed={state.open ? undefined : ''}\n class={props.overlayClassName}\n />\n <div {...panelProps} cmdk-dialog=\"\" data-expanded={state.open ? '' : undefined} />\n </TopLayerPositioner>","class=\"fixed inset-0 z-(--z-dialog)\"","data-closed={state.open ? undefined : ''}","class={props.overlayClassName}","<LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>","element={() => panel}","<Search class=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />","class=\"size-4 shrink-0 text-muted-foreground\"","<div\n data-slot=\"command-input-wrapper\"\n class=\"flex h-11 shrink-0 items-center gap-2 border-b border-border px-3\"\n >\n <Search class=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <CommandInputPrimitive\n aria-label={scope?.label()}\n {...(rest as Record<string, unknown>)}\n onKeyDown={onKeyDown}\n cmdk-input=\"\"\n class={cn(\n 'h-full w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n props.class\n )}\n />\n </div>","<CommandInputPrimitive\n aria-label={scope?.label()}\n {...(rest as Record<string, unknown>)}\n onKeyDown={onKeyDown}\n cmdk-input=\"\"\n class={cn(\n 'h-full w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n props.class\n )}\n />","<CommandListPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-list=\"\"\n class={cn('max-h-80 scroll-py-1 overflow-y-auto overflow-x-hidden p-1', props.class)}\n />","<CommandEmptyPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-empty=\"\"\n class={cn(\n 'text-muted-foreground py-8 text-center text-sm not-data-[empty]:py-0',\n props.class\n )}\n />","<CommandGroupPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-group=\"\"\n class={cn(\n 'text-foreground overflow-hidden p-1',\n '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:uppercase',\n props.class\n )}\n >\n <Show when={heading()}>\n <CommandGroupLabelPrimitive cmdk-group-heading=\"\">{heading()}</CommandGroupLabelPrimitive>\n </Show>\n {props.children}\n </CommandGroupPrimitive>","<Show when={heading()}>\n <CommandGroupLabelPrimitive cmdk-group-heading=\"\">{heading()}</CommandGroupLabelPrimitive>\n </Show>","<CommandGroupLabelPrimitive cmdk-group-heading=\"\">{heading()}</CommandGroupLabelPrimitive>","props.children","<CommandItemPrimitive\n {...(rest as Record<string, unknown>)}\n ref={(node: HTMLDivElement) => {\n element = node\n callRef(props.ref, node)\n }}\n value={value()}\n label={value()}\n keywords={props.keywords}\n disabled={props.disabled}\n onSelect={() => props.onSelect?.(value() ?? element?.textContent?.trim() ?? '')}\n render={(\n part: Record<string, unknown>,\n state: { highlighted: boolean; disabled: boolean }\n ) => (\n <div\n {...part}\n cmdk-item=\"\"\n data-selected={state.highlighted ? 'true' : 'false'}\n data-disabled={state.disabled ? 'true' : 'false'}\n data-value={value()}\n />\n )}\n class={cn(\n commandItem,\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:text-muted-foreground',\n // The selected row sits on the accent rung, the same primary-subtle\n // fill the settings navigation's selected row owns, instead of the\n // popover rung, so what is chosen keeps the accent the checked menus\n // already carry in their indicators.\n 'group/command-item text-popover-foreground data-[selected=true]:bg-primary-subtle data-[selected=true]:text-foreground',\n 'in-data-settling:transition-none',\n props.class\n )}\n />","ref={(node: HTMLDivElement) => {\n element = node\n callRef(props.ref, node)\n }}","onSelect={() => props.onSelect?.(value() ?? element?.textContent?.trim() ?? '')}","render={(\n part: Record<string, unknown>,\n state: { highlighted: boolean; disabled: boolean }\n ) => (\n <div\n {...part}\n cmdk-item=\"\"\n data-selected={state.highlighted ? 'true' : 'false'}\n data-disabled={state.disabled ? 'true' : 'false'}\n data-value={value()}\n />\n )}","<CommandSeparatorPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-separator=\"\"\n // A listbox owns options and groups only; the hairline is presentation.\n render={(part: Record<string, unknown>) => (\n <div {...part} role=\"presentation\" aria-orientation={undefined} />\n )}\n class={cn('bg-border -mx-1 my-1 h-px', props.class)}\n />","render={(part: Record<string, unknown>) => (\n <div {...part} role=\"presentation\" aria-orientation={undefined} />\n )}","role=\"presentation\"","role=\"progressbar\"","<div\n {...rest}\n cmdk-loading=\"\"\n role=\"progressbar\"\n aria-valuenow={props.progress}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={props.label ?? 'Loading...'}\n class={cn('text-muted-foreground py-6 text-center text-sm', props.class)}\n >\n <div aria-hidden=\"true\">{props.children}</div>\n </div>","<span\n class={cn(\n menuShortcut,\n 'group-data-[selected=true]/command-item:text-foreground',\n props.class\n )}\n >\n {props.children}\n </span>","<p\n data-slot=\"command-status\"\n class={cn('text-muted-foreground px-4 py-4 text-center text-sm', props.class)}\n {...rest}\n />","<p\n data-slot=\"command-hint\"\n class={cn('text-muted-foreground px-4 pb-1.5 text-right text-xs', props.class)}\n {...rest}\n />","LucideSearch","_$effect","_$readShallow","_$setAttribute","_$className","_$spread","_$insert","resolveChildren"],"sources":["../../../../src/components/ui/command/command.tsx"],"sourcesContent":["import {\n Command as CommandPrimitive,\n CommandEmpty as CommandEmptyPrimitive,\n CommandGroup as CommandGroupPrimitive,\n CommandGroupLabel as CommandGroupLabelPrimitive,\n CommandInput as CommandInputPrimitive,\n CommandItem as CommandItemPrimitive,\n CommandList as CommandListPrimitive,\n CommandSeparator as CommandSeparatorPrimitive,\n createCommandController,\n type CommandController,\n} from '@ui-sdk/solid/command'\nimport { DialogContent as UiDialogContent } from '@ui-sdk/solid/dialog'\nimport { Search as LucideSearch } from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { Portal } from '@solidjs/web'\nimport {\n children as resolveChildren,\n createContext,\n createEffect,\n createSignal,\n omit,\n Show,\n useContext,\n} from 'solid-js'\nimport { Dialog } from '../dialog'\nimport {\n LayerEscapeTarget,\n type LayerHandlers,\n TopLayerPositioner,\n useLayerContent,\n} from '../dialog/dialog-layer'\nimport { overlayContainer } from '../tooltip/tooltip'\nimport { menuItem, menuShortcut, overlaySurface, overlayZoom } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { forwardRef } from '#lib/refs'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Search = fastIcon(LucideSearch)\n\n// The rows write `data-selected` and `data-disabled` as `\"true\"|\"false\"`, the\n// cmdk-era contract the classes below (and hosts' selectors) are written\n// against. The shared row's presence-only disabled styles come off for the\n// `=true` forms, and so does its `data-highlighted` hover fill: ui-sdk marks\n// the highlighted row with it too, and the selected row's accent fill is the\n// palette's one highlight.\nconst commandItem = menuItem\n .replace('data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground', '')\n .replace('data-[disabled]:pointer-events-none', '')\n .replace('data-[disabled]:text-muted-foreground', '')\n\ntype CommandScope = {\n controller: CommandController\n label: () => string | undefined\n /** The input's `onValueChange`, which the root calls as the search text changes. */\n inputListener: { current?: (search: string) => void }\n}\n\n/**\n * Calls a caller's `ref`, which Solid 2 hands over as a function or, once\n * merged with another (a tooltip trigger around a menu trigger), an array.\n */\nfunction callRef<T>(ref: unknown, element: T): void {\n if (typeof ref === 'function') ref(element)\n else if (Array.isArray(ref)) for (const each of ref) callRef(each, element)\n}\n\nconst CommandScopeContext = createContext<CommandScope | null>(null)\n\n/** The cmdk-era options the root kept. */\ntype CommandOwnProps = {\n /** The input's accessible name. */\n label?: string\n /** `false` keeps every item, for results a server already filtered. */\n shouldFilter?: boolean\n /** A custom ranking: a score above 0 keeps the item, higher first. */\n filter?: (value: string, search: string, keywords?: string[]) => number\n /** The highlighted item's value. */\n value?: string\n /** The item highlighted at first. */\n defaultValue?: string\n /** The highlight moved. */\n onValueChange?: (value: string) => void\n /** Whether arrow keys wrap from the last item to the first. Off by default, as under cmdk. */\n loop?: boolean\n /** Kept for the API; ui-sdk moves the highlight with the arrow keys only. */\n vimBindings?: boolean\n /** Kept for the API; the pointer always moves the highlight. */\n disablePointerSelection?: boolean\n /** Runs when an item runs, with its value, after the item's own `onSelect`. */\n onAction?: (value: string) => void\n children?: JSX.Element\n}\n\nexport type CommandProps = Omit<\n ComponentProps<'div'>,\n keyof CommandOwnProps | 'onChange' | 'onSelect'\n> &\n CommandOwnProps\n\n/**\n * Command.\n *\n * The command palette: a filtered list of everything the user can do, ranked\n * by fuzzy match. It is the one place in an app where a keyboard-first surface\n * is the *primary* one, so it carries rules the rest of the system does not:\n *\n * - Every item must be reachable by typing its name. If a user has to\n * remember which group it lives in, the palette has failed at its job.\n * - Groups exist for reading, not for navigation. The ranking crosses them.\n * - The empty state is not an apology: it should offer the closest thing\n * the app could guess, or say plainly that nothing matched.\n *\n * ui-sdk's Command supplies the filter, the scoring, the\n * `aria-activedescendant` wiring and the arrow-key navigation. The parts keep\n * the `cmdk-*` attributes and `data-selected=\"true\"` on the highlighted row,\n * which the kit's classes and hosts' selectors are written against.\n */\nexport function Command(props: CommandProps) {\n const controller = createCommandController()\n const inputListener: CommandScope['inputListener'] = {}\n // The first highlight paints without the rows' colour transition. ui-sdk\n // measures the list to keep the new row in view as soon as it highlights\n // one, and Solid writes the row's `data-selected` only after that, so the\n // browser has already styled the row unselected and fades the accent in\n // over 120ms when the palette opens; cmdk drew it selected at once. Two\n // frames after mount the initial highlight has painted, and later moves\n // keep their transition (ui-notes/ui-sdk-issue-highlight-reveal.md).\n const [settling, setSettling] = createSignal(true)\n const rest = omit(\n props,\n 'ref',\n 'class',\n 'children',\n 'label',\n 'shouldFilter',\n 'filter',\n 'value',\n 'defaultValue',\n 'onValueChange',\n 'loop',\n 'vimBindings',\n 'disablePointerSelection',\n 'onAction'\n )\n\n const filter = () => {\n if (props.shouldFilter === false) return false as const\n const rank = props.filter\n if (!rank) return undefined\n return (item: { label: string; keywords?: string[] }, search: string) =>\n rank(item.label, search, item.keywords)\n }\n\n return (\n <CommandScopeContext value={{ controller, label: () => props.label, inputListener }}>\n <CommandPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-root=\"\"\n data-settling={settling() ? '' : undefined}\n ref={(element: HTMLDivElement) => {\n requestAnimationFrame(() => requestAnimationFrame(() => setSettling(false)))\n forwardRef(() => props.ref, element)\n }}\n controller={controller}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value: string | null) => props.onValueChange?.(value ?? '')}\n onQueryChange={(search: string) => inputListener.current?.(search)}\n onAction={(value: string) => props.onAction?.(value)}\n filter={filter()}\n loop={props.loop ?? false}\n class={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-xl',\n props.class\n )}\n >\n {props.children}\n </CommandPrimitive>\n </CommandScopeContext>\n )\n}\n\ntype CommandDialogProps = CommandProps &\n Pick<LayerHandlers, 'onCloseAutoFocus' | 'onOpenAutoFocus'> &\n Pick<\n ComponentProps<typeof Dialog>,\n 'open' | 'defaultOpen' | 'onOpenChange' | 'modal' | 'preventScroll' | 'forceMount'\n > & {\n /** Adds to `class` on the dialog surface. */\n contentClassName?: string\n /** The layer under the panel, unstyled unless this names a class. */\n overlayClassName?: string\n /** Where the dialog mounts, `<body>` by default. */\n container?: Element\n translations?: unknown\n }\n\n/**\n * The palette in a modal: the kit's Dialog root (focus trap, Escape, an\n * outside press, scroll lock and focus return) around a surface drawn at a\n * third of the window's height, where the eye lands, not the centre.\n * `class` and `contentClassName` land on the surface; the rest of the props\n * are the nested Command's.\n */\nexport function CommandDialog(props: CommandDialogProps) {\n const dialogKeys = [\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'id',\n 'modal',\n 'preventScroll',\n 'forceMount',\n 'translations',\n ] as const\n const commandProps = omit(\n props as CommandDialogProps & { id?: string },\n 'class',\n 'contentClassName',\n 'overlayClassName',\n 'container',\n 'onCloseAutoFocus',\n 'onOpenAutoFocus',\n ...dialogKeys\n )\n\n return (\n <Dialog\n open={props.open}\n defaultOpen={props.defaultOpen}\n onOpenChange={props.onOpenChange}\n modal={props.modal}\n >\n <CommandDialogContent\n label={props.label}\n class={cn(props.class, props.contentClassName)}\n overlayClassName={props.overlayClassName}\n container={props.container}\n onOpenAutoFocus={props.onOpenAutoFocus}\n onCloseAutoFocus={props.onCloseAutoFocus}\n >\n <Command {...commandProps} />\n </CommandDialogContent>\n </Dialog>\n )\n}\n\nfunction CommandDialogContent(\n props: Pick<CommandDialogProps, 'onCloseAutoFocus' | 'onOpenAutoFocus' | 'children'> & {\n label?: string\n class?: string\n overlayClassName?: string\n container?: Element\n }\n) {\n let panel: HTMLDivElement | undefined\n const focus = useLayerContent({\n content: () => panel,\n handlers: () => ({\n onOpenAutoFocus: props.onOpenAutoFocus,\n onCloseAutoFocus: props.onCloseAutoFocus,\n }),\n })\n return (\n <Portal mount={props.container ?? overlayContainer()}>\n <UiDialogContent\n // Inline inside a top-layer positioner of its own, as the kit's\n // DialogContent does; the surface keeps its fixed placement.\n inline\n ref={(element: HTMLDivElement) => (panel = element)}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n aria-label={props.label}\n class={cn(\n overlaySurface,\n 'fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden shadow-xl',\n overlayZoom,\n props.class\n )}\n render={(panelProps: Record<string, unknown>, state: { open: boolean }) => (\n <TopLayerPositioner class=\"fixed inset-0 z-(--z-dialog)\">\n <div\n cmdk-overlay=\"\"\n aria-hidden=\"true\"\n data-expanded={state.open ? '' : undefined}\n data-closed={state.open ? undefined : ''}\n class={props.overlayClassName}\n />\n <div {...panelProps} cmdk-dialog=\"\" data-expanded={state.open ? '' : undefined} />\n </TopLayerPositioner>\n )}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiDialogContent>\n </Portal>\n )\n}\n\nexport type CommandInputProps = Omit<ComponentProps<'input'>, 'value' | 'onChange'> & {\n /** The search text. Pass it to control the search. */\n value?: string\n /** The search text changed. */\n onValueChange?: (search: string) => void\n}\n\nexport function CommandInput(props: CommandInputProps) {\n const scope = useContext(CommandScopeContext)\n const rest = omit(props, 'class', 'value', 'onValueChange', 'onKeyDown')\n if (scope) scope.inputListener.current = (search) => props.onValueChange?.(search)\n\n // Escape closes the layer around the palette (a popover, a dialog) in one press, search text\n // or not, as it did before ui-sdk. ui-sdk's input clears the search first and keeps the event;\n // with the search already cleared here, it leaves Escape to the layer. On a page it still\n // steps back.\n const onKeyDown: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (event) => {\n const handler = props.onKeyDown\n if (typeof handler === 'function') handler(event)\n else if (Array.isArray(handler)) handler[0](handler[1], event)\n if (event.defaultPrevented || event.key !== 'Escape' || !scope) return\n if (scope.controller.getPages().length > 0) return\n if (scope.controller.getQuery()) scope.controller.setQuery('', { event })\n }\n\n createEffect(\n () => props.value,\n (search) => {\n if (search === undefined || !scope || scope.controller.getQuery() === search) return\n scope.controller.setQuery(search)\n }\n )\n\n return (\n <div\n data-slot=\"command-input-wrapper\"\n class=\"flex h-11 shrink-0 items-center gap-2 border-b border-border px-3\"\n >\n <Search class=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <CommandInputPrimitive\n aria-label={scope?.label()}\n {...(rest as Record<string, unknown>)}\n onKeyDown={onKeyDown}\n cmdk-input=\"\"\n class={cn(\n 'h-full w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n props.class\n )}\n />\n </div>\n )\n}\n\n/**\n * The scrolling list: a listbox that owns the options, always shown. ui-sdk\n * keeps an empty search's listbox valid and announces the result count, so the\n * cmdk-era role corrections are gone with cmdk's sizer.\n */\nexport function CommandList(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return (\n <CommandListPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-list=\"\"\n class={cn('max-h-80 scroll-py-1 overflow-y-auto overflow-x-hidden p-1', props.class)}\n />\n )\n}\n\n/**\n * The no-match message. Place it beside `CommandList`, before it, not inside:\n * it is a `status` live region, which a listbox may not contain. ui-sdk keeps\n * it mounted so the announcement is reliable, and it collapses to no height\n * while the search has matches (`data-empty` marks a search with none).\n */\nexport function CommandEmpty(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return (\n <CommandEmptyPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-empty=\"\"\n class={cn(\n 'text-muted-foreground py-8 text-center text-sm not-data-[empty]:py-0',\n props.class\n )}\n />\n )\n}\n\nexport type CommandGroupProps = ComponentProps<'div'> & {\n /** The group's heading, which names it. */\n heading?: JSX.Element\n /** Kept for the API: a group hides while none of its items matches. */\n forceMount?: boolean\n /** Kept for the API. */\n value?: string\n}\n\nexport function CommandGroup(props: CommandGroupProps) {\n const rest = omit(props, 'class', 'children', 'heading', 'forceMount', 'value')\n const heading = resolveChildren(() => props.heading)\n return (\n <CommandGroupPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-group=\"\"\n class={cn(\n 'text-foreground overflow-hidden p-1',\n '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:uppercase',\n props.class\n )}\n >\n <Show when={heading()}>\n <CommandGroupLabelPrimitive cmdk-group-heading=\"\">{heading()}</CommandGroupLabelPrimitive>\n </Show>\n {props.children}\n </CommandGroupPrimitive>\n )\n}\n\nexport type CommandItemProps = Omit<ComponentProps<'div'>, 'onSelect' | 'value'> & {\n /** What the search matches and what `onSelect` reports. Defaults to the item's text. */\n value?: string\n /** More words the search matches. */\n keywords?: string[]\n disabled?: boolean\n /** The item ran: a click, or Enter while it is highlighted. */\n onSelect?: (value: string) => void\n /** Kept for the API: an item shows while it matches the search. */\n forceMount?: boolean\n}\n\nexport function CommandItem(props: CommandItemProps) {\n let element: HTMLDivElement | undefined\n const rest = omit(\n props,\n 'class',\n 'value',\n 'keywords',\n 'disabled',\n 'onSelect',\n 'forceMount',\n 'ref'\n )\n const value = () => props.value?.trim()\n return (\n <CommandItemPrimitive\n {...(rest as Record<string, unknown>)}\n ref={(node: HTMLDivElement) => {\n element = node\n callRef(props.ref, node)\n }}\n value={value()}\n label={value()}\n keywords={props.keywords}\n disabled={props.disabled}\n onSelect={() => props.onSelect?.(value() ?? element?.textContent?.trim() ?? '')}\n render={(\n part: Record<string, unknown>,\n state: { highlighted: boolean; disabled: boolean }\n ) => (\n <div\n {...part}\n cmdk-item=\"\"\n data-selected={state.highlighted ? 'true' : 'false'}\n data-disabled={state.disabled ? 'true' : 'false'}\n data-value={value()}\n />\n )}\n class={cn(\n commandItem,\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:text-muted-foreground',\n // The selected row sits on the accent rung, the same primary-subtle\n // fill the settings navigation's selected row owns, instead of the\n // popover rung, so what is chosen keeps the accent the checked menus\n // already carry in their indicators.\n 'group/command-item text-popover-foreground data-[selected=true]:bg-primary-subtle data-[selected=true]:text-foreground',\n 'in-data-settling:transition-none',\n props.class\n )}\n />\n )\n}\n\nexport function CommandSeparator(props: ComponentProps<'div'> & { alwaysRender?: boolean }) {\n const rest = omit(props, 'class', 'alwaysRender')\n return (\n <CommandSeparatorPrimitive\n {...(rest as Record<string, unknown>)}\n cmdk-separator=\"\"\n // A listbox owns options and groups only; the hairline is presentation.\n render={(part: Record<string, unknown>) => (\n <div {...part} role=\"presentation\" aria-orientation={undefined} />\n )}\n class={cn('bg-border -mx-1 my-1 h-px', props.class)}\n />\n )\n}\n\n/** A loading row: a progress bar named \"Loading…\" unless `label` says otherwise. */\nexport function CommandLoading(\n props: ComponentProps<'div'> & { progress?: number; label?: string }\n) {\n const rest = omit(props, 'class', 'children', 'progress', 'label')\n return (\n <div\n {...rest}\n cmdk-loading=\"\"\n role=\"progressbar\"\n aria-valuenow={props.progress}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={props.label ?? 'Loading...'}\n class={cn('text-muted-foreground py-6 text-center text-sm', props.class)}\n >\n <div aria-hidden=\"true\">{props.children}</div>\n </div>\n )\n}\n\n/** The keyboard hint a palette item usually carries. */\nexport function CommandShortcut(props: {\n class?: string\n children?: ComponentProps<'span'>['children']\n}) {\n return (\n <span\n class={cn(\n menuShortcut,\n 'group-data-[selected=true]/command-item:text-foreground',\n props.class\n )}\n >\n {props.children}\n </span>\n )\n}\n\n/**\n * The status line a command surface reports under its list: searching, offline,\n * a partial result caveat. The copy and the live-role semantics (`status`,\n * `alert`) are the caller's, a palette's failure modes are app facts, but the\n * line's shape is not something every caller should redraw.\n */\nexport function CommandStatus(props: ComponentProps<'p'>) {\n const rest = omit(props, 'class')\n\n return (\n <p\n data-slot=\"command-status\"\n class={cn('text-muted-foreground px-4 py-4 text-center text-sm', props.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The keyboard hint a palette footer carries, right-aligned under the list so\n * it reads as furniture rather than a result. Muted on purpose: the arrows are\n * what the user has already been doing by the time they read it.\n */\nexport function CommandHint(props: ComponentProps<'p'>) {\n const rest = omit(props, 'class')\n\n return (\n <p\n data-slot=\"command-hint\"\n class={cn('text-muted-foreground px-4 pb-1.5 text-right text-xs', props.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCA,IAAM,SAAS,SAAS0C,QAAY;AAQpC,IAAM,cAAc,SACjB,QAAQ,0EAA0E,EAAE,CAAC,CACrF,QAAQ,uCAAuC,EAAE,CAAC,CAClD,QAAQ,yCAAyC,EAAE;;;;;AAatD,SAAS,QAAW,KAAc,SAAkB;CAClD,IAAI,OAAO,QAAQ,YAAY,IAAI,OAAO;MACrC,IAAI,MAAM,QAAQ,GAAG,GAAG,KAAK,MAAM,QAAQ,KAAK,QAAQ,MAAM,OAAO;AAC5E;AAEA,IAAM,sBA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,IAAA,GAAA,KAAA;CAJR,OACEP;AAMJ;;;;;;AAOA,SAAgB,YAAY,OAA4B;CACtD,MAAM,OAAO,KAAK,OAAO,OAAO;CAG9B,IAAA,SAAA,QAIC;CADCO,OAAA,QAAA,CAAA;EAFA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,wDAAwD,MAAM,KAAK;EAAC;CACtE,GAAJ,IAAA,GAAA,KAAA;CAJR,OACEN;AAMJ"}
@@ -81,7 +81,9 @@ export declare const overlayMotion = "data-expanded:animate-in data-expanded:fad
81
81
  /** `overlayZoom` at a hint's pace: the tooltip and the hover card. */
82
82
  export declare const tooltipMotion = "data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-expanded:duration-150 data-closed:duration-100";
83
83
  /** Popover-style motion: no zoom, so a panel anchored to a control does not
84
- * appear to breathe away from it. */
84
+ * appear to breathe away from it. The duration is animation-only: `duration-*`
85
+ * also transitions every property, so a panel that settles after its first
86
+ * position would slide from the stale one instead of appearing at the anchor. */
85
87
  export declare const popoverMotion: string;
86
88
  /** The popper arrow. Sized in the component; coloured here. */
87
89
  export declare const popoverArrow = "fill-popover stroke-border";
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/lib/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtD;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,QAAS,CAAA;AAEhC;+EAC+E;AAC/E,eAAO,MAAM,cAAc,iFACqD,CAAA;AAEhF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,4EACiD,CAAA;AAE3E;;;GAGG;AACH,eAAO,MAAM,YAAY,wDAAwD,CAAA;AAEjF,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,6DAA6D,CAAA;AAE3F,gDAAgD;AA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QAEiD,CAAA;AAE3E,+DAA+D;AAC/D,eAAO,MAAM,YAAY,+BAA+B,CAAA;AAExD;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,QAO+D,CAAA;AAEpF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,sHACqF,CAAA;AAErH,4CAA4C;AAC5C,eAAO,MAAM,SAAS,mFAC4D,CAAA;AAElF,+EAA+E;AAC/E,eAAO,MAAM,YAAY,0DAA0D,CAAA;AAEnF,oCAAoC;AACpC,eAAO,MAAM,aAAa,8BAA8B,CAAA;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;8EAYzB,CAAA;AAEF,8CAA8C;AAC9C,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAErF,iDAAiD;AACjD,eAAO,MAAM,kBAAkB,QAAQ,CAAA;AAEvC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa;aAAK,mBAAmB,EAAE,EAAE;CAAW,CAAA;AAEjE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,8BAA8B,CAAA;AAU7D,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,IAAI,CASlE;AAED,eAAO,MAAM,UAAU,SAAU,OAAO,YAA8B,CAAA"}
@@ -82,8 +82,10 @@ var overlayMotion = `${overlayZoom} data-expanded:duration-200 data-closed:durat
82
82
  /** `overlayZoom` at a hint's pace: the tooltip and the hover card. */
83
83
  var tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`;
84
84
  /** Popover-style motion: no zoom, so a panel anchored to a control does not
85
- * appear to breathe away from it. */
86
- var popoverMotion = "data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 data-expanded:duration-150 data-closed:duration-100";
85
+ * appear to breathe away from it. The duration is animation-only: `duration-*`
86
+ * also transitions every property, so a panel that settles after its first
87
+ * position would slide from the stale one instead of appearing at the anchor. */
88
+ var popoverMotion = "data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 data-expanded:animation-duration-150 data-closed:animation-duration-100";
87
89
  /** The popper arrow. Sized in the component; coloured here. */
88
90
  var popoverArrow = "fill-popover stroke-border";
89
91
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.js","names":[],"sources":["../../src/lib/overlay.ts"],"sourcesContent":["/**\n * Shared strings for the overlay layer: dialogs, sheets, menus, popovers,\n * tooltips and the command palette.\n *\n * These live here rather than in each component because the overlay family is\n * where consistency is most visible and least likely to survive duplication.\n * A dialog, a sheet and a dropdown that disagree about their border, radius,\n * motion or shadow read as three different apps, and an app that adopts this\n * library would inherit all three. Declaring the surface once is what makes\n * \"an overlay looks like this\" a fact rather than a convention.\n */\n\nimport { cva, type VariantProps } from '#lib/variants'\n\n/**\n * One CSS layout unit (1/64px), added to every side offset. ui-sdk snaps a\n * layer's position to whole device pixels after undoing the layer's entry\n * transform (`zoom-in-95`), and that undo carries float noise of about 1e-7px:\n * a layer due at an anchor edge of 75.5px lands at 75.4999997px and snaps to\n * 75px, half a pixel inside its trigger. A layout unit is far above the noise\n * and far below a pixel, so whole-pixel anchors land exactly where they did and\n * half-pixel ones round away from the anchor as intended. Remove once ui-sdk\n * rounds its untransformed origin (ui-notes/ui-sdk-issue-snap.md).\n */\nexport const SNAP_GUARD = 1 / 64\n\n/** The panel itself: fill, hairline edge, radius, elevation. Menus, popovers\n * and the command palette float on the elevated overlay rung (`--popover`). */\nexport const overlaySurface =\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * The modal panel: the same hairline edge, radius and elevation, painted on the\n * *neutral* theme surface instead of the elevated overlay rung.\n *\n * `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies\n * the canvas hue's chroma on the elevated step. On the dark default's violet\n * canvas that makes the dialog the most chromatic surface in the ladder,\n * `oklch(0.2406 0.0088 300.91)`, red above green in sRGB, and on a full dialog\n * panel that cast reads as a warm tint the canvas never has. shadcn's own\n * convention already splits the two: a Dialog paints `bg-background`, menus and\n * popovers paint `bg-popover`. The veil, the hairline and the elevation shadow\n * carry the separation the lighter fill no longer provides.\n */\nexport const dialogSurface =\n 'bg-background text-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * Overlay titles have one fixed typography role. Keep this small recipe shared\n * without loading the configurable Heading component into every dialog.\n */\nexport const overlayTitle = 'font-semibold text-base tracking-tight leading-none'\n\n/** The span of the portal wrapper that centres a dialog-like overlay. */\nexport const overlayPositioner = 'fixed inset-0 z-(--z-dialog) grid place-items-center p-4'\n\n/** The dimming layer behind a modal overlay. */\nexport const overlayScrim =\n 'fixed inset-0 z-(--z-dialog) bg-scrim/50 supports-[backdrop-filter]:backdrop-blur-xs'\n\n/** The scrim fades; it never zooms with the panel above it. */\nexport const overlayScrimMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0'\n\n/** The title block of a dialog-shaped panel. */\nexport const overlayHeader = 'flex flex-col gap-1.5 text-start'\n\n/** The action row of a dialog-shaped panel: stacked on a phone, trailing on a wider window. */\nexport const overlayFooter = 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end'\n\n/** The sentence under an overlay title. */\nexport const overlayDescription = 'text-muted-foreground text-sm'\n\n/** The icon-only close in a dialog or sheet's top-end corner. */\nexport const overlayCornerClose =\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground ' +\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground ' +\n 'focus-visible:border-ring focus-visible:focus-outline outline-none'\n\n/**\n * The tip: shadcn's inverted chip, foreground on background, so an explanation\n * never reads as a popover that could hold controls. The side rail draws it\n * flush to a collapsed row and every floating tooltip composes the same fill\n * and type, so a control never explains itself in two visual languages.\n */\nexport const tooltipTip = 'bg-foreground text-background rounded-md text-xs font-medium'\n\n/**\n * Entrance and exit motion, expressed as data-state classes.\n *\n * `data-expanded` / `data-closed` are the open and closed state every overlay\n * part carries (the names it had under Kobalte, kept by the overlays on top of\n * ui-sdk's `data-open`); `data-side-*` come from the positioning and let a menu\n * slide in from the edge it is anchored to,\n * which is what makes a dropdown feel attached to its trigger rather than\n * dropped on the screen. Exit motion is shorter than entry, because a\n * dismissal should feel immediate while an arrival benefits from being seen.\n */\nexport const overlayZoom =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95 ' +\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95'\n\n/** `overlayZoom` at the panel's pace: menus, dialogs. */\nexport const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-closed:duration-150`\n\n/** `overlayZoom` at a hint's pace: the tooltip and the hover card. */\nexport const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`\n\n/** Popover-style motion: no zoom, so a panel anchored to a control does not\n * appear to breathe away from it. */\nexport const popoverMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +\n 'data-expanded:duration-150 data-closed:duration-100'\n\n/** The popper arrow. Sized in the component; coloured here. */\nexport const popoverArrow = 'fill-popover stroke-border'\n\n/**\n * A menu row: the shared height, radius, hover fill and focus treatment for\n * every item inside a menu, listbox or command list.\n *\n * The row sizes and dims the icons a caller puts in it, but not the glyph of\n * its selection indicator (any `[data-slot$=-indicator]`): a descendant `svg`\n * rule outranks a single utility on the glyph, so without the exclusion a\n * radio item's `size-2` dot drew as a 16px muted disc and every check lost the\n * indicator's accent.\n */\nexport const menuItem =\n 'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none ' +\n 'transition-colors ease-out ' +\n 'data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground ' +\n 'data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground ' +\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 ' +\n '[&_svg:not([data-slot$=-indicator]_*)]:size-4 ' +\n '[&_svg:not([class*=text-]):not([data-slot$=-indicator]_*)]:text-muted-foreground'\n\n/**\n * A destructive action keeps readable body text; its icon takes the status colour and the\n * highlight a destructive tint. No edge bar: the row lines up with its neighbours.\n */\nexport const destructiveMenuItem =\n 'text-foreground data-[highlighted]:bg-destructive-subtle [&_svg:not([data-slot$=-indicator]_*)]:text-destructive!'\n\n/** The label above a group of menu rows. */\nexport const menuLabel =\n 'px-2 py-1.5 text-2xs font-medium tracking-wide text-muted-foreground uppercase'\n\n/** The chord drawn at a row's trailing edge: menus and the command palette. */\nexport const menuShortcut = 'text-muted-foreground ms-auto text-xs tracking-widest'\n\n/** The rule between menu groups. */\nexport const menuSeparator = 'bg-border -mx-1 my-1 h-px'\n\n/**\n * A leading colour swatch on a menu or select row: the sanctioned way to carry\n * a card-tone colour into a list of options. The tones are the system's accent\n * and status roles, the vocabulary a Badge already speaks, so the colour an\n * option shows in a menu is the colour its badge carries on a card, and a\n * caller never passes a raw colour into a list. The dot is `aria-hidden`; the\n * label carries the meaning, so a tone is never the only signal.\n */\nexport const menuSwatchTone = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n primary: 'bg-primary',\n success: 'bg-success',\n warning: 'bg-warning',\n destructive: 'bg-destructive',\n info: 'bg-info',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\n/** The tones a menu row's swatch can take. */\nexport type MenuSwatchTone = NonNullable<VariantProps<typeof menuSwatchTone>['tone']>\n\n/** Padding shared by every menu-list surface. */\nexport const menuContentPadding = 'p-1'\n\n/**\n * Marks a floating layer, a menu, a listbox, a popover, as part of the top\n * layer.\n *\n * A modal dialog hides everything outside itself from assistive technology\n * (`aria-hidden` on its siblings) and keeps watching `<body>` for new nodes.\n * A menu or select opened from inside the dialog portals to `<body>`, so the\n * dialog hid it too: the list was on screen, focused, and invisible to a\n * screen reader, and an outside-click check could treat a click on it as a\n * click away from the dialog. Kobalte exempted nodes carrying this attribute\n * from both, so every floating layer carries it.\n *\n * ui-sdk renders popups in place in the browser's top layer and makes the page\n * behind a modal inert itself, so nothing in it reads this attribute; it stays\n * until the overlays that spread it stop doing so.\n */\nexport const topLayerProps = { 'data-kb-top-layer': '' } as const\n\n/**\n * Marks a portal mounted while another modal layer is already open as a layer\n * of its own rather than background.\n *\n * Kobalte's hide-outside observer walked body children added after its layer\n * opened and aria-hid them a frame later, so a non-modal dialog portaled in\n * during that window would land outside the accessibility tree. That observer\n * exempts added nodes carrying the React Aria spelling it ported;\n * `data-kb-top-layer` (`topLayerProps`) is only honoured by a newer layer's\n * initial walk, which must still hide this portal.\n */\nexport const lateLayerAttribute = 'data-react-aria-top-layer'\n\n/**\n * Elements the kit itself has made inert (ModalDialog's background), counted per\n * writer. The dialog layer's guard against ui-sdk clearing app-set `inert` (see\n * `guardAppInert` in dialog-layer.tsx) skips these: they are the kit's own\n * bookkeeping, which ModalDialog undoes itself, not inertness an app asked for.\n */\nconst kitInertWriters = new WeakMap<Element, number>()\n\nexport function holdKitInert(nodes: readonly Element[]): () => void {\n for (const node of nodes) kitInertWriters.set(node, (kitInertWriters.get(node) ?? 0) + 1)\n return () => {\n for (const node of nodes) {\n const count = (kitInertWriters.get(node) ?? 1) - 1\n if (count > 0) kitInertWriters.set(node, count)\n else kitInertWriters.delete(node)\n }\n }\n}\n\nexport const isKitInert = (node: Element) => kitInertWriters.has(node)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,aAAa,IAAI;;;AAI9B,IAAa,iBACX;;;;;;;;;;;;;;AAeF,IAAa,gBACX;;;;;AAMF,IAAa,eAAe;;AAG5B,IAAa,oBAAoB;;AAGjC,IAAa,eACX;;AAGF,IAAa,qBACX;;AAGF,IAAa,gBAAgB;;AAG7B,IAAa,gBAAgB;;AAG7B,IAAa,qBAAqB;;AAGlC,IAAa,qBACX;;;;;;;AAUF,IAAa,aAAa;;;;;;;;;;;;AAa1B,IAAa,cACX;;AAIF,IAAa,gBAAgB,GAAG,YAAY;;AAG5C,IAAa,gBAAgB,GAAG,YAAY;;;AAI5C,IAAa,gBACX;;AAIF,IAAa,eAAe;;;;;;;;;;;AAY5B,IAAa,WACX;;;;;AAYF,IAAa,sBACX;;AAGF,IAAa,YACX;;AAGF,IAAa,eAAe;;AAG5B,IAAa,gBAAgB;;;;;;;;;AAU7B,IAAa,iBAAiB,IAAI,gCAAgC;CAChE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,aAAa;EACb,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;;AAMD,IAAa,qBAAqB;;;;;;;;;;;;;;;;;AAkBlC,IAAa,gBAAgB,EAAE,qBAAqB,GAAG;;;;;;;;;;;;AAavD,IAAa,qBAAqB;;;;;;;AAQlC,IAAM,kCAAkB,IAAI,QAAyB;AAErD,SAAgB,aAAa,OAAuC;CAClE,KAAK,MAAM,QAAQ,OAAO,gBAAgB,IAAI,OAAO,gBAAgB,IAAI,IAAI,KAAK,KAAK,CAAC;CACxF,aAAa;EACX,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,SAAS,gBAAgB,IAAI,IAAI,KAAK,KAAK;GACjD,IAAI,QAAQ,GAAG,gBAAgB,IAAI,MAAM,KAAK;QACzC,gBAAgB,OAAO,IAAI;EAClC;CACF;AACF;AAEA,IAAa,cAAc,SAAkB,gBAAgB,IAAI,IAAI"}
1
+ {"version":3,"file":"overlay.js","names":[],"sources":["../../src/lib/overlay.ts"],"sourcesContent":["/**\n * Shared strings for the overlay layer: dialogs, sheets, menus, popovers,\n * tooltips and the command palette.\n *\n * These live here rather than in each component because the overlay family is\n * where consistency is most visible and least likely to survive duplication.\n * A dialog, a sheet and a dropdown that disagree about their border, radius,\n * motion or shadow read as three different apps, and an app that adopts this\n * library would inherit all three. Declaring the surface once is what makes\n * \"an overlay looks like this\" a fact rather than a convention.\n */\n\nimport { cva, type VariantProps } from '#lib/variants'\n\n/**\n * One CSS layout unit (1/64px), added to every side offset. ui-sdk snaps a\n * layer's position to whole device pixels after undoing the layer's entry\n * transform (`zoom-in-95`), and that undo carries float noise of about 1e-7px:\n * a layer due at an anchor edge of 75.5px lands at 75.4999997px and snaps to\n * 75px, half a pixel inside its trigger. A layout unit is far above the noise\n * and far below a pixel, so whole-pixel anchors land exactly where they did and\n * half-pixel ones round away from the anchor as intended. Remove once ui-sdk\n * rounds its untransformed origin (ui-notes/ui-sdk-issue-snap.md).\n */\nexport const SNAP_GUARD = 1 / 64\n\n/** The panel itself: fill, hairline edge, radius, elevation. Menus, popovers\n * and the command palette float on the elevated overlay rung (`--popover`). */\nexport const overlaySurface =\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * The modal panel: the same hairline edge, radius and elevation, painted on the\n * *neutral* theme surface instead of the elevated overlay rung.\n *\n * `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies\n * the canvas hue's chroma on the elevated step. On the dark default's violet\n * canvas that makes the dialog the most chromatic surface in the ladder,\n * `oklch(0.2406 0.0088 300.91)`, red above green in sRGB, and on a full dialog\n * panel that cast reads as a warm tint the canvas never has. shadcn's own\n * convention already splits the two: a Dialog paints `bg-background`, menus and\n * popovers paint `bg-popover`. The veil, the hairline and the elevation shadow\n * carry the separation the lighter fill no longer provides.\n */\nexport const dialogSurface =\n 'bg-background text-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * Overlay titles have one fixed typography role. Keep this small recipe shared\n * without loading the configurable Heading component into every dialog.\n */\nexport const overlayTitle = 'font-semibold text-base tracking-tight leading-none'\n\n/** The span of the portal wrapper that centres a dialog-like overlay. */\nexport const overlayPositioner = 'fixed inset-0 z-(--z-dialog) grid place-items-center p-4'\n\n/** The dimming layer behind a modal overlay. */\nexport const overlayScrim =\n 'fixed inset-0 z-(--z-dialog) bg-scrim/50 supports-[backdrop-filter]:backdrop-blur-xs'\n\n/** The scrim fades; it never zooms with the panel above it. */\nexport const overlayScrimMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0'\n\n/** The title block of a dialog-shaped panel. */\nexport const overlayHeader = 'flex flex-col gap-1.5 text-start'\n\n/** The action row of a dialog-shaped panel: stacked on a phone, trailing on a wider window. */\nexport const overlayFooter = 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end'\n\n/** The sentence under an overlay title. */\nexport const overlayDescription = 'text-muted-foreground text-sm'\n\n/** The icon-only close in a dialog or sheet's top-end corner. */\nexport const overlayCornerClose =\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground ' +\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground ' +\n 'focus-visible:border-ring focus-visible:focus-outline outline-none'\n\n/**\n * The tip: shadcn's inverted chip, foreground on background, so an explanation\n * never reads as a popover that could hold controls. The side rail draws it\n * flush to a collapsed row and every floating tooltip composes the same fill\n * and type, so a control never explains itself in two visual languages.\n */\nexport const tooltipTip = 'bg-foreground text-background rounded-md text-xs font-medium'\n\n/**\n * Entrance and exit motion, expressed as data-state classes.\n *\n * `data-expanded` / `data-closed` are the open and closed state every overlay\n * part carries (the names it had under Kobalte, kept by the overlays on top of\n * ui-sdk's `data-open`); `data-side-*` come from the positioning and let a menu\n * slide in from the edge it is anchored to,\n * which is what makes a dropdown feel attached to its trigger rather than\n * dropped on the screen. Exit motion is shorter than entry, because a\n * dismissal should feel immediate while an arrival benefits from being seen.\n */\nexport const overlayZoom =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95 ' +\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95'\n\n/** `overlayZoom` at the panel's pace: menus, dialogs. */\nexport const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-closed:duration-150`\n\n/** `overlayZoom` at a hint's pace: the tooltip and the hover card. */\nexport const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`\n\n/** Popover-style motion: no zoom, so a panel anchored to a control does not\n * appear to breathe away from it. The duration is animation-only: `duration-*`\n * also transitions every property, so a panel that settles after its first\n * position would slide from the stale one instead of appearing at the anchor. */\nexport const popoverMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +\n 'data-expanded:animation-duration-150 data-closed:animation-duration-100'\n\n/** The popper arrow. Sized in the component; coloured here. */\nexport const popoverArrow = 'fill-popover stroke-border'\n\n/**\n * A menu row: the shared height, radius, hover fill and focus treatment for\n * every item inside a menu, listbox or command list.\n *\n * The row sizes and dims the icons a caller puts in it, but not the glyph of\n * its selection indicator (any `[data-slot$=-indicator]`): a descendant `svg`\n * rule outranks a single utility on the glyph, so without the exclusion a\n * radio item's `size-2` dot drew as a 16px muted disc and every check lost the\n * indicator's accent.\n */\nexport const menuItem =\n 'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none ' +\n 'transition-colors ease-out ' +\n 'data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground ' +\n 'data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground ' +\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 ' +\n '[&_svg:not([data-slot$=-indicator]_*)]:size-4 ' +\n '[&_svg:not([class*=text-]):not([data-slot$=-indicator]_*)]:text-muted-foreground'\n\n/**\n * A destructive action keeps readable body text; its icon takes the status colour and the\n * highlight a destructive tint. No edge bar: the row lines up with its neighbours.\n */\nexport const destructiveMenuItem =\n 'text-foreground data-[highlighted]:bg-destructive-subtle [&_svg:not([data-slot$=-indicator]_*)]:text-destructive!'\n\n/** The label above a group of menu rows. */\nexport const menuLabel =\n 'px-2 py-1.5 text-2xs font-medium tracking-wide text-muted-foreground uppercase'\n\n/** The chord drawn at a row's trailing edge: menus and the command palette. */\nexport const menuShortcut = 'text-muted-foreground ms-auto text-xs tracking-widest'\n\n/** The rule between menu groups. */\nexport const menuSeparator = 'bg-border -mx-1 my-1 h-px'\n\n/**\n * A leading colour swatch on a menu or select row: the sanctioned way to carry\n * a card-tone colour into a list of options. The tones are the system's accent\n * and status roles, the vocabulary a Badge already speaks, so the colour an\n * option shows in a menu is the colour its badge carries on a card, and a\n * caller never passes a raw colour into a list. The dot is `aria-hidden`; the\n * label carries the meaning, so a tone is never the only signal.\n */\nexport const menuSwatchTone = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n primary: 'bg-primary',\n success: 'bg-success',\n warning: 'bg-warning',\n destructive: 'bg-destructive',\n info: 'bg-info',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\n/** The tones a menu row's swatch can take. */\nexport type MenuSwatchTone = NonNullable<VariantProps<typeof menuSwatchTone>['tone']>\n\n/** Padding shared by every menu-list surface. */\nexport const menuContentPadding = 'p-1'\n\n/**\n * Marks a floating layer, a menu, a listbox, a popover, as part of the top\n * layer.\n *\n * A modal dialog hides everything outside itself from assistive technology\n * (`aria-hidden` on its siblings) and keeps watching `<body>` for new nodes.\n * A menu or select opened from inside the dialog portals to `<body>`, so the\n * dialog hid it too: the list was on screen, focused, and invisible to a\n * screen reader, and an outside-click check could treat a click on it as a\n * click away from the dialog. Kobalte exempted nodes carrying this attribute\n * from both, so every floating layer carries it.\n *\n * ui-sdk renders popups in place in the browser's top layer and makes the page\n * behind a modal inert itself, so nothing in it reads this attribute; it stays\n * until the overlays that spread it stop doing so.\n */\nexport const topLayerProps = { 'data-kb-top-layer': '' } as const\n\n/**\n * Marks a portal mounted while another modal layer is already open as a layer\n * of its own rather than background.\n *\n * Kobalte's hide-outside observer walked body children added after its layer\n * opened and aria-hid them a frame later, so a non-modal dialog portaled in\n * during that window would land outside the accessibility tree. That observer\n * exempts added nodes carrying the React Aria spelling it ported;\n * `data-kb-top-layer` (`topLayerProps`) is only honoured by a newer layer's\n * initial walk, which must still hide this portal.\n */\nexport const lateLayerAttribute = 'data-react-aria-top-layer'\n\n/**\n * Elements the kit itself has made inert (ModalDialog's background), counted per\n * writer. The dialog layer's guard against ui-sdk clearing app-set `inert` (see\n * `guardAppInert` in dialog-layer.tsx) skips these: they are the kit's own\n * bookkeeping, which ModalDialog undoes itself, not inertness an app asked for.\n */\nconst kitInertWriters = new WeakMap<Element, number>()\n\nexport function holdKitInert(nodes: readonly Element[]): () => void {\n for (const node of nodes) kitInertWriters.set(node, (kitInertWriters.get(node) ?? 0) + 1)\n return () => {\n for (const node of nodes) {\n const count = (kitInertWriters.get(node) ?? 1) - 1\n if (count > 0) kitInertWriters.set(node, count)\n else kitInertWriters.delete(node)\n }\n }\n}\n\nexport const isKitInert = (node: Element) => kitInertWriters.has(node)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,aAAa,IAAI;;;AAI9B,IAAa,iBACX;;;;;;;;;;;;;;AAeF,IAAa,gBACX;;;;;AAMF,IAAa,eAAe;;AAG5B,IAAa,oBAAoB;;AAGjC,IAAa,eACX;;AAGF,IAAa,qBACX;;AAGF,IAAa,gBAAgB;;AAG7B,IAAa,gBAAgB;;AAG7B,IAAa,qBAAqB;;AAGlC,IAAa,qBACX;;;;;;;AAUF,IAAa,aAAa;;;;;;;;;;;;AAa1B,IAAa,cACX;;AAIF,IAAa,gBAAgB,GAAG,YAAY;;AAG5C,IAAa,gBAAgB,GAAG,YAAY;;;;;AAM5C,IAAa,gBACX;;AAIF,IAAa,eAAe;;;;;;;;;;;AAY5B,IAAa,WACX;;;;;AAYF,IAAa,sBACX;;AAGF,IAAa,YACX;;AAGF,IAAa,eAAe;;AAG5B,IAAa,gBAAgB;;;;;;;;;AAU7B,IAAa,iBAAiB,IAAI,gCAAgC;CAChE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,aAAa;EACb,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;;AAMD,IAAa,qBAAqB;;;;;;;;;;;;;;;;;AAkBlC,IAAa,gBAAgB,EAAE,qBAAqB,GAAG;;;;;;;;;;;;AAavD,IA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