@adea-ai/ui 0.162.14 → 0.162.16
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/accent-picker/accent-picker.js +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/accent-picker/custom-color-popover.js +1 -1
- package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +2 -2
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +1 -1
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +1 -1
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/settings/settings.js +1 -1
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/tree/tree.js +1 -1
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/conversation/thread-panel.js +1 -1
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js +1 -1
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +1 -1
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +2 -2
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/ui/accordion/accordion.js +1 -1
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/attachment/attachment.js +2 -2
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/board/board.js +2 -2
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/button/button.js +1 -1
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +1 -1
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible/collapsible.js +1 -1
- package/dist/components/ui/collapsible/collapsible.js.map +1 -1
- package/dist/components/ui/combobox/combobox.js +3 -3
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/field/field.js +2 -2
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/input/input-control.js +1 -1
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input-group/input-group.js +1 -1
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-otp/input-otp.js +1 -1
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/menubar/menubar.js +1 -1
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/native-select/native-select.js +1 -1
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js +1 -1
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +2 -2
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/ui/select/select.js +1 -1
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/slider/slider.js +1 -1
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/switch/switch.js +1 -1
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/tabs/tabs.js +1 -1
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/text-link/text-link.js +1 -1
- package/dist/components/ui/text-link/text-link.js.map +1 -1
- package/dist/components/ui/textarea/textarea.js +1 -1
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.js +1 -1
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/trace/trace.js +1 -1
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +1 -1
- package/dist/lib/overlay.js.map +1 -1
- package/dist/lib/tokens.d.ts.map +1 -1
- package/dist/lib/tokens.js +2 -2
- package/dist/lib/tokens.js.map +1 -1
- package/dist/lib/variants.d.ts +1 -1
- package/dist/lib/variants.d.ts.map +1 -1
- package/dist/lib/variants.js +1 -1
- package/dist/lib/variants.js.map +1 -1
- package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +1 -1
- package/dist/r/src/components/composites/accent-picker/custom-color-popover.tsx +1 -1
- package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +1 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +2 -5
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +1 -1
- package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +1 -1
- package/dist/r/src/components/composites/list-row/list-row-control.tsx +1 -1
- package/dist/r/src/components/composites/settings/settings.tsx +1 -1
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +1 -1
- package/dist/r/src/components/composites/tree/tree.tsx +1 -1
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
- package/dist/r/src/components/conversation/thread-panel.tsx +1 -1
- package/dist/r/src/components/layout/app-shell/skip-link.tsx +1 -1
- package/dist/r/src/components/layout/side-rail/side-rail.tsx +1 -1
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +1 -1
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +1 -1
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +2 -2
- package/dist/r/src/components/ui/accordion/accordion.tsx +1 -1
- package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +1 -1
- package/dist/r/src/components/ui/attachment/attachment.tsx +2 -2
- package/dist/r/src/components/ui/board/board.tsx +2 -2
- package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +1 -1
- package/dist/r/src/components/ui/button/button.tsx +1 -1
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +1 -1
- package/dist/r/src/components/ui/collapsible/collapsible.tsx +1 -1
- package/dist/r/src/components/ui/combobox/combobox.tsx +3 -3
- package/dist/r/src/components/ui/field/field.tsx +2 -2
- package/dist/r/src/components/ui/input/input-control.tsx +1 -1
- package/dist/r/src/components/ui/input-group/input-group.tsx +1 -1
- package/dist/r/src/components/ui/input-otp/input-otp.tsx +1 -1
- package/dist/r/src/components/ui/menubar/menubar.tsx +1 -1
- package/dist/r/src/components/ui/native-select/native-select.tsx +1 -1
- package/dist/r/src/components/ui/pagination/pagination.tsx +1 -1
- package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +1 -1
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +2 -2
- package/dist/r/src/components/ui/scroll-area/scroll-area.tsx +1 -1
- package/dist/r/src/components/ui/select/select.tsx +1 -1
- package/dist/r/src/components/ui/slider/slider.tsx +1 -1
- package/dist/r/src/components/ui/switch/switch.tsx +1 -1
- package/dist/r/src/components/ui/tabs/tabs.tsx +1 -1
- package/dist/r/src/components/ui/text-link/text-link.tsx +1 -1
- package/dist/r/src/components/ui/textarea/textarea.tsx +1 -1
- package/dist/r/src/components/ui/toast/toast.tsx +1 -1
- package/dist/r/src/components/ui/trace/trace.tsx +1 -1
- package/dist/r/src/lib/overlay.ts +1 -1
- package/dist/r/src/lib/tokens.ts +4 -2
- package/dist/r/src/lib/variants.ts +1 -1
- package/dist/r/src/styles/base.css +35 -7
- package/dist/vite/tailwind-sources.d.ts.map +1 -1
- package/dist/vite/tailwind-sources.js +16 -5
- package/dist/vite/tailwind-sources.js.map +1 -1
- package/package.json +1 -1
- package/src/components/composites/accent-picker/accent-picker.tsx +1 -1
- package/src/components/composites/accent-picker/custom-color-popover.tsx +1 -1
- package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +1 -1
- package/src/components/composites/appearance-editor/appearance-choices.tsx +2 -5
- package/src/components/composites/confirmation/confirmation.tsx +1 -1
- package/src/components/composites/icon-picker/icon-picker.tsx +1 -1
- package/src/components/composites/list-row/list-row-control.tsx +1 -1
- package/src/components/composites/settings/settings.tsx +1 -1
- package/src/components/composites/stack-trace/stack-trace.tsx +1 -1
- package/src/components/composites/tree/tree.tsx +1 -1
- package/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
- package/src/components/conversation/thread-panel.tsx +1 -1
- package/src/components/layout/app-shell/skip-link.tsx +1 -1
- package/src/components/layout/side-rail/side-rail.tsx +1 -1
- package/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +1 -1
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +1 -1
- package/src/components/layout/top-bar/top-bar.tsx +2 -2
- package/src/components/ui/accordion/accordion.tsx +1 -1
- package/src/components/ui/annotation-surface/annotation-surface.tsx +1 -1
- package/src/components/ui/attachment/attachment.tsx +2 -2
- package/src/components/ui/board/board.tsx +2 -2
- package/src/components/ui/breadcrumb/breadcrumb.tsx +1 -1
- package/src/components/ui/button/button.tsx +1 -1
- package/src/components/ui/checkbox/checkbox.tsx +1 -1
- package/src/components/ui/collapsible/collapsible.tsx +1 -1
- package/src/components/ui/combobox/combobox.tsx +3 -3
- package/src/components/ui/field/field.tsx +2 -2
- package/src/components/ui/input/input-control.tsx +1 -1
- package/src/components/ui/input-group/input-group.tsx +1 -1
- package/src/components/ui/input-otp/input-otp.tsx +1 -1
- package/src/components/ui/menubar/menubar.tsx +1 -1
- package/src/components/ui/native-select/native-select.tsx +1 -1
- package/src/components/ui/pagination/pagination.tsx +1 -1
- package/src/components/ui/questionnaire/questionnaire.tsx +1 -1
- package/src/components/ui/radio-group/radio-group.tsx +2 -2
- package/src/components/ui/scroll-area/scroll-area.tsx +1 -1
- package/src/components/ui/select/select.tsx +1 -1
- package/src/components/ui/slider/slider.tsx +1 -1
- package/src/components/ui/switch/switch.tsx +1 -1
- package/src/components/ui/tabs/tabs.tsx +1 -1
- package/src/components/ui/text-link/text-link.tsx +1 -1
- package/src/components/ui/textarea/textarea.tsx +1 -1
- package/src/components/ui/toast/toast.tsx +1 -1
- package/src/components/ui/trace/trace.tsx +1 -1
- package/src/lib/overlay.ts +1 -1
- package/src/lib/tokens.ts +4 -2
- package/src/lib/variants.ts +1 -1
- package/src/styles/base.css +35 -7
- package/src/vite/tailwind-sources.ts +20 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance-choices.js","names":["<SdkRadioGroup\n value={props.draft.mode}\n disabled={props.saving}\n aria-label=\"Appearance mode\"\n onValueChange={(mode) => {\n const option = MODES.find((candidate) => candidate.value === mode)\n if (option) props.onChange({ mode: option.value })\n }}\n class=\"grid grid-cols-1 gap-3 px-4 py-4 sm:grid-cols-3\"\n >\n <For each={MODES}>\n {(option) => {\n const Icon = MODE_ICONS[option.value]\n return (\n <div\n data-mode={option.value}\n class=\"min-w-0 rounded-lg focus-within:ring-3 focus-within:ring-ring/50\"\n >\n <SdkRadio\n value={option.value}\n class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n <span class=\"block h-20 w-full\">\n <Show\n when={option.value === 'system'}\n fallback={\n <ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />\n }\n >\n <ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />\n </Show>\n </span>\n {/* The glyph names the axis beside the miniature, so the cards read\n like ThemeModeToggle without losing the previews. */}\n <Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>\n </SdkRadio>\n </div>\n )\n }}\n </For>\n </SdkRadioGroup>","onValueChange={(mode) => {\n const option = MODES.find((candidate) => candidate.value === mode)\n if (option) props.onChange({ mode: option.value })\n }}","class=\"grid grid-cols-1 gap-3 px-4 py-4 sm:grid-cols-3\"","<For each={MODES}>\n {(option) => {\n const Icon = MODE_ICONS[option.value]\n return (\n <div\n data-mode={option.value}\n class=\"min-w-0 rounded-lg focus-within:ring-3 focus-within:ring-ring/50\"\n >\n <SdkRadio\n value={option.value}\n class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n <span class=\"block h-20 w-full\">\n <Show\n when={option.value === 'system'}\n fallback={\n <ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />\n }\n >\n <ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />\n </Show>\n </span>\n {/* The glyph names the axis beside the miniature, so the cards read\n like ThemeModeToggle without losing the previews. */}\n <Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>\n </SdkRadio>\n </div>\n )\n }}\n </For>","each={MODES}","<SdkRadio\n value={option.value}\n class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n <span class=\"block h-20 w-full\">\n <Show\n when={option.value === 'system'}\n fallback={\n <ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />\n }\n >\n <ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />\n </Show>\n </span>\n {/* The glyph names the axis beside the miniature, so the cards read\n like ThemeModeToggle without losing the previews. */}\n <Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>\n </SdkRadio>","class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"","<ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />","<ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />","option.value === 'light' ? props.lightTheme : props.darkTheme","<Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>","<span>{option.label}</span>","<Icon aria-hidden=\"true\" class=\"size-3.5\" />","class=\"size-3.5\"","<span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>","<div\n data-mode={option.value}\n class=\"min-w-0 rounded-lg focus-within:ring-3 focus-within:ring-ring/50\"\n >\n <SdkRadio\n value={option.value}\n class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n <span class=\"block h-20 w-full\">\n <Show\n when={option.value === 'system'}\n fallback={\n <ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />\n }\n >\n <ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />\n </Show>\n </span>\n {/* The glyph names the axis beside the miniature, so the cards read\n like ThemeModeToggle without losing the previews. */}\n <Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>\n </SdkRadio>\n </div>","<Show\n when={entryStyle() === 'row'}\n fallback={\n <SdkRadioGroup\n value={accentSelection()}\n disabled={props.saving}\n aria-label=\"Accent\"\n class=\"flex flex-col items-start gap-3\"\n onValueChange={(accent) => {\n if (accent === null) return\n props.onChange({\n accent: accent === 'custom' ? (props.customAccentValue ?? '') : accent,\n })\n }}\n >\n <Show\n when={entryStyle() === 'labels'}\n fallback={\n <>\n <AccentSwatchGroups\n accentOptions={props.accentOptions}\n resolvedAppearance={resolvedAppearance()}\n showThemeDefault={showThemeDefault()}\n themeDefaultColor={themeDefaultColor()}\n />\n <div class=\"flex flex-col gap-1\">\n <Show when={props.showCustomAccentCaption ?? true}>\n <span class=\"text-xs font-medium text-muted-foreground\">Custom</span>\n </Show>\n <div>\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </>\n }\n >\n {/* The named-chip style: one grid, every choice a labelled control,\n including the custom colour — nothing to caption from above. */}\n <div class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\" data-accent-grid>\n <For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n <div class=\"min-w-0\">\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </Show>\n </SdkRadioGroup>\n }\n >\n <AccentPicker\n label=\"Accent\"\n inherit={false}\n options={rowOptions()}\n layout=\"row\"\n appearance={resolvedAppearance()}\n value={props.draft.accent}\n customSeed={\n isCustomAccentValue(props.customAccentValue) ? props.customAccentValue : '#000000'\n }\n disabled={props.saving}\n onValueChange={(accent) => {\n if (accent !== null) props.onChange({ accent })\n }}\n />\n </Show>","<AccentPicker\n label=\"Accent\"\n inherit={false}\n options={rowOptions()}\n layout=\"row\"\n appearance={resolvedAppearance()}\n value={props.draft.accent}\n customSeed={\n isCustomAccentValue(props.customAccentValue) ? props.customAccentValue : '#000000'\n }\n disabled={props.saving}\n onValueChange={(accent) => {\n if (accent !== null) props.onChange({ accent })\n }}\n />","label=\"Accent\"","inherit={false}","layout=\"row\"","isCustomAccentValue(props.customAccentValue) ? props.customAccentValue : '#000000'","onValueChange={(accent) => {\n if (accent !== null) props.onChange({ accent })\n }}","<SdkRadioGroup\n value={accentSelection()}\n disabled={props.saving}\n aria-label=\"Accent\"\n class=\"flex flex-col items-start gap-3\"\n onValueChange={(accent) => {\n if (accent === null) return\n props.onChange({\n accent: accent === 'custom' ? (props.customAccentValue ?? '') : accent,\n })\n }}\n >\n <Show\n when={entryStyle() === 'labels'}\n fallback={\n <>\n <AccentSwatchGroups\n accentOptions={props.accentOptions}\n resolvedAppearance={resolvedAppearance()}\n showThemeDefault={showThemeDefault()}\n themeDefaultColor={themeDefaultColor()}\n />\n <div class=\"flex flex-col gap-1\">\n <Show when={props.showCustomAccentCaption ?? true}>\n <span class=\"text-xs font-medium text-muted-foreground\">Custom</span>\n </Show>\n <div>\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </>\n }\n >\n {/* The named-chip style: one grid, every choice a labelled control,\n including the custom colour — nothing to caption from above. */}\n <div class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\" data-accent-grid>\n <For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n <div class=\"min-w-0\">\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </Show>\n </SdkRadioGroup>","class=\"flex flex-col items-start gap-3\"","onValueChange={(accent) => {\n if (accent === null) return\n props.onChange({\n accent: accent === 'custom' ? (props.customAccentValue ?? '') : accent,\n })\n }}","<Show\n when={entryStyle() === 'labels'}\n fallback={\n <>\n <AccentSwatchGroups\n accentOptions={props.accentOptions}\n resolvedAppearance={resolvedAppearance()}\n showThemeDefault={showThemeDefault()}\n themeDefaultColor={themeDefaultColor()}\n />\n <div class=\"flex flex-col gap-1\">\n <Show when={props.showCustomAccentCaption ?? true}>\n <span class=\"text-xs font-medium text-muted-foreground\">Custom</span>\n </Show>\n <div>\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </>\n }\n >\n {/* The named-chip style: one grid, every choice a labelled control,\n including the custom colour — nothing to caption from above. */}\n <div class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\" data-accent-grid>\n <For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n <div class=\"min-w-0\">\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </Show>","<For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>","<SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>","class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"","<div class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\" data-accent-grid>\n <For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n <div class=\"min-w-0\">\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>","<SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>","value=\"custom\"","<AccentSwatchGroups\n accentOptions={props.accentOptions}\n resolvedAppearance={resolvedAppearance()}\n showThemeDefault={showThemeDefault()}\n themeDefaultColor={themeDefaultColor()}\n />","<span class=\"text-xs font-medium text-muted-foreground\">Custom</span>","<div class=\"flex flex-col gap-1\">\n <Show when={props.showCustomAccentCaption ?? true}>\n <span class=\"text-xs font-medium text-muted-foreground\">Custom</span>\n </Show>\n <div>\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>","<SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>","<SdkRadioGroup\n value={props.draft.surface}\n disabled={props.saving}\n aria-label=\"Glass\"\n class=\"flex flex-wrap gap-1\"\n onValueChange={(surface) => {\n const option = SURFACES.find((candidate) => candidate.value === surface)\n if (option) props.onChange({ surface: option.value })\n }}\n >\n <For each={SURFACES}>\n {(option) => (\n <div class=\"rounded-md focus-within:ring-3 focus-within:ring-ring/50\">\n <SdkRadio\n value={option.value}\n title={\n option.value === 'theme'\n ? (props.surfaceCapability.themeDefaultDescription ?? option.hint)\n : option.hint\n }\n disabled={option.value === 'frosted' && !props.surfaceCapability.frosted}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n </SdkRadioGroup>","class=\"flex flex-wrap gap-1\"","onValueChange={(surface) => {\n const option = SURFACES.find((candidate) => candidate.value === surface)\n if (option) props.onChange({ surface: option.value })\n }}","<For each={SURFACES}>\n {(option) => (\n <div class=\"rounded-md focus-within:ring-3 focus-within:ring-ring/50\">\n <SdkRadio\n value={option.value}\n title={\n option.value === 'theme'\n ? (props.surfaceCapability.themeDefaultDescription ?? option.hint)\n : option.hint\n }\n disabled={option.value === 'frosted' && !props.surfaceCapability.frosted}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>","each={SURFACES}","<SdkRadio\n value={option.value}\n title={\n option.value === 'theme'\n ? (props.surfaceCapability.themeDefaultDescription ?? option.hint)\n : option.hint\n }\n disabled={option.value === 'frosted' && !props.surfaceCapability.frosted}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n {option.label}\n </SdkRadio>","option.value === 'theme'\n ? (props.surfaceCapability.themeDefaultDescription ?? option.hint)\n : option.hint","option.value === 'frosted' && !props.surfaceCapability.frosted","class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"","LucideMonitor","LucideMoon","LucideSun","_$insert","_$effect","_$setAttribute"],"sources":["../../../../src/components/composites/appearance-editor/appearance-choices.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// Pinned mode-card, accent-swatch, and glass-chip composition. ui-sdk's\n// RadioGroup replaces the app port's manual roving focus; it does not replace\n// the donor hierarchy. Each option is a wrapper (layout, focus ring, data\n// hooks) around a ui-sdk `role=\"radio\"` button drawn as the card or chip.\nimport { Radio as SdkRadio, RadioGroup as SdkRadioGroup } from '@ui-sdk/solid/radio'\nimport { Monitor as LucideMonitor, Moon as LucideMoon, Sun as LucideSun } from '@lucide/solid'\nimport { For, Show } from 'solid-js'\nimport { isThemeAccentId } from '#lib/theme-accents'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\nimport { AccentPicker, isCustomAccentValue } from '../accent-picker'\nimport { AccentSwatchGroups } from './accent-swatch-groups'\nimport type { AppearanceEditorProps } from './appearance-types'\nimport { ThemeMiniature, ThemeMiniatureSplit } from './theme-preview'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Monitor = fastIcon(LucideMonitor)\nconst Moon = fastIcon(LucideMoon)\nconst Sun = fastIcon(LucideSun)\n\nconst MODES = [\n { value: 'system', label: 'System' },\n { value: 'light', label: 'Light' },\n { value: 'dark', label: 'Dark' },\n] as const\n// Short labels keep the three choices on the Glass row's own line; each says the rest on hover.\nconst SURFACES = [\n { value: 'theme', label: 'Theme', hint: \"Uses this theme's default surface.\" },\n { value: 'frosted', label: 'Frosted', hint: 'Theme-colored glass where supported.' },\n { value: 'opaque', label: 'Opaque', hint: 'Solid surfaces for every theme.' },\n] as const\nconst MODE_ICONS = { system: Monitor, light: Sun, dark: Moon } as const\n\nexport function ModeChoices(props: AppearanceEditorProps) {\n return (\n <SdkRadioGroup\n value={props.draft.mode}\n disabled={props.saving}\n aria-label=\"Appearance mode\"\n onValueChange={(mode) => {\n const option = MODES.find((candidate) => candidate.value === mode)\n if (option) props.onChange({ mode: option.value })\n }}\n class=\"grid grid-cols-1 gap-3 px-4 py-4 sm:grid-cols-3\"\n >\n <For each={MODES}>\n {(option) => {\n const Icon = MODE_ICONS[option.value]\n return (\n <div\n data-mode={option.value}\n class=\"min-w-0 rounded-lg focus-within:ring-3 focus-within:ring-ring/50\"\n >\n <SdkRadio\n value={option.value}\n class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n <span class=\"block h-20 w-full\">\n <Show\n when={option.value === 'system'}\n fallback={\n <ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />\n }\n >\n <ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />\n </Show>\n </span>\n {/* The glyph names the axis beside the miniature, so the cards read\n like ThemeModeToggle without losing the previews. */}\n <Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>\n </SdkRadio>\n </div>\n )\n }}\n </For>\n </SdkRadioGroup>\n )\n}\n\n/**\n * Whether the draft accent is the host's custom colour: not the theme default,\n * not a preset, and not a theme accent id. A theme accent id counts as known even\n * when the current pair cannot offer it, it is a stored role, not a colour the\n * user typed, and showing it in the custom field would invite editing `ansi-blue`.\n */\nexport function isCustomAccent(props: AppearanceEditorProps): boolean {\n const accent = props.draft.accent\n return (\n accent !== THEME_DEFAULT_ID &&\n !props.accentOptions.some((option) => option.id === accent) &&\n !isThemeAccentId(accent)\n )\n}\n\nexport function AccentChoices(props: AppearanceEditorProps) {\n // The resolved appearance decides which side of a preset pair, and which\n // theme accent, the swatches paint, so the row previews each choice as the\n // user will see it.\n const resolvedAppearance = () =>\n props.draft.mode === 'system' ? props.resolvedAppearance : props.draft.mode\n const accentSelection = () => (isCustomAccent(props) ? 'custom' : props.draft.accent)\n const showThemeDefault = () => props.showThemeDefaultAccent ?? true\n const entryStyle = () => props.accentEntryStyle ?? 'swatches'\n const themeDefaultColor = () =>\n resolvedAppearance() === 'light'\n ? props.lightTheme.colors.accent\n : props.darkTheme.colors.accent\n // The named-chip style feeds the same resolved preset list to both entries:\n // \"Theme default\" leads only when the host has not folded it into a preset.\n const labelEntries = () => {\n const presets = props.accentOptions.filter((option) => option.id !== THEME_DEFAULT_ID)\n return showThemeDefault()\n ? [{ id: THEME_DEFAULT_ID, label: 'Theme default' }, ...presets]\n : presets\n }\n // The `row` style is the shared AccentPicker every accent setting uses: the\n // swatches, then a Custom button that opens the native colour selector, so the\n // draft only changes once a colour is chosen there. The app has nothing to\n // inherit from, so there is no inherit swatch; \"Theme default\" leads when the\n // host keeps it.\n const rowOptions = () => {\n const presets = props.accentOptions.filter((option) => option.id !== THEME_DEFAULT_ID)\n return showThemeDefault()\n ? [\n {\n id: THEME_DEFAULT_ID,\n label: 'Theme default',\n light: themeDefaultColor(),\n dark: themeDefaultColor(),\n },\n ...presets,\n ]\n : presets\n }\n return (\n <Show\n when={entryStyle() === 'row'}\n fallback={\n <SdkRadioGroup\n value={accentSelection()}\n disabled={props.saving}\n aria-label=\"Accent\"\n class=\"flex flex-col items-start gap-3\"\n onValueChange={(accent) => {\n if (accent === null) return\n props.onChange({\n accent: accent === 'custom' ? (props.customAccentValue ?? '') : accent,\n })\n }}\n >\n <Show\n when={entryStyle() === 'labels'}\n fallback={\n <>\n <AccentSwatchGroups\n accentOptions={props.accentOptions}\n resolvedAppearance={resolvedAppearance()}\n showThemeDefault={showThemeDefault()}\n themeDefaultColor={themeDefaultColor()}\n />\n <div class=\"flex flex-col gap-1\">\n <Show when={props.showCustomAccentCaption ?? true}>\n <span class=\"text-xs font-medium text-muted-foreground\">Custom</span>\n </Show>\n <div>\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </>\n }\n >\n {/* The named-chip style: one grid, every choice a labelled control,\n including the custom colour — nothing to caption from above. */}\n <div class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\" data-accent-grid>\n <For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n <div class=\"min-w-0\">\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </Show>\n </SdkRadioGroup>\n }\n >\n <AccentPicker\n label=\"Accent\"\n inherit={false}\n options={rowOptions()}\n layout=\"row\"\n appearance={resolvedAppearance()}\n value={props.draft.accent}\n customSeed={\n isCustomAccentValue(props.customAccentValue) ? props.customAccentValue : '#000000'\n }\n disabled={props.saving}\n onValueChange={(accent) => {\n if (accent !== null) props.onChange({ accent })\n }}\n />\n </Show>\n )\n}\n\nexport function GlassChoices(props: AppearanceEditorProps) {\n return (\n <SdkRadioGroup\n value={props.draft.surface}\n disabled={props.saving}\n aria-label=\"Glass\"\n class=\"flex flex-wrap gap-1\"\n onValueChange={(surface) => {\n const option = SURFACES.find((candidate) => candidate.value === surface)\n if (option) props.onChange({ surface: option.value })\n }}\n >\n <For each={SURFACES}>\n {(option) => (\n <div class=\"rounded-md focus-within:ring-3 focus-within:ring-ring/50\">\n <SdkRadio\n value={option.value}\n title={\n option.value === 'theme'\n ? (props.surfaceCapability.themeDefaultDescription ?? option.hint)\n : option.hint\n }\n disabled={option.value === 'frosted' && !props.surfaceCapability.frosted}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[dis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GAHRC,MAYK;MARHc,OAAA,QACEb,gBAAAA,OAAAA;OACEJ,OAAM;OACNH,OAAM;OAFRO,UAGC;MAES,CAAA,CACP;MAXP,OAAA;KAYK,EAAA,CAAA,CAlBN;IA8CC,CAAA;GACO;;CAkBb,CAAA;AAEV;AAEA,SAAgB,aAAa,OAA8B;CACzD,OACEC,gBAAAA,YAAAA;EACE,IAAA,QAAA;GAAO,OAAA,MAAM,MAAM;EAAO;EAC1B,IAAA,WAAA;GAAU,OAAA,MAAM;EAAM;EACtB,cAAW;EACXC,OAAM;EACNC,gBAAgB,YAAY;GAC1B,MAAM,SAAS,SAAS,MAAM,cAAc,UAAU,UAAU,OAAO;GACvE,IAAI,QAAQ,MAAM,SAAS,EAAE,SAAS,OAAO,MAAM,CAAC;EACtD;EARF,IAAA,WAAA;GAUEC,OAAAA,gBAAAA,KAAAA;IAAKC,MAAM;IAAXD,WACI,kBACA;KAaK,IAAA,SAAA,QAAA;KAbLS,OAAA,QACEP,gBAAAA,OAAAA;MACE,IAAA,QAAA;OAAO,OAAA,OAAO;MAAK;MACnB,IAAA,QAAA;OACEC,OAAAA,WAAAA;QAAO,OAAA,OAAA,UAAU;OAEH,CAAA,CAAC,CAAD,IADT,MAAM,kBAAkB,2BAA2B,OAAO,OAC3D,OAAO;MACb;MACA,IAAA,WAAA;OAAUC,OAAAA,WAAAA;QAAO,OAAA,OAAA,UAAU;OAA4C,CAAA,CAAC,CAAD,KAA/B,CAAC,MAAM,kBAAkB;MAAO;MACxEC,OAAM;MARR,IAAA,WAAA;OAUG,OAAA,OAAO;MACA;KACP,CAAA,CAAA;KAbL,OAAA;IAaK,EAAA,CAAA;GAEJ,CAAA;EACQ;;AAEnB"}
|
|
1
|
+
{"version":3,"file":"appearance-choices.js","names":["<SdkRadioGroup\n value={props.draft.mode}\n disabled={props.saving}\n aria-label=\"Appearance mode\"\n onValueChange={(mode) => {\n const option = MODES.find((candidate) => candidate.value === mode)\n if (option) props.onChange({ mode: option.value })\n }}\n class=\"grid grid-cols-1 gap-3 px-4 py-4 sm:grid-cols-3\"\n >\n <For each={MODES}>\n {(option) => {\n const Icon = MODE_ICONS[option.value]\n return (\n <div data-mode={option.value} class=\"min-w-0 rounded-lg focus-within:focus-outline\">\n <SdkRadio\n value={option.value}\n class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n <span class=\"block h-20 w-full\">\n <Show\n when={option.value === 'system'}\n fallback={\n <ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />\n }\n >\n <ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />\n </Show>\n </span>\n {/* The glyph names the axis beside the miniature, so the cards read\n like ThemeModeToggle without losing the previews. */}\n <Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>\n </SdkRadio>\n </div>\n )\n }}\n </For>\n </SdkRadioGroup>","onValueChange={(mode) => {\n const option = MODES.find((candidate) => candidate.value === mode)\n if (option) props.onChange({ mode: option.value })\n }}","class=\"grid grid-cols-1 gap-3 px-4 py-4 sm:grid-cols-3\"","<For each={MODES}>\n {(option) => {\n const Icon = MODE_ICONS[option.value]\n return (\n <div data-mode={option.value} class=\"min-w-0 rounded-lg focus-within:focus-outline\">\n <SdkRadio\n value={option.value}\n class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n <span class=\"block h-20 w-full\">\n <Show\n when={option.value === 'system'}\n fallback={\n <ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />\n }\n >\n <ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />\n </Show>\n </span>\n {/* The glyph names the axis beside the miniature, so the cards read\n like ThemeModeToggle without losing the previews. */}\n <Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>\n </SdkRadio>\n </div>\n )\n }}\n </For>","each={MODES}","<SdkRadio\n value={option.value}\n class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n <span class=\"block h-20 w-full\">\n <Show\n when={option.value === 'system'}\n fallback={\n <ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />\n }\n >\n <ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />\n </Show>\n </span>\n {/* The glyph names the axis beside the miniature, so the cards read\n like ThemeModeToggle without losing the previews. */}\n <Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>\n </SdkRadio>","class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"","<ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />","<ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />","option.value === 'light' ? props.lightTheme : props.darkTheme","<Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>","<span>{option.label}</span>","<Icon aria-hidden=\"true\" class=\"size-3.5\" />","class=\"size-3.5\"","<span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>","<div data-mode={option.value} class=\"min-w-0 rounded-lg focus-within:focus-outline\">\n <SdkRadio\n value={option.value}\n class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n <span class=\"block h-20 w-full\">\n <Show\n when={option.value === 'system'}\n fallback={\n <ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />\n }\n >\n <ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />\n </Show>\n </span>\n {/* The glyph names the axis beside the miniature, so the cards read\n like ThemeModeToggle without losing the previews. */}\n <Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>\n </SdkRadio>\n </div>","<Show\n when={entryStyle() === 'row'}\n fallback={\n <SdkRadioGroup\n value={accentSelection()}\n disabled={props.saving}\n aria-label=\"Accent\"\n class=\"flex flex-col items-start gap-3\"\n onValueChange={(accent) => {\n if (accent === null) return\n props.onChange({\n accent: accent === 'custom' ? (props.customAccentValue ?? '') : accent,\n })\n }}\n >\n <Show\n when={entryStyle() === 'labels'}\n fallback={\n <>\n <AccentSwatchGroups\n accentOptions={props.accentOptions}\n resolvedAppearance={resolvedAppearance()}\n showThemeDefault={showThemeDefault()}\n themeDefaultColor={themeDefaultColor()}\n />\n <div class=\"flex flex-col gap-1\">\n <Show when={props.showCustomAccentCaption ?? true}>\n <span class=\"text-xs font-medium text-muted-foreground\">Custom</span>\n </Show>\n <div>\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </>\n }\n >\n {/* The named-chip style: one grid, every choice a labelled control,\n including the custom colour — nothing to caption from above. */}\n <div class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\" data-accent-grid>\n <For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n <div class=\"min-w-0\">\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </Show>\n </SdkRadioGroup>\n }\n >\n <AccentPicker\n label=\"Accent\"\n inherit={false}\n options={rowOptions()}\n layout=\"row\"\n appearance={resolvedAppearance()}\n value={props.draft.accent}\n customSeed={\n isCustomAccentValue(props.customAccentValue) ? props.customAccentValue : '#000000'\n }\n disabled={props.saving}\n onValueChange={(accent) => {\n if (accent !== null) props.onChange({ accent })\n }}\n />\n </Show>","<AccentPicker\n label=\"Accent\"\n inherit={false}\n options={rowOptions()}\n layout=\"row\"\n appearance={resolvedAppearance()}\n value={props.draft.accent}\n customSeed={\n isCustomAccentValue(props.customAccentValue) ? props.customAccentValue : '#000000'\n }\n disabled={props.saving}\n onValueChange={(accent) => {\n if (accent !== null) props.onChange({ accent })\n }}\n />","label=\"Accent\"","inherit={false}","layout=\"row\"","isCustomAccentValue(props.customAccentValue) ? props.customAccentValue : '#000000'","onValueChange={(accent) => {\n if (accent !== null) props.onChange({ accent })\n }}","<SdkRadioGroup\n value={accentSelection()}\n disabled={props.saving}\n aria-label=\"Accent\"\n class=\"flex flex-col items-start gap-3\"\n onValueChange={(accent) => {\n if (accent === null) return\n props.onChange({\n accent: accent === 'custom' ? (props.customAccentValue ?? '') : accent,\n })\n }}\n >\n <Show\n when={entryStyle() === 'labels'}\n fallback={\n <>\n <AccentSwatchGroups\n accentOptions={props.accentOptions}\n resolvedAppearance={resolvedAppearance()}\n showThemeDefault={showThemeDefault()}\n themeDefaultColor={themeDefaultColor()}\n />\n <div class=\"flex flex-col gap-1\">\n <Show when={props.showCustomAccentCaption ?? true}>\n <span class=\"text-xs font-medium text-muted-foreground\">Custom</span>\n </Show>\n <div>\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </>\n }\n >\n {/* The named-chip style: one grid, every choice a labelled control,\n including the custom colour — nothing to caption from above. */}\n <div class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\" data-accent-grid>\n <For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n <div class=\"min-w-0\">\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </Show>\n </SdkRadioGroup>","class=\"flex flex-col items-start gap-3\"","onValueChange={(accent) => {\n if (accent === null) return\n props.onChange({\n accent: accent === 'custom' ? (props.customAccentValue ?? '') : accent,\n })\n }}","<Show\n when={entryStyle() === 'labels'}\n fallback={\n <>\n <AccentSwatchGroups\n accentOptions={props.accentOptions}\n resolvedAppearance={resolvedAppearance()}\n showThemeDefault={showThemeDefault()}\n themeDefaultColor={themeDefaultColor()}\n />\n <div class=\"flex flex-col gap-1\">\n <Show when={props.showCustomAccentCaption ?? true}>\n <span class=\"text-xs font-medium text-muted-foreground\">Custom</span>\n </Show>\n <div>\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </>\n }\n >\n {/* The named-chip style: one grid, every choice a labelled control,\n including the custom colour — nothing to caption from above. */}\n <div class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\" data-accent-grid>\n <For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n <div class=\"min-w-0\">\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </Show>","<For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>","<SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>","class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"","<div class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\" data-accent-grid>\n <For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n <div class=\"min-w-0\">\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>","<SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>","value=\"custom\"","<AccentSwatchGroups\n accentOptions={props.accentOptions}\n resolvedAppearance={resolvedAppearance()}\n showThemeDefault={showThemeDefault()}\n themeDefaultColor={themeDefaultColor()}\n />","<span class=\"text-xs font-medium text-muted-foreground\">Custom</span>","<div class=\"flex flex-col gap-1\">\n <Show when={props.showCustomAccentCaption ?? true}>\n <span class=\"text-xs font-medium text-muted-foreground\">Custom</span>\n </Show>\n <div>\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>","<SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>","<SdkRadioGroup\n value={props.draft.surface}\n disabled={props.saving}\n aria-label=\"Glass\"\n class=\"flex flex-wrap gap-1\"\n onValueChange={(surface) => {\n const option = SURFACES.find((candidate) => candidate.value === surface)\n if (option) props.onChange({ surface: option.value })\n }}\n >\n <For each={SURFACES}>\n {(option) => (\n <div class=\"rounded-md focus-within:focus-outline\">\n <SdkRadio\n value={option.value}\n title={\n option.value === 'theme'\n ? (props.surfaceCapability.themeDefaultDescription ?? option.hint)\n : option.hint\n }\n disabled={option.value === 'frosted' && !props.surfaceCapability.frosted}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n </SdkRadioGroup>","class=\"flex flex-wrap gap-1\"","onValueChange={(surface) => {\n const option = SURFACES.find((candidate) => candidate.value === surface)\n if (option) props.onChange({ surface: option.value })\n }}","<For each={SURFACES}>\n {(option) => (\n <div class=\"rounded-md focus-within:focus-outline\">\n <SdkRadio\n value={option.value}\n title={\n option.value === 'theme'\n ? (props.surfaceCapability.themeDefaultDescription ?? option.hint)\n : option.hint\n }\n disabled={option.value === 'frosted' && !props.surfaceCapability.frosted}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>","each={SURFACES}","<SdkRadio\n value={option.value}\n title={\n option.value === 'theme'\n ? (props.surfaceCapability.themeDefaultDescription ?? option.hint)\n : option.hint\n }\n disabled={option.value === 'frosted' && !props.surfaceCapability.frosted}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n {option.label}\n </SdkRadio>","option.value === 'theme'\n ? (props.surfaceCapability.themeDefaultDescription ?? option.hint)\n : option.hint","option.value === 'frosted' && !props.surfaceCapability.frosted","class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"","LucideMonitor","LucideMoon","LucideSun","_$insert","_$effect","_$setAttribute"],"sources":["../../../../src/components/composites/appearance-editor/appearance-choices.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// Pinned mode-card, accent-swatch, and glass-chip composition. ui-sdk's\n// RadioGroup replaces the app port's manual roving focus; it does not replace\n// the donor hierarchy. Each option is a wrapper (layout, focus ring, data\n// hooks) around a ui-sdk `role=\"radio\"` button drawn as the card or chip.\nimport { Radio as SdkRadio, RadioGroup as SdkRadioGroup } from '@ui-sdk/solid/radio'\nimport { Monitor as LucideMonitor, Moon as LucideMoon, Sun as LucideSun } from '@lucide/solid'\nimport { For, Show } from 'solid-js'\nimport { isThemeAccentId } from '#lib/theme-accents'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\nimport { AccentPicker, isCustomAccentValue } from '../accent-picker'\nimport { AccentSwatchGroups } from './accent-swatch-groups'\nimport type { AppearanceEditorProps } from './appearance-types'\nimport { ThemeMiniature, ThemeMiniatureSplit } from './theme-preview'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Monitor = fastIcon(LucideMonitor)\nconst Moon = fastIcon(LucideMoon)\nconst Sun = fastIcon(LucideSun)\n\nconst MODES = [\n { value: 'system', label: 'System' },\n { value: 'light', label: 'Light' },\n { value: 'dark', label: 'Dark' },\n] as const\n// Short labels keep the three choices on the Glass row's own line; each says the rest on hover.\nconst SURFACES = [\n { value: 'theme', label: 'Theme', hint: \"Uses this theme's default surface.\" },\n { value: 'frosted', label: 'Frosted', hint: 'Theme-colored glass where supported.' },\n { value: 'opaque', label: 'Opaque', hint: 'Solid surfaces for every theme.' },\n] as const\nconst MODE_ICONS = { system: Monitor, light: Sun, dark: Moon } as const\n\nexport function ModeChoices(props: AppearanceEditorProps) {\n return (\n <SdkRadioGroup\n value={props.draft.mode}\n disabled={props.saving}\n aria-label=\"Appearance mode\"\n onValueChange={(mode) => {\n const option = MODES.find((candidate) => candidate.value === mode)\n if (option) props.onChange({ mode: option.value })\n }}\n class=\"grid grid-cols-1 gap-3 px-4 py-4 sm:grid-cols-3\"\n >\n <For each={MODES}>\n {(option) => {\n const Icon = MODE_ICONS[option.value]\n return (\n <div data-mode={option.value} class=\"min-w-0 rounded-lg focus-within:focus-outline\">\n <SdkRadio\n value={option.value}\n class=\"flex w-full cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\"\n >\n <span class=\"block h-20 w-full\">\n <Show\n when={option.value === 'system'}\n fallback={\n <ThemeMiniature\n theme={option.value === 'light' ? props.lightTheme : props.darkTheme}\n />\n }\n >\n <ThemeMiniatureSplit light={props.lightTheme} dark={props.darkTheme} />\n </Show>\n </span>\n {/* The glyph names the axis beside the miniature, so the cards read\n like ThemeModeToggle without losing the previews. */}\n <Show when={props.showModeIcons} fallback={<span>{option.label}</span>}>\n <span class=\"flex items-center justify-center gap-1.5\">\n <Icon aria-hidden=\"true\" class=\"size-3.5\" />\n {option.label}\n </span>\n </Show>\n </SdkRadio>\n </div>\n )\n }}\n </For>\n </SdkRadioGroup>\n )\n}\n\n/**\n * Whether the draft accent is the host's custom colour: not the theme default,\n * not a preset, and not a theme accent id. A theme accent id counts as known even\n * when the current pair cannot offer it, it is a stored role, not a colour the\n * user typed, and showing it in the custom field would invite editing `ansi-blue`.\n */\nexport function isCustomAccent(props: AppearanceEditorProps): boolean {\n const accent = props.draft.accent\n return (\n accent !== THEME_DEFAULT_ID &&\n !props.accentOptions.some((option) => option.id === accent) &&\n !isThemeAccentId(accent)\n )\n}\n\nexport function AccentChoices(props: AppearanceEditorProps) {\n // The resolved appearance decides which side of a preset pair, and which\n // theme accent, the swatches paint, so the row previews each choice as the\n // user will see it.\n const resolvedAppearance = () =>\n props.draft.mode === 'system' ? props.resolvedAppearance : props.draft.mode\n const accentSelection = () => (isCustomAccent(props) ? 'custom' : props.draft.accent)\n const showThemeDefault = () => props.showThemeDefaultAccent ?? true\n const entryStyle = () => props.accentEntryStyle ?? 'swatches'\n const themeDefaultColor = () =>\n resolvedAppearance() === 'light'\n ? props.lightTheme.colors.accent\n : props.darkTheme.colors.accent\n // The named-chip style feeds the same resolved preset list to both entries:\n // \"Theme default\" leads only when the host has not folded it into a preset.\n const labelEntries = () => {\n const presets = props.accentOptions.filter((option) => option.id !== THEME_DEFAULT_ID)\n return showThemeDefault()\n ? [{ id: THEME_DEFAULT_ID, label: 'Theme default' }, ...presets]\n : presets\n }\n // The `row` style is the shared AccentPicker every accent setting uses: the\n // swatches, then a Custom button that opens the native colour selector, so the\n // draft only changes once a colour is chosen there. The app has nothing to\n // inherit from, so there is no inherit swatch; \"Theme default\" leads when the\n // host keeps it.\n const rowOptions = () => {\n const presets = props.accentOptions.filter((option) => option.id !== THEME_DEFAULT_ID)\n return showThemeDefault()\n ? [\n {\n id: THEME_DEFAULT_ID,\n label: 'Theme default',\n light: themeDefaultColor(),\n dark: themeDefaultColor(),\n },\n ...presets,\n ]\n : presets\n }\n return (\n <Show\n when={entryStyle() === 'row'}\n fallback={\n <SdkRadioGroup\n value={accentSelection()}\n disabled={props.saving}\n aria-label=\"Accent\"\n class=\"flex flex-col items-start gap-3\"\n onValueChange={(accent) => {\n if (accent === null) return\n props.onChange({\n accent: accent === 'custom' ? (props.customAccentValue ?? '') : accent,\n })\n }}\n >\n <Show\n when={entryStyle() === 'labels'}\n fallback={\n <>\n <AccentSwatchGroups\n accentOptions={props.accentOptions}\n resolvedAppearance={resolvedAppearance()}\n showThemeDefault={showThemeDefault()}\n themeDefaultColor={themeDefaultColor()}\n />\n <div class=\"flex flex-col gap-1\">\n <Show when={props.showCustomAccentCaption ?? true}>\n <span class=\"text-xs font-medium text-muted-foreground\">Custom</span>\n </Show>\n <div>\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </>\n }\n >\n {/* The named-chip style: one grid, every choice a labelled control,\n including the custom colour — nothing to caption from above. */}\n <div class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\" data-accent-grid>\n <For each={labelEntries()}>\n {(option) => (\n <div class=\"min-w-0\" data-accent-option={option.id}>\n <SdkRadio\n value={option.id}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n {option.label}\n </SdkRadio>\n </div>\n )}\n </For>\n <div class=\"min-w-0\">\n <SdkRadio\n value=\"custom\"\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\"\n >\n Custom\n </SdkRadio>\n </div>\n </div>\n </Show>\n </SdkRadioGroup>\n }\n >\n <AccentPicker\n label=\"Accent\"\n inherit={false}\n options={rowOptions()}\n layout=\"row\"\n appearance={resolvedAppearance()}\n value={props.draft.accent}\n customSeed={\n isCustomAccentValue(props.customAccentValue) ? props.customAccentValue : '#000000'\n }\n disabled={props.saving}\n onValueChange={(accent) => {\n if (accent !== null) props.onChange({ accent })\n }}\n />\n </Show>\n )\n}\n\nexport function GlassChoices(props: AppearanceEditorProps) {\n return (\n <SdkRadioGroup\n value={props.draft.surface}\n disabled={props.saving}\n aria-label=\"Glass\"\n class=\"flex flex-wrap gap-1\"\n onValueChange={(surface) => {\n const option = SURFACES.find((candidate) => candidate.value === surface)\n if (option) props.onChange({ surface: option.value })\n }}\n >\n <For each={SURFACES}>\n {(option) => (\n <div class=\"rounded-md focus-within:focus-outline\">\n <SdkRadio\n value={option.value}\n title={\n option.value === 'theme'\n ? (props.surfaceCapability.themeDefaultDescription ?? option.hint)\n : option.hint\n }\n disabled={option.value === 'frosted' && !props.surfaceCapability.frosted}\n class=\"flex h-7 w-full cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap outline-none data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data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D,GAHRC,MAYK;MARHc,OAAA,QACEb,gBAAAA,OAAAA;OACEJ,OAAM;OACNH,OAAM;OAFRO,UAGC;MAES,CAAA,CACP;MAXP,OAAA;KAYK,EAAA,CAAA,CAlBN;IA8CC,CAAA;GACO;;CAkBb,CAAA;AAEV;AAEA,SAAgB,aAAa,OAA8B;CACzD,OACEC,gBAAAA,YAAAA;EACE,IAAA,QAAA;GAAO,OAAA,MAAM,MAAM;EAAO;EAC1B,IAAA,WAAA;GAAU,OAAA,MAAM;EAAM;EACtB,cAAW;EACXC,OAAM;EACNC,gBAAgB,YAAY;GAC1B,MAAM,SAAS,SAAS,MAAM,cAAc,UAAU,UAAU,OAAO;GACvE,IAAI,QAAQ,MAAM,SAAS,EAAE,SAAS,OAAO,MAAM,CAAC;EACtD;EARF,IAAA,WAAA;GAUEC,OAAAA,gBAAAA,KAAAA;IAAKC,MAAM;IAAXD,WACI,kBACA;KAaK,IAAA,SAAA,QAAA;KAbLS,OAAA,QACEP,gBAAAA,OAAAA;MACE,IAAA,QAAA;OAAO,OAAA,OAAO;MAAK;MACnB,IAAA,QAAA;OACEC,OAAAA,WAAAA;QAAO,OAAA,OAAA,UAAU;OAEH,CAAA,CAAC,CAAD,IADT,MAAM,kBAAkB,2BAA2B,OAAO,OAC3D,OAAO;MACb;MACA,IAAA,WAAA;OAAUC,OAAAA,WAAAA;QAAO,OAAA,OAAA,UAAU;OAA4C,CAAA,CAAC,CAAD,KAA/B,CAAC,MAAM,kBAAkB;MAAO;MACxEC,OAAM;MARR,IAAA,WAAA;OAUG,OAAA,OAAO;MACA;KACP,CAAA,CAAA;KAbL,OAAA;IAaK,EAAA,CAAA;GAEJ,CAAA;EACQ;;AAEnB"}
|
|
@@ -17,7 +17,7 @@ var _tmpl$4 = /* @__PURE__ */ template(`<p role=status class="m-0 text-xs text-m
|
|
|
17
17
|
var _tmpl$5 = /* @__PURE__ */ template(`<p role=alert class="m-0 text-xs text-destructive [overflow-wrap:anywhere]">`);
|
|
18
18
|
var _tmpl$6 = /* @__PURE__ */ template(`<footer class="flex flex-wrap items-center justify-end gap-2"><!><span role=status class=visually-hidden>`);
|
|
19
19
|
var _tmpl$7 = /* @__PURE__ */ template(`<p tabindex=-1 role=status class="m-0 flex items-center gap-1.5 text-xs text-muted-foreground outline-none">`);
|
|
20
|
-
var _tmpl$8 = /* @__PURE__ */ template(`<div role=region aria-label="Proposed changes"tabindex=0 class="max-h-64 overflow-auto rounded-xl outline-none focus-visible:
|
|
20
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div role=region aria-label="Proposed changes"tabindex=0 class="max-h-64 overflow-auto rounded-xl outline-none focus-visible:focus-outline-inset">`);
|
|
21
21
|
var Ban = fastIcon(Ban$1);
|
|
22
22
|
var Check = fastIcon(Check$1);
|
|
23
23
|
var Clock = fastIcon(Clock$1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirmation.js","names":["ref={(element) => (root = element)}","<Check class=\"text-success\" />","class=\"text-success\"","<span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={state() === 'approved'}>\n <Check class=\"text-success\" />\n </Show>\n <Show when={state() === 'denied'}>\n <Ban />\n </Show>\n <Show when={state() === 'expired'}>\n <Clock />\n </Show>\n <Show when={state() === 'unavailable'}>\n <Lock />\n </Show>\n <Show when={state() === 'requested'}>\n <ShieldQuestion />\n </Show>\n </span>","<Ban />","<Clock />","<Lock />","<ShieldQuestion />","<Show when={local.details}>{(details) => <Details details={details()} />}</Show>","<Details details={details()} />","<section\n ref={(element) => (root = element)}\n data-slot=\"confirmation\"\n data-state={state()}\n aria-labelledby={titleId}\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4',\n {\n 'border-ring': awaiting(),\n 'border-border': !awaiting(),\n },\n local.class\n )}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={state() === 'approved'}>\n <Check class=\"text-success\" />\n </Show>\n <Show when={state() === 'denied'}>\n <Ban />\n </Show>\n <Show when={state() === 'expired'}>\n <Clock />\n </Show>\n <Show when={state() === 'unavailable'}>\n <Lock />\n </Show>\n <Show when={state() === 'requested'}>\n <ShieldQuestion />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 id={titleId} class=\"m-0 text-sm font-semibold [overflow-wrap:anywhere]\">\n {boundText(local.title, 200)}\n </h3>\n <Show when={local.description}>\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {boundText(local.description ?? '', 400)}\n </p>\n </Show>\n </div>\n <Show when={awaiting()}>\n <span class=\"shrink-0 text-xs text-muted-foreground\">\n {state() === 'requested' ? 'Needs your answer' : 'Cannot be answered now'}\n </span>\n </Show>\n </header>\n\n <Show when={local.details}>{(details) => <Details details={details()} />}</Show>\n\n {local.children}\n\n <Show\n when={awaiting()}\n fallback={\n <p\n ref={(element) => (outcome = element)}\n tabindex=\"-1\"\n role=\"status\"\n class=\"m-0 flex items-center gap-1.5 text-xs text-muted-foreground outline-none\"\n >\n {confirmationOutcome(state(), local.resolvedBy, local.resolvedAt)}\n </p>\n }\n >\n <Show when={reasons()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reasons()}\n </p>\n </Show>\n <Show when={error()}>\n <p role=\"alert\" class=\"m-0 text-xs text-destructive [overflow-wrap:anywhere]\">\n {error()}\n </p>\n </Show>\n <footer class=\"flex flex-wrap items-center justify-end gap-2\">\n <Button type=\"button\" variant=\"outline\" size=\"sm\" {...buttonProps('deny')}>\n <Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.denyLabel ?? 'Deny'}\n </Button>\n <Button type=\"button\" size=\"sm\" {...buttonProps('approve')}>\n <Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.approveLabel ?? 'Approve'}\n </Button>\n {/* Present from the start: a live region inserted with its text is not reliably announced. */}\n <span role=\"status\" class=\"visually-hidden\">\n {pending() !== undefined ? 'Sending your answer' : ''}\n </span>\n </footer>\n </Show>\n </section>","<Show when={reasons()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reasons()}\n </p>\n </Show>","<p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reasons()}\n </p>","<Show when={error()}>\n <p role=\"alert\" class=\"m-0 text-xs text-destructive [overflow-wrap:anywhere]\">\n {error()}\n </p>\n </Show>","<p role=\"alert\" class=\"m-0 text-xs text-destructive [overflow-wrap:anywhere]\">\n {error()}\n </p>","<Button type=\"button\" variant=\"outline\" size=\"sm\" {...buttonProps('deny')}>\n <Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.denyLabel ?? 'Deny'}\n </Button>","type=\"button\"","variant=\"outline\"","size=\"sm\"","<Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>","<Spinner size=\"sm\" label={false} />","label={false}","local.denyLabel ?? 'Deny'","<footer class=\"flex flex-wrap items-center justify-end gap-2\">\n <Button type=\"button\" variant=\"outline\" size=\"sm\" {...buttonProps('deny')}>\n <Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.denyLabel ?? 'Deny'}\n </Button>\n <Button type=\"button\" size=\"sm\" {...buttonProps('approve')}>\n <Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.approveLabel ?? 'Approve'}\n </Button>\n {/* Present from the start: a live region inserted with its text is not reliably announced. */}\n <span role=\"status\" class=\"visually-hidden\">\n {pending() !== undefined ? 'Sending your answer' : ''}\n </span>\n </footer>","<Button type=\"button\" size=\"sm\" {...buttonProps('approve')}>\n <Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.approveLabel ?? 'Approve'}\n </Button>","<Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>","local.approveLabel ?? 'Approve'","ref={(element) => (outcome = element)}","<Show\n when={props.details.kind === 'diff' && props.details}\n fallback={\n <CodeBlock\n size=\"sm\"\n code={(props.details as Extract<ConfirmationDetails, { kind: 'code' }>).code}\n language={bounded(\n (props.details as Extract<ConfirmationDetails, { kind: 'code' }>).language,\n 24\n )}\n title={bounded(props.details.title, 80)}\n complete\n wrap\n maxHeight=\"14rem\"\n />\n }\n >\n {(diff) => (\n // The diff block has no height cap of its own, so the cap lives here; a\n // scroller must be focusable, hence the labelled region and tab stop.\n <div\n role=\"region\"\n aria-label=\"Proposed changes\"\n tabindex=\"0\"\n class=\"max-h-64 overflow-auto rounded-xl outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n >\n <DiffBlock\n patch={(diff() as Extract<ConfirmationDetails, { kind: 'diff' }>).patch}\n title={bounded(diff().title, 80)}\n complete\n />\n </div>\n )}\n </Show>","props.details.kind === 'diff' && props.details","<CodeBlock\n size=\"sm\"\n code={(props.details as Extract<ConfirmationDetails, { kind: 'code' }>).code}\n language={bounded(\n (props.details as Extract<ConfirmationDetails, { kind: 'code' }>).language,\n 24\n )}\n title={bounded(props.details.title, 80)}\n complete\n wrap\n maxHeight=\"14rem\"\n />","maxHeight=\"14rem\"","<DiffBlock\n patch={(diff() as Extract<ConfirmationDetails, { kind: 'diff' }>).patch}\n title={bounded(diff().title, 80)}\n complete\n />","LucideBan","LucideCheck","LucideClock","LucideLock","LucideShieldQuestion","_$spread","_$ref","_$insert","_$setAttribute"],"sources":["../../../../src/components/composites/confirmation/confirmation.tsx"],"sourcesContent":["import {\n Ban as LucideBan,\n Check as LucideCheck,\n Clock as LucideClock,\n Lock as LucideLock,\n ShieldQuestion as LucideShieldQuestion,\n} from '@lucide/solid'\nimport { createEffect, createMemo, createSignal, createUniqueId, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { CodeBlock } from '../../ui/code-block'\nimport { DiffBlock } from '../../ui/diff-block'\nimport { Spinner } from '../../ui/spinner'\nimport { REASON_TEXT_LIMIT, boundText } from '#lib/text'\nimport {\n confirmationOutcome,\n decisionReason,\n isAwaitingAnswer,\n settleDecision,\n type ConfirmationState,\n} from './confirmation-model'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Ban = fastIcon(LucideBan)\nconst Check = fastIcon(LucideCheck)\nconst Clock = fastIcon(LucideClock)\nconst Lock = fastIcon(LucideLock)\nconst ShieldQuestion = fastIcon(LucideShieldQuestion)\n\n/**\n * Confirmation.\n *\n * The agent has stopped a tool and will not continue until the person approves or\n * denies it. Like `Questionnaire`, this is one of the two elements in a transcript\n * the reader *must* act on, so it is allowed a card surface — and the border is\n * the focus ring's colour only while it is waiting. Once answered it drops to a\n * hairline and a one-line record, because a settled decision should read as\n * history, not as something still asking.\n *\n * ## It shows what is being approved, and nothing else\n *\n * `title` and `description` say what the tool wants to do; `details` is the\n * evidence, rendered as `CodeBlock size=\"sm\"` (a command, a request) or\n * `DiffBlock` (a patch). Details are text: never interpreted, and a long one\n * scrolls inside its block. Approve and Deny exist only while the request is\n * open; afterwards they are replaced by the outcome, with *who* and *when* only if\n * the host supplied them.\n *\n * ## The host owns authority\n *\n * Whether this client may answer is not decided here. No handler, or a host\n * `disabledReason`, or the `unavailable` state, leaves the buttons visible and\n * disabled with the reason beside them in words — never hidden, because a reader\n * who cannot see the choice cannot tell whether the agent is waiting on them.\n *\n * ## Answering is a round trip\n *\n * `onApprove` / `onDeny` may return a promise. While one is pending both buttons\n * refuse input (a synchronous guard as well as the signal, so a double click in\n * one tick cannot submit twice) and the pressed one shows a spinner. A failure\n * shows `error` (or the rejection's own message) and re-enables the buttons. The\n * buttons use `aria-disabled` rather than `disabled`: a native disabled button\n * drops focus, and the reader's place would be lost mid-decision. When the state\n * settles, focus moves to the outcome line if it was in the card, so a keyboard\n * user is not stranded on a control that no longer exists.\n */\nexport type ConfirmationDetails =\n | Readonly<{ kind: 'code'; code: string; language?: string; title?: string }>\n | Readonly<{ kind: 'diff'; patch: string; title?: string }>\n\nexport type ConfirmationProps = Omit<ComponentProps<'section'>, 'title' | 'onError'> & {\n state?: ConfirmationState\n /** What the tool wants to do, as a short sentence. */\n title: string\n description?: string\n details?: ConfirmationDetails\n onApprove?: () => void | Promise<void>\n onDeny?: () => void | Promise<void>\n approveLabel?: string\n denyLabel?: string\n /** Why the choice cannot be made right now; shown in words beside the buttons. */\n disabledReason?: string\n /** A failed answer, in words. Overrides the rejection's own message. */\n error?: string\n /** Who answered, once settled. Omit if unknown; nothing is assumed. */\n resolvedBy?: string\n /** When it was answered, already formatted for the reader. Omit if unknown. */\n resolvedAt?: string\n /** Extra content between the details and the buttons. */\n children?: JSX.Element\n}\n\ntype Choice = 'approve' | 'deny'\n\nexport function Confirmation(props: ConfirmationProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'state',\n 'title',\n 'description',\n 'details',\n 'onApprove',\n 'onDeny',\n 'approveLabel',\n 'denyLabel',\n 'disabledReason',\n 'error',\n 'resolvedBy',\n 'resolvedAt',\n 'children'\n )\n const uid = createUniqueId()\n const titleId = `${uid}-title`\n const reasonId = `${uid}-reason`\n const state = (): ConfirmationState => local.state ?? 'requested'\n const awaiting = () => isAwaitingAnswer(state())\n const [pending, setPending] = createSignal<Choice | undefined>(undefined)\n const [failure, setFailure] = createSignal<string | undefined>(undefined)\n let inflight = false\n let root: HTMLElement | undefined\n let outcome: HTMLParagraphElement | undefined\n\n const reasonFor = (handler: (() => void | Promise<void>) | undefined, missing: string) => {\n if (pending() !== undefined) return 'Your answer is being sent.'\n return decisionReason({\n state: state(),\n disabledReason: local.disabledReason,\n hasHandler: handler !== undefined,\n unavailableFallback: 'This request cannot be answered right now.',\n missingFallback: missing,\n })\n }\n const approveReason = () => reasonFor(local.onApprove, 'Approving is not available here.')\n const denyReason = () => reasonFor(local.onDeny, 'Denying is not available here.')\n // One sentence per distinct reason, so two identical reasons are not read twice.\n const reasons = () => [...new Set([approveReason(), denyReason()].filter(Boolean))].join(' ')\n const error = () => (local.error ? boundText(local.error, REASON_TEXT_LIMIT) : failure())\n\n const choose = async (choice: Choice) => {\n const handler = choice === 'approve' ? local.onApprove : local.onDeny\n const blocked = choice === 'approve' ? approveReason() : denyReason()\n if (inflight || blocked || !awaiting()) return\n inflight = true\n setPending(choice)\n setFailure(undefined)\n const result = await settleDecision(handler)\n inflight = false\n setPending(undefined)\n if (!result.ok) setFailure(result.message)\n }\n\n // The buttons are replaced by the outcome line; keep a keyboard reader in the card.\n // A memo, so the effect re-runs only when the answer state flips; the apply phase\n // gets the previous value, undefined on the first run.\n const isAwaiting = createMemo(awaiting)\n createEffect(isAwaiting, (now, was) => {\n if (was && !now) {\n const active = document.activeElement\n if (active === null || active === document.body || root?.contains(active)) {\n outcome?.focus()\n }\n }\n })\n\n const buttonProps = (choice: Choice) => {\n const blocked = () => (choice === 'approve' ? approveReason() : denyReason())\n const disabled = () => pending() !== undefined || blocked() !== undefined\n // Getters, so the spread keeps both attributes following the state.\n return {\n get 'aria-disabled'() {\n return disabled() ? ('true' as const) : undefined\n },\n get 'aria-describedby'() {\n return blocked() ? reasonId : undefined\n },\n onClick: () => void choose(choice),\n }\n }\n\n return (\n <section\n ref={(element) => (root = element)}\n data-slot=\"confirmation\"\n data-state={state()}\n aria-labelledby={titleId}\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4',\n {\n 'border-ring': awaiting(),\n 'border-border': !awaiting(),\n },\n local.class\n )}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={state() === 'approved'}>\n <Check class=\"text-success\" />\n </Show>\n <Show when={state() === 'denied'}>\n <Ban />\n </Show>\n <Show when={state() === 'expired'}>\n <Clock />\n </Show>\n <Show when={state() === 'unavailable'}>\n <Lock />\n </Show>\n <Show when={state() === 'requested'}>\n <ShieldQuestion />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 id={titleId} class=\"m-0 text-sm font-semibold [overflow-wrap:anywhere]\">\n {boundText(local.title, 200)}\n </h3>\n <Show when={local.description}>\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {boundText(local.description ?? '', 400)}\n </p>\n </Show>\n </div>\n <Show when={awaiting()}>\n <span class=\"shrink-0 text-xs text-muted-foreground\">\n {state() === 'requested' ? 'Needs your answer' : 'Cannot be answered now'}\n </span>\n </Show>\n </header>\n\n <Show when={local.details}>{(details) => <Details details={details()} />}</Show>\n\n {local.children}\n\n <Show\n when={awaiting()}\n fallback={\n <p\n ref={(element) => (outcome = element)}\n tabindex=\"-1\"\n role=\"status\"\n class=\"m-0 flex items-center gap-1.5 text-xs text-muted-foreground outline-none\"\n >\n {confirmationOutcome(state(), local.resolvedBy, local.resolvedAt)}\n </p>\n }\n >\n <Show when={reasons()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reasons()}\n </p>\n </Show>\n <Show when={error()}>\n <p role=\"alert\" class=\"m-0 text-xs text-destructive [overflow-wrap:anywhere]\">\n {error()}\n </p>\n </Show>\n <footer class=\"flex flex-wrap items-center justify-end gap-2\">\n <Button type=\"button\" variant=\"outline\" size=\"sm\" {...buttonProps('deny')}>\n <Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.denyLabel ?? 'Deny'}\n </Button>\n <Button type=\"button\" size=\"sm\" {...buttonProps('approve')}>\n <Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.approveLabel ?? 'Approve'}\n </Button>\n {/* Present from the start: a live region inserted with its text is not reliably announced. */}\n <span role=\"status\" class=\"visually-hidden\">\n {pending() !== undefined ? 'Sending your answer' : ''}\n </span>\n </footer>\n </Show>\n </section>\n )\n}\n\n/** A name from the host or the model, cleaned and clipped before it reaches a header. */\nfunction bounded(value: string | undefined, limit: number): string | undefined {\n return value ? boundText(value, limit) || undefined : undefined\n}\n\nfunction Details(props: { details: ConfirmationDetails }) {\n return (\n <Show\n when={props.details.kind === 'diff' && props.details}\n fallback={\n <CodeBlock\n size=\"sm\"\n code={(props.details as Extract<ConfirmationDetails, { kind: 'code' }>).code}\n language={bounded(\n (props.details as Extract<ConfirmationDetails, { kind: 'code' }>).language,\n 24\n )}\n title={bounded(props.details.title, 80)}\n complete\n wrap\n maxHeight=\"14rem\"\n />\n }\n >\n {(diff) => (\n // The diff block has no height cap of its own, so the cap lives here; a\n // scroller must be focusable, hence the labelled region and tab stop.\n <div\n role=\"region\"\n aria-label=\"Proposed changes\"\n tabindex=\"0\"\n class=\"max-h-64 overflow-auto rounded-xl outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n >\n <DiffBlock\n patch={(diff() as Extract<ConfirmationDetails, { kind: 'diff' }>).patch}\n title={bounded(diff().title, 80)}\n complete\n />\n </div>\n )}\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyBA,IAAM,MAAM,SAASiC,KAAS;AAC9B,IAAM,QAAQ,SAASC,OAAW;AAClC,IAAM,QAAQ,SAASC,OAAW;AAClC,IAAM,OAAO,SAASC,MAAU;AAChC,IAAM,iBAAiB,SAASC,gBAAoB;AAmEpD,SAAgB,aAAa,OAA0B;CACrD,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,SACA,SACA,SACA,eACA,WACA,aACA,UACA,gBACA,aACA,kBACA,SACA,cACA,cACA,UACF;CACA,MAAM,MAAM,eAAe;CAC3B,MAAM,UAAU,GAAG,IAAI;CACvB,MAAM,WAAW,GAAG,IAAI;CACxB,MAAM,cAAiC,MAAM,SAAS;CACtD,MAAM,iBAAiB,iBAAiB,MAAM,CAAC;CAC/C,MAAM,CAAC,SAAS,cAAc,a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Y,OAAA,QAMER,gBAAAA,WAAAA;IACE,IAAA,QAAA;KAAQ,OAAA,KAAK,CAAA,CAAqD;IAAK;IACvE,IAAA,QAAA;KAAO,OAAA,QAAQ,KAAK,CAAC,CAAC,OAAO,EAAE;IAAC;IAChC,UAAA;GACD,CAAA,CACE;GAXL,OAAA;EAWK,EAAA,CAAA;CAEH,CAAA;AAEV"}
|
|
1
|
+
{"version":3,"file":"confirmation.js","names":["ref={(element) => (root = element)}","<Check class=\"text-success\" />","class=\"text-success\"","<span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={state() === 'approved'}>\n <Check class=\"text-success\" />\n </Show>\n <Show when={state() === 'denied'}>\n <Ban />\n </Show>\n <Show when={state() === 'expired'}>\n <Clock />\n </Show>\n <Show when={state() === 'unavailable'}>\n <Lock />\n </Show>\n <Show when={state() === 'requested'}>\n <ShieldQuestion />\n </Show>\n </span>","<Ban />","<Clock />","<Lock />","<ShieldQuestion />","<Show when={local.details}>{(details) => <Details details={details()} />}</Show>","<Details details={details()} />","<section\n ref={(element) => (root = element)}\n data-slot=\"confirmation\"\n data-state={state()}\n aria-labelledby={titleId}\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4',\n {\n 'border-ring': awaiting(),\n 'border-border': !awaiting(),\n },\n local.class\n )}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={state() === 'approved'}>\n <Check class=\"text-success\" />\n </Show>\n <Show when={state() === 'denied'}>\n <Ban />\n </Show>\n <Show when={state() === 'expired'}>\n <Clock />\n </Show>\n <Show when={state() === 'unavailable'}>\n <Lock />\n </Show>\n <Show when={state() === 'requested'}>\n <ShieldQuestion />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 id={titleId} class=\"m-0 text-sm font-semibold [overflow-wrap:anywhere]\">\n {boundText(local.title, 200)}\n </h3>\n <Show when={local.description}>\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {boundText(local.description ?? '', 400)}\n </p>\n </Show>\n </div>\n <Show when={awaiting()}>\n <span class=\"shrink-0 text-xs text-muted-foreground\">\n {state() === 'requested' ? 'Needs your answer' : 'Cannot be answered now'}\n </span>\n </Show>\n </header>\n\n <Show when={local.details}>{(details) => <Details details={details()} />}</Show>\n\n {local.children}\n\n <Show\n when={awaiting()}\n fallback={\n <p\n ref={(element) => (outcome = element)}\n tabindex=\"-1\"\n role=\"status\"\n class=\"m-0 flex items-center gap-1.5 text-xs text-muted-foreground outline-none\"\n >\n {confirmationOutcome(state(), local.resolvedBy, local.resolvedAt)}\n </p>\n }\n >\n <Show when={reasons()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reasons()}\n </p>\n </Show>\n <Show when={error()}>\n <p role=\"alert\" class=\"m-0 text-xs text-destructive [overflow-wrap:anywhere]\">\n {error()}\n </p>\n </Show>\n <footer class=\"flex flex-wrap items-center justify-end gap-2\">\n <Button type=\"button\" variant=\"outline\" size=\"sm\" {...buttonProps('deny')}>\n <Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.denyLabel ?? 'Deny'}\n </Button>\n <Button type=\"button\" size=\"sm\" {...buttonProps('approve')}>\n <Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.approveLabel ?? 'Approve'}\n </Button>\n {/* Present from the start: a live region inserted with its text is not reliably announced. */}\n <span role=\"status\" class=\"visually-hidden\">\n {pending() !== undefined ? 'Sending your answer' : ''}\n </span>\n </footer>\n </Show>\n </section>","<Show when={reasons()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reasons()}\n </p>\n </Show>","<p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reasons()}\n </p>","<Show when={error()}>\n <p role=\"alert\" class=\"m-0 text-xs text-destructive [overflow-wrap:anywhere]\">\n {error()}\n </p>\n </Show>","<p role=\"alert\" class=\"m-0 text-xs text-destructive [overflow-wrap:anywhere]\">\n {error()}\n </p>","<Button type=\"button\" variant=\"outline\" size=\"sm\" {...buttonProps('deny')}>\n <Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.denyLabel ?? 'Deny'}\n </Button>","type=\"button\"","variant=\"outline\"","size=\"sm\"","<Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>","<Spinner size=\"sm\" label={false} />","label={false}","local.denyLabel ?? 'Deny'","<footer class=\"flex flex-wrap items-center justify-end gap-2\">\n <Button type=\"button\" variant=\"outline\" size=\"sm\" {...buttonProps('deny')}>\n <Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.denyLabel ?? 'Deny'}\n </Button>\n <Button type=\"button\" size=\"sm\" {...buttonProps('approve')}>\n <Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.approveLabel ?? 'Approve'}\n </Button>\n {/* Present from the start: a live region inserted with its text is not reliably announced. */}\n <span role=\"status\" class=\"visually-hidden\">\n {pending() !== undefined ? 'Sending your answer' : ''}\n </span>\n </footer>","<Button type=\"button\" size=\"sm\" {...buttonProps('approve')}>\n <Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.approveLabel ?? 'Approve'}\n </Button>","<Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>","local.approveLabel ?? 'Approve'","ref={(element) => (outcome = element)}","<Show\n when={props.details.kind === 'diff' && props.details}\n fallback={\n <CodeBlock\n size=\"sm\"\n code={(props.details as Extract<ConfirmationDetails, { kind: 'code' }>).code}\n language={bounded(\n (props.details as Extract<ConfirmationDetails, { kind: 'code' }>).language,\n 24\n )}\n title={bounded(props.details.title, 80)}\n complete\n wrap\n maxHeight=\"14rem\"\n />\n }\n >\n {(diff) => (\n // The diff block has no height cap of its own, so the cap lives here; a\n // scroller must be focusable, hence the labelled region and tab stop.\n <div\n role=\"region\"\n aria-label=\"Proposed changes\"\n tabindex=\"0\"\n class=\"max-h-64 overflow-auto rounded-xl outline-none focus-visible:focus-outline-inset\"\n >\n <DiffBlock\n patch={(diff() as Extract<ConfirmationDetails, { kind: 'diff' }>).patch}\n title={bounded(diff().title, 80)}\n complete\n />\n </div>\n )}\n </Show>","props.details.kind === 'diff' && props.details","<CodeBlock\n size=\"sm\"\n code={(props.details as Extract<ConfirmationDetails, { kind: 'code' }>).code}\n language={bounded(\n (props.details as Extract<ConfirmationDetails, { kind: 'code' }>).language,\n 24\n )}\n title={bounded(props.details.title, 80)}\n complete\n wrap\n maxHeight=\"14rem\"\n />","maxHeight=\"14rem\"","<DiffBlock\n patch={(diff() as Extract<ConfirmationDetails, { kind: 'diff' }>).patch}\n title={bounded(diff().title, 80)}\n complete\n />","LucideBan","LucideCheck","LucideClock","LucideLock","LucideShieldQuestion","_$spread","_$ref","_$insert","_$setAttribute"],"sources":["../../../../src/components/composites/confirmation/confirmation.tsx"],"sourcesContent":["import {\n Ban as LucideBan,\n Check as LucideCheck,\n Clock as LucideClock,\n Lock as LucideLock,\n ShieldQuestion as LucideShieldQuestion,\n} from '@lucide/solid'\nimport { createEffect, createMemo, createSignal, createUniqueId, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { CodeBlock } from '../../ui/code-block'\nimport { DiffBlock } from '../../ui/diff-block'\nimport { Spinner } from '../../ui/spinner'\nimport { REASON_TEXT_LIMIT, boundText } from '#lib/text'\nimport {\n confirmationOutcome,\n decisionReason,\n isAwaitingAnswer,\n settleDecision,\n type ConfirmationState,\n} from './confirmation-model'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Ban = fastIcon(LucideBan)\nconst Check = fastIcon(LucideCheck)\nconst Clock = fastIcon(LucideClock)\nconst Lock = fastIcon(LucideLock)\nconst ShieldQuestion = fastIcon(LucideShieldQuestion)\n\n/**\n * Confirmation.\n *\n * The agent has stopped a tool and will not continue until the person approves or\n * denies it. Like `Questionnaire`, this is one of the two elements in a transcript\n * the reader *must* act on, so it is allowed a card surface — and the border is\n * the focus ring's colour only while it is waiting. Once answered it drops to a\n * hairline and a one-line record, because a settled decision should read as\n * history, not as something still asking.\n *\n * ## It shows what is being approved, and nothing else\n *\n * `title` and `description` say what the tool wants to do; `details` is the\n * evidence, rendered as `CodeBlock size=\"sm\"` (a command, a request) or\n * `DiffBlock` (a patch). Details are text: never interpreted, and a long one\n * scrolls inside its block. Approve and Deny exist only while the request is\n * open; afterwards they are replaced by the outcome, with *who* and *when* only if\n * the host supplied them.\n *\n * ## The host owns authority\n *\n * Whether this client may answer is not decided here. No handler, or a host\n * `disabledReason`, or the `unavailable` state, leaves the buttons visible and\n * disabled with the reason beside them in words — never hidden, because a reader\n * who cannot see the choice cannot tell whether the agent is waiting on them.\n *\n * ## Answering is a round trip\n *\n * `onApprove` / `onDeny` may return a promise. While one is pending both buttons\n * refuse input (a synchronous guard as well as the signal, so a double click in\n * one tick cannot submit twice) and the pressed one shows a spinner. A failure\n * shows `error` (or the rejection's own message) and re-enables the buttons. The\n * buttons use `aria-disabled` rather than `disabled`: a native disabled button\n * drops focus, and the reader's place would be lost mid-decision. When the state\n * settles, focus moves to the outcome line if it was in the card, so a keyboard\n * user is not stranded on a control that no longer exists.\n */\nexport type ConfirmationDetails =\n | Readonly<{ kind: 'code'; code: string; language?: string; title?: string }>\n | Readonly<{ kind: 'diff'; patch: string; title?: string }>\n\nexport type ConfirmationProps = Omit<ComponentProps<'section'>, 'title' | 'onError'> & {\n state?: ConfirmationState\n /** What the tool wants to do, as a short sentence. */\n title: string\n description?: string\n details?: ConfirmationDetails\n onApprove?: () => void | Promise<void>\n onDeny?: () => void | Promise<void>\n approveLabel?: string\n denyLabel?: string\n /** Why the choice cannot be made right now; shown in words beside the buttons. */\n disabledReason?: string\n /** A failed answer, in words. Overrides the rejection's own message. */\n error?: string\n /** Who answered, once settled. Omit if unknown; nothing is assumed. */\n resolvedBy?: string\n /** When it was answered, already formatted for the reader. Omit if unknown. */\n resolvedAt?: string\n /** Extra content between the details and the buttons. */\n children?: JSX.Element\n}\n\ntype Choice = 'approve' | 'deny'\n\nexport function Confirmation(props: ConfirmationProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'state',\n 'title',\n 'description',\n 'details',\n 'onApprove',\n 'onDeny',\n 'approveLabel',\n 'denyLabel',\n 'disabledReason',\n 'error',\n 'resolvedBy',\n 'resolvedAt',\n 'children'\n )\n const uid = createUniqueId()\n const titleId = `${uid}-title`\n const reasonId = `${uid}-reason`\n const state = (): ConfirmationState => local.state ?? 'requested'\n const awaiting = () => isAwaitingAnswer(state())\n const [pending, setPending] = createSignal<Choice | undefined>(undefined)\n const [failure, setFailure] = createSignal<string | undefined>(undefined)\n let inflight = false\n let root: HTMLElement | undefined\n let outcome: HTMLParagraphElement | undefined\n\n const reasonFor = (handler: (() => void | Promise<void>) | undefined, missing: string) => {\n if (pending() !== undefined) return 'Your answer is being sent.'\n return decisionReason({\n state: state(),\n disabledReason: local.disabledReason,\n hasHandler: handler !== undefined,\n unavailableFallback: 'This request cannot be answered right now.',\n missingFallback: missing,\n })\n }\n const approveReason = () => reasonFor(local.onApprove, 'Approving is not available here.')\n const denyReason = () => reasonFor(local.onDeny, 'Denying is not available here.')\n // One sentence per distinct reason, so two identical reasons are not read twice.\n const reasons = () => [...new Set([approveReason(), denyReason()].filter(Boolean))].join(' ')\n const error = () => (local.error ? boundText(local.error, REASON_TEXT_LIMIT) : failure())\n\n const choose = async (choice: Choice) => {\n const handler = choice === 'approve' ? local.onApprove : local.onDeny\n const blocked = choice === 'approve' ? approveReason() : denyReason()\n if (inflight || blocked || !awaiting()) return\n inflight = true\n setPending(choice)\n setFailure(undefined)\n const result = await settleDecision(handler)\n inflight = false\n setPending(undefined)\n if (!result.ok) setFailure(result.message)\n }\n\n // The buttons are replaced by the outcome line; keep a keyboard reader in the card.\n // A memo, so the effect re-runs only when the answer state flips; the apply phase\n // gets the previous value, undefined on the first run.\n const isAwaiting = createMemo(awaiting)\n createEffect(isAwaiting, (now, was) => {\n if (was && !now) {\n const active = document.activeElement\n if (active === null || active === document.body || root?.contains(active)) {\n outcome?.focus()\n }\n }\n })\n\n const buttonProps = (choice: Choice) => {\n const blocked = () => (choice === 'approve' ? approveReason() : denyReason())\n const disabled = () => pending() !== undefined || blocked() !== undefined\n // Getters, so the spread keeps both attributes following the state.\n return {\n get 'aria-disabled'() {\n return disabled() ? ('true' as const) : undefined\n },\n get 'aria-describedby'() {\n return blocked() ? reasonId : undefined\n },\n onClick: () => void choose(choice),\n }\n }\n\n return (\n <section\n ref={(element) => (root = element)}\n data-slot=\"confirmation\"\n data-state={state()}\n aria-labelledby={titleId}\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4',\n {\n 'border-ring': awaiting(),\n 'border-border': !awaiting(),\n },\n local.class\n )}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={state() === 'approved'}>\n <Check class=\"text-success\" />\n </Show>\n <Show when={state() === 'denied'}>\n <Ban />\n </Show>\n <Show when={state() === 'expired'}>\n <Clock />\n </Show>\n <Show when={state() === 'unavailable'}>\n <Lock />\n </Show>\n <Show when={state() === 'requested'}>\n <ShieldQuestion />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 id={titleId} class=\"m-0 text-sm font-semibold [overflow-wrap:anywhere]\">\n {boundText(local.title, 200)}\n </h3>\n <Show when={local.description}>\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {boundText(local.description ?? '', 400)}\n </p>\n </Show>\n </div>\n <Show when={awaiting()}>\n <span class=\"shrink-0 text-xs text-muted-foreground\">\n {state() === 'requested' ? 'Needs your answer' : 'Cannot be answered now'}\n </span>\n </Show>\n </header>\n\n <Show when={local.details}>{(details) => <Details details={details()} />}</Show>\n\n {local.children}\n\n <Show\n when={awaiting()}\n fallback={\n <p\n ref={(element) => (outcome = element)}\n tabindex=\"-1\"\n role=\"status\"\n class=\"m-0 flex items-center gap-1.5 text-xs text-muted-foreground outline-none\"\n >\n {confirmationOutcome(state(), local.resolvedBy, local.resolvedAt)}\n </p>\n }\n >\n <Show when={reasons()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reasons()}\n </p>\n </Show>\n <Show when={error()}>\n <p role=\"alert\" class=\"m-0 text-xs text-destructive [overflow-wrap:anywhere]\">\n {error()}\n </p>\n </Show>\n <footer class=\"flex flex-wrap items-center justify-end gap-2\">\n <Button type=\"button\" variant=\"outline\" size=\"sm\" {...buttonProps('deny')}>\n <Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.denyLabel ?? 'Deny'}\n </Button>\n <Button type=\"button\" size=\"sm\" {...buttonProps('approve')}>\n <Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.approveLabel ?? 'Approve'}\n </Button>\n {/* Present from the start: a live region inserted with its text is not reliably announced. */}\n <span role=\"status\" class=\"visually-hidden\">\n {pending() !== undefined ? 'Sending your answer' : ''}\n </span>\n </footer>\n </Show>\n </section>\n )\n}\n\n/** A name from the host or the model, cleaned and clipped before it reaches a header. */\nfunction bounded(value: string | undefined, limit: number): string | undefined {\n return value ? boundText(value, limit) || undefined : undefined\n}\n\nfunction Details(props: { details: ConfirmationDetails }) {\n return (\n <Show\n when={props.details.kind === 'diff' && props.details}\n fallback={\n <CodeBlock\n size=\"sm\"\n code={(props.details as Extract<ConfirmationDetails, { kind: 'code' }>).code}\n language={bounded(\n (props.details as Extract<ConfirmationDetails, { kind: 'code' }>).language,\n 24\n )}\n title={bounded(props.details.title, 80)}\n complete\n wrap\n maxHeight=\"14rem\"\n />\n }\n >\n {(diff) => (\n // The diff block has no height cap of its own, so the cap lives here; a\n // scroller must be focusable, hence the labelled region and tab stop.\n <div\n role=\"region\"\n aria-label=\"Proposed changes\"\n tabindex=\"0\"\n class=\"max-h-64 overflow-auto rounded-xl outline-none focus-visible:focus-outline-inset\"\n >\n <DiffBlock\n patch={(diff() as Extract<ConfirmationDetails, { kind: 'diff' }>).patch}\n title={bounded(diff().title, 80)}\n complete\n />\n </div>\n )}\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyBA,IAAM,MAAM,SAASiC,KAAS;AAC9B,IAAM,QAAQ,SAASC,OAAW;AAClC,IAAM,QAAQ,SAASC,OAAW;AAClC,IAAM,OAAO,SAASC,MAAU;AAChC,IAAM,iBAAiB,SAASC,gBAAoB;AAmEpD,SAAgB,aAAa,OAA0B;CACrD,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,SACA,SACA,SACA,eACA,WACA,aACA,UACA,gBACA,aACA,kBACA,SACA,cACA,cACA,UACF;CACA,MAAM,MAAM,eAAe;CAC3B,MAAM,UAAU,GAAG,IAAI;CACvB,MAAM,WAAW,GAAG,IAAI;CACxB,MAAM,cAAiC,MAAM,SAAS;CACtD,MAAM,iBAAiB,iBAAiB,MAAM,CAAC;CAC/C,MAAM,CAAC,SAAS,cAAc,aAAiC,KAAA,CAAS;CACxE,MAAM,CAAC,SAAS,cAAc,aAAiC,KAAA,CAAS;CACxE,IAAI,WAAW;CACf,IAAI;CACJ,IAAI;CAEJ,MAAM,aAAa,SAAmD,YAAoB;EACxF,IAAI,QAAQ,MAAM,KAAA,GAAW,OAAO;EACpC,OAAO,eAAe;GACpB,OAAO,MAAM;GACb,gBAAgB,MAAM;GACtB,YAAY,YAAY,KAAA;GACxB,qBAAqB;GACrB,iBAAiB;EACnB,CAAC;CACH;CACA,MAAM,sBAAsB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Default() ? `${entry.label} (default)` : entry.label,
|
|
182
|
-
t: readShallow(cn("flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground", "transition-colors ease-out", "hover:bg-surface-hover hover:text-foreground", "has-focus-visible:border-ring has-focus-visible:
|
|
182
|
+
t: readShallow(cn("flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground", "transition-colors ease-out", "hover:bg-surface-hover hover:text-foreground", "has-focus-visible:border-ring has-focus-visible:focus-outline", "has-checked:border-primary has-checked:bg-primary-subtle has-checked:text-primary", "has-disabled:pointer-events-none has-disabled:opacity-50")),
|
|
183
183
|
a: entry.key,
|
|
184
184
|
o: checkedKey() === entry.key,
|
|
185
185
|
i: props.disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-picker.js","names":["<Show\n when={props.image}\n fallback={<ImageUp class=\"size-5 text-muted-foreground\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full object-cover\" />}\n </Show>","<ImageUp class=\"size-5 text-muted-foreground\" aria-hidden=\"true\" />","class=\"size-5 text-muted-foreground\"","ref={setFileInput}","<Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => fileInput()?.click()}\n >\n <ImageUp aria-hidden=\"true\" />\n {props.image ? 'Replace image' : 'Upload image'}\n </Button>","type=\"button\"","variant=\"outline\"","size=\"sm\"","onClick={() => fileInput()?.click()}","<ImageUp aria-hidden=\"true\" />","props.image ? 'Replace image' : 'Upload image'","<div class=\"flex flex-wrap items-center gap-2\">\n <input\n ref={setFileInput}\n id={inputId}\n type=\"file\"\n class=\"sr-only\"\n tabindex={-1}\n // The visible button drives this input; hide the duplicate from assistive\n // technology but keep a name so the form-label rule is satisfied.\n aria-hidden=\"true\"\n aria-label={props.image ? 'Replace image' : 'Upload image'}\n accept=\"image/png,image/jpeg,image/webp,image/gif\"\n disabled={props.disabled}\n onChange={(event) => {\n const input = event.currentTarget\n void upload(input.files?.[0])\n // Clearing the value lets the same file be chosen again after Remove.\n input.value = ''\n }}\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => fileInput()?.click()}\n >\n <ImageUp aria-hidden=\"true\" />\n {props.image ? 'Replace image' : 'Upload image'}\n </Button>\n <Show when={props.image}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => {\n setProblem(undefined)\n props.onImageChange?.(undefined)\n }}\n >\n <Trash2 aria-hidden=\"true\" />\n Remove image\n </Button>\n </Show>\n </div>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => {\n setProblem(undefined)\n props.onImageChange?.(undefined)\n }}\n >\n <Trash2 aria-hidden=\"true\" />\n Remove image\n </Button>","variant=\"ghost\"","onClick={() => {\n setProblem(undefined)\n props.onImageChange?.(undefined)\n }}","<Trash2 aria-hidden=\"true\" />","disabled={props.disabled}","<Show when={problem()}>\n {(message) => (\n <p role=\"alert\" class=\"text-sm text-destructive\">\n {message()}\n </p>\n )}\n </Show>","<p class=\"text-xs text-muted-foreground\">\n PNG, JPEG, WebP or GIF up to {MARK_IMAGE_MAX_SOURCE_BYTES / 1024 / 1024} MB. It is cropped\n to a square.\n </p>","<div data-slot=\"icon-picker\" class={cn('flex flex-col gap-3', props.class)}>\n <Show when={props.onImageChange}>\n <div class=\"flex items-center gap-3\" data-slot=\"icon-picker-upload\">\n <span\n aria-hidden=\"true\"\n class=\"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-muted\"\n >\n <Show\n when={props.image}\n fallback={<ImageUp class=\"size-5 text-muted-foreground\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full object-cover\" />}\n </Show>\n </span>\n <div class=\"flex flex-wrap items-center gap-2\">\n <input\n ref={setFileInput}\n id={inputId}\n type=\"file\"\n class=\"sr-only\"\n tabindex={-1}\n // The visible button drives this input; hide the duplicate from assistive\n // technology but keep a name so the form-label rule is satisfied.\n aria-hidden=\"true\"\n aria-label={props.image ? 'Replace image' : 'Upload image'}\n accept=\"image/png,image/jpeg,image/webp,image/gif\"\n disabled={props.disabled}\n onChange={(event) => {\n const input = event.currentTarget\n void upload(input.files?.[0])\n // Clearing the value lets the same file be chosen again after Remove.\n input.value = ''\n }}\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => fileInput()?.click()}\n >\n <ImageUp aria-hidden=\"true\" />\n {props.image ? 'Replace image' : 'Upload image'}\n </Button>\n <Show when={props.image}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => {\n setProblem(undefined)\n props.onImageChange?.(undefined)\n }}\n >\n <Trash2 aria-hidden=\"true\" />\n Remove image\n </Button>\n </Show>\n </div>\n </div>\n <Show when={problem()}>\n {(message) => (\n <p role=\"alert\" class=\"text-sm text-destructive\">\n {message()}\n </p>\n )}\n </Show>\n <p class=\"text-xs text-muted-foreground\">\n PNG, JPEG, WebP or GIF up to {MARK_IMAGE_MAX_SOURCE_BYTES / 1024 / 1024} MB. It is cropped\n to a square.\n </p>\n </Show>\n <div\n ref={setGroup}\n role=\"radiogroup\"\n aria-label={props.label}\n aria-disabled={props.disabled ? 'true' : undefined}\n class=\"grid grid-cols-[repeat(auto-fill,minmax(2.5rem,1fr))] gap-1.5\"\n >\n <For each={shellIconEntries}>\n {(entry) => {\n const Icon = resolveShellIcon(entry.key)\n const isDefault = () => entry.key === props.defaultKey\n return (\n <label\n title={isDefault() ? `${entry.label} (default)` : entry.label}\n class={cn(\n 'flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground',\n 'transition-colors ease-out',\n 'hover:bg-surface-hover hover:text-foreground',\n 'has-focus-visible:border-ring has-focus-visible:ring-3 has-focus-visible:ring-primary-subtle',\n 'has-checked:border-primary has-checked:bg-primary-subtle has-checked:text-primary',\n 'has-disabled:pointer-events-none has-disabled:opacity-50'\n )}\n >\n <input\n type=\"radio\"\n name={groupName}\n value={entry.key}\n class=\"sr-only\"\n checked={checkedKey() === entry.key}\n disabled={props.disabled}\n onChange={() => {\n props.onValueChange(entry.key)\n syncChecked()\n }}\n />\n <Icon class=\"size-5\" aria-hidden=\"true\" />\n <span class=\"sr-only\">\n {entry.label}\n {isDefault() ? ' (default)' : ''}\n </span>\n </label>\n )\n }}\n </For>\n </div>\n </div>","ref={setGroup}","<For each={shellIconEntries}>\n {(entry) => {\n const Icon = resolveShellIcon(entry.key)\n const isDefault = () => entry.key === props.defaultKey\n return (\n <label\n title={isDefault() ? `${entry.label} (default)` : entry.label}\n class={cn(\n 'flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground',\n 'transition-colors ease-out',\n 'hover:bg-surface-hover hover:text-foreground',\n 'has-focus-visible:border-ring has-focus-visible:ring-3 has-focus-visible:ring-primary-subtle',\n 'has-checked:border-primary has-checked:bg-primary-subtle has-checked:text-primary',\n 'has-disabled:pointer-events-none has-disabled:opacity-50'\n )}\n >\n <input\n type=\"radio\"\n name={groupName}\n value={entry.key}\n class=\"sr-only\"\n checked={checkedKey() === entry.key}\n disabled={props.disabled}\n onChange={() => {\n props.onValueChange(entry.key)\n syncChecked()\n }}\n />\n <Icon class=\"size-5\" aria-hidden=\"true\" />\n <span class=\"sr-only\">\n {entry.label}\n {isDefault() ? ' (default)' : ''}\n </span>\n </label>\n )\n }}\n </For>","each={shellIconEntries}","<Icon class=\"size-5\" aria-hidden=\"true\" />","class=\"size-5\"","<label\n title={isDefault() ? `${entry.label} (default)` : entry.label}\n class={cn(\n 'flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground',\n 'transition-colors ease-out',\n 'hover:bg-surface-hover hover:text-foreground',\n 'has-focus-visible:border-ring has-focus-visible:ring-3 has-focus-visible:ring-primary-subtle',\n 'has-checked:border-primary has-checked:bg-primary-subtle has-checked:text-primary',\n 'has-disabled:pointer-events-none has-disabled:opacity-50'\n )}\n >\n <input\n type=\"radio\"\n name={groupName}\n value={entry.key}\n class=\"sr-only\"\n checked={checkedKey() === entry.key}\n disabled={props.disabled}\n onChange={() => {\n props.onValueChange(entry.key)\n syncChecked()\n }}\n />\n <Icon class=\"size-5\" aria-hidden=\"true\" />\n <span class=\"sr-only\">\n {entry.label}\n {isDefault() ? ' (default)' : ''}\n </span>\n </label>","<span class=\"sr-only\">\n {entry.label}\n {isDefault() ? ' (default)' : ''}\n </span>","class={cn(\n 'flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground',\n 'transition-colors ease-out',\n 'hover:bg-surface-hover hover:text-foreground',\n 'has-focus-visible:border-ring has-focus-visible:ring-3 has-focus-visible:ring-primary-subtle',\n 'has-checked:border-primary has-checked:bg-primary-subtle has-checked:text-primary',\n 'has-disabled:pointer-events-none has-disabled:opacity-50'\n )}","value={entry.key}","checked={checkedKey() === entry.key}","title={isDefault() ? `${entry.label} (default)` : entry.label}","aria-label={props.label}","aria-disabled={props.disabled ? 'true' : undefined}","<Popover open={open()} onOpenChange={setOpen} placement=\"bottom-start\">\n <PopoverTrigger\n as={IconPickerTriggerButton}\n type=\"button\"\n variant=\"outline\"\n data-slot=\"icon-picker-trigger\"\n aria-label={`${props.label}: ${props.image ? 'uploaded image' : shellIconLabel(props.value ?? props.defaultKey ?? '')}`}\n disabled={props.disabled}\n class={cn('gap-2', local.class)}\n >\n <span aria-hidden=\"true\" class=\"flex size-5 items-center justify-center overflow-hidden\">\n <Show\n when={local.trigger}\n fallback={\n <Show\n when={props.image}\n fallback={<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full rounded-sm object-cover\" />}\n </Show>\n }\n >\n {(triggerSlot) => <>{triggerSlot()}</>}\n </Show>\n </span>\n <ChevronDown class=\"size-4 text-muted-foreground\" aria-hidden=\"true\" />\n </PopoverTrigger>\n <PopoverContent class=\"w-88 max-w-(--available-width)\">\n <IconPicker\n {...picker}\n onValueChange={(key) => {\n picker.onValueChange(key)\n setOpen(false)\n }}\n />\n </PopoverContent>\n </Popover>","onOpenChange={setOpen}","placement=\"bottom-start\"","<PopoverTrigger\n as={IconPickerTriggerButton}\n type=\"button\"\n variant=\"outline\"\n data-slot=\"icon-picker-trigger\"\n aria-label={`${props.label}: ${props.image ? 'uploaded image' : shellIconLabel(props.value ?? props.defaultKey ?? '')}`}\n disabled={props.disabled}\n class={cn('gap-2', local.class)}\n >\n <span aria-hidden=\"true\" class=\"flex size-5 items-center justify-center overflow-hidden\">\n <Show\n when={local.trigger}\n fallback={\n <Show\n when={props.image}\n fallback={<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full rounded-sm object-cover\" />}\n </Show>\n }\n >\n {(triggerSlot) => <>{triggerSlot()}</>}\n </Show>\n </span>\n <ChevronDown class=\"size-4 text-muted-foreground\" aria-hidden=\"true\" />\n </PopoverTrigger>","as={IconPickerTriggerButton}","<Show\n when={local.trigger}\n fallback={\n <Show\n when={props.image}\n fallback={<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full rounded-sm object-cover\" />}\n </Show>\n }\n >\n {(triggerSlot) => <>{triggerSlot()}</>}\n </Show>","<Show\n when={props.image}\n fallback={<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full rounded-sm object-cover\" />}\n </Show>","<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />","class=\"size-4\"","{triggerSlot()}","<ChevronDown class=\"size-4 text-muted-foreground\" aria-hidden=\"true\" />","class=\"size-4 text-muted-foreground\"","<PopoverContent class=\"w-88 max-w-(--available-width)\">\n <IconPicker\n {...picker}\n onValueChange={(key) => {\n picker.onValueChange(key)\n setOpen(false)\n }}\n />\n </PopoverContent>","class=\"w-88 max-w-(--available-width)\"","<IconPicker\n {...picker}\n onValueChange={(key) => {\n picker.onValueChange(key)\n setOpen(false)\n }}\n />","onValueChange={(key) => {\n picker.onValueChange(key)\n setOpen(false)\n }}","LucideChevronDown","LucideImageUp","LucideTrash2","_$insert","_$effect","_$setAttribute","_$ref","_$readShallow","_$className","_$setProperty"],"sources":["../../../../src/components/composites/icon-picker/icon-picker.tsx"],"sourcesContent":["import {\n ChevronDown as LucideChevronDown,\n ImageUp as LucideImageUp,\n Trash2 as LucideTrash2,\n} from '@lucide/solid'\nimport type { JSX } from '@solidjs/web'\nimport { For, Show, createSignal, createUniqueId, omit } from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport { createLatestAction } from '#lib/async-action'\nimport { cn } from '#lib/utils'\nimport { slotted } from '#lib/slotted'\nimport { Button } from '../../ui/button'\nimport { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover'\nimport {\n MarkImageError,\n markImageFromFile,\n markImageProblemCopy,\n MARK_IMAGE_MAX_SOURCE_BYTES,\n} from './image-data-url'\nimport { resolveShellIcon, shellIconEntries, shellIconLabel } from './shell-icons'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst ImageUp = fastIcon(LucideImageUp)\nconst Trash2 = fastIcon(LucideTrash2)\n\n/**\n * IconPicker.\n *\n * The control behind \"choose an icon\" for a workspace or a project: a grid of\n * curated glyphs, and optionally an uploaded picture in their place.\n *\n * It is a single-choice group. The glyph grid is native radio inputs sharing a\n * name, so arrow keys move the choice and Tab enters and leaves the grid as one stop,\n * which is the contract a 56-cell grid needs to stay usable from a keyboard. An\n * uploaded image is a separate state, not a 57th cell: while `image` is set no\n * glyph is checked, and choosing a glyph asks the caller to drop the image, so\n * the stored mark is never both.\n *\n * The picker does not persist anything. The caller owns `value` and `image`\n * and saves them with the rest of its form; the image arrives already resized\n * to the stored square (see `markImageFromFile`).\n */\nexport type IconPickerProps = {\n /** The group's accessible name, e.g. \"Workspace icon\". */\n label: string\n /** The checked icon key; ignored while `image` is set. */\n value: string | undefined\n onValueChange(key: string): void\n /** The key the surface treats as unset, labelled \"default\" in the grid. */\n defaultKey?: string\n /** An uploaded mark (a data URL) currently chosen in place of a glyph. */\n image?: string\n /**\n * Called with the resized upload, or `undefined` for Remove. Omit it for a\n * surface that offers glyphs only; the upload row then does not render.\n */\n onImageChange?(image: string | undefined): void\n disabled?: boolean\n class?: string\n}\n\nexport function IconPicker(props: IconPickerProps) {\n const inputId = createUniqueId()\n const [problem, setProblem] = createSignal<string>()\n const uploads = createLatestAction()\n const [fileInput, setFileInput] = createSignal<HTMLInputElement>()\n const [group, setGroup] = createSignal<HTMLDivElement>()\n const groupName = createUniqueId()\n // Controlled: the checked glyph is the host's value, and none while an image is chosen.\n const checkedKey = () => (props.image ? '' : (props.value ?? ''))\n // A click checks its radio natively before the host answers. When the host keeps\n // its value (or answers later), put the DOM back on the controlled key.\n const syncChecked = () => {\n const key = checkedKey()\n for (const radio of group()?.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]') ?? [])\n radio.checked = radio.value === key\n }\n\n const upload = async (file: File | undefined) => {\n if (!file || !props.onImageChange) return\n setProblem(undefined)\n const outcome = await uploads.run(() => markImageFromFile(file))\n if (outcome.status === 'done') props.onImageChange?.(outcome.value)\n else if (outcome.status === 'failed')\n setProblem(\n markImageProblemCopy[\n outcome.error instanceof MarkImageError ? outcome.error.problem : 'unreadable'\n ]\n )\n }\n\n return (\n <div data-slot=\"icon-picker\" class={cn('flex flex-col gap-3', props.class)}>\n <Show when={props.onImageChange}>\n <div class=\"flex items-center gap-3\" data-slot=\"icon-picker-upload\">\n <span\n aria-hidden=\"true\"\n class=\"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-muted\"\n >\n <Show\n when={props.image}\n fallback={<ImageUp class=\"size-5 text-muted-foreground\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full object-cover\" />}\n </Show>\n </span>\n <div class=\"flex flex-wrap items-center gap-2\">\n <input\n ref={setFileInput}\n id={inputId}\n type=\"file\"\n class=\"sr-only\"\n tabindex={-1}\n // The visible button drives this input; hide the duplicate from assistive\n // technology but keep a name so the form-label rule is satisfied.\n aria-hidden=\"true\"\n aria-label={props.image ? 'Replace image' : 'Upload image'}\n accept=\"image/png,image/jpeg,image/webp,image/gif\"\n disabled={props.disabled}\n onChange={(event) => {\n const input = event.currentTarget\n void upload(input.files?.[0])\n // Clearing the value lets the same file be chosen again after Remove.\n input.value = ''\n }}\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => fileInput()?.click()}\n >\n <ImageUp aria-hidden=\"true\" />\n {props.image ? 'Replace image' : 'Upload image'}\n </Button>\n <Show when={props.image}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => {\n setProblem(undefined)\n props.onImageChange?.(undefined)\n }}\n >\n <Trash2 aria-hidden=\"true\" />\n Remove image\n </Button>\n </Show>\n </div>\n </div>\n <Show when={problem()}>\n {(message) => (\n <p role=\"alert\" class=\"text-sm text-destructive\">\n {message()}\n </p>\n )}\n </Show>\n <p class=\"text-xs text-muted-foreground\">\n PNG, JPEG, WebP or GIF up to {MARK_IMAGE_MAX_SOURCE_BYTES / 1024 / 1024} MB. It is cropped\n to a square.\n </p>\n </Show>\n <div\n ref={setGroup}\n role=\"radiogroup\"\n aria-label={props.label}\n aria-disabled={props.disabled ? 'true' : undefined}\n class=\"grid grid-cols-[repeat(auto-fill,minmax(2.5rem,1fr))] gap-1.5\"\n >\n <For each={shellIconEntries}>\n {(entry) => {\n const Icon = resolveShellIcon(entry.key)\n const isDefault = () => entry.key === props.defaultKey\n return (\n <label\n title={isDefault() ? `${entry.label} (default)` : entry.label}\n class={cn(\n 'flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground',\n 'transition-colors ease-out',\n 'hover:bg-surface-hover hover:text-foreground',\n 'has-focus-visible:border-ring has-focus-visible:ring-3 has-focus-visible:ring-primary-subtle',\n 'has-checked:border-primary has-checked:bg-primary-subtle has-checked:text-primary',\n 'has-disabled:pointer-events-none has-disabled:opacity-50'\n )}\n >\n <input\n type=\"radio\"\n name={groupName}\n value={entry.key}\n class=\"sr-only\"\n checked={checkedKey() === entry.key}\n disabled={props.disabled}\n onChange={() => {\n props.onValueChange(entry.key)\n syncChecked()\n }}\n />\n <Icon class=\"size-5\" aria-hidden=\"true\" />\n <span class=\"sr-only\">\n {entry.label}\n {isDefault() ? ' (default)' : ''}\n </span>\n </label>\n )\n }}\n </For>\n </div>\n </div>\n )\n}\n\n/**\n * IconPickerDropdown.\n *\n * The compact form of the picker for a settings row: one button showing the\n * current mark, opening the full grid (and the upload row, when the host offers\n * it) in a popover. Choosing a glyph applies it and closes the popover; an\n * upload or Remove leaves it open so the result is visible. The host owns the\n * value exactly as it does for `IconPicker`.\n */\nexport type IconPickerDropdownProps = IconPickerProps & {\n /** The mark shown on the trigger; defaults to the checked glyph or the uploaded image. */\n trigger?: JSX.Element\n}\n\n// The popover part writes its own data-slot; the rendered button restores ours.\nconst IconPickerTriggerButton = slotted(Button, 'icon-picker-trigger')\n\nexport function IconPickerDropdown(props: IconPickerDropdownProps) {\n const [open, setOpen] = createSignal(false)\n const local = props\n const picker = omit(props, 'trigger', 'class')\n const Current = () => resolveShellIcon(props.value ?? props.defaultKey ?? '')\n return (\n <Popover open={open()} onOpenChange={setOpen} placement=\"bottom-start\">\n <PopoverTrigger\n as={IconPickerTriggerButton}\n type=\"button\"\n variant=\"outline\"\n data-slot=\"icon-picker-trigger\"\n aria-label={`${props.label}: ${props.image ? 'uploaded image' : shellIconLabel(props.value ?? props.defaultKey ?? '')}`}\n disabled={props.disabled}\n class={cn('gap-2', local.class)}\n >\n <span aria-hidden=\"true\" class=\"flex size-5 items-center justify-center overflow-hidden\">\n <Show\n when={local.trigger}\n fallback={\n <Show\n when={props.image}\n fallback={<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full rounded-sm object-cover\" />}\n </Show>\n }\n >\n {(triggerSlot) => <>{triggerSlot()}</>}\n </Show>\n </span>\n <ChevronDown class=\"size-4 text-muted-foreground\" aria-hidden=\"true\" />\n </PopoverTrigger>\n <PopoverContent class=\"w-88 max-w-(--available-width)\">\n <IconPicker\n {...picker}\n onValueChange={(key) => {\n picker.onValueChange(key)\n setOpen(false)\n }}\n />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,IAAM,cAAc,SAASiD,aAAiB;AAC9C,IAAM,UAAU,SAASC,SAAa;AACtC,IAAM,SAAS,SAASC,QAAY;AAsCpC,SAAgB,WAAW,OAAwB;CACjD,MAAM,UAAU,eAAe;CAC/B,MAAM,CAAC,SAAS,cAAc,aAAqB;CACnD,MAAM,UAAU,mBAAmB;CACnC,MAAM,CAAC,WAAW,gBAAgB,aAA+B;CACjE,MAAM,CAAC,OAAO,YAAY,aAA6B;CACvD,MAAM,YAAY,eAAe;CAEjC,MAAM,mBAAoB,MAAM,QAAQ,KAAM,MAAM,SAAS;CAG7D,MAAM,oBAAoB;EACxB,MAAM,MAAM,WAAW;EACvB,KAAK,MAAM,SAAS,MAAM,CAAC,EAAE,iBAAmC,uBAAqB,KAAK,CAAC,GACzF,MAAM,UAAU,MAAM,UAAU;CACpC;CAEA,MAAM,SAAS,OAAO,SAA2B;EAC/C,IAAI,CAAC,QAAQ,CAAC,MAAM,eAAe;EACnC,WAAW,KAAA,CAAS;EACpB,MAAM,UAAU,MAAM,QAAQ,UAAU,kBAA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A,gBAAAA,SAAAA;WAAS,IAAA,YAAA;YAAW,OAAA,QAAQ;WAAC;WAAEC,OAAM;WAAS,eAAY;UAAQ,CAAA;SAAC;SAF/EF,WAII,eAAQ;UAAmE,IAAA,SAAA,QAAA;UAA9Dc,aAAK,IAAI,IAAT,QAAA;WAAUC,aAAA,QAAA,OAAA,GAAA;;UAAf,OAAA;SAAmE,EAAA,CAAA;QACzE,CAAA;OACR;OATFhB,WAWI,gBAAkBI,KAAC,WAAa;MAC9B,CAAA,CACF;MAdN,OAAA;KAcM,EAAA,CAAA,GACNC,gBAAAA,aAAAA;MAAaC,OAAM;MAA+B,eAAY;KAAQ,CAAA,CAfvE;IAgBe;GAChBC,CAAAA,GAAAA,gBAAAA,gBAAAA;IAAgBC,OAAM;IAAtB,IAAA,WAAA;KACEC,OAAAA,gBAAAA,YAAAA,WACM,QADN,EAEEC,gBAAgB,QAAQ;MACtB,OAAO,cAAc,GAAG;MACxB,QAAQ,KAAK;KACf,EACD,CAAA,CAAA;IACa;GAlCjB,CAAA,CAAA;EAmCQ;;AAEb"}
|
|
1
|
+
{"version":3,"file":"icon-picker.js","names":["<Show\n when={props.image}\n fallback={<ImageUp class=\"size-5 text-muted-foreground\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full object-cover\" />}\n </Show>","<ImageUp class=\"size-5 text-muted-foreground\" aria-hidden=\"true\" />","class=\"size-5 text-muted-foreground\"","ref={setFileInput}","<Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => fileInput()?.click()}\n >\n <ImageUp aria-hidden=\"true\" />\n {props.image ? 'Replace image' : 'Upload image'}\n </Button>","type=\"button\"","variant=\"outline\"","size=\"sm\"","onClick={() => fileInput()?.click()}","<ImageUp aria-hidden=\"true\" />","props.image ? 'Replace image' : 'Upload image'","<div class=\"flex flex-wrap items-center gap-2\">\n <input\n ref={setFileInput}\n id={inputId}\n type=\"file\"\n class=\"sr-only\"\n tabindex={-1}\n // The visible button drives this input; hide the duplicate from assistive\n // technology but keep a name so the form-label rule is satisfied.\n aria-hidden=\"true\"\n aria-label={props.image ? 'Replace image' : 'Upload image'}\n accept=\"image/png,image/jpeg,image/webp,image/gif\"\n disabled={props.disabled}\n onChange={(event) => {\n const input = event.currentTarget\n void upload(input.files?.[0])\n // Clearing the value lets the same file be chosen again after Remove.\n input.value = ''\n }}\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => fileInput()?.click()}\n >\n <ImageUp aria-hidden=\"true\" />\n {props.image ? 'Replace image' : 'Upload image'}\n </Button>\n <Show when={props.image}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => {\n setProblem(undefined)\n props.onImageChange?.(undefined)\n }}\n >\n <Trash2 aria-hidden=\"true\" />\n Remove image\n </Button>\n </Show>\n </div>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => {\n setProblem(undefined)\n props.onImageChange?.(undefined)\n }}\n >\n <Trash2 aria-hidden=\"true\" />\n Remove image\n </Button>","variant=\"ghost\"","onClick={() => {\n setProblem(undefined)\n props.onImageChange?.(undefined)\n }}","<Trash2 aria-hidden=\"true\" />","disabled={props.disabled}","<Show when={problem()}>\n {(message) => (\n <p role=\"alert\" class=\"text-sm text-destructive\">\n {message()}\n </p>\n )}\n </Show>","<p class=\"text-xs text-muted-foreground\">\n PNG, JPEG, WebP or GIF up to {MARK_IMAGE_MAX_SOURCE_BYTES / 1024 / 1024} MB. It is cropped\n to a square.\n </p>","<div data-slot=\"icon-picker\" class={cn('flex flex-col gap-3', props.class)}>\n <Show when={props.onImageChange}>\n <div class=\"flex items-center gap-3\" data-slot=\"icon-picker-upload\">\n <span\n aria-hidden=\"true\"\n class=\"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-muted\"\n >\n <Show\n when={props.image}\n fallback={<ImageUp class=\"size-5 text-muted-foreground\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full object-cover\" />}\n </Show>\n </span>\n <div class=\"flex flex-wrap items-center gap-2\">\n <input\n ref={setFileInput}\n id={inputId}\n type=\"file\"\n class=\"sr-only\"\n tabindex={-1}\n // The visible button drives this input; hide the duplicate from assistive\n // technology but keep a name so the form-label rule is satisfied.\n aria-hidden=\"true\"\n aria-label={props.image ? 'Replace image' : 'Upload image'}\n accept=\"image/png,image/jpeg,image/webp,image/gif\"\n disabled={props.disabled}\n onChange={(event) => {\n const input = event.currentTarget\n void upload(input.files?.[0])\n // Clearing the value lets the same file be chosen again after Remove.\n input.value = ''\n }}\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => fileInput()?.click()}\n >\n <ImageUp aria-hidden=\"true\" />\n {props.image ? 'Replace image' : 'Upload image'}\n </Button>\n <Show when={props.image}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => {\n setProblem(undefined)\n props.onImageChange?.(undefined)\n }}\n >\n <Trash2 aria-hidden=\"true\" />\n Remove image\n </Button>\n </Show>\n </div>\n </div>\n <Show when={problem()}>\n {(message) => (\n <p role=\"alert\" class=\"text-sm text-destructive\">\n {message()}\n </p>\n )}\n </Show>\n <p class=\"text-xs text-muted-foreground\">\n PNG, JPEG, WebP or GIF up to {MARK_IMAGE_MAX_SOURCE_BYTES / 1024 / 1024} MB. It is cropped\n to a square.\n </p>\n </Show>\n <div\n ref={setGroup}\n role=\"radiogroup\"\n aria-label={props.label}\n aria-disabled={props.disabled ? 'true' : undefined}\n class=\"grid grid-cols-[repeat(auto-fill,minmax(2.5rem,1fr))] gap-1.5\"\n >\n <For each={shellIconEntries}>\n {(entry) => {\n const Icon = resolveShellIcon(entry.key)\n const isDefault = () => entry.key === props.defaultKey\n return (\n <label\n title={isDefault() ? `${entry.label} (default)` : entry.label}\n class={cn(\n 'flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground',\n 'transition-colors ease-out',\n 'hover:bg-surface-hover hover:text-foreground',\n 'has-focus-visible:border-ring has-focus-visible:focus-outline',\n 'has-checked:border-primary has-checked:bg-primary-subtle has-checked:text-primary',\n 'has-disabled:pointer-events-none has-disabled:opacity-50'\n )}\n >\n <input\n type=\"radio\"\n name={groupName}\n value={entry.key}\n class=\"sr-only\"\n checked={checkedKey() === entry.key}\n disabled={props.disabled}\n onChange={() => {\n props.onValueChange(entry.key)\n syncChecked()\n }}\n />\n <Icon class=\"size-5\" aria-hidden=\"true\" />\n <span class=\"sr-only\">\n {entry.label}\n {isDefault() ? ' (default)' : ''}\n </span>\n </label>\n )\n }}\n </For>\n </div>\n </div>","ref={setGroup}","<For each={shellIconEntries}>\n {(entry) => {\n const Icon = resolveShellIcon(entry.key)\n const isDefault = () => entry.key === props.defaultKey\n return (\n <label\n title={isDefault() ? `${entry.label} (default)` : entry.label}\n class={cn(\n 'flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground',\n 'transition-colors ease-out',\n 'hover:bg-surface-hover hover:text-foreground',\n 'has-focus-visible:border-ring has-focus-visible:focus-outline',\n 'has-checked:border-primary has-checked:bg-primary-subtle has-checked:text-primary',\n 'has-disabled:pointer-events-none has-disabled:opacity-50'\n )}\n >\n <input\n type=\"radio\"\n name={groupName}\n value={entry.key}\n class=\"sr-only\"\n checked={checkedKey() === entry.key}\n disabled={props.disabled}\n onChange={() => {\n props.onValueChange(entry.key)\n syncChecked()\n }}\n />\n <Icon class=\"size-5\" aria-hidden=\"true\" />\n <span class=\"sr-only\">\n {entry.label}\n {isDefault() ? ' (default)' : ''}\n </span>\n </label>\n )\n }}\n </For>","each={shellIconEntries}","<Icon class=\"size-5\" aria-hidden=\"true\" />","class=\"size-5\"","<label\n title={isDefault() ? `${entry.label} (default)` : entry.label}\n class={cn(\n 'flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground',\n 'transition-colors ease-out',\n 'hover:bg-surface-hover hover:text-foreground',\n 'has-focus-visible:border-ring has-focus-visible:focus-outline',\n 'has-checked:border-primary has-checked:bg-primary-subtle has-checked:text-primary',\n 'has-disabled:pointer-events-none has-disabled:opacity-50'\n )}\n >\n <input\n type=\"radio\"\n name={groupName}\n value={entry.key}\n class=\"sr-only\"\n checked={checkedKey() === entry.key}\n disabled={props.disabled}\n onChange={() => {\n props.onValueChange(entry.key)\n syncChecked()\n }}\n />\n <Icon class=\"size-5\" aria-hidden=\"true\" />\n <span class=\"sr-only\">\n {entry.label}\n {isDefault() ? ' (default)' : ''}\n </span>\n </label>","<span class=\"sr-only\">\n {entry.label}\n {isDefault() ? ' (default)' : ''}\n </span>","class={cn(\n 'flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground',\n 'transition-colors ease-out',\n 'hover:bg-surface-hover hover:text-foreground',\n 'has-focus-visible:border-ring has-focus-visible:focus-outline',\n 'has-checked:border-primary has-checked:bg-primary-subtle has-checked:text-primary',\n 'has-disabled:pointer-events-none has-disabled:opacity-50'\n )}","value={entry.key}","checked={checkedKey() === entry.key}","title={isDefault() ? `${entry.label} (default)` : entry.label}","aria-label={props.label}","aria-disabled={props.disabled ? 'true' : undefined}","<Popover open={open()} onOpenChange={setOpen} placement=\"bottom-start\">\n <PopoverTrigger\n as={IconPickerTriggerButton}\n type=\"button\"\n variant=\"outline\"\n data-slot=\"icon-picker-trigger\"\n aria-label={`${props.label}: ${props.image ? 'uploaded image' : shellIconLabel(props.value ?? props.defaultKey ?? '')}`}\n disabled={props.disabled}\n class={cn('gap-2', local.class)}\n >\n <span aria-hidden=\"true\" class=\"flex size-5 items-center justify-center overflow-hidden\">\n <Show\n when={local.trigger}\n fallback={\n <Show\n when={props.image}\n fallback={<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full rounded-sm object-cover\" />}\n </Show>\n }\n >\n {(triggerSlot) => <>{triggerSlot()}</>}\n </Show>\n </span>\n <ChevronDown class=\"size-4 text-muted-foreground\" aria-hidden=\"true\" />\n </PopoverTrigger>\n <PopoverContent class=\"w-88 max-w-(--available-width)\">\n <IconPicker\n {...picker}\n onValueChange={(key) => {\n picker.onValueChange(key)\n setOpen(false)\n }}\n />\n </PopoverContent>\n </Popover>","onOpenChange={setOpen}","placement=\"bottom-start\"","<PopoverTrigger\n as={IconPickerTriggerButton}\n type=\"button\"\n variant=\"outline\"\n data-slot=\"icon-picker-trigger\"\n aria-label={`${props.label}: ${props.image ? 'uploaded image' : shellIconLabel(props.value ?? props.defaultKey ?? '')}`}\n disabled={props.disabled}\n class={cn('gap-2', local.class)}\n >\n <span aria-hidden=\"true\" class=\"flex size-5 items-center justify-center overflow-hidden\">\n <Show\n when={local.trigger}\n fallback={\n <Show\n when={props.image}\n fallback={<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full rounded-sm object-cover\" />}\n </Show>\n }\n >\n {(triggerSlot) => <>{triggerSlot()}</>}\n </Show>\n </span>\n <ChevronDown class=\"size-4 text-muted-foreground\" aria-hidden=\"true\" />\n </PopoverTrigger>","as={IconPickerTriggerButton}","<Show\n when={local.trigger}\n fallback={\n <Show\n when={props.image}\n fallback={<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full rounded-sm object-cover\" />}\n </Show>\n }\n >\n {(triggerSlot) => <>{triggerSlot()}</>}\n </Show>","<Show\n when={props.image}\n fallback={<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full rounded-sm object-cover\" />}\n </Show>","<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />","class=\"size-4\"","{triggerSlot()}","<ChevronDown class=\"size-4 text-muted-foreground\" aria-hidden=\"true\" />","class=\"size-4 text-muted-foreground\"","<PopoverContent class=\"w-88 max-w-(--available-width)\">\n <IconPicker\n {...picker}\n onValueChange={(key) => {\n picker.onValueChange(key)\n setOpen(false)\n }}\n />\n </PopoverContent>","class=\"w-88 max-w-(--available-width)\"","<IconPicker\n {...picker}\n onValueChange={(key) => {\n picker.onValueChange(key)\n setOpen(false)\n }}\n />","onValueChange={(key) => {\n picker.onValueChange(key)\n setOpen(false)\n }}","LucideChevronDown","LucideImageUp","LucideTrash2","_$insert","_$effect","_$setAttribute","_$ref","_$readShallow","_$className","_$setProperty"],"sources":["../../../../src/components/composites/icon-picker/icon-picker.tsx"],"sourcesContent":["import {\n ChevronDown as LucideChevronDown,\n ImageUp as LucideImageUp,\n Trash2 as LucideTrash2,\n} from '@lucide/solid'\nimport type { JSX } from '@solidjs/web'\nimport { For, Show, createSignal, createUniqueId, omit } from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport { createLatestAction } from '#lib/async-action'\nimport { cn } from '#lib/utils'\nimport { slotted } from '#lib/slotted'\nimport { Button } from '../../ui/button'\nimport { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover'\nimport {\n MarkImageError,\n markImageFromFile,\n markImageProblemCopy,\n MARK_IMAGE_MAX_SOURCE_BYTES,\n} from './image-data-url'\nimport { resolveShellIcon, shellIconEntries, shellIconLabel } from './shell-icons'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst ImageUp = fastIcon(LucideImageUp)\nconst Trash2 = fastIcon(LucideTrash2)\n\n/**\n * IconPicker.\n *\n * The control behind \"choose an icon\" for a workspace or a project: a grid of\n * curated glyphs, and optionally an uploaded picture in their place.\n *\n * It is a single-choice group. The glyph grid is native radio inputs sharing a\n * name, so arrow keys move the choice and Tab enters and leaves the grid as one stop,\n * which is the contract a 56-cell grid needs to stay usable from a keyboard. An\n * uploaded image is a separate state, not a 57th cell: while `image` is set no\n * glyph is checked, and choosing a glyph asks the caller to drop the image, so\n * the stored mark is never both.\n *\n * The picker does not persist anything. The caller owns `value` and `image`\n * and saves them with the rest of its form; the image arrives already resized\n * to the stored square (see `markImageFromFile`).\n */\nexport type IconPickerProps = {\n /** The group's accessible name, e.g. \"Workspace icon\". */\n label: string\n /** The checked icon key; ignored while `image` is set. */\n value: string | undefined\n onValueChange(key: string): void\n /** The key the surface treats as unset, labelled \"default\" in the grid. */\n defaultKey?: string\n /** An uploaded mark (a data URL) currently chosen in place of a glyph. */\n image?: string\n /**\n * Called with the resized upload, or `undefined` for Remove. Omit it for a\n * surface that offers glyphs only; the upload row then does not render.\n */\n onImageChange?(image: string | undefined): void\n disabled?: boolean\n class?: string\n}\n\nexport function IconPicker(props: IconPickerProps) {\n const inputId = createUniqueId()\n const [problem, setProblem] = createSignal<string>()\n const uploads = createLatestAction()\n const [fileInput, setFileInput] = createSignal<HTMLInputElement>()\n const [group, setGroup] = createSignal<HTMLDivElement>()\n const groupName = createUniqueId()\n // Controlled: the checked glyph is the host's value, and none while an image is chosen.\n const checkedKey = () => (props.image ? '' : (props.value ?? ''))\n // A click checks its radio natively before the host answers. When the host keeps\n // its value (or answers later), put the DOM back on the controlled key.\n const syncChecked = () => {\n const key = checkedKey()\n for (const radio of group()?.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]') ?? [])\n radio.checked = radio.value === key\n }\n\n const upload = async (file: File | undefined) => {\n if (!file || !props.onImageChange) return\n setProblem(undefined)\n const outcome = await uploads.run(() => markImageFromFile(file))\n if (outcome.status === 'done') props.onImageChange?.(outcome.value)\n else if (outcome.status === 'failed')\n setProblem(\n markImageProblemCopy[\n outcome.error instanceof MarkImageError ? outcome.error.problem : 'unreadable'\n ]\n )\n }\n\n return (\n <div data-slot=\"icon-picker\" class={cn('flex flex-col gap-3', props.class)}>\n <Show when={props.onImageChange}>\n <div class=\"flex items-center gap-3\" data-slot=\"icon-picker-upload\">\n <span\n aria-hidden=\"true\"\n class=\"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-muted\"\n >\n <Show\n when={props.image}\n fallback={<ImageUp class=\"size-5 text-muted-foreground\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full object-cover\" />}\n </Show>\n </span>\n <div class=\"flex flex-wrap items-center gap-2\">\n <input\n ref={setFileInput}\n id={inputId}\n type=\"file\"\n class=\"sr-only\"\n tabindex={-1}\n // The visible button drives this input; hide the duplicate from assistive\n // technology but keep a name so the form-label rule is satisfied.\n aria-hidden=\"true\"\n aria-label={props.image ? 'Replace image' : 'Upload image'}\n accept=\"image/png,image/jpeg,image/webp,image/gif\"\n disabled={props.disabled}\n onChange={(event) => {\n const input = event.currentTarget\n void upload(input.files?.[0])\n // Clearing the value lets the same file be chosen again after Remove.\n input.value = ''\n }}\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => fileInput()?.click()}\n >\n <ImageUp aria-hidden=\"true\" />\n {props.image ? 'Replace image' : 'Upload image'}\n </Button>\n <Show when={props.image}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled || uploads.pending()}\n onClick={() => {\n setProblem(undefined)\n props.onImageChange?.(undefined)\n }}\n >\n <Trash2 aria-hidden=\"true\" />\n Remove image\n </Button>\n </Show>\n </div>\n </div>\n <Show when={problem()}>\n {(message) => (\n <p role=\"alert\" class=\"text-sm text-destructive\">\n {message()}\n </p>\n )}\n </Show>\n <p class=\"text-xs text-muted-foreground\">\n PNG, JPEG, WebP or GIF up to {MARK_IMAGE_MAX_SOURCE_BYTES / 1024 / 1024} MB. It is cropped\n to a square.\n </p>\n </Show>\n <div\n ref={setGroup}\n role=\"radiogroup\"\n aria-label={props.label}\n aria-disabled={props.disabled ? 'true' : undefined}\n class=\"grid grid-cols-[repeat(auto-fill,minmax(2.5rem,1fr))] gap-1.5\"\n >\n <For each={shellIconEntries}>\n {(entry) => {\n const Icon = resolveShellIcon(entry.key)\n const isDefault = () => entry.key === props.defaultKey\n return (\n <label\n title={isDefault() ? `${entry.label} (default)` : entry.label}\n class={cn(\n 'flex size-10 cursor-pointer items-center justify-center rounded-lg border border-border bg-card text-muted-foreground',\n 'transition-colors ease-out',\n 'hover:bg-surface-hover hover:text-foreground',\n 'has-focus-visible:border-ring has-focus-visible:focus-outline',\n 'has-checked:border-primary has-checked:bg-primary-subtle has-checked:text-primary',\n 'has-disabled:pointer-events-none has-disabled:opacity-50'\n )}\n >\n <input\n type=\"radio\"\n name={groupName}\n value={entry.key}\n class=\"sr-only\"\n checked={checkedKey() === entry.key}\n disabled={props.disabled}\n onChange={() => {\n props.onValueChange(entry.key)\n syncChecked()\n }}\n />\n <Icon class=\"size-5\" aria-hidden=\"true\" />\n <span class=\"sr-only\">\n {entry.label}\n {isDefault() ? ' (default)' : ''}\n </span>\n </label>\n )\n }}\n </For>\n </div>\n </div>\n )\n}\n\n/**\n * IconPickerDropdown.\n *\n * The compact form of the picker for a settings row: one button showing the\n * current mark, opening the full grid (and the upload row, when the host offers\n * it) in a popover. Choosing a glyph applies it and closes the popover; an\n * upload or Remove leaves it open so the result is visible. The host owns the\n * value exactly as it does for `IconPicker`.\n */\nexport type IconPickerDropdownProps = IconPickerProps & {\n /** The mark shown on the trigger; defaults to the checked glyph or the uploaded image. */\n trigger?: JSX.Element\n}\n\n// The popover part writes its own data-slot; the rendered button restores ours.\nconst IconPickerTriggerButton = slotted(Button, 'icon-picker-trigger')\n\nexport function IconPickerDropdown(props: IconPickerDropdownProps) {\n const [open, setOpen] = createSignal(false)\n const local = props\n const picker = omit(props, 'trigger', 'class')\n const Current = () => resolveShellIcon(props.value ?? props.defaultKey ?? '')\n return (\n <Popover open={open()} onOpenChange={setOpen} placement=\"bottom-start\">\n <PopoverTrigger\n as={IconPickerTriggerButton}\n type=\"button\"\n variant=\"outline\"\n data-slot=\"icon-picker-trigger\"\n aria-label={`${props.label}: ${props.image ? 'uploaded image' : shellIconLabel(props.value ?? props.defaultKey ?? '')}`}\n disabled={props.disabled}\n class={cn('gap-2', local.class)}\n >\n <span aria-hidden=\"true\" class=\"flex size-5 items-center justify-center overflow-hidden\">\n <Show\n when={local.trigger}\n fallback={\n <Show\n when={props.image}\n fallback={<Dynamic component={Current()} class=\"size-4\" aria-hidden=\"true\" />}\n >\n {(src) => <img src={src()} alt=\"\" class=\"size-full rounded-sm object-cover\" />}\n </Show>\n }\n >\n {(triggerSlot) => <>{triggerSlot()}</>}\n </Show>\n </span>\n <ChevronDown class=\"size-4 text-muted-foreground\" aria-hidden=\"true\" />\n </PopoverTrigger>\n <PopoverContent class=\"w-88 max-w-(--available-width)\">\n <IconPicker\n {...picker}\n onValueChange={(key) => {\n picker.onValueChange(key)\n setOpen(false)\n }}\n />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,IAAM,cAAc,SAASiD,aAAiB;AAC9C,IAAM,UAAU,SAASC,SAAa;AACtC,IAAM,SAAS,SAASC,QAAY;AAsCpC,SAAgB,WAAW,OAAwB;CACjD,MAAM,UAAU,eAAe;CAC/B,MAAM,CAAC,SAAS,cAAc,aAAqB;CACnD,MAAM,UAAU,mBAAmB;CACnC,MAAM,CAAC,WAAW,gBAAgB,aAA+B;CACjE,MAAM,CAAC,OAAO,YAAY,aAA6B;CACvD,MAAM,YAAY,eAAe;CAEjC,MAAM,mBAAoB,MAAM,QAAQ,KAAM,MAAM,SAAS;CAG7D,MAAM,oBAAoB;EACxB,MAAM,MAAM,WAAW;EACvB,KAAK,MAAM,SAAS,MAAM,CAAC,EAAE,iBAAmC,uBAAqB,KAAK,CAAC,GACzF,MAAM,UAAU,MAAM,UAAU;CACpC;CAEA,MAAM,SAAS,OAAO,SAA2B;EAC/C,IAAI,CAAC,QAAQ,CAAC,M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AAAA;SACE,IAAA,OAAA;UAAM,OAAA,MAAM;SAAK;SACjB,IAAA,WAAA;UAAUC,OAAAA,gBAAAA,SAAAA;WAAS,IAAA,YAAA;YAAW,OAAA,QAAQ;WAAC;WAAEC,OAAM;WAAS,eAAY;UAAQ,CAAA;SAAC;SAF/EF,WAII,eAAQ;UAAmE,IAAA,SAAA,QAAA;UAA9Dc,aAAK,IAAI,IAAT,QAAA;WAAUC,aAAA,QAAA,OAAA,GAAA;;UAAf,OAAA;SAAmE,EAAA,CAAA;QACzE,CAAA;OACR;OATFhB,WAWI,gBAAkBI,KAAC,WAAa;MAC9B,CAAA,CACF;MAdN,OAAA;KAcM,EAAA,CAAA,GACNC,gBAAAA,aAAAA;MAAaC,OAAM;MAA+B,eAAY;KAAQ,CAAA,CAfvE;IAgBe;GAChBC,CAAAA,GAAAA,gBAAAA,gBAAAA;IAAgBC,OAAM;IAAtB,IAAA,WAAA;KACEC,OAAAA,gBAAAA,YAAAA,WACM,QADN,EAEEC,gBAAgB,QAAQ;MACtB,OAAO,cAAc,GAAG;MACxB,QAAQ,KAAK;KACf,EACD,CAAA,CAAA;IACa;GAlCjB,CAAA,CAAA;EAmCQ;;AAEb"}
|
|
@@ -38,7 +38,7 @@ function ListRowControl(props) {
|
|
|
38
38
|
return local.stackTrailing === false ? "never" : void 0;
|
|
39
39
|
},
|
|
40
40
|
get "class"() {
|
|
41
|
-
return cn("group/row list-row-description flex min-w-0 items-center gap-2.5 rounded-md px-2 text-sm", "transition-colors ease-out outline-none", "focus-visible:border-ring focus-visible:
|
|
41
|
+
return cn("group/row list-row-description flex min-w-0 items-center gap-2.5 rounded-md px-2 text-sm", "transition-colors ease-out outline-none", "focus-visible:border-ring focus-visible:focus-outline-inset", {
|
|
42
42
|
"h-row-sm": local.dense && !local.description,
|
|
43
43
|
"h-row-md": !local.dense && !local.description
|
|
44
44
|
}, {
|