@ds-mo/ui 12.6.0 → 12.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/.build-stamp +1 -1
  2. package/dist/agent-patterns.json +1 -1
  3. package/dist/agent.json +7 -6
  4. package/dist/components/ds-agent-response.js +1 -1
  5. package/dist/components/ds-bar-nav.js +1 -1
  6. package/dist/components/ds-bar-nav.js.map +1 -1
  7. package/dist/components/ds-bar-title.js +1 -1
  8. package/dist/components/ds-bar-title.js.map +1 -1
  9. package/dist/components/ds-bar-workflow.js +1 -1
  10. package/dist/components/ds-breadcrumb.js +1 -1
  11. package/dist/components/ds-button-filled.js +1 -1
  12. package/dist/components/ds-button-unfilled.js +1 -1
  13. package/dist/components/ds-card-data-viz-bar.js +1 -1
  14. package/dist/components/ds-card-data-viz-donut.js +1 -1
  15. package/dist/components/ds-card-data-viz-line.js +1 -1
  16. package/dist/components/ds-card-setting.js +1 -1
  17. package/dist/components/ds-chart-legend.js +1 -1
  18. package/dist/components/ds-chart-legend.js.map +1 -1
  19. package/dist/components/ds-checkbox.js +1 -1
  20. package/dist/components/ds-chip.js +1 -1
  21. package/dist/components/ds-chip.js.map +1 -1
  22. package/dist/components/ds-code-block.js +1 -1
  23. package/dist/components/ds-conversation-list-item.js +1 -1
  24. package/dist/components/ds-conversation-list-item.js.map +1 -1
  25. package/dist/components/ds-input.js +1 -1
  26. package/dist/components/ds-input.js.map +1 -1
  27. package/dist/components/ds-markdown.js +1 -1
  28. package/dist/components/ds-menu.js +1 -1
  29. package/dist/components/ds-message-composer.js +1 -1
  30. package/dist/components/ds-message-scroller.js +1 -1
  31. package/dist/components/ds-mobile-bar-nav.js +1 -1
  32. package/dist/components/ds-mobile-bar-nav.js.map +1 -1
  33. package/dist/components/ds-mobile-header.js +1 -1
  34. package/dist/components/ds-mobile-section-switcher.js +1 -1
  35. package/dist/components/ds-mobile-sheet-nav.js +1 -1
  36. package/dist/components/ds-mobile-sheet-nav.js.map +1 -1
  37. package/dist/components/ds-modal.js +1 -1
  38. package/dist/components/ds-panel-nav.js +1 -1
  39. package/dist/components/ds-panel-nav.js.map +1 -1
  40. package/dist/components/ds-panel-sub-nav.js +1 -1
  41. package/dist/components/ds-panel-sub-nav.js.map +1 -1
  42. package/dist/components/ds-panel-tool-header.js +1 -1
  43. package/dist/components/ds-panel-tool-search.js +1 -1
  44. package/dist/components/ds-panel-tools.js +1 -1
  45. package/dist/components/ds-radio.js +1 -1
  46. package/dist/components/ds-radio.js.map +1 -1
  47. package/dist/components/ds-select-multi.js +1 -1
  48. package/dist/components/ds-select-multi.js.map +1 -1
  49. package/dist/components/ds-select.js +1 -1
  50. package/dist/components/ds-select.js.map +1 -1
  51. package/dist/components/ds-shell-gradient-picker.js +1 -1
  52. package/dist/components/ds-shell-gradient-swatch.js +1 -1
  53. package/dist/components/ds-shell-gradient-swatch.js.map +1 -1
  54. package/dist/components/ds-shell-tools.js +1 -1
  55. package/dist/components/ds-shell-tools.js.map +1 -1
  56. package/dist/components/ds-swatch-picker.js +1 -1
  57. package/dist/components/ds-switch.js +1 -1
  58. package/dist/components/ds-tab-group.js +1 -1
  59. package/dist/components/ds-tag.js +1 -1
  60. package/dist/components/ds-tag.js.map +1 -1
  61. package/dist/components/ds-toast.js +1 -1
  62. package/dist/components/ds-toast.js.map +1 -1
  63. package/dist/components/p-4h7vAqyJ.js +2 -0
  64. package/dist/components/p-4h7vAqyJ.js.map +1 -0
  65. package/dist/components/p-6WdUnsGC.js +2 -0
  66. package/dist/components/{p-DD1Lgs7O.js.map → p-6WdUnsGC.js.map} +1 -1
  67. package/dist/components/p-BdPaDhDe.js +2 -0
  68. package/dist/components/p-BdPaDhDe.js.map +1 -0
  69. package/dist/components/{p-CICGtu7H.js → p-BqPLwCrR.js} +2 -2
  70. package/dist/components/{p-D4o2D1hk.js → p-CKGlB6Ow.js} +2 -2
  71. package/dist/components/p-CPK5Tgae.js +2 -0
  72. package/dist/components/{p-DTea1Du7.js.map → p-CPK5Tgae.js.map} +1 -1
  73. package/dist/components/p-CUWxI1u0.js +2 -0
  74. package/dist/components/{p-CXcjwduV.js.map → p-CUWxI1u0.js.map} +1 -1
  75. package/dist/components/p-D65itwnc.js +2 -0
  76. package/dist/components/{p-DcFfilOX.js.map → p-D65itwnc.js.map} +1 -1
  77. package/dist/components/p-DikRzG5f.js +2 -0
  78. package/dist/components/{p-YtgcuJYx.js.map → p-DikRzG5f.js.map} +1 -1
  79. package/dist/components/{p-DvVW0hxm.js → p-Dq1vMuJb.js} +2 -2
  80. package/dist/components/{p-CvKKmZJj.js → p-DzRBKJ2L.js} +2 -2
  81. package/dist/components/p-P5BMmQAc.js +2 -0
  82. package/dist/components/{p-CFpWrYAH.js.map → p-P5BMmQAc.js.map} +1 -1
  83. package/dist/components/{p-D9iN80yX.js → p-hLPTSGdo.js} +2 -2
  84. package/dist/components/p-rsIOpkzV.js +2 -0
  85. package/dist/components/{p-46nk9-RO.js.map → p-rsIOpkzV.js.map} +1 -1
  86. package/dist/docs/components.json +2 -2
  87. package/dist/mcp-data/registry/menu.json +7 -7
  88. package/dist/mcp-data/registry/mobile-bar-nav.json +2 -2
  89. package/dist/mcp-data/registry/mobile-section-switcher.json +3 -2
  90. package/dist/mcp-data/registry/registry.json +6 -5
  91. package/dist/mcp-data/registry/toast.json +1 -1
  92. package/dist/types/components/Menu/Menu.d.ts +1 -1
  93. package/dist/types/components.d.ts +2 -2
  94. package/package.json +1 -1
  95. package/dist/components/p--bSkr_yn.js +0 -2
  96. package/dist/components/p--bSkr_yn.js.map +0 -1
  97. package/dist/components/p-46nk9-RO.js +0 -2
  98. package/dist/components/p-CFpWrYAH.js +0 -2
  99. package/dist/components/p-CXcjwduV.js +0 -2
  100. package/dist/components/p-DD1Lgs7O.js +0 -2
  101. package/dist/components/p-DTea1Du7.js +0 -2
  102. package/dist/components/p-DcFfilOX.js +0 -2
  103. package/dist/components/p-YtgcuJYx.js +0 -2
  104. package/dist/components/p-loq_--ce.js +0 -2
  105. package/dist/components/p-loq_--ce.js.map +0 -1
  106. /package/dist/components/{p-CICGtu7H.js.map → p-BqPLwCrR.js.map} +0 -0
  107. /package/dist/components/{p-D4o2D1hk.js.map → p-CKGlB6Ow.js.map} +0 -0
  108. /package/dist/components/{p-DvVW0hxm.js.map → p-Dq1vMuJb.js.map} +0 -0
  109. /package/dist/components/{p-CvKKmZJj.js.map → p-DzRBKJ2L.js.map} +0 -0
  110. /package/dist/components/{p-D9iN80yX.js.map → p-hLPTSGdo.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["flattenSwatchPickerOptions","options","sections","length","flatMap","section","resolveSwatchPickerTabIndex","value","selectedIndex","findIndex","option","isInactive","resolveSwatchPickerNavigationIndex","currentIndex","key","enabledIndexes","map","index","filter","direction","currentEnabledIndex","indexOf","normalizeSwatchPickerOpacity","opacity","undefined","Number","isFinite","Math","min","max","swatchPickerCss","SwatchPicker","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","groupLabel","activeOptions","selectOption","dsChange","emit","focusOption","requestAnimationFrame","optionButtons","el","querySelectorAll","focus","handleOptionKeyDown","event","includes","nextIndex","preventDefault","nextOption","renderOption","tabIndex","selected","preview","h","type","class","style","backgroundColor","backgroundImage","String","role","label","disabled","onClick","onKeyDown","render","optionIndex","Host","sectionIndex"],"sources":["src/wc/components/SwatchPicker/swatch-picker-types.ts","src/wc/components/SwatchPicker/SwatchPicker.css?tag=ds-swatch-picker&encapsulation=scoped","src/wc/components/SwatchPicker/SwatchPicker.tsx"],"sourcesContent":["export interface SwatchPickerPreview {\n /** CSS color used as the swatch base or as a complete flat-color preview. */\n backgroundColor?: string;\n /** CSS gradient used as the swatch image. */\n backgroundImage?: string;\n /** Optional preview-layer opacity, clamped to the inclusive 0–1 range. */\n opacity?: number;\n}\n\nexport interface SwatchPickerOption {\n /** Stable value emitted when this option is selected. */\n value: string;\n /** Accessible option name; the visual preview never replaces this label. */\n label: string;\n preview: SwatchPickerPreview;\n isInactive?: boolean;\n}\n\nexport interface SwatchPickerSection {\n /** Sections remain one radio group and are separated visually. */\n options: SwatchPickerOption[];\n}\n\nexport type SwatchPickerNavigationKey =\n | 'ArrowDown'\n | 'ArrowLeft'\n | 'ArrowRight'\n | 'ArrowUp'\n | 'Home'\n | 'End';\n\nexport function flattenSwatchPickerOptions(\n options: readonly SwatchPickerOption[],\n sections: readonly SwatchPickerSection[],\n): SwatchPickerOption[] {\n return sections.length > 0\n ? sections.flatMap(section => section.options)\n : [...options];\n}\n\nexport function resolveSwatchPickerTabIndex(\n options: readonly SwatchPickerOption[],\n value: string,\n): number {\n const selectedIndex = options.findIndex(option => (\n option.value === value && !option.isInactive\n ));\n if (selectedIndex >= 0) return selectedIndex;\n return options.findIndex(option => !option.isInactive);\n}\n\nexport function resolveSwatchPickerNavigationIndex(\n options: readonly SwatchPickerOption[],\n currentIndex: number,\n key: SwatchPickerNavigationKey,\n): number | null {\n const enabledIndexes = options\n .map((option, index) => ({ option, index }))\n .filter(({ option }) => !option.isInactive)\n .map(({ index }) => index);\n\n if (enabledIndexes.length === 0) return null;\n if (key === 'Home') return enabledIndexes[0];\n if (key === 'End') return enabledIndexes[enabledIndexes.length - 1];\n\n const direction = key === 'ArrowRight' || key === 'ArrowDown' ? 1 : -1;\n const currentEnabledIndex = enabledIndexes.indexOf(currentIndex);\n if (currentEnabledIndex < 0) {\n return direction > 0\n ? enabledIndexes[0]\n : enabledIndexes[enabledIndexes.length - 1];\n }\n\n return enabledIndexes[\n (currentEnabledIndex + direction + enabledIndexes.length) % enabledIndexes.length\n ];\n}\n\nexport function normalizeSwatchPickerOpacity(opacity: number | undefined): number {\n if (opacity === undefined || !Number.isFinite(opacity)) return 1;\n return Math.min(1, Math.max(0, opacity));\n}\n","@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n\n:host {\n box-sizing: border-box;\n display: block;\n width: 100%;\n --_swatch-inner-inset: calc(\n var(--dimension-stroke-width-025) + var(--dimension-space-025)\n );\n --_swatch-ring-bg: var(--color-background-primary);\n --_swatch-select-motion: var(--effect-motion-short-3);\n}\n\n.swatch-picker {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n width: 100%;\n min-height: var(--dimension-size-400);\n gap: var(--dimension-space-100);\n padding: var(--dimension-space-100);\n}\n\n.swatch-picker__option {\n position: relative;\n box-sizing: border-box;\n flex: 0 0 auto;\n width: var(--dimension-size-300);\n height: var(--dimension-size-300);\n padding: 0;\n border: none;\n border-radius: var(--dimension-radius-half);\n background: transparent;\n cursor: pointer;\n isolation: isolate;\n}\n\n.swatch-picker__fill,\n.swatch-picker__border,\n.swatch-picker__interaction,\n.swatch-picker__halo,\n.swatch-picker__stroke {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n}\n\n.swatch-picker__fill {\n z-index: 1;\n background-color: var(--_swatch-preview-color);\n background-image: var(--_swatch-preview-image);\n background-repeat: no-repeat;\n background-position: center;\n background-size: cover;\n opacity: var(--_swatch-preview-opacity);\n transition:\n inset var(--_swatch-select-motion);\n}\n\n.swatch-picker__border {\n z-index: 2;\n box-shadow: inset 0 0 0 var(--dimension-stroke-width-012) var(--color-border-secondary);\n transition:\n inset var(--_swatch-select-motion);\n}\n\n.swatch-picker__interaction {\n z-index: 3;\n background-color: transparent;\n transition:\n inset var(--_swatch-select-motion),\n background-color 0s;\n}\n\n.swatch-picker__option:hover:not(:disabled) .swatch-picker__interaction {\n background-color: var(--color-interaction-hover);\n}\n\n.swatch-picker__option:active:not(:disabled) .swatch-picker__interaction {\n background-color: var(--color-interaction-pressed);\n}\n\n.swatch-picker__halo,\n.swatch-picker__stroke {\n opacity: 0;\n transform: scale(1.2);\n transform-origin: center;\n transition:\n opacity var(--_swatch-select-motion),\n transform var(--_swatch-select-motion);\n}\n\n.swatch-picker__halo {\n z-index: 4;\n box-shadow: inset 0 0 0 var(--_swatch-inner-inset) var(--_swatch-ring-bg);\n}\n\n.swatch-picker__stroke {\n z-index: 5;\n box-shadow: inset 0 0 0 var(--dimension-stroke-width-025) var(--color-border-bold-brand);\n}\n\n.swatch-picker__option--selected .swatch-picker__fill,\n.swatch-picker__option--selected .swatch-picker__border,\n.swatch-picker__option--selected .swatch-picker__interaction {\n inset: var(--_swatch-inner-inset);\n}\n\n.swatch-picker__option--selected .swatch-picker__halo,\n.swatch-picker__option--selected .swatch-picker__stroke {\n opacity: 1;\n transform: scale(1);\n}\n\n.swatch-picker__divider {\n flex: 0 0 auto;\n align-self: center;\n width: var(--dimension-stroke-width-012);\n height: var(--dimension-size-300);\n background-color: var(--color-border-tertiary);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .swatch-picker__fill,\n .swatch-picker__border,\n .swatch-picker__interaction,\n .swatch-picker__halo,\n .swatch-picker__stroke {\n transition: none;\n }\n}\n","import { Component, Element, Event, EventEmitter, Prop, h, Host } from '@stencil/core';\nimport {\n flattenSwatchPickerOptions,\n normalizeSwatchPickerOpacity,\n resolveSwatchPickerNavigationIndex,\n resolveSwatchPickerTabIndex,\n type SwatchPickerNavigationKey,\n type SwatchPickerOption,\n type SwatchPickerSection,\n} from './swatch-picker-types';\n\n@Component({\n tag: 'ds-swatch-picker',\n styleUrl: 'SwatchPicker.css',\n scoped: true,\n})\nexport class SwatchPicker {\n @Element() el!: HTMLElement;\n\n /** Selected option value. */\n @Prop({ mutable: true, reflect: true }) value: string = '';\n\n /** Flat option list. Sections take precedence when supplied. Assign as a JavaScript property. */\n @Prop() options: SwatchPickerOption[] = [];\n\n /** Visually separated option groups that remain one radio group. Assign as a JavaScript property. */\n @Prop() sections: SwatchPickerSection[] = [];\n\n /** Accessible name for the complete one-of-many choice. */\n @Prop() groupLabel: string = 'Swatch options';\n\n @Event() dsChange!: EventEmitter<string>;\n\n private get activeOptions(): SwatchPickerOption[] {\n return flattenSwatchPickerOptions(this.options, this.sections);\n }\n\n private selectOption(option: SwatchPickerOption) {\n if (option.isInactive || option.value === this.value) return;\n this.value = option.value;\n this.dsChange.emit(option.value);\n }\n\n private focusOption(index: number) {\n requestAnimationFrame(() => {\n const optionButtons = this.el\n .querySelectorAll<HTMLButtonElement>('.swatch-picker__option');\n optionButtons[index]?.focus();\n });\n }\n\n private handleOptionKeyDown(\n event: KeyboardEvent,\n currentIndex: number,\n ) {\n const key = event.key as SwatchPickerNavigationKey;\n if (!['ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'Home', 'End'].includes(key)) {\n return;\n }\n\n const nextIndex = resolveSwatchPickerNavigationIndex(\n this.activeOptions,\n currentIndex,\n key,\n );\n if (nextIndex === null) return;\n\n event.preventDefault();\n const nextOption = this.activeOptions[nextIndex];\n this.selectOption(nextOption);\n this.focusOption(nextIndex);\n }\n\n private renderOption(\n option: SwatchPickerOption,\n index: number,\n tabIndex: number,\n ) {\n const selected = option.value === this.value;\n const opacity = normalizeSwatchPickerOpacity(option.preview.opacity);\n\n return (\n <button\n key={option.value}\n type=\"button\"\n class={{\n 'swatch-picker__option': true,\n 'swatch-picker__option--selected': selected,\n 'ds-focus-ring-inset': true,\n 'ds-control-inactive': !!option.isInactive,\n }}\n style={{\n '--_swatch-preview-color': option.preview.backgroundColor ?? 'var(--color-background-secondary)',\n '--_swatch-preview-image': option.preview.backgroundImage ?? 'none',\n '--_swatch-preview-opacity': String(opacity),\n }}\n role=\"radio\"\n aria-label={option.label}\n aria-checked={selected ? 'true' : 'false'}\n tabIndex={index === tabIndex ? 0 : -1}\n disabled={option.isInactive}\n onClick={() => this.selectOption(option)}\n onKeyDown={(event: KeyboardEvent) => this.handleOptionKeyDown(event, index)}\n >\n <span class=\"swatch-picker__fill\" aria-hidden=\"true\" />\n <span class=\"swatch-picker__border\" aria-hidden=\"true\" />\n <span class=\"swatch-picker__interaction\" aria-hidden=\"true\" />\n <span class=\"swatch-picker__halo\" aria-hidden=\"true\" />\n <span class=\"swatch-picker__stroke\" aria-hidden=\"true\" />\n </button>\n );\n }\n\n render() {\n const activeOptions = this.activeOptions;\n const tabIndex = resolveSwatchPickerTabIndex(activeOptions, this.value);\n let optionIndex = 0;\n\n return (\n <Host>\n <div\n class=\"swatch-picker\"\n role=\"radiogroup\"\n aria-label={this.groupLabel}\n >\n {(this.sections.length > 0 ? this.sections : [{ options: this.options }]).map((section, sectionIndex) => [\n section.options.map(option => {\n const currentIndex = optionIndex++;\n return this.renderOption(option, currentIndex, tabIndex);\n }),\n sectionIndex < (this.sections.length > 0 ? this.sections.length : 1) - 1 && (\n <span class=\"swatch-picker__divider\" aria-hidden=\"true\" />\n ),\n ])}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"names":["flattenSwatchPickerOptions","options","sections","length","flatMap","section","resolveSwatchPickerTabIndex","value","selectedIndex","findIndex","option","isInactive","resolveSwatchPickerNavigationIndex","currentIndex","key","enabledIndexes","map","index","filter","direction","currentEnabledIndex","indexOf","normalizeSwatchPickerOpacity","opacity","undefined","Number","isFinite","Math","min","max","swatchPickerCss","SwatchPicker","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","groupLabel","activeOptions","selectOption","dsChange","emit","focusOption","requestAnimationFrame","optionButtons","el","querySelectorAll","focus","handleOptionKeyDown","event","includes","nextIndex","preventDefault","nextOption","renderOption","tabIndex","selected","preview","h","type","class","style","backgroundColor","backgroundImage","String","role","label","disabled","onClick","onKeyDown","render","optionIndex","Host","sectionIndex"],"sources":["src/wc/components/SwatchPicker/swatch-picker-types.ts","src/wc/components/SwatchPicker/SwatchPicker.css?tag=ds-swatch-picker&encapsulation=scoped","src/wc/components/SwatchPicker/SwatchPicker.tsx"],"sourcesContent":["export interface SwatchPickerPreview {\n /** CSS color used as the swatch base or as a complete flat-color preview. */\n backgroundColor?: string;\n /** CSS gradient used as the swatch image. */\n backgroundImage?: string;\n /** Optional preview-layer opacity, clamped to the inclusive 0–1 range. */\n opacity?: number;\n}\n\nexport interface SwatchPickerOption {\n /** Stable value emitted when this option is selected. */\n value: string;\n /** Accessible option name; the visual preview never replaces this label. */\n label: string;\n preview: SwatchPickerPreview;\n isInactive?: boolean;\n}\n\nexport interface SwatchPickerSection {\n /** Sections remain one radio group and are separated visually. */\n options: SwatchPickerOption[];\n}\n\nexport type SwatchPickerNavigationKey =\n | 'ArrowDown'\n | 'ArrowLeft'\n | 'ArrowRight'\n | 'ArrowUp'\n | 'Home'\n | 'End';\n\nexport function flattenSwatchPickerOptions(\n options: readonly SwatchPickerOption[],\n sections: readonly SwatchPickerSection[],\n): SwatchPickerOption[] {\n return sections.length > 0\n ? sections.flatMap(section => section.options)\n : [...options];\n}\n\nexport function resolveSwatchPickerTabIndex(\n options: readonly SwatchPickerOption[],\n value: string,\n): number {\n const selectedIndex = options.findIndex(option => (\n option.value === value && !option.isInactive\n ));\n if (selectedIndex >= 0) return selectedIndex;\n return options.findIndex(option => !option.isInactive);\n}\n\nexport function resolveSwatchPickerNavigationIndex(\n options: readonly SwatchPickerOption[],\n currentIndex: number,\n key: SwatchPickerNavigationKey,\n): number | null {\n const enabledIndexes = options\n .map((option, index) => ({ option, index }))\n .filter(({ option }) => !option.isInactive)\n .map(({ index }) => index);\n\n if (enabledIndexes.length === 0) return null;\n if (key === 'Home') return enabledIndexes[0];\n if (key === 'End') return enabledIndexes[enabledIndexes.length - 1];\n\n const direction = key === 'ArrowRight' || key === 'ArrowDown' ? 1 : -1;\n const currentEnabledIndex = enabledIndexes.indexOf(currentIndex);\n if (currentEnabledIndex < 0) {\n return direction > 0\n ? enabledIndexes[0]\n : enabledIndexes[enabledIndexes.length - 1];\n }\n\n return enabledIndexes[\n (currentEnabledIndex + direction + enabledIndexes.length) % enabledIndexes.length\n ];\n}\n\nexport function normalizeSwatchPickerOpacity(opacity: number | undefined): number {\n if (opacity === undefined || !Number.isFinite(opacity)) return 1;\n return Math.min(1, Math.max(0, opacity));\n}\n","@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n\n:host {\n box-sizing: border-box;\n display: block;\n width: 100%;\n --_swatch-inner-inset: calc(\n var(--dimension-stroke-width-025) + var(--dimension-space-025)\n );\n --_swatch-ring-bg: var(--color-background-primary);\n --_swatch-select-motion: var(--effect-motion-short-3);\n}\n\n.swatch-picker {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n width: 100%;\n min-height: var(--dimension-size-400);\n gap: var(--dimension-space-100);\n padding: var(--dimension-space-100);\n}\n\n.swatch-picker__option {\n position: relative;\n box-sizing: border-box;\n flex: 0 0 auto;\n width: var(--dimension-size-300);\n height: var(--dimension-size-300);\n padding: 0;\n border: none;\n border-radius: var(--dimension-radius-half);\n background: transparent;\n cursor: pointer;\n isolation: isolate;\n}\n\n.swatch-picker__fill,\n.swatch-picker__border,\n.swatch-picker__interaction,\n.swatch-picker__halo,\n.swatch-picker__stroke {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n}\n\n.swatch-picker__fill {\n z-index: 1;\n background-color: var(--_swatch-preview-color);\n background-image: var(--_swatch-preview-image);\n background-repeat: no-repeat;\n background-position: center;\n background-size: cover;\n opacity: var(--_swatch-preview-opacity);\n transition:\n inset var(--_swatch-select-motion);\n}\n\n.swatch-picker__border {\n z-index: 2;\n box-shadow: inset 0 0 0 var(--dimension-stroke-width-012) var(--color-border-secondary);\n transition:\n inset var(--_swatch-select-motion);\n}\n\n.swatch-picker__interaction {\n z-index: 3;\n background-color: transparent;\n transition:\n inset var(--_swatch-select-motion),\n background-color 0s;\n}\n\n.swatch-picker__option:hover:not(:disabled) .swatch-picker__interaction {\n background-color: var(--color-interaction-hover);\n}\n\n.swatch-picker__option:active:not(:disabled) .swatch-picker__interaction {\n background-color: var(--color-interaction-pressed);\n}\n\n.swatch-picker__halo,\n.swatch-picker__stroke {\n opacity: 0;\n transform: scale(1.2);\n transform-origin: center;\n transition:\n opacity var(--_swatch-select-motion),\n transform var(--_swatch-select-motion);\n}\n\n.swatch-picker__halo {\n z-index: 4;\n box-shadow: inset 0 0 0 var(--_swatch-inner-inset) var(--_swatch-ring-bg);\n}\n\n.swatch-picker__stroke {\n z-index: 5;\n box-shadow: inset 0 0 0 var(--dimension-stroke-width-025) var(--color-border-bold-brand);\n}\n\n.swatch-picker__option--selected .swatch-picker__fill,\n.swatch-picker__option--selected .swatch-picker__border,\n.swatch-picker__option--selected .swatch-picker__interaction {\n inset: var(--_swatch-inner-inset);\n}\n\n.swatch-picker__option--selected .swatch-picker__halo,\n.swatch-picker__option--selected .swatch-picker__stroke {\n opacity: 1;\n transform: scale(1);\n}\n\n.swatch-picker__divider {\n flex: 0 0 auto;\n align-self: center;\n width: var(--dimension-stroke-width-012);\n height: var(--dimension-size-300);\n background-color: var(--color-border-tertiary);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .swatch-picker__fill,\n .swatch-picker__border,\n .swatch-picker__interaction,\n .swatch-picker__halo,\n .swatch-picker__stroke {\n transition: none;\n }\n}\n","import { Component, Element, Event, EventEmitter, Prop, h, Host } from '@stencil/core';\nimport {\n flattenSwatchPickerOptions,\n normalizeSwatchPickerOpacity,\n resolveSwatchPickerNavigationIndex,\n resolveSwatchPickerTabIndex,\n type SwatchPickerNavigationKey,\n type SwatchPickerOption,\n type SwatchPickerSection,\n} from './swatch-picker-types';\n\n@Component({\n tag: 'ds-swatch-picker',\n styleUrl: 'SwatchPicker.css',\n scoped: true,\n})\nexport class SwatchPicker {\n @Element() el!: HTMLElement;\n\n /** Selected option value. */\n @Prop({ mutable: true, reflect: true }) value: string = '';\n\n /** Flat option list. Sections take precedence when supplied. Assign as a JavaScript property. */\n @Prop() options: SwatchPickerOption[] = [];\n\n /** Visually separated option groups that remain one radio group. Assign as a JavaScript property. */\n @Prop() sections: SwatchPickerSection[] = [];\n\n /** Accessible name for the complete one-of-many choice. */\n @Prop() groupLabel: string = 'Swatch options';\n\n @Event() dsChange!: EventEmitter<string>;\n\n private get activeOptions(): SwatchPickerOption[] {\n return flattenSwatchPickerOptions(this.options, this.sections);\n }\n\n private selectOption(option: SwatchPickerOption) {\n if (option.isInactive || option.value === this.value) return;\n this.value = option.value;\n this.dsChange.emit(option.value);\n }\n\n private focusOption(index: number) {\n requestAnimationFrame(() => {\n const optionButtons = this.el\n .querySelectorAll<HTMLButtonElement>('.swatch-picker__option');\n optionButtons[index]?.focus();\n });\n }\n\n private handleOptionKeyDown(\n event: KeyboardEvent,\n currentIndex: number,\n ) {\n const key = event.key as SwatchPickerNavigationKey;\n if (!['ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'Home', 'End'].includes(key)) {\n return;\n }\n\n const nextIndex = resolveSwatchPickerNavigationIndex(\n this.activeOptions,\n currentIndex,\n key,\n );\n if (nextIndex === null) return;\n\n event.preventDefault();\n const nextOption = this.activeOptions[nextIndex];\n this.selectOption(nextOption);\n this.focusOption(nextIndex);\n }\n\n private renderOption(\n option: SwatchPickerOption,\n index: number,\n tabIndex: number,\n ) {\n const selected = option.value === this.value;\n const opacity = normalizeSwatchPickerOpacity(option.preview.opacity);\n\n return (\n <button\n key={option.value}\n type=\"button\"\n class={{\n 'swatch-picker__option': true,\n 'swatch-picker__option--selected': selected,\n 'ds-focus-ring-inset': true,\n 'ds-control-inactive': !!option.isInactive,\n }}\n style={{\n '--_swatch-preview-color': option.preview.backgroundColor ?? 'var(--color-background-secondary)',\n '--_swatch-preview-image': option.preview.backgroundImage ?? 'none',\n '--_swatch-preview-opacity': String(opacity),\n }}\n role=\"radio\"\n aria-label={option.label}\n aria-checked={selected ? 'true' : 'false'}\n tabIndex={index === tabIndex ? 0 : -1}\n disabled={option.isInactive}\n onClick={() => this.selectOption(option)}\n onKeyDown={(event: KeyboardEvent) => this.handleOptionKeyDown(event, index)}\n >\n <span class=\"swatch-picker__fill\" aria-hidden=\"true\" />\n <span class=\"swatch-picker__border\" aria-hidden=\"true\" />\n <span class=\"swatch-picker__interaction\" aria-hidden=\"true\" />\n <span class=\"swatch-picker__halo\" aria-hidden=\"true\" />\n <span class=\"swatch-picker__stroke\" aria-hidden=\"true\" />\n </button>\n );\n }\n\n render() {\n const activeOptions = this.activeOptions;\n const tabIndex = resolveSwatchPickerTabIndex(activeOptions, this.value);\n let optionIndex = 0;\n\n return (\n <Host>\n <div\n class=\"swatch-picker\"\n role=\"radiogroup\"\n aria-label={this.groupLabel}\n >\n {(this.sections.length > 0 ? this.sections : [{ options: this.options }]).map((section, sectionIndex) => [\n section.options.map(option => {\n const currentIndex = optionIndex++;\n return this.renderOption(option, currentIndex, tabIndex);\n }),\n sectionIndex < (this.sections.length > 0 ? this.sections.length : 1) - 1 && (\n <span class=\"swatch-picker__divider\" aria-hidden=\"true\" />\n ),\n ])}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"6DA+BM,SAAUA,EACdC,EACAC,GAEA,OAAOA,EAASC,OAAS,EACrBD,EAASE,SAAQC,GAAWA,EAAQJ,UACpC,IAAIA,EACV,CAEM,SAAUK,EACdL,EACAM,GAEA,MAAMC,EAAgBP,EAAQQ,WAAUC,GACtCA,EAAOH,QAAUA,IAAUG,EAAOC,aAEpC,GAAIH,GAAiB,EAAG,OAAOA,EAC/B,OAAOP,EAAQQ,WAAUC,IAAWA,EAAOC,YAC7C,C,SAEgBC,EACdX,EACAY,EACAC,GAEA,MAAMC,EAAiBd,EACpBe,KAAI,CAACN,EAAQO,KAAK,CAAQP,SAAQO,YAClCC,QAAO,EAAGR,aAAcA,EAAOC,aAC/BK,KAAI,EAAGC,WAAYA,IAEtB,GAAIF,EAAeZ,SAAW,EAAG,OAAO,KACxC,GAAIW,IAAQ,OAAQ,OAAOC,EAAe,GAC1C,GAAID,IAAQ,MAAO,OAAOC,EAAeA,EAAeZ,OAAS,GAEjE,MAAMgB,EAAYL,IAAQ,cAAgBA,IAAQ,YAAc,GAAI,EACpE,MAAMM,EAAsBL,EAAeM,QAAQR,GACnD,GAAIO,EAAsB,EAAG,CAC3B,OAAOD,EAAY,EACfJ,EAAe,GACfA,EAAeA,EAAeZ,OAAS,E,CAG7C,OAAOY,GACJK,EAAsBD,EAAYJ,EAAeZ,QAAUY,EAAeZ,OAE/E,CAEM,SAAUmB,EAA6BC,GAC3C,GAAIA,IAAYC,YAAcC,OAAOC,SAASH,GAAU,OAAO,EAC/D,OAAOI,KAAKC,IAAI,EAAGD,KAAKE,IAAI,EAAGN,GACjC,CCjFA,MAAMO,EAAkB,IAAM,ysK,MCgBjBC,EAAYC,EAAA,MAAAD,UAAAE,EALzB,WAAAC,CAAAC,G,6EAS0CC,KAAA7B,MAAgB,GAGhD6B,KAAAnC,QAAgC,GAGhCmC,KAAAlC,SAAkC,GAGlCkC,KAAAC,WAAqB,gBA6G9B,CAzGC,iBAAYC,GACV,OAAOtC,EAA2BoC,KAAKnC,QAASmC,KAAKlC,S,CAG/C,YAAAqC,CAAa7B,GACnB,GAAIA,EAAOC,YAAcD,EAAOH,QAAU6B,KAAK7B,MAAO,OACtD6B,KAAK7B,MAAQG,EAAOH,MACpB6B,KAAKI,SAASC,KAAK/B,EAAOH,M,CAGpB,WAAAmC,CAAYzB,GAClB0B,uBAAsB,KACpB,MAAMC,EAAgBR,KAAKS,GACxBC,iBAAoC,0BACvCF,EAAc3B,IAAQ8B,OAAO,G,CAIzB,mBAAAC,CACNC,EACApC,GAEA,MAAMC,EAAMmC,EAAMnC,IAClB,IAAK,CAAC,YAAa,YAAa,aAAc,UAAW,OAAQ,OAAOoC,SAASpC,GAAM,CACrF,M,CAGF,MAAMqC,EAAYvC,EAChBwB,KAAKE,cACLzB,EACAC,GAEF,GAAIqC,IAAc,KAAM,OAExBF,EAAMG,iBACN,MAAMC,EAAajB,KAAKE,cAAca,GACtCf,KAAKG,aAAac,GAClBjB,KAAKM,YAAYS,E,CAGX,YAAAG,CACN5C,EACAO,EACAsC,GAEA,MAAMC,EAAW9C,EAAOH,QAAU6B,KAAK7B,MACvC,MAAMgB,EAAUD,EAA6BZ,EAAO+C,QAAQlC,SAE5D,OACEmC,EAAA,UACE5C,IAAKJ,EAAOH,MACZoD,KAAK,SACLC,MAAO,CACL,wBAAyB,KACzB,kCAAmCJ,EACnC,sBAAuB,KACvB,wBAAyB9C,EAAOC,YAElCkD,MAAO,CACL,0BAA2BnD,EAAO+C,QAAQK,iBAAmB,oCAC7D,0BAA2BpD,EAAO+C,QAAQM,iBAAmB,OAC7D,4BAA6BC,OAAOzC,IAEtC0C,KAAK,QAAO,aACAvD,EAAOwD,MAAK,eACVV,EAAW,OAAS,QAClCD,SAAUtC,IAAUsC,EAAW,GAAI,EACnCY,SAAUzD,EAAOC,WACjByD,QAAS,IAAMhC,KAAKG,aAAa7B,GACjC2D,UAAYpB,GAAyBb,KAAKY,oBAAoBC,EAAOhC,IAErEyC,EAAA,QAAME,MAAM,sBAAqB,cAAa,SAC9CF,EAAA,QAAME,MAAM,wBAAuB,cAAa,SAChDF,EAAA,QAAME,MAAM,6BAA4B,cAAa,SACrDF,EAAA,QAAME,MAAM,sBAAqB,cAAa,SAC9CF,EAAA,QAAME,MAAM,wBAAuB,cAAa,S,CAKtD,MAAAU,GACE,MAAMhC,EAAgBF,KAAKE,cAC3B,MAAMiB,EAAWjD,EAA4BgC,EAAeF,KAAK7B,OACjE,IAAIgE,EAAc,EAElB,OACEb,EAACc,EAAI,CAAA1D,IAAA,4CACH4C,EAAA,OAAA5C,IAAA,2CACE8C,MAAM,gBACNK,KAAK,aAAY,aACL7B,KAAKC,aAEfD,KAAKlC,SAASC,OAAS,EAAIiC,KAAKlC,SAAW,CAAC,CAAED,QAASmC,KAAKnC,WAAYe,KAAI,CAACX,EAASoE,IAAiB,CACvGpE,EAAQJ,QAAQe,KAAIN,IAClB,MAAMG,EAAe0D,IACrB,OAAOnC,KAAKkB,aAAa5C,EAAQG,EAAc0C,EAAS,IAE1DkB,GAAgBrC,KAAKlC,SAASC,OAAS,EAAIiC,KAAKlC,SAASC,OAAS,GAAK,GACrEuD,EAAA,QAAME,MAAM,yBAAwB,cAAa,a","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,h as r,a as o,t as a}from"./index.js";import{d}from"./p-CaRyxTMz.js";import{d as n}from"./p-DcFfilOX.js";import{d as t}from"./p-CvKKmZJj.js";import{d as i}from"./p-BAfG3M8z.js";import{d as c}from"./p-Ca-I2UnB.js";import{d as h}from"./p-BwGnhInj.js";import{d as m}from"./p-DWdRSOBV.js";const l=()=>`.sc-ds-markdown:where(.ds-prose){display:block;box-sizing:border-box;max-inline-size:100%;min-inline-size:0;color:inherit;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose) :where(p,ul.sc-ds-markdown,ol.sc-ds-markdown,dl.sc-ds-markdown,blockquote.sc-ds-markdown,figure.sc-ds-markdown,figcaption.sc-ds-markdown,table).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:inherit;font-family:var(--typography-font-family);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative-half)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:var(--color-foreground-primary);font-family:var(--typography-font-family);font-weight:var(--typography-weight-semibold)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl);letter-spacing:var(--typography-letterspacing-negative-double)}.sc-ds-markdown:where(.ds-prose) :where(h3,h4).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose) :where(h5,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose)>.sc-ds-markdown:where(*+*){margin-block-start:var(--dimension-space-150)}.sc-ds-markdown:where(.ds-prose)>:where(*)+:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-200)}.sc-ds-markdown:where(.ds-prose)>:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown+.sc-ds-markdown:where(*){margin-block-start:var(--dimension-space-100)}.sc-ds-markdown:where(.ds-prose) :where(blockquote,li.sc-ds-markdown,dd)>.sc-ds-markdown:where(*+*):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li+li.sc-ds-markdown,dt+dd).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(ul,ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-300)}.sc-ds-markdown:where(.ds-prose) :where(li>ul.sc-ds-markdown,li>ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li>input[type='checkbox']):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-inline-end:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(blockquote):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-150);border-inline-start:var(--dimension-stroke-width-025) solid var(--color-border-secondary);color:var(--color-foreground-secondary)}.sc-ds-markdown:where(.ds-prose) :where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6) .sc-ds-markdown:where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:inherit}.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-brand);text-decoration:underline;text-decoration-color:var(--color-foreground-tertiary)}.sc-ds-markdown:where(.ds-prose) :where(code):not(:where(pre code.sc-ds-markdown,[data-ds-prose='off'].sc-ds-markdown,[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-012) var(--dimension-space-025);border-radius:var(--dimension-radius-025);background:var(--color-background-secondary);font-family:var(--typography-fontfamily-mono);font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none)}.sc-ds-markdown:where(.ds-prose) :where(pre):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{box-sizing:border-box;max-inline-size:100%;min-inline-size:0;margin:0;padding:var(--dimension-space-150);overflow:auto;border-radius:var(--dimension-radius-050);background:var(--color-background-strong-neutral);color:var(--color-foreground-faint-neutral);font-family:var(--typography-fontfamily-mono);font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none);tab-size:2}.sc-ds-markdown:where(.ds-prose) :where(pre code):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:0;background:transparent;color:inherit;font:inherit;letter-spacing:inherit;white-space:pre}.sc-ds-markdown:where(.ds-prose) :where(hr):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;border:0;border-block-start:var(--dimension-stroke-width-012) solid var(--color-border-tertiary)}.sc-ds-markdown:where(.ds-prose__table-scroll){box-sizing:border-box;max-inline-size:100%;min-inline-size:0;overflow-x:auto}.sc-ds-markdown:where(.ds-prose) :where(table):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{inline-size:100%;border-collapse:collapse}.sc-ds-markdown:where(.ds-prose) :where(th,td).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-075);border:var(--dimension-stroke-width-012) solid var(--color-border-tertiary);text-align:start;vertical-align:top;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose) :where(th):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-primary);font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(img,video.sc-ds-markdown,svg).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{max-inline-size:100%;block-size:auto}.sc-ds-markdown:where(.ds-prose) :where(figcaption):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050);color:var(--color-foreground-secondary);font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none)}.sc-ds-markdown-h{display:block;min-width:0;color:inherit;box-sizing:border-box;-webkit-user-select:text;user-select:text}`;let w;function p(){w??(w=Promise.all([import("./p-BjtXYFhw.js"),import("./p-DVsje4AY.js"),import("./p-gidVv1FX.js")]).then((([e,s,r])=>({fromMarkdown:e.fromMarkdown,gfmFromMarkdown:s.gfmFromMarkdown,gfm:r.gfm}))));return w}function f(e){if(!e)return undefined;try{const s=new URL(e,document.baseURI);if(!["http:","https:","mailto:"].includes(s.protocol))return undefined;return s.href}catch{return undefined}}const k=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.content="";this.streaming=false;this.tree=null;this.parseRevision=0}componentWillLoad(){if(typeof document!=="undefined")return this.parse()}disconnectedCallback(){this.parseRevision+=1;if(this.parseFrame&&typeof cancelAnimationFrame==="function"){cancelAnimationFrame(this.parseFrame)}}scheduleParse(){if(typeof requestAnimationFrame!=="function")return;if(this.parseFrame)cancelAnimationFrame(this.parseFrame);this.parseFrame=requestAnimationFrame((()=>{this.parseFrame=undefined;void this.parse()}))}async parse(){const e=++this.parseRevision;try{const{fromMarkdown:s,gfmFromMarkdown:r,gfm:o}=await p();const a=s(this.content,{extensions:[o()],mdastExtensions:[r()]});if(e===this.parseRevision)this.tree=a}catch{if(e===this.parseRevision)this.tree=null}}children(e){if(!("children"in e))return[];return e.children.map((e=>this.renderNode(e)))}renderNode(e){switch(e.type){case"root":return this.children(e);case"text":return r("span",{class:"markdown__text"},e.value);case"paragraph":return r("p",{class:"markdown__paragraph"},this.children(e));case"heading":{const s=`h${e.depth}`;return r(s,{class:"markdown__heading"},this.children(e))}case"strong":return r("strong",{class:"markdown__strong"},this.children(e));case"emphasis":return r("em",{class:"markdown__emphasis"},this.children(e));case"delete":return r("del",{class:"markdown__delete"},this.children(e));case"blockquote":return r("blockquote",{class:"markdown__blockquote"},this.children(e));case"break":return r("br",{class:"markdown__break"});case"thematicBreak":return r("hr",{class:"markdown__thematic-break"});case"inlineCode":return r("code",{class:"markdown__inline-code"},e.value);case"code":return r("ds-code-block",{class:"markdown__code-block","data-ds-prose":"off",code:e.value,language:e.lang??"",filename:e.meta??""});case"link":{const s=f(e.url);return s?r("a",{class:"markdown__link",href:s,target:"_blank",rel:"noopener noreferrer"},this.children(e)):this.children(e)}case"list":{const s=e.ordered?"ol":"ul";return r(s,{class:"markdown__list",start:e.ordered&&e.start?e.start:undefined},this.children(e))}case"listItem":return r("li",{class:"markdown__list-item"},typeof e.checked==="boolean"?r("input",{class:"markdown__task-indicator",type:"checkbox",checked:e.checked,disabled:true,"aria-hidden":"true",tabIndex:-1}):null,this.children(e));case"table":{const[s,...o]=e.children;return r("div",{class:"markdown__table-wrap ds-prose__table-scroll",tabIndex:0},r("table",{class:"markdown__table"},s?r("thead",{class:"markdown__table-head"},r("tr",{class:"markdown__table-row"},s.children.map((e=>r("th",{class:"markdown__table-heading",scope:"col"},this.children(e)))))):null,r("tbody",{class:"markdown__table-body"},o.map((e=>this.renderNode(e))))))}case"tableRow":return r("tr",{class:"markdown__table-row"},this.children(e));case"tableCell":return r("td",{class:"markdown__table-cell"},this.children(e));case"image":{const s=f(e.url);return s?r("a",{class:"markdown__image-link",href:s,target:"_blank",rel:"noopener noreferrer"},e.alt||"View image"):e.alt||null}case"html":case"definition":case"footnoteDefinition":return null;case"footnoteReference":return r("sup",{class:"markdown__footnote"},e.label);default:return this.children(e)}}render(){return r(o,{key:"c51a77a22264def4876ec4acff734200e04e754b","aria-busy":this.streaming?"true":undefined},r("div",{key:"34ec48b089ad8626c4d0c2efa4fb74dc34a3b0e3",class:"markdown ds-prose"},this.tree?this.renderNode(this.tree):r("p",{class:"markdown__paragraph"},r("span",{class:"markdown__text"},this.content))))}static get watchers(){return{content:[{scheduleParse:0}]}}static get style(){return l()}},[2,"ds-markdown",{content:[1],streaming:[4],tree:[32]},undefined,{content:[{scheduleParse:0}]}]);function g(){if(typeof customElements==="undefined"){return}const e=["ds-markdown","ds-badge","ds-button-unfilled","ds-code-block","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-markdown":if(!customElements.get(a(e))){customElements.define(a(e),k)}break;case"ds-badge":if(!customElements.get(a(e))){d()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){n()}break;case"ds-code-block":if(!customElements.get(a(e))){t()}break;case"ds-icon":if(!customElements.get(a(e))){i()}break;case"ds-loader":if(!customElements.get(a(e))){c()}break;case"ds-text":if(!customElements.get(a(e))){h()}break;case"ds-tooltip":if(!customElements.get(a(e))){m()}break}}))}g();export{k as M,g as d};
2
- //# sourceMappingURL=p-D9iN80yX.js.map
1
+ import{p as e,H as s,h as r,a as o,t as a}from"./index.js";import{d}from"./p-CaRyxTMz.js";import{d as n}from"./p-D65itwnc.js";import{d as t}from"./p-DzRBKJ2L.js";import{d as i}from"./p-BAfG3M8z.js";import{d as c}from"./p-Ca-I2UnB.js";import{d as h}from"./p-BwGnhInj.js";import{d as m}from"./p-DWdRSOBV.js";const l=()=>`.sc-ds-markdown:where(.ds-prose){display:block;box-sizing:border-box;max-inline-size:100%;min-inline-size:0;color:inherit;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose) :where(p,ul.sc-ds-markdown,ol.sc-ds-markdown,dl.sc-ds-markdown,blockquote.sc-ds-markdown,figure.sc-ds-markdown,figcaption.sc-ds-markdown,table).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:inherit;font-family:var(--typography-font-family);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative-half)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:var(--color-foreground-primary);font-family:var(--typography-font-family);font-weight:var(--typography-weight-semibold)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl);letter-spacing:var(--typography-letterspacing-negative-double)}.sc-ds-markdown:where(.ds-prose) :where(h3,h4).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose) :where(h5,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose)>.sc-ds-markdown:where(*+*){margin-block-start:var(--dimension-space-150)}.sc-ds-markdown:where(.ds-prose)>:where(*)+:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-200)}.sc-ds-markdown:where(.ds-prose)>:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown+.sc-ds-markdown:where(*){margin-block-start:var(--dimension-space-100)}.sc-ds-markdown:where(.ds-prose) :where(blockquote,li.sc-ds-markdown,dd)>.sc-ds-markdown:where(*+*):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li+li.sc-ds-markdown,dt+dd).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(ul,ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-300)}.sc-ds-markdown:where(.ds-prose) :where(li>ul.sc-ds-markdown,li>ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li>input[type='checkbox']):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-inline-end:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(blockquote):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-150);border-inline-start:var(--dimension-stroke-width-025) solid var(--color-border-secondary);color:var(--color-foreground-secondary)}.sc-ds-markdown:where(.ds-prose) :where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6) .sc-ds-markdown:where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:inherit}.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-brand);text-decoration:underline;text-decoration-color:var(--color-foreground-tertiary)}.sc-ds-markdown:where(.ds-prose) :where(code):not(:where(pre code.sc-ds-markdown,[data-ds-prose='off'].sc-ds-markdown,[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-012) var(--dimension-space-025);border-radius:var(--dimension-radius-025);background:var(--color-background-secondary);font-family:var(--typography-fontfamily-mono);font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none)}.sc-ds-markdown:where(.ds-prose) :where(pre):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{box-sizing:border-box;max-inline-size:100%;min-inline-size:0;margin:0;padding:var(--dimension-space-150);overflow:auto;border-radius:var(--dimension-radius-050);background:var(--color-background-strong-neutral);color:var(--color-foreground-faint-neutral);font-family:var(--typography-fontfamily-mono);font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none);tab-size:2}.sc-ds-markdown:where(.ds-prose) :where(pre code):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:0;background:transparent;color:inherit;font:inherit;letter-spacing:inherit;white-space:pre}.sc-ds-markdown:where(.ds-prose) :where(hr):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;border:0;border-block-start:var(--dimension-stroke-width-012) solid var(--color-border-tertiary)}.sc-ds-markdown:where(.ds-prose__table-scroll){box-sizing:border-box;max-inline-size:100%;min-inline-size:0;overflow-x:auto}.sc-ds-markdown:where(.ds-prose) :where(table):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{inline-size:100%;border-collapse:collapse}.sc-ds-markdown:where(.ds-prose) :where(th,td).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-075);border:var(--dimension-stroke-width-012) solid var(--color-border-tertiary);text-align:start;vertical-align:top;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose) :where(th):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-primary);font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(img,video.sc-ds-markdown,svg).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{max-inline-size:100%;block-size:auto}.sc-ds-markdown:where(.ds-prose) :where(figcaption):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050);color:var(--color-foreground-secondary);font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none)}.sc-ds-markdown-h{display:block;min-width:0;color:inherit;box-sizing:border-box;-webkit-user-select:text;user-select:text}`;let w;function p(){w??(w=Promise.all([import("./p-BjtXYFhw.js"),import("./p-DVsje4AY.js"),import("./p-gidVv1FX.js")]).then((([e,s,r])=>({fromMarkdown:e.fromMarkdown,gfmFromMarkdown:s.gfmFromMarkdown,gfm:r.gfm}))));return w}function f(e){if(!e)return undefined;try{const s=new URL(e,document.baseURI);if(!["http:","https:","mailto:"].includes(s.protocol))return undefined;return s.href}catch{return undefined}}const k=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.content="";this.streaming=false;this.tree=null;this.parseRevision=0}componentWillLoad(){if(typeof document!=="undefined")return this.parse()}disconnectedCallback(){this.parseRevision+=1;if(this.parseFrame&&typeof cancelAnimationFrame==="function"){cancelAnimationFrame(this.parseFrame)}}scheduleParse(){if(typeof requestAnimationFrame!=="function")return;if(this.parseFrame)cancelAnimationFrame(this.parseFrame);this.parseFrame=requestAnimationFrame((()=>{this.parseFrame=undefined;void this.parse()}))}async parse(){const e=++this.parseRevision;try{const{fromMarkdown:s,gfmFromMarkdown:r,gfm:o}=await p();const a=s(this.content,{extensions:[o()],mdastExtensions:[r()]});if(e===this.parseRevision)this.tree=a}catch{if(e===this.parseRevision)this.tree=null}}children(e){if(!("children"in e))return[];return e.children.map((e=>this.renderNode(e)))}renderNode(e){switch(e.type){case"root":return this.children(e);case"text":return r("span",{class:"markdown__text"},e.value);case"paragraph":return r("p",{class:"markdown__paragraph"},this.children(e));case"heading":{const s=`h${e.depth}`;return r(s,{class:"markdown__heading"},this.children(e))}case"strong":return r("strong",{class:"markdown__strong"},this.children(e));case"emphasis":return r("em",{class:"markdown__emphasis"},this.children(e));case"delete":return r("del",{class:"markdown__delete"},this.children(e));case"blockquote":return r("blockquote",{class:"markdown__blockquote"},this.children(e));case"break":return r("br",{class:"markdown__break"});case"thematicBreak":return r("hr",{class:"markdown__thematic-break"});case"inlineCode":return r("code",{class:"markdown__inline-code"},e.value);case"code":return r("ds-code-block",{class:"markdown__code-block","data-ds-prose":"off",code:e.value,language:e.lang??"",filename:e.meta??""});case"link":{const s=f(e.url);return s?r("a",{class:"markdown__link",href:s,target:"_blank",rel:"noopener noreferrer"},this.children(e)):this.children(e)}case"list":{const s=e.ordered?"ol":"ul";return r(s,{class:"markdown__list",start:e.ordered&&e.start?e.start:undefined},this.children(e))}case"listItem":return r("li",{class:"markdown__list-item"},typeof e.checked==="boolean"?r("input",{class:"markdown__task-indicator",type:"checkbox",checked:e.checked,disabled:true,"aria-hidden":"true",tabIndex:-1}):null,this.children(e));case"table":{const[s,...o]=e.children;return r("div",{class:"markdown__table-wrap ds-prose__table-scroll",tabIndex:0},r("table",{class:"markdown__table"},s?r("thead",{class:"markdown__table-head"},r("tr",{class:"markdown__table-row"},s.children.map((e=>r("th",{class:"markdown__table-heading",scope:"col"},this.children(e)))))):null,r("tbody",{class:"markdown__table-body"},o.map((e=>this.renderNode(e))))))}case"tableRow":return r("tr",{class:"markdown__table-row"},this.children(e));case"tableCell":return r("td",{class:"markdown__table-cell"},this.children(e));case"image":{const s=f(e.url);return s?r("a",{class:"markdown__image-link",href:s,target:"_blank",rel:"noopener noreferrer"},e.alt||"View image"):e.alt||null}case"html":case"definition":case"footnoteDefinition":return null;case"footnoteReference":return r("sup",{class:"markdown__footnote"},e.label);default:return this.children(e)}}render(){return r(o,{key:"c51a77a22264def4876ec4acff734200e04e754b","aria-busy":this.streaming?"true":undefined},r("div",{key:"34ec48b089ad8626c4d0c2efa4fb74dc34a3b0e3",class:"markdown ds-prose"},this.tree?this.renderNode(this.tree):r("p",{class:"markdown__paragraph"},r("span",{class:"markdown__text"},this.content))))}static get watchers(){return{content:[{scheduleParse:0}]}}static get style(){return l()}},[2,"ds-markdown",{content:[1],streaming:[4],tree:[32]},undefined,{content:[{scheduleParse:0}]}]);function g(){if(typeof customElements==="undefined"){return}const e=["ds-markdown","ds-badge","ds-button-unfilled","ds-code-block","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-markdown":if(!customElements.get(a(e))){customElements.define(a(e),k)}break;case"ds-badge":if(!customElements.get(a(e))){d()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){n()}break;case"ds-code-block":if(!customElements.get(a(e))){t()}break;case"ds-icon":if(!customElements.get(a(e))){i()}break;case"ds-loader":if(!customElements.get(a(e))){c()}break;case"ds-text":if(!customElements.get(a(e))){h()}break;case"ds-tooltip":if(!customElements.get(a(e))){m()}break}}))}g();export{k as M,g as d};
2
+ //# sourceMappingURL=p-hLPTSGdo.js.map
@@ -0,0 +1,2 @@
1
+ import{p as s,H as i,c as t,h as e,a as n,t as o}from"./index.js";import{D as r,s as a}from"./p-BgGP65Nn.js";const d=()=>`:host{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}:host(.ds-focus-ring),.ds-focus-ring,:host(.ds-focus-ring-inset),.ds-focus-ring-inset{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}:host(.ds-focus-ring:focus-visible),.ds-focus-ring:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}:host(.ds-focus-ring.ds-focus-ring--visible),.ds-focus-ring.ds-focus-ring--visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}:host(.ds-focus-ring-inset:focus-visible),.ds-focus-ring-inset:focus-visible{outline:none}:host(.ds-focus-ring-inset:focus-visible)::after,.ds-focus-ring-inset:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}:host(.ds-focus-ring-inset.ds-focus-ring--visible),.ds-focus-ring-inset.ds-focus-ring--visible{outline:none}:host(.ds-focus-ring-inset.ds-focus-ring--visible)::after,.ds-focus-ring-inset.ds-focus-ring--visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}:host(.ds-control-inactive),.ds-control-inactive{opacity:0.5;pointer-events:none;cursor:not-allowed}:host{--ds-switch-width:var(--dimension-size-400);--ds-switch-height:var(--dimension-size-250);--ds-switch-thumb-size:var(--dimension-size-150);--ds-switch-gap:var(--dimension-space-050);--ds-switch-stroke:var(--dimension-stroke-width-012);--ds-switch-inset:var(--ds-switch-gap);--ds-switch-thumb-hover:var(--color-interaction-hover);--ds-switch-thumb-pressed:var(--color-interaction-pressed);--ds-switch-travel:calc( var(--ds-switch-width) - var(--ds-switch-thumb-size) - var(--ds-switch-inset) - var(--ds-switch-inset) );position:relative;display:inline-flex;width:var(--ds-switch-width);height:var(--ds-switch-height);padding:0;border:none;border-radius:var(--dimension-radius-half);box-sizing:border-box;flex-shrink:0;overflow:visible;cursor:pointer;user-select:none;outline:none;background-color:transparent;box-shadow:inset 0 0 0 var(--ds-switch-stroke) var(--color-border-secondary);transition:background-color var(--effect-motion-short-3), box-shadow var(--effect-motion-short-3)}:host(.switch--sm){--ds-switch-width:var(--dimension-size-300);--ds-switch-height:var(--dimension-size-200);--ds-switch-thumb-size:calc(var(--dimension-size-base) * 5 / 4);--ds-switch-gap:calc(var(--dimension-space-025) + var(--dimension-space-012))}:host(.switch--xs){--ds-switch-width:var(--dimension-size-250);--ds-switch-height:var(--dimension-size-150);--ds-switch-thumb-size:var(--dimension-size-100);--ds-switch-gap:var(--dimension-space-025)}:host(.checked){background-color:var(--color-background-bold-brand);box-shadow:none}:host(.switch--readonly),:host(.switch--presentation){cursor:default}:host(.switch--presentation){pointer-events:none}.thumb{position:absolute;top:50%;left:var(--ds-switch-inset);width:var(--ds-switch-thumb-size);height:var(--ds-switch-thumb-size);border-radius:var(--dimension-radius-half);background-color:var(--color-foreground-tertiary);box-shadow:none;transform:translateY(-50%);transition:background-color var(--effect-motion-short-3), transform var(--effect-motion-short-3);pointer-events:none}.thumb::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none}:host(:hover:not(:disabled):not(.ds-control-inactive):not(.switch--readonly):not(.switch--presentation)) .thumb::after{background:var(--ds-switch-thumb-hover)}:host(:active:not(:disabled):not(.ds-control-inactive):not(.switch--readonly):not(.switch--presentation)) .thumb::after{background:var(--ds-switch-thumb-pressed)}:host(.checked) .thumb{background-color:var(--color-background-primary);box-shadow:none;transform:translate3d(var(--ds-switch-travel), -50%, 0)}@media (prefers-reduced-motion: reduce){:host{transition:none}.thumb{transition:none}}`;let h=0;const c=s(class s extends i{constructor(s){super();if(s!==false){this.__registerHost()}this.__attachShadow();this.dsChange=t(this,"dsChange");this.internals=this.attachInternals();this.checked=false;this.value="on";this.disabled=false;this.readOnly=false;this.required=false;this.requiredMessage=r;this.isInactive=false;this.size="md";this.presentation=false;this.initialChecked=false;this.formDisabled=false;this.focused=false;this.touched=false;this.handleClick=()=>{if(this.presentation||this.readOnly||this.isInactive||this.disabled||this.formDisabled)return;this.checked=!this.checked;this.dsChange.emit(this.checked)};this.handleKeyDown=s=>{if(this.presentation||this.readOnly||this.isInactive||this.disabled||this.formDisabled)return;if(s.key===" "||s.key==="Enter"){s.preventDefault();this.handleClick()}};this.handleFocus=()=>{if(!this.presentation)this.focused=true};this.handleBlur=()=>{if(this.presentation)return;this.focused=false;this.touched=true}}componentWillLoad(){this.initialChecked=this.checked;this.syncFormValue()}componentDidLoad(){this.syncNativeLabels()}syncFormValue(){const s=this.presentation||this.isInactive||this.disabled||this.formDisabled;const i=this.checked?this.value:this.uncheckedValue??null;const t=this.checked?"checked":"unchecked";this.internals.setFormValue(s?null:i,t);const e=this.required&&!s&&!this.checked;a(this.internals,e,this.requiredMessage)}formDisabledCallback(s){this.formDisabled=s;this.syncFormValue()}formResetCallback(){this.checked=this.initialChecked;this.focused=false;this.touched=false}formStateRestoreCallback(s){this.checked=s==="checked"}syncNativeLabels(){if(this.presentation)return;if(this.el.hasAttribute("aria-label")||this.el.hasAttribute("aria-labelledby"))return;const s=Array.from(this.internals.labels).map((s=>{if(!s.id)s.id=`ds-switch-label-${++h}`;return s.id}));if(s.length)this.el.setAttribute("aria-labelledby",s.join(" "))}render(){const s=this.isInactive||this.disabled||this.formDisabled;const i=this.required&&!s&&!this.checked;const t=this.checked!==this.initialChecked;return e(n,{key:"341e79692409570e394675ad1731926578445308",role:this.presentation?undefined:"switch","aria-checked":this.presentation?undefined:String(this.checked),"aria-disabled":!this.presentation&&s?"true":undefined,"aria-readonly":!this.presentation&&this.readOnly?"true":undefined,"aria-required":!this.presentation&&this.required?"true":undefined,"aria-invalid":!this.presentation&&i?"true":undefined,"aria-hidden":this.presentation?"true":undefined,"data-checked":this.checked?"":undefined,"data-unchecked":!this.checked?"":undefined,"data-disabled":s?"":undefined,"data-readonly":this.readOnly?"":undefined,"data-required":this.required?"":undefined,"data-focused":!this.presentation&&this.focused?"":undefined,"data-filled":!this.presentation&&this.checked?"":undefined,"data-dirty":!this.presentation&&t?"":undefined,"data-touched":!this.presentation&&this.touched?"":undefined,"data-valid":!this.presentation&&!s&&!i?"":undefined,"data-invalid":!this.presentation&&i?"":undefined,tabIndex:this.presentation||s?-1:0,class:{switch:true,checked:this.checked,"switch--md":this.size==="md","switch--sm":this.size==="sm","switch--xs":this.size==="xs","switch--readonly":this.readOnly,"switch--presentation":this.presentation,"ds-focus-ring":true,"ds-control-inactive":s},onClick:this.handleClick,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur},e("span",{key:"e497c293e02743a00bf7204565416f82eda1eed5",class:"thumb"}))}static get formAssociated(){return true}get el(){return this}static get watchers(){return{checked:[{syncFormValue:0}],value:[{syncFormValue:0}],uncheckedValue:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],presentation:[{syncFormValue:0}],required:[{syncFormValue:0}]}}static get style(){return d()}},[65,"ds-switch",{checked:[1028],name:[513],value:[1],uncheckedValue:[1,"unchecked-value"],form:[513],disabled:[516],readOnly:[516,"read-only"],required:[516],requiredMessage:[1,"required-message"],isInactive:[4,"is-inactive"],size:[1],presentation:[4],formDisabled:[32],focused:[32],touched:[32]},undefined,{checked:[{syncFormValue:0}],value:[{syncFormValue:0}],uncheckedValue:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],presentation:[{syncFormValue:0}],required:[{syncFormValue:0}]}]);function u(){if(typeof customElements==="undefined"){return}const s=["ds-switch"];s.forEach((s=>{switch(s){case"ds-switch":if(!customElements.get(o(s))){customElements.define(o(s),c)}break}}))}u();export{c as S,u as d};
2
+ //# sourceMappingURL=p-rsIOpkzV.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["switchCss","generatedLabelId","Switch","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","checked","value","disabled","readOnly","required","requiredMessage","DEFAULT_REQUIRED_MESSAGE","isInactive","size","presentation","initialChecked","formDisabled","focused","touched","handleClick","dsChange","emit","handleKeyDown","event","key","preventDefault","handleFocus","handleBlur","componentWillLoad","syncFormValue","componentDidLoad","syncNativeLabels","inactive","submissionValue","uncheckedValue","state","internals","setFormValue","missing","setRequiredValidity","formDisabledCallback","formResetCallback","formStateRestoreCallback","el","hasAttribute","labelIds","Array","from","labels","map","label","id","length","setAttribute","join","render","invalid","dirty","h","Host","role","undefined","String","tabIndex","class","switch","onClick","onKeyDown","onFocus","onBlur"],"sources":["src/wc/components/Switch/Switch.css?tag=ds-switch&encapsulation=shadow","src/wc/components/Switch/Switch.tsx"],"sourcesContent":["@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n\n:host {\n --ds-switch-width: var(--dimension-size-400);\n --ds-switch-height: var(--dimension-size-250);\n --ds-switch-thumb-size: var(--dimension-size-150);\n --ds-switch-gap: var(--dimension-space-050);\n --ds-switch-stroke: var(--dimension-stroke-width-012);\n --ds-switch-inset: var(--ds-switch-gap);\n --ds-switch-thumb-hover: var(--color-interaction-hover);\n --ds-switch-thumb-pressed: var(--color-interaction-pressed);\n --ds-switch-travel: calc(\n var(--ds-switch-width) - var(--ds-switch-thumb-size) - var(--ds-switch-inset) -\n var(--ds-switch-inset)\n );\n position: relative;\n display: inline-flex;\n width: var(--ds-switch-width);\n height: var(--ds-switch-height);\n padding: 0;\n border: none;\n border-radius: var(--dimension-radius-half);\n box-sizing: border-box;\n flex-shrink: 0;\n overflow: visible;\n cursor: pointer;\n user-select: none;\n outline: none;\n background-color: transparent;\n box-shadow: inset 0 0 0 var(--ds-switch-stroke) var(--color-border-secondary);\n transition:\n background-color var(--effect-motion-short-3),\n box-shadow var(--effect-motion-short-3);\n}\n\n:host(.switch--sm) {\n --ds-switch-width: var(--dimension-size-300);\n --ds-switch-height: var(--dimension-size-200);\n --ds-switch-thumb-size: calc(var(--dimension-size-base) * 5 / 4);\n --ds-switch-gap: calc(var(--dimension-space-025) + var(--dimension-space-012));\n}\n\n:host(.switch--xs) {\n --ds-switch-width: var(--dimension-size-250);\n --ds-switch-height: var(--dimension-size-150);\n --ds-switch-thumb-size: var(--dimension-size-100);\n --ds-switch-gap: var(--dimension-space-025);\n}\n\n:host(.checked) {\n background-color: var(--color-background-bold-brand);\n box-shadow: none;\n}\n\n:host(.switch--readonly),\n:host(.switch--presentation) {\n cursor: default;\n}\n\n:host(.switch--presentation) {\n pointer-events: none;\n}\n\n/* Inactive: `.ds-control-inactive` (50% opacity). */\n\n.thumb {\n position: absolute;\n top: 50%;\n left: var(--ds-switch-inset);\n width: var(--ds-switch-thumb-size);\n height: var(--ds-switch-thumb-size);\n border-radius: var(--dimension-radius-half);\n background-color: var(--color-foreground-tertiary);\n box-shadow: none;\n transform: translateY(-50%);\n transition:\n background-color var(--effect-motion-short-3),\n transform var(--effect-motion-short-3);\n pointer-events: none;\n}\n\n.thumb::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: inherit;\n background: transparent;\n pointer-events: none;\n}\n\n:host(:hover:not(:disabled):not(.ds-control-inactive):not(.switch--readonly):not(.switch--presentation))\n .thumb::after {\n background: var(--ds-switch-thumb-hover);\n}\n\n:host(:active:not(:disabled):not(.ds-control-inactive):not(.switch--readonly):not(.switch--presentation))\n .thumb::after {\n background: var(--ds-switch-thumb-pressed);\n}\n\n:host(.checked) .thumb {\n background-color: var(--color-background-primary);\n box-shadow: none;\n transform: translate3d(var(--ds-switch-travel), -50%, 0);\n}\n\n@media (prefers-reduced-motion: reduce) {\n :host {\n transition: none;\n }\n\n .thumb {\n transition: none;\n }\n}\n","import { AttachInternals, Component, Element, Prop, State, Event, EventEmitter, Watch, h, Host } from '@stencil/core';\nimport { DEFAULT_REQUIRED_MESSAGE, setRequiredValidity } from '../../utils';\n\nexport type SwitchSize = 'md' | 'sm' | 'xs';\n\nlet generatedLabelId = 0;\n\n@Component({\n tag: 'ds-switch',\n styleUrl: 'Switch.css',\n shadow: true,\n formAssociated: true,\n})\nexport class Switch {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n /** Current on/off state. The initial value is restored when the owning form resets. */\n @Prop({ mutable: true }) checked: boolean = false;\n\n @Prop({ reflect: true }) name: string | undefined;\n @Prop() value: string = 'on';\n\n /** Optional value submitted when unchecked; omitted by default like a native checkbox. */\n @Prop() uncheckedValue: string | undefined;\n\n /** Associates the switch with a form by id when it is rendered outside that form. */\n @Prop({ reflect: true }) form: string | undefined;\n\n @Prop({ reflect: true }) disabled: boolean = false;\n @Prop({ reflect: true }) readOnly: boolean = false;\n @Prop({ reflect: true }) required: boolean = false;\n @Prop() requiredMessage: string = DEFAULT_REQUIRED_MESSAGE;\n @Prop() isInactive: boolean = false;\n\n /** Compact track size for placement inside controls, menus, and form rows. */\n @Prop() size: SwitchSize = 'md';\n\n /**\n * Removes standalone control semantics so a composite owner such as a\n * `menuitemcheckbox` can use the switch as an aria-hidden visual indicator.\n */\n @Prop() presentation: boolean = false;\n\n @Event() dsChange!: EventEmitter<boolean>;\n\n private initialChecked = false;\n @State() private formDisabled = false;\n @State() private focused = false;\n @State() private touched = false;\n\n componentWillLoad() {\n this.initialChecked = this.checked;\n this.syncFormValue();\n }\n\n componentDidLoad() {\n this.syncNativeLabels();\n }\n\n @Watch('checked')\n @Watch('value')\n @Watch('uncheckedValue')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('presentation')\n @Watch('required')\n syncFormValue() {\n const inactive = this.presentation || this.isInactive || this.disabled || this.formDisabled;\n const submissionValue = this.checked ? this.value : this.uncheckedValue ?? null;\n const state = this.checked ? 'checked' : 'unchecked';\n this.internals.setFormValue(inactive ? null : submissionValue, state);\n\n const missing = this.required && !inactive && !this.checked;\n setRequiredValidity(this.internals, missing, this.requiredMessage);\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.checked = this.initialChecked;\n this.focused = false;\n this.touched = false;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.checked = state === 'checked';\n }\n\n private syncNativeLabels() {\n if (this.presentation) return;\n if (this.el.hasAttribute('aria-label') || this.el.hasAttribute('aria-labelledby')) return;\n\n const labelIds = (Array.from(this.internals.labels) as HTMLLabelElement[]).map(label => {\n if (!label.id) label.id = `ds-switch-label-${++generatedLabelId}`;\n return label.id;\n });\n if (labelIds.length) this.el.setAttribute('aria-labelledby', labelIds.join(' '));\n }\n\n private handleClick = () => {\n if (this.presentation || this.readOnly || this.isInactive || this.disabled || this.formDisabled) return;\n this.checked = !this.checked;\n this.dsChange.emit(this.checked);\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (this.presentation || this.readOnly || this.isInactive || this.disabled || this.formDisabled) return;\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.handleClick();\n }\n };\n\n private handleFocus = () => {\n if (!this.presentation) this.focused = true;\n };\n\n private handleBlur = () => {\n if (this.presentation) return;\n this.focused = false;\n this.touched = true;\n };\n\n render() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n const invalid = this.required && !inactive && !this.checked;\n const dirty = this.checked !== this.initialChecked;\n // Switch owns its structural track and thumb strokes so nested interaction layers cannot cover them.\n return (\n <Host\n role={this.presentation ? undefined : 'switch'}\n aria-checked={this.presentation ? undefined : String(this.checked)}\n aria-disabled={!this.presentation && inactive ? 'true' : undefined}\n aria-readonly={!this.presentation && this.readOnly ? 'true' : undefined}\n aria-required={!this.presentation && this.required ? 'true' : undefined}\n aria-invalid={!this.presentation && invalid ? 'true' : undefined}\n aria-hidden={this.presentation ? 'true' : undefined}\n data-checked={this.checked ? '' : undefined}\n data-unchecked={!this.checked ? '' : undefined}\n data-disabled={inactive ? '' : undefined}\n data-readonly={this.readOnly ? '' : undefined}\n data-required={this.required ? '' : undefined}\n data-focused={!this.presentation && this.focused ? '' : undefined}\n data-filled={!this.presentation && this.checked ? '' : undefined}\n data-dirty={!this.presentation && dirty ? '' : undefined}\n data-touched={!this.presentation && this.touched ? '' : undefined}\n data-valid={!this.presentation && !inactive && !invalid ? '' : undefined}\n data-invalid={!this.presentation && invalid ? '' : undefined}\n tabIndex={this.presentation || inactive ? -1 : 0}\n class={{\n switch: true,\n checked: this.checked,\n 'switch--md': this.size === 'md',\n 'switch--sm': this.size === 'sm',\n 'switch--xs': this.size === 'xs',\n 'switch--readonly': this.readOnly,\n 'switch--presentation': this.presentation,\n 'ds-focus-ring': true,\n 'ds-control-inactive': inactive,\n }}\n onClick={this.handleClick}\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <span class=\"thumb\" />\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"names":["switchCss","generatedLabelId","Switch","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","checked","value","disabled","readOnly","required","requiredMessage","DEFAULT_REQUIRED_MESSAGE","isInactive","size","presentation","initialChecked","formDisabled","focused","touched","handleClick","dsChange","emit","handleKeyDown","event","key","preventDefault","handleFocus","handleBlur","componentWillLoad","syncFormValue","componentDidLoad","syncNativeLabels","inactive","submissionValue","uncheckedValue","state","internals","setFormValue","missing","setRequiredValidity","formDisabledCallback","formResetCallback","formStateRestoreCallback","el","hasAttribute","labelIds","Array","from","labels","map","label","id","length","setAttribute","join","render","invalid","dirty","h","Host","role","undefined","String","tabIndex","class","switch","onClick","onKeyDown","onFocus","onBlur"],"sources":["src/wc/components/Switch/Switch.css?tag=ds-switch&encapsulation=shadow","src/wc/components/Switch/Switch.tsx"],"sourcesContent":["@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n\n:host {\n --ds-switch-width: var(--dimension-size-400);\n --ds-switch-height: var(--dimension-size-250);\n --ds-switch-thumb-size: var(--dimension-size-150);\n --ds-switch-gap: var(--dimension-space-050);\n --ds-switch-stroke: var(--dimension-stroke-width-012);\n --ds-switch-inset: var(--ds-switch-gap);\n --ds-switch-thumb-hover: var(--color-interaction-hover);\n --ds-switch-thumb-pressed: var(--color-interaction-pressed);\n --ds-switch-travel: calc(\n var(--ds-switch-width) - var(--ds-switch-thumb-size) - var(--ds-switch-inset) -\n var(--ds-switch-inset)\n );\n position: relative;\n display: inline-flex;\n width: var(--ds-switch-width);\n height: var(--ds-switch-height);\n padding: 0;\n border: none;\n border-radius: var(--dimension-radius-half);\n box-sizing: border-box;\n flex-shrink: 0;\n overflow: visible;\n cursor: pointer;\n user-select: none;\n outline: none;\n background-color: transparent;\n box-shadow: inset 0 0 0 var(--ds-switch-stroke) var(--color-border-secondary);\n transition:\n background-color var(--effect-motion-short-3),\n box-shadow var(--effect-motion-short-3);\n}\n\n:host(.switch--sm) {\n --ds-switch-width: var(--dimension-size-300);\n --ds-switch-height: var(--dimension-size-200);\n --ds-switch-thumb-size: calc(var(--dimension-size-base) * 5 / 4);\n --ds-switch-gap: calc(var(--dimension-space-025) + var(--dimension-space-012));\n}\n\n:host(.switch--xs) {\n --ds-switch-width: var(--dimension-size-250);\n --ds-switch-height: var(--dimension-size-150);\n --ds-switch-thumb-size: var(--dimension-size-100);\n --ds-switch-gap: var(--dimension-space-025);\n}\n\n:host(.checked) {\n background-color: var(--color-background-bold-brand);\n box-shadow: none;\n}\n\n:host(.switch--readonly),\n:host(.switch--presentation) {\n cursor: default;\n}\n\n:host(.switch--presentation) {\n pointer-events: none;\n}\n\n/* Inactive: `.ds-control-inactive` (50% opacity). */\n\n.thumb {\n position: absolute;\n top: 50%;\n left: var(--ds-switch-inset);\n width: var(--ds-switch-thumb-size);\n height: var(--ds-switch-thumb-size);\n border-radius: var(--dimension-radius-half);\n background-color: var(--color-foreground-tertiary);\n box-shadow: none;\n transform: translateY(-50%);\n transition:\n background-color var(--effect-motion-short-3),\n transform var(--effect-motion-short-3);\n pointer-events: none;\n}\n\n.thumb::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: inherit;\n background: transparent;\n pointer-events: none;\n}\n\n:host(:hover:not(:disabled):not(.ds-control-inactive):not(.switch--readonly):not(.switch--presentation))\n .thumb::after {\n background: var(--ds-switch-thumb-hover);\n}\n\n:host(:active:not(:disabled):not(.ds-control-inactive):not(.switch--readonly):not(.switch--presentation))\n .thumb::after {\n background: var(--ds-switch-thumb-pressed);\n}\n\n:host(.checked) .thumb {\n background-color: var(--color-background-primary);\n box-shadow: none;\n transform: translate3d(var(--ds-switch-travel), -50%, 0);\n}\n\n@media (prefers-reduced-motion: reduce) {\n :host {\n transition: none;\n }\n\n .thumb {\n transition: none;\n }\n}\n","import { AttachInternals, Component, Element, Prop, State, Event, EventEmitter, Watch, h, Host } from '@stencil/core';\nimport { DEFAULT_REQUIRED_MESSAGE, setRequiredValidity } from '../../utils';\n\nexport type SwitchSize = 'md' | 'sm' | 'xs';\n\nlet generatedLabelId = 0;\n\n@Component({\n tag: 'ds-switch',\n styleUrl: 'Switch.css',\n shadow: true,\n formAssociated: true,\n})\nexport class Switch {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n /** Current on/off state. The initial value is restored when the owning form resets. */\n @Prop({ mutable: true }) checked: boolean = false;\n\n @Prop({ reflect: true }) name: string | undefined;\n @Prop() value: string = 'on';\n\n /** Optional value submitted when unchecked; omitted by default like a native checkbox. */\n @Prop() uncheckedValue: string | undefined;\n\n /** Associates the switch with a form by id when it is rendered outside that form. */\n @Prop({ reflect: true }) form: string | undefined;\n\n @Prop({ reflect: true }) disabled: boolean = false;\n @Prop({ reflect: true }) readOnly: boolean = false;\n @Prop({ reflect: true }) required: boolean = false;\n @Prop() requiredMessage: string = DEFAULT_REQUIRED_MESSAGE;\n @Prop() isInactive: boolean = false;\n\n /** Compact track size for placement inside controls, menus, and form rows. */\n @Prop() size: SwitchSize = 'md';\n\n /**\n * Removes standalone control semantics so a composite owner such as a\n * `menuitemcheckbox` can use the switch as an aria-hidden visual indicator.\n */\n @Prop() presentation: boolean = false;\n\n @Event() dsChange!: EventEmitter<boolean>;\n\n private initialChecked = false;\n @State() private formDisabled = false;\n @State() private focused = false;\n @State() private touched = false;\n\n componentWillLoad() {\n this.initialChecked = this.checked;\n this.syncFormValue();\n }\n\n componentDidLoad() {\n this.syncNativeLabels();\n }\n\n @Watch('checked')\n @Watch('value')\n @Watch('uncheckedValue')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('presentation')\n @Watch('required')\n syncFormValue() {\n const inactive = this.presentation || this.isInactive || this.disabled || this.formDisabled;\n const submissionValue = this.checked ? this.value : this.uncheckedValue ?? null;\n const state = this.checked ? 'checked' : 'unchecked';\n this.internals.setFormValue(inactive ? null : submissionValue, state);\n\n const missing = this.required && !inactive && !this.checked;\n setRequiredValidity(this.internals, missing, this.requiredMessage);\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.checked = this.initialChecked;\n this.focused = false;\n this.touched = false;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.checked = state === 'checked';\n }\n\n private syncNativeLabels() {\n if (this.presentation) return;\n if (this.el.hasAttribute('aria-label') || this.el.hasAttribute('aria-labelledby')) return;\n\n const labelIds = (Array.from(this.internals.labels) as HTMLLabelElement[]).map(label => {\n if (!label.id) label.id = `ds-switch-label-${++generatedLabelId}`;\n return label.id;\n });\n if (labelIds.length) this.el.setAttribute('aria-labelledby', labelIds.join(' '));\n }\n\n private handleClick = () => {\n if (this.presentation || this.readOnly || this.isInactive || this.disabled || this.formDisabled) return;\n this.checked = !this.checked;\n this.dsChange.emit(this.checked);\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (this.presentation || this.readOnly || this.isInactive || this.disabled || this.formDisabled) return;\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.handleClick();\n }\n };\n\n private handleFocus = () => {\n if (!this.presentation) this.focused = true;\n };\n\n private handleBlur = () => {\n if (this.presentation) return;\n this.focused = false;\n this.touched = true;\n };\n\n render() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n const invalid = this.required && !inactive && !this.checked;\n const dirty = this.checked !== this.initialChecked;\n // Switch owns its structural track and thumb strokes so nested interaction layers cannot cover them.\n return (\n <Host\n role={this.presentation ? undefined : 'switch'}\n aria-checked={this.presentation ? undefined : String(this.checked)}\n aria-disabled={!this.presentation && inactive ? 'true' : undefined}\n aria-readonly={!this.presentation && this.readOnly ? 'true' : undefined}\n aria-required={!this.presentation && this.required ? 'true' : undefined}\n aria-invalid={!this.presentation && invalid ? 'true' : undefined}\n aria-hidden={this.presentation ? 'true' : undefined}\n data-checked={this.checked ? '' : undefined}\n data-unchecked={!this.checked ? '' : undefined}\n data-disabled={inactive ? '' : undefined}\n data-readonly={this.readOnly ? '' : undefined}\n data-required={this.required ? '' : undefined}\n data-focused={!this.presentation && this.focused ? '' : undefined}\n data-filled={!this.presentation && this.checked ? '' : undefined}\n data-dirty={!this.presentation && dirty ? '' : undefined}\n data-touched={!this.presentation && this.touched ? '' : undefined}\n data-valid={!this.presentation && !inactive && !invalid ? '' : undefined}\n data-invalid={!this.presentation && invalid ? '' : undefined}\n tabIndex={this.presentation || inactive ? -1 : 0}\n class={{\n switch: true,\n checked: this.checked,\n 'switch--md': this.size === 'md',\n 'switch--sm': this.size === 'sm',\n 'switch--xs': this.size === 'xs',\n 'switch--readonly': this.readOnly,\n 'switch--presentation': this.presentation,\n 'ds-focus-ring': true,\n 'ds-control-inactive': inactive,\n }}\n onClick={this.handleClick}\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <span class=\"thumb\" />\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-07-26T01:15:10",
2
+ "timestamp": "2026-07-26T02:51:03",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.43.5",
@@ -10358,7 +10358,7 @@
10358
10358
  "mutable": false,
