@adea-ai/ui 0.99.2 → 0.99.4
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/workspace-mark/workspace-mark.d.ts.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +2 -2
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/conversation/message-row.d.ts.map +1 -1
- package/dist/components/conversation/message-row.js +2 -2
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/thread-panel.d.ts.map +1 -1
- package/dist/components/conversation/thread-panel.js +1 -1
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.js +8 -1
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.d.ts +8 -0
- package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js +8 -0
- package/dist/components/ui/context-menu/context-menu.js.map +1 -1
- package/dist/components/ui/drawer/drawer.d.ts +8 -1
- package/dist/components/ui/drawer/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +8 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +8 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/menubar/menubar.d.ts +8 -0
- package/dist/components/ui/menubar/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar/menubar.js +8 -0
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts +14 -2
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +28 -23
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/tabs/tabs.d.ts +6 -0
- package/dist/components/ui/tabs/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs/tabs.js +7 -1
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/toast/toast.d.ts.map +1 -1
- package/dist/components/ui/toast/toast.js +19 -6
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.js +1 -0
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/lib/version-notes.d.ts +6 -0
- package/dist/lib/version-notes.d.ts.map +1 -1
- package/dist/lib/version-notes.js +9 -1
- package/dist/lib/version-notes.js.map +1 -1
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +13 -2
- package/dist/r/src/components/conversation/message-row.tsx +6 -1
- package/dist/r/src/components/conversation/thread-panel.tsx +4 -1
- package/dist/r/src/components/ui/badge/badge.tsx +7 -0
- package/dist/r/src/components/ui/context-menu/context-menu.tsx +8 -0
- package/dist/r/src/components/ui/drawer/drawer.tsx +8 -1
- package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +8 -0
- package/dist/r/src/components/ui/menubar/menubar.tsx +8 -0
- package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +42 -28
- package/dist/r/src/components/ui/tabs/tabs.tsx +7 -1
- package/dist/r/src/components/ui/toast/toast.tsx +21 -6
- package/dist/r/src/components/ui/tooltip/tooltip.tsx +3 -0
- package/dist/r/src/lib/version-notes.ts +8 -0
- package/dist/r/src/styles/base.css +13 -0
- package/package.json +1 -1
- package/src/components/composites/workspace-mark/workspace-mark.tsx +13 -2
- package/src/components/conversation/message-row.tsx +6 -1
- package/src/components/conversation/thread-panel.tsx +4 -1
- package/src/components/ui/badge/badge.tsx +7 -0
- package/src/components/ui/context-menu/context-menu.tsx +8 -0
- package/src/components/ui/drawer/drawer.tsx +8 -1
- package/src/components/ui/dropdown-menu/dropdown-menu.tsx +8 -0
- package/src/components/ui/menubar/menubar.tsx +8 -0
- package/src/components/ui/navigation-menu/navigation-menu.tsx +42 -28
- package/src/components/ui/tabs/tabs.tsx +7 -1
- package/src/components/ui/toast/toast.tsx +21 -6
- package/src/components/ui/tooltip/tooltip.tsx +3 -0
- package/src/lib/version-notes.ts +8 -0
- package/src/styles/base.css +13 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-mark.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-mark/workspace-mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAKnD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG;IAC1D,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAA;IACZ,4BAA4B;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"workspace-mark.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-mark/workspace-mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAKnD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG;IAC1D,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAA;IACZ,4BAA4B;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,eAuDtD"}
|
|
@@ -3,9 +3,9 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "../../ui/tooltip/toolti
|
|
|
3
3
|
import { createComponent, insert, mergeProps, spread, template } from "solid-js/web";
|
|
4
4
|
import { Show, splitProps } from "solid-js";
|
|
5
5
|
//#region src/components/composites/workspace-mark/workspace-mark.tsx
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/ template(`<span class="absolute
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ template(`<span data-slot=workspace-mark-badge class="absolute end-0 top-0 flex translate-x-1/2 -translate-y-1/2 items-center justify-center rtl:-translate-x-1/2">`);
|
|
7
7
|
var _tmpl$2 = /*#__PURE__*/ template(`<button type=button>`);
|
|
8
|
-
var _tmpl$3 = /*#__PURE__*/ template(`<span aria-hidden=true>`);
|
|
8
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<span data-slot=workspace-mark-initial aria-hidden=true>`);
|
|
9
9
|
function WorkspaceMark(props) {
|
|
10
10
|
const [local, rest] = splitProps(props, [
|
|
11
11
|
"class",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-mark.js","names":["ComponentProps","JSX","Show","splitProps","cn","Tooltip","TooltipContent","TooltipTrigger","WorkspaceMarkProps","name","active","badge","Element","children","WorkspaceMark","props","local","rest","mark","_el$","_tmpl$2","_$spread","_$mergeProps","aria-label","aria-current","undefined","data-active","class","_$insert","_$createComponent","when","fallback","_el$3","_tmpl$3","charAt","toUpperCase","_el$2","_tmpl$","placement","as","_$mergeProps","_$createComponent"],"sources":["../../../../src/components/composites/workspace-mark/workspace-mark.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip/tooltip'\n\n/**\n * WorkspaceMark.\n *\n * The mark for one workspace in a rail: an initial or a glyph, a ring while it is\n * active, and a badge for something unread. It is deliberately not an `Avatar` —\n * a workspace is not a person, it does not need an image or initials derived from a\n * name, and a rail of them needs an *active* treatment an avatar does not have.\n *\n * The mark is square with a rounded corner rather than round, which is what\n * distinguishes a workspace from a person at a glance in a rail that holds both.\n */\nexport type WorkspaceMarkProps = ComponentProps<'button'> & {\n /** The workspace's name. Used for the label, the initial, and the tooltip. */\n name: string\n /** Draw the active ring. */\n active?: boolean\n /** A count or a dot, drawn at the corner. */\n badge?: JSX.Element\n /** Replace the initial with a glyph. */\n children?: JSX.Element\n}\n\nexport function WorkspaceMark(props: WorkspaceMarkProps) {\n const [local, rest] = splitProps(props, ['class', 'name', 'active', 'badge', 'children'])\n\n const mark = (\n <button\n type=\"button\"\n aria-label={local.name}\n aria-current={local.active ? 'true' : undefined}\n data-active={local.active ? '' : undefined}\n class={cn(\n 'relative flex size-9 shrink-0 items-center justify-center rounded-lg border text-sm font-semibold',\n 'transition-[color,background-color,border-color,transform] ease-out outline-none select-none',\n 'hover:scale-105 active:scale-95',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.active\n ? 'border-primary bg-primary-subtle text-primary'\n : 'border-border bg-card text-muted-foreground hover:text-foreground',\n local.class\n )}\n {...rest}\n >\n <Show\n when={local.children}\n fallback={<span aria-hidden=\"true\"
|
|
1
|
+
{"version":3,"file":"workspace-mark.js","names":["ComponentProps","JSX","Show","splitProps","cn","Tooltip","TooltipContent","TooltipTrigger","WorkspaceMarkProps","name","active","badge","Element","children","WorkspaceMark","props","local","rest","mark","_el$","_tmpl$2","_$spread","_$mergeProps","aria-label","aria-current","undefined","data-active","class","_$insert","_$createComponent","when","fallback","_el$3","_tmpl$3","charAt","toUpperCase","_el$2","_tmpl$","placement","as","_$mergeProps","_$createComponent"],"sources":["../../../../src/components/composites/workspace-mark/workspace-mark.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip/tooltip'\n\n/**\n * WorkspaceMark.\n *\n * The mark for one workspace in a rail: an initial or a glyph, a ring while it is\n * active, and a badge for something unread. It is deliberately not an `Avatar` —\n * a workspace is not a person, it does not need an image or initials derived from a\n * name, and a rail of them needs an *active* treatment an avatar does not have.\n *\n * The mark is square with a rounded corner rather than round, which is what\n * distinguishes a workspace from a person at a glance in a rail that holds both.\n */\nexport type WorkspaceMarkProps = ComponentProps<'button'> & {\n /** The workspace's name. Used for the label, the initial, and the tooltip. */\n name: string\n /** Draw the active ring. */\n active?: boolean\n /** A count or a dot, drawn at the corner. */\n badge?: JSX.Element\n /** Replace the initial with a glyph. */\n children?: JSX.Element\n}\n\nexport function WorkspaceMark(props: WorkspaceMarkProps) {\n const [local, rest] = splitProps(props, ['class', 'name', 'active', 'badge', 'children'])\n\n const mark = (\n <button\n type=\"button\"\n aria-label={local.name}\n aria-current={local.active ? 'true' : undefined}\n data-active={local.active ? '' : undefined}\n class={cn(\n 'relative flex size-9 shrink-0 items-center justify-center rounded-lg border text-sm font-semibold',\n 'transition-[color,background-color,border-color,transform] ease-out outline-none select-none',\n 'hover:scale-105 active:scale-95',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.active\n ? 'border-primary bg-primary-subtle text-primary'\n : 'border-border bg-card text-muted-foreground hover:text-foreground',\n local.class\n )}\n {...rest}\n >\n <Show\n when={local.children}\n fallback={\n <span data-slot=\"workspace-mark-initial\" aria-hidden=\"true\">\n {local.name.charAt(0).toUpperCase()}\n </span>\n }\n >\n {local.children}\n </Show>\n {/* The badge is centred on the corner rather than tucked inside it. Inset\n by an edge offset, a count badge is wider than the space between the\n corner and the monogram, so it sat on the letter; centred on the corner,\n a dot, a one-digit and a two-digit count all clear the letter's box. */}\n <Show when={local.badge}>\n <span\n data-slot=\"workspace-mark-badge\"\n class=\"absolute end-0 top-0 flex translate-x-1/2 -translate-y-1/2 items-center justify-center rtl:-translate-x-1/2\"\n >\n {local.badge}\n </span>\n </Show>\n </button>\n )\n\n return (\n <Tooltip placement=\"right\">\n <TooltipTrigger as=\"span\" class=\"contents\">\n {mark}\n </TooltipTrigger>\n <TooltipContent>{local.name}</TooltipContent>\n </Tooltip>\n )\n}\n"],"mappings":";;;;;;;;AA2BA,SAAgBc,cAAcC,OAA2B;CACvD,MAAM,CAACC,OAAOC,QAAQd,WAAWY,OAAO;EAAC;EAAS;EAAQ;EAAU;EAAS;CAAU,CAAC;CAExF,MAAMG,cAAI;EAAA,IAAAC,OAAAC,QAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,KAAA,gBAAA;IAAA,OAGMN,MAAMP;GAAI;GAAA,KAAA,kBAAA;IAAA,OACRO,MAAMN,SAAS,SAASe,KAAAA;GAAS;GAAA,KAAA,iBAAA;IAAA,OAClCT,MAAMN,SAAS,KAAKe,KAAAA;GAAS;GAAA,KAAA,WAAA;IAAA,OACnCrB,GACL,qGACA,gGACA,mCACA,oFACA,oDACAY,MAAMN,SACF,kDACA,qEACJM,MAAMW,KACR;GAAC;EAAA,GACGV,IAAI,GAAA,OAAA,IAAA;EAAAW,OAAAT,MAAAU,gBAEP3B,MAAI;GAAA,IACH4B,OAAI;IAAA,OAAEd,MAAMH;GAAQ;GAAA,IACpBkB,WAAQ;IAAA,cAAA;KAAA,IAAAC,QAAAC,QAAA;KAAAL,OAAAI,aAEHhB,MAAMP,KAAKyB,OAAO,CAAC,CAAC,CAACC,YAAY,CAAC;KAAA,OAAAH;IAAA,EAAA,CAAA;GAAA;GAAA,IAAAnB,WAAA;IAAA,OAItCG,MAAMH;GAAQ;EAAA,CAAA,GAAA,IA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ACnB,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB,kFAAkF;IAClF,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,gEAAgE;IAChE,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACrB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,eAiLhD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAOxD;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,eAgBjF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,
|
|
1
|
+
{"version":3,"file":"message-row.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message-row.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAKnD,OAAO,EAAsB,KA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AAE,cAAc,CAAC,KAAK,CAAC,eAOxD;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,eAgBjF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,eA2DF"}
|
|
@@ -298,7 +298,7 @@ function MessageBody(props) {
|
|
|
298
298
|
const segments = () => local.text.split(/(```[\s\S]*?(?:```|$))/g).filter(Boolean).map((segment) => {
|
|
299
299
|
if (!segment.startsWith("```")) return {
|
|
300
300
|
kind: "prose",
|
|
301
|
-
value: segment
|
|
301
|
+
value: segment.replace(/^\n+|\n+$/g, "")
|
|
302
302
|
};
|
|
303
303
|
const body = segment.replace(/^```/, "").replace(/```$/, "");
|
|
304
304
|
const newline = body.indexOf("\n");
|
|
@@ -309,7 +309,7 @@ function MessageBody(props) {
|
|
|
309
309
|
value: language ? body.slice(newline + 1) : body,
|
|
310
310
|
language
|
|
311
311
|
};
|
|
312
|
-
});
|
|
312
|
+
}).filter((segment) => segment.kind === "code" || segment.value !== "");
|
|
313
313
|
const last = () => segments().at(-1);
|
|
314
314
|
return (() => {
|
|
315
315
|
var _el$19 = _tmpl$11();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-row.js","names":["CheckCheck","MessageSquareReply","Pencil","RotateCcw","Trash2","ComponentProps","JSX","For","Show","splitProps","cn","Button","CodeBlock","InlineCode","ConversationAvatar","ConversationAvatarKind","MessageRowProps","Omit","senderKind","senderName","time","dateTime","edited","pending","streaming","deleted","highlighted","avatar","Element","attachments","link","actions","onOpenThread","onThreadIntent","onEdit","onDelete","onRetry","MessageRow","props","local","rest","mirrored","_el$","_tmpl$8","_el$2","firstChild","_el$3","nextSibling","_el$4","_el$5","_el$6","_el$9","_el$13","_$spread","_$mergeProps","data-message-kind","aria-busy","undefined","tabindex","class","_$insert","_$createComponent","kind","size","children","when","fallback","_tmpl$9","_el$7","_tmpl$","_el$8","_tmpl$2","_el$0","_tmpl$3","_$effect","_$setAttribute","_tmpl$4","_tmpl$5","_tmpl$6","_$memo","_el$12","_tmpl$7","variant","onClick","onPointerEnter","onFocus","_p$","_v$","_v$2","_v$3","_v$4","e","_$className","t","a","o","MessageGroup","_el$15","_tmpl$0","MessageDayDivider","label","_el$16","_tmpl$1","_el$17","_el$18","MessageBody","text","segments","split","filter","Boolean","map","segment","startsWith","const","value","body","replace","newline","indexOf","firstLine","slice","language","test","trim","last","at","_el$19","_tmpl$11","each","Prose","code","complete","_tmpl$10","parts","_el$21","_tmpl$12","part","endsWith","length","_$mergeProps","_$createComponent","_$setAttribute","_$memo","_$className"],"sources":["../../../src/components/conversation/message-row.tsx"],"sourcesContent":["import { CheckCheck, MessageSquareReply, Pencil, RotateCcw, Trash2 } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { For, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button/button'\nimport { CodeBlock, InlineCode } from '../ui/code-block'\nimport { ConversationAvatar, type ConversationAvatarKind } from './conversation-avatar'\n\n/**\n * MessageRow.\n *\n * One turn in a transcript: a speaker, a bubble, and the actions that apply to it.\n *\n * ## What it does not know\n *\n * It takes no domain types. A caller supplies the speaker's name, the timestamp, and\n * the body as children; attachments, a linked task and the action row are slots. That\n * is deliberate and it is the difference between a component a second application can\n * use and one that only fits the application it was written in — the first version of\n * this row was written against adea's message model and could not have been used by\n * cortana at all.\n *\n * ## The two things it does know\n *\n * **The speaker's own messages mirror.** A user's turn puts the avatar on the trailing\n * edge and the bubble on the leading one, so a transcript can be read as a\n * conversation rather than as a log. `senderKind` decides that, and it is the only\n * place the layout branches.\n *\n * **`content-visibility: auto`.** A transcript is the one list in an application that\n * can hold thousands of rows, and this lets the engine skip layout and paint for the\n * ones off screen. `contain-intrinsic-size` is what keeps the scrollbar honest while\n * it does — without it the scroll height collapses as rows are skipped and the\n * thumb jumps. Both are load-bearing rather than an optimisation to add later.\n */\nexport type MessageRowProps = Omit<ComponentProps<'article'>, 'onSelect'> & {\n /** Who spoke. Decides the mirroring and the avatar's tone. */\n senderKind: ConversationAvatarKind\n /** The speaker's name, announced with the message rather than drawn. */\n senderName: string\n /** An ISO timestamp, rendered by the caller's own formatter. */\n time?: string\n /** The machine-readable time, for `<time datetime>`. */\n dateTime?: string\n /** Set when the message has been edited after sending. */\n edited?: boolean\n /** Set while the message is in flight. */\n pending?: boolean\n /**\n * Set while tokens are still arriving. Shows a caret after the body and drops\n * the delivered tick; distinct from `pending`, which is the *sending* state of\n * a message the user wrote. A turn can be neither, either, or (briefly) both.\n */\n streaming?: boolean\n /** Set when the message has been deleted, which replaces the body. */\n deleted?: boolean\n /** Draw attention to this row, e.g. after arriving from a search result. */\n highlighted?: boolean\n /** The caller's own avatar content. Falls back to a glyph for the kind. */\n avatar?: JSX.Element\n /** Attachments, rendered under the body. */\n attachments?: JSX.Element\n /** A linked entity — a task, an artifact, a session — rendered under the body. */\n link?: JSX.Element\n /** Extra rows in the action strip, before the built-in ones. */\n actions?: JSX.Element\n /** Show the reply affordance. Omit it to hide the action. */\n onOpenThread?: () => void\n /** Fires on hover and focus of the reply affordance, for prefetching. */\n onThreadIntent?: () => void\n onEdit?: () => void\n onDelete?: () => void\n onRetry?: () => void\n}\n\nexport function MessageRow(props: MessageRowProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'senderKind',\n 'senderName',\n 'time',\n 'dateTime',\n 'edited',\n 'pending',\n 'streaming',\n 'deleted',\n 'highlighted',\n 'avatar',\n 'attachments',\n 'link',\n 'actions',\n 'onOpenThread',\n 'onThreadIntent',\n 'onEdit',\n 'onDelete',\n 'onRetry',\n 'children',\n ])\n\n const mirrored = () => local.senderKind === 'user'\n\n return (\n <article\n data-slot=\"message-row\"\n data-message-kind={local.senderKind}\n aria-busy={local.pending || undefined}\n tabindex={local.highlighted ? -1 : undefined}\n class={cn(\n 'group/message grid max-w-3xl gap-2.5 px-1 py-1.5',\n /* The row is skipped by the engine while off screen; the intrinsic size keeps\n the scroll height stable while that happens. */\n '[content-visibility:auto] [contain-intrinsic-size:auto_7rem]',\n mirrored() ? 'grid-cols-[minmax(0,1fr)_2rem]' : 'grid-cols-[1.9rem_minmax(0,1fr)]',\n 'transition-colors ease-out hover:bg-muted/45',\n local.highlighted && 'bg-primary-subtle shadow-[inset_3px_0_var(--primary)]',\n local.class\n )}\n {...rest}\n >\n <span data-slot=\"message-avatar\" class={cn('mt-0.5', mirrored() ? 'order-2' : 'order-1')}>\n <ConversationAvatar kind={local.senderKind} size={mirrored() ? 'lg' : 'md'}>\n {local.avatar}\n </ConversationAvatar>\n </span>\n\n <div\n data-slot=\"message-content\"\n class={cn('flex min-w-0 flex-col gap-1', mirrored() ? 'order-1' : 'order-2')}\n >\n <div\n data-slot=\"message-bubble\"\n class={cn(\n 'relative w-fit min-w-16 max-w-[min(100%,38rem)] rounded-lg border border-border px-3.5 pt-2.5 pb-2',\n 'bg-card text-card-foreground',\n /* The tail: a squared corner on the side the speaker sits, which is what\n makes a bubble read as belonging to one voice. */\n mirrored() ? 'rounded-ee-sm ms-auto' : 'rounded-es-sm'\n )}\n >\n {/* The name is announced with the message rather than drawn: a transcript\n that repeats every speaker's name in every bubble is one nobody reads. */}\n <span class=\"visually-hidden\">{local.senderName}</span>\n\n <div data-slot=\"message-body\" class=\"text-sm\">\n <Show\n when={!local.deleted}\n fallback={<p class=\"text-muted-foreground italic\">Message deleted</p>}\n >\n {local.children}\n </Show>\n </div>\n\n <Show when={local.attachments}>\n <div class=\"mt-2 flex flex-wrap gap-2\">{local.attachments}</div>\n </Show>\n\n <Show when={local.link}>\n <div class=\"mt-2\">{local.link}</div>\n </Show>\n\n <div\n data-slot=\"message-meta\"\n class=\"mt-1 flex items-center gap-2 text-2xs text-muted-foreground\"\n >\n <Show when={local.time}>\n <time datetime={local.dateTime}>{local.time}</time>\n </Show>\n <Show when={local.edited}>\n <span>edited</span>\n </Show>\n <Show when={local.pending}>\n <span role=\"status\">sending…</span>\n </Show>\n <Show when={local.streaming}>\n <span role=\"status\">responding…</span>\n </Show>\n <Show when={mirrored() && !local.pending && !local.streaming && !local.deleted}>\n {/*\n `role=\"img\"` because a bare span cannot carry `aria-label` — axe's\n `aria-prohibited-attr`. The glyph is the whole message, so the role\n is also the accurate one: this element *is* an image whose meaning\n is its label.\n */}\n <span role=\"img\" aria-label=\"Delivered\" class=\"inline-flex\">\n <CheckCheck aria-hidden=\"true\" class=\"size-3\" />\n </span>\n </Show>\n </div>\n </div>\n\n {/* The action strip is hidden until the row is hovered or focused, so a\n transcript is not a wall of buttons — but it stays in the accessibility\n tree and the tab order, because a control that only exists under the\n pointer cannot be reached by keyboard. */}\n <footer\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-hover/message:opacity-100 group-focus-within/message:opacity-100',\n mirrored() && 'justify-end'\n )}\n >\n <Show when={local.actions}>{local.actions}</Show>\n <Show when={local.onOpenThread && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onOpenThread?.()}\n onPointerEnter={() => local.onThreadIntent?.()}\n onFocus={() => local.onThreadIntent?.()}\n >\n <MessageSquareReply />\n Thread\n </Button>\n </Show>\n <Show when={local.onEdit && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onEdit?.()}\n >\n <Pencil />\n Edit\n </Button>\n </Show>\n <Show when={local.onDelete && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onDelete?.()}\n >\n <Trash2 />\n Delete\n </Button>\n </Show>\n <Show when={local.onRetry}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onRetry?.()}\n >\n <RotateCcw />\n Retry\n </Button>\n </Show>\n </footer>\n </div>\n </article>\n )\n}\n\n/**\n * A run of messages from the same speaker.\n *\n * Consecutive turns from one voice are a *paragraph*, and a transcript that repeats\n * the avatar and the name for each line reads as noise. The group draws the first\n * row fully and the rest without their avatar.\n */\nexport function MessageGroup(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div data-slot=\"message-group\" role=\"group\" class={cn('flex flex-col', local.class)} {...rest}>\n {local.children}\n </div>\n )\n}\n\n/** A day divider, so a long transcript has somewhere to rest the eye. */\nexport function MessageDayDivider(props: ComponentProps<'div'> & { label: string }) {\n const [local, rest] = splitProps(props, ['class', 'label'])\n return (\n <div\n data-slot=\"message-day-divider\"\n role=\"separator\"\n class={cn('flex items-center gap-3 px-4 py-3', local.class)}\n {...rest}\n >\n <span class=\"h-px flex-1 bg-border\" />\n <span class=\"text-2xs font-medium tracking-wide text-muted-foreground uppercase\">\n {local.label}\n </span>\n <span class=\"h-px flex-1 bg-border\" />\n </div>\n )\n}\n\n/**\n * Renders a body's code fences as blocks, which a plain `<p>` cannot.\n *\n * The fence grammar is the part worth owning: a fence opens with ``` and an\n * optional language, and closes with ``` on its own. Everything outside a fence\n * is prose, and inside it the language tag belongs to the block's header rather\n * than to the code.\n *\n * Inline code — a single backtick pair inside a line — is rendered too, because\n * the alternative is an identifier in the prose that is indistinguishable from a\n * word. Only the *first* pair on a line is treated as code by the splitter here,\n * which is the common case; a caller that needs full inline grammar should pass\n * already-rendered children instead of `text`.\n */\nexport function MessageBody(\n props: ComponentProps<'div'> & {\n text: string\n /** True while the turn is still streaming, so a partial fence renders as a block. */\n streaming?: boolean\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'text', 'streaming'])\n\n /**\n * Split on fences, then on inline code. `filter(Boolean)` because a text that\n * begins with a fence produces an empty leading segment.\n */\n const segments = () =>\n local.text\n .split(/(```[\\s\\S]*?(?:```|$))/g)\n .filter(Boolean)\n .map((segment) => {\n if (!segment.startsWith('```')) {\n return { kind: 'prose' as const, value: segment }\n }\n const body = segment.replace(/^```/, '').replace(/```$/, '')\n // The language is the first token on the opening line, and only when the\n // fence actually carried one — a fence with a bare newline has none.\n const newline = body.indexOf('\\n')\n const firstLine = newline === -1 ? '' : body.slice(0, newline)\n const language = /^[\\w+#.-]+$/.test(firstLine.trim()) ? firstLine.trim() : undefined\n return {\n kind: 'code' as const,\n value: language ? body.slice(newline + 1) : body,\n language,\n }\n })\n\n const last = () => segments().at(-1)\n\n return (\n <div data-slot=\"message-body\" class={cn('flex flex-col gap-2', local.class)} {...rest}>\n <For each={segments()}>\n {(segment) => (\n <Show when={segment.kind === 'code'} fallback={<Prose text={segment.value} />}>\n <CodeBlock\n code={segment.value}\n language={segment.kind === 'code' ? segment.language : undefined}\n complete={!local.streaming}\n />\n </Show>\n )}\n </For>\n {/*\n The caret trails the last segment, and only when that segment is prose: a\n streaming code block already carries its own generating indicator, and two\n of them on one turn read as two streams.\n */}\n <Show when={local.streaming && last()?.kind === 'prose'}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\n/**\n * A run of prose, with its inline code marked. The split is non-greedy and\n * requires a non-empty span, so an unmatched backtick stays a backtick rather\n * than swallowing the rest of the paragraph.\n */\nfunction Prose(props: { text: string }) {\n const parts = () => props.text.split(/(`[^`\\n]+`)/g).filter(Boolean)\n\n return (\n <p class=\"whitespace-pre-wrap\">\n <For each={parts()}>\n {(part) => (\n <Show\n when={part.startsWith('`') && part.endsWith('`') && part.length > 2}\n fallback={part}\n >\n <InlineCode>{part.slice(1, -1)}</InlineCode>\n </Show>\n )}\n </For>\n </p>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2EA,SAAgBqC,WAAWC,OAAw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;MAAS;MAAA,IAChE2E,WAAQ;OAAA,OAAE,CAAC7F,MAAMf;MAAS;KAAA,CAAA;IAAA;GAAA,CAAA;EAG/B,CAAA,GAAA,IAAA;EAAAoC,OAAAmE,QAAAlE,gBAOFrD,MAAI;GAAA,IAACyD,OAAI;IAAA,OAAEc,WAAA,CAAA,CAAAxC,MAAMf,SAAS,CAAA,CAAA,KAAIqG,KAAK,CAAC,EAAE/D,SAAS;GAAO;GAAA,IAAAE,WAAA;IAAA,OAAAqE,SAAA;GAAA;EAAA,CAAA,GAAA,IAAA;EAAA,OAAAN;CAAA,EAAA,CAAA;AAK7D;;;;;;AAOA,SAASG,MAAM5F,OAAyB;CACtC,MAAMgG,cAAchG,MAAMoE,KAAKE,MAAM,cAAc,CAAC,CAACC,OAAOC,OAAO;CAEnE,cAAA;EAAA,IAAAyB,SAAAC,SAAA;EAAA5E,OAAA2E,QAAA1E,gBAEKtD,KAAG;GAAA,IAAC0H,OAAI;IAAA,OAAEK,MAAM;GAAC;GAAAtE,WACdyE,SAAI5E,gBACHrD,MAAI;IAAA,IACHyD,OAAI;KAAA,OAAEc,WAAA,CAAA,EAAA0D,KAAKxB,WAAW,GAAG,KAAKwB,KAAKC,SAAS,GAAG,EAAC,CAAA,CAAA,KAAID,KAAKE,SAAS;IAAC;IACnEzE,UAAUuE;IAAI,IAAAzE,WAAA;KAAA,OAAAH,gBAEbhD,YAAU,EAAA,IAAAmD,WAAA;MAAA,OAAEyE,KAAKhB,MAAM,GAAG,EAAE;KAAC,EAAA,CAAA;IAAA;GAAA,CAAA;EAEjC,CAAA,CAAA;EAAA,OAAAc;CAAA,EAAA,CAAA;AAIT"}
|
|
1
|
+
{"version":3,"file":"message-row.js","names":["CheckCheck","MessageSquareReply","Pencil","RotateCcw","Trash2","ComponentProps","JSX","For","Show","splitProps","cn","Button","CodeBlock","InlineCode","ConversationAvatar","ConversationAvatarKind","MessageRowProps","Omit","senderKind","senderName","time","dateTime","edited","pending","streaming","deleted","highlighted","avatar","Element","attachments","link","actions","onOpenThread","onThreadIntent","onEdit","onDelete","onRetry","MessageRow","props","local","rest","mirrored","_el$","_tmpl$8","_el$2","firstChild","_el$3","nextSibling","_el$4","_el$5","_el$6","_el$9","_el$13","_$spread","_$mergeProps","data-message-kind","aria-busy","undefined","tabindex","class","_$insert","_$createComponent","kind","size","children","when","fallback","_tmpl$9","_el$7","_tmpl$","_el$8","_tmpl$2","_el$0","_tmpl$3","_$effect","_$setAttribute","_tmpl$4","_tmpl$5","_tmpl$6","_$memo","_el$12","_tmpl$7","variant","onClick","onPointerEnter","onFocus","_p$","_v$","_v$2","_v$3","_v$4","e","_$className","t","a","o","MessageGroup","_el$15","_tmpl$0","MessageDayDivider","label","_el$16","_tmpl$1","_el$17","_el$18","MessageBody","text","segments","split","filter","Boolean","map","segment","startsWith","const","value","replace","body","newline","indexOf","firstLine","slice","language","test","trim","last","at","_el$19","_tmpl$11","each","Prose","code","complete","_tmpl$10","parts","_el$21","_tmpl$12","part","endsWith","length","_$mergeProps","_$createComponent","_$setAttribute","_$memo","_$className"],"sources":["../../../src/components/conversation/message-row.tsx"],"sourcesContent":["import { CheckCheck, MessageSquareReply, Pencil, RotateCcw, Trash2 } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { For, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button/button'\nimport { CodeBlock, InlineCode } from '../ui/code-block'\nimport { ConversationAvatar, type ConversationAvatarKind } from './conversation-avatar'\n\n/**\n * MessageRow.\n *\n * One turn in a transcript: a speaker, a bubble, and the actions that apply to it.\n *\n * ## What it does not know\n *\n * It takes no domain types. A caller supplies the speaker's name, the timestamp, and\n * the body as children; attachments, a linked task and the action row are slots. That\n * is deliberate and it is the difference between a component a second application can\n * use and one that only fits the application it was written in — the first version of\n * this row was written against adea's message model and could not have been used by\n * cortana at all.\n *\n * ## The two things it does know\n *\n * **The speaker's own messages mirror.** A user's turn puts the avatar on the trailing\n * edge and the bubble on the leading one, so a transcript can be read as a\n * conversation rather than as a log. `senderKind` decides that, and it is the only\n * place the layout branches.\n *\n * **`content-visibility: auto`.** A transcript is the one list in an application that\n * can hold thousands of rows, and this lets the engine skip layout and paint for the\n * ones off screen. `contain-intrinsic-size` is what keeps the scrollbar honest while\n * it does — without it the scroll height collapses as rows are skipped and the\n * thumb jumps. Both are load-bearing rather than an optimisation to add later.\n */\nexport type MessageRowProps = Omit<ComponentProps<'article'>, 'onSelect'> & {\n /** Who spoke. Decides the mirroring and the avatar's tone. */\n senderKind: ConversationAvatarKind\n /** The speaker's name, announced with the message rather than drawn. */\n senderName: string\n /** An ISO timestamp, rendered by the caller's own formatter. */\n time?: string\n /** The machine-readable time, for `<time datetime>`. */\n dateTime?: string\n /** Set when the message has been edited after sending. */\n edited?: boolean\n /** Set while the message is in flight. */\n pending?: boolean\n /**\n * Set while tokens are still arriving. Shows a caret after the body and drops\n * the delivered tick; distinct from `pending`, which is the *sending* state of\n * a message the user wrote. A turn can be neither, either, or (briefly) both.\n */\n streaming?: boolean\n /** Set when the message has been deleted, which replaces the body. */\n deleted?: boolean\n /** Draw attention to this row, e.g. after arriving from a search result. */\n highlighted?: boolean\n /** The caller's own avatar content. Falls back to a glyph for the kind. */\n avatar?: JSX.Element\n /** Attachments, rendered under the body. */\n attachments?: JSX.Element\n /** A linked entity — a task, an artifact, a session — rendered under the body. */\n link?: JSX.Element\n /** Extra rows in the action strip, before the built-in ones. */\n actions?: JSX.Element\n /** Show the reply affordance. Omit it to hide the action. */\n onOpenThread?: () => void\n /** Fires on hover and focus of the reply affordance, for prefetching. */\n onThreadIntent?: () => void\n onEdit?: () => void\n onDelete?: () => void\n onRetry?: () => void\n}\n\nexport function MessageRow(props: MessageRowProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'senderKind',\n 'senderName',\n 'time',\n 'dateTime',\n 'edited',\n 'pending',\n 'streaming',\n 'deleted',\n 'highlighted',\n 'avatar',\n 'attachments',\n 'link',\n 'actions',\n 'onOpenThread',\n 'onThreadIntent',\n 'onEdit',\n 'onDelete',\n 'onRetry',\n 'children',\n ])\n\n const mirrored = () => local.senderKind === 'user'\n\n return (\n <article\n data-slot=\"message-row\"\n data-message-kind={local.senderKind}\n aria-busy={local.pending || undefined}\n tabindex={local.highlighted ? -1 : undefined}\n class={cn(\n 'group/message grid max-w-3xl gap-2.5 px-1 py-1.5',\n /* The row is skipped by the engine while off screen; the intrinsic size keeps\n the scroll height stable while that happens. */\n '[content-visibility:auto] [contain-intrinsic-size:auto_7rem]',\n mirrored() ? 'grid-cols-[minmax(0,1fr)_2rem]' : 'grid-cols-[1.9rem_minmax(0,1fr)]',\n 'transition-colors ease-out hover:bg-muted/45',\n local.highlighted && 'bg-primary-subtle shadow-[inset_3px_0_var(--primary)]',\n local.class\n )}\n {...rest}\n >\n <span data-slot=\"message-avatar\" class={cn('mt-0.5', mirrored() ? 'order-2' : 'order-1')}>\n <ConversationAvatar kind={local.senderKind} size={mirrored() ? 'lg' : 'md'}>\n {local.avatar}\n </ConversationAvatar>\n </span>\n\n <div\n data-slot=\"message-content\"\n class={cn('flex min-w-0 flex-col gap-1', mirrored() ? 'order-1' : 'order-2')}\n >\n <div\n data-slot=\"message-bubble\"\n class={cn(\n 'relative w-fit min-w-16 max-w-[min(100%,38rem)] rounded-lg border border-border px-3.5 pt-2.5 pb-2',\n 'bg-card text-card-foreground',\n /* The tail: a squared corner on the side the speaker sits, which is what\n makes a bubble read as belonging to one voice. */\n mirrored() ? 'rounded-ee-sm ms-auto' : 'rounded-es-sm'\n )}\n >\n {/* The name is announced with the message rather than drawn: a transcript\n that repeats every speaker's name in every bubble is one nobody reads. */}\n <span class=\"visually-hidden\">{local.senderName}</span>\n\n <div data-slot=\"message-body\" class=\"text-sm\">\n <Show\n when={!local.deleted}\n fallback={<p class=\"text-muted-foreground italic\">Message deleted</p>}\n >\n {local.children}\n </Show>\n </div>\n\n <Show when={local.attachments}>\n <div class=\"mt-2 flex flex-wrap gap-2\">{local.attachments}</div>\n </Show>\n\n <Show when={local.link}>\n <div class=\"mt-2\">{local.link}</div>\n </Show>\n\n <div\n data-slot=\"message-meta\"\n class=\"mt-1 flex items-center gap-2 text-2xs text-muted-foreground\"\n >\n <Show when={local.time}>\n <time datetime={local.dateTime}>{local.time}</time>\n </Show>\n <Show when={local.edited}>\n <span>edited</span>\n </Show>\n <Show when={local.pending}>\n <span role=\"status\">sending…</span>\n </Show>\n <Show when={local.streaming}>\n <span role=\"status\">responding…</span>\n </Show>\n <Show when={mirrored() && !local.pending && !local.streaming && !local.deleted}>\n {/*\n `role=\"img\"` because a bare span cannot carry `aria-label` — axe's\n `aria-prohibited-attr`. The glyph is the whole message, so the role\n is also the accurate one: this element *is* an image whose meaning\n is its label.\n */}\n <span role=\"img\" aria-label=\"Delivered\" class=\"inline-flex\">\n <CheckCheck aria-hidden=\"true\" class=\"size-3\" />\n </span>\n </Show>\n </div>\n </div>\n\n {/* The action strip is hidden until the row is hovered or focused, so a\n transcript is not a wall of buttons — but it stays in the accessibility\n tree and the tab order, because a control that only exists under the\n pointer cannot be reached by keyboard. */}\n <footer\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-hover/message:opacity-100 group-focus-within/message:opacity-100',\n mirrored() && 'justify-end'\n )}\n >\n <Show when={local.actions}>{local.actions}</Show>\n <Show when={local.onOpenThread && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onOpenThread?.()}\n onPointerEnter={() => local.onThreadIntent?.()}\n onFocus={() => local.onThreadIntent?.()}\n >\n <MessageSquareReply />\n Thread\n </Button>\n </Show>\n <Show when={local.onEdit && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onEdit?.()}\n >\n <Pencil />\n Edit\n </Button>\n </Show>\n <Show when={local.onDelete && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onDelete?.()}\n >\n <Trash2 />\n Delete\n </Button>\n </Show>\n <Show when={local.onRetry}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onRetry?.()}\n >\n <RotateCcw />\n Retry\n </Button>\n </Show>\n </footer>\n </div>\n </article>\n )\n}\n\n/**\n * A run of messages from the same speaker.\n *\n * Consecutive turns from one voice are a *paragraph*, and a transcript that repeats\n * the avatar and the name for each line reads as noise. The group draws the first\n * row fully and the rest without their avatar.\n */\nexport function MessageGroup(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div data-slot=\"message-group\" role=\"group\" class={cn('flex flex-col', local.class)} {...rest}>\n {local.children}\n </div>\n )\n}\n\n/** A day divider, so a long transcript has somewhere to rest the eye. */\nexport function MessageDayDivider(props: ComponentProps<'div'> & { label: string }) {\n const [local, rest] = splitProps(props, ['class', 'label'])\n return (\n <div\n data-slot=\"message-day-divider\"\n role=\"separator\"\n class={cn('flex items-center gap-3 px-4 py-3', local.class)}\n {...rest}\n >\n <span class=\"h-px flex-1 bg-border\" />\n <span class=\"text-2xs font-medium tracking-wide text-muted-foreground uppercase\">\n {local.label}\n </span>\n <span class=\"h-px flex-1 bg-border\" />\n </div>\n )\n}\n\n/**\n * Renders a body's code fences as blocks, which a plain `<p>` cannot.\n *\n * The fence grammar is the part worth owning: a fence opens with ``` and an\n * optional language, and closes with ``` on its own. Everything outside a fence\n * is prose, and inside it the language tag belongs to the block's header rather\n * than to the code.\n *\n * Inline code — a single backtick pair inside a line — is rendered too, because\n * the alternative is an identifier in the prose that is indistinguishable from a\n * word. Only the *first* pair on a line is treated as code by the splitter here,\n * which is the common case; a caller that needs full inline grammar should pass\n * already-rendered children instead of `text`.\n */\nexport function MessageBody(\n props: ComponentProps<'div'> & {\n text: string\n /** True while the turn is still streaming, so a partial fence renders as a block. */\n streaming?: boolean\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'text', 'streaming'])\n\n /**\n * Split on fences, then on inline code. `filter(Boolean)` because a text that\n * begins with a fence produces an empty leading segment.\n */\n const segments = () =>\n local.text\n .split(/(```[\\s\\S]*?(?:```|$))/g)\n .filter(Boolean)\n .map((segment) => {\n if (!segment.startsWith('```')) {\n // The newlines that separate prose from a fence belong to the fence\n // syntax. Kept, `whitespace-pre-wrap` draws them as blank lines on top\n // of the column gap, doubling the space beside every code block.\n return { kind: 'prose' as const, value: segment.replace(/^\\n+|\\n+$/g, '') }\n }\n const body = segment.replace(/^```/, '').replace(/```$/, '')\n // The language is the first token on the opening line, and only when the\n // fence actually carried one — a fence with a bare newline has none.\n const newline = body.indexOf('\\n')\n const firstLine = newline === -1 ? '' : body.slice(0, newline)\n const language = /^[\\w+#.-]+$/.test(firstLine.trim()) ? firstLine.trim() : undefined\n return {\n kind: 'code' as const,\n value: language ? body.slice(newline + 1) : body,\n language,\n }\n })\n // Newlines alone between two fences leave an empty paragraph once trimmed.\n .filter((segment) => segment.kind === 'code' || segment.value !== '')\n\n const last = () => segments().at(-1)\n\n return (\n <div data-slot=\"message-body\" class={cn('flex flex-col gap-2', local.class)} {...rest}>\n <For each={segments()}>\n {(segment) => (\n <Show when={segment.kind === 'code'} fallback={<Prose text={segment.value} />}>\n <CodeBlock\n code={segment.value}\n language={segment.kind === 'code' ? segment.language : undefined}\n complete={!local.streaming}\n />\n </Show>\n )}\n </For>\n {/*\n The caret trails the last segment, and only when that segment is prose: a\n streaming code block already carries its own generating indicator, and two\n of them on one turn read as two streams.\n */}\n <Show when={local.streaming && last()?.kind === 'prose'}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\n/**\n * A run of prose, with its inline code marked. The split is non-greedy and\n * requires a non-empty span, so an unmatched backtick stays a backtick rather\n * than swallowing the rest of the paragraph.\n */\nfunction Prose(props: { text: string }) {\n const parts = () => props.text.split(/(`[^`\\n]+`)/g).filter(Boolean)\n\n return (\n <p class=\"whitespace-pre-wrap\">\n <For each={parts()}>\n {(part) => (\n <Show\n when={part.startsWith('`') && part.endsWith('`') && part.length > 2}\n fallback={part}\n >\n <InlineCode>{part.slice(1, -1)}</InlineCode>\n </Show>\n )}\n </For>\n </p>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2EA,SAAgBqC,WAAWC,OAAwB;CACjD,MAAM,CAACC,OAAOC,QAAQ/B,WAAW6B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,MAAMG,iBAAiBF,MAAMrB,eAAe;CAE5C,cAAA;EAAA,IAAAwB,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAG,aAAAC,QAAAF,MAAAD,YAAAI,QAAAD,MAAAH,YAAAK,QAAAD,MAAAF,aAAAI,QAAAD,MAAAH,aAAAK,SAAAJ,MAAAD;EAAAM,OAAAX,MAAAY,WAAA;GAAA,KAAA,uBAAA;IAAA,OAGuBf,MAAMrB;GAAU;GAAA,KAAA,eAAA;IAAA,OACxBqB,MAAMhB,WAAWkC,KAAAA;GAAS;GAAA,IACrCC,WAAQ;IAAA,OAAEnB,MAAMb,cAAc,KAAK+B,KAAAA;GAAS;GAAA,KAAA,WAAA;IAAA,OACrC/C,GACL,oDAGA,gEACA+B,SAAS,IAAI,mCAAmC,oCAChD,gDACAF,MAAMb,eAAe,yDACrBa,MAAMoB,KACR;GAAC;EAAA,GACGnB,IAAI,GAAA,OAAA,IAAA;EAAAoB,OAAAhB,OAAAiB,gBAGL/C,oBAAkB;GAAA,IAACgD,OAAI;IAAA,OAAEvB,MAAMrB;GAAU;GAAA,IAAE6C,OAAI;IAAA,OAAEtB,SAAS,IAAI,OAAO;GAAI;GAAA,IAAAuB,WAAA;IAAA,OACvEzB,MAA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bhD,YAAU,EAAA,IAAAmD,WAAA;MAAA,OAAEyE,KAAKhB,MAAM,GAAG,EAAE;KAAC,EAAA,CAAA;IAAA;GAAA,CAAA;EAEjC,CAAA,CAAA;EAAA,OAAAc;CAAA,EAAA,CAAA;AAIT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-panel.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/thread-panel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAMnD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG;IACvD,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iDAAiD;IACjD,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACtB,iFAAiF;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"thread-panel.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/thread-panel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAMnD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG;IACvD,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iDAAiD;IACjD,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACtB,iFAAiF;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAuElD;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eA4BxD"}
|
|
@@ -8,7 +8,7 @@ import { Show, splitProps } from "solid-js";
|
|
|
8
8
|
var _tmpl$ = /*#__PURE__*/ template(`<span class="text-muted-foreground text-2xs"> `);
|
|
9
9
|
var _tmpl$2 = /*#__PURE__*/ template(`<div class="bg-muted/40 shrink-0 border-b border-border px-3 py-2">`);
|
|
10
10
|
var _tmpl$3 = /*#__PURE__*/ template(`<div class="shrink-0 border-t border-border p-2">`);
|
|
11
|
-
var _tmpl$4 = /*#__PURE__*/ template(`<aside data-slot=thread-panel><header class="flex h-topbar shrink-0 items-center gap-2 border-b border-border px-3"><div class="flex min-w-0 flex-col"><span class="truncate text-sm font-semibold tracking-tight">Thread</span></div><div class="ms-auto flex shrink-0 items-center gap-1"></div></header><div class="min-h-0 flex-1 overflow-y-auto overscroll-contain"role=region aria-label="Thread replies"tabindex=0>`);
|
|
11
|
+
var _tmpl$4 = /*#__PURE__*/ template(`<aside data-slot=thread-panel><header class="flex h-topbar shrink-0 items-center gap-2 border-b border-border px-3"><div class="flex min-w-0 flex-col"><span class="truncate text-sm font-semibold tracking-tight">Thread</span></div><div class="ms-auto flex shrink-0 items-center gap-1"></div></header><div class="min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 py-2"role=region aria-label="Thread replies"tabindex=0>`);
|
|
12
12
|
var _tmpl$5 = /*#__PURE__*/ template(`<span class="text-muted-foreground truncate text-2xs">`);
|
|
13
13
|
var _tmpl$6 = /*#__PURE__*/ template(`<button type=button><span class="flex min-w-0 flex-col"><span class="truncate text-xs font-medium">`);
|
|
14
14
|
function ThreadPanel(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-panel.js","names":["X","ComponentProps","JSX","Show","splitProps","cn","Button","Tooltip","TooltipContent","TooltipTrigger","ThreadPanelProps","label","count","root","Element","composer","headerActions","onClose","ThreadPanel","props","local","rest","_el$","_tmpl$4","_el$2","firstChild","_el$3","_el$4","_el$7","nextSibling","_el$9","_$spread","_$mergeProps","aria-label","class","_$insert","_$createComponent","when","undefined","children","_el$5","_tmpl$","_el$6","as","variant","size","onClick","_el$8","_tmpl$2","_el$0","_tmpl$3","AttachmentCardProps","name","detail","unavailable","icon","AttachmentCard","_el$1","_tmpl$6","_el$10","_el$11","disabled","_el$12","_tmpl$5","_$mergeProps","_$createComponent"],"sources":["../../../src/components/conversation/thread-panel.tsx"],"sourcesContent":["import { X } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button/button'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip/tooltip'\n\n/**\n * ThreadPanel.\n *\n * The replies to one message, shown beside the transcript rather than in it. Keeping\n * a thread out of the main flow is what stops a busy side conversation from burying\n * the conversation everyone is having.\n *\n * The root message is repeated at the top — with `pinned` — because a thread read out\n * of context is a set of answers to a question the reader can no longer see.\n *\n * The panel is a `complementary` landmark with a label, so it is reachable by\n * landmark navigation rather than by tabbing through the transcript to find it.\n */\nexport type ThreadPanelProps = ComponentProps<'aside'> & {\n /** The thread's title, usually the root message's author. */\n label: string\n /** A count of replies, shown beside the label. */\n count?: number\n /** The root message, drawn above the replies. */\n root?: JSX.Element\n /** The composer for a reply. */\n composer?: JSX.Element\n /** Host actions, such as marking the thread unread, before the close control. */\n headerActions?: JSX.Element\n onClose?: () => void\n}\n\nexport function ThreadPanel(props: ThreadPanelProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'count',\n 'root',\n 'composer',\n 'headerActions',\n 'onClose',\n 'children',\n ])\n\n return (\n <aside\n data-slot=\"thread-panel\"\n aria-label={`Thread: ${local.label}`}\n class={cn(\n 'bg-surface flex h-full w-96 max-w-full shrink-0 flex-col border-s border-border',\n local.class\n )}\n {...rest}\n >\n <header class=\"flex h-topbar shrink-0 items-center gap-2 border-b border-border px-3\">\n <div class=\"flex min-w-0 flex-col\">\n <span class=\"truncate text-sm font-semibold tracking-tight\">Thread</span>\n <Show when={local.count !== undefined}>\n <span class=\"text-muted-foreground text-2xs\">\n {local.count} {local.count === 1 ? 'reply' : 'replies'}\n </span>\n </Show>\n </div>\n <div class=\"ms-auto flex shrink-0 items-center gap-1\">\n {local.headerActions}\n <Show when={local.onClose}>\n <Tooltip>\n <TooltipTrigger\n as={Button}\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Close thread\"\n onClick={() => local.onClose?.()}\n >\n <X />\n </TooltipTrigger>\n <TooltipContent>Close thread</TooltipContent>\n </Tooltip>\n </Show>\n </div>\n </header>\n\n <Show when={local.root}>\n <div class=\"bg-muted/40 shrink-0 border-b border-border px-3 py-2\">{local.root}</div>\n </Show>\n\n <div\n class=\"min-h-0 flex-1 overflow-y-auto overscroll-contain\"\n role=\"region\"\n aria-label=\"Thread replies\"\n tabindex=\"0\"\n >\n {local.children}\n </div>\n\n <Show when={local.composer}>\n <div class=\"shrink-0 border-t border-border p-2\">{local.composer}</div>\n </Show>\n </aside>\n )\n}\n\n/**\n * An attachment card.\n *\n * A file is not a link: the reader wants to know what it is and how big it is before\n * deciding to open it, so the media type and size are on the card rather than behind\n * a click. `unavailable` is a real state — an artifact can be deleted, or live on a\n * device this one is not authorized for — and it is drawn as text rather than as a\n * dead link.\n */\nexport type AttachmentCardProps = ComponentProps<'button'> & {\n name: string\n /** A short description of the type and size, e.g. \"image/png · 24,120 bytes\". */\n detail?: string\n /** Draw the card as unavailable, with the reason as the detail. */\n unavailable?: boolean\n icon?: JSX.Element\n}\n\nexport function AttachmentCard(props: AttachmentCardProps) {\n const [local, rest] = splitProps(props, ['class', 'name', 'detail', 'unavailable', 'icon'])\n\n return (\n <button\n type=\"button\"\n disabled={local.unavailable}\n class={cn(\n 'flex max-w-64 items-center gap-2.5 rounded-md border border-border bg-surface-sunken px-2.5 py-2 text-start',\n 'transition-colors ease-out outline-none',\n local.unavailable\n ? 'cursor-not-allowed opacity-60'\n : 'hover:border-input hover:bg-surface-hover',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n '[&_svg]:size-4 [&_svg]:shrink-0',\n local.class\n )}\n {...rest}\n >\n {local.icon}\n <span class=\"flex min-w-0 flex-col\">\n <span class=\"truncate text-xs font-medium\">{local.name}</span>\n <Show when={local.detail}>\n <span class=\"text-muted-foreground truncate text-2xs\">{local.detail}</span>\n </Show>\n </span>\n </button>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,SAAgBkB,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQjB,WAAWe,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,cAAA;EAAA,IAAAG,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAC;EAAAC,MAAAD;EAAA,IAAAG,QAAAF,MAAAG,aAAAC,QAAAN,MAAAK;EAAAE,OAAAT,MAAAU,WAAA;GAAA,KAAA,gBAAA;IAAA,OAGgB,WAAWZ,MAAMT;GAAO;GAAA,KAAA,WAAA;IAAA,OAC7BN,GACL,mFACAe,MAAMc,KACR;GAAC;EAAA,GACGb,IAAI,GAAA,OAAA,IAAA;EAAAc,OAAAT,OAAAU,gBAKHjC,MAAI;GAAA,IAACkC,OAAI;IAAA,OAAEjB,MAAMR,UAAU0B,KAAAA;GAAS;GAAA,IAAAC,WAAA;IAAA,IAAAC,QAAAC,OAAA,GAAAC,QAAAF,MAAAf;IAAAU,OAAAK,aAEhCpB,MAAMR,OAAK8B,KAAA;IAAAP,OAAAK,aAAGpB,MAAMR,UAAU,IAAI,UAAU,WAAS,IAAA;IAAA,OAAA4B;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAL,OAAAP,aAKzDR,MAAMJ,eAAa,IAAA;EAAAmB,OAAAP,OAAAQ,gBACnBjC,MAAI;GAAA,IAACkC,OAAI;IAAA,OAAEjB,MAAMH;GAAO;GAAA,IAAAsB,WAAA;IAAA,OAAAH,gBACtB7B,SAAO,EAAA,IAAAgC,WAAA;KAAA,OAAA,CAAAH,gBACL3B,gBAAc;MACbkC,IAAIrC;MACJsC,SAAO;MACPC,MAAI;MAAA,cAAA;MAEJC,eAAe1B,MAAMH,UAAU;MAAC,IAAAsB,WAAA;OAAA,OAAAH,gBAE/BpC,GAAC,CAAA,CAAA;MAAA;KAAA,CAAA,GAAAoC,gBAEH5B,gBAAc,EAAA+B,UAAA,eAAA,CAAA,CAAA;IAAA,EAAA,CAAA;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAJ,OAAAb,MAAAc,gBAMtBjC,MAAI;GAAA,IAACkC,OAAI;IAAA,OAAEjB,MAAMP;GAAI;GAAA,IAAA0B,WAAA;IAAA,IAAAQ,QAAAC,QAAA;IAAAb,OAAAY,aACgD3B,MAAMP,IAAI;IAAA,OAAAkC;GAAA;EAAA,CAAA,GAAAjB,KAAA;EAAAK,OAAAL,
|
|
1
|
+
{"version":3,"file":"thread-panel.js","names":["X","ComponentProps","JSX","Show","splitProps","cn","Button","Tooltip","TooltipContent","TooltipTrigger","ThreadPanelProps","label","count","root","Element","composer","headerActions","onClose","ThreadPanel","props","local","rest","_el$","_tmpl$4","_el$2","firstChild","_el$3","_el$4","_el$7","nextSibling","_el$9","_$spread","_$mergeProps","aria-label","class","_$insert","_$createComponent","when","undefined","children","_el$5","_tmpl$","_el$6","as","variant","size","onClick","_el$8","_tmpl$2","_el$0","_tmpl$3","AttachmentCardProps","name","detail","unavailable","icon","AttachmentCard","_el$1","_tmpl$6","_el$10","_el$11","disabled","_el$12","_tmpl$5","_$mergeProps","_$createComponent"],"sources":["../../../src/components/conversation/thread-panel.tsx"],"sourcesContent":["import { X } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button/button'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip/tooltip'\n\n/**\n * ThreadPanel.\n *\n * The replies to one message, shown beside the transcript rather than in it. Keeping\n * a thread out of the main flow is what stops a busy side conversation from burying\n * the conversation everyone is having.\n *\n * The root message is repeated at the top — with `pinned` — because a thread read out\n * of context is a set of answers to a question the reader can no longer see.\n *\n * The panel is a `complementary` landmark with a label, so it is reachable by\n * landmark navigation rather than by tabbing through the transcript to find it.\n */\nexport type ThreadPanelProps = ComponentProps<'aside'> & {\n /** The thread's title, usually the root message's author. */\n label: string\n /** A count of replies, shown beside the label. */\n count?: number\n /** The root message, drawn above the replies. */\n root?: JSX.Element\n /** The composer for a reply. */\n composer?: JSX.Element\n /** Host actions, such as marking the thread unread, before the close control. */\n headerActions?: JSX.Element\n onClose?: () => void\n}\n\nexport function ThreadPanel(props: ThreadPanelProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'count',\n 'root',\n 'composer',\n 'headerActions',\n 'onClose',\n 'children',\n ])\n\n return (\n <aside\n data-slot=\"thread-panel\"\n aria-label={`Thread: ${local.label}`}\n class={cn(\n 'bg-surface flex h-full w-96 max-w-full shrink-0 flex-col border-s border-border',\n local.class\n )}\n {...rest}\n >\n <header class=\"flex h-topbar shrink-0 items-center gap-2 border-b border-border px-3\">\n <div class=\"flex min-w-0 flex-col\">\n <span class=\"truncate text-sm font-semibold tracking-tight\">Thread</span>\n <Show when={local.count !== undefined}>\n <span class=\"text-muted-foreground text-2xs\">\n {local.count} {local.count === 1 ? 'reply' : 'replies'}\n </span>\n </Show>\n </div>\n <div class=\"ms-auto flex shrink-0 items-center gap-1\">\n {local.headerActions}\n <Show when={local.onClose}>\n <Tooltip>\n <TooltipTrigger\n as={Button}\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Close thread\"\n onClick={() => local.onClose?.()}\n >\n <X />\n </TooltipTrigger>\n <TooltipContent>Close thread</TooltipContent>\n </Tooltip>\n </Show>\n </div>\n </header>\n\n <Show when={local.root}>\n <div class=\"bg-muted/40 shrink-0 border-b border-border px-3 py-2\">{local.root}</div>\n </Show>\n\n {/* The replies carry their own inline padding: a row brings only `px-1`, so\n a bubble at its widest otherwise meets the panel's edge. `px-2` plus the\n row's `px-1` lands on the `px-3` line the header and root use. */}\n <div\n class=\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 py-2\"\n role=\"region\"\n aria-label=\"Thread replies\"\n tabindex=\"0\"\n >\n {local.children}\n </div>\n\n <Show when={local.composer}>\n <div class=\"shrink-0 border-t border-border p-2\">{local.composer}</div>\n </Show>\n </aside>\n )\n}\n\n/**\n * An attachment card.\n *\n * A file is not a link: the reader wants to know what it is and how big it is before\n * deciding to open it, so the media type and size are on the card rather than behind\n * a click. `unavailable` is a real state — an artifact can be deleted, or live on a\n * device this one is not authorized for — and it is drawn as text rather than as a\n * dead link.\n */\nexport type AttachmentCardProps = ComponentProps<'button'> & {\n name: string\n /** A short description of the type and size, e.g. \"image/png · 24,120 bytes\". */\n detail?: string\n /** Draw the card as unavailable, with the reason as the detail. */\n unavailable?: boolean\n icon?: JSX.Element\n}\n\nexport function AttachmentCard(props: AttachmentCardProps) {\n const [local, rest] = splitProps(props, ['class', 'name', 'detail', 'unavailable', 'icon'])\n\n return (\n <button\n type=\"button\"\n disabled={local.unavailable}\n class={cn(\n 'flex max-w-64 items-center gap-2.5 rounded-md border border-border bg-surface-sunken px-2.5 py-2 text-start',\n 'transition-colors ease-out outline-none',\n local.unavailable\n ? 'cursor-not-allowed opacity-60'\n : 'hover:border-input hover:bg-surface-hover',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n '[&_svg]:size-4 [&_svg]:shrink-0',\n local.class\n )}\n {...rest}\n >\n {local.icon}\n <span class=\"flex min-w-0 flex-col\">\n <span class=\"truncate text-xs font-medium\">{local.name}</span>\n <Show when={local.detail}>\n <span class=\"text-muted-foreground truncate text-2xs\">{local.detail}</span>\n </Show>\n </span>\n </button>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,SAAgBkB,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQjB,WAAWe,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,cAAA;EAAA,IAAAG,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAC;EAAAC,MAAAD;EAAA,IAAAG,QAAAF,MAAAG,aAAAC,QAAAN,MAAAK;EAAAE,OAAAT,MAAAU,WAAA;GAAA,KAAA,gBAAA;IAAA,OAGgB,WAAWZ,MAAMT;GAAO;GAAA,KAAA,WAAA;IAAA,OAC7BN,GACL,mFACAe,MAAMc,KACR;GAAC;EAAA,GACGb,IAAI,GAAA,OAAA,IAAA;EAAAc,OAAAT,OAAAU,gBAKHjC,MAAI;GAAA,IAACkC,OAAI;IAAA,OAAEjB,MAAMR,UAAU0B,KAAAA;GAAS;GAAA,IAAAC,WAAA;IAAA,IAAAC,QAAAC,OAAA,GAAAC,QAAAF,MAAAf;IAAAU,OAAAK,aAEhCpB,MAAMR,OAAK8B,KAAA;IAAAP,OAAAK,aAAGpB,MAAMR,UAAU,IAAI,UAAU,WAAS,IAAA;IAAA,OAAA4B;G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AmC,SAAAD,OAAAlC;EAAAM,OAAA0B,OAAAzB,WAAA;GAAA,IAGI6B,WAAQ;IAAA,OAAEzC,MAAMkC;GAAW;GAAA,KAAA,WAAA;IAAA,OACpBjD,GACL,+GACA,2CACAe,MAAMkC,cACF,kCACA,6CACJ,oFACA,mCACAlC,MAAMc,KACR;GAAC;EAAA,GACGb,IAAI,GAAA,OAAA,IAAA;EAAAc,OAAAsB,aAEPrC,MAAMmC,MAAII,MAAA;EAAAxB,OAAAyB,cAEmCxC,MAAMgC,IAAI;EAAAjB,OAAAwB,QAAAvB,gBACrDjC,MAAI;GAAA,IAACkC,OAAI;IAAA,OAAEjB,MAAMiC;GAAM;GAAA,IAAAd,WAAA;IAAA,IAAAuB,SAAAC,QAAA;IAAA5B,OAAA2B,cACiC1C,MAAMiC,MAAM;IAAA,OAAAS;GAAA;EAAA,CAAA,GAAA,IAAA;EAAA,OAAAL;CAAA,EAAA,CAAA;AAK7E"}
|
|
@@ -10,7 +10,7 @@ import { type VariantProps } from '#lib/variants';
|
|
|
10
10
|
* action.
|
|
11
11
|
*/
|
|
12
12
|
export declare const badgeVariants: (props?: ({
|
|
13
|
-
variant?: "default" | "destructive" | "success" | "warning" | "info" | "outline" | "secondary" | "subtle" | null | undefined;
|
|
13
|
+
variant?: "default" | "destructive" | "success" | "warning" | "info" | "outline" | "secondary" | "subtle" | "notification" | null | undefined;
|
|
14
14
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
15
15
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
16
|
type BadgeVariantProps = VariantProps<typeof badgeVariants>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAmC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAmC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;8EAiCzB,CAAA;AAED,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAE3D,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,cAAc,GAAG,MAAM,IAAI,gBAAgB,CAC1E,CAAC,EACD,iBAAiB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CACvC,CAAA;AAED,wBAAgB,KAAK,CAAC,CAAC,SAAS,cAAc,GAAG,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,kCAU5E"}
|
|
@@ -23,7 +23,14 @@ var badgeVariants = cva("inline-flex w-fit shrink-0 items-center justify-center
|
|
|
23
23
|
warning: "bg-warning-subtle text-foreground",
|
|
24
24
|
destructive: "bg-destructive-subtle text-foreground",
|
|
25
25
|
info: "bg-info-subtle text-foreground",
|
|
26
|
-
subtle: "bg-primary-subtle text-primary"
|
|
26
|
+
subtle: "bg-primary-subtle text-primary",
|
|
27
|
+
/**
|
|
28
|
+
* A count that asks for attention, pinned to a corner of another control
|
|
29
|
+
* (a workspace mark, a rail icon). At `sm` it is a 2xs label on whatever
|
|
30
|
+
* surface sits behind the corner, where the destructive tint all but
|
|
31
|
+
* disappears — so it takes the solid, contrast-measured action fill.
|
|
32
|
+
*/
|
|
33
|
+
notification: "bg-destructive-action text-destructive-action-foreground"
|
|
27
34
|
},
|
|
28
35
|
size: {
|
|
29
36
|
sm: "h-4 px-1.5 text-2xs",
|
|
@@ -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-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;
|
|
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","notification","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 * A count that asks for attention, pinned to a corner of another control\n * (a workspace mark, a rail icon). At `sm` it is a 2xs label on whatever\n * surface sits behind the corner, where the destructive tint all but\n * disappears — so it takes the solid, contrast-measured action fill.\n */\n notification: 'bg-destructive-action text-destructive-action-foreground',\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;;;;;;;GAORC,cAAc;EAChB;EACAC,MAAM;GACJC,IAAI;GACJC,IAAI;GACJC,IAAI;EACN;CACF;CACAC,iBAAiB;EACfd,SAAS;EACTU,MAAM;CACR;AACF,CACF;AASA,SAAgBS,MAAyCC,OAAsB;CAC7E,MAAM,CAACC,OAAOC,QAAQ7B,WAAW2B,OAAqB;EAAC;EAAW;EAAQ;CAAO,CAAC;CAElF,OAAAG,gBACGjC,aAAWkC,WAAA;EACVC,IAAE;EAAA,KAAA,WAAA;GAAA,OACK5B,GAAGC,cAAc;IAAEE,SAASqB,MAAMrB;IAASU,MAAMW,MAAMX;GAAK,CAAC,GAAGW,MAAMH,KAAK;EAAC;CAAA,GAC9EI,IAA8B,CAAA;AAGzC"}
|
|
@@ -30,6 +30,14 @@ export declare function ContextMenuItem(props: ComponentProps<typeof KobalteCont
|
|
|
30
30
|
export declare function ContextMenuCheckboxItem(props: ComponentProps<typeof KobalteContextMenu.CheckboxItem>): import("solid-js").JSX.Element;
|
|
31
31
|
export declare function ContextMenuRadioGroup(props: ComponentProps<typeof KobalteContextMenu.RadioGroup>): import("solid-js").JSX.Element;
|
|
32
32
|
export declare function ContextMenuRadioItem(props: ComponentProps<typeof KobalteContextMenu.RadioItem>): import("solid-js").JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* The caption of a `ContextMenuGroup`, and that group's accessible name. It must be a
|
|
35
|
+
* child of the group it names: Kobalte reads the group from context, so a label
|
|
36
|
+
* placed directly in the content throws `useMenuGroupContext must be used within
|
|
37
|
+
* a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the
|
|
38
|
+
* label and its items in a group anyway — the grouping is what a screen reader
|
|
39
|
+
* announces.
|
|
40
|
+
*/
|
|
33
41
|
export declare function ContextMenuLabel(props: ComponentProps<typeof KobalteContextMenu.GroupLabel>): import("solid-js").JSX.Element;
|
|
34
42
|
export declare function ContextMenuGroup(props: ComponentProps<typeof KobalteContextMenu.Group>): import("solid-js").JSX.Element;
|
|
35
43
|
export declare function ContextMenuSeparator(props: ComponentProps<typeof KobalteContextMenu.Separator>): import("solid-js").JSX.Element;
|
|
@@ -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;A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,kBAAkB,CAAC,UAAU,CAAC,kCAG3F;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,KAAK,CAAC,kCAEtF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,SAAS,CAAC,kCAG9F;AAED,wBAAgB,cAAc,CAAC,KAAK,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"}
|
|
@@ -85,6 +85,14 @@ function ContextMenuRadioItem(props) {
|
|
|
85
85
|
})];
|
|
86
86
|
} }));
|
|
87
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* The caption of a `ContextMenuGroup`, and that group's accessible name. It must be a
|
|
90
|
+
* child of the group it names: Kobalte reads the group from context, so a label
|
|
91
|
+
* placed directly in the content throws `useMenuGroupContext must be used within
|
|
92
|
+
* a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the
|
|
93
|
+
* label and its items in a group anyway — the grouping is what a screen reader
|
|
94
|
+
* announces.
|
|
95
|
+
*/
|
|
88
96
|
function ContextMenuLabel(props) {
|
|
89
97
|
const [local, rest] = splitProps(props, ["class"]);
|
|
90
98
|
return createComponent(ContextMenu.GroupLabel, mergeProps({ get ["class"]() {
|
|
@@ -1 +1 @@
|
|
|
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","keyshortcuts","aria-keyshortcuts","_$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 * The parseable chord behind `shortcut`, e.g. `Meta+C`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n\n return (\n <KobalteContextMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-mono text-2xs tracking-widest\"\n >\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,SAAgBE,mBAAmBF,OAA0D;CAC3F,OAAAC,gBAAQf,YAAmBiB,SAAYH,KAAK;AAC9C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eU,MAAMK,KAAK;CAAC,EAAA,GAAMJ,IAAI,CAAA;AACtF;AAEA,SAAgB4B,eAAenC,OAAsD;CACnF,OAAAC,gBAAQf,YAAmBkD,KAAQpC,KAAK;AAC1C;AAEA,SAAgBqC,sBAAsBrC,OAA6D;CACjG,MAAM,CAACM,OAAOC,QAAQhB,WAAWS,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,OAAAC,gBACGf,YAAmBoD,YAAU5B,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQX,GAAGL,UAAUY,MAAMK,KAAK;CAAC,EAAA,GAAMJ,MAAI,EAAA,IAAAE,WAAA;EAAA,OAAA,CAAAS,WACtEZ,MAAMG,QAAQ,GAAAR,gBACdb,cAAY,EAAA,SAAA,iBAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAGnB;AAEA,SAAgBmD,sBAAsBvC,OAA6D;CACjG,MAAM,CAACM,OAAOC,QAAQhB,WAAWS,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGf,YAAmBsB,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAR,gBACvBf,YAAmBsD,YAAU9B,WAAA,EAAA,KAAA,WAAA;GAAA,OACrBX,GACLD,gBACAD,eACA,yFAAA,OAEAS,MAAMK,KACR;EAAC,EAAA,GACGJ,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
|
|
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","keyshortcuts","aria-keyshortcuts","_$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 * The parseable chord behind `shortcut`, e.g. `Meta+C`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n\n return (\n <KobalteContextMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-mono text-2xs tracking-widest\"\n >\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\n/**\n * The caption of a `ContextMenuGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\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,SAAgBE,mBAAmBF,OAA0D;CAC3F,OAAAC,gBAAQf,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A,KAAA,WAAA;EAAA,OAAQX,GAAGH,eAAeU,MAAMK,KAAK;CAAC,EAAA,GAAMJ,IAAI,CAAA;AACtF;AAEA,SAAgB4B,eAAenC,OAAsD;CACnF,OAAAC,gBAAQf,YAAmBkD,KAAQpC,KAAK;AAC1C;AAEA,SAAgBqC,sBAAsBrC,OAA6D;CACjG,MAAM,CAACM,OAAOC,QAAQhB,WAAWS,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,OAAAC,gBACGf,YAAmBoD,YAAU5B,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQX,GAAGL,UAAUY,MAAMK,KAAK;CAAC,EAAA,GAAMJ,MAAI,EAAA,IAAAE,WAAA;EAAA,OAAA,CAAAS,WACtEZ,MAAMG,QAAQ,GAAAR,gBACdb,cAAY,EAAA,SAAA,iBAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAGnB;AAEA,SAAgBmD,sBAAsBvC,OAA6D;CACjG,MAAM,CAACM,OAAOC,QAAQhB,WAAWS,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGf,YAAmBsB,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAR,gBACvBf,YAAmBsD,YAAU9B,WAAA,EAAA,KAAA,WAAA;GAAA,OACrBX,GACLD,gBACAD,eACA,yFAAA,OAEAS,MAAMK,KACR;EAAC,EAAA,GACGJ,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
|
|
@@ -18,7 +18,14 @@ import type { ComponentProps } from 'solid-js';
|
|
|
18
18
|
export declare function Drawer(props: ComponentProps<typeof DrawerPrimitive>): import("solid-js").JSX.Element;
|
|
19
19
|
export declare function DrawerTrigger(props: ComponentProps<typeof DrawerPrimitive.Trigger>): import("solid-js").JSX.Element;
|
|
20
20
|
export declare function DrawerOverlay(props: ComponentProps<typeof DrawerPrimitive.Overlay>): import("solid-js").JSX.Element;
|
|
21
|
-
export type DrawerContentProps = ComponentProps<typeof DrawerPrimitive.Content> & {
|
|
21
|
+
export type DrawerContentProps = Omit<ComponentProps<typeof DrawerPrimitive.Content>, 'side'> & {
|
|
22
|
+
/**
|
|
23
|
+
* Not accepted here. corvu reads the side from the root `Drawer`, which uses it
|
|
24
|
+
* for the drag axis and publishes it as `data-side`; a `side` on the content
|
|
25
|
+
* would type-check through the polymorphic props and be silently ignored,
|
|
26
|
+
* leaving the drawer on the bottom edge. Set `<Drawer side="right">` instead.
|
|
27
|
+
*/
|
|
28
|
+
side?: never;
|
|
22
29
|
/**
|
|
23
30
|
* Draw the grabber at the leading edge of the sheet.
|
|
24
31
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/drawer/drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,kCAEnE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAElF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAalF;AAED,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/drawer/drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,kCAEnE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAElF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAalF;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,GAAG;IAC9F;;;;;OAKG;IACH,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,kCA8BtD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,kCAQ9E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,kCAQ1F;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,kCAGpF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCASxD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAStD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCASxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","names":["DrawerPrimitive","ComponentProps","splitProps","cn","Drawer","props","_$createComponent","DrawerTrigger","Trigger","DrawerOverlay","Overlay","local","rest","_$mergeProps","class","DrawerContentProps","Content","withHandle","DrawerContent","Portal","children","_$memo","_el$","_tmpl$","_$effect","_$className","DrawerTitle","Label","DrawerDescription","Description","DrawerCloseButton","Close","DrawerHeader","_el$2","_tmpl$2","_$spread","DrawerBody","_el$3","_tmpl$3","DrawerFooter","_el$4","_tmpl$4","_$createComponent","_$mergeProps","_$memo","_$className"],"sources":["../../../../src/components/ui/drawer/drawer.tsx"],"sourcesContent":["import DrawerPrimitive from '@corvu/drawer'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Drawer.\n *\n * A sheet the user can drag away: it opens from an edge, carries a handle, and\n * closes by swipe as well as by button. That drag affordance is the reason to\n * choose it over Sheet — the gesture is for content the user is *finishing*\n * with (a summary, a queue, a confirmation), not for browsing.\n *\n * On a large window a Drawer is usually the wrong control: dragging is a touch\n * idiom, and on a desktop the same content is better as a Sheet or a Dialog.\n * The exceptions are the surfaces a pointer also drags naturally — a bottom\n * console, a media panel.\n *\n * corvu supplies the drag physics, the snap points and the pointer capture.\n */\nexport function Drawer(props: ComponentProps<typeof DrawerPrimitive>) {\n return <DrawerPrimitive {...props} />\n}\n\nexport function DrawerTrigger(props: ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger {...props} />\n}\n\nexport function DrawerOverlay(props: ComponentProps<typeof DrawerPrimitive.Overlay>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <DrawerPrimitive.Overlay\n class={cn(\n 'fixed inset-0 z-(--z-drawer) bg-scrim/50',\n 'data-[open]:animate-in data-[open]:fade-in-0 data-[closed]:animate-out data-[closed]:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DrawerContentProps = ComponentProps<typeof DrawerPrimitive.Content> & {\n /**\n * Draw the grabber at the leading edge of the sheet.\n *\n * It is an affordance, not the drag target: corvu makes the whole sheet\n * draggable, exactly as the platform's own sheets behave. So this is\n * `aria-hidden` decoration that tells the user the sheet can be pulled — it\n * carries no behaviour and must not be the only thing that moves.\n */\n withHandle?: boolean\n}\n\nexport function DrawerContent(props: DrawerContentProps) {\n const [local, rest] = splitProps(props, ['class', 'withHandle', 'children'])\n\n return (\n <DrawerPrimitive.Portal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n class={cn(\n 'group/drawer bg-popover text-popover-foreground fixed z-(--z-drawer) flex flex-col border-border shadow-lg',\n 'data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:max-h-[85vh] data-[side=bottom]:rounded-t-xl data-[side=bottom]:border-t',\n 'data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:max-h-[85vh] data-[side=top]:rounded-b-xl data-[side=top]:border-b',\n 'data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:w-80 data-[side=left]:rounded-e-xl data-[side=left]:border-e',\n 'data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:w-80 data-[side=right]:rounded-s-xl data-[side=right]:border-s',\n local.class\n )}\n {...rest}\n >\n {local.withHandle ? (\n <span\n aria-hidden=\"true\"\n class={cn(\n 'bg-muted shrink-0 self-center',\n 'group-data-[side=bottom]/drawer:mt-2 group-data-[side=bottom]/drawer:h-1.5 group-data-[side=bottom]/drawer:w-10 group-data-[side=bottom]/drawer:rounded-full'\n )}\n />\n ) : null}\n {local.children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n )\n}\n\nexport function DrawerTitle(props: ComponentProps<typeof DrawerPrimitive.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Label\n class={cn('text-base leading-none font-semibold tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerDescription(props: ComponentProps<typeof DrawerPrimitive.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerCloseButton(props: ComponentProps<typeof DrawerPrimitive.Close>) {\n const [local, rest] = splitProps(props, ['class'])\n return <DrawerPrimitive.Close class={cn('focus-ring', local.class)} {...rest} />\n}\n\nexport function DrawerHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-header\"\n class={cn('flex flex-col gap-1.5 p-5 pb-3 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto px-5 pb-4', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-footer\"\n class={cn('flex flex-col-reverse gap-2 p-5 pt-3 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgBI,OAAOC,OAA+C;CACpE,OAAAC,gBAAQN,iBAAoBK,KAAK;AACnC;AAEA,SAAgBE,cAAcF,OAAuD;CACnF,OAAAC,gBAAQN,gBAAgBQ,SAAYH,KAAK;AAC3C;AAEA,SAAgBI,cAAcJ,OAAuD;CACnF,MAAM,CAACM,OAAOC,QAAQV,WAAWG,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGN,gBAAgBU,SAAOG,WAAA,EAAA,KAAA,WAAA;EAAA,OACfV,GACL,4CACA,mGACAQ,MAAMG,KACR;CAAC,EAAA,GACGF,IAAI,CAAA;AAGd;
|
|
1
|
+
{"version":3,"file":"drawer.js","names":["DrawerPrimitive","ComponentProps","splitProps","cn","Drawer","props","_$createComponent","DrawerTrigger","Trigger","DrawerOverlay","Overlay","local","rest","_$mergeProps","class","DrawerContentProps","Omit","Content","side","withHandle","DrawerContent","Portal","children","_$memo","_el$","_tmpl$","_$effect","_$className","DrawerTitle","Label","DrawerDescription","Description","DrawerCloseButton","Close","DrawerHeader","_el$2","_tmpl$2","_$spread","DrawerBody","_el$3","_tmpl$3","DrawerFooter","_el$4","_tmpl$4","_$createComponent","_$mergeProps","_$memo","_$className"],"sources":["../../../../src/components/ui/drawer/drawer.tsx"],"sourcesContent":["import DrawerPrimitive from '@corvu/drawer'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Drawer.\n *\n * A sheet the user can drag away: it opens from an edge, carries a handle, and\n * closes by swipe as well as by button. That drag affordance is the reason to\n * choose it over Sheet — the gesture is for content the user is *finishing*\n * with (a summary, a queue, a confirmation), not for browsing.\n *\n * On a large window a Drawer is usually the wrong control: dragging is a touch\n * idiom, and on a desktop the same content is better as a Sheet or a Dialog.\n * The exceptions are the surfaces a pointer also drags naturally — a bottom\n * console, a media panel.\n *\n * corvu supplies the drag physics, the snap points and the pointer capture.\n */\nexport function Drawer(props: ComponentProps<typeof DrawerPrimitive>) {\n return <DrawerPrimitive {...props} />\n}\n\nexport function DrawerTrigger(props: ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger {...props} />\n}\n\nexport function DrawerOverlay(props: ComponentProps<typeof DrawerPrimitive.Overlay>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <DrawerPrimitive.Overlay\n class={cn(\n 'fixed inset-0 z-(--z-drawer) bg-scrim/50',\n 'data-[open]:animate-in data-[open]:fade-in-0 data-[closed]:animate-out data-[closed]:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DrawerContentProps = Omit<ComponentProps<typeof DrawerPrimitive.Content>, 'side'> & {\n /**\n * Not accepted here. corvu reads the side from the root `Drawer`, which uses it\n * for the drag axis and publishes it as `data-side`; a `side` on the content\n * would type-check through the polymorphic props and be silently ignored,\n * leaving the drawer on the bottom edge. Set `<Drawer side=\"right\">` instead.\n */\n side?: never\n /**\n * Draw the grabber at the leading edge of the sheet.\n *\n * It is an affordance, not the drag target: corvu makes the whole sheet\n * draggable, exactly as the platform's own sheets behave. So this is\n * `aria-hidden` decoration that tells the user the sheet can be pulled — it\n * carries no behaviour and must not be the only thing that moves.\n */\n withHandle?: boolean\n}\n\nexport function DrawerContent(props: DrawerContentProps) {\n const [local, rest] = splitProps(props, ['class', 'withHandle', 'children'])\n\n return (\n <DrawerPrimitive.Portal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n class={cn(\n 'group/drawer bg-popover text-popover-foreground fixed z-(--z-drawer) flex flex-col border-border shadow-lg',\n 'data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:max-h-[85vh] data-[side=bottom]:rounded-t-xl data-[side=bottom]:border-t',\n 'data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:max-h-[85vh] data-[side=top]:rounded-b-xl data-[side=top]:border-b',\n 'data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:w-80 data-[side=left]:rounded-e-xl data-[side=left]:border-e',\n 'data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:w-80 data-[side=right]:rounded-s-xl data-[side=right]:border-s',\n local.class\n )}\n {...rest}\n >\n {local.withHandle ? (\n <span\n aria-hidden=\"true\"\n class={cn(\n 'bg-muted shrink-0 self-center',\n 'group-data-[side=bottom]/drawer:mt-2 group-data-[side=bottom]/drawer:h-1.5 group-data-[side=bottom]/drawer:w-10 group-data-[side=bottom]/drawer:rounded-full'\n )}\n />\n ) : null}\n {local.children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n )\n}\n\nexport function DrawerTitle(props: ComponentProps<typeof DrawerPrimitive.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Label\n class={cn('text-base leading-none font-semibold tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerDescription(props: ComponentProps<typeof DrawerPrimitive.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerCloseButton(props: ComponentProps<typeof DrawerPrimitive.Close>) {\n const [local, rest] = splitProps(props, ['class'])\n return <DrawerPrimitive.Close class={cn('focus-ring', local.class)} {...rest} />\n}\n\nexport function DrawerHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-header\"\n class={cn('flex flex-col gap-1.5 p-5 pb-3 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto px-5 pb-4', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-footer\"\n class={cn('flex flex-col-reverse gap-2 p-5 pt-3 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgBI,OAAOC,OAA+C;CACpE,OAAAC,gBAAQN,iBAAoBK,KAAK;AACnC;AAEA,SAAgBE,cAAcF,OAAuD;CACnF,OAAAC,gBAAQN,gBAAgBQ,SAAYH,KAAK;AAC3C;AAEA,SAAgBI,cAAcJ,OAAuD;CACnF,MAAM,CAACM,OAAOC,QAAQV,WAAWG,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGN,gBAAgBU,SAAOG,WAAA,EAAA,KAAA,WAAA;EAAA,OACfV,GACL,4CACA,mGACAQ,MAAMG,KACR;CAAC,EAAA,GACGF,IAAI,CAAA;AAGd;AAqBA,SAAgBQ,cAAcf,OAA2B;CACvD,MAAM,CAACM,OAAOC,QAAQV,WAAWG,OAAO;EAAC;EAAS;EAAc;CAAU,CAAC;CAE3E,OAAAC,gBACGN,gBAAgBqB,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAA,CAAAhB,gBACpBG,eAAa,CAAA,CAAA,GAAAH,gBACbN,gBAAgBiB,SAAOJ,WAAA,EAAA,KAAA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D,cAAA;EAAA,IAAA8B,QAAAC,QAAA;EAAAC,OAAAF,OAAAtB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWV,GAAG,6CAA6CQ,MAAMG,KAAK;EAAC,EAAA,GAC/DF,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAuB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBG,WAAWjC,OAA8B;CACvD,MAAM,CAACM,OAAOC,QAAQV,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAkC,QAAAC,QAAA;EAAAH,OAAAE,OAAA1B,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWV,GAAG,4CAA4CQ,MAAMG,KAAK;EAAC,EAAA,GAC9DF,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA2B;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,aAAapC,OAA8B;CACzD,MAAM,CAACM,OAAOC,QAAQV,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAqC,QAAAC,QAAA;EAAAN,OAAAK,OAAA7B,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWV,GAAG,mEAAmEQ,MAAMG,KAAK;EAAC,EAAA,GACrFF,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA8B;CAAA,EAAA,CAAA;AAGd"}
|
|
@@ -56,6 +56,14 @@ export declare function DropdownMenuShortcut(props: ComponentProps<'span'>): imp
|
|
|
56
56
|
export declare function DropdownMenuCheckboxItem(props: ComponentProps<typeof KobalteDropdownMenu.CheckboxItem>): import("solid-js").JSX.Element;
|
|
57
57
|
export declare function DropdownMenuRadioGroup(props: ComponentProps<typeof KobalteDropdownMenu.RadioGroup>): import("solid-js").JSX.Element;
|
|
58
58
|
export declare function DropdownMenuRadioItem(props: ComponentProps<typeof KobalteDropdownMenu.RadioItem>): import("solid-js").JSX.Element;
|
|
59
|
+
/**
|
|
60
|
+
* The caption of a `DropdownMenuGroup`, and that group's accessible name. It must be a
|
|
61
|
+
* child of the group it names: Kobalte reads the group from context, so a label
|
|
62
|
+
* placed directly in the content throws `useMenuGroupContext must be used within
|
|
63
|
+
* a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the
|
|
64
|
+
* label and its items in a group anyway — the grouping is what a screen reader
|
|
65
|
+
* announces.
|
|
66
|
+
*/
|
|
59
67
|
export declare function DropdownMenuLabel(props: ComponentProps<typeof KobalteDropdownMenu.GroupLabel>): import("solid-js").JSX.Element;
|
|
60
68
|
export declare function DropdownMenuGroup(props: ComponentProps<typeof KobalteDropdownMenu.Group>): import("solid-js").JSX.Element;
|
|
61
69
|
export declare function DropdownMenuSeparator(props: ComponentProps<typeof KobalteDropdownMenu.Separator>): import("solid-js").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAc9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,kCAG7E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,OAAO,CAAC,kCAE5F;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,MAAM,CAAC,kCAE1F;AAED,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,OAAO,CAAC,GAAG;IAC1F,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gGAAgG;IAChG,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAA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ACpC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,UAAU,CAAC,kCAG7D;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,SAAS,CAAC,kCAgBhG;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,UAAU,CAAC,kCAG7F;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,KAAK,CAAC,kCAExF;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,SAAS,CAAC,kCAGhG;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,GAAG,CAAC,kCAEpF;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,UAAU,CAAC,kCAU7D;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,UAAU,CAAC,kCAkB7D"}
|
|
@@ -136,6 +136,14 @@ function DropdownMenuRadioItem(props) {
|
|
|
136
136
|
})];
|
|
137
137
|
} }));
|
|
138
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* The caption of a `DropdownMenuGroup`, and that group's accessible name. It must be a
|
|
141
|
+
* child of the group it names: Kobalte reads the group from context, so a label
|
|
142
|
+
* placed directly in the content throws `useMenuGroupContext must be used within
|
|
143
|
+
* a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the
|
|
144
|
+
* label and its items in a group anyway — the grouping is what a screen reader
|
|
145
|
+
* announces.
|
|
146
|
+
*/
|
|
139
147
|
function DropdownMenuLabel(props) {
|
|
140
148
|
const [local, rest] = splitProps(props, ["class"]);
|
|
141
149
|
return createComponent(DropdownMenu.GroupLabel, mergeProps({ get ["class"]() {
|