@ds-mo/ui 16.1.3 → 16.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +574 -3
- package/dist/angular/ds-disclosure.d.ts +18 -0
- package/dist/angular/ds-disclosure.js +42 -0
- package/dist/angular/ds-drawer.d.ts +40 -0
- package/dist/angular/ds-drawer.js +54 -0
- package/dist/angular/ds-popover.d.ts +24 -0
- package/dist/angular/ds-popover.js +45 -0
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +3 -0
- package/dist/angular/proxies.d.ts +3 -0
- package/dist/angular/proxies.js +3 -0
- package/dist/components/ds-agent-activity.js +1 -1
- package/dist/components/ds-agent-questionnaire.js +1 -1
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-agent-source-list.js +1 -1
- package/dist/components/ds-agent-tool-call.js +1 -1
- package/dist/components/ds-attachment-list.js +1 -1
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-banner.js +1 -1
- package/dist/components/ds-bar-action.js +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-page-title.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-breadcrumb.js +1 -1
- package/dist/components/ds-button-filled.js +1 -1
- package/dist/components/ds-button-inverted.js +1 -1
- package/dist/components/ds-button-unfilled.js +1 -1
- package/dist/components/ds-calendar.js +1 -1
- package/dist/components/ds-card-action-center.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-overview.js +1 -1
- package/dist/components/ds-card-setting.js +1 -1
- package/dist/components/ds-card-settings-scope.js +1 -1
- package/dist/components/ds-chart-legend.js +1 -1
- package/dist/components/ds-chart.js +1 -1
- package/dist/components/ds-checkbox-group.js +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-section.js +1 -1
- package/dist/components/ds-conversation-list.js +1 -1
- package/dist/components/ds-data-customize.js +1 -1
- package/dist/components/ds-data-filter.js +1 -1
- package/dist/components/ds-data-group.js +1 -1
- package/dist/components/ds-data-preferences.js +1 -1
- package/dist/components/ds-data-preferences.js.map +1 -1
- package/dist/components/ds-data-saved-views.js +1 -1
- package/dist/components/ds-data-search.js +1 -1
- package/dist/components/ds-data-search.js.map +1 -1
- package/dist/components/ds-data-sort.js +1 -1
- package/dist/components/ds-data-toolbar.js +1 -1
- package/dist/components/ds-disclosure.d.ts +11 -0
- package/dist/components/ds-disclosure.js +2 -0
- package/dist/components/ds-disclosure.js.map +1 -0
- package/dist/components/ds-divider.js +1 -1
- package/dist/components/ds-drawer.d.ts +11 -0
- package/dist/components/ds-drawer.js +2 -0
- package/dist/components/ds-drawer.js.map +1 -0
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-field.js +1 -1
- package/dist/components/ds-filter-menu.js +1 -1
- package/dist/components/ds-inline-banner-settings.js +1 -1
- package/dist/components/ds-input-date.js +1 -1
- package/dist/components/ds-input-time.js +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-map-cluster-marker.js +1 -1
- package/dist/components/ds-map-entity-marker.js +1 -1
- package/dist/components/ds-map-marker.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-bubble.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-message.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-navigation-tab-group.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-tool-header.js +1 -1
- package/dist/components/ds-panel-tool-search.js +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-paper-texture.js +1 -1
- package/dist/components/ds-popover.d.ts +11 -0
- package/dist/components/ds-popover.js +2 -0
- package/dist/components/ds-popover.js.map +1 -0
- package/dist/components/ds-radio-tile.js +1 -1
- package/dist/components/ds-radio.js +1 -1
- package/dist/components/ds-score.js +1 -1
- package/dist/components/ds-scroll-overlay.js +1 -1
- package/dist/components/ds-select-toggle.js +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-setting-row-checkbox.js +1 -1
- package/dist/components/ds-setting-row-radio.js +1 -1
- package/dist/components/ds-setting-row-radio.js.map +1 -1
- package/dist/components/ds-setting-row-toggle.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-skeleton.js +1 -1
- package/dist/components/ds-slider.js +1 -1
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-switch.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-text.js +1 -1
- package/dist/components/ds-textarea.js +1 -1
- package/dist/components/ds-time-picker.js +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-toast.js.map +1 -1
- package/dist/components/ds-tooltip-chart.js +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/{p-D-Lo5uuI.js → p-3_LHRdqq.js} +2 -2
- package/dist/components/{p-Cc8p57pS.js → p-9EjkmESv.js} +2 -2
- package/dist/components/{p-CQnjpuMX.js → p-9PpepIfc.js} +2 -2
- package/dist/components/{p-C860ilDn.js → p-A47UHyiC.js} +2 -2
- package/dist/components/p-BCzvtlR2.js +2 -0
- package/dist/components/{p-D3FrQk7o.js.map → p-BCzvtlR2.js.map} +1 -1
- package/dist/components/{p-ClOvX8cD.js → p-BEj9uENH.js} +2 -2
- package/dist/components/{p-CtomYv1z.js → p-BJmAAyRk.js} +2 -2
- package/dist/components/{p-Bt1Ybvz-.js → p-BQ6p3LFP.js} +2 -2
- package/dist/components/{p-DiNEjFpy.js → p-BbndBzzZ.js} +2 -2
- package/dist/components/{p-hFe35P2l.js → p-Bg1UmSZn.js} +2 -2
- package/dist/components/{p-ClhfXMaD.js → p-Bn-cskPo.js} +2 -2
- package/dist/components/p-Bz9dI7nI.js +2 -0
- package/dist/components/{p-Dc_zSOKq.js.map → p-Bz9dI7nI.js.map} +1 -1
- package/dist/components/{p-D538svhW.js → p-C0-sabnr.js} +2 -2
- package/dist/components/{p-DQ-wfTOw.js → p-C11CnHDl.js} +2 -2
- package/dist/components/{p-xszHlNkG.js → p-C68nt4dl.js} +2 -2
- package/dist/components/p-C8UThLHd.js +2 -0
- package/dist/components/{p-CsGkdf4W.js.map → p-C8UThLHd.js.map} +1 -1
- package/dist/components/p-C8WKo0sf.js +2 -0
- package/dist/components/{p-D8iNLSCa.js.map → p-C8WKo0sf.js.map} +1 -1
- package/dist/components/p-CAYqnjyC.js +2 -0
- package/dist/components/{p-oBBzQpg_.js.map → p-CAYqnjyC.js.map} +1 -1
- package/dist/components/{p-G6r6yYg8.js → p-CBezgJ3r.js} +2 -2
- package/dist/components/p-CF6Px2b2.js +2 -0
- package/dist/components/{p-omfGVBEt.js.map → p-CF6Px2b2.js.map} +1 -1
- package/dist/components/{p-CMZAEySh.js → p-CVSE2Ool.js} +2 -2
- package/dist/components/{p-KTaiJztz.js → p-CVuSm1Sh.js} +2 -2
- package/dist/components/{p-BNvZM4jP.js → p-CZVoCdYE.js} +2 -2
- package/dist/components/{p-BYo1-6b5.js → p-CeACJYcU.js} +2 -2
- package/dist/components/{p-lnCWfvuA.js → p-Cjw63BmX.js} +2 -2
- package/dist/components/{p-N-2CZze7.js → p-CkUF45d_.js} +2 -2
- package/dist/components/{p-CbyZ7BDJ.js → p-ClRd39mR.js} +2 -2
- package/dist/components/{p-Nx52go85.js → p-Cn6Ud58k.js} +2 -2
- package/dist/components/{p-BFgJoeVV.js → p-D3r_5Fw-.js} +2 -2
- package/dist/components/p-DCqDQWVK.js +2 -0
- package/dist/components/{p-BuvVFyAA.js.map → p-DCqDQWVK.js.map} +1 -1
- package/dist/components/{p-CXrOGz7X.js → p-DIXpyBWB.js} +2 -2
- package/dist/components/{p-1lWK_LMY.js → p-DJtohrKV.js} +2 -2
- package/dist/components/{p-D5-hqLPK.js → p-DKL7n7NM.js} +2 -2
- package/dist/components/{p-DYI6UlOP.js → p-D_CfgH1L.js} +2 -2
- package/dist/components/{p-P2-eHQJU.js → p-D_N38YjY.js} +2 -2
- package/dist/components/p-Dalq5voO.js +2 -0
- package/dist/components/{p-ClgJZFkb.js.map → p-Dalq5voO.js.map} +1 -1
- package/dist/components/{p-DMPn_dt7.js → p-DcwgXLe-.js} +2 -2
- package/dist/components/{p-BckLHaey.js → p-DpA8UeSy.js} +2 -2
- package/dist/components/{p-hom6svhE.js → p-DtNCj4p0.js} +2 -2
- package/dist/components/{p-pkJ3X3s7.js → p-Dwga8azB.js} +2 -2
- package/dist/components/{p-CGtq7TnC.js → p-LFHrICnV.js} +2 -2
- package/dist/components/p-LQGcTdiv.js +2 -0
- package/dist/components/{p-BI-XuQKW.js.map → p-LQGcTdiv.js.map} +1 -1
- package/dist/components/{p-BoWpIl_m.js → p-N8tEOYt8.js} +2 -2
- package/dist/components/{p-CbJx9swS.js → p-QU-CyuBt.js} +2 -2
- package/dist/components/p-QYI9nW7a.js +2 -0
- package/dist/components/p-QYI9nW7a.js.map +1 -0
- package/dist/components/{p-DcvPY30Q.js → p-X-GPE9bP.js} +2 -2
- package/dist/components/{p-CnsuVR2e.js → p-cOkFnnZV.js} +2 -2
- package/dist/components/{p-BctjNfzt.js → p-c_qWiZ6V.js} +2 -2
- package/dist/components/{p-M-Sxsv7V.js → p-dVdTdZdu.js} +2 -2
- package/dist/components/{p-CE_S4oQ_.js → p-hHtKJMVu.js} +2 -2
- package/dist/components/{p-6r60E0i4.js → p-snYhfM1q.js} +2 -2
- package/dist/components/p-xHv_RGJh.js +2 -0
- package/dist/components/p-xHv_RGJh.js.map +1 -0
- package/dist/components/{p-cvVUXaen.js → p-zGd26CTX.js} +2 -2
- package/dist/docs/components.json +1291 -1
- package/dist/lint/index.js +1 -1
- package/dist/mcp-data/registry/disclosure.json +282 -0
- package/dist/mcp-data/registry/drawer.json +567 -0
- package/dist/mcp-data/registry/popover.json +385 -0
- package/dist/mcp-data/registry/registry.json +582 -2
- package/dist/mcp-data/registry/shell-app.json +6 -4
- package/dist/react/components.d.ts +3 -0
- package/dist/react/components.js +3 -0
- package/dist/react/ds-disclosure.d.ts +12 -0
- package/dist/react/ds-disclosure.js +12 -0
- package/dist/react/ds-drawer.d.ts +16 -0
- package/dist/react/ds-drawer.js +18 -0
- package/dist/react/ds-popover.d.ts +13 -0
- package/dist/react/ds-popover.js +15 -0
- package/dist/types/components/Disclosure/Disclosure.d.ts +22 -0
- package/dist/types/components/Drawer/Drawer.d.ts +123 -0
- package/dist/types/components/Popover/Popover.d.ts +64 -0
- package/dist/types/components.d.ts +423 -0
- package/dist/vue/components.d.ts +3 -0
- package/dist/vue/components.js +3 -0
- package/dist/vue/ds-disclosure.d.ts +3 -0
- package/dist/vue/ds-disclosure.js +15 -0
- package/dist/vue/ds-drawer.d.ts +3 -0
- package/dist/vue/ds-drawer.js +34 -0
- package/dist/vue/ds-popover.d.ts +3 -0
- package/dist/vue/ds-popover.js +21 -0
- package/package.json +1 -1
- package/dist/components/p-BI-XuQKW.js +0 -2
- package/dist/components/p-BuvVFyAA.js +0 -2
- package/dist/components/p-ClgJZFkb.js +0 -2
- package/dist/components/p-CsGkdf4W.js +0 -2
- package/dist/components/p-D3FrQk7o.js +0 -2
- package/dist/components/p-D8iNLSCa.js +0 -2
- package/dist/components/p-DTlNtCX1.js +0 -2
- package/dist/components/p-DTlNtCX1.js.map +0 -1
- package/dist/components/p-Dc_zSOKq.js +0 -2
- package/dist/components/p-oBBzQpg_.js +0 -2
- package/dist/components/p-omfGVBEt.js +0 -2
- /package/dist/components/{p-D-Lo5uuI.js.map → p-3_LHRdqq.js.map} +0 -0
- /package/dist/components/{p-Cc8p57pS.js.map → p-9EjkmESv.js.map} +0 -0
- /package/dist/components/{p-CQnjpuMX.js.map → p-9PpepIfc.js.map} +0 -0
- /package/dist/components/{p-C860ilDn.js.map → p-A47UHyiC.js.map} +0 -0
- /package/dist/components/{p-ClOvX8cD.js.map → p-BEj9uENH.js.map} +0 -0
- /package/dist/components/{p-CtomYv1z.js.map → p-BJmAAyRk.js.map} +0 -0
- /package/dist/components/{p-Bt1Ybvz-.js.map → p-BQ6p3LFP.js.map} +0 -0
- /package/dist/components/{p-DiNEjFpy.js.map → p-BbndBzzZ.js.map} +0 -0
- /package/dist/components/{p-hFe35P2l.js.map → p-Bg1UmSZn.js.map} +0 -0
- /package/dist/components/{p-ClhfXMaD.js.map → p-Bn-cskPo.js.map} +0 -0
- /package/dist/components/{p-D538svhW.js.map → p-C0-sabnr.js.map} +0 -0
- /package/dist/components/{p-DQ-wfTOw.js.map → p-C11CnHDl.js.map} +0 -0
- /package/dist/components/{p-xszHlNkG.js.map → p-C68nt4dl.js.map} +0 -0
- /package/dist/components/{p-G6r6yYg8.js.map → p-CBezgJ3r.js.map} +0 -0
- /package/dist/components/{p-CMZAEySh.js.map → p-CVSE2Ool.js.map} +0 -0
- /package/dist/components/{p-KTaiJztz.js.map → p-CVuSm1Sh.js.map} +0 -0
- /package/dist/components/{p-BNvZM4jP.js.map → p-CZVoCdYE.js.map} +0 -0
- /package/dist/components/{p-BYo1-6b5.js.map → p-CeACJYcU.js.map} +0 -0
- /package/dist/components/{p-lnCWfvuA.js.map → p-Cjw63BmX.js.map} +0 -0
- /package/dist/components/{p-N-2CZze7.js.map → p-CkUF45d_.js.map} +0 -0
- /package/dist/components/{p-CbyZ7BDJ.js.map → p-ClRd39mR.js.map} +0 -0
- /package/dist/components/{p-Nx52go85.js.map → p-Cn6Ud58k.js.map} +0 -0
- /package/dist/components/{p-BFgJoeVV.js.map → p-D3r_5Fw-.js.map} +0 -0
- /package/dist/components/{p-CXrOGz7X.js.map → p-DIXpyBWB.js.map} +0 -0
- /package/dist/components/{p-1lWK_LMY.js.map → p-DJtohrKV.js.map} +0 -0
- /package/dist/components/{p-D5-hqLPK.js.map → p-DKL7n7NM.js.map} +0 -0
- /package/dist/components/{p-DYI6UlOP.js.map → p-D_CfgH1L.js.map} +0 -0
- /package/dist/components/{p-P2-eHQJU.js.map → p-D_N38YjY.js.map} +0 -0
- /package/dist/components/{p-DMPn_dt7.js.map → p-DcwgXLe-.js.map} +0 -0
- /package/dist/components/{p-BckLHaey.js.map → p-DpA8UeSy.js.map} +0 -0
- /package/dist/components/{p-hom6svhE.js.map → p-DtNCj4p0.js.map} +0 -0
- /package/dist/components/{p-pkJ3X3s7.js.map → p-Dwga8azB.js.map} +0 -0
- /package/dist/components/{p-CGtq7TnC.js.map → p-LFHrICnV.js.map} +0 -0
- /package/dist/components/{p-BoWpIl_m.js.map → p-N8tEOYt8.js.map} +0 -0
- /package/dist/components/{p-CbJx9swS.js.map → p-QU-CyuBt.js.map} +0 -0
- /package/dist/components/{p-DcvPY30Q.js.map → p-X-GPE9bP.js.map} +0 -0
- /package/dist/components/{p-CnsuVR2e.js.map → p-cOkFnnZV.js.map} +0 -0
- /package/dist/components/{p-BctjNfzt.js.map → p-c_qWiZ6V.js.map} +0 -0
- /package/dist/components/{p-M-Sxsv7V.js.map → p-dVdTdZdu.js.map} +0 -0
- /package/dist/components/{p-CE_S4oQ_.js.map → p-hHtKJMVu.js.map} +0 -0
- /package/dist/components/{p-6r60E0i4.js.map → p-snYhfM1q.js.map} +0 -0
- /package/dist/components/{p-cvVUXaen.js.map → p-zGd26CTX.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,h as o,a as r,t as n}from"./index.js";import{d as i}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as e,H as s,h as o,a as r,t as n}from"./index.js";import{d as i}from"./p-X-GPE9bP.js";import{d as c}from"./p-DcwgXLe-.js";const a=["fair","good","excellent"];function d(e){return typeof e==="string"&&a.includes(e)}function t(e){if(typeof e==="string"&&e.trim()==="")return undefined;const s=typeof e==="number"?e:Number(e);if(!Number.isFinite(s)||s<0||s>100)return undefined;if(s<=50)return"fair";if(s<=80)return"good";return"excellent"}function l(e,s){return d(s)?s:t(e)}const b={default:{sm:"text-title-small",md:"text-title-medium",lg:"text-title-large"},dense:{sm:"text-title-medium",md:"text-title-large",lg:"text-display-small"}};const g=()=>`.ds-control-frame.sc-ds-score{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-score{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-score{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-score{min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025))}.ds-control-label-dot.sc-ds-score{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-score{position:absolute;inset-block-start:0;inset-inline-end:0;pointer-events:none}@media (forced-colors: active){.sc-ds-score:root,.sc-ds-score-h,.ds-forced-colors-scope.sc-ds-score{--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-score-h{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;--_score-badge-inline-size:var(--dimension-size-500);--_score-badge-block-size:var(--dimension-size-400);--_score-skeleton-inset:calc(var(--_score-badge-block-size) / 8)}.score--sm.sc-ds-score-h{--_score-badge-inline-size:calc(var(--dimension-size-400) - var(--dimension-space-050));--_score-badge-block-size:var(--dimension-size-300)}.score--md.sc-ds-score-h{--_score-badge-inline-size:var(--dimension-size-500);--_score-badge-block-size:var(--dimension-size-400)}.score--lg.sc-ds-score-h{--_score-badge-inline-size:calc(var(--dimension-size-600) + var(--dimension-space-100));--_score-badge-block-size:var(--dimension-size-500)}.score__badge.sc-ds-score{display:flex;flex:0 0 auto;align-items:center;justify-content:center;box-sizing:border-box;inline-size:var(--_score-badge-inline-size);block-size:var(--_score-badge-block-size);overflow:hidden;border-radius:var(--dimension-radius-025);background:var(--color-background-faint-neutral);color:var(--color-foreground-bold-neutral);-webkit-user-select:none;user-select:none}.score__badge--fair.sc-ds-score{background:var(--color-safety-score-background-fair);color:var(--color-safety-score-foreground-on-fair)}.score__badge--good.sc-ds-score{background:var(--color-safety-score-background-good);color:var(--color-safety-score-foreground-on-good)}.score__badge--excellent.sc-ds-score{background:var(--color-safety-score-background-excellent);color:var(--color-safety-score-foreground-on-excellent)}.score__value.sc-ds-score,.score__badge.sc-ds-score ds-skeleton.sc-ds-score{flex:0 0 auto}.score__badge--loading.sc-ds-score{padding-inline:var(--_score-skeleton-inset)}.score__badge--loading.sc-ds-score .score__value.sc-ds-score{flex:1 1 auto;inline-size:100%;block-size:100%;max-inline-size:100%;max-block-size:100%;min-inline-size:0}@media (forced-colors: active){.score__badge.sc-ds-score{border:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);background:var(--ds-forced-color-surface);color:var(--ds-forced-color-content)}}`;const u=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.value="";this.size="md";this.variant="default";this.isLoading=false;this.label=""}render(){const e=this.size;const s=this.variant;const n=l(this.value,this.level);const i=b[s][e];const c=[this.label.trim(),this.isLoading?"":this.value].filter(Boolean).join(" ");return o(r,{key:"5ab743247ea25b5f83bfb72542dc8830831c3401",class:{score:true,[`score--${e}`]:true,[`score--${s}`]:true,"score--loading":this.isLoading},role:c?"img":undefined,"aria-busy":this.isLoading?"true":undefined,"aria-label":c||undefined},o("span",{key:"7f693acfd2a3d975cbb4577d01bbe65399b02654",class:{score__badge:true,[`score__badge--${n}`]:Boolean(n),"score__badge--loading":this.isLoading}},this.isLoading?o("ds-skeleton",{class:"score__value",variant:"text",textVariant:i,background:n?"bold":"faint"}):o("ds-text",{as:"span",class:"score__value ds-control-label-box",variant:i,emphasis:true,color:"inherit",fontFeature:"tabular-nums"},this.value)))}static get style(){return g()}},[2,"ds-score",{value:[8],size:[1],variant:[1],level:[1],isLoading:[4,"is-loading"],label:[1]}]);function f(){if(typeof customElements==="undefined"){return}const e=["ds-score","ds-skeleton","ds-text"];e.forEach((e=>{switch(e){case"ds-score":if(!customElements.get(n(e))){customElements.define(n(e),u)}break;case"ds-skeleton":if(!customElements.get(n(e))){i()}break;case"ds-text":if(!customElements.get(n(e))){c()}break}}))}f();export{u as S,f as d,d as i};
|
|
2
|
+
//# sourceMappingURL=p-D_N38YjY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as t,H as i,c as e,h as s,a as n,t as d}from"./index.js";import{A as o,r}from"./p-QYI9nW7a.js";import{A as a}from"./p-CwUXroLs.js";import{P as c}from"./p-HNktxWtF.js";import{d as l}from"./p-BEj9uENH.js";import{d as p}from"./p-DKL7n7NM.js";import{i as u,f as h,b as f,d as v}from"./p-BbndBzzZ.js";import{d as g}from"./p-C942uiH1.js";import{d as m}from"./p-0XTyQNRG.js";import{d as b}from"./p-DcwgXLe-.js";import{d as y}from"./p-xHv_RGJh.js";import{D as x}from"./p-DOUk4KoT.js";import{r as w}from"./p-CVYjLzYI.js";import{r as k}from"./p-DhKvqh5G.js";import{s as z,r as C}from"./p-DGVZhrMd.js";import{C as I}from"./p-CuwopElg.js";import{T as F}from"./p-mSCnWLhL.js";import{c as _}from"./p-DuFm-ieS.js";const j=()=>`@media (forced-colors: active){.sc-ds-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--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-input-date-h,.ds-interaction-fill.sc-ds-input-date{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-input-date-h::before,.ds-interaction-fill.sc-ds-input-date::before,.ds-interaction-fill.sc-ds-input-date-h::after,.ds-interaction-fill.sc-ds-input-date::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-input-date-h::before,.ds-interaction-fill.sc-ds-input-date::before{z-index:1}.ds-interaction-fill.sc-ds-input-date-h::after,.ds-interaction-fill.sc-ds-input-date::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-input-date-h,.ds-interaction-fill--bordered.sc-ds-input-date{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-input-date-h::before,.ds-interaction-fill--selected.sc-ds-input-date::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-input-date-h,.ds-interaction-fill--selected.sc-ds-input-date{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-input-date-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-input-date:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-input-date-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-input-date:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-input-date-h::after,.ds-interaction-fill--grouped.sc-ds-input-date::after,.ds-interaction-fill--grouped.sc-ds-input-date-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-input-date:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-input-date-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-input-date:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-input-date-h,.ds-interaction-fill--grouped.sc-ds-input-date{--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-input-date-h>.ds-interaction-fill__content.sc-ds-input-date,.ds-interaction-fill.sc-ds-input-date>.ds-interaction-fill__content.sc-ds-input-date,.ds-interaction-fill__content.sc-ds-input-date{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-input-date-h,.ds-interaction-fill--on-faint.sc-ds-input-date{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-input-date-h,.ds-interaction-fill--on-medium.sc-ds-input-date{--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-input-date-h,.ds-interaction-fill--on-bold.sc-ds-input-date{--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-input-date-h,.ds-interaction-fill--on-strong.sc-ds-input-date{--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-input-date-h,.ds-interaction-fill--on-translucent.sc-ds-input-date{--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-input-date-h,.ds-interaction-fill--on-inverted.sc-ds-input-date{--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-input-date-h,.ds-interaction-fill--on-media.sc-ds-input-date{--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-input-date-h,.ds-interaction-fill--on-always-dark.sc-ds-input-date{--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-chrome.sc-ds-input-date-h,.ds-interaction-fill--on-chrome.sc-ds-input-date{--ds-interaction-hover:var(--color-chrome-interaction-hover);--ds-interaction-pressed:var(--color-chrome-interaction-pressed);--ds-interaction-active:var(--color-chrome-interaction-active);--ds-focus-ring-color:var(--color-chrome-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-input-date-h,.ds-interaction-fill--on-navigation.sc-ds-input-date{--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-input-date-h:not(:disabled)::after,.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-input-date:not(:disabled)::after{background:var(--ds-interaction-pressed)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-input-date-h::after,.ds-interaction-fill.sc-ds-input-date::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-input-date-h:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill--surface-open.sc-ds-input-date: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-input-date-h::before,.ds-interaction-fill--selected.sc-ds-input-date::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-input-date-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-input-date: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-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--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-input-date-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-input-date-h,.ds-focus-ring.sc-ds-input-date,.ds-focus-ring-inset.sc-ds-input-date-h,.ds-focus-ring-inset.sc-ds-input-date{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-input-date-h:focus-visible,.ds-focus-ring.sc-ds-input-date: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-input-date-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-input-date{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-input-date-h:focus-visible,.ds-focus-ring-inset.sc-ds-input-date:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-input-date-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-input-date: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-input-date-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-input-date{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-input-date-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-input-date::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-input-date-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--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-input-date-h,.ds-control-inactive.sc-ds-input-date{opacity:var(--effect-opacity-medium);pointer-events:none;cursor:not-allowed}@media (forced-colors: active){.ds-control-inactive.sc-ds-input-date-h,.ds-control-inactive.sc-ds-input-date{color:var(--ds-forced-color-disabled);opacity:1}}.sc-ds-input-date-h,.sc-ds-input-date:where(.ds-table),.sc-ds-input-date:where(.tooltip-popup),.sc-ds-input-date:where(.ds-radius){--ds-radius-control:var(--dimension-radius-025);--ds-radius-card:var(--dimension-radius-050);--ds-radius-modal:var(--dimension-radius-050);--ds-radius-menu:var(--dimension-radius-075);--ds-radius-tooltip-control:var(--dimension-radius-025);--ds-radius-tooltip-menu:var(--dimension-radius-075);--ds-radius-table:var(--dimension-radius-050)}.ds-control--lg.sc-ds-input-date,.ds-control--lg.sc-ds-input-date-h,.ds-control--md.sc-ds-input-date-h,.ds-control--md.sc-ds-input-date,.ds-control--sm.sc-ds-input-date-h,.ds-control--sm.sc-ds-input-date,.ds-control--xs.sc-ds-input-date-h,.ds-control--xs.sc-ds-input-date{--ds-control-radius:var(--ds-radius-control)}.ds-control--lg.sc-ds-input-date-h,.ds-control--lg.sc-ds-input-date{--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-input-date-h,.ds-control--md.sc-ds-input-date{--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-input-date-h,.ds-control--sm.sc-ds-input-date{--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-input-date-h,.ds-control--xs.sc-ds-input-date{--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-frame.sc-ds-input-date{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-input-date{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-input-date{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-input-date{min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025))}.ds-control-label-dot.sc-ds-input-date{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-input-date{position:absolute;inset-block-start:0;inset-inline-end:0;pointer-events:none}.ds-control-width--hug.sc-ds-input-date-h,.ds-control-width--hug.sc-ds-input-date{width:fit-content;max-width:100%;flex:0 0 auto}.ds-control-width--fill.sc-ds-input-date-h,.ds-control-width--fill.sc-ds-input-date{width:100%;min-width:0;flex:1 1 auto;align-self:stretch}.ds-field-stack.sc-ds-input-date-h,.ds-field-stack.sc-ds-input-date{display:flex;flex-direction:column;gap:var(--dimension-space-050)}.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date-h .error-text.sc-ds-input-date,.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date .error-text.sc-ds-input-date,.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date .field__description.sc-ds-input-date,.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date .field__error.sc-ds-input-date{padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-text--display-medium.sc-ds-input-date-h,.ds-text--display-medium.sc-ds-input-date{font-size:var(--typography-fontsize-3xl);line-height:var(--typography-lineheight-3xl)}.ds-text--display-small.sc-ds-input-date-h,.ds-text--display-small.sc-ds-input-date{font-size:var(--typography-fontsize-2xl);line-height:var(--typography-lineheight-2xl)}.ds-text--title-large.sc-ds-input-date-h,.ds-text--title-large.sc-ds-input-date{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl)}.ds-text--title-medium.sc-ds-input-date-h,.ds-text--title-medium.sc-ds-input-date{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--title-small.sc-ds-input-date-h,.ds-text--title-small.sc-ds-input-date{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-large.sc-ds-input-date-h,.ds-text--body-large.sc-ds-input-date{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--body-medium.sc-ds-input-date-h,.ds-text--body-medium.sc-ds-input-date{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-small.sc-ds-input-date-h,.ds-text--body-small.sc-ds-input-date{font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm)}.ds-text--caption.sc-ds-input-date-h,.ds-text--caption.sc-ds-input-date{font-size:var(--typography-fontsize-xs);line-height:var(--typography-lineheight-xs);text-transform:uppercase}.ds-text--display-medium.ds-text--emphasis.sc-ds-input-date-h,.ds-text--display-small.ds-text--emphasis.sc-ds-input-date-h,.ds-text--display-medium.ds-text--emphasis.sc-ds-input-date,.ds-text--display-small.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-bold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--display-medium.ds-text--regular.sc-ds-input-date-h,.ds-text--display-small.ds-text--regular.sc-ds-input-date-h,.ds-text--display-medium.ds-text--regular.sc-ds-input-date,.ds-text--display-small.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-large.ds-text--emphasis.sc-ds-input-date-h,.ds-text--title-large.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--title-large.ds-text--regular.sc-ds-input-date-h,.ds-text--title-large.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--emphasis.sc-ds-input-date-h,.ds-text--title-small.ds-text--emphasis.sc-ds-input-date-h,.ds-text--title-medium.ds-text--emphasis.sc-ds-input-date,.ds-text--title-small.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--regular.sc-ds-input-date-h,.ds-text--title-small.ds-text--regular.sc-ds-input-date-h,.ds-text--title-medium.ds-text--regular.sc-ds-input-date,.ds-text--title-small.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-large.ds-text--emphasis.sc-ds-input-date-h,.ds-text--body-medium.ds-text--emphasis.sc-ds-input-date-h,.ds-text--body-large.ds-text--emphasis.sc-ds-input-date,.ds-text--body-medium.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--body-large.ds-text--regular.sc-ds-input-date-h,.ds-text--body-medium.ds-text--regular.sc-ds-input-date-h,.ds-text--body-large.ds-text--regular.sc-ds-input-date,.ds-text--body-medium.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--emphasis.sc-ds-input-date-h,.ds-text--body-small.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--regular.sc-ds-input-date-h,.ds-text--body-small.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-none)}.ds-text--caption.ds-text--emphasis.sc-ds-input-date-h,.ds-text--caption.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-positive)}.ds-text--caption.ds-text--regular.sc-ds-input-date-h,.ds-text--caption.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-positive)}@media (forced-colors: active){.sc-ds-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--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}}.input-host.sc-ds-input-date-h{display:inline-flex;--ds-input-fg:var(--color-foreground-primary);--ds-input-placeholder:var(--color-foreground-secondary);--ds-input-placeholder-active:var(--color-foreground-quaternary);--ds-input-adornment-fg:var(--color-foreground-secondary);--ds-input-border:var(--color-border-secondary)}.ds-control-width--fill.sc-ds-input-date-h,.ds-control-width--fill.sc-ds-input-date-h .input-control.sc-ds-input-date{width:100%}.input-control.sc-ds-input-date{overflow:hidden;background:transparent;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));color:var(--ds-input-fg)}.input-control--bordered.sc-ds-input-date{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--ds-input-border)}.input-control--error.sc-ds-input-date{--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-negative)}.input-control--bordered.sc-ds-input-date:focus-within:not(.input-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-input-date-h .input-control.sc-ds-input-date::after{background:transparent}.native-input.sc-ds-input-date{position:relative;z-index:2;flex:1 1 auto;min-width:0;height:100%;background:transparent;border:none;border-radius:inherit;outline:none;color:var(--ds-input-fg);font-family:inherit;letter-spacing:inherit;text-overflow:ellipsis;-webkit-appearance:none;appearance:none;color-scheme:inherit}.native-input--align-start.sc-ds-input-date{text-align:start}.native-input.sc-ds-input-date:disabled{cursor:not-allowed}.native-input.sc-ds-input-date:read-only:not(:disabled){cursor:default}.native-input.sc-ds-input-date::-webkit-calendar-picker-indicator{display:none}.native-input.sc-ds-input-date::-webkit-inner-spin-button,.native-input.sc-ds-input-date::-webkit-clear-button{display:none}.native-input.sc-ds-input-date::-webkit-datetime-edit,.native-input.sc-ds-input-date::-webkit-datetime-edit-fields-wrapper,.native-input.sc-ds-input-date::-webkit-datetime-edit-text,.native-input.sc-ds-input-date::-webkit-datetime-edit-month-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-day-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-year-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-hour-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-minute-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-second-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-ampm-field{padding:0;color:inherit;font:inherit;letter-spacing:inherit}.input-control__prefix.sc-ds-input-date{position:relative;z-index:2;color:var(--ds-input-adornment-fg)}.input-control.sc-ds-input-date>.input-control__datetime-action.sc-ds-input-date{position:relative;z-index:2;flex-shrink:0;align-self:center}.ds-control-inactive.sc-ds-input-date-h .input-control.sc-ds-input-date>.input-control__datetime-action.sc-ds-input-date{--effect-opacity-medium:1}.input-control.sc-ds-input-date:has(.input-control__datetime-action){padding-inline-end:var(--dimension-space-025)}.error-text.sc-ds-input-date{width:100%}@media (forced-colors: active){.input-control--bordered.sc-ds-input-date:focus-within:not(.input-control--error)::after{outline-color:var(--ds-forced-color-selected)}.input-control--error.sc-ds-input-date::after{outline-style:dashed}}.ds-choice-popup.sc-ds-input-date{box-sizing:border-box;display:flex;flex-direction:column;min-width:var(--ds-choice-popup-min-inline-size, var(--dimension-menu-width-xs));max-width:min(var(--dimension-panel-width-lg), calc(100vw - var(--dimension-space-200)));max-height:calc(100vh - var(--dimension-space-200));overflow:hidden;inset:auto;margin:0;padding:0;border:0;background-color:var(--color-background-primary);border-radius:var(--ds-radius-menu);box-shadow:var(--effect-shadow-elevated-floating);color:var(--color-foreground-secondary);animation:dsChoiceFadeIn var(--effect-motion-short-2) forwards;backface-visibility:hidden;will-change:transform;text-align:start}.ds-choice-popup.sc-ds-input-date::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:var(--effect-highlight-elevated-floating)}.ds-choice-popup--closing.sc-ds-input-date{animation:dsChoiceFadeOut var(--effect-motion-short-2) forwards}@keyframes dsChoiceFadeIn{from{opacity:0;transform:inherit scale(0.97)}to{opacity:1}}@keyframes dsChoiceFadeOut{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.ds-choice-popup.sc-ds-input-date{animation:none;opacity:1}.ds-choice-popup--closing.sc-ds-input-date{opacity:0}}@media (forced-colors: active){.ds-choice-popup.sc-ds-input-date{outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}.ds-choice-popup.sc-ds-input-date::after{box-shadow:none}}.ds-chrome-space--sm.sc-ds-input-date-h,.ds-chrome-space--sm.sc-ds-input-date{--ds-chrome-padding:var(--ds-chrome-space-sm-padding, var(--dimension-space-050));--ds-chrome-gap:var(--dimension-space-050)}.ds-chrome-space--md.sc-ds-input-date-h,.ds-chrome-space--md.sc-ds-input-date{--ds-chrome-padding:var(--dimension-space-100);--ds-chrome-gap:var(--dimension-space-100)}.ds-chrome-space--lg.sc-ds-input-date-h,.ds-chrome-space--lg.sc-ds-input-date{--ds-chrome-padding:var(--dimension-space-200);--ds-chrome-gap:var(--dimension-space-200)}.ds-chrome-row.sc-ds-input-date-h,.ds-chrome-row.sc-ds-input-date,.ds-chrome-column.sc-ds-input-date-h,.ds-chrome-column.sc-ds-input-date,.ds-chrome-grid.sc-ds-input-date-h,.ds-chrome-grid.sc-ds-input-date{display:flex;box-sizing:border-box;gap:var(--ds-chrome-gap, var(--dimension-space-100));padding:var(--ds-chrome-padding, var(--dimension-space-100))}.ds-chrome-row.sc-ds-input-date-h,.ds-chrome-row.sc-ds-input-date{flex-direction:row;align-items:center}.ds-chrome-column.sc-ds-input-date-h,.ds-chrome-column.sc-ds-input-date{flex-direction:column}.ds-chrome-grid.sc-ds-input-date-h,.ds-chrome-grid.sc-ds-input-date{display:grid;align-items:center}.input-date-popup.ds-choice-popup.sc-ds-input-date{--ds-calendar-padding:0;padding:var(--dimension-space-050)}`;let T=0;const D="Enter a valid date.";const H="Date is before the minimum allowed date.";const E="Date is after the maximum allowed date.";const O=t(class t extends i{constructor(t){super();if(t!==false){this.__registerHost()}this.dsChange=e(this,"dsChange",7);this.internals=this.attachInternals();this.generatedId=`ds-input-date-${++T}`;this.errorId=`${this.generatedId}-error`;this.popupId=`${this.generatedId}-popup`;this.value="";this.disabled=false;this.readOnly=false;this.required=false;this.requiredMessage=x;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.draftText="";this.popupPhase="closed";this.positionReady=false;this.pos={x:0,y:0};this.position=new o({getAnchor:()=>this.controlEl??null,getPopup:()=>this.el.querySelector(".input-date-popup"),getOwnerDocument:()=>this.el.ownerDocument,measure:(t,i)=>{if(!this.open)return null;const e=w(F.space050,F.space050);return{anchorRect:t.getBoundingClientRect(),popupWidth:i.offsetWidth||this.popupFallbackWidth,popupHeight:i.offsetHeight||this.popupFallbackHeight,side:"bottom",align:"end",sideOffsetPx:w(F.space050,F.space050),alignOffsetPx:k({align:"end",alignOffsetPx:0,sectionInsetPx:e,anchorAlignment:"popup-frame"}),viewportPadPx:w(F.space050,F.space050),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,collisionRect:r(t)}},apply:({x:t,y:i})=>{this.pos={x:t,y:i}},onReady:()=>{this.positionReady=true},liveUpdate:"double-frame",observeResize:true,topLayer:true});this.interaction=new a({getAnchor:()=>this.controlEl??null,getPopup:()=>this.el.querySelector(".input-date-popup"),getOwnerDocument:()=>this.el.ownerDocument,onOutsideActivation:()=>this.closePicker(false)});this.pickerPopup=new c({position:this.position,interaction:this.interaction,getPopup:()=>this.el.querySelector(".input-date-popup"),onPhaseChange:t=>{this.popupPhase=t}});this.togglePicker=()=>{if(this.pickerInactive)return;if(this.open)this.closePicker("button");else this.openPicker()};this.handleInput=t=>{if(this.pickerInactive)return;this.draftText=t.target.value;const i=this.parseDraft(this.draftText);if(i===null)return;this.commitIso(i)};this.handleFocus=()=>{this.draftText=this.displayValue||this.value;this.focused=true};this.handleBlur=()=>{this.focused=false;this.touched=true;if(this.pickerInactive){this.draftText=this.displayValue;return}const t=this.parseDraft(this.draftText);if(t===null){this.draftText=this.displayValue;return}this.commitIso(t)};this.handleCalendarChange=t=>{t.stopPropagation();if(this.pickerInactive)return;const i=this.parseDraft(t.detail);if(i===null)return;this.commitIso(i);this.closePicker("input")}}get open(){return this.popupPhase==="open"}get shouldRender(){return this.popupPhase!=="closed"}get closing(){return this.popupPhase==="closing"}get popupFallbackWidth(){return w(F.menuWidthXs,F.menuWidthXs)}get popupFallbackHeight(){return w(F.menuFallbackHeight,F.menuFallbackHeight)}get formInactive(){return this.isInactive||this.disabled||this.formDisabled}get pickerInactive(){return this.formInactive||this.readOnly}get hasConstraintError(){if(!this.value)return false;if(!u(this.value))return true;if(this.min&&u(this.min)&&this.value<this.min)return true;if(this.max&&u(this.max)&&this.value>this.max)return true;return false}get isInvalid(){return this.error||!this.formInactive&&(this.required&&this.value.length===0||this.hasConstraintError)}componentWillLoad(){this.initialValue=this.value;this.syncFormValue()}disconnectedCallback(){this.pickerPopup.disconnect();this.positionReady=false;this.focused=false}syncFormValue(){const t=this.formInactive;z(this.internals,this.value,{inactive:t});const i={};let e="";if(!t){if(this.required&&this.value.length===0){i.valueMissing=true;e=this.requiredMessage}else if(this.value&&!u(this.value)){i.badInput=true;e=D}else if(this.value&&this.min&&u(this.min)&&this.value<this.min){i.rangeUnderflow=true;e=H}else if(this.value&&this.max&&u(this.max)&&this.value>this.max){i.rangeOverflow=true;e=E}}this.internals.setValidity(i,e)}onInteractionStateChange(){this.syncFormValue();if(this.pickerInactive&&this.shouldRender)this.closePicker(false)}formDisabledCallback(t){this.formDisabled=t;this.onInteractionStateChange()}formResetCallback(){this.value=this.initialValue;this.draftText=this.displayValue}formStateRestoreCallback(t){this.value=C(t);this.draftText=this.displayValue}async setFocus(){this.inputEl?.focus()}handleHostKeyDown(t){if(!this.shouldRender||this.closing)return;if(t.key==="Escape"){t.preventDefault();this.closePicker("button");return}if(t.key!=="Tab")return;const i=this.el.querySelector(".input-date-popup");if(!i||!t.composedPath().includes(i))return;if(!this.interaction.tabLeavesPopup(t))return;t.preventDefault();this.closePicker(false);this.interaction.moveFocusAfterTab(t.shiftKey)}get displayValue(){return h(this.value)}parseDraft(t){const i=t.trim();if(!i)return"";const e=f(i);if(!e)return null;if(this.min&&u(this.min)&&e<this.min)return null;if(this.max&&u(this.max)&&e>this.max)return null;return e}commitIso(t,i=true){if(this.value!==t){this.value=t;if(i)this.dsChange.emit(t)}this.draftText=h(t)}openPicker(){if(this.pickerInactive||this.open||!this.el.isConnected)return;this.positionReady=false;this.pickerPopup.open()}closePicker(t){this.pickerPopup.close((()=>{if(t==="input")this.inputEl?.focus();if(t==="button")void this.calendarButton?.setFocus()}))}render(){const t=this.inputId??this.generatedId;const i=this.formInactive;const e=this.pickerInactive;const d=this.value.length>0;const o=this.value!==this.initialValue;const r=this.error&&Boolean(this.errorMessage);const a=I[this.size];const c=`ds-text--${a.replace("text-","")}`;const l=[this.ariaDescribedby,r?this.errorId:undefined].filter(Boolean).join(" ")||undefined;const p={position:"fixed",left:"0",top:"0",transform:`translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,zIndex:"var(--dimension-z-index-floating)",visibility:this.positionReady?"visible":"hidden"};return s(n,{key:"3acefccb7ae39206adb0e16009abd8a629aa913b",class:{"input-host":true,"ds-field-stack":true,"ds-field-stack--supporting-inset":!this.hasBorder,"ds-control-inactive":i,[`ds-control--${this.size}`]:true,..._(this.width)},"data-disabled":i?"":undefined,"data-readonly":this.readOnly?"":undefined,"data-required":this.required?"":undefined,"data-invalid":this.isInvalid?"":undefined,"data-filled":d?"":undefined,"data-focused":this.focused?"":undefined,"data-dirty":o?"":undefined,"data-touched":this.touched?"":undefined},s("div",{key:"39d47f2b9583a6e1ac00bcaa22f18ff4411dc6e2",ref:t=>{this.controlEl=t},class:{"input-control":true,"ds-control-frame":true,"input-control--bordered":this.hasBorder,"input-control--error":this.hasBorder&&this.error,"ds-interaction-fill":this.hasInteractionFill,[`ds-control--${this.size}`]:true}},s("input",{key:"30aa906b097c429111d199e49c3fe722c1a14b07",ref:t=>{this.inputEl=t},type:"text",id:t,value:this.focused?this.draftText:this.displayValue,disabled:i,readOnly:this.readOnly,required:this.required,autoFocus:this.autoFocus,autoComplete:"off",spellcheck:false,class:{"native-input":true,"native-input--align-start":true,"ds-control-label-box":true,[c]:true,"ds-text--regular":true},"aria-label":this.ariaLabel,"aria-labelledby":this.ariaLabelledby,"aria-describedby":l,"aria-invalid":this.isInvalid?"true":undefined,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur}),s("ds-button-unfilled",{key:"eafeb29f46ca411a12aa8c519dcf873af30311ed",ref:t=>{this.calendarButton=t},class:"input-control__datetime-action",variant:"icon",size:this.size,icon:"Calendar",hasBorder:false,isInset:true,isInactive:e,ariaLabel:"Choose date",haspopup:"dialog",expanded:this.open,surfaceOpen:this.open||this.closing,controls:this.open?this.popupId:undefined,onDsClick:this.togglePicker})),this.shouldRender?s("div",{id:this.popupId,popover:"manual",class:{"input-date-popup":true,"ds-choice-popup":true,"ds-choice-popup--closing":this.closing,"ds-chrome-column":true,"ds-chrome-space--sm":true},style:p,role:"dialog","aria-label":"Choose date"},s("ds-calendar",{selectionMode:"single",value:this.value,min:this.min,max:this.max,isInactive:e,autoFocus:true,onDsChange:this.handleCalendarChange})):null,r&&s("ds-text",{key:"380784b2ddc6391931ac7d13b52e6f926e286b7e",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}],required:[{syncFormValue:0}],requiredMessage:[{syncFormValue:0}],min:[{syncFormValue:0}],max:[{syncFormValue:0}],disabled:[{onInteractionStateChange:0}],isInactive:[{onInteractionStateChange:0}],readOnly:[{onInteractionStateChange:0}]}}static get style(){return j()}},[66,"ds-input-date",{value:[1025],name:[513],form:[513],disabled:[516],readOnly:[516,"read-only"],required:[516],requiredMessage:[1,"required-message"],min:[1],max:[1],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],draftText:[32],popupPhase:[32],positionReady:[32],pos:[32],setFocus:[64]},[[0,"keydown","handleHostKeyDown"]],{value:[{syncFormValue:0}],required:[{syncFormValue:0}],requiredMessage:[{syncFormValue:0}],min:[{syncFormValue:0}],max:[{syncFormValue:0}],disabled:[{onInteractionStateChange:0}],isInactive:[{onInteractionStateChange:0}],readOnly:[{onInteractionStateChange:0}]}]);function P(){if(typeof customElements==="undefined"){return}const t=["ds-input-date","ds-badge","ds-button-unfilled","ds-calendar","ds-icon","ds-loader","ds-text","ds-tooltip"];t.forEach((t=>{switch(t){case"ds-input-date":if(!customElements.get(d(t))){customElements.define(d(t),O)}break;case"ds-badge":if(!customElements.get(d(t))){l()}break;case"ds-button-unfilled":if(!customElements.get(d(t))){p()}break;case"ds-calendar":if(!customElements.get(d(t))){v()}break;case"ds-icon":if(!customElements.get(d(t))){g()}break;case"ds-loader":if(!customElements.get(d(t))){m()}break;case"ds-text":if(!customElements.get(d(t))){b()}break;case"ds-tooltip":if(!customElements.get(d(t))){y()}break}}))}P();export{O as I,P as d};
|
|
2
|
+
//# sourceMappingURL=p-Dalq5voO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["inputDateCss","idCounter","INVALID_DATE_MESSAGE","DATE_BEFORE_MIN_MESSAGE","DATE_AFTER_MAX_MESSAGE","InputDate","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","generatedId","errorId","popupId","value","disabled","readOnly","required","requiredMessage","DEFAULT_REQUIRED_MESSAGE","size","width","hasBorder","hasInteractionFill","isInactive","autoFocus","error","ariaLabel","initialValue","formDisabled","focused","touched","draftText","popupPhase","positionReady","pos","x","y","position","AnchoredPositionController","getAnchor","controlEl","getPopup","el","querySelector","getOwnerDocument","ownerDocument","measure","anchor","popup","open","sectionInsetPx","resolveCssLengthPx","TOKEN_DEFAULTS","space050","anchorRect","getBoundingClientRect","popupWidth","offsetWidth","popupFallbackWidth","popupHeight","offsetHeight","popupFallbackHeight","side","align","sideOffsetPx","alignOffsetPx","resolveChoicePopupAlignOffset","anchorAlignment","viewportPadPx","viewportWidth","window","innerWidth","viewportHeight","innerHeight","collisionRect","resolveAnchoredOverlayBoundaryRect","apply","onReady","liveUpdate","observeResize","topLayer","interaction","AnchoredOverlayInteractionController","onOutsideActivation","closePicker","pickerPopup","PickerPopupController","onPhaseChange","phase","togglePicker","pickerInactive","openPicker","handleInput","event","target","parsed","parseDraft","commitIso","handleFocus","displayValue","handleBlur","handleCalendarChange","stopPropagation","detail","shouldRender","closing","menuWidthXs","menuFallbackHeight","formInactive","hasConstraintError","isIsoCalendarDate","min","max","isInvalid","length","componentWillLoad","syncFormValue","disconnectedCallback","disconnect","inactive","setFormControlValue","internals","flags","message","valueMissing","badInput","rangeUnderflow","rangeOverflow","setValidity","onInteractionStateChange","formDisabledCallback","formResetCallback","formStateRestoreCallback","state","restoreStringFormState","setFocus","inputEl","focus","handleHostKeyDown","key","preventDefault","composedPath","includes","tabLeavesPopup","moveFocusAfterTab","shiftKey","formatIsoCalendarDateLabel","text","trimmed","trim","iso","parseLooseCalendarDate","emit","dsChange","isConnected","restore","close","calendarButton","render","inputId","filled","dirty","showError","Boolean","errorMessage","textVariant","CONTROL_TEXT_VARIANT","textClass","replace","describedBy","ariaDescribedby","undefined","filter","join","popupStyle","left","top","transform","Math","round","zIndex","visibility","h","Host","class","controlWidthClass","ref","element","type","id","autoComplete","spellcheck","ariaLabelledby","onInput","onFocus","onBlur","variant","icon","isInset","haspopup","expanded","surfaceOpen","controls","onDsClick","popover","style","role","selectionMode","onDsChange","as","color","textId"],"sources":["src/wc/components/InputDate/InputDate.css?tag=ds-input-date&encapsulation=scoped","src/wc/components/InputDate/InputDate.tsx"],"sourcesContent":["@import '../../utils/datetime-input-control.css';\n@import '../../utils/choice-popup.css';\n@import '../../utils/chrome-layout.css';\n\n.input-date-popup.ds-choice-popup {\n --ds-calendar-padding: 0;\n padding: var(--dimension-space-050);\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Prop,\n State,\n Event,\n EventEmitter,\n Listen,\n Method,\n Watch,\n h,\n Host,\n} from '@stencil/core';\nimport {\n controlWidthClass,\n CONTROL_TEXT_VARIANT,\n DEFAULT_REQUIRED_MESSAGE,\n formatIsoCalendarDateLabel,\n isIsoCalendarDate,\n parseLooseCalendarDate,\n resolveChoicePopupAlignOffset,\n resolveCssLengthPx,\n restoreStringFormState,\n setFormControlValue,\n TOKEN_DEFAULTS,\n type ControlSize,\n type ControlWidth,\n} from '../../utils';\nimport { AnchoredPositionController } from '../../utils/anchored-position-controller';\nimport { AnchoredOverlayInteractionController } from '../../utils/anchored-overlay-interaction-controller';\nimport { resolveAnchoredOverlayBoundaryRect } from '../../utils/anchored-overlay-boundary';\nimport { PickerPopupController, type PickerPopupPhase } from '../../utils/picker-popup-controller';\n\nexport type InputDateSize = ControlSize;\nexport type InputDateWidth = ControlWidth;\n\nlet idCounter = 0;\n\nconst INVALID_DATE_MESSAGE = 'Enter a valid date.';\nconst DATE_BEFORE_MIN_MESSAGE = 'Date is before the minimum allowed date.';\nconst DATE_AFTER_MAX_MESSAGE = 'Date is after the maximum allowed date.';\n\n@Component({\n tag: 'ds-input-date',\n styleUrl: 'InputDate.css',\n scoped: true,\n formAssociated: true,\n})\nexport class InputDate {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n private generatedId = `ds-input-date-${++idCounter}`;\n private errorId = `${this.generatedId}-error`;\n private popupId = `${this.generatedId}-popup`;\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 @Prop({ reflect: true }) readOnly: boolean = false;\n @Prop({ reflect: true }) required: boolean = false;\n @Prop() requiredMessage: string = DEFAULT_REQUIRED_MESSAGE;\n @Prop() min: string | undefined;\n @Prop() max: string | undefined;\n @Prop() size: InputDateSize = 'md';\n @Prop() width: InputDateWidth = 'fill';\n @Prop() hasBorder: boolean = true;\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 @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 inputEl?: HTMLInputElement;\n private controlEl?: HTMLElement;\n private calendarButton?: HTMLDsButtonUnfilledElement;\n @State() private formDisabled = false;\n @State() private focused = false;\n @State() private touched = false;\n @State() private draftText = '';\n @State() private popupPhase: PickerPopupPhase = 'closed';\n @State() private positionReady = false;\n @State() private pos = { x: 0, y: 0 };\n\n private readonly position = new AnchoredPositionController({\n getAnchor: () => this.controlEl ?? null,\n getPopup: () => this.el.querySelector<HTMLElement>('.input-date-popup'),\n getOwnerDocument: () => this.el.ownerDocument,\n measure: (anchor, popup) => {\n if (!this.open) return null;\n const sectionInsetPx = resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n return {\n anchorRect: anchor.getBoundingClientRect(),\n popupWidth: popup.offsetWidth || this.popupFallbackWidth,\n popupHeight: popup.offsetHeight || this.popupFallbackHeight,\n side: 'bottom',\n align: 'end',\n sideOffsetPx: resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050),\n alignOffsetPx: resolveChoicePopupAlignOffset({\n align: 'end',\n alignOffsetPx: 0,\n sectionInsetPx,\n anchorAlignment: 'popup-frame',\n }),\n viewportPadPx: resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050),\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n collisionRect: resolveAnchoredOverlayBoundaryRect(anchor),\n };\n },\n apply: ({ x, y }) => {\n this.pos = { x, y };\n },\n onReady: () => {\n this.positionReady = true;\n },\n liveUpdate: 'double-frame',\n observeResize: true,\n topLayer: true,\n });\n private readonly interaction = new AnchoredOverlayInteractionController({\n getAnchor: () => this.controlEl ?? null,\n getPopup: () => this.el.querySelector<HTMLElement>('.input-date-popup'),\n getOwnerDocument: () => this.el.ownerDocument,\n onOutsideActivation: () => this.closePicker(false),\n });\n private readonly pickerPopup = new PickerPopupController({\n position: this.position,\n interaction: this.interaction,\n getPopup: () => this.el.querySelector<HTMLElement>('.input-date-popup'),\n onPhaseChange: phase => {\n this.popupPhase = phase;\n },\n });\n\n private get open(): boolean {\n return this.popupPhase === 'open';\n }\n\n private get shouldRender(): boolean {\n return this.popupPhase !== 'closed';\n }\n\n private get closing(): boolean {\n return this.popupPhase === 'closing';\n }\n\n private get popupFallbackWidth(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuWidthXs, TOKEN_DEFAULTS.menuWidthXs);\n }\n\n private get popupFallbackHeight(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuFallbackHeight, TOKEN_DEFAULTS.menuFallbackHeight);\n }\n\n private get formInactive(): boolean {\n return this.isInactive || this.disabled || this.formDisabled;\n }\n\n private get pickerInactive(): boolean {\n return this.formInactive || this.readOnly;\n }\n\n private get hasConstraintError(): boolean {\n if (!this.value) return false;\n if (!isIsoCalendarDate(this.value)) return true;\n if (this.min && isIsoCalendarDate(this.min) && this.value < this.min) return true;\n if (this.max && isIsoCalendarDate(this.max) && this.value > this.max) return true;\n return false;\n }\n\n private get isInvalid(): boolean {\n return (\n this.error ||\n (!this.formInactive &&\n ((this.required && this.value.length === 0) || this.hasConstraintError))\n );\n }\n\n componentWillLoad() {\n this.initialValue = this.value;\n this.syncFormValue();\n }\n\n disconnectedCallback() {\n this.pickerPopup.disconnect();\n this.positionReady = false;\n this.focused = false;\n }\n\n @Watch('value')\n @Watch('required')\n @Watch('requiredMessage')\n @Watch('min')\n @Watch('max')\n syncFormValue() {\n const inactive = this.formInactive;\n setFormControlValue(this.internals, this.value, { inactive });\n const flags: ValidityStateFlags = {};\n let message = '';\n if (!inactive) {\n if (this.required && this.value.length === 0) {\n flags.valueMissing = true;\n message = this.requiredMessage;\n } else if (this.value && !isIsoCalendarDate(this.value)) {\n flags.badInput = true;\n message = INVALID_DATE_MESSAGE;\n } else if (this.value && this.min && isIsoCalendarDate(this.min) && this.value < this.min) {\n flags.rangeUnderflow = true;\n message = DATE_BEFORE_MIN_MESSAGE;\n } else if (this.value && this.max && isIsoCalendarDate(this.max) && this.value > this.max) {\n flags.rangeOverflow = true;\n message = DATE_AFTER_MAX_MESSAGE;\n }\n }\n this.internals.setValidity(flags, message);\n }\n\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('readOnly')\n onInteractionStateChange() {\n this.syncFormValue();\n if (this.pickerInactive && this.shouldRender) this.closePicker(false);\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.onInteractionStateChange();\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n this.draftText = this.displayValue;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = restoreStringFormState(state);\n this.draftText = this.displayValue;\n }\n\n @Method()\n async setFocus() {\n this.inputEl?.focus();\n }\n\n @Listen('keydown')\n handleHostKeyDown(event: KeyboardEvent) {\n if (!this.shouldRender || this.closing) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n this.closePicker('button');\n return;\n }\n if (event.key !== 'Tab') return;\n const popup = this.el.querySelector<HTMLElement>('.input-date-popup');\n if (!popup || !event.composedPath().includes(popup)) return;\n if (!this.interaction.tabLeavesPopup(event)) return;\n event.preventDefault();\n this.closePicker(false);\n this.interaction.moveFocusAfterTab(event.shiftKey);\n }\n\n private get displayValue(): string {\n return formatIsoCalendarDateLabel(this.value);\n }\n\n private parseDraft(text: string): string | null {\n const trimmed = text.trim();\n if (!trimmed) return '';\n const iso = parseLooseCalendarDate(trimmed);\n if (!iso) return null;\n if (this.min && isIsoCalendarDate(this.min) && iso < this.min) return null;\n if (this.max && isIsoCalendarDate(this.max) && iso > this.max) return null;\n return iso;\n }\n\n private commitIso(iso: string, emit = true) {\n if (this.value !== iso) {\n this.value = iso;\n if (emit) this.dsChange.emit(iso);\n }\n this.draftText = formatIsoCalendarDateLabel(iso);\n }\n\n private openPicker() {\n if (this.pickerInactive || this.open || !this.el.isConnected) return;\n this.positionReady = false;\n this.pickerPopup.open();\n }\n\n private closePicker(restore: 'input' | 'button' | false) {\n this.pickerPopup.close(() => {\n if (restore === 'input') this.inputEl?.focus();\n if (restore === 'button') void this.calendarButton?.setFocus();\n });\n }\n\n private togglePicker = () => {\n if (this.pickerInactive) return;\n if (this.open) this.closePicker('button');\n else this.openPicker();\n };\n\n private handleInput = (event: Event) => {\n if (this.pickerInactive) return;\n this.draftText = (event.target as HTMLInputElement).value;\n const parsed = this.parseDraft(this.draftText);\n if (parsed === null) return;\n this.commitIso(parsed);\n };\n\n private handleFocus = () => {\n this.draftText = this.displayValue || this.value;\n this.focused = true;\n };\n\n private handleBlur = () => {\n this.focused = false;\n this.touched = true;\n if (this.pickerInactive) {\n this.draftText = this.displayValue;\n return;\n }\n const parsed = this.parseDraft(this.draftText);\n if (parsed === null) {\n this.draftText = this.displayValue;\n return;\n }\n this.commitIso(parsed);\n };\n\n private handleCalendarChange = (event: CustomEvent<string>) => {\n event.stopPropagation();\n if (this.pickerInactive) return;\n const parsed = this.parseDraft(event.detail);\n if (parsed === null) return;\n this.commitIso(parsed);\n this.closePicker('input');\n };\n\n render() {\n const inputId = this.inputId ?? this.generatedId;\n const inactive = this.formInactive;\n const pickerInactive = this.pickerInactive;\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 textClass = `ds-text--${textVariant.replace('text-', '')}`;\n const describedBy =\n [this.ariaDescribedby, showError ? this.errorId : undefined].filter(Boolean).join(' ') ||\n undefined;\n const popupStyle = {\n position: 'fixed',\n left: '0',\n top: '0',\n transform: `translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,\n zIndex: 'var(--dimension-z-index-floating)',\n visibility: this.positionReady ? 'visible' : 'hidden',\n };\n\n return (\n <Host\n class={{\n 'input-host': true,\n 'ds-field-stack': true,\n 'ds-field-stack--supporting-inset': !this.hasBorder,\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.isInvalid ? '' : 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 ref={element => {\n this.controlEl = element;\n }}\n class={{\n 'input-control': true,\n 'ds-control-frame': true,\n 'input-control--bordered': this.hasBorder,\n 'input-control--error': this.hasBorder && this.error,\n 'ds-interaction-fill': this.hasInteractionFill,\n [`ds-control--${this.size}`]: true,\n }}\n >\n <input\n ref={element => {\n this.inputEl = element;\n }}\n type=\"text\"\n id={inputId}\n value={this.focused ? this.draftText : this.displayValue}\n disabled={inactive}\n readOnly={this.readOnly}\n required={this.required}\n autoFocus={this.autoFocus}\n autoComplete=\"off\"\n spellcheck={false}\n class={{\n 'native-input': true,\n 'native-input--align-start': true,\n 'ds-control-label-box': true,\n [textClass]: true,\n 'ds-text--regular': true,\n }}\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledby}\n aria-describedby={describedBy}\n aria-invalid={this.isInvalid ? 'true' : undefined}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n <ds-button-unfilled\n ref={element => {\n this.calendarButton = element as HTMLDsButtonUnfilledElement | undefined;\n }}\n class=\"input-control__datetime-action\"\n variant=\"icon\"\n size={this.size}\n icon=\"Calendar\"\n hasBorder={false}\n isInset\n isInactive={pickerInactive}\n ariaLabel=\"Choose date\"\n haspopup=\"dialog\"\n expanded={this.open}\n surfaceOpen={this.open || this.closing}\n controls={this.open ? this.popupId : undefined}\n onDsClick={this.togglePicker}\n />\n </div>\n {this.shouldRender ? (\n <div\n id={this.popupId}\n popover=\"manual\"\n class={{\n 'input-date-popup': true,\n 'ds-choice-popup': true,\n 'ds-choice-popup--closing': this.closing,\n 'ds-chrome-column': true,\n 'ds-chrome-space--sm': true,\n }}\n style={popupStyle}\n role=\"dialog\"\n aria-label=\"Choose date\"\n >\n <ds-calendar\n selectionMode=\"single\"\n value={this.value}\n min={this.min}\n max={this.max}\n isInactive={pickerInactive}\n autoFocus\n onDsChange={this.handleCalendarChange}\n />\n </div>\n ) : null}\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":"kqBAAA,MAAMA,EAAe,IAAM,uj3BCqC3B,IAAIC,EAAY,EAEhB,MAAMC,EAAuB,sBAC7B,MAAMC,EAA0B,2CAChC,MAAMC,EAAyB,0C,MAQlBC,EAASC,EAAA,MAAAD,UAAAE,EANtB,WAAAC,CAAAC,G,qHAUUC,KAAAC,YAAc,mBAAmBV,IACjCS,KAAAE,QAAU,GAAGF,KAAKC,oBAClBD,KAAAG,QAAU,GAAGH,KAAKC,oBAEDD,KAAAI,MAAgB,GAGhBJ,KAAAK,SAAoB,MACpBL,KAAAM,SAAoB,MACpBN,KAAAO,SAAoB,MACrCP,KAAAQ,gBAA0BC,EAG1BT,KAAAU,KAAsB,KACtBV,KAAAW,MAAwB,OACxBX,KAAAY,UAAqB,KACrBZ,KAAAa,mBAA8B,KAC9Bb,KAAAc,WAAsB,MACtBd,KAAAe,UAAqB,MACrBf,KAAAgB,MAAiB,MAGUhB,KAAAiB,UAA2B,KAMtDjB,KAAAkB,aAAe,GAINlB,KAAAmB,aAAe,MACfnB,KAAAoB,QAAU,MACVpB,KAAAqB,QAAU,MACVrB,KAAAsB,UAAY,GACZtB,KAAAuB,WAA+B,SAC/BvB,KAAAwB,cAAgB,MAChBxB,KAAAyB,IAAM,CAAEC,EAAG,EAAGC,EAAG,GAEjB3B,KAAA4B,SAAW,IAAIC,EAA2B,CACzDC,UAAW,IAAM9B,KAAK+B,WAAa,KACnCC,SAAU,IAAMhC,KAAKiC,GAAGC,cAA2B,qBACnDC,iBAAkB,IAAMnC,KAAKiC,GAAGG,cAChCC,QAAS,CAACC,EAAQC,KAChB,IAAKvC,KAAKwC,KAAM,OAAO,KACvB,MAAMC,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KAAKgF,gBAGnBhF,KAAK+F,aACJ8E,EAAA,OACEO,GAAIpL,KAAKG,QACTgM,QAAQ,SACRpB,MAAO,CACL,mBAAoB,KACpB,kBAAmB,KACnB,2BAA4B/K,KAAKgG,QACjC,mBAAoB,KACpB,sBAAuB,MAEzBoG,MAAO/B,EACPgC,KAAK,SAAQ,aACF,eAEXxB,EAAA,eACEyB,cAAc,SACdlM,MAAOJ,KAAKI,MACZkG,IAAKtG,KAAKsG,IACVC,IAAKvG,KAAKuG,IACVzF,WAAYmE,EACZlE,UAAS,KACTwL,WAAYvM,KAAK4F,wBAGnB,KACH6D,GACCoB,EAAA,WAAA3C,IAAA,2CACE6C,MAAM,aACNyB,GAAG,MACHb,QAAQ,kBACRc,MAAM,WACNC,OAAQ1M,KAAKE,QACbmM,KAAK,SAEJrM,KAAK2J,c","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["inputDateCss","idCounter","INVALID_DATE_MESSAGE","DATE_BEFORE_MIN_MESSAGE","DATE_AFTER_MAX_MESSAGE","InputDate","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","generatedId","errorId","popupId","value","disabled","readOnly","required","requiredMessage","DEFAULT_REQUIRED_MESSAGE","size","width","hasBorder","hasInteractionFill","isInactive","autoFocus","error","ariaLabel","initialValue","formDisabled","focused","touched","draftText","popupPhase","positionReady","pos","x","y","position","AnchoredPositionController","getAnchor","controlEl","getPopup","el","querySelector","getOwnerDocument","ownerDocument","measure","anchor","popup","open","sectionInsetPx","resolveCssLengthPx","TOKEN_DEFAULTS","space050","anchorRect","getBoundingClientRect","popupWidth","offsetWidth","popupFallbackWidth","popupHeight","offsetHeight","popupFallbackHeight","side","align","sideOffsetPx","alignOffsetPx","resolveChoicePopupAlignOffset","anchorAlignment","viewportPadPx","viewportWidth","window","innerWidth","viewportHeight","innerHeight","collisionRect","resolveAnchoredOverlayBoundaryRect","apply","onReady","liveUpdate","observeResize","topLayer","interaction","AnchoredOverlayInteractionController","onOutsideActivation","closePicker","pickerPopup","PickerPopupController","onPhaseChange","phase","togglePicker","pickerInactive","openPicker","handleInput","event","target","parsed","parseDraft","commitIso","handleFocus","displayValue","handleBlur","handleCalendarChange","stopPropagation","detail","shouldRender","closing","menuWidthXs","menuFallbackHeight","formInactive","hasConstraintError","isIsoCalendarDate","min","max","isInvalid","length","componentWillLoad","syncFormValue","disconnectedCallback","disconnect","inactive","setFormControlValue","internals","flags","message","valueMissing","badInput","rangeUnderflow","rangeOverflow","setValidity","onInteractionStateChange","formDisabledCallback","formResetCallback","formStateRestoreCallback","state","restoreStringFormState","setFocus","inputEl","focus","handleHostKeyDown","key","preventDefault","composedPath","includes","tabLeavesPopup","moveFocusAfterTab","shiftKey","formatIsoCalendarDateLabel","text","trimmed","trim","iso","parseLooseCalendarDate","emit","dsChange","isConnected","restore","close","calendarButton","render","inputId","filled","dirty","showError","Boolean","errorMessage","textVariant","CONTROL_TEXT_VARIANT","textClass","replace","describedBy","ariaDescribedby","undefined","filter","join","popupStyle","left","top","transform","Math","round","zIndex","visibility","h","Host","class","controlWidthClass","ref","element","type","id","autoComplete","spellcheck","ariaLabelledby","onInput","onFocus","onBlur","variant","icon","isInset","haspopup","expanded","surfaceOpen","controls","onDsClick","popover","style","role","selectionMode","onDsChange","as","color","textId"],"sources":["src/wc/components/InputDate/InputDate.css?tag=ds-input-date&encapsulation=scoped","src/wc/components/InputDate/InputDate.tsx"],"sourcesContent":["@import '../../utils/datetime-input-control.css';\n@import '../../utils/choice-popup.css';\n@import '../../utils/chrome-layout.css';\n\n.input-date-popup.ds-choice-popup {\n --ds-calendar-padding: 0;\n padding: var(--dimension-space-050);\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Prop,\n State,\n Event,\n EventEmitter,\n Listen,\n Method,\n Watch,\n h,\n Host,\n} from '@stencil/core';\nimport {\n controlWidthClass,\n CONTROL_TEXT_VARIANT,\n DEFAULT_REQUIRED_MESSAGE,\n formatIsoCalendarDateLabel,\n isIsoCalendarDate,\n parseLooseCalendarDate,\n resolveChoicePopupAlignOffset,\n resolveCssLengthPx,\n restoreStringFormState,\n setFormControlValue,\n TOKEN_DEFAULTS,\n type ControlSize,\n type ControlWidth,\n} from '../../utils';\nimport { AnchoredPositionController } from '../../utils/anchored-position-controller';\nimport { AnchoredOverlayInteractionController } from '../../utils/anchored-overlay-interaction-controller';\nimport { resolveAnchoredOverlayBoundaryRect } from '../../utils/anchored-overlay-boundary';\nimport { PickerPopupController, type PickerPopupPhase } from '../../utils/picker-popup-controller';\n\nexport type InputDateSize = ControlSize;\nexport type InputDateWidth = ControlWidth;\n\nlet idCounter = 0;\n\nconst INVALID_DATE_MESSAGE = 'Enter a valid date.';\nconst DATE_BEFORE_MIN_MESSAGE = 'Date is before the minimum allowed date.';\nconst DATE_AFTER_MAX_MESSAGE = 'Date is after the maximum allowed date.';\n\n@Component({\n tag: 'ds-input-date',\n styleUrl: 'InputDate.css',\n scoped: true,\n formAssociated: true,\n})\nexport class InputDate {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n private generatedId = `ds-input-date-${++idCounter}`;\n private errorId = `${this.generatedId}-error`;\n private popupId = `${this.generatedId}-popup`;\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 @Prop({ reflect: true }) readOnly: boolean = false;\n @Prop({ reflect: true }) required: boolean = false;\n @Prop() requiredMessage: string = DEFAULT_REQUIRED_MESSAGE;\n @Prop() min: string | undefined;\n @Prop() max: string | undefined;\n @Prop() size: InputDateSize = 'md';\n @Prop() width: InputDateWidth = 'fill';\n @Prop() hasBorder: boolean = true;\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 @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 inputEl?: HTMLInputElement;\n private controlEl?: HTMLElement;\n private calendarButton?: HTMLDsButtonUnfilledElement;\n @State() private formDisabled = false;\n @State() private focused = false;\n @State() private touched = false;\n @State() private draftText = '';\n @State() private popupPhase: PickerPopupPhase = 'closed';\n @State() private positionReady = false;\n @State() private pos = { x: 0, y: 0 };\n\n private readonly position = new AnchoredPositionController({\n getAnchor: () => this.controlEl ?? null,\n getPopup: () => this.el.querySelector<HTMLElement>('.input-date-popup'),\n getOwnerDocument: () => this.el.ownerDocument,\n measure: (anchor, popup) => {\n if (!this.open) return null;\n const sectionInsetPx = resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n return {\n anchorRect: anchor.getBoundingClientRect(),\n popupWidth: popup.offsetWidth || this.popupFallbackWidth,\n popupHeight: popup.offsetHeight || this.popupFallbackHeight,\n side: 'bottom',\n align: 'end',\n sideOffsetPx: resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050),\n alignOffsetPx: resolveChoicePopupAlignOffset({\n align: 'end',\n alignOffsetPx: 0,\n sectionInsetPx,\n anchorAlignment: 'popup-frame',\n }),\n viewportPadPx: resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050),\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n collisionRect: resolveAnchoredOverlayBoundaryRect(anchor),\n };\n },\n apply: ({ x, y }) => {\n this.pos = { x, y };\n },\n onReady: () => {\n this.positionReady = true;\n },\n liveUpdate: 'double-frame',\n observeResize: true,\n topLayer: true,\n });\n private readonly interaction = new AnchoredOverlayInteractionController({\n getAnchor: () => this.controlEl ?? null,\n getPopup: () => this.el.querySelector<HTMLElement>('.input-date-popup'),\n getOwnerDocument: () => this.el.ownerDocument,\n onOutsideActivation: () => this.closePicker(false),\n });\n private readonly pickerPopup = new PickerPopupController({\n position: this.position,\n interaction: this.interaction,\n getPopup: () => this.el.querySelector<HTMLElement>('.input-date-popup'),\n onPhaseChange: phase => {\n this.popupPhase = phase;\n },\n });\n\n private get open(): boolean {\n return this.popupPhase === 'open';\n }\n\n private get shouldRender(): boolean {\n return this.popupPhase !== 'closed';\n }\n\n private get closing(): boolean {\n return this.popupPhase === 'closing';\n }\n\n private get popupFallbackWidth(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuWidthXs, TOKEN_DEFAULTS.menuWidthXs);\n }\n\n private get popupFallbackHeight(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuFallbackHeight, TOKEN_DEFAULTS.menuFallbackHeight);\n }\n\n private get formInactive(): boolean {\n return this.isInactive || this.disabled || this.formDisabled;\n }\n\n private get pickerInactive(): boolean {\n return this.formInactive || this.readOnly;\n }\n\n private get hasConstraintError(): boolean {\n if (!this.value) return false;\n if (!isIsoCalendarDate(this.value)) return true;\n if (this.min && isIsoCalendarDate(this.min) && this.value < this.min) return true;\n if (this.max && isIsoCalendarDate(this.max) && this.value > this.max) return true;\n return false;\n }\n\n private get isInvalid(): boolean {\n return (\n this.error ||\n (!this.formInactive &&\n ((this.required && this.value.length === 0) || this.hasConstraintError))\n );\n }\n\n componentWillLoad() {\n this.initialValue = this.value;\n this.syncFormValue();\n }\n\n disconnectedCallback() {\n this.pickerPopup.disconnect();\n this.positionReady = false;\n this.focused = false;\n }\n\n @Watch('value')\n @Watch('required')\n @Watch('requiredMessage')\n @Watch('min')\n @Watch('max')\n syncFormValue() {\n const inactive = this.formInactive;\n setFormControlValue(this.internals, this.value, { inactive });\n const flags: ValidityStateFlags = {};\n let message = '';\n if (!inactive) {\n if (this.required && this.value.length === 0) {\n flags.valueMissing = true;\n message = this.requiredMessage;\n } else if (this.value && !isIsoCalendarDate(this.value)) {\n flags.badInput = true;\n message = INVALID_DATE_MESSAGE;\n } else if (this.value && this.min && isIsoCalendarDate(this.min) && this.value < this.min) {\n flags.rangeUnderflow = true;\n message = DATE_BEFORE_MIN_MESSAGE;\n } else if (this.value && this.max && isIsoCalendarDate(this.max) && this.value > this.max) {\n flags.rangeOverflow = true;\n message = DATE_AFTER_MAX_MESSAGE;\n }\n }\n this.internals.setValidity(flags, message);\n }\n\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('readOnly')\n onInteractionStateChange() {\n this.syncFormValue();\n if (this.pickerInactive && this.shouldRender) this.closePicker(false);\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.onInteractionStateChange();\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n this.draftText = this.displayValue;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = restoreStringFormState(state);\n this.draftText = this.displayValue;\n }\n\n @Method()\n async setFocus() {\n this.inputEl?.focus();\n }\n\n @Listen('keydown')\n handleHostKeyDown(event: KeyboardEvent) {\n if (!this.shouldRender || this.closing) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n this.closePicker('button');\n return;\n }\n if (event.key !== 'Tab') return;\n const popup = this.el.querySelector<HTMLElement>('.input-date-popup');\n if (!popup || !event.composedPath().includes(popup)) return;\n if (!this.interaction.tabLeavesPopup(event)) return;\n event.preventDefault();\n this.closePicker(false);\n this.interaction.moveFocusAfterTab(event.shiftKey);\n }\n\n private get displayValue(): string {\n return formatIsoCalendarDateLabel(this.value);\n }\n\n private parseDraft(text: string): string | null {\n const trimmed = text.trim();\n if (!trimmed) return '';\n const iso = parseLooseCalendarDate(trimmed);\n if (!iso) return null;\n if (this.min && isIsoCalendarDate(this.min) && iso < this.min) return null;\n if (this.max && isIsoCalendarDate(this.max) && iso > this.max) return null;\n return iso;\n }\n\n private commitIso(iso: string, emit = true) {\n if (this.value !== iso) {\n this.value = iso;\n if (emit) this.dsChange.emit(iso);\n }\n this.draftText = formatIsoCalendarDateLabel(iso);\n }\n\n private openPicker() {\n if (this.pickerInactive || this.open || !this.el.isConnected) return;\n this.positionReady = false;\n this.pickerPopup.open();\n }\n\n private closePicker(restore: 'input' | 'button' | false) {\n this.pickerPopup.close(() => {\n if (restore === 'input') this.inputEl?.focus();\n if (restore === 'button') void this.calendarButton?.setFocus();\n });\n }\n\n private togglePicker = () => {\n if (this.pickerInactive) return;\n if (this.open) this.closePicker('button');\n else this.openPicker();\n };\n\n private handleInput = (event: Event) => {\n if (this.pickerInactive) return;\n this.draftText = (event.target as HTMLInputElement).value;\n const parsed = this.parseDraft(this.draftText);\n if (parsed === null) return;\n this.commitIso(parsed);\n };\n\n private handleFocus = () => {\n this.draftText = this.displayValue || this.value;\n this.focused = true;\n };\n\n private handleBlur = () => {\n this.focused = false;\n this.touched = true;\n if (this.pickerInactive) {\n this.draftText = this.displayValue;\n return;\n }\n const parsed = this.parseDraft(this.draftText);\n if (parsed === null) {\n this.draftText = this.displayValue;\n return;\n }\n this.commitIso(parsed);\n };\n\n private handleCalendarChange = (event: CustomEvent<string>) => {\n event.stopPropagation();\n if (this.pickerInactive) return;\n const parsed = this.parseDraft(event.detail);\n if (parsed === null) return;\n this.commitIso(parsed);\n this.closePicker('input');\n };\n\n render() {\n const inputId = this.inputId ?? this.generatedId;\n const inactive = this.formInactive;\n const pickerInactive = this.pickerInactive;\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 textClass = `ds-text--${textVariant.replace('text-', '')}`;\n const describedBy =\n [this.ariaDescribedby, showError ? this.errorId : undefined].filter(Boolean).join(' ') ||\n undefined;\n const popupStyle = {\n position: 'fixed',\n left: '0',\n top: '0',\n transform: `translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,\n zIndex: 'var(--dimension-z-index-floating)',\n visibility: this.positionReady ? 'visible' : 'hidden',\n };\n\n return (\n <Host\n class={{\n 'input-host': true,\n 'ds-field-stack': true,\n 'ds-field-stack--supporting-inset': !this.hasBorder,\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.isInvalid ? '' : 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 ref={element => {\n this.controlEl = element;\n }}\n class={{\n 'input-control': true,\n 'ds-control-frame': true,\n 'input-control--bordered': this.hasBorder,\n 'input-control--error': this.hasBorder && this.error,\n 'ds-interaction-fill': this.hasInteractionFill,\n [`ds-control--${this.size}`]: true,\n }}\n >\n <input\n ref={element => {\n this.inputEl = element;\n }}\n type=\"text\"\n id={inputId}\n value={this.focused ? this.draftText : this.displayValue}\n disabled={inactive}\n readOnly={this.readOnly}\n required={this.required}\n autoFocus={this.autoFocus}\n autoComplete=\"off\"\n spellcheck={false}\n class={{\n 'native-input': true,\n 'native-input--align-start': true,\n 'ds-control-label-box': true,\n [textClass]: true,\n 'ds-text--regular': true,\n }}\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledby}\n aria-describedby={describedBy}\n aria-invalid={this.isInvalid ? 'true' : undefined}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n <ds-button-unfilled\n ref={element => {\n this.calendarButton = element as HTMLDsButtonUnfilledElement | undefined;\n }}\n class=\"input-control__datetime-action\"\n variant=\"icon\"\n size={this.size}\n icon=\"Calendar\"\n hasBorder={false}\n isInset\n isInactive={pickerInactive}\n ariaLabel=\"Choose date\"\n haspopup=\"dialog\"\n expanded={this.open}\n surfaceOpen={this.open || this.closing}\n controls={this.open ? this.popupId : undefined}\n onDsClick={this.togglePicker}\n />\n </div>\n {this.shouldRender ? (\n <div\n id={this.popupId}\n popover=\"manual\"\n class={{\n 'input-date-popup': true,\n 'ds-choice-popup': true,\n 'ds-choice-popup--closing': this.closing,\n 'ds-chrome-column': true,\n 'ds-chrome-space--sm': true,\n }}\n style={popupStyle}\n role=\"dialog\"\n aria-label=\"Choose date\"\n >\n <ds-calendar\n selectionMode=\"single\"\n value={this.value}\n min={this.min}\n max={this.max}\n isInactive={pickerInactive}\n autoFocus\n onDsChange={this.handleCalendarChange}\n />\n </div>\n ) : null}\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":"osBAAA,MAAMA,EAAe,IAAM,uj3BCqC3B,IAAIC,EAAY,EAEhB,MAAMC,EAAuB,sBAC7B,MAAMC,EAA0B,2CAChC,MAAMC,EAAyB,0C,MAQlBC,EAASC,EAAA,MAAAD,UAAAE,EANtB,WAAAC,CAAAC,G,qHAUUC,KAAAC,YAAc,mBAAmBV,IACjCS,KAAAE,QAAU,GAAGF,KAAKC,oBAClBD,KAAAG,QAAU,GAAGH,KAAKC,oBAEDD,KAAAI,MAAgB,GAGhBJ,KAAAK,SAAoB,MACpBL,KAAAM,SAAoB,MACpBN,KAAAO,SAAoB,MACrCP,KAAAQ,gBAA0BC,EAG1BT,KAAAU,KAAsB,KACtBV,KAAAW,MAAwB,OACxBX,KAAAY,UAAqB,KACrBZ,KAAAa,mBAA8B,KAC9Bb,KAAAc,WAAsB,MACtBd,KAAAe,UAAqB,MACrBf,KAAAgB,MAAiB,MAGUhB,KAAAiB,UAA2B,KAMtDjB,KAAAkB,aAAe,GAINlB,KAAAmB,aAAe,MACfnB,KAAAoB,QAAU,MACVpB,KAAAqB,QAAU,MACVrB,KAAAsB,UAAY,GACZtB,KAAAuB,WAA+B,SAC/BvB,KAAAwB,cAAgB,MAChBxB,KAAAyB,IAAM,CAAEC,EAAG,EAAGC,EAAG,GAEjB3B,KAAA4B,SAAW,IAAIC,EAA2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ACLhL,UAAW,MACXiL,QAAO,KACP/K,WAAYmE,EACZhE,UAAU,cACV6K,SAAS,SACTC,SAAU/L,KAAKwC,KACfwJ,YAAahM,KAAKwC,MAAQxC,KAAKgG,QAC/BiG,SAAUjM,KAAKwC,KAAOxC,KAAKG,QAAU+J,UACrCgC,UAAWlM,KAAKgF,gBAGnBhF,KAAK+F,aACJ8E,EAAA,OACEO,GAAIpL,KAAKG,QACTgM,QAAQ,SACRpB,MAAO,CACL,mBAAoB,KACpB,kBAAmB,KACnB,2BAA4B/K,KAAKgG,QACjC,mBAAoB,KACpB,sBAAuB,MAEzBoG,MAAO/B,EACPgC,KAAK,SAAQ,aACF,eAEXxB,EAAA,eACEyB,cAAc,SACdlM,MAAOJ,KAAKI,MACZkG,IAAKtG,KAAKsG,IACVC,IAAKvG,KAAKuG,IACVzF,WAAYmE,EACZlE,UAAS,KACTwL,WAAYvM,KAAK4F,wBAGnB,KACH6D,GACCoB,EAAA,WAAA3C,IAAA,2CACE6C,MAAM,aACNyB,GAAG,MACHb,QAAQ,kBACRc,MAAM,WACNC,OAAQ1M,KAAKE,QACbmM,KAAK,SAEJrM,KAAK2J,c","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,h as s,a as r,t as i}from"./index.js";function d(t){return`ds-text--${t.replace(/^text-/,"")}`}function a(t){return t==="span"||t==="label"?"ds-text--inline-box":"ds-text--block-box"}const o=()=>`.ds-text--display-medium.sc-ds-text-h,.ds-text--display-medium.sc-ds-text{font-size:var(--typography-fontsize-3xl);line-height:var(--typography-lineheight-3xl)}.ds-text--display-small.sc-ds-text-h,.ds-text--display-small.sc-ds-text{font-size:var(--typography-fontsize-2xl);line-height:var(--typography-lineheight-2xl)}.ds-text--title-large.sc-ds-text-h,.ds-text--title-large.sc-ds-text{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl)}.ds-text--title-medium.sc-ds-text-h,.ds-text--title-medium.sc-ds-text{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--title-small.sc-ds-text-h,.ds-text--title-small.sc-ds-text{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-large.sc-ds-text-h,.ds-text--body-large.sc-ds-text{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--body-medium.sc-ds-text-h,.ds-text--body-medium.sc-ds-text{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-small.sc-ds-text-h,.ds-text--body-small.sc-ds-text{font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm)}.ds-text--caption.sc-ds-text-h,.ds-text--caption.sc-ds-text{font-size:var(--typography-fontsize-xs);line-height:var(--typography-lineheight-xs);text-transform:uppercase}.ds-text--display-medium.ds-text--emphasis.sc-ds-text-h,.ds-text--display-small.ds-text--emphasis.sc-ds-text-h,.ds-text--display-medium.ds-text--emphasis.sc-ds-text,.ds-text--display-small.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-bold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--display-medium.ds-text--regular.sc-ds-text-h,.ds-text--display-small.ds-text--regular.sc-ds-text-h,.ds-text--display-medium.ds-text--regular.sc-ds-text,.ds-text--display-small.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-large.ds-text--emphasis.sc-ds-text-h,.ds-text--title-large.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--title-large.ds-text--regular.sc-ds-text-h,.ds-text--title-large.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--emphasis.sc-ds-text-h,.ds-text--title-small.ds-text--emphasis.sc-ds-text-h,.ds-text--title-medium.ds-text--emphasis.sc-ds-text,.ds-text--title-small.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--regular.sc-ds-text-h,.ds-text--title-small.ds-text--regular.sc-ds-text-h,.ds-text--title-medium.ds-text--regular.sc-ds-text,.ds-text--title-small.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-large.ds-text--emphasis.sc-ds-text-h,.ds-text--body-medium.ds-text--emphasis.sc-ds-text-h,.ds-text--body-large.ds-text--emphasis.sc-ds-text,.ds-text--body-medium.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--body-large.ds-text--regular.sc-ds-text-h,.ds-text--body-medium.ds-text--regular.sc-ds-text-h,.ds-text--body-large.ds-text--regular.sc-ds-text,.ds-text--body-medium.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--emphasis.sc-ds-text-h,.ds-text--body-small.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--regular.sc-ds-text-h,.ds-text--body-small.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-none)}.ds-text--caption.ds-text--emphasis.sc-ds-text-h,.ds-text--caption.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-positive)}.ds-text--caption.ds-text--regular.sc-ds-text-h,.ds-text--caption.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-positive)}@media (forced-colors: active){.sc-ds-text:root,.sc-ds-text-h,.ds-forced-colors-scope.sc-ds-text{--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}}@keyframes ds-shimmer-text-motion{0%{background-position:100% 0}76.923%{background-position:0 0}100%{background-position:0 0}}@keyframes ds-shimmer-surface-motion{0%{background-position:100% 0}76.923%{background-position:0 0}100%{background-position:0 0}}.ds-shimmer-text.sc-ds-text{--ds-shimmer-base:currentColor;--ds-shimmer-duration:var(--effect-animation-duration-long-2);--ds-shimmer-repeat-delay:var(--effect-animation-delay-short-3);--ds-shimmer-cycle-duration:calc(var(--ds-shimmer-duration) + var(--ds-shimmer-repeat-delay));--ds-shimmer-easing:var(--effect-animation-easing-linear);--ds-shimmer-spread:var(--dimension-size-500);--ds-shimmer-travel:calc( var(--dimension-size-800) + var(--dimension-size-500) + var(--dimension-size-200) );background-color:var(--ds-shimmer-base);background-image:linear-gradient( 330deg, transparent calc(50% - var(--ds-shimmer-spread)), var(--ds-shimmer, var(--color-shimmer-shimmer)) 50%, transparent calc(50% + var(--ds-shimmer-spread)) );background-repeat:no-repeat;background-position:100% 0;background-size:calc(200% + var(--ds-shimmer-spread) * 2 + var(--ds-shimmer-travel) * 2) 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:ds-shimmer-text-motion var(--ds-shimmer-cycle-duration) var(--ds-shimmer-easing) infinite}.ds-shimmer-surface.sc-ds-text{--ds-shimmer-surface-base:var(--color-foreground-quaternary);--ds-shimmer-duration:var(--effect-animation-duration-long-2);--ds-shimmer-repeat-delay:var(--effect-animation-delay-short-3);--ds-shimmer-cycle-duration:calc(var(--ds-shimmer-duration) + var(--ds-shimmer-repeat-delay));--ds-shimmer-easing:var(--effect-animation-easing-linear);--ds-shimmer-spread:var(--dimension-size-500);--ds-shimmer-travel:calc( var(--dimension-size-800) + var(--dimension-size-500) + var(--dimension-size-200) );position:relative;overflow:hidden;background-color:var(--ds-shimmer-surface-base)}.ds-shimmer-surface.sc-ds-text::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient( 330deg, transparent calc(50% - var(--ds-shimmer-spread)), var(--ds-shimmer, var(--color-shimmer-shimmer)) 50%, transparent calc(50% + var(--ds-shimmer-spread)) );background-repeat:no-repeat;background-position:100% 0;background-size:calc(200% + var(--ds-shimmer-spread) * 2 + var(--ds-shimmer-travel) * 2) 100%;animation:ds-shimmer-surface-motion var(--ds-shimmer-cycle-duration) var(--ds-shimmer-easing) infinite}@media (prefers-reduced-motion: reduce){.ds-shimmer-text.sc-ds-text{animation:none;background-image:none;-webkit-text-fill-color:currentColor}.ds-shimmer-surface.sc-ds-text::after{display:none;animation:none}}@media (forced-colors: active){.ds-shimmer-text.sc-ds-text{animation:none;background-image:none;-webkit-text-fill-color:currentColor}.ds-shimmer-surface.sc-ds-text{background-color:var(--ds-forced-color-disabled)}.ds-shimmer-surface.sc-ds-text::after{display:none;animation:none}}.sc-ds-text-h{box-sizing:border-box;max-width:100%;min-width:0;margin:0;padding:0;border:0;font-family:var(--typography-font-family-ui)}.sc-ds-text-h:where(.ds-text--inline-box){display:inline-block}.sc-ds-text-h:where(.ds-text--block-box){display:block;width:100%}.ds-text__element.sc-ds-text{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;border:0;font:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;text-transform:inherit;text-align:inherit;text-decoration:inherit;text-underline-offset:inherit;font-style:inherit;font-variant-numeric:inherit;font-feature-settings:inherit;-webkit-user-select:inherit;user-select:inherit;white-space:inherit;text-wrap:inherit;overflow-wrap:inherit;word-break:inherit;overflow:inherit;text-overflow:inherit}.ds-text--truncate-1.sc-ds-text-h{overflow:hidden}.ds-text--truncate-1.sc-ds-text-h .ds-text__element.sc-ds-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ds-text--truncate-2.sc-ds-text-h,.ds-text--truncate-3.sc-ds-text-h,.ds-text--truncate-4.sc-ds-text-h,.ds-text--truncate-5.sc-ds-text-h{overflow:hidden}.ds-text--truncate-2.sc-ds-text-h .ds-text__element.sc-ds-text,.ds-text--truncate-3.sc-ds-text-h .ds-text__element.sc-ds-text,.ds-text--truncate-4.sc-ds-text-h .ds-text__element.sc-ds-text,.ds-text--truncate-5.sc-ds-text-h .ds-text__element.sc-ds-text{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;word-break:break-word}.ds-text--truncate-2.sc-ds-text-h .ds-text__element.sc-ds-text{-webkit-line-clamp:2}.ds-text--truncate-3.sc-ds-text-h .ds-text__element.sc-ds-text{-webkit-line-clamp:3}.ds-text--truncate-4.sc-ds-text-h .ds-text__element.sc-ds-text{-webkit-line-clamp:4}.ds-text--truncate-5.sc-ds-text-h .ds-text__element.sc-ds-text{-webkit-line-clamp:5}.ds-text--nowrap.sc-ds-text-h,.ds-text--nowrap.sc-ds-text-h .ds-text__element.sc-ds-text{white-space:nowrap;word-break:normal;overflow:hidden;text-overflow:ellipsis;min-width:0}.ds-text--balance.sc-ds-text-h,.ds-text--balance.sc-ds-text-h .ds-text__element.sc-ds-text{text-wrap:balance}.ds-text--pretty.sc-ds-text-h,.ds-text--pretty.sc-ds-text-h .ds-text__element.sc-ds-text{text-wrap:pretty}.ds-text--color-primary.sc-ds-text-h{color:var(--color-foreground-primary)}.ds-text--color-secondary.sc-ds-text-h{color:var(--color-foreground-secondary)}.ds-text--color-tertiary.sc-ds-text-h{color:var(--color-foreground-tertiary)}.ds-text--color-quaternary.sc-ds-text-h{color:var(--color-foreground-quaternary)}.ds-text--color-brand.sc-ds-text-h{color:var(--color-foreground-bold-brand)}.ds-text--color-negative.sc-ds-text-h{color:var(--color-foreground-bold-negative)}.ds-text--color-positive.sc-ds-text-h{color:var(--color-foreground-bold-positive)}.ds-text--color-warning.sc-ds-text-h{color:var(--color-foreground-bold-warning)}.ds-text--color-caution.sc-ds-text-h{color:var(--color-foreground-bold-caution)}.ds-text--color-ai.sc-ds-text-h{color:var(--color-foreground-bold-ai)}.ds-text--color-on-strong.sc-ds-text-h{color:var(--color-foreground-on-strong-background-primary)}.ds-text--color-on-bold.sc-ds-text-h{color:var(--color-foreground-on-bold-background-primary)}.ds-text--decoration-underline.sc-ds-text-h,.ds-text--decoration-dotted-underline.sc-ds-text-h{text-decoration-color:var(--ds-text-decoration-color, var(--color-foreground-tertiary));text-decoration-thickness:var(--ds-text-decoration-thickness, var(--dimension-stroke-width-012));text-underline-offset:var(--ds-text-decoration-offset, var(--dimension-space-025))}.ds-text--decoration-underline.sc-ds-text-h{text-decoration-line:underline}.ds-text--decoration-dotted-underline.sc-ds-text-h{text-decoration-line:underline;text-decoration-style:dotted}.ds-text--italic.sc-ds-text-h{font-style:italic}.ds-text--font-feature-tabular-nums.sc-ds-text-h{font-variant-numeric:tabular-nums;font-feature-settings:'tnum'}.ds-text--align-left.sc-ds-text-h{text-align:left}.ds-text--align-center.sc-ds-text-h{text-align:center}.ds-text--align-right.sc-ds-text-h{text-align:right}`;const n=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.variant="text-body-medium";this.emphasis=false;this.color="inherit";this.italic=false;this.shimmer=false;this.lineTruncation="none";this.fontFeature="normal";this.as="p"}render(){const t=this.as;const e=t=>typeof t==="string"&&t.startsWith("var(--");const i=Number(this.lineTruncation);const o={"ds-text":true,[a(this.as)]:true,[d(this.variant)]:true,"ds-text--emphasis":this.emphasis,"ds-text--regular":!this.emphasis,"ds-text--nowrap":this.wrap==="nowrap","ds-text--balance":this.wrap==="balance","ds-text--pretty":this.wrap==="pretty","ds-text--truncate-1":i===1&&this.wrap!=="nowrap","ds-text--truncate-2":i===2&&this.wrap!=="nowrap","ds-text--truncate-3":i===3&&this.wrap!=="nowrap","ds-text--truncate-4":i===4&&this.wrap!=="nowrap","ds-text--truncate-5":i===5&&this.wrap!=="nowrap","ds-text--color-primary":this.color==="primary","ds-text--color-secondary":this.color==="secondary","ds-text--color-tertiary":this.color==="tertiary","ds-text--color-quaternary":this.color==="quaternary","ds-text--color-brand":this.color==="brand","ds-text--color-negative":this.color==="negative","ds-text--color-positive":this.color==="positive","ds-text--color-warning":this.color==="warning","ds-text--color-caution":this.color==="caution","ds-text--color-ai":this.color==="ai","ds-text--color-on-strong":this.color==="on-strong","ds-text--color-on-bold":this.color==="on-bold","ds-text--color-inherit":this.color==="inherit","ds-text--decoration-underline":this.decoration==="underline","ds-text--decoration-dotted-underline":this.decoration==="dotted-underline","ds-text--italic":this.italic,"ds-text--align-left":this.align==="left","ds-text--align-center":this.align==="center","ds-text--align-right":this.align==="right","ds-text--font-feature-tabular-nums":this.fontFeature==="tabular-nums"};const n=this.color&&e(this.color)?{color:this.color}:undefined;const c={};if(this.as==="label"&&this.for)c["for"]=this.for;if(this.textId)c["id"]=this.textId;return s(r,{key:"2e20cde150c268a5336050d293c24ac8e043567c",class:o,style:n},s(t,{key:"6ca0882c002f2b48d16be775a1e177ec2aec0b72",class:{"ds-text__element":true,"ds-shimmer-text":this.shimmer},...c},s("slot",{key:"1f3d5fd852437e36f71cf2d8fbf3bdd2d4c4809a"})))}static get style(){return o()}},[262,"ds-text",{variant:[1],emphasis:[4],color:[1],decoration:[1],italic:[4],shimmer:[4],align:[1],lineTruncation:[8,"line-truncation"],wrap:[1],fontFeature:[1,"font-feature"],as:[1],for:[1],textId:[1,"text-id"]}]);function c(){if(typeof customElements==="undefined"){return}const t=["ds-text"];t.forEach((t=>{switch(t){case"ds-text":if(!customElements.get(i(t))){customElements.define(i(t),n)}break}}))}c();export{n as T,c as d};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as t,H as e,h as s,a as r,t as i}from"./index.js";function d(t){return`ds-text--${t.replace(/^text-/,"")}`}function a(t){return t==="span"||t==="label"?"ds-text--inline-box":"ds-text--block-box"}const o=()=>`.ds-text--display-medium.sc-ds-text-h,.ds-text--display-medium.sc-ds-text{font-size:var(--typography-fontsize-3xl);line-height:var(--typography-lineheight-3xl)}.ds-text--display-small.sc-ds-text-h,.ds-text--display-small.sc-ds-text{font-size:var(--typography-fontsize-2xl);line-height:var(--typography-lineheight-2xl)}.ds-text--title-large.sc-ds-text-h,.ds-text--title-large.sc-ds-text{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl)}.ds-text--title-medium.sc-ds-text-h,.ds-text--title-medium.sc-ds-text{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--title-small.sc-ds-text-h,.ds-text--title-small.sc-ds-text{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-large.sc-ds-text-h,.ds-text--body-large.sc-ds-text{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--body-medium.sc-ds-text-h,.ds-text--body-medium.sc-ds-text{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-small.sc-ds-text-h,.ds-text--body-small.sc-ds-text{font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm)}.ds-text--caption.sc-ds-text-h,.ds-text--caption.sc-ds-text{font-size:var(--typography-fontsize-xs);line-height:var(--typography-lineheight-xs);text-transform:uppercase}.ds-text--display-medium.ds-text--emphasis.sc-ds-text-h,.ds-text--display-small.ds-text--emphasis.sc-ds-text-h,.ds-text--display-medium.ds-text--emphasis.sc-ds-text,.ds-text--display-small.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-bold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--display-medium.ds-text--regular.sc-ds-text-h,.ds-text--display-small.ds-text--regular.sc-ds-text-h,.ds-text--display-medium.ds-text--regular.sc-ds-text,.ds-text--display-small.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-large.ds-text--emphasis.sc-ds-text-h,.ds-text--title-large.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--title-large.ds-text--regular.sc-ds-text-h,.ds-text--title-large.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--emphasis.sc-ds-text-h,.ds-text--title-small.ds-text--emphasis.sc-ds-text-h,.ds-text--title-medium.ds-text--emphasis.sc-ds-text,.ds-text--title-small.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--regular.sc-ds-text-h,.ds-text--title-small.ds-text--regular.sc-ds-text-h,.ds-text--title-medium.ds-text--regular.sc-ds-text,.ds-text--title-small.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-large.ds-text--emphasis.sc-ds-text-h,.ds-text--body-medium.ds-text--emphasis.sc-ds-text-h,.ds-text--body-large.ds-text--emphasis.sc-ds-text,.ds-text--body-medium.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--body-large.ds-text--regular.sc-ds-text-h,.ds-text--body-medium.ds-text--regular.sc-ds-text-h,.ds-text--body-large.ds-text--regular.sc-ds-text,.ds-text--body-medium.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--emphasis.sc-ds-text-h,.ds-text--body-small.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--regular.sc-ds-text-h,.ds-text--body-small.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-none)}.ds-text--caption.ds-text--emphasis.sc-ds-text-h,.ds-text--caption.ds-text--emphasis.sc-ds-text{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-positive)}.ds-text--caption.ds-text--regular.sc-ds-text-h,.ds-text--caption.ds-text--regular.sc-ds-text{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-positive)}@media (forced-colors: active){.sc-ds-text:root,.sc-ds-text-h,.ds-forced-colors-scope.sc-ds-text{--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}}@keyframes ds-shimmer-text-motion{0%{background-position:100% 0}76.923%{background-position:0 0}100%{background-position:0 0}}@keyframes ds-shimmer-surface-motion{0%{background-position:100% 0}76.923%{background-position:0 0}100%{background-position:0 0}}.ds-shimmer-text.sc-ds-text{--ds-shimmer-base:currentColor;--ds-shimmer-duration:var(--effect-animation-duration-long-2);--ds-shimmer-repeat-delay:var(--effect-animation-delay-short-3);--ds-shimmer-cycle-duration:calc(var(--ds-shimmer-duration) + var(--ds-shimmer-repeat-delay));--ds-shimmer-easing:var(--effect-animation-easing-linear);--ds-shimmer-spread:var(--dimension-size-500);--ds-shimmer-travel:calc( var(--dimension-size-800) + var(--dimension-size-500) + var(--dimension-size-200) );background-color:var(--ds-shimmer-base);background-image:linear-gradient( 330deg, transparent calc(50% - var(--ds-shimmer-spread)), var(--ds-shimmer, var(--color-shimmer-shimmer)) 50%, transparent calc(50% + var(--ds-shimmer-spread)) );background-repeat:no-repeat;background-position:100% 0;background-size:calc(200% + var(--ds-shimmer-spread) * 2 + var(--ds-shimmer-travel) * 2) 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:ds-shimmer-text-motion var(--ds-shimmer-cycle-duration) var(--ds-shimmer-easing) infinite}.ds-shimmer-surface.sc-ds-text{--ds-shimmer-surface-base:var(--color-foreground-quaternary);--ds-shimmer-duration:var(--effect-animation-duration-long-2);--ds-shimmer-repeat-delay:var(--effect-animation-delay-short-3);--ds-shimmer-cycle-duration:calc(var(--ds-shimmer-duration) + var(--ds-shimmer-repeat-delay));--ds-shimmer-easing:var(--effect-animation-easing-linear);--ds-shimmer-spread:var(--dimension-size-500);--ds-shimmer-travel:calc( var(--dimension-size-800) + var(--dimension-size-500) + var(--dimension-size-200) );position:relative;overflow:hidden;background-color:var(--ds-shimmer-surface-base)}.ds-shimmer-surface.sc-ds-text::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient( 330deg, transparent calc(50% - var(--ds-shimmer-spread)), var(--ds-shimmer, var(--color-shimmer-shimmer)) 50%, transparent calc(50% + var(--ds-shimmer-spread)) );background-repeat:no-repeat;background-position:100% 0;background-size:calc(200% + var(--ds-shimmer-spread) * 2 + var(--ds-shimmer-travel) * 2) 100%;animation:ds-shimmer-surface-motion var(--ds-shimmer-cycle-duration) var(--ds-shimmer-easing) infinite}@media (prefers-reduced-motion: reduce){.ds-shimmer-text.sc-ds-text{animation:none;background-image:none;-webkit-text-fill-color:currentColor}.ds-shimmer-surface.sc-ds-text::after{display:none;animation:none}}@media (forced-colors: active){.ds-shimmer-text.sc-ds-text{animation:none;background-image:none;-webkit-text-fill-color:currentColor}.ds-shimmer-surface.sc-ds-text{background-color:var(--ds-forced-color-disabled)}.ds-shimmer-surface.sc-ds-text::after{display:none;animation:none}}.sc-ds-text-h{box-sizing:border-box;max-width:100%;min-width:0;margin:0;padding:0;border:0;font-family:var(--typography-font-family-ui)}.sc-ds-text-h:where(.ds-text--inline-box){display:inline-block}.sc-ds-text-h:where(.ds-text--block-box){display:block;width:100%}.ds-text__element.sc-ds-text{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;border:0;font:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;text-transform:inherit;text-align:inherit;text-decoration:inherit;text-underline-offset:inherit;font-style:inherit;font-variant-numeric:inherit;font-feature-settings:inherit;-webkit-user-select:inherit;user-select:inherit;white-space:inherit;text-wrap:inherit;overflow-wrap:inherit;word-break:inherit;overflow:inherit;text-overflow:inherit}.ds-text--truncate-1.sc-ds-text-h{overflow:hidden}.ds-text--truncate-1.sc-ds-text-h .ds-text__element.sc-ds-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ds-text--truncate-2.sc-ds-text-h,.ds-text--truncate-3.sc-ds-text-h,.ds-text--truncate-4.sc-ds-text-h,.ds-text--truncate-5.sc-ds-text-h{overflow:hidden}.ds-text--truncate-2.sc-ds-text-h .ds-text__element.sc-ds-text,.ds-text--truncate-3.sc-ds-text-h .ds-text__element.sc-ds-text,.ds-text--truncate-4.sc-ds-text-h .ds-text__element.sc-ds-text,.ds-text--truncate-5.sc-ds-text-h .ds-text__element.sc-ds-text{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;word-break:break-word}.ds-text--truncate-2.sc-ds-text-h .ds-text__element.sc-ds-text{-webkit-line-clamp:2}.ds-text--truncate-3.sc-ds-text-h .ds-text__element.sc-ds-text{-webkit-line-clamp:3}.ds-text--truncate-4.sc-ds-text-h .ds-text__element.sc-ds-text{-webkit-line-clamp:4}.ds-text--truncate-5.sc-ds-text-h .ds-text__element.sc-ds-text{-webkit-line-clamp:5}.ds-text--nowrap.sc-ds-text-h,.ds-text--nowrap.sc-ds-text-h .ds-text__element.sc-ds-text{white-space:nowrap;word-break:normal;overflow:hidden;text-overflow:ellipsis;min-width:0}.ds-text--balance.sc-ds-text-h,.ds-text--balance.sc-ds-text-h .ds-text__element.sc-ds-text{text-wrap:balance}.ds-text--pretty.sc-ds-text-h,.ds-text--pretty.sc-ds-text-h .ds-text__element.sc-ds-text{text-wrap:pretty}.ds-text--color-primary.sc-ds-text-h{color:var(--color-foreground-primary)}.ds-text--color-secondary.sc-ds-text-h{color:var(--color-foreground-secondary)}.ds-text--color-tertiary.sc-ds-text-h{color:var(--color-foreground-tertiary)}.ds-text--color-quaternary.sc-ds-text-h{color:var(--color-foreground-quaternary)}.ds-text--color-brand.sc-ds-text-h{color:var(--color-foreground-bold-brand)}.ds-text--color-negative.sc-ds-text-h{color:var(--color-foreground-bold-negative)}.ds-text--color-positive.sc-ds-text-h{color:var(--color-foreground-bold-positive)}.ds-text--color-warning.sc-ds-text-h{color:var(--color-foreground-bold-warning)}.ds-text--color-caution.sc-ds-text-h{color:var(--color-foreground-bold-caution)}.ds-text--color-ai.sc-ds-text-h{color:var(--color-foreground-bold-ai)}.ds-text--color-on-strong.sc-ds-text-h{color:var(--color-foreground-on-strong-background-primary)}.ds-text--color-on-bold.sc-ds-text-h{color:var(--color-foreground-on-bold-background-primary)}.ds-text--decoration-underline.sc-ds-text-h,.ds-text--decoration-dotted-underline.sc-ds-text-h{text-decoration-color:var(--ds-text-decoration-color, var(--color-foreground-tertiary));text-decoration-thickness:var(--ds-text-decoration-thickness, var(--dimension-stroke-width-012));text-underline-offset:var(--ds-text-decoration-offset, var(--dimension-space-025))}.ds-text--decoration-underline.sc-ds-text-h{text-decoration-line:underline}.ds-text--decoration-dotted-underline.sc-ds-text-h{text-decoration-line:underline;text-decoration-style:dotted}.ds-text--italic.sc-ds-text-h{font-style:italic}.ds-text--font-feature-tabular-nums.sc-ds-text-h{font-variant-numeric:tabular-nums;font-feature-settings:'tnum'}.ds-text--align-left.sc-ds-text-h{text-align:left}.ds-text--align-center.sc-ds-text-h{text-align:center}.ds-text--align-right.sc-ds-text-h{text-align:right}`;const n=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.variant="text-body-medium";this.emphasis=false;this.color="inherit";this.italic=false;this.shimmer=false;this.lineTruncation="none";this.fontFeature="normal";this.as="p"}render(){const t=this.as;const e=t=>typeof t==="string"&&t.startsWith("var(--");const i=Number(this.lineTruncation);const o={"ds-text":true,[a(this.as)]:true,[d(this.variant)]:true,"ds-text--emphasis":this.emphasis,"ds-text--regular":!this.emphasis,"ds-text--nowrap":this.wrap==="nowrap","ds-text--balance":this.wrap==="balance","ds-text--pretty":this.wrap==="pretty","ds-text--truncate-1":i===1&&this.wrap!=="nowrap","ds-text--truncate-2":i===2&&this.wrap!=="nowrap","ds-text--truncate-3":i===3&&this.wrap!=="nowrap","ds-text--truncate-4":i===4&&this.wrap!=="nowrap","ds-text--truncate-5":i===5&&this.wrap!=="nowrap","ds-text--color-primary":this.color==="primary","ds-text--color-secondary":this.color==="secondary","ds-text--color-tertiary":this.color==="tertiary","ds-text--color-quaternary":this.color==="quaternary","ds-text--color-brand":this.color==="brand","ds-text--color-negative":this.color==="negative","ds-text--color-positive":this.color==="positive","ds-text--color-warning":this.color==="warning","ds-text--color-caution":this.color==="caution","ds-text--color-ai":this.color==="ai","ds-text--color-on-strong":this.color==="on-strong","ds-text--color-on-bold":this.color==="on-bold","ds-text--color-inherit":this.color==="inherit","ds-text--decoration-underline":this.decoration==="underline","ds-text--decoration-dotted-underline":this.decoration==="dotted-underline","ds-text--italic":this.italic,"ds-text--align-left":this.align==="left","ds-text--align-center":this.align==="center","ds-text--align-right":this.align==="right","ds-text--font-feature-tabular-nums":this.fontFeature==="tabular-nums"};const n=this.color&&e(this.color)?{color:this.color}:undefined;const c={};if(this.as==="label"&&this.for)c["for"]=this.for;if(this.textId)c["id"]=this.textId;return s(r,{key:"be73f0c9d4df91843707e6ca4d38a0d0b70babae",class:o,style:n},s(t,{key:"37e3e0d14c1ca71c6e23aaf5dae564458acd9df3",class:{"ds-text__element":true,"ds-shimmer-text":this.shimmer},...c},s("slot",{key:"e4876b9c6c23c6b63f53916c8b3860472da40cc3"})))}static get style(){return o()}},[262,"ds-text",{variant:[1],emphasis:[4],color:[1],decoration:[1],italic:[4],shimmer:[4],align:[1],lineTruncation:[8,"line-truncation"],wrap:[1],fontFeature:[1,"font-feature"],as:[1],for:[1],textId:[1,"text-id"]}]);function c(){if(typeof customElements==="undefined"){return}const t=["ds-text"];t.forEach((t=>{switch(t){case"ds-text":if(!customElements.get(i(t))){customElements.define(i(t),n)}break}}))}c();export{n as T,c as d};
|
|
2
|
+
//# sourceMappingURL=p-DcwgXLe-.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as i,H as e,c as s,h as t,a as o,t as n}from"./index.js";import{g as r,i as c}from"./p-BQq26pt9.js";import{C as a}from"./p-DlsjHRU3.js";import{d}from"./p-ClOvX8cD.js";import{d as l}from"./p-D5-hqLPK.js";import{d as h}from"./p-C942uiH1.js";import{d as m}from"./p-0XTyQNRG.js";import{d as b}from"./p-D8iNLSCa.js";import{d as f}from"./p-Nx52go85.js";import{d as u}from"./p-KTaiJztz.js";import{d as v}from"./p-Bt1Ybvz-.js";import{d as g}from"./p-DMPn_dt7.js";import{d as w}from"./p-DTlNtCX1.js";import{r as p,T as x}from"./p-mSCnWLhL.js";function k(i,e){const s=r(i);const t=s.findIndex((i=>i.id===e));const o=t>=0?t:0;return{selectedIndex:o,selected:s[o],hasPrevious:o>0,hasNext:o<s.length-1}}const _=()=>`@media (forced-colors: active){.sc-ds-mobile-section-switcher:root,.sc-ds-mobile-section-switcher-h,.ds-forced-colors-scope.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-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-mobile-section-switcher-h,.ds-focus-ring.sc-ds-mobile-section-switcher,.ds-focus-ring-inset.sc-ds-mobile-section-switcher-h,.ds-focus-ring-inset.sc-ds-mobile-section-switcher{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-mobile-section-switcher-h:focus-visible,.ds-focus-ring.sc-ds-mobile-section-switcher: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-mobile-section-switcher-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-mobile-section-switcher{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-mobile-section-switcher-h:focus-visible,.ds-focus-ring-inset.sc-ds-mobile-section-switcher:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-mobile-section-switcher-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-mobile-section-switcher: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-mobile-section-switcher-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher::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-mobile-section-switcher-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-mobile-section-switcher:root,.sc-ds-mobile-section-switcher-h,.ds-forced-colors-scope.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill.sc-ds-mobile-section-switcher{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-mobile-section-switcher-h::before,.ds-interaction-fill.sc-ds-mobile-section-switcher::before,.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill.sc-ds-mobile-section-switcher::before{z-index:1}.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::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-mobile-section-switcher-h,.ds-interaction-fill--bordered.sc-ds-mobile-section-switcher{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-mobile-section-switcher-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-mobile-section-switcher-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h>.ds-interaction-fill__content.sc-ds-mobile-section-switcher,.ds-interaction-fill.sc-ds-mobile-section-switcher>.ds-interaction-fill__content.sc-ds-mobile-section-switcher,.ds-interaction-fill__content.sc-ds-mobile-section-switcher{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-faint.sc-ds-mobile-section-switcher{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-medium.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-bold.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-strong.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-translucent.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-inverted.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-media.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-always-dark.sc-ds-mobile-section-switcher{--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-chrome.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-chrome.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-chrome-interaction-hover);--ds-interaction-pressed:var(--color-chrome-interaction-pressed);--ds-interaction-active:var(--color-chrome-interaction-active);--ds-focus-ring-color:var(--color-chrome-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-navigation.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h:not(:disabled)::after,.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher:not(:disabled)::after{background:var(--ds-interaction-pressed)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::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-mobile-section-switcher-h:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher: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-mobile-section-switcher-h::before,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher::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-mobile-section-switcher-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher: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)}}.sc-ds-mobile-section-switcher-h,.sc-ds-mobile-section-switcher:where(.ds-table),.sc-ds-mobile-section-switcher:where(.tooltip-popup),.sc-ds-mobile-section-switcher:where(.ds-radius){--ds-radius-control:var(--dimension-radius-025);--ds-radius-card:var(--dimension-radius-050);--ds-radius-modal:var(--dimension-radius-050);--ds-radius-menu:var(--dimension-radius-075);--ds-radius-tooltip-control:var(--dimension-radius-025);--ds-radius-tooltip-menu:var(--dimension-radius-075);--ds-radius-table:var(--dimension-radius-050)}.ds-control--lg.sc-ds-mobile-section-switcher,.ds-control--lg.sc-ds-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher,.ds-control--sm.sc-ds-mobile-section-switcher-h,.ds-control--sm.sc-ds-mobile-section-switcher,.ds-control--xs.sc-ds-mobile-section-switcher-h,.ds-control--xs.sc-ds-mobile-section-switcher{--ds-control-radius:var(--ds-radius-control)}.ds-control--lg.sc-ds-mobile-section-switcher-h,.ds-control--lg.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-control--sm.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-control--xs.sc-ds-mobile-section-switcher{--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}.sc-ds-mobile-section-switcher-h{display:block;min-width:0;max-width:100%;color:var(--color-foreground-primary)}.mobile-section-switcher.sc-ds-mobile-section-switcher{appearance:none;display:grid;grid-template-columns:var(--dimension-size-100) minmax(0, auto) var(--dimension-size-100);align-items:center;justify-content:center;gap:var(--dimension-space-050);max-width:100%;min-height:var(--dimension-size-400);padding-inline:var(--dimension-space-100);border:0;border-radius:var(--dimension-radius-100);background:var(--color-background-secondary);color:inherit;box-sizing:border-box;cursor:default}.mobile-section-switcher__label.sc-ds-mobile-section-switcher{min-width:0;max-width:100%;text-align:center}.mobile-section-switcher__position.sc-ds-mobile-section-switcher{width:var(--dimension-size-050);height:var(--dimension-size-050);border-radius:var(--dimension-radius-half);background:currentColor;opacity:0}.mobile-section-switcher__position--visible.sc-ds-mobile-section-switcher{opacity:1}.mobile-section-switcher--sheet.sc-ds-mobile-section-switcher{grid-template-columns:minmax(0, auto);min-height:var(--dimension-size-400);padding-inline:var(--dimension-space-100);border-radius:var(--dimension-radius-half);background:transparent;--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-tertiary)}.mobile-section-switcher--combined.sc-ds-mobile-section-switcher{display:flex}.mobile-section-switcher__page-label.sc-ds-mobile-section-switcher{flex:0 1 auto;min-width:0}.mobile-section-switcher__separator.sc-ds-mobile-section-switcher{flex:0 0 auto}.mobile-section-switcher--combined.sc-ds-mobile-section-switcher .mobile-section-switcher__label.sc-ds-mobile-section-switcher{flex:0 0 auto;max-width:50%}.mobile-section-sheet.sc-ds-mobile-section-switcher{position:fixed;inset:0 0 auto;width:100%;max-width:none;max-height:calc(100dvh - var(--dimension-size-400) - var(--dimension-space-200));margin:0;padding:0;border:0;border-radius:0;box-sizing:border-box;overflow:visible;background:transparent;color:var(--color-foreground-secondary);outline:none}.mobile-section-sheet[open].sc-ds-mobile-section-switcher{display:flex;flex-direction:column}.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher{animation:mobileSectionSheetIn var(--effect-motion-short-2) both}.mobile-section-sheet.sc-ds-mobile-section-switcher::backdrop{background:var(--color-background-shade);animation:mobileSectionShadeIn var(--effect-motion-short-2) both}.mobile-section-sheet--closing[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher{animation-name:mobileSectionSheetOut}.mobile-section-sheet--closing.sc-ds-mobile-section-switcher::backdrop{animation-name:mobileSectionShadeOut}.mobile-section-sheet__items.sc-ds-mobile-section-switcher{display:flex;flex-direction:column;gap:var(--dimension-space-100);min-height:0;max-height:inherit;box-sizing:border-box;background:var(--color-background-primary);box-shadow:var(--effect-elevation-elevated-floating);padding:var(--dimension-space-100);padding-block-start:max(var(--dimension-space-100), env(safe-area-inset-top, 0px));overflow-y:auto;overscroll-behavior:contain}.mobile-section-sheet__item.sc-ds-mobile-section-switcher{appearance:none;flex:0 0 auto;display:flex;align-items:center;height:var(--ds-control-height);width:100%;min-width:0;padding:0 var(--ds-control-padding-inline);box-sizing:border-box;border:0;border-radius:var(--ds-control-radius);background:transparent;color:inherit;text-align:start}.mobile-section-sheet__item[aria-current='page'].sc-ds-mobile-section-switcher{color:var(--color-foreground-primary)}.mobile-section-sheet__item.sc-ds-mobile-section-switcher:disabled{color:var(--color-foreground-tertiary)}.mobile-section-sheet__label.sc-ds-mobile-section-switcher{min-width:0;padding-inline:var(--ds-control-label-inset)}.mobile-section-sheet__divider.sc-ds-mobile-section-switcher{flex:0 0 auto;height:var(--dimension-stroke-width-012);margin-inline:var(--dimension-space-100);background:var(--color-border-tertiary)}@keyframes mobileSectionSheetIn{from{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes mobileSectionSheetOut{from{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes mobileSectionShadeIn{from{opacity:0}to{opacity:1}}@keyframes mobileSectionShadeOut{from{opacity:1}to{opacity:0}}.mobile-section-switcher--pointer-focus.sc-ds-mobile-section-switcher-h .ds-focus-ring-inset.sc-ds-mobile-section-switcher::after{outline:none}.mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{position:fixed;inset:auto 0 0;height:max(var(--dimension-space-200), env(safe-area-inset-bottom, 0px));pointer-events:none;color:var(--color-background-primary);background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{animation:mobileSectionEdgeIn var(--effect-motion-short-2) both}.mobile-section-sheet--closing[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{animation-name:mobileSectionEdgeOut}@keyframes mobileSectionEdgeIn{from{background-color:var(--color-background-primary)}to{background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}}@keyframes mobileSectionEdgeOut{from{background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}to{background-color:var(--color-background-primary)}}@media (prefers-reduced-motion: reduce){.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher,.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher,.mobile-section-sheet.sc-ds-mobile-section-switcher::backdrop{animation:none}}`;let y=0;const C=i(class i extends e{constructor(i){super();if(i!==false){this.__registerHost()}this.dsChange=s(this,"dsChange",7);this.sections=[];this.value="";this.navigationLabel="Change page section";this.presentation="menu";this.pageLabel="";this.menuOpen=false;this.menuSurfaceOpen=false;this.initialFocusVisible=false;this.pointerFocus=false;this.sheetClosing=false;this.focusedSection="";this.instanceId=y++;this.triggerId=`ds-mobile-section-switcher-trigger-${this.instanceId}`;this.menuId=`ds-mobile-section-switcher-menu-${this.instanceId}`;this.triggerEl=null;this.dialogEl=null;this.browserEdgeEl=null;this.browserEdgeColors="";this.closeTimer=null;this.loaded=false;this.tasks=new a((()=>this.el.isConnected));this.handleDocumentKeyDown=i=>{if(["Shift","Control","Alt","Meta"].includes(i.key))return;this.pointerFocus=false};this.updateBrowserEdgeColor=()=>{if(!this.el.isConnected||!this.browserEdgeEl||!this.dialogEl)return;const i=getComputedStyle(this.browserEdgeEl).color;const e=getComputedStyle(this.dialogEl,"::backdrop").backgroundColor;const s=`${i}|${e}`;if(s===this.browserEdgeColors)return;const t=this.el.ownerDocument.createElement("canvas");t.width=t.height=1;const o=t.getContext("2d");if(!o)return;o.fillStyle=i;o.fillRect(0,0,1,1);o.fillStyle=e;o.fillRect(0,0,1,1);const[n,r,c]=o.getImageData(0,0,1,1).data;this.browserEdgeEl.style.setProperty("--_mobile-section-edge-color",`rgb(${n}, ${r}, ${c})`);this.browserEdgeColors=s};this.handleSheetKeyDown=i=>{if(i.key==="Escape"){i.preventDefault();i.stopPropagation();this.closeMenu();return}const e=this.selectableSections.filter((i=>!i.isInactive));if(!e.length)return;const s=Math.max(0,e.findIndex((i=>i.id===this.focusedSection)));let t;if(i.key==="ArrowDown")t=(s+1)%e.length;else if(i.key==="ArrowUp")t=(s+e.length-1)%e.length;else if(i.key==="Home")t=0;else if(i.key==="End")t=e.length-1;else if(i.key==="Tab")t=s;else if(i.key.length===1&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&i.key!==" "){const o=e.findIndex(((t,o)=>e[(s+o+1)%e.length].label.toLowerCase().startsWith(i.key.toLowerCase())));if(o<0)return;t=(s+o+1)%e.length}else return;i.preventDefault();this.initialFocusVisible=true;this.focusSheetItem(e[t].id)};this.toggleMenu=i=>{if(this.selectableSections.length<=1)return;this.initialFocusVisible=i.detail===0;if(this.presentation==="sheet"){if(this.menuOpen)this.closeMenu();else{this.focusedSection=this.selectedSection?.id??"";this.menuOpen=true}return}this.menuOpen=!this.menuOpen;if(this.menuOpen)this.menuSurfaceOpen=true};this.closeMenu=()=>{this.menuOpen=false;if(this.dialogEl?.open)this.sheetClosing=true};this.handleSelect=i=>{const e=String(i.detail.value??"");const s=this.selectableSections.find((i=>i.id===e));if(!s||s.isInactive)return;this.closeMenu();if(e!==this.selectedSection?.id)this.dsChange.emit(e);this.tasks.frame((()=>this.triggerEl?.focus()))}}componentDidLoad(){this.loaded=true;this.connectResources()}connectedCallback(){if(this.loaded)this.connectResources()}connectResources(){if(!this.el.isConnected||this.boundDocument)return;this.boundDocument=this.el.ownerDocument;this.boundDocument.addEventListener("keydown",this.handleDocumentKeyDown,true);this.visibilityObserver=new ResizeObserver(this.tasks.guard((()=>{if(this.dialogEl?.open&&!this.triggerEl?.getClientRects().length){this.finishSheetClose(false)}})));this.visibilityObserver.observe(this.el)}componentDidRender(){if(!this.el.isConnected||!this.dialogEl)return;if(this.presentation==="sheet"&&this.menuOpen&&!this.dialogEl.open){const i=this.focusedSection;this.updateBrowserEdgeColor();this.observeBrowserEdgeTheme();this.dialogEl.showModal();this.focusSheetItem(i)}if(this.sheetClosing&&this.dialogEl.open&&!this.closeTimer){const i=p(x.motionShort2,x.animationDurationShort3);if(!i)this.finishSheetClose();else this.closeTimer=setTimeout((()=>this.finishSheetClose()),i)}}disconnectedCallback(){this.tasks.cancel();this.boundDocument?.removeEventListener("keydown",this.handleDocumentKeyDown,true);this.boundDocument=undefined;this.visibilityObserver?.disconnect();this.visibilityObserver=undefined;this.pointerFocus=false;this.menuSurfaceOpen=false;this.finishSheetClose(false)}handlePresentationChange(){this.menuSurfaceOpen=false;this.closeMenu()}handleContextChange(){this.closeMenu()}finishSheetClose(i=true){if(this.closeTimer)clearTimeout(this.closeTimer);this.closeTimer=null;const e=this.dialogEl?.open;this.dialogEl?.close();this.themeObserver?.disconnect();this.menuOpen=false;this.sheetClosing=false;if(e&&i&&this.triggerEl?.getClientRects().length)this.triggerEl.focus()}observeBrowserEdgeTheme(){this.themeObserver??(this.themeObserver=new MutationObserver(this.updateBrowserEdgeColor));for(let i=this.el;i;i=i.parentElement){this.themeObserver.observe(i,{attributes:true,attributeFilter:["class","style","data-theme"]})}}focusSheetItem(i){const e=Array.from(this.dialogEl?.querySelectorAll("button")??[]);const s=e.find((e=>e.value===i&&!e.disabled))??e.find((i=>!i.disabled));if(s){this.focusedSection=s.value;s.focus()}else this.dialogEl?.focus()}get resolvedSections(){return this.sections??[]}get selectableSections(){return r(this.resolvedSections)}get selectedIndex(){return k(this.resolvedSections,this.value).selectedIndex}get selectedSection(){return this.selectableSections[this.selectedIndex]}get hasPrevious(){return k(this.resolvedSections,this.value).hasPrevious}get hasNext(){return k(this.resolvedSections,this.value).hasNext}get triggerAriaLabel(){return`${this.presentation==="sheet"&&this.pageLabel?`${this.pageLabel}. `:""}${this.navigationLabel}. Current section: ${this.selectedSection?.label??""}`}get menuSections(){const i=[];let e=[];const s=()=>{if(e.length)i.push({items:e});e=[]};for(const i of this.resolvedSections){if(c(i)){s();continue}e.push({label:i.label,value:i.id,dot:i.dot,isSelected:i.id===this.selectedSection?.id,isInactive:i.isInactive})}s();return i}handleSectionsChange(){if(this.selectableSections.length<=1){this.closeMenu();this.menuSurfaceOpen=false}else if(this.dialogEl?.open&&!this.sheetClosing){this.tasks.frame((()=>{if(this.dialogEl?.open&&!this.sheetClosing)this.focusSheetItem(this.focusedSection)}))}}renderSheet(){return t("dialog",{id:this.menuId,ref:i=>{this.dialogEl=i??null},class:{"mobile-section-sheet":true,"mobile-section-sheet--closing":this.sheetClosing},"aria-label":this.navigationLabel,tabIndex:-1,onCancel:i=>{i.preventDefault();this.closeMenu()},onKeyDown:this.handleSheetKeyDown,onClick:i=>{if(!this.dialogEl||i.target!==this.dialogEl)return;const e=this.dialogEl.getBoundingClientRect();if(i.clientY<e.top||i.clientY>e.bottom||i.clientX<e.left||i.clientX>e.right)this.closeMenu()}},t("div",{class:"mobile-section-sheet__items",role:"menu","aria-label":this.navigationLabel},this.resolvedSections.map((i=>c(i)?t("div",{class:"mobile-section-sheet__divider",role:"separator"}):t("button",{type:"button",role:"menuitem",value:i.id,disabled:i.isInactive,"aria-current":i.id===this.selectedSection?.id?"page":undefined,tabIndex:i.id===this.focusedSection?0:-1,class:{"mobile-section-sheet__item":true,"ds-control--md":true,"ds-interaction-fill":true,"ds-focus-ring-inset":true,"ds-focus-ring--visible":this.initialFocusVisible&&i.id===this.focusedSection},onFocus:()=>{this.focusedSection=i.id},onClick:()=>{if(this.sheetClosing||i.isInactive)return;this.closeMenu();if(i.id!==this.selectedSection?.id)this.dsChange.emit(i.id)}},t("ds-text",{class:"mobile-section-sheet__label ds-interaction-fill__content",as:"span",variant:"text-body-medium",color:"inherit",emphasis:i.id===this.selectedSection?.id,lineTruncation:1},i.label))))),t("div",{ref:i=>{if(this.browserEdgeEl!==i)this.browserEdgeColors="";this.browserEdgeEl=i??null},class:"mobile-section-sheet__browser-edge","aria-hidden":"true"}))}render(){const i=this.selectedSection;if(!i)return t(o,null);const e=this.presentation==="sheet"&&!!this.pageLabel;return t(o,{class:{"mobile-section-switcher--pointer-focus":this.pointerFocus},onPointerDown:()=>{this.pointerFocus=true;this.initialFocusVisible=false}},t("button",{ref:i=>{this.triggerEl=i??null},id:this.triggerId,class:{"mobile-section-switcher":true,"mobile-section-switcher--expanded":this.menuOpen,"ds-interaction-fill--surface-open":this.menuSurfaceOpen||this.menuOpen||this.sheetClosing,"mobile-section-switcher--sheet":this.presentation==="sheet","mobile-section-switcher--combined":e,"ds-focus-ring-inset":true,"ds-interaction-fill":true},type:"button","aria-haspopup":this.presentation==="sheet"?"dialog":"menu","aria-controls":this.menuId,"aria-expanded":String(this.menuOpen),"aria-label":this.triggerAriaLabel,onClick:this.toggleMenu},this.presentation==="menu"?t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasPrevious,"ds-interaction-fill__content":true},"aria-hidden":"true"}):null,e?[t("ds-text",{class:"mobile-section-switcher__page-label ds-interaction-fill__content",as:"span",variant:"text-body-medium",emphasis:true,color:"inherit",lineTruncation:1},this.pageLabel),t("ds-text",{class:"mobile-section-switcher__separator ds-interaction-fill__content",as:"span",variant:"text-body-medium",color:"inherit","aria-hidden":"true"},"·")]:null,t("ds-text",{class:"mobile-section-switcher__label ds-interaction-fill__content",as:"span",variant:"text-body-medium",emphasis:true,color:"inherit",lineTruncation:1},i.label),this.presentation==="menu"?t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasNext,"ds-interaction-fill__content":true},"aria-hidden":"true"}):null),this.presentation==="sheet"||this.sheetClosing?this.renderSheet():this.selectableSections.length>1?t("ds-menu",{id:this.menuId,anchorId:this.triggerId,align:"center",menuLabel:this.navigationLabel,open:this.menuOpen,initialFocusVisible:this.initialFocusVisible,sections:this.menuSections,onDsClose:this.closeMenu,onDsAfterClose:()=>{if(!this.menuOpen)this.menuSurfaceOpen=false},onDsSelect:this.handleSelect}):null)}get el(){return this}static get watchers(){return{presentation:[{handlePresentationChange:0}],value:[{handleContextChange:0}],pageLabel:[{handleContextChange:0}],sections:[{handleSectionsChange:0}]}}static get style(){return _()}},[2,"ds-mobile-section-switcher",{sections:[16],value:[1],navigationLabel:[1,"navigation-label"],presentation:[1],pageLabel:[1,"page-label"],menuOpen:[32],menuSurfaceOpen:[32],initialFocusVisible:[32],pointerFocus:[32],sheetClosing:[32],focusedSection:[32]},undefined,{presentation:[{handlePresentationChange:0}],value:[{handleContextChange:0}],pageLabel:[{handleContextChange:0}],sections:[{handleSectionsChange:0}]}]);function S(){if(typeof customElements==="undefined"){return}const i=["ds-mobile-section-switcher","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-menu","ds-swatch-picker","ds-switch","ds-tag","ds-text","ds-tooltip"];i.forEach((i=>{switch(i){case"ds-mobile-section-switcher":if(!customElements.get(n(i))){customElements.define(n(i),C)}break;case"ds-badge":if(!customElements.get(n(i))){d()}break;case"ds-button-unfilled":if(!customElements.get(n(i))){l()}break;case"ds-icon":if(!customElements.get(n(i))){h()}break;case"ds-loader":if(!customElements.get(n(i))){m()}break;case"ds-menu":if(!customElements.get(n(i))){b()}break;case"ds-swatch-picker":if(!customElements.get(n(i))){f()}break;case"ds-switch":if(!customElements.get(n(i))){u()}break;case"ds-tag":if(!customElements.get(n(i))){v()}break;case"ds-text":if(!customElements.get(n(i))){g()}break;case"ds-tooltip":if(!customElements.get(n(i))){w()}break}}))}S();export{C as M,S as d};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as i,H as e,c as s,h as t,a as o,t as n}from"./index.js";import{g as r,i as c}from"./p-BQq26pt9.js";import{C as a}from"./p-DlsjHRU3.js";import{d}from"./p-BEj9uENH.js";import{d as l}from"./p-DKL7n7NM.js";import{d as h}from"./p-C942uiH1.js";import{d as m}from"./p-0XTyQNRG.js";import{d as b}from"./p-C8WKo0sf.js";import{d as f}from"./p-Cn6Ud58k.js";import{d as u}from"./p-CVuSm1Sh.js";import{d as v}from"./p-BQ6p3LFP.js";import{d as g}from"./p-DcwgXLe-.js";import{d as w}from"./p-xHv_RGJh.js";import{r as p,T as x}from"./p-mSCnWLhL.js";function k(i,e){const s=r(i);const t=s.findIndex((i=>i.id===e));const o=t>=0?t:0;return{selectedIndex:o,selected:s[o],hasPrevious:o>0,hasNext:o<s.length-1}}const _=()=>`@media (forced-colors: active){.sc-ds-mobile-section-switcher:root,.sc-ds-mobile-section-switcher-h,.ds-forced-colors-scope.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-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-mobile-section-switcher-h,.ds-focus-ring.sc-ds-mobile-section-switcher,.ds-focus-ring-inset.sc-ds-mobile-section-switcher-h,.ds-focus-ring-inset.sc-ds-mobile-section-switcher{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-mobile-section-switcher-h:focus-visible,.ds-focus-ring.sc-ds-mobile-section-switcher: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-mobile-section-switcher-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-mobile-section-switcher{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-mobile-section-switcher-h:focus-visible,.ds-focus-ring-inset.sc-ds-mobile-section-switcher:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-mobile-section-switcher-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-mobile-section-switcher: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-mobile-section-switcher-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher::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-mobile-section-switcher-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-mobile-section-switcher:root,.sc-ds-mobile-section-switcher-h,.ds-forced-colors-scope.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill.sc-ds-mobile-section-switcher{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-mobile-section-switcher-h::before,.ds-interaction-fill.sc-ds-mobile-section-switcher::before,.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill.sc-ds-mobile-section-switcher::before{z-index:1}.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::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-mobile-section-switcher-h,.ds-interaction-fill--bordered.sc-ds-mobile-section-switcher{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-mobile-section-switcher-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-mobile-section-switcher-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h>.ds-interaction-fill__content.sc-ds-mobile-section-switcher,.ds-interaction-fill.sc-ds-mobile-section-switcher>.ds-interaction-fill__content.sc-ds-mobile-section-switcher,.ds-interaction-fill__content.sc-ds-mobile-section-switcher{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-faint.sc-ds-mobile-section-switcher{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-medium.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-bold.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-strong.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-translucent.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-inverted.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-media.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-interaction-fill--on-always-dark.sc-ds-mobile-section-switcher{--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-chrome.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-chrome.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-chrome-interaction-hover);--ds-interaction-pressed:var(--color-chrome-interaction-pressed);--ds-interaction-active:var(--color-chrome-interaction-active);--ds-focus-ring-color:var(--color-chrome-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-navigation.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h:not(:disabled)::after,.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher:not(:disabled)::after{background:var(--ds-interaction-pressed)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::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-mobile-section-switcher-h:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher: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-mobile-section-switcher-h::before,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher::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-mobile-section-switcher-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher: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)}}.sc-ds-mobile-section-switcher-h,.sc-ds-mobile-section-switcher:where(.ds-table),.sc-ds-mobile-section-switcher:where(.tooltip-popup),.sc-ds-mobile-section-switcher:where(.ds-radius){--ds-radius-control:var(--dimension-radius-025);--ds-radius-card:var(--dimension-radius-050);--ds-radius-modal:var(--dimension-radius-050);--ds-radius-menu:var(--dimension-radius-075);--ds-radius-tooltip-control:var(--dimension-radius-025);--ds-radius-tooltip-menu:var(--dimension-radius-075);--ds-radius-table:var(--dimension-radius-050)}.ds-control--lg.sc-ds-mobile-section-switcher,.ds-control--lg.sc-ds-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher,.ds-control--sm.sc-ds-mobile-section-switcher-h,.ds-control--sm.sc-ds-mobile-section-switcher,.ds-control--xs.sc-ds-mobile-section-switcher-h,.ds-control--xs.sc-ds-mobile-section-switcher{--ds-control-radius:var(--ds-radius-control)}.ds-control--lg.sc-ds-mobile-section-switcher-h,.ds-control--lg.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-control--sm.sc-ds-mobile-section-switcher{--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-mobile-section-switcher-h,.ds-control--xs.sc-ds-mobile-section-switcher{--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}.sc-ds-mobile-section-switcher-h{display:block;min-width:0;max-width:100%;color:var(--color-foreground-primary)}.mobile-section-switcher.sc-ds-mobile-section-switcher{appearance:none;display:grid;grid-template-columns:var(--dimension-size-100) minmax(0, auto) var(--dimension-size-100);align-items:center;justify-content:center;gap:var(--dimension-space-050);max-width:100%;min-height:var(--dimension-size-400);padding-inline:var(--dimension-space-100);border:0;border-radius:var(--dimension-radius-100);background:var(--color-background-secondary);color:inherit;box-sizing:border-box;cursor:default}.mobile-section-switcher__label.sc-ds-mobile-section-switcher{min-width:0;max-width:100%;text-align:center}.mobile-section-switcher__position.sc-ds-mobile-section-switcher{width:var(--dimension-size-050);height:var(--dimension-size-050);border-radius:var(--dimension-radius-half);background:currentColor;opacity:0}.mobile-section-switcher__position--visible.sc-ds-mobile-section-switcher{opacity:1}.mobile-section-switcher--sheet.sc-ds-mobile-section-switcher{grid-template-columns:minmax(0, auto);min-height:var(--dimension-size-400);padding-inline:var(--dimension-space-100);border-radius:var(--dimension-radius-half);background:transparent;--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-tertiary)}.mobile-section-switcher--combined.sc-ds-mobile-section-switcher{display:flex}.mobile-section-switcher__page-label.sc-ds-mobile-section-switcher{flex:0 1 auto;min-width:0}.mobile-section-switcher__separator.sc-ds-mobile-section-switcher{flex:0 0 auto}.mobile-section-switcher--combined.sc-ds-mobile-section-switcher .mobile-section-switcher__label.sc-ds-mobile-section-switcher{flex:0 0 auto;max-width:50%}.mobile-section-sheet.sc-ds-mobile-section-switcher{position:fixed;inset:0 0 auto;width:100%;max-width:none;max-height:calc(100dvh - var(--dimension-size-400) - var(--dimension-space-200));margin:0;padding:0;border:0;border-radius:0;box-sizing:border-box;overflow:visible;background:transparent;color:var(--color-foreground-secondary);outline:none}.mobile-section-sheet[open].sc-ds-mobile-section-switcher{display:flex;flex-direction:column}.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher{animation:mobileSectionSheetIn var(--effect-motion-short-2) both}.mobile-section-sheet.sc-ds-mobile-section-switcher::backdrop{background:var(--color-background-shade);animation:mobileSectionShadeIn var(--effect-motion-short-2) both}.mobile-section-sheet--closing[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher{animation-name:mobileSectionSheetOut}.mobile-section-sheet--closing.sc-ds-mobile-section-switcher::backdrop{animation-name:mobileSectionShadeOut}.mobile-section-sheet__items.sc-ds-mobile-section-switcher{display:flex;flex-direction:column;gap:var(--dimension-space-100);min-height:0;max-height:inherit;box-sizing:border-box;background:var(--color-background-primary);box-shadow:var(--effect-elevation-elevated-floating);padding:var(--dimension-space-100);padding-block-start:max(var(--dimension-space-100), env(safe-area-inset-top, 0px));overflow-y:auto;overscroll-behavior:contain}.mobile-section-sheet__item.sc-ds-mobile-section-switcher{appearance:none;flex:0 0 auto;display:flex;align-items:center;height:var(--ds-control-height);width:100%;min-width:0;padding:0 var(--ds-control-padding-inline);box-sizing:border-box;border:0;border-radius:var(--ds-control-radius);background:transparent;color:inherit;text-align:start}.mobile-section-sheet__item[aria-current='page'].sc-ds-mobile-section-switcher{color:var(--color-foreground-primary)}.mobile-section-sheet__item.sc-ds-mobile-section-switcher:disabled{color:var(--color-foreground-tertiary)}.mobile-section-sheet__label.sc-ds-mobile-section-switcher{min-width:0;padding-inline:var(--ds-control-label-inset)}.mobile-section-sheet__divider.sc-ds-mobile-section-switcher{flex:0 0 auto;height:var(--dimension-stroke-width-012);margin-inline:var(--dimension-space-100);background:var(--color-border-tertiary)}@keyframes mobileSectionSheetIn{from{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes mobileSectionSheetOut{from{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes mobileSectionShadeIn{from{opacity:0}to{opacity:1}}@keyframes mobileSectionShadeOut{from{opacity:1}to{opacity:0}}.mobile-section-switcher--pointer-focus.sc-ds-mobile-section-switcher-h .ds-focus-ring-inset.sc-ds-mobile-section-switcher::after{outline:none}.mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{position:fixed;inset:auto 0 0;height:max(var(--dimension-space-200), env(safe-area-inset-bottom, 0px));pointer-events:none;color:var(--color-background-primary);background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{animation:mobileSectionEdgeIn var(--effect-motion-short-2) both}.mobile-section-sheet--closing[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{animation-name:mobileSectionEdgeOut}@keyframes mobileSectionEdgeIn{from{background-color:var(--color-background-primary)}to{background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}}@keyframes mobileSectionEdgeOut{from{background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}to{background-color:var(--color-background-primary)}}@media (prefers-reduced-motion: reduce){.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher,.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher,.mobile-section-sheet.sc-ds-mobile-section-switcher::backdrop{animation:none}}`;let y=0;const C=i(class i extends e{constructor(i){super();if(i!==false){this.__registerHost()}this.dsChange=s(this,"dsChange",7);this.sections=[];this.value="";this.navigationLabel="Change page section";this.presentation="menu";this.pageLabel="";this.menuOpen=false;this.menuSurfaceOpen=false;this.initialFocusVisible=false;this.pointerFocus=false;this.sheetClosing=false;this.focusedSection="";this.instanceId=y++;this.triggerId=`ds-mobile-section-switcher-trigger-${this.instanceId}`;this.menuId=`ds-mobile-section-switcher-menu-${this.instanceId}`;this.triggerEl=null;this.dialogEl=null;this.browserEdgeEl=null;this.browserEdgeColors="";this.closeTimer=null;this.loaded=false;this.tasks=new a((()=>this.el.isConnected));this.handleDocumentKeyDown=i=>{if(["Shift","Control","Alt","Meta"].includes(i.key))return;this.pointerFocus=false};this.updateBrowserEdgeColor=()=>{if(!this.el.isConnected||!this.browserEdgeEl||!this.dialogEl)return;const i=getComputedStyle(this.browserEdgeEl).color;const e=getComputedStyle(this.dialogEl,"::backdrop").backgroundColor;const s=`${i}|${e}`;if(s===this.browserEdgeColors)return;const t=this.el.ownerDocument.createElement("canvas");t.width=t.height=1;const o=t.getContext("2d");if(!o)return;o.fillStyle=i;o.fillRect(0,0,1,1);o.fillStyle=e;o.fillRect(0,0,1,1);const[n,r,c]=o.getImageData(0,0,1,1).data;this.browserEdgeEl.style.setProperty("--_mobile-section-edge-color",`rgb(${n}, ${r}, ${c})`);this.browserEdgeColors=s};this.handleSheetKeyDown=i=>{if(i.key==="Escape"){i.preventDefault();i.stopPropagation();this.closeMenu();return}const e=this.selectableSections.filter((i=>!i.isInactive));if(!e.length)return;const s=Math.max(0,e.findIndex((i=>i.id===this.focusedSection)));let t;if(i.key==="ArrowDown")t=(s+1)%e.length;else if(i.key==="ArrowUp")t=(s+e.length-1)%e.length;else if(i.key==="Home")t=0;else if(i.key==="End")t=e.length-1;else if(i.key==="Tab")t=s;else if(i.key.length===1&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&i.key!==" "){const o=e.findIndex(((t,o)=>e[(s+o+1)%e.length].label.toLowerCase().startsWith(i.key.toLowerCase())));if(o<0)return;t=(s+o+1)%e.length}else return;i.preventDefault();this.initialFocusVisible=true;this.focusSheetItem(e[t].id)};this.toggleMenu=i=>{if(this.selectableSections.length<=1)return;this.initialFocusVisible=i.detail===0;if(this.presentation==="sheet"){if(this.menuOpen)this.closeMenu();else{this.focusedSection=this.selectedSection?.id??"";this.menuOpen=true}return}this.menuOpen=!this.menuOpen;if(this.menuOpen)this.menuSurfaceOpen=true};this.closeMenu=()=>{this.menuOpen=false;if(this.dialogEl?.open)this.sheetClosing=true};this.handleSelect=i=>{const e=String(i.detail.value??"");const s=this.selectableSections.find((i=>i.id===e));if(!s||s.isInactive)return;this.closeMenu();if(e!==this.selectedSection?.id)this.dsChange.emit(e);this.tasks.frame((()=>this.triggerEl?.focus()))}}componentDidLoad(){this.loaded=true;this.connectResources()}connectedCallback(){if(this.loaded)this.connectResources()}connectResources(){if(!this.el.isConnected||this.boundDocument)return;this.boundDocument=this.el.ownerDocument;this.boundDocument.addEventListener("keydown",this.handleDocumentKeyDown,true);this.visibilityObserver=new ResizeObserver(this.tasks.guard((()=>{if(this.dialogEl?.open&&!this.triggerEl?.getClientRects().length){this.finishSheetClose(false)}})));this.visibilityObserver.observe(this.el)}componentDidRender(){if(!this.el.isConnected||!this.dialogEl)return;if(this.presentation==="sheet"&&this.menuOpen&&!this.dialogEl.open){const i=this.focusedSection;this.updateBrowserEdgeColor();this.observeBrowserEdgeTheme();this.dialogEl.showModal();this.focusSheetItem(i)}if(this.sheetClosing&&this.dialogEl.open&&!this.closeTimer){const i=p(x.motionShort2,x.animationDurationShort3);if(!i)this.finishSheetClose();else this.closeTimer=setTimeout((()=>this.finishSheetClose()),i)}}disconnectedCallback(){this.tasks.cancel();this.boundDocument?.removeEventListener("keydown",this.handleDocumentKeyDown,true);this.boundDocument=undefined;this.visibilityObserver?.disconnect();this.visibilityObserver=undefined;this.pointerFocus=false;this.menuSurfaceOpen=false;this.finishSheetClose(false)}handlePresentationChange(){this.menuSurfaceOpen=false;this.closeMenu()}handleContextChange(){this.closeMenu()}finishSheetClose(i=true){if(this.closeTimer)clearTimeout(this.closeTimer);this.closeTimer=null;const e=this.dialogEl?.open;this.dialogEl?.close();this.themeObserver?.disconnect();this.menuOpen=false;this.sheetClosing=false;if(e&&i&&this.triggerEl?.getClientRects().length)this.triggerEl.focus()}observeBrowserEdgeTheme(){this.themeObserver??(this.themeObserver=new MutationObserver(this.updateBrowserEdgeColor));for(let i=this.el;i;i=i.parentElement){this.themeObserver.observe(i,{attributes:true,attributeFilter:["class","style","data-theme"]})}}focusSheetItem(i){const e=Array.from(this.dialogEl?.querySelectorAll("button")??[]);const s=e.find((e=>e.value===i&&!e.disabled))??e.find((i=>!i.disabled));if(s){this.focusedSection=s.value;s.focus()}else this.dialogEl?.focus()}get resolvedSections(){return this.sections??[]}get selectableSections(){return r(this.resolvedSections)}get selectedIndex(){return k(this.resolvedSections,this.value).selectedIndex}get selectedSection(){return this.selectableSections[this.selectedIndex]}get hasPrevious(){return k(this.resolvedSections,this.value).hasPrevious}get hasNext(){return k(this.resolvedSections,this.value).hasNext}get triggerAriaLabel(){return`${this.presentation==="sheet"&&this.pageLabel?`${this.pageLabel}. `:""}${this.navigationLabel}. Current section: ${this.selectedSection?.label??""}`}get menuSections(){const i=[];let e=[];const s=()=>{if(e.length)i.push({items:e});e=[]};for(const i of this.resolvedSections){if(c(i)){s();continue}e.push({label:i.label,value:i.id,dot:i.dot,isSelected:i.id===this.selectedSection?.id,isInactive:i.isInactive})}s();return i}handleSectionsChange(){if(this.selectableSections.length<=1){this.closeMenu();this.menuSurfaceOpen=false}else if(this.dialogEl?.open&&!this.sheetClosing){this.tasks.frame((()=>{if(this.dialogEl?.open&&!this.sheetClosing)this.focusSheetItem(this.focusedSection)}))}}renderSheet(){return t("dialog",{id:this.menuId,ref:i=>{this.dialogEl=i??null},class:{"mobile-section-sheet":true,"mobile-section-sheet--closing":this.sheetClosing},"aria-label":this.navigationLabel,tabIndex:-1,onCancel:i=>{i.preventDefault();this.closeMenu()},onKeyDown:this.handleSheetKeyDown,onClick:i=>{if(!this.dialogEl||i.target!==this.dialogEl)return;const e=this.dialogEl.getBoundingClientRect();if(i.clientY<e.top||i.clientY>e.bottom||i.clientX<e.left||i.clientX>e.right)this.closeMenu()}},t("div",{class:"mobile-section-sheet__items",role:"menu","aria-label":this.navigationLabel},this.resolvedSections.map((i=>c(i)?t("div",{class:"mobile-section-sheet__divider",role:"separator"}):t("button",{type:"button",role:"menuitem",value:i.id,disabled:i.isInactive,"aria-current":i.id===this.selectedSection?.id?"page":undefined,tabIndex:i.id===this.focusedSection?0:-1,class:{"mobile-section-sheet__item":true,"ds-control--md":true,"ds-interaction-fill":true,"ds-focus-ring-inset":true,"ds-focus-ring--visible":this.initialFocusVisible&&i.id===this.focusedSection},onFocus:()=>{this.focusedSection=i.id},onClick:()=>{if(this.sheetClosing||i.isInactive)return;this.closeMenu();if(i.id!==this.selectedSection?.id)this.dsChange.emit(i.id)}},t("ds-text",{class:"mobile-section-sheet__label ds-interaction-fill__content",as:"span",variant:"text-body-medium",color:"inherit",emphasis:i.id===this.selectedSection?.id,lineTruncation:1},i.label))))),t("div",{ref:i=>{if(this.browserEdgeEl!==i)this.browserEdgeColors="";this.browserEdgeEl=i??null},class:"mobile-section-sheet__browser-edge","aria-hidden":"true"}))}render(){const i=this.selectedSection;if(!i)return t(o,null);const e=this.presentation==="sheet"&&!!this.pageLabel;return t(o,{class:{"mobile-section-switcher--pointer-focus":this.pointerFocus},onPointerDown:()=>{this.pointerFocus=true;this.initialFocusVisible=false}},t("button",{ref:i=>{this.triggerEl=i??null},id:this.triggerId,class:{"mobile-section-switcher":true,"mobile-section-switcher--expanded":this.menuOpen,"ds-interaction-fill--surface-open":this.menuSurfaceOpen||this.menuOpen||this.sheetClosing,"mobile-section-switcher--sheet":this.presentation==="sheet","mobile-section-switcher--combined":e,"ds-focus-ring-inset":true,"ds-interaction-fill":true},type:"button","aria-haspopup":this.presentation==="sheet"?"dialog":"menu","aria-controls":this.menuId,"aria-expanded":String(this.menuOpen),"aria-label":this.triggerAriaLabel,onClick:this.toggleMenu},this.presentation==="menu"?t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasPrevious,"ds-interaction-fill__content":true},"aria-hidden":"true"}):null,e?[t("ds-text",{class:"mobile-section-switcher__page-label ds-interaction-fill__content",as:"span",variant:"text-body-medium",emphasis:true,color:"inherit",lineTruncation:1},this.pageLabel),t("ds-text",{class:"mobile-section-switcher__separator ds-interaction-fill__content",as:"span",variant:"text-body-medium",color:"inherit","aria-hidden":"true"},"·")]:null,t("ds-text",{class:"mobile-section-switcher__label ds-interaction-fill__content",as:"span",variant:"text-body-medium",emphasis:true,color:"inherit",lineTruncation:1},i.label),this.presentation==="menu"?t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasNext,"ds-interaction-fill__content":true},"aria-hidden":"true"}):null),this.presentation==="sheet"||this.sheetClosing?this.renderSheet():this.selectableSections.length>1?t("ds-menu",{id:this.menuId,anchorId:this.triggerId,align:"center",menuLabel:this.navigationLabel,open:this.menuOpen,initialFocusVisible:this.initialFocusVisible,sections:this.menuSections,onDsClose:this.closeMenu,onDsAfterClose:()=>{if(!this.menuOpen)this.menuSurfaceOpen=false},onDsSelect:this.handleSelect}):null)}get el(){return this}static get watchers(){return{presentation:[{handlePresentationChange:0}],value:[{handleContextChange:0}],pageLabel:[{handleContextChange:0}],sections:[{handleSectionsChange:0}]}}static get style(){return _()}},[2,"ds-mobile-section-switcher",{sections:[16],value:[1],navigationLabel:[1,"navigation-label"],presentation:[1],pageLabel:[1,"page-label"],menuOpen:[32],menuSurfaceOpen:[32],initialFocusVisible:[32],pointerFocus:[32],sheetClosing:[32],focusedSection:[32]},undefined,{presentation:[{handlePresentationChange:0}],value:[{handleContextChange:0}],pageLabel:[{handleContextChange:0}],sections:[{handleSectionsChange:0}]}]);function S(){if(typeof customElements==="undefined"){return}const i=["ds-mobile-section-switcher","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-menu","ds-swatch-picker","ds-switch","ds-tag","ds-text","ds-tooltip"];i.forEach((i=>{switch(i){case"ds-mobile-section-switcher":if(!customElements.get(n(i))){customElements.define(n(i),C)}break;case"ds-badge":if(!customElements.get(n(i))){d()}break;case"ds-button-unfilled":if(!customElements.get(n(i))){l()}break;case"ds-icon":if(!customElements.get(n(i))){h()}break;case"ds-loader":if(!customElements.get(n(i))){m()}break;case"ds-menu":if(!customElements.get(n(i))){b()}break;case"ds-swatch-picker":if(!customElements.get(n(i))){f()}break;case"ds-switch":if(!customElements.get(n(i))){u()}break;case"ds-tag":if(!customElements.get(n(i))){v()}break;case"ds-text":if(!customElements.get(n(i))){g()}break;case"ds-tooltip":if(!customElements.get(n(i))){w()}break}}))}S();export{C as M,S as d};
|
|
2
|
+
//# sourceMappingURL=p-DpA8UeSy.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as o,h as s,a,t as n}from"./index.js";import{d as l}from"./p-C942uiH1.js";import{d as i}from"./p-0XTyQNRG.js";import{d as r}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as t,H as e,c as o,h as s,a,t as n}from"./index.js";import{d as l}from"./p-C942uiH1.js";import{d as i}from"./p-0XTyQNRG.js";import{d as r}from"./p-DcwgXLe-.js";const c=()=>`@media (forced-colors: active){.sc-ds-agent-tool-call:root,.sc-ds-agent-tool-call-h,.ds-forced-colors-scope.sc-ds-agent-tool-call{--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-agent-tool-call-h{display:block;min-width:0}.agent-tool.sc-ds-agent-tool-call{min-width:0;color:var(--color-foreground-secondary)}details.sc-ds-agent-tool-call{margin:0}summary.sc-ds-agent-tool-call,.agent-tool__row.sc-ds-agent-tool-call{min-width:0;padding:var(--dimension-space-050) 0}summary.sc-ds-agent-tool-call{cursor:pointer;list-style:none}summary.sc-ds-agent-tool-call::-webkit-details-marker{display:none}.agent-tool__summary-content.sc-ds-agent-tool-call{display:grid;align-items:center;grid-template-columns:auto minmax(0, 1fr) auto;gap:var(--dimension-space-075);min-width:0}.agent-tool__status-icon.sc-ds-agent-tool-call{display:flex;align-items:center;color:var(--color-foreground-faint-neutral)}.agent-tool--preparing.sc-ds-agent-tool-call .agent-tool__status-icon.sc-ds-agent-tool-call,.agent-tool--queued.sc-ds-agent-tool-call .agent-tool__status-icon.sc-ds-agent-tool-call,.agent-tool--running.sc-ds-agent-tool-call .agent-tool__status-icon.sc-ds-agent-tool-call{color:var(--color-foreground-faint-brand)}.agent-tool--waiting-for-user.sc-ds-agent-tool-call .agent-tool__status-icon.sc-ds-agent-tool-call{color:var(--color-foreground-bold-warning)}.agent-tool--error.sc-ds-agent-tool-call .agent-tool__status-icon.sc-ds-agent-tool-call,.agent-tool--denied.sc-ds-agent-tool-call .agent-tool__status-icon.sc-ds-agent-tool-call{color:var(--color-foreground-bold-negative)}.agent-tool__title.sc-ds-agent-tool-call{display:flex;align-items:baseline;flex-wrap:wrap;gap:var(--dimension-space-025) var(--dimension-space-075);min-width:0;overflow-wrap:anywhere}.agent-tool__chevron.sc-ds-agent-tool-call{transition:none}details[open].sc-ds-agent-tool-call .agent-tool__chevron.sc-ds-agent-tool-call{transform:rotate(90deg)}.agent-tool__details.sc-ds-agent-tool-call,.agent-tool__diagnostics.sc-ds-agent-tool-call{display:grid;gap:var(--dimension-space-075)}.agent-tool__details.sc-ds-agent-tool-call{padding:var(--dimension-space-050) 0 var(--dimension-space-100) calc(var(--dimension-size-200) + var(--dimension-space-075))}.agent-tool__diagnostics.sc-ds-agent-tool-call section.sc-ds-agent-tool-call{display:grid;gap:var(--dimension-space-025)}pre.sc-ds-agent-tool-call{max-width:100%;margin:0;padding:var(--dimension-space-075);overflow:auto;border-radius:var(--dimension-radius-050);background:var(--color-background-secondary);color:var(--color-foreground-primary);font-family:var( --typography-font-family-code, 'Fira Code', ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'Roboto Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace );font-variant-ligatures:var(--ds-code-font-variant-ligatures, normal);font-weight:var(--typography-weight-regular);white-space:pre-wrap;overflow-wrap:anywhere}.agent-tool__result.sc-ds-agent-tool-call{min-width:0;padding-block:var(--dimension-space-050)}.agent-tool__result--plain-text.sc-ds-agent-tool-call{font-family:var(--typography-font-family-ui);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative-half)}summary.sc-ds-agent-tool-call:focus-visible{border-radius:var(--dimension-radius-025);outline:var(--dimension-stroke-width-025) solid var(--color-border-bold-brand);outline-offset:var(--dimension-space-025)}@media (prefers-reduced-motion: no-preference){.agent-tool__chevron.sc-ds-agent-tool-call{transition:transform var(--effect-motion-short-2)}}@media (forced-colors: active){summary.sc-ds-agent-tool-call:focus-visible{outline-color:var(--ds-forced-color-selected)}.agent-tool--error.sc-ds-agent-tool-call .agent-tool__summary-content.sc-ds-agent-tool-call,.agent-tool--denied.sc-ds-agent-tool-call .agent-tool__summary-content.sc-ds-agent-tool-call{border-inline-start:var(--dimension-stroke-width-025) solid var(--ds-forced-color-content);padding-inline-start:var(--dimension-space-050)}}`;const d={preparing:"Preparing",queued:"Queued",running:"Running","waiting-for-user":"Waiting for your response",success:"Completed",error:"Failed",denied:"Permission denied",canceled:"Canceled"};const g=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.dsOpenChange=o(this,"dsOpenChange",7);this.name="";this.label="";this.state="queued";this.open=false;this.hasSummary=false;this.hasResult=false;this.hasPlainTextResult=false;this.hasDetails=false;this.hasLoaded=false;this.handleToggle=t=>{this.dsOpenChange.emit({open:t.currentTarget.open})}}componentWillLoad(){this.syncSlots()}connectedCallback(){if(this.hasLoaded)this.observeSlots()}componentDidLoad(){this.hasLoaded=true;this.observeSlots()}observeSlots(){if(!this.el.isConnected)return;this.slotObserver?.disconnect();this.syncSlots();this.slotObserver=new MutationObserver((()=>{if(this.el.isConnected)this.syncSlots()}));this.slotObserver.observe(this.el,{childList:true,subtree:true,characterData:true,attributes:true,attributeFilter:["slot"]})}disconnectedCallback(){this.slotObserver?.disconnect();this.slotObserver=undefined}syncSlots(){this.hasSummary=Boolean(this.el.querySelector('[slot="summary"]'));const t=this.el.querySelector('[slot="result"]');this.hasResult=Boolean(t);this.hasPlainTextResult=Boolean(t&&t.childElementCount===0&&t.textContent?.trim());this.hasDetails=Boolean(this.el.querySelector('[slot="details"]'))}serialize(t){if(t===undefined)return"";if(typeof t==="string")return t;try{return JSON.stringify(t,null,2)}catch{return String(t)}}get active(){return["preparing","queued","running"].includes(this.state)}get expandable(){return this.hasDetails||this.input!==undefined||this.output!==undefined||Boolean(this.error)}renderStatusIcon(){if(this.active)return s("ds-loader",{size:"xs",color:"inherit"});if(this.state==="success"){return s("ds-icon",{name:"Check",size:"xs",color:"inherit"})}if(this.state==="waiting-for-user"){return s("ds-icon",{name:"Clock",size:"xs",color:"inherit"})}return s("ds-icon",{name:"ExclamationTriangle",size:"xs",color:"inherit"})}renderSummary(t){return s("span",{class:"agent-tool__summary-content"},s("span",{class:"agent-tool__status-icon","aria-hidden":"true"},this.renderStatusIcon()),s("span",{class:"agent-tool__title"},this.hasSummary?s("slot",{name:"summary"}):s("ds-text",{as:"span",variant:"text-body-small",emphasis:true},this.label||this.name),s("ds-text",{class:"agent-tool__state-label",as:"span",variant:"text-caption",color:["error","denied"].includes(this.state)?"negative":"secondary"},this.statusLabel??d[this.state])),t?s("ds-icon",{class:"agent-tool__chevron",name:"ChevronRight",size:"xs",color:"inherit"}):null)}renderGenericDetails(){return s("div",{class:"agent-tool__diagnostics"},this.input!==undefined?s("section",null,s("ds-text",{variant:"text-caption",emphasis:true},"Input"),s("pre",null,this.serialize(this.input))):null,this.output!==undefined?s("section",null,s("ds-text",{variant:"text-caption",emphasis:true},"Output"),s("pre",null,this.serialize(this.output))):null,this.error?s("section",null,s("ds-text",{variant:"text-caption",emphasis:true},"Error"),s("pre",null,this.error)):null)}render(){const t=this.expandable;return s(a,{key:"3c885b02a6941b63b2ef39f47ada39180860d51b"},s("div",{key:"ca65ef6d6693811a4054c4186bc2e2a7c1fcadc7",class:`agent-tool agent-tool--${this.state}`},t?s("details",{open:this.open,onToggle:this.handleToggle},s("summary",null,this.renderSummary(true)),s("div",{class:"agent-tool__details"},this.hasDetails?s("slot",{name:"details"}):this.renderGenericDetails())):s("div",{class:"agent-tool__row"},this.renderSummary(false)),this.hasResult?s("div",{class:{"agent-tool__result":true,"agent-tool__result--plain-text":this.hasPlainTextResult}},s("slot",{name:"result"})):null))}get el(){return this}static get style(){return c()}},[262,"ds-agent-tool-call",{name:[1],label:[1],state:[1],statusLabel:[1,"status-label"],input:[16],output:[16],error:[1],open:[4],hasSummary:[32],hasResult:[32],hasPlainTextResult:[32],hasDetails:[32]}]);function u(){if(typeof customElements==="undefined"){return}const t=["ds-agent-tool-call","ds-icon","ds-loader","ds-text"];t.forEach((t=>{switch(t){case"ds-agent-tool-call":if(!customElements.get(n(t))){customElements.define(n(t),g)}break;case"ds-icon":if(!customElements.get(n(t))){l()}break;case"ds-loader":if(!customElements.get(n(t))){i()}break;case"ds-text":if(!customElements.get(n(t))){r()}break}}))}u();export{g as A,u as d};
|
|
2
|
+
//# sourceMappingURL=p-DtNCj4p0.js.map
|