@adea-ai/ui 0.149.8 → 0.151.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +2 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +3 -3
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-types.d.ts +7 -0
- package/dist/components/composites/appearance-editor/appearance-types.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/index.d.ts +1 -0
- package/dist/components/composites/appearance-editor/index.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/index.js +2 -1
- package/dist/components/composites/inline-citation/inline-citation.d.ts +2 -1
- package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +36 -3
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/settings/settings-layout.d.ts.map +1 -1
- package/dist/components/composites/settings/settings-layout.js +1 -1
- package/dist/components/composites/settings/settings-layout.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts +5 -0
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +54 -23
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +9 -4
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +1 -1
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.d.ts +18 -3
- package/dist/components/ui/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js +29 -3
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +9 -2
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +2 -2
- package/dist/r/src/components/composites/appearance-editor/appearance-types.ts +7 -0
- package/dist/r/src/components/composites/appearance-editor/index.ts +1 -0
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +53 -4
- package/dist/r/src/components/composites/settings/settings-layout.tsx +4 -1
- package/dist/r/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +76 -28
- package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +11 -2
- package/dist/r/src/components/ui/dialog/dialog.tsx +1 -1
- package/dist/r/src/components/ui/modal-dialog/modal-dialog.tsx +33 -4
- package/package.json +1 -1
- package/src/components/composites/appearance-editor/appearance-editor.tsx +9 -2
- package/src/components/composites/appearance-editor/appearance-rows.tsx +2 -2
- package/src/components/composites/appearance-editor/appearance-types.ts +7 -0
- package/src/components/composites/appearance-editor/index.ts +1 -0
- package/src/components/composites/inline-citation/inline-citation.tsx +53 -4
- package/src/components/composites/settings/settings-layout.tsx +4 -1
- package/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +76 -28
- package/src/components/ui/alert-dialog/alert-dialog.tsx +11 -2
- package/src/components/ui/dialog/dialog.tsx +1 -1
- package/src/components/ui/modal-dialog/modal-dialog.tsx +33 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-dialog.js","names":["Accessor","ComponentProps","JSX","Show","createEffect","createSignal","onCleanup","splitProps","cn","createDialogFocusRestoration","Dialog","DialogContent","DialogDescription","DialogHeader","DialogTitle","ModalDialogProps","Omit","size","open","onClose","title","modal","description","headerLeading","Element","restoreFocusRef","HTMLElement","children","ModalDialog","props","local","rest","content","setContent","focusRestoration","onOpenAutoFocus","onCloseAutoFocus","element","background","document","body","filter","child","contains","wasInert","map","node","hasAttribute","setAttribute","forEach","index","removeAttribute","portal","parentElement","_$createComponent","when","onOpenChange","next","_$mergeProps","ref","positioner","class","aria-label","aria-labelledby","undefined","band","_$memo","_$createComponent","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/modal-dialog/modal-dialog.tsx"],"sourcesContent":["import type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { Show, createEffect, createSignal, onCleanup, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n createDialogFocusRestoration,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '../dialog/dialog'\n\n/**\n * ModalDialog.\n *\n * A dialog that owns four things `Dialog` leaves to its caller, each of which is a\n * real defect when it is missed:\n *\n * 1. **It unmounts while closed.** An always-mounted dialog that closes as a side\n * effect of an async action can leave Kobalte's `aria-hidden` bookkeeping behind,\n * which hides the rest of the application from assistive technology. Unmounting\n * the whole owner makes cleanup the only way the layer can end.\n * 2. **It marks the background `inert`.** `inert` keeps the background out of the\n * tab order and the accessibility tree without depending on that bookkeeping, and\n * it restores exactly the elements that did not already have it — so a nested\n * dialog does not un-inert its parent.\n * 3. **It sets an explicit accessible name.** The content receives `aria-label`\n * from `title`, so its name does not depend on the title id registration effect.\n * Pass `aria-label` to use a different name while keeping the visible title;\n * pass `aria-labelledby` when another visible label should take precedence.\n * 4. **It returns focus to the opener.** The opener is captured before the dialog\n * autofocuses and restored after the owner closes, unless a close-autofocus\n * handler takes control or focus has moved to another layer. For controlled\n * dialogs without a composed trigger, pass `restoreFocusRef` when the opener\n * cannot be inferred from the focused element.\n * 5. **It keeps its own portal out of an enclosing layer's `aria-hidden`\n * bookkeeping.** A non-modal dialog opened while a modal `Sheet` is alive would\n * otherwise be aria-hidden one frame after it mounts — the enclosing layer's\n * hide-outside observer walks late-arriving body children as background. The\n * portal carries the marker that observer exempts; a modal layer opened above\n * still hides it, because that path matches a different attribute.\n *\n * Use `Dialog` directly when you need its composition; use this when you want a\n * dialog that is correct by default. `size=\"settings\"` supplies a wide, bounded\n * shell for a shared settings layout, titled by a banded header like a sheet's;\n * ordinary dialogs keep their compact default.\n */\nexport type ModalDialogProps = Omit<\n ComponentProps<typeof DialogContent>,\n 'children' | 'aria-label' | 'aria-labelledby' | 'positioner'\n> & {\n /** Selects the bounded, scrollable shell used for grouped workspace settings. */\n size?: 'default' | 'settings'\n open: boolean\n onClose: () => void\n title: string\n /**\n * Controls Kobalte's focus, scroll and accessibility modality. Defaults to `true`;\n * background body children remain inert in either mode.\n */\n modal?: boolean\n description?: string\n /** A mark or icon drawn before the title. */\n headerLeading?: JSX.Element\n /** Replaces `title` as the accessible name while keeping the visible title. */\n 'aria-label'?: string\n /** Names the dialog from a visible element; ARIA gives it precedence over `aria-label`. */\n 'aria-labelledby'?: string\n /**\n * Supplies the external control to focus when this controlled dialog closes.\n * Defaults to the element focused immediately before the dialog opens.\n */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n children?: JSX.Element\n}\n\nexport function ModalDialog(props: ModalDialogProps) {\n const [local, rest] = splitProps(props, [\n 'open',\n 'onClose',\n 'title',\n 'modal',\n 'size',\n 'description',\n 'headerLeading',\n 'class',\n 'children',\n 'aria-label',\n 'aria-labelledby',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n\n const [content, setContent] = createSignal<HTMLElement>()\n const focusRestoration = createDialogFocusRestoration({\n open: () => local.open,\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: local.onOpenAutoFocus,\n onCloseAutoFocus: local.onCloseAutoFocus,\n })\n\n createEffect(() => {\n if (!local.open) return\n const element = content()\n if (!element) return\n\n const background = [...document.body.children].filter(\n (child): child is HTMLElement => child instanceof HTMLElement && !child.contains(element)\n )\n const wasInert = background.map((node) => node.hasAttribute('inert'))\n for (const node of background) node.setAttribute('inert', '')\n\n onCleanup(() => {\n background.forEach((node, index) => {\n // Only the elements that were not already inert are restored, so a nested\n // dialog closing does not undo its parent's containment.\n if (!wasInert[index]) node.removeAttribute('inert')\n })\n })\n\n // Kobalte's hide-outside observer walks body children added after its layer\n // opened and aria-hides them one frame later, so a non-modal dialog portaled\n // in during that window would land outside the accessibility tree — role\n // queries never resolve it again while the enclosing layer stays open. The\n // observer exempts added nodes carrying its top-layer marker (it checks the\n // React Aria spelling it ported; `data-kb-top-layer` is only matched by a\n // newer layer's initial walk, which must still hide this dialog).\n let portal = element\n while (portal.parentElement !== null && portal.parentElement !== document.body) {\n portal = portal.parentElement\n }\n portal.setAttribute('data-react-aria-top-layer', 'true')\n onCleanup(() => portal.removeAttribute('data-react-aria-top-layer'))\n })\n\n return (\n <Show when={local.open}>\n <Dialog open modal={local.modal ?? true} onOpenChange={(next) => !next && local.onClose()}>\n <DialogContent\n ref={setContent}\n positioner={local.size === 'settings' ? 'inset' : 'default'}\n class={cn(\n 'gap-4',\n local.size === 'settings' &&\n 'flex h-208 max-h-full min-h-0 max-w-6xl flex-col gap-0 overflow-hidden p-0',\n local.class\n )}\n aria-label={local['aria-label'] ?? local.title}\n aria-labelledby={\n local['aria-labelledby'] ?? (local['aria-label'] !== undefined ? '' : undefined)\n }\n {...rest}\n onOpenAutoFocus={focusRestoration.onOpenAutoFocus}\n onCloseAutoFocus={focusRestoration.onCloseAutoFocus}\n >\n <DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>{local.headerLeading}</Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n <DialogDescription>{local.description}</DialogDescription>\n </Show>\n </DialogHeader>\n {local.children}\n </DialogContent>\n </Dialog>\n </Show>\n )\n}\n"],"mappings":";;;;;AA4EA,SAAgB4B,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQxB,WAAWsB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA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
{"version":3,"file":"modal-dialog.js","names":["Accessor","ComponentProps","JSX","Show","createEffect","createSignal","onCleanup","splitProps","cn","createDialogFocusRestoration","Dialog","DialogContent","DialogDescription","DialogHeader","DialogTitle","ModalDialogProps","Omit","size","footer","Element","open","onClose","title","modal","description","headerLeading","restoreFocusRef","HTMLElement","children","ModalDialog","props","local","rest","content","setContent","focusRestoration","onOpenAutoFocus","onCloseAutoFocus","element","background","document","body","filter","child","contains","wasInert","map","node","hasAttribute","setAttribute","forEach","index","removeAttribute","portal","parentElement","_$createComponent","when","onOpenChange","next","_$mergeProps","ref","positioner","class","aria-label","aria-labelledby","undefined","band","_$memo","fallback","_el$","_tmpl$","_$insert","_el$2","_tmpl$2","_$createComponent","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/modal-dialog/modal-dialog.tsx"],"sourcesContent":["import type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { Show, createEffect, createSignal, onCleanup, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n createDialogFocusRestoration,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '../dialog/dialog'\n\n/**\n * ModalDialog.\n *\n * A dialog that owns four things `Dialog` leaves to its caller, each of which is a\n * real defect when it is missed:\n *\n * 1. **It unmounts while closed.** An always-mounted dialog that closes as a side\n * effect of an async action can leave Kobalte's `aria-hidden` bookkeeping behind,\n * which hides the rest of the application from assistive technology. Unmounting\n * the whole owner makes cleanup the only way the layer can end.\n * 2. **It marks the background `inert`.** `inert` keeps the background out of the\n * tab order and the accessibility tree without depending on that bookkeeping, and\n * it restores exactly the elements that did not already have it — so a nested\n * dialog does not un-inert its parent.\n * 3. **It sets an explicit accessible name.** The content receives `aria-label`\n * from `title`, so its name does not depend on the title id registration effect.\n * Pass `aria-label` to use a different name while keeping the visible title;\n * pass `aria-labelledby` when another visible label should take precedence.\n * 4. **It returns focus to the opener.** The opener is captured before the dialog\n * autofocuses and restored after the owner closes, unless a close-autofocus\n * handler takes control or focus has moved to another layer. For controlled\n * dialogs without a composed trigger, pass `restoreFocusRef` when the opener\n * cannot be inferred from the focused element.\n * 5. **It keeps its own portal out of an enclosing layer's `aria-hidden`\n * bookkeeping.** A non-modal dialog opened while a modal `Sheet` is alive would\n * otherwise be aria-hidden one frame after it mounts — the enclosing layer's\n * hide-outside observer walks late-arriving body children as background. The\n * portal carries the marker that observer exempts; a modal layer opened above\n * still hides it, because that path matches a different attribute.\n *\n * Use `Dialog` directly when you need its composition; use this when you want a\n * dialog that is correct by default. `size=\"settings\"` supplies a wide, bounded\n * shell for a shared settings layout, titled by a banded header like a sheet's;\n * ordinary dialogs keep their compact default. Every centred dialog stays inside\n * the window: past the window's height it scrolls rather than running off its\n * edges. `size=\"fit\"` is for a dialog whose body can grow (a scan result, a long\n * plan) and whose actions must stay in view: the title and `footer` stay put and\n * the children scroll between them.\n */\nexport type ModalDialogProps = Omit<\n ComponentProps<typeof DialogContent>,\n 'children' | 'aria-label' | 'aria-labelledby' | 'positioner'\n> & {\n /**\n * `settings` selects the bounded, scrollable shell used for grouped workspace\n * settings. `fit` keeps the compact default width but lets the dialog's content\n * decide its height up to the window: the title band stays put, the children\n * scroll, and `footer` stays in view beneath them.\n */\n size?: 'default' | 'settings' | 'fit'\n /**\n * Actions that must stay reachable however long the content is (Cancel and a\n * primary button). Rendered under the scrolling children, outside the scroll\n * area, and only by the `fit` size.\n */\n footer?: JSX.Element\n open: boolean\n onClose: () => void\n title: string\n /**\n * Controls Kobalte's focus, scroll and accessibility modality. Defaults to `true`;\n * background body children remain inert in either mode.\n */\n modal?: boolean\n description?: string\n /** A mark or icon drawn before the title. */\n headerLeading?: JSX.Element\n /** Replaces `title` as the accessible name while keeping the visible title. */\n 'aria-label'?: string\n /** Names the dialog from a visible element; ARIA gives it precedence over `aria-label`. */\n 'aria-labelledby'?: string\n /**\n * Supplies the external control to focus when this controlled dialog closes.\n * Defaults to the element focused immediately before the dialog opens.\n */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n children?: JSX.Element\n}\n\nexport function ModalDialog(props: ModalDialogProps) {\n const [local, rest] = splitProps(props, [\n 'open',\n 'onClose',\n 'title',\n 'modal',\n 'size',\n 'footer',\n 'description',\n 'headerLeading',\n 'class',\n 'children',\n 'aria-label',\n 'aria-labelledby',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n\n const [content, setContent] = createSignal<HTMLElement>()\n const focusRestoration = createDialogFocusRestoration({\n open: () => local.open,\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: local.onOpenAutoFocus,\n onCloseAutoFocus: local.onCloseAutoFocus,\n })\n\n createEffect(() => {\n if (!local.open) return\n const element = content()\n if (!element) return\n\n const background = [...document.body.children].filter(\n (child): child is HTMLElement => child instanceof HTMLElement && !child.contains(element)\n )\n const wasInert = background.map((node) => node.hasAttribute('inert'))\n for (const node of background) node.setAttribute('inert', '')\n\n onCleanup(() => {\n background.forEach((node, index) => {\n // Only the elements that were not already inert are restored, so a nested\n // dialog closing does not undo its parent's containment.\n if (!wasInert[index]) node.removeAttribute('inert')\n })\n })\n\n // Kobalte's hide-outside observer walks body children added after its layer\n // opened and aria-hides them one frame later, so a non-modal dialog portaled\n // in during that window would land outside the accessibility tree — role\n // queries never resolve it again while the enclosing layer stays open. The\n // observer exempts added nodes carrying its top-layer marker (it checks the\n // React Aria spelling it ported; `data-kb-top-layer` is only matched by a\n // newer layer's initial walk, which must still hide this dialog).\n let portal = element\n while (portal.parentElement !== null && portal.parentElement !== document.body) {\n portal = portal.parentElement\n }\n portal.setAttribute('data-react-aria-top-layer', 'true')\n onCleanup(() => portal.removeAttribute('data-react-aria-top-layer'))\n })\n\n return (\n <Show when={local.open}>\n <Dialog open modal={local.modal ?? true} onOpenChange={(next) => !next && local.onClose()}>\n <DialogContent\n ref={setContent}\n positioner={local.size === 'settings' ? 'inset' : 'default'}\n class={cn(\n 'gap-4',\n local.size === 'settings' &&\n 'flex h-208 max-h-full min-h-0 max-w-6xl flex-col gap-0 overflow-hidden p-0',\n local.size === 'fit' && 'flex flex-col overflow-hidden',\n local.class\n )}\n aria-label={local['aria-label'] ?? local.title}\n aria-labelledby={\n local['aria-labelledby'] ?? (local['aria-label'] !== undefined ? '' : undefined)\n }\n {...rest}\n onOpenAutoFocus={focusRestoration.onOpenAutoFocus}\n onCloseAutoFocus={focusRestoration.onCloseAutoFocus}\n >\n <DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>{local.headerLeading}</Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n <DialogDescription>{local.description}</DialogDescription>\n </Show>\n </DialogHeader>\n <Show when={local.size === 'fit'} fallback={local.children}>\n {/* The scrollport takes the room the title band and footer leave. The\n padding and matching negative margin keep a focused control's ring\n from being clipped at the scrollport's edge. */}\n <div class=\"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1\">\n {local.children}\n </div>\n <Show when={local.footer}>\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {local.footer}\n </div>\n </Show>\n </Show>\n </DialogContent>\n </Dialog>\n </Show>\n )\n}\n"],"mappings":";;;;;;;AA2FA,SAAgB6B,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQzB,WAAWuB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAkB,CACnB;CAED,MAAM,CAACG,SAASC,cAAc7B,aAA0B;CACxD,MAAM8B,mBAAmB1B,6BAA6B;EACpDW,YAAYW,MAAMX;EAClBM,iBAAiBK,MAAML;EACvBU,iBAAiBL,MAAMK;EACvBC,kBAAkBN,MAAMM;CAC1B,CAAC;CAEDjC,mBAAmB;EACjB,IAAI,CAAC2B,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A,IAAA4C,QAAAC,QAAA;WAAAF,OAAAC,aAEnBzC,MAAMb,MAAM;WAAA,OAAAsD;UAAA;SAAA,CAAA,CAAA;QAAA;OAAA,CAAA,CAAA;MAAA;KAAA,CAAA,CAAA;IAAA;GAAA,CAAA;EAAA;CAAA,CAAA;AAQ7B"}
|
package/dist/index.js
CHANGED
|
@@ -176,12 +176,13 @@ import { describeCount, firstFailureKey, formatDuration as formatDuration$1, lis
|
|
|
176
176
|
import { TEST_RESULTS_LIST_LIMIT, TestResults } from "./components/composites/test-results/test-results.js";
|
|
177
177
|
import { TOOL_VALUE_MAX_CHARS, formatToolValue } from "./components/composites/tool/format-tool-value.js";
|
|
178
178
|
import { TOOL_STATUS_LABELS, Tool } from "./components/composites/tool/tool.js";
|
|
179
|
-
import { SettingsField, SettingsPage, SettingsRow, SettingsSection } from "./components/composites/settings/settings.js";
|
|
179
|
+
import { SettingsField, SettingsPage, SettingsRow as SettingsRow$1, SettingsSection } from "./components/composites/settings/settings.js";
|
|
180
180
|
import { SettingsNavigation } from "./components/composites/settings/settings-navigation.js";
|
|
181
181
|
import { SettingsLayout } from "./components/composites/settings/settings-layout.js";
|
|
182
182
|
import { SceneControls } from "./components/composites/scene-controls/scene-controls.js";
|
|
183
183
|
import { PropertyList, PropertyRow, PropertyTerm, PropertyValue, Stat, StatGroup } from "./components/composites/stat/stat.js";
|
|
184
184
|
import { PalettePreview, ThemeMiniature, ThemeMiniatureSplit } from "./components/composites/appearance-editor/theme-preview.js";
|
|
185
|
+
import { SettingsRow } from "./components/composites/appearance-editor/appearance-rows.js";
|
|
185
186
|
import { AppearanceEditor, AppearanceEditorActions, AppearancePopover } from "./components/composites/appearance-editor/appearance-editor.js";
|
|
186
187
|
import { allTokens, colorTokens, densityTokens, designTokens, elevationTokens, motionTokens, radiusTokens, typographyTokens, undocumentedTokenAliases, zIndexTokens } from "./lib/tokens.js";
|
|
187
188
|
import { UpdateDialog } from "./components/composites/update-dialog/update-dialog.js";
|
|
@@ -196,4 +197,4 @@ import { MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE
|
|
|
196
197
|
import { isShellIconKey, resolveShellIcon, shellIconEntries, shellIconLabel } from "./components/composites/icon-picker/shell-icons.js";
|
|
197
198
|
import { IconPicker, IconPickerDropdown } from "./components/composites/icon-picker/icon-picker.js";
|
|
198
199
|
import { AccentPicker } from "./components/composites/accent-picker/accent-picker.js";
|
|
199
|
-
export { ANSI_MAX_LINE_LENGTH, ANSI_RETAIN_LINES, APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, AccentPicker, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, AspectRatio, Attachment, AttachmentCard, AttachmentList, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHAIN_OF_THOUGHT_STATUS_LABELS, CODE_BLOCK_LINE_LIMIT, CalendarSurface, Callout, CalloutTitle, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChainOfThought, ChainOfThoughtResult, ChainOfThoughtResults, ChainOfThoughtStep, Chat, ChatComposer, ChatEmpty, ChatHeader, ChatNotice, Checkbox, CheckboxDescription, CheckboxLabel, Checkpoint, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, Confirmation, Context, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FILE_CHANGE_LABELS, FILE_TREE_AUTO_EXPAND_LIMIT, FILE_TREE_MAX_DEPTH, FILE_TREE_MAX_ROWS, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FileTree, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, IconPicker, IconPickerDropdown, InlineCitation, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE_SIZE, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, MODEL_SEARCH_THRESHOLD, MarkImageError, Marker, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, MessageBody, MessageComposer, MessageContent, MessageDayDivider, MessageFooter, MessageGroup, MessageHeader, MessageRow, MessageScroller, MessageText, ModalDialog, ModelSelector, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelResizeHandle, Plan, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, Questionnaire, Queue, QueueFollowUps, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, Reasoning, ResizableHandle, ResizablePanel, ResizablePanelGroup, SOURCE_SNIPPET_LIMIT, SOURCE_TITLE_LIMIT, STACK_MAX_LINES, STACK_TRACE_MAX_BLOCKS, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShellRail, ShellTopBar, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Sources, Spinner, SplitLayout, StackTrace, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Subagent, Suggestion, Suggestions, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, TASK_ITEM_STATUS_LABELS, TERMINAL_MAX_LINES, TEST_RESULTS_LIST_LIMIT, TOOL_STATUS_LABELS, TOOL_VALUE_MAX_CHARS, TRACE_STATUS_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskItemList, TaskItemRow, Terminal, TestResults, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tool, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, Trace, TraceDetail, TraceLine, TranscriptComposition, Tree, TreeRow, TreeRowActions, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, WorkspaceReorderDialog, WorkspaceSwitcher, accentPresets, alertVariants, allTokens, ansi256ToColor, ansiLineText, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, boundText, breakdownRows, bubbleVariants, buildFileTree, builtinThemes, buttonVariants, calloutVariants, captureAnchor, cardVariants, centredSquare, chatNoticeVariants, checkMarkImageFile, checkpointLabel, checkpointStatus, citationLabel, citationName, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, clampWindow, classifyFrame, closePane, cn, colorTokens, computeLayoutFrames, confirmationOutcome, contextLabel, contextLevel, contextLevelWord, contextPercent, contextShort, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countChanges, countLeaves, countLines, createAnsiParser, createAppMenuItems, createLayoutState, createVersionedPersistence, cva, decisionReason, dedentLines, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, describeChanges, describeCount, describeFrameGroup, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findModel, findTokenRanges, firstFailureKey, flattenFileTree, focusPane, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatAttachmentSize, formatBytes, formatCost, formatDuration, formatExact, formatReleaseDate, formatDuration$1 as formatTestDuration, formatToken, formatTokens, formatToolValue, frameLocation, groupModels, groupStackEntries, hasContextFigures, headingElement, headingVariants, indexFileTree, initialExpanded, initialsFrom, inlineScriptLiteral, isAwaitingAnswer, isCustomAccent, isFailedExit, isFigure, isMarkImageDataUrl, isPasteBlock, isPlainStyle, isQuestionAnswered, isShellIconKey, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, listedCounts, localStoragePersistence, markImageFromFile, markImageProblemCopy, markerVariants, messageCitations, modelSearchValue, monogram, motionTokens, movePane, moveTarget, moveWorkspace, nearestAnsiColor, needsSearch, neighborLeaf, nextCitationMode, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeEfforts, normalizeLayout, normalizePath, normalizeSurface, paintAccentRoles, parseAnsi, parseDiff, parseInline, parseMessageText, parseStackTrace, partitionQueue, placeCitationMarkers, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, reasoningTitle, recollapsePastes, reconcileCounts, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveColors, resolveEffort, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolveShellIcon, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, restoreAnchor, restoreControl, restoreDialogCopy, revealInWindow, safeHref, safePreviewSrc, safeSourceUrl, searchShortcutKeyshortcuts, searchShortcutLabel, settleDecision, sheetVariants, shellIconEntries, shellIconLabel, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, sourceHost, sourceTitle, sourcesLabel, splitLocation, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stepCountLabel, stripTrailingBlankLines, suiteKey, suiteState, surfaceAlpha, surfaceInteractive, swapPanes, taskProgress, taskProgressLabel, terminalCssVariables, terminalStatusLabel, testKey, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, typeaheadIndex, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, wrapIndex, writeClipboardText, writeVersionedRecord, zIndexTokens };
|
|
200
|
+
export { ANSI_MAX_LINE_LENGTH, ANSI_RETAIN_LINES, APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, AccentPicker, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, SettingsRow as AppearanceSettingsRow, AspectRatio, Attachment, AttachmentCard, AttachmentList, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHAIN_OF_THOUGHT_STATUS_LABELS, CODE_BLOCK_LINE_LIMIT, CalendarSurface, Callout, CalloutTitle, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChainOfThought, ChainOfThoughtResult, ChainOfThoughtResults, ChainOfThoughtStep, Chat, ChatComposer, ChatEmpty, ChatHeader, ChatNotice, Checkbox, CheckboxDescription, CheckboxLabel, Checkpoint, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, Confirmation, Context, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FILE_CHANGE_LABELS, FILE_TREE_AUTO_EXPAND_LIMIT, FILE_TREE_MAX_DEPTH, FILE_TREE_MAX_ROWS, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FileTree, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, IconPicker, IconPickerDropdown, InlineCitation, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE_SIZE, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, MODEL_SEARCH_THRESHOLD, MarkImageError, Marker, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, MessageBody, MessageComposer, MessageContent, MessageDayDivider, MessageFooter, MessageGroup, MessageHeader, MessageRow, MessageScroller, MessageText, ModalDialog, ModelSelector, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelResizeHandle, Plan, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, Questionnaire, Queue, QueueFollowUps, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, Reasoning, ResizableHandle, ResizablePanel, ResizablePanelGroup, SOURCE_SNIPPET_LIMIT, SOURCE_TITLE_LIMIT, STACK_MAX_LINES, STACK_TRACE_MAX_BLOCKS, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow$1 as SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShellRail, ShellTopBar, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Sources, Spinner, SplitLayout, StackTrace, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Subagent, Suggestion, Suggestions, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, TASK_ITEM_STATUS_LABELS, TERMINAL_MAX_LINES, TEST_RESULTS_LIST_LIMIT, TOOL_STATUS_LABELS, TOOL_VALUE_MAX_CHARS, TRACE_STATUS_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskItemList, TaskItemRow, Terminal, TestResults, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tool, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, Trace, TraceDetail, TraceLine, TranscriptComposition, Tree, TreeRow, TreeRowActions, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, WorkspaceReorderDialog, WorkspaceSwitcher, accentPresets, alertVariants, allTokens, ansi256ToColor, ansiLineText, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, boundText, breakdownRows, bubbleVariants, buildFileTree, builtinThemes, buttonVariants, calloutVariants, captureAnchor, cardVariants, centredSquare, chatNoticeVariants, checkMarkImageFile, checkpointLabel, checkpointStatus, citationLabel, citationName, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, clampWindow, classifyFrame, closePane, cn, colorTokens, computeLayoutFrames, confirmationOutcome, contextLabel, contextLevel, contextLevelWord, contextPercent, contextShort, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countChanges, countLeaves, countLines, createAnsiParser, createAppMenuItems, createLayoutState, createVersionedPersistence, cva, decisionReason, dedentLines, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, describeChanges, describeCount, describeFrameGroup, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findModel, findTokenRanges, firstFailureKey, flattenFileTree, focusPane, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatAttachmentSize, formatBytes, formatCost, formatDuration, formatExact, formatReleaseDate, formatDuration$1 as formatTestDuration, formatToken, formatTokens, formatToolValue, frameLocation, groupModels, groupStackEntries, hasContextFigures, headingElement, headingVariants, indexFileTree, initialExpanded, initialsFrom, inlineScriptLiteral, isAwaitingAnswer, isCustomAccent, isFailedExit, isFigure, isMarkImageDataUrl, isPasteBlock, isPlainStyle, isQuestionAnswered, isShellIconKey, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, listedCounts, localStoragePersistence, markImageFromFile, markImageProblemCopy, markerVariants, messageCitations, modelSearchValue, monogram, motionTokens, movePane, moveTarget, moveWorkspace, nearestAnsiColor, needsSearch, neighborLeaf, nextCitationMode, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeEfforts, normalizeLayout, normalizePath, normalizeSurface, paintAccentRoles, parseAnsi, parseDiff, parseInline, parseMessageText, parseStackTrace, partitionQueue, placeCitationMarkers, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, reasoningTitle, recollapsePastes, reconcileCounts, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveColors, resolveEffort, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolveShellIcon, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, restoreAnchor, restoreControl, restoreDialogCopy, revealInWindow, safeHref, safePreviewSrc, safeSourceUrl, searchShortcutKeyshortcuts, searchShortcutLabel, settleDecision, sheetVariants, shellIconEntries, shellIconLabel, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, sourceHost, sourceTitle, sourcesLabel, splitLocation, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stepCountLabel, stripTrailingBlankLines, suiteKey, suiteState, surfaceAlpha, surfaceInteractive, swapPanes, taskProgress, taskProgressLabel, terminalCssVariables, terminalStatusLabel, testKey, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, typeaheadIndex, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, wrapIndex, writeClipboardText, writeVersionedRecord, zIndexTokens };
|
|
@@ -203,12 +203,19 @@ export function AppearanceEditor(props: AppearanceEditorProps) {
|
|
|
203
203
|
onChange={(fonts) => props.onChange({ fonts })}
|
|
204
204
|
/>
|
|
205
205
|
</Show>
|
|
206
|
+
{props.extraRows}
|
|
206
207
|
</div>
|
|
207
208
|
<Show when={!props.hideActions}>
|
|
208
209
|
{/* Sticky so Save/Cancel stay reachable in a tall scroll container: the
|
|
209
210
|
editor scrolls with its host panel, and actions parked at the bottom
|
|
210
|
-
of a long form were unreachable without scrolling past every row.
|
|
211
|
-
|
|
211
|
+
of a long form were unreachable without scrolling past every row. The
|
|
212
|
+
bar is a band on the subtle-fill rung, like a sheet footer. It bleeds
|
|
213
|
+
through the host panel's padding (`--settings-panel-padding`, set by
|
|
214
|
+
SettingsLayout) so it sits flush with the panel's bottom and side
|
|
215
|
+
edges with no strip of page under it; a sticky offset is measured
|
|
216
|
+
inside a scroll container's padding, so `bottom` is pulled out by the
|
|
217
|
+
same amount. */}
|
|
218
|
+
<div class="sticky bottom-[calc(var(--settings-panel-padding,0px)*-1)] z-10 -mx-(--settings-panel-padding) -mb-(--settings-panel-padding) mt-4 border-t bg-muted px-4 py-3">
|
|
212
219
|
<AppearanceEditorActions {...props} />
|
|
213
220
|
</div>
|
|
214
221
|
</Show>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
// the menu sizes to that content instead of clipping it at the trigger width.
|
|
29
29
|
import type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'
|
|
30
30
|
import { For, Show, createMemo, createSignal, onCleanup, type JSX } from 'solid-js'
|
|
31
|
-
import { ChevronDown,
|
|
31
|
+
import { ChevronDown, Moon, SquareTerminal, Sun } from 'lucide-solid'
|
|
32
32
|
import { cn } from '../../../lib/utils'
|
|
33
33
|
import { Button } from '../../ui/button/button'
|
|
34
34
|
import {
|
|
@@ -377,7 +377,7 @@ export function ThemeRow(props: {
|
|
|
377
377
|
}))
|
|
378
378
|
)
|
|
379
379
|
return (
|
|
380
|
-
<SettingsRow title={label()} icon={<
|
|
380
|
+
<SettingsRow title={label()} icon={props.appearance === 'light' ? <Sun /> : <Moon />}>
|
|
381
381
|
<ThemeSelectMenu
|
|
382
382
|
label={label()}
|
|
383
383
|
selectedId={props.selectedId}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSX } from 'solid-js'
|
|
1
2
|
import type { AccentPreset, AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'
|
|
2
3
|
import type { AppearanceEditorFontSettings } from '../../../lib/appearance-font-settings'
|
|
3
4
|
|
|
@@ -55,6 +56,12 @@ export type AppearanceEditorProps = {
|
|
|
55
56
|
/** Mount nested font menus inside the containing overlay when one exists. */
|
|
56
57
|
menuPortalMount?: HTMLElement
|
|
57
58
|
class?: string
|
|
59
|
+
/**
|
|
60
|
+
* Host rows closing the option list, inside the same bordered group as the
|
|
61
|
+
* built-in rows. Compose them with `AppearanceSettingsRow` so they share the
|
|
62
|
+
* row anatomy (glyph tile, title, description, trailing control).
|
|
63
|
+
*/
|
|
64
|
+
extraRows?: JSX.Element
|
|
58
65
|
/** Leave Reset/Cancel/Save to the host, which renders `AppearanceEditorActions`. */
|
|
59
66
|
hideActions?: boolean
|
|
60
67
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChevronLeft, ChevronRight } from 'lucide-solid'
|
|
2
|
-
import { createSignal, onCleanup, Show, splitProps } from 'solid-js'
|
|
2
|
+
import { createEffect, createSignal, onCleanup, Show, splitProps } from 'solid-js'
|
|
3
3
|
import { cn } from '../../../lib/utils'
|
|
4
4
|
import { ActionButton } from '../action-button'
|
|
5
5
|
import { Button } from '../../ui/button'
|
|
@@ -40,7 +40,8 @@ import {
|
|
|
40
40
|
*
|
|
41
41
|
* - **Hover or keyboard focus peeks.** The popover opens without taking focus
|
|
42
42
|
* and closes when the pointer or focus leaves. Touch has no hover, so a touch
|
|
43
|
-
* never peeks.
|
|
43
|
+
* never peeks. A keyboard peek's card is inert, so Tab moves on from the badge
|
|
44
|
+
* to the next control on the page instead of into a card that is closing.
|
|
44
45
|
* - **Click, tap, Enter or Space pins.** Focus moves into the popover so its
|
|
45
46
|
* link and Previous/Next are reachable; it stays until Escape, an outside press,
|
|
46
47
|
* or the badge is pressed again, and focus returns to the badge. Pressing a badge
|
|
@@ -85,6 +86,34 @@ export function InlineCitation(props: InlineCitationProps) {
|
|
|
85
86
|
// Focus handed back to the badge as the popover closes is not a request to
|
|
86
87
|
// peek again; without this, Escape from a pinned card reopens it as a preview.
|
|
87
88
|
let restoringFocus = false
|
|
89
|
+
// A keyboard peek is a preview of the badge the reader is already on. Its card
|
|
90
|
+
// sits in a portal at the end of the document, so if it stayed tabbable, Tab
|
|
91
|
+
// from the badge would walk into the card, the card would close behind the
|
|
92
|
+
// focus as the badge blurred, and focus would fall to <body> and be pulled
|
|
93
|
+
// back to the badge: a keyboard trap. The card is inert until Enter or Space
|
|
94
|
+
// pins it, and while it closes. A pointer peek stays interactive.
|
|
95
|
+
const [keyboardPeek, setKeyboardPeek] = createSignal(false)
|
|
96
|
+
// Focus goes back to the badge only when it was in the card. A peek never
|
|
97
|
+
// held focus, and its close (finishing after its exit animation) must not
|
|
98
|
+
// pull the reader back from wherever Tab has taken them since.
|
|
99
|
+
let focusInCard = false
|
|
100
|
+
// Escape closes the innermost layer first: an open Previous/Next tooltip, then
|
|
101
|
+
// the card. Kobalte only lets the top-most layer take Escape, and a tooltip
|
|
102
|
+
// that just closed stays the top layer while it animates out, so a second
|
|
103
|
+
// Escape pressed during that exit used to vanish and leave the card open.
|
|
104
|
+
// Whether a tooltip was open is read before any handler runs (window,
|
|
105
|
+
// capture); an Escape that closed nothing else closes the card itself.
|
|
106
|
+
let escapeClosedTooltip = false
|
|
107
|
+
const onWindowKeyDown = (event: KeyboardEvent) => {
|
|
108
|
+
if (event.key !== 'Escape') return
|
|
109
|
+
escapeClosedTooltip =
|
|
110
|
+
content?.ownerDocument.querySelector('[data-slot="tooltip-content"][data-expanded]') != null
|
|
111
|
+
}
|
|
112
|
+
createEffect(() => {
|
|
113
|
+
if (mode() !== 'pinned' || typeof window === 'undefined') return
|
|
114
|
+
window.addEventListener('keydown', onWindowKeyDown, true)
|
|
115
|
+
onCleanup(() => window.removeEventListener('keydown', onWindowKeyDown, true))
|
|
116
|
+
})
|
|
88
117
|
|
|
89
118
|
const count = () => local.sources.length
|
|
90
119
|
const active = () => local.sources[wrapIndex(position(), count())]
|
|
@@ -94,7 +123,13 @@ export function InlineCitation(props: InlineCitationProps) {
|
|
|
94
123
|
}
|
|
95
124
|
onCleanup(clear)
|
|
96
125
|
|
|
97
|
-
const dispatch = (event: CitationEvent) =>
|
|
126
|
+
const dispatch = (event: CitationEvent) =>
|
|
127
|
+
setMode((current) => {
|
|
128
|
+
const next = nextCitationMode(current, event)
|
|
129
|
+
if (next !== 'peek') setKeyboardPeek(false)
|
|
130
|
+
else if (current === 'closed') setKeyboardPeek(event === 'focus')
|
|
131
|
+
return next
|
|
132
|
+
})
|
|
98
133
|
const schedule = (event: CitationEvent, delay: number) => {
|
|
99
134
|
clear()
|
|
100
135
|
timer = setTimeout(() => dispatch(event), delay)
|
|
@@ -159,11 +194,25 @@ export function InlineCitation(props: InlineCitationProps) {
|
|
|
159
194
|
</PopoverTrigger>
|
|
160
195
|
<PopoverContent
|
|
161
196
|
ref={(element: HTMLElement) => (content = element)}
|
|
197
|
+
inert={keyboardPeek() || mode() === 'closed' || undefined}
|
|
162
198
|
class="w-72 max-w-full"
|
|
163
199
|
onOpenAutoFocus={(event: Event) => {
|
|
164
200
|
if (mode() === 'peek') event.preventDefault()
|
|
165
201
|
}}
|
|
166
|
-
|
|
202
|
+
onFocusIn={() => {
|
|
203
|
+
focusInCard = true
|
|
204
|
+
}}
|
|
205
|
+
onKeyDown={(event: KeyboardEvent) => {
|
|
206
|
+
if (event.key !== 'Escape' || escapeClosedTooltip || mode() !== 'pinned') return
|
|
207
|
+
dispatch('dismiss')
|
|
208
|
+
}}
|
|
209
|
+
onCloseAutoFocus={(event: Event) => {
|
|
210
|
+
const returnFocus = focusInCard
|
|
211
|
+
focusInCard = false
|
|
212
|
+
if (!returnFocus) {
|
|
213
|
+
event.preventDefault()
|
|
214
|
+
return
|
|
215
|
+
}
|
|
167
216
|
// The focus move that follows is synchronous; the microtask ends the window.
|
|
168
217
|
restoringFocus = true
|
|
169
218
|
queueMicrotask(() => {
|
|
@@ -100,7 +100,10 @@ export function SettingsLayout(props: SettingsLayoutProps) {
|
|
|
100
100
|
revealSelected={local.revealSelected}
|
|
101
101
|
class={layout() === 'rail' ? 'w-24 md:w-sidebar' : undefined}
|
|
102
102
|
/>
|
|
103
|
-
<div
|
|
103
|
+
<div
|
|
104
|
+
data-slot="settings-layout-panels"
|
|
105
|
+
class="min-h-0 min-w-0 flex-1 overflow-y-auto p-(--settings-panel-padding) [--settings-panel-padding:--spacing(4)]"
|
|
106
|
+
>
|
|
104
107
|
{local.children}
|
|
105
108
|
</div>
|
|
106
109
|
</Tabs>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Accessor, JSX } from 'solid-js'
|
|
2
|
-
import { Show, createSignal, createUniqueId, onCleanup,
|
|
2
|
+
import { Show, createEffect, createSignal, createUniqueId, onCleanup, untrack } from 'solid-js'
|
|
3
3
|
import { cn } from '../../../lib/utils'
|
|
4
4
|
import {
|
|
5
5
|
SidebarNav,
|
|
@@ -37,6 +37,11 @@ export type ContextualSidebarProps = {
|
|
|
37
37
|
/** Host-controlled expanded state for the desktop panel and mobile dialog. */
|
|
38
38
|
open: boolean
|
|
39
39
|
onOpenChange(open: boolean): void
|
|
40
|
+
/**
|
|
41
|
+
* Presentation mode. `auto` (default) uses the built-in viewport breakpoint;
|
|
42
|
+
* hosts can select `desktop` or the shared mobile `Sheet` themselves.
|
|
43
|
+
*/
|
|
44
|
+
responsiveMode?: 'auto' | 'desktop' | 'mobile'
|
|
40
45
|
/** Current host-owned pixel width, reflected by the resize handle. */
|
|
41
46
|
width: number
|
|
42
47
|
minimum: number
|
|
@@ -80,20 +85,32 @@ export type ContextualSidebarProps = {
|
|
|
80
85
|
* persisted preference, open state, and view-specific navigation content.
|
|
81
86
|
*/
|
|
82
87
|
export function ContextualSidebar(props: ContextualSidebarProps) {
|
|
83
|
-
const [
|
|
88
|
+
const [isMobile, setIsMobile] = createSignal(false)
|
|
84
89
|
const [mobileLoad, setMobileLoad] = createSignal<MobileLoad>()
|
|
85
|
-
let
|
|
90
|
+
let mobileLoadGeneration = 0
|
|
91
|
+
let mobileLoadPending = false
|
|
92
|
+
let mobileLoadSettled = false
|
|
93
|
+
let responsiveModeInitialized = false
|
|
86
94
|
// Keep the resolved component mounted across viewport changes for Sheet cleanup.
|
|
87
95
|
const loadMobile = () => {
|
|
88
|
-
if (
|
|
89
|
-
|
|
96
|
+
if (mobileLoadPending || mobileLoadSettled) return
|
|
97
|
+
mobileLoadPending = true
|
|
98
|
+
const generation = ++mobileLoadGeneration
|
|
90
99
|
// Native module caching shares successful loads without keeping a rejected promise.
|
|
91
100
|
void import('./mobile-contextual-sidebar').then(
|
|
92
101
|
(module) => {
|
|
93
|
-
if (
|
|
102
|
+
if (generation === mobileLoadGeneration) {
|
|
103
|
+
mobileLoadPending = false
|
|
104
|
+
mobileLoadSettled = true
|
|
105
|
+
setMobileLoad(module)
|
|
106
|
+
}
|
|
94
107
|
},
|
|
95
108
|
(error: unknown) => {
|
|
96
|
-
if (
|
|
109
|
+
if (generation === mobileLoadGeneration) {
|
|
110
|
+
mobileLoadPending = false
|
|
111
|
+
mobileLoadSettled = true
|
|
112
|
+
setMobileLoad({ error })
|
|
113
|
+
}
|
|
97
114
|
}
|
|
98
115
|
)
|
|
99
116
|
}
|
|
@@ -107,28 +124,59 @@ export function ContextualSidebar(props: ContextualSidebarProps) {
|
|
|
107
124
|
return mount?.connected && mount.element.isConnected ? mount.element : undefined
|
|
108
125
|
}
|
|
109
126
|
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
// Close before mounting a modal. A desktop-expanded host state is not
|
|
116
|
-
// mobile intent, and opening the Sheet for one frame can steal focus.
|
|
117
|
-
if (media.matches && !wasNarrow) props.onOpenChange(false)
|
|
118
|
-
setIsNarrowViewport(media.matches)
|
|
119
|
-
}
|
|
127
|
+
createEffect(() => {
|
|
128
|
+
const mode = props.responsiveMode ?? 'auto'
|
|
129
|
+
const wasMobile = untrack(isMobile)
|
|
130
|
+
let media: MediaQueryList | undefined
|
|
131
|
+
let viewportListener: (() => void) | undefined
|
|
120
132
|
|
|
121
|
-
// A route can mount after a wide-loaded host crosses into mobile. Clear
|
|
122
|
-
// that stale seed, but preserve a sidebar intentionally opened at a
|
|
123
|
-
// narrow boot viewport.
|
|
124
|
-
if (media.matches) loadMobile()
|
|
125
|
-
if (media.matches && props.wideViewportAtLoad && props.open) props.onOpenChange(false)
|
|
126
|
-
setIsNarrowViewport(media.matches)
|
|
127
|
-
media.addEventListener('change', updateViewport)
|
|
128
133
|
onCleanup(() => {
|
|
129
|
-
|
|
130
|
-
|
|
134
|
+
mobileLoadGeneration += 1
|
|
135
|
+
mobileLoadPending = false
|
|
136
|
+
if (media && viewportListener) media.removeEventListener('change', viewportListener)
|
|
131
137
|
})
|
|
138
|
+
|
|
139
|
+
if (mode === 'desktop') {
|
|
140
|
+
setIsMobile(false)
|
|
141
|
+
} else if (mode === 'mobile') {
|
|
142
|
+
// An explicit host transition into mobile must not briefly open a Sheet
|
|
143
|
+
// with stale desktop-expanded state. An initial wide-loaded seed still
|
|
144
|
+
// marks an open value as stale, including in host-selected mobile mode.
|
|
145
|
+
const shouldCloseStaleOpen = responsiveModeInitialized
|
|
146
|
+
? !wasMobile && untrack(() => props.open)
|
|
147
|
+
: untrack(() => props.wideViewportAtLoad && props.open)
|
|
148
|
+
if (shouldCloseStaleOpen) untrack(() => props.onOpenChange(false))
|
|
149
|
+
loadMobile()
|
|
150
|
+
setIsMobile(true)
|
|
151
|
+
} else {
|
|
152
|
+
const mediaQuery = window.matchMedia('(max-width: 48rem)')
|
|
153
|
+
media = mediaQuery
|
|
154
|
+
const updateViewport = () => {
|
|
155
|
+
const nextIsMobile = mediaQuery.matches
|
|
156
|
+
const wasNarrow = untrack(isMobile)
|
|
157
|
+
if (nextIsMobile) loadMobile()
|
|
158
|
+
// Close before mounting a modal. A desktop-expanded host state is not
|
|
159
|
+
// mobile intent, and opening the Sheet for one frame can steal focus.
|
|
160
|
+
if (nextIsMobile && !wasNarrow) props.onOpenChange(false)
|
|
161
|
+
setIsMobile(nextIsMobile)
|
|
162
|
+
}
|
|
163
|
+
viewportListener = updateViewport
|
|
164
|
+
|
|
165
|
+
// Preserve a narrow-boot open intent. Initial auto and mobile modes use
|
|
166
|
+
// the viewport seed to clear stale state; runtime transitions close it.
|
|
167
|
+
if (media.matches) {
|
|
168
|
+
if (!responsiveModeInitialized && untrack(() => props.wideViewportAtLoad && props.open)) {
|
|
169
|
+
untrack(() => props.onOpenChange(false))
|
|
170
|
+
} else if (responsiveModeInitialized && !wasMobile) {
|
|
171
|
+
untrack(() => props.onOpenChange(false))
|
|
172
|
+
}
|
|
173
|
+
loadMobile()
|
|
174
|
+
}
|
|
175
|
+
setIsMobile(mediaQuery.matches)
|
|
176
|
+
mediaQuery.addEventListener('change', updateViewport)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
responsiveModeInitialized = true
|
|
132
180
|
})
|
|
133
181
|
|
|
134
182
|
const renderSidebar = (mobile: boolean) => {
|
|
@@ -209,13 +257,13 @@ export function ContextualSidebar(props: ContextualSidebarProps) {
|
|
|
209
257
|
|
|
210
258
|
return (
|
|
211
259
|
<>
|
|
212
|
-
<Show when={!
|
|
260
|
+
<Show when={!isMobile()}>{(_wide) => renderSidebar(false)}</Show>
|
|
213
261
|
<Show when={mobileLoad()} keyed>
|
|
214
262
|
{(loaded) => {
|
|
215
263
|
if ('error' in loaded) throw loaded.error
|
|
216
264
|
return (
|
|
217
265
|
<loaded.MobileSidebar
|
|
218
|
-
open={
|
|
266
|
+
open={isMobile() && props.open}
|
|
219
267
|
onOpenChange={props.onOpenChange}
|
|
220
268
|
label={props.label}
|
|
221
269
|
sheetClass={props.sheetClass}
|
|
@@ -94,7 +94,12 @@ export function AlertDialogContent(props: ComponentProps<typeof KobalteAlertDial
|
|
|
94
94
|
<div class={overlayPositioner}>
|
|
95
95
|
<KobalteAlertDialogContent
|
|
96
96
|
{...blockDismissal}
|
|
97
|
-
class={cn(
|
|
97
|
+
class={cn(
|
|
98
|
+
dialogSurface,
|
|
99
|
+
overlayMotion,
|
|
100
|
+
'grid max-h-full w-full max-w-md gap-4 overflow-y-auto p-5',
|
|
101
|
+
local.class
|
|
102
|
+
)}
|
|
98
103
|
{...rest}
|
|
99
104
|
/>
|
|
100
105
|
</div>
|
|
@@ -172,7 +177,11 @@ function AlertDialogChoice(props: ComponentProps<typeof KobalteAlertDialog.Close
|
|
|
172
177
|
|
|
173
178
|
return (
|
|
174
179
|
<span ref={setWrapper} class="contents">
|
|
175
|
-
<KobalteAlertDialog.CloseButton
|
|
180
|
+
<KobalteAlertDialog.CloseButton
|
|
181
|
+
class={cn(local.class)}
|
|
182
|
+
aria-label={local['aria-label']}
|
|
183
|
+
{...rest}
|
|
184
|
+
/>
|
|
176
185
|
</span>
|
|
177
186
|
)
|
|
178
187
|
}
|
|
@@ -314,7 +314,7 @@ export function DialogContent(props: DialogContentProps) {
|
|
|
314
314
|
class={cn(
|
|
315
315
|
dialogSurface,
|
|
316
316
|
overlayMotion,
|
|
317
|
-
'relative grid w-full gap-4 p-5',
|
|
317
|
+
'relative grid max-h-full w-full gap-4 overflow-y-auto p-5',
|
|
318
318
|
dialogContentSizes[local.size ?? 'md'],
|
|
319
319
|
local.class
|
|
320
320
|
)}
|
|
@@ -43,14 +43,29 @@ import {
|
|
|
43
43
|
* Use `Dialog` directly when you need its composition; use this when you want a
|
|
44
44
|
* dialog that is correct by default. `size="settings"` supplies a wide, bounded
|
|
45
45
|
* shell for a shared settings layout, titled by a banded header like a sheet's;
|
|
46
|
-
* ordinary dialogs keep their compact default.
|
|
46
|
+
* ordinary dialogs keep their compact default. Every centred dialog stays inside
|
|
47
|
+
* the window: past the window's height it scrolls rather than running off its
|
|
48
|
+
* edges. `size="fit"` is for a dialog whose body can grow (a scan result, a long
|
|
49
|
+
* plan) and whose actions must stay in view: the title and `footer` stay put and
|
|
50
|
+
* the children scroll between them.
|
|
47
51
|
*/
|
|
48
52
|
export type ModalDialogProps = Omit<
|
|
49
53
|
ComponentProps<typeof DialogContent>,
|
|
50
54
|
'children' | 'aria-label' | 'aria-labelledby' | 'positioner'
|
|
51
55
|
> & {
|
|
52
|
-
/**
|
|
53
|
-
|
|
56
|
+
/**
|
|
57
|
+
* `settings` selects the bounded, scrollable shell used for grouped workspace
|
|
58
|
+
* settings. `fit` keeps the compact default width but lets the dialog's content
|
|
59
|
+
* decide its height up to the window: the title band stays put, the children
|
|
60
|
+
* scroll, and `footer` stays in view beneath them.
|
|
61
|
+
*/
|
|
62
|
+
size?: 'default' | 'settings' | 'fit'
|
|
63
|
+
/**
|
|
64
|
+
* Actions that must stay reachable however long the content is (Cancel and a
|
|
65
|
+
* primary button). Rendered under the scrolling children, outside the scroll
|
|
66
|
+
* area, and only by the `fit` size.
|
|
67
|
+
*/
|
|
68
|
+
footer?: JSX.Element
|
|
54
69
|
open: boolean
|
|
55
70
|
onClose: () => void
|
|
56
71
|
title: string
|
|
@@ -81,6 +96,7 @@ export function ModalDialog(props: ModalDialogProps) {
|
|
|
81
96
|
'title',
|
|
82
97
|
'modal',
|
|
83
98
|
'size',
|
|
99
|
+
'footer',
|
|
84
100
|
'description',
|
|
85
101
|
'headerLeading',
|
|
86
102
|
'class',
|
|
@@ -144,6 +160,7 @@ export function ModalDialog(props: ModalDialogProps) {
|
|
|
144
160
|
'gap-4',
|
|
145
161
|
local.size === 'settings' &&
|
|
146
162
|
'flex h-208 max-h-full min-h-0 max-w-6xl flex-col gap-0 overflow-hidden p-0',
|
|
163
|
+
local.size === 'fit' && 'flex flex-col overflow-hidden',
|
|
147
164
|
local.class
|
|
148
165
|
)}
|
|
149
166
|
aria-label={local['aria-label'] ?? local.title}
|
|
@@ -170,7 +187,19 @@ export function ModalDialog(props: ModalDialogProps) {
|
|
|
170
187
|
<DialogDescription>{local.description}</DialogDescription>
|
|
171
188
|
</Show>
|
|
172
189
|
</DialogHeader>
|
|
173
|
-
{local.children}
|
|
190
|
+
<Show when={local.size === 'fit'} fallback={local.children}>
|
|
191
|
+
{/* The scrollport takes the room the title band and footer leave. The
|
|
192
|
+
padding and matching negative margin keep a focused control's ring
|
|
193
|
+
from being clipped at the scrollport's edge. */}
|
|
194
|
+
<div class="-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1">
|
|
195
|
+
{local.children}
|
|
196
|
+
</div>
|
|
197
|
+
<Show when={local.footer}>
|
|
198
|
+
<div class="flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3">
|
|
199
|
+
{local.footer}
|
|
200
|
+
</div>
|
|
201
|
+
</Show>
|
|
202
|
+
</Show>
|
|
174
203
|
</DialogContent>
|
|
175
204
|
</Dialog>
|
|
176
205
|
</Show>
|
package/package.json
CHANGED
|
@@ -203,12 +203,19 @@ export function AppearanceEditor(props: AppearanceEditorProps) {
|
|
|
203
203
|
onChange={(fonts) => props.onChange({ fonts })}
|
|
204
204
|
/>
|
|
205
205
|
</Show>
|
|
206
|
+
{props.extraRows}
|
|
206
207
|
</div>
|
|
207
208
|
<Show when={!props.hideActions}>
|
|
208
209
|
{/* Sticky so Save/Cancel stay reachable in a tall scroll container: the
|
|
209
210
|
editor scrolls with its host panel, and actions parked at the bottom
|
|
210
|
-
of a long form were unreachable without scrolling past every row.
|
|
211
|
-
|
|
211
|
+
of a long form were unreachable without scrolling past every row. The
|
|
212
|
+
bar is a band on the subtle-fill rung, like a sheet footer. It bleeds
|
|
213
|
+
through the host panel's padding (`--settings-panel-padding`, set by
|
|
214
|
+
SettingsLayout) so it sits flush with the panel's bottom and side
|
|
215
|
+
edges with no strip of page under it; a sticky offset is measured
|
|
216
|
+
inside a scroll container's padding, so `bottom` is pulled out by the
|
|
217
|
+
same amount. */}
|
|
218
|
+
<div class="sticky bottom-[calc(var(--settings-panel-padding,0px)*-1)] z-10 -mx-(--settings-panel-padding) -mb-(--settings-panel-padding) mt-4 border-t bg-muted px-4 py-3">
|
|
212
219
|
<AppearanceEditorActions {...props} />
|
|
213
220
|
</div>
|
|
214
221
|
</Show>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
// the menu sizes to that content instead of clipping it at the trigger width.
|
|
29
29
|
import type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'
|
|
30
30
|
import { For, Show, createMemo, createSignal, onCleanup, type JSX } from 'solid-js'
|
|
31
|
-
import { ChevronDown,
|
|
31
|
+
import { ChevronDown, Moon, SquareTerminal, Sun } from 'lucide-solid'
|
|
32
32
|
import { cn } from '#lib/utils'
|
|
33
33
|
import { Button } from '../../ui/button/button'
|
|
34
34
|
import {
|
|
@@ -377,7 +377,7 @@ export function ThemeRow(props: {
|
|
|
377
377
|
}))
|
|
378
378
|
)
|
|
379
379
|
return (
|
|
380
|
-
<SettingsRow title={label()} icon={<
|
|
380
|
+
<SettingsRow title={label()} icon={props.appearance === 'light' ? <Sun /> : <Moon />}>
|
|
381
381
|
<ThemeSelectMenu
|
|
382
382
|
label={label()}
|
|
383
383
|
selectedId={props.selectedId}
|