@ds-mo/ui 12.3.0 → 12.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp +1 -1
- package/dist/agent-patterns.json +89 -11
- package/dist/agent.json +543 -9
- package/dist/angular/ds-shell-app.d.ts +13 -2
- package/dist/angular/ds-shell-app.js +9 -5
- package/dist/angular/ds-shell-mobile-bar.d.ts +18 -0
- package/dist/angular/ds-shell-mobile-bar.js +46 -0
- package/dist/angular/ds-shell-mobile-nav.d.ts +23 -0
- package/dist/angular/ds-shell-mobile-nav.js +51 -0
- package/dist/angular/ds-shell-mobile-section-nav.d.ts +18 -0
- package/dist/angular/ds-shell-mobile-section-nav.js +42 -0
- package/dist/angular/ds-shell-tools.d.ts +42 -0
- package/dist/angular/ds-shell-tools.js +52 -0
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +4 -0
- package/dist/angular/proxies.d.ts +4 -0
- package/dist/angular/proxies.js +4 -0
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-title.js +1 -1
- package/dist/components/ds-bar-workflow.js +1 -1
- package/dist/components/ds-chart-donut.js +1 -1
- package/dist/components/ds-code-block.js +1 -1
- package/dist/components/ds-conversation-list-item.js +1 -1
- package/dist/components/ds-conversation-list-item.js.map +1 -1
- package/dist/components/ds-markdown.js +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-message-composer.js +1 -1
- package/dist/components/ds-message-scroller.js +1 -1
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-modal.js.map +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-nav.js.map +1 -1
- package/dist/components/ds-panel-tool-header.js +1 -1
- package/dist/components/ds-panel-tool-search.js +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-panel-tools.js.map +1 -1
- package/dist/components/ds-select-multi.js +1 -1
- package/dist/components/ds-select-multi.js.map +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-select.js.map +1 -1
- package/dist/components/ds-shell-app.js +1 -1
- package/dist/components/ds-shell-app.js.map +1 -1
- package/dist/components/ds-shell-gradient-picker.js +1 -1
- package/dist/components/ds-shell-gradient-picker.js.map +1 -1
- package/dist/components/ds-shell-gradient-swatch.js +1 -1
- package/dist/components/ds-shell-mobile-bar.d.ts +11 -0
- package/dist/components/ds-shell-mobile-bar.js +2 -0
- package/dist/components/ds-shell-mobile-bar.js.map +1 -0
- package/dist/components/ds-shell-mobile-nav.d.ts +11 -0
- package/dist/components/ds-shell-mobile-nav.js +2 -0
- package/dist/components/ds-shell-mobile-nav.js.map +1 -0
- package/dist/components/ds-shell-mobile-section-nav.d.ts +11 -0
- package/dist/components/ds-shell-mobile-section-nav.js +2 -0
- package/dist/components/ds-shell-mobile-section-nav.js.map +1 -0
- package/dist/components/ds-shell-page.js +1 -1
- package/dist/components/ds-shell-page.js.map +1 -1
- package/dist/components/ds-shell-tools.d.ts +11 -0
- package/dist/components/ds-shell-tools.js +2 -0
- package/dist/components/ds-shell-tools.js.map +1 -0
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-tab-group.js.map +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-toast.js.map +1 -1
- package/dist/components/ds-tooltip-data-viz.js +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/p-B6Vuayt6.js +2 -0
- package/dist/components/p-B6Vuayt6.js.map +1 -0
- package/dist/components/p-BPS9VExm.js +2 -0
- package/dist/components/{p-D3DYxbC5.js.map → p-BPS9VExm.js.map} +1 -1
- package/dist/components/{p-Bi_bxbih.js → p-Biz6xo-z.js} +2 -2
- package/dist/components/p-BrusnEYP.js +2 -0
- package/dist/components/p-BrusnEYP.js.map +1 -0
- package/dist/components/p-C_0Q8Cnp.js +2 -0
- package/dist/components/{p-Dg3xLna0.js.map → p-C_0Q8Cnp.js.map} +1 -1
- package/dist/components/p-CgHTNfC1.js +2 -0
- package/dist/components/p-CgHTNfC1.js.map +1 -0
- package/dist/components/p-Co8hD3P-.js +2 -0
- package/dist/components/{p-DC7yOUQx.js.map → p-Co8hD3P-.js.map} +1 -1
- package/dist/components/{p-Cuw2Lo2g.js → p-CtD24EyI.js} +2 -2
- package/dist/components/{p-C0NPJ0h2.js → p-DXnFhmZF.js} +2 -2
- package/dist/components/p-NUNsefU1.js +2 -0
- package/dist/components/{p-CWlh7HAg.js.map → p-NUNsefU1.js.map} +1 -1
- package/dist/components/p-PZ6R_nGI.js +2 -0
- package/dist/components/p-PZ6R_nGI.js.map +1 -0
- package/dist/components/{p-J6xK6Ihq.js → p-g40DTeV8.js} +2 -2
- package/dist/components/p-yhj1lIPx.js +2 -0
- package/dist/components/p-yhj1lIPx.js.map +1 -0
- package/dist/docs/components.json +2143 -115
- package/dist/lib/components/BarNav/bar-nav-types.d.ts +2 -0
- package/dist/lib/components/PanelNav/panel-nav-types.d.ts +29 -0
- package/dist/lib/components/PanelTools/panel-tools-types.d.ts +40 -0
- package/dist/lib/components/TabGroup/tab-item-utils.d.ts +31 -0
- package/dist/lib/shell/index.d.ts +5 -0
- package/dist/lib/shell/index.js +36 -0
- package/dist/lib/shell/index.js.map +3 -3
- package/dist/lib/shell/shell-responsive.d.ts +13 -0
- package/dist/mcp-data/registry/conversation-list-item.json +1 -1
- package/dist/mcp-data/registry/modal.json +1 -1
- package/dist/mcp-data/registry/registry.json +554 -8
- package/dist/mcp-data/registry/shell-app.json +71 -11
- package/dist/mcp-data/registry/shell-mobile-bar.json +314 -0
- package/dist/mcp-data/registry/shell-mobile-nav.json +348 -0
- package/dist/mcp-data/registry/shell-mobile-section-nav.json +267 -0
- package/dist/mcp-data/registry/shell-page.json +1 -1
- package/dist/mcp-data/registry/shell-tools.json +450 -0
- package/dist/react/components.d.ts +4 -0
- package/dist/react/components.js +4 -0
- package/dist/react/ds-shell-app.d.ts +7 -2
- package/dist/react/ds-shell-app.js +1 -1
- package/dist/react/ds-shell-mobile-bar.d.ts +13 -0
- package/dist/react/ds-shell-mobile-bar.js +15 -0
- package/dist/react/ds-shell-mobile-nav.d.ts +15 -0
- package/dist/react/ds-shell-mobile-nav.js +17 -0
- package/dist/react/ds-shell-mobile-section-nav.d.ts +12 -0
- package/dist/react/ds-shell-mobile-section-nav.js +12 -0
- package/dist/react/ds-shell-tools.d.ts +25 -0
- package/dist/react/ds-shell-tools.js +17 -0
- package/dist/types/components/ShellApp/ShellApp.d.ts +16 -0
- package/dist/types/components/ShellMobileBar/ShellMobileBar.d.ts +25 -0
- package/dist/types/components/ShellMobileBar/index.d.ts +4 -0
- package/dist/types/components/ShellMobileBar/shell-mobile-bar-types.d.ts +5 -0
- package/dist/types/components/ShellMobileNav/ShellMobileNav.d.ts +32 -0
- package/dist/types/components/ShellMobileNav/index.d.ts +2 -0
- package/dist/types/components/ShellMobileNav/shell-mobile-nav-types.d.ts +6 -0
- package/dist/types/components/ShellMobileSectionNav/ShellMobileSectionNav.d.ts +30 -0
- package/dist/types/components/ShellMobileSectionNav/index.d.ts +2 -0
- package/dist/types/components/ShellTools/ShellTools.d.ts +61 -0
- package/dist/types/components/ShellTools/index.d.ts +3 -0
- package/dist/types/components.d.ts +607 -2
- package/dist/types/shell/index.d.ts +5 -0
- package/dist/types/shell/shell-responsive.d.ts +14 -0
- package/package.json +1 -1
- package/dist/components/p-CWlh7HAg.js +0 -2
- package/dist/components/p-D3DYxbC5.js +0 -2
- package/dist/components/p-DC7yOUQx.js +0 -2
- package/dist/components/p-Dg3xLna0.js +0 -2
- /package/dist/components/{p-Bi_bxbih.js.map → p-Biz6xo-z.js.map} +0 -0
- /package/dist/components/{p-Cuw2Lo2g.js.map → p-CtD24EyI.js.map} +0 -0
- /package/dist/components/{p-C0NPJ0h2.js.map → p-DXnFhmZF.js.map} +0 -0
- /package/dist/components/{p-J6xK6Ihq.js.map → p-g40DTeV8.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as i,a as r,t as o}from"./index.js";import{c as n,a as c,r as a}from"./p-CydY-v7X.js";import{a as d,C as l,b as h}from"./p-DbpfpeQT.js";import{e as g,r as p,f,a as u,m as v,b as m,c as b,d as y,g as x}from"./p-BhC1YyId.js";import{d as w}from"./p-CH6cNXXF.js";import{d as k}from"./p-CoYFJD-w.js";import{d as _}from"./p-jCWtxthA.js";import{d as z}from"./p-BAfG3M8z.js";import{d as C}from"./p-Cpr3K41-.js";import{d as F}from"./p-BwGnhInj.js";import{d as A}from"./p-D3DYxbC5.js";import{r as j}from"./p-BJMRBHKW.js";import{r as I,T as L}from"./p-Dg3xLna0.js";import{C as D}from"./p-Cx-ywr1e.js";import{c as V}from"./p-DuFm-ieS.js";const q=()=>`.sc-ds-select-h{--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)}.ds-focus-ring.sc-ds-select-h:focus-visible,.ds-focus-ring.sc-ds-select:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-select-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-select{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-select-h:focus-visible,.ds-focus-ring-inset.sc-ds-select:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-select-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-select:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-select-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-select{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-select-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-select::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-interaction-fill.sc-ds-select-h,.ds-interaction-fill.sc-ds-select{position:relative;z-index:0;--ds-interaction-hover:var(--color-interaction-hover);--ds-interaction-pressed:var(--color-interaction-pressed);--ds-interaction-active:var(--color-interaction-active-brand);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent}.ds-interaction-fill.sc-ds-select-h::before,.ds-interaction-fill.sc-ds-select::before,.ds-interaction-fill.sc-ds-select-h::after,.ds-interaction-fill.sc-ds-select::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;transition:none}.ds-interaction-fill.sc-ds-select-h::before,.ds-interaction-fill.sc-ds-select::before{z-index:1}.ds-interaction-fill.sc-ds-select-h::after,.ds-interaction-fill.sc-ds-select::after{z-index:3;box-shadow:inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-interaction-fill--bordered.sc-ds-select-h,.ds-interaction-fill--bordered.sc-ds-select{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-select-h::before,.ds-interaction-fill--selected.sc-ds-select::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-select-h,.ds-interaction-fill--selected.sc-ds-select{--ds-interaction-dot-ring:var(--ds-interaction-active)}.ds-interaction-fill.sc-ds-select-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-select:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}.ds-interaction-fill.sc-ds-select-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-select:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill.sc-ds-select-h>.ds-interaction-fill__content.sc-ds-select,.ds-interaction-fill.sc-ds-select>.ds-interaction-fill__content.sc-ds-select,.ds-interaction-fill__content.sc-ds-select{position:relative;z-index:2}.ds-interaction-fill--on-faint.sc-ds-select-h,.ds-interaction-fill--on-faint.sc-ds-select{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-select-h,.ds-interaction-fill--on-medium.sc-ds-select{--ds-interaction-hover:var(--color-interaction-on-medium-background-hover);--ds-interaction-pressed:var(--color-interaction-on-medium-background-pressed);--ds-interaction-active:var(--color-interaction-on-medium-background-active);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.ds-interaction-fill--on-bold.sc-ds-select-h,.ds-interaction-fill--on-bold.sc-ds-select{--ds-interaction-hover:var(--color-interaction-on-bold-background-hover);--ds-interaction-pressed:var(--color-interaction-on-bold-background-pressed);--ds-interaction-active:var(--color-interaction-on-bold-background-active);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus)}.ds-interaction-fill--on-strong.sc-ds-select-h,.ds-interaction-fill--on-strong.sc-ds-select{--ds-interaction-hover:var(--color-interaction-on-strong-background-hover);--ds-interaction-pressed:var(--color-interaction-on-strong-background-pressed);--ds-interaction-active:var(--color-interaction-on-strong-background-active);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus)}.ds-interaction-fill--on-translucent.sc-ds-select-h,.ds-interaction-fill--on-translucent.sc-ds-select{--ds-interaction-hover:var(--color-translucent-interaction-hover);--ds-interaction-pressed:var(--color-translucent-interaction-pressed);--ds-interaction-active:var(--color-translucent-interaction-active);--ds-focus-ring-color:var(--color-translucent-interaction-focus)}.ds-interaction-fill--on-inverted.sc-ds-select-h,.ds-interaction-fill--on-inverted.sc-ds-select{--ds-interaction-hover:var(--color-inverted-interaction-hover);--ds-interaction-pressed:var(--color-inverted-interaction-pressed);--ds-interaction-active:var(--color-inverted-interaction-active);--ds-focus-ring-color:var(--color-inverted-interaction-focus)}.ds-interaction-fill--on-media.sc-ds-select-h,.ds-interaction-fill--on-media.sc-ds-select{--ds-interaction-hover:var(--color-media-interaction-hover);--ds-interaction-pressed:var(--color-media-interaction-pressed);--ds-interaction-active:var(--color-media-interaction-active);--ds-focus-ring-color:var(--color-media-interaction-focus)}.ds-interaction-fill--on-always-dark.sc-ds-select-h,.ds-interaction-fill--on-always-dark.sc-ds-select{--ds-interaction-hover:var(--color-always-dark-interaction-hover);--ds-interaction-pressed:var(--color-always-dark-interaction-pressed);--ds-interaction-active:var(--color-always-dark-interaction-active);--ds-focus-ring-color:var(--color-always-dark-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-select-h,.ds-interaction-fill--on-navigation.sc-ds-select{--ds-interaction-hover:var(--color-navigation-interaction-hover);--ds-interaction-pressed:var(--color-navigation-interaction-pressed);--ds-interaction-active:var(--color-navigation-interaction-active);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}.ds-control-inactive.sc-ds-select-h,.ds-control-inactive.sc-ds-select{opacity:0.5;pointer-events:none;cursor:not-allowed}.ds-control--md.sc-ds-select-h,.ds-control--md.sc-ds-select,.ds-control--sm.sc-ds-select-h,.ds-control--sm.sc-ds-select,.ds-control--xs.sc-ds-select-h,.ds-control--xs.sc-ds-select{--ds-control-radius:var(--dimension-radius-025)}.ds-control--md.sc-ds-select-h,.ds-control--md.sc-ds-select{--ds-control-height:var(--dimension-size-400);--ds-control-icon:var(--dimension-iconography-md);--ds-control-padding-inline:var(--dimension-space-075);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-050)}.ds-control--sm.sc-ds-select-h,.ds-control--sm.sc-ds-select{--ds-control-height:var(--dimension-size-300);--ds-control-icon:var(--dimension-iconography-sm);--ds-control-padding-inline:var(--dimension-space-050);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025)}.ds-control--xs.sc-ds-select-h,.ds-control--xs.sc-ds-select{--ds-control-height:var(--dimension-size-200);--ds-control-icon:var(--dimension-iconography-xs);--ds-control-padding-inline:var(--dimension-space-025);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:0}.ds-choice-popup.sc-ds-select{box-sizing:border-box;display:flex;flex-direction:column;min-width:var(--dimension-menu-width-xs);max-width:min( var(--dimension-panel-width-lg), calc(100vw - var(--dimension-space-200)) );max-height:calc(100vh - var(--dimension-space-200));overflow:hidden;inset:auto;margin:0;padding:0;border:0;background-color:var(--color-background-primary);border-radius:var(--dimension-radius-075);box-shadow:var(--effect-shadow-elevated-floating);animation:dsChoiceFadeIn var(--effect-motion-short-2) forwards;backface-visibility:hidden;will-change:transform;text-align:start}.ds-choice-popup.sc-ds-select::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:var(--effect-highlight-elevated-floating)}.ds-choice-popup--closing.sc-ds-select{animation:dsChoiceFadeOut var(--effect-motion-short-2) forwards}@keyframes dsChoiceFadeIn{from{opacity:0;transform:inherit scale(0.97)}to{opacity:1}}@keyframes dsChoiceFadeOut{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.ds-choice-popup.sc-ds-select{animation:none;opacity:1}.ds-choice-popup--closing.sc-ds-select{opacity:0}}.ds-choice-list.sc-ds-select{display:flex;flex-direction:column;min-height:0;overflow-y:auto;overscroll-behavior:contain}.ds-choice-section.sc-ds-select{display:flex;flex-direction:column;gap:var(--dimension-space-050);padding:var(--dimension-space-050)}.ds-choice-section--divided.sc-ds-select{border-bottom:var(--dimension-stroke-width-015) solid var(--color-border-tertiary)}ds-text.ds-choice-section__header.sc-ds-select{display:flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding:0 calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) );text-align:start;-webkit-user-select:none;user-select:none}.ds-choice-item.sc-ds-select{display:flex;align-items:center;gap:var(--ds-control-gap, var(--dimension-space-050));width:100%;height:var(--ds-control-height, var(--dimension-size-400));padding:0 var(--ds-control-padding-inline, var(--dimension-space-075));box-sizing:border-box;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));background:transparent;cursor:pointer;-webkit-user-select:none;user-select:none;text-align:left;color:inherit}.ds-choice-item.sc-ds-select:has(.ds-choice-item__subtext){height:auto;min-height:var(--ds-control-height, var(--dimension-size-400));padding-block:var(--ds-control-padding-inline, var(--dimension-space-075));align-items:flex-start}.ds-choice-item__content.sc-ds-select{display:flex;flex:1;flex-direction:column;gap:var(--dimension-space-025);min-width:0}ds-text.ds-choice-item__label.sc-ds-select,.ds-choice-item__subtext.sc-ds-select,ds-text.ds-choice-item__subtext.sc-ds-select{padding:0 var(--ds-control-label-inset, var(--dimension-space-025))}ds-text.ds-choice-item__label.sc-ds-select{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ds-text.ds-choice-item__subtext.sc-ds-select{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.ds-choice-item__icon.sc-ds-select,.ds-choice-item__suffix.sc-ds-select{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md));pointer-events:none}.ds-choice-empty.sc-ds-select,.ds-choice-loading.sc-ds-select{display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:var(--dimension-size-600);padding:var(--dimension-space-100)}.ds-choice-footer.sc-ds-select{position:relative;box-sizing:border-box;padding-block:var(--dimension-space-050)}.ds-choice-footer.sc-ds-select::before{content:'';position:absolute;inset:0 0 auto;height:var(--dimension-stroke-width-012);background-color:var(--color-border-tertiary);pointer-events:none}.ds-choice-footer__content.sc-ds-select{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--dimension-size-400)}.ds-choice-footer__summary.sc-ds-select,.ds-choice-footer__clear.sc-ds-select ds-text.sc-ds-select{padding-inline:calc( var(--dimension-space-050) + var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-choice-footer__clear.sc-ds-select{appearance:none;display:inline-flex;align-items:center;padding:0;border:0;border-radius:var(--dimension-radius-025);background:transparent;color:var(--color-foreground-bold-brand);cursor:pointer}.ds-choice-footer__clear.sc-ds-select:hover{text-decoration:underline;text-decoration-color:var(--color-foreground-tertiary)}.ds-control-width--hug.sc-ds-select-h,.ds-control-width--hug.sc-ds-select{width:fit-content;max-width:100%;flex:0 0 auto;align-self:flex-start}.ds-control-width--fill.sc-ds-select-h,.ds-control-width--fill.sc-ds-select{width:100%;min-width:0;flex:1 1 auto;align-self:stretch}.select-search.sc-ds-select{position:relative;box-sizing:border-box;padding:var(--dimension-space-050);background:transparent}.select-search.sc-ds-select::after{content:'';position:absolute;inset:auto 0 0;height:var(--dimension-stroke-width-012);background-color:var(--color-border-tertiary);pointer-events:none}.select-search.sc-ds-select:focus-within::after{height:var(--dimension-stroke-width-018);background-color:var(--color-border-bold-brand)}.select-search__control.sc-ds-select{display:flex;align-items:center;box-sizing:border-box;gap:var(--ds-control-gap, var(--dimension-space-050));height:var(--ds-control-height, var(--dimension-size-400));padding:0 var(--ds-control-padding-inline, var(--dimension-space-075));border:0;border-radius:var(--ds-control-radius, var(--dimension-radius-025))}.select-search__control.sc-ds-select:has(.select-search__clear){padding-right:0}.select-search__control.sc-ds-select>ds-icon.sc-ds-select{flex-shrink:0;color:var(--color-foreground-secondary)}.select-search.sc-ds-select .select-search__control.sc-ds-select .select-search__clear.sc-ds-select{align-self:center;flex-shrink:0;margin-right:var(--dimension-space-050)}.select-search__control.sc-ds-select input.sc-ds-select{flex:1;min-width:0;height:100%;padding:0 var(--ds-control-label-inset, var(--dimension-space-025));border:0;outline:none;background:transparent;color:var(--color-foreground-primary);font-family:inherit}.select-search__control.sc-ds-select input.sc-ds-select::placeholder{color:var(--color-foreground-secondary)}.select-search__control.sc-ds-select input.sc-ds-select:focus::placeholder{color:var(--color-foreground-quaternary)}.select-search__control.sc-ds-select input[type='search'].sc-ds-select::-webkit-search-cancel-button,.select-search__control.sc-ds-select input[type='search'].sc-ds-select::-webkit-search-decoration{display:none}.ds-text--display-medium.sc-ds-select-h,.ds-text--display-medium.sc-ds-select{font-size:var(--typography-fontsize-3xl);line-height:var(--typography-lineheight-3xl)}.ds-text--display-small.sc-ds-select-h,.ds-text--display-small.sc-ds-select{font-size:var(--typography-fontsize-2xl);line-height:var(--typography-lineheight-2xl)}.ds-text--title-large.sc-ds-select-h,.ds-text--title-large.sc-ds-select{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl)}.ds-text--title-medium.sc-ds-select-h,.ds-text--title-medium.sc-ds-select{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--title-small.sc-ds-select-h,.ds-text--title-small.sc-ds-select{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-large.sc-ds-select-h,.ds-text--body-large.sc-ds-select{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--body-medium.sc-ds-select-h,.ds-text--body-medium.sc-ds-select{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-small.sc-ds-select-h,.ds-text--body-small.sc-ds-select{font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm)}.ds-text--caption.sc-ds-select-h,.ds-text--caption.sc-ds-select{font-size:var(--typography-fontsize-xs);line-height:var(--typography-lineheight-xs);text-transform:uppercase}.ds-text--display-medium.ds-text--emphasis.sc-ds-select-h,.ds-text--display-small.ds-text--emphasis.sc-ds-select-h,.ds-text--display-medium.ds-text--emphasis.sc-ds-select,.ds-text--display-small.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-bold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--display-medium.ds-text--regular.sc-ds-select-h,.ds-text--display-small.ds-text--regular.sc-ds-select-h,.ds-text--display-medium.ds-text--regular.sc-ds-select,.ds-text--display-small.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-large.ds-text--emphasis.sc-ds-select-h,.ds-text--title-large.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--title-large.ds-text--regular.sc-ds-select-h,.ds-text--title-large.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--emphasis.sc-ds-select-h,.ds-text--title-small.ds-text--emphasis.sc-ds-select-h,.ds-text--title-medium.ds-text--emphasis.sc-ds-select,.ds-text--title-small.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--regular.sc-ds-select-h,.ds-text--title-small.ds-text--regular.sc-ds-select-h,.ds-text--title-medium.ds-text--regular.sc-ds-select,.ds-text--title-small.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-large.ds-text--emphasis.sc-ds-select-h,.ds-text--body-medium.ds-text--emphasis.sc-ds-select-h,.ds-text--body-large.ds-text--emphasis.sc-ds-select,.ds-text--body-medium.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--body-large.ds-text--regular.sc-ds-select-h,.ds-text--body-medium.ds-text--regular.sc-ds-select-h,.ds-text--body-large.ds-text--regular.sc-ds-select,.ds-text--body-medium.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--emphasis.sc-ds-select-h,.ds-text--body-small.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--regular.sc-ds-select-h,.ds-text--body-small.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-none)}.ds-text--caption.ds-text--emphasis.sc-ds-select-h,.ds-text--caption.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-positive)}.ds-text--caption.ds-text--regular.sc-ds-select-h,.ds-text--caption.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-positive)}.select-host.sc-ds-select-h{display:inline-flex;flex-direction:column;gap:var(--dimension-space-050);position:relative;outline:none;--ds-select-fg:var(--color-foreground-secondary);--ds-select-fg-active:var(--color-foreground-primary);--ds-select-prefix-fg:var(--ds-select-fg);--ds-select-chevron-fg:var(--ds-select-fg);--ds-select-border:var(--color-border-secondary)}.ds-control-width--fill.sc-ds-select-h,.ds-control-width--fill.sc-ds-select-h .trigger.sc-ds-select{width:100%}.trigger.sc-ds-select{display:inline-flex;align-items:center;justify-content:flex-start;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding:0 var(--ds-control-padding-inline, var(--dimension-space-075));gap:var(--ds-control-gap, var(--dimension-space-050));background:transparent;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));color:var(--ds-select-fg);cursor:pointer;font-family:inherit;-webkit-user-select:none;user-select:none;overflow:hidden;transition:color var(--effect-motion-short-2)}.trigger--bordered.sc-ds-select{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--ds-select-border)}.trigger--has-value.sc-ds-select .trigger__label.sc-ds-select{color:var(--ds-select-fg-active)}.wrapper--error.sc-ds-select{--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-negative)}.trigger__prefix.sc-ds-select,.trigger__chevron.sc-ds-select{position:relative;z-index:2;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md));display:inline-flex;align-items:center;justify-content:center}.trigger__prefix.sc-ds-select{color:var(--ds-select-prefix-fg)}.trigger__chevron.sc-ds-select{color:var(--ds-select-chevron-fg)}.trigger__label.sc-ds-select{position:relative;z-index:2;flex:1 1 auto;min-width:0;padding:0 var(--ds-control-label-inset, var(--dimension-space-025));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;color:inherit;transition:color var(--effect-motion-short-2)}.select-popup.sc-ds-select{color:var(--color-foreground-secondary)}.select-option[aria-selected='true'].sc-ds-select .ds-choice-item__icon.sc-ds-select{color:var(--color-foreground-primary)}.error-text.sc-ds-select{width:100%}.select-host--background-medium.sc-ds-select-h{--ds-select-fg:var(--color-foreground-on-medium-background-secondary);--ds-select-fg-active:var(--color-foreground-on-medium-background-primary);--ds-select-border:var(--color-border-on-medium-background-secondary)}.select-host--background-bold.sc-ds-select-h{--ds-select-fg:var(--color-foreground-on-bold-background-secondary);--ds-select-fg-active:var(--color-foreground-on-bold-background-primary);--ds-select-border:var(--color-border-on-bold-background-secondary)}.select-host--background-strong.sc-ds-select-h{--ds-select-fg:var(--color-foreground-on-strong-background-secondary);--ds-select-fg-active:var(--color-foreground-on-strong-background-primary);--ds-select-border:var(--color-border-on-strong-background-secondary)}.select-host--background-translucent.sc-ds-select-h{--ds-select-fg:var(--color-translucent-foreground-secondary);--ds-select-fg-active:var(--color-translucent-foreground-primary);--ds-select-border:var(--color-translucent-border-secondary)}.select-host--background-inverted.sc-ds-select-h{--ds-select-fg:var(--color-inverted-foreground-secondary);--ds-select-fg-active:var(--color-inverted-foreground-primary);--ds-select-border:var(--color-inverted-border-secondary)}.select-host--background-media.sc-ds-select-h{--ds-select-fg:var(--color-media-foreground-secondary);--ds-select-fg-active:var(--color-media-foreground-primary);--ds-select-border:var(--color-media-border-secondary)}.select-host--background-always-dark.sc-ds-select-h{--ds-select-fg:var(--color-always-dark-foreground-secondary);--ds-select-fg-active:var(--color-always-dark-foreground-primary);--ds-select-border:var(--color-always-dark-border-secondary)}`;const O={md:"md",sm:"sm",xs:"xs"};let T=0;const E=8;const $=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.dsChange=t(this,"dsChange");this.dsClear=t(this,"dsClear");this.dsOpenChange=t(this,"dsOpenChange");this.internals=this.attachInternals();this.options=[];this.sections=[];this.value="";this.open=false;this.disabled=false;this.required=false;this.requiredMessage="This field is required.";this.placeholder="Select";this.size="md";this.width="hug";this.isInactive=false;this.isLoading=false;this.activeFill=true;this.hasBorder=true;this.allowClear=true;this.clearLabel="Clear";this.searchable=false;this.searchPlaceholder="Search";this.noResultsText="No results found";this.loadingLabel="Loading";this.error=false;this.ariaLabel=null;this.activeIndex=-1;this.searchTerm="";this.formDisabled=false;this.position={x:0,y:0};this.positionReady=false;this.focusRingVisible=false;this.generatedId=`ds-select-${++T}`;this.listboxId=`${this.generatedId}-listbox`;this.errorId=`${this.generatedId}-error`;this.triggerEl=null;this.popupEl=null;this.searchEl=null;this.initialValue="";this.typeahead="";this.typeaheadTimer=null;this.outsideHandler=null;this.repositionHandler=null;this.positionRetryRaf=null;this.clearSelection=e=>{e.preventDefault();e.stopPropagation();this.value="";this.dsChange.emit("");this.dsClear.emit();const s=g(this.visibleOptions);this.activeIndex=s[0]??-1;requestAnimationFrame((()=>this.searchable?this.searchEl?.focus():this.triggerEl?.focus()))};this.handleTriggerKeyDown=e=>{if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(e.key)){e.preventDefault();this.openPopup(true,e.key==="ArrowUp"?"last":"first")}else if(e.key.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey){e.preventDefault();this.openPopup(true);if(this.searchable){this.searchTerm=e.key}else{this.handleTypeahead(e.key)}}return}this.handleListKeyDown(e)}}componentWillLoad(){this.initialValue=this.value;this.syncFormValue()}componentDidLoad(){if(this.open)this.onOpenChange(true)}disconnectedCallback(){this.cancelPositionRetry();this.unbindPopupListeners();if(this.typeaheadTimer)clearTimeout(this.typeaheadTimer)}syncFormValue(){const e=this.isDisabled;const s=this.hasSelection?this.value:"";this.internals.setFormValue(e?null:s);const t=this.required&&!e&&!s;this.internals.setValidity(t?{valueMissing:true}:{},t?this.requiredMessage:"");if(this.open){const e=g(this.visibleOptions);if(!e.includes(this.activeIndex))this.activeIndex=e[0]??-1;requestAnimationFrame((()=>this.updatePosition()))}}onLoadingChange(){if(this.open)requestAnimationFrame((()=>this.updatePosition()))}onOpenChange(e){this.dsOpenChange.emit(e);if(e){this.bindPopupListeners();this.schedulePositionUpdate((()=>{this.scrollActiveOptionIntoView();if(this.searchable)this.searchEl?.focus()}))}else{this.cancelPositionRetry();this.unbindPopupListeners();this.searchTerm="";this.positionReady=false}}onSearchTermChange(){const e=g(this.visibleOptions);this.activeIndex=e[0]??-1;requestAnimationFrame((()=>{this.updatePosition();this.scrollActiveOptionIntoView()}))}onActiveIndexChange(){requestAnimationFrame((()=>this.scrollActiveOptionIntoView()))}formDisabledCallback(e){this.formDisabled=e;this.syncFormValue()}formResetCallback(){this.value=this.initialValue;this.closePopup()}formStateRestoreCallback(e){this.value=typeof e==="string"?e:""}async setFocus(){this.triggerEl?.focus()}get isDisabled(){return this.disabled||this.isInactive||this.formDisabled}get allSections(){return p(this.options,this.sections)}get allOptions(){return f(this.allSections)}get visibleSections(){return this.searchable?u(this.allSections,this.searchTerm):this.allSections}get visibleOptions(){return f(this.visibleSections)}get selectedOption(){return this.allOptions.find((e=>e.value===this.value))}get hasSelection(){return Boolean(this.selectedOption)}get activeOptionId(){return!this.isLoading&&this.activeIndex>=0?`${this.generatedId}-option-${this.activeIndex}`:undefined}scrollActiveOptionIntoView(){if(!this.open||!this.activeOptionId)return;this.el.querySelector(`#${this.activeOptionId}`)?.scrollIntoView({block:"nearest",inline:"nearest"})}bindPopupListeners(){this.unbindPopupListeners();this.outsideHandler=e=>{const s=e.target;if(this.el.contains(s))return;this.closePopup()};this.repositionHandler=()=>this.updatePosition();document.addEventListener("mousedown",this.outsideHandler,true);window.addEventListener("scroll",this.repositionHandler,true);window.addEventListener("resize",this.repositionHandler)}unbindPopupListeners(){if(this.outsideHandler){document.removeEventListener("mousedown",this.outsideHandler,true);this.outsideHandler=null}if(this.repositionHandler){window.removeEventListener("scroll",this.repositionHandler,true);window.removeEventListener("resize",this.repositionHandler);this.repositionHandler=null}}cancelPositionRetry(){if(this.positionRetryRaf!==null){cancelAnimationFrame(this.positionRetryRaf);this.positionRetryRaf=null}}schedulePositionUpdate(e){if(!this.open)return;this.cancelPositionRetry();this.positionReady=false;let s=E;const t=()=>{this.positionRetryRaf=null;if(!this.open)return;if(this.updatePosition()){e?.();return}if(s>0){s-=1;this.positionRetryRaf=requestAnimationFrame(t)}};this.positionRetryRaf=requestAnimationFrame(t)}updatePosition(){if(!this.open||!this.triggerEl||!this.popupEl||!this.popupEl.isConnected||!this.el.contains(this.popupEl))return false;const e=j(L.space050,L.space050);this.popupEl.style.minWidth=`${n(this.triggerEl.offsetWidth,e)}px`;this.position=c({anchorRect:this.triggerEl.getBoundingClientRect(),popupWidth:this.popupEl.offsetWidth,popupHeight:this.popupEl.offsetHeight,side:"bottom",align:"start",sideOffsetPx:e,alignOffsetPx:a({align:"start",alignOffsetPx:0,sectionInsetPx:e}),viewportPadPx:e,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight});this.positionReady=true;return true}openPopup(e,s){if(this.isDisabled||!this.allOptions.length&&!this.isLoading)return;const t=g(this.visibleOptions);const i=this.visibleOptions.findIndex((e=>e.value===this.value&&!e.isInactive));this.activeIndex=s==="last"?t[t.length-1]??-1:i>=0?i:t[0]??-1;this.focusRingVisible=e;this.open=true}closePopup(e=false){if(!this.open)return;this.open=false;if(e)requestAnimationFrame((()=>this.triggerEl?.focus()))}selectOption(e){if(e.isInactive||this.isLoading)return;this.value=e.value;this.dsChange.emit(this.value);this.closePopup(true)}moveActive(e){this.activeIndex=v(this.visibleOptions,this.activeIndex,e)}setActiveEdge(e){const s=g(this.visibleOptions);this.activeIndex=e==="first"?s[0]??-1:s[s.length-1]??-1}handleTypeahead(e){if(this.typeaheadTimer)clearTimeout(this.typeaheadTimer);this.focusRingVisible=true;const s=e.toLocaleLowerCase();const t=this.typeahead.length>0&&[...this.typeahead].every((e=>e===s));this.typeahead=t?s:`${this.typeahead}${s}`;const i=m(this.visibleOptions,this.typeahead,this.activeIndex);if(i>=0)this.activeIndex=i;const r=I(L.animationDurationMedium1,L.animationDurationMedium1);this.typeaheadTimer=setTimeout((()=>{this.typeahead="";this.typeaheadTimer=null}),r)}handleListKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault();this.focusRingVisible=true;this.moveActive(1);break;case"ArrowUp":e.preventDefault();this.focusRingVisible=true;this.moveActive(-1);break;case"Home":e.preventDefault();this.focusRingVisible=true;this.setActiveEdge("first");break;case"End":e.preventDefault();this.focusRingVisible=true;this.setActiveEdge("last");break;case"Enter":case" ":{if(e.key===" "&&this.searchable&&e.target===this.searchEl)break;e.preventDefault();const s=this.visibleOptions[this.activeIndex];if(s)this.selectOption(s);break}case"Escape":e.preventDefault();this.closePopup(true);break;case"Tab":this.closePopup();break;default:if(!this.searchable&&e.key.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey){this.handleTypeahead(e.key)}}}renderOption(e,s,t,r){const o=e.value===this.value;const n=s===this.activeIndex;return i(d,{id:`${this.generatedId}-option-${s}`,option:e,selected:o,active:n,focusRingVisible:this.focusRingVisible,usesSubtext:r,leading:t&&e.icon?i("span",{class:"ds-choice-item__icon ds-interaction-fill__content","aria-hidden":"true"},i("ds-icon",{name:e.icon,size:"md",color:"inherit"})):undefined,onHover:()=>{this.focusRingVisible=false;this.activeIndex=s},onSelect:()=>this.selectOption(e)})}render(){const e=this.isDisabled;const s=!this.hasSelection;const t=s?this.placeholder:this.selectedOption?.label;const o=D[this.size];const n=O[this.size];const c=b(this.allOptions);const a=y(this.allOptions);const d=this.error&&Boolean(this.errorMessage);const g=[this.ariaDescribedby,d?this.errorId:undefined].filter(Boolean).join(" ")||undefined;const p={position:"fixed",left:"0",top:"0",transform:`translate(${Math.round(this.position.x)}px, ${Math.round(this.position.y)}px)`,zIndex:"var(--dimension-z-index-floating)",visibility:this.positionReady?"visible":"hidden"};let f=0;return i(r,{key:"20a252271e86013f45a3f78a49d44f694d46ca0e",class:{"select-host":true,"ds-control-inactive":e,"ds-control--md":this.size==="md","ds-control--sm":this.size==="sm","ds-control--xs":this.size==="xs",...V(this.width),[`select-host--background-${this.background}`]:!!this.background}},i("button",{key:"88bbce06293926d6cc5282a417a5efe137f033f5",ref:e=>{this.triggerEl=e??null},id:this.inputId??this.generatedId,type:"button",class:{trigger:true,"ds-focus-ring-inset":true,"ds-interaction-fill":true,"ds-interaction-fill--selected":!e&&this.activeFill&&this.hasSelection,"trigger--bordered":this.hasBorder||this.error,"trigger--placeholder":s,"trigger--has-value":this.hasSelection,"wrapper--error":this.error,[`ds-control--${this.size}`]:true,...x(this.background)},disabled:e,role:"combobox","aria-haspopup":"listbox","aria-expanded":String(this.open),"aria-controls":this.open?this.listboxId:undefined,"aria-activedescendant":this.open&&!this.searchable?this.activeOptionId:undefined,"aria-label":this.ariaLabel,"aria-labelledby":this.ariaLabelledby,"aria-describedby":g,"aria-invalid":this.error?"true":undefined,"aria-required":this.required||undefined,"aria-busy":this.isLoading?"true":undefined,onClick:()=>this.open?this.closePopup():this.openPopup(false),onKeyDown:this.handleTriggerKeyDown},(this.icon||this.isLoading)&&i("span",{key:"572b4a6859d2e74937e96fa6e3e4627cd43a9161",class:"trigger__prefix ds-interaction-fill__content","aria-hidden":"true"},this.isLoading?i("ds-loader",{size:n,color:"inherit"}):i("ds-icon",{name:this.icon,size:n,color:"inherit"})),i("ds-text",{key:"546a68d555376faef5b1bddf99ca66350fb30431",class:"trigger__label ds-interaction-fill__content",as:"span",variant:o,color:"inherit",lineTruncation:1},t),i("span",{key:"75a7d1a1b7d8f12863519731a4296f3c863601b4",class:"trigger__chevron ds-interaction-fill__content","aria-hidden":"true"},i("ds-icon",{key:"19d705b7391b646ff76f40793b4c3c5b413dab75",name:"ChevronDown",size:n,color:"inherit"}))),this.open&&i("div",{key:"aaa3e039180221c7a7ebf037fbd415d15b324e56",ref:e=>{this.popupEl=e??null},class:"select-popup ds-choice-popup",style:p},this.searchable&&i(l,{key:"7f67581cdeb00feb9ed70bbd03b0d25473637721",value:this.searchTerm,placeholder:this.searchPlaceholder,controls:this.listboxId,activeDescendant:this.activeOptionId,inputRef:e=>{this.searchEl=e},clearLabel:this.clearLabel,onValueChange:e=>{this.searchTerm=e},onKeyDown:e=>this.handleListKeyDown(e)}),i("div",{key:"93c3ce408e6e255eba4a2be709cd171b9cff770c",id:this.listboxId,class:"ds-choice-list",role:"listbox","aria-label":this.ariaLabel??this.placeholder,"aria-busy":this.isLoading?"true":undefined},this.isLoading?i("div",{class:"ds-choice-loading",role:"option","aria-selected":"false","aria-disabled":"true","aria-label":this.loadingLabel,"aria-live":"polite"},i("ds-loader",{size:"md",color:"inherit"})):this.visibleOptions.length===0?i("div",{class:"ds-choice-empty",role:"option","aria-selected":"false","aria-disabled":"true","aria-label":this.noResultsText,"aria-live":"polite"},i("ds-empty-state",{body:this.noResultsText})):this.visibleSections.map((e=>i("div",{class:{"ds-choice-section":true,"ds-choice-section--divided":!!e.divider},role:e.header?"group":undefined,"aria-label":e.header},e.header&&i("ds-text",{class:"ds-choice-section__header ds-control--md",as:"span",variant:"text-body-small",emphasis:true,color:"primary","aria-hidden":"true"},e.header),e.options.map((e=>this.renderOption(e,f++,c,a))))))),this.allowClear&&this.hasSelection&&!this.isLoading&&i(h,{key:"b26cc2aadebe3920da9a0b7d5ee4689bf913affe",clearLabel:this.clearLabel,onClear:this.clearSelection})),d&&i("ds-text",{key:"c44fa96c6ee938fedd4025184386fc2c339971ea",class:"error-text",as:"div",variant:"text-body-small",color:"negative",textId:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}get el(){return this}static get watchers(){return{value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}],options:[{syncFormValue:0}],sections:[{syncFormValue:0}],isLoading:[{onLoadingChange:0}],open:[{onOpenChange:0}],searchTerm:[{onSearchTermChange:0}],activeIndex:[{onActiveIndexChange:0}]}}static get style(){return q()}},[66,"ds-select",{options:[16],sections:[16],value:[1025],open:[1540],name:[513],disabled:[516],required:[516],requiredMessage:[1,"required-message"],placeholder:[1],size:[1],width:[1],isInactive:[4,"is-inactive"],isLoading:[4,"is-loading"],activeFill:[4,"active-fill"],hasBorder:[4,"has-border"],icon:[1],allowClear:[4,"allow-clear"],clearLabel:[1,"clear-label"],searchable:[4],searchPlaceholder:[1,"search-placeholder"],noResultsText:[1,"no-results-text"],loadingLabel:[1,"loading-label"],background:[1],error:[4],errorMessage:[1,"error-message"],inputId:[1,"input-id"],ariaLabel:[1,"aria-label"],ariaLabelledby:[1,"aria-labelledby"],ariaDescribedby:[1,"aria-describedby"],activeIndex:[32],searchTerm:[32],formDisabled:[32],position:[32],positionReady:[32],focusRingVisible:[32],setFocus:[64]},undefined,{value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}],options:[{syncFormValue:0}],sections:[{syncFormValue:0}],isLoading:[{onLoadingChange:0}],open:[{onOpenChange:0}],searchTerm:[{onSearchTermChange:0}],activeIndex:[{onActiveIndexChange:0}]}]);function P(){if(typeof customElements==="undefined"){return}const e=["ds-select","ds-badge","ds-button-unfilled","ds-empty-state","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-select":if(!customElements.get(o(e))){customElements.define(o(e),$)}break;case"ds-badge":if(!customElements.get(o(e))){w()}break;case"ds-button-unfilled":if(!customElements.get(o(e))){k()}break;case"ds-empty-state":if(!customElements.get(o(e))){_()}break;case"ds-icon":if(!customElements.get(o(e))){z()}break;case"ds-loader":if(!customElements.get(o(e))){C()}break;case"ds-text":if(!customElements.get(o(e))){F()}break;case"ds-tooltip":if(!customElements.get(o(e))){A()}break}}))}P();const S=$;const R=P;export{S as DsSelect,R as defineCustomElement};
|
|
1
|
+
import{p as e,H as s,c as t,h as i,a as r,t as o}from"./index.js";import{c as n,a as c,r as a}from"./p-CydY-v7X.js";import{a as d,C as l,b as h}from"./p-DbpfpeQT.js";import{e as g,r as p,f,a as u,m as v,b as m,c as b,d as y,g as x}from"./p-BhC1YyId.js";import{d as w}from"./p-CH6cNXXF.js";import{d as k}from"./p-CoYFJD-w.js";import{d as _}from"./p-jCWtxthA.js";import{d as z}from"./p-BAfG3M8z.js";import{d as C}from"./p-Cpr3K41-.js";import{d as F}from"./p-BwGnhInj.js";import{d as j}from"./p-BPS9VExm.js";import{r as A}from"./p-BJMRBHKW.js";import{r as I}from"./p-B6Vuayt6.js";import{C as V}from"./p-Cx-ywr1e.js";import{T as L}from"./p-C_0Q8Cnp.js";import{c as q}from"./p-DuFm-ieS.js";const E=()=>`.sc-ds-select-h{--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)}.ds-focus-ring.sc-ds-select-h:focus-visible,.ds-focus-ring.sc-ds-select:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-select-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-select{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-select-h:focus-visible,.ds-focus-ring-inset.sc-ds-select:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-select-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-select:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-select-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-select{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-select-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-select::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-interaction-fill.sc-ds-select-h,.ds-interaction-fill.sc-ds-select{position:relative;z-index:0;--ds-interaction-hover:var(--color-interaction-hover);--ds-interaction-pressed:var(--color-interaction-pressed);--ds-interaction-active:var(--color-interaction-active-brand);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent}.ds-interaction-fill.sc-ds-select-h::before,.ds-interaction-fill.sc-ds-select::before,.ds-interaction-fill.sc-ds-select-h::after,.ds-interaction-fill.sc-ds-select::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;transition:none}.ds-interaction-fill.sc-ds-select-h::before,.ds-interaction-fill.sc-ds-select::before{z-index:1}.ds-interaction-fill.sc-ds-select-h::after,.ds-interaction-fill.sc-ds-select::after{z-index:3;box-shadow:inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-interaction-fill--bordered.sc-ds-select-h,.ds-interaction-fill--bordered.sc-ds-select{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-select-h::before,.ds-interaction-fill--selected.sc-ds-select::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-select-h,.ds-interaction-fill--selected.sc-ds-select{--ds-interaction-dot-ring:var(--ds-interaction-active)}.ds-interaction-fill.sc-ds-select-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-select:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}.ds-interaction-fill.sc-ds-select-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-select:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill.sc-ds-select-h>.ds-interaction-fill__content.sc-ds-select,.ds-interaction-fill.sc-ds-select>.ds-interaction-fill__content.sc-ds-select,.ds-interaction-fill__content.sc-ds-select{position:relative;z-index:2}.ds-interaction-fill--on-faint.sc-ds-select-h,.ds-interaction-fill--on-faint.sc-ds-select{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-select-h,.ds-interaction-fill--on-medium.sc-ds-select{--ds-interaction-hover:var(--color-interaction-on-medium-background-hover);--ds-interaction-pressed:var(--color-interaction-on-medium-background-pressed);--ds-interaction-active:var(--color-interaction-on-medium-background-active);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.ds-interaction-fill--on-bold.sc-ds-select-h,.ds-interaction-fill--on-bold.sc-ds-select{--ds-interaction-hover:var(--color-interaction-on-bold-background-hover);--ds-interaction-pressed:var(--color-interaction-on-bold-background-pressed);--ds-interaction-active:var(--color-interaction-on-bold-background-active);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus)}.ds-interaction-fill--on-strong.sc-ds-select-h,.ds-interaction-fill--on-strong.sc-ds-select{--ds-interaction-hover:var(--color-interaction-on-strong-background-hover);--ds-interaction-pressed:var(--color-interaction-on-strong-background-pressed);--ds-interaction-active:var(--color-interaction-on-strong-background-active);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus)}.ds-interaction-fill--on-translucent.sc-ds-select-h,.ds-interaction-fill--on-translucent.sc-ds-select{--ds-interaction-hover:var(--color-translucent-interaction-hover);--ds-interaction-pressed:var(--color-translucent-interaction-pressed);--ds-interaction-active:var(--color-translucent-interaction-active);--ds-focus-ring-color:var(--color-translucent-interaction-focus)}.ds-interaction-fill--on-inverted.sc-ds-select-h,.ds-interaction-fill--on-inverted.sc-ds-select{--ds-interaction-hover:var(--color-inverted-interaction-hover);--ds-interaction-pressed:var(--color-inverted-interaction-pressed);--ds-interaction-active:var(--color-inverted-interaction-active);--ds-focus-ring-color:var(--color-inverted-interaction-focus)}.ds-interaction-fill--on-media.sc-ds-select-h,.ds-interaction-fill--on-media.sc-ds-select{--ds-interaction-hover:var(--color-media-interaction-hover);--ds-interaction-pressed:var(--color-media-interaction-pressed);--ds-interaction-active:var(--color-media-interaction-active);--ds-focus-ring-color:var(--color-media-interaction-focus)}.ds-interaction-fill--on-always-dark.sc-ds-select-h,.ds-interaction-fill--on-always-dark.sc-ds-select{--ds-interaction-hover:var(--color-always-dark-interaction-hover);--ds-interaction-pressed:var(--color-always-dark-interaction-pressed);--ds-interaction-active:var(--color-always-dark-interaction-active);--ds-focus-ring-color:var(--color-always-dark-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-select-h,.ds-interaction-fill--on-navigation.sc-ds-select{--ds-interaction-hover:var(--color-navigation-interaction-hover);--ds-interaction-pressed:var(--color-navigation-interaction-pressed);--ds-interaction-active:var(--color-navigation-interaction-active);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}.ds-control-inactive.sc-ds-select-h,.ds-control-inactive.sc-ds-select{opacity:0.5;pointer-events:none;cursor:not-allowed}.ds-control--md.sc-ds-select-h,.ds-control--md.sc-ds-select,.ds-control--sm.sc-ds-select-h,.ds-control--sm.sc-ds-select,.ds-control--xs.sc-ds-select-h,.ds-control--xs.sc-ds-select{--ds-control-radius:var(--dimension-radius-025)}.ds-control--md.sc-ds-select-h,.ds-control--md.sc-ds-select{--ds-control-height:var(--dimension-size-400);--ds-control-icon:var(--dimension-iconography-md);--ds-control-padding-inline:var(--dimension-space-075);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-050)}.ds-control--sm.sc-ds-select-h,.ds-control--sm.sc-ds-select{--ds-control-height:var(--dimension-size-300);--ds-control-icon:var(--dimension-iconography-sm);--ds-control-padding-inline:var(--dimension-space-050);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025)}.ds-control--xs.sc-ds-select-h,.ds-control--xs.sc-ds-select{--ds-control-height:var(--dimension-size-200);--ds-control-icon:var(--dimension-iconography-xs);--ds-control-padding-inline:var(--dimension-space-025);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:0}.ds-choice-popup.sc-ds-select{box-sizing:border-box;display:flex;flex-direction:column;min-width:var(--dimension-menu-width-xs);max-width:min( var(--dimension-panel-width-lg), calc(100vw - var(--dimension-space-200)) );max-height:calc(100vh - var(--dimension-space-200));overflow:hidden;inset:auto;margin:0;padding:0;border:0;background-color:var(--color-background-primary);border-radius:var(--dimension-radius-075);box-shadow:var(--effect-shadow-elevated-floating);animation:dsChoiceFadeIn var(--effect-motion-short-2) forwards;backface-visibility:hidden;will-change:transform;text-align:start}.ds-choice-popup.sc-ds-select::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:var(--effect-highlight-elevated-floating)}.ds-choice-popup--closing.sc-ds-select{animation:dsChoiceFadeOut var(--effect-motion-short-2) forwards}@keyframes dsChoiceFadeIn{from{opacity:0;transform:inherit scale(0.97)}to{opacity:1}}@keyframes dsChoiceFadeOut{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.ds-choice-popup.sc-ds-select{animation:none;opacity:1}.ds-choice-popup--closing.sc-ds-select{opacity:0}}.ds-choice-list.sc-ds-select{display:flex;flex-direction:column;min-height:0;overflow-y:auto;overscroll-behavior:contain}.ds-choice-section.sc-ds-select{display:flex;flex-direction:column;gap:var(--dimension-space-050);padding:var(--dimension-space-050)}.ds-choice-section--divided.sc-ds-select{border-bottom:var(--dimension-stroke-width-015) solid var(--color-border-tertiary)}ds-text.ds-choice-section__header.sc-ds-select{display:flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding:0 calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) );text-align:start;-webkit-user-select:none;user-select:none}.ds-choice-item.sc-ds-select{display:flex;align-items:center;gap:var(--ds-control-gap, var(--dimension-space-050));width:100%;height:var(--ds-control-height, var(--dimension-size-400));padding:0 var(--ds-control-padding-inline, var(--dimension-space-075));box-sizing:border-box;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));background:transparent;cursor:pointer;-webkit-user-select:none;user-select:none;text-align:left;color:inherit}.ds-choice-item.sc-ds-select:has(.ds-choice-item__subtext){height:auto;min-height:var(--ds-control-height, var(--dimension-size-400));padding-block:var(--ds-control-padding-inline, var(--dimension-space-075));align-items:flex-start}.ds-choice-item__content.sc-ds-select{display:flex;flex:1;flex-direction:column;gap:var(--dimension-space-025);min-width:0}ds-text.ds-choice-item__label.sc-ds-select,.ds-choice-item__subtext.sc-ds-select,ds-text.ds-choice-item__subtext.sc-ds-select{padding:0 var(--ds-control-label-inset, var(--dimension-space-025))}ds-text.ds-choice-item__label.sc-ds-select{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ds-text.ds-choice-item__subtext.sc-ds-select{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.ds-choice-item__icon.sc-ds-select,.ds-choice-item__suffix.sc-ds-select{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md));pointer-events:none}.ds-choice-empty.sc-ds-select,.ds-choice-loading.sc-ds-select{display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:var(--dimension-size-600);padding:var(--dimension-space-100)}.ds-choice-footer.sc-ds-select{position:relative;box-sizing:border-box;padding-block:var(--dimension-space-050)}.ds-choice-footer.sc-ds-select::before{content:'';position:absolute;inset:0 0 auto;height:var(--dimension-stroke-width-012);background-color:var(--color-border-tertiary);pointer-events:none}.ds-choice-footer__content.sc-ds-select{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--dimension-size-400)}.ds-choice-footer__summary.sc-ds-select,.ds-choice-footer__clear.sc-ds-select ds-text.sc-ds-select{padding-inline:calc( var(--dimension-space-050) + var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-choice-footer__clear.sc-ds-select{appearance:none;display:inline-flex;align-items:center;padding:0;border:0;border-radius:var(--dimension-radius-025);background:transparent;color:var(--color-foreground-bold-brand);cursor:pointer}.ds-choice-footer__clear.sc-ds-select:hover{text-decoration:underline;text-decoration-color:var(--color-foreground-tertiary)}.ds-control-width--hug.sc-ds-select-h,.ds-control-width--hug.sc-ds-select{width:fit-content;max-width:100%;flex:0 0 auto;align-self:flex-start}.ds-control-width--fill.sc-ds-select-h,.ds-control-width--fill.sc-ds-select{width:100%;min-width:0;flex:1 1 auto;align-self:stretch}.select-search.sc-ds-select{position:relative;box-sizing:border-box;padding:var(--dimension-space-050);background:transparent}.select-search.sc-ds-select::after{content:'';position:absolute;inset:auto 0 0;height:var(--dimension-stroke-width-012);background-color:var(--color-border-tertiary);pointer-events:none}.select-search.sc-ds-select:focus-within::after{height:var(--dimension-stroke-width-018);background-color:var(--color-border-bold-brand)}.select-search__control.sc-ds-select{display:flex;align-items:center;box-sizing:border-box;gap:var(--ds-control-gap, var(--dimension-space-050));height:var(--ds-control-height, var(--dimension-size-400));padding:0 var(--ds-control-padding-inline, var(--dimension-space-075));border:0;border-radius:var(--ds-control-radius, var(--dimension-radius-025))}.select-search__control.sc-ds-select:has(.select-search__clear){padding-right:0}.select-search__control.sc-ds-select>ds-icon.sc-ds-select{flex-shrink:0;color:var(--color-foreground-secondary)}.select-search.sc-ds-select .select-search__control.sc-ds-select .select-search__clear.sc-ds-select{align-self:center;flex-shrink:0;margin-right:var(--dimension-space-050)}.select-search__control.sc-ds-select input.sc-ds-select{flex:1;min-width:0;height:100%;padding:0 var(--ds-control-label-inset, var(--dimension-space-025));border:0;outline:none;background:transparent;color:var(--color-foreground-primary);font-family:inherit}.select-search__control.sc-ds-select input.sc-ds-select::placeholder{color:var(--color-foreground-secondary)}.select-search__control.sc-ds-select input.sc-ds-select:focus::placeholder{color:var(--color-foreground-quaternary)}.select-search__control.sc-ds-select input[type='search'].sc-ds-select::-webkit-search-cancel-button,.select-search__control.sc-ds-select input[type='search'].sc-ds-select::-webkit-search-decoration{display:none}.ds-text--display-medium.sc-ds-select-h,.ds-text--display-medium.sc-ds-select{font-size:var(--typography-fontsize-3xl);line-height:var(--typography-lineheight-3xl)}.ds-text--display-small.sc-ds-select-h,.ds-text--display-small.sc-ds-select{font-size:var(--typography-fontsize-2xl);line-height:var(--typography-lineheight-2xl)}.ds-text--title-large.sc-ds-select-h,.ds-text--title-large.sc-ds-select{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl)}.ds-text--title-medium.sc-ds-select-h,.ds-text--title-medium.sc-ds-select{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--title-small.sc-ds-select-h,.ds-text--title-small.sc-ds-select{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-large.sc-ds-select-h,.ds-text--body-large.sc-ds-select{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--body-medium.sc-ds-select-h,.ds-text--body-medium.sc-ds-select{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-small.sc-ds-select-h,.ds-text--body-small.sc-ds-select{font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm)}.ds-text--caption.sc-ds-select-h,.ds-text--caption.sc-ds-select{font-size:var(--typography-fontsize-xs);line-height:var(--typography-lineheight-xs);text-transform:uppercase}.ds-text--display-medium.ds-text--emphasis.sc-ds-select-h,.ds-text--display-small.ds-text--emphasis.sc-ds-select-h,.ds-text--display-medium.ds-text--emphasis.sc-ds-select,.ds-text--display-small.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-bold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--display-medium.ds-text--regular.sc-ds-select-h,.ds-text--display-small.ds-text--regular.sc-ds-select-h,.ds-text--display-medium.ds-text--regular.sc-ds-select,.ds-text--display-small.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-large.ds-text--emphasis.sc-ds-select-h,.ds-text--title-large.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--title-large.ds-text--regular.sc-ds-select-h,.ds-text--title-large.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--emphasis.sc-ds-select-h,.ds-text--title-small.ds-text--emphasis.sc-ds-select-h,.ds-text--title-medium.ds-text--emphasis.sc-ds-select,.ds-text--title-small.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--regular.sc-ds-select-h,.ds-text--title-small.ds-text--regular.sc-ds-select-h,.ds-text--title-medium.ds-text--regular.sc-ds-select,.ds-text--title-small.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-large.ds-text--emphasis.sc-ds-select-h,.ds-text--body-medium.ds-text--emphasis.sc-ds-select-h,.ds-text--body-large.ds-text--emphasis.sc-ds-select,.ds-text--body-medium.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--body-large.ds-text--regular.sc-ds-select-h,.ds-text--body-medium.ds-text--regular.sc-ds-select-h,.ds-text--body-large.ds-text--regular.sc-ds-select,.ds-text--body-medium.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--emphasis.sc-ds-select-h,.ds-text--body-small.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--regular.sc-ds-select-h,.ds-text--body-small.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-none)}.ds-text--caption.ds-text--emphasis.sc-ds-select-h,.ds-text--caption.ds-text--emphasis.sc-ds-select{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-positive)}.ds-text--caption.ds-text--regular.sc-ds-select-h,.ds-text--caption.ds-text--regular.sc-ds-select{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-positive)}.select-host.sc-ds-select-h{display:inline-flex;flex-direction:column;gap:var(--dimension-space-050);position:relative;outline:none;--ds-select-fg:var(--color-foreground-secondary);--ds-select-fg-active:var(--color-foreground-primary);--ds-select-prefix-fg:var(--ds-select-fg);--ds-select-chevron-fg:var(--ds-select-fg);--ds-select-border:var(--color-border-secondary)}.ds-control-width--fill.sc-ds-select-h,.ds-control-width--fill.sc-ds-select-h .trigger.sc-ds-select{width:100%}.trigger.sc-ds-select{display:inline-flex;align-items:center;justify-content:flex-start;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding:0 var(--ds-control-padding-inline, var(--dimension-space-075));gap:var(--ds-control-gap, var(--dimension-space-050));background:transparent;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));color:var(--ds-select-fg);cursor:pointer;font-family:inherit;-webkit-user-select:none;user-select:none;overflow:hidden;transition:color var(--effect-motion-short-2)}.trigger--bordered.sc-ds-select{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--ds-select-border)}.trigger--has-value.sc-ds-select .trigger__label.sc-ds-select{color:var(--ds-select-fg-active)}.wrapper--error.sc-ds-select{--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-negative)}.trigger__prefix.sc-ds-select,.trigger__chevron.sc-ds-select{position:relative;z-index:2;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md));display:inline-flex;align-items:center;justify-content:center}.trigger__prefix.sc-ds-select{color:var(--ds-select-prefix-fg)}.trigger__chevron.sc-ds-select{color:var(--ds-select-chevron-fg)}.trigger__label.sc-ds-select{position:relative;z-index:2;flex:1 1 auto;min-width:0;padding:0 var(--ds-control-label-inset, var(--dimension-space-025));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;color:inherit;transition:color var(--effect-motion-short-2)}.select-popup.sc-ds-select{color:var(--color-foreground-secondary)}.select-option[aria-selected='true'].sc-ds-select .ds-choice-item__icon.sc-ds-select{color:var(--color-foreground-primary)}.error-text.sc-ds-select{width:100%}.select-host--background-medium.sc-ds-select-h{--ds-select-fg:var(--color-foreground-on-medium-background-secondary);--ds-select-fg-active:var(--color-foreground-on-medium-background-primary);--ds-select-border:var(--color-border-on-medium-background-secondary)}.select-host--background-bold.sc-ds-select-h{--ds-select-fg:var(--color-foreground-on-bold-background-secondary);--ds-select-fg-active:var(--color-foreground-on-bold-background-primary);--ds-select-border:var(--color-border-on-bold-background-secondary)}.select-host--background-strong.sc-ds-select-h{--ds-select-fg:var(--color-foreground-on-strong-background-secondary);--ds-select-fg-active:var(--color-foreground-on-strong-background-primary);--ds-select-border:var(--color-border-on-strong-background-secondary)}.select-host--background-translucent.sc-ds-select-h{--ds-select-fg:var(--color-translucent-foreground-secondary);--ds-select-fg-active:var(--color-translucent-foreground-primary);--ds-select-border:var(--color-translucent-border-secondary)}.select-host--background-inverted.sc-ds-select-h{--ds-select-fg:var(--color-inverted-foreground-secondary);--ds-select-fg-active:var(--color-inverted-foreground-primary);--ds-select-border:var(--color-inverted-border-secondary)}.select-host--background-media.sc-ds-select-h{--ds-select-fg:var(--color-media-foreground-secondary);--ds-select-fg-active:var(--color-media-foreground-primary);--ds-select-border:var(--color-media-border-secondary)}.select-host--background-always-dark.sc-ds-select-h{--ds-select-fg:var(--color-always-dark-foreground-secondary);--ds-select-fg-active:var(--color-always-dark-foreground-primary);--ds-select-border:var(--color-always-dark-border-secondary)}`;const O={md:"md",sm:"sm",xs:"xs"};let T=0;const D=8;const P=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.dsChange=t(this,"dsChange");this.dsClear=t(this,"dsClear");this.dsOpenChange=t(this,"dsOpenChange");this.internals=this.attachInternals();this.options=[];this.sections=[];this.value="";this.open=false;this.disabled=false;this.required=false;this.requiredMessage="This field is required.";this.placeholder="Select";this.size="md";this.width="hug";this.isInactive=false;this.isLoading=false;this.activeFill=true;this.hasBorder=true;this.allowClear=true;this.clearLabel="Clear";this.searchable=false;this.searchPlaceholder="Search";this.noResultsText="No results found";this.loadingLabel="Loading";this.error=false;this.ariaLabel=null;this.activeIndex=-1;this.searchTerm="";this.formDisabled=false;this.position={x:0,y:0};this.positionReady=false;this.focusRingVisible=false;this.generatedId=`ds-select-${++T}`;this.listboxId=`${this.generatedId}-listbox`;this.errorId=`${this.generatedId}-error`;this.triggerEl=null;this.popupEl=null;this.searchEl=null;this.initialValue="";this.typeahead="";this.typeaheadTimer=null;this.outsideHandler=null;this.repositionHandler=null;this.positionRetryRaf=null;this.clearSelection=e=>{e.preventDefault();e.stopPropagation();this.value="";this.dsChange.emit("");this.dsClear.emit();const s=g(this.visibleOptions);this.activeIndex=s[0]??-1;requestAnimationFrame((()=>this.searchable?this.searchEl?.focus():this.triggerEl?.focus()))};this.handleTriggerKeyDown=e=>{if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(e.key)){e.preventDefault();this.openPopup(true,e.key==="ArrowUp"?"last":"first")}else if(e.key.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey){e.preventDefault();this.openPopup(true);if(this.searchable){this.searchTerm=e.key}else{this.handleTypeahead(e.key)}}return}this.handleListKeyDown(e)}}componentWillLoad(){this.initialValue=this.value;this.syncFormValue()}componentDidLoad(){if(this.open)this.onOpenChange(true)}disconnectedCallback(){this.cancelPositionRetry();this.unbindPopupListeners();if(this.typeaheadTimer)clearTimeout(this.typeaheadTimer)}syncFormValue(){const e=this.isDisabled;const s=this.hasSelection?this.value:"";this.internals.setFormValue(e?null:s);const t=this.required&&!e&&!s;this.internals.setValidity(t?{valueMissing:true}:{},t?this.requiredMessage:"");if(this.open){const e=g(this.visibleOptions);if(!e.includes(this.activeIndex))this.activeIndex=e[0]??-1;requestAnimationFrame((()=>this.updatePosition()))}}onLoadingChange(){if(this.open)requestAnimationFrame((()=>this.updatePosition()))}onOpenChange(e){this.dsOpenChange.emit(e);if(e){this.bindPopupListeners();this.schedulePositionUpdate((()=>{this.scrollActiveOptionIntoView();if(this.searchable)this.searchEl?.focus()}))}else{this.cancelPositionRetry();this.unbindPopupListeners();this.searchTerm="";this.positionReady=false}}onSearchTermChange(){const e=g(this.visibleOptions);this.activeIndex=e[0]??-1;requestAnimationFrame((()=>{this.updatePosition();this.scrollActiveOptionIntoView()}))}onActiveIndexChange(){requestAnimationFrame((()=>this.scrollActiveOptionIntoView()))}formDisabledCallback(e){this.formDisabled=e;this.syncFormValue()}formResetCallback(){this.value=this.initialValue;this.closePopup()}formStateRestoreCallback(e){this.value=typeof e==="string"?e:""}async setFocus(){this.triggerEl?.focus()}get isDisabled(){return this.disabled||this.isInactive||this.formDisabled}get allSections(){return p(this.options,this.sections)}get allOptions(){return f(this.allSections)}get visibleSections(){return this.searchable?u(this.allSections,this.searchTerm):this.allSections}get visibleOptions(){return f(this.visibleSections)}get selectedOption(){return this.allOptions.find((e=>e.value===this.value))}get hasSelection(){return Boolean(this.selectedOption)}get activeOptionId(){return!this.isLoading&&this.activeIndex>=0?`${this.generatedId}-option-${this.activeIndex}`:undefined}scrollActiveOptionIntoView(){if(!this.open||!this.activeOptionId)return;this.el.querySelector(`#${this.activeOptionId}`)?.scrollIntoView({block:"nearest",inline:"nearest"})}bindPopupListeners(){this.unbindPopupListeners();this.outsideHandler=e=>{const s=e.target;if(this.el.contains(s))return;this.closePopup()};this.repositionHandler=()=>this.updatePosition();document.addEventListener("mousedown",this.outsideHandler,true);window.addEventListener("scroll",this.repositionHandler,true);window.addEventListener("resize",this.repositionHandler)}unbindPopupListeners(){if(this.outsideHandler){document.removeEventListener("mousedown",this.outsideHandler,true);this.outsideHandler=null}if(this.repositionHandler){window.removeEventListener("scroll",this.repositionHandler,true);window.removeEventListener("resize",this.repositionHandler);this.repositionHandler=null}}cancelPositionRetry(){if(this.positionRetryRaf!==null){cancelAnimationFrame(this.positionRetryRaf);this.positionRetryRaf=null}}schedulePositionUpdate(e){if(!this.open)return;this.cancelPositionRetry();this.positionReady=false;let s=D;const t=()=>{this.positionRetryRaf=null;if(!this.open)return;if(this.updatePosition()){e?.();return}if(s>0){s-=1;this.positionRetryRaf=requestAnimationFrame(t)}};this.positionRetryRaf=requestAnimationFrame(t)}updatePosition(){if(!this.open||!this.triggerEl||!this.popupEl||!this.popupEl.isConnected||!this.el.contains(this.popupEl))return false;const e=A(L.space050,L.space050);this.popupEl.style.minWidth=`${n(this.triggerEl.offsetWidth,e)}px`;this.position=c({anchorRect:this.triggerEl.getBoundingClientRect(),popupWidth:this.popupEl.offsetWidth,popupHeight:this.popupEl.offsetHeight,side:"bottom",align:"start",sideOffsetPx:e,alignOffsetPx:a({align:"start",alignOffsetPx:0,sectionInsetPx:e}),viewportPadPx:e,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight});this.positionReady=true;return true}openPopup(e,s){if(this.isDisabled||!this.allOptions.length&&!this.isLoading)return;const t=g(this.visibleOptions);const i=this.visibleOptions.findIndex((e=>e.value===this.value&&!e.isInactive));this.activeIndex=s==="last"?t[t.length-1]??-1:i>=0?i:t[0]??-1;this.focusRingVisible=e;this.open=true}closePopup(e=false){if(!this.open)return;this.open=false;if(e)requestAnimationFrame((()=>this.triggerEl?.focus()))}selectOption(e){if(e.isInactive||this.isLoading)return;this.value=e.value;this.dsChange.emit(this.value);this.closePopup(true)}moveActive(e){this.activeIndex=v(this.visibleOptions,this.activeIndex,e)}setActiveEdge(e){const s=g(this.visibleOptions);this.activeIndex=e==="first"?s[0]??-1:s[s.length-1]??-1}handleTypeahead(e){if(this.typeaheadTimer)clearTimeout(this.typeaheadTimer);this.focusRingVisible=true;const s=e.toLocaleLowerCase();const t=this.typeahead.length>0&&[...this.typeahead].every((e=>e===s));this.typeahead=t?s:`${this.typeahead}${s}`;const i=m(this.visibleOptions,this.typeahead,this.activeIndex);if(i>=0)this.activeIndex=i;const r=I(L.animationDurationMedium1,L.animationDurationMedium1);this.typeaheadTimer=setTimeout((()=>{this.typeahead="";this.typeaheadTimer=null}),r)}handleListKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault();this.focusRingVisible=true;this.moveActive(1);break;case"ArrowUp":e.preventDefault();this.focusRingVisible=true;this.moveActive(-1);break;case"Home":e.preventDefault();this.focusRingVisible=true;this.setActiveEdge("first");break;case"End":e.preventDefault();this.focusRingVisible=true;this.setActiveEdge("last");break;case"Enter":case" ":{if(e.key===" "&&this.searchable&&e.target===this.searchEl)break;e.preventDefault();const s=this.visibleOptions[this.activeIndex];if(s)this.selectOption(s);break}case"Escape":e.preventDefault();this.closePopup(true);break;case"Tab":this.closePopup();break;default:if(!this.searchable&&e.key.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey){this.handleTypeahead(e.key)}}}renderOption(e,s,t,r){const o=e.value===this.value;const n=s===this.activeIndex;return i(d,{id:`${this.generatedId}-option-${s}`,option:e,selected:o,active:n,focusRingVisible:this.focusRingVisible,usesSubtext:r,leading:t&&e.icon?i("span",{class:"ds-choice-item__icon ds-interaction-fill__content","aria-hidden":"true"},i("ds-icon",{name:e.icon,size:"md",color:"inherit"})):undefined,onHover:()=>{this.focusRingVisible=false;this.activeIndex=s},onSelect:()=>this.selectOption(e)})}render(){const e=this.isDisabled;const s=!this.hasSelection;const t=s?this.placeholder:this.selectedOption?.label;const o=V[this.size];const n=O[this.size];const c=b(this.allOptions);const a=y(this.allOptions);const d=this.error&&Boolean(this.errorMessage);const g=[this.ariaDescribedby,d?this.errorId:undefined].filter(Boolean).join(" ")||undefined;const p={position:"fixed",left:"0",top:"0",transform:`translate(${Math.round(this.position.x)}px, ${Math.round(this.position.y)}px)`,zIndex:"var(--dimension-z-index-floating)",visibility:this.positionReady?"visible":"hidden"};let f=0;return i(r,{key:"20a252271e86013f45a3f78a49d44f694d46ca0e",class:{"select-host":true,"ds-control-inactive":e,"ds-control--md":this.size==="md","ds-control--sm":this.size==="sm","ds-control--xs":this.size==="xs",...q(this.width),[`select-host--background-${this.background}`]:!!this.background}},i("button",{key:"88bbce06293926d6cc5282a417a5efe137f033f5",ref:e=>{this.triggerEl=e??null},id:this.inputId??this.generatedId,type:"button",class:{trigger:true,"ds-focus-ring-inset":true,"ds-interaction-fill":true,"ds-interaction-fill--selected":!e&&this.activeFill&&this.hasSelection,"trigger--bordered":this.hasBorder||this.error,"trigger--placeholder":s,"trigger--has-value":this.hasSelection,"wrapper--error":this.error,[`ds-control--${this.size}`]:true,...x(this.background)},disabled:e,role:"combobox","aria-haspopup":"listbox","aria-expanded":String(this.open),"aria-controls":this.open?this.listboxId:undefined,"aria-activedescendant":this.open&&!this.searchable?this.activeOptionId:undefined,"aria-label":this.ariaLabel,"aria-labelledby":this.ariaLabelledby,"aria-describedby":g,"aria-invalid":this.error?"true":undefined,"aria-required":this.required||undefined,"aria-busy":this.isLoading?"true":undefined,onClick:()=>this.open?this.closePopup():this.openPopup(false),onKeyDown:this.handleTriggerKeyDown},(this.icon||this.isLoading)&&i("span",{key:"572b4a6859d2e74937e96fa6e3e4627cd43a9161",class:"trigger__prefix ds-interaction-fill__content","aria-hidden":"true"},this.isLoading?i("ds-loader",{size:n,color:"inherit"}):i("ds-icon",{name:this.icon,size:n,color:"inherit"})),i("ds-text",{key:"546a68d555376faef5b1bddf99ca66350fb30431",class:"trigger__label ds-interaction-fill__content",as:"span",variant:o,color:"inherit",lineTruncation:1},t),i("span",{key:"75a7d1a1b7d8f12863519731a4296f3c863601b4",class:"trigger__chevron ds-interaction-fill__content","aria-hidden":"true"},i("ds-icon",{key:"19d705b7391b646ff76f40793b4c3c5b413dab75",name:"ChevronDown",size:n,color:"inherit"}))),this.open&&i("div",{key:"aaa3e039180221c7a7ebf037fbd415d15b324e56",ref:e=>{this.popupEl=e??null},class:"select-popup ds-choice-popup",style:p},this.searchable&&i(l,{key:"7f67581cdeb00feb9ed70bbd03b0d25473637721",value:this.searchTerm,placeholder:this.searchPlaceholder,controls:this.listboxId,activeDescendant:this.activeOptionId,inputRef:e=>{this.searchEl=e},clearLabel:this.clearLabel,onValueChange:e=>{this.searchTerm=e},onKeyDown:e=>this.handleListKeyDown(e)}),i("div",{key:"93c3ce408e6e255eba4a2be709cd171b9cff770c",id:this.listboxId,class:"ds-choice-list",role:"listbox","aria-label":this.ariaLabel??this.placeholder,"aria-busy":this.isLoading?"true":undefined},this.isLoading?i("div",{class:"ds-choice-loading",role:"option","aria-selected":"false","aria-disabled":"true","aria-label":this.loadingLabel,"aria-live":"polite"},i("ds-loader",{size:"md",color:"inherit"})):this.visibleOptions.length===0?i("div",{class:"ds-choice-empty",role:"option","aria-selected":"false","aria-disabled":"true","aria-label":this.noResultsText,"aria-live":"polite"},i("ds-empty-state",{body:this.noResultsText})):this.visibleSections.map((e=>i("div",{class:{"ds-choice-section":true,"ds-choice-section--divided":!!e.divider},role:e.header?"group":undefined,"aria-label":e.header},e.header&&i("ds-text",{class:"ds-choice-section__header ds-control--md",as:"span",variant:"text-body-small",emphasis:true,color:"primary","aria-hidden":"true"},e.header),e.options.map((e=>this.renderOption(e,f++,c,a))))))),this.allowClear&&this.hasSelection&&!this.isLoading&&i(h,{key:"b26cc2aadebe3920da9a0b7d5ee4689bf913affe",clearLabel:this.clearLabel,onClear:this.clearSelection})),d&&i("ds-text",{key:"c44fa96c6ee938fedd4025184386fc2c339971ea",class:"error-text",as:"div",variant:"text-body-small",color:"negative",textId:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}get el(){return this}static get watchers(){return{value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}],options:[{syncFormValue:0}],sections:[{syncFormValue:0}],isLoading:[{onLoadingChange:0}],open:[{onOpenChange:0}],searchTerm:[{onSearchTermChange:0}],activeIndex:[{onActiveIndexChange:0}]}}static get style(){return E()}},[66,"ds-select",{options:[16],sections:[16],value:[1025],open:[1540],name:[513],disabled:[516],required:[516],requiredMessage:[1,"required-message"],placeholder:[1],size:[1],width:[1],isInactive:[4,"is-inactive"],isLoading:[4,"is-loading"],activeFill:[4,"active-fill"],hasBorder:[4,"has-border"],icon:[1],allowClear:[4,"allow-clear"],clearLabel:[1,"clear-label"],searchable:[4],searchPlaceholder:[1,"search-placeholder"],noResultsText:[1,"no-results-text"],loadingLabel:[1,"loading-label"],background:[1],error:[4],errorMessage:[1,"error-message"],inputId:[1,"input-id"],ariaLabel:[1,"aria-label"],ariaLabelledby:[1,"aria-labelledby"],ariaDescribedby:[1,"aria-describedby"],activeIndex:[32],searchTerm:[32],formDisabled:[32],position:[32],positionReady:[32],focusRingVisible:[32],setFocus:[64]},undefined,{value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}],options:[{syncFormValue:0}],sections:[{syncFormValue:0}],isLoading:[{onLoadingChange:0}],open:[{onOpenChange:0}],searchTerm:[{onSearchTermChange:0}],activeIndex:[{onActiveIndexChange:0}]}]);function $(){if(typeof customElements==="undefined"){return}const e=["ds-select","ds-badge","ds-button-unfilled","ds-empty-state","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-select":if(!customElements.get(o(e))){customElements.define(o(e),P)}break;case"ds-badge":if(!customElements.get(o(e))){w()}break;case"ds-button-unfilled":if(!customElements.get(o(e))){k()}break;case"ds-empty-state":if(!customElements.get(o(e))){_()}break;case"ds-icon":if(!customElements.get(o(e))){z()}break;case"ds-loader":if(!customElements.get(o(e))){C()}break;case"ds-text":if(!customElements.get(o(e))){F()}break;case"ds-tooltip":if(!customElements.get(o(e))){j()}break}}))}$();const S=P;const B=$;export{S as DsSelect,B as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["selectCss","ICON_SIZE","md","sm","xs","selectId","POSITION_RETRY_BUDGET","Select","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","options","sections","value","open","disabled","required","requiredMessage","placeholder","size","width","isInactive","isLoading","activeFill","hasBorder","allowClear","clearLabel","searchable","searchPlaceholder","noResultsText","loadingLabel","error","ariaLabel","activeIndex","searchTerm","formDisabled","position","x","y","positionReady","focusRingVisible","generatedId","listboxId","errorId","triggerEl","popupEl","searchEl","initialValue","typeahead","typeaheadTimer","outsideHandler","repositionHandler","positionRetryRaf","clearSelection","event","preventDefault","stopPropagation","dsChange","emit","dsClear","enabled","enabledChoiceIndexes","visibleOptions","requestAnimationFrame","focus","handleTriggerKeyDown","includes","key","openPopup","length","metaKey","ctrlKey","altKey","handleTypeahead","handleListKeyDown","componentWillLoad","syncFormValue","componentDidLoad","onOpenChange","disconnectedCallback","cancelPositionRetry","unbindPopupListeners","clearTimeout","inactive","isDisabled","resolvedValue","hasSelection","internals","setFormValue","missing","setValidity","valueMissing","updatePosition","onLoadingChange","dsOpenChange","bindPopupListeners","schedulePositionUpdate","scrollActiveOptionIntoView","onSearchTermChange","onActiveIndexChange","formDisabledCallback","formResetCallback","closePopup","formStateRestoreCallback","state","setFocus","allSections","resolveChoiceSections","allOptions","flattenChoiceSections","visibleSections","filterChoiceSections","selectedOption","find","option","Boolean","activeOptionId","undefined","el","querySelector","scrollIntoView","block","inline","target","contains","document","addEventListener","window","removeEventListener","cancelAnimationFrame","onReady","remaining","attempt","isConnected","sectionPadding","resolveCssLengthPx","TOKEN_DEFAULTS","space050","style","minWidth","choicePopupMinWidth","offsetWidth","computeAnchoredPopupPosition","anchorRect","getBoundingClientRect","popupWidth","popupHeight","offsetHeight","side","align","sideOffsetPx","alignOffsetPx","resolveChoicePopupAlignOffset","sectionInsetPx","viewportPadPx","viewportWidth","innerWidth","viewportHeight","innerHeight","focusVisible","edge","selectedIndex","findIndex","restoreFocus","selectOption","moveActive","direction","moveChoiceIndex","setActiveEdge","normalized","toLocaleLowerCase","repeatedCharacter","every","character","match","findChoiceTypeaheadMatch","resetMs","resolveCssTimeMs","animationDurationMedium1","setTimeout","renderOption","index","usesIcons","usesSubtext","selected","active","h","ChoiceOptionRow","id","leading","icon","class","name","color","onHover","onSelect","render","showPlaceholder","label","textVariant","CONTROL_TEXT_VARIANT","iconSize","usesOptionIcons","choiceListUsesIcons","usesOptionSubtext","choiceListUsesSubtext","showError","errorMessage","describedBy","ariaDescribedby","filter","join","popupStyle","left","top","transform","Math","round","zIndex","visibility","flatIndex","Host","controlWidthClass","background","ref","element","inputId","type","trigger","choiceBackgroundClassMap","role","String","ariaLabelledby","onClick","onKeyDown","as","variant","lineTruncation","ChoiceSearch","controls","activeDescendant","inputRef","onValueChange","body","map","section","divider","header","emphasis","ChoiceFooter","onClear","textId"],"sources":["src/wc/components/Select/Select.css?tag=ds-select&encapsulation=scoped","src/wc/components/Select/Select.tsx"],"sourcesContent":["@import '../../utils/choice-list.css';\n@import '../../utils/control-width.css';\n@import '../../utils/search-control.css';\n@import '../../utils/typography.css';\n\n:host(.select-host) {\n display: inline-flex;\n flex-direction: column;\n gap: var(--dimension-space-050);\n position: relative;\n outline: none;\n --ds-select-fg: var(--color-foreground-secondary);\n --ds-select-fg-active: var(--color-foreground-primary);\n --ds-select-prefix-fg: var(--ds-select-fg);\n --ds-select-chevron-fg: var(--ds-select-fg);\n --ds-select-border: var(--color-border-secondary);\n}\n\n:host(.ds-control-width--fill),\n:host(.ds-control-width--fill) .trigger {\n width: 100%;\n}\n\n.trigger {\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n box-sizing: border-box;\n height: var(--ds-control-height, var(--dimension-size-400));\n padding: 0 var(--ds-control-padding-inline, var(--dimension-space-075));\n gap: var(--ds-control-gap, var(--dimension-space-050));\n background: transparent;\n border: none;\n border-radius: var(--ds-control-radius, var(--dimension-radius-025));\n color: var(--ds-select-fg);\n cursor: pointer;\n font-family: inherit;\n -webkit-user-select: none;\n user-select: none;\n overflow: hidden;\n transition: color var(--effect-motion-short-2);\n}\n\n.trigger--bordered {\n --ds-interaction-border-width: var(--dimension-stroke-width-012);\n --ds-interaction-border-color: var(--ds-select-border);\n}\n\n.trigger--has-value .trigger__label {\n color: var(--ds-select-fg-active);\n}\n\n.wrapper--error {\n --ds-interaction-border-width: var(--dimension-stroke-width-018);\n --ds-interaction-border-color: var(--color-border-bold-negative);\n}\n\n.trigger__prefix,\n.trigger__chevron {\n position: relative;\n z-index: 2;\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 display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.trigger__prefix {\n color: var(--ds-select-prefix-fg);\n}\n\n.trigger__chevron {\n color: var(--ds-select-chevron-fg);\n}\n\n.trigger__label {\n position: relative;\n z-index: 2;\n flex: 1 1 auto;\n min-width: 0;\n padding: 0 var(--ds-control-label-inset, var(--dimension-space-025));\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n color: inherit;\n transition: color var(--effect-motion-short-2);\n}\n\n.select-popup {\n color: var(--color-foreground-secondary);\n}\n\n.select-option[aria-selected='true'] .ds-choice-item__icon {\n color: var(--color-foreground-primary);\n}\n\n.error-text {\n width: 100%;\n}\n\n:host(.select-host--background-medium) {\n --ds-select-fg: var(--color-foreground-on-medium-background-secondary);\n --ds-select-fg-active: var(--color-foreground-on-medium-background-primary);\n --ds-select-border: var(--color-border-on-medium-background-secondary);\n}\n\n:host(.select-host--background-bold) {\n --ds-select-fg: var(--color-foreground-on-bold-background-secondary);\n --ds-select-fg-active: var(--color-foreground-on-bold-background-primary);\n --ds-select-border: var(--color-border-on-bold-background-secondary);\n}\n\n:host(.select-host--background-strong) {\n --ds-select-fg: var(--color-foreground-on-strong-background-secondary);\n --ds-select-fg-active: var(--color-foreground-on-strong-background-primary);\n --ds-select-border: var(--color-border-on-strong-background-secondary);\n}\n\n:host(.select-host--background-translucent) {\n --ds-select-fg: var(--color-translucent-foreground-secondary);\n --ds-select-fg-active: var(--color-translucent-foreground-primary);\n --ds-select-border: var(--color-translucent-border-secondary);\n}\n\n:host(.select-host--background-inverted) {\n --ds-select-fg: var(--color-inverted-foreground-secondary);\n --ds-select-fg-active: var(--color-inverted-foreground-primary);\n --ds-select-border: var(--color-inverted-border-secondary);\n}\n\n:host(.select-host--background-media) {\n --ds-select-fg: var(--color-media-foreground-secondary);\n --ds-select-fg-active: var(--color-media-foreground-primary);\n --ds-select-border: var(--color-media-border-secondary);\n}\n\n:host(.select-host--background-always-dark) {\n --ds-select-fg: var(--color-always-dark-foreground-secondary);\n --ds-select-fg-active: var(--color-always-dark-foreground-primary);\n --ds-select-border: var(--color-always-dark-border-secondary);\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport {\n controlWidthClass,\n CONTROL_TEXT_VARIANT,\n choicePopupMinWidth,\n resolveCssLengthPx,\n resolveCssTimeMs,\n resolveChoicePopupAlignOffset,\n TOKEN_DEFAULTS,\n type ControlWidth,\n} from '../../utils';\nimport { computeAnchoredPopupPosition } from '../../utils/anchored-popup';\nimport { ChoiceFooter, ChoiceOptionRow, ChoiceSearch } from '../../utils/choice-list-parts';\nimport {\n choiceBackgroundClassMap,\n choiceListUsesIcons,\n choiceListUsesSubtext,\n enabledChoiceIndexes,\n filterChoiceSections,\n findChoiceTypeaheadMatch,\n flattenChoiceSections,\n moveChoiceIndex,\n resolveChoiceSections,\n type ChoiceBackground,\n type ChoiceOption,\n type ChoiceSection,\n} from '../../utils/choice-list';\n\nexport type SelectOption = ChoiceOption;\nexport type SelectSection = ChoiceSection;\nexport type SelectBackground = ChoiceBackground;\nexport type SelectSize = 'md' | 'sm' | 'xs';\nexport type SelectWidth = ControlWidth;\n\nconst ICON_SIZE: Record<SelectSize, 'md' | 'sm' | 'xs'> = {\n md: 'md',\n sm: 'sm',\n xs: 'xs',\n};\n\nlet selectId = 0;\n/** rAF retries while the conditionally rendered popup mounts. */\nconst POSITION_RETRY_BUDGET = 8;\n\n@Component({\n tag: 'ds-select',\n styleUrl: 'Select.css',\n scoped: true,\n formAssociated: true,\n})\nexport class Select {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n /** Flat choices. Assign arrays through the JavaScript property. */\n @Prop() options: SelectOption[] = [];\n /** Grouped choices; takes precedence over options. Assign through JavaScript. */\n @Prop() sections: SelectSection[] = [];\n /** Selected string value. Unknown values render the placeholder and are not submitted. */\n @Prop({ mutable: true }) value: string = '';\n /** Controlled popup visibility. */\n @Prop({ mutable: true, reflect: true }) open: boolean = false;\n /** Native form field name. */\n @Prop({ reflect: true }) name: string | undefined;\n /** Native disabled state. */\n @Prop({ reflect: true }) disabled: boolean = false;\n /** Require one valid selected value. */\n @Prop({ reflect: true }) required: boolean = false;\n /** Validation message used when required is missing. */\n @Prop() requiredMessage: string = 'This field is required.';\n /** Trigger text shown when no valid value is selected. */\n @Prop() placeholder: string = 'Select';\n /** Control density. */\n @Prop() size: SelectSize = 'md';\n /** Width fit — hug content (default) or fill the parent. */\n @Prop() width: SelectWidth = 'hug';\n /** Shared inactive treatment; removes interaction and form submission. */\n @Prop() isInactive: boolean = false;\n /** Replace the prefix with a loader and disable option interaction. */\n @Prop() isLoading: boolean = false;\n /** Show the selected interaction fill when a valid value exists. */\n @Prop() activeFill: boolean = true;\n /** Show the surface-aware inset border. */\n @Prop() hasBorder: boolean = true;\n /** Optional trigger prefix icon name. */\n @Prop() icon: string | undefined;\n /** Show the clear footer action when a value exists. */\n @Prop() allowClear: boolean = true;\n /** Localized clear action label. */\n @Prop() clearLabel: string = 'Clear';\n /** Show immediate local filtering over option labels, subtext, and section headings. */\n @Prop() searchable: boolean = false;\n /** Localized search-field placeholder and accessible name. */\n @Prop() searchPlaceholder: string = 'Search';\n /** Localized empty-filter result text. */\n @Prop() noResultsText: string = 'No results found';\n /** Accessible loading status label. */\n @Prop() loadingLabel: string = 'Loading';\n /** Actual parent surface context; omit on primary and secondary surfaces. */\n @Prop() background: SelectBackground | undefined;\n /** Show invalid visual state. */\n @Prop() error: boolean = false;\n /** Error text rendered below the trigger when error is true. */\n @Prop() errorMessage: string | undefined;\n /** ID applied to the internal combobox trigger for external labels. */\n @Prop() inputId: string | undefined;\n /** Direct accessible name when no external label is available. */\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n /** IDs of elements that label the combobox. */\n @Prop({ attribute: 'aria-labelledby' }) ariaLabelledby: string | undefined;\n /** Additional IDs that describe the combobox. */\n @Prop({ attribute: 'aria-describedby' }) ariaDescribedby: string | undefined;\n\n /** Emitted after user selection or clearing with the next scalar value. */\n @Event() dsChange!: EventEmitter<string>;\n /** Emitted after the footer clear action. */\n @Event() dsClear!: EventEmitter<void>;\n /** Emitted whenever popup visibility changes. */\n @Event() dsOpenChange!: EventEmitter<boolean>;\n\n @State() private activeIndex = -1;\n @State() private searchTerm = '';\n @State() private formDisabled = false;\n @State() private position = { x: 0, y: 0 };\n @State() private positionReady = false;\n @State() private focusRingVisible = false;\n\n private readonly generatedId = `ds-select-${++selectId}`;\n private readonly listboxId = `${this.generatedId}-listbox`;\n private readonly errorId = `${this.generatedId}-error`;\n private triggerEl: HTMLButtonElement | null = null;\n private popupEl: HTMLDivElement | null = null;\n private searchEl: HTMLInputElement | null = null;\n private initialValue = '';\n private typeahead = '';\n private typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n private outsideHandler: ((event: MouseEvent) => void) | null = null;\n private repositionHandler: (() => void) | null = null;\n private positionRetryRaf: number | null = null;\n\n componentWillLoad() {\n this.initialValue = this.value;\n this.syncFormValue();\n }\n\n componentDidLoad() {\n if (this.open) this.onOpenChange(true);\n }\n\n disconnectedCallback() {\n this.cancelPositionRetry();\n this.unbindPopupListeners();\n if (this.typeaheadTimer) clearTimeout(this.typeaheadTimer);\n }\n\n @Watch('value')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('required')\n @Watch('options')\n @Watch('sections')\n syncFormValue() {\n const inactive = this.isDisabled;\n const resolvedValue = this.hasSelection ? this.value : '';\n this.internals.setFormValue(inactive ? null : resolvedValue);\n const missing = this.required && !inactive && !resolvedValue;\n this.internals.setValidity(missing ? { valueMissing: true } : {}, missing ? this.requiredMessage : '');\n if (this.open) {\n const enabled = enabledChoiceIndexes(this.visibleOptions);\n if (!enabled.includes(this.activeIndex)) this.activeIndex = enabled[0] ?? -1;\n requestAnimationFrame(() => this.updatePosition());\n }\n }\n\n @Watch('isLoading')\n onLoadingChange() {\n if (this.open) requestAnimationFrame(() => this.updatePosition());\n }\n\n @Watch('open')\n onOpenChange(open: boolean) {\n this.dsOpenChange.emit(open);\n if (open) {\n this.bindPopupListeners();\n this.schedulePositionUpdate(() => {\n this.scrollActiveOptionIntoView();\n if (this.searchable) this.searchEl?.focus();\n });\n } else {\n this.cancelPositionRetry();\n this.unbindPopupListeners();\n this.searchTerm = '';\n this.positionReady = false;\n }\n }\n\n @Watch('searchTerm')\n onSearchTermChange() {\n const enabled = enabledChoiceIndexes(this.visibleOptions);\n this.activeIndex = enabled[0] ?? -1;\n requestAnimationFrame(() => {\n this.updatePosition();\n this.scrollActiveOptionIntoView();\n });\n }\n\n @Watch('activeIndex')\n onActiveIndexChange() {\n requestAnimationFrame(() => this.scrollActiveOptionIntoView());\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n this.closePopup();\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = typeof state === 'string' ? state : '';\n }\n\n @Method()\n async setFocus() {\n this.triggerEl?.focus();\n }\n\n private get isDisabled(): boolean {\n return this.disabled || this.isInactive || this.formDisabled;\n }\n\n private get allSections(): SelectSection[] {\n return resolveChoiceSections(this.options, this.sections);\n }\n\n private get allOptions(): SelectOption[] {\n return flattenChoiceSections(this.allSections);\n }\n\n private get visibleSections(): SelectSection[] {\n return this.searchable\n ? filterChoiceSections(this.allSections, this.searchTerm)\n : this.allSections;\n }\n\n private get visibleOptions(): SelectOption[] {\n return flattenChoiceSections(this.visibleSections);\n }\n\n private get selectedOption(): SelectOption | undefined {\n return this.allOptions.find(option => option.value === this.value);\n }\n\n private get hasSelection(): boolean {\n return Boolean(this.selectedOption);\n }\n\n private get activeOptionId(): string | undefined {\n return !this.isLoading && this.activeIndex >= 0\n ? `${this.generatedId}-option-${this.activeIndex}`\n : undefined;\n }\n\n private scrollActiveOptionIntoView() {\n if (!this.open || !this.activeOptionId) return;\n this.el\n .querySelector<HTMLElement>(`#${this.activeOptionId}`)\n ?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n\n private bindPopupListeners() {\n this.unbindPopupListeners();\n this.outsideHandler = event => {\n const target = event.target as Node;\n if (this.el.contains(target)) return;\n this.closePopup();\n };\n this.repositionHandler = () => this.updatePosition();\n document.addEventListener('mousedown', this.outsideHandler, true);\n window.addEventListener('scroll', this.repositionHandler, true);\n window.addEventListener('resize', this.repositionHandler);\n }\n\n private unbindPopupListeners() {\n if (this.outsideHandler) {\n document.removeEventListener('mousedown', this.outsideHandler, true);\n this.outsideHandler = null;\n }\n if (this.repositionHandler) {\n window.removeEventListener('scroll', this.repositionHandler, true);\n window.removeEventListener('resize', this.repositionHandler);\n this.repositionHandler = null;\n }\n }\n\n private cancelPositionRetry() {\n if (this.positionRetryRaf !== null) {\n cancelAnimationFrame(this.positionRetryRaf);\n this.positionRetryRaf = null;\n }\n }\n\n /** Retry until the conditionally rendered popup is mounted and measurable. */\n private schedulePositionUpdate(onReady?: () => void) {\n if (!this.open) return;\n\n this.cancelPositionRetry();\n this.positionReady = false;\n let remaining = POSITION_RETRY_BUDGET;\n\n const attempt = () => {\n this.positionRetryRaf = null;\n if (!this.open) return;\n\n if (this.updatePosition()) {\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 the current popup was found and positioned. */\n private updatePosition(): boolean {\n if (\n !this.open ||\n !this.triggerEl ||\n !this.popupEl ||\n !this.popupEl.isConnected ||\n !this.el.contains(this.popupEl)\n ) return false;\n const sectionPadding = resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n this.popupEl.style.minWidth = `${choicePopupMinWidth(this.triggerEl.offsetWidth, sectionPadding)}px`;\n this.position = computeAnchoredPopupPosition({\n anchorRect: this.triggerEl.getBoundingClientRect(),\n popupWidth: this.popupEl.offsetWidth,\n popupHeight: this.popupEl.offsetHeight,\n side: 'bottom',\n align: 'start',\n sideOffsetPx: sectionPadding,\n alignOffsetPx: resolveChoicePopupAlignOffset({\n align: 'start',\n alignOffsetPx: 0,\n sectionInsetPx: sectionPadding,\n }),\n viewportPadPx: sectionPadding,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n });\n this.positionReady = true;\n return true;\n }\n\n private openPopup(focusVisible: boolean, edge?: 'first' | 'last') {\n if (this.isDisabled || (!this.allOptions.length && !this.isLoading)) return;\n const enabled = enabledChoiceIndexes(this.visibleOptions);\n const selectedIndex = this.visibleOptions.findIndex(\n option => option.value === this.value && !option.isInactive,\n );\n this.activeIndex =\n edge === 'last'\n ? (enabled[enabled.length - 1] ?? -1)\n : selectedIndex >= 0\n ? selectedIndex\n : (enabled[0] ?? -1);\n this.focusRingVisible = focusVisible;\n this.open = true;\n }\n\n private closePopup(restoreFocus = false) {\n if (!this.open) return;\n this.open = false;\n if (restoreFocus) requestAnimationFrame(() => this.triggerEl?.focus());\n }\n\n private selectOption(option: SelectOption) {\n if (option.isInactive || this.isLoading) return;\n this.value = option.value;\n this.dsChange.emit(this.value);\n this.closePopup(true);\n }\n\n private clearSelection = (event: Event) => {\n event.preventDefault();\n event.stopPropagation();\n this.value = '';\n this.dsChange.emit('');\n this.dsClear.emit();\n const enabled = enabledChoiceIndexes(this.visibleOptions);\n this.activeIndex = enabled[0] ?? -1;\n requestAnimationFrame(() => (this.searchable ? this.searchEl?.focus() : this.triggerEl?.focus()));\n };\n\n private moveActive(direction: 1 | -1) {\n this.activeIndex = moveChoiceIndex(this.visibleOptions, this.activeIndex, direction);\n }\n\n private setActiveEdge(edge: 'first' | 'last') {\n const enabled = enabledChoiceIndexes(this.visibleOptions);\n this.activeIndex =\n edge === 'first' ? (enabled[0] ?? -1) : (enabled[enabled.length - 1] ?? -1);\n }\n\n private handleTypeahead(key: string) {\n if (this.typeaheadTimer) clearTimeout(this.typeaheadTimer);\n this.focusRingVisible = true;\n const normalized = key.toLocaleLowerCase();\n const repeatedCharacter =\n this.typeahead.length > 0 &&\n [...this.typeahead].every(character => character === normalized);\n this.typeahead = repeatedCharacter ? normalized : `${this.typeahead}${normalized}`;\n const match = findChoiceTypeaheadMatch(this.visibleOptions, this.typeahead, this.activeIndex);\n if (match >= 0) this.activeIndex = match;\n const resetMs = resolveCssTimeMs(\n TOKEN_DEFAULTS.animationDurationMedium1,\n TOKEN_DEFAULTS.animationDurationMedium1,\n );\n this.typeaheadTimer = setTimeout(() => {\n this.typeahead = '';\n this.typeaheadTimer = null;\n }, resetMs);\n }\n\n private handleListKeyDown(event: KeyboardEvent) {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n this.focusRingVisible = true;\n this.moveActive(1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.focusRingVisible = true;\n this.moveActive(-1);\n break;\n case 'Home':\n event.preventDefault();\n this.focusRingVisible = true;\n this.setActiveEdge('first');\n break;\n case 'End':\n event.preventDefault();\n this.focusRingVisible = true;\n this.setActiveEdge('last');\n break;\n case 'Enter':\n case ' ': {\n if (event.key === ' ' && this.searchable && event.target === this.searchEl) break;\n event.preventDefault();\n const option = this.visibleOptions[this.activeIndex];\n if (option) this.selectOption(option);\n break;\n }\n case 'Escape':\n event.preventDefault();\n this.closePopup(true);\n break;\n case 'Tab':\n this.closePopup();\n break;\n default:\n if (!this.searchable && event.key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey) {\n this.handleTypeahead(event.key);\n }\n }\n }\n\n private handleTriggerKeyDown = (event: KeyboardEvent) => {\n if (!this.open) {\n if (['ArrowDown', 'ArrowUp', 'Enter', ' '].includes(event.key)) {\n event.preventDefault();\n this.openPopup(true, event.key === 'ArrowUp' ? 'last' : 'first');\n } else if (event.key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey) {\n event.preventDefault();\n this.openPopup(true);\n if (this.searchable) {\n this.searchTerm = event.key;\n } else {\n this.handleTypeahead(event.key);\n }\n }\n return;\n }\n this.handleListKeyDown(event);\n };\n\n private renderOption(\n option: SelectOption,\n index: number,\n usesIcons: boolean,\n usesSubtext: boolean,\n ) {\n const selected = option.value === this.value;\n const active = index === this.activeIndex;\n return (\n <ChoiceOptionRow\n id={`${this.generatedId}-option-${index}`}\n option={option}\n selected={selected}\n active={active}\n focusRingVisible={this.focusRingVisible}\n usesSubtext={usesSubtext}\n leading={usesIcons && option.icon ? (\n <span class=\"ds-choice-item__icon ds-interaction-fill__content\" aria-hidden=\"true\">\n <ds-icon name={option.icon} size=\"md\" color=\"inherit\" />\n </span>\n ) : undefined}\n onHover={() => {\n this.focusRingVisible = false;\n this.activeIndex = index;\n }}\n onSelect={() => this.selectOption(option)}\n />\n );\n }\n\n render() {\n const inactive = this.isDisabled;\n const showPlaceholder = !this.hasSelection;\n const label = showPlaceholder ? this.placeholder : this.selectedOption?.label;\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const iconSize = ICON_SIZE[this.size];\n const usesOptionIcons = choiceListUsesIcons(this.allOptions);\n const usesOptionSubtext = choiceListUsesSubtext(this.allOptions);\n const showError = this.error && Boolean(this.errorMessage);\n const describedBy = [this.ariaDescribedby, showError ? this.errorId : undefined]\n .filter(Boolean)\n .join(' ') || undefined;\n const popupStyle = {\n position: 'fixed',\n left: '0',\n top: '0',\n transform: `translate(${Math.round(this.position.x)}px, ${Math.round(this.position.y)}px)`,\n zIndex: 'var(--dimension-z-index-floating)',\n visibility: this.positionReady ? 'visible' : 'hidden',\n };\n let flatIndex = 0;\n\n return (\n <Host\n class={{\n 'select-host': true,\n 'ds-control-inactive': inactive,\n 'ds-control--md': this.size === 'md',\n 'ds-control--sm': this.size === 'sm',\n 'ds-control--xs': this.size === 'xs',\n ...controlWidthClass(this.width),\n [`select-host--background-${this.background}`]: !!this.background,\n }}\n >\n <button\n ref={element => {\n this.triggerEl = (element as HTMLButtonElement) ?? null;\n }}\n id={this.inputId ?? this.generatedId}\n type=\"button\"\n class={{\n trigger: true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected':\n !inactive && this.activeFill && this.hasSelection,\n 'trigger--bordered': this.hasBorder || this.error,\n 'trigger--placeholder': showPlaceholder,\n 'trigger--has-value': this.hasSelection,\n 'wrapper--error': this.error,\n [`ds-control--${this.size}`]: true,\n ...choiceBackgroundClassMap(this.background),\n }}\n disabled={inactive}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={String(this.open)}\n aria-controls={this.open ? this.listboxId : undefined}\n aria-activedescendant={this.open && !this.searchable ? this.activeOptionId : undefined}\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledby}\n aria-describedby={describedBy}\n aria-invalid={this.error ? 'true' : undefined}\n aria-required={this.required || undefined}\n aria-busy={this.isLoading ? 'true' : undefined}\n onClick={() => (this.open ? this.closePopup() : this.openPopup(false))}\n onKeyDown={this.handleTriggerKeyDown}\n >\n {(this.icon || this.isLoading) && (\n <span class=\"trigger__prefix ds-interaction-fill__content\" aria-hidden=\"true\">\n {this.isLoading ? (\n <ds-loader size={iconSize} color=\"inherit\" />\n ) : (\n <ds-icon name={this.icon} size={iconSize} color=\"inherit\" />\n )}\n </span>\n )}\n <ds-text\n class=\"trigger__label ds-interaction-fill__content\"\n as=\"span\"\n variant={textVariant}\n color=\"inherit\"\n lineTruncation={1}\n >\n {label}\n </ds-text>\n <span class=\"trigger__chevron ds-interaction-fill__content\" aria-hidden=\"true\">\n <ds-icon name=\"ChevronDown\" size={iconSize} color=\"inherit\" />\n </span>\n </button>\n\n {this.open && (\n <div\n ref={element => {\n this.popupEl = (element as HTMLDivElement) ?? null;\n }}\n class=\"select-popup ds-choice-popup\"\n style={popupStyle}\n >\n {this.searchable && (\n <ChoiceSearch\n value={this.searchTerm}\n placeholder={this.searchPlaceholder}\n controls={this.listboxId}\n activeDescendant={this.activeOptionId}\n inputRef={element => {\n this.searchEl = element;\n }}\n clearLabel={this.clearLabel}\n onValueChange={value => {\n this.searchTerm = value;\n }}\n onKeyDown={event => this.handleListKeyDown(event)}\n />\n )}\n <div\n id={this.listboxId}\n class=\"ds-choice-list\"\n role=\"listbox\"\n aria-label={this.ariaLabel ?? this.placeholder}\n aria-busy={this.isLoading ? 'true' : undefined}\n >\n {this.isLoading ? (\n <div\n class=\"ds-choice-loading\"\n role=\"option\"\n aria-selected=\"false\"\n aria-disabled=\"true\"\n aria-label={this.loadingLabel}\n aria-live=\"polite\"\n >\n <ds-loader size=\"md\" color=\"inherit\" />\n </div>\n ) : this.visibleOptions.length === 0 ? (\n <div\n class=\"ds-choice-empty\"\n role=\"option\"\n aria-selected=\"false\"\n aria-disabled=\"true\"\n aria-label={this.noResultsText}\n aria-live=\"polite\"\n >\n <ds-empty-state body={this.noResultsText} />\n </div>\n ) : (\n this.visibleSections.map(section => (\n <div\n class={{\n 'ds-choice-section': true,\n 'ds-choice-section--divided': !!section.divider,\n }}\n role={section.header ? 'group' : undefined}\n aria-label={section.header}\n >\n {section.header && (\n <ds-text\n class=\"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 {section.options.map(option => this.renderOption(\n option,\n flatIndex++,\n usesOptionIcons,\n usesOptionSubtext,\n ))}\n </div>\n ))\n )}\n </div>\n {this.allowClear && this.hasSelection && !this.isLoading && (\n <ChoiceFooter clearLabel={this.clearLabel} onClear={this.clearSelection} />\n )}\n </div>\n )}\n\n {showError && (\n <ds-text\n class=\"error-text\"\n as=\"div\"\n variant=\"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,QAGZF,EAAQ1O,QAAQyO,KAAIlI,GAAUxG,KAAK0K,aAClClE,EACA0G,IACAlB,EACAE,SAMTlM,KAAKe,YAAcf,KAAK4E,eAAiB5E,KAAKY,WAC7CoK,EAAC+D,EAAY,CAAAtL,IAAA,2CAACzC,WAAYhB,KAAKgB,WAAYgO,QAAShP,KAAK2C,kBAK9DyJ,GACCpB,EAAA,WAAAvH,IAAA,2CACE4H,MAAM,aACN4C,GAAG,MACHC,QAAQ,kBACR3C,MAAM,WACN0D,OAAQjP,KAAKiC,QACb2L,KAAK,SAEJ5N,KAAKqM,c","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["selectCss","ICON_SIZE","md","sm","xs","selectId","POSITION_RETRY_BUDGET","Select","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","options","sections","value","open","disabled","required","requiredMessage","placeholder","size","width","isInactive","isLoading","activeFill","hasBorder","allowClear","clearLabel","searchable","searchPlaceholder","noResultsText","loadingLabel","error","ariaLabel","activeIndex","searchTerm","formDisabled","position","x","y","positionReady","focusRingVisible","generatedId","listboxId","errorId","triggerEl","popupEl","searchEl","initialValue","typeahead","typeaheadTimer","outsideHandler","repositionHandler","positionRetryRaf","clearSelection","event","preventDefault","stopPropagation","dsChange","emit","dsClear","enabled","enabledChoiceIndexes","visibleOptions","requestAnimationFrame","focus","handleTriggerKeyDown","includes","key","openPopup","length","metaKey","ctrlKey","altKey","handleTypeahead","handleListKeyDown","componentWillLoad","syncFormValue","componentDidLoad","onOpenChange","disconnectedCallback","cancelPositionRetry","unbindPopupListeners","clearTimeout","inactive","isDisabled","resolvedValue","hasSelection","internals","setFormValue","missing","setValidity","valueMissing","updatePosition","onLoadingChange","dsOpenChange","bindPopupListeners","schedulePositionUpdate","scrollActiveOptionIntoView","onSearchTermChange","onActiveIndexChange","formDisabledCallback","formResetCallback","closePopup","formStateRestoreCallback","state","setFocus","allSections","resolveChoiceSections","allOptions","flattenChoiceSections","visibleSections","filterChoiceSections","selectedOption","find","option","Boolean","activeOptionId","undefined","el","querySelector","scrollIntoView","block","inline","target","contains","document","addEventListener","window","removeEventListener","cancelAnimationFrame","onReady","remaining","attempt","isConnected","sectionPadding","resolveCssLengthPx","TOKEN_DEFAULTS","space050","style","minWidth","choicePopupMinWidth","offsetWidth","computeAnchoredPopupPosition","anchorRect","getBoundingClientRect","popupWidth","popupHeight","offsetHeight","side","align","sideOffsetPx","alignOffsetPx","resolveChoicePopupAlignOffset","sectionInsetPx","viewportPadPx","viewportWidth","innerWidth","viewportHeight","innerHeight","focusVisible","edge","selectedIndex","findIndex","restoreFocus","selectOption","moveActive","direction","moveChoiceIndex","setActiveEdge","normalized","toLocaleLowerCase","repeatedCharacter","every","character","match","findChoiceTypeaheadMatch","resetMs","resolveCssTimeMs","animationDurationMedium1","setTimeout","renderOption","index","usesIcons","usesSubtext","selected","active","h","ChoiceOptionRow","id","leading","icon","class","name","color","onHover","onSelect","render","showPlaceholder","label","textVariant","CONTROL_TEXT_VARIANT","iconSize","usesOptionIcons","choiceListUsesIcons","usesOptionSubtext","choiceListUsesSubtext","showError","errorMessage","describedBy","ariaDescribedby","filter","join","popupStyle","left","top","transform","Math","round","zIndex","visibility","flatIndex","Host","controlWidthClass","background","ref","element","inputId","type","trigger","choiceBackgroundClassMap","role","String","ariaLabelledby","onClick","onKeyDown","as","variant","lineTruncation","ChoiceSearch","controls","activeDescendant","inputRef","onValueChange","body","map","section","divider","header","emphasis","ChoiceFooter","onClear","textId"],"sources":["src/wc/components/Select/Select.css?tag=ds-select&encapsulation=scoped","src/wc/components/Select/Select.tsx"],"sourcesContent":["@import '../../utils/choice-list.css';\n@import '../../utils/control-width.css';\n@import '../../utils/search-control.css';\n@import '../../utils/typography.css';\n\n:host(.select-host) {\n display: inline-flex;\n flex-direction: column;\n gap: var(--dimension-space-050);\n position: relative;\n outline: none;\n --ds-select-fg: var(--color-foreground-secondary);\n --ds-select-fg-active: var(--color-foreground-primary);\n --ds-select-prefix-fg: var(--ds-select-fg);\n --ds-select-chevron-fg: var(--ds-select-fg);\n --ds-select-border: var(--color-border-secondary);\n}\n\n:host(.ds-control-width--fill),\n:host(.ds-control-width--fill) .trigger {\n width: 100%;\n}\n\n.trigger {\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n box-sizing: border-box;\n height: var(--ds-control-height, var(--dimension-size-400));\n padding: 0 var(--ds-control-padding-inline, var(--dimension-space-075));\n gap: var(--ds-control-gap, var(--dimension-space-050));\n background: transparent;\n border: none;\n border-radius: var(--ds-control-radius, var(--dimension-radius-025));\n color: var(--ds-select-fg);\n cursor: pointer;\n font-family: inherit;\n -webkit-user-select: none;\n user-select: none;\n overflow: hidden;\n transition: color var(--effect-motion-short-2);\n}\n\n.trigger--bordered {\n --ds-interaction-border-width: var(--dimension-stroke-width-012);\n --ds-interaction-border-color: var(--ds-select-border);\n}\n\n.trigger--has-value .trigger__label {\n color: var(--ds-select-fg-active);\n}\n\n.wrapper--error {\n --ds-interaction-border-width: var(--dimension-stroke-width-018);\n --ds-interaction-border-color: var(--color-border-bold-negative);\n}\n\n.trigger__prefix,\n.trigger__chevron {\n position: relative;\n z-index: 2;\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 display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.trigger__prefix {\n color: var(--ds-select-prefix-fg);\n}\n\n.trigger__chevron {\n color: var(--ds-select-chevron-fg);\n}\n\n.trigger__label {\n position: relative;\n z-index: 2;\n flex: 1 1 auto;\n min-width: 0;\n padding: 0 var(--ds-control-label-inset, var(--dimension-space-025));\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n color: inherit;\n transition: color var(--effect-motion-short-2);\n}\n\n.select-popup {\n color: var(--color-foreground-secondary);\n}\n\n.select-option[aria-selected='true'] .ds-choice-item__icon {\n color: var(--color-foreground-primary);\n}\n\n.error-text {\n width: 100%;\n}\n\n:host(.select-host--background-medium) {\n --ds-select-fg: var(--color-foreground-on-medium-background-secondary);\n --ds-select-fg-active: var(--color-foreground-on-medium-background-primary);\n --ds-select-border: var(--color-border-on-medium-background-secondary);\n}\n\n:host(.select-host--background-bold) {\n --ds-select-fg: var(--color-foreground-on-bold-background-secondary);\n --ds-select-fg-active: var(--color-foreground-on-bold-background-primary);\n --ds-select-border: var(--color-border-on-bold-background-secondary);\n}\n\n:host(.select-host--background-strong) {\n --ds-select-fg: var(--color-foreground-on-strong-background-secondary);\n --ds-select-fg-active: var(--color-foreground-on-strong-background-primary);\n --ds-select-border: var(--color-border-on-strong-background-secondary);\n}\n\n:host(.select-host--background-translucent) {\n --ds-select-fg: var(--color-translucent-foreground-secondary);\n --ds-select-fg-active: var(--color-translucent-foreground-primary);\n --ds-select-border: var(--color-translucent-border-secondary);\n}\n\n:host(.select-host--background-inverted) {\n --ds-select-fg: var(--color-inverted-foreground-secondary);\n --ds-select-fg-active: var(--color-inverted-foreground-primary);\n --ds-select-border: var(--color-inverted-border-secondary);\n}\n\n:host(.select-host--background-media) {\n --ds-select-fg: var(--color-media-foreground-secondary);\n --ds-select-fg-active: var(--color-media-foreground-primary);\n --ds-select-border: var(--color-media-border-secondary);\n}\n\n:host(.select-host--background-always-dark) {\n --ds-select-fg: var(--color-always-dark-foreground-secondary);\n --ds-select-fg-active: var(--color-always-dark-foreground-primary);\n --ds-select-border: var(--color-always-dark-border-secondary);\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport {\n controlWidthClass,\n CONTROL_TEXT_VARIANT,\n choicePopupMinWidth,\n resolveCssLengthPx,\n resolveCssTimeMs,\n resolveChoicePopupAlignOffset,\n TOKEN_DEFAULTS,\n type ControlWidth,\n} from '../../utils';\nimport { computeAnchoredPopupPosition } from '../../utils/anchored-popup';\nimport { ChoiceFooter, ChoiceOptionRow, ChoiceSearch } from '../../utils/choice-list-parts';\nimport {\n choiceBackgroundClassMap,\n choiceListUsesIcons,\n choiceListUsesSubtext,\n enabledChoiceIndexes,\n filterChoiceSections,\n findChoiceTypeaheadMatch,\n flattenChoiceSections,\n moveChoiceIndex,\n resolveChoiceSections,\n type ChoiceBackground,\n type ChoiceOption,\n type ChoiceSection,\n} from '../../utils/choice-list';\n\nexport type SelectOption = ChoiceOption;\nexport type SelectSection = ChoiceSection;\nexport type SelectBackground = ChoiceBackground;\nexport type SelectSize = 'md' | 'sm' | 'xs';\nexport type SelectWidth = ControlWidth;\n\nconst ICON_SIZE: Record<SelectSize, 'md' | 'sm' | 'xs'> = {\n md: 'md',\n sm: 'sm',\n xs: 'xs',\n};\n\nlet selectId = 0;\n/** rAF retries while the conditionally rendered popup mounts. */\nconst POSITION_RETRY_BUDGET = 8;\n\n@Component({\n tag: 'ds-select',\n styleUrl: 'Select.css',\n scoped: true,\n formAssociated: true,\n})\nexport class Select {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n /** Flat choices. Assign arrays through the JavaScript property. */\n @Prop() options: SelectOption[] = [];\n /** Grouped choices; takes precedence over options. Assign through JavaScript. */\n @Prop() sections: SelectSection[] = [];\n /** Selected string value. Unknown values render the placeholder and are not submitted. */\n @Prop({ mutable: true }) value: string = '';\n /** Controlled popup visibility. */\n @Prop({ mutable: true, reflect: true }) open: boolean = false;\n /** Native form field name. */\n @Prop({ reflect: true }) name: string | undefined;\n /** Native disabled state. */\n @Prop({ reflect: true }) disabled: boolean = false;\n /** Require one valid selected value. */\n @Prop({ reflect: true }) required: boolean = false;\n /** Validation message used when required is missing. */\n @Prop() requiredMessage: string = 'This field is required.';\n /** Trigger text shown when no valid value is selected. */\n @Prop() placeholder: string = 'Select';\n /** Control density. */\n @Prop() size: SelectSize = 'md';\n /** Width fit — hug content (default) or fill the parent. */\n @Prop() width: SelectWidth = 'hug';\n /** Shared inactive treatment; removes interaction and form submission. */\n @Prop() isInactive: boolean = false;\n /** Replace the prefix with a loader and disable option interaction. */\n @Prop() isLoading: boolean = false;\n /** Show the selected interaction fill when a valid value exists. */\n @Prop() activeFill: boolean = true;\n /** Show the surface-aware inset border. */\n @Prop() hasBorder: boolean = true;\n /** Optional trigger prefix icon name. */\n @Prop() icon: string | undefined;\n /** Show the clear footer action when a value exists. */\n @Prop() allowClear: boolean = true;\n /** Localized clear action label. */\n @Prop() clearLabel: string = 'Clear';\n /** Show immediate local filtering over option labels, subtext, and section headings. */\n @Prop() searchable: boolean = false;\n /** Localized search-field placeholder and accessible name. */\n @Prop() searchPlaceholder: string = 'Search';\n /** Localized empty-filter result text. */\n @Prop() noResultsText: string = 'No results found';\n /** Accessible loading status label. */\n @Prop() loadingLabel: string = 'Loading';\n /** Actual parent surface context; omit on primary and secondary surfaces. */\n @Prop() background: SelectBackground | undefined;\n /** Show invalid visual state. */\n @Prop() error: boolean = false;\n /** Error text rendered below the trigger when error is true. */\n @Prop() errorMessage: string | undefined;\n /** ID applied to the internal combobox trigger for external labels. */\n @Prop() inputId: string | undefined;\n /** Direct accessible name when no external label is available. */\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n /** IDs of elements that label the combobox. */\n @Prop({ attribute: 'aria-labelledby' }) ariaLabelledby: string | undefined;\n /** Additional IDs that describe the combobox. */\n @Prop({ attribute: 'aria-describedby' }) ariaDescribedby: string | undefined;\n\n /** Emitted after user selection or clearing with the next scalar value. */\n @Event() dsChange!: EventEmitter<string>;\n /** Emitted after the footer clear action. */\n @Event() dsClear!: EventEmitter<void>;\n /** Emitted whenever popup visibility changes. */\n @Event() dsOpenChange!: EventEmitter<boolean>;\n\n @State() private activeIndex = -1;\n @State() private searchTerm = '';\n @State() private formDisabled = false;\n @State() private position = { x: 0, y: 0 };\n @State() private positionReady = false;\n @State() private focusRingVisible = false;\n\n private readonly generatedId = `ds-select-${++selectId}`;\n private readonly listboxId = `${this.generatedId}-listbox`;\n private readonly errorId = `${this.generatedId}-error`;\n private triggerEl: HTMLButtonElement | null = null;\n private popupEl: HTMLDivElement | null = null;\n private searchEl: HTMLInputElement | null = null;\n private initialValue = '';\n private typeahead = '';\n private typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n private outsideHandler: ((event: MouseEvent) => void) | null = null;\n private repositionHandler: (() => void) | null = null;\n private positionRetryRaf: number | null = null;\n\n componentWillLoad() {\n this.initialValue = this.value;\n this.syncFormValue();\n }\n\n componentDidLoad() {\n if (this.open) this.onOpenChange(true);\n }\n\n disconnectedCallback() {\n this.cancelPositionRetry();\n this.unbindPopupListeners();\n if (this.typeaheadTimer) clearTimeout(this.typeaheadTimer);\n }\n\n @Watch('value')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('required')\n @Watch('options')\n @Watch('sections')\n syncFormValue() {\n const inactive = this.isDisabled;\n const resolvedValue = this.hasSelection ? this.value : '';\n this.internals.setFormValue(inactive ? null : resolvedValue);\n const missing = this.required && !inactive && !resolvedValue;\n this.internals.setValidity(missing ? { valueMissing: true } : {}, missing ? this.requiredMessage : '');\n if (this.open) {\n const enabled = enabledChoiceIndexes(this.visibleOptions);\n if (!enabled.includes(this.activeIndex)) this.activeIndex = enabled[0] ?? -1;\n requestAnimationFrame(() => this.updatePosition());\n }\n }\n\n @Watch('isLoading')\n onLoadingChange() {\n if (this.open) requestAnimationFrame(() => this.updatePosition());\n }\n\n @Watch('open')\n onOpenChange(open: boolean) {\n this.dsOpenChange.emit(open);\n if (open) {\n this.bindPopupListeners();\n this.schedulePositionUpdate(() => {\n this.scrollActiveOptionIntoView();\n if (this.searchable) this.searchEl?.focus();\n });\n } else {\n this.cancelPositionRetry();\n this.unbindPopupListeners();\n this.searchTerm = '';\n this.positionReady = false;\n }\n }\n\n @Watch('searchTerm')\n onSearchTermChange() {\n const enabled = enabledChoiceIndexes(this.visibleOptions);\n this.activeIndex = enabled[0] ?? -1;\n requestAnimationFrame(() => {\n this.updatePosition();\n this.scrollActiveOptionIntoView();\n });\n }\n\n @Watch('activeIndex')\n onActiveIndexChange() {\n requestAnimationFrame(() => this.scrollActiveOptionIntoView());\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n this.closePopup();\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = typeof state === 'string' ? state : '';\n }\n\n @Method()\n async setFocus() {\n this.triggerEl?.focus();\n }\n\n private get isDisabled(): boolean {\n return this.disabled || this.isInactive || this.formDisabled;\n }\n\n private get allSections(): SelectSection[] {\n return resolveChoiceSections(this.options, this.sections);\n }\n\n private get allOptions(): SelectOption[] {\n return flattenChoiceSections(this.allSections);\n }\n\n private get visibleSections(): SelectSection[] {\n return this.searchable\n ? filterChoiceSections(this.allSections, this.searchTerm)\n : this.allSections;\n }\n\n private get visibleOptions(): SelectOption[] {\n return flattenChoiceSections(this.visibleSections);\n }\n\n private get selectedOption(): SelectOption | undefined {\n return this.allOptions.find(option => option.value === this.value);\n }\n\n private get hasSelection(): boolean {\n return Boolean(this.selectedOption);\n }\n\n private get activeOptionId(): string | undefined {\n return !this.isLoading && this.activeIndex >= 0\n ? `${this.generatedId}-option-${this.activeIndex}`\n : undefined;\n }\n\n private scrollActiveOptionIntoView() {\n if (!this.open || !this.activeOptionId) return;\n this.el\n .querySelector<HTMLElement>(`#${this.activeOptionId}`)\n ?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n\n private bindPopupListeners() {\n this.unbindPopupListeners();\n this.outsideHandler = event => {\n const target = event.target as Node;\n if (this.el.contains(target)) return;\n this.closePopup();\n };\n this.repositionHandler = () => this.updatePosition();\n document.addEventListener('mousedown', this.outsideHandler, true);\n window.addEventListener('scroll', this.repositionHandler, true);\n window.addEventListener('resize', this.repositionHandler);\n }\n\n private unbindPopupListeners() {\n if (this.outsideHandler) {\n document.removeEventListener('mousedown', this.outsideHandler, true);\n this.outsideHandler = null;\n }\n if (this.repositionHandler) {\n window.removeEventListener('scroll', this.repositionHandler, true);\n window.removeEventListener('resize', this.repositionHandler);\n this.repositionHandler = null;\n }\n }\n\n private cancelPositionRetry() {\n if (this.positionRetryRaf !== null) {\n cancelAnimationFrame(this.positionRetryRaf);\n this.positionRetryRaf = null;\n }\n }\n\n /** Retry until the conditionally rendered popup is mounted and measurable. */\n private schedulePositionUpdate(onReady?: () => void) {\n if (!this.open) return;\n\n this.cancelPositionRetry();\n this.positionReady = false;\n let remaining = POSITION_RETRY_BUDGET;\n\n const attempt = () => {\n this.positionRetryRaf = null;\n if (!this.open) return;\n\n if (this.updatePosition()) {\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 the current popup was found and positioned. */\n private updatePosition(): boolean {\n if (\n !this.open ||\n !this.triggerEl ||\n !this.popupEl ||\n !this.popupEl.isConnected ||\n !this.el.contains(this.popupEl)\n ) return false;\n const sectionPadding = resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n this.popupEl.style.minWidth = `${choicePopupMinWidth(this.triggerEl.offsetWidth, sectionPadding)}px`;\n this.position = computeAnchoredPopupPosition({\n anchorRect: this.triggerEl.getBoundingClientRect(),\n popupWidth: this.popupEl.offsetWidth,\n popupHeight: this.popupEl.offsetHeight,\n side: 'bottom',\n align: 'start',\n sideOffsetPx: sectionPadding,\n alignOffsetPx: resolveChoicePopupAlignOffset({\n align: 'start',\n alignOffsetPx: 0,\n sectionInsetPx: sectionPadding,\n }),\n viewportPadPx: sectionPadding,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n });\n this.positionReady = true;\n return true;\n }\n\n private openPopup(focusVisible: boolean, edge?: 'first' | 'last') {\n if (this.isDisabled || (!this.allOptions.length && !this.isLoading)) return;\n const enabled = enabledChoiceIndexes(this.visibleOptions);\n const selectedIndex = this.visibleOptions.findIndex(\n option => option.value === this.value && !option.isInactive,\n );\n this.activeIndex =\n edge === 'last'\n ? (enabled[enabled.length - 1] ?? -1)\n : selectedIndex >= 0\n ? selectedIndex\n : (enabled[0] ?? -1);\n this.focusRingVisible = focusVisible;\n this.open = true;\n }\n\n private closePopup(restoreFocus = false) {\n if (!this.open) return;\n this.open = false;\n if (restoreFocus) requestAnimationFrame(() => this.triggerEl?.focus());\n }\n\n private selectOption(option: SelectOption) {\n if (option.isInactive || this.isLoading) return;\n this.value = option.value;\n this.dsChange.emit(this.value);\n this.closePopup(true);\n }\n\n private clearSelection = (event: Event) => {\n event.preventDefault();\n event.stopPropagation();\n this.value = '';\n this.dsChange.emit('');\n this.dsClear.emit();\n const enabled = enabledChoiceIndexes(this.visibleOptions);\n this.activeIndex = enabled[0] ?? -1;\n requestAnimationFrame(() => (this.searchable ? this.searchEl?.focus() : this.triggerEl?.focus()));\n };\n\n private moveActive(direction: 1 | -1) {\n this.activeIndex = moveChoiceIndex(this.visibleOptions, this.activeIndex, direction);\n }\n\n private setActiveEdge(edge: 'first' | 'last') {\n const enabled = enabledChoiceIndexes(this.visibleOptions);\n this.activeIndex =\n edge === 'first' ? (enabled[0] ?? -1) : (enabled[enabled.length - 1] ?? -1);\n }\n\n private handleTypeahead(key: string) {\n if (this.typeaheadTimer) clearTimeout(this.typeaheadTimer);\n this.focusRingVisible = true;\n const normalized = key.toLocaleLowerCase();\n const repeatedCharacter =\n this.typeahead.length > 0 &&\n [...this.typeahead].every(character => character === normalized);\n this.typeahead = repeatedCharacter ? normalized : `${this.typeahead}${normalized}`;\n const match = findChoiceTypeaheadMatch(this.visibleOptions, this.typeahead, this.activeIndex);\n if (match >= 0) this.activeIndex = match;\n const resetMs = resolveCssTimeMs(\n TOKEN_DEFAULTS.animationDurationMedium1,\n TOKEN_DEFAULTS.animationDurationMedium1,\n );\n this.typeaheadTimer = setTimeout(() => {\n this.typeahead = '';\n this.typeaheadTimer = null;\n }, resetMs);\n }\n\n private handleListKeyDown(event: KeyboardEvent) {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n this.focusRingVisible = true;\n this.moveActive(1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.focusRingVisible = true;\n this.moveActive(-1);\n break;\n case 'Home':\n event.preventDefault();\n this.focusRingVisible = true;\n this.setActiveEdge('first');\n break;\n case 'End':\n event.preventDefault();\n this.focusRingVisible = true;\n this.setActiveEdge('last');\n break;\n case 'Enter':\n case ' ': {\n if (event.key === ' ' && this.searchable && event.target === this.searchEl) break;\n event.preventDefault();\n const option = this.visibleOptions[this.activeIndex];\n if (option) this.selectOption(option);\n break;\n }\n case 'Escape':\n event.preventDefault();\n this.closePopup(true);\n break;\n case 'Tab':\n this.closePopup();\n break;\n default:\n if (!this.searchable && event.key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey) {\n this.handleTypeahead(event.key);\n }\n }\n }\n\n private handleTriggerKeyDown = (event: KeyboardEvent) => {\n if (!this.open) {\n if (['ArrowDown', 'ArrowUp', 'Enter', ' '].includes(event.key)) {\n event.preventDefault();\n this.openPopup(true, event.key === 'ArrowUp' ? 'last' : 'first');\n } else if (event.key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey) {\n event.preventDefault();\n this.openPopup(true);\n if (this.searchable) {\n this.searchTerm = event.key;\n } else {\n this.handleTypeahead(event.key);\n }\n }\n return;\n }\n this.handleListKeyDown(event);\n };\n\n private renderOption(\n option: SelectOption,\n index: number,\n usesIcons: boolean,\n usesSubtext: boolean,\n ) {\n const selected = option.value === this.value;\n const active = index === this.activeIndex;\n return (\n <ChoiceOptionRow\n id={`${this.generatedId}-option-${index}`}\n option={option}\n selected={selected}\n active={active}\n focusRingVisible={this.focusRingVisible}\n usesSubtext={usesSubtext}\n leading={usesIcons && option.icon ? (\n <span class=\"ds-choice-item__icon ds-interaction-fill__content\" aria-hidden=\"true\">\n <ds-icon name={option.icon} size=\"md\" color=\"inherit\" />\n </span>\n ) : undefined}\n onHover={() => {\n this.focusRingVisible = false;\n this.activeIndex = index;\n }}\n onSelect={() => this.selectOption(option)}\n />\n );\n }\n\n render() {\n const inactive = this.isDisabled;\n const showPlaceholder = !this.hasSelection;\n const label = showPlaceholder ? this.placeholder : this.selectedOption?.label;\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const iconSize = ICON_SIZE[this.size];\n const usesOptionIcons = choiceListUsesIcons(this.allOptions);\n const usesOptionSubtext = choiceListUsesSubtext(this.allOptions);\n const showError = this.error && Boolean(this.errorMessage);\n const describedBy = [this.ariaDescribedby, showError ? this.errorId : undefined]\n .filter(Boolean)\n .join(' ') || undefined;\n const popupStyle = {\n position: 'fixed',\n left: '0',\n top: '0',\n transform: `translate(${Math.round(this.position.x)}px, ${Math.round(this.position.y)}px)`,\n zIndex: 'var(--dimension-z-index-floating)',\n visibility: this.positionReady ? 'visible' : 'hidden',\n };\n let flatIndex = 0;\n\n return (\n <Host\n class={{\n 'select-host': true,\n 'ds-control-inactive': inactive,\n 'ds-control--md': this.size === 'md',\n 'ds-control--sm': this.size === 'sm',\n 'ds-control--xs': this.size === 'xs',\n ...controlWidthClass(this.width),\n [`select-host--background-${this.background}`]: !!this.background,\n }}\n >\n <button\n ref={element => {\n this.triggerEl = (element as HTMLButtonElement) ?? null;\n }}\n id={this.inputId ?? this.generatedId}\n type=\"button\"\n class={{\n trigger: true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected':\n !inactive && this.activeFill && this.hasSelection,\n 'trigger--bordered': this.hasBorder || this.error,\n 'trigger--placeholder': showPlaceholder,\n 'trigger--has-value': this.hasSelection,\n 'wrapper--error': this.error,\n [`ds-control--${this.size}`]: true,\n ...choiceBackgroundClassMap(this.background),\n }}\n disabled={inactive}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={String(this.open)}\n aria-controls={this.open ? this.listboxId : undefined}\n aria-activedescendant={this.open && !this.searchable ? this.activeOptionId : undefined}\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledby}\n aria-describedby={describedBy}\n aria-invalid={this.error ? 'true' : undefined}\n aria-required={this.required || undefined}\n aria-busy={this.isLoading ? 'true' : undefined}\n onClick={() => (this.open ? this.closePopup() : this.openPopup(false))}\n onKeyDown={this.handleTriggerKeyDown}\n >\n {(this.icon || this.isLoading) && (\n <span class=\"trigger__prefix ds-interaction-fill__content\" aria-hidden=\"true\">\n {this.isLoading ? (\n <ds-loader size={iconSize} color=\"inherit\" />\n ) : (\n <ds-icon name={this.icon} size={iconSize} color=\"inherit\" />\n )}\n </span>\n )}\n <ds-text\n class=\"trigger__label ds-interaction-fill__content\"\n as=\"span\"\n variant={textVariant}\n color=\"inherit\"\n lineTruncation={1}\n >\n {label}\n </ds-text>\n <span class=\"trigger__chevron ds-interaction-fill__content\" aria-hidden=\"true\">\n <ds-icon name=\"ChevronDown\" size={iconSize} color=\"inherit\" />\n </span>\n </button>\n\n {this.open && (\n <div\n ref={element => {\n this.popupEl = (element as HTMLDivElement) ?? null;\n }}\n class=\"select-popup ds-choice-popup\"\n style={popupStyle}\n >\n {this.searchable && (\n <ChoiceSearch\n value={this.searchTerm}\n placeholder={this.searchPlaceholder}\n controls={this.listboxId}\n activeDescendant={this.activeOptionId}\n inputRef={element => {\n this.searchEl = element;\n }}\n clearLabel={this.clearLabel}\n onValueChange={value => {\n this.searchTerm = value;\n }}\n onKeyDown={event => this.handleListKeyDown(event)}\n />\n )}\n <div\n id={this.listboxId}\n class=\"ds-choice-list\"\n role=\"listbox\"\n aria-label={this.ariaLabel ?? this.placeholder}\n aria-busy={this.isLoading ? 'true' : undefined}\n >\n {this.isLoading ? (\n <div\n class=\"ds-choice-loading\"\n role=\"option\"\n aria-selected=\"false\"\n aria-disabled=\"true\"\n aria-label={this.loadingLabel}\n aria-live=\"polite\"\n >\n <ds-loader size=\"md\" color=\"inherit\" />\n </div>\n ) : this.visibleOptions.length === 0 ? (\n <div\n class=\"ds-choice-empty\"\n role=\"option\"\n aria-selected=\"false\"\n aria-disabled=\"true\"\n aria-label={this.noResultsText}\n aria-live=\"polite\"\n >\n <ds-empty-state body={this.noResultsText} />\n </div>\n ) : (\n this.visibleSections.map(section => (\n <div\n class={{\n 'ds-choice-section': true,\n 'ds-choice-section--divided': !!section.divider,\n }}\n role={section.header ? 'group' : undefined}\n aria-label={section.header}\n >\n {section.header && (\n <ds-text\n class=\"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 {section.options.map(option => this.renderOption(\n option,\n flatIndex++,\n usesOptionIcons,\n usesOptionSubtext,\n ))}\n </div>\n ))\n )}\n </div>\n {this.allowClear && this.hasSelection && !this.isLoading && (\n <ChoiceFooter clearLabel={this.clearLabel} onClear={this.clearSelection} />\n )}\n </div>\n )}\n\n {showError && (\n <ds-text\n class=\"error-text\"\n as=\"div\"\n variant=\"text-body-small\"\n color=\"negative\"\n textId={this.errorId}\n role=\"alert\"\n >\n {this.errorMessage}\n </ds-text>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"6qBAAA,MAAMA,EAAY,IAAM,kutBC8CxB,MAAMC,EAAoD,CACxDC,GAAI,KACJC,GAAI,KACJC,GAAI,MAGN,IAAIC,EAAW,EAEf,MAAMC,EAAwB,E,MAQjBC,EAAMC,EAAA,MAAAD,UAAAE,EANnB,WAAAC,CAAAC,G,2LAWUC,KAAAC,QAA0B,GAE1BD,KAAAE,SAA4B,GAEXF,KAAAG,MAAgB,GAEDH,KAAAI,KAAgB,MAI/BJ,KAAAK,SAAoB,MAEpBL,KAAAM,SAAoB,MAErCN,KAAAO,gBAA0B,0BAE1BP,KAAAQ,YAAsB,SAEtBR,KAAAS,KAAmB,KAEnBT,KAAAU,MAAqB,MAErBV,KAAAW,WAAsB,MAEtBX,KAAAY,UAAqB,MAErBZ,KAAAa,WAAsB,KAEtBb,KAAAc,UAAqB,KAIrBd,KAAAe,WAAsB,KAEtBf,KAAAgB,WAAqB,QAErBh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K,SAAQ,gBACC,QAAO,gBACP,OAAM,aACR5N,KAAKoB,aAAY,YACnB,UAEV4J,EAAA,aAAWvK,KAAK,KAAK8K,MAAM,aAE3BvL,KAAKoD,eAAeO,SAAW,EACjCqH,EAAA,OACEK,MAAM,kBACNuC,KAAK,SAAQ,gBACC,QAAO,gBACP,OAAM,aACR5N,KAAKmB,cAAa,YACpB,UAEV6J,EAAA,kBAAgByD,KAAMzO,KAAKmB,iBAG7BnB,KAAKoG,gBAAgBsI,KAAIC,GACvB3D,EAAA,OACEK,MAAO,CACL,oBAAqB,KACrB,+BAAgCsD,EAAQC,SAE1ChB,KAAMe,EAAQE,OAAS,QAAUlI,UAAS,aAC9BgI,EAAQE,QAEnBF,EAAQE,QACP7D,EAAA,WACEK,MAAM,2CACN4C,GAAG,OACHC,QAAQ,kBACRY,SAAQ,KACRvD,MAAM,UAAS,cACH,QAEXoD,EAAQE,QAGZF,EAAQ1O,QAAQyO,KAAIlI,GAAUxG,KAAK0K,aAClClE,EACA0G,IACAlB,EACAE,SAMTlM,KAAKe,YAAcf,KAAK4E,eAAiB5E,KAAKY,WAC7CoK,EAAC+D,EAAY,CAAAtL,IAAA,2CAACzC,WAAYhB,KAAKgB,WAAYgO,QAAShP,KAAK2C,kBAK9DyJ,GACCpB,EAAA,WAAAvH,IAAA,2CACE4H,MAAM,aACN4C,GAAG,MACHC,QAAQ,kBACR3C,MAAM,WACN0D,OAAQjP,KAAKiC,QACb2L,KAAK,SAEJ5N,KAAKqM,c","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,h as t,a as n,t as i}from"./index.js";import{D as l,b as a,n as o,a as r}from"./p-D1HFMTdC.js";import{e as h,c as d,r as c,a as p,b as f}from"./p-D2x17ei-.js";const u="--ds-shell-gradient-image";const b="--ds-shell-gradient-size";const g="--ds-shell-gradient-position-panel";const v="--ds-shell-gradient-position-bar";const m="--ds-shell-gradient-opacity";function y(e=l){return a(e)}function _(e){const s=typeof globalThis.window!=="undefined"?globalThis.window:undefined;if(!s)return{width:0,height:0};const t=s.visualViewport;return{width:Math.round(t?.width??s.innerWidth),height:Math.round(t?.height??s.innerHeight)}}function w(e){return`${Math.round(e.width)}px ${Math.round(e.height)}px`}function x(){return"0 0"}function k(e){return`${-Math.round(e)}px 0`}const P={k:"search",a:"agents",s:"stacks",m:"messages",n:"activity","/":"help"};function z(e){return!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey}function C(e){if(!e||typeof e!=="object")return false;if(!("closest"in e)||typeof e.closest!=="function")return false;const s=e;const t=s.closest('input, textarea, select, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]');if(t)return true;const n=s.getAttribute("role");if(n==="textbox"||n==="combobox"||n==="searchbox")return true;return Boolean(s.isContentEditable)}function S(e){if(e.key==="["||e.code==="BracketLeft")return"[";if(e.key==="]"||e.code==="BracketRight")return"]";return e.key.length===1?e.key.toLowerCase():e.key.toLowerCase()}function D(e){if(!z(e))return null;const s=S(e);if(s==="[")return"toggle-panel-nav";if(s==="]")return"close-panel-tools";const t=P[s];if(t)return`open-tool:${t}`;return null}function M(e,s){if(typeof document==="undefined")return 0;const t=document.createElement("div");t.style.cssText="position:absolute;visibility:hidden;pointer-events:none;height:0;width:var("+s+");";e.appendChild(t);const n=t.getBoundingClientRect().width;e.removeChild(t);return n}function L(e){return{expandedPx:M(e,"--_nav-width"),collapsedPx:M(e,"--_nav-width-collapsed")}}function T(e,s){if(s?.classList.contains("panel-nav--collapsed"))return true;const t=e?.collapsed;return t===true}function V(e,s){return s?e.collapsedPx:e.expandedPx}const j=()=>`.sc-ds-shell-app-h{display:block;height:100%;min-height:0;box-sizing:border-box;overflow:hidden;overscroll-behavior:none;--ds-shell-panel-tools-width:var(--dimension-panel-width-xs)}.shell-app.sc-ds-shell-app{display:flex;flex-direction:column;height:100%;min-height:0;box-sizing:border-box;overflow:hidden;overscroll-behavior:none;font-family:var(--typography-font-family, system-ui)}.sc-ds-shell-app-h{--_shell-chrome-bg:var(--color-background-secondary)}.shell-app__row.sc-ds-shell-app{display:flex;flex:1 1 auto;min-height:0;height:100%;position:relative}.shell-app__chrome.sc-ds-shell-app{position:absolute;inset:0;pointer-events:none;z-index:0;background-color:var(--_shell-chrome-bg)}.shell-app--gradient.sc-ds-shell-app-h .shell-app__chrome.sc-ds-shell-app::before{content:'';position:absolute;inset:0;pointer-events:none;background-position:0 0;background-attachment:fixed;z-index:1;opacity:var(--ds-shell-gradient-opacity, 1);background-image:var(--ds-shell-gradient-image, none);background-size:var(--ds-shell-gradient-size, auto);background-repeat:no-repeat}.shell-app__panel.sc-ds-shell-app{flex:0 0 auto;min-height:0;height:100%;position:relative;z-index:2}.shell-app__panel.sc-ds-shell-app-s>ds-panel-nav,.shell-app__panel .sc-ds-shell-app-s>ds-panel-nav{display:block;height:100%}.shell-app__main.sc-ds-shell-app{flex:1 1 auto;min-width:0;min-height:0;display:grid;grid-template-columns:minmax(0, 1fr) auto;grid-template-rows:auto minmax(0, 1fr);grid-template-areas:'bar tools' 'content tools';position:relative;z-index:1}.shell-app__bar.sc-ds-shell-app{grid-area:bar;flex:0 0 auto;min-width:0}.shell-app__bar.sc-ds-shell-app-s>ds-bar-nav,.shell-app__bar .sc-ds-shell-app-s>ds-bar-nav{display:block}.shell-app__content.sc-ds-shell-app{grid-area:content;flex:1 1 auto;min-width:0;min-height:0;overflow:auto;overscroll-behavior:none;contain:layout}.shell-app__content.sc-ds-shell-app{position:relative;z-index:1;background-color:var(--color-background-primary)}.shell-app__tools.sc-ds-shell-app{grid-area:tools;flex:0 0 auto;min-width:0;min-height:0;height:100%;display:flex;position:relative;z-index:0;overflow:hidden}.shell-app__tools.sc-ds-shell-app-s>ds-panel-tools,.shell-app__tools .sc-ds-shell-app-s>ds-panel-tools{display:block;height:100%;min-height:0}.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__panel.sc-ds-shell-app,.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__bar.sc-ds-shell-app,.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app{visibility:hidden}`;const $=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.navStyle="dashboard";this.gradientPreset=l;this.shortcutsEnabled=true;this.toolsFullscreen=false;this.resizeObserver=null;this.panelNavTransition=new h;this.chromeSyncCoalescer=d((()=>this.syncChrome()));this.panelWidthTokens={expandedPx:0,collapsedPx:0};this.cachedViewportWidth=0;this.cachedViewportHeight=0;this.onWindowResize=()=>{if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()};this.onVisualViewportChange=()=>{if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()};this.onChromeTransitionStart=e=>{if(c(e)!=="panel-nav")return;this.panelNavTransition.enter();const s=_();this.cachedViewportWidth=s.width;this.cachedViewportHeight=s.height;this.syncChrome()};this.onChromeTransitionEnd=e=>{if(c(e)!=="panel-nav")return;this.panelNavTransition.exit();if(!this.panelNavTransition.isActive){this.scheduleChromeSync()}}}componentDidLoad(){this.syncSlottedNavStyle();this.connectMetricsObserver();this.connectViewportListeners();this.el.addEventListener(p,this.onChromeTransitionStart);this.el.addEventListener(f,this.onChromeTransitionEnd);requestAnimationFrame((()=>{this.cachePanelWidthTokens();this.scheduleChromeSync()}));const e=this.el.querySelector("ds-panel-tools");this.toolsFullscreen=e?.getAttribute("presentation")==="fullscreen"}handleToolsPresentation(e){this.toolsFullscreen=e.detail?.presentation==="fullscreen"}disconnectedCallback(){this.resizeObserver?.disconnect();this.resizeObserver=null;this.disconnectViewportListeners();this.chromeSyncCoalescer.cancel();this.el.removeEventListener(p,this.onChromeTransitionStart);this.el.removeEventListener(f,this.onChromeTransitionEnd)}onShellPropsChange(){this.syncSlottedNavStyle();this.scheduleChromeSync()}scheduleChromeSync(){this.chromeSyncCoalescer.schedule()}syncSlottedNavStyle(){const e=this.el.querySelector("ds-panel-nav");const s=this.el.querySelector("ds-bar-nav");if(e){e.setAttribute("nav-style",this.navStyle);e.navStyle=this.navStyle}if(s){s.setAttribute("nav-style",this.navStyle);s.navStyle=this.navStyle}}connectMetricsObserver(){this.resizeObserver=new ResizeObserver((()=>{if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()}));this.resizeObserver.observe(this.el);const e=this.el.querySelector(".shell-app__panel");if(e)this.resizeObserver.observe(e)}connectViewportListeners(){if(typeof window==="undefined")return;window.addEventListener("resize",this.onWindowResize,{passive:true});const e=window.visualViewport;if(e){e.addEventListener("resize",this.onVisualViewportChange,{passive:true});e.addEventListener("scroll",this.onVisualViewportChange,{passive:true})}}disconnectViewportListeners(){if(typeof window==="undefined")return;window.removeEventListener("resize",this.onWindowResize);const e=window.visualViewport;if(e){e.removeEventListener("resize",this.onVisualViewportChange);e.removeEventListener("scroll",this.onVisualViewportChange)}}cachePanelWidthTokens(){const e=this.el.querySelector("ds-panel-nav .panel-nav");if(!e)return;this.panelWidthTokens=L(e)}applyGradientVars(e,s){const t=e.style;for(const[e,n]of Object.entries(s)){if(n===null)t.removeProperty(e);else t.setProperty(e,n)}}clearGradientPaintVars(e){const s=[u,b,m];for(const t of e){for(const e of s)t.style.removeProperty(e)}}syncChromeLayoutVars(e,s,t,n){if(e){e.style.setProperty(g,t)}if(s){s.style.setProperty(v,n)}}resolvePanelWidthPx(e){const s=e?.querySelector(".panel-nav");if(this.panelNavTransition.isActive&&this.panelWidthTokens.expandedPx>0){const t=T(e,s);return V(this.panelWidthTokens,t)}const t=this.el.querySelector(".shell-app__panel");const n=t?.getBoundingClientRect().width??0;if(n>0)return n;if(this.panelWidthTokens.expandedPx>0){const t=T(e,s);return V(this.panelWidthTokens,t)}return 0}resolveViewportDimensions(){if(this.panelNavTransition.isActive&&this.cachedViewportWidth>0){return{width:this.cachedViewportWidth,height:this.cachedViewportHeight}}return _()}chromeLayerActive(){return o(this.gradientPreset)!=="none"}handleWindowKeyDown(e){if(!this.shortcutsEnabled)return;if(C(e.target))return;const s=D(e);if(!s)return;e.preventDefault();const t=this.el.querySelector("ds-panel-nav");const n=this.el.querySelector("ds-panel-tools");if(s==="toggle-panel-nav"){void t?.toggleCollapsed();return}if(s==="close-panel-tools"){void n?.closeDrawer();return}if(s.startsWith("open-tool:")&&n){const e=s.slice("open-tool:".length);void n.activateTool(e)}}syncChrome(){const e=this.el.querySelector("ds-panel-nav");const s=this.el.querySelector("ds-bar-nav");const t=[this.el,e,s].filter((e=>e!==null));const n=()=>{if(e)e.style.removeProperty(g);if(s)s.style.removeProperty(v)};const i=o(this.gradientPreset);if(i==="none"){this.clearGradientPaintVars(t);n();return}const l=this.resolveViewportDimensions();const a=this.resolvePanelWidthPx(e);const h=x();const d=k(a);this.syncChromeLayoutVars(e,s,h,d);const c=y(i);const p=w({width:l.width,height:l.height});const f=r(i);for(const e of t){if(e===this.el){this.applyGradientVars(e,{[u]:c,[b]:p,[g]:h,[v]:d,[m]:f});continue}const s=e.tagName.toLowerCase()==="ds-bar-nav";this.applyGradientVars(e,{[u]:c,[b]:p,[m]:f,[g]:s?null:h,[v]:s?d:null})}}render(){const e=this.chromeLayerActive();const s={"shell-app":true,"shell-app--gradient":e,[`shell-app--${this.navStyle}`]:true,"shell-app--tools-fullscreen":this.toolsFullscreen};return t(n,{key:"464a7a56f8a8954648d4b74f0526f907fddd9cde",class:s},t("div",{key:"15d6ff08c360824d13e30b7312ed6ff2d30e3fa3",class:"shell-app__row"},t("div",{key:"2b7f886e0da877be4176f7250d8199e7cceeac37",class:"shell-app__chrome","aria-hidden":"true"}),t("div",{key:"0a91c214ea3121c5d275e119dae6bc5f91d765f8",class:"shell-app__panel","aria-hidden":this.toolsFullscreen?"true":undefined,inert:this.toolsFullscreen?true:undefined},t("slot",{key:"2ee1c6f142524cf4212f89ddd51bbb80f80141d0",name:"panel"})),t("div",{key:"b0f88c99a744935dc6724600261a93db6b78c14a",class:"shell-app__main"},t("div",{key:"ebbac56011b48d9fbb518c724d2ab0b0cd46aa76",class:"shell-app__bar","aria-hidden":this.toolsFullscreen?"true":undefined,inert:this.toolsFullscreen?true:undefined},t("slot",{key:"de3e37ac3c96578bdc2f8ce3673a1784428141f9",name:"bar"})),t("div",{key:"164960fc6c06ec6d8ae5b522f6ed2facdbc1a57f",class:"shell-app__tools"},t("slot",{key:"d9677660871cb20e28b11ade3899c2e54f7f2ea2",name:"tools"})),t("div",{key:"eb8f1638bdb8794dbeec98e4a7fc9f082c0d9745",class:"shell-app__content","aria-hidden":this.toolsFullscreen?"true":undefined,inert:this.toolsFullscreen?true:undefined},t("slot",{key:"99ed6d84796cf3528f4e95771cfa4595abf02ba5"})))))}get el(){return this}static get watchers(){return{navStyle:[{onShellPropsChange:0}],gradientPreset:[{onShellPropsChange:0}]}}static get style(){return j()}},[262,"ds-shell-app",{navStyle:[513,"nav-style"],gradientPreset:[513,"gradient-preset"],shortcutsEnabled:[4,"shortcuts-enabled"],toolsFullscreen:[32]},[[0,"dsPresentationChange","handleToolsPresentation"],[10,"keydown","handleWindowKeyDown"]],{navStyle:[{onShellPropsChange:0}],gradientPreset:[{onShellPropsChange:0}]}]);function E(){if(typeof customElements==="undefined"){return}const e=["ds-shell-app"];e.forEach((e=>{switch(e){case"ds-shell-app":if(!customElements.get(i(e))){customElements.define(i(e),$)}break}}))}E();const W=$;const B=E;export{W as DsShellApp,B as defineCustomElement};
|
|
1
|
+
import{p as e,H as s,c as l,h as t,a as i,t as a}from"./index.js";import{D as n,b as o,n as h,a as p}from"./p-D1HFMTdC.js";import{e as d,c as r,r as c,a as b,b as f}from"./p-D2x17ei-.js";import{a as u}from"./p-BrusnEYP.js";const m="--ds-shell-gradient-image";const g="--ds-shell-gradient-size";const v="--ds-shell-gradient-position-panel";const _="--ds-shell-gradient-position-bar";const y="--ds-shell-gradient-opacity";function w(e=n){return o(e)}function k(e){const s=typeof globalThis.window!=="undefined"?globalThis.window:undefined;if(!s)return{width:0,height:0};const l=s.visualViewport;return{width:Math.round(l?.width??s.innerWidth),height:Math.round(l?.height??s.innerHeight)}}function x(e){return`${Math.round(e.width)}px ${Math.round(e.height)}px`}function z(){return"0 0"}function P(e){return`${-Math.round(e)}px 0`}const S={k:"search",a:"agents",s:"stacks",m:"messages",n:"activity","/":"help"};function C(e){return!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey}function M(e){if(!e||typeof e!=="object")return false;if(!("closest"in e)||typeof e.closest!=="function")return false;const s=e;const l=s.closest('input, textarea, select, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]');if(l)return true;const t=s.getAttribute("role");if(t==="textbox"||t==="combobox"||t==="searchbox")return true;return Boolean(s.isContentEditable)}function D(e){if(e.key==="["||e.code==="BracketLeft")return"[";if(e.key==="]"||e.code==="BracketRight")return"]";return e.key.length===1?e.key.toLowerCase():e.key.toLowerCase()}function L(e){if(!C(e))return null;const s=D(e);if(s==="[")return"toggle-panel-nav";if(s==="]")return"close-panel-tools";const l=S[s];if(l)return`open-tool:${l}`;return null}function j(e,s){if(typeof document==="undefined")return 0;const l=document.createElement("div");l.style.cssText="position:absolute;visibility:hidden;pointer-events:none;height:0;width:var("+s+");";e.appendChild(l);const t=l.getBoundingClientRect().width;e.removeChild(l);return t}function O(e){return{expandedPx:j(e,"--_nav-width"),collapsedPx:j(e,"--_nav-width-collapsed")}}function T(e,s){if(s?.classList.contains("panel-nav--collapsed"))return true;const l=e?.collapsed;return l===true}function V(e,s){return s?e.collapsedPx:e.expandedPx}const $=()=>`.sc-ds-shell-app-h{display:block;height:100%;min-height:0;box-sizing:border-box;overflow:hidden;overscroll-behavior:none;--ds-shell-panel-tools-width:var(--dimension-panel-width-xs)}.shell-app.sc-ds-shell-app{display:flex;flex-direction:column;height:100%;min-height:0;box-sizing:border-box;overflow:hidden;overscroll-behavior:none;font-family:var(--typography-font-family, system-ui)}.sc-ds-shell-app-h{--_shell-chrome-bg:var(--color-background-secondary)}.shell-app__row.sc-ds-shell-app{display:flex;flex:1 1 auto;min-height:0;height:100%;position:relative}.shell-app__chrome.sc-ds-shell-app{position:absolute;inset:0;pointer-events:none;z-index:0;background-color:var(--_shell-chrome-bg)}.shell-app--gradient.sc-ds-shell-app-h .shell-app__chrome.sc-ds-shell-app::before{content:'';position:absolute;inset:0;pointer-events:none;background-position:0 0;background-attachment:fixed;z-index:1;opacity:var(--ds-shell-gradient-opacity, 1);background-image:var(--ds-shell-gradient-image, none);background-size:var(--ds-shell-gradient-size, auto);background-repeat:no-repeat}.shell-app__panel.sc-ds-shell-app{flex:0 0 auto;min-height:0;height:100%;position:relative;z-index:2}.shell-app__panel.sc-ds-shell-app-s>ds-panel-nav,.shell-app__panel .sc-ds-shell-app-s>ds-panel-nav{display:block;height:100%}.shell-app__main.sc-ds-shell-app{flex:1 1 auto;min-width:0;min-height:0;display:grid;grid-template-columns:minmax(0, 1fr) auto;grid-template-rows:auto minmax(0, 1fr);grid-template-areas:'bar tools' 'content tools';position:relative;z-index:1}.shell-app__mobile-section.sc-ds-shell-app,.shell-app__mobile-navigation.sc-ds-shell-app,.shell-app__mobile-bar.sc-ds-shell-app{display:none}.shell-app__bar.sc-ds-shell-app{grid-area:bar;flex:0 0 auto;min-width:0}.shell-app__bar.sc-ds-shell-app-s>ds-bar-nav,.shell-app__bar .sc-ds-shell-app-s>ds-bar-nav{display:block}.shell-app__content.sc-ds-shell-app{grid-area:content;flex:1 1 auto;min-width:0;min-height:0;overflow:auto;overscroll-behavior:none;contain:layout}.shell-app__content.sc-ds-shell-app{position:relative;z-index:1;background-color:var(--color-background-primary)}.shell-app__tools.sc-ds-shell-app{grid-area:tools;flex:0 0 auto;min-width:0;min-height:0;height:100%;display:flex;position:relative;z-index:0;overflow:hidden}.shell-app__tools.sc-ds-shell-app-s>ds-panel-tools,.shell-app__tools .sc-ds-shell-app-s>ds-panel-tools{display:block;height:100%;min-height:0}.shell-app__tools.sc-ds-shell-app-s>ds-shell-tools,.shell-app__tools .sc-ds-shell-app-s>ds-shell-tools{display:block;height:100%;min-height:0}.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__panel.sc-ds-shell-app,.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__bar.sc-ds-shell-app,.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app{visibility:hidden}.shell-app--mobile.sc-ds-shell-app-h{--_shell-chrome-bg:var(--color-background-primary)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__chrome.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__panel.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__bar.sc-ds-shell-app{display:none}.shell-app--mobile.sc-ds-shell-app-h .shell-app__main.sc-ds-shell-app{width:100%;grid-template-columns:minmax(0, 1fr);grid-template-rows:auto minmax(0, 1fr) auto;grid-template-areas:'mobile-section' 'stage' 'mobile-bar';background:var(--color-background-primary)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-section.sc-ds-shell-app{grid-area:mobile-section;display:block;min-width:0;position:relative;z-index:1}.shell-app--mobile.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__tools.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-navigation.sc-ds-shell-app{grid-area:stage;min-width:0;min-height:0;height:100%;position:relative}.shell-app--mobile.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app{z-index:1;overflow:auto}.shell-app--mobile.sc-ds-shell-app-h .shell-app__tools.sc-ds-shell-app{z-index:2;width:100%;overflow:hidden;background:var(--color-background-primary)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-navigation.sc-ds-shell-app{display:block;z-index:3;overflow:hidden;background:var(--color-background-primary)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-bar.sc-ds-shell-app{grid-area:mobile-bar;display:block;min-width:0;position:relative;z-index:4}.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-section[hidden].sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__tools[hidden].sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-navigation[hidden].sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-bar[hidden].sc-ds-shell-app{display:none}.shell-app--mobile-tool-active.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app,.shell-app--mobile-navigation-open.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app,.shell-app--mobile-navigation-open.sc-ds-shell-app-h .shell-app__tools.sc-ds-shell-app{visibility:hidden}`;const E=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.dsResponsiveModeChange=l(this,"dsResponsiveModeChange");this.navStyle="dashboard";this.gradientPreset=n;this.shortcutsEnabled=true;this.mobileDestination="area";this.mobileNavigationOpen=false;this.toolsFullscreen=false;this.resolvedMode="desktop";this.resizeObserver=null;this.hasLoaded=false;this.panelNavTransition=new d;this.chromeSyncCoalescer=r((()=>this.syncChrome()));this.panelWidthTokens={expandedPx:0,collapsedPx:0};this.cachedViewportWidth=0;this.cachedViewportHeight=0;this.onWindowResize=()=>{this.updateResponsiveMode();if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()};this.onVisualViewportChange=()=>{if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()};this.onChromeTransitionStart=e=>{if(c(e)!=="panel-nav")return;this.panelNavTransition.enter();const s=k();this.cachedViewportWidth=s.width;this.cachedViewportHeight=s.height;this.syncChrome()};this.onChromeTransitionEnd=e=>{if(c(e)!=="panel-nav")return;this.panelNavTransition.exit();if(!this.panelNavTransition.isActive){this.scheduleChromeSync()}}}componentWillLoad(){if(typeof window!=="undefined"){this.resolvedMode=u(window.innerWidth)}}componentDidLoad(){this.hasLoaded=true;this.syncSlottedNavStyle();this.syncSlottedMobileState();this.connectMetricsObserver();this.connectViewportListeners();this.el.addEventListener(b,this.onChromeTransitionStart);this.el.addEventListener(f,this.onChromeTransitionEnd);requestAnimationFrame((()=>{this.cachePanelWidthTokens();this.scheduleChromeSync()}));const e=this.el.querySelector("ds-shell-tools, ds-panel-tools");this.toolsFullscreen=e?.getAttribute("presentation")==="fullscreen"}handleToolsPresentation(e){this.toolsFullscreen=e.detail?.presentation==="fullscreen"}disconnectedCallback(){this.resizeObserver?.disconnect();this.resizeObserver=null;this.disconnectViewportListeners();this.chromeSyncCoalescer.cancel();this.el.removeEventListener(b,this.onChromeTransitionStart);this.el.removeEventListener(f,this.onChromeTransitionEnd)}onShellPropsChange(){this.syncSlottedNavStyle();this.scheduleChromeSync()}onMobileStateChange(e,l){this.syncSlottedMobileState();if(l===true&&!this.mobileNavigationOpen&&this.resolvedMode==="mobile"){requestAnimationFrame((()=>{const e=this.el.querySelector("ds-shell-mobile-bar");const l=document.activeElement;if(l instanceof s&&e?.contains(l))return;void e?.focusDestination?.("navigation")}))}}updateResponsiveMode(){if(typeof window==="undefined")return;const e=u(window.innerWidth);if(e===this.resolvedMode)return;this.resolvedMode=e;this.syncSlottedMobileState();this.scheduleChromeSync();if(this.hasLoaded)this.dsResponsiveModeChange.emit({mode:e})}scheduleChromeSync(){this.chromeSyncCoalescer.schedule()}syncSlottedNavStyle(){const e=this.el.querySelector("ds-panel-nav");const s=this.el.querySelector("ds-bar-nav");if(e){e.setAttribute("nav-style",this.navStyle);e.navStyle=this.navStyle}if(s){s.setAttribute("nav-style",this.navStyle);s.navStyle=this.navStyle}}syncSlottedMobileState(){const e=this.el.querySelector("ds-shell-tools");const s=this.el.querySelector("ds-shell-mobile-bar");const l=this.el.querySelector("ds-shell-mobile-nav");if(e){e.setAttribute("responsive-mode",this.resolvedMode);e.responsiveMode=this.resolvedMode}if(s){s.activeDestination=this.mobileDestination;s.navigationExpanded=this.mobileNavigationOpen}if(l){l.open=this.mobileNavigationOpen}}connectMetricsObserver(){this.resizeObserver=new ResizeObserver((()=>{if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()}));this.resizeObserver.observe(this.el);const e=this.el.querySelector(".shell-app__panel");if(e)this.resizeObserver.observe(e)}connectViewportListeners(){if(typeof window==="undefined")return;window.addEventListener("resize",this.onWindowResize,{passive:true});const e=window.visualViewport;if(e){e.addEventListener("resize",this.onVisualViewportChange,{passive:true});e.addEventListener("scroll",this.onVisualViewportChange,{passive:true})}}disconnectViewportListeners(){if(typeof window==="undefined")return;window.removeEventListener("resize",this.onWindowResize);const e=window.visualViewport;if(e){e.removeEventListener("resize",this.onVisualViewportChange);e.removeEventListener("scroll",this.onVisualViewportChange)}}cachePanelWidthTokens(){const e=this.el.querySelector("ds-panel-nav .panel-nav");if(!e)return;this.panelWidthTokens=O(e)}applyGradientVars(e,s){const l=e.style;for(const[e,t]of Object.entries(s)){if(t===null)l.removeProperty(e);else l.setProperty(e,t)}}clearGradientPaintVars(e){const s=[m,g,y];for(const l of e){for(const e of s)l.style.removeProperty(e)}}syncChromeLayoutVars(e,s,l,t){if(e){e.style.setProperty(v,l)}if(s){s.style.setProperty(_,t)}}resolvePanelWidthPx(e){const s=e?.querySelector(".panel-nav");if(this.panelNavTransition.isActive&&this.panelWidthTokens.expandedPx>0){const l=T(e,s);return V(this.panelWidthTokens,l)}const l=this.el.querySelector(".shell-app__panel");const t=l?.getBoundingClientRect().width??0;if(t>0)return t;if(this.panelWidthTokens.expandedPx>0){const l=T(e,s);return V(this.panelWidthTokens,l)}return 0}resolveViewportDimensions(){if(this.panelNavTransition.isActive&&this.cachedViewportWidth>0){return{width:this.cachedViewportWidth,height:this.cachedViewportHeight}}return k()}chromeLayerActive(){return this.resolvedMode!=="mobile"&&h(this.gradientPreset)!=="none"}handleWindowKeyDown(e){if(!this.shortcutsEnabled)return;if(M(e.target))return;const s=L(e);if(!s)return;e.preventDefault();const l=this.el.querySelector("ds-panel-nav");const t=this.el.querySelector("ds-shell-tools, ds-panel-tools");if(s==="toggle-panel-nav"){void l?.toggleCollapsed();return}if(s==="close-panel-tools"){void t?.closeDrawer?.();return}if(s.startsWith("open-tool:")&&t){const e=s.slice("open-tool:".length);void t.activateTool?.(e)}}syncChrome(){const e=this.el.querySelector("ds-panel-nav");const s=this.el.querySelector("ds-bar-nav");const l=[this.el,e,s].filter((e=>e!==null));const t=()=>{if(e)e.style.removeProperty(v);if(s)s.style.removeProperty(_)};const i=h(this.gradientPreset);if(i==="none"||this.resolvedMode==="mobile"){this.clearGradientPaintVars(l);t();return}const a=this.resolveViewportDimensions();const n=this.resolvePanelWidthPx(e);const o=z();const d=P(n);this.syncChromeLayoutVars(e,s,o,d);const r=w(i);const c=x({width:a.width,height:a.height});const b=p(i);for(const e of l){if(e===this.el){this.applyGradientVars(e,{[m]:r,[g]:c,[v]:o,[_]:d,[y]:b});continue}const s=e.tagName.toLowerCase()==="ds-bar-nav";this.applyGradientVars(e,{[m]:r,[g]:c,[y]:b,[v]:s?null:o,[_]:s?d:null})}}render(){const e=this.chromeLayerActive();const s=this.resolvedMode==="mobile";const l=s&&this.mobileDestination!=="area";const a=s&&(l||this.mobileNavigationOpen);const n=!s&&this.toolsFullscreen;const o={"shell-app":true,"shell-app--gradient":e,[`shell-app--${this.navStyle}`]:true,[`shell-app--${this.resolvedMode}`]:true,"shell-app--tools-fullscreen":n,"shell-app--mobile-tool-active":l,"shell-app--mobile-navigation-open":s&&this.mobileNavigationOpen};return t(i,{key:"ed0e226d623d5ef12a1e3058321d6442bf8e0dcd",class:o,"responsive-mode":this.resolvedMode},t("div",{key:"096d1ebb43b24e77d098465886a87085a8f280b7",class:"shell-app__row"},t("div",{key:"6c85395d797629a21508b21a68f1788c58edc844",class:"shell-app__chrome","aria-hidden":"true"}),t("div",{key:"cf8cb1d08df0e2ba67e99cecee2d5fe6083d32f8",class:"shell-app__panel","aria-hidden":n?"true":undefined,inert:n?true:undefined},t("slot",{key:"23b0e95bf46516d369a1935471fd706be8bf7887",name:"panel"})),t("div",{key:"fb8eb7fb00dad42e98f5ba9fc6f4f523c02a2046",class:"shell-app__main"},t("div",{key:"22cee2a5f13b52e1a1dcb5802c4adea7e05b6bbe",class:"shell-app__bar","aria-hidden":n?"true":undefined,inert:n?true:undefined},t("slot",{key:"47d86aa6ef8fb4bef79ce20e6b1ca6c1b86a33ed",name:"bar"})),t("div",{key:"6cd41f967ec0228974b2c3cc9e64c7043670aaa5",class:"shell-app__mobile-section",hidden:!s||this.mobileDestination!=="area"||this.mobileNavigationOpen},t("slot",{key:"3ae3b75e718beae01131012ea1b22a229028cac1",name:"mobile-section-nav"})),t("div",{key:"6f8e6af9b21fb3add2ebd0d1fc863983936c1f9c",class:"shell-app__tools","aria-hidden":s&&(!l||this.mobileNavigationOpen)?"true":undefined,inert:s&&(!l||this.mobileNavigationOpen)?true:undefined,hidden:s&&!l},t("slot",{key:"dce442127b4141e017c6a7961584baad5f1d0a11",name:"tools"})),t("div",{key:"ec05cdcc138eaef59b9f6634bc5d4bbe29fba71e",class:"shell-app__content","aria-hidden":n||a?"true":undefined,inert:n||a?true:undefined},t("slot",{key:"34af8ef0dcdea455e8a083f4f9970e6fda0d698a"})),t("div",{key:"7c1e0a90f005773ca17fb4aa4be71760400db8fb",class:"shell-app__mobile-navigation",hidden:!s||!this.mobileNavigationOpen,"aria-hidden":s&&this.mobileNavigationOpen?undefined:"true",inert:s&&this.mobileNavigationOpen?undefined:true},t("slot",{key:"67a00b3649c98c5903c63aa5def2d422b5dd05ec",name:"mobile-navigation"})),t("div",{key:"f98cd5273c7debacb4dae8f2c645bb4df6a0be07",class:"shell-app__mobile-bar",hidden:!s},t("slot",{key:"152597a2d7d9fbaedebdc205bdd2268ceb18fa30",name:"mobile-bar"})))))}get el(){return this}static get watchers(){return{navStyle:[{onShellPropsChange:0}],gradientPreset:[{onShellPropsChange:0}],mobileDestination:[{onMobileStateChange:0}],mobileNavigationOpen:[{onMobileStateChange:0}]}}static get style(){return $()}},[262,"ds-shell-app",{navStyle:[513,"nav-style"],gradientPreset:[513,"gradient-preset"],shortcutsEnabled:[4,"shortcuts-enabled"],mobileDestination:[1,"mobile-destination"],mobileNavigationOpen:[4,"mobile-navigation-open"],toolsFullscreen:[32],resolvedMode:[32]},[[0,"dsPresentationChange","handleToolsPresentation"],[10,"keydown","handleWindowKeyDown"]],{navStyle:[{onShellPropsChange:0}],gradientPreset:[{onShellPropsChange:0}],mobileDestination:[{onMobileStateChange:0}],mobileNavigationOpen:[{onMobileStateChange:0}]}]);function W(){if(typeof customElements==="undefined"){return}const e=["ds-shell-app"];e.forEach((e=>{switch(e){case"ds-shell-app":if(!customElements.get(a(e))){customElements.define(a(e),E)}break}}))}W();const B=E;const F=W;export{B as DsShellApp,F as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-shell-app.js.map
|