@adea-ai/ui 0.161.9 → 0.162.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +11 -3
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +1 -4
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts +2 -0
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +4 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +77 -40
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-types.d.ts +5 -0
- package/dist/components/composites/catalog-browser/catalog-types.d.ts.map +1 -1
- package/dist/components/composites/settings/settings-navigation.d.ts.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js +13 -4
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +9 -3
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +3 -7
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +8 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +27 -6
- package/dist/r/src/components/composites/catalog-browser/catalog-types.ts +5 -0
- package/dist/r/src/components/composites/settings/settings-navigation.tsx +33 -6
- package/package.json +1 -1
- package/src/components/composites/appearance-editor/appearance-choices.tsx +9 -3
- package/src/components/composites/appearance-editor/appearance-editor.tsx +3 -7
- package/src/components/composites/appearance-editor/appearance-rows.tsx +8 -1
- package/src/components/composites/catalog-browser/catalog-browser.tsx +27 -6
- package/src/components/composites/catalog-browser/catalog-types.ts +5 -0
- package/src/components/composites/settings/settings-navigation.tsx +33 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance-rows.js","names":["<Show when={props.description}>\n {(descriptionSlot) => (\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</div>\n )}\n </Show>","class={cn('flex min-w-0 flex-1 items-center gap-3', { 'basis-48': !props.stacked })}","<section\n class={cn('flex gap-3 px-4 py-4', {\n 'flex-col': props.stacked,\n 'flex-wrap items-center': !props.stacked,\n })}\n >\n {/* Reserve readable copy before choosing a side-by-side control row.\n Wrapping follows the actual host width and enlarged text, rather\n than a viewport breakpoint that also matches a narrow popover. */}\n <div class={cn('flex min-w-0 flex-1 items-center gap-3', { 'basis-48': !props.stacked })}>\n <span\n class=\"flex size-9 shrink-0 items-center justify-center rounded-lg border bg-foreground/5 text-muted-foreground [&_svg]:size-4\"\n aria-hidden=\"true\"\n >\n {props.icon}\n </span>\n <div class=\"min-w-0\">\n <h3 class=\"text-sm font-medium\">{props.title}</h3>\n <Show when={props.description}>\n {(descriptionSlot) => (\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</div>\n )}\n </Show>\n </div>\n </div>\n <div class=\"min-w-0 max-w-full shrink-0\">{props.children}</div>\n </section>","ref={setPortalMount}","<DropdownMenu\n modal={false}\n open={menuOpen()}\n onOpenChange={(next: boolean) => {\n if (next !== open) focusLifecycleVersion += 1\n open = next\n setMenuOpen(next)\n if (next) {\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n }\n }}\n >\n <DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${props.label}: ${selectedName()}`}\n disabled={props.disabled || props.options.length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n portalMount={portalMount()}\n // A fixed height with its own scroll: an adaptive cap measured the\n // host panel instead, and opening a long theme list scrolled the\n // sidebar to reveal the menu. The content scrolls internally at the\n // cap, so the panel around the trigger never moves. Width still\n // follows content (at least the trigger width, never wider than the\n // popper allows) so long theme names render in full with padding for\n // the selection indicator instead of truncating at the anchor width.\n class=\"max-h-80 w-max min-w-(--anchor-width) max-w-(--available-width) overflow-x-hidden overflow-y-auto\"\n tabKey=\"leave\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = tabStopAt(target)\n if (focusTarget) {\n restoreTriggerFocus = false\n focusOutsideTarget = focusTarget\n } else {\n restoreTriggerFocus = true\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n restoreTriggerFocus = false\n focusOutsideTarget = target\n }\n }}\n onEscapeKeyDown={() => {\n restoreTriggerFocus = true\n }}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (open) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus\n const focusTarget = focusOutsideTarget\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // the menu's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || open) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so the menu must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>","modal={false}","onOpenChange={(next: boolean) => {\n if (next !== open) focusLifecycleVersion += 1\n open = next\n setMenuOpen(next)\n if (next) {\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n }\n }}","<DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${props.label}: ${selectedName()}`}\n disabled={props.disabled || props.options.length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>","ref={setTriggerElement}","as={Button}","variant=\"outline\"","size=\"sm\"","class=\"w-full justify-between sm:w-52\"","<PalettePreview theme={props.triggerPreview} />","<span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>","<ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />","class=\"shrink-0 text-muted-foreground\"","<DropdownMenuContent\n portalMount={portalMount()}\n // A fixed height with its own scroll: an adaptive cap measured the\n // host panel instead, and opening a long theme list scrolled the\n // sidebar to reveal the menu. The content scrolls internally at the\n // cap, so the panel around the trigger never moves. Width still\n // follows content (at least the trigger width, never wider than the\n // popper allows) so long theme names render in full with padding for\n // the selection indicator instead of truncating at the anchor width.\n class=\"max-h-80 w-max min-w-(--anchor-width) max-w-(--available-width) overflow-x-hidden overflow-y-auto\"\n tabKey=\"leave\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = tabStopAt(target)\n if (focusTarget) {\n restoreTriggerFocus = false\n focusOutsideTarget = focusTarget\n } else {\n restoreTriggerFocus = true\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n restoreTriggerFocus = false\n focusOutsideTarget = target\n }\n }}\n onEscapeKeyDown={() => {\n restoreTriggerFocus = true\n }}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (open) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus\n const focusTarget = focusOutsideTarget\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // the menu's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || open) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so the menu must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>","class=\"max-h-80 w-max min-w-(--anchor-width) max-w-(--available-width) overflow-x-hidden overflow-y-auto\"","tabKey=\"leave\"","onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = tabStopAt(target)\n if (focusTarget) {\n restoreTriggerFocus = false\n focusOutsideTarget = focusTarget\n } else {\n restoreTriggerFocus = true\n }\n }}","onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n restoreTriggerFocus = false\n focusOutsideTarget = target\n }\n }}","onEscapeKeyDown={() => {\n restoreTriggerFocus = true\n }}","onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (open) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus\n const focusTarget = focusOutsideTarget\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // the menu's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || open) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so the menu must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}","<DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>","onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}","<For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>","<DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>","closeOnSelect={true}","<ThemeMenuPreview theme={option.preview} />","<div ref={setPortalMount}>\n <DropdownMenu\n modal={false}\n open={menuOpen()}\n onOpenChange={(next: boolean) => {\n if (next !== open) focusLifecycleVersion += 1\n open = next\n setMenuOpen(next)\n if (next) {\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n }\n }}\n >\n <DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${props.label}: ${selectedName()}`}\n disabled={props.disabled || props.options.length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n portalMount={portalMount()}\n // A fixed height with its own scroll: an adaptive cap measured the\n // host panel instead, and opening a long theme list scrolled the\n // sidebar to reveal the menu. The content scrolls internally at the\n // cap, so the panel around the trigger never moves. Width still\n // follows content (at least the trigger width, never wider than the\n // popper allows) so long theme names render in full with padding for\n // the selection indicator instead of truncating at the anchor width.\n class=\"max-h-80 w-max min-w-(--anchor-width) max-w-(--available-width) overflow-x-hidden overflow-y-auto\"\n tabKey=\"leave\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = tabStopAt(target)\n if (focusTarget) {\n restoreTriggerFocus = false\n focusOutsideTarget = focusTarget\n } else {\n restoreTriggerFocus = true\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n restoreTriggerFocus = false\n focusOutsideTarget = target\n }\n }}\n onEscapeKeyDown={() => {\n restoreTriggerFocus = true\n }}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (open) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus\n const focusTarget = focusOutsideTarget\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // the menu's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || open) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so the menu must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>","<SettingsRow title={label()} icon={props.appearance === 'light' ? <Sun /> : <Moon />}>\n <ThemeSelectMenu\n label={label()}\n selectedId={props.selectedId}\n triggerPreview={props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>","props.appearance === 'light' ? <Sun /> : <Moon />","<Sun />","<Moon />","<ThemeSelectMenu\n label={label()}\n selectedId={props.selectedId}\n triggerPreview={props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />","<PinnedThemeRow {...props} title=\"Terminal\" subject=\"The terminal\" icon={<SquareTerminal />} />","title=\"Terminal\"","subject=\"The terminal\"","<SquareTerminal />","<PinnedThemeRow {...props} title=\"Code\" subject=\"Code\" icon={<Code />} />","title=\"Code\"","subject=\"Code\"","<Code />","<SettingsRow\n title={props.sectioned ? 'Theme' : props.title}\n icon={props.icon}\n description={props.sectioned ? undefined : description()}\n >\n <ThemeSelectMenu\n label={props.title}\n selectedId={props.selectedId}\n triggerPreview={selectedOption()?.preview ?? props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>","props.sectioned ? 'Theme' : props.title","props.sectioned ? undefined : description()","<ThemeSelectMenu\n label={props.title}\n selectedId={props.selectedId}\n triggerPreview={selectedOption()?.preview ?? props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />","ChevronDown","LucideChevronDown","Code","LucideCode","Moon","LucideMoon","SquareTerminal","LucideSquareTerminal","Sun","LucideSun","_$readShallow"],"sources":["../../../../src/components/composites/appearance-editor/appearance-rows.tsx"],"sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2026 Wing\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n// Retains the compact divided row and palette-preview selector from the pinned\n// Zeron/Adea composition; the menu primitive owns option navigation and nested dismissal.\n// One shared menu serves the light, dark, and terminal rows: each option is a\n// compact theme preview with its name and one-line description beside it, and\n// the menu sizes to that content instead of clipping it at the trigger width.\nimport type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'\nimport { For, Show, createMemo, createSignal, onCleanup } from 'solid-js'\nimport { type JSX } from '@solidjs/web'\nimport {\n ChevronDown as LucideChevronDown,\n Code as LucideCode,\n Moon as LucideMoon,\n SquareTerminal as LucideSquareTerminal,\n Sun as LucideSun,\n} from '@lucide/solid'\nimport { cn } from '#lib/utils'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\nimport { Button } from '../../ui/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n tabStopAt,\n} from '../../ui/dropdown-menu/dropdown-menu'\nimport { PalettePreview, ThemeMenuPreview } from './theme-preview'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst Code = fastIcon(LucideCode)\nconst Moon = fastIcon(LucideMoon)\nconst SquareTerminal = fastIcon(LucideSquareTerminal)\nconst Sun = fastIcon(LucideSun)\n\nexport function SettingsRow(props: {\n title: string\n icon: JSX.Element\n description?: JSX.Element\n stacked?: boolean\n children: JSX.Element\n}) {\n return (\n <section\n class={cn('flex gap-3 px-4 py-4', {\n 'flex-col': props.stacked,\n 'flex-wrap items-center': !props.stacked,\n })}\n >\n {/* Reserve readable copy before choosing a side-by-side control row.\n Wrapping follows the actual host width and enlarged text, rather\n than a viewport breakpoint that also matches a narrow popover. */}\n <div class={cn('flex min-w-0 flex-1 items-center gap-3', { 'basis-48': !props.stacked })}>\n <span\n class=\"flex size-9 shrink-0 items-center justify-center rounded-lg border bg-foreground/5 text-muted-foreground [&_svg]:size-4\"\n aria-hidden=\"true\"\n >\n {props.icon}\n </span>\n <div class=\"min-w-0\">\n <h3 class=\"text-sm font-medium\">{props.title}</h3>\n <Show when={props.description}>\n {(descriptionSlot) => (\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</div>\n )}\n </Show>\n </div>\n </div>\n <div class=\"min-w-0 max-w-full shrink-0\">{props.children}</div>\n </section>\n )\n}\n\n/** One selectable palette in a theme menu. */\nexport type ThemeOption = {\n id: string\n name: string\n description?: string\n preview: AdeaTheme\n}\n\n/**\n * The shared theme picker. The menu primitive handles menu navigation and dismissal; Tab\n * leaves the menu for the adjacent stop (`tabKey=\"leave\"`). The menu width\n * follows its content (bounded by the popper's available width) so a long\n * theme name and its description render fully instead of truncating at the\n * trigger's width.\n */\nfunction ThemeSelectMenu(props: {\n /** Row title; prefixes the trigger's accessible name and labels the group. */\n label: string\n selectedId: string\n /** Palette shown on the trigger; hosts pass the accent-applied preview. */\n triggerPreview: AdeaTheme\n options: readonly ThemeOption[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const [portalMount, setPortalMount] = createSignal<HTMLDivElement>()\n const [triggerElement, setTriggerElement] = createSignal<HTMLButtonElement>()\n // Focus bookkeeping the dismissal handlers share. Plain variables, not\n // signals: the handlers run back to back within one close (Escape, then the\n // focus return) and a signal read would still see the value from before the\n // last write until the next flush. Only `menuOpen` is drawn, so it alone is\n // also a signal.\n const [menuOpen, setMenuOpen] = createSignal(false)\n let open = false\n let focusOutsideTarget: HTMLElement | undefined\n let restoreTriggerFocus = false\n let focusLifecycleVersion = 0\n onCleanup(() => {\n focusLifecycleVersion += 1\n })\n const selected = createMemo(() => {\n const options = props.options\n const selectedId = props.selectedId\n const matched = options.find((option) => option.id === selectedId)\n if (matched) return matched\n const previewId = props.triggerPreview.id\n return options.find((option) => option.id === previewId)\n })\n const selectedName = () => selected()?.name ?? props.triggerPreview.name\n\n return (\n <div ref={setPortalMount}>\n <DropdownMenu\n modal={false}\n open={menuOpen()}\n onOpenChange={(next: boolean) => {\n if (next !== open) focusLifecycleVersion += 1\n open = next\n setMenuOpen(next)\n if (next) {\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n }\n }}\n >\n <DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${props.label}: ${selectedName()}`}\n disabled={props.disabled || props.options.length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n portalMount={portalMount()}\n // A fixed height with its own scroll: an adaptive cap measured the\n // host panel instead, and opening a long theme list scrolled the\n // sidebar to reveal the menu. The content scrolls internally at the\n // cap, so the panel around the trigger never moves. Width still\n // follows content (at least the trigger width, never wider than the\n // popper allows) so long theme names render in full with padding for\n // the selection indicator instead of truncating at the anchor width.\n class=\"max-h-80 w-max min-w-(--anchor-width) max-w-(--available-width) overflow-x-hidden overflow-y-auto\"\n tabKey=\"leave\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = tabStopAt(target)\n if (focusTarget) {\n restoreTriggerFocus = false\n focusOutsideTarget = focusTarget\n } else {\n restoreTriggerFocus = true\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n restoreTriggerFocus = false\n focusOutsideTarget = target\n }\n }}\n onEscapeKeyDown={() => {\n restoreTriggerFocus = true\n }}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (open) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus\n const focusTarget = focusOutsideTarget\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // the menu's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || open) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so the menu must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n )\n}\n\n/**\n * A compact persistent theme choice for one appearance.\n */\nexport function ThemeRow(props: {\n appearance: 'light' | 'dark'\n selectedId: string\n preview: AdeaTheme\n themes: readonly AdeaThemeRecord[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const label = () => (props.appearance === 'light' ? 'Light theme' : 'Dark theme')\n const options = createMemo<ThemeOption[]>(() =>\n props.themes\n .filter((theme) => theme.appearance === props.appearance)\n .map((theme) => ({\n id: theme.id,\n name: theme.name,\n description: theme.description,\n preview: theme,\n }))\n )\n return (\n <SettingsRow title={label()} icon={props.appearance === 'light' ? <Sun /> : <Moon />}>\n <ThemeSelectMenu\n label={label()}\n selectedId={props.selectedId}\n triggerPreview={props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>\n )\n}\n\n/**\n * A terminal palette choice independent of the light/dark rows. The first\n * option (`'theme'`) follows the interface theme, painted with the resolved\n * preview; every catalogue record follows, both appearances, because the\n * terminal paints one fixed ANSI palette rather than an appearance axis.\n */\nexport function TerminalRow(props: PinnedThemeRowProps) {\n return (\n <PinnedThemeRow {...props} title=\"Terminal\" subject=\"The terminal\" icon={<SquareTerminal />} />\n )\n}\n\n/**\n * The code palette (editor, diff and file views), chosen the same way as the\n * terminal: `'theme'` follows the interface theme, any catalogue record pins\n * that theme's syntax colours and the canvas they were measured on.\n */\nexport function CodeRow(props: PinnedThemeRowProps) {\n return <PinnedThemeRow {...props} title=\"Code\" subject=\"Code\" icon={<Code />} />\n}\n\ntype PinnedThemeRowProps = {\n selectedId: string\n /** Resolved interface theme: the `theme` option's palette and the fallback. */\n preview: AdeaTheme\n themes: readonly AdeaThemeRecord[]\n disabled?: boolean\n /**\n * The row sits under a tab that already names its subject, so it is titled\n * for what it sets (\"Theme\") and carries no description. The menu keeps the\n * subject in its accessible name.\n */\n sectioned?: boolean\n onSelect: (id: string) => void\n}\n\nfunction PinnedThemeRow(\n props: PinnedThemeRowProps & { title: string; subject: string; icon: JSX.Element }\n) {\n const options = createMemo<ThemeOption[]>(() => [\n {\n id: THEME_DEFAULT_ID,\n name: 'UI theme',\n description: 'Uses the interface theme.',\n preview: props.preview,\n },\n ...props.themes.map((theme) => ({\n id: theme.id,\n name: theme.name,\n description: theme.description,\n preview: theme,\n })),\n ])\n const selectedOption = createMemo(() => {\n const selectedId = props.selectedId\n return options().find((option) => option.id === selectedId)\n })\n const description = () => {\n const option = selectedOption()\n return option && option.id !== THEME_DEFAULT_ID\n ? `${props.subject} follows ${option.name}.`\n : `${props.subject} follows the interface theme.`\n }\n return (\n <SettingsRow\n title={props.sectioned ? 'Theme' : props.title}\n icon={props.icon}\n description={props.sectioned ? undefined : description()}\n >\n <ThemeSelectMenu\n label={props.title}\n selectedId={props.selectedId}\n triggerPreview={selectedOption()?.preview ?? props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqDA,IAAMgD,gBAAc,SAASC,WAAiB;AAC9C,IAAMC,SAAO,SAASC,IAAU;AAChC,IAAMC,SAAO,SAASC,IAAU;AAChC,IAAMC,mBAAiB,SAASC,cAAoB;AACpD,IAAMC,QAAM,SAASC,GAAS;AAE9B,SAAgB,YAAY,OAMzB;CAEC,IAAA,OAAA,OA0BS;CAjBP,IAAA,QAAA,KAAA;CACE,IAAA,QAAA,MAAA;CAMA,IAAA,QAAA,MAAA;CACE,IAAA,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|
|
1
|
+
{"version":3,"file":"appearance-rows.js","names":["<Show when={props.description}>\n {(descriptionSlot) => (\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</div>\n )}\n </Show>","class={cn('flex min-w-0 flex-1 items-center gap-3', {\n 'basis-48': !props.stacked && !props.compact,\n 'basis-24': !props.stacked && props.compact,\n })}","<section\n class={cn('flex gap-3 px-4 py-4', {\n 'flex-col': props.stacked,\n 'flex-wrap items-center': !props.stacked,\n })}\n >\n {/* Reserve readable copy before choosing a side-by-side control row.\n Wrapping follows the actual host width and enlarged text, rather\n than a viewport breakpoint that also matches a narrow popover. */}\n <div\n class={cn('flex min-w-0 flex-1 items-center gap-3', {\n 'basis-48': !props.stacked && !props.compact,\n 'basis-24': !props.stacked && props.compact,\n })}\n >\n <span\n class=\"flex size-9 shrink-0 items-center justify-center rounded-lg border bg-foreground/5 text-muted-foreground [&_svg]:size-4\"\n aria-hidden=\"true\"\n >\n {props.icon}\n </span>\n <div class=\"min-w-0\">\n <h3 class=\"text-sm font-medium\">{props.title}</h3>\n <Show when={props.description}>\n {(descriptionSlot) => (\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</div>\n )}\n </Show>\n </div>\n </div>\n <div class=\"min-w-0 max-w-full shrink-0\">{props.children}</div>\n </section>","ref={setPortalMount}","<DropdownMenu\n modal={false}\n open={menuOpen()}\n onOpenChange={(next: boolean) => {\n if (next !== open) focusLifecycleVersion += 1\n open = next\n setMenuOpen(next)\n if (next) {\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n }\n }}\n >\n <DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${props.label}: ${selectedName()}`}\n disabled={props.disabled || props.options.length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n portalMount={portalMount()}\n // A fixed height with its own scroll: an adaptive cap measured the\n // host panel instead, and opening a long theme list scrolled the\n // sidebar to reveal the menu. The content scrolls internally at the\n // cap, so the panel around the trigger never moves. Width still\n // follows content (at least the trigger width, never wider than the\n // popper allows) so long theme names render in full with padding for\n // the selection indicator instead of truncating at the anchor width.\n class=\"max-h-80 w-max min-w-(--anchor-width) max-w-(--available-width) overflow-x-hidden overflow-y-auto\"\n tabKey=\"leave\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = tabStopAt(target)\n if (focusTarget) {\n restoreTriggerFocus = false\n focusOutsideTarget = focusTarget\n } else {\n restoreTriggerFocus = true\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n restoreTriggerFocus = false\n focusOutsideTarget = target\n }\n }}\n onEscapeKeyDown={() => {\n restoreTriggerFocus = true\n }}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (open) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus\n const focusTarget = focusOutsideTarget\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // the menu's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || open) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so the menu must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>","modal={false}","onOpenChange={(next: boolean) => {\n if (next !== open) focusLifecycleVersion += 1\n open = next\n setMenuOpen(next)\n if (next) {\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n }\n }}","<DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${props.label}: ${selectedName()}`}\n disabled={props.disabled || props.options.length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>","ref={setTriggerElement}","as={Button}","variant=\"outline\"","size=\"sm\"","class=\"w-full justify-between sm:w-52\"","<PalettePreview theme={props.triggerPreview} />","<span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>","<ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />","class=\"shrink-0 text-muted-foreground\"","<DropdownMenuContent\n portalMount={portalMount()}\n // A fixed height with its own scroll: an adaptive cap measured the\n // host panel instead, and opening a long theme list scrolled the\n // sidebar to reveal the menu. The content scrolls internally at the\n // cap, so the panel around the trigger never moves. Width still\n // follows content (at least the trigger width, never wider than the\n // popper allows) so long theme names render in full with padding for\n // the selection indicator instead of truncating at the anchor width.\n class=\"max-h-80 w-max min-w-(--anchor-width) max-w-(--available-width) overflow-x-hidden overflow-y-auto\"\n tabKey=\"leave\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = tabStopAt(target)\n if (focusTarget) {\n restoreTriggerFocus = false\n focusOutsideTarget = focusTarget\n } else {\n restoreTriggerFocus = true\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n restoreTriggerFocus = false\n focusOutsideTarget = target\n }\n }}\n onEscapeKeyDown={() => {\n restoreTriggerFocus = true\n }}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (open) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus\n const focusTarget = focusOutsideTarget\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // the menu's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || open) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so the menu must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>","class=\"max-h-80 w-max min-w-(--anchor-width) max-w-(--available-width) overflow-x-hidden overflow-y-auto\"","tabKey=\"leave\"","onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = tabStopAt(target)\n if (focusTarget) {\n restoreTriggerFocus = false\n focusOutsideTarget = focusTarget\n } else {\n restoreTriggerFocus = true\n }\n }}","onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n restoreTriggerFocus = false\n focusOutsideTarget = target\n }\n }}","onEscapeKeyDown={() => {\n restoreTriggerFocus = true\n }}","onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (open) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus\n const focusTarget = focusOutsideTarget\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // the menu's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || open) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so the menu must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}","<DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>","onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}","<For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>","<DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>","closeOnSelect={true}","<ThemeMenuPreview theme={option.preview} />","<div ref={setPortalMount}>\n <DropdownMenu\n modal={false}\n open={menuOpen()}\n onOpenChange={(next: boolean) => {\n if (next !== open) focusLifecycleVersion += 1\n open = next\n setMenuOpen(next)\n if (next) {\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n }\n }}\n >\n <DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${props.label}: ${selectedName()}`}\n disabled={props.disabled || props.options.length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n portalMount={portalMount()}\n // A fixed height with its own scroll: an adaptive cap measured the\n // host panel instead, and opening a long theme list scrolled the\n // sidebar to reveal the menu. The content scrolls internally at the\n // cap, so the panel around the trigger never moves. Width still\n // follows content (at least the trigger width, never wider than the\n // popper allows) so long theme names render in full with padding for\n // the selection indicator instead of truncating at the anchor width.\n class=\"max-h-80 w-max min-w-(--anchor-width) max-w-(--available-width) overflow-x-hidden overflow-y-auto\"\n tabKey=\"leave\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = tabStopAt(target)\n if (focusTarget) {\n restoreTriggerFocus = false\n focusOutsideTarget = focusTarget\n } else {\n restoreTriggerFocus = true\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n restoreTriggerFocus = false\n focusOutsideTarget = target\n }\n }}\n onEscapeKeyDown={() => {\n restoreTriggerFocus = true\n }}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (open) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus\n const focusTarget = focusOutsideTarget\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // the menu's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || open) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so the menu must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>","<SettingsRow title={label()} icon={props.appearance === 'light' ? <Sun /> : <Moon />}>\n <ThemeSelectMenu\n label={label()}\n selectedId={props.selectedId}\n triggerPreview={props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>","props.appearance === 'light' ? <Sun /> : <Moon />","<Sun />","<Moon />","<ThemeSelectMenu\n label={label()}\n selectedId={props.selectedId}\n triggerPreview={props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />","<PinnedThemeRow {...props} title=\"Terminal\" subject=\"The terminal\" icon={<SquareTerminal />} />","title=\"Terminal\"","subject=\"The terminal\"","<SquareTerminal />","<PinnedThemeRow {...props} title=\"Code\" subject=\"Code\" icon={<Code />} />","title=\"Code\"","subject=\"Code\"","<Code />","<SettingsRow\n title={props.sectioned ? 'Theme' : props.title}\n icon={props.icon}\n description={props.sectioned ? undefined : description()}\n >\n <ThemeSelectMenu\n label={props.title}\n selectedId={props.selectedId}\n triggerPreview={selectedOption()?.preview ?? props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>","props.sectioned ? 'Theme' : props.title","props.sectioned ? undefined : description()","<ThemeSelectMenu\n label={props.title}\n selectedId={props.selectedId}\n triggerPreview={selectedOption()?.preview ?? props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />","ChevronDown","LucideChevronDown","Code","LucideCode","Moon","LucideMoon","SquareTerminal","LucideSquareTerminal","Sun","LucideSun","_$readShallow"],"sources":["../../../../src/components/composites/appearance-editor/appearance-rows.tsx"],"sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2026 Wing\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n// Retains the compact divided row and palette-preview selector from the pinned\n// Zeron/Adea composition; the menu primitive owns option navigation and nested dismissal.\n// One shared menu serves the light, dark, and terminal rows: each option is a\n// compact theme preview with its name and one-line description beside it, and\n// the menu sizes to that content instead of clipping it at the trigger width.\nimport type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'\nimport { For, Show, createMemo, createSignal, onCleanup } from 'solid-js'\nimport { type JSX } from '@solidjs/web'\nimport {\n ChevronDown as LucideChevronDown,\n Code as LucideCode,\n Moon as LucideMoon,\n SquareTerminal as LucideSquareTerminal,\n Sun as LucideSun,\n} from '@lucide/solid'\nimport { cn } from '#lib/utils'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\nimport { Button } from '../../ui/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n tabStopAt,\n} from '../../ui/dropdown-menu/dropdown-menu'\nimport { PalettePreview, ThemeMenuPreview } from './theme-preview'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst Code = fastIcon(LucideCode)\nconst Moon = fastIcon(LucideMoon)\nconst SquareTerminal = fastIcon(LucideSquareTerminal)\nconst Sun = fastIcon(LucideSun)\n\nexport function SettingsRow(props: {\n title: string\n icon: JSX.Element\n description?: JSX.Element\n stacked?: boolean\n /** A short title with no subtitle: the control keeps the title's line at a narrow width. */\n compact?: boolean\n children: JSX.Element\n}) {\n return (\n <section\n class={cn('flex gap-3 px-4 py-4', {\n 'flex-col': props.stacked,\n 'flex-wrap items-center': !props.stacked,\n })}\n >\n {/* Reserve readable copy before choosing a side-by-side control row.\n Wrapping follows the actual host width and enlarged text, rather\n than a viewport breakpoint that also matches a narrow popover. */}\n <div\n class={cn('flex min-w-0 flex-1 items-center gap-3', {\n 'basis-48': !props.stacked && !props.compact,\n 'basis-24': !props.stacked && props.compact,\n })}\n >\n <span\n class=\"flex size-9 shrink-0 items-center justify-center rounded-lg border bg-foreground/5 text-muted-foreground [&_svg]:size-4\"\n aria-hidden=\"true\"\n >\n {props.icon}\n </span>\n <div class=\"min-w-0\">\n <h3 class=\"text-sm font-medium\">{props.title}</h3>\n <Show when={props.description}>\n {(descriptionSlot) => (\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</div>\n )}\n </Show>\n </div>\n </div>\n <div class=\"min-w-0 max-w-full shrink-0\">{props.children}</div>\n </section>\n )\n}\n\n/** One selectable palette in a theme menu. */\nexport type ThemeOption = {\n id: string\n name: string\n description?: string\n preview: AdeaTheme\n}\n\n/**\n * The shared theme picker. The menu primitive handles menu navigation and dismissal; Tab\n * leaves the menu for the adjacent stop (`tabKey=\"leave\"`). The menu width\n * follows its content (bounded by the popper's available width) so a long\n * theme name and its description render fully instead of truncating at the\n * trigger's width.\n */\nfunction ThemeSelectMenu(props: {\n /** Row title; prefixes the trigger's accessible name and labels the group. */\n label: string\n selectedId: string\n /** Palette shown on the trigger; hosts pass the accent-applied preview. */\n triggerPreview: AdeaTheme\n options: readonly ThemeOption[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const [portalMount, setPortalMount] = createSignal<HTMLDivElement>()\n const [triggerElement, setTriggerElement] = createSignal<HTMLButtonElement>()\n // Focus bookkeeping the dismissal handlers share. Plain variables, not\n // signals: the handlers run back to back within one close (Escape, then the\n // focus return) and a signal read would still see the value from before the\n // last write until the next flush. Only `menuOpen` is drawn, so it alone is\n // also a signal.\n const [menuOpen, setMenuOpen] = createSignal(false)\n let open = false\n let focusOutsideTarget: HTMLElement | undefined\n let restoreTriggerFocus = false\n let focusLifecycleVersion = 0\n onCleanup(() => {\n focusLifecycleVersion += 1\n })\n const selected = createMemo(() => {\n const options = props.options\n const selectedId = props.selectedId\n const matched = options.find((option) => option.id === selectedId)\n if (matched) return matched\n const previewId = props.triggerPreview.id\n return options.find((option) => option.id === previewId)\n })\n const selectedName = () => selected()?.name ?? props.triggerPreview.name\n\n return (\n <div ref={setPortalMount}>\n <DropdownMenu\n modal={false}\n open={menuOpen()}\n onOpenChange={(next: boolean) => {\n if (next !== open) focusLifecycleVersion += 1\n open = next\n setMenuOpen(next)\n if (next) {\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n }\n }}\n >\n <DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${props.label}: ${selectedName()}`}\n disabled={props.disabled || props.options.length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.triggerPreview} />\n <span class=\"min-w-0 flex-1 truncate\">{selectedName()}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n portalMount={portalMount()}\n // A fixed height with its own scroll: an adaptive cap measured the\n // host panel instead, and opening a long theme list scrolled the\n // sidebar to reveal the menu. The content scrolls internally at the\n // cap, so the panel around the trigger never moves. Width still\n // follows content (at least the trigger width, never wider than the\n // popper allows) so long theme names render in full with padding for\n // the selection indicator instead of truncating at the anchor width.\n class=\"max-h-80 w-max min-w-(--anchor-width) max-w-(--available-width) overflow-x-hidden overflow-y-auto\"\n tabKey=\"leave\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = tabStopAt(target)\n if (focusTarget) {\n restoreTriggerFocus = false\n focusOutsideTarget = focusTarget\n } else {\n restoreTriggerFocus = true\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n restoreTriggerFocus = false\n focusOutsideTarget = target\n }\n }}\n onEscapeKeyDown={() => {\n restoreTriggerFocus = true\n }}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (open) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus\n const focusTarget = focusOutsideTarget\n focusOutsideTarget = undefined\n restoreTriggerFocus = false\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // the menu's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || open) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so the menu must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${props.label} options`}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={props.options}>\n {(option) => (\n <DropdownMenuRadioItem\n value={option.id}\n textValue={option.name}\n closeOnSelect={true}\n disabled={props.disabled}\n // Choosing an option returns focus to the trigger. ui-sdk's\n // menu item takes `onSelect`, and DropdownMenuRadioItem passes\n // it through, though its prop type does not list it yet.\n {...({\n onSelect: () => {\n restoreTriggerFocus = true\n },\n } as object)}\n >\n <ThemeMenuPreview theme={option.preview} />\n <span class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"truncate\">{option.name}</span>\n {/* Visual affordance only: the accessible name stays the\n theme name, which is what keyboard and test callers\n match on. */}\n <Show when={option.description}>\n <span\n aria-hidden=\"true\"\n class=\"line-clamp-2 max-w-44 text-2xs text-muted-foreground\"\n >\n {option.description}\n </span>\n </Show>\n </span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n )\n}\n\n/**\n * A compact persistent theme choice for one appearance.\n */\nexport function ThemeRow(props: {\n appearance: 'light' | 'dark'\n selectedId: string\n preview: AdeaTheme\n themes: readonly AdeaThemeRecord[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const label = () => (props.appearance === 'light' ? 'Light theme' : 'Dark theme')\n const options = createMemo<ThemeOption[]>(() =>\n props.themes\n .filter((theme) => theme.appearance === props.appearance)\n .map((theme) => ({\n id: theme.id,\n name: theme.name,\n description: theme.description,\n preview: theme,\n }))\n )\n return (\n <SettingsRow title={label()} icon={props.appearance === 'light' ? <Sun /> : <Moon />}>\n <ThemeSelectMenu\n label={label()}\n selectedId={props.selectedId}\n triggerPreview={props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>\n )\n}\n\n/**\n * A terminal palette choice independent of the light/dark rows. The first\n * option (`'theme'`) follows the interface theme, painted with the resolved\n * preview; every catalogue record follows, both appearances, because the\n * terminal paints one fixed ANSI palette rather than an appearance axis.\n */\nexport function TerminalRow(props: PinnedThemeRowProps) {\n return (\n <PinnedThemeRow {...props} title=\"Terminal\" subject=\"The terminal\" icon={<SquareTerminal />} />\n )\n}\n\n/**\n * The code palette (editor, diff and file views), chosen the same way as the\n * terminal: `'theme'` follows the interface theme, any catalogue record pins\n * that theme's syntax colours and the canvas they were measured on.\n */\nexport function CodeRow(props: PinnedThemeRowProps) {\n return <PinnedThemeRow {...props} title=\"Code\" subject=\"Code\" icon={<Code />} />\n}\n\ntype PinnedThemeRowProps = {\n selectedId: string\n /** Resolved interface theme: the `theme` option's palette and the fallback. */\n preview: AdeaTheme\n themes: readonly AdeaThemeRecord[]\n disabled?: boolean\n /**\n * The row sits under a tab that already names its subject, so it is titled\n * for what it sets (\"Theme\") and carries no description. The menu keeps the\n * subject in its accessible name.\n */\n sectioned?: boolean\n onSelect: (id: string) => void\n}\n\nfunction PinnedThemeRow(\n props: PinnedThemeRowProps & { title: string; subject: string; icon: JSX.Element }\n) {\n const options = createMemo<ThemeOption[]>(() => [\n {\n id: THEME_DEFAULT_ID,\n name: 'UI theme',\n description: 'Uses the interface theme.',\n preview: props.preview,\n },\n ...props.themes.map((theme) => ({\n id: theme.id,\n name: theme.name,\n description: theme.description,\n preview: theme,\n })),\n ])\n const selectedOption = createMemo(() => {\n const selectedId = props.selectedId\n return options().find((option) => option.id === selectedId)\n })\n const description = () => {\n const option = selectedOption()\n return option && option.id !== THEME_DEFAULT_ID\n ? `${props.subject} follows ${option.name}.`\n : `${props.subject} follows the interface theme.`\n }\n return (\n <SettingsRow\n title={props.sectioned ? 'Theme' : props.title}\n icon={props.icon}\n description={props.sectioned ? undefined : description()}\n >\n <ThemeSelectMenu\n label={props.title}\n selectedId={props.selectedId}\n triggerPreview={selectedOption()?.preview ?? props.preview}\n options={options()}\n disabled={props.disabled}\n onSelect={props.onSelect}\n />\n </SettingsRow>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqDA,IAAMgD,gBAAc,SAASC,WAAiB;AAC9C,IAAMC,SAAO,SAASC,IAAU;AAChC,IAAMC,SAAO,SAASC,IAAU;AAChC,IAAMC,mBAAiB,SAASC,cAAoB;AACpD,IAAMC,QAAM,SAASC,GAAS;AAE9B,SAAgB,YAAY,OAQzB;CAEC,IAAA,OAAA,OA+BS;CAtBP,IAAA,QAAA,KAAA;CAME,IAAA,QAAA,MAAA;CAMA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;IAAQ;IACxB,IAAA,WAAA;KAAU,OAAA,MAAM;IAAQ;GACzB,CAAA;EACU;;AAEjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-browser.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/catalog-browser/catalog-browser.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAU1D,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"catalog-browser.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/catalog-browser/catalog-browser.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAU1D,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC,sCA0QtE"}
|
|
@@ -10,14 +10,15 @@ import { CatalogBrowserGroup, CatalogLoadingState } from "./catalog-browser-grou
|
|
|
10
10
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
11
11
|
import { className, createComponent, effect, insert, memo, readShallow, setAttribute, template } from "@solidjs/web";
|
|
12
12
|
import { ArrowLeft, Blocks, Search } from "@lucide/solid";
|
|
13
|
-
import { For, Show, createEffect, createMemo, createSignal, onSettled } from "solid-js";
|
|
13
|
+
import { For, Show, children, createEffect, createMemo, createSignal, onSettled } from "solid-js";
|
|
14
14
|
// src/components/composites/catalog-browser/catalog-browser.tsx
|
|
15
15
|
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
16
16
|
var _tmpl$2 = /* @__PURE__ */ template(`<div class="flex min-h-0 min-w-0 flex-1 flex-col gap-3"data-catalog-browser-detail><!><!>`);
|
|
17
|
-
var _tmpl$3 = /* @__PURE__ */ template(`<div class="flex min-w-0 shrink-0 flex-wrap items-center gap-2 px-4 pt-2"
|
|
18
|
-
var _tmpl$4 = /* @__PURE__ */ template(`<
|
|
19
|
-
var _tmpl$5 = /* @__PURE__ */ template(`<
|
|
20
|
-
var _tmpl$6 = /* @__PURE__ */ template(`<
|
|
17
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<div class="flex min-w-0 shrink-0 flex-wrap items-center gap-2 px-4 pt-2"data-slot=catalog-browser-tabs-row><!><!>`);
|
|
18
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<div class="flex min-w-0 shrink-0 flex-wrap items-center gap-2 px-4 pt-2"><!><span class="text-primary ms-auto text-sm font-medium tabular-nums"role=status>`);
|
|
19
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<p class="text-destructive px-4 pt-2 text-sm"role=alert>`);
|
|
20
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<div class="grid min-w-0 gap-5">`);
|
|
21
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<p class="text-muted-foreground text-sm">`);
|
|
21
22
|
var ArrowLeft$1 = fastIcon(ArrowLeft);
|
|
22
23
|
var Blocks$1 = fastIcon(Blocks);
|
|
23
24
|
var Search$1 = fastIcon(Search);
|
|
@@ -90,6 +91,7 @@ function CatalogBrowser(props) {
|
|
|
90
91
|
const previewCount = () => wide() ? 6 : 3;
|
|
91
92
|
const countLabel = () => props.status === "loading" ? props.loadingLabel : props.resultLabel(props.resultCount);
|
|
92
93
|
const supplementalContent = () => props.renderSupplementalView?.(props.tab);
|
|
94
|
+
const tabsLeading = children(() => props.tabsLeading);
|
|
93
95
|
var _el$ = _tmpl$();
|
|
94
96
|
insert(_el$, (() => {
|
|
95
97
|
var _c$ = memo(() => {
|
|
@@ -134,25 +136,60 @@ function CatalogBrowser(props) {
|
|
|
134
136
|
},
|
|
135
137
|
onChange: (value) => value && props.onTabChange(value),
|
|
136
138
|
get children() {
|
|
137
|
-
return [createComponent(
|
|
138
|
-
get
|
|
139
|
-
return
|
|
139
|
+
return [createComponent(Show, {
|
|
140
|
+
get when() {
|
|
141
|
+
return tabsLeading();
|
|
140
142
|
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return props.tabs;
|
|
143
|
+
get fallback() {
|
|
144
|
+
return createComponent(TabsList, {
|
|
145
|
+
get "aria-label"() {
|
|
146
|
+
return props.tabsLabel;
|
|
146
147
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
148
|
+
class: "ms-auto max-w-full flex-wrap px-4 pt-2",
|
|
149
|
+
get children() {
|
|
150
|
+
return createComponent(For, {
|
|
151
|
+
get each() {
|
|
152
|
+
return props.tabs;
|
|
153
|
+
},
|
|
154
|
+
children: (tab) => createComponent(TabsTrigger, {
|
|
155
|
+
get value() {
|
|
156
|
+
return tab.id;
|
|
157
|
+
},
|
|
158
|
+
get children() {
|
|
159
|
+
return tab.label;
|
|
160
|
+
}
|
|
161
|
+
})
|
|
162
|
+
});
|
|
163
|
+
}
|
|
155
164
|
});
|
|
165
|
+
},
|
|
166
|
+
get children() {
|
|
167
|
+
var _el$5 = _tmpl$3();
|
|
168
|
+
var _el$6 = _el$5.firstChild;
|
|
169
|
+
var _el$7 = _el$6.nextSibling;
|
|
170
|
+
insert(_el$5, tabsLeading, _el$6);
|
|
171
|
+
insert(_el$5, createComponent(TabsList, {
|
|
172
|
+
get "aria-label"() {
|
|
173
|
+
return props.tabsLabel;
|
|
174
|
+
},
|
|
175
|
+
class: "ms-auto max-w-full flex-wrap",
|
|
176
|
+
get children() {
|
|
177
|
+
return createComponent(For, {
|
|
178
|
+
get each() {
|
|
179
|
+
return props.tabs;
|
|
180
|
+
},
|
|
181
|
+
children: (tab) => createComponent(TabsTrigger, {
|
|
182
|
+
get value() {
|
|
183
|
+
return tab.id;
|
|
184
|
+
},
|
|
185
|
+
get children() {
|
|
186
|
+
return tab.label;
|
|
187
|
+
}
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}), _el$7);
|
|
192
|
+
return _el$5;
|
|
156
193
|
}
|
|
157
194
|
}), createComponent(TabsContent, {
|
|
158
195
|
get value() {
|
|
@@ -171,19 +208,19 @@ function CatalogBrowser(props) {
|
|
|
171
208
|
return props.installError;
|
|
172
209
|
},
|
|
173
210
|
children: (message) => (() => {
|
|
174
|
-
var _el$
|
|
175
|
-
insert(_el$
|
|
176
|
-
return _el$
|
|
211
|
+
var _el$11 = _tmpl$5();
|
|
212
|
+
insert(_el$11, message);
|
|
213
|
+
return _el$11;
|
|
177
214
|
})()
|
|
178
215
|
}),
|
|
179
216
|
(() => {
|
|
180
|
-
var _el$
|
|
181
|
-
var _el$
|
|
182
|
-
var _el$
|
|
183
|
-
insert(_el$
|
|
217
|
+
var _el$8 = _tmpl$4();
|
|
218
|
+
var _el$9 = _el$8.firstChild;
|
|
219
|
+
var _el$10 = _el$9.nextSibling;
|
|
220
|
+
insert(_el$8, () => {
|
|
184
221
|
return props.filterControl;
|
|
185
|
-
}, _el$
|
|
186
|
-
insert(_el$
|
|
222
|
+
}, _el$9);
|
|
223
|
+
insert(_el$8, createComponent(InputGroup, {
|
|
187
224
|
class: "min-w-0 flex-1 sm:max-w-md",
|
|
188
225
|
get children() {
|
|
189
226
|
return [createComponent(InputGroupAddon, {
|
|
@@ -206,9 +243,9 @@ function CatalogBrowser(props) {
|
|
|
206
243
|
onInput: (event) => props.onQueryChange(event.currentTarget.value)
|
|
207
244
|
})];
|
|
208
245
|
}
|
|
209
|
-
}), _el$
|
|
210
|
-
insert(_el$
|
|
211
|
-
return _el$
|
|
246
|
+
}), _el$10);
|
|
247
|
+
insert(_el$10, countLabel);
|
|
248
|
+
return _el$8;
|
|
212
249
|
})(),
|
|
213
250
|
createComponent(ScrollArea, {
|
|
214
251
|
role: "region",
|
|
@@ -276,8 +313,8 @@ function CatalogBrowser(props) {
|
|
|
276
313
|
return memo(() => {
|
|
277
314
|
return props.resultCount > 0;
|
|
278
315
|
})() ? (() => {
|
|
279
|
-
var _el$
|
|
280
|
-
insert(_el$
|
|
316
|
+
var _el$12 = _tmpl$6();
|
|
317
|
+
insert(_el$12, createComponent(For, {
|
|
281
318
|
get each() {
|
|
282
319
|
return groupRows();
|
|
283
320
|
},
|
|
@@ -311,7 +348,7 @@ function CatalogBrowser(props) {
|
|
|
311
348
|
onToggle: toggleGroup
|
|
312
349
|
})
|
|
313
350
|
}));
|
|
314
|
-
return _el$
|
|
351
|
+
return _el$12;
|
|
315
352
|
})() : createComponent(Empty, {
|
|
316
353
|
class: "min-h-0 min-w-0 flex-1",
|
|
317
354
|
role: "status",
|
|
@@ -349,14 +386,14 @@ function CatalogBrowser(props) {
|
|
|
349
386
|
return props.notices ?? [];
|
|
350
387
|
},
|
|
351
388
|
children: (notice) => (() => {
|
|
352
|
-
var _el$
|
|
353
|
-
insert(_el$
|
|
389
|
+
var _el$13 = _tmpl$7();
|
|
390
|
+
insert(_el$13, () => {
|
|
354
391
|
return notice.message;
|
|
355
392
|
});
|
|
356
393
|
effect(() => notice.role, (_v$) => {
|
|
357
|
-
setAttribute(_el$
|
|
394
|
+
setAttribute(_el$13, "role", _v$);
|
|
358
395
|
});
|
|
359
|
-
return _el$
|
|
396
|
+
return _el$13;
|
|
360
397
|
})()
|
|
361
398
|
})
|
|
362
399
|
];
|