@adea-ai/ui 0.82.1 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +3 -3
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +13 -2
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/layout/orbit-layout/index.d.ts +3 -0
- package/dist/components/layout/orbit-layout/index.d.ts.map +1 -0
- package/dist/components/layout/orbit-layout/index.js +2 -0
- package/dist/components/layout/orbit-layout/orbit-layout.d.ts +38 -0
- package/dist/components/layout/orbit-layout/orbit-layout.d.ts.map +1 -0
- package/dist/components/layout/orbit-layout/orbit-layout.js +83 -0
- package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -0
- package/dist/components/layout/side-rail/side-rail.d.ts +1 -0
- package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +6 -2
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/virtual-window/index.d.ts +3 -0
- package/dist/components/layout/virtual-window/index.d.ts.map +1 -0
- package/dist/components/layout/virtual-window/index.js +2 -0
- package/dist/components/layout/virtual-window/virtual-window.d.ts +22 -0
- package/dist/components/layout/virtual-window/virtual-window.d.ts.map +1 -0
- package/dist/components/layout/virtual-window/virtual-window.js +45 -0
- package/dist/components/layout/virtual-window/virtual-window.js.map +1 -0
- package/dist/components/ui/command/command.d.ts +5 -6
- package/dist/components/ui/command/command.d.ts.map +1 -1
- package/dist/components/ui/command/command.js +73 -15
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +3 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +7 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.d.ts +2 -0
- package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +26 -17
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/lib/overlay.js +1 -1
- package/dist/lib/overlay.js.map +1 -1
- package/dist/r/command.json +2 -0
- package/dist/r/orbit-layout.json +22 -0
- package/dist/r/registry.json +46 -0
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +3 -5
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +9 -3
- package/dist/r/src/components/layout/orbit-layout/index.ts +8 -0
- package/dist/r/src/components/layout/orbit-layout/orbit-layout.tsx +112 -0
- package/dist/r/src/components/layout/side-rail/side-rail.tsx +8 -3
- package/dist/r/src/components/layout/virtual-window/index.ts +2 -0
- package/dist/r/src/components/layout/virtual-window/virtual-window.tsx +55 -0
- package/dist/r/src/components/ui/command/command.tsx +81 -29
- package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +5 -1
- package/dist/r/src/components/ui/status-chip/status-chip.tsx +11 -2
- package/dist/r/src/lib/overlay.ts +1 -1
- package/dist/r/virtual-window.json +22 -0
- package/package.json +1 -1
- package/registry.json +46 -0
- package/src/components/composites/appearance-editor/appearance-choices.tsx +3 -5
- package/src/components/composites/appearance-editor/appearance-rows.tsx +9 -3
- package/src/components/layout/orbit-layout/index.ts +8 -0
- package/src/components/layout/orbit-layout/orbit-layout.tsx +112 -0
- package/src/components/layout/side-rail/side-rail.tsx +8 -3
- package/src/components/layout/virtual-window/index.ts +2 -0
- package/src/components/layout/virtual-window/virtual-window.tsx +55 -0
- package/src/components/ui/command/command.tsx +81 -29
- package/src/components/ui/dropdown-menu/dropdown-menu.tsx +5 -1
- package/src/components/ui/status-chip/status-chip.tsx +11 -2
- package/src/index.ts +2 -0
- package/src/lib/overlay.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance-choices.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/appearance-choices.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAc/D,wBAAgB,WAAW,CAAC,KAAK,EAAE,qBAAqB,kCAyCvD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"appearance-choices.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/appearance-choices.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAc/D,wBAAgB,WAAW,CAAC,KAAK,EAAE,qBAAqB,kCAyCvD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,qBAAqB,kCA2DzD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,qBAAqB,kCA6BxD"}
|
|
@@ -5,7 +5,7 @@ import { RadioGroup } from "@kobalte/core/radio-group";
|
|
|
5
5
|
//#region src/components/composites/appearance-editor/appearance-choices.tsx
|
|
6
6
|
var _tmpl$ = /*#__PURE__*/ template(`<span class="block h-20 w-full">`);
|
|
7
7
|
var _tmpl$2 = /*#__PURE__*/ template(`<span>`);
|
|
8
|
-
var _tmpl$3 = /*#__PURE__*/ template(`<div class="
|
|
8
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<div class="flex max-w-full flex-wrap gap-2">`);
|
|
9
9
|
var _tmpl$4 = /*#__PURE__*/ template(`<span class="block size-full rounded-full"aria-hidden=true>`);
|
|
10
10
|
var _tmpl$5 = /*#__PURE__*/ template(`<span class=sr-only>`);
|
|
11
11
|
var MODES = [
|
|
@@ -114,7 +114,7 @@ function AccentChoices(props) {
|
|
|
114
114
|
},
|
|
115
115
|
orientation: "horizontal",
|
|
116
116
|
"aria-label": "Accent",
|
|
117
|
-
"class": "
|
|
117
|
+
"class": "flex flex-wrap items-center gap-2",
|
|
118
118
|
onChange: (accent) => props.onChange({ accent: accent === "custom" ? props.customAccentValue ?? "" : accent }),
|
|
119
119
|
get children() {
|
|
120
120
|
return [
|
|
@@ -122,7 +122,7 @@ function AccentChoices(props) {
|
|
|
122
122
|
value: "theme",
|
|
123
123
|
get children() {
|
|
124
124
|
return [createComponent(RadioGroup.ItemInput, {}), createComponent(RadioGroup.ItemLabel, {
|
|
125
|
-
"class": "flex h-7 cursor-pointer items-center rounded-md border px-2 text-xs data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary",
|
|
125
|
+
"class": "flex h-7 cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary",
|
|
126
126
|
children: "Theme default"
|
|
127
127
|
})];
|
|
128
128
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance-choices.js","names":["RadioGroup","Radio","For","Show","AppearanceEditorProps","ThemeMiniature","ThemeMiniatureSplit","MODES","value","label","const","SURFACES","ModeChoices","props","_$createComponent","draft","mode","disabled","saving","orientation","onChange","option","find","candidate","children","each","Item","data-mode","ItemInput","ItemLabel","_el$","_tmpl$","_$insert","when","fallback","theme","_$memo","lightTheme","darkTheme","light","dark","_el$2","_tmpl$2","AccentChoices","custom","accent","accentOptions","some","id","accentSelection","customAccentValue","_el$3","_tmpl$3","_el$4","_tmpl$4","_$effect","_$p","_$setStyleProperty","resolvedAppearance","_el$5","_tmpl$5","GlassChoices","surface","surfaceCapability","frosted","_$createComponent","Radio","_$memo","_$setStyleProperty"],"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. Kobalte replaces\n// the app port's manual roving focus; it does not replace the donor hierarchy.\nimport { RadioGroup as Radio } from '@kobalte/core/radio-group'\nimport { For, Show } from 'solid-js'\nimport type { AppearanceEditorProps } from './appearance-types'\nimport { ThemeMiniature, ThemeMiniatureSplit } from './theme-preview'\n\nconst MODES = [\n { value: 'system', label: 'System' },\n { value: 'light', label: 'Light' },\n { value: 'dark', label: 'Dark' },\n] as const\nconst SURFACES = [\n { value: 'theme', label: 'Theme default' },\n { value: 'frosted', label: 'Frosted' },\n { value: 'opaque', label: 'Opaque' },\n] as const\n\nexport function ModeChoices(props: AppearanceEditorProps) {\n return (\n <Radio\n value={props.draft.mode}\n disabled={props.saving}\n orientation=\"horizontal\"\n aria-label=\"Appearance mode\"\n onChange={(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 <Radio.Item\n value={option.value}\n data-mode={option.value}\n class=\"min-w-0 rounded-lg focus-within:ring-3 focus-within:ring-ring/50\"\n >\n <Radio.ItemInput />\n <Radio.ItemLabel class=\"flex cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\">\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 <span>{option.label}</span>\n </Radio.ItemLabel>\n </Radio.Item>\n )}\n </For>\n </Radio>\n )\n}\n\nexport function AccentChoices(props: AppearanceEditorProps) {\n const custom = () =>\n props.draft.accent !== 'theme' &&\n !props.accentOptions.some((option) => option.id === props.draft.accent)\n const accentSelection = () => (custom() ? 'custom' : props.draft.accent)\n return (\n <Radio\n value={accentSelection()}\n disabled={props.saving}\n orientation=\"horizontal\"\n aria-label=\"Accent\"\n /* Narrow hosts wrap the swatches into a three-column grid so the row\n control stays beside its label; wide hosts keep one inline row. */\n class=\"grid grid-cols-3 items-center gap-2 sm:flex sm:flex-wrap sm:justify-end\"\n onChange={(accent) =>\n props.onChange({\n accent: accent === 'custom' ? (props.customAccentValue ?? '') : accent,\n })\n }\n >\n <Radio.Item value=\"theme\">\n <Radio.ItemInput />\n <Radio.ItemLabel class=\"flex h-7 cursor-pointer items-center rounded-md border px-2 text-xs data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\">\n Theme default\n </Radio.ItemLabel>\n </Radio.Item>\n <div class=\"col-span-3 grid grid-cols-3 gap-2 sm:col-span-1 sm:flex sm:gap-2\">\n <For each={props.accentOptions}>\n {(option) => (\n <Radio.Item\n value={option.id}\n class=\"rounded-full focus-within:ring-3 focus-within:ring-ring/50\"\n >\n <Radio.ItemInput />\n <Radio.ItemLabel class=\"block size-7 cursor-pointer rounded-full border p-0.5 data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\">\n <span\n class=\"block size-full rounded-full\"\n aria-hidden=\"true\"\n style={{\n 'background-color':\n (props.draft.mode === 'system'\n ? props.resolvedAppearance\n : props.draft.mode) === 'light'\n ? option.light\n : option.dark,\n }}\n />\n <span class=\"sr-only\">{option.label}</span>\n </Radio.ItemLabel>\n </Radio.Item>\n )}\n </For>\n </div>\n <Radio.Item value=\"custom\">\n <Radio.ItemInput />\n <Radio.ItemLabel class=\"flex h-7 cursor-pointer items-center rounded-md border px-2 text-xs data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\">\n Custom\n </Radio.ItemLabel>\n </Radio.Item>\n </Radio>\n )\n}\n\nexport function GlassChoices(props: AppearanceEditorProps) {\n return (\n <Radio\n value={props.draft.surface}\n disabled={props.saving}\n orientation=\"horizontal\"\n aria-label=\"Glass\"\n class=\"flex flex-wrap gap-1\"\n onChange={(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 <Radio.Item\n value={option.value}\n disabled={option.value === 'frosted' && !props.surfaceCapability.frosted}\n class=\"rounded-md focus-within:ring-3 focus-within:ring-ring/50\"\n >\n <Radio.ItemInput />\n <Radio.ItemLabel class=\"flex h-7 cursor-pointer items-center rounded-md border px-2 text-xs data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\">\n {option.label}\n </Radio.ItemLabel>\n </Radio.Item>\n )}\n </For>\n </Radio>\n )\n}\n"],"mappings":";;;;;;;;;;AA8BA,IAAMO,QAAQ;CACZ;EAAEC,OAAO;EAAUC,OAAO;CAAS;CACnC;EAAED,OAAO;EAASC,OAAO;CAAQ;CACjC;EAAED,OAAO;EAAQC,OAAO;CAAO;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,KAAG;IAACuB,MAAMd;IAAQa,WACfH,WAAMP,gBACLb,WAAMyB,MAAI;KAAA,IACTlB,QAAK;MAAA,OAAEa,OAAOb;KAAK;KAAA,IACnBS,WAAQ;MAAA,OAAEmB,WAAAf,OAAOb,UAAU,SAAS,CAAA,CAAA,KAAI,CAACK,MAAMkD,kBAAkBC;KAAO;KAAA,SAAA;KAAA,IAAAxC,WAAA;MAAA,OAAA,CAAAV,gBAGvEb,WAAM2B,WAAS,CAAA,CAAA,GAAAd,gBACfb,WAAM4B,WAAS;OAAA,SAAA;OAAA,IAAAL,WAAA;QAAA,OACbH,OAAOZ;OAAK;MAAA,CAAA,CAAA;KAAA;IAAA,CAAA;GAGlB,CAAA;EAAA;CAAA,CAAA;AAIT"}
|
|
1
|
+
{"version":3,"file":"appearance-choices.js","names":["RadioGroup","Radio","For","Show","AppearanceEditorProps","ThemeMiniature","ThemeMiniatureSplit","MODES","value","label","const","SURFACES","ModeChoices","props","_$createComponent","draft","mode","disabled","saving","orientation","onChange","option","find","candidate","children","each","Item","data-mode","ItemInput","ItemLabel","_el$","_tmpl$","_$insert","when","fallback","theme","_$memo","lightTheme","darkTheme","light","dark","_el$2","_tmpl$2","AccentChoices","custom","accent","accentOptions","some","id","accentSelection","customAccentValue","_el$3","_tmpl$3","_el$4","_tmpl$4","_$effect","_$p","_$setStyleProperty","resolvedAppearance","_el$5","_tmpl$5","GlassChoices","surface","surfaceCapability","frosted","_$createComponent","Radio","_$memo","_$setStyleProperty"],"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. Kobalte replaces\n// the app port's manual roving focus; it does not replace the donor hierarchy.\nimport { RadioGroup as Radio } from '@kobalte/core/radio-group'\nimport { For, Show } from 'solid-js'\nimport type { AppearanceEditorProps } from './appearance-types'\nimport { ThemeMiniature, ThemeMiniatureSplit } from './theme-preview'\n\nconst MODES = [\n { value: 'system', label: 'System' },\n { value: 'light', label: 'Light' },\n { value: 'dark', label: 'Dark' },\n] as const\nconst SURFACES = [\n { value: 'theme', label: 'Theme default' },\n { value: 'frosted', label: 'Frosted' },\n { value: 'opaque', label: 'Opaque' },\n] as const\n\nexport function ModeChoices(props: AppearanceEditorProps) {\n return (\n <Radio\n value={props.draft.mode}\n disabled={props.saving}\n orientation=\"horizontal\"\n aria-label=\"Appearance mode\"\n onChange={(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 <Radio.Item\n value={option.value}\n data-mode={option.value}\n class=\"min-w-0 rounded-lg focus-within:ring-3 focus-within:ring-ring/50\"\n >\n <Radio.ItemInput />\n <Radio.ItemLabel class=\"flex cursor-pointer flex-col gap-2 rounded-lg border p-2 text-center text-xs data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\">\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 <span>{option.label}</span>\n </Radio.ItemLabel>\n </Radio.Item>\n )}\n </For>\n </Radio>\n )\n}\n\nexport function AccentChoices(props: AppearanceEditorProps) {\n const custom = () =>\n props.draft.accent !== 'theme' &&\n !props.accentOptions.some((option) => option.id === props.draft.accent)\n const accentSelection = () => (custom() ? 'custom' : props.draft.accent)\n return (\n <Radio\n value={accentSelection()}\n disabled={props.saving}\n orientation=\"horizontal\"\n aria-label=\"Accent\"\n class=\"flex flex-wrap items-center gap-2\"\n onChange={(accent) =>\n props.onChange({\n accent: accent === 'custom' ? (props.customAccentValue ?? '') : accent,\n })\n }\n >\n <Radio.Item value=\"theme\">\n <Radio.ItemInput />\n <Radio.ItemLabel class=\"flex h-7 cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\">\n Theme default\n </Radio.ItemLabel>\n </Radio.Item>\n <div class=\"flex max-w-full flex-wrap gap-2\">\n <For each={props.accentOptions}>\n {(option) => (\n <Radio.Item\n value={option.id}\n class=\"rounded-full focus-within:ring-3 focus-within:ring-ring/50\"\n >\n <Radio.ItemInput />\n <Radio.ItemLabel class=\"block size-7 cursor-pointer rounded-full border p-0.5 data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\">\n <span\n class=\"block size-full rounded-full\"\n aria-hidden=\"true\"\n style={{\n 'background-color':\n (props.draft.mode === 'system'\n ? props.resolvedAppearance\n : props.draft.mode) === 'light'\n ? option.light\n : option.dark,\n }}\n />\n <span class=\"sr-only\">{option.label}</span>\n </Radio.ItemLabel>\n </Radio.Item>\n )}\n </For>\n </div>\n <Radio.Item value=\"custom\">\n <Radio.ItemInput />\n <Radio.ItemLabel class=\"flex h-7 cursor-pointer items-center rounded-md border px-2 text-xs data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary\">\n Custom\n </Radio.ItemLabel>\n </Radio.Item>\n </Radio>\n )\n}\n\nexport function GlassChoices(props: AppearanceEditorProps) {\n return (\n <Radio\n value={props.draft.surface}\n disabled={props.saving}\n orientation=\"horizontal\"\n aria-label=\"Glass\"\n class=\"flex flex-wrap gap-1\"\n onChange={(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 <Radio.Item\n value={option.value}\n disabled={option.value === 'frosted' && !props.surfaceCapability.frosted}\n class=\"rounded-md focus-within:ring-3 focus-within:ring-ring/50\"\n >\n <Radio.ItemInput />\n <Radio.ItemLabel class=\"flex h-7 cursor-pointer items-center rounded-md border px-2 text-xs data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\">\n {option.label}\n </Radio.ItemLabel>\n </Radio.Item>\n )}\n </For>\n </Radio>\n )\n}\n"],"mappings":";;;;;;;;;;AA8BA,IAAMO,QAAQ;CACZ;EAAEC,OAAO;EAAUC,OAAO;CAAS;CACnC;EAAED,OAAO;EAASC,OAAO;CAAQ;CACjC;EAAED,OAAO;EAAQC,OAAO;CAAO;AAAC;AAElC,IAAME,WAAW;CACf;EAAEH,OAAO;EAASC,OAAO;CAAgB;CACzC;EAAED,OAAO;EAAWC,OAAO;CAAU;CACrC;EAAED,OAAO;EAAUC,OAAO;CAAS;AAAC;AAGtC,SAAgBG,YAAYC,OAA8B;CACxD,OAAAC,gBACGb,YAAK;EAAA,IACJO,QAAK;GAAA,OAAEK,MAAME,MAAMC;EAAI;EAAA,IACvBC,WAAQ;GAAA,OAAEJ,MAAMK;EAAM;EACt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CAAA,GAAAd,gBACfb,WAAM4B,WAAS;OAAA,SAAA;OAAA,IAAAL,WAAA;QAAA,OACbH,OAAOZ;OAAK;MAAA,CAAA,CAAA;KAAA;IAAA,CAAA;GAGlB,CAAA;EAAA;CAAA,CAAA;AAIT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance-rows.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/appearance-rows.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAkD,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AA2BnF,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,GAAG,CAAC,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAA;CACtB,
|
|
1
|
+
{"version":3,"file":"appearance-rows.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/appearance-editor/appearance-rows.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAkD,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AA2BnF,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,GAAG,CAAC,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAA;CACtB,eA4BA;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,UAAU,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,SAAS,CAAA;IAClB,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B,eA6NA"}
|
|
@@ -7,7 +7,7 @@ import { ChevronDown, Palette } from "lucide-solid";
|
|
|
7
7
|
import { For, Show, createMemo, createSignal, onCleanup } from "solid-js";
|
|
8
8
|
//#region src/components/composites/appearance-editor/appearance-rows.tsx
|
|
9
9
|
var _tmpl$ = /*#__PURE__*/ template(`<div class="mt-0.5 text-xs text-muted-foreground">`);
|
|
10
|
-
var _tmpl$2 = /*#__PURE__*/ template(`<section><div
|
|
10
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<section><div><span class="flex size-9 shrink-0 items-center justify-center rounded-lg border bg-foreground/5 text-muted-foreground [&_svg]:size-4"aria-hidden=true></span><div class=min-w-0><h3 class="text-sm font-medium"></h3></div></div><div class="min-w-0 max-w-full shrink-0">`);
|
|
11
11
|
var _tmpl$3 = /*#__PURE__*/ template(`<span class="flex min-w-0 flex-1 items-center gap-2"><span class="min-w-0 flex-1 truncate">`);
|
|
12
12
|
var _tmpl$4 = /*#__PURE__*/ template(`<div>`);
|
|
13
13
|
var _tmpl$5 = /*#__PURE__*/ template(`<span class="min-w-0 flex-1 truncate">`);
|
|
@@ -31,7 +31,18 @@ function SettingsRow(props) {
|
|
|
31
31
|
}
|
|
32
32
|
}), null);
|
|
33
33
|
insert(_el$7, () => props.children);
|
|
34
|
-
effect(() =>
|
|
34
|
+
effect((_p$) => {
|
|
35
|
+
var _v$ = cn("flex gap-3 px-4 py-4", {
|
|
36
|
+
"flex-col": props.stacked,
|
|
37
|
+
"flex-wrap items-center": !props.stacked
|
|
38
|
+
}), _v$2 = cn("flex min-w-0 flex-1 items-center gap-3", { "basis-48": !props.stacked });
|
|
39
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
40
|
+
_v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
|
|
41
|
+
return _p$;
|
|
42
|
+
}, {
|
|
43
|
+
e: void 0,
|
|
44
|
+
t: void 0
|
|
45
|
+
});
|
|
35
46
|
return _el$;
|
|
36
47
|
})();
|
|
37
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance-rows.js","names":["AdeaTheme","AdeaThemeRecord","For","Show","createMemo","createSignal","onCleanup","JSX","ChevronDown","Palette","cn","Button","DropdownMenu","DropdownMenuContent","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuTrigger","PalettePreview","POINTER_FOCUS_TARGET_SELECTOR","isTabStop","element","HTMLElement","tabIndex","matches","hasAttribute","getAttribute","closest","getClientRects","length","SettingsRow","props","title","icon","Element","description","stacked","children","_el$","_tmpl$2","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$7","_$insert","_$createComponent","when","_el$6","_tmpl$","_$effect","_$className","ThemeRow","appearance","selectedId","preview","themes","disabled","onSelect","id","portalMount","setPortalMount","HTMLDivElement","triggerElement","setTriggerElement","HTMLButtonElement","menuOpen","setMenuOpen","focusOutsideTarget","setFocusOutsideTarget","restoreTriggerFocus","setRestoreTriggerFocus","focusTargetAfterTab","focusLifecycleVersion","options","filter","theme","selected","find","label","closeMenu","moveFocusOnTab","event","KeyboardEvent","key","isComposing","trigger","parentDialog","focusScope","ownerDocument","body","focusStops","Array","from","querySelectorAll","orderedFocusStops","toSorted","a","b","triggerIndex","indexOf","direction","shiftKey","adjacent","at","undefined","stopPropagation","preventDefault","focus","preventScroll","_el$8","_tmpl$4","_$use","modal","open","onOpenChange","ref","as","variant","size","aria-label","_el$9","_tmpl$3","_el$0","name","onInteractOutside","detail","originalEvent","type","target","contains","focusTarget","onFocusOutside","onEscapeKeyDown","onCloseAutoFocus","lifecycleVersion","shouldRestore","isConnected","queueMicrotask","activeElement","document","isMenuFocus","isTriggerFocus","value","onChange","each","textValue","closeOnSelect","_el$1","_tmpl$5","_$createComponent","_$className"],"sources":["../../../../src/components/composites/appearance-editor/appearance-rows.tsx"],"sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2026 Wing\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n// Retains the compact divided row and palette-preview selector from the pinned\n// Zeron/Adea composition; Kobalte owns option navigation and nested dismissal.\nimport type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'\nimport { For, Show, createMemo, createSignal, onCleanup, type JSX } from 'solid-js'\nimport { ChevronDown, Palette } from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu/dropdown-menu'\nimport { PalettePreview } from './theme-preview'\n\nconst POINTER_FOCUS_TARGET_SELECTOR =\n 'a[href], area[href], button, input, select, textarea, iframe, [tabindex], [contenteditable], details > summary:first-of-type'\n\nfunction isTabStop(element: HTMLElement) {\n return (\n (element.tabIndex >= 0 ||\n (element.matches('details > summary:first-of-type') && !element.hasAttribute('tabindex'))) &&\n !element.matches(':disabled') &&\n element.getAttribute('aria-disabled') !== 'true' &&\n element.closest('[hidden], [inert], [aria-hidden=\"true\"]') === null &&\n element.getClientRects().length > 0\n )\n}\n\nexport function SettingsRow(props: {\n title: string\n icon: JSX.Element\n description?: JSX.Element\n stacked?: boolean\n children: JSX.Element\n}) {\n return (\n <section\n class={cn('flex flex-col gap-3 px-4 py-4', { 'sm:flex-row sm:items-center': !props.stacked })}\n >\n <div class=\"flex min-w-0 flex-1 items-center gap-3\">\n <span\n class=\"flex size-9 shrink-0 items-center justify-center rounded-lg border bg-foreground/5 text-muted-foreground [&_svg]:size-4\"\n aria-hidden=\"true\"\n >\n {props.icon}\n </span>\n <div class=\"min-w-0\">\n <h3 class=\"text-sm font-medium\">{props.title}</h3>\n <Show when={props.description}>\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{props.description}</div>\n </Show>\n </div>\n </div>\n <div class=\"min-w-0 shrink-0\">{props.children}</div>\n </section>\n )\n}\n\n/**\n * A compact persistent theme choice. Kobalte handles menu navigation and\n * dismissal; this row moves Tab to the adjacent browser-reported stop because\n * menus consume Tab by default. Enumerating elements and checking their native\n * tabIndex keeps details summaries in the order while preserving explicit\n * tabindex overrides.\n */\nexport function ThemeRow(props: {\n appearance: 'light' | 'dark'\n selectedId: string\n preview: AdeaTheme\n themes: readonly AdeaThemeRecord[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const [portalMount, setPortalMount] = createSignal<HTMLDivElement>()\n const [triggerElement, setTriggerElement] = createSignal<HTMLButtonElement>()\n const [menuOpen, setMenuOpen] = createSignal(false)\n const [focusOutsideTarget, setFocusOutsideTarget] = createSignal<HTMLElement>()\n const [restoreTriggerFocus, setRestoreTriggerFocus] = createSignal(false)\n let focusTargetAfterTab: HTMLElement | undefined\n let focusLifecycleVersion = 0\n onCleanup(() => {\n focusLifecycleVersion += 1\n })\n const options = createMemo(() =>\n props.themes.filter((theme) => theme.appearance === props.appearance)\n )\n const selected = createMemo(\n () =>\n options().find((theme) => theme.id === props.selectedId) ??\n options().find((theme) => theme.id === props.preview.id)\n )\n const label = () => (props.appearance === 'light' ? 'Light theme' : 'Dark theme')\n const closeMenu = () => {\n if (menuOpen()) focusLifecycleVersion += 1\n setMenuOpen(false)\n }\n const moveFocusOnTab = (event: KeyboardEvent) => {\n if (event.key !== 'Tab' || event.isComposing) return\n\n const trigger = triggerElement()\n if (!trigger) return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (!focusScope) return\n\n const focusStops = Array.from(focusScope.querySelectorAll<HTMLElement>('*')).filter(\n (element) =>\n isTabStop(element) &&\n element.closest('[role=\"menu\"], [hidden], [inert], [aria-hidden=\"true\"]') === null\n )\n const orderedFocusStops = [\n ...focusStops\n .filter((element) => element.tabIndex > 0)\n .toSorted((a, b) => a.tabIndex - b.tabIndex),\n ...focusStops.filter((element) => element.tabIndex <= 0),\n ]\n const triggerIndex = orderedFocusStops.indexOf(trigger)\n const direction = event.shiftKey ? -1 : 1\n const adjacent =\n orderedFocusStops[triggerIndex + direction] ??\n (parentDialog ? (direction > 0 ? orderedFocusStops[0] : orderedFocusStops.at(-1)) : undefined)\n\n event.stopPropagation()\n setRestoreTriggerFocus(false)\n if (adjacent) {\n event.preventDefault()\n focusTargetAfterTab = adjacent\n setFocusOutsideTarget(adjacent)\n closeMenu()\n adjacent.focus({ preventScroll: true })\n } else {\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n closeMenu()\n }\n }\n return (\n <SettingsRow title={label()} icon={<Palette />}>\n <div ref={setPortalMount}>\n <DropdownMenu\n modal={false}\n open={menuOpen()}\n onOpenChange={(open) => {\n if (open !== menuOpen()) focusLifecycleVersion += 1\n setMenuOpen(open)\n if (open) {\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n setRestoreTriggerFocus(false)\n }\n }}\n >\n <DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={label()}\n disabled={props.disabled || options().length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.preview} />\n <span class=\"min-w-0 flex-1 truncate\">{selected()?.name ?? props.preview.name}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n portalMount={portalMount()}\n class=\"max-h-(--kb-popper-content-available-height) w-(--kb-popper-anchor-width) min-w-32 overflow-x-hidden overflow-y-auto\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = target.closest<HTMLElement>(POINTER_FOCUS_TARGET_SELECTOR)\n if (focusTarget && isTabStop(focusTarget)) {\n setRestoreTriggerFocus(false)\n setFocusOutsideTarget(focusTarget)\n } else {\n setRestoreTriggerFocus(true)\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n setRestoreTriggerFocus(false)\n setFocusOutsideTarget(target)\n }\n }}\n onEscapeKeyDown={() => setRestoreTriggerFocus(true)}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (menuOpen()) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus()\n const focusTarget = focusTargetAfterTab ?? focusOutsideTarget()\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n setRestoreTriggerFocus(false)\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // Kobalte's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || menuOpen()) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so Kobalte must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${label()} options`}\n on:keydown={moveFocusOnTab}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={options()}>\n {(theme) => (\n <DropdownMenuRadioItem\n value={theme.id}\n textValue={theme.name}\n closeOnSelect={true}\n disabled={props.disabled}\n onSelect={() => setRestoreTriggerFocus(true)}\n >\n <PalettePreview theme={theme} />\n <span class=\"min-w-0 flex-1 truncate\">{theme.name}</span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n </SettingsRow>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAuCA,IAAMkB,gCACJ;AAEF,SAASC,UAAUC,SAAsB;CACvC,QACGA,QAAQE,YAAY,KAClBF,QAAQG,QAAQ,iCAAiC,KAAK,CAACH,QAAQI,aAAa,UAAU,MACzF,CAACJ,QAAQG,QAAQ,WAAW,KAC5BH,QAAQK,aAAa,eAAe,MAAM,UAC1CL,QAAQM,QAAQ,2CAAyC,MAAM,QAC/DN,QAAQO,eAAe,CAAC,CAACC,SAAS;AAEtC;AAEA,SAAgBC,YAAYC,OAMzB;CACD,cAAA;EAAA,IAAAO,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAC,YAAAE,QAAAD,MAAAE,aAAAC,QAAAF,MAAAF,YAAAK,QAAAN,MAAAI;EAAAG,OAAAL,aASSX,MAAME,IAAI;EAAAc,OAAAF,aAGsBd,MAAMC,KAAK;EAAAe,OAAAJ,OAAAK,gBAC3C5C,MAAI;GAAA,IAAC6C,OAAI;IAAA,OAAElB,MAAMI;GAAW;GAAA,IAAAE,WAAA;IAAA,IAAAa,QAAAC,OAAA;IAAAJ,OAAAG,aACwBnB,MAAMI,WAAW;IAAA,OAAAe;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAH,OAAAD,aAI3Cf,MAAMM,QAAQ;EAAAe,aAAAC,UAAAf,MAhBtC3B,GAAG,iCAAiC,EAAE,+BAA+B,CAACoB,MAAMK,QAAQ,CAAC,CAAC,CAAA;EAAA,OAAAE;CAAA,EAAA,CAAA;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AgBC,SAASD;OAC/B,IACEnD,cACAmD,yBAAyBvH,eACzBuH,kBAAkBnD,cAClBA,WAAW0C,SAASS,aAAa,KACjCA,cAAclH,QAAQ,iBAAe,MAAM,MAM3CyD,MAAMyB,eAAe;MAEzB;MAAC,IAAAxE,WAAA;OAAA,OAAAW,gBAEAjC,wBAAsB;QAAA,IACrBkI,QAAK;SAAA,OAAElE,SAAS,CAAC,EAAElB,MAAM;QAAE;QAAA,KAAA,gBAAA;SAAA,OACf,GAAGoB,MAAM,EAAC;QAAU;QAAA,cACpBE;QACZ+D,WAAWrF,OAAO;SAChB,IAAI,CAAC9B,MAAM4B,YAAY,OAAOE,OAAO,UAAU9B,MAAM6B,SAASC,EAAE;QAClE;QAAC,IAAAxB,WAAA;SAAA,OAAAW,gBAEA7C,KAAG;UAAA,IAACgJ,OAAI;WAAA,OAAEvE,QAAQ;UAAC;UAAAvC,WAChByC,UAAK9B,gBACJhC,uBAAqB;WAAA,IACpBiI,QAAK;YAAA,OAAEnE,MAAMjB;WAAE;WAAA,IACfuF,YAAS;YAAA,OAAEtE,MAAMgD;WAAI;WACrBuB,eAAe;WAAI,IACnB1F,WAAQ;YAAA,OAAE5B,MAAM4B;WAAQ;WACxBC,gBAAgBa,uBAAuB,IAAI;WAAC,IAAApC,WAAA;YAAA,OAAA,CAAAW,gBAE3C9B,gBAAc,EAAQ4D,MAAK,CAAA,UAAA;aAAA,IAAAwE,QAAAC,QAAA;aAAAxG,OAAAuG,aACWxE,MAAMgD,IAAI;aAAA,OAAAwB;YAAA,EAAA,CAAA,CAAA;WAAA;UAAA,CAAA;SAEpD,CAAA;QAAA;OAAA,CAAA;MAAA;KAAA,CAAA,CAAA;IAAA;GAAA,CAAA,CAAA;GAAA,OAAAtC;EAAA;CAAA,CAAA;AAQjB"}
|
|
1
|
+
{"version":3,"file":"appearance-rows.js","names":["AdeaTheme","AdeaThemeRecord","For","Show","createMemo","createSignal","onCleanup","JSX","ChevronDown","Palette","cn","Button","DropdownMenu","DropdownMenuContent","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuTrigger","PalettePreview","POINTER_FOCUS_TARGET_SELECTOR","isTabStop","element","HTMLElement","tabIndex","matches","hasAttribute","getAttribute","closest","getClientRects","length","SettingsRow","props","title","icon","Element","description","stacked","children","_el$","_tmpl$2","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$7","_$insert","_$createComponent","when","_el$6","_tmpl$","_$effect","_p$","_v$","_v$2","e","_$className","t","undefined","ThemeRow","appearance","selectedId","preview","themes","disabled","onSelect","id","portalMount","setPortalMount","HTMLDivElement","triggerElement","setTriggerElement","HTMLButtonElement","menuOpen","setMenuOpen","focusOutsideTarget","setFocusOutsideTarget","restoreTriggerFocus","setRestoreTriggerFocus","focusTargetAfterTab","focusLifecycleVersion","options","filter","theme","selected","find","label","closeMenu","moveFocusOnTab","event","KeyboardEvent","key","isComposing","trigger","parentDialog","focusScope","ownerDocument","body","focusStops","Array","from","querySelectorAll","orderedFocusStops","toSorted","a","b","triggerIndex","indexOf","direction","shiftKey","adjacent","at","stopPropagation","preventDefault","focus","preventScroll","_el$8","_tmpl$4","_$use","modal","open","onOpenChange","ref","as","variant","size","aria-label","_el$9","_tmpl$3","_el$0","name","onInteractOutside","detail","originalEvent","type","target","contains","focusTarget","onFocusOutside","onEscapeKeyDown","onCloseAutoFocus","lifecycleVersion","shouldRestore","isConnected","queueMicrotask","activeElement","document","isMenuFocus","isTriggerFocus","value","onChange","each","textValue","closeOnSelect","_el$1","_tmpl$5","_$createComponent","_$className"],"sources":["../../../../src/components/composites/appearance-editor/appearance-rows.tsx"],"sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2026 Wing\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n// Retains the compact divided row and palette-preview selector from the pinned\n// Zeron/Adea composition; Kobalte owns option navigation and nested dismissal.\nimport type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'\nimport { For, Show, createMemo, createSignal, onCleanup, type JSX } from 'solid-js'\nimport { ChevronDown, Palette } from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu/dropdown-menu'\nimport { PalettePreview } from './theme-preview'\n\nconst POINTER_FOCUS_TARGET_SELECTOR =\n 'a[href], area[href], button, input, select, textarea, iframe, [tabindex], [contenteditable], details > summary:first-of-type'\n\nfunction isTabStop(element: HTMLElement) {\n return (\n (element.tabIndex >= 0 ||\n (element.matches('details > summary:first-of-type') && !element.hasAttribute('tabindex'))) &&\n !element.matches(':disabled') &&\n element.getAttribute('aria-disabled') !== 'true' &&\n element.closest('[hidden], [inert], [aria-hidden=\"true\"]') === null &&\n element.getClientRects().length > 0\n )\n}\n\nexport function SettingsRow(props: {\n title: string\n icon: JSX.Element\n description?: JSX.Element\n stacked?: boolean\n children: JSX.Element\n}) {\n return (\n <section\n class={cn('flex gap-3 px-4 py-4', {\n 'flex-col': props.stacked,\n 'flex-wrap items-center': !props.stacked,\n })}\n >\n {/* Reserve readable copy before choosing a side-by-side control row.\n Wrapping follows the actual host width and enlarged text, rather\n than a viewport breakpoint that also matches a narrow popover. */}\n <div class={cn('flex min-w-0 flex-1 items-center gap-3', { 'basis-48': !props.stacked })}>\n <span\n class=\"flex size-9 shrink-0 items-center justify-center rounded-lg border bg-foreground/5 text-muted-foreground [&_svg]:size-4\"\n aria-hidden=\"true\"\n >\n {props.icon}\n </span>\n <div class=\"min-w-0\">\n <h3 class=\"text-sm font-medium\">{props.title}</h3>\n <Show when={props.description}>\n <div class=\"mt-0.5 text-xs text-muted-foreground\">{props.description}</div>\n </Show>\n </div>\n </div>\n <div class=\"min-w-0 max-w-full shrink-0\">{props.children}</div>\n </section>\n )\n}\n\n/**\n * A compact persistent theme choice. Kobalte handles menu navigation and\n * dismissal; this row moves Tab to the adjacent browser-reported stop because\n * menus consume Tab by default. Enumerating elements and checking their native\n * tabIndex keeps details summaries in the order while preserving explicit\n * tabindex overrides.\n */\nexport function ThemeRow(props: {\n appearance: 'light' | 'dark'\n selectedId: string\n preview: AdeaTheme\n themes: readonly AdeaThemeRecord[]\n disabled?: boolean\n onSelect: (id: string) => void\n}) {\n const [portalMount, setPortalMount] = createSignal<HTMLDivElement>()\n const [triggerElement, setTriggerElement] = createSignal<HTMLButtonElement>()\n const [menuOpen, setMenuOpen] = createSignal(false)\n const [focusOutsideTarget, setFocusOutsideTarget] = createSignal<HTMLElement>()\n const [restoreTriggerFocus, setRestoreTriggerFocus] = createSignal(false)\n let focusTargetAfterTab: HTMLElement | undefined\n let focusLifecycleVersion = 0\n onCleanup(() => {\n focusLifecycleVersion += 1\n })\n const options = createMemo(() =>\n props.themes.filter((theme) => theme.appearance === props.appearance)\n )\n const selected = createMemo(\n () =>\n options().find((theme) => theme.id === props.selectedId) ??\n options().find((theme) => theme.id === props.preview.id)\n )\n const label = () => (props.appearance === 'light' ? 'Light theme' : 'Dark theme')\n const closeMenu = () => {\n if (menuOpen()) focusLifecycleVersion += 1\n setMenuOpen(false)\n }\n const moveFocusOnTab = (event: KeyboardEvent) => {\n if (event.key !== 'Tab' || event.isComposing) return\n\n const trigger = triggerElement()\n if (!trigger) return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (!focusScope) return\n\n const focusStops = Array.from(focusScope.querySelectorAll<HTMLElement>('*')).filter(\n (element) =>\n isTabStop(element) &&\n element.closest('[role=\"menu\"], [hidden], [inert], [aria-hidden=\"true\"]') === null\n )\n const orderedFocusStops = [\n ...focusStops\n .filter((element) => element.tabIndex > 0)\n .toSorted((a, b) => a.tabIndex - b.tabIndex),\n ...focusStops.filter((element) => element.tabIndex <= 0),\n ]\n const triggerIndex = orderedFocusStops.indexOf(trigger)\n const direction = event.shiftKey ? -1 : 1\n const adjacent =\n orderedFocusStops[triggerIndex + direction] ??\n (parentDialog ? (direction > 0 ? orderedFocusStops[0] : orderedFocusStops.at(-1)) : undefined)\n\n event.stopPropagation()\n setRestoreTriggerFocus(false)\n if (adjacent) {\n event.preventDefault()\n focusTargetAfterTab = adjacent\n setFocusOutsideTarget(adjacent)\n closeMenu()\n adjacent.focus({ preventScroll: true })\n } else {\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n closeMenu()\n }\n }\n return (\n <SettingsRow title={label()} icon={<Palette />}>\n <div ref={setPortalMount}>\n <DropdownMenu\n modal={false}\n open={menuOpen()}\n onOpenChange={(open) => {\n if (open !== menuOpen()) focusLifecycleVersion += 1\n setMenuOpen(open)\n if (open) {\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n setRestoreTriggerFocus(false)\n }\n }}\n >\n <DropdownMenuTrigger\n ref={setTriggerElement}\n as={Button}\n variant=\"outline\"\n size=\"sm\"\n aria-label={label()}\n disabled={props.disabled || options().length === 0}\n class=\"w-full justify-between sm:w-52\"\n >\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n <PalettePreview theme={props.preview} />\n <span class=\"min-w-0 flex-1 truncate\">{selected()?.name ?? props.preview.name}</span>\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n portalMount={portalMount()}\n class=\"max-h-(--kb-popper-content-available-height) w-(--kb-popper-anchor-width) min-w-32 overflow-x-hidden overflow-y-auto\"\n onInteractOutside={(event) => {\n if (event.detail.originalEvent.type !== 'pointerdown') return\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (!(target instanceof Element) || !focusScope?.contains(target)) return\n\n const focusTarget = target.closest<HTMLElement>(POINTER_FOCUS_TARGET_SELECTOR)\n if (focusTarget && isTabStop(focusTarget)) {\n setRestoreTriggerFocus(false)\n setFocusOutsideTarget(focusTarget)\n } else {\n setRestoreTriggerFocus(true)\n }\n }}\n onFocusOutside={(event) => {\n // The containing dialog or document body can briefly reclaim\n // focus when the menu opens. Keep that handoff from dismissing\n // it; focus moving to another descendant still closes the menu.\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n const target = event.detail.originalEvent.target\n if (target === focusScope) {\n event.preventDefault()\n } else if (target instanceof HTMLElement && focusScope?.contains(target)) {\n setRestoreTriggerFocus(false)\n setFocusOutsideTarget(target)\n }\n }}\n onEscapeKeyDown={() => setRestoreTriggerFocus(true)}\n onCloseAutoFocus={(event) => {\n // A prior menu instance can finish its focus cleanup after this\n // row has already reopened. Do not let that cleanup steal focus.\n if (menuOpen()) {\n event.preventDefault()\n return\n }\n\n const lifecycleVersion = focusLifecycleVersion\n const shouldRestore = restoreTriggerFocus()\n const focusTarget = focusTargetAfterTab ?? focusOutsideTarget()\n focusTargetAfterTab = undefined\n setFocusOutsideTarget(undefined)\n setRestoreTriggerFocus(false)\n if (shouldRestore) {\n // The saved focus may be the containing dialog rather than\n // the trigger when WebKit opens this menu from a pointer click.\n event.preventDefault()\n triggerElement()?.focus({ preventScroll: true })\n return\n }\n\n const parentDialog = portalMount()?.closest<HTMLElement>('[role=\"dialog\"]')\n const focusScope = parentDialog ?? portalMount()?.ownerDocument.body\n if (focusTarget?.isConnected && focusScope?.contains(focusTarget)) {\n // Preserve the intended in-scope destination across\n // Kobalte's deferred stale-focus restore.\n event.preventDefault()\n queueMicrotask(() => {\n if (lifecycleVersion !== focusLifecycleVersion || menuOpen()) return\n\n const activeElement = document.activeElement\n const isMenuFocus =\n activeElement instanceof HTMLElement &&\n activeElement.closest('[role=\"menu\"]') !== null\n const isTriggerFocus = activeElement === triggerElement()\n if (\n activeElement !== focusTarget &&\n (activeElement === document.body ||\n activeElement === focusScope ||\n isMenuFocus ||\n isTriggerFocus)\n ) {\n focusTarget.focus({ preventScroll: true })\n }\n })\n return\n }\n\n const activeElement = document.activeElement\n if (\n focusScope &&\n activeElement instanceof HTMLElement &&\n activeElement !== focusScope &&\n focusScope.contains(activeElement) &&\n activeElement.closest('[role=\"menu\"]') === null\n ) {\n // Preserve a real focus target in this scope instead of\n // restoring the stale element captured when the menu mounted. A\n // focused menu item is about to unmount, so Kobalte must restore\n // focus to the trigger instead.\n event.preventDefault()\n }\n }}\n >\n <DropdownMenuRadioGroup\n value={selected()?.id ?? ''}\n aria-label={`${label()} options`}\n on:keydown={moveFocusOnTab}\n onChange={(id) => {\n if (!props.disabled && typeof id === 'string') props.onSelect(id)\n }}\n >\n <For each={options()}>\n {(theme) => (\n <DropdownMenuRadioItem\n value={theme.id}\n textValue={theme.name}\n closeOnSelect={true}\n disabled={props.disabled}\n onSelect={() => setRestoreTriggerFocus(true)}\n >\n <PalettePreview theme={theme} />\n <span class=\"min-w-0 flex-1 truncate\">{theme.name}</span>\n </DropdownMenuRadioItem>\n )}\n </For>\n </Dropdown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d.ts","sourceRoot":"","sources":["../../../../src/components/layout/orbit-layout/index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,OAAO,EACL,SAAS,EACT,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ComponentProps } from 'solid-js';
|
|
2
|
+
/** A CSS length or expression used to place an item away from the orbit center. */
|
|
3
|
+
export type OrbitRadius = number | string;
|
|
4
|
+
export type OrbitLayoutMode = 'radial' | 'flow';
|
|
5
|
+
/**
|
|
6
|
+
* OrbitLayout.
|
|
7
|
+
*
|
|
8
|
+
* Provides a positioned canvas and a shared radius for its OrbitItems. It does
|
|
9
|
+
* not assign list semantics or alter DOM order: callers choose semantics, and
|
|
10
|
+
* keyboard and screen-reader order remain the source order of the children.
|
|
11
|
+
*/
|
|
12
|
+
export type OrbitLayoutProps = Omit<ComponentProps<'div'>, 'style'> & {
|
|
13
|
+
/** JSX style props are owned by this geometry primitive. */
|
|
14
|
+
style?: never;
|
|
15
|
+
/** Responsive radius used by every OrbitItem unless that item overrides it. */
|
|
16
|
+
radius?: OrbitRadius;
|
|
17
|
+
/** `flow` places items in source order; `radial` positions them around the host. */
|
|
18
|
+
mode?: OrbitLayoutMode;
|
|
19
|
+
};
|
|
20
|
+
export declare function OrbitLayout(props: OrbitLayoutProps): import("solid-js").JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* OrbitItem.
|
|
23
|
+
*
|
|
24
|
+
* Positions one ordinary child around its OrbitLayout. This is geometry only:
|
|
25
|
+
* the wrapper has no role, tabindex, or interaction of its own.
|
|
26
|
+
*/
|
|
27
|
+
export type OrbitItemProps = Omit<ComponentProps<'div'>, 'style'> & {
|
|
28
|
+
/** JSX style props are owned by this geometry primitive. */
|
|
29
|
+
style?: never;
|
|
30
|
+
/** Zero-based position in the rendered sequence. */
|
|
31
|
+
index: number;
|
|
32
|
+
/** Number of items sharing this orbit. */
|
|
33
|
+
count: number;
|
|
34
|
+
/** Per-item override for OrbitLayout's responsive radius. */
|
|
35
|
+
radius?: OrbitRadius;
|
|
36
|
+
};
|
|
37
|
+
export declare function OrbitItem(props: OrbitItemProps): import("solid-js").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=orbit-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orbit-layout.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/orbit-layout/orbit-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C,mFAAmF;AACnF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAA;AACzC,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,MAAM,CAAA;AAW/C;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GAAG;IACpE,4DAA4D;IAC5D,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,+EAA+E;IAC/E,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,oFAAoF;IACpF,IAAI,CAAC,EAAE,eAAe,CAAA;CACvB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,kCAkBlD;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GAAG;IAClE,4DAA4D;IAC5D,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAA;IACb,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAA;IACb,6DAA6D;IAC7D,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,CAAA;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,kCAyC9C"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { createComponent, insert, mergeProps, spread, template } from "solid-js/web";
|
|
3
|
+
import { createContext, createMemo, splitProps, useContext } from "solid-js";
|
|
4
|
+
//#region src/components/layout/orbit-layout/orbit-layout.tsx
|
|
5
|
+
var _tmpl$ = /*#__PURE__*/ template(`<div>`);
|
|
6
|
+
var DEFAULT_ORBIT_RADIUS = "calc(50% - 2rem)";
|
|
7
|
+
var OrbitRadiusContext = createContext();
|
|
8
|
+
var OrbitModeContext = createContext();
|
|
9
|
+
function resolveRadius(radius) {
|
|
10
|
+
if (typeof radius === "number") return `${Number.isFinite(radius) ? Math.max(0, radius) : 0}px`;
|
|
11
|
+
return radius?.trim() || DEFAULT_ORBIT_RADIUS;
|
|
12
|
+
}
|
|
13
|
+
function OrbitLayout(props) {
|
|
14
|
+
const [local, rest] = splitProps(props, [
|
|
15
|
+
"class",
|
|
16
|
+
"radius",
|
|
17
|
+
"mode",
|
|
18
|
+
"style",
|
|
19
|
+
"children"
|
|
20
|
+
]);
|
|
21
|
+
const radius = createMemo(() => resolveRadius(local.radius));
|
|
22
|
+
const mode = createMemo(() => local.mode ?? "radial");
|
|
23
|
+
return createComponent(OrbitRadiusContext.Provider, {
|
|
24
|
+
value: radius,
|
|
25
|
+
get children() {
|
|
26
|
+
return createComponent(OrbitModeContext.Provider, {
|
|
27
|
+
value: mode,
|
|
28
|
+
get children() {
|
|
29
|
+
var _el$ = _tmpl$();
|
|
30
|
+
spread(_el$, mergeProps(rest, {
|
|
31
|
+
"data-slot": "orbit-layout",
|
|
32
|
+
get ["class"]() {
|
|
33
|
+
return cn(mode() === "flow" ? "grid gap-3" : "relative size-full", local.class);
|
|
34
|
+
}
|
|
35
|
+
}), false, true);
|
|
36
|
+
insert(_el$, () => local.children);
|
|
37
|
+
return _el$;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function OrbitItem(props) {
|
|
44
|
+
const [local, rest] = splitProps(props, [
|
|
45
|
+
"class",
|
|
46
|
+
"index",
|
|
47
|
+
"count",
|
|
48
|
+
"radius",
|
|
49
|
+
"style",
|
|
50
|
+
"children"
|
|
51
|
+
]);
|
|
52
|
+
const inheritedRadius = useContext(OrbitRadiusContext);
|
|
53
|
+
const inheritedMode = useContext(OrbitModeContext);
|
|
54
|
+
const mode = () => inheritedMode?.() ?? "radial";
|
|
55
|
+
const radius = () => local.radius !== void 0 ? resolveRadius(local.radius) : inheritedRadius?.() ?? DEFAULT_ORBIT_RADIUS;
|
|
56
|
+
const angle = createMemo(() => {
|
|
57
|
+
const count = Number.isFinite(local.count) ? Math.max(1, Math.trunc(local.count)) : 1;
|
|
58
|
+
return `${((Number.isFinite(local.index) ? Math.trunc(local.index) : 0) % count + count) % count / count * Math.PI * 2}rad`;
|
|
59
|
+
});
|
|
60
|
+
const positionStyle = () => mode() === "flow" ? void 0 : {
|
|
61
|
+
top: `calc(50% + sin(${angle()}) * ${radius()})`,
|
|
62
|
+
left: `calc(50% + cos(${angle()}) * ${radius()})`,
|
|
63
|
+
translate: "-50% -50%"
|
|
64
|
+
};
|
|
65
|
+
return (() => {
|
|
66
|
+
var _el$2 = _tmpl$();
|
|
67
|
+
spread(_el$2, mergeProps(rest, {
|
|
68
|
+
"data-slot": "orbit-item",
|
|
69
|
+
get ["class"]() {
|
|
70
|
+
return cn(mode() === "flow" ? void 0 : "absolute", local.class);
|
|
71
|
+
},
|
|
72
|
+
get style() {
|
|
73
|
+
return positionStyle();
|
|
74
|
+
}
|
|
75
|
+
}), false, true);
|
|
76
|
+
insert(_el$2, () => local.children);
|
|
77
|
+
return _el$2;
|
|
78
|
+
})();
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { OrbitItem, OrbitLayout };
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=orbit-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orbit-layout.js","names":["ComponentProps","createContext","createMemo","splitProps","useContext","Accessor","cn","OrbitRadius","OrbitLayoutMode","DEFAULT_ORBIT_RADIUS","OrbitRadiusContext","OrbitModeContext","resolveRadius","radius","Number","isFinite","Math","max","trim","OrbitLayoutProps","Omit","style","mode","OrbitLayout","props","local","rest","_$createComponent","Provider","value","children","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","OrbitItemProps","index","count","OrbitItem","inheritedRadius","inheritedMode","undefined","angle","trunc","rawIndex","PI","positionStyle","top","left","translate","_el$2","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/layout/orbit-layout/orbit-layout.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { createContext, createMemo, splitProps, useContext, type Accessor } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/** A CSS length or expression used to place an item away from the orbit center. */\nexport type OrbitRadius = number | string\nexport type OrbitLayoutMode = 'radial' | 'flow'\n\nconst DEFAULT_ORBIT_RADIUS = 'calc(50% - 2rem)'\nconst OrbitRadiusContext = createContext<Accessor<string>>()\nconst OrbitModeContext = createContext<Accessor<OrbitLayoutMode>>()\n\nfunction resolveRadius(radius: OrbitRadius | undefined): string {\n if (typeof radius === 'number') return `${Number.isFinite(radius) ? Math.max(0, radius) : 0}px`\n return radius?.trim() || DEFAULT_ORBIT_RADIUS\n}\n\n/**\n * OrbitLayout.\n *\n * Provides a positioned canvas and a shared radius for its OrbitItems. It does\n * not assign list semantics or alter DOM order: callers choose semantics, and\n * keyboard and screen-reader order remain the source order of the children.\n */\nexport type OrbitLayoutProps = Omit<ComponentProps<'div'>, 'style'> & {\n /** JSX style props are owned by this geometry primitive. */\n style?: never\n /** Responsive radius used by every OrbitItem unless that item overrides it. */\n radius?: OrbitRadius\n /** `flow` places items in source order; `radial` positions them around the host. */\n mode?: OrbitLayoutMode\n}\n\nexport function OrbitLayout(props: OrbitLayoutProps) {\n const [local, rest] = splitProps(props, ['class', 'radius', 'mode', 'style', 'children'])\n const radius = createMemo(() => resolveRadius(local.radius))\n const mode = createMemo(() => local.mode ?? 'radial')\n\n return (\n <OrbitRadiusContext.Provider value={radius}>\n <OrbitModeContext.Provider value={mode}>\n <div\n {...rest}\n data-slot=\"orbit-layout\"\n class={cn(mode() === 'flow' ? 'grid gap-3' : 'relative size-full', local.class)}\n >\n {local.children}\n </div>\n </OrbitModeContext.Provider>\n </OrbitRadiusContext.Provider>\n )\n}\n\n/**\n * OrbitItem.\n *\n * Positions one ordinary child around its OrbitLayout. This is geometry only:\n * the wrapper has no role, tabindex, or interaction of its own.\n */\nexport type OrbitItemProps = Omit<ComponentProps<'div'>, 'style'> & {\n /** JSX style props are owned by this geometry primitive. */\n style?: never\n /** Zero-based position in the rendered sequence. */\n index: number\n /** Number of items sharing this orbit. */\n count: number\n /** Per-item override for OrbitLayout's responsive radius. */\n radius?: OrbitRadius\n}\n\nexport function OrbitItem(props: OrbitItemProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'index',\n 'count',\n 'radius',\n 'style',\n 'children',\n ])\n const inheritedRadius = useContext(OrbitRadiusContext)\n const inheritedMode = useContext(OrbitModeContext)\n const mode = () => inheritedMode?.() ?? 'radial'\n const radius = () =>\n local.radius !== undefined\n ? resolveRadius(local.radius)\n : (inheritedRadius?.() ?? DEFAULT_ORBIT_RADIUS)\n const angle = createMemo(() => {\n const count = Number.isFinite(local.count) ? Math.max(1, Math.trunc(local.count)) : 1\n const rawIndex = Number.isFinite(local.index) ? Math.trunc(local.index) : 0\n const index = ((rawIndex % count) + count) % count\n return `${(index / count) * Math.PI * 2}rad`\n })\n const positionStyle = () =>\n mode() === 'flow'\n ? undefined\n : {\n top: `calc(50% + sin(${angle()}) * ${radius()})`,\n left: `calc(50% + cos(${angle()}) * ${radius()})`,\n translate: '-50% -50%',\n }\n\n return (\n <div\n {...rest}\n data-slot=\"orbit-item\"\n class={cn(mode() === 'flow' ? undefined : 'absolute', local.class)}\n style={positionStyle()}\n >\n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MAAMZ,WAAW8B,KAAAA,IACb/B,cAAca,MAAMZ,MAAM,IACzB4B,kBAAkB,KAAKhC;CAC9B,MAAMmC,QAAQ1C,iBAAiB;EAC7B,MAAMqC,QAAQzB,OAAOC,SAASU,MAAMc,KAAK,IAAIvB,KAAKC,IAAI,GAAGD,KAAK6B,MAAMpB,MAAMc,KAAK,CAAC,IAAI;EAGpF,OAAO,KAFUzB,OAAOC,SAASU,MAAMa,KAAK,IAAItB,KAAK6B,MAAMpB,MAAMa,KAAK,IAAI,KAC/CC,QAASA,SAASA,QAC1BA,QAASvB,KAAK+B,KAAK,EAAC;CACzC,CAAC;CACD,MAAMC,sBACJ1B,KAAK,MAAM,SACPqB,KAAAA,IACA;EACEM,KAAK,kBAAkBL,MAAM,EAAC,MAAO/B,OAAO,EAAC;EAC7CqC,MAAM,kBAAkBN,MAAM,EAAC,MAAO/B,OAAO,EAAC;EAC9CsC,WAAW;CACb;CAEN,cAAA;EAAA,IAAAC,QAAApB,OAAA;EAAAC,OAAAmB,OAAAlB,WAEQR,MAAI;GAAA,aACE;GAAY,KAAA,WAAA;IAAA,OACfpB,GAAGgB,KAAK,MAAM,SAASqB,KAAAA,IAAY,YAAYlB,MAAMU,KAAK;GAAC;GAAA,IAClEd,QAAK;IAAA,OAAE2B,cAAc;GAAC;EAAA,CAAA,GAAA,OAAA,IAAA;EAAAZ,OAAAgB,aAErB3B,MAAMK,QAAQ;EAAA,OAAAsB;CAAA,EAAA,CAAA;AAGrB"}
|
|
@@ -97,5 +97,6 @@ export declare function SideRailItem<T extends ValidComponent = 'a'>(props: Side
|
|
|
97
97
|
export declare function SideRailButton(props: Omit<ComponentProps<'button'>, 'type'> & {
|
|
98
98
|
label: string;
|
|
99
99
|
shortcut?: string;
|
|
100
|
+
active?: boolean;
|
|
100
101
|
}): JSX.Element;
|
|
101
102
|
//# sourceMappingURL=side-rail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-rail.d.ts","sourceR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@ function SideRailButton(props) {
|
|
|
264
264
|
"class",
|
|
265
265
|
"label",
|
|
266
266
|
"shortcut",
|
|
267
|
-
"children"
|
|
267
|
+
"children",
|
|
268
|
+
"active"
|
|
268
269
|
]);
|
|
269
270
|
const [row, setRow] = createSignal();
|
|
270
271
|
const [tip, setTip] = createSignal(null);
|
|
@@ -290,8 +291,11 @@ function SideRailButton(props) {
|
|
|
290
291
|
get ["aria-label"]() {
|
|
291
292
|
return local.label;
|
|
292
293
|
},
|
|
294
|
+
get ["data-active"]() {
|
|
295
|
+
return local.active ? "true" : void 0;
|
|
296
|
+
},
|
|
293
297
|
get ["class"]() {
|
|
294
|
-
return cn(sideRailItemClass, sideRailItemStateClass.idle, "disabled:pointer-events-none disabled:opacity-50", local.class);
|
|
298
|
+
return cn(sideRailItemClass, local.active ? sideRailItemStateClass.active : sideRailItemStateClass.idle, "disabled:pointer-events-none disabled:opacity-50", local.class);
|
|
295
299
|
}
|
|
296
300
|
}, rest), false, true);
|
|
297
301
|
insert(_el$14, () => local.children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-rail.js","names":["Polymorphic","PolymorphicProps","ComponentProps","JSX","ValidComponent","Show","createMemo","createSignal","splitProps","Portal","cn","SideRailContext","createSideRailValue","SideRailProps","T","class","collapsed","SideRail","props","local","rest","value","_$createComponent","Provider","children","_$mergeProps","as","aria-label","data-collapsed","SideRailHeader","_el$","_tmpl$","_$spread","SideRailContent","_el$2","_tmpl$2","SideRailFooter","_el$3","_tmpl$3","SideRailSection","label","_el$4","_tmpl$5","_$insert","when","_el$5","_tmpl$4","sideRailItemClass","join","sideRailItemStateClass","active","idle","SideRailItemProps","badge","Element","trailing","shortcut","keyshortcuts","SideRailItem","row","setRow","HTMLElement","tip","setTip","top","left","height","closest","getAttribute","showTip","element","rect","getBoundingClientRect","right","hideTip","ref","aria-current","undefined","aria-keyshortcuts","data-active","onPointerEnter","onPointerLeave","onFocus","onBlur","Record","_el$6","_tmpl$6","_el$7","firstChild","_el$8","_tmpl$7","_el$9","_tmpl$8","_$memo","_el$0","_tmpl$9","_el$1","_tmpl$0","position","_el$10","_tmpl$10","_el$11","_el$12","_tmpl$1","_$effect","_p$","_v$","_v$2","_v$3","_v$4","_v$5","e","_$className","t","_$setStyleProperty","a","o","i","SideRailButton","Omit","_el$13","_tmpl$11","_el$14","_el$15","nextSibling","addEventListener","_$use","_el$16","_el$17","_tmpl$12","_el$18","_v$6","_v$7","_v$8","_$createComponent","_$mergeProps","_$memo","_$className","_$setStyleProperty"],"sources":["../../../../src/components/layout/side-rail/side-rail.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport type { ComponentProps, JSX, ValidComponent } from 'solid-js'\nimport { Show, createMemo, createSignal, splitProps } from 'solid-js'\nimport { Portal } from 'solid-js/web'\nimport { cn } from '#lib/utils'\nimport { SideRailContext, createSideRailValue } from './side-rail-context'\n\n/**\n * SideRail.\n *\n * The narrow, persistent column of top-level destinations at the window's leading\n * edge: the app mark, the primary sections, and a footer for account and settings.\n * It is the one piece of chrome that is always on screen, which is why it is a\n * component rather than something each view arranges.\n *\n * Two forms, one component. Collapsed it is an icon column; expanded it carries\n * labels. Both widths come from `--rail-width` (74px) and `--rail-width-expanded`\n * (236px), so an app cannot pick its own and end up a few pixels out of step with\n * the app beside it.\n *\n * The rail does not own its collapsed state; the app does. That state has to\n * survive a reload and usually lives with the rest of the window preferences, and\n * a rail that kept it privately could not be restored.\n */\nexport type SideRailProps<T extends ValidComponent = 'nav'> = PolymorphicProps<\n T,\n {\n class?: string\n collapsed?: boolean\n 'aria-label'?: string\n }\n>\n\nexport function SideRail<T extends ValidComponent = 'nav'>(props: SideRailProps<T>) {\n const [local, rest] = splitProps(props as SideRailProps, [\n 'class',\n 'collapsed',\n 'aria-label',\n 'children',\n ])\n\n const collapsed = () => local.collapsed ?? false\n const value = createSideRailValue(\n collapsed,\n createMemo(() => (collapsed() ? 'var(--rail-width)' : 'var(--rail-width-expanded)'))\n )\n\n return (\n <SideRailContext.Provider value={value}>\n <Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Primary'}\n /* Rendered in both states, with a real value, so the descendant selectors\n below can key on true *and* false — an absent attribute would leave the\n expanded form matching neither. */\n data-collapsed={collapsed() ? 'true' : 'false'}\n class={cn(\n 'group/rail bg-sidebar text-sidebar-foreground flex h-full shrink-0 flex-col border-e border-sidebar-border',\n 'transition-[width] duration-150 ease-out',\n { 'w-rail': collapsed(), 'w-rail-expanded': !collapsed() },\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>\n </SideRailContext.Provider>\n )\n}\n\n/** The header slot: the app mark, and the product name when there is room. */\nexport function SideRailHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"side-rail-header\"\n class={cn(\n 'h-topbar flex shrink-0 items-center gap-2.5 px-3 group-data-[collapsed=true]/rail:justify-center group-data-[collapsed=true]/rail:px-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** The scrolling middle. Keeps the header and the footer pinned. */\nexport function SideRailContent(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"side-rail-content\"\n class={cn(\n 'flex min-h-0 flex-1 flex-col gap-0.5 overflow-x-hidden overflow-y-auto px-2 py-2',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** The pinned footer: account, settings, help. */\nexport function SideRailFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"side-rail-footer\"\n class={cn(\n 'flex shrink-0 flex-col gap-0.5 border-t border-sidebar-border px-2 py-2',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A titled group of rail destinations. The title hides when collapsed. */\nexport function SideRailSection(props: ComponentProps<'div'> & { label?: string }) {\n const [local, rest] = splitProps(props, ['class', 'label', 'children'])\n\n return (\n <div data-slot=\"side-rail-section\" class={cn('flex flex-col gap-0.5', local.class)} {...rest}>\n <Show when={local.label}>\n <div class=\"text-sidebar-muted-foreground px-2 pt-2 pb-1 text-2xs font-medium tracking-wide uppercase group-data-[collapsed=true]/rail:hidden\">\n {local.label}\n </div>\n </Show>\n {local.children}\n </div>\n )\n}\n\n/**\n * The classes a rail row uses. Exported so a caller's own element — a router link,\n * a custom button — can match the rail exactly instead of approximating it.\n */\nexport const sideRailItemClass = [\n 'group/rail-item flex h-rail-item min-w-0 w-full items-center gap-2.5 rounded-md px-3 text-sm font-medium',\n 'group-data-[collapsed=true]/rail:justify-center group-data-[collapsed=true]/rail:px-0',\n 'transition-[color,background-color,transform] ease-out outline-none select-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n /*\n * The donor's row scales up slightly under the pointer and down under a press.\n * It is a CSS transform rather than a motion-library gesture because the two are\n * the same thing here and the transform costs nothing at runtime: no wrapper\n * element, no listener, and it works on whatever element a caller renders the row\n * as — an anchor, a button, a router's own link.\n *\n * The collapsed rail opts out: a 1.02 scale on a 74px column pushes the row past\n * the rail's own edge, which reads as a glitch rather than as feedback.\n */\n 'hover:scale-[1.02] active:scale-[0.97] group-data-[collapsed=true]/rail:hover:scale-100 group-data-[collapsed=true]/rail:active:scale-[0.98]',\n '[&_svg]:size-4 [&_svg]:shrink-0',\n].join(' ')\n\nexport const sideRailItemStateClass = {\n active: 'bg-sidebar-accent text-sidebar-accent-foreground',\n idle: 'text-sidebar-muted-foreground hover:bg-sidebar-accent/60 hover:text-sidebar-foreground',\n}\n\n/**\n * A rail destination.\n *\n * ## The tooltip is the rail's hover affordance, not a generic bubble\n *\n * Collapsed, the row has no text, so the label has to come from somewhere. This\n * ports the donor's treatment rather than using a standard tooltip, because the\n * details are what make it read as part of the rail:\n *\n * - It is **flush with the row**: positioned at the row's own top and given the\n * row's own height, so it continues the row outward instead of floating near\n * it. A centred bubble with an arrow reads as a separate object.\n * - It **repeats the icon**, which anchors it to the row it belongs to.\n * - It carries the **keyboard chord**, which is the one piece of information a\n * collapsed rail otherwise cannot show.\n * - It opens on **hover and on focus**, so a keyboard user gets the same label a\n * pointer user does.\n * - It is `pointer-events-none` and `aria-hidden`: the row already carries the\n * name (as a visually hidden span when collapsed), so this is decoration and\n * must never be the accessible name.\n *\n * ## The chord on the row\n *\n * Expanded, the row shows its chord on hover and on focus — and the chord is\n * declared once to assistive technology through `aria-keyshortcuts` rather than\n * being read out as glyphs. The visible badge is `aria-hidden` for that reason.\n */\nexport type SideRailItemProps<T extends ValidComponent = 'a'> = PolymorphicProps<\n T,\n {\n class?: string\n /** Marks the item as the current destination. */\n active?: boolean\n /**\n * The item's accessible name. Required, and always in the accessibility tree:\n * collapsed it moves into the tooltip and a visually hidden span rather than\n * being deleted.\n */\n label: string\n /** A count or a dot, rendered over the icon's corner. */\n badge?: JSX.Element\n /** An indicator pinned to the trailing edge in the expanded form. */\n trailing?: JSX.Element\n /** The chord as it should be drawn, e.g. `⌘1`. Shown on hover and focus. */\n shortcut?: string\n /**\n * The same chord in the ARIA grammar, e.g. `Meta+1`. Declared to assistive\n * technology instead of the display glyphs, which are not a keyboard shortcut\n * a screen reader can parse. Supply it whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n>\n\nexport function SideRailItem<T extends ValidComponent = 'a'>(props: SideRailItemProps<T>) {\n const [local, rest] = splitProps(props as SideRailItemProps, [\n 'as',\n 'class',\n 'active',\n 'label',\n 'badge',\n 'trailing',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n\n const [row, setRow] = createSignal<HTMLElement>()\n const [tip, setTip] = createSignal<{ top: number; left: number; height: number } | null>(null)\n\n const collapsed = () =>\n row()?.closest('[data-collapsed]')?.getAttribute('data-collapsed') === 'true'\n\n const showTip = () => {\n const element = row()\n if (!element || !collapsed()) return\n const rect = element.getBoundingClientRect()\n setTip({ top: rect.top, left: rect.right + 8, height: rect.height })\n }\n\n const hideTip = () => setTip(null)\n\n return (\n <>\n <Polymorphic\n as={local.as ?? 'a'}\n ref={setRow}\n aria-current={local.active ? 'page' : undefined}\n aria-keyshortcuts={local.keyshortcuts}\n data-active={local.active ? '' : undefined}\n class={cn(\n sideRailItemClass,\n local.active ? sideRailItemStateClass.active : sideRailItemStateClass.idle,\n local.class\n )}\n onPointerEnter={showTip}\n onPointerLeave={hideTip}\n onFocus={showTip}\n onBlur={hideTip}\n {...(rest as Record<string, unknown>)}\n >\n <Show when={local.badge}>\n <span class=\"relative flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\">\n {local.children}\n <span class=\"absolute -top-1 -end-1 flex items-center justify-center\">\n {local.badge}\n </span>\n </span>\n </Show>\n <Show when={!local.badge}>\n <span class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\">\n {local.children}\n </span>\n </Show>\n\n <span class=\"min-w-0 flex-1 truncate group-data-[collapsed=true]/rail:sr-only\">\n {local.label}\n </span>\n\n <Show when={local.shortcut && local.trailing === undefined}>\n <span\n aria-hidden=\"true\"\n class=\"text-sidebar-muted-foreground shrink-0 font-mono text-2xs leading-none opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n >\n {local.shortcut}\n </span>\n </Show>\n\n <Show when={local.trailing}>\n <span class=\"ms-auto shrink-0\">{local.trailing}</span>\n </Show>\n </Polymorphic>\n\n <Show when={tip()}>\n {(position) => (\n <Portal>\n <div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class={cn(\n 'bg-card text-card-foreground border-border pointer-events-none fixed z-(--z-tooltip)',\n 'flex items-center gap-2.5 rounded-md border ps-3 pe-3 text-sm font-medium whitespace-nowrap shadow-lg'\n )}\n style={{\n top: `${position().top}px`,\n left: `${position().left}px`,\n height: `${position().height}px`,\n }}\n >\n <span\n class={cn('flex size-4 shrink-0 items-center justify-center [&_svg]:size-4', {\n 'text-primary': local.active,\n })}\n >\n {local.children}\n </span>\n {local.label}\n <Show when={local.shortcut}>\n <span class=\"text-muted-foreground shrink-0 font-mono text-2xs leading-none\">\n {local.shortcut}\n </span>\n </Show>\n </div>\n </Portal>\n )}\n </Show>\n </>\n )\n}\n\n/** A non-navigating rail control: a collapse toggle, a \"new\" action. */\nexport function SideRailButton(\n props: Omit<ComponentProps<'button'>, 'type'> & { label: string; shortcut?: string }\n) {\n const [local, rest] = splitProps(props, ['class', 'label', 'shortcut', 'children'])\n const [row, setRow] = createSignal<HTMLElement>()\n const [tip, setTip] = createSignal<{ top: number; left: number; height: number } | null>(null)\n\n const collapsed = () =>\n row()?.closest('[data-collapsed]')?.getAttribute('data-collapsed') === 'true'\n\n const showTip = () => {\n const element = row()\n if (!element || !collapsed()) return\n const rect = element.getBoundingClientRect()\n setTip({ top: rect.top, left: rect.right + 8, height: rect.height })\n }\n\n return (\n <>\n <button\n type=\"button\"\n ref={setRow}\n aria-label={local.label}\n onPointerEnter={showTip}\n onPointerLeave={() => setTip(null)}\n onFocus={showTip}\n onBlur={() => setTip(null)}\n class={cn(\n sideRailItemClass,\n sideRailItemStateClass.idle,\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n <span class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\">\n {local.children}\n </span>\n <span class=\"min-w-0 flex-1 truncate group-data-[collapsed=true]/rail:sr-only\">\n {local.label}\n </span>\n <Show when={local.shortcut}>\n <span\n aria-hidden=\"true\"\n class=\"text-sidebar-muted-foreground shrink-0 font-mono text-2xs leading-none opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n >\n {local.shortcut}\n </span>\n </Show>\n </button>\n\n <Show when={tip()}>\n {(position) => (\n <Portal>\n <div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class=\"bg-card text-card-foreground border-border pointer-events-none fixed z-(--z-tooltip) flex items-center gap-2.5 rounded-md border ps-3 pe-3 text-sm font-medium whitespace-nowrap shadow-lg\"\n style={{\n top: `${position().top}px`,\n left: `${position().left}px`,\n height: `${position().height}px`,\n }}\n >\n <span class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\">\n {local.children}\n </span>\n {local.label}\n </div>\n </Portal>\n )}\n </Show>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiCA,SAAgBiB,SAA2CC,OAAyB;CAClF,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAwB;EACvD;EACA;EACA;EACA;CAAU,CACX;CAED,MAAMF,kBAAkBG,MAAMH,aAAa;CAC3C,MAAMK,QAAQT,oBACZI,WACAV,iBAAkBU,UAAU,IAAI,sBAAsB,4BAA6B,CACrF;CAEA,OAAAM,gBACGX,gBAAgBY,UAAQ;EAAQF;EAAK,IAAAG,WAAA;GAAA,OAAAF,gBACnCtB,aAAWyB,WAAA;IACVC,IAAE;IAAA,KAAA,gBAAA;KAAA,OACUP,MAAM,iBAAiB;IAAS;IAAA,KAAA,oBAAA;KAAA,OAI5BH,UAAU,IAAI,SAAS;IAAO;IAAA,KAAA,WAAA;KAAA,OACvCN,GACL,8GACA,4CACA;MAAE,UAAUM,UAAU;MAAG,mBAAmB,CAACA,UAAU;KAAE,GACzDG,MAAMJ,KACR;IAAC;GAAA,GACIK,MAA6B,EAAA,IAAAI,WAAA;IAAA,OAEjCL,MAAMK;GAAQ,EAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAIvB;;AAGA,SAAgBK,eAAeX,OAA8B;CAC3D,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAY,OAAAC,OAAA;EAAAC,OAAAF,MAAAL,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWf,GACL,0IACAS,MAAMJ,KACR;EAAC,EAAA,GACGK,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAU;CAAA,EAAA,CAAA;AAGd;;AAGA,SAAgBG,gBAAgBf,OAA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AAAlG,gBAKpBjB,MAAI;EAAA,IAACuC,OAAI;GAAA,OAAEkB,IAAI;EAAC;EAAAtC,WACb0E,aAAQ5E,gBACPb,QAAM,EAAA,IAAAe,WAAA;GAAA,IAAAwG,SAAAC,SAAA,GAAAC,SAAAF,OAAAxC;GAAA7C,OAAAuF,cAYA/G,MAAMK,QAAQ;GAAAmB,OAAAqF,cAEhB7G,MAAMqB,OAAK,IAAA;GAAAgE,QAAAC,QAAA;IAAA,IAAA0B,OARL,GAAGjC,SAAS,CAAC,CAAClC,IAAG,KAAIoE,OACpB,GAAGlC,SAAS,CAAC,CAACjC,KAAI,KAAIoE,OACpB,GAAGnC,SAAS,CAAC,CAAChC,OAAM;IAAIiE,SAAA1B,IAAAM,KAAAG,iBAAAc,QAAA,OAAAvB,IAAAM,IAAAoB,IAAA;IAAAC,SAAA3B,IAAAQ,KAAAC,iBAAAc,QAAA,QAAAvB,IAAAQ,IAAAmB,IAAA;IAAAC,SAAA5B,IAAAU,KAAAD,iBAAAc,QAAA,UAAAvB,IAAAU,IAAAkB,IAAA;IAAA,OAAA5B;GAAA,GAAA;IAAAM,GAAAlC,KAAAA;IAAAoC,GAAApC,KAAAA;IAAAsC,GAAAtC,KAAAA;GAAA,CAAA;GAAA,OAAAmD;EAAA,EAAA,CAAA;CASvC,CAAA,CAAA;AAIT"}
|
|
1
|
+
{"version":3,"file":"side-rail.js","names":["Polymorphic","PolymorphicProps","ComponentProps","JSX","ValidComponent","Show","createMemo","createSignal","splitProps","Portal","cn","SideRailContext","createSideRailValue","SideRailProps","T","class","collapsed","SideRail","props","local","rest","value","_$createComponent","Provider","children","_$mergeProps","as","aria-label","data-collapsed","SideRailHeader","_el$","_tmpl$","_$spread","SideRailContent","_el$2","_tmpl$2","SideRailFooter","_el$3","_tmpl$3","SideRailSection","label","_el$4","_tmpl$5","_$insert","when","_el$5","_tmpl$4","sideRailItemClass","join","sideRailItemStateClass","active","idle","SideRailItemProps","badge","Element","trailing","shortcut","keyshortcuts","SideRailItem","row","setRow","HTMLElement","tip","setTip","top","left","height","closest","getAttribute","showTip","element","rect","getBoundingClientRect","right","hideTip","ref","aria-current","undefined","aria-keyshortcuts","data-active","onPointerEnter","onPointerLeave","onFocus","onBlur","Record","_el$6","_tmpl$6","_el$7","firstChild","_el$8","_tmpl$7","_el$9","_tmpl$8","_$memo","_el$0","_tmpl$9","_el$1","_tmpl$0","position","_el$10","_tmpl$10","_el$11","_el$12","_tmpl$1","_$effect","_p$","_v$","_v$2","_v$3","_v$4","_v$5","e","_$className","t","_$setStyleProperty","a","o","i","SideRailButton","Omit","_el$13","_tmpl$11","_el$14","_el$15","nextSibling","addEventListener","_$use","_el$16","_el$17","_tmpl$12","_el$18","_v$6","_v$7","_v$8","_$createComponent","_$mergeProps","_$memo","_$className","_$setStyleProperty"],"sources":["../../../../src/components/layout/side-rail/side-rail.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport type { ComponentProps, JSX, ValidComponent } from 'solid-js'\nimport { Show, createMemo, createSignal, splitProps } from 'solid-js'\nimport { Portal } from 'solid-js/web'\nimport { cn } from '#lib/utils'\nimport { SideRailContext, createSideRailValue } from './side-rail-context'\n\n/**\n * SideRail.\n *\n * The narrow, persistent column of top-level destinations at the window's leading\n * edge: the app mark, the primary sections, and a footer for account and settings.\n * It is the one piece of chrome that is always on screen, which is why it is a\n * component rather than something each view arranges.\n *\n * Two forms, one component. Collapsed it is an icon column; expanded it carries\n * labels. Both widths come from `--rail-width` (74px) and `--rail-width-expanded`\n * (236px), so an app cannot pick its own and end up a few pixels out of step with\n * the app beside it.\n *\n * The rail does not own its collapsed state; the app does. That state has to\n * survive a reload and usually lives with the rest of the window preferences, and\n * a rail that kept it privately could not be restored.\n */\nexport type SideRailProps<T extends ValidComponent = 'nav'> = PolymorphicProps<\n T,\n {\n class?: string\n collapsed?: boolean\n 'aria-label'?: string\n }\n>\n\nexport function SideRail<T extends ValidComponent = 'nav'>(props: SideRailProps<T>) {\n const [local, rest] = splitProps(props as SideRailProps, [\n 'class',\n 'collapsed',\n 'aria-label',\n 'children',\n ])\n\n const collapsed = () => local.collapsed ?? false\n const value = createSideRailValue(\n collapsed,\n createMemo(() => (collapsed() ? 'var(--rail-width)' : 'var(--rail-width-expanded)'))\n )\n\n return (\n <SideRailContext.Provider value={value}>\n <Polymorphic\n as=\"nav\"\n aria-label={local['aria-label'] ?? 'Primary'}\n /* Rendered in both states, with a real value, so the descendant selectors\n below can key on true *and* false — an absent attribute would leave the\n expanded form matching neither. */\n data-collapsed={collapsed() ? 'true' : 'false'}\n class={cn(\n 'group/rail bg-sidebar text-sidebar-foreground flex h-full shrink-0 flex-col border-e border-sidebar-border',\n 'transition-[width] duration-150 ease-out',\n { 'w-rail': collapsed(), 'w-rail-expanded': !collapsed() },\n local.class\n )}\n {...(rest as ComponentProps<'nav'>)}\n >\n {local.children}\n </Polymorphic>\n </SideRailContext.Provider>\n )\n}\n\n/** The header slot: the app mark, and the product name when there is room. */\nexport function SideRailHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"side-rail-header\"\n class={cn(\n 'h-topbar flex shrink-0 items-center gap-2.5 px-3 group-data-[collapsed=true]/rail:justify-center group-data-[collapsed=true]/rail:px-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** The scrolling middle. Keeps the header and the footer pinned. */\nexport function SideRailContent(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"side-rail-content\"\n class={cn(\n 'flex min-h-0 flex-1 flex-col gap-0.5 overflow-x-hidden overflow-y-auto px-2 py-2',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** The pinned footer: account, settings, help. */\nexport function SideRailFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"side-rail-footer\"\n class={cn(\n 'flex shrink-0 flex-col gap-0.5 border-t border-sidebar-border px-2 py-2',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A titled group of rail destinations. The title hides when collapsed. */\nexport function SideRailSection(props: ComponentProps<'div'> & { label?: string }) {\n const [local, rest] = splitProps(props, ['class', 'label', 'children'])\n\n return (\n <div data-slot=\"side-rail-section\" class={cn('flex flex-col gap-0.5', local.class)} {...rest}>\n <Show when={local.label}>\n <div class=\"text-sidebar-muted-foreground px-2 pt-2 pb-1 text-2xs font-medium tracking-wide uppercase group-data-[collapsed=true]/rail:hidden\">\n {local.label}\n </div>\n </Show>\n {local.children}\n </div>\n )\n}\n\n/**\n * The classes a rail row uses. Exported so a caller's own element — a router link,\n * a custom button — can match the rail exactly instead of approximating it.\n */\nexport const sideRailItemClass = [\n 'group/rail-item flex h-rail-item min-w-0 w-full items-center gap-2.5 rounded-md px-3 text-sm font-medium',\n 'group-data-[collapsed=true]/rail:justify-center group-data-[collapsed=true]/rail:px-0',\n 'transition-[color,background-color,transform] ease-out outline-none select-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n /*\n * The donor's row scales up slightly under the pointer and down under a press.\n * It is a CSS transform rather than a motion-library gesture because the two are\n * the same thing here and the transform costs nothing at runtime: no wrapper\n * element, no listener, and it works on whatever element a caller renders the row\n * as — an anchor, a button, a router's own link.\n *\n * The collapsed rail opts out: a 1.02 scale on a 74px column pushes the row past\n * the rail's own edge, which reads as a glitch rather than as feedback.\n */\n 'hover:scale-[1.02] active:scale-[0.97] group-data-[collapsed=true]/rail:hover:scale-100 group-data-[collapsed=true]/rail:active:scale-[0.98]',\n '[&_svg]:size-4 [&_svg]:shrink-0',\n].join(' ')\n\nexport const sideRailItemStateClass = {\n active: 'bg-sidebar-accent text-sidebar-accent-foreground',\n idle: 'text-sidebar-muted-foreground hover:bg-sidebar-accent/60 hover:text-sidebar-foreground',\n}\n\n/**\n * A rail destination.\n *\n * ## The tooltip is the rail's hover affordance, not a generic bubble\n *\n * Collapsed, the row has no text, so the label has to come from somewhere. This\n * ports the donor's treatment rather than using a standard tooltip, because the\n * details are what make it read as part of the rail:\n *\n * - It is **flush with the row**: positioned at the row's own top and given the\n * row's own height, so it continues the row outward instead of floating near\n * it. A centred bubble with an arrow reads as a separate object.\n * - It **repeats the icon**, which anchors it to the row it belongs to.\n * - It carries the **keyboard chord**, which is the one piece of information a\n * collapsed rail otherwise cannot show.\n * - It opens on **hover and on focus**, so a keyboard user gets the same label a\n * pointer user does.\n * - It is `pointer-events-none` and `aria-hidden`: the row already carries the\n * name (as a visually hidden span when collapsed), so this is decoration and\n * must never be the accessible name.\n *\n * ## The chord on the row\n *\n * Expanded, the row shows its chord on hover and on focus — and the chord is\n * declared once to assistive technology through `aria-keyshortcuts` rather than\n * being read out as glyphs. The visible badge is `aria-hidden` for that reason.\n */\nexport type SideRailItemProps<T extends ValidComponent = 'a'> = PolymorphicProps<\n T,\n {\n class?: string\n /** Marks the item as the current destination. */\n active?: boolean\n /**\n * The item's accessible name. Required, and always in the accessibility tree:\n * collapsed it moves into the tooltip and a visually hidden span rather than\n * being deleted.\n */\n label: string\n /** A count or a dot, rendered over the icon's corner. */\n badge?: JSX.Element\n /** An indicator pinned to the trailing edge in the expanded form. */\n trailing?: JSX.Element\n /** The chord as it should be drawn, e.g. `⌘1`. Shown on hover and focus. */\n shortcut?: string\n /**\n * The same chord in the ARIA grammar, e.g. `Meta+1`. Declared to assistive\n * technology instead of the display glyphs, which are not a keyboard shortcut\n * a screen reader can parse. Supply it whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n>\n\nexport function SideRailItem<T extends ValidComponent = 'a'>(props: SideRailItemProps<T>) {\n const [local, rest] = splitProps(props as SideRailItemProps, [\n 'as',\n 'class',\n 'active',\n 'label',\n 'badge',\n 'trailing',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n\n const [row, setRow] = createSignal<HTMLElement>()\n const [tip, setTip] = createSignal<{ top: number; left: number; height: number } | null>(null)\n\n const collapsed = () =>\n row()?.closest('[data-collapsed]')?.getAttribute('data-collapsed') === 'true'\n\n const showTip = () => {\n const element = row()\n if (!element || !collapsed()) return\n const rect = element.getBoundingClientRect()\n setTip({ top: rect.top, left: rect.right + 8, height: rect.height })\n }\n\n const hideTip = () => setTip(null)\n\n return (\n <>\n <Polymorphic\n as={local.as ?? 'a'}\n ref={setRow}\n aria-current={local.active ? 'page' : undefined}\n aria-keyshortcuts={local.keyshortcuts}\n data-active={local.active ? '' : undefined}\n class={cn(\n sideRailItemClass,\n local.active ? sideRailItemStateClass.active : sideRailItemStateClass.idle,\n local.class\n )}\n onPointerEnter={showTip}\n onPointerLeave={hideTip}\n onFocus={showTip}\n onBlur={hideTip}\n {...(rest as Record<string, unknown>)}\n >\n <Show when={local.badge}>\n <span class=\"relative flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\">\n {local.children}\n <span class=\"absolute -top-1 -end-1 flex items-center justify-center\">\n {local.badge}\n </span>\n </span>\n </Show>\n <Show when={!local.badge}>\n <span class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\">\n {local.children}\n </span>\n </Show>\n\n <span class=\"min-w-0 flex-1 truncate group-data-[collapsed=true]/rail:sr-only\">\n {local.label}\n </span>\n\n <Show when={local.shortcut && local.trailing === undefined}>\n <span\n aria-hidden=\"true\"\n class=\"text-sidebar-muted-foreground shrink-0 font-mono text-2xs leading-none opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n >\n {local.shortcut}\n </span>\n </Show>\n\n <Show when={local.trailing}>\n <span class=\"ms-auto shrink-0\">{local.trailing}</span>\n </Show>\n </Polymorphic>\n\n <Show when={tip()}>\n {(position) => (\n <Portal>\n <div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class={cn(\n 'bg-card text-card-foreground border-border pointer-events-none fixed z-(--z-tooltip)',\n 'flex items-center gap-2.5 rounded-md border ps-3 pe-3 text-sm font-medium whitespace-nowrap shadow-lg'\n )}\n style={{\n top: `${position().top}px`,\n left: `${position().left}px`,\n height: `${position().height}px`,\n }}\n >\n <span\n class={cn('flex size-4 shrink-0 items-center justify-center [&_svg]:size-4', {\n 'text-primary': local.active,\n })}\n >\n {local.children}\n </span>\n {local.label}\n <Show when={local.shortcut}>\n <span class=\"text-muted-foreground shrink-0 font-mono text-2xs leading-none\">\n {local.shortcut}\n </span>\n </Show>\n </div>\n </Portal>\n )}\n </Show>\n </>\n )\n}\n\n/** A non-navigating rail control: a collapse toggle, a \"new\" action. */\nexport function SideRailButton(\n props: Omit<ComponentProps<'button'>, 'type'> & {\n label: string\n shortcut?: string\n active?: boolean\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'label', 'shortcut', 'children', 'active'])\n const [row, setRow] = createSignal<HTMLElement>()\n const [tip, setTip] = createSignal<{ top: number; left: number; height: number } | null>(null)\n\n const collapsed = () =>\n row()?.closest('[data-collapsed]')?.getAttribute('data-collapsed') === 'true'\n\n const showTip = () => {\n const element = row()\n if (!element || !collapsed()) return\n const rect = element.getBoundingClientRect()\n setTip({ top: rect.top, left: rect.right + 8, height: rect.height })\n }\n\n return (\n <>\n <button\n type=\"button\"\n ref={setRow}\n aria-label={local.label}\n data-active={local.active ? 'true' : undefined}\n onPointerEnter={showTip}\n onPointerLeave={() => setTip(null)}\n onFocus={showTip}\n onBlur={() => setTip(null)}\n class={cn(\n sideRailItemClass,\n local.active ? sideRailItemStateClass.active : sideRailItemStateClass.idle,\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n <span class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\">\n {local.children}\n </span>\n <span class=\"min-w-0 flex-1 truncate group-data-[collapsed=true]/rail:sr-only\">\n {local.label}\n </span>\n <Show when={local.shortcut}>\n <span\n aria-hidden=\"true\"\n class=\"text-sidebar-muted-foreground shrink-0 font-mono text-2xs leading-none opacity-0 transition-opacity group-hover/rail-item:opacity-100 group-focus-visible/rail-item:opacity-100 group-data-[collapsed=true]/rail:hidden\"\n >\n {local.shortcut}\n </span>\n </Show>\n </button>\n\n <Show when={tip()}>\n {(position) => (\n <Portal>\n <div\n aria-hidden=\"true\"\n data-slot=\"side-rail-tip\"\n class=\"bg-card text-card-foreground border-border pointer-events-none fixed z-(--z-tooltip) flex items-center gap-2.5 rounded-md border ps-3 pe-3 text-sm font-medium whitespace-nowrap shadow-lg\"\n style={{\n top: `${position().top}px`,\n left: `${position().left}px`,\n height: `${position().height}px`,\n }}\n >\n <span class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\">\n {local.children}\n </span>\n {local.label}\n </div>\n </Portal>\n )}\n </Show>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiCA,SAAgBiB,SAA2CC,OAAyB;CAClF,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAwB;EACvD;EACA;EACA;EACA;CAAU,CACX;CAED,MAAMF,kBAAkBG,MAAMH,aAAa;CAC3C,MAAMK,QAAQT,oBACZI,WACAV,iBAAkBU,UAAU,IAAI,sBAAsB,4BAA6B,CACrF;CAEA,OAAAM,gBACGX,gBAAgBY,UAAQ;EAAQF;EAAK,IAAAG,WAAA;GAAA,OAAAF,gBACnCtB,aAAWyB,WAAA;IACVC,IAAE;IAAA,KAAA,gBAAA;KAAA,OACUP,MAAM,iBAAiB;IAAS;IAAA,KAAA,oBAAA;KAAA,OAI5BH,UAAU,IAAI,SAAS;IAAO;IAAA,KAAA,WAAA;KAAA,OACvCN,GACL,8GACA,4CACA;MAAE,UAAUM,UAAU;MAAG,mBAAmB,CAACA,UAAU;KAAE,GACzDG,MAAMJ,KACR;IAAC;GAAA,GACIK,MAA6B,EAAA,IAAAI,WAAA;IAAA,OAEjCL,MAAMK;GAAQ,EAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAIvB;;AAGA,SAAgBK,eAAeX,OAA8B;CAC3D,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,OAAO,CAA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