@ds-mo/ui 14.28.0 → 14.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +27 -17
- package/dist/agent.json +149 -25
- package/dist/angular/ds-button-filled.d.ts +1 -1
- package/dist/angular/ds-button-filled.js +3 -3
- package/dist/angular/ds-button-unfilled.d.ts +1 -1
- package/dist/angular/ds-button-unfilled.js +3 -3
- package/dist/angular/ds-panel-nav.d.ts +1 -1
- package/dist/angular/ds-panel-nav.js +3 -3
- package/dist/angular/ds-panel-tool-header.d.ts +1 -1
- package/dist/angular/ds-panel-tool-header.js +3 -3
- package/dist/angular/ds-panel-tool-search.d.ts +1 -1
- package/dist/angular/ds-panel-tool-search.js +3 -3
- package/dist/angular/ds-table.d.ts +1 -1
- package/dist/angular/ds-table.js +3 -3
- package/dist/angular/ds-tag.d.ts +1 -1
- package/dist/angular/ds-tag.js +3 -3
- package/dist/components/ds-agent-questionnaire.js +1 -1
- package/dist/components/ds-agent-response.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-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-navigation.js +1 -1
- package/dist/components/ds-card-navigation.js.map +1 -1
- package/dist/components/ds-card-overview.js +1 -1
- package/dist/components/ds-card-overview.js.map +1 -1
- package/dist/components/ds-card-setting.js +1 -1
- package/dist/components/ds-chart-legend.js +1 -1
- package/dist/components/ds-chart-legend.js.map +1 -1
- package/dist/components/ds-checkbox.js +1 -1
- package/dist/components/ds-chip.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-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-sub-nav.js +1 -1
- package/dist/components/ds-panel-sub-nav.js.map +1 -1
- package/dist/components/ds-panel-tool-header.js +1 -1
- package/dist/components/ds-panel-tool-search.js +1 -1
- package/dist/components/ds-panel-tool-search.js.map +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-radio.js +1 -1
- 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-tab-group.js +1 -1
- package/dist/components/ds-table-filter.js +1 -1
- package/dist/components/ds-table-group.js +1 -1
- package/dist/components/ds-table-group.js.map +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-search.js +1 -1
- package/dist/components/ds-table-search.js.map +1 -1
- package/dist/components/ds-table-sort.js +1 -1
- package/dist/components/ds-table-sort.js.map +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-table.js.map +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-textarea.js +1 -1
- package/dist/components/ds-textarea.js.map +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/p--yvQzZoO.js +2 -0
- package/dist/components/p--yvQzZoO.js.map +1 -0
- package/dist/components/p-B5AZd41L.js +2 -0
- package/dist/components/p-B5AZd41L.js.map +1 -0
- package/dist/components/p-B5eMVBlz.js +2 -0
- package/dist/components/p-B5eMVBlz.js.map +1 -0
- package/dist/components/p-BGnRFtBa.js +2 -0
- package/dist/components/p-BGnRFtBa.js.map +1 -0
- package/dist/components/p-BIDGQ4tc.js +2 -0
- package/dist/components/p-BIDGQ4tc.js.map +1 -0
- package/dist/components/p-BZDQLjE0.js +2 -0
- package/dist/components/p-BZDQLjE0.js.map +1 -0
- package/dist/components/{p-DmYZLH_L.js → p-BdC7wxhu.js} +2 -2
- package/dist/components/{p-DmYZLH_L.js.map → p-BdC7wxhu.js.map} +1 -1
- package/dist/components/p-BfVlFinS.js +2 -0
- package/dist/components/{p-WM1GTEun.js.map → p-BfVlFinS.js.map} +1 -1
- package/dist/components/p-BmRHJ_jo.js +2 -0
- package/dist/components/p-BmRHJ_jo.js.map +1 -0
- package/dist/components/{p-CxbGZJBU.js → p-BwAWZAHk.js} +2 -2
- package/dist/components/{p-8atLxerP.js → p-By5TDnbF.js} +2 -2
- package/dist/components/{p-BdXUd-tK.js → p-CDXcINTO.js} +2 -2
- package/dist/components/{p-BdXUd-tK.js.map → p-CDXcINTO.js.map} +1 -1
- package/dist/components/{p-DGHeKNfG.js → p-CE8gsv7V.js} +2 -2
- package/dist/components/p-CLcwh1kq.js +2 -0
- package/dist/components/p-CLcwh1kq.js.map +1 -0
- package/dist/components/p-CcK3UiTu.js +2 -0
- package/dist/components/{p-NB-SoVpo.js.map → p-CcK3UiTu.js.map} +1 -1
- package/dist/components/p-Cr5vn5JO.js +2 -0
- package/dist/components/{p-CsW_2w-s.js.map → p-Cr5vn5JO.js.map} +1 -1
- package/dist/components/{p-CW7JhWlS.js → p-Crd3PEUx.js} +2 -2
- package/dist/components/{p-CW7JhWlS.js.map → p-Crd3PEUx.js.map} +1 -1
- package/dist/components/{p-Kp8ifB1g.js → p-Ct90k-nz.js} +2 -2
- package/dist/components/{p-C82vesh_.js → p-Cx2dWjaW.js} +2 -2
- package/dist/components/p-CyoLh8su.js +2 -0
- package/dist/components/p-CyoLh8su.js.map +1 -0
- package/dist/components/p-CysCSinT.js +2 -0
- package/dist/components/{p-BdU6FPu4.js.map → p-CysCSinT.js.map} +1 -1
- package/dist/components/p-CzbsTZt7.js.map +1 -1
- package/dist/components/p-D1pPq-y0.js +2 -0
- package/dist/components/{p-BWDbER5T.js.map → p-D1pPq-y0.js.map} +1 -1
- package/dist/components/{p-B3iy9Rl_.js → p-DF8W85Tz.js} +2 -2
- package/dist/components/p-DZBB8BVn.js +2 -0
- package/dist/components/p-DZBB8BVn.js.map +1 -0
- package/dist/components/p-GbtafFds.js +2 -0
- package/dist/components/p-GbtafFds.js.map +1 -0
- package/dist/components/{p-B_NN7k8H.js → p-K39w53Bw.js} +2 -2
- package/dist/components/p-K39w53Bw.js.map +1 -0
- package/dist/components/p-frKsmPQn.js +2 -0
- package/dist/components/{p-CvB76TJn.js.map → p-frKsmPQn.js.map} +1 -1
- package/dist/docs/components.json +188 -6
- package/dist/lib/components/ButtonFilled/ButtonFilled.d.ts +11 -3
- package/dist/lib/components/PanelTools/panel-tools-types.d.ts +2 -0
- package/dist/lib/components/ShellApp/shell-app-types.d.ts +2 -0
- package/dist/lib/shell/index.js.map +1 -1
- package/dist/lib/utils/choice-list.d.ts +2 -0
- package/dist/mcp-data/registry/bar-nav.json +7 -2
- package/dist/mcp-data/registry/bar-title.json +8 -3
- package/dist/mcp-data/registry/button-filled.json +26 -5
- package/dist/mcp-data/registry/button-unfilled.json +27 -6
- package/dist/mcp-data/registry/filter-menu.json +7 -2
- package/dist/mcp-data/registry/mobile-section-switcher.json +8 -3
- package/dist/mcp-data/registry/panel-nav.json +27 -6
- package/dist/mcp-data/registry/panel-tool-header.json +23 -2
- package/dist/mcp-data/registry/panel-tool-search.json +23 -2
- package/dist/mcp-data/registry/panel-tools.json +7 -2
- package/dist/mcp-data/registry/registry.json +148 -24
- package/dist/mcp-data/registry/select.json +8 -3
- package/dist/mcp-data/registry/shell-app.json +8 -3
- package/dist/mcp-data/registry/shell-page.json +2 -1
- package/dist/mcp-data/registry/shell-tools.json +7 -2
- package/dist/mcp-data/registry/table-group.json +7 -2
- package/dist/mcp-data/registry/table-saved-views.json +7 -2
- package/dist/mcp-data/registry/table-search.json +7 -2
- package/dist/mcp-data/registry/table-sort.json +7 -2
- package/dist/mcp-data/registry/table.json +24 -3
- package/dist/mcp-data/registry/tag.json +24 -3
- package/dist/styles/table.css +1 -0
- package/dist/types/components/BarTitle/BarTitle.d.ts +3 -0
- package/dist/types/components/ButtonFilled/ButtonFilled.d.ts +11 -3
- package/dist/types/components/ButtonUnfilled/ButtonUnfilled.d.ts +11 -5
- package/dist/types/components/MobileSectionSwitcher/MobileSectionSwitcher.d.ts +2 -0
- package/dist/types/components/PanelNav/PanelNav.d.ts +4 -1
- package/dist/types/components/PanelToolHeader/PanelToolHeader.d.ts +2 -0
- package/dist/types/components/PanelToolSearch/PanelToolSearch.d.ts +2 -0
- package/dist/types/components/PanelTools/panel-tools-types.d.ts +2 -0
- package/dist/types/components/ShellApp/ShellApp.d.ts +1 -0
- package/dist/types/components/ShellApp/shell-app-types.d.ts +2 -0
- package/dist/types/components/Table/Table.d.ts +10 -0
- package/dist/types/components/Table/table-row-view.d.ts +6 -1
- package/dist/types/components/TableSort/TableSort.d.ts +1 -0
- package/dist/types/components/Tag/Tag.d.ts +3 -0
- package/dist/types/components.d.ts +69 -6
- package/dist/types/utils/choice-list.d.ts +2 -0
- package/dist/vue/ds-button-filled.js +1 -0
- package/dist/vue/ds-button-unfilled.js +1 -0
- package/dist/vue/ds-panel-nav.js +1 -0
- package/dist/vue/ds-panel-tool-header.js +1 -0
- package/dist/vue/ds-panel-tool-search.js +1 -0
- package/dist/vue/ds-table.js +1 -0
- package/dist/vue/ds-tag.js +1 -0
- package/package.json +1 -1
- package/dist/components/p-6iF6gdoc.js +0 -2
- package/dist/components/p-6iF6gdoc.js.map +0 -1
- package/dist/components/p-BWDbER5T.js +0 -2
- package/dist/components/p-B_NN7k8H.js.map +0 -1
- package/dist/components/p-BdU6FPu4.js +0 -2
- package/dist/components/p-Bj018KMC.js +0 -2
- package/dist/components/p-Bj018KMC.js.map +0 -1
- package/dist/components/p-BxLF8b8a.js +0 -2
- package/dist/components/p-BxLF8b8a.js.map +0 -1
- package/dist/components/p-C1BJgnHY.js +0 -2
- package/dist/components/p-C1BJgnHY.js.map +0 -1
- package/dist/components/p-C78uTz-n.js +0 -2
- package/dist/components/p-C78uTz-n.js.map +0 -1
- package/dist/components/p-COn7l__5.js +0 -2
- package/dist/components/p-COn7l__5.js.map +0 -1
- package/dist/components/p-CsW_2w-s.js +0 -2
- package/dist/components/p-CvB76TJn.js +0 -2
- package/dist/components/p-D4-RkuER.js +0 -2
- package/dist/components/p-D4-RkuER.js.map +0 -1
- package/dist/components/p-DB_tlJ2d.js +0 -2
- package/dist/components/p-DB_tlJ2d.js.map +0 -1
- package/dist/components/p-Hzz2j1Je.js +0 -2
- package/dist/components/p-Hzz2j1Je.js.map +0 -1
- package/dist/components/p-NB-SoVpo.js +0 -2
- package/dist/components/p-P9My22Z1.js +0 -2
- package/dist/components/p-P9My22Z1.js.map +0 -1
- package/dist/components/p-WM1GTEun.js +0 -2
- package/dist/components/p-oAbq-DLk.js +0 -2
- package/dist/components/p-oAbq-DLk.js.map +0 -1
- /package/dist/components/{p-CxbGZJBU.js.map → p-BwAWZAHk.js.map} +0 -0
- /package/dist/components/{p-8atLxerP.js.map → p-By5TDnbF.js.map} +0 -0
- /package/dist/components/{p-DGHeKNfG.js.map → p-CE8gsv7V.js.map} +0 -0
- /package/dist/components/{p-Kp8ifB1g.js.map → p-Ct90k-nz.js.map} +0 -0
- /package/dist/components/{p-C82vesh_.js.map → p-Cx2dWjaW.js.map} +0 -0
- /package/dist/components/{p-B3iy9Rl_.js.map → p-DF8W85Tz.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as o,d as s}from"./p-
|
|
1
|
+
import{T as o,d as s}from"./p-BGnRFtBa.js";const t=o;const a=s;export{t as DsTag,a as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-tag.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as r,h as s,a,t as i}from"./index.js";import{d as o}from"./p-aMyflqva.js";import{D as d,s as n}from"./p-DOUk4KoT.js";import{s as c,r as l}from"./p-C0qN3PSb.js";import{C as h}from"./p-CuwopElg.js";import{c as x}from"./p-DuFm-ieS.js";const f=()=>`@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-interaction-fill.sc-ds-textarea-h,.ds-interaction-fill.sc-ds-textarea{position:var(--ds-interaction-position, relative);z-index:var(--ds-interaction-z-index, 0);cursor:default;--ds-interaction-hover:var(--color-interaction-hover);--ds-interaction-pressed:var(--color-interaction-pressed);--ds-interaction-active:var(--color-interaction-active-brand);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent;--ds-interaction-divider-width:0px;--ds-interaction-divider-color:transparent;--ds-interaction-divider-inline-start-width:0px;--ds-interaction-divider-inline-start-color:transparent;--ds-interaction-divider-inline-end-width:0px;--ds-interaction-divider-inline-end-color:transparent}.ds-interaction-fill.sc-ds-textarea-h::before,.ds-interaction-fill.sc-ds-textarea::before,.ds-interaction-fill.sc-ds-textarea-h::after,.ds-interaction-fill.sc-ds-textarea::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-textarea-h::before,.ds-interaction-fill.sc-ds-textarea::before{z-index:1}.ds-interaction-fill.sc-ds-textarea-h::after,.ds-interaction-fill.sc-ds-textarea::after{z-index:3;box-shadow:inset 0 calc(-1 * var(--ds-interaction-divider-width)) 0 var(--ds-interaction-divider-color), inset var(--ds-interaction-divider-inline-start-width) 0 0 var(--ds-interaction-divider-inline-start-color), inset calc(-1 * var(--ds-interaction-divider-inline-end-width)) 0 0 var(--ds-interaction-divider-inline-end-color), inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-interaction-fill--bordered.sc-ds-textarea-h,.ds-interaction-fill--bordered.sc-ds-textarea{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-textarea-h::before,.ds-interaction-fill--selected.sc-ds-textarea::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-textarea-h,.ds-interaction-fill--selected.sc-ds-textarea{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-textarea-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-textarea:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-textarea-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-textarea:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-textarea-h::after,.ds-interaction-fill--grouped.sc-ds-textarea::after,.ds-interaction-fill--grouped.sc-ds-textarea-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-textarea:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-textarea-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-textarea:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-textarea-h,.ds-interaction-fill--grouped.sc-ds-textarea{--ds-interaction-divider-width:var(--ds-interaction-group-divider-width, 0px);--ds-interaction-divider-color:var(--ds-interaction-group-divider-color, transparent);--ds-interaction-divider-inline-start-width:var( --ds-interaction-group-divider-inline-start-width, 0px );--ds-interaction-divider-inline-start-color:var( --ds-interaction-group-divider-inline-start-color, transparent );--ds-interaction-divider-inline-end-width:var( --ds-interaction-group-divider-inline-end-width, 0px );--ds-interaction-divider-inline-end-color:var( --ds-interaction-group-divider-inline-end-color, transparent )}.ds-interaction-fill.sc-ds-textarea-h>.ds-interaction-fill__content.sc-ds-textarea,.ds-interaction-fill.sc-ds-textarea>.ds-interaction-fill__content.sc-ds-textarea,.ds-interaction-fill__content.sc-ds-textarea{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-textarea-h,.ds-interaction-fill--on-faint.sc-ds-textarea{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-textarea-h,.ds-interaction-fill--on-medium.sc-ds-textarea{--ds-interaction-hover:var(--color-interaction-on-medium-background-hover);--ds-interaction-pressed:var(--color-interaction-on-medium-background-pressed);--ds-interaction-active:var(--color-interaction-on-medium-background-active);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.ds-interaction-fill--on-bold.sc-ds-textarea-h,.ds-interaction-fill--on-bold.sc-ds-textarea{--ds-interaction-hover:var(--color-interaction-on-bold-background-hover);--ds-interaction-pressed:var(--color-interaction-on-bold-background-pressed);--ds-interaction-active:var(--color-interaction-on-bold-background-active);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus)}.ds-interaction-fill--on-strong.sc-ds-textarea-h,.ds-interaction-fill--on-strong.sc-ds-textarea{--ds-interaction-hover:var(--color-interaction-on-strong-background-hover);--ds-interaction-pressed:var(--color-interaction-on-strong-background-pressed);--ds-interaction-active:var(--color-interaction-on-strong-background-active);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus)}.ds-interaction-fill--on-translucent.sc-ds-textarea-h,.ds-interaction-fill--on-translucent.sc-ds-textarea{--ds-interaction-hover:var(--color-translucent-interaction-hover);--ds-interaction-pressed:var(--color-translucent-interaction-pressed);--ds-interaction-active:var(--color-translucent-interaction-active-brand);--ds-focus-ring-color:var(--color-translucent-interaction-focus)}.ds-interaction-fill--on-inverted.sc-ds-textarea-h,.ds-interaction-fill--on-inverted.sc-ds-textarea{--ds-interaction-hover:var(--color-inverted-interaction-hover);--ds-interaction-pressed:var(--color-inverted-interaction-pressed);--ds-interaction-active:var(--color-inverted-interaction-active-brand);--ds-focus-ring-color:var(--color-inverted-interaction-focus)}.ds-interaction-fill--on-media.sc-ds-textarea-h,.ds-interaction-fill--on-media.sc-ds-textarea{--ds-interaction-hover:var(--color-media-interaction-hover);--ds-interaction-pressed:var(--color-media-interaction-pressed);--ds-interaction-active:var(--color-media-interaction-active);--ds-focus-ring-color:var(--color-media-interaction-focus)}.ds-interaction-fill--on-always-dark.sc-ds-textarea-h,.ds-interaction-fill--on-always-dark.sc-ds-textarea{--ds-interaction-hover:var(--color-always-dark-interaction-hover);--ds-interaction-pressed:var(--color-always-dark-interaction-pressed);--ds-interaction-active:var(--color-always-dark-interaction-active-brand);--ds-focus-ring-color:var(--color-always-dark-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-textarea-h,.ds-interaction-fill--on-navigation.sc-ds-textarea{--ds-interaction-hover:var(--color-navigation-interaction-hover);--ds-interaction-pressed:var(--color-navigation-interaction-pressed);--ds-interaction-active:var(--color-navigation-interaction-active);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-textarea-h::after,.ds-interaction-fill.sc-ds-textarea::after{box-shadow:none;outline:var(--ds-interaction-border-width) solid var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--ds-interaction-border-width))}.ds-interaction-fill--selected.sc-ds-textarea-h::before,.ds-interaction-fill--selected.sc-ds-textarea::before{background:transparent;outline:var(--dimension-stroke-width-025) solid var(--ds-forced-color-selected);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}}@media (forced-colors: active) and (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-textarea-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-textarea:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline-color:var(--ds-forced-color-selected);outline-width:var(--dimension-stroke-width-012)}}@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-textarea-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-textarea-h,.ds-focus-ring.sc-ds-textarea,.ds-focus-ring-inset.sc-ds-textarea-h,.ds-focus-ring-inset.sc-ds-textarea{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-textarea-h:focus-visible,.ds-focus-ring.sc-ds-textarea:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-textarea-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-textarea{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-textarea-h:focus-visible,.ds-focus-ring-inset.sc-ds-textarea:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-textarea-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-textarea:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}@media (forced-colors: active){.sc-ds-textarea-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-control-inactive.sc-ds-textarea-h,.ds-control-inactive.sc-ds-textarea{opacity:var(--effect-opacity-medium);pointer-events:none;cursor:not-allowed}@media (forced-colors: active){.ds-control-inactive.sc-ds-textarea-h,.ds-control-inactive.sc-ds-textarea{color:var(--ds-forced-color-disabled);opacity:1}}.ds-control--lg.sc-ds-textarea,.ds-control--lg.sc-ds-textarea-h,.ds-control--md.sc-ds-textarea-h,.ds-control--md.sc-ds-textarea,.ds-control--sm.sc-ds-textarea-h,.ds-control--sm.sc-ds-textarea,.ds-control--xs.sc-ds-textarea-h,.ds-control--xs.sc-ds-textarea{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-textarea-h,.ds-control--lg.sc-ds-textarea{--ds-control-height:var(--dimension-size-500);--ds-control-icon:var(--dimension-iconography-lg);--ds-control-padding-inline:var(--dimension-space-100);--ds-control-label-inset:var(--dimension-space-050);--ds-control-gap:var(--dimension-space-050)}.ds-control--md.sc-ds-textarea-h,.ds-control--md.sc-ds-textarea{--ds-control-height:var(--dimension-size-400);--ds-control-icon:var(--dimension-iconography-md);--ds-control-padding-inline:var(--dimension-space-075);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-050)}.ds-control--sm.sc-ds-textarea-h,.ds-control--sm.sc-ds-textarea{--ds-control-height:var(--dimension-size-300);--ds-control-icon:var(--dimension-iconography-sm);--ds-control-padding-inline:var(--dimension-space-050);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025)}.ds-control--xs.sc-ds-textarea-h,.ds-control--xs.sc-ds-textarea{--ds-control-height:var(--dimension-size-200);--ds-control-icon:var(--dimension-iconography-xs);--ds-control-padding-inline:var(--dimension-space-025);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:0}.ds-control-width--hug.sc-ds-textarea-h,.ds-control-width--hug.sc-ds-textarea{width:fit-content;max-width:100%;flex:0 0 auto}.ds-control-width--fill.sc-ds-textarea-h,.ds-control-width--fill.sc-ds-textarea{width:100%;min-width:0;flex:1 1 auto;align-self:stretch}.ds-field-stack.sc-ds-textarea-h,.ds-field-stack.sc-ds-textarea{display:flex;flex-direction:column;gap:var(--dimension-space-050)}.ds-text--display-medium.sc-ds-textarea-h,.ds-text--display-medium.sc-ds-textarea{font-size:var(--typography-fontsize-3xl);line-height:var(--typography-lineheight-3xl)}.ds-text--display-small.sc-ds-textarea-h,.ds-text--display-small.sc-ds-textarea{font-size:var(--typography-fontsize-2xl);line-height:var(--typography-lineheight-2xl)}.ds-text--title-large.sc-ds-textarea-h,.ds-text--title-large.sc-ds-textarea{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl)}.ds-text--title-medium.sc-ds-textarea-h,.ds-text--title-medium.sc-ds-textarea{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--title-small.sc-ds-textarea-h,.ds-text--title-small.sc-ds-textarea{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-large.sc-ds-textarea-h,.ds-text--body-large.sc-ds-textarea{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--body-medium.sc-ds-textarea-h,.ds-text--body-medium.sc-ds-textarea{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-small.sc-ds-textarea-h,.ds-text--body-small.sc-ds-textarea{font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm)}.ds-text--caption.sc-ds-textarea-h,.ds-text--caption.sc-ds-textarea{font-size:var(--typography-fontsize-xs);line-height:var(--typography-lineheight-xs);text-transform:uppercase}.ds-text--display-medium.ds-text--emphasis.sc-ds-textarea-h,.ds-text--display-small.ds-text--emphasis.sc-ds-textarea-h,.ds-text--display-medium.ds-text--emphasis.sc-ds-textarea,.ds-text--display-small.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-bold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--display-medium.ds-text--regular.sc-ds-textarea-h,.ds-text--display-small.ds-text--regular.sc-ds-textarea-h,.ds-text--display-medium.ds-text--regular.sc-ds-textarea,.ds-text--display-small.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-large.ds-text--emphasis.sc-ds-textarea-h,.ds-text--title-large.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--title-large.ds-text--regular.sc-ds-textarea-h,.ds-text--title-large.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--emphasis.sc-ds-textarea-h,.ds-text--title-small.ds-text--emphasis.sc-ds-textarea-h,.ds-text--title-medium.ds-text--emphasis.sc-ds-textarea,.ds-text--title-small.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--regular.sc-ds-textarea-h,.ds-text--title-small.ds-text--regular.sc-ds-textarea-h,.ds-text--title-medium.ds-text--regular.sc-ds-textarea,.ds-text--title-small.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-large.ds-text--emphasis.sc-ds-textarea-h,.ds-text--body-medium.ds-text--emphasis.sc-ds-textarea-h,.ds-text--body-large.ds-text--emphasis.sc-ds-textarea,.ds-text--body-medium.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--body-large.ds-text--regular.sc-ds-textarea-h,.ds-text--body-medium.ds-text--regular.sc-ds-textarea-h,.ds-text--body-large.ds-text--regular.sc-ds-textarea,.ds-text--body-medium.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--emphasis.sc-ds-textarea-h,.ds-text--body-small.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--regular.sc-ds-textarea-h,.ds-text--body-small.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-none)}.ds-text--caption.ds-text--emphasis.sc-ds-textarea-h,.ds-text--caption.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-positive)}.ds-text--caption.ds-text--regular.sc-ds-textarea-h,.ds-text--caption.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-positive)}@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.textarea-host.sc-ds-textarea-h{display:inline-flex;--ds-textarea-fg:var(--color-foreground-primary);--ds-textarea-placeholder:var(--color-foreground-secondary);--ds-textarea-placeholder-active:var(--color-foreground-quaternary);--ds-textarea-border:var(--color-border-secondary)}.ds-control-width--fill.sc-ds-textarea-h,.ds-control-width--fill.sc-ds-textarea-h .textarea-control.sc-ds-textarea{width:100%}.textarea-control.sc-ds-textarea{display:flex;box-sizing:border-box;min-width:0;overflow:hidden;background:transparent;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));color:var(--ds-textarea-fg)}.textarea-control--resizable.sc-ds-textarea{padding-block-end:var(--dimension-space-025);padding-inline-end:var(--dimension-space-025)}.textarea-control--bordered.sc-ds-textarea{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--ds-textarea-border)}.textarea-control--error.sc-ds-textarea{--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-negative)}.textarea-control--bordered.sc-ds-textarea:focus-within:not(.textarea-control--error){--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-brand)}.ds-control-inactive.sc-ds-textarea-h .textarea-control.sc-ds-textarea::after{background:transparent}.native-textarea.sc-ds-textarea{position:relative;z-index:2;box-sizing:border-box;min-width:0;width:100%;padding-block:var(--ds-control-padding-inline, var(--dimension-space-075));padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) );background:transparent;border:none;border-radius:inherit;outline:none;color:var(--ds-textarea-fg);font-family:inherit;-webkit-appearance:none;appearance:none}.native-textarea--resize-vertical.sc-ds-textarea{resize:vertical}.native-textarea--resize-none.sc-ds-textarea{resize:none}.native-textarea.sc-ds-textarea:disabled{cursor:not-allowed}.native-textarea.sc-ds-textarea:read-only:not(:disabled){cursor:default}.native-textarea.sc-ds-textarea::placeholder{color:var(--ds-textarea-placeholder)}.native-textarea.sc-ds-textarea:focus::placeholder{color:var(--ds-textarea-placeholder-active)}.error-text.sc-ds-textarea{width:100%}@media (forced-colors: active){.textarea-control--bordered.sc-ds-textarea:focus-within:not(.textarea-control--error)::after{outline-color:var(--ds-forced-color-selected)}.textarea-control--error.sc-ds-textarea::after{outline-style:dashed}}`;let v=0;const g=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.dsChange=r(this,"dsChange",7);this.internals=this.attachInternals();this.generatedId=`ds-textarea-${++v}`;this.errorId=`${this.generatedId}-error`;this.value="";this.disabled=false;this.readOnly=false;this.required=false;this.requiredMessage=d;this.rows=4;this.resize="vertical";this.inputMode="";this.enterKeyHint="";this.spellCheck=true;this.size="md";this.width="fill";this.hasBorder=true;this.hasInteractionFill=true;this.isInactive=false;this.autoFocus=false;this.error=false;this.ariaLabel=null;this.initialValue="";this.formDisabled=false;this.focused=false;this.touched=false;this.handleInput=t=>{this.value=t.target.value;this.dsChange.emit(this.value)};this.handleFocus=()=>{this.focused=true};this.handleBlur=()=>{this.focused=false;this.touched=true}}componentWillLoad(){this.initialValue=this.value;this.syncFormValue()}syncFormValue(){const t=this.isInactive||this.disabled||this.formDisabled;c(this.internals,this.value,{inactive:t});const e=this.required&&!t&&this.value.length===0;n(this.internals,e,this.requiredMessage)}formDisabledCallback(t){this.formDisabled=t;this.syncFormValue()}formResetCallback(){this.value=this.initialValue}formStateRestoreCallback(t){this.value=l(t)}async setFocus(){this.textareaEl?.focus()}render(){const t=this.inputId??this.generatedId;const e=this.isInactive||this.disabled||this.formDisabled;const r=this.value.length>0;const i=this.value!==this.initialValue;const o=this.error&&Boolean(this.errorMessage);const d=h[this.size];const n=Number.isFinite(this.rows)?Math.max(1,Math.floor(this.rows)):4;const c=[this.ariaDescribedby,o?this.errorId:undefined].filter(Boolean).join(" ")||undefined;return s(a,{key:"89ff7fad01d5021c1b65ac346069c4ed1cf86343",class:{"textarea-host":true,"ds-field-stack":true,"ds-control-inactive":e,[`ds-control--${this.size}`]:true,...x(this.width)},"data-disabled":e?"":undefined,"data-readonly":this.readOnly?"":undefined,"data-required":this.required?"":undefined,"data-invalid":this.error?"":undefined,"data-filled":r?"":undefined,"data-focused":this.focused?"":undefined,"data-dirty":i?"":undefined,"data-touched":this.touched?"":undefined},s("div",{key:"3fdea15601685a2e5bdc46811a0bf9807a00998f",class:{"textarea-control":true,"textarea-control--resizable":this.resize==="vertical","textarea-control--bordered":this.hasBorder,"textarea-control--error":this.hasBorder&&this.error,"ds-interaction-fill":this.hasInteractionFill,[`ds-control--${this.size}`]:true}},s("textarea",{key:"57659444907a46b0187b58cad37833e8fa9317f0",ref:t=>{this.textareaEl=t},id:t,value:this.value,placeholder:this.placeholder,rows:n,disabled:e,readOnly:this.readOnly,required:this.required,autoFocus:this.autoFocus,autoComplete:this.autoComplete,inputMode:this.inputMode||undefined,enterKeyHint:this.enterKeyHint||undefined,spellcheck:this.spellCheck,class:`native-textarea native-textarea--resize-${this.resize} ds-text--${d.replace("text-","")} ds-text--regular ds-interaction-fill__content`,"aria-label":this.ariaLabel,"aria-labelledby":this.ariaLabelledby,"aria-describedby":c,"aria-invalid":this.error?"true":undefined,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur})),o&&s("ds-text",{key:"b52869d722957e10caa63c14b877bfba8ea07ea2",class:"error-text",as:"div",variant:"text-body-small",color:"negative",textId:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}get el(){return this}static get watchers(){return{value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}]}}static get style(){return f()}},[66,"ds-textarea",{value:[1025],name:[513],form:[513],disabled:[516],readOnly:[516,"read-only"],required:[516],requiredMessage:[1,"required-message"],placeholder:[1],rows:[2],resize:[1],autoComplete:[1,"autocomplete"],inputMode:[1,"inputmode"],enterKeyHint:[1,"enterkeyhint"],spellCheck:[4,"spellcheck"],size:[1],width:[1],hasBorder:[4,"has-border"],hasInteractionFill:[4,"has-interaction-fill"],isInactive:[4,"is-inactive"],autoFocus:[4,"auto-focus"],error:[4],errorMessage:[1,"error-message"],inputId:[1,"input-id"],ariaLabel:[1,"aria-label"],ariaLabelledby:[1,"aria-labelledby"],ariaDescribedby:[1,"aria-describedby"],formDisabled:[32],focused:[32],touched:[32],setFocus:[64]},undefined,{value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}]}]);function u(){if(typeof customElements==="undefined"){return}const t=["ds-textarea","ds-text"];t.forEach((t=>{switch(t){case"ds-textarea":if(!customElements.get(i(t))){customElements.define(i(t),g)}break;case"ds-text":if(!customElements.get(i(t))){o()}break}}))}u();const p=g;const m=u;export{p as DsTextarea,m as defineCustomElement};
|
|
1
|
+
import{p as t,H as e,c as s,h as r,a,t as i}from"./index.js";import{d as o}from"./p-aMyflqva.js";import{D as d,s as n}from"./p-DOUk4KoT.js";import{s as c,r as l}from"./p-C0qN3PSb.js";import{C as h}from"./p-CuwopElg.js";import{c as x}from"./p-DuFm-ieS.js";const f=()=>`@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-interaction-fill.sc-ds-textarea-h,.ds-interaction-fill.sc-ds-textarea{position:var(--ds-interaction-position, relative);z-index:var(--ds-interaction-z-index, 0);cursor:default;--ds-interaction-hover:var(--color-interaction-hover);--ds-interaction-pressed:var(--color-interaction-pressed);--ds-interaction-active:var(--color-interaction-active-brand);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent;--ds-interaction-divider-width:0px;--ds-interaction-divider-color:transparent;--ds-interaction-divider-inline-start-width:0px;--ds-interaction-divider-inline-start-color:transparent;--ds-interaction-divider-inline-end-width:0px;--ds-interaction-divider-inline-end-color:transparent}.ds-interaction-fill.sc-ds-textarea-h::before,.ds-interaction-fill.sc-ds-textarea::before,.ds-interaction-fill.sc-ds-textarea-h::after,.ds-interaction-fill.sc-ds-textarea::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-textarea-h::before,.ds-interaction-fill.sc-ds-textarea::before{z-index:1}.ds-interaction-fill.sc-ds-textarea-h::after,.ds-interaction-fill.sc-ds-textarea::after{z-index:3;box-shadow:inset 0 calc(-1 * var(--ds-interaction-divider-width)) 0 var(--ds-interaction-divider-color), inset var(--ds-interaction-divider-inline-start-width) 0 0 var(--ds-interaction-divider-inline-start-color), inset calc(-1 * var(--ds-interaction-divider-inline-end-width)) 0 0 var(--ds-interaction-divider-inline-end-color), inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-interaction-fill--bordered.sc-ds-textarea-h,.ds-interaction-fill--bordered.sc-ds-textarea{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-textarea-h::before,.ds-interaction-fill--selected.sc-ds-textarea::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-textarea-h,.ds-interaction-fill--selected.sc-ds-textarea{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-textarea-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-textarea:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-textarea-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-textarea:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-textarea-h::after,.ds-interaction-fill--grouped.sc-ds-textarea::after,.ds-interaction-fill--grouped.sc-ds-textarea-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-textarea:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-textarea-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-textarea:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-textarea-h,.ds-interaction-fill--grouped.sc-ds-textarea{--ds-interaction-divider-width:var(--ds-interaction-group-divider-width, 0px);--ds-interaction-divider-color:var(--ds-interaction-group-divider-color, transparent);--ds-interaction-divider-inline-start-width:var( --ds-interaction-group-divider-inline-start-width, 0px );--ds-interaction-divider-inline-start-color:var( --ds-interaction-group-divider-inline-start-color, transparent );--ds-interaction-divider-inline-end-width:var( --ds-interaction-group-divider-inline-end-width, 0px );--ds-interaction-divider-inline-end-color:var( --ds-interaction-group-divider-inline-end-color, transparent )}.ds-interaction-fill.sc-ds-textarea-h>.ds-interaction-fill__content.sc-ds-textarea,.ds-interaction-fill.sc-ds-textarea>.ds-interaction-fill__content.sc-ds-textarea,.ds-interaction-fill__content.sc-ds-textarea{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-textarea-h,.ds-interaction-fill--on-faint.sc-ds-textarea{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-textarea-h,.ds-interaction-fill--on-medium.sc-ds-textarea{--ds-interaction-hover:var(--color-interaction-on-medium-background-hover);--ds-interaction-pressed:var(--color-interaction-on-medium-background-pressed);--ds-interaction-active:var(--color-interaction-on-medium-background-active);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.ds-interaction-fill--on-bold.sc-ds-textarea-h,.ds-interaction-fill--on-bold.sc-ds-textarea{--ds-interaction-hover:var(--color-interaction-on-bold-background-hover);--ds-interaction-pressed:var(--color-interaction-on-bold-background-pressed);--ds-interaction-active:var(--color-interaction-on-bold-background-active);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus)}.ds-interaction-fill--on-strong.sc-ds-textarea-h,.ds-interaction-fill--on-strong.sc-ds-textarea{--ds-interaction-hover:var(--color-interaction-on-strong-background-hover);--ds-interaction-pressed:var(--color-interaction-on-strong-background-pressed);--ds-interaction-active:var(--color-interaction-on-strong-background-active);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus)}.ds-interaction-fill--on-translucent.sc-ds-textarea-h,.ds-interaction-fill--on-translucent.sc-ds-textarea{--ds-interaction-hover:var(--color-translucent-interaction-hover);--ds-interaction-pressed:var(--color-translucent-interaction-pressed);--ds-interaction-active:var(--color-translucent-interaction-active-brand);--ds-focus-ring-color:var(--color-translucent-interaction-focus)}.ds-interaction-fill--on-inverted.sc-ds-textarea-h,.ds-interaction-fill--on-inverted.sc-ds-textarea{--ds-interaction-hover:var(--color-inverted-interaction-hover);--ds-interaction-pressed:var(--color-inverted-interaction-pressed);--ds-interaction-active:var(--color-inverted-interaction-active-brand);--ds-focus-ring-color:var(--color-inverted-interaction-focus)}.ds-interaction-fill--on-media.sc-ds-textarea-h,.ds-interaction-fill--on-media.sc-ds-textarea{--ds-interaction-hover:var(--color-media-interaction-hover);--ds-interaction-pressed:var(--color-media-interaction-pressed);--ds-interaction-active:var(--color-media-interaction-active);--ds-focus-ring-color:var(--color-media-interaction-focus)}.ds-interaction-fill--on-always-dark.sc-ds-textarea-h,.ds-interaction-fill--on-always-dark.sc-ds-textarea{--ds-interaction-hover:var(--color-always-dark-interaction-hover);--ds-interaction-pressed:var(--color-always-dark-interaction-pressed);--ds-interaction-active:var(--color-always-dark-interaction-active-brand);--ds-focus-ring-color:var(--color-always-dark-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-textarea-h,.ds-interaction-fill--on-navigation.sc-ds-textarea{--ds-interaction-hover:var(--color-navigation-interaction-hover);--ds-interaction-pressed:var(--color-navigation-interaction-pressed);--ds-interaction-active:var(--color-navigation-interaction-active);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-textarea-h:not(:disabled)::after,.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-textarea:not(:disabled)::after{background:var(--ds-interaction-pressed)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-textarea-h::after,.ds-interaction-fill.sc-ds-textarea::after{box-shadow:none;outline:var(--ds-interaction-border-width) solid var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--ds-interaction-border-width))}.ds-interaction-fill--surface-open.sc-ds-textarea-h:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill--surface-open.sc-ds-textarea:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline:var(--dimension-stroke-width-025) dashed var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}.ds-interaction-fill--selected.sc-ds-textarea-h::before,.ds-interaction-fill--selected.sc-ds-textarea::before{background:transparent;outline:var(--dimension-stroke-width-025) solid var(--ds-forced-color-selected);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}}@media (forced-colors: active) and (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-textarea-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-textarea:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline-color:var(--ds-forced-color-selected);outline-width:var(--dimension-stroke-width-012)}}@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-textarea-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-textarea-h,.ds-focus-ring.sc-ds-textarea,.ds-focus-ring-inset.sc-ds-textarea-h,.ds-focus-ring-inset.sc-ds-textarea{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-textarea-h:focus-visible,.ds-focus-ring.sc-ds-textarea:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-textarea-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-textarea{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-textarea-h:focus-visible,.ds-focus-ring-inset.sc-ds-textarea:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-textarea-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-textarea:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}@media (forced-colors: active){.sc-ds-textarea-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-control-inactive.sc-ds-textarea-h,.ds-control-inactive.sc-ds-textarea{opacity:var(--effect-opacity-medium);pointer-events:none;cursor:not-allowed}@media (forced-colors: active){.ds-control-inactive.sc-ds-textarea-h,.ds-control-inactive.sc-ds-textarea{color:var(--ds-forced-color-disabled);opacity:1}}.ds-control--lg.sc-ds-textarea,.ds-control--lg.sc-ds-textarea-h,.ds-control--md.sc-ds-textarea-h,.ds-control--md.sc-ds-textarea,.ds-control--sm.sc-ds-textarea-h,.ds-control--sm.sc-ds-textarea,.ds-control--xs.sc-ds-textarea-h,.ds-control--xs.sc-ds-textarea{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-textarea-h,.ds-control--lg.sc-ds-textarea{--ds-control-height:var(--dimension-size-500);--ds-control-icon:var(--dimension-iconography-lg);--ds-control-padding-inline:var(--dimension-space-100);--ds-control-label-inset:var(--dimension-space-050);--ds-control-gap:var(--dimension-space-050)}.ds-control--md.sc-ds-textarea-h,.ds-control--md.sc-ds-textarea{--ds-control-height:var(--dimension-size-400);--ds-control-icon:var(--dimension-iconography-md);--ds-control-padding-inline:var(--dimension-space-075);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-050)}.ds-control--sm.sc-ds-textarea-h,.ds-control--sm.sc-ds-textarea{--ds-control-height:var(--dimension-size-300);--ds-control-icon:var(--dimension-iconography-sm);--ds-control-padding-inline:var(--dimension-space-050);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025)}.ds-control--xs.sc-ds-textarea-h,.ds-control--xs.sc-ds-textarea{--ds-control-height:var(--dimension-size-200);--ds-control-icon:var(--dimension-iconography-xs);--ds-control-padding-inline:var(--dimension-space-025);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:0}.ds-control-width--hug.sc-ds-textarea-h,.ds-control-width--hug.sc-ds-textarea{width:fit-content;max-width:100%;flex:0 0 auto}.ds-control-width--fill.sc-ds-textarea-h,.ds-control-width--fill.sc-ds-textarea{width:100%;min-width:0;flex:1 1 auto;align-self:stretch}.ds-field-stack.sc-ds-textarea-h,.ds-field-stack.sc-ds-textarea{display:flex;flex-direction:column;gap:var(--dimension-space-050)}.ds-text--display-medium.sc-ds-textarea-h,.ds-text--display-medium.sc-ds-textarea{font-size:var(--typography-fontsize-3xl);line-height:var(--typography-lineheight-3xl)}.ds-text--display-small.sc-ds-textarea-h,.ds-text--display-small.sc-ds-textarea{font-size:var(--typography-fontsize-2xl);line-height:var(--typography-lineheight-2xl)}.ds-text--title-large.sc-ds-textarea-h,.ds-text--title-large.sc-ds-textarea{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl)}.ds-text--title-medium.sc-ds-textarea-h,.ds-text--title-medium.sc-ds-textarea{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--title-small.sc-ds-textarea-h,.ds-text--title-small.sc-ds-textarea{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-large.sc-ds-textarea-h,.ds-text--body-large.sc-ds-textarea{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--body-medium.sc-ds-textarea-h,.ds-text--body-medium.sc-ds-textarea{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-small.sc-ds-textarea-h,.ds-text--body-small.sc-ds-textarea{font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm)}.ds-text--caption.sc-ds-textarea-h,.ds-text--caption.sc-ds-textarea{font-size:var(--typography-fontsize-xs);line-height:var(--typography-lineheight-xs);text-transform:uppercase}.ds-text--display-medium.ds-text--emphasis.sc-ds-textarea-h,.ds-text--display-small.ds-text--emphasis.sc-ds-textarea-h,.ds-text--display-medium.ds-text--emphasis.sc-ds-textarea,.ds-text--display-small.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-bold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--display-medium.ds-text--regular.sc-ds-textarea-h,.ds-text--display-small.ds-text--regular.sc-ds-textarea-h,.ds-text--display-medium.ds-text--regular.sc-ds-textarea,.ds-text--display-small.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-large.ds-text--emphasis.sc-ds-textarea-h,.ds-text--title-large.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--title-large.ds-text--regular.sc-ds-textarea-h,.ds-text--title-large.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--emphasis.sc-ds-textarea-h,.ds-text--title-small.ds-text--emphasis.sc-ds-textarea-h,.ds-text--title-medium.ds-text--emphasis.sc-ds-textarea,.ds-text--title-small.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--regular.sc-ds-textarea-h,.ds-text--title-small.ds-text--regular.sc-ds-textarea-h,.ds-text--title-medium.ds-text--regular.sc-ds-textarea,.ds-text--title-small.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-large.ds-text--emphasis.sc-ds-textarea-h,.ds-text--body-medium.ds-text--emphasis.sc-ds-textarea-h,.ds-text--body-large.ds-text--emphasis.sc-ds-textarea,.ds-text--body-medium.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--body-large.ds-text--regular.sc-ds-textarea-h,.ds-text--body-medium.ds-text--regular.sc-ds-textarea-h,.ds-text--body-large.ds-text--regular.sc-ds-textarea,.ds-text--body-medium.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--emphasis.sc-ds-textarea-h,.ds-text--body-small.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--regular.sc-ds-textarea-h,.ds-text--body-small.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-none)}.ds-text--caption.ds-text--emphasis.sc-ds-textarea-h,.ds-text--caption.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-positive)}.ds-text--caption.ds-text--regular.sc-ds-textarea-h,.ds-text--caption.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-positive)}@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.textarea-host.sc-ds-textarea-h{display:inline-flex;--ds-textarea-fg:var(--color-foreground-primary);--ds-textarea-placeholder:var(--color-foreground-secondary);--ds-textarea-placeholder-active:var(--color-foreground-quaternary);--ds-textarea-border:var(--color-border-secondary)}.ds-control-width--fill.sc-ds-textarea-h,.ds-control-width--fill.sc-ds-textarea-h .textarea-control.sc-ds-textarea{width:100%}.textarea-control.sc-ds-textarea{display:flex;box-sizing:border-box;min-width:0;overflow:hidden;background:transparent;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));color:var(--ds-textarea-fg)}.textarea-control--resizable.sc-ds-textarea{padding-block-end:var(--dimension-space-025);padding-inline-end:var(--dimension-space-025)}.textarea-control--bordered.sc-ds-textarea{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--ds-textarea-border)}.textarea-control--error.sc-ds-textarea{--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-negative)}.textarea-control--bordered.sc-ds-textarea:focus-within:not(.textarea-control--error){--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-brand)}.ds-control-inactive.sc-ds-textarea-h .textarea-control.sc-ds-textarea::after{background:transparent}.native-textarea.sc-ds-textarea{position:relative;z-index:2;box-sizing:border-box;min-width:0;width:100%;padding-block:var(--ds-control-padding-inline, var(--dimension-space-075));padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) );background:transparent;border:none;border-radius:inherit;outline:none;color:var(--ds-textarea-fg);font-family:inherit;-webkit-appearance:none;appearance:none}.native-textarea--resize-vertical.sc-ds-textarea{resize:vertical}.native-textarea--resize-none.sc-ds-textarea{resize:none}.native-textarea.sc-ds-textarea:disabled{cursor:not-allowed}.native-textarea.sc-ds-textarea:read-only:not(:disabled){cursor:default}.native-textarea.sc-ds-textarea::placeholder{color:var(--ds-textarea-placeholder)}.native-textarea.sc-ds-textarea:focus::placeholder{color:var(--ds-textarea-placeholder-active)}.error-text.sc-ds-textarea{width:100%}@media (forced-colors: active){.textarea-control--bordered.sc-ds-textarea:focus-within:not(.textarea-control--error)::after{outline-color:var(--ds-forced-color-selected)}.textarea-control--error.sc-ds-textarea::after{outline-style:dashed}}`;let v=0;const u=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.dsChange=s(this,"dsChange",7);this.internals=this.attachInternals();this.generatedId=`ds-textarea-${++v}`;this.errorId=`${this.generatedId}-error`;this.value="";this.disabled=false;this.readOnly=false;this.required=false;this.requiredMessage=d;this.rows=4;this.resize="vertical";this.inputMode="";this.enterKeyHint="";this.spellCheck=true;this.size="md";this.width="fill";this.hasBorder=true;this.hasInteractionFill=true;this.isInactive=false;this.autoFocus=false;this.error=false;this.ariaLabel=null;this.initialValue="";this.formDisabled=false;this.focused=false;this.touched=false;this.handleInput=t=>{this.value=t.target.value;this.dsChange.emit(this.value)};this.handleFocus=()=>{this.focused=true};this.handleBlur=()=>{this.focused=false;this.touched=true}}componentWillLoad(){this.initialValue=this.value;this.syncFormValue()}syncFormValue(){const t=this.isInactive||this.disabled||this.formDisabled;c(this.internals,this.value,{inactive:t});const e=this.required&&!t&&this.value.length===0;n(this.internals,e,this.requiredMessage)}formDisabledCallback(t){this.formDisabled=t;this.syncFormValue()}formResetCallback(){this.value=this.initialValue}formStateRestoreCallback(t){this.value=l(t)}async setFocus(){this.textareaEl?.focus()}render(){const t=this.inputId??this.generatedId;const e=this.isInactive||this.disabled||this.formDisabled;const s=this.value.length>0;const i=this.value!==this.initialValue;const o=this.error&&Boolean(this.errorMessage);const d=h[this.size];const n=Number.isFinite(this.rows)?Math.max(1,Math.floor(this.rows)):4;const c=[this.ariaDescribedby,o?this.errorId:undefined].filter(Boolean).join(" ")||undefined;return r(a,{key:"89ff7fad01d5021c1b65ac346069c4ed1cf86343",class:{"textarea-host":true,"ds-field-stack":true,"ds-control-inactive":e,[`ds-control--${this.size}`]:true,...x(this.width)},"data-disabled":e?"":undefined,"data-readonly":this.readOnly?"":undefined,"data-required":this.required?"":undefined,"data-invalid":this.error?"":undefined,"data-filled":s?"":undefined,"data-focused":this.focused?"":undefined,"data-dirty":i?"":undefined,"data-touched":this.touched?"":undefined},r("div",{key:"3fdea15601685a2e5bdc46811a0bf9807a00998f",class:{"textarea-control":true,"textarea-control--resizable":this.resize==="vertical","textarea-control--bordered":this.hasBorder,"textarea-control--error":this.hasBorder&&this.error,"ds-interaction-fill":this.hasInteractionFill,[`ds-control--${this.size}`]:true}},r("textarea",{key:"57659444907a46b0187b58cad37833e8fa9317f0",ref:t=>{this.textareaEl=t},id:t,value:this.value,placeholder:this.placeholder,rows:n,disabled:e,readOnly:this.readOnly,required:this.required,autoFocus:this.autoFocus,autoComplete:this.autoComplete,inputMode:this.inputMode||undefined,enterKeyHint:this.enterKeyHint||undefined,spellcheck:this.spellCheck,class:`native-textarea native-textarea--resize-${this.resize} ds-text--${d.replace("text-","")} ds-text--regular ds-interaction-fill__content`,"aria-label":this.ariaLabel,"aria-labelledby":this.ariaLabelledby,"aria-describedby":c,"aria-invalid":this.error?"true":undefined,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur})),o&&r("ds-text",{key:"b52869d722957e10caa63c14b877bfba8ea07ea2",class:"error-text",as:"div",variant:"text-body-small",color:"negative",textId:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}get el(){return this}static get watchers(){return{value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}]}}static get style(){return f()}},[66,"ds-textarea",{value:[1025],name:[513],form:[513],disabled:[516],readOnly:[516,"read-only"],required:[516],requiredMessage:[1,"required-message"],placeholder:[1],rows:[2],resize:[1],autoComplete:[1,"autocomplete"],inputMode:[1,"inputmode"],enterKeyHint:[1,"enterkeyhint"],spellCheck:[4,"spellcheck"],size:[1],width:[1],hasBorder:[4,"has-border"],hasInteractionFill:[4,"has-interaction-fill"],isInactive:[4,"is-inactive"],autoFocus:[4,"auto-focus"],error:[4],errorMessage:[1,"error-message"],inputId:[1,"input-id"],ariaLabel:[1,"aria-label"],ariaLabelledby:[1,"aria-labelledby"],ariaDescribedby:[1,"aria-describedby"],formDisabled:[32],focused:[32],touched:[32],setFocus:[64]},undefined,{value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}]}]);function g(){if(typeof customElements==="undefined"){return}const t=["ds-textarea","ds-text"];t.forEach((t=>{switch(t){case"ds-textarea":if(!customElements.get(i(t))){customElements.define(i(t),u)}break;case"ds-text":if(!customElements.get(i(t))){o()}break}}))}g();const p=u;const m=g;export{p as DsTextarea,m as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["textareaCss","idCounter","Textarea","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","generatedId","errorId","value","disabled","readOnly","required","requiredMessage","DEFAULT_REQUIRED_MESSAGE","rows","resize","inputMode","enterKeyHint","spellCheck","size","width","hasBorder","hasInteractionFill","isInactive","autoFocus","error","ariaLabel","initialValue","formDisabled","focused","touched","handleInput","event","target","dsChange","emit","handleFocus","handleBlur","componentWillLoad","syncFormValue","inactive","setFormControlValue","internals","missing","length","setRequiredValidity","formDisabledCallback","formResetCallback","formStateRestoreCallback","state","restoreStringFormState","setFocus","textareaEl","focus","render","inputId","filled","dirty","showError","Boolean","errorMessage","textVariant","CONTROL_TEXT_VARIANT","Number","isFinite","Math","max","floor","describedBy","ariaDescribedby","undefined","filter","join","h","Host","key","class","controlWidthClass","ref","element","id","placeholder","autoComplete","spellcheck","replace","ariaLabelledby","onInput","onFocus","onBlur","as","variant","color","textId","role"],"sources":["src/wc/components/Textarea/Textarea.css?tag=ds-textarea&encapsulation=scoped","src/wc/components/Textarea/Textarea.tsx"],"sourcesContent":["@import '../../utils/interaction-fill.css';\n@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n@import '../../utils/control-density.css';\n@import '../../utils/control-width.css';\n@import '../../utils/field-stack.css';\n@import '../../utils/typography.css';\n@import '../../utils/forced-colors.css';\n\n:host(.textarea-host) {\n display: inline-flex;\n --ds-textarea-fg: var(--color-foreground-primary);\n --ds-textarea-placeholder: var(--color-foreground-secondary);\n --ds-textarea-placeholder-active: var(--color-foreground-quaternary);\n --ds-textarea-border: var(--color-border-secondary);\n}\n\n:host(.ds-control-width--fill),\n:host(.ds-control-width--fill) .textarea-control {\n width: 100%;\n}\n\n.textarea-control {\n display: flex;\n box-sizing: border-box;\n min-width: 0;\n overflow: hidden;\n background: transparent;\n border: none;\n border-radius: var(--ds-control-radius, var(--dimension-radius-025));\n color: var(--ds-textarea-fg);\n}\n\n.textarea-control--resizable {\n padding-block-end: var(--dimension-space-025);\n padding-inline-end: var(--dimension-space-025);\n}\n\n.textarea-control--bordered {\n --ds-interaction-border-width: var(--dimension-stroke-width-012);\n --ds-interaction-border-color: var(--ds-textarea-border);\n}\n\n.textarea-control--error {\n --ds-interaction-border-width: var(--dimension-stroke-width-018);\n --ds-interaction-border-color: var(--color-border-bold-negative);\n}\n\n.textarea-control--bordered:focus-within:not(.textarea-control--error) {\n --ds-interaction-border-width: var(--dimension-stroke-width-018);\n --ds-interaction-border-color: var(--color-border-bold-brand);\n}\n\n:host(.ds-control-inactive) .textarea-control::after {\n background: transparent;\n}\n\n.native-textarea {\n position: relative;\n z-index: 2;\n box-sizing: border-box;\n min-width: 0;\n width: 100%;\n padding-block: var(--ds-control-padding-inline, var(--dimension-space-075));\n padding-inline: calc(\n var(--ds-control-padding-inline, var(--dimension-space-075)) +\n var(--ds-control-label-inset, var(--dimension-space-025))\n );\n background: transparent;\n border: none;\n border-radius: inherit;\n outline: none;\n color: var(--ds-textarea-fg);\n font-family: inherit;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.native-textarea--resize-vertical {\n resize: vertical;\n}\n\n.native-textarea--resize-none {\n resize: none;\n}\n\n.native-textarea:disabled {\n cursor: not-allowed;\n}\n\n.native-textarea:read-only:not(:disabled) {\n cursor: default;\n}\n\n.native-textarea::placeholder {\n color: var(--ds-textarea-placeholder);\n}\n\n.native-textarea:focus::placeholder {\n color: var(--ds-textarea-placeholder-active);\n}\n\n.error-text {\n width: 100%;\n}\n\n@media (forced-colors: active) {\n .textarea-control--bordered:focus-within:not(.textarea-control--error)::after {\n outline-color: var(--ds-forced-color-selected);\n }\n\n .textarea-control--error::after {\n outline-style: dashed;\n }\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n Method,\n Prop,\n State,\n Watch,\n h,\n Host,\n} from '@stencil/core';\nimport {\n controlWidthClass,\n CONTROL_TEXT_VARIANT,\n DEFAULT_REQUIRED_MESSAGE,\n restoreStringFormState,\n setFormControlValue,\n setRequiredValidity,\n type ControlWidth,\n} from '../../utils';\n\nexport type TextareaSize = 'lg' | 'md' | 'sm' | 'xs';\nexport type TextareaWidth = ControlWidth;\nexport type TextareaResize = 'vertical' | 'none';\n\nlet idCounter = 0;\n\n@Component({\n tag: 'ds-textarea',\n styleUrl: 'Textarea.css',\n scoped: true,\n formAssociated: true,\n})\nexport class Textarea {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n private generatedId = `ds-textarea-${++idCounter}`;\n private errorId = `${this.generatedId}-error`;\n\n @Prop({ mutable: true }) value: string = '';\n @Prop({ reflect: true }) name: string | undefined;\n @Prop({ reflect: true }) form: string | undefined;\n @Prop({ reflect: true }) disabled: boolean = false;\n /** Keeps the value focusable and submittable while preventing edits. */\n @Prop({ reflect: true }) readOnly: boolean = false;\n @Prop({ reflect: true }) required: boolean = false;\n @Prop() requiredMessage: string = DEFAULT_REQUIRED_MESSAGE;\n @Prop() placeholder: string | undefined;\n /** Visible text rows before the field scrolls. */\n @Prop() rows: number = 4;\n /** Whether the user can resize the field vertically. */\n @Prop() resize: TextareaResize = 'vertical';\n /** Native browser autofill hint. */\n @Prop({ attribute: 'autocomplete' }) autoComplete: string | undefined;\n /** Preferred virtual keyboard without changing the value semantics. */\n @Prop({ attribute: 'inputmode' }) inputMode: string = '';\n /** Preferred virtual-keyboard action label. */\n @Prop({ attribute: 'enterkeyhint' }) enterKeyHint: string = '';\n /** Whether the browser should check spelling and grammar. */\n @Prop({ attribute: 'spellcheck' }) spellCheck: boolean = true;\n /** Control density for typography and inset spacing. */\n @Prop() size: TextareaSize = 'md';\n /** Width fit — fill the parent (default) or hug the available content. */\n @Prop() width: TextareaWidth = 'fill';\n /** Show the standard inset border, including focused and invalid strokes. */\n @Prop() hasBorder: boolean = true;\n /** Show the standard hover and pressed fill when the field is not embedded in interactive chrome. */\n @Prop() hasInteractionFill: boolean = true;\n @Prop() isInactive: boolean = false;\n @Prop() autoFocus: boolean = false;\n @Prop() error: boolean = false;\n @Prop() errorMessage: string | undefined;\n /** Associates the internal textarea with an external <label>. */\n @Prop() inputId: string | undefined;\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n @Prop({ attribute: 'aria-labelledby' }) ariaLabelledby: string | undefined;\n @Prop({ attribute: 'aria-describedby' }) ariaDescribedby: string | undefined;\n\n @Event() dsChange!: EventEmitter<string>;\n\n private initialValue = '';\n private textareaEl?: HTMLTextAreaElement;\n @State() private formDisabled = false;\n @State() private focused = false;\n @State() private touched = false;\n\n componentWillLoad() {\n this.initialValue = this.value;\n this.syncFormValue();\n }\n\n @Watch('value')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('required')\n syncFormValue() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n setFormControlValue(this.internals, this.value, { inactive });\n const missing = this.required && !inactive && this.value.length === 0;\n setRequiredValidity(this.internals, missing, this.requiredMessage);\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = restoreStringFormState(state);\n }\n\n @Method()\n async setFocus() {\n this.textareaEl?.focus();\n }\n\n private handleInput = (event: Event) => {\n this.value = (event.target as HTMLTextAreaElement).value;\n this.dsChange.emit(this.value);\n };\n\n private handleFocus = () => {\n this.focused = true;\n };\n\n private handleBlur = () => {\n this.focused = false;\n this.touched = true;\n };\n\n render() {\n const inputId = this.inputId ?? this.generatedId;\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n const filled = this.value.length > 0;\n const dirty = this.value !== this.initialValue;\n const showError = this.error && Boolean(this.errorMessage);\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const rows = Number.isFinite(this.rows) ? Math.max(1, Math.floor(this.rows)) : 4;\n const describedBy =\n [this.ariaDescribedby, showError ? this.errorId : undefined].filter(Boolean).join(' ') ||\n undefined;\n\n return (\n <Host\n class={{\n 'textarea-host': true,\n 'ds-field-stack': true,\n 'ds-control-inactive': inactive,\n [`ds-control--${this.size}`]: true,\n ...controlWidthClass(this.width),\n }}\n data-disabled={inactive ? '' : undefined}\n data-readonly={this.readOnly ? '' : undefined}\n data-required={this.required ? '' : undefined}\n data-invalid={this.error ? '' : undefined}\n data-filled={filled ? '' : undefined}\n data-focused={this.focused ? '' : undefined}\n data-dirty={dirty ? '' : undefined}\n data-touched={this.touched ? '' : undefined}\n >\n <div\n class={{\n 'textarea-control': true,\n 'textarea-control--resizable': this.resize === 'vertical',\n 'textarea-control--bordered': this.hasBorder,\n 'textarea-control--error': this.hasBorder && this.error,\n 'ds-interaction-fill': this.hasInteractionFill,\n [`ds-control--${this.size}`]: true,\n }}\n >\n <textarea\n ref={element => {\n this.textareaEl = element;\n }}\n id={inputId}\n value={this.value}\n placeholder={this.placeholder}\n rows={rows}\n disabled={inactive}\n readOnly={this.readOnly}\n required={this.required}\n autoFocus={this.autoFocus}\n autoComplete={this.autoComplete}\n inputMode={this.inputMode || undefined}\n enterKeyHint={this.enterKeyHint || undefined}\n spellcheck={this.spellCheck}\n class={`native-textarea native-textarea--resize-${this.resize} ds-text--${textVariant.replace('text-', '')} ds-text--regular ds-interaction-fill__content`}\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledby}\n aria-describedby={describedBy}\n aria-invalid={this.error ? 'true' : undefined}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n </div>\n {showError && (\n <ds-text\n class=\"error-text\"\n as=\"div\"\n variant=\"text-body-small\"\n color=\"negative\"\n textId={this.errorId}\n role=\"alert\"\n >\n {this.errorMessage}\n </ds-text>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["textareaCss","idCounter","Textarea","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","generatedId","errorId","value","disabled","readOnly","required","requiredMessage","DEFAULT_REQUIRED_MESSAGE","rows","resize","inputMode","enterKeyHint","spellCheck","size","width","hasBorder","hasInteractionFill","isInactive","autoFocus","error","ariaLabel","initialValue","formDisabled","focused","touched","handleInput","event","target","dsChange","emit","handleFocus","handleBlur","componentWillLoad","syncFormValue","inactive","setFormControlValue","internals","missing","length","setRequiredValidity","formDisabledCallback","formResetCallback","formStateRestoreCallback","state","restoreStringFormState","setFocus","textareaEl","focus","render","inputId","filled","dirty","showError","Boolean","errorMessage","textVariant","CONTROL_TEXT_VARIANT","Number","isFinite","Math","max","floor","describedBy","ariaDescribedby","undefined","filter","join","h","Host","key","class","controlWidthClass","ref","element","id","placeholder","autoComplete","spellcheck","replace","ariaLabelledby","onInput","onFocus","onBlur","as","variant","color","textId","role"],"sources":["src/wc/components/Textarea/Textarea.css?tag=ds-textarea&encapsulation=scoped","src/wc/components/Textarea/Textarea.tsx"],"sourcesContent":["@import '../../utils/interaction-fill.css';\n@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n@import '../../utils/control-density.css';\n@import '../../utils/control-width.css';\n@import '../../utils/field-stack.css';\n@import '../../utils/typography.css';\n@import '../../utils/forced-colors.css';\n\n:host(.textarea-host) {\n display: inline-flex;\n --ds-textarea-fg: var(--color-foreground-primary);\n --ds-textarea-placeholder: var(--color-foreground-secondary);\n --ds-textarea-placeholder-active: var(--color-foreground-quaternary);\n --ds-textarea-border: var(--color-border-secondary);\n}\n\n:host(.ds-control-width--fill),\n:host(.ds-control-width--fill) .textarea-control {\n width: 100%;\n}\n\n.textarea-control {\n display: flex;\n box-sizing: border-box;\n min-width: 0;\n overflow: hidden;\n background: transparent;\n border: none;\n border-radius: var(--ds-control-radius, var(--dimension-radius-025));\n color: var(--ds-textarea-fg);\n}\n\n.textarea-control--resizable {\n padding-block-end: var(--dimension-space-025);\n padding-inline-end: var(--dimension-space-025);\n}\n\n.textarea-control--bordered {\n --ds-interaction-border-width: var(--dimension-stroke-width-012);\n --ds-interaction-border-color: var(--ds-textarea-border);\n}\n\n.textarea-control--error {\n --ds-interaction-border-width: var(--dimension-stroke-width-018);\n --ds-interaction-border-color: var(--color-border-bold-negative);\n}\n\n.textarea-control--bordered:focus-within:not(.textarea-control--error) {\n --ds-interaction-border-width: var(--dimension-stroke-width-018);\n --ds-interaction-border-color: var(--color-border-bold-brand);\n}\n\n:host(.ds-control-inactive) .textarea-control::after {\n background: transparent;\n}\n\n.native-textarea {\n position: relative;\n z-index: 2;\n box-sizing: border-box;\n min-width: 0;\n width: 100%;\n padding-block: var(--ds-control-padding-inline, var(--dimension-space-075));\n padding-inline: calc(\n var(--ds-control-padding-inline, var(--dimension-space-075)) +\n var(--ds-control-label-inset, var(--dimension-space-025))\n );\n background: transparent;\n border: none;\n border-radius: inherit;\n outline: none;\n color: var(--ds-textarea-fg);\n font-family: inherit;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.native-textarea--resize-vertical {\n resize: vertical;\n}\n\n.native-textarea--resize-none {\n resize: none;\n}\n\n.native-textarea:disabled {\n cursor: not-allowed;\n}\n\n.native-textarea:read-only:not(:disabled) {\n cursor: default;\n}\n\n.native-textarea::placeholder {\n color: var(--ds-textarea-placeholder);\n}\n\n.native-textarea:focus::placeholder {\n color: var(--ds-textarea-placeholder-active);\n}\n\n.error-text {\n width: 100%;\n}\n\n@media (forced-colors: active) {\n .textarea-control--bordered:focus-within:not(.textarea-control--error)::after {\n outline-color: var(--ds-forced-color-selected);\n }\n\n .textarea-control--error::after {\n outline-style: dashed;\n }\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n Method,\n Prop,\n State,\n Watch,\n h,\n Host,\n} from '@stencil/core';\nimport {\n controlWidthClass,\n CONTROL_TEXT_VARIANT,\n DEFAULT_REQUIRED_MESSAGE,\n restoreStringFormState,\n setFormControlValue,\n setRequiredValidity,\n type ControlWidth,\n} from '../../utils';\n\nexport type TextareaSize = 'lg' | 'md' | 'sm' | 'xs';\nexport type TextareaWidth = ControlWidth;\nexport type TextareaResize = 'vertical' | 'none';\n\nlet idCounter = 0;\n\n@Component({\n tag: 'ds-textarea',\n styleUrl: 'Textarea.css',\n scoped: true,\n formAssociated: true,\n})\nexport class Textarea {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n private generatedId = `ds-textarea-${++idCounter}`;\n private errorId = `${this.generatedId}-error`;\n\n @Prop({ mutable: true }) value: string = '';\n @Prop({ reflect: true }) name: string | undefined;\n @Prop({ reflect: true }) form: string | undefined;\n @Prop({ reflect: true }) disabled: boolean = false;\n /** Keeps the value focusable and submittable while preventing edits. */\n @Prop({ reflect: true }) readOnly: boolean = false;\n @Prop({ reflect: true }) required: boolean = false;\n @Prop() requiredMessage: string = DEFAULT_REQUIRED_MESSAGE;\n @Prop() placeholder: string | undefined;\n /** Visible text rows before the field scrolls. */\n @Prop() rows: number = 4;\n /** Whether the user can resize the field vertically. */\n @Prop() resize: TextareaResize = 'vertical';\n /** Native browser autofill hint. */\n @Prop({ attribute: 'autocomplete' }) autoComplete: string | undefined;\n /** Preferred virtual keyboard without changing the value semantics. */\n @Prop({ attribute: 'inputmode' }) inputMode: string = '';\n /** Preferred virtual-keyboard action label. */\n @Prop({ attribute: 'enterkeyhint' }) enterKeyHint: string = '';\n /** Whether the browser should check spelling and grammar. */\n @Prop({ attribute: 'spellcheck' }) spellCheck: boolean = true;\n /** Control density for typography and inset spacing. */\n @Prop() size: TextareaSize = 'md';\n /** Width fit — fill the parent (default) or hug the available content. */\n @Prop() width: TextareaWidth = 'fill';\n /** Show the standard inset border, including focused and invalid strokes. */\n @Prop() hasBorder: boolean = true;\n /** Show the standard hover and pressed fill when the field is not embedded in interactive chrome. */\n @Prop() hasInteractionFill: boolean = true;\n @Prop() isInactive: boolean = false;\n @Prop() autoFocus: boolean = false;\n @Prop() error: boolean = false;\n @Prop() errorMessage: string | undefined;\n /** Associates the internal textarea with an external <label>. */\n @Prop() inputId: string | undefined;\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n @Prop({ attribute: 'aria-labelledby' }) ariaLabelledby: string | undefined;\n @Prop({ attribute: 'aria-describedby' }) ariaDescribedby: string | undefined;\n\n @Event() dsChange!: EventEmitter<string>;\n\n private initialValue = '';\n private textareaEl?: HTMLTextAreaElement;\n @State() private formDisabled = false;\n @State() private focused = false;\n @State() private touched = false;\n\n componentWillLoad() {\n this.initialValue = this.value;\n this.syncFormValue();\n }\n\n @Watch('value')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('required')\n syncFormValue() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n setFormControlValue(this.internals, this.value, { inactive });\n const missing = this.required && !inactive && this.value.length === 0;\n setRequiredValidity(this.internals, missing, this.requiredMessage);\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = restoreStringFormState(state);\n }\n\n @Method()\n async setFocus() {\n this.textareaEl?.focus();\n }\n\n private handleInput = (event: Event) => {\n this.value = (event.target as HTMLTextAreaElement).value;\n this.dsChange.emit(this.value);\n };\n\n private handleFocus = () => {\n this.focused = true;\n };\n\n private handleBlur = () => {\n this.focused = false;\n this.touched = true;\n };\n\n render() {\n const inputId = this.inputId ?? this.generatedId;\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n const filled = this.value.length > 0;\n const dirty = this.value !== this.initialValue;\n const showError = this.error && Boolean(this.errorMessage);\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const rows = Number.isFinite(this.rows) ? Math.max(1, Math.floor(this.rows)) : 4;\n const describedBy =\n [this.ariaDescribedby, showError ? this.errorId : undefined].filter(Boolean).join(' ') ||\n undefined;\n\n return (\n <Host\n class={{\n 'textarea-host': true,\n 'ds-field-stack': true,\n 'ds-control-inactive': inactive,\n [`ds-control--${this.size}`]: true,\n ...controlWidthClass(this.width),\n }}\n data-disabled={inactive ? '' : undefined}\n data-readonly={this.readOnly ? '' : undefined}\n data-required={this.required ? '' : undefined}\n data-invalid={this.error ? '' : undefined}\n data-filled={filled ? '' : undefined}\n data-focused={this.focused ? '' : undefined}\n data-dirty={dirty ? '' : undefined}\n data-touched={this.touched ? '' : undefined}\n >\n <div\n class={{\n 'textarea-control': true,\n 'textarea-control--resizable': this.resize === 'vertical',\n 'textarea-control--bordered': this.hasBorder,\n 'textarea-control--error': this.hasBorder && this.error,\n 'ds-interaction-fill': this.hasInteractionFill,\n [`ds-control--${this.size}`]: true,\n }}\n >\n <textarea\n ref={element => {\n this.textareaEl = element;\n }}\n id={inputId}\n value={this.value}\n placeholder={this.placeholder}\n rows={rows}\n disabled={inactive}\n readOnly={this.readOnly}\n required={this.required}\n autoFocus={this.autoFocus}\n autoComplete={this.autoComplete}\n inputMode={this.inputMode || undefined}\n enterKeyHint={this.enterKeyHint || undefined}\n spellcheck={this.spellCheck}\n class={`native-textarea native-textarea--resize-${this.resize} ds-text--${textVariant.replace('text-', '')} ds-text--regular ds-interaction-fill__content`}\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledby}\n aria-describedby={describedBy}\n aria-invalid={this.error ? 'true' : undefined}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n </div>\n {showError && (\n <ds-text\n class=\"error-text\"\n as=\"div\"\n variant=\"text-body-small\"\n color=\"negative\"\n textId={this.errorId}\n role=\"alert\"\n >\n {this.errorMessage}\n </ds-text>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as s,c as i,h as e,a as o,t as n}from"./index.js";import{c as a,r}from"./p-DjF2m7bf.js";import{d as c}from"./p-rSC7ZUpy.js";import{d as h}from"./p-oAbq-DLk.js";import{d}from"./p-Cea7rROU.js";import{d as l}from"./p-0XTyQNRG.js";import{d as f}from"./p-aMyflqva.js";import{d as u}from"./p-CN8PQLZu.js";import{T as m,r as p,a as v}from"./p-CUL5_8JM.js";import{r as g}from"./p-CochmPyg.js";function w(t,s){const i=typeof t==="function"?t(s):t;return typeof i==="string"?{description:i}:i}class b{constructor(){this.records=[];this.listeners=new Set;this.nextId=0}add(t){const s=t.id||`ds-toast-${++this.nextId}`;const i=this.records.findIndex((t=>t.id===s));if(!t.title?.trim()&&!t.description?.trim()){console.warn(`[ds-toast] Toast "${s}" should provide a title or description.`)}if(i>=0){const e=this.records[i];const o={...e,...t,id:s,priority:t.priority??e.priority,transitionStatus:"active",closeReason:undefined,updateKey:e.updateKey+1,timerKey:e.timerKey+1};this.records=[o,...this.records.filter(((t,s)=>s!==i))];this.emit();return s}const e={...t,id:s,priority:t.priority??"low",transitionStatus:"starting",updateKey:0,timerKey:0};this.records=[e,...this.records];this.emit();return s}update(t,s){const i=this.records.findIndex((s=>s.id===t));if(i<0)return;const e=this.records[i];const o=Object.prototype.hasOwnProperty.call(s,"timeout")||e.type==="loading"&&s.type!==undefined&&s.type!=="loading";const n={...e,...s,id:t,priority:s.priority??e.priority,updateKey:e.updateKey+1,timerKey:o?e.timerKey+1:e.timerKey};this.records=this.records.map(((t,s)=>s===i?n:t));this.emit()}close(t,s="programmatic"){const i=this.records.findIndex((s=>s.id===t));if(i<0||this.records[i].transitionStatus==="ending")return;const e={...this.records[i],transitionStatus:"ending",closeReason:s};this.records=this.records.map(((t,s)=>s===i?e:t));this.emit();e.onClose?.({id:t,reason:s,toast:e})}closeAll(t="programmatic"){for(const s of[...this.records])this.close(s.id,t)}async promise(t,s){const i=w(s.loading,undefined);const e=this.add({...i,type:i.type??"loading",timeout:0});try{const i=await t;const o=w(s.success,i);this.update(e,{...o,type:o.type??"success",timeout:o.timeout});return i}catch(t){const i=w(s.error,t);this.update(e,{...i,type:i.type??"error",timeout:i.timeout});throw t}}subscribe(t){this.listeners.add(t);t(this.getSnapshot());return()=>{this.listeners.delete(t)}}getSnapshot(){return this.records.map((t=>({...t})))}activate(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="starting")return;this.records=this.records.map((s=>s.id===t?{...s,transitionStatus:"active"}:s));this.emit()}remove(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="ending")return null;const i=s.closeReason??"programmatic";this.records=this.records.filter((s=>s.id!==t));this.emit();const e={id:t,reason:i,toast:s};return e}notifyRemove(t){const{toast:s}=t;s.onRemove?.(t)}emit(){const t=this.getSnapshot();for(const s of this.listeners)s(t)}}function y(){return new b}const x=Symbol.for("@ds-mo/ui/default-toast-manager");const T=globalThis;const M=T[x];const k=M??y();if(!M)T[x]=k;const A=()=>`.ds-visually-hidden.sc-ds-toast-h,.ds-visually-hidden.sc-ds-toast{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}@media (forced-colors: active){.sc-ds-toast:root,.sc-ds-toast-h,.ds-forced-colors-scope.sc-ds-toast{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-toast-h{display:contents}.toast-region.sc-ds-toast{position:fixed;inset:0;z-index:var(--dimension-z-index-floating);pointer-events:none;outline:none}.toast-viewport.sc-ds-toast{position:absolute;right:var(--dimension-space-200);bottom:var(--dimension-space-200);display:grid;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)))}@media (max-width: 767px){[avoid-mobile-shell-bar].sc-ds-toast-h .toast-viewport.sc-ds-toast{bottom:calc( var(--dimension-space-200) + var(--dimension-stroke-width-012) + var(--dimension-space-100) + var(--dimension-size-500) + max(var(--dimension-space-100), env(safe-area-inset-bottom)) )}}.toast-positioner.sc-ds-toast{grid-area:1 / 1;align-self:end;justify-self:center;width:100%;pointer-events:auto;transform:translateY(calc(-1 * var(--toast-index) * var(--dimension-space-100)));transition:transform var(--effect-motion-short-3), width var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner.sc-ds-toast{width:calc(100% - 2 * var(--toast-index) * var(--dimension-space-100))}.toast-viewport[data-expanded].sc-ds-toast .toast-positioner.sc-ds-toast{transform:translateY(calc(-1 * var(--toast-offset-y)))}.toast-positioner[data-limited].sc-ds-toast{visibility:hidden;pointer-events:none}.toast-positioner--anchored.sc-ds-toast{position:fixed;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)));transform:none}.toast-positioner--anchored[data-positioned='false'].sc-ds-toast{visibility:hidden}.toast-surface.sc-ds-toast{position:relative;display:block;box-sizing:border-box;width:100%;height:var(--toast-height, auto);padding:var(--dimension-space-200);overflow:hidden;color:var(--color-foreground-primary);background-color:var(--color-background-primary);border-radius:var(--dimension-radius-050);box-shadow:var(--effect-elevation-elevated-floating);transform:translate(var(--toast-swipe-movement-x), var(--toast-swipe-movement-y));animation:toast-enter var(--effect-motion-short-2) both}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{animation:toast-exit var(--effect-motion-short-3) both}.toast-surface--swiping.sc-ds-toast{transition:none;user-select:none}.toast-content.sc-ds-toast{display:flex;flex-direction:column;min-width:0;padding-inline-end:var(--dimension-size-500);transition:opacity var(--effect-motion-short-3)}.toast-copy.sc-ds-toast{display:flex;flex-direction:column;min-width:0;min-height:var(--typography-lineheight-md);margin-block:calc(-1 * var(--dimension-space-025));gap:var(--dimension-space-050)}.toast-title.sc-ds-toast,.toast-description.sc-ds-toast{min-width:0}.toast-action.sc-ds-toast{align-self:start;margin-top:calc(var(--dimension-space-200) + var(--dimension-space-025))}.toast-close.sc-ds-toast{position:absolute;top:var(--dimension-space-100);right:var(--dimension-space-100);transition:opacity var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-content.sc-ds-toast,.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-close.sc-ds-toast{opacity:0}@keyframes toast-enter{from{opacity:0;transform:translateY(var(--dimension-space-100))}to{opacity:1;transform:translateY(0)}}@keyframes toast-exit{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.toast-positioner.sc-ds-toast,.toast-surface.sc-ds-toast,.toast-content.sc-ds-toast,.toast-close.sc-ds-toast,.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{transition:none;animation:none}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{opacity:0}}@media (forced-colors: active){.toast-surface.sc-ds-toast{box-shadow:none;outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}}`;const C=40;const P=10;const S="__global-stack__";const E='button,a,input,textarea,select,[role="button"],[data-ds-toast-swipe-ignore]';const F=new WeakMap;const D=new Set;let R=null;let j=0;const L=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.dsToastClose=i(this,"dsToastClose",7);this.dsToastRemove=i(this,"dsToastRemove",7);this.dsToastAction=i(this,"dsToastAction",7);this.manager=k;this.limit=3;this.timeout=m.animationDelayLong2;this.label="Notifications";this.closeLabel="Close notification";this.avoidMobileShellBar=false;this.swipeDirections=["down","right"];this.records=[];this.expanded=false;this.keyboardActive=false;this.swipe=null;this.layoutVersion=0;this.instanceId=++j;this.domIds=new Map;this.timers=new Map;this.closeWatchdogs=new Map;this.closeFrames=new Map;this.closeEvents=new Set;this.activationFrames=new Map;this.pauseReasons=new Set;this.hoveredIds=new Set;this.heights=new Map;this.measuredUpdateKeys=new Map;this.anchoredPositions=new Map;this.dismissedSwipeDirections=new Map;this.observedElements=new Set;this.pendingRemovals=[];this.unsubscribe=null;this.attachedManager=null;this.previousFocus=null;this.resizeObserver=null;this.mutationObserver=null;this.layoutFrame=null;this.activeSwipe=null;this.nextDomId=0;this.connected=false;this.pendingHoverLeave=false;this.handleWindowBlur=()=>this.pauseTimers("window");this.handleWindowFocus=()=>this.resumeTimers("window");this.handleVisibilityChange=()=>{if(document.hidden)this.pauseTimers("document");else this.resumeTimers("document")};this.handleFocusIn=()=>{const t=document.activeElement;if(!(t instanceof s)||!t.matches(":focus-visible"))return;R=this;this.keyboardActive=true;this.expanded=true;this.pauseTimers("focus")};this.handleFocusOut=t=>{const s=t.relatedTarget;if(s instanceof Node&&this.el.contains(s))return;if(!this.keyboardActive)return;this.keyboardActive=false;this.expanded=this.hoveredIds.size>0;this.resumeTimers("focus")};this.handleDocumentKeyDown=t=>{if(t.key!=="F6")return;const s=Array.from(D).filter((t=>t.activeRecords.length>0));const i=R&&R.activeRecords.length?R:s[s.length-1];if(i!==this)return;t.preventDefault();if(!this.el.contains(document.activeElement)){this.previousFocus=document.activeElement}this.keyboardActive=true;this.regionElement?.focus()};this.handleRegionKeyDown=t=>{if(t.key==="Escape"){const s=t.target;const i=s.closest(".toast-positioner");const e=i?.dataset["toastId"]??this.activeRecords[0]?.id;if(e){t.preventDefault();this.manager.close(e,"escape")}return}if(t.key==="Tab"&&t.shiftKey&&t.target===this.regionElement){t.preventDefault();this.restorePreviousFocus()}};this.handleWindowResize=()=>{this.heights.clear();this.measuredUpdateKeys.clear();this.layoutVersion+=1;this.scheduleLayout()};this.scheduleLayout=()=>{if(this.layoutFrame!==null)return;this.layoutFrame=requestAnimationFrame((()=>{this.layoutFrame=null;this.measureLayout()}))}}connectedCallback(){this.connect()}componentDidLoad(){this.connect()}connect(){if(this.connected)return;this.connected=true;this.resizeObserver??(this.resizeObserver=new ResizeObserver((()=>this.scheduleLayout())));this.mutationObserver??(this.mutationObserver=new MutationObserver((()=>this.scheduleLayout())));this.mutationObserver.observe(document.body,{childList:true,subtree:true});if(!this.unsubscribe)this.attachManager(this.manager);window.addEventListener("blur",this.handleWindowBlur);window.addEventListener("focus",this.handleWindowFocus);window.addEventListener("resize",this.handleWindowResize);window.addEventListener("scroll",this.scheduleLayout,true);document.addEventListener("keydown",this.handleDocumentKeyDown);document.addEventListener("visibilitychange",this.handleVisibilityChange);D.add(this);if(!R)R=this}componentDidRender(){this.syncObservedElements();this.flushPendingRemovals();this.scheduleLayout()}disconnectedCallback(){this.connected=false;this.flushPendingRemovals();this.detachManager();this.resetManagerState();this.resizeObserver?.disconnect();this.resizeObserver=null;this.mutationObserver?.disconnect();this.mutationObserver=null;this.observedElements.clear();if(this.layoutFrame!==null)cancelAnimationFrame(this.layoutFrame);this.layoutFrame=null;window.removeEventListener("blur",this.handleWindowBlur);window.removeEventListener("focus",this.handleWindowFocus);window.removeEventListener("resize",this.handleWindowResize);window.removeEventListener("scroll",this.scheduleLayout,true);document.removeEventListener("keydown",this.handleDocumentKeyDown);document.removeEventListener("visibilitychange",this.handleVisibilityChange);D.delete(this);if(R===this){const t=Array.from(D);R=t[t.length-1]??null}}onManagerChange(t){this.detachManager();this.resetManagerState();if(this.connected)this.attachManager(t)}onTimeoutChange(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}this.timers.clear();this.syncTimers()}attachManager(t){const s=F.get(t);if(s&&s!==this){console.warn("[ds-toast] A manager can control only one connected ds-toast instance.");return}F.set(t,this);this.attachedManager=t;this.unsubscribe=t.subscribe((t=>{this.records=t;this.syncLifecycle(t);this.scheduleLayout()}))}detachManager(){this.unsubscribe?.();this.unsubscribe=null;if(this.attachedManager&&F.get(this.attachedManager)===this){F.delete(this.attachedManager)}this.attachedManager=null}resetManagerState(){this.flushPendingRemovals();if(this.el.contains(document.activeElement))this.restorePreviousFocus();this.clearAllTimers();for(const t of this.activationFrames.values())cancelAnimationFrame(t);for(const t of this.closeFrames.values())cancelAnimationFrame(t);this.activationFrames.clear();this.closeFrames.clear();this.closeEvents.clear();this.pauseReasons.clear();this.hoveredIds.clear();this.pendingHoverLeave=false;this.heights.clear();this.measuredUpdateKeys.clear();this.anchoredPositions.clear();this.dismissedSwipeDirections.clear();this.domIds.clear();this.activeSwipe=null;this.swipe=null;this.expanded=false;this.keyboardActive=false;this.records=[];this.resizeObserver?.disconnect();this.observedElements.clear()}syncObservedElements(){const t=new Set(this.el.querySelectorAll(".toast-positioner"));for(const s of this.records){if(!s.positioner)continue;const i=this.resolveAnchor(s.positioner.anchor);if(i)t.add(i)}for(const s of this.observedElements){if(!t.has(s)){this.resizeObserver?.unobserve(s);this.observedElements.delete(s)}}for(const s of t){if(this.observedElements.has(s))continue;this.resizeObserver?.observe(s);this.observedElements.add(s)}}flushPendingRemovals(){for(const t of this.pendingRemovals.splice(0)){t.manager.notifyRemove(t.context);this.dsToastRemove.emit({id:t.context.id,toast:t.context.toast})}}syncLifecycle(t){const s=new Set(t.map((t=>t.id)));for(const t of this.hoveredIds){if(t!==S&&!s.has(t))this.hoveredIds.delete(t)}const i=t.some((t=>t.transitionStatus==="ending"));if(this.pendingHoverLeave&&!i&&!this.hoveredIds.size){this.pendingHoverLeave=false;this.expanded=false;this.resumeTimers("hover")}else if(!this.hoveredIds.size&&!this.pendingHoverLeave){this.resumeTimers("hover")}for(const[t,i]of this.timers){if(s.has(t))continue;if(i.handle)clearTimeout(i.handle);this.timers.delete(t)}for(const[t,i]of this.closeWatchdogs){if(s.has(t))continue;clearTimeout(i);this.closeWatchdogs.delete(t)}for(const[t,i]of this.activationFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.activationFrames.delete(t)}for(const[t,i]of this.closeFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.closeFrames.delete(t)}for(const t of this.domIds.keys()){if(s.has(t))continue;this.closeEvents.delete(t);this.domIds.delete(t);this.heights.delete(t);this.measuredUpdateKeys.delete(t);this.anchoredPositions.delete(t);this.dismissedSwipeDirections.delete(t)}for(const s of t){this.ensureDomId(s.id);if(s.transitionStatus==="starting"&&!this.activationFrames.has(s.id)){const t=this.attachedManager;const i=requestAnimationFrame((()=>{this.activationFrames.delete(s.id);t?.activate(s.id)}));this.activationFrames.set(s.id,i)}if(s.transitionStatus==="ending"){this.clearToastTimer(s.id);this.beginRemoval(s)}else{const t=this.closeWatchdogs.get(s.id);if(t)clearTimeout(t);this.closeWatchdogs.delete(s.id);const i=this.closeFrames.get(s.id);if(i)cancelAnimationFrame(i);this.closeFrames.delete(s.id);this.closeEvents.delete(s.id)}}this.syncTimers()}syncTimers(){const t=new Set;for(const s of this.records){if(s.transitionStatus!=="active")continue;t.add(s.id);const i=this.resolveToastTimeout(s);if(i<=0){this.clearToastTimer(s.id);continue}const e=this.timers.get(s.id);if(!e||e.timerKey!==s.timerKey){this.clearToastTimer(s.id);this.timers.set(s.id,{timerKey:s.timerKey,remaining:i,startedAt:0,handle:null})}if(!this.isPaused)this.startToastTimer(s.id)}for(const s of this.timers.keys()){if(!t.has(s))this.clearToastTimer(s)}}resolveToastTimeout(t){const s=t.timeout??this.timeout;if(typeof s==="number")return Math.max(0,s);return p(s,m.animationDelayLong2)}startToastTimer(t){const s=this.timers.get(t);if(!s||s.handle||s.remaining<=0)return;s.startedAt=Date.now();s.handle=setTimeout((()=>{s.handle=null;s.remaining=0;this.manager.close(t,"timeout")}),s.remaining)}pauseTimers(t){const s=this.isPaused;this.pauseReasons.add(t);if(s)return;const i=Date.now();for(const t of this.timers.values()){if(!t.handle)continue;clearTimeout(t.handle);t.handle=null;t.remaining=Math.max(0,t.remaining-(i-t.startedAt))}}resumeTimers(t){this.pauseReasons.delete(t);if(this.isPaused)return;for(const t of this.timers.keys())this.startToastTimer(t)}get isPaused(){return this.pauseReasons.size>0}clearToastTimer(t){const s=this.timers.get(t);if(s?.handle)clearTimeout(s.handle);this.timers.delete(t)}clearAllTimers(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}for(const t of this.closeWatchdogs.values())clearTimeout(t);this.timers.clear();this.closeWatchdogs.clear()}beginRemoval(t){if(!this.closeEvents.has(t.id)){this.closeEvents.add(t.id);this.dsToastClose.emit({id:t.id,reason:t.closeReason??"programmatic",toast:t});this.moveFocusAfterClose(t.id)}if(this.closeWatchdogs.has(t.id)||this.closeFrames.has(t.id))return;const s=v(m.motionShort3,m.animationDurationShort3);if(s<=0){queueMicrotask((()=>this.completeRemoval(t)));return}const i=requestAnimationFrame((()=>{this.closeFrames.delete(t.id);const i=this.records.find((s=>s.id===t.id));if(!i||i.transitionStatus!=="ending")return;this.closeWatchdogs.set(t.id,setTimeout((()=>this.completeRemoval(i)),s))}));this.closeFrames.set(t.id,i)}completeRemoval(t){const s=this.records.find((s=>s.id===t.id));if(!s||s.transitionStatus!=="ending")return;const i=this.closeWatchdogs.get(t.id);if(i)clearTimeout(i);this.closeWatchdogs.delete(t.id);const e=this.closeFrames.get(t.id);if(e)cancelAnimationFrame(e);this.closeFrames.delete(t.id);const o=this.attachedManager;const n=o?.remove(t.id);if(o&&n)this.pendingRemovals.push({manager:o,context:n})}handleAnimationComplete(t){if(t.transitionStatus==="ending")this.completeRemoval(t)}bindAnimationCancel(t,s){if(!t||t.dataset["cancelBound"]==="true")return;t.dataset["cancelBound"]="true";t.addEventListener("animationcancel",(()=>{const t=this.records.find((t=>t.id===s));if(t)this.handleAnimationComplete(t)}))}handlePointerEnter(t){R=this;this.pendingHoverLeave=false;this.hoveredIds.add(t);this.expanded=true;this.pauseTimers("hover")}handlePointerLeave(t){this.hoveredIds.delete(t);if(this.hoveredIds.size)return;if(this.records.some((t=>t.transitionStatus==="ending"))){this.pendingHoverLeave=true;return}this.expanded=false;this.resumeTimers("hover")}get regionElement(){return this.el.querySelector(".toast-region")}restorePreviousFocus(){this.previousFocus?.focus?.();this.previousFocus=null;this.keyboardActive=false}moveFocusAfterClose(t){const s=document.activeElement;const i=this.positionerElement(t);if(!s||!i?.contains(s))return;requestAnimationFrame((()=>{const s=this.activeRecords.find((s=>s.id!==t));const i=s?this.positionerElement(s.id)?.querySelector("ds-button-unfilled"):null;if(i?.setFocus)void i.setFocus();else if(s)this.regionElement?.focus();else this.restorePreviousFocus()}))}handleAction(t,s){const i={id:t.id,toast:t,originalEvent:s.detail};this.dsToastAction.emit(i);t.action?.onAction?.({id:t.id,data:t.data,manager:this.manager,originalEvent:s.detail})}handlePointerDown(t,s){if(s.button!==0)return;const i=s.target;if(i.closest(E))return;const e=s.currentTarget;e.setPointerCapture(s.pointerId);this.activeSwipe={id:t.id,pointerId:s.pointerId,pointerType:s.pointerType,startX:s.clientX,startY:s.clientY,maxDistance:0,cancelled:false,axis:null};this.swipe={id:t.id,x:0,y:0};if(s.pointerType==="touch")this.pauseTimers("swipe")}handlePointerMove(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId||s.cancelled)return;const i=t.clientX-s.startX;const e=t.clientY-s.startY;if(!s.axis&&Math.max(Math.abs(i),Math.abs(e))>1){s.axis=Math.abs(i)>=Math.abs(e)?"x":"y"}if(!s.axis)return;const o=s.axis==="x";const n=o?i>=0?"right":"left":e>=0?"down":"up";const a=this.swipeDirections.includes(n);const r=o?Math.abs(i):Math.abs(e);const c=a?r:Math.sqrt(r);const h=(o?i:e)<0?-c:c;const d=o?h:0;const l=o?0:h;if(s.maxDistance-c>=P){s.cancelled=true;this.cancelSwipe();return}s.maxDistance=Math.max(s.maxDistance,c);if(r>1)t.preventDefault();this.swipe={id:s.id,x:d,y:l,direction:a?n:undefined}}handlePointerUp(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId)return;const i=this.swipe;const e=i?Math.max(Math.abs(i.x),Math.abs(i.y)):0;const o=!s.cancelled&&!!i?.direction&&e>=C;const n=s.id;const a=s.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(a)this.resumeTimers("swipe");if(o&&i.direction){this.dismissedSwipeDirections.set(n,i.direction);this.manager.close(n,"swipe")}}handlePointerCancel(t){if(this.activeSwipe?.pointerId!==t.pointerId)return;this.cancelSwipe()}cancelSwipe(){const t=this.activeSwipe?.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(t)this.resumeTimers("swipe")}get touchAction(){const t=this.swipeDirections.includes("left")||this.swipeDirections.includes("right");const s=this.swipeDirections.includes("up")||this.swipeDirections.includes("down");if(t&&s)return"none";if(t)return"pan-y";if(s)return"pan-x";return"auto"}measureNaturalHeight(t,s){const i=t.querySelector(".toast-surface");if(!i)return 0;const e=t.style.width;const o=t.style.transition;const n=i.style.height;if(s){t.style.transition="none";t.style.width="100%"}i.style.height="auto";const a=i.getBoundingClientRect().height;i.style.height=n;if(s){t.style.width=e;t.getBoundingClientRect();t.style.transition=o}return a}measureLayout(){let t=false;for(const s of this.records){const i=this.positionerElement(s.id);if(!i)continue;let e=this.heights.get(s.id)??0;const o=e<=0||this.measuredUpdateKeys.get(s.id)!==s.updateKey;if(o){e=this.measureNaturalHeight(i,!s.positioner);if(e>0){if(this.heights.get(s.id)!==e)t=true;this.heights.set(s.id,e);this.measuredUpdateKeys.set(s.id,s.updateKey)}}if(!s.positioner)continue;const n=this.resolveAnchor(s.positioner.anchor);if(!n||e<=0){if(this.anchoredPositions.delete(s.id))t=true;continue}const c=i.getBoundingClientRect();const h=g(s.positioner.sideOffset,m.space050);const d=g(s.positioner.alignOffset,0);const l=a({anchorRect:n.getBoundingClientRect(),popupWidth:c.width,popupHeight:e,side:s.positioner.side??"top",align:s.positioner.align??"center",sideOffsetPx:h,alignOffsetPx:d,viewportPadPx:g(undefined,m.space200),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,collisionRect:r(n)});const f=this.anchoredPositions.get(s.id);if(!f||f.x!==l.x||f.y!==l.y||f.side!==l.resolvedSide){this.anchoredPositions.set(s.id,{x:l.x,y:l.y,side:l.resolvedSide});t=true}}if(t)this.layoutVersion+=1}resolveAnchor(t){return typeof t==="string"?document.getElementById(t):t}positionerElement(t){return Array.from(this.el.querySelectorAll(".toast-positioner")).find((s=>s.dataset["toastId"]===t))??null}ensureDomId(t){const s=this.domIds.get(t);if(s)return s;const i=++this.nextDomId;this.domIds.set(t,i);return i}get activeRecords(){return this.records.filter((t=>t.transitionStatus!=="ending"))}globalLayout(){const t=this.records.filter((t=>!t.positioner));let s=0;let i=0;const e=g(undefined,m.space200);const o=new Map;t.forEach(((t,n)=>{if(t.transitionStatus==="ending"){o.set(t.id,{index:n,offset:s,limited:false});return}const a=i>=Math.max(1,this.limit);o.set(t.id,{index:i,offset:s,limited:a});s+=(this.heights.get(t.id)??0)+e;i+=1}));return o}renderToast(t,s){const i=this.ensureDomId(t.id);const o=`ds-toast-${this.instanceId}-${i}-title`;const n=`ds-toast-${this.instanceId}-${i}-description`;const a=this.swipe?.id===t.id?this.swipe:null;const r=a?.direction??this.dismissedSwipeDirections.get(t.id);const c=!!t.positioner;const h=this.anchoredPositions.get(t.id);const d=t.priority==="high"&&!this.keyboardActive;const l=this.keyboardActive&&!s.limited?0:-1;const f=this.heights.get(t.id);return e("div",{ref:s=>this.bindAnimationCancel(s,t.id),class:{"toast-positioner":true,"toast-positioner--anchored":c,"toast-positioner--ending":t.transitionStatus==="ending"},"data-toast-id":t.id,"data-behind":!c&&s.index>0?"":undefined,"data-limited":s.limited?"":undefined,"data-positioned":c?String(!!h):undefined,"data-side":h?.side,inert:s.limited?true:undefined,"aria-hidden":s.limited?"true":undefined,style:{"--toast-index":String(s.index),"--toast-offset-y":`${s.offset}px`,"--toast-height":f?`${f}px`:undefined,zIndex:String(this.records.length-s.index),left:h?`${h.x}px`:undefined,top:h?`${h.y}px`:undefined},onAnimationEnd:()=>this.handleAnimationComplete(t)},e("div",{class:{"toast-surface":true,"toast-surface--swiping":!!a},role:t.priority==="high"?"alertdialog":"dialog","aria-modal":"false","aria-labelledby":t.title?o:t.description?n:undefined,"aria-describedby":t.title&&t.description?n:undefined,"aria-hidden":d?"true":undefined,"data-type":t.type,"data-priority":t.priority,"data-transition-status":t.transitionStatus,"data-swiping":a?"":undefined,"data-swipe-direction":r,style:{"--toast-swipe-movement-x":`${a?.x??0}px`,"--toast-swipe-movement-y":`${a?.y??0}px`,touchAction:this.touchAction},onPointerDown:s=>this.handlePointerDown(t,s),onPointerMove:t=>this.handlePointerMove(t),onPointerUp:t=>this.handlePointerUp(t),onPointerCancel:t=>this.handlePointerCancel(t),onPointerEnter:c?()=>this.handlePointerEnter(t.id):undefined,onPointerLeave:c?()=>this.handlePointerLeave(t.id):undefined},e("div",{class:"toast-content"},e("div",{class:"toast-copy"},t.title&&e("ds-text",{class:"toast-title",as:"div",variant:"text-title-small",color:"primary",textId:o},t.title),t.description&&e("ds-text",{class:"toast-description",as:"div",variant:"text-body-medium",color:"secondary",textId:n},t.description)),t.action&&e("ds-button-unfilled",{class:"toast-action",variant:"label",size:"md",type:"button",label:t.action.label,"aria-label":t.action.ariaLabel,hasBorder:true,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:s=>this.handleAction(t,s)})),e("ds-button-unfilled",{class:"toast-close",variant:"icon",size:"md",type:"button",icon:"Cross","aria-label":this.closeLabel,hasBorder:false,activeFill:false,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:()=>this.manager.close(t.id,"close-button")})))}render(){const t=this.globalLayout();const s=this.records.filter((t=>!t.positioner));const i=this.records.filter((t=>!!t.positioner));const n=this.records.filter((s=>s.priority==="high"&&s.transitionStatus!=="ending"&&!t.get(s.id)?.limited));return e(o,{key:"64b89c8f62ae480eb42b41643cc6fb21ece56cb7"},e("section",{key:"a44a83908627ec3cbe5bbd7e434627b6dc49a19a",class:"toast-region",role:"region","aria-label":this.label,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",tabIndex:-1,onFocusin:this.handleFocusIn,onFocusout:t=>this.handleFocusOut(t),onKeyDown:t=>this.handleRegionKeyDown(t)},e("div",{key:"a3fc44accad5aff9990b768195254d5fd1d8ec9f",class:"toast-viewport","data-expanded":this.expanded?"":undefined,onPointerEnter:()=>this.handlePointerEnter(S),onPointerLeave:()=>this.handlePointerLeave(S)},s.map((s=>this.renderToast(s,t.get(s.id)??{index:0,offset:0,limited:false})))),e("div",{key:"fc05900e9c57ee5e0727895978cf5e7619903500",class:"toast-anchored-layer"},i.map((t=>this.renderToast(t,{index:0,offset:0,limited:false})))),e("div",{key:"9d28556aebde56f952af6dd3b8304ef67e3a0ae7",class:"toast-assertive-announcer ds-visually-hidden"},n.map((t=>e("div",{role:"alert","aria-atomic":"true"},[t.title,t.description].filter(Boolean).join(". ")))))))}get el(){return this}static get watchers(){return{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}}static get style(){return A()}},[2,"ds-toast",{manager:[16],limit:[2],timeout:[8],label:[1],closeLabel:[1,"close-label"],avoidMobileShellBar:[516,"avoid-mobile-shell-bar"],swipeDirections:[16],records:[32],expanded:[32],keyboardActive:[32],swipe:[32],layoutVersion:[32]},undefined,{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}]);function $(){if(typeof customElements==="undefined"){return}const t=["ds-toast","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];t.forEach((t=>{switch(t){case"ds-toast":if(!customElements.get(n(t))){customElements.define(n(t),L)}break;case"ds-badge":if(!customElements.get(n(t))){c()}break;case"ds-button-unfilled":if(!customElements.get(n(t))){h()}break;case"ds-icon":if(!customElements.get(n(t))){d()}break;case"ds-loader":if(!customElements.get(n(t))){l()}break;case"ds-text":if(!customElements.get(n(t))){f()}break;case"ds-tooltip":if(!customElements.get(n(t))){u()}break}}))}$();const z=L;const I=$;export{z as DsToast,I as defineCustomElement};
|
|
1
|
+
import{p as t,H as s,c as i,h as e,a as o,t as n}from"./index.js";import{c as a,r}from"./p-DjF2m7bf.js";import{d as c}from"./p-rSC7ZUpy.js";import{d as h}from"./p--yvQzZoO.js";import{d}from"./p-Cea7rROU.js";import{d as l}from"./p-0XTyQNRG.js";import{d as f}from"./p-aMyflqva.js";import{d as u}from"./p-CN8PQLZu.js";import{T as m,r as p,a as v}from"./p-CUL5_8JM.js";import{r as g}from"./p-CochmPyg.js";function w(t,s){const i=typeof t==="function"?t(s):t;return typeof i==="string"?{description:i}:i}class b{constructor(){this.records=[];this.listeners=new Set;this.nextId=0}add(t){const s=t.id||`ds-toast-${++this.nextId}`;const i=this.records.findIndex((t=>t.id===s));if(!t.title?.trim()&&!t.description?.trim()){console.warn(`[ds-toast] Toast "${s}" should provide a title or description.`)}if(i>=0){const e=this.records[i];const o={...e,...t,id:s,priority:t.priority??e.priority,transitionStatus:"active",closeReason:undefined,updateKey:e.updateKey+1,timerKey:e.timerKey+1};this.records=[o,...this.records.filter(((t,s)=>s!==i))];this.emit();return s}const e={...t,id:s,priority:t.priority??"low",transitionStatus:"starting",updateKey:0,timerKey:0};this.records=[e,...this.records];this.emit();return s}update(t,s){const i=this.records.findIndex((s=>s.id===t));if(i<0)return;const e=this.records[i];const o=Object.prototype.hasOwnProperty.call(s,"timeout")||e.type==="loading"&&s.type!==undefined&&s.type!=="loading";const n={...e,...s,id:t,priority:s.priority??e.priority,updateKey:e.updateKey+1,timerKey:o?e.timerKey+1:e.timerKey};this.records=this.records.map(((t,s)=>s===i?n:t));this.emit()}close(t,s="programmatic"){const i=this.records.findIndex((s=>s.id===t));if(i<0||this.records[i].transitionStatus==="ending")return;const e={...this.records[i],transitionStatus:"ending",closeReason:s};this.records=this.records.map(((t,s)=>s===i?e:t));this.emit();e.onClose?.({id:t,reason:s,toast:e})}closeAll(t="programmatic"){for(const s of[...this.records])this.close(s.id,t)}async promise(t,s){const i=w(s.loading,undefined);const e=this.add({...i,type:i.type??"loading",timeout:0});try{const i=await t;const o=w(s.success,i);this.update(e,{...o,type:o.type??"success",timeout:o.timeout});return i}catch(t){const i=w(s.error,t);this.update(e,{...i,type:i.type??"error",timeout:i.timeout});throw t}}subscribe(t){this.listeners.add(t);t(this.getSnapshot());return()=>{this.listeners.delete(t)}}getSnapshot(){return this.records.map((t=>({...t})))}activate(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="starting")return;this.records=this.records.map((s=>s.id===t?{...s,transitionStatus:"active"}:s));this.emit()}remove(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="ending")return null;const i=s.closeReason??"programmatic";this.records=this.records.filter((s=>s.id!==t));this.emit();const e={id:t,reason:i,toast:s};return e}notifyRemove(t){const{toast:s}=t;s.onRemove?.(t)}emit(){const t=this.getSnapshot();for(const s of this.listeners)s(t)}}function y(){return new b}const x=Symbol.for("@ds-mo/ui/default-toast-manager");const T=globalThis;const M=T[x];const k=M??y();if(!M)T[x]=k;const A=()=>`.ds-visually-hidden.sc-ds-toast-h,.ds-visually-hidden.sc-ds-toast{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}@media (forced-colors: active){.sc-ds-toast:root,.sc-ds-toast-h,.ds-forced-colors-scope.sc-ds-toast{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-toast-h{display:contents}.toast-region.sc-ds-toast{position:fixed;inset:0;z-index:var(--dimension-z-index-floating);pointer-events:none;outline:none}.toast-viewport.sc-ds-toast{position:absolute;right:var(--dimension-space-200);bottom:var(--dimension-space-200);display:grid;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)))}@media (max-width: 767px){[avoid-mobile-shell-bar].sc-ds-toast-h .toast-viewport.sc-ds-toast{bottom:calc( var(--dimension-space-200) + var(--dimension-stroke-width-012) + var(--dimension-space-100) + var(--dimension-size-500) + max(var(--dimension-space-100), env(safe-area-inset-bottom)) )}}.toast-positioner.sc-ds-toast{grid-area:1 / 1;align-self:end;justify-self:center;width:100%;pointer-events:auto;transform:translateY(calc(-1 * var(--toast-index) * var(--dimension-space-100)));transition:transform var(--effect-motion-short-3), width var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner.sc-ds-toast{width:calc(100% - 2 * var(--toast-index) * var(--dimension-space-100))}.toast-viewport[data-expanded].sc-ds-toast .toast-positioner.sc-ds-toast{transform:translateY(calc(-1 * var(--toast-offset-y)))}.toast-positioner[data-limited].sc-ds-toast{visibility:hidden;pointer-events:none}.toast-positioner--anchored.sc-ds-toast{position:fixed;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)));transform:none}.toast-positioner--anchored[data-positioned='false'].sc-ds-toast{visibility:hidden}.toast-surface.sc-ds-toast{position:relative;display:block;box-sizing:border-box;width:100%;height:var(--toast-height, auto);padding:var(--dimension-space-200);overflow:hidden;color:var(--color-foreground-primary);background-color:var(--color-background-primary);border-radius:var(--dimension-radius-050);box-shadow:var(--effect-elevation-elevated-floating);transform:translate(var(--toast-swipe-movement-x), var(--toast-swipe-movement-y));animation:toast-enter var(--effect-motion-short-2) both}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{animation:toast-exit var(--effect-motion-short-3) both}.toast-surface--swiping.sc-ds-toast{transition:none;user-select:none}.toast-content.sc-ds-toast{display:flex;flex-direction:column;min-width:0;padding-inline-end:var(--dimension-size-500);transition:opacity var(--effect-motion-short-3)}.toast-copy.sc-ds-toast{display:flex;flex-direction:column;min-width:0;min-height:var(--typography-lineheight-md);margin-block:calc(-1 * var(--dimension-space-025));gap:var(--dimension-space-050)}.toast-title.sc-ds-toast,.toast-description.sc-ds-toast{min-width:0}.toast-action.sc-ds-toast{align-self:start;margin-top:calc(var(--dimension-space-200) + var(--dimension-space-025))}.toast-close.sc-ds-toast{position:absolute;top:var(--dimension-space-100);right:var(--dimension-space-100);transition:opacity var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-content.sc-ds-toast,.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-close.sc-ds-toast{opacity:0}@keyframes toast-enter{from{opacity:0;transform:translateY(var(--dimension-space-100))}to{opacity:1;transform:translateY(0)}}@keyframes toast-exit{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.toast-positioner.sc-ds-toast,.toast-surface.sc-ds-toast,.toast-content.sc-ds-toast,.toast-close.sc-ds-toast,.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{transition:none;animation:none}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{opacity:0}}@media (forced-colors: active){.toast-surface.sc-ds-toast{box-shadow:none;outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}}`;const C=40;const P=10;const S="__global-stack__";const E='button,a,input,textarea,select,[role="button"],[data-ds-toast-swipe-ignore]';const F=new WeakMap;const R=new Set;let j=null;let D=0;const z=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.dsToastClose=i(this,"dsToastClose",7);this.dsToastRemove=i(this,"dsToastRemove",7);this.dsToastAction=i(this,"dsToastAction",7);this.manager=k;this.limit=3;this.timeout=m.animationDelayLong2;this.label="Notifications";this.closeLabel="Close notification";this.avoidMobileShellBar=false;this.swipeDirections=["down","right"];this.records=[];this.expanded=false;this.keyboardActive=false;this.swipe=null;this.layoutVersion=0;this.instanceId=++D;this.domIds=new Map;this.timers=new Map;this.closeWatchdogs=new Map;this.closeFrames=new Map;this.closeEvents=new Set;this.activationFrames=new Map;this.pauseReasons=new Set;this.hoveredIds=new Set;this.heights=new Map;this.measuredUpdateKeys=new Map;this.anchoredPositions=new Map;this.dismissedSwipeDirections=new Map;this.observedElements=new Set;this.pendingRemovals=[];this.unsubscribe=null;this.attachedManager=null;this.previousFocus=null;this.resizeObserver=null;this.mutationObserver=null;this.layoutFrame=null;this.activeSwipe=null;this.nextDomId=0;this.connected=false;this.pendingHoverLeave=false;this.handleWindowBlur=()=>this.pauseTimers("window");this.handleWindowFocus=()=>this.resumeTimers("window");this.handleVisibilityChange=()=>{if(document.hidden)this.pauseTimers("document");else this.resumeTimers("document")};this.handleFocusIn=()=>{const t=document.activeElement;if(!(t instanceof s)||!t.matches(":focus-visible"))return;j=this;this.keyboardActive=true;this.expanded=true;this.pauseTimers("focus")};this.handleFocusOut=t=>{const s=t.relatedTarget;if(s instanceof Node&&this.el.contains(s))return;if(!this.keyboardActive)return;this.keyboardActive=false;this.expanded=this.hoveredIds.size>0;this.resumeTimers("focus")};this.handleDocumentKeyDown=t=>{if(t.key!=="F6")return;const s=Array.from(R).filter((t=>t.activeRecords.length>0));const i=j&&j.activeRecords.length?j:s[s.length-1];if(i!==this)return;t.preventDefault();if(!this.el.contains(document.activeElement)){this.previousFocus=document.activeElement}this.keyboardActive=true;this.regionElement?.focus()};this.handleRegionKeyDown=t=>{if(t.key==="Escape"){const s=t.target;const i=s.closest(".toast-positioner");const e=i?.dataset["toastId"]??this.activeRecords[0]?.id;if(e){t.preventDefault();this.manager.close(e,"escape")}return}if(t.key==="Tab"&&t.shiftKey&&t.target===this.regionElement){t.preventDefault();this.restorePreviousFocus()}};this.handleWindowResize=()=>{this.heights.clear();this.measuredUpdateKeys.clear();this.layoutVersion+=1;this.scheduleLayout()};this.scheduleLayout=()=>{if(this.layoutFrame!==null)return;this.layoutFrame=requestAnimationFrame((()=>{this.layoutFrame=null;this.measureLayout()}))}}connectedCallback(){this.connect()}componentDidLoad(){this.connect()}connect(){if(this.connected)return;this.connected=true;this.resizeObserver??(this.resizeObserver=new ResizeObserver((()=>this.scheduleLayout())));this.mutationObserver??(this.mutationObserver=new MutationObserver((()=>this.scheduleLayout())));this.mutationObserver.observe(document.body,{childList:true,subtree:true});if(!this.unsubscribe)this.attachManager(this.manager);window.addEventListener("blur",this.handleWindowBlur);window.addEventListener("focus",this.handleWindowFocus);window.addEventListener("resize",this.handleWindowResize);window.addEventListener("scroll",this.scheduleLayout,true);document.addEventListener("keydown",this.handleDocumentKeyDown);document.addEventListener("visibilitychange",this.handleVisibilityChange);R.add(this);if(!j)j=this}componentDidRender(){this.syncObservedElements();this.flushPendingRemovals();this.scheduleLayout()}disconnectedCallback(){this.connected=false;this.flushPendingRemovals();this.detachManager();this.resetManagerState();this.resizeObserver?.disconnect();this.resizeObserver=null;this.mutationObserver?.disconnect();this.mutationObserver=null;this.observedElements.clear();if(this.layoutFrame!==null)cancelAnimationFrame(this.layoutFrame);this.layoutFrame=null;window.removeEventListener("blur",this.handleWindowBlur);window.removeEventListener("focus",this.handleWindowFocus);window.removeEventListener("resize",this.handleWindowResize);window.removeEventListener("scroll",this.scheduleLayout,true);document.removeEventListener("keydown",this.handleDocumentKeyDown);document.removeEventListener("visibilitychange",this.handleVisibilityChange);R.delete(this);if(j===this){const t=Array.from(R);j=t[t.length-1]??null}}onManagerChange(t){this.detachManager();this.resetManagerState();if(this.connected)this.attachManager(t)}onTimeoutChange(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}this.timers.clear();this.syncTimers()}attachManager(t){const s=F.get(t);if(s&&s!==this){console.warn("[ds-toast] A manager can control only one connected ds-toast instance.");return}F.set(t,this);this.attachedManager=t;this.unsubscribe=t.subscribe((t=>{this.records=t;this.syncLifecycle(t);this.scheduleLayout()}))}detachManager(){this.unsubscribe?.();this.unsubscribe=null;if(this.attachedManager&&F.get(this.attachedManager)===this){F.delete(this.attachedManager)}this.attachedManager=null}resetManagerState(){this.flushPendingRemovals();if(this.el.contains(document.activeElement))this.restorePreviousFocus();this.clearAllTimers();for(const t of this.activationFrames.values())cancelAnimationFrame(t);for(const t of this.closeFrames.values())cancelAnimationFrame(t);this.activationFrames.clear();this.closeFrames.clear();this.closeEvents.clear();this.pauseReasons.clear();this.hoveredIds.clear();this.pendingHoverLeave=false;this.heights.clear();this.measuredUpdateKeys.clear();this.anchoredPositions.clear();this.dismissedSwipeDirections.clear();this.domIds.clear();this.activeSwipe=null;this.swipe=null;this.expanded=false;this.keyboardActive=false;this.records=[];this.resizeObserver?.disconnect();this.observedElements.clear()}syncObservedElements(){const t=new Set(this.el.querySelectorAll(".toast-positioner"));for(const s of this.records){if(!s.positioner)continue;const i=this.resolveAnchor(s.positioner.anchor);if(i)t.add(i)}for(const s of this.observedElements){if(!t.has(s)){this.resizeObserver?.unobserve(s);this.observedElements.delete(s)}}for(const s of t){if(this.observedElements.has(s))continue;this.resizeObserver?.observe(s);this.observedElements.add(s)}}flushPendingRemovals(){for(const t of this.pendingRemovals.splice(0)){t.manager.notifyRemove(t.context);this.dsToastRemove.emit({id:t.context.id,toast:t.context.toast})}}syncLifecycle(t){const s=new Set(t.map((t=>t.id)));for(const t of this.hoveredIds){if(t!==S&&!s.has(t))this.hoveredIds.delete(t)}const i=t.some((t=>t.transitionStatus==="ending"));if(this.pendingHoverLeave&&!i&&!this.hoveredIds.size){this.pendingHoverLeave=false;this.expanded=false;this.resumeTimers("hover")}else if(!this.hoveredIds.size&&!this.pendingHoverLeave){this.resumeTimers("hover")}for(const[t,i]of this.timers){if(s.has(t))continue;if(i.handle)clearTimeout(i.handle);this.timers.delete(t)}for(const[t,i]of this.closeWatchdogs){if(s.has(t))continue;clearTimeout(i);this.closeWatchdogs.delete(t)}for(const[t,i]of this.activationFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.activationFrames.delete(t)}for(const[t,i]of this.closeFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.closeFrames.delete(t)}for(const t of this.domIds.keys()){if(s.has(t))continue;this.closeEvents.delete(t);this.domIds.delete(t);this.heights.delete(t);this.measuredUpdateKeys.delete(t);this.anchoredPositions.delete(t);this.dismissedSwipeDirections.delete(t)}for(const s of t){this.ensureDomId(s.id);if(s.transitionStatus==="starting"&&!this.activationFrames.has(s.id)){const t=this.attachedManager;const i=requestAnimationFrame((()=>{this.activationFrames.delete(s.id);t?.activate(s.id)}));this.activationFrames.set(s.id,i)}if(s.transitionStatus==="ending"){this.clearToastTimer(s.id);this.beginRemoval(s)}else{const t=this.closeWatchdogs.get(s.id);if(t)clearTimeout(t);this.closeWatchdogs.delete(s.id);const i=this.closeFrames.get(s.id);if(i)cancelAnimationFrame(i);this.closeFrames.delete(s.id);this.closeEvents.delete(s.id)}}this.syncTimers()}syncTimers(){const t=new Set;for(const s of this.records){if(s.transitionStatus!=="active")continue;t.add(s.id);const i=this.resolveToastTimeout(s);if(i<=0){this.clearToastTimer(s.id);continue}const e=this.timers.get(s.id);if(!e||e.timerKey!==s.timerKey){this.clearToastTimer(s.id);this.timers.set(s.id,{timerKey:s.timerKey,remaining:i,startedAt:0,handle:null})}if(!this.isPaused)this.startToastTimer(s.id)}for(const s of this.timers.keys()){if(!t.has(s))this.clearToastTimer(s)}}resolveToastTimeout(t){const s=t.timeout??this.timeout;if(typeof s==="number")return Math.max(0,s);return p(s,m.animationDelayLong2)}startToastTimer(t){const s=this.timers.get(t);if(!s||s.handle||s.remaining<=0)return;s.startedAt=Date.now();s.handle=setTimeout((()=>{s.handle=null;s.remaining=0;this.manager.close(t,"timeout")}),s.remaining)}pauseTimers(t){const s=this.isPaused;this.pauseReasons.add(t);if(s)return;const i=Date.now();for(const t of this.timers.values()){if(!t.handle)continue;clearTimeout(t.handle);t.handle=null;t.remaining=Math.max(0,t.remaining-(i-t.startedAt))}}resumeTimers(t){this.pauseReasons.delete(t);if(this.isPaused)return;for(const t of this.timers.keys())this.startToastTimer(t)}get isPaused(){return this.pauseReasons.size>0}clearToastTimer(t){const s=this.timers.get(t);if(s?.handle)clearTimeout(s.handle);this.timers.delete(t)}clearAllTimers(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}for(const t of this.closeWatchdogs.values())clearTimeout(t);this.timers.clear();this.closeWatchdogs.clear()}beginRemoval(t){if(!this.closeEvents.has(t.id)){this.closeEvents.add(t.id);this.dsToastClose.emit({id:t.id,reason:t.closeReason??"programmatic",toast:t});this.moveFocusAfterClose(t.id)}if(this.closeWatchdogs.has(t.id)||this.closeFrames.has(t.id))return;const s=v(m.motionShort3,m.animationDurationShort3);if(s<=0){queueMicrotask((()=>this.completeRemoval(t)));return}const i=requestAnimationFrame((()=>{this.closeFrames.delete(t.id);const i=this.records.find((s=>s.id===t.id));if(!i||i.transitionStatus!=="ending")return;this.closeWatchdogs.set(t.id,setTimeout((()=>this.completeRemoval(i)),s))}));this.closeFrames.set(t.id,i)}completeRemoval(t){const s=this.records.find((s=>s.id===t.id));if(!s||s.transitionStatus!=="ending")return;const i=this.closeWatchdogs.get(t.id);if(i)clearTimeout(i);this.closeWatchdogs.delete(t.id);const e=this.closeFrames.get(t.id);if(e)cancelAnimationFrame(e);this.closeFrames.delete(t.id);const o=this.attachedManager;const n=o?.remove(t.id);if(o&&n)this.pendingRemovals.push({manager:o,context:n})}handleAnimationComplete(t){if(t.transitionStatus==="ending")this.completeRemoval(t)}bindAnimationCancel(t,s){if(!t||t.dataset["cancelBound"]==="true")return;t.dataset["cancelBound"]="true";t.addEventListener("animationcancel",(()=>{const t=this.records.find((t=>t.id===s));if(t)this.handleAnimationComplete(t)}))}handlePointerEnter(t){j=this;this.pendingHoverLeave=false;this.hoveredIds.add(t);this.expanded=true;this.pauseTimers("hover")}handlePointerLeave(t){this.hoveredIds.delete(t);if(this.hoveredIds.size)return;if(this.records.some((t=>t.transitionStatus==="ending"))){this.pendingHoverLeave=true;return}this.expanded=false;this.resumeTimers("hover")}get regionElement(){return this.el.querySelector(".toast-region")}restorePreviousFocus(){this.previousFocus?.focus?.();this.previousFocus=null;this.keyboardActive=false}moveFocusAfterClose(t){const s=document.activeElement;const i=this.positionerElement(t);if(!s||!i?.contains(s))return;requestAnimationFrame((()=>{const s=this.activeRecords.find((s=>s.id!==t));const i=s?this.positionerElement(s.id)?.querySelector("ds-button-unfilled"):null;if(i?.setFocus)void i.setFocus();else if(s)this.regionElement?.focus();else this.restorePreviousFocus()}))}handleAction(t,s){const i={id:t.id,toast:t,originalEvent:s.detail};this.dsToastAction.emit(i);t.action?.onAction?.({id:t.id,data:t.data,manager:this.manager,originalEvent:s.detail})}handlePointerDown(t,s){if(s.button!==0)return;const i=s.target;if(i.closest(E))return;const e=s.currentTarget;e.setPointerCapture(s.pointerId);this.activeSwipe={id:t.id,pointerId:s.pointerId,pointerType:s.pointerType,startX:s.clientX,startY:s.clientY,maxDistance:0,cancelled:false,axis:null};this.swipe={id:t.id,x:0,y:0};if(s.pointerType==="touch")this.pauseTimers("swipe")}handlePointerMove(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId||s.cancelled)return;const i=t.clientX-s.startX;const e=t.clientY-s.startY;if(!s.axis&&Math.max(Math.abs(i),Math.abs(e))>1){s.axis=Math.abs(i)>=Math.abs(e)?"x":"y"}if(!s.axis)return;const o=s.axis==="x";const n=o?i>=0?"right":"left":e>=0?"down":"up";const a=this.swipeDirections.includes(n);const r=o?Math.abs(i):Math.abs(e);const c=a?r:Math.sqrt(r);const h=(o?i:e)<0?-c:c;const d=o?h:0;const l=o?0:h;if(s.maxDistance-c>=P){s.cancelled=true;this.cancelSwipe();return}s.maxDistance=Math.max(s.maxDistance,c);if(r>1)t.preventDefault();this.swipe={id:s.id,x:d,y:l,direction:a?n:undefined}}handlePointerUp(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId)return;const i=this.swipe;const e=i?Math.max(Math.abs(i.x),Math.abs(i.y)):0;const o=!s.cancelled&&!!i?.direction&&e>=C;const n=s.id;const a=s.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(a)this.resumeTimers("swipe");if(o&&i.direction){this.dismissedSwipeDirections.set(n,i.direction);this.manager.close(n,"swipe")}}handlePointerCancel(t){if(this.activeSwipe?.pointerId!==t.pointerId)return;this.cancelSwipe()}cancelSwipe(){const t=this.activeSwipe?.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(t)this.resumeTimers("swipe")}get touchAction(){const t=this.swipeDirections.includes("left")||this.swipeDirections.includes("right");const s=this.swipeDirections.includes("up")||this.swipeDirections.includes("down");if(t&&s)return"none";if(t)return"pan-y";if(s)return"pan-x";return"auto"}measureNaturalHeight(t,s){const i=t.querySelector(".toast-surface");if(!i)return 0;const e=t.style.width;const o=t.style.transition;const n=i.style.height;if(s){t.style.transition="none";t.style.width="100%"}i.style.height="auto";const a=i.getBoundingClientRect().height;i.style.height=n;if(s){t.style.width=e;t.getBoundingClientRect();t.style.transition=o}return a}measureLayout(){let t=false;for(const s of this.records){const i=this.positionerElement(s.id);if(!i)continue;let e=this.heights.get(s.id)??0;const o=e<=0||this.measuredUpdateKeys.get(s.id)!==s.updateKey;if(o){e=this.measureNaturalHeight(i,!s.positioner);if(e>0){if(this.heights.get(s.id)!==e)t=true;this.heights.set(s.id,e);this.measuredUpdateKeys.set(s.id,s.updateKey)}}if(!s.positioner)continue;const n=this.resolveAnchor(s.positioner.anchor);if(!n||e<=0){if(this.anchoredPositions.delete(s.id))t=true;continue}const c=i.getBoundingClientRect();const h=g(s.positioner.sideOffset,m.space050);const d=g(s.positioner.alignOffset,0);const l=a({anchorRect:n.getBoundingClientRect(),popupWidth:c.width,popupHeight:e,side:s.positioner.side??"top",align:s.positioner.align??"center",sideOffsetPx:h,alignOffsetPx:d,viewportPadPx:g(undefined,m.space200),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,collisionRect:r(n)});const f=this.anchoredPositions.get(s.id);if(!f||f.x!==l.x||f.y!==l.y||f.side!==l.resolvedSide){this.anchoredPositions.set(s.id,{x:l.x,y:l.y,side:l.resolvedSide});t=true}}if(t)this.layoutVersion+=1}resolveAnchor(t){return typeof t==="string"?document.getElementById(t):t}positionerElement(t){return Array.from(this.el.querySelectorAll(".toast-positioner")).find((s=>s.dataset["toastId"]===t))??null}ensureDomId(t){const s=this.domIds.get(t);if(s)return s;const i=++this.nextDomId;this.domIds.set(t,i);return i}get activeRecords(){return this.records.filter((t=>t.transitionStatus!=="ending"))}globalLayout(){const t=this.records.filter((t=>!t.positioner));let s=0;let i=0;const e=g(undefined,m.space200);const o=new Map;t.forEach(((t,n)=>{if(t.transitionStatus==="ending"){o.set(t.id,{index:n,offset:s,limited:false});return}const a=i>=Math.max(1,this.limit);o.set(t.id,{index:i,offset:s,limited:a});s+=(this.heights.get(t.id)??0)+e;i+=1}));return o}renderToast(t,s){const i=this.ensureDomId(t.id);const o=`ds-toast-${this.instanceId}-${i}-title`;const n=`ds-toast-${this.instanceId}-${i}-description`;const a=this.swipe?.id===t.id?this.swipe:null;const r=a?.direction??this.dismissedSwipeDirections.get(t.id);const c=!!t.positioner;const h=this.anchoredPositions.get(t.id);const d=t.priority==="high"&&!this.keyboardActive;const l=this.keyboardActive&&!s.limited?0:-1;const f=this.heights.get(t.id);return e("div",{ref:s=>this.bindAnimationCancel(s,t.id),class:{"toast-positioner":true,"toast-positioner--anchored":c,"toast-positioner--ending":t.transitionStatus==="ending"},"data-toast-id":t.id,"data-behind":!c&&s.index>0?"":undefined,"data-limited":s.limited?"":undefined,"data-positioned":c?String(!!h):undefined,"data-side":h?.side,inert:s.limited?true:undefined,"aria-hidden":s.limited?"true":undefined,style:{"--toast-index":String(s.index),"--toast-offset-y":`${s.offset}px`,"--toast-height":f?`${f}px`:undefined,zIndex:String(this.records.length-s.index),left:h?`${h.x}px`:undefined,top:h?`${h.y}px`:undefined},onAnimationEnd:()=>this.handleAnimationComplete(t)},e("div",{class:{"toast-surface":true,"toast-surface--swiping":!!a},role:t.priority==="high"?"alertdialog":"dialog","aria-modal":"false","aria-labelledby":t.title?o:t.description?n:undefined,"aria-describedby":t.title&&t.description?n:undefined,"aria-hidden":d?"true":undefined,"data-type":t.type,"data-priority":t.priority,"data-transition-status":t.transitionStatus,"data-swiping":a?"":undefined,"data-swipe-direction":r,style:{"--toast-swipe-movement-x":`${a?.x??0}px`,"--toast-swipe-movement-y":`${a?.y??0}px`,touchAction:this.touchAction},onPointerDown:s=>this.handlePointerDown(t,s),onPointerMove:t=>this.handlePointerMove(t),onPointerUp:t=>this.handlePointerUp(t),onPointerCancel:t=>this.handlePointerCancel(t),onPointerEnter:c?()=>this.handlePointerEnter(t.id):undefined,onPointerLeave:c?()=>this.handlePointerLeave(t.id):undefined},e("div",{class:"toast-content"},e("div",{class:"toast-copy"},t.title&&e("ds-text",{class:"toast-title",as:"div",variant:"text-title-small",color:"primary",textId:o},t.title),t.description&&e("ds-text",{class:"toast-description",as:"div",variant:"text-body-medium",color:"secondary",textId:n},t.description)),t.action&&e("ds-button-unfilled",{class:"toast-action",variant:"label",size:"md",type:"button",label:t.action.label,"aria-label":t.action.ariaLabel,hasBorder:true,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:s=>this.handleAction(t,s)})),e("ds-button-unfilled",{class:"toast-close",variant:"icon",size:"md",type:"button",icon:"Cross","aria-label":this.closeLabel,hasBorder:false,activeFill:false,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:()=>this.manager.close(t.id,"close-button")})))}render(){const t=this.globalLayout();const s=this.records.filter((t=>!t.positioner));const i=this.records.filter((t=>!!t.positioner));const n=this.records.filter((s=>s.priority==="high"&&s.transitionStatus!=="ending"&&!t.get(s.id)?.limited));return e(o,{key:"64b89c8f62ae480eb42b41643cc6fb21ece56cb7"},e("section",{key:"a44a83908627ec3cbe5bbd7e434627b6dc49a19a",class:"toast-region",role:"region","aria-label":this.label,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",tabIndex:-1,onFocusin:this.handleFocusIn,onFocusout:t=>this.handleFocusOut(t),onKeyDown:t=>this.handleRegionKeyDown(t)},e("div",{key:"a3fc44accad5aff9990b768195254d5fd1d8ec9f",class:"toast-viewport","data-expanded":this.expanded?"":undefined,onPointerEnter:()=>this.handlePointerEnter(S),onPointerLeave:()=>this.handlePointerLeave(S)},s.map((s=>this.renderToast(s,t.get(s.id)??{index:0,offset:0,limited:false})))),e("div",{key:"fc05900e9c57ee5e0727895978cf5e7619903500",class:"toast-anchored-layer"},i.map((t=>this.renderToast(t,{index:0,offset:0,limited:false})))),e("div",{key:"9d28556aebde56f952af6dd3b8304ef67e3a0ae7",class:"toast-assertive-announcer ds-visually-hidden"},n.map((t=>e("div",{role:"alert","aria-atomic":"true"},[t.title,t.description].filter(Boolean).join(". ")))))))}get el(){return this}static get watchers(){return{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}}static get style(){return A()}},[2,"ds-toast",{manager:[16],limit:[2],timeout:[8],label:[1],closeLabel:[1,"close-label"],avoidMobileShellBar:[516,"avoid-mobile-shell-bar"],swipeDirections:[16],records:[32],expanded:[32],keyboardActive:[32],swipe:[32],layoutVersion:[32]},undefined,{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}]);function $(){if(typeof customElements==="undefined"){return}const t=["ds-toast","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];t.forEach((t=>{switch(t){case"ds-toast":if(!customElements.get(n(t))){customElements.define(n(t),z)}break;case"ds-badge":if(!customElements.get(n(t))){c()}break;case"ds-button-unfilled":if(!customElements.get(n(t))){h()}break;case"ds-icon":if(!customElements.get(n(t))){d()}break;case"ds-loader":if(!customElements.get(n(t))){l()}break;case"ds-text":if(!customElements.get(n(t))){f()}break;case"ds-tooltip":if(!customElements.get(n(t))){u()}break}}))}$();const L=z;const I=$;export{L as DsToast,I as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-toast.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as n,H as t,c as i,h as o,a as s,t as e}from"./index.js";import{r as d,b as r}from"./p-DZ58Sg5a.js";import{d as l}from"./p-rSC7ZUpy.js";import{d as a}from"./p-Cea7rROU.js";import{d as c}from"./p-0XTyQNRG.js";import{d as u}from"./p-aMyflqva.js";import{d as f}from"./p-CN8PQLZu.js";import{c as b}from"./p-DuFm-ieS.js";const h=899;function v(n){return n>0&&n<=h}function g(n){return n.contentBoxSize[0]?.inlineSize??n.contentRect.width}function p(n,t){if(typeof ResizeObserver==="undefined"){t(false);return()=>undefined}const i=n.closest("ds-table");if(!i){t(false);return()=>undefined}const o=n=>{if(n<=0)return;t(v(n))};const s=new ResizeObserver((n=>{o(n[0]?g(n[0]):0)}));s.observe(i);o(i.clientWidth);return()=>s.disconnect()}const m=()=>`@media (forced-colors: active){.sc-ds-button-unfilled:root,.sc-ds-button-unfilled-h,.ds-forced-colors-scope.sc-ds-button-unfilled{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-button-unfilled-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-button-unfilled-h,.ds-focus-ring.sc-ds-button-unfilled,.ds-focus-ring-inset.sc-ds-button-unfilled-h,.ds-focus-ring-inset.sc-ds-button-unfilled{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-button-unfilled-h:focus-visible,.ds-focus-ring.sc-ds-button-unfilled:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-button-unfilled-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-button-unfilled{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-button-unfilled-h:focus-visible,.ds-focus-ring-inset.sc-ds-button-unfilled:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-button-unfilled-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-button-unfilled:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-button-unfilled-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-button-unfilled{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-button-unfilled-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-button-unfilled::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}@media (forced-colors: active){.sc-ds-button-unfilled-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-button-unfilled:root,.sc-ds-button-unfilled-h,.ds-forced-colors-scope.sc-ds-button-unfilled{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}@media (forced-colors: active){.sc-ds-button-unfilled:root,.sc-ds-button-unfilled-h,.ds-forced-colors-scope.sc-ds-button-unfilled{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-interaction-fill.sc-ds-button-unfilled-h,.ds-interaction-fill.sc-ds-button-unfilled{position:var(--ds-interaction-position, relative);z-index:var(--ds-interaction-z-index, 0);cursor:default;--ds-interaction-hover:var(--color-interaction-hover);--ds-interaction-pressed:var(--color-interaction-pressed);--ds-interaction-active:var(--color-interaction-active-brand);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent;--ds-interaction-divider-width:0px;--ds-interaction-divider-color:transparent;--ds-interaction-divider-inline-start-width:0px;--ds-interaction-divider-inline-start-color:transparent;--ds-interaction-divider-inline-end-width:0px;--ds-interaction-divider-inline-end-color:transparent}.ds-interaction-fill.sc-ds-button-unfilled-h::before,.ds-interaction-fill.sc-ds-button-unfilled::before,.ds-interaction-fill.sc-ds-button-unfilled-h::after,.ds-interaction-fill.sc-ds-button-unfilled::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-button-unfilled-h::before,.ds-interaction-fill.sc-ds-button-unfilled::before{z-index:1}.ds-interaction-fill.sc-ds-button-unfilled-h::after,.ds-interaction-fill.sc-ds-button-unfilled::after{z-index:3;box-shadow:inset 0 calc(-1 * var(--ds-interaction-divider-width)) 0 var(--ds-interaction-divider-color), inset var(--ds-interaction-divider-inline-start-width) 0 0 var(--ds-interaction-divider-inline-start-color), inset calc(-1 * var(--ds-interaction-divider-inline-end-width)) 0 0 var(--ds-interaction-divider-inline-end-color), inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-interaction-fill--bordered.sc-ds-button-unfilled-h,.ds-interaction-fill--bordered.sc-ds-button-unfilled{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-button-unfilled-h::before,.ds-interaction-fill--selected.sc-ds-button-unfilled::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-button-unfilled-h,.ds-interaction-fill--selected.sc-ds-button-unfilled{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-button-unfilled-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-button-unfilled:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-button-unfilled-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-button-unfilled:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-button-unfilled-h::after,.ds-interaction-fill--grouped.sc-ds-button-unfilled::after,.ds-interaction-fill--grouped.sc-ds-button-unfilled-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-button-unfilled:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-button-unfilled-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-button-unfilled:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-button-unfilled-h,.ds-interaction-fill--grouped.sc-ds-button-unfilled{--ds-interaction-divider-width:var(--ds-interaction-group-divider-width, 0px);--ds-interaction-divider-color:var(--ds-interaction-group-divider-color, transparent);--ds-interaction-divider-inline-start-width:var( --ds-interaction-group-divider-inline-start-width, 0px );--ds-interaction-divider-inline-start-color:var( --ds-interaction-group-divider-inline-start-color, transparent );--ds-interaction-divider-inline-end-width:var( --ds-interaction-group-divider-inline-end-width, 0px );--ds-interaction-divider-inline-end-color:var( --ds-interaction-group-divider-inline-end-color, transparent )}.ds-interaction-fill.sc-ds-button-unfilled-h>.ds-interaction-fill__content.sc-ds-button-unfilled,.ds-interaction-fill.sc-ds-button-unfilled>.ds-interaction-fill__content.sc-ds-button-unfilled,.ds-interaction-fill__content.sc-ds-button-unfilled{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-button-unfilled-h,.ds-interaction-fill--on-faint.sc-ds-button-unfilled{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-button-unfilled-h,.ds-interaction-fill--on-medium.sc-ds-button-unfilled{--ds-interaction-hover:var(--color-interaction-on-medium-background-hover);--ds-interaction-pressed:var(--color-interaction-on-medium-background-pressed);--ds-interaction-active:var(--color-interaction-on-medium-background-active);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.ds-interaction-fill--on-bold.sc-ds-button-unfilled-h,.ds-interaction-fill--on-bold.sc-ds-button-unfilled{--ds-interaction-hover:var(--color-interaction-on-bold-background-hover);--ds-interaction-pressed:var(--color-interaction-on-bold-background-pressed);--ds-interaction-active:var(--color-interaction-on-bold-background-active);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus)}.ds-interaction-fill--on-strong.sc-ds-button-unfilled-h,.ds-interaction-fill--on-strong.sc-ds-button-unfilled{--ds-interaction-hover:var(--color-interaction-on-strong-background-hover);--ds-interaction-pressed:var(--color-interaction-on-strong-background-pressed);--ds-interaction-active:var(--color-interaction-on-strong-background-active);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus)}.ds-interaction-fill--on-translucent.sc-ds-button-unfilled-h,.ds-interaction-fill--on-translucent.sc-ds-button-unfilled{--ds-interaction-hover:var(--color-translucent-interaction-hover);--ds-interaction-pressed:var(--color-translucent-interaction-pressed);--ds-interaction-active:var(--color-translucent-interaction-active-brand);--ds-focus-ring-color:var(--color-translucent-interaction-focus)}.ds-interaction-fill--on-inverted.sc-ds-button-unfilled-h,.ds-interaction-fill--on-inverted.sc-ds-button-unfilled{--ds-interaction-hover:var(--color-inverted-interaction-hover);--ds-interaction-pressed:var(--color-inverted-interaction-pressed);--ds-interaction-active:var(--color-inverted-interaction-active-brand);--ds-focus-ring-color:var(--color-inverted-interaction-focus)}.ds-interaction-fill--on-media.sc-ds-button-unfilled-h,.ds-interaction-fill--on-media.sc-ds-button-unfilled{--ds-interaction-hover:var(--color-media-interaction-hover);--ds-interaction-pressed:var(--color-media-interaction-pressed);--ds-interaction-active:var(--color-media-interaction-active);--ds-focus-ring-color:var(--color-media-interaction-focus)}.ds-interaction-fill--on-always-dark.sc-ds-button-unfilled-h,.ds-interaction-fill--on-always-dark.sc-ds-button-unfilled{--ds-interaction-hover:var(--color-always-dark-interaction-hover);--ds-interaction-pressed:var(--color-always-dark-interaction-pressed);--ds-interaction-active:var(--color-always-dark-interaction-active-brand);--ds-focus-ring-color:var(--color-always-dark-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-button-unfilled-h,.ds-interaction-fill--on-navigation.sc-ds-button-unfilled{--ds-interaction-hover:var(--color-navigation-interaction-hover);--ds-interaction-pressed:var(--color-navigation-interaction-pressed);--ds-interaction-active:var(--color-navigation-interaction-active);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-button-unfilled-h:not(:disabled)::after,.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-button-unfilled:not(:disabled)::after{background:var(--ds-interaction-pressed)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-button-unfilled-h::after,.ds-interaction-fill.sc-ds-button-unfilled::after{box-shadow:none;outline:var(--ds-interaction-border-width) solid var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--ds-interaction-border-width))}.ds-interaction-fill--surface-open.sc-ds-button-unfilled-h:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill--surface-open.sc-ds-button-unfilled:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline:var(--dimension-stroke-width-025) dashed var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}.ds-interaction-fill--selected.sc-ds-button-unfilled-h::before,.ds-interaction-fill--selected.sc-ds-button-unfilled::before{background:transparent;outline:var(--dimension-stroke-width-025) solid var(--ds-forced-color-selected);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}}@media (forced-colors: active) and (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-button-unfilled-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-button-unfilled:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline-color:var(--ds-forced-color-selected);outline-width:var(--dimension-stroke-width-012)}}.ds-control-press-scale.sc-ds-button-unfilled{transition:scale var(--effect-motion-short-2)}.ds-control-press-scale.sc-ds-button-unfilled:active:not(:disabled):not(.ds-control-inactive):not([aria-busy='true']){scale:var(--ds-control-press-active-scale, var(--dimension-scale-subtle))}@media (prefers-reduced-motion: reduce){.ds-control-press-scale.sc-ds-button-unfilled,.ds-control-press-scale.sc-ds-button-unfilled:active:not(:disabled):not(.ds-control-inactive):not([aria-busy='true']){scale:none;transition:none}}@media (forced-colors: active){.sc-ds-button-unfilled:root,.sc-ds-button-unfilled-h,.ds-forced-colors-scope.sc-ds-button-unfilled{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-control-inactive.sc-ds-button-unfilled-h,.ds-control-inactive.sc-ds-button-unfilled{opacity:var(--effect-opacity-medium);pointer-events:none;cursor:not-allowed}@media (forced-colors: active){.ds-control-inactive.sc-ds-button-unfilled-h,.ds-control-inactive.sc-ds-button-unfilled{color:var(--ds-forced-color-disabled);opacity:1}}.ds-control--lg.sc-ds-button-unfilled,.ds-control--lg.sc-ds-button-unfilled-h,.ds-control--md.sc-ds-button-unfilled-h,.ds-control--md.sc-ds-button-unfilled,.ds-control--sm.sc-ds-button-unfilled-h,.ds-control--sm.sc-ds-button-unfilled,.ds-control--xs.sc-ds-button-unfilled-h,.ds-control--xs.sc-ds-button-unfilled{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-button-unfilled-h,.ds-control--lg.sc-ds-button-unfilled{--ds-control-height:var(--dimension-size-500);--ds-control-icon:var(--dimension-iconography-lg);--ds-control-padding-inline:var(--dimension-space-100);--ds-control-label-inset:var(--dimension-space-050);--ds-control-gap:var(--dimension-space-050)}.ds-control--md.sc-ds-button-unfilled-h,.ds-control--md.sc-ds-button-unfilled{--ds-control-height:var(--dimension-size-400);--ds-control-icon:var(--dimension-iconography-md);--ds-control-padding-inline:var(--dimension-space-075);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-050)}.ds-control--sm.sc-ds-button-unfilled-h,.ds-control--sm.sc-ds-button-unfilled{--ds-control-height:var(--dimension-size-300);--ds-control-icon:var(--dimension-iconography-sm);--ds-control-padding-inline:var(--dimension-space-050);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025)}.ds-control--xs.sc-ds-button-unfilled-h,.ds-control--xs.sc-ds-button-unfilled{--ds-control-height:var(--dimension-size-200);--ds-control-icon:var(--dimension-iconography-xs);--ds-control-padding-inline:var(--dimension-space-025);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:0}.ds-control--lg.ds-control--inset.sc-ds-button-unfilled-h,.ds-control--lg.ds-control--inset.sc-ds-button-unfilled{--ds-control-height:calc(var(--dimension-size-500) - var(--dimension-space-050));--ds-control-padding-inline:calc(var(--dimension-space-100) - var(--dimension-space-025))}.ds-control--md.ds-control--inset.sc-ds-button-unfilled-h,.ds-control--md.ds-control--inset.sc-ds-button-unfilled{--ds-control-height:calc(var(--dimension-size-400) - var(--dimension-space-050));--ds-control-padding-inline:calc(var(--dimension-space-075) - var(--dimension-space-025))}.ds-control--sm.ds-control--inset.sc-ds-button-unfilled-h,.ds-control--sm.ds-control--inset.sc-ds-button-unfilled{--ds-control-height:calc(var(--dimension-size-300) - var(--dimension-space-050));--ds-control-padding-inline:calc(var(--dimension-space-050) - var(--dimension-space-025))}.ds-control--xs.ds-control--inset.sc-ds-button-unfilled-h,.ds-control--xs.ds-control--inset.sc-ds-button-unfilled{--ds-control-height:calc(var(--dimension-size-200) - var(--dimension-space-050));--ds-control-padding-inline:calc(var(--dimension-space-025) - var(--dimension-space-025))}.ds-control--lg.ds-control--inset-double.sc-ds-button-unfilled-h,.ds-control--lg.ds-control--inset-double.sc-ds-button-unfilled{--ds-control-height:calc(var(--dimension-size-500) - var(--dimension-space-100));--ds-control-padding-inline:calc(var(--dimension-space-100) - var(--dimension-space-050))}.ds-control--md.ds-control--inset-double.sc-ds-button-unfilled-h,.ds-control--md.ds-control--inset-double.sc-ds-button-unfilled{--ds-control-height:calc(var(--dimension-size-400) - var(--dimension-space-100));--ds-control-padding-inline:calc(var(--dimension-space-075) - var(--dimension-space-050))}.ds-control--sm.ds-control--inset-double.sc-ds-button-unfilled-h,.ds-control--sm.ds-control--inset-double.sc-ds-button-unfilled{--ds-control-height:calc(var(--dimension-size-300) - var(--dimension-space-100));--ds-control-padding-inline:calc(var(--dimension-space-050) - var(--dimension-space-050))}.ds-control-frame.sc-ds-button-unfilled{display:inline-flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:var(--ds-control-padding-inline, var(--dimension-space-075));gap:var(--ds-control-gap, var(--dimension-space-050));border-radius:var(--ds-control-radius, var(--dimension-radius-025))}.ds-control-section-heading.sc-ds-button-unfilled{display:flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-control-icon-box.sc-ds-button-unfilled{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md))}.ds-control-label-box.sc-ds-button-unfilled{min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025))}.ds-control-label-dot.sc-ds-button-unfilled{position:relative;padding-inline-end:calc( var(--ds-control-label-inset, var(--dimension-space-025)) + var(--ds-control-gap, var(--dimension-space-050)) )}.ds-control-label-dot__badge.sc-ds-button-unfilled{position:absolute;inset-block-start:0;inset-inline-end:0;pointer-events:none}.ds-control-width--hug.sc-ds-button-unfilled-h,.ds-control-width--hug.sc-ds-button-unfilled{width:fit-content;max-width:100%;flex:0 0 auto}.ds-control-width--fill.sc-ds-button-unfilled-h,.ds-control-width--fill.sc-ds-button-unfilled{width:100%;min-width:0;flex:1 1 auto;align-self:stretch}.sc-ds-button-unfilled-h{display:inline-flex;outline:none}.ds-button-host--icon.ds-control-width--hug.sc-ds-button-unfilled-h{width:var(--ds-control-height, var(--dimension-size-400));height:var(--ds-control-height, var(--dimension-size-400));min-width:var(--ds-control-height, var(--dimension-size-400));min-height:var(--ds-control-height, var(--dimension-size-400))}.ds-button-host--icon.ds-control-width--fill.sc-ds-button-unfilled-h{height:var(--ds-control-height, var(--dimension-size-400));min-height:var(--ds-control-height, var(--dimension-size-400))}.ds-control-width--fill.sc-ds-button-unfilled-h .ds-button.sc-ds-button-unfilled{width:100%}.ds-button.sc-ds-button-unfilled{justify-content:center;overflow:hidden;min-inline-size:var(--ds-control-height);border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));border-start-start-radius:var( --ds-button-radius-start-start, var(--ds-control-radius, var(--dimension-radius-025)) );border-start-end-radius:var( --ds-button-radius-start-end, var(--ds-control-radius, var(--dimension-radius-025)) );border-end-start-radius:var( --ds-button-radius-end-start, var(--ds-control-radius, var(--dimension-radius-025)) );border-end-end-radius:var( --ds-button-radius-end-end, var(--ds-control-radius, var(--dimension-radius-025)) );cursor:default;-webkit-user-select:none;user-select:none}.ds-button--icon.sc-ds-button-unfilled{width:100%;height:100%;padding:0}.ds-button--rounded.sc-ds-button-unfilled{--ds-control-radius:var(--dimension-radius-half)}.ds-button--bordered.sc-ds-button-unfilled{--ds-interaction-border-width:var(--dimension-stroke-width-012)}.ds-button--bordered.sc-ds-button-unfilled:not(.ds-interaction-fill){box-shadow:inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-button__icon-wrap.sc-ds-button-unfilled,.ds-button__label.sc-ds-button-unfilled,.ds-button__chevron.sc-ds-button-unfilled{position:relative;z-index:2}.ds-button__label.sc-ds-button-unfilled{flex-shrink:0;min-width:0;white-space:nowrap}.ds-button__label--loading.sc-ds-button-unfilled,.ds-button__chevron--loading.sc-ds-button-unfilled{visibility:hidden}.ds-button.sc-ds-button-unfilled>.ds-button__loader-overlay.sc-ds-button-unfilled{position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;pointer-events:none}.ds-button__dot.sc-ds-button-unfilled{position:absolute;top:0;right:0;z-index:2;pointer-events:none}@media (forced-colors: active){.ds-button.sc-ds-button-unfilled{outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}}.ds-button-split.sc-ds-button-unfilled{position:relative;display:inline-flex;align-items:stretch;min-width:0;overflow:hidden;gap:0;border-radius:var(--ds-control-radius, var(--dimension-radius-025));background:transparent}.ds-control-width--fill.sc-ds-button-unfilled-h .ds-button-split.sc-ds-button-unfilled{width:100%}.ds-button-split.sc-ds-button-unfilled>.ds-button-split__primary.sc-ds-button-unfilled{flex:1 1 auto;width:auto;min-width:0;border-start-end-radius:var(--dimension-radius-000);border-end-end-radius:var(--dimension-radius-000)}.ds-button-split.sc-ds-button-unfilled>.ds-button-split__menu.sc-ds-button-unfilled{flex:0 0 var(--ds-control-height);width:var(--ds-control-height);min-width:var(--ds-control-height);border-start-start-radius:var(--dimension-radius-000);border-end-start-radius:var(--dimension-radius-000)}.ds-button-split__divider.sc-ds-button-unfilled{position:relative;z-index:3;align-self:stretch;flex:0 0 0;margin-inline-start:calc(-1 * var(--dimension-stroke-width-012));border-inline-start:var(--dimension-stroke-width-012) solid var(--ds-button-split-divider);pointer-events:none}.ds-button-split__divider--content-height.sc-ds-button-unfilled{align-self:center;block-size:var(--ds-button-split-divider-content-height)}.ds-button-split__outline.sc-ds-button-unfilled{position:absolute;z-index:3;inset:0;border:var(--dimension-stroke-width-012) solid var(--ds-button-split-border);border-radius:inherit;pointer-events:none}.ds-control--lg.sc-ds-button-unfilled-h{--ds-button-split-divider-content-height:var(--dimension-size-300)}.ds-control--md.sc-ds-button-unfilled-h{--ds-button-split-divider-content-height:var(--dimension-size-250)}.ds-control--sm.sc-ds-button-unfilled-h,.ds-control--xs.sc-ds-button-unfilled-h{--ds-button-split-divider-content-height:var(--dimension-size-200)}.ds-button-split-host--primary-icon.ds-control-width--hug.sc-ds-button-unfilled-h .ds-button-split.sc-ds-button-unfilled>.ds-button-split__primary.sc-ds-button-unfilled{flex:0 0 var(--ds-control-height);width:var(--ds-control-height);min-width:var(--ds-control-height);height:var(--ds-control-height)}.ds-button-split--rounded.sc-ds-button-unfilled{border-radius:var(--dimension-radius-half)}.ds-table-caption-control.sc-ds-button-unfilled-h{--ds-choice-popup-min-inline-size:var(--dimension-menu-width-xs)}.ds-table-caption-control.ds-table-caption-control--compact.sc-ds-button-unfilled-h{flex:0 0 auto;width:var(--ds-control-height, var(--dimension-size-400));height:var(--ds-control-height, var(--dimension-size-400));min-width:var(--ds-control-height, var(--dimension-size-400));min-height:var(--ds-control-height, var(--dimension-size-400));max-width:var(--ds-control-height, var(--dimension-size-400));inline-size:var(--ds-control-height, var(--dimension-size-400));min-inline-size:var(--ds-control-height, var(--dimension-size-400));max-inline-size:var(--ds-control-height, var(--dimension-size-400))}.ds-table-caption-control.ds-table-caption-control--compact.sc-ds-button-unfilled-h .trigger.sc-ds-button-unfilled{justify-content:center;inline-size:100%;min-inline-size:100%;height:100%;padding-inline:0}.ds-table-caption-control.ds-table-caption-control--compact.sc-ds-button-unfilled-h .trigger--has-value.sc-ds-button-unfilled{--ds-select-prefix-fg:var(--ds-select-fg-active)}@container ds-table (max-width: 899px){.sc-ds-button-unfilled-h.ds-table-caption-control{flex:0 0 auto;inline-size:var(--ds-control-height, var(--dimension-size-400));min-inline-size:var(--ds-control-height, var(--dimension-size-400));max-inline-size:var(--ds-control-height, var(--dimension-size-400))}.sc-ds-button-unfilled-h.ds-table-caption-control .trigger{justify-content:center;inline-size:100%;min-inline-size:100%;padding-inline:0}.sc-ds-button-unfilled-h.ds-table-caption-control .trigger--has-value{--ds-select-prefix-fg:var(--ds-select-fg-active)}}.sc-ds-button-unfilled-h{--ds-button-unfilled-fg:var(--color-foreground-secondary);--ds-button-unfilled-fg-active:var(--color-foreground-primary);--ds-button-unfilled-dot-ring:var(--color-background-secondary);--ds-button-unfilled-border:var(--color-border-secondary);--ds-button-split-border:var(--color-border-secondary);--ds-button-split-divider:var(--color-border-tertiary)}.button-unfilled-host--background-medium.sc-ds-button-unfilled-h{--ds-button-split-border:var(--color-border-on-medium-background-secondary);--ds-button-split-divider:var(--color-border-on-medium-background-tertiary)}.button-unfilled-host--background-bold.sc-ds-button-unfilled-h{--ds-button-split-border:var(--color-border-on-bold-background-secondary);--ds-button-split-divider:var(--color-border-on-bold-background-tertiary)}.button-unfilled-host--background-strong.sc-ds-button-unfilled-h{--ds-button-split-border:var(--color-border-on-strong-background-secondary);--ds-button-split-divider:var(--color-border-on-strong-background-tertiary)}.button-unfilled-host--background-translucent.sc-ds-button-unfilled-h{--ds-button-split-border:var(--color-translucent-border-secondary);--ds-button-split-divider:var(--color-translucent-border-tertiary)}.button-unfilled-host--background-inverted.sc-ds-button-unfilled-h{--ds-button-split-border:var(--color-inverted-border-secondary);--ds-button-split-divider:var(--color-inverted-border-tertiary)}.button-unfilled-host--background-media.sc-ds-button-unfilled-h{--ds-button-split-border:var(--color-media-border-secondary);--ds-button-split-divider:var(--color-media-border-tertiary)}.button-unfilled-host--background-always-dark.sc-ds-button-unfilled-h{--ds-button-split-border:var(--color-always-dark-border-secondary);--ds-button-split-divider:var(--color-always-dark-border-tertiary)}.button-unfilled.sc-ds-button-unfilled{background:transparent;color:var(--ds-button-unfilled-fg)}.button-unfilled--active.sc-ds-button-unfilled{color:var(--ds-button-unfilled-fg-active)}.button-unfilled--bordered.sc-ds-button-unfilled{--ds-interaction-border-color:var(--ds-button-unfilled-border)}.button-unfilled--background-medium.sc-ds-button-unfilled{--ds-button-unfilled-fg:var(--color-foreground-on-medium-background-secondary);--ds-button-unfilled-fg-active:var(--color-foreground-on-medium-background-primary);--ds-button-unfilled-dot-ring:var(--color-background-medium-neutral);--ds-button-unfilled-border:var(--color-border-on-medium-background-secondary)}.button-unfilled--background-bold.sc-ds-button-unfilled{--ds-button-unfilled-fg:var(--color-foreground-on-bold-background-secondary);--ds-button-unfilled-fg-active:var(--color-foreground-on-bold-background-primary);--ds-button-unfilled-dot-ring:var(--color-background-bold-neutral);--ds-button-unfilled-border:var(--color-border-on-bold-background-secondary)}.button-unfilled--background-strong.sc-ds-button-unfilled{--ds-button-unfilled-fg:var(--color-foreground-on-strong-background-secondary);--ds-button-unfilled-fg-active:var(--color-foreground-on-strong-background-primary);--ds-button-unfilled-dot-ring:var(--color-background-strong-neutral);--ds-button-unfilled-border:var(--color-border-on-strong-background-secondary)}.button-unfilled--background-translucent.sc-ds-button-unfilled{--ds-button-unfilled-fg:var(--color-translucent-foreground-secondary);--ds-button-unfilled-fg-active:var(--color-translucent-foreground-primary);--ds-button-unfilled-dot-ring:var(--color-translucent-translucent);--ds-button-unfilled-border:var(--color-translucent-border-secondary)}.button-unfilled--background-inverted.sc-ds-button-unfilled{--ds-button-unfilled-fg:var(--color-inverted-foreground-secondary);--ds-button-unfilled-fg-active:var(--color-inverted-foreground-primary);--ds-button-unfilled-dot-ring:var(--color-inverted-background);--ds-button-unfilled-border:var(--color-inverted-border-secondary)}.button-unfilled--background-media.sc-ds-button-unfilled{--ds-button-unfilled-fg:var(--color-media-foreground-secondary);--ds-button-unfilled-fg-active:var(--color-media-foreground-primary);--ds-button-unfilled-dot-ring:var(--color-media-background);--ds-button-unfilled-border:var(--color-media-border-secondary)}.button-unfilled--on-always-dark.sc-ds-button-unfilled{--ds-button-unfilled-fg:var(--color-always-dark-foreground-secondary);--ds-button-unfilled-fg-active:var(--color-always-dark-foreground-primary);--ds-button-unfilled-dot-ring:var(--color-always-dark-background);--ds-button-unfilled-border:var(--color-always-dark-border-secondary)}.button-unfilled.ds-interaction-fill--selected.sc-ds-button-unfilled{--ds-button-unfilled-dot-ring:var(--ds-interaction-active)}`;const k=n(class n extends t{constructor(n){super();if(n!==false){this.__registerHost()}this.dsClick=i(this,"dsClick",7);this.dsMenuClick=i(this,"dsMenuClick",7);this.dsChange=i(this,"dsChange",7);this.variant="label";this.size="md";this.isInset=false;this.insetDepth="single";this.width="hug";this.label="";this.labelEmphasis=true;this.icon="";this.isActive=false;this.activeFill=true;this.hasBorder=true;this.rounded=false;this.pressScale=true;this.dot=false;this.isInactive=false;this.isLoading=false;this.type="button";this.ariaLabel=null;this.split=false;this.menuAriaLabel="More options";this.collapseLabel=false;this.hasMenu=false;this.captionCompact=false;this.buttonEl=null;this.menuButtonEl=null;this.hasLoaded=false;this.handleClick=n=>{if(this.isInactive||this.isLoading){n.preventDefault();n.stopPropagation();return}this.dsClick.emit(n);if(this.pressed!==undefined)this.dsChange.emit(!this.pressed)};this.handleMenuClick=n=>{if(this.isInactive||this.isLoading){n.preventDefault();n.stopPropagation();return}this.dsMenuClick.emit(n)}}componentDidLoad(){this.hasLoaded=true;this.syncCaptionCompactObserver()}connectedCallback(){if(this.hasLoaded)this.syncCaptionCompactObserver()}disconnectedCallback(){this.disconnectCaptionCompactObserver()}onCollapseLabelChange(){this.syncCaptionCompactObserver()}async setFocus(n="primary"){(n==="menu"?this.menuButtonEl:this.buttonEl)?.focus()}get captionIconOnly(){return this.collapseLabel&&this.captionCompact&&this.variant==="icon-label"&&Boolean(this.icon)}get visualVariant(){return this.captionIconOnly?"icon":this.variant}get showDot(){return this.variant==="icon"&&this.dot&&!this.isLoading}syncCaptionCompactObserver(){this.disconnectCaptionCompactObserver();if(!this.collapseLabel){if(this.captionCompact)this.captionCompact=false;return}this.captionCompactDisconnect=p(this.el,(n=>{if(this.captionCompact!==n)this.captionCompact=n}))}disconnectCaptionCompactObserver(){this.captionCompactDisconnect?.();this.captionCompactDisconnect=undefined}get resolvedHaspopup(){return this.haspopup??(this.hasMenu?"menu":undefined)}get doubleInset(){return this.isInset&&this.insetDepth==="double"&&this.size!=="xs"}get resolvedSurfaceOpen(){const n=this.expanded===true&&(this.split||this.resolvedHaspopup!==undefined);return(this.surfaceOpen??n)&&!this.isInactive}get visuallyActive(){return this.isActive||this.pressed===true}get dotRing(){if((this.isActive||this.pressed===true)&&this.activeFill){return"var(--ds-interaction-active)"}return"var(--ds-button-unfilled-dot-ring)"}get accessibleName(){if(this.ariaLabel)return this.ariaLabel;if(this.isLoading&&this.variant==="label"&&this.label)return this.label;return undefined}buttonClass(n,t,i){const o=this.background;const s={"button-unfilled":true,"ds-button":true,"ds-focus-ring-inset":true,"ds-control-press-scale":this.pressScale&&!this.split,"ds-interaction-fill":true,"ds-interaction-fill--selected":(this.isActive||this.pressed===true)&&this.activeFill&&!this.isInactive,"ds-interaction-fill--on-faint":o==="faint","ds-interaction-fill--on-medium":o==="medium","ds-interaction-fill--on-bold":o==="bold","ds-interaction-fill--on-strong":o==="strong","ds-interaction-fill--on-translucent":o==="translucent","ds-interaction-fill--on-inverted":o==="inverted","ds-interaction-fill--on-media":o==="media","ds-interaction-fill--on-always-dark":o==="always-dark","button-unfilled--active":this.visuallyActive,"button-unfilled--expanded":t,"ds-interaction-fill--surface-open":t,"ds-button--expanded":t,"button-unfilled--bordered":i,"ds-button--bordered":i,"button-unfilled--rounded":this.rounded,"ds-button--rounded":this.rounded,"ds-control-inactive":this.isInactive,"ds-control--lg":this.size==="lg","ds-control--md":this.size==="md","ds-control--sm":this.size==="sm","ds-control--xs":this.size==="xs","ds-control--inset":this.isInset&&!this.doubleInset,"ds-control--inset-double":this.doubleInset,"ds-control-frame":true,"button-unfilled--icon":n==="icon","ds-button--icon":n==="icon","button-unfilled--label":n==="label","button-unfilled--icon-label":n==="icon-label","button-unfilled--background-faint":o==="faint","button-unfilled--background-medium":o==="medium","button-unfilled--background-bold":o==="bold","button-unfilled--background-strong":o==="strong","button-unfilled--background-translucent":o==="translucent","button-unfilled--background-inverted":o==="inverted","button-unfilled--background-media":o==="media","button-unfilled--on-always-dark":o==="always-dark"};return s}render(){const n=o("button",{key:"8a4788472c66b714a6a9502fb018fe8935ffd5ba",ref:n=>{this.buttonEl=n??null},type:this.type,class:{...this.buttonClass(this.visualVariant,!this.split&&this.resolvedSurfaceOpen,this.hasBorder&&!this.split),"ds-button-split__primary":this.split},disabled:this.isInactive,tabIndex:this.focusTabIndex??0,"aria-label":this.accessibleName,"aria-busy":this.isLoading?"true":undefined,"aria-disabled":this.isLoading?"true":undefined,"aria-controls":this.split?undefined:this.controls,"aria-expanded":this.split||this.expanded===undefined?undefined:String(this.expanded),"aria-haspopup":this.split?undefined:this.resolvedHaspopup,"aria-pressed":this.pressed===undefined?undefined:String(this.pressed),onPointerDown:n=>r(n,this.pressScale&&!this.split&&!this.isInactive&&!this.isLoading),onClick:this.handleClick},d({namespace:"button-unfilled",variant:this.visualVariant,size:this.size,label:this.label,labelEmphasis:this.labelEmphasis,icon:this.icon,hasMenu:!this.split&&this.hasMenu,isLoading:this.isLoading,dot:{visible:this.showDot,background:this.dotRing}}));const t=this.split?o("div",{class:{"ds-button-split":true,"ds-button-split--rounded":this.rounded}},n,o("span",{class:{"ds-button-split__divider":true,"ds-button-split__divider--content-height":!this.hasBorder},"aria-hidden":"true"}),o("button",{ref:n=>{this.menuButtonEl=n??null},class:{...this.buttonClass("icon",this.resolvedSurfaceOpen,false),"ds-button-split__menu":true},type:"button",disabled:this.isInactive||this.isLoading,tabIndex:this.focusTabIndex??0,"aria-label":this.menuAriaLabel,"aria-controls":this.controls,"aria-expanded":String(this.expanded===true),"aria-haspopup":"menu",onClick:this.handleMenuClick},d({namespace:"button-unfilled",variant:"icon",size:this.size,label:"",labelEmphasis:true,icon:"ChevronDown",hasMenu:false,isLoading:false})),this.hasBorder?o("span",{class:"ds-button-split__outline","aria-hidden":"true"}):null):n;return o(s,{key:"7142ae1bb699047b2aa2bb43ffcedf570d02f466",class:{"button-unfilled-host":true,"button-unfilled-host--icon":this.visualVariant==="icon"&&!this.split,"ds-button-host--icon":this.visualVariant==="icon"&&!this.split,"ds-button-split-host":this.split,"ds-button-split-host--primary-icon":this.split&&this.visualVariant==="icon",[`button-unfilled-host--background-${this.background}`]:this.split&&this.background!==undefined,"ds-control--lg":this.size==="lg","ds-control--md":this.size==="md","ds-control--sm":this.size==="sm","ds-control--xs":this.size==="xs","ds-control--inset":this.isInset&&!this.doubleInset,"ds-control--inset-double":this.doubleInset,"ds-table-caption-control":this.collapseLabel,"ds-table-caption-control--compact":this.captionIconOnly,...b(this.width)},tabIndex:-1},this.collapseLabel?o("ds-tooltip",{label:this.captionIconOnly?this.label||this.accessibleName||"":"",side:"top",size:"sm"},t):t)}get el(){return this}static get watchers(){return{collapseLabel:[{onCollapseLabelChange:0}]}}static get style(){return m()}},[2,"ds-button-unfilled",{variant:[1],size:[1],isInset:[4,"is-inset"],insetDepth:[1,"inset-depth"],width:[1],label:[1],labelEmphasis:[4,"label-emphasis"],icon:[1],isActive:[4,"is-active"],activeFill:[4,"active-fill"],hasBorder:[4,"has-border"],rounded:[4],pressScale:[4,"press-scale"],dot:[4],isInactive:[4,"is-inactive"],isLoading:[4,"is-loading"],type:[1],background:[1],ariaLabel:[1,"aria-label"],controls:[1],expanded:[4],surfaceOpen:[4,"surface-open"],haspopup:[1],split:[4],menuAriaLabel:[1,"menu-aria-label"],pressed:[4],collapseLabel:[516,"collapse-label"],hasMenu:[4,"has-menu"],focusTabIndex:[2,"tab-index"],captionCompact:[32],setFocus:[64]},undefined,{collapseLabel:[{onCollapseLabelChange:0}]}]);function y(){if(typeof customElements==="undefined"){return}const n=["ds-button-unfilled","ds-badge","ds-icon","ds-loader","ds-text","ds-tooltip"];n.forEach((n=>{switch(n){case"ds-button-unfilled":if(!customElements.get(e(n))){customElements.define(e(n),k)}break;case"ds-badge":if(!customElements.get(e(n))){l()}break;case"ds-icon":if(!customElements.get(e(n))){a()}break;case"ds-loader":if(!customElements.get(e(n))){c()}break;case"ds-text":if(!customElements.get(e(n))){u()}break;case"ds-tooltip":if(!customElements.get(e(n))){f()}break}}))}y();export{k as B,y as d,p as o};
|
|
2
|
+
//# sourceMappingURL=p--yvQzZoO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TABLE_CAPTION_COMPACT_MAX_PX","isTableCaptionCompact","width","tableCaptionInlineSize","entry","contentBoxSize","inlineSize","contentRect","observeTableCaptionCompact","host","onChange","ResizeObserver","undefined","table","closest","sync","observer","entries","observe","clientWidth","disconnect","buttonUnfilledCss","ButtonUnfilled","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","variant","size","isInset","insetDepth","label","labelEmphasis","icon","isActive","activeFill","hasBorder","rounded","pressScale","dot","isInactive","isLoading","type","ariaLabel","split","menuAriaLabel","collapseLabel","hasMenu","captionCompact","buttonEl","menuButtonEl","hasLoaded","handleClick","event","preventDefault","stopPropagation","dsClick","emit","pressed","dsChange","handleMenuClick","dsMenuClick","componentDidLoad","syncCaptionCompactObserver","connectedCallback","disconnectedCallback","disconnectCaptionCompactObserver","onCollapseLabelChange","setFocus","segment","focus","captionIconOnly","Boolean","visualVariant","showDot","captionCompactDisconnect","el","compact","resolvedHaspopup","haspopup","doubleInset","resolvedSurfaceOpen","legacy","expanded","surfaceOpen","visuallyActive","dotRing","accessibleName","buttonClass","bordered","bg","background","cls","render","primaryButton","h","key","ref","class","disabled","tabIndex","focusTabIndex","controls","String","onPointerDown","beginElevatedControlPress","onClick","renderButtonContent","namespace","visible","control","Host","controlWidthClass","side"],"sources":["src/wc/utils/table-caption-compact.ts","src/wc/components/ButtonUnfilled/ButtonUnfilled.css?tag=ds-button-unfilled&encapsulation=scoped","src/wc/components/ButtonUnfilled/ButtonUnfilled.tsx"],"sourcesContent":["/** Matches `@container ds-table (max-width: 899px)` on caption Filter/Group/Sort. */\nexport const TABLE_CAPTION_COMPACT_MAX_PX = 899;\n\nexport function isTableCaptionCompact(width: number): boolean {\n return width > 0 && width <= TABLE_CAPTION_COMPACT_MAX_PX;\n}\n\nexport function tableCaptionInlineSize(entry: ResizeObserverEntry): number {\n return entry.contentBoxSize[0]?.inlineSize ?? entry.contentRect.width;\n}\n\nexport function observeTableCaptionCompact(\n host: HTMLElement,\n onChange: (compact: boolean) => void\n): () => void {\n if (typeof ResizeObserver === 'undefined') {\n onChange(false);\n return () => undefined;\n }\n\n const table = host.closest('ds-table');\n if (!table) {\n onChange(false);\n return () => undefined;\n }\n\n const sync = (width: number) => {\n if (width <= 0) return;\n onChange(isTableCaptionCompact(width));\n };\n\n const observer = new ResizeObserver(entries => {\n sync(entries[0] ? tableCaptionInlineSize(entries[0]) : 0);\n });\n observer.observe(table);\n sync(table.clientWidth);\n return () => observer.disconnect();\n}\n","@import '../../utils/button-base.css';\n@import '../../utils/button-split.css';\n@import '../../utils/table-caption-control.css';\n\n:host {\n --ds-button-unfilled-fg: var(--color-foreground-secondary);\n --ds-button-unfilled-fg-active: var(--color-foreground-primary);\n --ds-button-unfilled-dot-ring: var(--color-background-secondary);\n --ds-button-unfilled-border: var(--color-border-secondary);\n --ds-button-split-border: var(--color-border-secondary);\n --ds-button-split-divider: var(--color-border-tertiary);\n}\n\n:host(.button-unfilled-host--background-medium) {\n --ds-button-split-border: var(--color-border-on-medium-background-secondary);\n --ds-button-split-divider: var(--color-border-on-medium-background-tertiary);\n}\n\n:host(.button-unfilled-host--background-bold) {\n --ds-button-split-border: var(--color-border-on-bold-background-secondary);\n --ds-button-split-divider: var(--color-border-on-bold-background-tertiary);\n}\n\n:host(.button-unfilled-host--background-strong) {\n --ds-button-split-border: var(--color-border-on-strong-background-secondary);\n --ds-button-split-divider: var(--color-border-on-strong-background-tertiary);\n}\n\n:host(.button-unfilled-host--background-translucent) {\n --ds-button-split-border: var(--color-translucent-border-secondary);\n --ds-button-split-divider: var(--color-translucent-border-tertiary);\n}\n\n:host(.button-unfilled-host--background-inverted) {\n --ds-button-split-border: var(--color-inverted-border-secondary);\n --ds-button-split-divider: var(--color-inverted-border-tertiary);\n}\n\n:host(.button-unfilled-host--background-media) {\n --ds-button-split-border: var(--color-media-border-secondary);\n --ds-button-split-divider: var(--color-media-border-tertiary);\n}\n\n:host(.button-unfilled-host--background-always-dark) {\n --ds-button-split-border: var(--color-always-dark-border-secondary);\n --ds-button-split-divider: var(--color-always-dark-border-tertiary);\n}\n\n.button-unfilled {\n background: transparent;\n color: var(--ds-button-unfilled-fg);\n /* Hover/press/selected fill: `.ds-interaction-fill` (+ `--selected` / `--on-*`).\n Active foreground changes remain independent from popup-open pressed paint. */\n}\n\n.button-unfilled--active {\n color: var(--ds-button-unfilled-fg-active);\n}\n\n/*\n * An open popup is a transient pressed state, not a selected state. Keep the\n * pressed wash visible for the popup's complete rendered lifecycle without\n * promoting the resting foreground or selected fill.\n */\n/* Inset stroke via interaction-fill ::after (above selected / hover washes). */\n.button-unfilled--bordered {\n --ds-interaction-border-color: var(--ds-button-unfilled-border);\n}\n\n/* Inactive: `.ds-control-inactive` (50% opacity). */\n\n/* Foreground / chrome tokens per surface — interaction tokens come from util `--on-*`. */\n.button-unfilled--background-medium {\n --ds-button-unfilled-fg: var(--color-foreground-on-medium-background-secondary);\n --ds-button-unfilled-fg-active: var(--color-foreground-on-medium-background-primary);\n --ds-button-unfilled-dot-ring: var(--color-background-medium-neutral);\n --ds-button-unfilled-border: var(--color-border-on-medium-background-secondary);\n}\n\n.button-unfilled--background-bold {\n --ds-button-unfilled-fg: var(--color-foreground-on-bold-background-secondary);\n --ds-button-unfilled-fg-active: var(--color-foreground-on-bold-background-primary);\n --ds-button-unfilled-dot-ring: var(--color-background-bold-neutral);\n --ds-button-unfilled-border: var(--color-border-on-bold-background-secondary);\n}\n\n.button-unfilled--background-strong {\n --ds-button-unfilled-fg: var(--color-foreground-on-strong-background-secondary);\n --ds-button-unfilled-fg-active: var(--color-foreground-on-strong-background-primary);\n --ds-button-unfilled-dot-ring: var(--color-background-strong-neutral);\n --ds-button-unfilled-border: var(--color-border-on-strong-background-secondary);\n}\n\n.button-unfilled--background-translucent {\n --ds-button-unfilled-fg: var(--color-translucent-foreground-secondary);\n --ds-button-unfilled-fg-active: var(--color-translucent-foreground-primary);\n --ds-button-unfilled-dot-ring: var(--color-translucent-translucent);\n --ds-button-unfilled-border: var(--color-translucent-border-secondary);\n}\n\n.button-unfilled--background-inverted {\n --ds-button-unfilled-fg: var(--color-inverted-foreground-secondary);\n --ds-button-unfilled-fg-active: var(--color-inverted-foreground-primary);\n --ds-button-unfilled-dot-ring: var(--color-inverted-background);\n --ds-button-unfilled-border: var(--color-inverted-border-secondary);\n}\n\n.button-unfilled--background-media {\n --ds-button-unfilled-fg: var(--color-media-foreground-secondary);\n --ds-button-unfilled-fg-active: var(--color-media-foreground-primary);\n --ds-button-unfilled-dot-ring: var(--color-media-background);\n --ds-button-unfilled-border: var(--color-media-border-secondary);\n}\n\n.button-unfilled--on-always-dark {\n --ds-button-unfilled-fg: var(--color-always-dark-foreground-secondary);\n --ds-button-unfilled-fg-active: var(--color-always-dark-foreground-primary);\n --ds-button-unfilled-dot-ring: var(--color-always-dark-background);\n --ds-button-unfilled-border: var(--color-always-dark-border-secondary);\n}\n\n/*\n * After surface ring defaults: selected fill remaps the knock-out to the active\n * wash so the badge halo matches the selected background.\n */\n.button-unfilled.ds-interaction-fill--selected {\n --ds-button-unfilled-dot-ring: var(--ds-interaction-active);\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { controlWidthClass } from '../../utils';\nimport { beginElevatedControlPress } from '../../utils/control-press';\nimport { renderButtonContent } from '../../utils/button-render';\nimport type { ControlInsetDepth } from '../../utils/control-text';\nimport { observeTableCaptionCompact } from '../../utils/table-caption-compact';\nimport type { ButtonPopup, ButtonSize, ButtonVariant, ButtonWidth } from '../../utils/button-types';\n\nexport type ButtonUnfilledBackground =\n | 'faint'\n | 'medium'\n | 'bold'\n | 'strong'\n | 'translucent'\n | 'inverted'\n | 'media'\n | 'always-dark';\n\nexport type ButtonUnfilledVariant = ButtonVariant;\nexport type ButtonUnfilledSize = ButtonSize;\nexport type ButtonUnfilledWidth = ButtonWidth;\nexport type ButtonUnfilledPopup = ButtonPopup;\n\n@Component({\n tag: 'ds-button-unfilled',\n styleUrl: 'ButtonUnfilled.css',\n scoped: true,\n})\nexport class ButtonUnfilled {\n @Element() el!: HTMLElement;\n\n /**\n * Content layout. Default is label-only; pass `icon` for icon-only chrome\n * (nav / tool rails) or `icon-label` for leading icon + text.\n */\n @Prop() variant: ButtonUnfilledVariant = 'label';\n\n /** Control density (height, padding, icon, type). */\n @Prop() size: ButtonUnfilledSize = 'md';\n\n /** Use reduced outer geometry when nested inside a control of the same size. */\n @Prop() isInset: boolean = false;\n\n /** Single removes 4px overall; double removes 8px overall (xs stays single). */\n @Prop() insetDepth: ControlInsetDepth = 'single';\n\n /** Width fit — hug content (default) or fill the parent. */\n @Prop() width: ButtonUnfilledWidth = 'hug';\n\n /** Visible text for `label` / `icon-label` variants. */\n @Prop() label: string = '';\n\n /** Whether the visible label uses the emphasized weight. */\n @Prop() labelEmphasis: boolean = true;\n\n /** Icon name passed to <ds-icon> for `icon` / `icon-label` variants. */\n @Prop() icon: string = '';\n\n /**\n * Owner-controlled visual emphasis inside a composite. This does not add\n * toggle semantics and does not emit dsChange.\n */\n @Prop() isActive: boolean = false;\n\n /**\n * When active, render the selected interaction fill.\n * Default `true` for general UI. Shell chrome (nav / tool rails) should pass\n * `false` so selection is foreground-only (primary color, no fill).\n */\n @Prop() activeFill: boolean = true;\n\n /** Show a 1px secondary inset border. Default on; shell chrome can pass `false`. */\n @Prop() hasBorder: boolean = true;\n\n /** Use the half-radius treatment instead of the default control radius. */\n @Prop() rounded: boolean = false;\n\n /**\n * Scale down during a physical pointer press.\n * Disable when an owning composite requires fixed child or background geometry.\n */\n @Prop() pressScale: boolean = true;\n\n /** Show a notification dot at the top-right of the icon zone (icon variant only). */\n @Prop() dot: boolean = false;\n\n /** Disables interaction. */\n @Prop() isInactive: boolean = false;\n\n /** Shows an inline loader and prevents interaction without applying inactive opacity. */\n @Prop() isLoading: boolean = false;\n\n /** Native button type. */\n @Prop() type: 'button' | 'submit' | 'reset' = 'button';\n\n /** Actual parent surface context. Omit on primary and secondary surfaces. */\n @Prop() background: ButtonUnfilledBackground | undefined;\n\n /** Accessible name override. Required for icon-only buttons. */\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n @Prop() controls: string | undefined;\n /**\n * Controlled disclosure state forwarded to aria-expanded.\n * Using expanded alone for surface-open styling is deprecated; set surfaceOpen\n * explicitly to separate the rendered surface lifecycle from disclosure state.\n */\n @Prop() expanded: boolean | undefined;\n\n /**\n * The associated menu, picker, or panel is visible, including its exit motion.\n * Holds only the pressed wash; does not set ARIA, selection, or press scaling.\n * In split mode this applies only to the menu segment. Explicit false disables\n * the legacy expanded-derived wash; omission preserves that compatibility path.\n */\n @Prop() surfaceOpen: boolean | undefined;\n @Prop() haspopup: ButtonUnfilledPopup | undefined;\n\n /**\n * Append a separate ChevronDown menu segment while preserving this button's\n * variant, size, surface, active, loading, border, and width treatment.\n */\n @Prop() split: boolean = false;\n\n /** Accessible name for the appended menu segment in split mode. */\n @Prop() menuAriaLabel: string = 'More options';\n\n /**\n * Controlled state for a genuine toggle button. Adds aria-pressed, promotes\n * active styling, and makes activation emit dsChange with the requested state.\n */\n @Prop() pressed: boolean | undefined;\n\n /**\n * Collapse the visible label and chevron to an icon-only control when the\n * owning `ds-table` caption is narrower than 900px. The trigger omits those\n * parts rather than clipping them.\n */\n @Prop({ reflect: true }) collapseLabel: boolean = false;\n\n /**\n * Mark the button as a Menu trigger. Implies `aria-haspopup=\"menu\"` and covers\n * both menu-button shapes:\n *\n * - `label` / `icon-label` — the action *has* a menu; a trailing chevron carries\n * the affordance.\n * - `icon` — the button *is* a menu. No chevron is added, so the glyph must\n * convey the menu on its own. Use `Ellipses` for generic more-options;\n * use a specific icon when the menu has a named purpose, such as\n * `Table` for Customize table.\n *\n * Use `haspopup` directly for non-menu popups.\n */\n @Prop() hasMenu: boolean = false;\n\n /**\n * Native `tabindex` for roving keyboard groups in shell chrome.\n * Omit for the default button tab stop (`0`).\n */\n @Prop({ attribute: 'tab-index' }) focusTabIndex?: number;\n\n @Event() dsClick!: EventEmitter<MouseEvent>;\n @Event() dsMenuClick!: EventEmitter<MouseEvent>;\n @Event() dsChange!: EventEmitter<boolean>;\n\n @State() private captionCompact = false;\n\n private buttonEl: HTMLButtonElement | null = null;\n private menuButtonEl: HTMLButtonElement | null = null;\n private captionCompactDisconnect: (() => void) | undefined;\n private hasLoaded = false;\n\n componentDidLoad(): void {\n this.hasLoaded = true;\n this.syncCaptionCompactObserver();\n }\n\n connectedCallback(): void {\n if (this.hasLoaded) this.syncCaptionCompactObserver();\n }\n\n disconnectedCallback(): void {\n this.disconnectCaptionCompactObserver();\n }\n\n @Watch('collapseLabel')\n onCollapseLabelChange() {\n this.syncCaptionCompactObserver();\n }\n\n @Method()\n async setFocus(segment: 'primary' | 'menu' = 'primary') {\n (segment === 'menu' ? this.menuButtonEl : this.buttonEl)?.focus();\n }\n\n private handleClick = (event: MouseEvent) => {\n if (this.isInactive || this.isLoading) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n this.dsClick.emit(event);\n if (this.pressed !== undefined) this.dsChange.emit(!this.pressed);\n };\n\n private handleMenuClick = (event: MouseEvent) => {\n if (this.isInactive || this.isLoading) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n this.dsMenuClick.emit(event);\n };\n\n private get captionIconOnly(): boolean {\n return (\n this.collapseLabel &&\n this.captionCompact &&\n this.variant === 'icon-label' &&\n Boolean(this.icon)\n );\n }\n\n private get visualVariant(): ButtonUnfilledVariant {\n return this.captionIconOnly ? 'icon' : this.variant;\n }\n\n private get showDot(): boolean {\n return this.variant === 'icon' && this.dot && !this.isLoading;\n }\n\n private syncCaptionCompactObserver(): void {\n this.disconnectCaptionCompactObserver();\n if (!this.collapseLabel) {\n if (this.captionCompact) this.captionCompact = false;\n return;\n }\n this.captionCompactDisconnect = observeTableCaptionCompact(this.el, compact => {\n if (this.captionCompact !== compact) this.captionCompact = compact;\n });\n }\n\n private disconnectCaptionCompactObserver(): void {\n this.captionCompactDisconnect?.();\n this.captionCompactDisconnect = undefined;\n }\n\n private get resolvedHaspopup(): ButtonUnfilledPopup | undefined {\n return this.haspopup ?? (this.hasMenu ? 'menu' : undefined);\n }\n\n private get doubleInset(): boolean {\n return this.isInset && this.insetDepth === 'double' && this.size !== 'xs';\n }\n\n private get resolvedSurfaceOpen(): boolean {\n const legacy = this.expanded === true && (this.split || this.resolvedHaspopup !== undefined);\n return (this.surfaceOpen ?? legacy) && !this.isInactive;\n }\n\n private get visuallyActive(): boolean {\n return this.isActive || this.pressed === true;\n }\n\n /** Knock-out ring: selected fill → active wash; otherwise surface token. */\n private get dotRing(): string {\n if ((this.isActive || this.pressed === true) && this.activeFill) {\n return 'var(--ds-interaction-active)';\n }\n return 'var(--ds-button-unfilled-dot-ring)';\n }\n\n private get accessibleName(): string | undefined {\n if (this.ariaLabel) return this.ariaLabel;\n if (this.isLoading && this.variant === 'label' && this.label) return this.label;\n return undefined;\n }\n\n private buttonClass(\n variant: ButtonUnfilledVariant,\n expanded: boolean,\n bordered: boolean\n ): Record<string, boolean> {\n const bg = this.background;\n const cls: Record<string, boolean> = {\n 'button-unfilled': true,\n 'ds-button': true,\n 'ds-focus-ring-inset': true,\n 'ds-control-press-scale': this.pressScale && !this.split,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected':\n (this.isActive || this.pressed === true) && this.activeFill && !this.isInactive,\n 'ds-interaction-fill--on-faint': bg === 'faint',\n 'ds-interaction-fill--on-medium': bg === 'medium',\n 'ds-interaction-fill--on-bold': bg === 'bold',\n 'ds-interaction-fill--on-strong': bg === 'strong',\n 'ds-interaction-fill--on-translucent': bg === 'translucent',\n 'ds-interaction-fill--on-inverted': bg === 'inverted',\n 'ds-interaction-fill--on-media': bg === 'media',\n 'ds-interaction-fill--on-always-dark': bg === 'always-dark',\n 'button-unfilled--active': this.visuallyActive,\n 'button-unfilled--expanded': expanded,\n 'ds-interaction-fill--surface-open': expanded,\n 'ds-button--expanded': expanded,\n 'button-unfilled--bordered': bordered,\n 'ds-button--bordered': bordered,\n 'button-unfilled--rounded': this.rounded,\n 'ds-button--rounded': this.rounded,\n 'ds-control-inactive': this.isInactive,\n 'ds-control--lg': this.size === 'lg',\n 'ds-control--md': this.size === 'md',\n 'ds-control--sm': this.size === 'sm',\n 'ds-control--xs': this.size === 'xs',\n 'ds-control--inset': this.isInset && !this.doubleInset,\n 'ds-control--inset-double': this.doubleInset,\n 'ds-control-frame': true,\n 'button-unfilled--icon': variant === 'icon',\n 'ds-button--icon': variant === 'icon',\n 'button-unfilled--label': variant === 'label',\n 'button-unfilled--icon-label': variant === 'icon-label',\n 'button-unfilled--background-faint': bg === 'faint',\n 'button-unfilled--background-medium': bg === 'medium',\n 'button-unfilled--background-bold': bg === 'bold',\n 'button-unfilled--background-strong': bg === 'strong',\n 'button-unfilled--background-translucent': bg === 'translucent',\n 'button-unfilled--background-inverted': bg === 'inverted',\n 'button-unfilled--background-media': bg === 'media',\n 'button-unfilled--on-always-dark': bg === 'always-dark',\n };\n return cls;\n }\n\n render() {\n const primaryButton = (\n <button\n ref={el => {\n this.buttonEl = el ?? null;\n }}\n type={this.type}\n class={{\n ...this.buttonClass(\n this.visualVariant,\n !this.split && this.resolvedSurfaceOpen,\n this.hasBorder && !this.split\n ),\n 'ds-button-split__primary': this.split,\n }}\n disabled={this.isInactive}\n tabIndex={this.focusTabIndex ?? 0}\n aria-label={this.accessibleName}\n aria-busy={this.isLoading ? 'true' : undefined}\n aria-disabled={this.isLoading ? 'true' : undefined}\n aria-controls={this.split ? undefined : this.controls}\n aria-expanded={\n this.split || this.expanded === undefined ? undefined : String(this.expanded)\n }\n aria-haspopup={this.split ? undefined : this.resolvedHaspopup}\n aria-pressed={this.pressed === undefined ? undefined : String(this.pressed)}\n onPointerDown={event =>\n beginElevatedControlPress(\n event,\n this.pressScale && !this.split && !this.isInactive && !this.isLoading\n )\n }\n onClick={this.handleClick}\n >\n {renderButtonContent({\n namespace: 'button-unfilled',\n variant: this.visualVariant,\n size: this.size,\n label: this.label,\n labelEmphasis: this.labelEmphasis,\n icon: this.icon,\n hasMenu: !this.split && this.hasMenu,\n isLoading: this.isLoading,\n dot: {\n visible: this.showDot,\n background: this.dotRing,\n },\n })}\n </button>\n );\n\n const control = this.split ? (\n <div\n class={{\n 'ds-button-split': true,\n 'ds-button-split--rounded': this.rounded,\n }}\n >\n {primaryButton}\n <span\n class={{\n 'ds-button-split__divider': true,\n 'ds-button-split__divider--content-height': !this.hasBorder,\n }}\n aria-hidden=\"true\"\n />\n <button\n ref={el => {\n this.menuButtonEl = el ?? null;\n }}\n class={{\n ...this.buttonClass('icon', this.resolvedSurfaceOpen, false),\n 'ds-button-split__menu': true,\n }}\n type=\"button\"\n disabled={this.isInactive || this.isLoading}\n tabIndex={this.focusTabIndex ?? 0}\n aria-label={this.menuAriaLabel}\n aria-controls={this.controls}\n aria-expanded={String(this.expanded === true)}\n aria-haspopup=\"menu\"\n onClick={this.handleMenuClick}\n >\n {renderButtonContent({\n namespace: 'button-unfilled',\n variant: 'icon',\n size: this.size,\n label: '',\n labelEmphasis: true,\n icon: 'ChevronDown',\n hasMenu: false,\n isLoading: false,\n })}\n </button>\n {this.hasBorder ? <span class=\"ds-button-split__outline\" aria-hidden=\"true\" /> : null}\n </div>\n ) : (\n primaryButton\n );\n\n return (\n <Host\n class={{\n 'button-unfilled-host': true,\n 'button-unfilled-host--icon': this.visualVariant === 'icon' && !this.split,\n 'ds-button-host--icon': this.visualVariant === 'icon' && !this.split,\n 'ds-button-split-host': this.split,\n 'ds-button-split-host--primary-icon': this.split && this.visualVariant === 'icon',\n [`button-unfilled-host--background-${this.background}`]:\n this.split && this.background !== undefined,\n 'ds-control--lg': this.size === 'lg',\n 'ds-control--md': this.size === 'md',\n 'ds-control--sm': this.size === 'sm',\n 'ds-control--xs': this.size === 'xs',\n 'ds-control--inset': this.isInset && !this.doubleInset,\n 'ds-control--inset-double': this.doubleInset,\n 'ds-table-caption-control': this.collapseLabel,\n 'ds-table-caption-control--compact': this.captionIconOnly,\n ...controlWidthClass(this.width),\n }}\n tabIndex={-1}\n >\n {this.collapseLabel ? (\n <ds-tooltip\n label={this.captionIconOnly ? this.label || this.accessibleName || '' : ''}\n side=\"top\"\n size=\"sm\"\n >\n {control}\n </ds-tooltip>\n ) : (\n control\n )}\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as s,H as e,c as t,h as i,a as o,t as l}from"./index.js";import{o as a,a as r,r as n,b as d,d as h}from"./p-B5eMVBlz.js";import{i as c,r as m,a as u}from"./p-CgGcgMjs.js";import{d as b}from"./p-rSC7ZUpy.js";import{d as p}from"./p--yvQzZoO.js";import{d as f}from"./p-DbDYEEWq.js";import{d as g}from"./p-Cea7rROU.js";import{d as v}from"./p-0XTyQNRG.js";import{d as k}from"./p-D1pPq-y0.js";import{d as w}from"./p-Cx2dWjaW.js";import{d as _}from"./p-CyoLh8su.js";import{d as y}from"./p-BmRHJ_jo.js";import{d as C}from"./p-BCFpqnAg.js";import{d as E}from"./p-Bl5wd3v3.js";import{d as j}from"./p-Crd3PEUx.js";import{d as x}from"./p-BGnRFtBa.js";import{d as B}from"./p-aMyflqva.js";import{d as L}from"./p-CN8PQLZu.js";const D=()=>`:host{display:block;min-width:0;min-height:0;height:100%;background:transparent}:host([responsive-mode='mobile']){width:100%;background:var(--color-background-primary)}.shell-tools__desktop,.shell-tools__desktop ds-panel-tools,.shell-tools__mobile{display:block;min-width:0;min-height:0;height:100%}.shell-tools__slot-proxy{display:block;width:100%;height:100%;min-width:0;min-height:0}.shell-tools__mobile{display:grid;grid-template-rows:auto minmax(0, 1fr);background:var(--color-background-primary)}.shell-tools__mobile-header{grid-row:1}.shell-tools__mobile-body,.shell-tools__view{min-width:0;min-height:0;height:100%}.shell-tools__mobile-body{grid-row:2;overflow:hidden}.shell-tools__view{overflow:auto;overscroll-behavior:contain}.shell-tools__view[hidden]{display:none}.shell-tools__view ::slotted(*){min-height:0}`;const T=s(class s extends e{constructor(s){super();if(s!==false){this.__registerHost()}this.__attachShadow();this.dsToolChange=t(this,"dsToolChange",7);this.dsPresentationChange=t(this,"dsPresentationChange",7);this.dsHeaderBack=t(this,"dsHeaderBack",7);this.dsHeaderAction=t(this,"dsHeaderAction",7);this.dsRailAccessoryAction=t(this,"dsRailAccessoryAction",7);this.responsiveMode="desktop";this.open=false;this.activeTool="";this.presentation="drawer";this.fullscreenHeaderMode="shared";this.items=[];this.accessories=[];this.headers={};this.storageKey="";this.toolsLabel="Tools";this.toolShortcutsLabel="Tool shortcuts";this.inboxLabel="Inbox";this.inboxNavigationLabel="Inbox sections";this.panelToolsEl=null;this.selectInboxTool=s=>{const e=s.detail;if(!this.availableInboxTools.includes(e)||e===this.mobileActiveTool)return;this.open=true;this.activeTool=e;this.dsToolChange.emit({id:e,selected:true})};this.handlePanelToolChange=s=>{this.activeTool=s.detail.id;this.open=s.detail.selected};this.handlePanelPresentationChange=s=>{this.presentation=s.detail.presentation};this.handlePanelRailAccessoryAction=s=>{s.stopPropagation();this.dsRailAccessoryAction.emit(s.detail)};this.handleMobileHeaderAction=(s,e,t)=>{t.stopPropagation();this.dsHeaderAction.emit({tool:s,id:e})}}presentationChanged(s,e){if(s===e)return;if(this.panelToolsEl&&this.panelToolsEl.getAttribute("presentation")!==s){this.panelToolsEl.setAttribute("presentation",s)}}get resolvedItems(){return this.items??[]}get availableInboxTools(){return this.resolvedItems.filter((s=>!s.isInactive&&c(s))).map((s=>s.id))}get mobileViewOrder(){return a(this.resolvedItems).map((s=>s.id))}toolLabel(s){const e=this.resolvedItems.find((e=>e.id===s));return e?.label??e?.ariaLabel??r[s]??s}get mobileActiveTool(){const s=this.resolvedItems.find((s=>s.id===this.activeTool));const e=s?c(s):u(this.activeTool);if(!e)return this.activeTool;return m(this.activeTool,this.availableInboxTools)}componentWillLoad(){this.reconcileAvailability()}handleItemsChange(){this.reconcileAvailability()}reconcileAvailability(){const s=n(this.resolvedItems,this.open,this.activeTool);this.open=s.open;this.activeTool=s.activeTool}resolvedHeaders(){return this.headers??{}}activeHeader(s){return this.resolvedHeaders()[s]??{}}activateMobileTool(s){const e=this.resolvedItems.find((e=>e.id===s));if(!e||e.isInactive)return;const t=d(this.open,this.activeTool,s);this.open=t.open;this.activeTool=t.activeTool;this.dsToolChange.emit({id:s,selected:t.selected})}async activateTool(s){if(this.responsiveMode!=="mobile"){await(this.panelToolsEl?.activateTool(s));return}this.activateMobileTool(s)}async closeDrawer(){if(this.responsiveMode!=="mobile"){await(this.panelToolsEl?.closeDrawer());return}if(!this.open)return;const s=this.activeTool;this.open=false;if(s)this.dsToolChange.emit({id:s,selected:false})}async focusHeaderAction(s){if(this.responsiveMode!=="mobile"){await(this.panelToolsEl?.focusHeaderAction(s));return}const e=(this.el.shadowRoot??this.el).querySelector(`[data-header-action-id="${CSS.escape(s)}"]`);await(e?.setFocus?.())}renderForwardedSlots(){return this.mobileViewOrder.flatMap((s=>[i("div",{key:`tool:${s}`,class:"shell-tools__slot-proxy",slot:s},i("slot",{name:s})),i("div",{key:`tool-view:${s}`,class:"shell-tools__slot-proxy",slot:`${s}-view`},i("slot",{name:`${s}-view`}))]))}renderDesktop(){return i("div",{class:"shell-tools__desktop"},i("ds-panel-tools",{open:this.open,activeTool:this.activeTool,presentation:this.presentation,fullscreenHeaderMode:this.fullscreenHeaderMode,items:this.resolvedItems,accessories:this.accessories??[],headers:this.resolvedHeaders(),storageKey:this.storageKey,toolsLabel:this.toolsLabel,toolShortcutsLabel:this.toolShortcutsLabel,ref:s=>{this.panelToolsEl=s},onDsToolChange:this.handlePanelToolChange,onDsPresentationChange:this.handlePanelPresentationChange,onDsRailAccessoryAction:this.handlePanelRailAccessoryAction},this.renderForwardedSlots()))}renderMobileHeader(s){const e=this.activeHeader(s);const t=e.title?.trim();const o=t||this.toolLabel(s);const l=(e.actions??[]).filter((s=>s.id!=="fullscreen"));const a=this.resolvedItems.find((e=>e.id===s));const r=Boolean(a&&c(a)&&!e.showBack);const n=r?this.availableInboxTools.map((s=>{const e=this.resolvedItems.find((e=>e.id===s));return{id:s,label:this.toolLabel(s),variant:"label",dot:e?.dot}})):[];return i("ds-mobile-header",{class:"shell-tools__mobile-header",heading:o,headingLevel:"h2",sections:n,value:s,sectionsAriaLabel:this.inboxNavigationLabel,sectionsPresentation:r?"segmented":"switcher",sectionsSize:"lg",onDsSectionChange:this.selectInboxTool},e.showBack?i("ds-tooltip",{slot:"leading",label:e.backAriaLabel||"Back",side:"bottom",size:"sm"},i("ds-button-unfilled",{variant:"icon",icon:e.backIcon||"ChevronLeft",size:"md","aria-label":e.backAriaLabel||"Back",activeFill:false,hasBorder:false,onDsClick:()=>this.dsHeaderBack.emit({tool:s})})):null,l.map((e=>i("ds-tooltip",{slot:"trailing",key:e.id,label:e.ariaLabel,side:"bottom",size:"sm"},i("ds-button-unfilled",{id:e.triggerId||undefined,"data-header-action-id":e.id,variant:"icon",icon:e.icon,size:"md","aria-label":e.ariaLabel,haspopup:e.haspopup,controls:e.controls,expanded:e.expanded,surfaceOpen:e.surfaceOpen,pressed:e.pressed,isInactive:e.isInactive,activeFill:false,hasBorder:false,onDsClick:t=>this.handleMobileHeaderAction(s,e.id,t)})))))}renderMobile(){const s=this.mobileActiveTool;return i("div",{class:"shell-tools__mobile","aria-hidden":this.open&&s?undefined:"true",inert:this.open&&s?undefined:true},s?this.renderMobileHeader(s):null,i("div",{class:"shell-tools__mobile-body"},this.mobileViewOrder.map((e=>{const t=this.open&&e===s;return i("div",{key:`mobile-tool-view:${e}`,class:{"shell-tools__view":true,"shell-tools__view--active":t},hidden:!t,"aria-hidden":t?undefined:"true",inert:t?undefined:true},i("slot",{name:`${e}-view`},i("slot",{name:e})))}))))}render(){const s=this.responsiveMode==="mobile";return i(o,{key:"39e2fd965c057e8202d2aa7f2ae8b344bd41986d",role:s?this.presentation==="fullscreen"?"dialog":"complementary":undefined,"aria-modal":s&&this.presentation==="fullscreen"?"true":undefined,"aria-label":s?this.toolsLabel:undefined},s?this.renderMobile():this.renderDesktop())}get el(){return this}static get watchers(){return{presentation:[{presentationChanged:0}],items:[{handleItemsChange:0}]}}static get style(){return D()}},[257,"ds-shell-tools",{responsiveMode:[513,"responsive-mode"],open:[1540],activeTool:[1537,"active-tool"],presentation:[1537],fullscreenHeaderMode:[513,"fullscreen-header-mode"],items:[16],accessories:[16],headers:[16],storageKey:[1,"storage-key"],toolsLabel:[1,"tools-label"],toolShortcutsLabel:[1,"tool-shortcuts-label"],inboxLabel:[1,"inbox-label"],inboxNavigationLabel:[1,"inbox-navigation-label"],activateTool:[64],closeDrawer:[64],focusHeaderAction:[64]},undefined,{presentation:[{presentationChanged:0}],items:[{handleItemsChange:0}]}]);function A(){if(typeof customElements==="undefined"){return}const s=["ds-shell-tools","ds-badge","ds-button-unfilled","ds-divider","ds-icon","ds-loader","ds-menu","ds-mobile-header","ds-mobile-section-switcher","ds-panel-tool-header","ds-panel-tools","ds-swatch-picker","ds-switch","ds-tab-group","ds-tag","ds-text","ds-tooltip"];s.forEach((s=>{switch(s){case"ds-shell-tools":if(!customElements.get(l(s))){customElements.define(l(s),T)}break;case"ds-badge":if(!customElements.get(l(s))){b()}break;case"ds-button-unfilled":if(!customElements.get(l(s))){p()}break;case"ds-divider":if(!customElements.get(l(s))){f()}break;case"ds-icon":if(!customElements.get(l(s))){g()}break;case"ds-loader":if(!customElements.get(l(s))){v()}break;case"ds-menu":if(!customElements.get(l(s))){k()}break;case"ds-mobile-header":if(!customElements.get(l(s))){w()}break;case"ds-mobile-section-switcher":if(!customElements.get(l(s))){_()}break;case"ds-panel-tool-header":if(!customElements.get(l(s))){y()}break;case"ds-panel-tools":if(!customElements.get(l(s))){h()}break;case"ds-swatch-picker":if(!customElements.get(l(s))){C()}break;case"ds-switch":if(!customElements.get(l(s))){E()}break;case"ds-tab-group":if(!customElements.get(l(s))){j()}break;case"ds-tag":if(!customElements.get(l(s))){x()}break;case"ds-text":if(!customElements.get(l(s))){B()}break;case"ds-tooltip":if(!customElements.get(l(s))){L()}break}}))}A();export{T as S,A as d};
|
|
2
|
+
//# sourceMappingURL=p-B5AZd41L.js.map
|