@ds-mo/ui 14.11.1 → 14.13.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/NOTICE +10 -0
- package/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +104 -9
- package/dist/angular/ds-pagination.d.ts +1 -1
- package/dist/angular/ds-pagination.js +3 -3
- package/dist/angular/ds-paper-texture.d.ts +12 -0
- package/dist/angular/ds-paper-texture.js +38 -0
- package/dist/angular/ds-shell-app.d.ts +1 -1
- package/dist/angular/ds-shell-app.js +3 -3
- package/dist/angular/ds-table.d.ts +1 -1
- package/dist/angular/ds-table.js +3 -3
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +1 -0
- package/dist/angular/proxies.d.ts +1 -0
- package/dist/angular/proxies.js +1 -0
- package/dist/components/ds-agent-questionnaire.js +1 -1
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-banner.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-bar-workflow.js.map +1 -1
- package/dist/components/ds-button-filled.js +1 -1
- package/dist/components/ds-button-unfilled.js +1 -1
- package/dist/components/ds-card-chart.js +1 -1
- package/dist/components/ds-card-setting.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-filter-menu.js +1 -1
- package/dist/components/ds-filter-menu.js.map +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-markdown.js +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-message-actions.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-mobile-bar-nav.js +1 -1
- package/dist/components/ds-mobile-header.js +1 -1
- package/dist/components/ds-mobile-section-switcher.js +1 -1
- package/dist/components/ds-mobile-sheet-nav.js +1 -1
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-pagination.js +1 -1
- package/dist/components/ds-panel-nav.js +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-paper-texture.d.ts +11 -0
- package/dist/components/ds-paper-texture.js +2 -0
- package/dist/components/ds-paper-texture.js.map +1 -0
- package/dist/components/ds-select.js +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-page.js +1 -1
- package/dist/components/ds-shell-tools.js +1 -1
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-table-saved-views.js +1 -1
- package/dist/components/ds-table-saved-views.js.map +1 -1
- package/dist/components/ds-table-toolbar.js +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-table.js.map +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/p-BEvBJ65v.js +2 -0
- package/dist/components/p-BEvBJ65v.js.map +1 -0
- package/dist/components/{p-DvJkkdIO.js → p-BxqBiVbH.js} +2 -2
- package/dist/components/p-BzLnSwG9.js +2 -0
- package/dist/components/p-BzLnSwG9.js.map +1 -0
- package/dist/components/{p-CbfmzgdW.js → p-BzObtSlo.js} +2 -2
- package/dist/components/{p-Bv1CFHgD.js → p-C2n8A8NA.js} +2 -2
- package/dist/components/p-C5eosu67.js +2 -0
- package/dist/components/p-C5eosu67.js.map +1 -0
- package/dist/components/{p-c_5SXjwx.js → p-C7rzVotG.js} +2 -2
- package/dist/components/{p-bQm3gfr1.js → p-CKJzHclc.js} +2 -2
- package/dist/components/p-CWDmHPJC.js +2 -0
- package/dist/components/p-CWDmHPJC.js.map +1 -0
- package/dist/components/{p-BPnmiiIS.js → p-CjgnFGd6.js} +2 -2
- package/dist/components/{p-BuGGwWmt.js → p-Ck_VRQYi.js} +2 -2
- package/dist/components/p-CnWC0QvG.js +2 -0
- package/dist/components/p-CnWC0QvG.js.map +1 -0
- package/dist/components/p-CooNucm0.js +2 -0
- package/dist/components/p-CooNucm0.js.map +1 -0
- package/dist/components/{p-CoQSB3tl.js → p-Ct-m0I6U.js} +2 -2
- package/dist/components/{p-CqbMoVDQ.js → p-Cyw9odJX.js} +2 -2
- package/dist/components/{p-D5VglrfF.js → p-D1Nqlrrl.js} +2 -2
- package/dist/components/p-DIEx1e0M.js +2 -0
- package/dist/components/p-DIEx1e0M.js.map +1 -0
- package/dist/components/{p-DjqZWBnM.js → p-DL_5VENG.js} +2 -2
- package/dist/components/p-DfyfrfHL.js +2 -0
- package/dist/components/p-DfyfrfHL.js.map +1 -0
- package/dist/components/{p-CvwtYbmh.js → p-Dsn1RCS5.js} +2 -2
- package/dist/components/{p-D5bPuNiF.js → p-M9DPfXbP.js} +2 -2
- package/dist/components/{p-DgWGfscR.js → p-Rfpd5mWO.js} +2 -2
- package/dist/components/p-URdgCwEs.js +2 -0
- package/dist/components/{p-BCg_6ErW.js.map → p-URdgCwEs.js.map} +1 -1
- package/dist/components/{p-1tOy4H51.js → p-V2ywPfsR.js} +2 -2
- package/dist/components/{p-BVmKcpyP.js → p-iBuPFJL9.js} +2 -2
- package/dist/components/p-vWK5faWZ.js +2 -0
- package/dist/components/p-vWK5faWZ.js.map +1 -0
- package/dist/docs/components.json +163 -5
- package/dist/lib/shell/index.js.map +2 -2
- package/dist/lib/shell/shell-responsive.d.ts +1 -1
- package/dist/mcp-data/registry/bar-nav.json +1 -1
- package/dist/mcp-data/registry/filter-menu.json +1 -1
- package/dist/mcp-data/registry/menu.json +1 -1
- package/dist/mcp-data/registry/pagination.json +21 -3
- package/dist/mcp-data/registry/panel-nav.json +1 -1
- package/dist/mcp-data/registry/panel-tools.json +1 -1
- package/dist/mcp-data/registry/paper-texture.json +141 -0
- package/dist/mcp-data/registry/registry.json +106 -8
- package/dist/mcp-data/registry/select.json +2 -2
- package/dist/mcp-data/registry/shell-app.json +26 -5
- package/dist/mcp-data/registry/shell-tools.json +2 -2
- package/dist/mcp-data/registry/table-saved-views.json +6 -6
- package/dist/mcp-data/registry/table.json +31 -13
- package/dist/react/components.d.ts +1 -0
- package/dist/react/components.js +1 -0
- package/dist/react/ds-paper-texture.d.ts +9 -0
- package/dist/react/ds-paper-texture.js +12 -0
- package/dist/styles/table.css +5 -0
- package/dist/types/components/Pagination/Pagination.d.ts +2 -0
- package/dist/types/components/Pagination/pagination-types.d.ts +2 -0
- package/dist/types/components/PanelTools/PanelTools.d.ts +1 -0
- package/dist/types/components/PaperTexture/PaperTexture.d.ts +18 -0
- package/dist/types/components/PaperTexture/paper-texture-types.d.ts +39 -0
- package/dist/types/components/ShellApp/ShellApp.d.ts +7 -2
- package/dist/types/components/Table/Table.d.ts +19 -1
- package/dist/types/components/Table/table-layout-controller.d.ts +7 -1
- package/dist/types/components/Table/table-model.d.ts +3 -2
- package/dist/types/components/Table/table-viewport-fit-controller.d.ts +5 -1
- package/dist/types/components/Table/table-virtual-controller.d.ts +14 -1
- package/dist/types/components/Table/table-virtual-model.d.ts +26 -1
- package/dist/types/components/TableSavedViews/TableSavedViews.d.ts +1 -1
- package/dist/types/components.d.ts +59 -4
- package/dist/types/shell/shell-responsive.d.ts +1 -1
- package/package.json +4 -2
- package/dist/components/p-BCg_6ErW.js +0 -2
- package/dist/components/p-BFSnIEsC.js +0 -2
- package/dist/components/p-BFSnIEsC.js.map +0 -1
- package/dist/components/p-BiTwXttN.js +0 -2
- package/dist/components/p-BiTwXttN.js.map +0 -1
- package/dist/components/p-BmWWU20X.js +0 -2
- package/dist/components/p-BmWWU20X.js.map +0 -1
- package/dist/components/p-C-L4InQ0.js +0 -2
- package/dist/components/p-C-L4InQ0.js.map +0 -1
- package/dist/components/p-C-Zgq_Fx.js +0 -2
- package/dist/components/p-C-Zgq_Fx.js.map +0 -1
- package/dist/components/p-C1jsgfeh.js +0 -2
- package/dist/components/p-C1jsgfeh.js.map +0 -1
- package/dist/components/p-D8nnhQNJ.js +0 -2
- package/dist/components/p-D8nnhQNJ.js.map +0 -1
- package/dist/components/p-DNpE0RBz.js +0 -2
- package/dist/components/p-DNpE0RBz.js.map +0 -1
- /package/dist/components/{p-DvJkkdIO.js.map → p-BxqBiVbH.js.map} +0 -0
- /package/dist/components/{p-CbfmzgdW.js.map → p-BzObtSlo.js.map} +0 -0
- /package/dist/components/{p-Bv1CFHgD.js.map → p-C2n8A8NA.js.map} +0 -0
- /package/dist/components/{p-c_5SXjwx.js.map → p-C7rzVotG.js.map} +0 -0
- /package/dist/components/{p-bQm3gfr1.js.map → p-CKJzHclc.js.map} +0 -0
- /package/dist/components/{p-BPnmiiIS.js.map → p-CjgnFGd6.js.map} +0 -0
- /package/dist/components/{p-BuGGwWmt.js.map → p-Ck_VRQYi.js.map} +0 -0
- /package/dist/components/{p-CoQSB3tl.js.map → p-Ct-m0I6U.js.map} +0 -0
- /package/dist/components/{p-CqbMoVDQ.js.map → p-Cyw9odJX.js.map} +0 -0
- /package/dist/components/{p-D5VglrfF.js.map → p-D1Nqlrrl.js.map} +0 -0
- /package/dist/components/{p-DjqZWBnM.js.map → p-DL_5VENG.js.map} +0 -0
- /package/dist/components/{p-CvwtYbmh.js.map → p-Dsn1RCS5.js.map} +0 -0
- /package/dist/components/{p-D5bPuNiF.js.map → p-M9DPfXbP.js.map} +0 -0
- /package/dist/components/{p-DgWGfscR.js.map → p-Rfpd5mWO.js.map} +0 -0
- /package/dist/components/{p-1tOy4H51.js.map → p-V2ywPfsR.js.map} +0 -0
- /package/dist/components/{p-BVmKcpyP.js.map → p-iBuPFJL9.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BADGE_GRADIENT_POSITION_VAR","closestComposed","from","selector","current","match","closest","getRootNode","composedRoot","shadowHost","host","isShellGradientActive","shell","getAttribute","badgeCss","SURFACE_RING","primary","secondary","faint","medium","bold","strong","translucent","inverted","media","navigation","Badge","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","variant","count","max","surface","hasRing","gradientBackground","gradientLayoutVersion","gradientObserver","gradientWindowListener","componentDidLoad","enableShellGradientRingIfNeeded","disconnectedCallback","unbindGradientRingSync","gradientBackgroundChanged","el","bindGradientRingSync","update","window","addEventListener","ResizeObserver","observe","bar","panel","removeEventListener","disconnect","ringHostStyle","ring","style","render","isDot","h","Host","display","String","background","class","badge","as","emphasis","color","label"],"sources":["src/wc/shell/badge-gradient-ring.ts","src/wc/components/Badge/Badge.css?tag=ds-badge&encapsulation=scoped","src/wc/components/Badge/Badge.tsx"],"sourcesContent":["import {\n SHELL_GRADIENT_POSITION_BAR_VAR,\n SHELL_GRADIENT_POSITION_PANEL_VAR,\n} from './shell-gradient';\n\n/** Per-badge background-position for shell gradient ring sampling. */\nexport const BADGE_GRADIENT_POSITION_VAR = '--_badge-gradient-position';\n\nexport interface GradientSurface {\n element: HTMLElement;\n chromeHost: HTMLElement;\n positionVar: string;\n}\n\nfunction closestComposed(from: HTMLElement, selector: string): HTMLElement | null {\n let current: HTMLElement | null = from;\n while (current) {\n const match = current.closest<HTMLElement>(selector);\n if (match) return match;\n if (typeof current.getRootNode !== 'function') return null;\n const composedRoot = current.getRootNode() as Node & { readonly host?: Element };\n const shadowHost: Element | undefined = composedRoot.host;\n current = shadowHost && typeof (shadowHost as HTMLElement).closest === 'function'\n ? shadowHost as HTMLElement\n : null;\n }\n return null;\n}\n\n/** Whether the badge sits under a shell with an active wash preset. */\nexport function isShellGradientActive(from: HTMLElement): boolean {\n // Explicit <HTMLElement>: the inferred HTMLDsShellAppElement type only\n // resolves where @stencil/core types are installed — consumers importing\n // `@ds-mo/ui/shell` (raw TS) compile this without them.\n const shell = closestComposed(from, 'ds-shell-app');\n return shell !== null && shell.getAttribute('gradient-preset') !== 'none';\n}\n\n/** Bar or panel chrome surface that owns the shell gradient stack. */\nexport function findGradientSurface(from: HTMLElement): GradientSurface | null {\n const barHost = closestComposed(from, 'ds-bar-nav');\n if (barHost) {\n const root = barHost.shadowRoot ?? barHost;\n const element = root.querySelector('.bar-nav');\n if (element) {\n return {\n element: element as HTMLElement,\n chromeHost: barHost,\n positionVar: SHELL_GRADIENT_POSITION_BAR_VAR,\n };\n }\n }\n\n const panelHost = closestComposed(from, 'ds-panel-nav');\n if (panelHost) {\n const root = panelHost.shadowRoot ?? panelHost;\n const element = root.querySelector('.panel-nav');\n if (element) {\n return {\n element: element as HTMLElement,\n chromeHost: panelHost,\n positionVar: SHELL_GRADIENT_POSITION_PANEL_VAR,\n };\n }\n }\n\n return null;\n}\n\ninterface ParsedPosition {\n x: number;\n y: number;\n}\n\n/** Parse a two-value CSS background-position (e.g. `-200px 0`). */\nexport function parseCssBackgroundPosition(value: string): ParsedPosition {\n const trimmed = value.trim();\n if (!trimmed) return { x: 0, y: 0 };\n\n const parts = trimmed.split(/\\s+/);\n const x = parseLength(parts[0] ?? '0');\n const y = parseLength(parts[1] ?? '0');\n return { x, y };\n}\n\nfunction parseLength(token: string): number {\n const px = token.match(/^(-?[\\d.]+)px$/);\n if (px) return Number(px[1]);\n return 0;\n}\n\n/**\n * Background position for a badge ring so the shell gradient aligns with nav chrome.\n * Uses badge center relative to the painted chrome surface.\n */\nexport function badgeGradientPosition(\n badgeHost: HTMLElement,\n surface: GradientSurface,\n shellPosition: string,\n): string {\n const badgeRect = badgeHost.getBoundingClientRect();\n const surfaceRect = surface.element.getBoundingClientRect();\n const anchorX = badgeRect.left + badgeRect.width / 2 - surfaceRect.left;\n const anchorY = badgeRect.top + badgeRect.height / 2 - surfaceRect.top;\n const { x, y } = parseCssBackgroundPosition(shellPosition);\n\n return `${Math.round(x - anchorX)}px ${Math.round(y - anchorY)}px`;\n}\n\n/** Resolve shell gradient position from chrome host custom properties. */\nexport function readShellGradientPosition(surface: GradientSurface): string {\n const styles = getComputedStyle(surface.chromeHost);\n return styles.getPropertyValue(surface.positionVar).trim() || '0 0';\n}\n\n/** Stamp `--_badge-gradient-position` on the badge host (fixed viewport chrome). */\nexport function syncBadgeGradientPosition(badgeHost: HTMLElement): void {\n if (!isShellGradientActive(badgeHost)) {\n badgeHost.style.removeProperty(BADGE_GRADIENT_POSITION_VAR);\n return;\n }\n\n badgeHost.style.setProperty(BADGE_GRADIENT_POSITION_VAR, '0 0');\n}\n","@import '../../utils/visually-hidden.css';\n@import '../../utils/forced-colors.css';\n\n:host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n pointer-events: none;\n vertical-align: middle;\n\n --_badge-bg: var(--color-background-bold-brand);\n --_badge-fg: var(--color-foreground-on-bold-background-primary);\n --_badge-ring: var(--color-background-secondary);\n --_badge-ring-width: var(--dimension-stroke-width-018);\n}\n\n.badge__mark {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n box-sizing: border-box;\n color: var(--_badge-fg);\n background: var(--_badge-bg);\n box-shadow: 0 0 0 var(--_badge-ring-width) var(--_badge-ring);\n white-space: nowrap;\n}\n\n:host(.badge--no-ring) {\n --_badge-ring-width: 0;\n}\n\n\n:host(.badge--dot) .badge__mark {\n width: var(--dimension-size-075);\n height: var(--dimension-size-075);\n border-radius: var(--dimension-radius-half);\n}\n\n:host(.badge--counter) .badge__mark {\n width: auto;\n min-width: var(--dimension-size-150);\n height: var(--dimension-size-150);\n padding: 0 var(--dimension-space-025);\n border-radius: var(--dimension-radius-half);\n}\n\n/* Shell gradient ring — base fill + wash donut (option 3). */\n:host(.badge--on-gradient-background) .badge__mark {\n position: relative;\n z-index: 0;\n box-shadow: none;\n isolation: isolate;\n}\n\n:host(.badge--on-gradient-background) .badge__mark::before,\n:host(.badge--on-gradient-background) .badge__mark::after {\n content: '';\n position: absolute;\n inset: calc(-1 * var(--_badge-ring-width));\n border-radius: inherit;\n box-sizing: border-box;\n padding: var(--_badge-ring-width);\n pointer-events: none;\n /* stylelint-disable color-no-hex -- mask luminance stops for ring cutout, not theme colors */\n -webkit-mask:\n linear-gradient(#fff 0 0) content-box,\n linear-gradient(#fff 0 0);\n -webkit-mask-composite: xor;\n mask:\n linear-gradient(#fff 0 0) content-box,\n linear-gradient(#fff 0 0);\n /* stylelint-enable color-no-hex */\n mask-composite: exclude;\n}\n\n:host(.badge--on-gradient-background) .badge__mark::before {\n z-index: -2;\n background-color: var(--_badge-ring);\n}\n\n:host(.badge--on-gradient-background) .badge__mark::after {\n z-index: -1;\n background-image: var(--ds-shell-gradient-image, none);\n background-size: var(--ds-shell-gradient-size, auto);\n background-position: 0 0;\n background-repeat: no-repeat;\n background-attachment: fixed;\n opacity: var(--ds-shell-gradient-opacity, 1);\n}\n\n@media (forced-colors: active) {\n .badge__mark {\n color: var(--ds-forced-color-on-selected);\n background: var(--ds-forced-color-selected);\n box-shadow: none;\n outline: var(--_badge-ring-width) solid var(--ds-forced-color-surface);\n }\n\n :host(.badge--on-gradient-background) .badge__mark::before,\n :host(.badge--on-gradient-background) .badge__mark::after {\n display: none;\n }\n}\n","import { Component, Prop, Element, State, Watch, h, Host } from '@stencil/core';\nimport {\n BADGE_GRADIENT_POSITION_VAR,\n isShellGradientActive,\n} from '../../shell/badge-gradient-ring';\n\nexport type BadgeVariant = 'counter' | 'dot';\nexport type BadgeSurface =\n | 'primary'\n | 'secondary'\n | 'faint'\n | 'medium'\n | 'bold'\n | 'strong'\n | 'translucent'\n | 'inverted'\n | 'media'\n | 'navigation'\n | 'always-dark';\n\nconst SURFACE_RING: Record<BadgeSurface, string> = {\n primary: 'var(--color-background-primary)',\n secondary: 'var(--color-background-secondary)',\n faint: 'var(--color-background-faint-neutral)',\n medium: 'var(--color-background-medium-neutral)',\n bold: 'var(--color-background-bold-neutral)',\n strong: 'var(--color-background-strong-neutral)',\n translucent: 'var(--color-translucent-translucent)',\n inverted: 'var(--color-inverted-background)',\n media: 'var(--color-media-background)',\n navigation: 'var(--color-navigation-background)',\n 'always-dark': 'var(--color-always-dark-background)',\n};\n\n@Component({\n tag: 'ds-badge',\n styleUrl: 'Badge.css',\n scoped: true,\n})\nexport class Badge {\n @Element() el!: HTMLElement;\n\n /** Render as a compact counter or notification dot. */\n @Prop() variant: BadgeVariant = 'counter';\n\n /** Count shown for counter badges. Count 0 hides the badge. */\n @Prop() count: number = 0;\n\n /** Highest count shown before compacting to \"{max}+\". */\n @Prop() max: number = 9;\n\n /** Immediate backing surface matched by the ring around either variant. */\n @Prop() surface: BadgeSurface = 'primary';\n\n /** Direct ring background override for component-local surfaces. */\n @Prop() background: string | undefined;\n\n /** Show the separation ring when the badge overlaps an icon or other content. */\n @Prop() hasRing: boolean = true;\n\n /**\n * Ring samples the shell gradient stack (base fill + wash) instead of a flat\n * `box-shadow`. Auto-enabled under an ShellApp with an active gradient preset;\n * set `gradient-background` to opt in/out explicitly.\n *\n * The attribute must NOT start with `on` — Stencil's setAccessor routes any\n * unknown `on*` member down the event-listener path during attribute\n * reflection, calling addEventListener with a non-listener and throwing.\n */\n @Prop({ attribute: 'gradient-background', reflect: true }) gradientBackground: boolean = false;\n\n /** Contextual supplemental text. Omit when the owner hides the badge from assistive technology. */\n @Prop() label: string | undefined;\n\n /** Bumps on resize/layout so render recomputes gradient ring position. */\n @State() private gradientLayoutVersion = 0;\n\n private gradientObserver: ResizeObserver | null = null;\n private gradientWindowListener: (() => void) | null = null;\n\n componentDidLoad() {\n this.enableShellGradientRingIfNeeded();\n }\n\n disconnectedCallback() {\n this.unbindGradientRingSync();\n }\n\n @Watch('gradientBackground')\n @Watch('hasRing')\n gradientBackgroundChanged() {\n if (!this.hasRing) {\n this.unbindGradientRingSync();\n return;\n }\n if (!this.gradientBackground && isShellGradientActive(this.el)) {\n this.gradientBackground = true;\n return;\n }\n this.bindGradientRingSync();\n }\n\n /** Imperative opt-in avoids Stencil aborting parent render for nested badges. */\n private enableShellGradientRingIfNeeded() {\n if (!this.hasRing) return;\n\n if (!this.gradientBackground && isShellGradientActive(this.el)) {\n this.gradientBackground = true;\n }\n\n if (this.gradientBackground) {\n this.bindGradientRingSync();\n }\n }\n\n private bindGradientRingSync() {\n this.unbindGradientRingSync();\n\n if (!this.gradientBackground) return;\n\n const update = () => {\n this.gradientLayoutVersion += 1;\n };\n update();\n\n this.gradientWindowListener = update;\n window.addEventListener('resize', update);\n\n if (typeof ResizeObserver !== 'undefined') {\n this.gradientObserver = new ResizeObserver(update);\n this.gradientObserver.observe(this.el);\n\n const shell = this.el.closest('ds-shell-app');\n if (shell) this.gradientObserver.observe(shell);\n\n const bar = this.el.closest('ds-bar-nav');\n if (bar) this.gradientObserver.observe(bar);\n\n const panel = this.el.closest('ds-panel-nav');\n if (panel) this.gradientObserver.observe(panel);\n }\n }\n\n private unbindGradientRingSync() {\n if (this.gradientWindowListener) {\n window.removeEventListener('resize', this.gradientWindowListener);\n this.gradientWindowListener = null;\n }\n\n this.gradientObserver?.disconnect();\n this.gradientObserver = null;\n }\n\n private ringHostStyle(ring: string): Record<string, string> {\n void this.gradientLayoutVersion;\n\n const style: Record<string, string> = { '--_badge-ring': ring };\n if (!this.gradientBackground || !isShellGradientActive(this.el)) return style;\n\n /* Shell chrome wash uses background-attachment: fixed at viewport origin. */\n style[BADGE_GRADIENT_POSITION_VAR] = '0 0';\n return style;\n }\n\n render() {\n const isDot = this.variant === 'dot';\n\n if (!isDot && this.count <= 0) return <Host style={{ display: 'none' }} />;\n\n const display = this.count > this.max ? `${this.max}+` : String(this.count);\n const ring = this.background ?? SURFACE_RING[this.surface];\n\n return (\n <Host\n class={{\n badge: true,\n 'badge--counter': !isDot,\n 'badge--dot': isDot,\n 'badge--no-ring': !this.hasRing,\n 'badge--on-gradient-background': this.hasRing && this.gradientBackground,\n }}\n style={this.ringHostStyle(ring)}\n >\n <span class=\"badge__mark\" aria-hidden=\"true\">\n {!isDot && (\n <ds-text as=\"span\" variant=\"text-caption\" emphasis color=\"inherit\">\n {display}\n </ds-text>\n )}\n </span>\n {this.label && <span class=\"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F,KAAKG,IAAM,GAAGH,KAAKG,OAAS+B,OAAOlC,KAAKE,OACrE,MAAMyB,EAAO3B,KAAKmC,YAAcnD,EAAagB,KAAKI,SAElD,OACE2B,EAACC,EAAI,CACHI,MAAO,CACLC,MAAO,KACP,kBAAmBP,EACnB,aAAcA,EACd,kBAAmB9B,KAAKK,QACxB,gCAAiCL,KAAKK,SAAWL,KAAKM,oBAExDsB,MAAO5B,KAAK0B,cAAcC,IAE1BI,EAAA,QAAMK,MAAM,cAAa,cAAa,SAClCN,GACAC,EAAA,WAASO,GAAG,OAAOrC,QAAQ,eAAesC,SAAQ,KAACC,MAAM,WACtDP,IAINjC,KAAKyC,OAASV,EAAA,QAAMK,MAAM,kCAAkCpC,KAAKyC,O","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-08-
|
|
2
|
+
"timestamp": "2026-08-23T03:20:04",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.43.5",
|
|
@@ -15955,6 +15955,35 @@
|
|
|
15955
15955
|
"getter": false,
|
|
15956
15956
|
"setter": false
|
|
15957
15957
|
},
|
|
15958
|
+
{
|
|
15959
|
+
"name": "fitToPageInactive",
|
|
15960
|
+
"type": "boolean",
|
|
15961
|
+
"complexType": {
|
|
15962
|
+
"original": "boolean",
|
|
15963
|
+
"resolved": "boolean",
|
|
15964
|
+
"references": {}
|
|
15965
|
+
},
|
|
15966
|
+
"mutable": false,
|
|
15967
|
+
"attr": "fit-to-page-inactive",
|
|
15968
|
+
"reflectToAttr": false,
|
|
15969
|
+
"docs": "Keep the Fit to page choice visible but unavailable.",
|
|
15970
|
+
"docsTags": [
|
|
15971
|
+
{
|
|
15972
|
+
"name": "default",
|
|
15973
|
+
"text": "false"
|
|
15974
|
+
}
|
|
15975
|
+
],
|
|
15976
|
+
"default": "false",
|
|
15977
|
+
"values": [
|
|
15978
|
+
{
|
|
15979
|
+
"type": "boolean"
|
|
15980
|
+
}
|
|
15981
|
+
],
|
|
15982
|
+
"optional": false,
|
|
15983
|
+
"required": false,
|
|
15984
|
+
"getter": false,
|
|
15985
|
+
"setter": false
|
|
15986
|
+
},
|
|
15958
15987
|
{
|
|
15959
15988
|
"name": "itemLabel",
|
|
15960
15989
|
"type": "string",
|
|
@@ -18240,7 +18269,7 @@
|
|
|
18240
18269
|
},
|
|
18241
18270
|
{
|
|
18242
18271
|
"filePath": "src/wc/components/PanelTools/PanelTools.tsx",
|
|
18243
|
-
"encapsulation": "
|
|
18272
|
+
"encapsulation": "shadow",
|
|
18244
18273
|
"tag": "ds-panel-tools",
|
|
18245
18274
|
"docs": "",
|
|
18246
18275
|
"docsTags": [],
|
|
@@ -18811,6 +18840,67 @@
|
|
|
18811
18840
|
]
|
|
18812
18841
|
}
|
|
18813
18842
|
},
|
|
18843
|
+
{
|
|
18844
|
+
"filePath": "src/wc/components/PaperTexture/PaperTexture.tsx",
|
|
18845
|
+
"encapsulation": "scoped",
|
|
18846
|
+
"tag": "ds-paper-texture",
|
|
18847
|
+
"docs": "",
|
|
18848
|
+
"docsTags": [],
|
|
18849
|
+
"usage": {},
|
|
18850
|
+
"props": [
|
|
18851
|
+
{
|
|
18852
|
+
"name": "config",
|
|
18853
|
+
"type": "PaperTextureConfig",
|
|
18854
|
+
"complexType": {
|
|
18855
|
+
"original": "PaperTextureConfig",
|
|
18856
|
+
"resolved": "PaperTextureConfig",
|
|
18857
|
+
"references": {
|
|
18858
|
+
"PaperTextureConfig": {
|
|
18859
|
+
"location": "import",
|
|
18860
|
+
"path": "./paper-texture-types",
|
|
18861
|
+
"id": "src/wc/components/PaperTexture/paper-texture-types.ts::PaperTextureConfig",
|
|
18862
|
+
"referenceLocation": "PaperTextureConfig"
|
|
18863
|
+
}
|
|
18864
|
+
}
|
|
18865
|
+
},
|
|
18866
|
+
"mutable": false,
|
|
18867
|
+
"reflectToAttr": false,
|
|
18868
|
+
"docs": "Paper Design shader parameters. Set as a JavaScript property.",
|
|
18869
|
+
"docsTags": [
|
|
18870
|
+
{
|
|
18871
|
+
"name": "default",
|
|
18872
|
+
"text": "{}"
|
|
18873
|
+
}
|
|
18874
|
+
],
|
|
18875
|
+
"default": "{}",
|
|
18876
|
+
"values": [
|
|
18877
|
+
{
|
|
18878
|
+
"type": "PaperTextureConfig"
|
|
18879
|
+
}
|
|
18880
|
+
],
|
|
18881
|
+
"optional": false,
|
|
18882
|
+
"required": false,
|
|
18883
|
+
"getter": false,
|
|
18884
|
+
"setter": false
|
|
18885
|
+
}
|
|
18886
|
+
],
|
|
18887
|
+
"methods": [],
|
|
18888
|
+
"events": [],
|
|
18889
|
+
"listeners": [],
|
|
18890
|
+
"styles": [],
|
|
18891
|
+
"slots": [],
|
|
18892
|
+
"parts": [],
|
|
18893
|
+
"states": [],
|
|
18894
|
+
"dependents": [
|
|
18895
|
+
"ds-shell-app"
|
|
18896
|
+
],
|
|
18897
|
+
"dependencies": [],
|
|
18898
|
+
"dependencyGraph": {
|
|
18899
|
+
"ds-shell-app": [
|
|
18900
|
+
"ds-paper-texture"
|
|
18901
|
+
]
|
|
18902
|
+
}
|
|
18903
|
+
},
|
|
18814
18904
|
{
|
|
18815
18905
|
"filePath": "src/wc/components/Radio/Radio.tsx",
|
|
18816
18906
|
"encapsulation": "scoped",
|
|
@@ -21039,6 +21129,38 @@
|
|
|
21039
21129
|
"getter": false,
|
|
21040
21130
|
"setter": false
|
|
21041
21131
|
},
|
|
21132
|
+
{
|
|
21133
|
+
"name": "paperTexture",
|
|
21134
|
+
"type": "PaperTextureConfig | undefined",
|
|
21135
|
+
"complexType": {
|
|
21136
|
+
"original": "PaperTextureConfig",
|
|
21137
|
+
"resolved": "PaperTextureConfig | undefined",
|
|
21138
|
+
"references": {
|
|
21139
|
+
"PaperTextureConfig": {
|
|
21140
|
+
"location": "import",
|
|
21141
|
+
"path": "../PaperTexture/paper-texture-types",
|
|
21142
|
+
"id": "src/wc/components/PaperTexture/paper-texture-types.ts::PaperTextureConfig",
|
|
21143
|
+
"referenceLocation": "PaperTextureConfig"
|
|
21144
|
+
}
|
|
21145
|
+
}
|
|
21146
|
+
},
|
|
21147
|
+
"mutable": false,
|
|
21148
|
+
"reflectToAttr": false,
|
|
21149
|
+
"docs": "Optional decorative Paper Design texture layered above the shell wash.",
|
|
21150
|
+
"docsTags": [],
|
|
21151
|
+
"values": [
|
|
21152
|
+
{
|
|
21153
|
+
"type": "PaperTextureConfig"
|
|
21154
|
+
},
|
|
21155
|
+
{
|
|
21156
|
+
"type": "undefined"
|
|
21157
|
+
}
|
|
21158
|
+
],
|
|
21159
|
+
"optional": true,
|
|
21160
|
+
"required": false,
|
|
21161
|
+
"getter": false,
|
|
21162
|
+
"setter": false
|
|
21163
|
+
},
|
|
21042
21164
|
{
|
|
21043
21165
|
"name": "shortcutsEnabled",
|
|
21044
21166
|
"type": "boolean",
|
|
@@ -21481,6 +21603,7 @@
|
|
|
21481
21603
|
"states": [],
|
|
21482
21604
|
"dependents": [],
|
|
21483
21605
|
"dependencies": [
|
|
21606
|
+
"ds-paper-texture",
|
|
21484
21607
|
"ds-panel-nav",
|
|
21485
21608
|
"ds-bar-nav",
|
|
21486
21609
|
"ds-shell-tools",
|
|
@@ -21494,6 +21617,7 @@
|
|
|
21494
21617
|
],
|
|
21495
21618
|
"dependencyGraph": {
|
|
21496
21619
|
"ds-shell-app": [
|
|
21620
|
+
"ds-paper-texture",
|
|
21497
21621
|
"ds-panel-nav",
|
|
21498
21622
|
"ds-bar-nav",
|
|
21499
21623
|
"ds-shell-tools",
|
|
@@ -21972,7 +22096,7 @@
|
|
|
21972
22096
|
},
|
|
21973
22097
|
{
|
|
21974
22098
|
"filePath": "src/wc/components/ShellTools/ShellTools.tsx",
|
|
21975
|
-
"encapsulation": "
|
|
22099
|
+
"encapsulation": "shadow",
|
|
21976
22100
|
"tag": "ds-shell-tools",
|
|
21977
22101
|
"docs": "",
|
|
21978
22102
|
"docsTags": [],
|
|
@@ -24948,6 +25072,35 @@
|
|
|
24948
25072
|
"getter": false,
|
|
24949
25073
|
"setter": false
|
|
24950
25074
|
},
|
|
25075
|
+
{
|
|
25076
|
+
"name": "chromeLoading",
|
|
25077
|
+
"type": "boolean",
|
|
25078
|
+
"complexType": {
|
|
25079
|
+
"original": "boolean",
|
|
25080
|
+
"resolved": "boolean",
|
|
25081
|
+
"references": {}
|
|
25082
|
+
},
|
|
25083
|
+
"mutable": false,
|
|
25084
|
+
"attr": "chrome-loading",
|
|
25085
|
+
"reflectToAttr": false,
|
|
25086
|
+
"docs": "Replace opted-in table-owned caption controls with same-size visual skeletons.",
|
|
25087
|
+
"docsTags": [
|
|
25088
|
+
{
|
|
25089
|
+
"name": "default",
|
|
25090
|
+
"text": "false"
|
|
25091
|
+
}
|
|
25092
|
+
],
|
|
25093
|
+
"default": "false",
|
|
25094
|
+
"values": [
|
|
25095
|
+
{
|
|
25096
|
+
"type": "boolean"
|
|
25097
|
+
}
|
|
25098
|
+
],
|
|
25099
|
+
"optional": false,
|
|
25100
|
+
"required": false,
|
|
25101
|
+
"getter": false,
|
|
25102
|
+
"setter": false
|
|
25103
|
+
},
|
|
24951
25104
|
{
|
|
24952
25105
|
"name": "collapsedGroupIds",
|
|
24953
25106
|
"type": "string[]",
|
|
@@ -25211,7 +25364,7 @@
|
|
|
25211
25364
|
"mutable": false,
|
|
25212
25365
|
"attr": "displayed-count",
|
|
25213
25366
|
"reflectToAttr": false,
|
|
25214
|
-
"docs": "Optional result summary footer. When both `displayedCount` and `totalCount`\nare finite numbers, infinite mode shows “Displaying {displayed} of {total}”.\nVirtual mode ignores `displayedCount` and
|
|
25367
|
+
"docs": "Optional result summary footer. When both `displayedCount` and `totalCount`\nare finite numbers, infinite mode shows “Displaying {displayed} of {total}”.\nVirtual mode ignores `displayedCount` and derives its total from the\ncomplete supplied rows; a mismatched `totalCount` emits a warning.",
|
|
25215
25368
|
"docsTags": [],
|
|
25216
25369
|
"values": [
|
|
25217
25370
|
{
|
|
@@ -27025,7 +27178,7 @@
|
|
|
27025
27178
|
"mutable": false,
|
|
27026
27179
|
"attr": "dirty",
|
|
27027
27180
|
"reflectToAttr": false,
|
|
27028
|
-
"docs": "Whether the current table state differs from the selected view.",
|
|
27181
|
+
"docs": "Whether the current table state differs from the selected custom view. Ignored for the default view.",
|
|
27029
27182
|
"docsTags": [
|
|
27030
27183
|
{
|
|
27031
27184
|
"name": "default",
|
|
@@ -30733,6 +30886,11 @@
|
|
|
30733
30886
|
"docstring": "",
|
|
30734
30887
|
"path": "src/wc/components/PanelTools/panel-tools-types.ts"
|
|
30735
30888
|
},
|
|
30889
|
+
"src/wc/components/PaperTexture/paper-texture-types.ts::PaperTextureConfig": {
|
|
30890
|
+
"declaration": "export interface PaperTextureConfig {\n image?: HTMLImageElement | string;\n colorFront?: string;\n colorBack?: string;\n contrast?: number;\n roughness?: number;\n fiber?: number;\n fiberSize?: number;\n crumples?: number;\n crumpleSize?: number;\n folds?: number;\n foldCount?: number;\n fade?: number;\n drops?: number;\n seed?: number;\n fit?: PaperTextureFit;\n scale?: number;\n rotation?: number;\n originX?: number;\n originY?: number;\n offsetX?: number;\n offsetY?: number;\n worldWidth?: number;\n worldHeight?: number;\n speed?: number;\n frame?: number;\n minPixelRatio?: number;\n maxPixelCount?: number;\n /** CSS opacity applied after the shader has rendered. */\n opacity?: number;\n}",
|
|
30891
|
+
"docstring": "Literal parameters forwarded to Paper Design's paper texture shader.\nColors intentionally remain ordinary CSS color strings; they are not token\nreferences and are parsed once into shader RGBA uniforms.",
|
|
30892
|
+
"path": "src/wc/components/PaperTexture/paper-texture-types.ts"
|
|
30893
|
+
},
|
|
30736
30894
|
"src/wc/components/ShellApp/shell-app-types.ts::ShellAppComposition": {
|
|
30737
30895
|
"declaration": "export type ShellAppComposition = 'managed' | 'slotted';",
|
|
30738
30896
|
"docstring": "",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/wc/components/PanelTools/panel-tools-types.ts", "../../../src/wc/shell/nav-chrome.ts", "../../../src/wc/components/Menu/menu-placement.ts", "../../../src/wc/shell/shell-gradient-presets.ts", "../../../src/wc/shell/shell-responsive.ts"],
|
|
4
|
-
"sourcesContent": ["/** Application-owned tool id for the shell rail and responsive tool views. */\nexport type PanelToolsToolId = string;\n\n/** Canonical Motive shell recipe used when item metadata is omitted. */\nexport type CanonicalPanelToolsToolId =\n | 'search'\n | 'messages'\n | 'agents'\n | 'stacks'\n | 'activity'\n | 'help';\n\nexport const PANEL_TOOLS_TOOL_IDS: CanonicalPanelToolsToolId[] = [\n 'search',\n 'messages',\n 'agents',\n 'stacks',\n 'activity',\n 'help',\n];\n\n/** Rail header slot \u2014 mirrors panel-nav M logo row. */\nexport const PANEL_TOOLS_PRIMARY_TOOL_ID: CanonicalPanelToolsToolId = 'search';\n\n/** Rail footer slot \u2014 flush to the bottom of the tools column. */\nexport const PANEL_TOOLS_FOOTER_TOOL_ID: CanonicalPanelToolsToolId = 'help';\n\nexport const PANEL_TOOLS_LABELS: Record<CanonicalPanelToolsToolId, string> = {\n search: 'Search',\n messages: 'Messages',\n stacks: 'Stacks',\n activity: 'Activity',\n agents: 'Agents',\n help: 'Help & Support',\n};\n\nexport const PANEL_TOOLS_SHORTCUTS: Partial<Record<CanonicalPanelToolsToolId, string>> = {\n search: 'K',\n agents: 'A',\n messages: 'M',\n stacks: 'S',\n activity: 'N',\n help: '/',\n};\n\nexport interface PanelToolsItem {\n id: PanelToolsToolId;\n /** Icon name for <ds-icon>. */\n icon: string;\n /** Visible and accessible fallback label for custom tool ids. */\n label?: string;\n /** Explicit rail region; canonical Search/Help placement is the fallback. */\n railPlacement?: 'header' | 'body' | 'footer';\n /** Stable ordering within the selected rail region. */\n order?: number;\n /** Optional shortcut label displayed by the tooltip. */\n shortcutKey?: string;\n /** Mobile destination recipe; canonical ids retain their explicit defaults. */\n mobileDestination?: 'search' | 'inbox' | 'messages' | 'agents' | 'help';\n /** Whether this rail button is currently pressed/active. */\n selected?: boolean;\n /** Show a notification dot. */\n dot?: boolean;\n isInactive?: boolean;\n ariaLabel?: string;\n}\n\n/** Canonical shell recipe used by Lab and by managed ShellApp examples. */\nexport const PANEL_TOOLS_DEFAULT_ITEMS: PanelToolsItem[] = [\n {\n id: 'search',\n icon: 'MagnifyingGlass',\n label: PANEL_TOOLS_LABELS.search,\n railPlacement: 'header',\n order: 0,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.search,\n mobileDestination: 'search',\n },\n {\n id: 'messages',\n icon: 'MessageBubbleStack',\n label: PANEL_TOOLS_LABELS.messages,\n order: 1,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.messages,\n mobileDestination: 'messages',\n },\n {\n id: 'agents',\n icon: 'AI',\n label: PANEL_TOOLS_LABELS.agents,\n order: 2,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.agents,\n mobileDestination: 'agents',\n },\n {\n id: 'stacks',\n icon: 'ViewMenu',\n label: PANEL_TOOLS_LABELS.stacks,\n order: 3,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.stacks,\n mobileDestination: 'inbox',\n },\n {\n id: 'activity',\n icon: 'Bell',\n label: PANEL_TOOLS_LABELS.activity,\n order: 4,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.activity,\n mobileDestination: 'inbox',\n },\n {\n id: 'help',\n icon: 'CircleQuestion',\n label: PANEL_TOOLS_LABELS.help,\n railPlacement: 'footer',\n order: 5,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.help,\n mobileDestination: 'help',\n },\n];\n\nexport interface PanelToolsHeaderAction {\n id: string;\n icon: string;\n ariaLabel: string;\n triggerId?: string;\n controls?: string;\n expanded?: boolean;\n haspopup?: 'menu' | 'dialog' | 'listbox' | 'tree' | 'grid';\n pressed?: boolean;\n isInactive?: boolean;\n}\n\nexport interface PanelToolsHeaderConfig {\n title?: string;\n showBack?: boolean;\n backIcon?: string;\n backAriaLabel?: string;\n actions?: PanelToolsHeaderAction[];\n}\n\n/** Per-tool header state. The application replaces the object when a tool changes depth or actions. */\nexport type PanelToolsHeaders = Partial<Record<PanelToolsToolId, PanelToolsHeaderConfig>>;\n", "/** Nav chrome style slot \u2014 dashboard vs settings. Colors unified for now; texture hooks use the class. */\nexport type NavChromeStyle = 'dashboard' | 'settings';\n\n/** Document hint for first paint before framework props land. */\nexport const NAV_STYLE_HINT_ATTR = 'data-nav-style';\n\nexport function readNavStyleAttr(attr: string | null): NavChromeStyle | undefined {\n if (attr === 'dashboard' || attr === 'settings') return attr;\n return undefined;\n}\n\nexport function setNavStyleHint(style: NavChromeStyle): void {\n if (typeof document === 'undefined') return;\n document.documentElement.setAttribute(NAV_STYLE_HINT_ATTR, style);\n}\n\nexport function clearNavStyleHint(): void {\n if (typeof document === 'undefined') return;\n document.documentElement.removeAttribute(NAV_STYLE_HINT_ATTR);\n}\n\nexport function resolveNavChromeStyle(\n styleProp: NavChromeStyle,\n hostAttr: string | null,\n docHint?: string | null,\n): NavChromeStyle {\n const fromHost = readNavStyleAttr(hostAttr);\n if (fromHost) return fromHost;\n\n const hint =\n docHint !== undefined\n ? docHint\n : typeof document !== 'undefined'\n ? document.documentElement.getAttribute(NAV_STYLE_HINT_ATTR)\n : null;\n const fromHint = readNavStyleAttr(hint);\n if (fromHint) return fromHint;\n\n return styleProp;\n}\n\nexport function shouldResyncNavChromeStyle(\n renderedStyle: NavChromeStyle,\n style: NavChromeStyle,\n): boolean {\n return renderedStyle !== style;\n}\n", "import type { ChoicePopupAnchorAlignment } from '../../utils/choice-popup-alignment';\nimport type { MenuAlign, MenuSide } from './menu-position';\n\n/** Placement props bindable on `ds-menu` (side, align, offsets). */\nexport interface MenuPlacement {\n side: MenuSide;\n align: MenuAlign;\n anchorAlignment: ChoicePopupAnchorAlignment;\n sideOffset: number | string;\n alignOffset: number | string;\n}\n\n/**\n * Canonical `ds-menu` placement for the **panel-nav footer user menu**.\n * Anchor from `dsNavUserAction` detail `{ anchor }` (id `ds-panel-nav-user-menu-anchor`).\n *\n * Not for BarNav overflow menus \u2014 those use `side=\"bottom\"` / `align=\"end\"` internally.\n * `align: 'end'` bottom-aligns the last choice cell on the anchor; the side offset nudges into the content area:\n * - `sideOffset` space-100 + space-050 (12px): 4px past the panel-nav outer edge (anchor is ~8px inset).\n * - `anchorAlignment: 'choice-cell'`: the shared section inset puts the last row edge on the footer user row.\n */\nexport const PANEL_NAV_USER_MENU_PLACEMENT = {\n side: 'right',\n align: 'end',\n anchorAlignment: 'choice-cell',\n sideOffset: 'calc(var(--dimension-space-100) + var(--dimension-space-050))',\n alignOffset: 0,\n} as const satisfies MenuPlacement;\n\n/**\n * Canonical placement for a menu opened by a PanelTools header action.\n * Matches BarNav overflow: the 32px trigger is 8px inside the 48px header, so\n * a 12px side offset places the popup 4px below the header edge. Choice-cell\n * alignment keeps the final menu item edge aligned with the trigger.\n */\nexport const PANEL_TOOLS_HEADER_MENU_PLACEMENT = {\n side: 'bottom',\n align: 'end',\n anchorAlignment: 'choice-cell',\n sideOffset: 'calc(var(--dimension-space-100) + var(--dimension-space-050))',\n alignOffset: 0,\n} as const satisfies MenuPlacement;\n", "/** Built-in shell chrome wash presets. */\nexport type ShellGradientPreset = 'none' | 'cool' | 'neutral' | 'warm' | 'fresh';\n\nexport const SHELL_GRADIENT_PRESETS: ShellGradientPreset[] = [\n 'none',\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Wash presets shown after the `none` option in pickers. */\nexport const SHELL_GRADIENT_WASH_PRESETS: Exclude<ShellGradientPreset, 'none'>[] = [\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Default wash when `gradient-preset` is omitted. */\nexport const DEFAULT_SHELL_GRADIENT_PRESET: ShellGradientPreset = 'neutral';\n\nexport const SHELL_GRADIENT_PRESET_LABELS: Record<ShellGradientPreset, string> = {\n none: 'None',\n cool: 'Cool',\n neutral: 'Neutral',\n warm: 'Warm',\n fresh: 'Fresh',\n};\n\nexport interface ShellGradientStop {\n color: string;\n position: number;\n}\n\nexport interface ShellGradientRecipe {\n opacity: number;\n stops: readonly ShellGradientStop[];\n}\n\nexport interface ShellGradientPickerPreview {\n backgroundColor: string;\n backgroundImage?: string;\n opacity?: number;\n}\n\nexport interface ShellGradientPickerOption {\n value: ShellGradientPreset;\n label: string;\n preview: ShellGradientPickerPreview;\n}\n\nexport interface ShellGradientPickerSection {\n options: ShellGradientPickerOption[];\n}\n\nconst SHELL_GRADIENT_RECIPES: Record<Exclude<ShellGradientPreset, 'none'>, ShellGradientRecipe> = {\n cool: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-blue-strong-background)', position: 100 },\n ],\n },\n neutral: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-grey-strong-background)', position: 100 },\n ],\n },\n warm: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-yellow-strong-background)', position: 100 },\n ],\n },\n fresh: {\n opacity: 0.4,\n stops: [\n { color: 'var(--color-color-intent-cyan-faint-background)', position: 0 },\n { color: 'var(--color-background-transparent)', position: 47 },\n { color: 'var(--color-background-transparent)', position: 58 },\n { color: 'var(--color-color-intent-red-faint-background)', position: 83 },\n { color: 'var(--color-color-intent-pink-faint-background)', position: 100 },\n ],\n },\n};\n\nconst GRADIENT_GEOMETRY = '100% 100% at 0% 0%';\n\nexport function shellGradientPresetStopToken(preset: ShellGradientPreset): string | null {\n if (preset === 'none') return null;\n const stops = SHELL_GRADIENT_RECIPES[preset].stops;\n return stops[stops.length - 1]?.color ?? null;\n}\n\nexport function shellGradientPresetRecipe(preset: ShellGradientPreset): ShellGradientRecipe | null {\n const normalized = normalizeShellGradientPreset(preset);\n return normalized === 'none' ? null : SHELL_GRADIENT_RECIPES[normalized];\n}\n\nexport function shellGradientPresetOpacity(preset: ShellGradientPreset): string {\n return String(shellGradientPresetRecipe(preset)?.opacity ?? 0);\n}\n\nexport function isShellGradientPreset(value: string): value is ShellGradientPreset {\n return (SHELL_GRADIENT_PRESETS as string[]).includes(value);\n}\n\n/**\n * Coerce unknown/absent presets to the default. Runtime values escape the\n * type: removing the reflected `gradient-preset` attribute (e.g. an Angular\n * `[attr.gradient-preset]=\"null\"` binding) drives the prop to null past its\n * field default \u2014 without normalization the stop lookup interpolates the\n * literal string \"undefined\" into CSS and the wash silently disappears.\n */\nexport function normalizeShellGradientPreset(\n value: string | null | undefined,\n): ShellGradientPreset {\n return value != null && isShellGradientPreset(value) ? value : DEFAULT_SHELL_GRADIENT_PRESET;\n}\n\n/** Radial wash for a preset \u2014 transparent at top-left into the intent stop. `none` returns no image. */\nexport function buildShellRadialGradientForPreset(preset: ShellGradientPreset): string {\n const normalized = normalizeShellGradientPreset(preset);\n if (normalized === 'none') return 'none';\n\n return buildShellRadialGradientFromStops(SHELL_GRADIENT_RECIPES[normalized].stops);\n}\n\n/** Build the production shell geometry from an ordered set of design-time stops. */\nexport function buildShellRadialGradientFromStops(stops: readonly ShellGradientStop[]): string {\n const serialized = stops.map(stop => `${stop.color} ${stop.position}%`).join(', ');\n return `radial-gradient(${GRADIENT_GEOMETRY}, ${serialized})`;\n}\n\n/** Generic SwatchPicker sections for the fixed shell appearance presets. */\nexport function shellGradientPickerSections(): ShellGradientPickerSection[] {\n return [\n {\n options: [{\n value: 'none',\n label: SHELL_GRADIENT_PRESET_LABELS.none,\n preview: {\n backgroundColor: 'var(--color-background-secondary)',\n },\n }],\n },\n {\n options: SHELL_GRADIENT_WASH_PRESETS.map(preset => ({\n value: preset,\n label: SHELL_GRADIENT_PRESET_LABELS[preset],\n preview: {\n backgroundColor: 'var(--color-background-secondary)',\n backgroundImage: buildShellRadialGradientForPreset(preset),\n opacity: Number(shellGradientPresetOpacity(preset)),\n },\n })),\n },\n ];\n}\n", "import type { PanelToolsToolId } from '../components/PanelTools/panel-tools-types';\n\nexport type ShellResponsiveMode = 'desktop' | 'tablet' | 'mobile';\nexport type MobileDestination = 'area' | 'search' | 'inbox' | 'messages' | 'agents' | 'help';\nexport type ShellInboxToolId = PanelToolsToolId;\n\nexport const SHELL_DESKTOP_BREAKPOINT = 1200;\nexport const SHELL_MOBILE_BREAKPOINT = 768;\nexport const SHELL_DEFAULT_INBOX_TOOL: ShellInboxToolId = 'activity';\n\nexport function resolveShellResponsiveMode(width: number): ShellResponsiveMode {\n if (width >= SHELL_DESKTOP_BREAKPOINT) return 'desktop';\n if (width >= SHELL_MOBILE_BREAKPOINT) return 'tablet';\n return 'mobile';\n}\n\nexport function resolveManagedShellPageCapacity(\n mode: ShellResponsiveMode,\n toolsOpen: boolean\n): 'roomy' | 'compact' | 'constrained' {\n if (mode === 'desktop') return toolsOpen ? 'compact' : 'roomy';\n return toolsOpen ? 'constrained' : 'compact';\n}\n\nexport function shellMobileDestinationForTool(\n open: boolean,\n tool: PanelToolsToolId | ''\n): MobileDestination {\n if (!open || !tool) return 'area';\n if (tool === 'help') return 'help';\n if (tool === 'search') return 'search';\n if (tool === 'messages') return 'messages';\n if (tool === 'agents') return 'agents';\n return 'inbox';\n}\n\nexport function isShellInboxTool(tool: string): tool is ShellInboxToolId {\n return tool === 'stacks' || tool === 'activity';\n}\n\nexport function resolveAvailableInboxTool(\n preferred: string,\n available: readonly PanelToolsToolId[]\n): ShellInboxToolId | '' {\n const inbox = available.filter(isShellInboxTool);\n if (isShellInboxTool(preferred) && inbox.includes(preferred)) return preferred;\n if (inbox.includes(SHELL_DEFAULT_INBOX_TOOL)) return SHELL_DEFAULT_INBOX_TOOL;\n return inbox[0] ?? '';\n}\n\n/** Active-destination reselects are inert unless they also dismiss the Menu pane. */\nexport function shouldEmitMobileDestinationChange(\n active: MobileDestination,\n next: MobileDestination,\n navigationOpen: boolean\n): boolean {\n return navigationOpen || active !== next;\n}\n"],
|
|
5
|
-
"mappings": ";AA2BO,IAAM,qBAAgE;AAAA,EAC3E,QAAQ;AAAA,EACR,UA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,IACA;AAAA,MACE,SAAS,4BAA4B,IAAI,aAAW;AAAA,QAClD,OAAO;AAAA,QACP,OAAO,6BAA6B,MAAM;AAAA,QAC1C,SAAS;AAAA,UACP,iBAAiB;AAAA,UACjB,iBAAiB,kCAAkC,MAAM;AAAA,UACzD,SAAS,OAAO,2BAA2B,MAAM,CAAC;AAAA,QACpD;AAAA,MACF,EAAE;AAAA,IACJ;AAAA,EACF;AACF;;;AC5JO,IAAM,2BAA2B;AACjC,IAAM,0BAA0B;AAChC,IAAM,2BAA6C;AAEnD,SAAS,2BAA2B,OAAoC;AAC7E,MAAI,SAAS,yBAA0B,QAAO;AAC9C,MAAI,SAAS,wBAAyB,QAAO;AAC7C,SAAO;AACT;
|
|
4
|
+
"sourcesContent": ["/** Application-owned tool id for the shell rail and responsive tool views. */\nexport type PanelToolsToolId = string;\n\n/** Canonical Motive shell recipe used when item metadata is omitted. */\nexport type CanonicalPanelToolsToolId =\n | 'search'\n | 'messages'\n | 'agents'\n | 'stacks'\n | 'activity'\n | 'help';\n\nexport const PANEL_TOOLS_TOOL_IDS: CanonicalPanelToolsToolId[] = [\n 'search',\n 'messages',\n 'agents',\n 'stacks',\n 'activity',\n 'help',\n];\n\n/** Rail header slot \u2014 mirrors panel-nav M logo row. */\nexport const PANEL_TOOLS_PRIMARY_TOOL_ID: CanonicalPanelToolsToolId = 'search';\n\n/** Rail footer slot \u2014 flush to the bottom of the tools column. */\nexport const PANEL_TOOLS_FOOTER_TOOL_ID: CanonicalPanelToolsToolId = 'help';\n\nexport const PANEL_TOOLS_LABELS: Record<CanonicalPanelToolsToolId, string> = {\n search: 'Search',\n messages: 'Messages',\n stacks: 'Stacks',\n activity: 'Activity',\n agents: 'Agents',\n help: 'Help & Support',\n};\n\nexport const PANEL_TOOLS_SHORTCUTS: Partial<Record<CanonicalPanelToolsToolId, string>> = {\n search: 'K',\n agents: 'A',\n messages: 'M',\n stacks: 'S',\n activity: 'N',\n help: '/',\n};\n\nexport interface PanelToolsItem {\n id: PanelToolsToolId;\n /** Icon name for <ds-icon>. */\n icon: string;\n /** Visible and accessible fallback label for custom tool ids. */\n label?: string;\n /** Explicit rail region; canonical Search/Help placement is the fallback. */\n railPlacement?: 'header' | 'body' | 'footer';\n /** Stable ordering within the selected rail region. */\n order?: number;\n /** Optional shortcut label displayed by the tooltip. */\n shortcutKey?: string;\n /** Mobile destination recipe; canonical ids retain their explicit defaults. */\n mobileDestination?: 'search' | 'inbox' | 'messages' | 'agents' | 'help';\n /** Whether this rail button is currently pressed/active. */\n selected?: boolean;\n /** Show a notification dot. */\n dot?: boolean;\n isInactive?: boolean;\n ariaLabel?: string;\n}\n\n/** Canonical shell recipe used by Lab and by managed ShellApp examples. */\nexport const PANEL_TOOLS_DEFAULT_ITEMS: PanelToolsItem[] = [\n {\n id: 'search',\n icon: 'MagnifyingGlass',\n label: PANEL_TOOLS_LABELS.search,\n railPlacement: 'header',\n order: 0,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.search,\n mobileDestination: 'search',\n },\n {\n id: 'messages',\n icon: 'MessageBubbleStack',\n label: PANEL_TOOLS_LABELS.messages,\n order: 1,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.messages,\n mobileDestination: 'messages',\n },\n {\n id: 'agents',\n icon: 'AI',\n label: PANEL_TOOLS_LABELS.agents,\n order: 2,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.agents,\n mobileDestination: 'agents',\n },\n {\n id: 'stacks',\n icon: 'ViewMenu',\n label: PANEL_TOOLS_LABELS.stacks,\n order: 3,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.stacks,\n mobileDestination: 'inbox',\n },\n {\n id: 'activity',\n icon: 'Bell',\n label: PANEL_TOOLS_LABELS.activity,\n order: 4,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.activity,\n mobileDestination: 'inbox',\n },\n {\n id: 'help',\n icon: 'CircleQuestion',\n label: PANEL_TOOLS_LABELS.help,\n railPlacement: 'footer',\n order: 5,\n shortcutKey: PANEL_TOOLS_SHORTCUTS.help,\n mobileDestination: 'help',\n },\n];\n\nexport interface PanelToolsHeaderAction {\n id: string;\n icon: string;\n ariaLabel: string;\n triggerId?: string;\n controls?: string;\n expanded?: boolean;\n haspopup?: 'menu' | 'dialog' | 'listbox' | 'tree' | 'grid';\n pressed?: boolean;\n isInactive?: boolean;\n}\n\nexport interface PanelToolsHeaderConfig {\n title?: string;\n showBack?: boolean;\n backIcon?: string;\n backAriaLabel?: string;\n actions?: PanelToolsHeaderAction[];\n}\n\n/** Per-tool header state. The application replaces the object when a tool changes depth or actions. */\nexport type PanelToolsHeaders = Partial<Record<PanelToolsToolId, PanelToolsHeaderConfig>>;\n", "/** Nav chrome style slot \u2014 dashboard vs settings. Colors unified for now; texture hooks use the class. */\nexport type NavChromeStyle = 'dashboard' | 'settings';\n\n/** Document hint for first paint before framework props land. */\nexport const NAV_STYLE_HINT_ATTR = 'data-nav-style';\n\nexport function readNavStyleAttr(attr: string | null): NavChromeStyle | undefined {\n if (attr === 'dashboard' || attr === 'settings') return attr;\n return undefined;\n}\n\nexport function setNavStyleHint(style: NavChromeStyle): void {\n if (typeof document === 'undefined') return;\n document.documentElement.setAttribute(NAV_STYLE_HINT_ATTR, style);\n}\n\nexport function clearNavStyleHint(): void {\n if (typeof document === 'undefined') return;\n document.documentElement.removeAttribute(NAV_STYLE_HINT_ATTR);\n}\n\nexport function resolveNavChromeStyle(\n styleProp: NavChromeStyle,\n hostAttr: string | null,\n docHint?: string | null,\n): NavChromeStyle {\n const fromHost = readNavStyleAttr(hostAttr);\n if (fromHost) return fromHost;\n\n const hint =\n docHint !== undefined\n ? docHint\n : typeof document !== 'undefined'\n ? document.documentElement.getAttribute(NAV_STYLE_HINT_ATTR)\n : null;\n const fromHint = readNavStyleAttr(hint);\n if (fromHint) return fromHint;\n\n return styleProp;\n}\n\nexport function shouldResyncNavChromeStyle(\n renderedStyle: NavChromeStyle,\n style: NavChromeStyle,\n): boolean {\n return renderedStyle !== style;\n}\n", "import type { ChoicePopupAnchorAlignment } from '../../utils/choice-popup-alignment';\nimport type { MenuAlign, MenuSide } from './menu-position';\n\n/** Placement props bindable on `ds-menu` (side, align, offsets). */\nexport interface MenuPlacement {\n side: MenuSide;\n align: MenuAlign;\n anchorAlignment: ChoicePopupAnchorAlignment;\n sideOffset: number | string;\n alignOffset: number | string;\n}\n\n/**\n * Canonical `ds-menu` placement for the **panel-nav footer user menu**.\n * Anchor from `dsNavUserAction` detail `{ anchor }` (id `ds-panel-nav-user-menu-anchor`).\n *\n * Not for BarNav overflow menus \u2014 those use `side=\"bottom\"` / `align=\"end\"` internally.\n * `align: 'end'` bottom-aligns the last choice cell on the anchor; the side offset nudges into the content area:\n * - `sideOffset` space-100 + space-050 (12px): 4px past the panel-nav outer edge (anchor is ~8px inset).\n * - `anchorAlignment: 'choice-cell'`: the shared section inset puts the last row edge on the footer user row.\n */\nexport const PANEL_NAV_USER_MENU_PLACEMENT = {\n side: 'right',\n align: 'end',\n anchorAlignment: 'choice-cell',\n sideOffset: 'calc(var(--dimension-space-100) + var(--dimension-space-050))',\n alignOffset: 0,\n} as const satisfies MenuPlacement;\n\n/**\n * Canonical placement for a menu opened by a PanelTools header action.\n * Matches BarNav overflow: the 32px trigger is 8px inside the 48px header, so\n * a 12px side offset places the popup 4px below the header edge. Choice-cell\n * alignment keeps the final menu item edge aligned with the trigger.\n */\nexport const PANEL_TOOLS_HEADER_MENU_PLACEMENT = {\n side: 'bottom',\n align: 'end',\n anchorAlignment: 'choice-cell',\n sideOffset: 'calc(var(--dimension-space-100) + var(--dimension-space-050))',\n alignOffset: 0,\n} as const satisfies MenuPlacement;\n", "/** Built-in shell chrome wash presets. */\nexport type ShellGradientPreset = 'none' | 'cool' | 'neutral' | 'warm' | 'fresh';\n\nexport const SHELL_GRADIENT_PRESETS: ShellGradientPreset[] = [\n 'none',\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Wash presets shown after the `none` option in pickers. */\nexport const SHELL_GRADIENT_WASH_PRESETS: Exclude<ShellGradientPreset, 'none'>[] = [\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Default wash when `gradient-preset` is omitted. */\nexport const DEFAULT_SHELL_GRADIENT_PRESET: ShellGradientPreset = 'neutral';\n\nexport const SHELL_GRADIENT_PRESET_LABELS: Record<ShellGradientPreset, string> = {\n none: 'None',\n cool: 'Cool',\n neutral: 'Neutral',\n warm: 'Warm',\n fresh: 'Fresh',\n};\n\nexport interface ShellGradientStop {\n color: string;\n position: number;\n}\n\nexport interface ShellGradientRecipe {\n opacity: number;\n stops: readonly ShellGradientStop[];\n}\n\nexport interface ShellGradientPickerPreview {\n backgroundColor: string;\n backgroundImage?: string;\n opacity?: number;\n}\n\nexport interface ShellGradientPickerOption {\n value: ShellGradientPreset;\n label: string;\n preview: ShellGradientPickerPreview;\n}\n\nexport interface ShellGradientPickerSection {\n options: ShellGradientPickerOption[];\n}\n\nconst SHELL_GRADIENT_RECIPES: Record<Exclude<ShellGradientPreset, 'none'>, ShellGradientRecipe> = {\n cool: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-blue-strong-background)', position: 100 },\n ],\n },\n neutral: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-grey-strong-background)', position: 100 },\n ],\n },\n warm: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-yellow-strong-background)', position: 100 },\n ],\n },\n fresh: {\n opacity: 0.4,\n stops: [\n { color: 'var(--color-color-intent-cyan-faint-background)', position: 0 },\n { color: 'var(--color-background-transparent)', position: 47 },\n { color: 'var(--color-background-transparent)', position: 58 },\n { color: 'var(--color-color-intent-red-faint-background)', position: 83 },\n { color: 'var(--color-color-intent-pink-faint-background)', position: 100 },\n ],\n },\n};\n\nconst GRADIENT_GEOMETRY = '100% 100% at 0% 0%';\n\nexport function shellGradientPresetStopToken(preset: ShellGradientPreset): string | null {\n if (preset === 'none') return null;\n const stops = SHELL_GRADIENT_RECIPES[preset].stops;\n return stops[stops.length - 1]?.color ?? null;\n}\n\nexport function shellGradientPresetRecipe(preset: ShellGradientPreset): ShellGradientRecipe | null {\n const normalized = normalizeShellGradientPreset(preset);\n return normalized === 'none' ? null : SHELL_GRADIENT_RECIPES[normalized];\n}\n\nexport function shellGradientPresetOpacity(preset: ShellGradientPreset): string {\n return String(shellGradientPresetRecipe(preset)?.opacity ?? 0);\n}\n\nexport function isShellGradientPreset(value: string): value is ShellGradientPreset {\n return (SHELL_GRADIENT_PRESETS as string[]).includes(value);\n}\n\n/**\n * Coerce unknown/absent presets to the default. Runtime values escape the\n * type: removing the reflected `gradient-preset` attribute (e.g. an Angular\n * `[attr.gradient-preset]=\"null\"` binding) drives the prop to null past its\n * field default \u2014 without normalization the stop lookup interpolates the\n * literal string \"undefined\" into CSS and the wash silently disappears.\n */\nexport function normalizeShellGradientPreset(\n value: string | null | undefined,\n): ShellGradientPreset {\n return value != null && isShellGradientPreset(value) ? value : DEFAULT_SHELL_GRADIENT_PRESET;\n}\n\n/** Radial wash for a preset \u2014 transparent at top-left into the intent stop. `none` returns no image. */\nexport function buildShellRadialGradientForPreset(preset: ShellGradientPreset): string {\n const normalized = normalizeShellGradientPreset(preset);\n if (normalized === 'none') return 'none';\n\n return buildShellRadialGradientFromStops(SHELL_GRADIENT_RECIPES[normalized].stops);\n}\n\n/** Build the production shell geometry from an ordered set of design-time stops. */\nexport function buildShellRadialGradientFromStops(stops: readonly ShellGradientStop[]): string {\n const serialized = stops.map(stop => `${stop.color} ${stop.position}%`).join(', ');\n return `radial-gradient(${GRADIENT_GEOMETRY}, ${serialized})`;\n}\n\n/** Generic SwatchPicker sections for the fixed shell appearance presets. */\nexport function shellGradientPickerSections(): ShellGradientPickerSection[] {\n return [\n {\n options: [{\n value: 'none',\n label: SHELL_GRADIENT_PRESET_LABELS.none,\n preview: {\n backgroundColor: 'var(--color-background-secondary)',\n },\n }],\n },\n {\n options: SHELL_GRADIENT_WASH_PRESETS.map(preset => ({\n value: preset,\n label: SHELL_GRADIENT_PRESET_LABELS[preset],\n preview: {\n backgroundColor: 'var(--color-background-secondary)',\n backgroundImage: buildShellRadialGradientForPreset(preset),\n opacity: Number(shellGradientPresetOpacity(preset)),\n },\n })),\n },\n ];\n}\n", "import type { PanelToolsToolId } from '../components/PanelTools/panel-tools-types';\n\nexport type ShellResponsiveMode = 'desktop' | 'tablet' | 'mobile';\nexport type MobileDestination = 'area' | 'search' | 'inbox' | 'messages' | 'agents' | 'help';\nexport type ShellInboxToolId = PanelToolsToolId;\n\nexport const SHELL_DESKTOP_BREAKPOINT = 1200;\nexport const SHELL_MOBILE_BREAKPOINT = 768;\nexport const SHELL_DEFAULT_INBOX_TOOL: ShellInboxToolId = 'activity';\n\nexport function resolveShellResponsiveMode(width: number): ShellResponsiveMode {\n if (width >= SHELL_DESKTOP_BREAKPOINT) return 'desktop';\n if (width >= SHELL_MOBILE_BREAKPOINT) return 'tablet';\n return 'mobile';\n}\n\nexport function resolveManagedShellPageCapacity(\n mode: ShellResponsiveMode\n): 'roomy' | 'compact' | 'constrained' {\n return mode === 'desktop' ? 'roomy' : 'compact';\n}\n\nexport function shellMobileDestinationForTool(\n open: boolean,\n tool: PanelToolsToolId | ''\n): MobileDestination {\n if (!open || !tool) return 'area';\n if (tool === 'help') return 'help';\n if (tool === 'search') return 'search';\n if (tool === 'messages') return 'messages';\n if (tool === 'agents') return 'agents';\n return 'inbox';\n}\n\nexport function isShellInboxTool(tool: string): tool is ShellInboxToolId {\n return tool === 'stacks' || tool === 'activity';\n}\n\nexport function resolveAvailableInboxTool(\n preferred: string,\n available: readonly PanelToolsToolId[]\n): ShellInboxToolId | '' {\n const inbox = available.filter(isShellInboxTool);\n if (isShellInboxTool(preferred) && inbox.includes(preferred)) return preferred;\n if (inbox.includes(SHELL_DEFAULT_INBOX_TOOL)) return SHELL_DEFAULT_INBOX_TOOL;\n return inbox[0] ?? '';\n}\n\n/** Active-destination reselects are inert unless they also dismiss the Menu pane. */\nexport function shouldEmitMobileDestinationChange(\n active: MobileDestination,\n next: MobileDestination,\n navigationOpen: boolean\n): boolean {\n return navigationOpen || active !== next;\n}\n"],
|
|
5
|
+
"mappings": ";AA2BO,IAAM,qBAAgE;AAAA,EAC3E,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,MAAM;AACR;AAEO,IAAM,wBAA4E;AAAA,EACvF,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM;AACR;AAyBO,IAAM,4BAA8C;AAAA,EACzD;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,OAAO,mBAAmB;AAAA,IAC1B,eAAe;AAAA,IACf,OAAO;AAAA,IACP,aAAa,sBAAsB;AAAA,IACnC,mBAAmB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,OAAO,mBAAmB;AAAA,IAC1B,OAAO;AAAA,IACP,aAAa,sBAAsB;AAAA,IACnC,mBAAmB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,OAAO,mBAAmB;AAAA,IAC1B,OAAO;AAAA,IACP,aAAa,sBAAsB;AAAA,IACnC,mBAAmB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,OAAO,mBAAmB;AAAA,IAC1B,OAAO;AAAA,IACP,aAAa,sBAAsB;AAAA,IACnC,mBAAmB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,OAAO,mBAAmB;AAAA,IAC1B,OAAO;AAAA,IACP,aAAa,sBAAsB;AAAA,IACnC,mBAAmB;AA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AO,kBAAkB,WAAW;AACtC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,7 +6,7 @@ export declare const SHELL_DESKTOP_BREAKPOINT = 1200;
|
|
|
6
6
|
export declare const SHELL_MOBILE_BREAKPOINT = 768;
|
|
7
7
|
export declare const SHELL_DEFAULT_INBOX_TOOL: ShellInboxToolId;
|
|
8
8
|
export declare function resolveShellResponsiveMode(width: number): ShellResponsiveMode;
|
|
9
|
-
export declare function resolveManagedShellPageCapacity(mode: ShellResponsiveMode
|
|
9
|
+
export declare function resolveManagedShellPageCapacity(mode: ShellResponsiveMode): 'roomy' | 'compact' | 'constrained';
|
|
10
10
|
export declare function shellMobileDestinationForTool(open: boolean, tool: PanelToolsToolId | ''): MobileDestination;
|
|
11
11
|
export declare function isShellInboxTool(tool: string): tool is ShellInboxToolId;
|
|
12
12
|
export declare function resolveAvailableInboxTool(preferred: string, available: readonly PanelToolsToolId[]): ShellInboxToolId | '';
|
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
"files": [
|
|
297
297
|
{
|
|
298
298
|
"path": "src/wc/components/BarNav/BarNav.css",
|
|
299
|
-
"content": "@import '../../utils/control-density.css';\n@import '../../utils/control-parts.css';\n@import '../../utils/chrome-layout.css';\n@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n\n:host {\n display: block;\n}\n\n.bar-nav {\n position: relative;\n height: var(--dimension-size-600);\n border-bottom: var(--dimension-stroke-width-012) solid var(--_bar-nav-border);\n background-color: var(--_bar-nav-bg);\n color: var(--_bar-nav-fg-primary);\n -webkit-user-select: none;\n user-select: none;\n overflow: hidden;\n transition:\n background-color var(--effect-motion-short-3),\n border-color var(--effect-motion-short-3),\n color var(--effect-motion-short-3);\n isolation: isolate;\n /* Default chrome — app surfaces */\n --_bar-nav-bg: var(--color-background-secondary);\n --_bar-nav-border: var(--color-border-tertiary);\n --_bar-nav-fg-primary: var(--color-foreground-primary);\n --_bar-nav-fg-secondary: var(--color-foreground-secondary);\n --_bar-nav-hover: var(--color-interaction-hover);\n --_bar-nav-pressed: var(--color-interaction-pressed);\n --_bar-nav-focus: var(--color-interaction-focus);\n --_bar-nav-dot: var(--color-foreground-bold-brand);\n --ds-focus-ring-color: var(--_bar-nav-focus);\n}\n\n/* Style slots — same app tokens for now; hook texture/glyph layers later. */\n.bar-nav--dashboard,\n.bar-nav--settings {\n --_bar-nav-bg: var(--color-background-secondary);\n --_bar-nav-border: var(--color-border-tertiary);\n --_bar-nav-fg-primary: var(--color-foreground-primary);\n --_bar-nav-fg-secondary: var(--color-foreground-secondary);\n --_bar-nav-hover: var(--color-interaction-hover);\n --_bar-nav-pressed: var(--color-interaction-pressed);\n --_bar-nav-focus: var(--color-interaction-focus);\n --_bar-nav-dot: var(--color-foreground-bold-brand);\n}\n\n/* Shell-owned chrome (bg + wash) — bar is a transparent frame. */\n:host-context(ds-shell-app:not([gradient-preset='none'])) .bar-nav {\n background-color: transparent;\n}\n\n.bar-nav > :not(.bar-nav__tabs-probe) {\n position: relative;\n z-index: 3;\n}\n\n/* Overflow — keep fitting tabs visible and pin the overflow trigger to the far edge. */\n.bar-nav--tabs-collapsed {\n display: flex;\n gap: var(--dimension-space-100);\n align-items: center;\n}\n\n/* Expanded tabs — consume full header width */\n.bar-nav__left {\n position: relative;\n flex: 1 1 0%;\n min-width: 0;\n width: 0;\n display: flex;\n align-items: center;\n}\n\n.bar-nav__tabs-visible {\n flex: 1;\n min-width: 0;\n width: 100%;\n}\n\n/* Unconstrained width so intrinsic tab row width is measurable while collapsed */\n.bar-nav__tabs-probe {\n position: absolute;\n left: 0;\n top: 0;\n visibility: hidden;\n pointer-events: none;\n overflow: visible;\n width: max-content;\n max-width: none;\n z-index: -1;\n}\n\n.bar-nav__tabs-probe > div {\n width: max-content;\n}\n\n.bar-nav__tab-list {\n display: flex;\n align-items: center;\n gap: var(--dimension-space-050);\n position: relative;\n width: max-content;\n}\n\n.bar-nav__tab {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--ds-control-gap);\n height: var(--ds-control-height);\n min-width: var(--ds-control-height);\n padding: 0 var(--ds-control-padding-inline);\n box-sizing: border-box;\n border: none;\n border-radius: var(--ds-control-radius);\n background-color: transparent;\n color: var(--_bar-nav-fg-secondary);\n cursor: default;\n position: relative;\n flex-shrink: 0;\n -webkit-user-select: none;\n user-select: none;\n transition: color var(--effect-motion-short-2);\n}\n\n.bar-nav__tab::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: var(--ds-control-radius);\n background: transparent;\n pointer-events: none;\n cursor: inherit;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .bar-nav__tab:hover::after {\n background: var(--_bar-nav-hover);\n }\n}\n\n.bar-nav__tab:active::after {\n background: var(--_bar-nav-pressed);\n}\n\n.bar-nav__tab--selected {\n color: var(--_bar-nav-fg-primary);\n}\n\n.bar-nav__tab-label {\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n}\n\n.bar-nav__tab-divider {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--dimension-space-100);\n height: var(--ds-control-height);\n padding-block: var(--ds-control-padding-inline);\n flex-shrink: 0;\n pointer-events: none;\n}\n\n.bar-nav__tab-divider-line {\n width: var(--dimension-stroke-width-012);\n align-self: stretch;\n background-color: var(--_bar-nav-border);\n}\n\n/* In-flow placeholder while measuring overflow — avoids layout jump; hidden from view/accessibility. */\n.bar-nav__tabs-pending {\n flex: 1;\n min-width: 0;\n height: var(--ds-control-height);\n visibility: hidden;\n pointer-events: none;\n}\n\n/* Overflow trigger — compact icon button aligned to the right edge. */\n.bar-nav__overflow-trigger {\n margin-left: auto;\n --ds-button-unfilled-fg: var(--_bar-nav-fg-secondary);\n --ds-button-unfilled-fg-active: var(--_bar-nav-fg-primary);\n --ds-interaction-hover: var(--_bar-nav-hover);\n --ds-interaction-pressed: var(--_bar-nav-pressed);\n --ds-focus-ring-color: var(--_bar-nav-focus);\n}\n\n/* Fallback heading when no tabs — matches a single (selected) tab so the area\n name shares the tab label's type token, color, height and horizontal inset.\n Inset = tab button padding (space-075, 6px) + label inset (space-025, 2px).\n Color comes from ds-text color=\"primary\"; beat Text's inline-box display. */\nds-text.bar-nav__heading {\n display: inline-flex;\n align-items: center;\n height: var(--ds-control-height);\n padding-inline: calc(var(--ds-control-padding-inline) + var(--ds-control-label-inset));\n -webkit-user-select: none;\n user-select: none;\n}\n",
|
|
299
|
+
"content": "@import '../../utils/control-density.css';\n@import '../../utils/control-parts.css';\n@import '../../utils/chrome-layout.css';\n@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n\n:host {\n display: block;\n}\n\n.bar-nav {\n position: relative;\n height: var(--dimension-size-600);\n border-bottom: var(--dimension-stroke-width-012) solid var(--_bar-nav-border);\n background-color: var(--_bar-nav-bg);\n color: var(--_bar-nav-fg-primary);\n -webkit-user-select: none;\n user-select: none;\n overflow: hidden;\n transition:\n background-color var(--effect-motion-short-3),\n border-color var(--effect-motion-short-3),\n color var(--effect-motion-short-3);\n isolation: isolate;\n /* Default chrome — app surfaces */\n --_bar-nav-bg: var(--color-background-secondary);\n --_bar-nav-border: var(--color-border-tertiary);\n --_bar-nav-fg-primary: var(--color-foreground-primary);\n --_bar-nav-fg-secondary: var(--color-foreground-secondary);\n --_bar-nav-hover: var(--color-interaction-hover);\n --_bar-nav-pressed: var(--color-interaction-pressed);\n --_bar-nav-focus: var(--color-interaction-focus);\n --_bar-nav-dot: var(--color-foreground-bold-brand);\n --ds-focus-ring-color: var(--_bar-nav-focus);\n}\n\n/* Style slots — same app tokens for now; hook texture/glyph layers later. */\n.bar-nav--dashboard,\n.bar-nav--settings {\n --_bar-nav-bg: var(--color-background-secondary);\n --_bar-nav-border: var(--color-border-tertiary);\n --_bar-nav-fg-primary: var(--color-foreground-primary);\n --_bar-nav-fg-secondary: var(--color-foreground-secondary);\n --_bar-nav-hover: var(--color-interaction-hover);\n --_bar-nav-pressed: var(--color-interaction-pressed);\n --_bar-nav-focus: var(--color-interaction-focus);\n --_bar-nav-dot: var(--color-foreground-bold-brand);\n}\n\n/* Shell-owned chrome (bg + wash) — bar is a transparent frame. */\n:host-context(ds-shell-app:not([gradient-preset='none'])) .bar-nav,\n:host-context(ds-shell-app.shell-app--paper-texture) .bar-nav {\n background-color: transparent;\n}\n\n.bar-nav > :not(.bar-nav__tabs-probe) {\n position: relative;\n z-index: 3;\n}\n\n/* Overflow — keep fitting tabs visible and pin the overflow trigger to the far edge. */\n.bar-nav--tabs-collapsed {\n display: flex;\n gap: var(--dimension-space-100);\n align-items: center;\n}\n\n/* Expanded tabs — consume full header width */\n.bar-nav__left {\n position: relative;\n flex: 1 1 0%;\n min-width: 0;\n width: 0;\n display: flex;\n align-items: center;\n}\n\n.bar-nav__tabs-visible {\n flex: 1;\n min-width: 0;\n width: 100%;\n}\n\n/* Unconstrained width so intrinsic tab row width is measurable while collapsed */\n.bar-nav__tabs-probe {\n position: absolute;\n left: 0;\n top: 0;\n visibility: hidden;\n pointer-events: none;\n overflow: visible;\n width: max-content;\n max-width: none;\n z-index: -1;\n}\n\n.bar-nav__tabs-probe > div {\n width: max-content;\n}\n\n.bar-nav__tab-list {\n display: flex;\n align-items: center;\n gap: var(--dimension-space-050);\n position: relative;\n width: max-content;\n}\n\n.bar-nav__tab {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--ds-control-gap);\n height: var(--ds-control-height);\n min-width: var(--ds-control-height);\n padding: 0 var(--ds-control-padding-inline);\n box-sizing: border-box;\n border: none;\n border-radius: var(--ds-control-radius);\n background-color: transparent;\n color: var(--_bar-nav-fg-secondary);\n cursor: default;\n position: relative;\n flex-shrink: 0;\n -webkit-user-select: none;\n user-select: none;\n transition: color var(--effect-motion-short-2);\n}\n\n.bar-nav__tab::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: var(--ds-control-radius);\n background: transparent;\n pointer-events: none;\n cursor: inherit;\n}\n\n@media (hover: hover) and (pointer: fine) {\n .bar-nav__tab:hover::after {\n background: var(--_bar-nav-hover);\n }\n}\n\n.bar-nav__tab:active::after {\n background: var(--_bar-nav-pressed);\n}\n\n.bar-nav__tab--selected {\n color: var(--_bar-nav-fg-primary);\n}\n\n.bar-nav__tab-label {\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n}\n\n.bar-nav__tab-divider {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--dimension-space-100);\n height: var(--ds-control-height);\n padding-block: var(--ds-control-padding-inline);\n flex-shrink: 0;\n pointer-events: none;\n}\n\n.bar-nav__tab-divider-line {\n width: var(--dimension-stroke-width-012);\n align-self: stretch;\n background-color: var(--_bar-nav-border);\n}\n\n/* In-flow placeholder while measuring overflow — avoids layout jump; hidden from view/accessibility. */\n.bar-nav__tabs-pending {\n flex: 1;\n min-width: 0;\n height: var(--ds-control-height);\n visibility: hidden;\n pointer-events: none;\n}\n\n/* Overflow trigger — compact icon button aligned to the right edge. */\n.bar-nav__overflow-trigger {\n margin-left: auto;\n --ds-button-unfilled-fg: var(--_bar-nav-fg-secondary);\n --ds-button-unfilled-fg-active: var(--_bar-nav-fg-primary);\n --ds-interaction-hover: var(--_bar-nav-hover);\n --ds-interaction-pressed: var(--_bar-nav-pressed);\n --ds-focus-ring-color: var(--_bar-nav-focus);\n}\n\n/* Fallback heading when no tabs — matches a single (selected) tab so the area\n name shares the tab label's type token, color, height and horizontal inset.\n Inset = tab button padding (space-075, 6px) + label inset (space-025, 2px).\n Color comes from ds-text color=\"primary\"; beat Text's inline-box display. */\nds-text.bar-nav__heading {\n display: inline-flex;\n align-items: center;\n height: var(--ds-control-height);\n padding-inline: calc(var(--ds-control-padding-inline) + var(--ds-control-label-inset));\n -webkit-user-select: none;\n user-select: none;\n}\n",
|
|
300
300
|
"type": "registry:ui"
|
|
301
301
|
},
|
|
302
302
|
{
|
|
@@ -637,7 +637,7 @@
|
|
|
637
637
|
},
|
|
638
638
|
{
|
|
639
639
|
"path": "src/wc/components/FilterMenu/FilterMenu.tsx",
|
|
640
|
-
"content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport {\n CONTROL_TEXT_VARIANT,\n controlWidthClass,\n resolveChoicePopupAlignOffset,\n resolveCssLengthPx,\n resolveMotionTimeMs,\n TOKEN_CSS_LENGTHS,\n TOKEN_DEFAULTS,\n type ControlWidth,\n} from '../../utils';\nimport type { AnchoredAlign, AnchoredSide } from '../../utils/anchored-position';\nimport { AnchoredPositionController } from '../../utils/anchored-position-controller';\nimport { ChoiceOptionRow } from '../../utils/choice-list-parts';\nimport { choiceListUsesSubtext } from '../../utils/choice-list';\n\nexport type FilterMenuFilterKind = 'single' | 'multiple' | 'boolean' | 'date';\nexport type FilterMenuSize = 'lg' | 'md' | 'sm' | 'xs';\nexport type FilterMenuWidth = ControlWidth;\n\nexport interface FilterMenuOption {\n label: string;\n value: string;\n description?: string;\n isInactive?: boolean;\n}\n\nexport interface FilterMenuFilter {\n id: string;\n label: string;\n kind: FilterMenuFilterKind;\n options?: FilterMenuOption[];\n description?: string;\n fieldLabel?: string;\n /** Draw a standard menu-section divider after this category. */\n divider?: boolean;\n}\n\nexport type FilterMenuValue = string[] | boolean | string;\nexport type FilterMenuValues = Record<string, FilterMenuValue | undefined>;\n\nexport interface FilterMenuChangeDetail {\n filterId: string;\n value: FilterMenuValue;\n}\n\nconst FILTER_MENU_FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\nlet filterMenuId = 0;\n\nconst ICON_SIZE: Record<FilterMenuSize, 'lg' | 'md' | 'sm' | 'xs'> = {\n lg: 'lg',\n md: 'md',\n sm: 'sm',\n xs: 'xs',\n};\n\n@Component({\n tag: 'ds-filter-menu',\n styleUrl: 'FilterMenu.css',\n scoped: true,\n})\nexport class FilterMenu {\n @Element() el!: HTMLElement;\n\n /** Controlled popup visibility. */\n @Prop({ mutable: true }) open: boolean = false;\n /** Select trigger text. The selected count is appended automatically. */\n @Prop() triggerLabel: string = 'Filters';\n /** Optional select trigger prefix icon name. */\n @Prop() icon: string | undefined = 'Filters';\n /** Select trigger density. */\n @Prop() size: FilterMenuSize = 'md';\n /** Select trigger width fit. */\n @Prop() width: FilterMenuWidth = 'hug';\n /** Show the surface-aware inset border around the select trigger. */\n @Prop() hasBorder: boolean = true;\n /** Show selected interaction fill when one or more criteria are active. */\n @Prop() activeFill: boolean = false;\n /** ID applied to the internal select trigger. */\n @Prop() inputId: string | undefined;\n /** Direct accessible name for the internal select trigger. */\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n /** Product-owned filter categories and option definitions. */\n @Prop() filters: FilterMenuFilter[] = [];\n /** Controlled values keyed by filter id. */\n @Prop() values: FilterMenuValues = {};\n /** Controlled category shown in the option pane. */\n @Prop() activeFilterId: string | undefined;\n /** External trigger element to position against. */\n @Prop() anchor: HTMLElement | undefined;\n /** ID of the external trigger element used for positioning and focus return. */\n @Prop() anchorId: string | undefined;\n /** Preferred popup side; collision handling may flip it. */\n @Prop() side: AnchoredSide = 'bottom';\n /** Cross-axis alignment against the trigger. */\n @Prop() align: AnchoredAlign = 'end';\n /** Gap between trigger and popup — number in px or a TokoMo length. */\n @Prop() sideOffset: number | string = TOKEN_CSS_LENGTHS.space050;\n /** Cross-axis offset — number in px or a TokoMo length. */\n @Prop() alignOffset: number | string = 0;\n /** Popup width. It remains clamped to the viewport by the component recipe. */\n @Prop() menuWidth: string = TOKEN_CSS_LENGTHS.menuWidthLg;\n /** Accessible name for the non-modal filter dialog. */\n @Prop() menuLabel: string = 'Filters';\n /** Accessible name for the category tab list. */\n @Prop() categoriesLabel: string = 'Filter categories';\n /** Footer action and date-clear accessible label. */\n @Prop() clearLabel: string = 'Clear';\n /** Show a visible focus ring on initial entry after keyboard activation. */\n @Prop() initialFocusVisible: boolean = false;\n\n @State() private shouldRender = false;\n @State() private closing = false;\n @State() private positionReady = false;\n @State() private pos: { x: number; y: number } = { x: 0, y: 0 };\n @State() private focusRingVisible = false;\n @State() private activeOptionIndex = 0;\n\n /** Requests a controlled value replacement without closing the popup. */\n @Event() dsChange!: EventEmitter<FilterMenuChangeDetail>;\n /** Requests that the consumer clear every filter value. */\n @Event() dsClear!: EventEmitter<void>;\n /** Requests a controlled active-category replacement. */\n @Event() dsActiveFilterChange!: EventEmitter<string>;\n /** Requests that the controlled popup close. */\n @Event() dsClose!: EventEmitter<void>;\n /** Emitted whenever internal select-trigger activation changes popup visibility. */\n @Event() dsOpenChange!: EventEmitter<boolean>;\n /** Emitted after exit motion and rendered popup removal complete. */\n @Event() dsAfterClose!: EventEmitter<void>;\n\n private readonly generatedId = `ds-filter-menu-${++filterMenuId}`;\n private outsideHandler: ((event: MouseEvent) => void) | null = null;\n private triggerElement: HTMLButtonElement | null = null;\n private pendingInitialFocusVisible = false;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private closingSnapshot: {\n filters: FilterMenuFilter[];\n values: FilterMenuValues;\n activeFilterId: string | undefined;\n } | null = null;\n\n private readonly position = new AnchoredPositionController({\n getAnchor: () => this.resolvedAnchor,\n getPopup: () => this.el.querySelector<HTMLElement>('.filter-menu-popup'),\n measure: (anchor, popup) => {\n if (!this.open) return null;\n const anchorRect = anchor.getBoundingClientRect();\n const sectionInsetPx = resolveCssLengthPx(\n TOKEN_DEFAULTS.space050,\n TOKEN_DEFAULTS.space050\n );\n return {\n anchorRect,\n popupWidth: popup.offsetWidth || this.popupFallbackWidth,\n popupHeight: popup.offsetHeight || this.popupFallbackHeight,\n side: this.side,\n align: this.align,\n sideOffsetPx: resolveCssLengthPx(this.sideOffset, TOKEN_DEFAULTS.space050),\n alignOffsetPx: resolveChoicePopupAlignOffset({\n align: this.align,\n alignOffsetPx: resolveCssLengthPx(this.alignOffset, 0),\n sectionInsetPx,\n }),\n viewportPadPx: this.viewportPad,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n };\n },\n apply: ({ x, y }) => {\n this.pos = { x, y };\n },\n onReady: () => {\n this.positionReady = true;\n },\n liveUpdate: 'double-frame',\n observeResize: true,\n topLayer: true,\n });\n\n componentDidLoad() {\n if (this.open) this.onOpenChange(true);\n }\n\n disconnectedCallback() {\n this.position.unobserve();\n this.teardownListeners();\n }\n\n @Watch('open')\n onOpenChange(isOpen: boolean) {\n if (isOpen) {\n this.teardownListeners();\n this.closingSnapshot = null;\n this.shouldRender = true;\n this.closing = false;\n this.positionReady = false;\n this.focusRingVisible = this.pendingInitialFocusVisible || this.initialFocusVisible;\n this.setupListeners();\n this.position.schedule(() => this.focusInitialCategory());\n return;\n }\n\n if (!this.shouldRender) return;\n this.position.cancel();\n this.captureClosingSnapshot();\n this.closing = true;\n this.teardownListeners();\n const duration = resolveMotionTimeMs(\n TOKEN_DEFAULTS.motionShort2,\n TOKEN_DEFAULTS.animationDurationShort3\n );\n if (duration <= 0) {\n this.finishClose();\n return;\n }\n this.closeTimer = setTimeout(() => this.finishClose(), duration);\n }\n\n @Watch('anchor')\n @Watch('anchorId')\n @Watch('side')\n @Watch('align')\n @Watch('sideOffset')\n @Watch('alignOffset')\n @Watch('menuWidth')\n onPositionInputChange() {\n if (this.open) this.position.schedule();\n }\n\n @Listen('keydown')\n handleKeyDown(event: KeyboardEvent) {\n if (!this.shouldRender || this.closing) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close();\n return;\n }\n if (event.key !== 'Tab' || !this.tabLeavesPopup(event)) return;\n event.preventDefault();\n this.close(false);\n this.moveFocusAfterTab(event.shiftKey);\n }\n\n private get resolvedAnchor(): HTMLElement | null {\n if (this.anchor) return this.anchor;\n if (this.anchorId) return document.getElementById(this.anchorId);\n return this.triggerElement;\n }\n\n private get usesInternalTrigger(): boolean {\n return !this.anchor && !this.anchorId;\n }\n\n private get anchorFocusTarget(): HTMLElement | null {\n const anchor = this.resolvedAnchor;\n if (!anchor) return null;\n if (anchor.matches(FILTER_MENU_FOCUSABLE_SELECTOR)) return anchor;\n return anchor.querySelector<HTMLElement>(FILTER_MENU_FOCUSABLE_SELECTOR) ?? anchor;\n }\n\n private get viewportPad(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n }\n\n private get popupFallbackWidth(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuWidthLg, TOKEN_DEFAULTS.menuWidthLg);\n }\n\n private get popupFallbackHeight(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuFallbackHeight, TOKEN_DEFAULTS.menuFallbackHeight);\n }\n\n private setupListeners() {\n this.outsideHandler = event => {\n const target = event.target as Node;\n const popup = this.el.querySelector('.filter-menu-popup');\n if (popup?.contains(target) || this.resolvedAnchor?.contains(target)) return;\n this.close();\n };\n document.addEventListener('mousedown', this.outsideHandler, true);\n this.position.observe();\n }\n\n private teardownListeners() {\n this.position.unobserve();\n if (this.outsideHandler) {\n document.removeEventListener('mousedown', this.outsideHandler, true);\n this.outsideHandler = null;\n }\n if (this.closeTimer) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private close(restoreFocus = true) {\n this.captureClosingSnapshot();\n if (restoreFocus) this.focusAnchor();\n this.dsOpenChange.emit(false);\n this.dsClose.emit();\n this.open = false;\n this.onOpenChange(false);\n }\n\n private toggleFromTrigger(event: MouseEvent) {\n if (this.open) {\n this.close();\n return;\n }\n this.pendingInitialFocusVisible = event.detail === 0;\n this.open = true;\n this.dsOpenChange.emit(true);\n this.onOpenChange(true);\n }\n\n private handleTriggerKeyDown(event: KeyboardEvent) {\n if (event.key !== 'ArrowDown' || this.open) return;\n event.preventDefault();\n this.pendingInitialFocusVisible = true;\n this.open = true;\n this.dsOpenChange.emit(true);\n this.onOpenChange(true);\n }\n\n private finishClose() {\n const popup = this.el.querySelector<HTMLElement>('.filter-menu-popup');\n if (popup?.matches(':popover-open')) popup.hidePopover();\n this.shouldRender = false;\n this.closing = false;\n this.closingSnapshot = null;\n this.closeTimer = null;\n this.dsAfterClose.emit();\n }\n\n private captureClosingSnapshot() {\n if (this.closingSnapshot) return;\n this.closingSnapshot = {\n filters: this.filters.map(filter => ({\n ...filter,\n options: filter.options?.map(option => ({ ...option })),\n })),\n values: Object.fromEntries(\n Object.entries(this.values).map(([key, value]) => [\n key,\n Array.isArray(value) ? [...value] : value,\n ])\n ),\n activeFilterId: this.activeFilterId,\n };\n }\n\n private focusAnchor() {\n const anchor = this.resolvedAnchor as\n (HTMLElement & { setFocus?: () => Promise<void> | void }) | null;\n if (anchor?.setFocus) {\n void anchor.setFocus();\n return;\n }\n this.anchorFocusTarget?.focus();\n }\n\n private focusInitialCategory() {\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>('.filter-menu__category[tabindex=\"0\"]')?.focus();\n this.pendingInitialFocusVisible = false;\n });\n }\n\n private tabLeavesPopup(event: KeyboardEvent): boolean {\n const popup = this.el.querySelector<HTMLElement>('.filter-menu-popup');\n if (!popup) return true;\n const focusables = Array.from(\n popup.querySelectorAll<HTMLElement>(FILTER_MENU_FOCUSABLE_SELECTOR)\n ).filter(element => element.getClientRects().length > 0);\n const index = focusables.indexOf(event.target as HTMLElement);\n if (index < 0) return true;\n return event.shiftKey ? index === 0 : index === focusables.length - 1;\n }\n\n private moveFocusAfterTab(backwards: boolean) {\n const anchor = this.anchorFocusTarget;\n if (!anchor) return;\n if (backwards) {\n anchor.focus();\n return;\n }\n const candidates = Array.from(\n document.querySelectorAll<HTMLElement>(FILTER_MENU_FOCUSABLE_SELECTOR)\n ).filter(\n element =>\n !element.closest('.filter-menu-popup') &&\n !element.closest('[inert]') &&\n element.getClientRects().length > 0\n );\n const index = candidates.indexOf(anchor);\n (candidates[index + 1] ?? anchor).focus();\n }\n\n private selectedFilter(filters: FilterMenuFilter[], activeFilterId: string | undefined) {\n return filters.find(filter => filter.id === activeFilterId) ?? filters[0];\n }\n\n private selectedCount(filter: FilterMenuFilter, values: FilterMenuValues): number {\n const value = values[filter.id];\n if (filter.kind === 'multiple') return Array.isArray(value) ? value.length : 0;\n if (filter.kind === 'boolean') return value === true ? 1 : 0;\n return typeof value === 'string' && value.length > 0 ? 1 : 0;\n }\n\n private totalSelected(filters: FilterMenuFilter[], values: FilterMenuValues): number {\n return filters.reduce((total, filter) => total + this.selectedCount(filter, values), 0);\n }\n\n private activeFilterCount(filters: FilterMenuFilter[], values: FilterMenuValues): number {\n return filters.filter(filter => this.selectedCount(filter, values) > 0).length;\n }\n\n private selectCategory(filterId: string, focus = false) {\n this.activeOptionIndex = 0;\n this.dsActiveFilterChange.emit(filterId);\n if (!focus) return;\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>(`[data-filter-category=\"${filterId}\"]`)?.focus();\n });\n }\n\n private handleCategoryKeyDown(\n event: KeyboardEvent,\n filters: FilterMenuFilter[],\n filterId: string\n ) {\n const currentIndex = filters.findIndex(filter => filter.id === filterId);\n let nextIndex: number;\n if (event.key === 'ArrowDown') nextIndex = (currentIndex + 1) % filters.length;\n else if (event.key === 'ArrowUp')\n nextIndex = (currentIndex - 1 + filters.length) % filters.length;\n else if (event.key === 'Home') nextIndex = 0;\n else if (event.key === 'End') nextIndex = filters.length - 1;\n else if (event.key === 'ArrowRight') {\n event.preventDefault();\n requestAnimationFrame(() => {\n this.el\n .querySelector<HTMLElement>(\n '.filter-menu__options [role=\"option\"], .filter-menu__options input'\n )\n ?.focus();\n });\n return;\n } else return;\n\n event.preventDefault();\n this.focusRingVisible = true;\n this.selectCategory(filters[nextIndex].id, true);\n }\n\n private handlePanelKeyDown(event: KeyboardEvent, filterId: string) {\n if (event.key !== 'ArrowLeft') return;\n event.preventDefault();\n this.el.querySelector<HTMLElement>(`[data-filter-category=\"${filterId}\"]`)?.focus();\n }\n\n private handleOptionKeyDown(\n event: KeyboardEvent,\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n index: number,\n values: FilterMenuValues\n ) {\n const options = filter.options ?? [];\n if (event.key === 'ArrowLeft') {\n this.handlePanelKeyDown(event, filter.id);\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.selectOption(filter, option, values);\n return;\n }\n if (!['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) return;\n event.preventDefault();\n const enabled = options\n .map((candidate, optionIndex) => ({ candidate, optionIndex }))\n .filter(({ candidate }) => !candidate.isInactive)\n .map(({ optionIndex }) => optionIndex);\n if (!enabled.length) return;\n const current = enabled.indexOf(index);\n let next: number;\n if (event.key === 'Home') next = enabled[0];\n else if (event.key === 'End') next = enabled[enabled.length - 1];\n else {\n const direction = event.key === 'ArrowDown' ? 1 : -1;\n const start = current >= 0 ? current : direction === 1 ? -1 : 0;\n next = enabled[(start + direction + enabled.length) % enabled.length];\n }\n this.activeOptionIndex = next;\n this.focusRingVisible = true;\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>(`#${this.generatedId}-${filter.id}-option-${next}`)?.focus();\n });\n }\n\n private toggleMultiple(\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n checked: boolean,\n values: FilterMenuValues\n ) {\n if (option.isInactive) return;\n const current = Array.isArray(values[filter.id]) ? (values[filter.id] as string[]) : [];\n const selected = new Set(current);\n if (checked) selected.add(option.value);\n else selected.delete(option.value);\n const ordered = (filter.options ?? [])\n .map(candidate => candidate.value)\n .filter(value => selected.has(value));\n this.dsChange.emit({ filterId: filter.id, value: ordered });\n }\n\n private selectOption(\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n values: FilterMenuValues\n ) {\n if (option.isInactive) return;\n if (filter.kind === 'single') {\n this.dsChange.emit({ filterId: filter.id, value: option.value });\n return;\n }\n const selected = Array.isArray(values[filter.id])\n ? (values[filter.id] as string[]).includes(option.value)\n : false;\n this.toggleMultiple(filter, option, !selected, values);\n }\n\n private renderOptions(filter: FilterMenuFilter, values: FilterMenuValues) {\n const value = values[filter.id];\n if (filter.kind === 'multiple' || filter.kind === 'single') {\n const selected = Array.isArray(value) ? value : [];\n const options = filter.options ?? [];\n const usesSubtext = choiceListUsesSubtext(\n options.map(option => ({\n label: option.label,\n value: option.value,\n subtext: option.description,\n }))\n );\n return options.map((option, index) => {\n const isSelected =\n filter.kind === 'multiple'\n ? selected.includes(option.value)\n : value === option.value;\n return (\n <ChoiceOptionRow\n size=\"md\"\n id={`${this.generatedId}-${filter.id}-option-${index}`}\n option={{\n label: option.label,\n value: option.value,\n subtext: option.description,\n isInactive: option.isInactive,\n }}\n selected={isSelected}\n active={index === this.activeOptionIndex}\n focusRingVisible={this.focusRingVisible}\n usesSubtext={usesSubtext}\n tabIndex={index === this.activeOptionIndex ? 0 : -1}\n leading={\n filter.kind === 'multiple' ? (\n <span\n class=\"ds-choice-item__icon ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-checkbox label=\"\" size=\"md\" checked={isSelected} presentation />\n </span>\n ) : undefined\n }\n onFocus={() => {\n this.activeOptionIndex = index;\n }}\n onKeyDown={(event: KeyboardEvent) =>\n this.handleOptionKeyDown(event, filter, option, index, values)\n }\n onHover={() => {\n this.focusRingVisible = false;\n this.activeOptionIndex = index;\n }}\n onSelect={() => this.selectOption(filter, option, values)}\n />\n );\n });\n }\n\n if (filter.kind === 'boolean') {\n const option: FilterMenuOption = {\n label: filter.fieldLabel ?? filter.label,\n value: 'true',\n description: filter.description,\n };\n return (\n <ChoiceOptionRow\n size=\"md\"\n id={`${this.generatedId}-${filter.id}-option-0`}\n option={{\n label: option.label,\n value: option.value,\n subtext: option.description,\n }}\n selected={value === true}\n active\n focusRingVisible={this.focusRingVisible}\n usesSubtext={Boolean(option.description)}\n tabIndex={0}\n leading={\n <span\n class=\"ds-choice-item__icon ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-checkbox label=\"\" size=\"md\" checked={value === true} presentation />\n </span>\n }\n onKeyDown={(event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') this.handlePanelKeyDown(event, filter.id);\n else if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.dsChange.emit({ filterId: filter.id, value: value !== true });\n }\n }}\n onHover={() => {\n this.focusRingVisible = false;\n }}\n onSelect={() => this.dsChange.emit({ filterId: filter.id, value: value !== true })}\n />\n );\n }\n\n const dateValue = typeof value === 'string' ? value : '';\n const inputId = `${this.generatedId}-${filter.id}-input`;\n return (\n <div class=\"filter-menu__date-field\">\n <label htmlFor={inputId}>\n <ds-text as=\"span\" variant=\"text-body-small\" emphasis color=\"primary\">\n {filter.fieldLabel ?? 'Event date'}\n </ds-text>\n </label>\n <div class=\"filter-menu__date-control ds-control-frame ds-control--md\">\n <input\n id={inputId}\n class=\"filter-menu__date-input\"\n type=\"date\"\n value={dateValue}\n onInput={(event: Event) =>\n this.dsChange.emit({\n filterId: filter.id,\n value: (event.target as HTMLInputElement).value,\n })\n }\n />\n {dateValue ? (\n <ds-button-unfilled\n variant=\"icon\"\n icon=\"CrossCircle\"\n size=\"sm\"\n isInset\n hasBorder={false}\n rounded\n ariaLabel={`${this.clearLabel} ${filter.fieldLabel ?? filter.label}`}\n onDsClick={(event: CustomEvent<MouseEvent>) => {\n event.stopPropagation();\n this.dsChange.emit({ filterId: filter.id, value: '' });\n }}\n />\n ) : null}\n </div>\n </div>\n );\n }\n\n render() {\n const state =\n this.closing && this.closingSnapshot\n ? this.closingSnapshot\n : {\n filters: this.filters,\n values: this.values,\n activeFilterId: this.activeFilterId,\n };\n const activeFilter = this.selectedFilter(state.filters, state.activeFilterId);\n const totalSelected = this.totalSelected(state.filters, state.values);\n const activeFilterCount = this.activeFilterCount(state.filters, state.values);\n const hasActiveFilters = activeFilterCount > 0;\n const label = `${this.triggerLabel}${hasActiveFilters ? ` · ${activeFilterCount}` : ''}`;\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const iconSize = ICON_SIZE[this.size];\n const popupId = `${this.generatedId}-popup`;\n const popupStyle: Record<string, string> = {\n position: 'fixed',\n left: '0',\n top: '0',\n width: this.menuWidth,\n transform: `translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,\n zIndex: '9998',\n visibility: this.positionReady ? 'visible' : 'hidden',\n };\n\n return (\n <Host\n class={{\n 'filter-menu-host': true,\n 'filter-menu-host--external-trigger': !this.usesInternalTrigger,\n 'ds-select-trigger-host': this.usesInternalTrigger,\n [`ds-control--${this.size}`]: true,\n ...controlWidthClass(this.width),\n }}\n >\n {this.usesInternalTrigger ? (\n <button\n ref={element => {\n this.triggerElement = (element as HTMLButtonElement) ?? null;\n }}\n id={this.inputId ?? `${this.generatedId}-trigger`}\n type=\"button\"\n class={{\n trigger: true,\n 'ds-control-frame': true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected': this.activeFill && hasActiveFilters,\n 'trigger--expanded': this.open || this.closing,\n 'trigger--bordered': this.hasBorder,\n 'trigger--has-value': hasActiveFilters,\n [`ds-control--${this.size}`]: true,\n }}\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-expanded={String(this.open)}\n aria-controls={this.open ? popupId : undefined}\n aria-label={this.ariaLabel ?? this.menuLabel}\n onClick={(event: MouseEvent) => this.toggleFromTrigger(event)}\n onKeyDown={(event: KeyboardEvent) => this.handleTriggerKeyDown(event)}\n >\n {this.icon ? (\n <span\n class=\"trigger__prefix ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-icon name={this.icon} size={iconSize} color=\"inherit\" />\n </span>\n ) : null}\n <ds-text\n class=\"trigger__label-box trigger__label trigger__label-content ds-control-label-box ds-interaction-fill__content\"\n as=\"span\"\n variant={textVariant}\n color=\"inherit\"\n lineTruncation={1}\n >\n {label}\n </ds-text>\n <span\n class=\"trigger__chevron ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-icon name=\"ChevronDown\" size={iconSize} color=\"inherit\" />\n </span>\n </button>\n ) : null}\n\n {this.shouldRender ? (\n <div\n id={popupId}\n popover=\"manual\"\n class={{\n 'filter-menu-popup': true,\n 'ds-choice-popup': true,\n 'ds-choice-popup--closing': this.closing,\n }}\n style={popupStyle}\n role=\"dialog\"\n aria-label={this.menuLabel}\n >\n {activeFilter ? (\n <div class=\"filter-menu\">\n <div class=\"filter-menu__body\">\n <div\n class=\"filter-menu__categories ds-choice-list ds-chrome-column ds-chrome-space--sm\"\n role=\"tablist\"\n aria-label={this.categoriesLabel}\n aria-orientation=\"vertical\"\n >\n {state.filters.map(filter => {\n const active = filter.id === activeFilter.id;\n const count = this.selectedCount(filter, state.values);\n return (\n <div\n key={filter.id}\n class={{\n 'filter-menu__category-section': true,\n 'ds-choice-section--divided': Boolean(filter.divider),\n }}\n >\n <button\n id={`${this.generatedId}-${filter.id}-tab`}\n type=\"button\"\n role=\"tab\"\n data-filter-category={filter.id}\n class={{\n 'filter-menu__category': true,\n 'filter-menu__category--active': active,\n 'ds-choice-item': true,\n 'ds-control-frame': true,\n 'ds-control--md': true,\n 'ds-focus-ring-inset': true,\n 'ds-focus-ring--visible': active && this.focusRingVisible,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected': active,\n }}\n aria-selected={String(active)}\n aria-controls={`${this.generatedId}-panel`}\n tabIndex={active ? 0 : -1}\n onMouseDown={() => {\n this.focusRingVisible = false;\n }}\n onClick={() => this.selectCategory(filter.id)}\n onKeyDown={(event: KeyboardEvent) =>\n this.handleCategoryKeyDown(event, state.filters, filter.id)\n }\n >\n <ds-text\n class=\"ds-choice-item__content ds-choice-item__label ds-control-label-box ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-medium\"\n color={active ? 'primary' : 'secondary'}\n >\n {filter.label}\n </ds-text>\n {count > 0 ? (\n <ds-tag\n class=\"ds-choice-item__tag ds-interaction-fill__content\"\n label={String(count)}\n size=\"sm\"\n intent=\"brand\"\n contrast=\"bold\"\n isInset\n rounded\n />\n ) : null}\n </button>\n </div>\n );\n })}\n </div>\n\n <div\n id={`${this.generatedId}-panel`}\n class=\"filter-menu__options\"\n role=\"tabpanel\"\n aria-labelledby={`${this.generatedId}-${activeFilter.id}-tab`}\n >\n <div\n key={activeFilter.id}\n class=\"filter-menu__option-list ds-choice-list ds-chrome-column ds-chrome-space--sm\"\n role=\"listbox\"\n aria-label={activeFilter.label}\n aria-multiselectable={\n activeFilter.kind === 'multiple' ? 'true' : undefined\n }\n >\n {this.renderOptions(activeFilter, state.values)}\n </div>\n </div>\n </div>\n\n {totalSelected > 0 ? (\n <div class=\"filter-menu__footer ds-choice-footer\">\n <div class=\"ds-choice-footer__content ds-control--md\">\n <ds-text\n class=\"ds-choice-footer__summary\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"secondary\"\n aria-live=\"polite\"\n >\n {totalSelected} selected\n </ds-text>\n <button\n class=\"filter-menu__clear ds-choice-footer__clear ds-text-action\"\n type=\"button\"\n onClick={() => this.dsClear.emit()}\n >\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"inherit\">\n {this.clearLabel}\n </ds-text>\n </button>\n </div>\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n ) : null}\n </Host>\n );\n }\n}\n",
|
|
640
|
+
"content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport {\n CONTROL_TEXT_VARIANT,\n controlWidthClass,\n resolveChoicePopupAlignOffset,\n resolveCssLengthPx,\n resolveMotionTimeMs,\n TOKEN_CSS_LENGTHS,\n TOKEN_DEFAULTS,\n type ControlWidth,\n} from '../../utils';\nimport type { AnchoredAlign, AnchoredSide } from '../../utils/anchored-position';\nimport { AnchoredPositionController } from '../../utils/anchored-position-controller';\nimport { ChoiceOptionRow } from '../../utils/choice-list-parts';\nimport { choiceListUsesSubtext } from '../../utils/choice-list';\n\nexport type FilterMenuFilterKind = 'single' | 'multiple' | 'boolean' | 'date';\nexport type FilterMenuSize = 'lg' | 'md' | 'sm' | 'xs';\nexport type FilterMenuWidth = ControlWidth;\n\nexport interface FilterMenuOption {\n label: string;\n value: string;\n description?: string;\n isInactive?: boolean;\n}\n\nexport interface FilterMenuFilter {\n id: string;\n label: string;\n kind: FilterMenuFilterKind;\n options?: FilterMenuOption[];\n description?: string;\n fieldLabel?: string;\n /** Draw a standard menu-section divider after this category. */\n divider?: boolean;\n}\n\nexport type FilterMenuValue = string[] | boolean | string;\nexport type FilterMenuValues = Record<string, FilterMenuValue | undefined>;\n\nexport interface FilterMenuChangeDetail {\n filterId: string;\n value: FilterMenuValue;\n}\n\nconst FILTER_MENU_FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\nlet filterMenuId = 0;\n\nconst ICON_SIZE: Record<FilterMenuSize, 'lg' | 'md' | 'sm' | 'xs'> = {\n lg: 'lg',\n md: 'md',\n sm: 'sm',\n xs: 'xs',\n};\n\n@Component({\n tag: 'ds-filter-menu',\n styleUrl: 'FilterMenu.css',\n scoped: true,\n})\nexport class FilterMenu {\n @Element() el!: HTMLElement;\n\n /** Controlled popup visibility. */\n @Prop({ mutable: true }) open: boolean = false;\n /** Select trigger text. The selected count is appended automatically. */\n @Prop() triggerLabel: string = 'Filters';\n /** Optional select trigger prefix icon name. */\n @Prop() icon: string | undefined = 'Filters';\n /** Select trigger density. */\n @Prop() size: FilterMenuSize = 'md';\n /** Select trigger width fit. */\n @Prop() width: FilterMenuWidth = 'hug';\n /** Show the surface-aware inset border around the select trigger. */\n @Prop() hasBorder: boolean = true;\n /** Show selected interaction fill when one or more criteria are active. */\n @Prop() activeFill: boolean = false;\n /** ID applied to the internal select trigger. */\n @Prop() inputId: string | undefined;\n /** Direct accessible name for the internal select trigger. */\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n /** Product-owned filter categories and option definitions. */\n @Prop() filters: FilterMenuFilter[] = [];\n /** Controlled values keyed by filter id. */\n @Prop() values: FilterMenuValues = {};\n /** Controlled category shown in the option pane. */\n @Prop() activeFilterId: string | undefined;\n /** External trigger element to position against. */\n @Prop() anchor: HTMLElement | undefined;\n /** ID of the external trigger element used for positioning and focus return. */\n @Prop() anchorId: string | undefined;\n /** Preferred popup side; collision handling may flip it. */\n @Prop() side: AnchoredSide = 'bottom';\n /** Cross-axis alignment against the trigger. */\n @Prop() align: AnchoredAlign = 'end';\n /** Gap between trigger and popup — number in px or a TokoMo length. */\n @Prop() sideOffset: number | string = TOKEN_CSS_LENGTHS.space050;\n /** Cross-axis offset — number in px or a TokoMo length. */\n @Prop() alignOffset: number | string = 0;\n /** Popup width. It remains clamped to the viewport by the component recipe. */\n @Prop() menuWidth: string = TOKEN_CSS_LENGTHS.menuWidthLg;\n /** Accessible name for the non-modal filter dialog. */\n @Prop() menuLabel: string = 'Filters';\n /** Accessible name for the category tab list. */\n @Prop() categoriesLabel: string = 'Filter categories';\n /** Footer action and date-clear accessible label. */\n @Prop() clearLabel: string = 'Clear';\n /** Show a visible focus ring on initial entry after keyboard activation. */\n @Prop() initialFocusVisible: boolean = false;\n\n @State() private shouldRender = false;\n @State() private closing = false;\n @State() private positionReady = false;\n @State() private pos: { x: number; y: number } = { x: 0, y: 0 };\n @State() private focusRingVisible = false;\n @State() private activeOptionIndex = 0;\n\n /** Requests a controlled value replacement without closing the popup. */\n @Event() dsChange!: EventEmitter<FilterMenuChangeDetail>;\n /** Requests that the consumer clear every filter value. */\n @Event() dsClear!: EventEmitter<void>;\n /** Requests a controlled active-category replacement. */\n @Event() dsActiveFilterChange!: EventEmitter<string>;\n /** Requests that the controlled popup close. */\n @Event() dsClose!: EventEmitter<void>;\n /** Emitted whenever internal select-trigger activation changes popup visibility. */\n @Event() dsOpenChange!: EventEmitter<boolean>;\n /** Emitted after exit motion and rendered popup removal complete. */\n @Event() dsAfterClose!: EventEmitter<void>;\n\n private readonly generatedId = `ds-filter-menu-${++filterMenuId}`;\n private outsideHandler: ((event: MouseEvent) => void) | null = null;\n private triggerElement: HTMLButtonElement | null = null;\n private pendingInitialFocusVisible = false;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private closingSnapshot: {\n filters: FilterMenuFilter[];\n values: FilterMenuValues;\n activeFilterId: string | undefined;\n } | null = null;\n\n private readonly position = new AnchoredPositionController({\n getAnchor: () => this.resolvedAnchor,\n getPopup: () => this.el.querySelector<HTMLElement>('.filter-menu-popup'),\n measure: (anchor, popup) => {\n if (!this.open) return null;\n const anchorRect = anchor.getBoundingClientRect();\n const sectionInsetPx = resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n return {\n anchorRect,\n popupWidth: popup.offsetWidth || this.popupFallbackWidth,\n popupHeight: popup.offsetHeight || this.popupFallbackHeight,\n side: this.side,\n align: this.align,\n sideOffsetPx: resolveCssLengthPx(this.sideOffset, TOKEN_DEFAULTS.space050),\n alignOffsetPx: resolveChoicePopupAlignOffset({\n align: this.align,\n alignOffsetPx: resolveCssLengthPx(this.alignOffset, 0),\n sectionInsetPx,\n }),\n viewportPadPx: this.viewportPad,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n };\n },\n apply: ({ x, y }) => {\n this.pos = { x, y };\n },\n onReady: () => {\n this.positionReady = true;\n },\n liveUpdate: 'double-frame',\n observeResize: true,\n topLayer: true,\n });\n\n componentDidLoad() {\n if (this.open) this.onOpenChange(true);\n }\n\n disconnectedCallback() {\n this.position.unobserve();\n this.teardownListeners();\n }\n\n @Watch('open')\n onOpenChange(isOpen: boolean) {\n if (isOpen) {\n this.teardownListeners();\n this.closingSnapshot = null;\n this.shouldRender = true;\n this.closing = false;\n this.positionReady = false;\n this.focusRingVisible = this.pendingInitialFocusVisible || this.initialFocusVisible;\n this.setupListeners();\n this.position.schedule(() => this.focusInitialCategory());\n return;\n }\n\n if (!this.shouldRender) return;\n this.position.cancel();\n this.captureClosingSnapshot();\n this.closing = true;\n this.teardownListeners();\n const duration = resolveMotionTimeMs(\n TOKEN_DEFAULTS.motionShort2,\n TOKEN_DEFAULTS.animationDurationShort3\n );\n if (duration <= 0) {\n this.finishClose();\n return;\n }\n this.closeTimer = setTimeout(() => this.finishClose(), duration);\n }\n\n @Watch('anchor')\n @Watch('anchorId')\n @Watch('side')\n @Watch('align')\n @Watch('sideOffset')\n @Watch('alignOffset')\n @Watch('menuWidth')\n onPositionInputChange() {\n if (this.open) this.position.schedule();\n }\n\n @Listen('keydown')\n handleKeyDown(event: KeyboardEvent) {\n if (!this.shouldRender || this.closing) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close();\n return;\n }\n if (event.key !== 'Tab' || !this.tabLeavesPopup(event)) return;\n event.preventDefault();\n this.close(false);\n this.moveFocusAfterTab(event.shiftKey);\n }\n\n private get resolvedAnchor(): HTMLElement | null {\n if (this.anchor) return this.anchor;\n if (this.anchorId) return document.getElementById(this.anchorId);\n return this.triggerElement;\n }\n\n private get usesInternalTrigger(): boolean {\n return !this.anchor && !this.anchorId;\n }\n\n private get anchorFocusTarget(): HTMLElement | null {\n const anchor = this.resolvedAnchor;\n if (!anchor) return null;\n if (anchor.matches(FILTER_MENU_FOCUSABLE_SELECTOR)) return anchor;\n return anchor.querySelector<HTMLElement>(FILTER_MENU_FOCUSABLE_SELECTOR) ?? anchor;\n }\n\n private get viewportPad(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n }\n\n private get popupFallbackWidth(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuWidthLg, TOKEN_DEFAULTS.menuWidthLg);\n }\n\n private get popupFallbackHeight(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuFallbackHeight, TOKEN_DEFAULTS.menuFallbackHeight);\n }\n\n private setupListeners() {\n this.outsideHandler = event => {\n const target = event.target as Node;\n const popup = this.el.querySelector('.filter-menu-popup');\n if (popup?.contains(target) || this.resolvedAnchor?.contains(target)) return;\n this.close();\n };\n document.addEventListener('mousedown', this.outsideHandler, true);\n this.position.observe();\n }\n\n private teardownListeners() {\n this.position.unobserve();\n if (this.outsideHandler) {\n document.removeEventListener('mousedown', this.outsideHandler, true);\n this.outsideHandler = null;\n }\n if (this.closeTimer) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private close(restoreFocus = true) {\n this.captureClosingSnapshot();\n if (restoreFocus) this.focusAnchor();\n this.dsOpenChange.emit(false);\n this.dsClose.emit();\n this.open = false;\n this.onOpenChange(false);\n }\n\n private toggleFromTrigger(event: MouseEvent) {\n if (this.open) {\n this.close();\n return;\n }\n this.pendingInitialFocusVisible = event.detail === 0;\n this.open = true;\n this.dsOpenChange.emit(true);\n this.onOpenChange(true);\n }\n\n private handleTriggerKeyDown(event: KeyboardEvent) {\n if (event.key !== 'ArrowDown' || this.open) return;\n event.preventDefault();\n this.pendingInitialFocusVisible = true;\n this.open = true;\n this.dsOpenChange.emit(true);\n this.onOpenChange(true);\n }\n\n private finishClose() {\n const popup = this.el.querySelector<HTMLElement>('.filter-menu-popup');\n if (popup?.matches(':popover-open')) popup.hidePopover();\n this.shouldRender = false;\n this.closing = false;\n this.closingSnapshot = null;\n this.closeTimer = null;\n this.dsAfterClose.emit();\n }\n\n private captureClosingSnapshot() {\n if (this.closingSnapshot) return;\n this.closingSnapshot = {\n filters: this.filters.map(filter => ({\n ...filter,\n options: filter.options?.map(option => ({ ...option })),\n })),\n values: Object.fromEntries(\n Object.entries(this.values).map(([key, value]) => [\n key,\n Array.isArray(value) ? [...value] : value,\n ])\n ),\n activeFilterId: this.activeFilterId,\n };\n }\n\n private focusAnchor() {\n const anchor = this.resolvedAnchor as\n (HTMLElement & { setFocus?: () => Promise<void> | void }) | null;\n if (anchor?.setFocus) {\n void anchor.setFocus();\n return;\n }\n this.anchorFocusTarget?.focus();\n }\n\n private focusInitialCategory() {\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>('.filter-menu__category[tabindex=\"0\"]')?.focus();\n this.pendingInitialFocusVisible = false;\n });\n }\n\n private tabLeavesPopup(event: KeyboardEvent): boolean {\n const popup = this.el.querySelector<HTMLElement>('.filter-menu-popup');\n if (!popup) return true;\n const focusables = Array.from(\n popup.querySelectorAll<HTMLElement>(FILTER_MENU_FOCUSABLE_SELECTOR)\n ).filter(element => element.getClientRects().length > 0);\n const index = focusables.indexOf(event.target as HTMLElement);\n if (index < 0) return true;\n return event.shiftKey ? index === 0 : index === focusables.length - 1;\n }\n\n private moveFocusAfterTab(backwards: boolean) {\n const anchor = this.anchorFocusTarget;\n if (!anchor) return;\n if (backwards) {\n anchor.focus();\n return;\n }\n const candidates = Array.from(\n document.querySelectorAll<HTMLElement>(FILTER_MENU_FOCUSABLE_SELECTOR)\n ).filter(\n element =>\n !element.closest('.filter-menu-popup') &&\n !element.closest('[inert]') &&\n element.getClientRects().length > 0\n );\n const index = candidates.indexOf(anchor);\n (candidates[index + 1] ?? anchor).focus();\n }\n\n private selectedFilter(filters: FilterMenuFilter[], activeFilterId: string | undefined) {\n return filters.find(filter => filter.id === activeFilterId) ?? filters[0];\n }\n\n private selectedCount(filter: FilterMenuFilter, values: FilterMenuValues): number {\n const value = values[filter.id];\n if (filter.kind === 'multiple') return Array.isArray(value) ? value.length : 0;\n if (filter.kind === 'boolean') return value === true ? 1 : 0;\n return typeof value === 'string' && value.length > 0 ? 1 : 0;\n }\n\n private totalSelected(filters: FilterMenuFilter[], values: FilterMenuValues): number {\n return filters.reduce((total, filter) => total + this.selectedCount(filter, values), 0);\n }\n\n private activeFilterCount(filters: FilterMenuFilter[], values: FilterMenuValues): number {\n return filters.filter(filter => this.selectedCount(filter, values) > 0).length;\n }\n\n private selectCategory(filterId: string, focus = false) {\n this.activeOptionIndex = 0;\n this.dsActiveFilterChange.emit(filterId);\n if (!focus) return;\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>(`[data-filter-category=\"${filterId}\"]`)?.focus();\n });\n }\n\n private handleCategoryKeyDown(\n event: KeyboardEvent,\n filters: FilterMenuFilter[],\n filterId: string\n ) {\n const currentIndex = filters.findIndex(filter => filter.id === filterId);\n let nextIndex: number;\n if (event.key === 'ArrowDown') nextIndex = (currentIndex + 1) % filters.length;\n else if (event.key === 'ArrowUp')\n nextIndex = (currentIndex - 1 + filters.length) % filters.length;\n else if (event.key === 'Home') nextIndex = 0;\n else if (event.key === 'End') nextIndex = filters.length - 1;\n else if (event.key === 'ArrowRight') {\n event.preventDefault();\n requestAnimationFrame(() => {\n this.el\n .querySelector<HTMLElement>(\n '.filter-menu__options [role=\"option\"], .filter-menu__options input'\n )\n ?.focus();\n });\n return;\n } else return;\n\n event.preventDefault();\n this.focusRingVisible = true;\n this.selectCategory(filters[nextIndex].id, true);\n }\n\n private handlePanelKeyDown(event: KeyboardEvent, filterId: string) {\n if (event.key !== 'ArrowLeft') return;\n event.preventDefault();\n this.el.querySelector<HTMLElement>(`[data-filter-category=\"${filterId}\"]`)?.focus();\n }\n\n private handleOptionKeyDown(\n event: KeyboardEvent,\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n index: number,\n values: FilterMenuValues\n ) {\n const options = filter.options ?? [];\n if (event.key === 'ArrowLeft') {\n this.handlePanelKeyDown(event, filter.id);\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.selectOption(filter, option, values);\n return;\n }\n if (!['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) return;\n event.preventDefault();\n const enabled = options\n .map((candidate, optionIndex) => ({ candidate, optionIndex }))\n .filter(({ candidate }) => !candidate.isInactive)\n .map(({ optionIndex }) => optionIndex);\n if (!enabled.length) return;\n const current = enabled.indexOf(index);\n let next: number;\n if (event.key === 'Home') next = enabled[0];\n else if (event.key === 'End') next = enabled[enabled.length - 1];\n else {\n const direction = event.key === 'ArrowDown' ? 1 : -1;\n const start = current >= 0 ? current : direction === 1 ? -1 : 0;\n next = enabled[(start + direction + enabled.length) % enabled.length];\n }\n this.activeOptionIndex = next;\n this.focusRingVisible = true;\n requestAnimationFrame(() => {\n this.el\n .querySelector<HTMLElement>(`#${this.generatedId}-${filter.id}-option-${next}`)\n ?.focus();\n });\n }\n\n private toggleMultiple(\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n checked: boolean,\n values: FilterMenuValues\n ) {\n if (option.isInactive) return;\n const current = Array.isArray(values[filter.id]) ? (values[filter.id] as string[]) : [];\n const selected = new Set(current);\n if (checked) selected.add(option.value);\n else selected.delete(option.value);\n const ordered = (filter.options ?? [])\n .map(candidate => candidate.value)\n .filter(value => selected.has(value));\n this.dsChange.emit({ filterId: filter.id, value: ordered });\n }\n\n private selectOption(\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n values: FilterMenuValues\n ) {\n if (option.isInactive) return;\n if (filter.kind === 'single') {\n this.dsChange.emit({ filterId: filter.id, value: option.value });\n return;\n }\n const selected = Array.isArray(values[filter.id])\n ? (values[filter.id] as string[]).includes(option.value)\n : false;\n this.toggleMultiple(filter, option, !selected, values);\n }\n\n private renderOptions(filter: FilterMenuFilter, values: FilterMenuValues) {\n const value = values[filter.id];\n if (filter.kind === 'multiple' || filter.kind === 'single') {\n const selected = Array.isArray(value) ? value : [];\n const options = filter.options ?? [];\n const usesSubtext = choiceListUsesSubtext(\n options.map(option => ({\n label: option.label,\n value: option.value,\n subtext: option.description,\n }))\n );\n return options.map((option, index) => {\n const isSelected =\n filter.kind === 'multiple' ? selected.includes(option.value) : value === option.value;\n return (\n <ChoiceOptionRow\n size=\"md\"\n id={`${this.generatedId}-${filter.id}-option-${index}`}\n option={{\n label: option.label,\n value: option.value,\n subtext: option.description,\n isInactive: option.isInactive,\n }}\n selected={isSelected}\n active={index === this.activeOptionIndex}\n focusRingVisible={this.focusRingVisible}\n usesSubtext={usesSubtext}\n tabIndex={index === this.activeOptionIndex ? 0 : -1}\n leading={\n filter.kind === 'multiple' ? (\n <span\n class=\"ds-choice-item__icon ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-checkbox label=\"\" size=\"md\" checked={isSelected} presentation />\n </span>\n ) : undefined\n }\n onFocus={() => {\n this.activeOptionIndex = index;\n }}\n onKeyDown={(event: KeyboardEvent) =>\n this.handleOptionKeyDown(event, filter, option, index, values)\n }\n onHover={() => {\n this.focusRingVisible = false;\n this.activeOptionIndex = index;\n }}\n onSelect={() => this.selectOption(filter, option, values)}\n />\n );\n });\n }\n\n if (filter.kind === 'boolean') {\n const option: FilterMenuOption = {\n label: filter.fieldLabel ?? filter.label,\n value: 'true',\n description: filter.description,\n };\n return (\n <ChoiceOptionRow\n size=\"md\"\n id={`${this.generatedId}-${filter.id}-option-0`}\n option={{\n label: option.label,\n value: option.value,\n subtext: option.description,\n }}\n selected={value === true}\n active\n focusRingVisible={this.focusRingVisible}\n usesSubtext={Boolean(option.description)}\n tabIndex={0}\n leading={\n <span\n class=\"ds-choice-item__icon ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-checkbox label=\"\" size=\"md\" checked={value === true} presentation />\n </span>\n }\n onKeyDown={(event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') this.handlePanelKeyDown(event, filter.id);\n else if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.dsChange.emit({ filterId: filter.id, value: value !== true });\n }\n }}\n onHover={() => {\n this.focusRingVisible = false;\n }}\n onSelect={() => this.dsChange.emit({ filterId: filter.id, value: value !== true })}\n />\n );\n }\n\n const dateValue = typeof value === 'string' ? value : '';\n const inputId = `${this.generatedId}-${filter.id}-input`;\n return (\n <div class=\"filter-menu__date-field\">\n <label htmlFor={inputId}>\n <ds-text as=\"span\" variant=\"text-body-small\" emphasis color=\"primary\">\n {filter.fieldLabel ?? 'Event date'}\n </ds-text>\n </label>\n <div class=\"filter-menu__date-control ds-control-frame ds-control--md\">\n <input\n id={inputId}\n class=\"filter-menu__date-input\"\n type=\"date\"\n value={dateValue}\n onInput={(event: Event) =>\n this.dsChange.emit({\n filterId: filter.id,\n value: (event.target as HTMLInputElement).value,\n })\n }\n />\n {dateValue ? (\n <ds-button-unfilled\n variant=\"icon\"\n icon=\"CrossCircle\"\n size=\"sm\"\n isInset\n hasBorder={false}\n rounded\n ariaLabel={`${this.clearLabel} ${filter.fieldLabel ?? filter.label}`}\n onDsClick={(event: CustomEvent<MouseEvent>) => {\n event.stopPropagation();\n this.dsChange.emit({ filterId: filter.id, value: '' });\n }}\n />\n ) : null}\n </div>\n </div>\n );\n }\n\n render() {\n const state =\n this.closing && this.closingSnapshot\n ? this.closingSnapshot\n : {\n filters: this.filters,\n values: this.values,\n activeFilterId: this.activeFilterId,\n };\n const activeFilter = this.selectedFilter(state.filters, state.activeFilterId);\n const totalSelected = this.totalSelected(state.filters, state.values);\n const activeFilterCount = this.activeFilterCount(state.filters, state.values);\n const hasActiveFilters = activeFilterCount > 0;\n const label = `${this.triggerLabel}${hasActiveFilters ? ` · ${activeFilterCount}` : ''}`;\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const iconSize = ICON_SIZE[this.size];\n const popupId = `${this.generatedId}-popup`;\n const popupStyle: Record<string, string> = {\n position: 'fixed',\n left: '0',\n top: '0',\n width: this.menuWidth,\n transform: `translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,\n zIndex: '9998',\n visibility: this.positionReady ? 'visible' : 'hidden',\n };\n\n return (\n <Host\n class={{\n 'filter-menu-host': true,\n 'filter-menu-host--external-trigger': !this.usesInternalTrigger,\n 'ds-select-trigger-host': this.usesInternalTrigger,\n [`ds-control--${this.size}`]: true,\n ...controlWidthClass(this.width),\n }}\n >\n {this.usesInternalTrigger ? (\n <button\n ref={element => {\n this.triggerElement = (element as HTMLButtonElement) ?? null;\n }}\n id={this.inputId ?? `${this.generatedId}-trigger`}\n type=\"button\"\n class={{\n trigger: true,\n 'ds-control-frame': true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected': this.activeFill && hasActiveFilters,\n 'trigger--expanded': this.open || this.closing,\n 'trigger--bordered': this.hasBorder,\n 'trigger--has-value': hasActiveFilters,\n [`ds-control--${this.size}`]: true,\n }}\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-expanded={String(this.open)}\n aria-controls={this.open ? popupId : undefined}\n aria-label={this.ariaLabel ?? this.menuLabel}\n onClick={(event: MouseEvent) => this.toggleFromTrigger(event)}\n onKeyDown={(event: KeyboardEvent) => this.handleTriggerKeyDown(event)}\n >\n {this.icon ? (\n <span\n class=\"trigger__prefix ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-icon name={this.icon} size={iconSize} color=\"inherit\" />\n </span>\n ) : null}\n <ds-text\n class=\"trigger__label-box trigger__label trigger__label-content ds-control-label-box ds-interaction-fill__content\"\n as=\"span\"\n variant={textVariant}\n color=\"inherit\"\n lineTruncation={1}\n >\n {label}\n </ds-text>\n <span\n class=\"trigger__chevron ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-icon name=\"ChevronDown\" size={iconSize} color=\"inherit\" />\n </span>\n </button>\n ) : null}\n\n {this.shouldRender ? (\n <div\n id={popupId}\n popover=\"manual\"\n class={{\n 'filter-menu-popup': true,\n 'ds-choice-popup': true,\n 'ds-choice-popup--closing': this.closing,\n }}\n style={popupStyle}\n role=\"dialog\"\n aria-label={this.menuLabel}\n >\n {activeFilter ? (\n <div class=\"filter-menu\">\n <div class=\"filter-menu__body\">\n <div\n class=\"filter-menu__categories ds-choice-list ds-chrome-column ds-chrome-space--sm\"\n role=\"tablist\"\n aria-label={this.categoriesLabel}\n aria-orientation=\"vertical\"\n >\n {state.filters.map(filter => {\n const active = filter.id === activeFilter.id;\n const count = this.selectedCount(filter, state.values);\n return (\n <div\n key={filter.id}\n class={{\n 'filter-menu__category-section': true,\n 'ds-choice-section--divided': Boolean(filter.divider),\n }}\n >\n <button\n id={`${this.generatedId}-${filter.id}-tab`}\n type=\"button\"\n role=\"tab\"\n data-filter-category={filter.id}\n class={{\n 'filter-menu__category': true,\n 'filter-menu__category--active': active,\n 'ds-choice-item': true,\n 'ds-control-frame': true,\n 'ds-control--md': true,\n 'ds-focus-ring-inset': true,\n 'ds-focus-ring--visible': active && this.focusRingVisible,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected': active,\n }}\n aria-selected={String(active)}\n aria-controls={`${this.generatedId}-panel`}\n tabIndex={active ? 0 : -1}\n onMouseDown={() => {\n this.focusRingVisible = false;\n }}\n onClick={() => this.selectCategory(filter.id)}\n onKeyDown={(event: KeyboardEvent) =>\n this.handleCategoryKeyDown(event, state.filters, filter.id)\n }\n >\n <ds-text\n class=\"ds-choice-item__content ds-choice-item__label ds-control-label-box ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-medium\"\n color={active ? 'primary' : 'secondary'}\n >\n {filter.label}\n </ds-text>\n {count > 0 ? (\n <ds-tag\n class=\"ds-choice-item__tag ds-interaction-fill__content\"\n label={String(count)}\n size=\"sm\"\n intent=\"brand\"\n contrast=\"bold\"\n isInset\n rounded\n />\n ) : null}\n </button>\n </div>\n );\n })}\n </div>\n\n <div\n id={`${this.generatedId}-panel`}\n class=\"filter-menu__options\"\n role=\"tabpanel\"\n aria-labelledby={`${this.generatedId}-${activeFilter.id}-tab`}\n >\n <div\n key={activeFilter.id}\n class=\"filter-menu__option-list ds-choice-list ds-chrome-column ds-chrome-space--sm\"\n role=\"listbox\"\n aria-label={activeFilter.label}\n aria-multiselectable={activeFilter.kind === 'multiple' ? 'true' : undefined}\n >\n {this.renderOptions(activeFilter, state.values)}\n </div>\n </div>\n </div>\n\n {totalSelected > 0 ? (\n <div class=\"filter-menu__footer ds-choice-footer\">\n <div class=\"ds-choice-footer__content ds-control--md\">\n <ds-text\n class=\"ds-choice-footer__summary\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"secondary\"\n aria-live=\"polite\"\n >\n {totalSelected} selected\n </ds-text>\n <button\n class=\"filter-menu__clear ds-choice-footer__clear ds-text-action\"\n type=\"button\"\n onClick={() => this.dsClear.emit()}\n >\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"inherit\">\n {this.clearLabel}\n </ds-text>\n </button>\n </div>\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n ) : null}\n </Host>\n );\n }\n}\n",
|
|
641
641
|
"type": "registry:ui"
|
|
642
642
|
}
|
|
643
643
|
]
|