@adea-ai/ui 0.71.1 → 0.71.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composites/appearance-editor/appearance-editor.js +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/stat/stat.d.ts.map +1 -1
- package/dist/components/composites/stat/stat.js +8 -8
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.d.ts +7 -0
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +71 -26
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +1 -1
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/ui/alert/alert.d.ts +3 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.js +18 -8
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/badge/badge.js +4 -4
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js +2 -2
- package/dist/components/ui/context-menu/context-menu.js.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts +17 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +120 -2
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/diff-block/diff-block.js +2 -2
- package/dist/components/ui/diff-block/diff-block.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +3 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +5 -4
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.d.ts +3 -3
- package/dist/components/ui/entity-icon/entity-icon.js +7 -7
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.js +1 -1
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/menubar/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar/menubar.js +2 -2
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.d.ts +12 -2
- package/dist/components/ui/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js +44 -27
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +4 -4
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/lib/overlay.d.ts +2 -0
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +3 -1
- package/dist/lib/overlay.js.map +1 -1
- package/dist/lib/themes.d.ts +7 -0
- package/dist/lib/themes.d.ts.map +1 -1
- package/dist/lib/themes.js +22 -1
- package/dist/lib/themes.js.map +1 -1
- package/dist/lib/tokens.d.ts.map +1 -1
- package/dist/lib/tokens.js +4 -4
- package/dist/lib/tokens.js.map +1 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +1 -1
- package/dist/r/src/components/composites/stat/stat.tsx +5 -8
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +98 -26
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
- package/dist/r/src/components/conversation/message-composer.tsx +3 -1
- package/dist/r/src/components/ui/alert/alert.tsx +20 -7
- package/dist/r/src/components/ui/badge/badge.tsx +4 -4
- package/dist/r/src/components/ui/context-menu/context-menu.tsx +2 -2
- package/dist/r/src/components/ui/dialog/dialog.tsx +204 -2
- package/dist/r/src/components/ui/diff-block/diff-block.tsx +4 -4
- package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +5 -4
- package/dist/r/src/components/ui/entity-icon/entity-icon.tsx +7 -7
- package/dist/r/src/components/ui/field/field.tsx +1 -1
- package/dist/r/src/components/ui/menubar/menubar.tsx +2 -2
- package/dist/r/src/components/ui/modal-dialog/modal-dialog.tsx +24 -2
- package/dist/r/src/components/ui/status-chip/status-chip.tsx +4 -4
- package/dist/r/src/lib/overlay.ts +4 -0
- package/dist/r/src/lib/themes.ts +29 -0
- package/dist/r/src/lib/tokens.ts +19 -4
- package/dist/r/src/styles/theme.css +10 -10
- package/package.json +2 -2
- package/src/components/composites/appearance-editor/appearance-editor.tsx +1 -1
- package/src/components/composites/stat/stat.tsx +5 -8
- package/src/components/composites/update-dialog/update-dialog.tsx +98 -26
- package/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
- package/src/components/conversation/message-composer.tsx +3 -1
- package/src/components/ui/alert/alert.tsx +20 -7
- package/src/components/ui/badge/badge.tsx +4 -4
- package/src/components/ui/context-menu/context-menu.tsx +2 -2
- package/src/components/ui/dialog/dialog.tsx +204 -2
- package/src/components/ui/diff-block/diff-block.tsx +4 -4
- package/src/components/ui/dropdown-menu/dropdown-menu.tsx +5 -4
- package/src/components/ui/entity-icon/entity-icon.tsx +7 -7
- package/src/components/ui/field/field.tsx +1 -1
- package/src/components/ui/menubar/menubar.tsx +2 -2
- package/src/components/ui/modal-dialog/modal-dialog.tsx +24 -2
- package/src/components/ui/status-chip/status-chip.tsx +4 -4
- package/src/lib/overlay.ts +4 -0
- package/src/lib/themes.ts +29 -0
- package/src/lib/tokens.ts +19 -4
- package/src/styles/theme.css +10 -10
|
@@ -18,7 +18,7 @@ var _tmpl$8 = /*#__PURE__*/ template(`<div class="flex min-w-0 flex-col"><span>C
|
|
|
18
18
|
var _tmpl$9 = /*#__PURE__*/ template(`<form data-slot=composer-input-box class="border-input bg-card flex flex-col overflow-hidden rounded-2xl border transition-colors focus-within:border-ring"><div data-slot=composer-action-row class="flex items-center justify-between gap-2 px-2.5 pb-2 pt-0.5"><div class="flex min-w-0 items-center gap-1"></div><div class="flex shrink-0 items-center gap-1">`);
|
|
19
19
|
var _tmpl$0 = /*#__PURE__*/ template(`<div data-slot=composer-context class="flex min-w-0 items-center gap-2 pt-1">`);
|
|
20
20
|
var _tmpl$1 = /*#__PURE__*/ template(`<div data-slot=chat-composer class="mx-auto flex w-full max-w-4xl flex-col px-4 pb-1"><div aria-hidden=true class="h-1.5 shrink-0">`);
|
|
21
|
-
var _tmpl$10 = /*#__PURE__*/ template(`<p role=alert class="text-
|
|
21
|
+
var _tmpl$10 = /*#__PURE__*/ template(`<p role=alert class="text-foreground mb-1 border-s-2 border-destructive ps-2 text-xs">`);
|
|
22
22
|
var _tmpl$11 = /*#__PURE__*/ template(`<span aria-hidden=true class=shrink-0>Show the message input`);
|
|
23
23
|
var _tmpl$12 = /*#__PURE__*/ template(`<span aria-hidden=true class="min-w-0 flex-1 truncate">`);
|
|
24
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-composer-shell.js","names":["ChevronsDownUp","ChevronsUpDown","MoreHorizontal","ArrowUp","Show","createEffect","createSignal","on","onCleanup","onMount","Accessor","JSX","ChatComposerControl","ChatComposerSharedProps","ChatComposerSubmitInput","Button","DropdownMenu","DropdownMenuContent","DropdownMenuItem","DropdownMenuTrigger","Spinner","BusySendButton","BusySendMode","createComposerImeGuard","ChatComposerInputRenderProps","ref","element","HTMLTextAreaElement","value","resetKey","inputLabel","placeholder","disabled","readOnly","composing","onCompositionStart","onCompositionEnd","onFocus","onBlur","onKeyDown","event","KeyboardEvent","ChatComposerShellProps","createSubmitExtra","input","Extra","onSubmit","Promise","renderInput","props","Element","ChatComposerShell","ime","pending","setPending","error","setError","field","restoreBar","HTMLButtonElement","focusFrame","focusTarget","selection","start","end","direction","generation","active","collapsed","collapse","unavailable","blockedReason","cancelFocus","undefined","cancelAnimationFrame","requestFocus","target","requestAnimationFrame","approvalFocus","focus","setSelectionRange","Math","min","length","changeCollapsed","selectionStart","selectionEnd","selectionDirection","onChange","control","expandAndFocus","controlRef","defer","action","busy","mode","canSend","selected","sendableActions","trim","submit","started","base","text","preview","first","split","find","line","slice","handleInputKeyDown","key","shiftKey","defaultPrevented","claimEnter","metaKey","ctrlKey","handleCompositionStart","handleCompositionEnd","handleBlur","_el$","_tmpl$1","_el$5","firstChild","_$insert","_$createComponent","when","children","knowledge","_el$2","_tmpl$","followUps","_el$3","_tmpl$2","band","_el$4","_tmpl$3","approval","_el$6","_tmpl$4","notices","_el$7","_tmpl$5","_el$8","_tmpl$6","message","_el$14","_tmpl$10","fallback","type","variant","size","onClick","_tmpl$11","_el$16","_tmpl$12","_el$9","_tmpl$9","_el$1","_el$10","_el$12","nextSibling","addEventListener","preventDefault","attachments","_el$0","_tmpl$7","menuItems","placement","as","onCloseAutoFocus","_$memo","onSelect","_tmpl$8","leadingActions","trailingActions","aria-label","label","_$mergeProps","alternateActionHint","onFire","context","_el$13","_tmpl$0","_$createComponent","_$memo","_$mergeProps"],"sources":["../../../../src/components/conversation/internal/chat-composer-shell.tsx"],"sourcesContent":["/*\n * Substantially translated from KiroCrew website/src/components/ChatInput.tsx\n * at 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * Licensed under Apache-2.0; see LICENSE and NOTICE.\n */\nimport { ChevronsDownUp, ChevronsUpDown, MoreHorizontal, ArrowUp } from 'lucide-solid'\nimport {\n Show,\n createEffect,\n createSignal,\n on,\n onCleanup,\n onMount,\n type Accessor,\n type JSX,\n} from 'solid-js'\nimport type {\n ChatComposerControl,\n ChatComposerSharedProps,\n ChatComposerSubmitInput,\n} from '../chat-composer'\nimport { Button } from '../../ui/button/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu/dropdown-menu'\nimport { Spinner } from '../../ui/spinner/spinner'\nimport { BusySendButton, type BusySendMode } from '../busy-send-button'\nimport { createComposerImeGuard } from '../ime-guard'\n\n/** Private typed seam: public wrappers supply the native or atomic input. */\ntype ChatComposerInputRenderProps = {\n ref: (element: HTMLTextAreaElement | undefined) => void\n value: Accessor<string>\n resetKey: Accessor<unknown>\n inputLabel: Accessor<string>\n placeholder: Accessor<string>\n disabled: Accessor<boolean | undefined>\n readOnly: Accessor<boolean>\n composing: Accessor<boolean>\n onCompositionStart: () => void\n onCompositionEnd: () => void\n onFocus: () => void\n onBlur: () => void\n onKeyDown: (event: KeyboardEvent) => void\n}\n\ntype ChatComposerShellProps<Extra extends object> = ChatComposerSharedProps & {\n createSubmitExtra: (input: ChatComposerSubmitInput) => Extra\n onSubmit: (input: ChatComposerSubmitInput & Extra) => void | Promise<void>\n renderInput: (props: ChatComposerInputRenderProps) => JSX.Element\n}\n\n/**\n * Kiro's composer assembly: context/options, adjacent band, approval/notices,\n * staged content, input/action groups and a context shelf. Reading collapse\n * really unmounts the input and shelf and offers a labeled way back with draft\n * preview. The host retains the only draft, identities, preferences and services.\n *\n * Kobalte owns the options menu. Scoped imperative typing intent replaces the\n * donor global lookup/broadcast so a second composer cannot receive this draft\n * or focus. No animation starts from hidden geometry, no global shortcut, and no\n * runtime/permission/voice/optimizer authority is copied. More specific chips,\n * approval decisions and staged-content semantics are supplied by their owners.\n */\nexport function ChatComposerShell<Extra extends object>(props: ChatComposerShellProps<Extra>) {\n const ime = createComposerImeGuard()\n const [pending, setPending] = createSignal(false)\n const [error, setError] = createSignal<string | null>(null)\n let field: HTMLTextAreaElement | undefined\n let restoreBar: HTMLButtonElement | undefined\n let focusFrame: number | undefined\n let focusTarget: 'input' | 'bar' | undefined\n let selection:\n | { start: number; end: number; direction: 'forward' | 'backward' | 'none' }\n | undefined\n let generation = 0\n let active = true\n let composing = false\n const collapsed = () => props.collapse?.value === true\n const unavailable = () => props.disabled || props.readOnly || !!props.blockedReason\n const cancelFocus = () => {\n if (focusFrame !== undefined) cancelAnimationFrame(focusFrame)\n focusFrame = undefined\n }\n const requestFocus = (target: 'input' | 'bar') => {\n cancelFocus()\n focusTarget = target\n focusFrame = requestAnimationFrame(() => {\n focusFrame = undefined\n if (!active || props.approvalFocus) return\n if (target === 'bar' && collapsed()) restoreBar?.focus()\n if (target === 'input' && !collapsed() && !props.disabled && field) {\n field.focus()\n if (selection)\n field.setSelectionRange(\n Math.min(selection.start, field.value.length),\n Math.min(selection.end, field.value.length),\n selection.direction\n )\n }\n focusTarget = undefined\n })\n }\n const changeCollapsed = (value: boolean) => {\n if (!props.collapse || props.approvalFocus) return\n if (value && field)\n selection = {\n start: field.selectionStart,\n end: field.selectionEnd,\n direction: field.selectionDirection,\n }\n props.collapse.onChange(value)\n requestFocus(value ? 'bar' : 'input')\n }\n const control: ChatComposerControl = {\n focus() {\n if (collapsed() || props.approvalFocus || props.disabled || !field) return false\n field.focus()\n return true\n },\n expandAndFocus() {\n if (props.approvalFocus || props.disabled) return false\n if (collapsed()) changeCollapsed(false)\n else requestFocus('input')\n return true\n },\n }\n onMount(() => props.controlRef?.(control))\n createEffect(\n on(\n () => props.resetKey,\n () => {\n generation += 1\n selection = undefined\n composing = false\n cancelFocus()\n focusTarget = undefined\n setPending(false)\n setError(null)\n ime.onBlur()\n },\n { defer: true }\n )\n )\n onCleanup(() => {\n active = false\n generation += 1\n cancelFocus()\n props.controlRef?.(undefined)\n })\n const action = (): 'send' | BusySendMode => props.busy?.mode ?? 'send'\n const canSend = (selected: 'send' | BusySendMode = action()) =>\n !unavailable() &&\n !pending() &&\n (props.sendableActions?.[selected] ?? props.value.trim().length > 0) &&\n !(selected !== 'send' && props.busy?.unavailable?.[selected])\n const submit = async (selected: 'send' | BusySendMode = action()) => {\n if (!canSend(selected)) return\n const started = generation\n const base: ChatComposerSubmitInput = { text: props.value, action: selected }\n const input = { ...base, ...props.createSubmitExtra(base) }\n setPending(true)\n setError(null)\n try {\n await props.onSubmit(input)\n } catch {\n if (active && started === generation)\n setError('Message not sent. Check your draft and retry when the connection recovers.')\n } finally {\n if (active && started === generation) setPending(false)\n }\n }\n const preview = () => {\n const first =\n props.value\n .split('\\n')\n .find((line) => line.trim().length > 0)\n ?.trim() ?? ''\n return first.length > 120 ? `${first.slice(0, 120)}…` : first\n }\n const handleInputKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && error()) {\n setError(null)\n return\n }\n if (event.key !== 'Enter' || event.shiftKey || event.defaultPrevented) return\n if (ime.claimEnter(event)) {\n const selected =\n props.busy && (event.metaKey || event.ctrlKey)\n ? props.busy.mode === 'steer'\n ? 'queue'\n : 'steer'\n : action()\n void submit(selected)\n }\n }\n const handleCompositionStart = () => {\n composing = true\n ime.onCompositionStart()\n }\n const handleCompositionEnd = () => {\n composing = false\n ime.onCompositionEnd()\n }\n const handleBlur = () => {\n composing = false\n ime.onBlur()\n }\n return (\n <div data-slot=\"chat-composer\" class=\"mx-auto flex w-full max-w-4xl flex-col px-4 pb-1\">\n <Show when={!props.approvalFocus}>\n <Show when={props.knowledge}>\n <div data-slot=\"composer-knowledge\">{props.knowledge}</div>\n </Show>\n <Show when={props.followUps}>\n <div data-slot=\"composer-follow-ups\">{props.followUps}</div>\n </Show>\n </Show>\n <Show when={props.band}>\n <div data-slot=\"composer-band\">{props.band}</div>\n </Show>\n <div aria-hidden=\"true\" class=\"h-1.5 shrink-0\" />\n <Show when={props.approval}>\n <div data-slot=\"composer-approval\">{props.approval}</div>\n </Show>\n <Show when={props.notices}>\n <div data-slot=\"composer-notices\">{props.notices}</div>\n </Show>\n <Show when={props.blockedReason}>\n <p role=\"status\" class=\"text-muted-foreground mb-1 text-xs\">\n {props.blockedReason}\n </p>\n </Show>\n <Show when={error()}>\n {(message) => (\n <p role=\"alert\" class=\"text-destructive mb-1 text-xs\">\n {message()}\n </p>\n )}\n </Show>\n <Show when={!props.approvalFocus}>\n <Show\n when={!collapsed()}\n fallback={\n <Button\n ref={(element) => {\n restoreBar = element\n onCleanup(() => {\n if (restoreBar === element) restoreBar = undefined\n })\n }}\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n class=\"w-full justify-start\"\n aria-expanded={false}\n aria-label=\"Show the message input\"\n onClick={() => changeCollapsed(false)}\n >\n <ChevronsUpDown />\n <span aria-hidden=\"true\" class=\"shrink-0\">\n Show the message input\n </span>\n <Show when={preview()}>\n <span aria-hidden=\"true\" class=\"min-w-0 flex-1 truncate\">\n {preview()}\n </span>\n </Show>\n </Button>\n }\n >\n <form\n data-slot=\"composer-input-box\"\n class=\"border-input bg-card flex flex-col overflow-hidden rounded-2xl border transition-colors focus-within:border-ring\"\n onSubmit={(event) => {\n event.preventDefault()\n void submit()\n }}\n >\n <Show when={props.attachments}>\n <div data-slot=\"composer-staged-content\">{props.attachments}</div>\n </Show>\n {props.renderInput({\n ref: (element) => {\n field = element\n if (element)\n onCleanup(() => {\n if (field === element) field = undefined\n })\n },\n value: () => props.value,\n resetKey: () => props.resetKey,\n inputLabel: () => props.inputLabel ?? 'Message',\n placeholder: () => props.placeholder ?? 'Write a message…',\n disabled: () => props.disabled,\n readOnly: () => props.readOnly || pending(),\n composing: () => composing,\n onCompositionStart: handleCompositionStart,\n onCompositionEnd: handleCompositionEnd,\n onFocus: ime.onFocus,\n onBlur: handleBlur,\n onKeyDown: handleInputKeyDown,\n })}\n <div\n data-slot=\"composer-action-row\"\n class=\"flex items-center justify-between gap-2 px-2.5 pb-2 pt-0.5\"\n >\n <div class=\"flex min-w-0 items-center gap-1\">\n <Show when={props.collapse || props.menuItems}>\n <DropdownMenu placement=\"top-start\">\n <DropdownMenuTrigger\n as={Button}\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Message input options\"\n >\n <MoreHorizontal />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n onCloseAutoFocus={(event) => {\n if (focusTarget) event.preventDefault()\n }}\n >\n {props.menuItems}\n <Show when={props.collapse}>\n <DropdownMenuItem onSelect={() => changeCollapsed(true)}>\n <ChevronsDownUp />\n <div class=\"flex min-w-0 flex-col\">\n <span>Collapse the message input</span>\n <span class=\"text-muted-foreground text-xs\">\n Make room to read; keep your draft\n </span>\n </div>\n </DropdownMenuItem>\n </Show>\n </DropdownMenuContent>\n </DropdownMenu>\n </Show>\n {props.leadingActions}\n </div>\n <div class=\"flex shrink-0 items-center gap-1\">\n {props.trailingActions}\n <Show\n when={props.busy}\n fallback={\n <Button\n type=\"submit\"\n size=\"icon-sm\"\n disabled={!canSend()}\n aria-label={pending() ? 'Sending message' : 'Send message'}\n >\n <Show when={pending()} fallback={<ArrowUp />}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n </Button>\n }\n >\n {(busy) => (\n <BusySendButton\n {...busy()}\n alternateActionHint={\n canSend(busy().mode === 'steer' ? 'queue' : 'steer')\n ? 'Ctrl/Cmd+Enter uses the other action'\n : undefined\n }\n disabled={!canSend()}\n onFire={() => {\n void submit()\n }}\n />\n )}\n </Show>\n </div>\n </div>\n </form>\n <Show when={props.context}>\n <div data-slot=\"composer-context\" class=\"flex min-w-0 items-center gap-2 pt-1\">\n {props.context}\n </div>\n </Show>\n </Show>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,SAAgBmD,kBAAwCF,OAAsC;CAC5F,MAAMG,MAAM7B,uBAAuB;CACnC,MAAM,CAAC8B,SAASC,cAAchD,aAAa,KAAK;CAChD,MAAM,CAACiD,OAAOC,YAAYlD,aAA4B,IAAI;CAC1D,IAAImD;CACJ,IAAIC;CACJ,IAAIE;CACJ,IAAIC;CACJ,IAAIC;CAGJ,IAAII,aAAa;CACjB,IAAIC,SAAS;CACb,IAAIjC,YAAY;CAChB,MAAMkC,kBAAkBnB,MAAMoB,UAAUzC,UAAU;CAClD,MAAM0C,oBAAoBrB,MAAMjB,YAAYiB,MAAMhB,YAAY,CAAC,CAACgB,MAAMsB;CACtE,MAAMC,oBAAoB;EACxB,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B"}
|
|
1
|
+
{"version":3,"file":"chat-composer-shell.js","names":["ChevronsDownUp","ChevronsUpDown","MoreHorizontal","ArrowUp","Show","createEffect","createSignal","on","onCleanup","onMount","Accessor","JSX","ChatComposerControl","ChatComposerSharedProps","ChatComposerSubmitInput","Button","DropdownMenu","DropdownMenuContent","DropdownMenuItem","DropdownMenuTrigger","Spinner","BusySendButton","BusySendMode","createComposerImeGuard","ChatComposerInputRenderProps","ref","element","HTMLTextAreaElement","value","resetKey","inputLabel","placeholder","disabled","readOnly","composing","onCompositionStart","onCompositionEnd","onFocus","onBlur","onKeyDown","event","KeyboardEvent","ChatComposerShellProps","createSubmitExtra","input","Extra","onSubmit","Promise","renderInput","props","Element","ChatComposerShell","ime","pending","setPending","error","setError","field","restoreBar","HTMLButtonElement","focusFrame","focusTarget","selection","start","end","direction","generation","active","collapsed","collapse","unavailable","blockedReason","cancelFocus","undefined","cancelAnimationFrame","requestFocus","target","requestAnimationFrame","approvalFocus","focus","setSelectionRange","Math","min","length","changeCollapsed","selectionStart","selectionEnd","selectionDirection","onChange","control","expandAndFocus","controlRef","defer","action","busy","mode","canSend","selected","sendableActions","trim","submit","started","base","text","preview","first","split","find","line","slice","handleInputKeyDown","key","shiftKey","defaultPrevented","claimEnter","metaKey","ctrlKey","handleCompositionStart","handleCompositionEnd","handleBlur","_el$","_tmpl$1","_el$5","firstChild","_$insert","_$createComponent","when","children","knowledge","_el$2","_tmpl$","followUps","_el$3","_tmpl$2","band","_el$4","_tmpl$3","approval","_el$6","_tmpl$4","notices","_el$7","_tmpl$5","_el$8","_tmpl$6","message","_el$14","_tmpl$10","fallback","type","variant","size","onClick","_tmpl$11","_el$16","_tmpl$12","_el$9","_tmpl$9","_el$1","_el$10","_el$12","nextSibling","addEventListener","preventDefault","attachments","_el$0","_tmpl$7","menuItems","placement","as","onCloseAutoFocus","_$memo","onSelect","_tmpl$8","leadingActions","trailingActions","aria-label","label","_$mergeProps","alternateActionHint","onFire","context","_el$13","_tmpl$0","_$createComponent","_$memo","_$mergeProps"],"sources":["../../../../src/components/conversation/internal/chat-composer-shell.tsx"],"sourcesContent":["/*\n * Substantially translated from KiroCrew website/src/components/ChatInput.tsx\n * at 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * Licensed under Apache-2.0; see LICENSE and NOTICE.\n */\nimport { ChevronsDownUp, ChevronsUpDown, MoreHorizontal, ArrowUp } from 'lucide-solid'\nimport {\n Show,\n createEffect,\n createSignal,\n on,\n onCleanup,\n onMount,\n type Accessor,\n type JSX,\n} from 'solid-js'\nimport type {\n ChatComposerControl,\n ChatComposerSharedProps,\n ChatComposerSubmitInput,\n} from '../chat-composer'\nimport { Button } from '../../ui/button/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu/dropdown-menu'\nimport { Spinner } from '../../ui/spinner/spinner'\nimport { BusySendButton, type BusySendMode } from '../busy-send-button'\nimport { createComposerImeGuard } from '../ime-guard'\n\n/** Private typed seam: public wrappers supply the native or atomic input. */\ntype ChatComposerInputRenderProps = {\n ref: (element: HTMLTextAreaElement | undefined) => void\n value: Accessor<string>\n resetKey: Accessor<unknown>\n inputLabel: Accessor<string>\n placeholder: Accessor<string>\n disabled: Accessor<boolean | undefined>\n readOnly: Accessor<boolean>\n composing: Accessor<boolean>\n onCompositionStart: () => void\n onCompositionEnd: () => void\n onFocus: () => void\n onBlur: () => void\n onKeyDown: (event: KeyboardEvent) => void\n}\n\ntype ChatComposerShellProps<Extra extends object> = ChatComposerSharedProps & {\n createSubmitExtra: (input: ChatComposerSubmitInput) => Extra\n onSubmit: (input: ChatComposerSubmitInput & Extra) => void | Promise<void>\n renderInput: (props: ChatComposerInputRenderProps) => JSX.Element\n}\n\n/**\n * Kiro's composer assembly: context/options, adjacent band, approval/notices,\n * staged content, input/action groups and a context shelf. Reading collapse\n * really unmounts the input and shelf and offers a labeled way back with draft\n * preview. The host retains the only draft, identities, preferences and services.\n *\n * Kobalte owns the options menu. Scoped imperative typing intent replaces the\n * donor global lookup/broadcast so a second composer cannot receive this draft\n * or focus. No animation starts from hidden geometry, no global shortcut, and no\n * runtime/permission/voice/optimizer authority is copied. More specific chips,\n * approval decisions and staged-content semantics are supplied by their owners.\n */\nexport function ChatComposerShell<Extra extends object>(props: ChatComposerShellProps<Extra>) {\n const ime = createComposerImeGuard()\n const [pending, setPending] = createSignal(false)\n const [error, setError] = createSignal<string | null>(null)\n let field: HTMLTextAreaElement | undefined\n let restoreBar: HTMLButtonElement | undefined\n let focusFrame: number | undefined\n let focusTarget: 'input' | 'bar' | undefined\n let selection:\n | { start: number; end: number; direction: 'forward' | 'backward' | 'none' }\n | undefined\n let generation = 0\n let active = true\n let composing = false\n const collapsed = () => props.collapse?.value === true\n const unavailable = () => props.disabled || props.readOnly || !!props.blockedReason\n const cancelFocus = () => {\n if (focusFrame !== undefined) cancelAnimationFrame(focusFrame)\n focusFrame = undefined\n }\n const requestFocus = (target: 'input' | 'bar') => {\n cancelFocus()\n focusTarget = target\n focusFrame = requestAnimationFrame(() => {\n focusFrame = undefined\n if (!active || props.approvalFocus) return\n if (target === 'bar' && collapsed()) restoreBar?.focus()\n if (target === 'input' && !collapsed() && !props.disabled && field) {\n field.focus()\n if (selection)\n field.setSelectionRange(\n Math.min(selection.start, field.value.length),\n Math.min(selection.end, field.value.length),\n selection.direction\n )\n }\n focusTarget = undefined\n })\n }\n const changeCollapsed = (value: boolean) => {\n if (!props.collapse || props.approvalFocus) return\n if (value && field)\n selection = {\n start: field.selectionStart,\n end: field.selectionEnd,\n direction: field.selectionDirection,\n }\n props.collapse.onChange(value)\n requestFocus(value ? 'bar' : 'input')\n }\n const control: ChatComposerControl = {\n focus() {\n if (collapsed() || props.approvalFocus || props.disabled || !field) return false\n field.focus()\n return true\n },\n expandAndFocus() {\n if (props.approvalFocus || props.disabled) return false\n if (collapsed()) changeCollapsed(false)\n else requestFocus('input')\n return true\n },\n }\n onMount(() => props.controlRef?.(control))\n createEffect(\n on(\n () => props.resetKey,\n () => {\n generation += 1\n selection = undefined\n composing = false\n cancelFocus()\n focusTarget = undefined\n setPending(false)\n setError(null)\n ime.onBlur()\n },\n { defer: true }\n )\n )\n onCleanup(() => {\n active = false\n generation += 1\n cancelFocus()\n props.controlRef?.(undefined)\n })\n const action = (): 'send' | BusySendMode => props.busy?.mode ?? 'send'\n const canSend = (selected: 'send' | BusySendMode = action()) =>\n !unavailable() &&\n !pending() &&\n (props.sendableActions?.[selected] ?? props.value.trim().length > 0) &&\n !(selected !== 'send' && props.busy?.unavailable?.[selected])\n const submit = async (selected: 'send' | BusySendMode = action()) => {\n if (!canSend(selected)) return\n const started = generation\n const base: ChatComposerSubmitInput = { text: props.value, action: selected }\n const input = { ...base, ...props.createSubmitExtra(base) }\n setPending(true)\n setError(null)\n try {\n await props.onSubmit(input)\n } catch {\n if (active && started === generation)\n setError('Message not sent. Check your draft and retry when the connection recovers.')\n } finally {\n if (active && started === generation) setPending(false)\n }\n }\n const preview = () => {\n const first =\n props.value\n .split('\\n')\n .find((line) => line.trim().length > 0)\n ?.trim() ?? ''\n return first.length > 120 ? `${first.slice(0, 120)}…` : first\n }\n const handleInputKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && error()) {\n setError(null)\n return\n }\n if (event.key !== 'Enter' || event.shiftKey || event.defaultPrevented) return\n if (ime.claimEnter(event)) {\n const selected =\n props.busy && (event.metaKey || event.ctrlKey)\n ? props.busy.mode === 'steer'\n ? 'queue'\n : 'steer'\n : action()\n void submit(selected)\n }\n }\n const handleCompositionStart = () => {\n composing = true\n ime.onCompositionStart()\n }\n const handleCompositionEnd = () => {\n composing = false\n ime.onCompositionEnd()\n }\n const handleBlur = () => {\n composing = false\n ime.onBlur()\n }\n return (\n <div data-slot=\"chat-composer\" class=\"mx-auto flex w-full max-w-4xl flex-col px-4 pb-1\">\n <Show when={!props.approvalFocus}>\n <Show when={props.knowledge}>\n <div data-slot=\"composer-knowledge\">{props.knowledge}</div>\n </Show>\n <Show when={props.followUps}>\n <div data-slot=\"composer-follow-ups\">{props.followUps}</div>\n </Show>\n </Show>\n <Show when={props.band}>\n <div data-slot=\"composer-band\">{props.band}</div>\n </Show>\n <div aria-hidden=\"true\" class=\"h-1.5 shrink-0\" />\n <Show when={props.approval}>\n <div data-slot=\"composer-approval\">{props.approval}</div>\n </Show>\n <Show when={props.notices}>\n <div data-slot=\"composer-notices\">{props.notices}</div>\n </Show>\n <Show when={props.blockedReason}>\n <p role=\"status\" class=\"text-muted-foreground mb-1 text-xs\">\n {props.blockedReason}\n </p>\n </Show>\n <Show when={error()}>\n {(message) => (\n <p role=\"alert\" class=\"text-foreground mb-1 border-s-2 border-destructive ps-2 text-xs\">\n {message()}\n </p>\n )}\n </Show>\n <Show when={!props.approvalFocus}>\n <Show\n when={!collapsed()}\n fallback={\n <Button\n ref={(element) => {\n restoreBar = element\n onCleanup(() => {\n if (restoreBar === element) restoreBar = undefined\n })\n }}\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n class=\"w-full justify-start\"\n aria-expanded={false}\n aria-label=\"Show the message input\"\n onClick={() => changeCollapsed(false)}\n >\n <ChevronsUpDown />\n <span aria-hidden=\"true\" class=\"shrink-0\">\n Show the message input\n </span>\n <Show when={preview()}>\n <span aria-hidden=\"true\" class=\"min-w-0 flex-1 truncate\">\n {preview()}\n </span>\n </Show>\n </Button>\n }\n >\n <form\n data-slot=\"composer-input-box\"\n class=\"border-input bg-card flex flex-col overflow-hidden rounded-2xl border transition-colors focus-within:border-ring\"\n onSubmit={(event) => {\n event.preventDefault()\n void submit()\n }}\n >\n <Show when={props.attachments}>\n <div data-slot=\"composer-staged-content\">{props.attachments}</div>\n </Show>\n {props.renderInput({\n ref: (element) => {\n field = element\n if (element)\n onCleanup(() => {\n if (field === element) field = undefined\n })\n },\n value: () => props.value,\n resetKey: () => props.resetKey,\n inputLabel: () => props.inputLabel ?? 'Message',\n placeholder: () => props.placeholder ?? 'Write a message…',\n disabled: () => props.disabled,\n readOnly: () => props.readOnly || pending(),\n composing: () => composing,\n onCompositionStart: handleCompositionStart,\n onCompositionEnd: handleCompositionEnd,\n onFocus: ime.onFocus,\n onBlur: handleBlur,\n onKeyDown: handleInputKeyDown,\n })}\n <div\n data-slot=\"composer-action-row\"\n class=\"flex items-center justify-between gap-2 px-2.5 pb-2 pt-0.5\"\n >\n <div class=\"flex min-w-0 items-center gap-1\">\n <Show when={props.collapse || props.menuItems}>\n <DropdownMenu placement=\"top-start\">\n <DropdownMenuTrigger\n as={Button}\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Message input options\"\n >\n <MoreHorizontal />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n onCloseAutoFocus={(event) => {\n if (focusTarget) event.preventDefault()\n }}\n >\n {props.menuItems}\n <Show when={props.collapse}>\n <DropdownMenuItem onSelect={() => changeCollapsed(true)}>\n <ChevronsDownUp />\n <div class=\"flex min-w-0 flex-col\">\n <span>Collapse the message input</span>\n <span class=\"text-muted-foreground text-xs\">\n Make room to read; keep your draft\n </span>\n </div>\n </DropdownMenuItem>\n </Show>\n </DropdownMenuContent>\n </DropdownMenu>\n </Show>\n {props.leadingActions}\n </div>\n <div class=\"flex shrink-0 items-center gap-1\">\n {props.trailingActions}\n <Show\n when={props.busy}\n fallback={\n <Button\n type=\"submit\"\n size=\"icon-sm\"\n disabled={!canSend()}\n aria-label={pending() ? 'Sending message' : 'Send message'}\n >\n <Show when={pending()} fallback={<ArrowUp />}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n </Button>\n }\n >\n {(busy) => (\n <BusySendButton\n {...busy()}\n alternateActionHint={\n canSend(busy().mode === 'steer' ? 'queue' : 'steer')\n ? 'Ctrl/Cmd+Enter uses the other action'\n : undefined\n }\n disabled={!canSend()}\n onFire={() => {\n void submit()\n }}\n />\n )}\n </Show>\n </div>\n </div>\n </form>\n <Show when={props.context}>\n <div data-slot=\"composer-context\" class=\"flex min-w-0 items-center gap-2 pt-1\">\n {props.context}\n </div>\n </Show>\n </Show>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,SAAgBmD,kBAAwCF,OAAsC;CAC5F,MAAMG,MAAM7B,uBAAuB;CACnC,MAAM,CAAC8B,SAASC,cAAchD,aAAa,KAAK;CAChD,MAAM,CAACiD,OAAOC,YAAYlD,aAA4B,IAAI;CAC1D,IAAImD;CACJ,IAAIC;CACJ,IAAIE;CACJ,IAAIC;CACJ,IAAIC;CAGJ,IAAII,aAAa;CACjB,IAAIC,SAAS;CACb,IAAIjC,YAAY;CAChB,MAAMkC,kBAAkBnB,MAAMoB,UAAUzC,UAAU;CAClD,MAAM0C,oBAAoBrB,MAAMjB,YAAYiB,MAAMhB,YAAY,CAAC,CAACgB,MAAMsB;CACtE,MAAMC,oBAAoB;EACxB,IAAIZ,eAAea,KAAAA,GAAWC,qBAAqBd,UAAU;EAC7DA,aAAaa,KAAAA;CACf;CACA,MAAME,gBAAgBC,WAA4B;EAChDJ,YAAY;EACZX,cAAce;EACdhB,aAAaiB,4BAA4B;GACvCjB,aAAaa,KAAAA;GACb,IAAI,CAACN,UAAUlB,MAAM6B,eAAe;GACpC,IAAIF,WAAW,SAASR,UAAU,GAAGV,YAAYqB,MAAM;GACvD,IAAIH,WAAW,WAAW,CAACR,UAAU,KAAK,CAACnB,MAAMjB,YAAYyB,OAAO;IAClEA,MAAMsB,MAAM;IACZ,IAAIjB,WACFL,MAAMuB,kBACJC,KAAKC,IAAIpB,UAAUC,OAAON,MAAM7B,MAAMuD,MAAM,GAC5CF,KAAKC,IAAIpB,UAAUE,KAAKP,MAAM7B,MAAMuD,MAAM,GAC1CrB,UAAUG,SACZ;GACJ;GACAJ,cAAcY,KAAAA;EAChB,CAAC;CACH;CACA,MAAMW,mBAAmBxD,UAAmB;EAC1C,IAAI,CAACqB,MAAMoB,YAAYpB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CAAA;IAClB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,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,0DAA0D;IAC1D,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,IAAI,CAAA;KAAE,CAAA;CACnD,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"message-composer.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message-composer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAM5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;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,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,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,0DAA0D;IAC1D,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,IAAI,CAAA;KAAE,CAAA;CACnD,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eA6I1D;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,eAiB1E;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,eAetD"}
|
|
@@ -12,7 +12,7 @@ var _tmpl$ = /*#__PURE__*/ template(`<div>`);
|
|
|
12
12
|
var _tmpl$2 = /*#__PURE__*/ template(`<p class="text-muted-foreground flex items-center gap-1.5 text-2xs"> to send<span aria-hidden=true>·</span> <!> for a new line`);
|
|
13
13
|
var _tmpl$3 = /*#__PURE__*/ template(`<form data-slot=message-composer><div><div class="flex items-center gap-1"><div class="ms-auto flex items-center gap-1"></div></div></div><div aria-live=polite class=min-h-0>`);
|
|
14
14
|
var _tmpl$4 = /*#__PURE__*/ template(`<div class="bg-muted text-muted-foreground flex items-center gap-2 rounded-md px-2.5 py-1.5 text-xs"><span class="min-w-0 flex-1 truncate">Replying to `);
|
|
15
|
-
var _tmpl$5 = /*#__PURE__*/ template(`<p class="text-destructive text-xs">`);
|
|
15
|
+
var _tmpl$5 = /*#__PURE__*/ template(`<p class="text-foreground border-s-2 border-destructive ps-2 text-xs">`);
|
|
16
16
|
var _tmpl$6 = /*#__PURE__*/ template(`<p>`);
|
|
17
17
|
function MessageComposer(props) {
|
|
18
18
|
const [local, rest] = splitProps(props, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-composer.js","names":["CornerDownLeft","Paperclip","Send","X","ComponentProps","JSX","Show","createSignal","splitProps","cn","Button","Kbd","Spinner","Textarea","createComposerImeGuard","MessageComposerProps","Omit","value","onValueChange","onSubmit","Promise","placeholder","disabled","submitLabel","showHint","leading","Element","trailing","menu","replyTo","label","onDismiss","MessageComposer","props","local","rest","sending","setSending","error","setError","ime","canSend","trim","length","send","onKeyDown","EventHandlerUnion","HTMLTextAreaElement","KeyboardEvent","event","defaultPrevented","key","shiftKey","metaKey","ctrlKey","claimEnter","_el$","_tmpl$3","_el$3","firstChild","_el$4","_el$5","_el$10","nextSibling","addEventListener","preventDefault","_$spread","_$mergeProps","class","_$insert","_$createComponent","when","children","_el$2","_tmpl$","reply","_el$11","_tmpl$4","_el$12","_el$13","type","variant","size","onClick","onCompositionStart","onCompositionEnd","onFocus","onBlur","onInput","currentTarget","rows","aria-label","_$memo","fallback","_el$6","_tmpl$2","_el$7","_el$8","_el$9","_el$1","_el$0","message","_el$14","_tmpl$5","_$effect","_$className","ComposerAttachmentButton","count","open","aria-expanded","ComposerHint","_el$15","_tmpl$6","_$mergeProps","_$createComponent","_$memo","_$className"],"sources":["../../../src/components/conversation/message-composer.tsx"],"sourcesContent":["import { CornerDownLeft, Paperclip, Send, X } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { Show, createSignal, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button/button'\nimport { Kbd } from '../ui/kbd/kbd'\nimport { Spinner } from '../ui/spinner/spinner'\nimport { Textarea } from '../ui/textarea/textarea'\nimport { createComposerImeGuard } from './ime-guard'\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.\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 /** Label the send action for a context other than a message, e.g. a reply. */\n submitLabel?: string\n /** Show the keyboard hint under the field. */\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 /** The reply target, drawn as a strip above the field. */\n replyTo?: { label: string; onDismiss: () => void }\n}\n\nexport function MessageComposer(props: MessageComposerProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'value',\n 'onValueChange',\n 'onSubmit',\n 'placeholder',\n 'disabled',\n 'submitLabel',\n 'showHint',\n 'leading',\n 'trailing',\n 'menu',\n 'replyTo',\n ])\n\n const [sending, setSending] = createSignal(false)\n const [error, setError] = createSignal<string | null>(null)\n const ime = createComposerImeGuard()\n\n const canSend = () => local.value.trim().length > 0 && !local.disabled && !sending()\n\n const send = async () => {\n if (!canSend()) return\n setSending(true)\n setError(null)\n try {\n await local.onSubmit()\n } catch {\n // The draft is deliberately left in place. A send that fails and clears the\n // field loses the user's work, which is the worst outcome available here.\n setError('Message not sent. Your draft is still here; retry when the connection recovers.')\n } finally {\n setSending(false)\n }\n }\n\n const onKeyDown: JSX.EventHandlerUnion<HTMLTextAreaElement, KeyboardEvent> = (event) => {\n if (event.defaultPrevented) return\n if (event.key === 'Escape' && error()) {\n setError(null)\n return\n }\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 (!ime.claimEnter(event)) return\n void send()\n }\n\n return (\n <form\n data-slot=\"message-composer\"\n class={cn('flex flex-col gap-2', local.class)}\n onSubmit={(event) => {\n event.preventDefault()\n void send()\n }}\n {...rest}\n >\n <Show when={local.menu}>\n <div>{local.menu}</div>\n </Show>\n\n <Show when={local.replyTo}>\n {(reply) => (\n <div class=\"bg-muted text-muted-foreground flex items-center gap-2 rounded-md px-2.5 py-1.5 text-xs\">\n <span class=\"min-w-0 flex-1 truncate\">Replying to {reply().label}</span>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </Button>\n </div>\n )}\n </Show>\n\n <div\n class={cn(\n 'border-input bg-card flex flex-col gap-1 rounded-lg border p-2',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n local.disabled && 'opacity-50'\n )}\n >\n <Textarea\n onCompositionStart={ime.onCompositionStart}\n onCompositionEnd={ime.onCompositionEnd}\n onFocus={ime.onFocus}\n onBlur={ime.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 rows={1}\n aria-label={local.submitLabel ? `${local.submitLabel} message` : 'Message'}\n class=\"min-h-9 resize-none border-0 bg-transparent p-0 text-sm shadow-none focus-visible:ring-0\"\n />\n\n <div class=\"flex items-center gap-1\">\n <Show when={local.leading}>{local.leading}</Show>\n <div class=\"ms-auto flex items-center gap-1\">\n <Show when={local.trailing}>{local.trailing}</Show>\n <Button\n type=\"submit\"\n size=\"icon-sm\"\n disabled={!canSend()}\n aria-label={sending() ? 'Sending message' : 'Send message'}\n >\n <Show when={sending()} fallback={<Send />}>\n <Spinner size=\"sm\" label={false} class=\"text-primary-foreground\" />\n </Show>\n </Button>\n </div>\n </div>\n </div>\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 aria-live=\"polite\" class=\"min-h-0\">\n <Show when={error()}>\n {(message) => <p class=\"text-destructive text-xs\">{message()}</p>}\n </Show>\n </div>\n </form>\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, rest] = splitProps(props, ['count', 'open', 'children'])\n\n return (\n <Button\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}\n class=\"text-muted-foreground\"\n {...rest}\n >\n {local.children ?? <Paperclip />}\n </Button>\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, rest] = splitProps(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":";;;;;;;;;;;;;;;;AAiEA,SAAgBgC,gBAAgBC,OAA6B;CAC3D,MAAM,CAACC,OAAOC,QAAQ3B,WAAWyB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAS,CACV;CAED,MAAM,CAACG,SAASC,cAAc9B,aAAa,KAAK;CAChD,MAAM,CAAC+B,OAAOC,YAAYhC,aAA4B,IAAI;CAC1D,MAAMiC,MAAM1B,uBAAuB;CAEnC,MAAM2B,gBAAgBP,MAAMjB,MAAMyB,KAAK,CAAC,CAACC,SAAS,KAAK,CAACT,MAAMZ,YAAY,CAACc,QAAQ;CAEnF,MAAMQ,OAAO,YAAY;EACvB,IAAI,CAACH,QAAQ,GAAG;EAChBJ,WAAW,IAAI;EACfE,SAAS,IAAI;EACb,IAAI;GACF,MAAML,MAAMf,SAAS;EACvB,QAAQ;GAGNoB,SAAS,iFAAiF;EAC5F,UAAU;GACRF,WAAW,KAAK;EAClB;CACF;CAEA,MAAMQ,aAAwEI,UAAU;EACtF,IAAIA,MAAMC,kBAAkB;EAC5B,IAAID,MAAME,QAAQ,YAAYb,MAAM,GAAG;GACrCC,SAAS,IAAI;GACb;EACF;EACA,IAAIU,MAAME,QAAQ,SAAS;EAE3B,IAAIF,MAAMG,YAAY,CAACH,MAAMI,WAAW,CAACJ,MAAMK,SAAS;EACxD,IAAI,CAACd,IAAIe,WAAWN,KAAK,GAAG;EAC5B,KAAU;CACZ;CAEA,cAAA;EAAA,IAAAO,OAAAC,QAAA,GAAAC,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AAA;CAAA,GAErBzE,MAAI,EAAA,IAAAqC,WAAA;EAAA,OAEPtC,MAAMsC,YAAQF,gBAAKrE,WAAS,CAAA,CAAA;CAAG,EAAA,CAAA,CAAA;AAGtC;;AAGA,SAAgB6G,aAAa7E,OAA4B;CACvD,MAAM,CAACC,OAAOC,QAAQ3B,WAAWyB,OAAO,CAAC,SAAS,UAAU,CAAC;CAC7D,cAAA;EAAA,IAAA8E,SAAAC,QAAA;EAAA9C,OAAA6C,QAAA5C,WAAA,EAAA,KAAA,WAAA;GAAA,OAEW1D,GAAG,4DAA4DyB,MAAMkC,KAAK;EAAC,EAAA,GAC9EjC,IAAI,GAAA,OAAA,IAAA;EAAAkC,OAAA0C,cAEP7E,MAAMsC,YAAQ;GAAAF,gBAEVtE,gBAAc;IAAA,eAAA;IAAA,SAAA;GAAA,CAAA;GAAAsE,gBACd3D,KAAG,EAAA6D,UAAA,QAAA,CAAA;GAAA;EAAA,CAEP;EAAA,OAAAuC;CAAA,EAAA,CAAA;AAGP"}
|
|
1
|
+
{"version":3,"file":"message-composer.js","names":["CornerDownLeft","Paperclip","Send","X","ComponentProps","JSX","Show","createSignal","splitProps","cn","Button","Kbd","Spinner","Textarea","createComposerImeGuard","MessageComposerProps","Omit","value","onValueChange","onSubmit","Promise","placeholder","disabled","submitLabel","showHint","leading","Element","trailing","menu","replyTo","label","onDismiss","MessageComposer","props","local","rest","sending","setSending","error","setError","ime","canSend","trim","length","send","onKeyDown","EventHandlerUnion","HTMLTextAreaElement","KeyboardEvent","event","defaultPrevented","key","shiftKey","metaKey","ctrlKey","claimEnter","_el$","_tmpl$3","_el$3","firstChild","_el$4","_el$5","_el$10","nextSibling","addEventListener","preventDefault","_$spread","_$mergeProps","class","_$insert","_$createComponent","when","children","_el$2","_tmpl$","reply","_el$11","_tmpl$4","_el$12","_el$13","type","variant","size","onClick","onCompositionStart","onCompositionEnd","onFocus","onBlur","onInput","currentTarget","rows","aria-label","_$memo","fallback","_el$6","_tmpl$2","_el$7","_el$8","_el$9","_el$1","_el$0","message","_el$14","_tmpl$5","_$effect","_$className","ComposerAttachmentButton","count","open","aria-expanded","ComposerHint","_el$15","_tmpl$6","_$mergeProps","_$createComponent","_$memo","_$className"],"sources":["../../../src/components/conversation/message-composer.tsx"],"sourcesContent":["import { CornerDownLeft, Paperclip, Send, X } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { Show, createSignal, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button/button'\nimport { Kbd } from '../ui/kbd/kbd'\nimport { Spinner } from '../ui/spinner/spinner'\nimport { Textarea } from '../ui/textarea/textarea'\nimport { createComposerImeGuard } from './ime-guard'\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.\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 /** Label the send action for a context other than a message, e.g. a reply. */\n submitLabel?: string\n /** Show the keyboard hint under the field. */\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 /** The reply target, drawn as a strip above the field. */\n replyTo?: { label: string; onDismiss: () => void }\n}\n\nexport function MessageComposer(props: MessageComposerProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'value',\n 'onValueChange',\n 'onSubmit',\n 'placeholder',\n 'disabled',\n 'submitLabel',\n 'showHint',\n 'leading',\n 'trailing',\n 'menu',\n 'replyTo',\n ])\n\n const [sending, setSending] = createSignal(false)\n const [error, setError] = createSignal<string | null>(null)\n const ime = createComposerImeGuard()\n\n const canSend = () => local.value.trim().length > 0 && !local.disabled && !sending()\n\n const send = async () => {\n if (!canSend()) return\n setSending(true)\n setError(null)\n try {\n await local.onSubmit()\n } catch {\n // The draft is deliberately left in place. A send that fails and clears the\n // field loses the user's work, which is the worst outcome available here.\n setError('Message not sent. Your draft is still here; retry when the connection recovers.')\n } finally {\n setSending(false)\n }\n }\n\n const onKeyDown: JSX.EventHandlerUnion<HTMLTextAreaElement, KeyboardEvent> = (event) => {\n if (event.defaultPrevented) return\n if (event.key === 'Escape' && error()) {\n setError(null)\n return\n }\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 (!ime.claimEnter(event)) return\n void send()\n }\n\n return (\n <form\n data-slot=\"message-composer\"\n class={cn('flex flex-col gap-2', local.class)}\n onSubmit={(event) => {\n event.preventDefault()\n void send()\n }}\n {...rest}\n >\n <Show when={local.menu}>\n <div>{local.menu}</div>\n </Show>\n\n <Show when={local.replyTo}>\n {(reply) => (\n <div class=\"bg-muted text-muted-foreground flex items-center gap-2 rounded-md px-2.5 py-1.5 text-xs\">\n <span class=\"min-w-0 flex-1 truncate\">Replying to {reply().label}</span>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label=\"Cancel reply\"\n onClick={() => reply().onDismiss()}\n >\n <X />\n </Button>\n </div>\n )}\n </Show>\n\n <div\n class={cn(\n 'border-input bg-card flex flex-col gap-1 rounded-lg border p-2',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n local.disabled && 'opacity-50'\n )}\n >\n <Textarea\n onCompositionStart={ime.onCompositionStart}\n onCompositionEnd={ime.onCompositionEnd}\n onFocus={ime.onFocus}\n onBlur={ime.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 rows={1}\n aria-label={local.submitLabel ? `${local.submitLabel} message` : 'Message'}\n class=\"min-h-9 resize-none border-0 bg-transparent p-0 text-sm shadow-none focus-visible:ring-0\"\n />\n\n <div class=\"flex items-center gap-1\">\n <Show when={local.leading}>{local.leading}</Show>\n <div class=\"ms-auto flex items-center gap-1\">\n <Show when={local.trailing}>{local.trailing}</Show>\n <Button\n type=\"submit\"\n size=\"icon-sm\"\n disabled={!canSend()}\n aria-label={sending() ? 'Sending message' : 'Send message'}\n >\n <Show when={sending()} fallback={<Send />}>\n <Spinner size=\"sm\" label={false} class=\"text-primary-foreground\" />\n </Show>\n </Button>\n </div>\n </div>\n </div>\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 aria-live=\"polite\" class=\"min-h-0\">\n <Show when={error()}>\n {(message) => (\n <p class=\"text-foreground border-s-2 border-destructive ps-2 text-xs\">{message()}</p>\n )}\n </Show>\n </div>\n </form>\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, rest] = splitProps(props, ['count', 'open', 'children'])\n\n return (\n <Button\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}\n class=\"text-muted-foreground\"\n {...rest}\n >\n {local.children ?? <Paperclip />}\n </Button>\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, rest] = splitProps(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":";;;;;;;;;;;;;;;;AAiEA,SAAgBgC,gBAAgBC,OAA6B;CAC3D,MAAM,CAACC,OAAOC,QAAQ3B,WAAWyB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAS,CACV;CAED,MAAM,CAACG,SAASC,cAAc9B,aAAa,KAAK;CAChD,MAAM,CAAC+B,OAAOC,YAAYhC,aAA4B,IAAI;CAC1D,MAAMiC,MAAM1B,uBAAuB;CAEnC,MAAM2B,gBAAgBP,MAAMjB,MAAMyB,KAAK,CAAC,CAACC,SAAS,KAAK,CAACT,M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import { type VariantProps } from '#lib/variants';
|
|
|
9
9
|
*
|
|
10
10
|
* The glyph follows the tone rather than being passed in, so an alert cannot
|
|
11
11
|
* be given a green checkmark on a destructive fill. A caller that genuinely
|
|
12
|
-
* needs a different icon passes `icon`; `icon={null}` removes it.
|
|
12
|
+
* needs a different icon passes `icon`; `icon={null}` removes it. Text stays on
|
|
13
|
+
* the body foreground over the tinted status surface, while the glyph and edge
|
|
14
|
+
* carry the status hue.
|
|
13
15
|
*/
|
|
14
16
|
declare const alertVariants: (props?: ({
|
|
15
17
|
variant?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert/alert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert/alert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,aAAa;;8EAclB,CAAA;AAkBD,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAE3D,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,GAC5C,iBAAiB,GAAG;IAClB,yEAAyE;IACzE,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAA;CAC1B,CAAA;AAEH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,eAuBtC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAStD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAS5D;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
2
|
import { cva } from "../../../lib/variants.js";
|
|
3
|
-
import { Dynamic, createComponent, insert, memo, mergeProps, spread, template } from "solid-js/web";
|
|
3
|
+
import { Dynamic, className, createComponent, effect, insert, memo, mergeProps, spread, template } from "solid-js/web";
|
|
4
4
|
import { AlertCircle, CheckCircle2, Info, TriangleAlert } from "lucide-solid";
|
|
5
5
|
import { splitProps } from "solid-js";
|
|
6
6
|
//#region src/components/ui/alert/alert.tsx
|
|
7
7
|
var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=alert role=alert>`);
|
|
8
|
-
var _tmpl$2 = /*#__PURE__*/ template(`<span data-slot=alert-icon
|
|
8
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<span data-slot=alert-icon>`);
|
|
9
9
|
var _tmpl$3 = /*#__PURE__*/ template(`<div data-slot=alert-title>`);
|
|
10
10
|
var _tmpl$4 = /*#__PURE__*/ template(`<div data-slot=alert-description>`);
|
|
11
11
|
/**
|
|
@@ -17,15 +17,17 @@ var _tmpl$4 = /*#__PURE__*/ template(`<div data-slot=alert-description>`);
|
|
|
17
17
|
*
|
|
18
18
|
* The glyph follows the tone rather than being passed in, so an alert cannot
|
|
19
19
|
* be given a green checkmark on a destructive fill. A caller that genuinely
|
|
20
|
-
* needs a different icon passes `icon`; `icon={null}` removes it.
|
|
20
|
+
* needs a different icon passes `icon`; `icon={null}` removes it. Text stays on
|
|
21
|
+
* the body foreground over the tinted status surface, while the glyph and edge
|
|
22
|
+
* carry the status hue.
|
|
21
23
|
*/
|
|
22
24
|
var alertVariants = cva("relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 gap-y-1 rounded-lg border px-3 py-2.5 text-sm", {
|
|
23
25
|
variants: { variant: {
|
|
24
26
|
default: "bg-card text-card-foreground border-border",
|
|
25
|
-
destructive: "bg-destructive-subtle text-
|
|
26
|
-
success: "bg-success-subtle text-
|
|
27
|
-
warning: "bg-warning-subtle text-
|
|
28
|
-
info: "bg-info-subtle text-
|
|
27
|
+
destructive: "bg-destructive-subtle text-foreground border-destructive/30",
|
|
28
|
+
success: "bg-success-subtle text-foreground border-success/30",
|
|
29
|
+
warning: "bg-warning-subtle text-foreground border-warning/30",
|
|
30
|
+
info: "bg-info-subtle text-foreground border-info/30"
|
|
29
31
|
} },
|
|
30
32
|
defaultVariants: { variant: "default" }
|
|
31
33
|
});
|
|
@@ -36,6 +38,13 @@ var alertIcons = {
|
|
|
36
38
|
warning: TriangleAlert,
|
|
37
39
|
info: Info
|
|
38
40
|
};
|
|
41
|
+
var alertIconTones = {
|
|
42
|
+
default: "text-muted-foreground",
|
|
43
|
+
destructive: "text-destructive",
|
|
44
|
+
success: "text-success",
|
|
45
|
+
warning: "text-warning",
|
|
46
|
+
info: "text-info"
|
|
47
|
+
};
|
|
39
48
|
function Alert(props) {
|
|
40
49
|
const [local, rest] = splitProps(props, [
|
|
41
50
|
"class",
|
|
@@ -56,6 +65,7 @@ function Alert(props) {
|
|
|
56
65
|
insert(_el$2, () => local.icon ?? createComponent(Dynamic, { get component() {
|
|
57
66
|
return alertIcons[tone()];
|
|
58
67
|
} }));
|
|
68
|
+
effect(() => className(_el$2, cn("row-span-2 pt-0.5 [&_svg]:size-4", alertIconTones[tone()])));
|
|
59
69
|
return _el$2;
|
|
60
70
|
})();
|
|
61
71
|
})(), null);
|
|
@@ -78,7 +88,7 @@ function AlertDescription(props) {
|
|
|
78
88
|
return (() => {
|
|
79
89
|
var _el$4 = _tmpl$4();
|
|
80
90
|
spread(_el$4, mergeProps({ get ["class"]() {
|
|
81
|
-
return cn("col-start-2 text-sm
|
|
91
|
+
return cn("col-start-2 text-sm [&_p]:leading-relaxed", local.class);
|
|
82
92
|
} }, rest), false, false);
|
|
83
93
|
return _el$4;
|
|
84
94
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","names":["AlertCircle","CheckCircle2","Info","TriangleAlert","ComponentProps","JSX","splitProps","Dynamic","cva","VariantProps","cn","alertVariants","variants","variant","default","destructive","success","warning","info","defaultVariants","alertIcons","const","AlertVariantProps","AlertProps","icon","Element","Alert","props","local","rest","tone","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","_c$","_$memo","_el$2","_tmpl$2","_$createComponent","component","children","AlertTitle","_el$3","_tmpl$3","AlertDescription","_el$4","_tmpl$4","_$mergeProps","_$memo","_$createComponent"],"sources":["../../../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import { AlertCircle, CheckCircle2, Info, TriangleAlert } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Alert.\n *\n * A message about the whole surface it sits in — a form's validation summary,\n * a failed sync banner, a permission notice. It is deliberately not a dialog:\n * an alert that must be dismissed before the user can continue is a Dialog.\n *\n * The glyph follows the tone rather than being passed in, so an alert cannot\n * be given a green checkmark on a destructive fill. A caller that genuinely\n * needs a different icon passes `icon`; `icon={null}` removes it.\n */\nconst alertVariants = cva(\n 'relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 gap-y-1 rounded-lg border px-3 py-2.5 text-sm',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground border-border',\n destructive: 'bg-destructive-subtle text-
|
|
1
|
+
{"version":3,"file":"alert.js","names":["AlertCircle","CheckCircle2","Info","TriangleAlert","ComponentProps","JSX","splitProps","Dynamic","cva","VariantProps","cn","alertVariants","variants","variant","default","destructive","success","warning","info","defaultVariants","alertIcons","const","alertIconTones","AlertVariantProps","AlertProps","icon","Element","Alert","props","local","rest","tone","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","_c$","_$memo","_el$2","_tmpl$2","_$createComponent","component","_$effect","_$className","children","AlertTitle","_el$3","_tmpl$3","AlertDescription","_el$4","_tmpl$4","_$mergeProps","_$memo","_$createComponent","_$className"],"sources":["../../../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import { AlertCircle, CheckCircle2, Info, TriangleAlert } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Alert.\n *\n * A message about the whole surface it sits in — a form's validation summary,\n * a failed sync banner, a permission notice. It is deliberately not a dialog:\n * an alert that must be dismissed before the user can continue is a Dialog.\n *\n * The glyph follows the tone rather than being passed in, so an alert cannot\n * be given a green checkmark on a destructive fill. A caller that genuinely\n * needs a different icon passes `icon`; `icon={null}` removes it. Text stays on\n * the body foreground over the tinted status surface, while the glyph and edge\n * carry the status hue.\n */\nconst alertVariants = cva(\n 'relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 gap-y-1 rounded-lg border px-3 py-2.5 text-sm',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground border-border',\n destructive: 'bg-destructive-subtle text-foreground border-destructive/30',\n success: 'bg-success-subtle text-foreground border-success/30',\n warning: 'bg-warning-subtle text-foreground border-warning/30',\n info: 'bg-info-subtle text-foreground border-info/30',\n },\n },\n defaultVariants: { variant: 'default' },\n }\n)\n\nconst alertIcons = {\n default: Info,\n destructive: AlertCircle,\n success: CheckCircle2,\n warning: TriangleAlert,\n info: Info,\n} as const\n\nconst alertIconTones = {\n default: 'text-muted-foreground',\n destructive: 'text-destructive',\n success: 'text-success',\n warning: 'text-warning',\n info: 'text-info',\n} as const\n\ntype AlertVariantProps = VariantProps<typeof alertVariants>\n\nexport type AlertProps = ComponentProps<'div'> &\n AlertVariantProps & {\n /** Replace the tone's glyph with your own element. `null` removes it. */\n icon?: JSX.Element | null\n }\n\nexport function Alert(props: AlertProps) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'icon', 'children'])\n\n const tone = () => local.variant ?? 'default'\n\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(alertVariants({ variant: local.variant }), local.class)}\n {...rest}\n >\n {local.icon === null ? null : (\n <span\n data-slot=\"alert-icon\"\n class={cn('row-span-2 pt-0.5 [&_svg]:size-4', alertIconTones[tone()])}\n >\n {local.icon ?? <Dynamic component={alertIcons[tone()]} />}\n </span>\n )}\n {local.children}\n </div>\n )\n}\n\nexport function AlertTitle(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-title\"\n class={cn('col-start-2 font-medium tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function AlertDescription(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-description\"\n class={cn('col-start-2 text-sm [&_p]:leading-relaxed', local.class)}\n {...rest}\n />\n )\n}\n\nexport { alertVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAMW,gBAAgBH,IACpB,+GACA;CACEI,UAAU,EACRC,SAAS;EACPC,SAAS;EACTC,aAAa;EACbC,SAAS;EACTC,SAAS;EACTC,MAAM;CACR,EACF;CACAC,iBAAiB,EAAEN,SAAS,UAAU;AACxC,CACF;AAEA,IAAMO,aAAa;CACjBN,SAASZ;CACTa,aAAaf;CACbgB,SAASf;CACTgB,SAASd;CACTe,MAAMhB;AACR;AAEA,IAAMoB,iBAAiB;CACrBR,SAAS;CACTC,aAAa;CACbC,SAAS;CACTC,SAAS;CACTC,MAAM;AACR;AAUA,SAAgBS,MAAMC,OAAmB;CACvC,MAAM,CAACC,OAAOC,QAAQxB,WAAWsB,OAAO;EAAC;EAAS;EAAW;EAAQ;CAAU,CAAC;CAEhF,MAAMG,aAAaF,MAAMhB,WAAW;CAEpC,cAAA;EAAA,IAAAmB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AAI,GAAA,OAAA,KAAA;EAAA,OAAAqB;CAAA,EAAA,CAAA;AAGd"}
|
|
@@ -19,10 +19,10 @@ var badgeVariants = cva("inline-flex w-fit shrink-0 items-center justify-center
|
|
|
19
19
|
secondary: "bg-secondary text-secondary-foreground",
|
|
20
20
|
outline: "border-border text-foreground",
|
|
21
21
|
/** Tinted status fills, for counts and states rather than actions. */
|
|
22
|
-
success: "bg-success-subtle text-
|
|
23
|
-
warning: "bg-warning-subtle text-
|
|
24
|
-
destructive: "bg-destructive-subtle text-
|
|
25
|
-
info: "bg-info-subtle text-
|
|
22
|
+
success: "bg-success-subtle text-foreground",
|
|
23
|
+
warning: "bg-warning-subtle text-foreground",
|
|
24
|
+
destructive: "bg-destructive-subtle text-foreground",
|
|
25
|
+
info: "bg-info-subtle text-foreground",
|
|
26
26
|
subtle: "bg-primary-subtle text-primary"
|
|
27
27
|
},
|
|
28
28
|
size: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","names":["Polymorphic","PolymorphicProps","ComponentProps","splitProps","ValidComponent","cva","VariantProps","cn","badgeVariants","variants","variant","default","secondary","outline","success","warning","destructive","info","subtle","size","sm","md","lg","defaultVariants","BadgeVariantProps","BadgeProps","T","class","Badge","props","local","rest","_$createComponent","_$mergeProps","as","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/ui/badge/badge.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport { type ComponentProps, splitProps, type ValidComponent } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Badge.\n *\n * A short, non-interactive status label. If it can be clicked it is a Button\n * with `size=\"2xs\"`, not a Badge — the difference matters because a Badge\n * carries no focus or pressed state and must never be the only way to reach an\n * action.\n */\nexport const badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-md border border-transparent font-medium transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n outline: 'border-border text-foreground',\n /** Tinted status fills, for counts and states rather than actions. */\n success: 'bg-success-subtle text-
|
|
1
|
+
{"version":3,"file":"badge.js","names":["Polymorphic","PolymorphicProps","ComponentProps","splitProps","ValidComponent","cva","VariantProps","cn","badgeVariants","variants","variant","default","secondary","outline","success","warning","destructive","info","subtle","size","sm","md","lg","defaultVariants","BadgeVariantProps","BadgeProps","T","class","Badge","props","local","rest","_$createComponent","_$mergeProps","as","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/ui/badge/badge.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport { type ComponentProps, splitProps, type ValidComponent } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Badge.\n *\n * A short, non-interactive status label. If it can be clicked it is a Button\n * with `size=\"2xs\"`, not a Badge — the difference matters because a Badge\n * carries no focus or pressed state and must never be the only way to reach an\n * action.\n */\nexport const badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-md border border-transparent font-medium transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n outline: 'border-border text-foreground',\n /** Tinted status fills, for counts and states rather than actions. */\n success: 'bg-success-subtle text-foreground',\n warning: 'bg-warning-subtle text-foreground',\n destructive: 'bg-destructive-subtle text-foreground',\n info: 'bg-info-subtle text-foreground',\n subtle: 'bg-primary-subtle text-primary',\n },\n size: {\n sm: 'h-4 px-1.5 text-2xs',\n md: 'h-5 px-2 text-xs',\n lg: 'h-6 px-2.5 text-xs',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n)\n\ntype BadgeVariantProps = VariantProps<typeof badgeVariants>\n\nexport type BadgeProps<T extends ValidComponent = 'span'> = PolymorphicProps<\n T,\n BadgeVariantProps & { class?: string }\n>\n\nexport function Badge<T extends ValidComponent = 'span'>(props: BadgeProps<T>) {\n const [local, rest] = splitProps(props as BadgeProps, ['variant', 'size', 'class'])\n\n return (\n <Polymorphic\n as=\"span\"\n class={cn(badgeVariants({ variant: local.variant, size: local.size }), local.class)}\n {...(rest as ComponentProps<'span'>)}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAaQ,gBAAgBH,IAC3B,iNACA;CACEI,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,WAAW;GACXC,SAAS;;GAETC,SAAS;GACTC,SAAS;GACTC,aAAa;GACbC,MAAM;GACNC,QAAQ;EACV;EACAC,MAAM;GACJC,IAAI;GACJC,IAAI;GACJC,IAAI;EACN;CACF;CACAC,iBAAiB;EACfb,SAAS;EACTS,MAAM;CACR;AACF,CACF;AASA,SAAgBS,MAAyCC,OAAsB;CAC7E,MAAM,CAACC,OAAOC,QAAQ5B,WAAW0B,OAAqB;EAAC;EAAW;EAAQ;CAAO,CAAC;CAElF,OAAAG,gBACGhC,aAAWiC,WAAA;EACVC,IAAE;EAAA,KAAA,WAAA;GAAA,OACK3B,GAAGC,cAAc;IAAEE,SAASoB,MAAMpB;IAASS,MAAMW,MAAMX;GAAK,CAAC,GAAGW,MAAMH,KAAK;EAAC;CAAA,GAC9EI,IAA8B,CAAA;AAGzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/context-menu/context-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":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,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,GAAG,CAAC,kCAElF;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,UAAU,CAAC,kCAShG;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,UAAU,CAAC,kCAiBhG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
|
-
import { menuItem, menuLabel, menuSeparator, overlayMotion, overlaySurface } from "../../../lib/overlay.js";
|
|
2
|
+
import { destructiveMenuItem, menuItem, menuLabel, menuSeparator, overlayMotion, overlaySurface } from "../../../lib/overlay.js";
|
|
3
3
|
import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
|
|
4
4
|
import { Check, ChevronRight, Circle } from "lucide-solid";
|
|
5
5
|
import { splitProps } from "solid-js";
|
|
@@ -41,7 +41,7 @@ function ContextMenuItem(props) {
|
|
|
41
41
|
"children"
|
|
42
42
|
]);
|
|
43
43
|
return createComponent(ContextMenu.Item, mergeProps({ get ["class"]() {
|
|
44
|
-
return cn(menuItem, {
|
|
44
|
+
return cn(menuItem, { [destructiveMenuItem]: local.variant === "destructive" }, local.class);
|
|
45
45
|
} }, rest, { get children() {
|
|
46
46
|
return [memo(() => local.children), memo(() => memo(() => !!local.shortcut)() ? (() => {
|
|
47
47
|
var _el$ = _tmpl$();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","names":["ContextMenu","KobalteContextMenu","Check","ChevronRight","Circle","ComponentProps","splitProps","menuContentPadding","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","cn","props","_$createComponent","ContextMenuTrigger","Trigger","ContextMenuContent","Content","local","rest","Portal","children","_$mergeProps","class","ContextMenuItem","Item","variant","shortcut","_$memo","_el$","_tmpl$","_$insert","ContextMenuCheckboxItem","CheckboxItem","ItemIndicator","ContextMenuRadioGroup","RadioGroup","ContextMenuRadioItem","RadioItem","ContextMenuLabel","GroupLabel","ContextMenuGroup","Group","ContextMenuSeparator","Separator","ContextMenuSub","Sub","ContextMenuSubTrigger","SubTrigger","ContextMenuSubContent","SubContent","ContextMenu","_$createComponent","KobalteContextMenu","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/context-menu/context-menu.tsx"],"sourcesContent":["import { ContextMenu as KobalteContextMenu } from '@kobalte/core/context-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * ContextMenu.\n *\n * The same actions as DropdownMenu, opened by right-click. The trigger is the\n * region the menu belongs to — a file row, a canvas, a code block — and the\n * menu opens at the pointer.\n *\n * The accessibility rule for this component is not about its own markup: a\n * context menu must never hold the *only* route to an action, because a\n * right-click is unavailable on touch and undiscoverable on a trackpad. Every\n * item here should also appear somewhere reachable, usually a DropdownMenu on\n * the same row.\n */\nexport function ContextMenu(props: ComponentProps<typeof KobalteContextMenu>) {\n return <KobalteContextMenu {...props} />\n}\n\nexport function ContextMenuTrigger(props: ComponentProps<typeof KobalteContextMenu.Trigger>) {\n return <KobalteContextMenu.Trigger {...props} />\n}\n\nexport function ContextMenuContent(props: ComponentProps<typeof KobalteContextMenu.Content>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteContextMenu.Portal>\n <KobalteContextMenu.Content\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteContextMenu.Portal>\n )\n}\n\nexport function ContextMenuItem(\n props: ComponentProps<typeof KobalteContextMenu.Item> & {\n variant?: 'default' | 'destructive'\n shortcut?: string\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'shortcut', 'children'])\n\n return (\n <KobalteContextMenu.Item\n class={cn(\n menuItem,\n {\n
|
|
1
|
+
{"version":3,"file":"context-menu.js","names":["ContextMenu","KobalteContextMenu","Check","ChevronRight","Circle","ComponentProps","splitProps","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","cn","props","_$createComponent","ContextMenuTrigger","Trigger","ContextMenuContent","Content","local","rest","Portal","children","_$mergeProps","class","ContextMenuItem","Item","variant","shortcut","_$memo","_el$","_tmpl$","_$insert","ContextMenuCheckboxItem","CheckboxItem","ItemIndicator","ContextMenuRadioGroup","RadioGroup","ContextMenuRadioItem","RadioItem","ContextMenuLabel","GroupLabel","ContextMenuGroup","Group","ContextMenuSeparator","Separator","ContextMenuSub","Sub","ContextMenuSubTrigger","SubTrigger","ContextMenuSubContent","SubContent","ContextMenu","_$createComponent","KobalteContextMenu","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/context-menu/context-menu.tsx"],"sourcesContent":["import { ContextMenu as KobalteContextMenu } from '@kobalte/core/context-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * ContextMenu.\n *\n * The same actions as DropdownMenu, opened by right-click. The trigger is the\n * region the menu belongs to — a file row, a canvas, a code block — and the\n * menu opens at the pointer.\n *\n * The accessibility rule for this component is not about its own markup: a\n * context menu must never hold the *only* route to an action, because a\n * right-click is unavailable on touch and undiscoverable on a trackpad. Every\n * item here should also appear somewhere reachable, usually a DropdownMenu on\n * the same row.\n */\nexport function ContextMenu(props: ComponentProps<typeof KobalteContextMenu>) {\n return <KobalteContextMenu {...props} />\n}\n\nexport function ContextMenuTrigger(props: ComponentProps<typeof KobalteContextMenu.Trigger>) {\n return <KobalteContextMenu.Trigger {...props} />\n}\n\nexport function ContextMenuContent(props: ComponentProps<typeof KobalteContextMenu.Content>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteContextMenu.Portal>\n <KobalteContextMenu.Content\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteContextMenu.Portal>\n )\n}\n\nexport function ContextMenuItem(\n props: ComponentProps<typeof KobalteContextMenu.Item> & {\n variant?: 'default' | 'destructive'\n shortcut?: string\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'shortcut', 'children'])\n\n return (\n <KobalteContextMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span class=\"text-muted-foreground ms-auto font-mono text-2xs tracking-widest\">\n {local.shortcut}\n </span>\n ) : null}\n </KobalteContextMenu.Item>\n )\n}\n\nexport function ContextMenuCheckboxItem(\n props: ComponentProps<typeof KobalteContextMenu.CheckboxItem>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteContextMenu.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteContextMenu.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteContextMenu.ItemIndicator>\n </KobalteContextMenu.CheckboxItem>\n )\n}\n\nexport function ContextMenuRadioGroup(props: ComponentProps<typeof KobalteContextMenu.RadioGroup>) {\n return <KobalteContextMenu.RadioGroup {...props} />\n}\n\nexport function ContextMenuRadioItem(props: ComponentProps<typeof KobalteContextMenu.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteContextMenu.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteContextMenu.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </KobalteContextMenu.ItemIndicator>\n </KobalteContextMenu.RadioItem>\n )\n}\n\nexport function ContextMenuLabel(props: ComponentProps<typeof KobalteContextMenu.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteContextMenu.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function ContextMenuGroup(props: ComponentProps<typeof KobalteContextMenu.Group>) {\n return <KobalteContextMenu.Group {...props} />\n}\n\nexport function ContextMenuSeparator(props: ComponentProps<typeof KobalteContextMenu.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteContextMenu.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function ContextMenuSub(props: ComponentProps<typeof KobalteContextMenu.Sub>) {\n return <KobalteContextMenu.Sub {...props} />\n}\n\nexport function ContextMenuSubTrigger(props: ComponentProps<typeof KobalteContextMenu.SubTrigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteContextMenu.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteContextMenu.SubTrigger>\n )\n}\n\nexport function ContextMenuSubContent(props: ComponentProps<typeof KobalteContextMenu.SubContent>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteContextMenu.Portal>\n <KobalteContextMenu.SubContent\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteContextMenu.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BA,SAAgBA,cAAYe,OAAkD;CAC5E,OAAAC,gBAAQf,aAAuBc,KAAK;AACtC;AAEA,SAA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AAA,OAAQX,GAAGH,eAAeU,MAAMK,KAAK;CAAC,EAAA,GAAMJ,IAAI,CAAA;AACtF;AAEA,SAAgB0B,eAAejC,OAAsD;CACnF,OAAAC,gBAAQf,YAAmBgD,KAAQlC,KAAK;AAC1C;AAEA,SAAgBmC,sBAAsBnC,OAA6D;CACjG,MAAM,CAACM,OAAOC,QAAQhB,WAAWS,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,OAAAC,gBACGf,YAAmBkD,YAAU1B,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQX,GAAGL,UAAUY,MAAMK,KAAK;CAAC,EAAA,GAAMJ,MAAI,EAAA,IAAAE,WAAA;EAAA,OAAA,CAAAO,WACtEV,MAAMG,QAAQ,GAAAR,gBACdb,cAAY,EAAA,SAAA,iBAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAGnB;AAEA,SAAgBiD,sBAAsBrC,OAA6D;CACjG,MAAM,CAACM,OAAOC,QAAQhB,WAAWS,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGf,YAAmBsB,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAR,gBACvBf,YAAmBoD,YAAU5B,WAAA,EAAA,KAAA,WAAA;GAAA,OACrBX,GACLD,gBACAD,eACA,yFAAA,OAEAS,MAAMK,KACR;EAAC,EAAA,GACGJ,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { Dialog as KobalteDialog } from '@kobalte/core/dialog';
|
|
2
|
-
import type { ComponentProps, JSX } from 'solid-js';
|
|
2
|
+
import type { Accessor, ComponentProps, JSX } from 'solid-js';
|
|
3
|
+
type DialogFocusRestorationOptions = {
|
|
4
|
+
open: Accessor<boolean>;
|
|
5
|
+
restoreFocusRef?: Accessor<HTMLElement | undefined>;
|
|
6
|
+
onOpenAutoFocus?: ComponentProps<typeof KobalteDialog.Content>['onOpenAutoFocus'];
|
|
7
|
+
onCloseAutoFocus?: ComponentProps<typeof KobalteDialog.Content>['onCloseAutoFocus'];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Adds guarded opener capture and restoration to a Kobalte dialog content.
|
|
11
|
+
* Composed surfaces use this internal helper; it is omitted from the public
|
|
12
|
+
* dialog barrel so the restoration policy stays with the dialog components.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createDialogFocusRestoration({ open, restoreFocusRef, onOpenAutoFocus: callerOnOpenAutoFocus, onCloseAutoFocus: callerOnCloseAutoFocus, }: DialogFocusRestorationOptions): {
|
|
15
|
+
onOpenAutoFocus: (event: Event) => void;
|
|
16
|
+
onCloseAutoFocus: (event: Event) => void;
|
|
17
|
+
};
|
|
3
18
|
/**
|
|
4
19
|
* Dialog.
|
|
5
20
|
*
|
|
@@ -37,4 +52,5 @@ export declare function DialogCloseButton(props: ComponentProps<typeof KobalteDi
|
|
|
37
52
|
* a copied class string.
|
|
38
53
|
*/
|
|
39
54
|
export declare function DialogClose(props: ComponentProps<typeof KobalteDialog.CloseButton>): JSX.Element;
|
|
55
|
+
export {};
|
|
40
56
|
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAE9D,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAwC7D,KAAK,6BAA6B,GAAG;IACnC,IAAI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