10359
10359
  "attr": "selection-mode",
10360
10360
  "reflectToAttr": false,
10361
- "docs": "Give ordinary rows mutually-exclusive radio-menu semantics using isSelected.",
10361
+ "docs": "Give ordinary rows mutually-exclusive menu semantics using isSelected.",
10362
10362
  "docsTags": [
10363
10363
  {
10364
10364
  "name": "default",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
3
  "name": "menu",
4
4
  "title": "Menu",
5
- "description": "Anchored action menu with flat commands, grouped sections, single-selection radio choices, supplemental notification dots, switches, and destructive actions.",
5
+ "description": "Anchored action menu with flat commands, grouped sections, single-selection choices, supplemental notification dots, switches, and destructive actions.",
6
6
  "type": "registry:ui",
7
7
  "meta": {
8
8
  "library": "@ds-mo/ui",
@@ -13,7 +13,7 @@
13
13
  "intent": {
14
14
  "audience": "general",
15
15
  "status": "stable",
16
- "summary": "Anchored action menu with flat commands, grouped sections, single-selection radio choices, supplemental notification dots, switches, and destructive actions.",
16
+ "summary": "Anchored action menu with flat commands, grouped sections, single-selection choices, supplemental notification dots, switches, and destructive actions.",
17
17
  "useWhen": [
18
18
  "A trigger reveals a short contextual list of commands or state-changing actions.",
19
19
  "Actions need grouping, mutually exclusive selected state, supplemental notification dots, switch rows, or destructive treatment."
@@ -54,7 +54,7 @@
54
54
  "Open with visible initial focus only when the trigger was activated from the keyboard.",
55
55
  "Keep disabled items discoverable only when their unavailable state is meaningful.",
56
56
  "Switch rows use menuitemcheckbox semantics on the row; the nested ds-switch is an aria-hidden md presentation indicator.",
57
- "Single-selection menus use menuitemradio semantics and aria-checked on each row; the leading radio mark is presentation-only.",
57
+ "Single-selection menus use menuitemradio semantics and aria-checked on each row, but render no nested radio control; selected interaction fill and primary foreground provide the visual state.",
58
58
  "A swatch-picker section changes the popup to a non-modal dialog so its radio group and ordinary preference buttons keep valid nested semantics; Tab moves between its controls, then leaves and closes at the popup boundary.",
59
59
  "Use notification dots only as supplemental status and not as the sole indication of important information."
60
60
  ],
@@ -197,7 +197,7 @@
197
197
  "default": "'none'",
198
198
  "required": false,
199
199
  "mutable": false,
200
- "description": "Give ordinary rows mutually-exclusive radio-menu semantics using isSelected."
200
+ "description": "Give ordinary rows mutually-exclusive menu semantics using isSelected."
201
201
  },
202
202
  "side": {
203
203
  "type": "MenuSide",
@@ -364,7 +364,7 @@
364
364
  "default": "'none'",
365
365
  "required": false,
366
366
  "mutable": false,
367
- "description": "Give ordinary rows mutually-exclusive radio-menu semantics using isSelected."
367
+ "description": "Give ordinary rows mutually-exclusive menu semantics using isSelected."
368
368
  },
369
369
  "side": {
370
370
  "type": "MenuSide",
@@ -470,12 +470,12 @@
470
470
  "files": [
471
471
  {
472
472
  "path": "src/wc/components/Menu/Menu.css",
473
- "content": "@import '../../utils/choice-list.css';\n\n/* Inactive: `.ds-control-inactive` (50% opacity). */\n\n.menu-item--destructive .menu-item__label {\n /* Beat ds-text color-* host classes for destructive rows. */\n color: var(--color-foreground-bold-negative) !important;\n}\n\n/* Standard md icon zone keeps the dot aligned with other control suffixes. */\n.menu-item__dot-box {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--ds-control-icon, var(--dimension-iconography-md));\n height: var(--ds-control-icon, var(--dimension-iconography-md));\n pointer-events: none;\n}\n\n/* ── Switch suffix ───────────────────────────────────────────────────────── */\n\n.menu-item__switch {\n flex-shrink: 0;\n}\n\n/* ── Single-selection radio indicator ───────────────────────────────────── */\n\n.menu-item__radio-box {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--ds-control-icon, var(--dimension-iconography-md));\n height: var(--ds-control-icon, var(--dimension-iconography-md));\n pointer-events: none;\n}\n\n.menu-item__radio {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--dimension-iconography-sm);\n height: var(--dimension-iconography-sm);\n border-radius: var(--dimension-radius-half);\n box-shadow: inset 0 0 0 var(--dimension-stroke-width-015) var(--color-foreground-tertiary);\n}\n\n.menu-item__radio--checked {\n background-color: var(--color-background-bold-brand);\n box-shadow: none;\n}\n\n.menu-item__radio-dot {\n width: var(--dimension-size-100);\n height: var(--dimension-size-100);\n border-radius: var(--dimension-radius-half);\n background-color: var(--color-foreground-on-bold-background-primary);\n}\n",
473
+ "content": "@import '../../utils/choice-list.css';\n\n/* Inactive: `.ds-control-inactive` (50% opacity). */\n\n.menu-item--destructive .menu-item__label {\n /* Beat ds-text color-* host classes for destructive rows. */\n color: var(--color-foreground-bold-negative) !important;\n}\n\n/* Standard md icon zone keeps the dot aligned with other control suffixes. */\n.menu-item__dot-box {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--ds-control-icon, var(--dimension-iconography-md));\n height: var(--ds-control-icon, var(--dimension-iconography-md));\n pointer-events: none;\n}\n\n/* ── Switch suffix ───────────────────────────────────────────────────────── */\n\n.menu-item__switch {\n flex-shrink: 0;\n}\n",
474
474
  "type": "registry:ui"
475
475
  },
476
476
  {
477
477
  "path": "src/wc/components/Menu/Menu.tsx",
478
- "content": "import {\n Component,\n Prop,\n State,\n Event,\n EventEmitter,\n Element,\n Watch,\n Listen,\n h,\n Host,\n} from '@stencil/core';\nimport {\n choicePopupMinWidth,\n resolveChoicePopupAlignOffset,\n resolveCssLengthPx,\n resolveMotionTimeMs,\n TOKEN_CSS_LENGTHS,\n TOKEN_DEFAULTS,\n type ChoicePopupAnchorAlignment,\n} from '../../utils';\nimport { computeMenuPosition, type MenuAlign, type MenuSide } from './menu-position';\nimport type { MenuItemData, MenuSection } from './menu-types';\n\nexport type MenuSelectionMode = 'none' | 'single';\nimport {\n isMenuGradientPickerSection,\n isMenuPickerSection,\n isMenuSwatchPickerSection,\n} from './menu-types';\nimport {\n shellGradientPickerSections,\n type ShellGradientPreset,\n} from '../../shell/shell-gradient-presets';\n\n/** rAF retries while the popup mounts or the anchor resolves. */\nconst POSITION_RETRY_BUDGET = 8;\nconst MENU_FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\nfunction snapshotMenuSections(sections: MenuSection[]): MenuSection[] {\n return sections.map(section => {\n if (isMenuGradientPickerSection(section)) return { ...section };\n if (isMenuSwatchPickerSection(section)) {\n return {\n ...section,\n options: section.options?.map(option => ({ ...option })),\n sections: section.sections?.map(swatchSection => ({\n ...swatchSection,\n options: swatchSection.options.map(option => ({ ...option })),\n })),\n };\n }\n return { ...section, items: section.items.map(item => ({ ...item })) };\n });\n}\n\n@Component({\n tag: 'ds-menu',\n styleUrl: 'Menu.css',\n scoped: true,\n})\nexport class Menu {\n @Element() el!: HTMLElement;\n\n @Prop({ mutable: true }) open: boolean = false;\n @Prop() items: MenuItemData[] = [];\n /** Give ordinary rows mutually-exclusive radio-menu semantics using isSelected. */\n @Prop() selectionMode: MenuSelectionMode = 'none';\n @Prop() sections: MenuSection[] = [];\n /** Preferred side; placement flips to the opposite side when that offers a better fit. */\n @Prop() side: MenuSide = 'bottom';\n @Prop() align: MenuAlign = 'start';\n /** Align choice-row edges to the anchor by default; use `popup-frame` only for custom frame geometry. */\n @Prop() anchorAlignment: ChoicePopupAnchorAlignment = 'choice-cell';\n /** Gap between anchor and menu — number (px) or TokoMo length (`var(--dimension-space-050)`, etc.). */\n @Prop() sideOffset: number | string = TOKEN_CSS_LENGTHS.space050;\n /** Cross-axis offset — number (px) or TokoMo length. */\n @Prop() alignOffset: number | string = 0;\n @Prop() menuWidth: string | undefined;\n @Prop() minWidth: string | undefined;\n /** External trigger element to position against. Set via JS: menuEl.anchor = buttonEl */\n @Prop() anchor: HTMLElement | undefined;\n /** ID of the external trigger element for positioning */\n @Prop() anchorId: string | undefined;\n /** Show a visible ring on the initially focused menu item. Use only when the opener was keyboard-driven. */\n @Prop() initialFocusVisible: boolean = false;\n /** Accessible name for the popup menu. */\n @Prop() menuLabel: string = 'Menu';\n\n @State() private shouldRender: boolean = false;\n @State() private closing: boolean = false;\n @State() private pos: { x: number; y: number } = { x: 0, y: 0 };\n @State() private focusedIndex: number = 0;\n @State() private positionReady: boolean = false;\n @State() private focusRingVisible: boolean = false;\n\n @Event() dsClose!: EventEmitter<void>;\n /** Emitted after the popup's exit motion is complete and its rendered content is removed. */\n @Event() dsAfterClose!: EventEmitter<void>;\n @Event() dsSelect!: EventEmitter<MenuItemData>;\n /** Emitted when a `gradient-picker` section swatch is chosen. */\n @Event() dsGradientSelect!: EventEmitter<ShellGradientPreset>;\n /** Emitted when a generic `swatch-picker` section option is chosen. */\n @Event() dsSwatchSelect!: EventEmitter<string>;\n\n private clickOutsideHandler: ((e: MouseEvent) => void) | null = null;\n private scrollResizeHandler: (() => void) | null = null;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private positionRetryRaf: number | null = null;\n private livePositionRaf: number | null = null;\n /** Last content actually painted while open; retained unchanged through exit motion. */\n private lastRenderedSections: MenuSection[] = [];\n private closingSections: MenuSection[] | null = null;\n\n componentDidLoad() {\n if (this.open) this.onOpenChange(true);\n }\n\n componentDidRender() {\n if (!this.shouldRender) return;\n const popup = this.el.querySelector<HTMLElement>('.menu-popup');\n if (!popup || typeof popup.showPopover !== 'function') return;\n if (!popup.matches(':popover-open')) popup.showPopover();\n }\n\n disconnectedCallback() {\n this.cancelPositionRetry();\n this.cancelLivePositionUpdate();\n this.teardownListeners();\n }\n\n @Watch('open')\n onOpenChange(isOpen: boolean) {\n if (isOpen) {\n this.teardownListeners();\n this.closingSections = null;\n this.shouldRender = true;\n this.closing = false;\n this.positionReady = false;\n this.focusRingVisible = this.initialFocusVisible;\n this.setupListeners();\n this.schedulePositionUpdate(() => {\n this.focusInitialItem();\n });\n } else if (this.shouldRender) {\n this.cancelPositionRetry();\n this.captureClosingSections();\n this.closing = true;\n this.teardownListeners();\n const closeAnimationMs = this.closeAnimationMs;\n if (closeAnimationMs <= 0) {\n this.finishClose();\n return;\n }\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n this.finishClose();\n }, closeAnimationMs);\n }\n }\n\n @Watch('anchor')\n @Watch('anchorId')\n onAnchorChange() {\n if (this.open) this.schedulePositionUpdate();\n }\n\n @Watch('side')\n @Watch('align')\n @Watch('anchorAlignment')\n @Watch('sideOffset')\n @Watch('alignOffset')\n onPositionPropsChange() {\n if (this.open) this.schedulePositionUpdate();\n }\n\n private get viewportPadPx(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n }\n\n private get sideOffsetPx(): number {\n return resolveCssLengthPx(this.sideOffset, TOKEN_DEFAULTS.space050);\n }\n\n private get alignOffsetPx(): number {\n return resolveCssLengthPx(this.alignOffset, 0);\n }\n\n private get popupFallbackWidthPx(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuWidthXs, TOKEN_DEFAULTS.menuWidthXs);\n }\n\n private get popupFallbackHeightPx(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuFallbackHeight, TOKEN_DEFAULTS.menuFallbackHeight);\n }\n\n private get closeAnimationMs(): number {\n return resolveMotionTimeMs(TOKEN_DEFAULTS.motionShort2, TOKEN_DEFAULTS.animationDurationShort3);\n }\n\n private finishClose() {\n const popup = this.el.querySelector<HTMLElement>('.menu-popup');\n if (popup?.matches(':popover-open')) popup.hidePopover();\n this.shouldRender = false;\n this.closing = false;\n this.lastRenderedSections = [];\n this.closingSections = null;\n this.dsAfterClose.emit();\n }\n\n private captureClosingSections() {\n if (this.closingSections) return;\n const visibleSections = this.lastRenderedSections.length\n ? this.lastRenderedSections\n : this.activeSections;\n this.closingSections = snapshotMenuSections(visibleSections);\n }\n\n private get resolvedAnchor(): HTMLElement | null {\n if (this.anchor) return this.anchor;\n if (this.anchorId) return document.getElementById(this.anchorId);\n return null;\n }\n\n private get anchorFocusTarget(): HTMLElement | null {\n const anchor = this.resolvedAnchor;\n if (!anchor) return null;\n if (anchor.matches(MENU_FOCUSABLE_SELECTOR)) return anchor;\n return anchor.querySelector<HTMLElement>(MENU_FOCUSABLE_SELECTOR) ?? anchor;\n }\n\n private focusAnchor() {\n const anchor = this.resolvedAnchor as\n | (HTMLElement & { setFocus?: () => Promise<void> | void })\n | null;\n if (anchor?.setFocus) {\n anchor.setFocus();\n return;\n }\n this.anchorFocusTarget?.focus();\n }\n\n private moveFocusAfterTab(backwards: boolean) {\n const anchor = this.anchorFocusTarget;\n if (!anchor) return;\n if (backwards) {\n anchor.focus();\n return;\n }\n\n const candidates = Array.from(\n document.querySelectorAll<HTMLElement>(MENU_FOCUSABLE_SELECTOR)\n ).filter(\n element =>\n !element.closest('.menu-popup') &&\n !element.closest('[inert]') &&\n element.getClientRects().length > 0\n );\n const index = candidates.indexOf(anchor);\n (candidates[index + 1] ?? anchor).focus();\n }\n\n private compositeTabLeavesPopup(event: KeyboardEvent): boolean {\n const popup = this.el.querySelector<HTMLElement>('.menu-popup');\n if (!popup) return true;\n const focusables = Array.from(\n popup.querySelectorAll<HTMLElement>(MENU_FOCUSABLE_SELECTOR)\n ).filter(element => element.getClientRects().length > 0);\n const currentIndex = focusables.indexOf(event.target as HTMLElement);\n if (currentIndex < 0) return true;\n return event.shiftKey ? currentIndex === 0 : currentIndex === focusables.length - 1;\n }\n\n private get activeSections(): MenuSection[] {\n if (this.sections.length > 0) return this.sections;\n if (this.items.length > 0) return [{ items: this.items }];\n return [];\n }\n\n private get flatItems(): MenuItemData[] {\n return this.activeSections.flatMap(section =>\n isMenuPickerSection(section) ? [] : section.items\n );\n }\n\n /** Rich preference content is a non-modal dialog, not an ARIA action menu. */\n private get hasCompositeSections(): boolean {\n return this.activeSections.some(isMenuPickerSection);\n }\n\n private cancelPositionRetry() {\n if (this.positionRetryRaf !== null) {\n cancelAnimationFrame(this.positionRetryRaf);\n this.positionRetryRaf = null;\n }\n }\n\n private cancelLivePositionUpdate() {\n if (this.livePositionRaf !== null) {\n cancelAnimationFrame(this.livePositionRaf);\n this.livePositionRaf = null;\n }\n }\n\n /** Reposition after the current scroll/layout frame without hiding the open popup. */\n private scheduleLivePositionUpdate() {\n if (this.livePositionRaf !== null) return;\n this.livePositionRaf = requestAnimationFrame(() => {\n if (this.shouldRender && !this.closing) this.calculatePosition();\n // Scroll-driven owners such as ShellPage may commit their compact header\n // render in this frame. Re-read once after that render, then stop tracking.\n this.livePositionRaf = requestAnimationFrame(() => {\n this.livePositionRaf = null;\n if (this.shouldRender && !this.closing) this.calculatePosition();\n });\n });\n }\n\n /** Retry until anchor + popup exist — do not reveal at 0,0 on a failed first pass. */\n private schedulePositionUpdate(onReady?: () => void) {\n if (!this.open) return;\n\n this.cancelPositionRetry();\n this.positionReady = false;\n\n let remaining = POSITION_RETRY_BUDGET;\n\n const attempt = () => {\n this.positionRetryRaf = null;\n if (!this.open) return;\n\n if (this.calculatePosition()) {\n this.positionReady = true;\n onReady?.();\n return;\n }\n\n if (remaining > 0) {\n remaining -= 1;\n this.positionRetryRaf = requestAnimationFrame(attempt);\n }\n };\n\n this.positionRetryRaf = requestAnimationFrame(attempt);\n }\n\n /** @returns `true` when anchor and popup were found and `pos` was updated. */\n private calculatePosition(): boolean {\n const anchorEl = this.resolvedAnchor;\n if (!anchorEl) return false;\n const popup = this.el.querySelector('.menu-popup') as HTMLElement | null;\n if (!popup) return false;\n\n const anchorRect = anchorEl.getBoundingClientRect();\n const sectionInsetPx = this.viewportPadPx;\n if (!this.minWidth) {\n if (\n this.anchorAlignment === 'choice-cell' &&\n (this.side === 'top' || this.side === 'bottom')\n ) {\n popup.style.minWidth = `max(var(--dimension-menu-width-xs), ${choicePopupMinWidth(\n anchorRect.width,\n sectionInsetPx\n )}px)`;\n } else {\n popup.style.removeProperty('min-width');\n }\n }\n\n const next = computeMenuPosition({\n anchorRect,\n popupWidth: popup.offsetWidth || this.popupFallbackWidthPx,\n popupHeight: popup.offsetHeight || this.popupFallbackHeightPx,\n side: this.side,\n align: this.align,\n sideOffsetPx: this.sideOffsetPx,\n alignOffsetPx: resolveChoicePopupAlignOffset({\n align: this.align,\n alignOffsetPx: this.alignOffsetPx,\n sectionInsetPx,\n anchorAlignment: this.anchorAlignment,\n }),\n viewportPadPx: this.viewportPadPx,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n });\n if (next.x !== this.pos.x || next.y !== this.pos.y) this.pos = next;\n return true;\n }\n\n /** Focus the selected item when present, otherwise the first enabled item. */\n private focusInitialItem() {\n if (this.hasCompositeSections) {\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>('.menu-popup [tabindex=\"0\"]')?.focus();\n });\n return;\n }\n\n const flat = this.flatItems;\n const selectedIdx = flat.findIndex(it => it.isSelected && !it.isInactive);\n const firstEnabledIdx = flat.findIndex(it => !it.isInactive);\n this.focusedIndex = selectedIdx >= 0 ? selectedIdx : firstEnabledIdx >= 0 ? firstEnabledIdx : 0;\n\n requestAnimationFrame(() => {\n const btns = this.el.querySelectorAll<HTMLElement>('.menu-item');\n btns[this.focusedIndex]?.focus();\n });\n }\n\n private setupListeners() {\n this.clickOutsideHandler = (e: MouseEvent) => {\n const t = e.target as Node;\n const popup = this.el.querySelector('.menu-popup');\n const anchorEl = this.resolvedAnchor;\n if (popup?.contains(t) || anchorEl?.contains(t)) return;\n this.close();\n };\n\n this.scrollResizeHandler = () => this.scheduleLivePositionUpdate();\n\n document.addEventListener('mousedown', this.clickOutsideHandler, true);\n window.addEventListener('scroll', this.scrollResizeHandler, true);\n window.addEventListener('resize', this.scrollResizeHandler);\n }\n\n private teardownListeners() {\n this.cancelLivePositionUpdate();\n if (this.clickOutsideHandler) {\n document.removeEventListener('mousedown', this.clickOutsideHandler, true);\n this.clickOutsideHandler = null;\n }\n if (this.scrollResizeHandler) {\n window.removeEventListener('scroll', this.scrollResizeHandler, true);\n window.removeEventListener('resize', this.scrollResizeHandler);\n this.scrollResizeHandler = null;\n }\n if (this.closeTimer) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private close(restoreFocus = true) {\n this.captureClosingSections();\n if (restoreFocus) this.focusAnchor();\n this.dsClose.emit();\n this.open = false;\n this.onOpenChange(false);\n }\n\n @Listen('keydown')\n handleKeyDown(e: KeyboardEvent) {\n if (!this.shouldRender || this.closing) return;\n\n if (e.key === 'Escape') {\n e.preventDefault();\n this.close();\n return;\n }\n\n if (e.key === 'Tab') {\n if (this.hasCompositeSections && !this.compositeTabLeavesPopup(e)) return;\n e.preventDefault();\n this.close(false);\n this.moveFocusAfterTab(e.shiftKey);\n return;\n }\n\n if (this.hasCompositeSections) return;\n\n const flat = this.flatItems;\n const enabled = flat\n .map((it, i) => ({ it, i }))\n .filter(({ it }) => !it.isInactive)\n .map(({ i }) => i);\n if (!enabled.length) return;\n\n const cur = enabled.indexOf(this.focusedIndex);\n const safe = cur < 0 ? 0 : cur;\n\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n e.stopPropagation();\n this.focusRingVisible = true;\n this.focusedIndex = enabled[(safe + 1) % enabled.length];\n this.focusItem(this.focusedIndex);\n break;\n case 'ArrowUp':\n e.preventDefault();\n e.stopPropagation();\n this.focusRingVisible = true;\n this.focusedIndex = enabled[(safe - 1 + enabled.length) % enabled.length];\n this.focusItem(this.focusedIndex);\n break;\n case 'Home':\n e.preventDefault();\n e.stopPropagation();\n this.focusRingVisible = true;\n this.focusedIndex = enabled[0];\n this.focusItem(this.focusedIndex);\n break;\n case 'End':\n e.preventDefault();\n e.stopPropagation();\n this.focusRingVisible = true;\n this.focusedIndex = enabled[enabled.length - 1];\n this.focusItem(this.focusedIndex);\n break;\n }\n }\n\n private focusItem(idx: number) {\n const btns = this.el.querySelectorAll<HTMLElement>('.menu-item');\n btns[idx]?.focus();\n }\n\n private handleItemClick(item: MenuItemData) {\n if (item.isInactive) return;\n // Consumers commonly change the item source while handling selection.\n // Capture first so the exit animation never paints the next menu context.\n this.captureClosingSections();\n this.dsSelect.emit(item);\n }\n\n private handleGradientSelect(preset: ShellGradientPreset) {\n this.dsGradientSelect.emit(preset);\n }\n\n private handleSwatchSelect(value: string) {\n this.dsSwatchSelect.emit(value);\n }\n\n render() {\n if (!this.shouldRender) return <Host style={{ display: 'contents' }} />;\n\n const sections = this.closing\n ? (this.closingSections ?? this.lastRenderedSections)\n : this.activeSections;\n const hasCompositeSections = sections.some(isMenuPickerSection);\n if (!this.closing) {\n this.lastRenderedSections = snapshotMenuSections(sections);\n this.closingSections = null;\n }\n let flatIdx = 0;\n\n const popupStyle: Record<string, string> = {\n position: 'fixed',\n left: '0',\n top: '0',\n transform: `translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,\n zIndex: '9998',\n visibility: this.positionReady ? 'visible' : 'hidden',\n };\n\n if (this.menuWidth) popupStyle['width'] = this.menuWidth;\n if (this.minWidth) popupStyle['min-width'] = this.minWidth;\n\n return (\n <Host style={{ display: 'contents' }}>\n <div\n popover=\"manual\"\n class={{\n 'menu-popup': true,\n 'menu-popup--closing': this.closing,\n 'ds-choice-popup': true,\n 'ds-choice-popup--closing': this.closing,\n }}\n style={popupStyle}\n role={hasCompositeSections ? 'dialog' : 'menu'}\n aria-label={this.menuLabel}\n aria-orientation={hasCompositeSections ? undefined : 'vertical'}\n >\n <div class=\"ds-choice-list\">\n {sections.map((section, si) => (\n <div\n key={si}\n class={{\n 'menu-section': true,\n 'menu-section--divided': si < sections.length - 1,\n 'menu-section--gradient-picker': isMenuPickerSection(section),\n 'ds-choice-section': true,\n 'ds-choice-section--divided': si < sections.length - 1,\n }}\n role={section.header ? 'group' : undefined}\n aria-label={section.header}\n >\n {section.header && (\n <ds-text\n class=\"section-header ds-choice-section__header ds-control--md\"\n as=\"span\"\n variant=\"text-body-small\"\n emphasis\n color=\"primary\"\n aria-hidden=\"true\"\n >\n {section.header}\n </ds-text>\n )}\n {isMenuGradientPickerSection(section) ? (\n <ds-swatch-picker\n value={section.value}\n groupLabel={section.header ?? 'Shell gradient theme'}\n sections={shellGradientPickerSections()}\n onDsChange={(e: CustomEvent<string>) => {\n e.stopPropagation();\n this.handleGradientSelect(e.detail as ShellGradientPreset);\n }}\n />\n ) : isMenuSwatchPickerSection(section) ? (\n <ds-swatch-picker\n value={section.value}\n groupLabel={section.groupLabel ?? section.header ?? 'Swatch options'}\n options={section.options ?? []}\n sections={section.sections ?? []}\n onDsChange={(e: CustomEvent<string>) => {\n e.stopPropagation();\n this.handleSwatchSelect(e.detail);\n }}\n />\n ) : (\n section.items.map(item => {\n const idx = flatIdx++;\n const isFocused = this.focusedIndex === idx;\n const isRadioItem =\n !hasCompositeSections &&\n this.selectionMode === 'single' &&\n !item.showSwitch;\n return (\n <button\n key={idx}\n type=\"button\"\n class={{\n 'menu-item': true,\n 'ds-choice-item': true,\n 'ds-control--md': true,\n 'ds-focus-ring-inset': true,\n 'ds-focus-ring--visible': isFocused && this.focusRingVisible,\n 'ds-interaction-fill': !item.isInactive,\n 'ds-interaction-fill--selected': !!item.isSelected && !item.isInactive,\n 'menu-item--selected': !!item.isSelected,\n 'ds-control-inactive': !!item.isInactive,\n 'menu-item--destructive': !!item.isDestructive,\n 'menu-item--focused': isFocused,\n }}\n role={\n hasCompositeSections\n ? undefined\n : item.showSwitch\n ? 'menuitemcheckbox'\n : isRadioItem\n ? 'menuitemradio'\n : 'menuitem'\n }\n aria-checked={\n !hasCompositeSections && item.showSwitch\n ? String(!!item.switchValue)\n : isRadioItem\n ? String(!!item.isSelected)\n : undefined\n }\n aria-pressed={\n hasCompositeSections\n ? String(item.showSwitch ? !!item.switchValue : !!item.isSelected)\n : undefined\n }\n aria-current={\n !hasCompositeSections &&\n !item.showSwitch &&\n !isRadioItem &&\n item.isSelected\n ? 'true'\n : undefined\n }\n disabled={item.isInactive}\n tabIndex={hasCompositeSections ? 0 : isFocused ? 0 : -1}\n onMouseDown={() => {\n this.focusRingVisible = false;\n }}\n onClick={() => this.handleItemClick(item)}\n onFocus={() => {\n this.focusedIndex = idx;\n }}\n >\n {isRadioItem && (\n <span\n class=\"menu-item__radio-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <span\n class={{\n 'menu-item__radio': true,\n 'menu-item__radio--checked': !!item.isSelected,\n }}\n >\n {item.isSelected && <span class=\"menu-item__radio-dot\" />}\n </span>\n </span>\n )}\n <div class=\"menu-item__content ds-choice-item__content ds-interaction-fill__content\">\n <ds-text\n class=\"menu-item__label ds-choice-item__label\"\n as=\"span\"\n variant=\"text-body-medium\"\n color={item.isSelected ? 'primary' : 'secondary'}\n >\n {item.label}\n </ds-text>\n {item.subtext && (\n <ds-text\n class=\"menu-item__subtext ds-choice-item__subtext\"\n as=\"span\"\n variant=\"text-body-small\"\n color=\"secondary\"\n >\n {item.subtext}\n </ds-text>\n )}\n </div>\n {item.dot && (\n <span\n class=\"menu-item__dot-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-badge\n class=\"menu-item__dot\"\n variant=\"dot\"\n hasRing={false}\n label=\"\"\n />\n </span>\n )}\n {item.showSwitch && (\n <ds-switch\n class=\"menu-item__switch ds-interaction-fill__content\"\n size=\"md\"\n checked={!!item.switchValue}\n presentation\n />\n )}\n </button>\n );\n })\n )}\n </div>\n ))}\n </div>\n </div>\n </Host>\n );\n }\n}\n",
478
+ "content": "import {\n Component,\n Prop,\n State,\n Event,\n EventEmitter,\n Element,\n Watch,\n Listen,\n h,\n Host,\n} from '@stencil/core';\nimport {\n choicePopupMinWidth,\n resolveChoicePopupAlignOffset,\n resolveCssLengthPx,\n resolveMotionTimeMs,\n TOKEN_CSS_LENGTHS,\n TOKEN_DEFAULTS,\n type ChoicePopupAnchorAlignment,\n} from '../../utils';\nimport { computeMenuPosition, type MenuAlign, type MenuSide } from './menu-position';\nimport type { MenuItemData, MenuSection } from './menu-types';\n\nexport type MenuSelectionMode = 'none' | 'single';\nimport {\n isMenuGradientPickerSection,\n isMenuPickerSection,\n isMenuSwatchPickerSection,\n} from './menu-types';\nimport {\n shellGradientPickerSections,\n type ShellGradientPreset,\n} from '../../shell/shell-gradient-presets';\n\n/** rAF retries while the popup mounts or the anchor resolves. */\nconst POSITION_RETRY_BUDGET = 8;\nconst MENU_FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\nfunction snapshotMenuSections(sections: MenuSection[]): MenuSection[] {\n return sections.map(section => {\n if (isMenuGradientPickerSection(section)) return { ...section };\n if (isMenuSwatchPickerSection(section)) {\n return {\n ...section,\n options: section.options?.map(option => ({ ...option })),\n sections: section.sections?.map(swatchSection => ({\n ...swatchSection,\n options: swatchSection.options.map(option => ({ ...option })),\n })),\n };\n }\n return { ...section, items: section.items.map(item => ({ ...item })) };\n });\n}\n\n@Component({\n tag: 'ds-menu',\n styleUrl: 'Menu.css',\n scoped: true,\n})\nexport class Menu {\n @Element() el!: HTMLElement;\n\n @Prop({ mutable: true }) open: boolean = false;\n @Prop() items: MenuItemData[] = [];\n /** Give ordinary rows mutually-exclusive menu semantics using isSelected. */\n @Prop() selectionMode: MenuSelectionMode = 'none';\n @Prop() sections: MenuSection[] = [];\n /** Preferred side; placement flips to the opposite side when that offers a better fit. */\n @Prop() side: MenuSide = 'bottom';\n @Prop() align: MenuAlign = 'start';\n /** Align choice-row edges to the anchor by default; use `popup-frame` only for custom frame geometry. */\n @Prop() anchorAlignment: ChoicePopupAnchorAlignment = 'choice-cell';\n /** Gap between anchor and menu — number (px) or TokoMo length (`var(--dimension-space-050)`, etc.). */\n @Prop() sideOffset: number | string = TOKEN_CSS_LENGTHS.space050;\n /** Cross-axis offset — number (px) or TokoMo length. */\n @Prop() alignOffset: number | string = 0;\n @Prop() menuWidth: string | undefined;\n @Prop() minWidth: string | undefined;\n /** External trigger element to position against. Set via JS: menuEl.anchor = buttonEl */\n @Prop() anchor: HTMLElement | undefined;\n /** ID of the external trigger element for positioning */\n @Prop() anchorId: string | undefined;\n /** Show a visible ring on the initially focused menu item. Use only when the opener was keyboard-driven. */\n @Prop() initialFocusVisible: boolean = false;\n /** Accessible name for the popup menu. */\n @Prop() menuLabel: string = 'Menu';\n\n @State() private shouldRender: boolean = false;\n @State() private closing: boolean = false;\n @State() private pos: { x: number; y: number } = { x: 0, y: 0 };\n @State() private focusedIndex: number = 0;\n @State() private positionReady: boolean = false;\n @State() private focusRingVisible: boolean = false;\n\n @Event() dsClose!: EventEmitter<void>;\n /** Emitted after the popup's exit motion is complete and its rendered content is removed. */\n @Event() dsAfterClose!: EventEmitter<void>;\n @Event() dsSelect!: EventEmitter<MenuItemData>;\n /** Emitted when a `gradient-picker` section swatch is chosen. */\n @Event() dsGradientSelect!: EventEmitter<ShellGradientPreset>;\n /** Emitted when a generic `swatch-picker` section option is chosen. */\n @Event() dsSwatchSelect!: EventEmitter<string>;\n\n private clickOutsideHandler: ((e: MouseEvent) => void) | null = null;\n private scrollResizeHandler: (() => void) | null = null;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private positionRetryRaf: number | null = null;\n private livePositionRaf: number | null = null;\n /** Last content actually painted while open; retained unchanged through exit motion. */\n private lastRenderedSections: MenuSection[] = [];\n private closingSections: MenuSection[] | null = null;\n\n componentDidLoad() {\n if (this.open) this.onOpenChange(true);\n }\n\n componentDidRender() {\n if (!this.shouldRender) return;\n const popup = this.el.querySelector<HTMLElement>('.menu-popup');\n if (!popup || typeof popup.showPopover !== 'function') return;\n if (!popup.matches(':popover-open')) popup.showPopover();\n }\n\n disconnectedCallback() {\n this.cancelPositionRetry();\n this.cancelLivePositionUpdate();\n this.teardownListeners();\n }\n\n @Watch('open')\n onOpenChange(isOpen: boolean) {\n if (isOpen) {\n this.teardownListeners();\n this.closingSections = null;\n this.shouldRender = true;\n this.closing = false;\n this.positionReady = false;\n this.focusRingVisible = this.initialFocusVisible;\n this.setupListeners();\n this.schedulePositionUpdate(() => {\n this.focusInitialItem();\n });\n } else if (this.shouldRender) {\n this.cancelPositionRetry();\n this.captureClosingSections();\n this.closing = true;\n this.teardownListeners();\n const closeAnimationMs = this.closeAnimationMs;\n if (closeAnimationMs <= 0) {\n this.finishClose();\n return;\n }\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n this.finishClose();\n }, closeAnimationMs);\n }\n }\n\n @Watch('anchor')\n @Watch('anchorId')\n onAnchorChange() {\n if (this.open) this.schedulePositionUpdate();\n }\n\n @Watch('side')\n @Watch('align')\n @Watch('anchorAlignment')\n @Watch('sideOffset')\n @Watch('alignOffset')\n onPositionPropsChange() {\n if (this.open) this.schedulePositionUpdate();\n }\n\n private get viewportPadPx(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n }\n\n private get sideOffsetPx(): number {\n return resolveCssLengthPx(this.sideOffset, TOKEN_DEFAULTS.space050);\n }\n\n private get alignOffsetPx(): number {\n return resolveCssLengthPx(this.alignOffset, 0);\n }\n\n private get popupFallbackWidthPx(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuWidthXs, TOKEN_DEFAULTS.menuWidthXs);\n }\n\n private get popupFallbackHeightPx(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuFallbackHeight, TOKEN_DEFAULTS.menuFallbackHeight);\n }\n\n private get closeAnimationMs(): number {\n return resolveMotionTimeMs(TOKEN_DEFAULTS.motionShort2, TOKEN_DEFAULTS.animationDurationShort3);\n }\n\n private finishClose() {\n const popup = this.el.querySelector<HTMLElement>('.menu-popup');\n if (popup?.matches(':popover-open')) popup.hidePopover();\n this.shouldRender = false;\n this.closing = false;\n this.lastRenderedSections = [];\n this.closingSections = null;\n this.dsAfterClose.emit();\n }\n\n private captureClosingSections() {\n if (this.closingSections) return;\n const visibleSections = this.lastRenderedSections.length\n ? this.lastRenderedSections\n : this.activeSections;\n this.closingSections = snapshotMenuSections(visibleSections);\n }\n\n private get resolvedAnchor(): HTMLElement | null {\n if (this.anchor) return this.anchor;\n if (this.anchorId) return document.getElementById(this.anchorId);\n return null;\n }\n\n private get anchorFocusTarget(): HTMLElement | null {\n const anchor = this.resolvedAnchor;\n if (!anchor) return null;\n if (anchor.matches(MENU_FOCUSABLE_SELECTOR)) return anchor;\n return anchor.querySelector<HTMLElement>(MENU_FOCUSABLE_SELECTOR) ?? anchor;\n }\n\n private focusAnchor() {\n const anchor = this.resolvedAnchor as\n | (HTMLElement & { setFocus?: () => Promise<void> | void })\n | null;\n if (anchor?.setFocus) {\n anchor.setFocus();\n return;\n }\n this.anchorFocusTarget?.focus();\n }\n\n private moveFocusAfterTab(backwards: boolean) {\n const anchor = this.anchorFocusTarget;\n if (!anchor) return;\n if (backwards) {\n anchor.focus();\n return;\n }\n\n const candidates = Array.from(\n document.querySelectorAll<HTMLElement>(MENU_FOCUSABLE_SELECTOR)\n ).filter(\n element =>\n !element.closest('.menu-popup') &&\n !element.closest('[inert]') &&\n element.getClientRects().length > 0\n );\n const index = candidates.indexOf(anchor);\n (candidates[index + 1] ?? anchor).focus();\n }\n\n private compositeTabLeavesPopup(event: KeyboardEvent): boolean {\n const popup = this.el.querySelector<HTMLElement>('.menu-popup');\n if (!popup) return true;\n const focusables = Array.from(\n popup.querySelectorAll<HTMLElement>(MENU_FOCUSABLE_SELECTOR)\n ).filter(element => element.getClientRects().length > 0);\n const currentIndex = focusables.indexOf(event.target as HTMLElement);\n if (currentIndex < 0) return true;\n return event.shiftKey ? currentIndex === 0 : currentIndex === focusables.length - 1;\n }\n\n private get activeSections(): MenuSection[] {\n if (this.sections.length > 0) return this.sections;\n if (this.items.length > 0) return [{ items: this.items }];\n return [];\n }\n\n private get flatItems(): MenuItemData[] {\n return this.activeSections.flatMap(section =>\n isMenuPickerSection(section) ? [] : section.items\n );\n }\n\n /** Rich preference content is a non-modal dialog, not an ARIA action menu. */\n private get hasCompositeSections(): boolean {\n return this.activeSections.some(isMenuPickerSection);\n }\n\n private cancelPositionRetry() {\n if (this.positionRetryRaf !== null) {\n cancelAnimationFrame(this.positionRetryRaf);\n this.positionRetryRaf = null;\n }\n }\n\n private cancelLivePositionUpdate() {\n if (this.livePositionRaf !== null) {\n cancelAnimationFrame(this.livePositionRaf);\n this.livePositionRaf = null;\n }\n }\n\n /** Reposition after the current scroll/layout frame without hiding the open popup. */\n private scheduleLivePositionUpdate() {\n if (this.livePositionRaf !== null) return;\n this.livePositionRaf = requestAnimationFrame(() => {\n if (this.shouldRender && !this.closing) this.calculatePosition();\n // Scroll-driven owners such as ShellPage may commit their compact header\n // render in this frame. Re-read once after that render, then stop tracking.\n this.livePositionRaf = requestAnimationFrame(() => {\n this.livePositionRaf = null;\n if (this.shouldRender && !this.closing) this.calculatePosition();\n });\n });\n }\n\n /** Retry until anchor + popup exist — do not reveal at 0,0 on a failed first pass. */\n private schedulePositionUpdate(onReady?: () => void) {\n if (!this.open) return;\n\n this.cancelPositionRetry();\n this.positionReady = false;\n\n let remaining = POSITION_RETRY_BUDGET;\n\n const attempt = () => {\n this.positionRetryRaf = null;\n if (!this.open) return;\n\n if (this.calculatePosition()) {\n this.positionReady = true;\n onReady?.();\n return;\n }\n\n if (remaining > 0) {\n remaining -= 1;\n this.positionRetryRaf = requestAnimationFrame(attempt);\n }\n };\n\n this.positionRetryRaf = requestAnimationFrame(attempt);\n }\n\n /** @returns `true` when anchor and popup were found and `pos` was updated. */\n private calculatePosition(): boolean {\n const anchorEl = this.resolvedAnchor;\n if (!anchorEl) return false;\n const popup = this.el.querySelector('.menu-popup') as HTMLElement | null;\n if (!popup) return false;\n\n const anchorRect = anchorEl.getBoundingClientRect();\n const sectionInsetPx = this.viewportPadPx;\n if (!this.minWidth) {\n if (\n this.anchorAlignment === 'choice-cell' &&\n (this.side === 'top' || this.side === 'bottom')\n ) {\n popup.style.minWidth = `max(var(--dimension-menu-width-xs), ${choicePopupMinWidth(\n anchorRect.width,\n sectionInsetPx\n )}px)`;\n } else {\n popup.style.removeProperty('min-width');\n }\n }\n\n const next = computeMenuPosition({\n anchorRect,\n popupWidth: popup.offsetWidth || this.popupFallbackWidthPx,\n popupHeight: popup.offsetHeight || this.popupFallbackHeightPx,\n side: this.side,\n align: this.align,\n sideOffsetPx: this.sideOffsetPx,\n alignOffsetPx: resolveChoicePopupAlignOffset({\n align: this.align,\n alignOffsetPx: this.alignOffsetPx,\n sectionInsetPx,\n anchorAlignment: this.anchorAlignment,\n }),\n viewportPadPx: this.viewportPadPx,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n });\n if (next.x !== this.pos.x || next.y !== this.pos.y) this.pos = next;\n return true;\n }\n\n /** Focus the selected item when present, otherwise the first enabled item. */\n private focusInitialItem() {\n if (this.hasCompositeSections) {\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>('.menu-popup [tabindex=\"0\"]')?.focus();\n });\n return;\n }\n\n const flat = this.flatItems;\n const selectedIdx = flat.findIndex(it => it.isSelected && !it.isInactive);\n const firstEnabledIdx = flat.findIndex(it => !it.isInactive);\n this.focusedIndex = selectedIdx >= 0 ? selectedIdx : firstEnabledIdx >= 0 ? firstEnabledIdx : 0;\n\n requestAnimationFrame(() => {\n const btns = this.el.querySelectorAll<HTMLElement>('.menu-item');\n btns[this.focusedIndex]?.focus();\n });\n }\n\n private setupListeners() {\n this.clickOutsideHandler = (e: MouseEvent) => {\n const t = e.target as Node;\n const popup = this.el.querySelector('.menu-popup');\n const anchorEl = this.resolvedAnchor;\n if (popup?.contains(t) || anchorEl?.contains(t)) return;\n this.close();\n };\n\n this.scrollResizeHandler = () => this.scheduleLivePositionUpdate();\n\n document.addEventListener('mousedown', this.clickOutsideHandler, true);\n window.addEventListener('scroll', this.scrollResizeHandler, true);\n window.addEventListener('resize', this.scrollResizeHandler);\n }\n\n private teardownListeners() {\n this.cancelLivePositionUpdate();\n if (this.clickOutsideHandler) {\n document.removeEventListener('mousedown', this.clickOutsideHandler, true);\n this.clickOutsideHandler = null;\n }\n if (this.scrollResizeHandler) {\n window.removeEventListener('scroll', this.scrollResizeHandler, true);\n window.removeEventListener('resize', this.scrollResizeHandler);\n this.scrollResizeHandler = null;\n }\n if (this.closeTimer) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private close(restoreFocus = true) {\n this.captureClosingSections();\n if (restoreFocus) this.focusAnchor();\n this.dsClose.emit();\n this.open = false;\n this.onOpenChange(false);\n }\n\n @Listen('keydown')\n handleKeyDown(e: KeyboardEvent) {\n if (!this.shouldRender || this.closing) return;\n\n if (e.key === 'Escape') {\n e.preventDefault();\n this.close();\n return;\n }\n\n if (e.key === 'Tab') {\n if (this.hasCompositeSections && !this.compositeTabLeavesPopup(e)) return;\n e.preventDefault();\n this.close(false);\n this.moveFocusAfterTab(e.shiftKey);\n return;\n }\n\n if (this.hasCompositeSections) return;\n\n const flat = this.flatItems;\n const enabled = flat\n .map((it, i) => ({ it, i }))\n .filter(({ it }) => !it.isInactive)\n .map(({ i }) => i);\n if (!enabled.length) return;\n\n const cur = enabled.indexOf(this.focusedIndex);\n const safe = cur < 0 ? 0 : cur;\n\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n e.stopPropagation();\n this.focusRingVisible = true;\n this.focusedIndex = enabled[(safe + 1) % enabled.length];\n this.focusItem(this.focusedIndex);\n break;\n case 'ArrowUp':\n e.preventDefault();\n e.stopPropagation();\n this.focusRingVisible = true;\n this.focusedIndex = enabled[(safe - 1 + enabled.length) % enabled.length];\n this.focusItem(this.focusedIndex);\n break;\n case 'Home':\n e.preventDefault();\n e.stopPropagation();\n this.focusRingVisible = true;\n this.focusedIndex = enabled[0];\n this.focusItem(this.focusedIndex);\n break;\n case 'End':\n e.preventDefault();\n e.stopPropagation();\n this.focusRingVisible = true;\n this.focusedIndex = enabled[enabled.length - 1];\n this.focusItem(this.focusedIndex);\n break;\n }\n }\n\n private focusItem(idx: number) {\n const btns = this.el.querySelectorAll<HTMLElement>('.menu-item');\n btns[idx]?.focus();\n }\n\n private handleItemClick(item: MenuItemData) {\n if (item.isInactive) return;\n // Consumers commonly change the item source while handling selection.\n // Capture first so the exit animation never paints the next menu context.\n this.captureClosingSections();\n this.dsSelect.emit(item);\n }\n\n private handleGradientSelect(preset: ShellGradientPreset) {\n this.dsGradientSelect.emit(preset);\n }\n\n private handleSwatchSelect(value: string) {\n this.dsSwatchSelect.emit(value);\n }\n\n render() {\n if (!this.shouldRender) return <Host style={{ display: 'contents' }} />;\n\n const sections = this.closing\n ? (this.closingSections ?? this.lastRenderedSections)\n : this.activeSections;\n const hasCompositeSections = sections.some(isMenuPickerSection);\n if (!this.closing) {\n this.lastRenderedSections = snapshotMenuSections(sections);\n this.closingSections = null;\n }\n let flatIdx = 0;\n\n const popupStyle: Record<string, string> = {\n position: 'fixed',\n left: '0',\n top: '0',\n transform: `translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,\n zIndex: '9998',\n visibility: this.positionReady ? 'visible' : 'hidden',\n };\n\n if (this.menuWidth) popupStyle['width'] = this.menuWidth;\n if (this.minWidth) popupStyle['min-width'] = this.minWidth;\n\n return (\n <Host style={{ display: 'contents' }}>\n <div\n popover=\"manual\"\n class={{\n 'menu-popup': true,\n 'menu-popup--closing': this.closing,\n 'ds-choice-popup': true,\n 'ds-choice-popup--closing': this.closing,\n }}\n style={popupStyle}\n role={hasCompositeSections ? 'dialog' : 'menu'}\n aria-label={this.menuLabel}\n aria-orientation={hasCompositeSections ? undefined : 'vertical'}\n >\n <div class=\"ds-choice-list\">\n {sections.map((section, si) => (\n <div\n key={si}\n class={{\n 'menu-section': true,\n 'menu-section--divided': si < sections.length - 1,\n 'menu-section--gradient-picker': isMenuPickerSection(section),\n 'ds-choice-section': true,\n 'ds-choice-section--divided': si < sections.length - 1,\n }}\n role={section.header ? 'group' : undefined}\n aria-label={section.header}\n >\n {section.header && (\n <ds-text\n class=\"section-header ds-choice-section__header ds-control--md\"\n as=\"span\"\n variant=\"text-body-small\"\n emphasis\n color=\"primary\"\n aria-hidden=\"true\"\n >\n {section.header}\n </ds-text>\n )}\n {isMenuGradientPickerSection(section) ? (\n <ds-swatch-picker\n value={section.value}\n groupLabel={section.header ?? 'Shell gradient theme'}\n sections={shellGradientPickerSections()}\n onDsChange={(e: CustomEvent<string>) => {\n e.stopPropagation();\n this.handleGradientSelect(e.detail as ShellGradientPreset);\n }}\n />\n ) : isMenuSwatchPickerSection(section) ? (\n <ds-swatch-picker\n value={section.value}\n groupLabel={section.groupLabel ?? section.header ?? 'Swatch options'}\n options={section.options ?? []}\n sections={section.sections ?? []}\n onDsChange={(e: CustomEvent<string>) => {\n e.stopPropagation();\n this.handleSwatchSelect(e.detail);\n }}\n />\n ) : (\n section.items.map(item => {\n const idx = flatIdx++;\n const isFocused = this.focusedIndex === idx;\n const isSingleSelectionItem =\n !hasCompositeSections &&\n this.selectionMode === 'single' &&\n !item.showSwitch;\n return (\n <button\n key={idx}\n type=\"button\"\n class={{\n 'menu-item': true,\n 'ds-choice-item': true,\n 'ds-control--md': true,\n 'ds-focus-ring-inset': true,\n 'ds-focus-ring--visible': isFocused && this.focusRingVisible,\n 'ds-interaction-fill': !item.isInactive,\n 'ds-interaction-fill--selected': !!item.isSelected && !item.isInactive,\n 'menu-item--selected': !!item.isSelected,\n 'ds-control-inactive': !!item.isInactive,\n 'menu-item--destructive': !!item.isDestructive,\n 'menu-item--focused': isFocused,\n }}\n role={\n hasCompositeSections\n ? undefined\n : item.showSwitch\n ? 'menuitemcheckbox'\n : isSingleSelectionItem\n ? 'menuitemradio'\n : 'menuitem'\n }\n aria-checked={\n !hasCompositeSections && item.showSwitch\n ? String(!!item.switchValue)\n : isSingleSelectionItem\n ? String(!!item.isSelected)\n : undefined\n }\n aria-pressed={\n hasCompositeSections\n ? String(item.showSwitch ? !!item.switchValue : !!item.isSelected)\n : undefined\n }\n aria-current={\n !hasCompositeSections &&\n !item.showSwitch &&\n !isSingleSelectionItem &&\n item.isSelected\n ? 'true'\n : undefined\n }\n disabled={item.isInactive}\n tabIndex={hasCompositeSections ? 0 : isFocused ? 0 : -1}\n onMouseDown={() => {\n this.focusRingVisible = false;\n }}\n onClick={() => this.handleItemClick(item)}\n onFocus={() => {\n this.focusedIndex = idx;\n }}\n >\n <div class=\"menu-item__content ds-choice-item__content ds-interaction-fill__content\">\n <ds-text\n class=\"menu-item__label ds-choice-item__label\"\n as=\"span\"\n variant=\"text-body-medium\"\n color={item.isSelected ? 'primary' : 'secondary'}\n >\n {item.label}\n </ds-text>\n {item.subtext && (\n <ds-text\n class=\"menu-item__subtext ds-choice-item__subtext\"\n as=\"span\"\n variant=\"text-body-small\"\n color=\"secondary\"\n >\n {item.subtext}\n </ds-text>\n )}\n </div>\n {item.dot && (\n <span\n class=\"menu-item__dot-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-badge\n class=\"menu-item__dot\"\n variant=\"dot\"\n hasRing={false}\n label=\"\"\n />\n </span>\n )}\n {item.showSwitch && (\n <ds-switch\n class=\"menu-item__switch ds-interaction-fill__content\"\n size=\"md\"\n checked={!!item.switchValue}\n presentation\n />\n )}\n </button>\n );\n })\n )}\n </div>\n ))}\n </div>\n </div>\n </Host>\n );\n }\n}\n",
479
479
  "type": "registry:ui"
480
480
  },
481
481
  {
@@ -39,7 +39,7 @@
39
39
  ],
40
40
  "responsiveBehavior": [
41
41
  "Render only below the mobile breakpoint and preserve safe-area clearance.",
42
- "The two icon-only control groups remain centered with fixed 40px targets and a divider between Menu and current area."
42
+ "The secondary-background bar keeps an 8px outer inset; its two icon-only groups anchor to opposite edges while retaining fixed 40px targets and a divider between Menu and current area."
43
43
  ],
44
44
  "references": [
45
45
  {
@@ -316,7 +316,7 @@
316
316
  "files": [
317
317
  {
318
318
  "path": "src/wc/components/MobileBarNav/MobileBarNav.css",
319
- "content": "@import '../../utils/focus-ring.css';\n@import '../../utils/interaction-fill.css';\n\n:host {\n display: block;\n min-width: 0;\n background: var(--color-background-primary);\n color: var(--color-foreground-tertiary);\n}\n\n.mobile-bar-nav {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--dimension-space-200);\n min-width: 0;\n padding: var(--dimension-space-200) var(--dimension-space-200)\n max(var(--dimension-space-200), env(safe-area-inset-bottom));\n border-top: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n background: var(--color-background-primary);\n box-sizing: border-box;\n}\n\n.mobile-bar-nav__group {\n display: flex;\n align-items: center;\n gap: var(--dimension-space-100);\n}\n\n.mobile-bar-nav__item {\n appearance: none;\n flex: 0 0 var(--dimension-size-500);\n width: var(--dimension-size-500);\n height: var(--dimension-size-500);\n padding: var(--dimension-space-100);\n border: 0;\n border-radius: var(--dimension-radius-025);\n background: transparent;\n color: inherit;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n\n.mobile-bar-nav__item--selected {\n color: var(--color-foreground-primary);\n}\n\n.mobile-bar-nav__divider {\n flex: 0 0 var(--dimension-stroke-width-012);\n width: var(--dimension-stroke-width-012);\n height: var(--dimension-iconography-lg);\n background: var(--color-border-tertiary);\n}\n\n.mobile-bar-nav__icon {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--dimension-iconography-lg);\n height: var(--dimension-iconography-lg);\n}\n\n.mobile-bar-nav__dot {\n position: absolute;\n inset-block-start: calc(var(--dimension-space-025) * -1);\n inset-inline-end: calc(var(--dimension-space-025) * -1);\n}\n",
319
+ "content": "@import '../../utils/focus-ring.css';\n@import '../../utils/interaction-fill.css';\n\n:host {\n display: block;\n min-width: 0;\n background: var(--color-background-secondary);\n color: var(--color-foreground-tertiary);\n}\n\n.mobile-bar-nav {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--dimension-space-200);\n min-width: 0;\n padding: var(--dimension-space-100) var(--dimension-space-100)\n max(var(--dimension-space-100), env(safe-area-inset-bottom));\n border-top: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n background: var(--color-background-secondary);\n box-sizing: border-box;\n}\n\n.mobile-bar-nav__group {\n display: flex;\n align-items: center;\n gap: var(--dimension-space-100);\n}\n\n.mobile-bar-nav__item {\n appearance: none;\n flex: 0 0 var(--dimension-size-500);\n width: var(--dimension-size-500);\n height: var(--dimension-size-500);\n padding: var(--dimension-space-100);\n border: 0;\n border-radius: var(--dimension-radius-025);\n background: transparent;\n color: inherit;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n\n.mobile-bar-nav__item--selected {\n color: var(--color-foreground-primary);\n}\n\n.mobile-bar-nav__divider {\n flex: 0 0 var(--dimension-stroke-width-012);\n width: var(--dimension-stroke-width-012);\n height: var(--dimension-iconography-lg);\n background: var(--color-border-tertiary);\n}\n\n.mobile-bar-nav__icon {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--dimension-iconography-lg);\n height: var(--dimension-iconography-lg);\n}\n\n.mobile-bar-nav__dot {\n position: absolute;\n inset-block-start: calc(var(--dimension-space-025) * -1);\n inset-inline-end: calc(var(--dimension-space-025) * -1);\n}\n",
320
320
  "type": "registry:ui"
321
321
  },
322
322
  {
@@ -30,7 +30,8 @@
30
30
  "accessibility": [
31
31
  "The trigger exposes the current section, popup relationship, and expanded state.",
32
32
  "Decorative previous and next position hints are hidden from assistive technology.",
33
- "The menu is always available so a future swipe gesture is never the only navigation mechanism."
33
+ "The menu is always available so a future swipe gesture is never the only navigation mechanism.",
34
+ "Peer destinations use menuitem semantics with aria-current on the active page; they do not present a radio-control affordance."
34
35
  ],
35
36
  "states": [
36
37
  "Selection is controlled and dsChange reports intent without mutating value.",
@@ -193,7 +194,7 @@
193
194
  },
194
195
  {
195
196
  "path": "src/wc/components/MobileSectionSwitcher/MobileSectionSwitcher.tsx",
196
- "content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport type { MenuItemData, MenuSection } from '../Menu/menu-types';\nimport {\n getSelectableTabs,\n isTabDivider,\n type TabItem,\n type TabItemTab,\n} from '../TabGroup/tab-item-utils';\nimport { resolveMobileSectionPosition } from './mobile-section-switcher-utils';\n\nlet nextMobileSectionSwitcherId = 0;\n\n@Component({\n tag: 'ds-mobile-section-switcher',\n styleUrl: 'MobileSectionSwitcher.css',\n scoped: true,\n})\nexport class MobileSectionSwitcher {\n @Element() el!: HTMLElement;\n\n /** Ordered controlled sections. Divider entries group the popup menu. */\n @Prop() sections: TabItem[] = [];\n /** JSON fallback for `sections`. */\n @Prop({ attribute: 'sections-json' }) sectionsJson: string = '';\n /** Controlled selected section id. */\n @Prop() value: string = '';\n /** Accessible name for the section chooser. */\n @Prop() navigationLabel: string = 'Change page section';\n\n /** Selection intent. The route, tool, or workflow owner updates `value`. */\n @Event() dsChange!: EventEmitter<string>;\n\n @State() private menuOpen = false;\n @State() private initialFocusVisible = false;\n\n private readonly instanceId = nextMobileSectionSwitcherId++;\n private readonly triggerId = `ds-mobile-section-switcher-trigger-${this.instanceId}`;\n private readonly menuId = `ds-mobile-section-switcher-menu-${this.instanceId}`;\n private triggerEl: HTMLButtonElement | null = null;\n\n private get resolvedSections(): TabItem[] {\n if (!this.sectionsJson.trim()) return this.sections ?? [];\n try {\n const parsed = JSON.parse(this.sectionsJson);\n return Array.isArray(parsed) ? (parsed as TabItem[]) : [];\n } catch {\n return [];\n }\n }\n\n private get selectableSections(): TabItemTab[] {\n return getSelectableTabs(this.resolvedSections);\n }\n\n private get selectedIndex(): number {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).selectedIndex;\n }\n\n private get selectedSection(): TabItemTab | undefined {\n return this.selectableSections[this.selectedIndex];\n }\n\n private get hasPrevious(): boolean {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).hasPrevious;\n }\n\n private get hasNext(): boolean {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).hasNext;\n }\n\n private get triggerAriaLabel(): string {\n return `${this.navigationLabel}. Current section: ${this.selectedSection?.label ?? ''}`;\n }\n\n private get menuSections(): MenuSection[] {\n const groups: MenuSection[] = [];\n let items: MenuItemData[] = [];\n const commit = () => {\n if (items.length) groups.push({ items });\n items = [];\n };\n\n for (const section of this.resolvedSections) {\n if (isTabDivider(section)) {\n commit();\n continue;\n }\n items.push({\n label: section.label,\n value: section.id,\n dot: section.dot,\n isSelected: section.id === this.selectedSection?.id,\n isInactive: section.isInactive,\n });\n }\n commit();\n return groups;\n }\n\n @Watch('sections')\n @Watch('sectionsJson')\n handleSectionsChange() {\n if (this.selectableSections.length <= 1) this.closeMenu();\n }\n\n private toggleMenu = (event: MouseEvent) => {\n if (this.selectableSections.length <= 1) return;\n this.initialFocusVisible = event.detail === 0;\n this.menuOpen = !this.menuOpen;\n };\n\n private closeMenu = () => {\n this.menuOpen = false;\n };\n\n private handleSelect = (event: CustomEvent<MenuItemData>) => {\n const id = String(event.detail.value ?? '');\n const section = this.selectableSections.find(candidate => candidate.id === id);\n if (!section || section.isInactive) return;\n this.closeMenu();\n if (id !== this.selectedSection?.id) this.dsChange.emit(id);\n requestAnimationFrame(() => this.triggerEl?.focus());\n };\n\n render() {\n const selected = this.selectedSection;\n if (!selected) return <Host />;\n\n return (\n <Host>\n <button\n ref={element => {\n this.triggerEl = element ?? null;\n }}\n id={this.triggerId}\n class={{\n 'mobile-section-switcher': true,\n 'mobile-section-switcher--expanded': this.menuOpen,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n }}\n type=\"button\"\n aria-haspopup=\"menu\"\n aria-controls={this.menuId}\n aria-expanded={String(this.menuOpen)}\n aria-label={this.triggerAriaLabel}\n onClick={this.toggleMenu}\n >\n <span\n class={{\n 'mobile-section-switcher__position': true,\n 'mobile-section-switcher__position--visible': this.hasPrevious,\n 'ds-interaction-fill__content': true,\n }}\n aria-hidden=\"true\"\n />\n <ds-text\n class=\"mobile-section-switcher__label ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-medium\"\n emphasis\n color=\"inherit\"\n lineTruncation={1}\n >\n {selected.label}\n </ds-text>\n <span\n class={{\n 'mobile-section-switcher__position': true,\n 'mobile-section-switcher__position--visible': this.hasNext,\n 'ds-interaction-fill__content': true,\n }}\n aria-hidden=\"true\"\n />\n </button>\n\n {this.selectableSections.length > 1 ? (\n <ds-menu\n id={this.menuId}\n anchorId={this.triggerId}\n align=\"center\"\n selectionMode=\"single\"\n menuLabel={this.navigationLabel}\n open={this.menuOpen}\n initialFocusVisible={this.initialFocusVisible}\n sections={this.menuSections}\n onDsClose={this.closeMenu}\n onDsSelect={this.handleSelect}\n />\n ) : null}\n </Host>\n );\n }\n}\n",
197
+ "content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport type { MenuItemData, MenuSection } from '../Menu/menu-types';\nimport {\n getSelectableTabs,\n isTabDivider,\n type TabItem,\n type TabItemTab,\n} from '../TabGroup/tab-item-utils';\nimport { resolveMobileSectionPosition } from './mobile-section-switcher-utils';\n\nlet nextMobileSectionSwitcherId = 0;\n\n@Component({\n tag: 'ds-mobile-section-switcher',\n styleUrl: 'MobileSectionSwitcher.css',\n scoped: true,\n})\nexport class MobileSectionSwitcher {\n @Element() el!: HTMLElement;\n\n /** Ordered controlled sections. Divider entries group the popup menu. */\n @Prop() sections: TabItem[] = [];\n /** JSON fallback for `sections`. */\n @Prop({ attribute: 'sections-json' }) sectionsJson: string = '';\n /** Controlled selected section id. */\n @Prop() value: string = '';\n /** Accessible name for the section chooser. */\n @Prop() navigationLabel: string = 'Change page section';\n\n /** Selection intent. The route, tool, or workflow owner updates `value`. */\n @Event() dsChange!: EventEmitter<string>;\n\n @State() private menuOpen = false;\n @State() private initialFocusVisible = false;\n\n private readonly instanceId = nextMobileSectionSwitcherId++;\n private readonly triggerId = `ds-mobile-section-switcher-trigger-${this.instanceId}`;\n private readonly menuId = `ds-mobile-section-switcher-menu-${this.instanceId}`;\n private triggerEl: HTMLButtonElement | null = null;\n\n private get resolvedSections(): TabItem[] {\n if (!this.sectionsJson.trim()) return this.sections ?? [];\n try {\n const parsed = JSON.parse(this.sectionsJson);\n return Array.isArray(parsed) ? (parsed as TabItem[]) : [];\n } catch {\n return [];\n }\n }\n\n private get selectableSections(): TabItemTab[] {\n return getSelectableTabs(this.resolvedSections);\n }\n\n private get selectedIndex(): number {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).selectedIndex;\n }\n\n private get selectedSection(): TabItemTab | undefined {\n return this.selectableSections[this.selectedIndex];\n }\n\n private get hasPrevious(): boolean {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).hasPrevious;\n }\n\n private get hasNext(): boolean {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).hasNext;\n }\n\n private get triggerAriaLabel(): string {\n return `${this.navigationLabel}. Current section: ${this.selectedSection?.label ?? ''}`;\n }\n\n private get menuSections(): MenuSection[] {\n const groups: MenuSection[] = [];\n let items: MenuItemData[] = [];\n const commit = () => {\n if (items.length) groups.push({ items });\n items = [];\n };\n\n for (const section of this.resolvedSections) {\n if (isTabDivider(section)) {\n commit();\n continue;\n }\n items.push({\n label: section.label,\n value: section.id,\n dot: section.dot,\n isSelected: section.id === this.selectedSection?.id,\n isInactive: section.isInactive,\n });\n }\n commit();\n return groups;\n }\n\n @Watch('sections')\n @Watch('sectionsJson')\n handleSectionsChange() {\n if (this.selectableSections.length <= 1) this.closeMenu();\n }\n\n private toggleMenu = (event: MouseEvent) => {\n if (this.selectableSections.length <= 1) return;\n this.initialFocusVisible = event.detail === 0;\n this.menuOpen = !this.menuOpen;\n };\n\n private closeMenu = () => {\n this.menuOpen = false;\n };\n\n private handleSelect = (event: CustomEvent<MenuItemData>) => {\n const id = String(event.detail.value ?? '');\n const section = this.selectableSections.find(candidate => candidate.id === id);\n if (!section || section.isInactive) return;\n this.closeMenu();\n if (id !== this.selectedSection?.id) this.dsChange.emit(id);\n requestAnimationFrame(() => this.triggerEl?.focus());\n };\n\n render() {\n const selected = this.selectedSection;\n if (!selected) return <Host />;\n\n return (\n <Host>\n <button\n ref={element => {\n this.triggerEl = element ?? null;\n }}\n id={this.triggerId}\n class={{\n 'mobile-section-switcher': true,\n 'mobile-section-switcher--expanded': this.menuOpen,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n }}\n type=\"button\"\n aria-haspopup=\"menu\"\n aria-controls={this.menuId}\n aria-expanded={String(this.menuOpen)}\n aria-label={this.triggerAriaLabel}\n onClick={this.toggleMenu}\n >\n <span\n class={{\n 'mobile-section-switcher__position': true,\n 'mobile-section-switcher__position--visible': this.hasPrevious,\n 'ds-interaction-fill__content': true,\n }}\n aria-hidden=\"true\"\n />\n <ds-text\n class=\"mobile-section-switcher__label ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-medium\"\n emphasis\n color=\"inherit\"\n lineTruncation={1}\n >\n {selected.label}\n </ds-text>\n <span\n class={{\n 'mobile-section-switcher__position': true,\n 'mobile-section-switcher__position--visible': this.hasNext,\n 'ds-interaction-fill__content': true,\n }}\n aria-hidden=\"true\"\n />\n </button>\n\n {this.selectableSections.length > 1 ? (\n <ds-menu\n id={this.menuId}\n anchorId={this.triggerId}\n align=\"center\"\n menuLabel={this.navigationLabel}\n open={this.menuOpen}\n initialFocusVisible={this.initialFocusVisible}\n sections={this.menuSections}\n onDsClose={this.closeMenu}\n onDsSelect={this.handleSelect}\n />\n ) : null}\n </Host>\n );\n }\n}\n",
197
198
  "type": "registry:ui"
198
199
  },
199
200
  {
@@ -4395,7 +4395,7 @@
4395
4395
  {
4396
4396
  "name": "menu",
4397
4397
  "title": "Menu",
4398
- "description": "Anchored action menu with flat commands, grouped sections, single-selection radio choices, supplemental notification dots, switches, and destructive actions.",
4398
+ "description": "Anchored action menu with flat commands, grouped sections, single-selection choices, supplemental notification dots, switches, and destructive actions.",
4399
4399
  "type": "registry:ui",
4400
4400
  "meta": {
4401
4401
  "library": "@ds-mo/ui",
@@ -4406,7 +4406,7 @@
4406
4406
  "intent": {
4407
4407
  "audience": "general",
4408
4408
  "status": "stable",
4409
- "summary": "Anchored action menu with flat commands, grouped sections, single-selection radio choices, supplemental notification dots, switches, and destructive actions.",
4409
+ "summary": "Anchored action menu with flat commands, grouped sections, single-selection choices, supplemental notification dots, switches, and destructive actions.",
4410
4410
  "useWhen": [
4411
4411
  "A trigger reveals a short contextual list of commands or state-changing actions.",
4412
4412
  "Actions need grouping, mutually exclusive selected state, supplemental notification dots, switch rows, or destructive treatment."
@@ -4447,7 +4447,7 @@
4447
4447
  "Open with visible initial focus only when the trigger was activated from the keyboard.",
4448
4448
  "Keep disabled items discoverable only when their unavailable state is meaningful.",
4449
4449
  "Switch rows use menuitemcheckbox semantics on the row; the nested ds-switch is an aria-hidden md presentation indicator.",
4450
- "Single-selection menus use menuitemradio semantics and aria-checked on each row; the leading radio mark is presentation-only.",
4450
+ "Single-selection menus use menuitemradio semantics and aria-checked on each row, but render no nested radio control; selected interaction fill and primary foreground provide the visual state.",
4451
4451
  "A swatch-picker section changes the popup to a non-modal dialog so its radio group and ordinary preference buttons keep valid nested semantics; Tab moves between its controls, then leaves and closes at the popup boundary.",
4452
4452
  "Use notification dots only as supplemental status and not as the sole indication of important information."
4453
4453
  ],
@@ -5003,7 +5003,7 @@
5003
5003
  ],
5004
5004
  "responsiveBehavior": [
5005
5005
  "Render only below the mobile breakpoint and preserve safe-area clearance.",
5006
- "The two icon-only control groups remain centered with fixed 40px targets and a divider between Menu and current area."
5006
+ "The secondary-background bar keeps an 8px outer inset; its two icon-only groups anchor to opposite edges while retaining fixed 40px targets and a divider between Menu and current area."
5007
5007
  ],
5008
5008
  "references": [
5009
5009
  {
@@ -5242,7 +5242,8 @@
5242
5242
  "accessibility": [
5243
5243
  "The trigger exposes the current section, popup relationship, and expanded state.",
5244
5244
  "Decorative previous and next position hints are hidden from assistive technology.",
5245
- "The menu is always available so a future swipe gesture is never the only navigation mechanism."
5245
+ "The menu is always available so a future swipe gesture is never the only navigation mechanism.",
5246
+ "Peer destinations use menuitem semantics with aria-current on the active page; they do not present a radio-control affordance."
5246
5247
  ],
5247
5248
  "states": [
5248
5249
  "Selection is controlled and dsChange reports intent without mutating value.",