@devschile/chucao 2.7.0 → 2.8.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/chucao/chucao.esm.js +1 -1
- package/dist/chucao/{p-10109256.entry.js → p-0831c6f2.entry.js} +2 -2
- package/dist/chucao/p-0d7fc720.entry.js +2 -0
- package/dist/chucao/{p-62e762f7.entry.js.map → p-0d7fc720.entry.js.map} +1 -1
- package/dist/chucao/{p-999dba28.entry.js → p-19d90f87.entry.js} +2 -2
- package/dist/chucao/{p-afe45116.entry.js → p-25f4f815.entry.js} +2 -2
- package/dist/chucao/{p-14184080.entry.js → p-3e0d7585.entry.js} +2 -2
- package/dist/chucao/{p-afacd489.entry.js → p-46dae34b.entry.js} +2 -2
- package/dist/chucao/{p-d1e9f563.entry.js → p-5093c486.entry.js} +2 -2
- package/dist/chucao/{p-337d7f68.entry.js → p-51f6327c.entry.js} +2 -2
- package/dist/chucao/{p-bf036509.entry.js → p-5577e0a0.entry.js} +2 -2
- package/dist/chucao/{p-339e3c30.entry.js → p-56e41372.entry.js} +2 -2
- package/dist/chucao/{p-a84d4493.entry.js → p-6c2e5931.entry.js} +2 -2
- package/dist/chucao/{p-1e8d921d.entry.js → p-6e93c392.entry.js} +2 -2
- package/dist/chucao/{p-93f25dd5.entry.js → p-7f99ae48.entry.js} +2 -2
- package/dist/chucao/p-8b09ad3c.entry.js +2 -0
- package/dist/chucao/p-8b09ad3c.entry.js.map +1 -0
- package/dist/chucao/{p-e2fe7c5d.entry.js → p-8fcf6d36.entry.js} +2 -2
- package/dist/chucao/{p-CIV5Gg1o.js → p-8l_6qAY9.js} +3 -3
- package/dist/chucao/p-8l_6qAY9.js.map +1 -0
- package/dist/chucao/{p-d2077ae4.entry.js → p-920d5727.entry.js} +2 -2
- package/dist/chucao/{p-1852dfdb.entry.js → p-ad41da02.entry.js} +2 -2
- package/dist/chucao/p-af088ffd.entry.js +2 -0
- package/dist/chucao/p-af088ffd.entry.js.map +1 -0
- package/dist/chucao/{p-08d90a3d.entry.js → p-b42ec9bf.entry.js} +2 -2
- package/dist/chucao/{p-36c59ad1.entry.js → p-b80c39c3.entry.js} +2 -2
- package/dist/chucao/{p-507d4b69.entry.js → p-ba589c2f.entry.js} +2 -2
- package/dist/chucao/{p-39815ee2.entry.js → p-c4d68ab7.entry.js} +2 -2
- package/dist/chucao/{p-3e6614ee.entry.js → p-c98e2a50.entry.js} +2 -2
- package/dist/chucao/{p-4c8838a0.entry.js → p-ca3179ae.entry.js} +2 -2
- package/dist/chucao/{p-3f9894a4.entry.js → p-d630f662.entry.js} +2 -2
- package/dist/chucao/{p-4cda7f71.entry.js → p-d868bdbc.entry.js} +2 -2
- package/dist/chucao/{p-f17b186f.entry.js → p-e6b7b2da.entry.js} +2 -2
- package/dist/chucao/p-eb39b9c2.entry.js +2 -0
- package/dist/chucao/p-eb39b9c2.entry.js.map +1 -0
- package/dist/chucao/p-f0c288db.entry.js +2 -0
- package/dist/chucao/p-f0c288db.entry.js.map +1 -0
- package/dist/cjs/ch-accordion.cjs.entry.js +2 -2
- package/dist/cjs/ch-alert_8.cjs.entry.js +8 -8
- package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ch-cluster.cjs.entry.js +3 -3
- package/dist/cjs/ch-confirm-dialog.cjs.entry.js +138 -0
- package/dist/cjs/ch-confirm-dialog.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-description-list.cjs.entry.js +2 -2
- package/dist/cjs/ch-divider.cjs.entry.js +2 -2
- package/dist/cjs/ch-drawer.cjs.entry.js +2 -2
- package/dist/cjs/ch-emoji.cjs.entry.js +2 -2
- package/dist/cjs/ch-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/ch-grid.cjs.entry.js +2 -2
- package/dist/cjs/ch-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/ch-icon.cjs.entry.js +2 -2
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +2 -2
- package/dist/cjs/ch-number-input.cjs.entry.js +3 -3
- package/dist/cjs/ch-otp-input.cjs.entry.js +196 -0
- package/dist/cjs/ch-otp-input.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-page-header.cjs.entry.js +2 -2
- package/dist/cjs/ch-pagination.cjs.entry.js +67 -0
- package/dist/cjs/ch-pagination.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-radio.cjs.entry.js +2 -2
- package/dist/cjs/ch-segmented-control.cjs.entry.js +2 -2
- package/dist/cjs/ch-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ch-stack.cjs.entry.js +2 -2
- package/dist/cjs/ch-stat.cjs.entry.js +3 -3
- package/dist/cjs/ch-table.cjs.entry.js +2 -2
- package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ch-timeline.cjs.entry.js +2 -2
- package/dist/cjs/ch-tooltip.cjs.entry.js +25 -8
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/chucao.cjs.js +2 -2
- package/dist/cjs/{index-ByZY6aTj.js → index-C6khqyw3.js} +19 -2
- package/dist/cjs/index-C6khqyw3.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/ch-accordion/ch-accordion.js +1 -1
- package/dist/collection/components/ch-alert/ch-alert.js +1 -1
- package/dist/collection/components/ch-badge/ch-badge.js +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
- package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.css +71 -0
- package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.js +382 -0
- package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.js.map +1 -0
- package/dist/collection/components/ch-description-list/ch-description-list.js +1 -1
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
- package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
- package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
- package/dist/collection/components/ch-grid/ch-grid.js +1 -1
- package/dist/collection/components/ch-icon/ch-icon.js +1 -1
- package/dist/collection/components/ch-icon-button/ch-icon-button.js +1 -1
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +1 -1
- package/dist/collection/components/ch-number-input/ch-number-input.js +2 -2
- package/dist/collection/components/ch-otp-input/ch-otp-input.css +86 -0
- package/dist/collection/components/ch-otp-input/ch-otp-input.js +478 -0
- package/dist/collection/components/ch-otp-input/ch-otp-input.js.map +1 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js +1 -1
- package/dist/collection/components/ch-pagination/ch-pagination.css +63 -0
- package/dist/collection/components/ch-pagination/ch-pagination.js +228 -0
- package/dist/collection/components/ch-pagination/ch-pagination.js.map +1 -0
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- package/dist/collection/components/ch-stack/ch-stack.js +1 -1
- package/dist/collection/components/ch-stat/ch-stat.js +2 -2
- package/dist/collection/components/ch-switch/ch-switch.js +1 -1
- package/dist/collection/components/ch-table/ch-table.js +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
- package/dist/collection/components/ch-timeline/ch-timeline.js +1 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.css +11 -0
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +23 -6
- package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
- package/dist/collection/utils/overlay.js.map +1 -1
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-cluster.js +1 -1
- package/dist/components/ch-confirm-dialog.d.ts +11 -0
- package/dist/components/ch-confirm-dialog.js +2 -0
- package/dist/components/ch-confirm-dialog.js.map +1 -0
- package/dist/components/ch-description-list.js +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-drawer.js +1 -1
- package/dist/components/ch-emoji.js +1 -1
- package/dist/components/ch-empty-state.js +1 -1
- package/dist/components/ch-grid.js +1 -1
- package/dist/components/ch-icon-button.js +1 -1
- package/dist/components/ch-icon.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-modal.js.map +1 -1
- package/dist/components/ch-number-input.js +1 -1
- package/dist/components/ch-otp-input.d.ts +11 -0
- package/dist/components/ch-otp-input.js +2 -0
- package/dist/components/ch-otp-input.js.map +1 -0
- package/dist/components/ch-page-header.js +1 -1
- package/dist/components/ch-pagination.d.ts +11 -0
- package/dist/components/ch-pagination.js +2 -0
- package/dist/components/ch-pagination.js.map +1 -0
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-segmented-control.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-skeleton.js +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-stack.js +1 -1
- package/dist/components/ch-stat.js +1 -1
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-table.js +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-timeline.js +1 -1
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/ch-tooltip.js.map +1 -1
- package/dist/components/{p-CuczWSQU.js → p-CF1yV0aa.js} +2 -2
- package/dist/components/p-CmMN-UuJ.js +2 -0
- package/dist/components/p-CmMN-UuJ.js.map +1 -0
- package/dist/components/p-qP_9qshx.js.map +1 -1
- package/dist/esm/ch-accordion.entry.js +2 -2
- package/dist/esm/ch-alert_8.entry.js +8 -8
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-cluster.entry.js +3 -3
- package/dist/esm/ch-confirm-dialog.entry.js +136 -0
- package/dist/esm/ch-confirm-dialog.entry.js.map +1 -0
- package/dist/esm/ch-description-list.entry.js +2 -2
- package/dist/esm/ch-divider.entry.js +2 -2
- package/dist/esm/ch-drawer.entry.js +2 -2
- package/dist/esm/ch-emoji.entry.js +2 -2
- package/dist/esm/ch-empty-state.entry.js +2 -2
- package/dist/esm/ch-grid.entry.js +2 -2
- package/dist/esm/ch-icon-button.entry.js +2 -2
- package/dist/esm/ch-icon.entry.js +2 -2
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +2 -2
- package/dist/esm/ch-number-input.entry.js +3 -3
- package/dist/esm/ch-otp-input.entry.js +194 -0
- package/dist/esm/ch-otp-input.entry.js.map +1 -0
- package/dist/esm/ch-page-header.entry.js +2 -2
- package/dist/esm/ch-pagination.entry.js +65 -0
- package/dist/esm/ch-pagination.entry.js.map +1 -0
- package/dist/esm/ch-radio.entry.js +2 -2
- package/dist/esm/ch-segmented-control.entry.js +2 -2
- package/dist/esm/ch-skeleton.entry.js +2 -2
- package/dist/esm/ch-stack.entry.js +2 -2
- package/dist/esm/ch-stat.entry.js +3 -3
- package/dist/esm/ch-table.entry.js +2 -2
- package/dist/esm/ch-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +2 -2
- package/dist/esm/ch-timeline.entry.js +2 -2
- package/dist/esm/ch-tooltip.entry.js +25 -8
- package/dist/esm/ch-tooltip.entry.js.map +1 -1
- package/dist/esm/chucao.js +3 -3
- package/dist/esm/{index-CIV5Gg1o.js → index-8l_6qAY9.js} +19 -2
- package/dist/esm/index-8l_6qAY9.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-confirm-dialog/ch-confirm-dialog.d.ts +81 -0
- package/dist/types/components/ch-otp-input/ch-otp-input.d.ts +79 -0
- package/dist/types/components/ch-pagination/ch-pagination.d.ts +44 -0
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +7 -0
- package/dist/types/components.d.ts +548 -0
- package/dist/types/utils/overlay.d.ts +1 -1
- package/dist-react/components.d.ts +21 -1
- package/dist-react/components.js +33 -0
- package/dist-react/components.ts +49 -1
- package/dist-vue/index.d.ts +3 -0
- package/dist-vue/index.js +48 -0
- package/dist-vue/index.ts +54 -0
- package/hydrate/index.js +540 -40
- package/hydrate/index.mjs +540 -40
- package/package.json +13 -1
- package/dist/chucao/p-5c253fa0.entry.js +0 -2
- package/dist/chucao/p-5c253fa0.entry.js.map +0 -1
- package/dist/chucao/p-62e762f7.entry.js +0 -2
- package/dist/chucao/p-CIV5Gg1o.js.map +0 -1
- package/dist/cjs/index-ByZY6aTj.js.map +0 -1
- package/dist/esm/index-CIV5Gg1o.js.map +0 -1
- /package/dist/chucao/{p-10109256.entry.js.map → p-0831c6f2.entry.js.map} +0 -0
- /package/dist/chucao/{p-999dba28.entry.js.map → p-19d90f87.entry.js.map} +0 -0
- /package/dist/chucao/{p-afe45116.entry.js.map → p-25f4f815.entry.js.map} +0 -0
- /package/dist/chucao/{p-14184080.entry.js.map → p-3e0d7585.entry.js.map} +0 -0
- /package/dist/chucao/{p-afacd489.entry.js.map → p-46dae34b.entry.js.map} +0 -0
- /package/dist/chucao/{p-d1e9f563.entry.js.map → p-5093c486.entry.js.map} +0 -0
- /package/dist/chucao/{p-337d7f68.entry.js.map → p-51f6327c.entry.js.map} +0 -0
- /package/dist/chucao/{p-bf036509.entry.js.map → p-5577e0a0.entry.js.map} +0 -0
- /package/dist/chucao/{p-339e3c30.entry.js.map → p-56e41372.entry.js.map} +0 -0
- /package/dist/chucao/{p-a84d4493.entry.js.map → p-6c2e5931.entry.js.map} +0 -0
- /package/dist/chucao/{p-1e8d921d.entry.js.map → p-6e93c392.entry.js.map} +0 -0
- /package/dist/chucao/{p-93f25dd5.entry.js.map → p-7f99ae48.entry.js.map} +0 -0
- /package/dist/chucao/{p-e2fe7c5d.entry.js.map → p-8fcf6d36.entry.js.map} +0 -0
- /package/dist/chucao/{p-d2077ae4.entry.js.map → p-920d5727.entry.js.map} +0 -0
- /package/dist/chucao/{p-1852dfdb.entry.js.map → p-ad41da02.entry.js.map} +0 -0
- /package/dist/chucao/{p-08d90a3d.entry.js.map → p-b42ec9bf.entry.js.map} +0 -0
- /package/dist/chucao/{p-36c59ad1.entry.js.map → p-b80c39c3.entry.js.map} +0 -0
- /package/dist/chucao/{p-507d4b69.entry.js.map → p-ba589c2f.entry.js.map} +0 -0
- /package/dist/chucao/{p-39815ee2.entry.js.map → p-c4d68ab7.entry.js.map} +0 -0
- /package/dist/chucao/{p-3e6614ee.entry.js.map → p-c98e2a50.entry.js.map} +0 -0
- /package/dist/chucao/{p-4c8838a0.entry.js.map → p-ca3179ae.entry.js.map} +0 -0
- /package/dist/chucao/{p-3f9894a4.entry.js.map → p-d630f662.entry.js.map} +0 -0
- /package/dist/chucao/{p-4cda7f71.entry.js.map → p-d868bdbc.entry.js.map} +0 -0
- /package/dist/chucao/{p-f17b186f.entry.js.map → p-e6b7b2da.entry.js.map} +0 -0
- /package/dist/components/{p-CuczWSQU.js.map → p-CF1yV0aa.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as a,h as t,H as e}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as a,h as t,H as e}from"./p-8l_6qAY9.js";const s=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-primary)}:host([hidden]){display:none}.stat__inner{display:flex;flex-direction:column;gap:var(--spacing-2xs);padding:var(--spacing-md) var(--spacing-lg);border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.stat__label{font-size:var(--typography-size-xs);font-weight:var(--typography-weight-semibold);letter-spacing:0.06em;text-transform:uppercase;color:var(--color-text-secondary)}.stat__value{font-family:var(--typography-heading);font-size:var(--typography-size-xl);font-weight:var(--typography-weight-bold);font-variant-numeric:tabular-nums;display:flex;align-items:baseline;gap:var(--spacing-2xs)}.stat__cue{font-size:var(--typography-size-md)}.stat__value--positive{color:var(--color-status-positive)}.stat__value--negative{color:var(--color-status-negative)}.stat__value--unavailable{color:var(--color-text-tertiary);font-style:italic}.stat__hint{font-size:var(--typography-size-sm);color:var(--color-text-secondary)}.stat__footer:empty{display:none}.stat__footer{margin-top:var(--spacing-2xs)}`;const r=new Set(["default","positive","negative","unavailable"]);const o=class{constructor(t){a(this,t)}label;value;hint;tone="default";get toneClass(){return r.has(this.tone)?this.tone:"default"}render(){const a=this.toneClass==="positive"?"+":this.toneClass==="negative"?"−":null;return t(e,{key:"79553724e7efce617f793913fc4b65301d8e4214",class:"stat"},t("div",{key:"1d24c5b7fce578242c2464914beddd7c0bc0ac1b",class:"stat__inner"},t("span",{key:"37bbb5ebf996a2f460d817ffc546bf37100a4c7f",class:"stat__label"},this.label),t("span",{key:"a1e5ff57b56f04fcc31b31d04ad6e8fae4ab75e3",class:{stat__value:true,[`stat__value--${this.toneClass}`]:this.toneClass!=="default"}},a&&t("span",{key:"9a35c34c366d66f3712f9c22cacefe48e550a08f",class:"stat__cue","aria-hidden":"true"},a),t("slot",{key:"cbf547c8ec13a675cd694e39016b7a702fac41a5",name:"value"},this.value)),this.hint&&t("span",{key:"ceaa61ab32fd4b607fe40f96a4ded7588098c98b",class:"stat__hint"},this.hint),t("div",{key:"67352638ded6243693a9698105b9d330466ccc3b",class:"stat__footer"},t("slot",{key:"8d8e59eae68d8d7153a57ec33a8185483e79b8f3",name:"footer"}))))}};o.style=s();export{o as ch_stat};
|
|
2
|
+
//# sourceMappingURL=p-920d5727.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as e,H as s}from"./p-8l_6qAY9.js";const a=()=>`:host{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;box-sizing:border-box}:host([hidden]){display:none}.cluster--nowrap{flex-wrap:nowrap}.cluster--gap-none{gap:0}.cluster--gap-2xs{gap:var(--spacing-2xs)}.cluster--gap-xs{gap:var(--spacing-xs)}.cluster--gap-sm{gap:var(--spacing-sm)}.cluster--gap-md{gap:var(--spacing-md)}.cluster--gap-lg{gap:var(--spacing-lg)}.cluster--gap-xl{gap:var(--spacing-xl)}.cluster--gap-2xl{gap:var(--spacing-2xl)}.cluster--gap-3xl{gap:var(--spacing-3xl)}.cluster--gap-4xl{gap:var(--spacing-4xl)}.cluster--gap-5xl{gap:var(--spacing-5xl)}.cluster--gap-6xl{gap:var(--spacing-6xl)}.cluster--align-stretch{align-items:stretch}.cluster--align-start{align-items:flex-start}.cluster--align-center{align-items:center}.cluster--align-end{align-items:flex-end}.cluster--align-baseline{align-items:baseline}.cluster--justify-start{justify-content:flex-start}.cluster--justify-center{justify-content:center}.cluster--justify-end{justify-content:flex-end}.cluster--justify-between{justify-content:space-between}.cluster--justify-around{justify-content:space-around}`;const r=new Set(["none","2xs","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"]);const l=class{constructor(e){t(this,e)}gap="md";align="center";justify="start";wrap=true;get gapStep(){return r.has(this.gap)?this.gap:"md"}render(){return e(s,{key:"d1852bc490835eb559f31039e14b87d59b151b11",class:{cluster:true,[`cluster--gap-${this.gapStep}`]:true,[`cluster--align-${this.align}`]:true,[`cluster--justify-${this.justify}`]:true,"cluster--nowrap":!this.wrap}},e("slot",{key:"7dc3c83e40d8e0d5dd18052bb9c36898a443ce23"}))}};l.style=a();export{l as ch_cluster};
|
|
2
|
+
//# sourceMappingURL=p-ad41da02.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as i,a as s,h as e,H as r}from"./p-8l_6qAY9.js";import{r as a}from"./p-BXzZsX2r.js";const o=()=>`:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.input{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input::placeholder{color:var(--text-muted)}.input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus,:host(:user-invalid) .input:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.input:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}.input{font-family:var(--typography-heading);font-size:var(--typography-size-lg);letter-spacing:0.4em;text-align:center;font-variant-numeric:tabular-nums}`;let n=0;const h=class{constructor(s){t(this,s);this.chInput=i(this,"chInput");this.chComplete=i(this,"chComplete");if(s.$hostElement$["s-ei"]){this.internals=s.$hostElement$["s-ei"]}else{this.internals=s.$hostElement$.attachInternals();s.$hostElement$["s-ei"]=this.internals}}inputId=`ch-otp-input-${++n}`;hintId=`${this.inputId}-hint`;errorId=`${this.inputId}-error`;initialValue="";internals;formDisabled=false;get host(){return s(this)}label;value="";length=6;inputMode="numeric";secret=false;placeholder;name;disabled=false;required=false;hint;errorMessage;invalid=false;chInput;chComplete;wasComplete=false;componentDidLoad(){this.initialValue=this.value;this.wasComplete=this.isComplete;this.syncForm();this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","");this.syncForm()};get isComplete(){if(this.value.length!==this.length){return false}return this.inputMode==="numeric"?/^\d+$/u.test(this.value):/^[a-z0-9]+$/iu.test(this.value)}get incompleteMessage(){if(this.errorMessage||this.invalid||this.value===""){return undefined}return this.isComplete?undefined:`Enter the ${this.length}-character code.`}syncForm(){const t=this.internals;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(this.value);const i=this.value==="";const s=a({required:this.required,empty:i,invalid:this.invalid,errorMessage:this.errorMessage});const e=this.host.hasAttribute("data-touched");const r=this.incompleteMessage;if(r&&e&&!i){t.setValidity({...s.flags,customError:true},r);return}t.setValidity(s.flags,s.message)}formResetCallback(){this.value=this.initialValue;this.wasComplete=this.isComplete;this.syncForm();const t=this.host.shadowRoot?.querySelector("input");if(t){t.value=this.value}}formDisabledCallback(t){this.formDisabled=t}sanitize(t){const i=this.inputMode==="numeric"?t.replace(/\D/gu,""):t.replace(/[^a-z0-9]/giu,"");return i.slice(0,Math.max(1,this.length))}handleInput=t=>{const i=t.target;const s=this.sanitize(i.value);if(i.value!==s){i.value=s}this.value=s;this.chInput.emit(s);const e=this.isComplete;if(e&&!this.wasComplete){this.chComplete.emit(s)}this.wasComplete=e;this.syncForm()};handleBlur=()=>{this.syncForm()};get isInvalid(){return this.invalid||this.host.hasAttribute("data-touched")&&this.incompleteMessage!==undefined}get describedBy(){if(this.isInvalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){const t=this.isInvalid&&this.errorMessage;return e(r,{key:"addfb3ad7a6a5fabefe89dd5cde1d4e5b79d7c7c"},this.label&&e("label",{key:"e2ad53ac281a2334712d04ff6e09070616a38e7f",class:"label",htmlFor:this.inputId},this.label),e("input",{key:"4ea2123ba313a2626105346db50af219f5542de3",id:this.label?this.inputId:undefined,class:{input:true,"input--invalid":this.isInvalid},type:this.secret?"password":"text",inputMode:this.inputMode,autocomplete:"one-time-code",autocapitalize:this.inputMode==="text"?"characters":"off",spellcheck:false,name:this.name,placeholder:this.placeholder,maxLength:this.length,disabled:this.disabled||this.formDisabled,required:this.required,value:this.value,"aria-invalid":this.isInvalid?"true":undefined,"aria-describedby":this.describedBy,onInput:this.handleInput,onBlur:this.handleBlur}),this.hint&&!t&&e("p",{key:"6ecfc85e27b82b2afe94f66959e3f5cb99708189",class:"hint",id:this.hintId},this.hint),t&&e("p",{key:"9b429bcea9bfb40c9583778dcdc4e8f64a84b552",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}],length:[{syncForm:0}],inputMode:[{syncForm:0}]}}};h.style=o();export{h as ch_otp_input};
|
|
2
|
+
//# sourceMappingURL=p-af088ffd.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["chOtpInputCss","otpIds","ChOtpInput","inputId","hintId","this","errorId","initialValue","internals","formDisabled","label","value","length","inputMode","secret","placeholder","name","disabled","required","hint","errorMessage","invalid","chInput","chComplete","wasComplete","componentDidLoad","isComplete","syncForm","host","addEventListener","markTouched","setAttribute","test","incompleteMessage","undefined","setFormValue","empty","base","resolveValidity","touched","hasAttribute","incomplete","setValidity","flags","customError","message","formResetCallback","input","shadowRoot","querySelector","formDisabledCallback","isDisabled","sanitize","raw","allowed","replace","slice","Math","max","handleInput","ev","target","clean","emit","complete","handleBlur","isInvalid","describedBy","render","showError","h","Host","key","class","htmlFor","id","type","autocomplete","autocapitalize","spellcheck","maxLength","onInput","onBlur","role"],"sources":["src/components/ch-otp-input/ch-otp-input.css?tag=ch-otp-input&encapsulation=shadow","src/components/ch-otp-input/ch-otp-input.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: 100%;\n}\n\n.label {\n display: block;\n margin-bottom: var(--spacing-sm);\n font-size: var(--typography-size-sm);\n font-weight: var(--typography-weight-semibold);\n color: var(--text);\n}\n\n.input {\n box-sizing: border-box;\n width: 100%;\n padding: var(--spacing-xl) var(--spacing-3xl);\n border-radius: var(--radius);\n border: var(--border-width) solid var(--border);\n background: var(--surface);\n color: var(--text);\n backdrop-filter: blur(var(--effect-blur));\n font-family: inherit;\n font-size: inherit;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.input::placeholder {\n color: var(--text-muted);\n}\n\n.input:focus {\n border-color: var(--accent);\n box-shadow: var(--shadow-focus-ring);\n outline: none;\n}\n\n.input--invalid {\n border-color: var(--color-status-warning);\n}\n\n.input--invalid:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n:host([data-touched]:invalid) .input,\n:host(:user-invalid) .input {\n border-color: var(--color-status-warning);\n}\n\n:host([data-touched]:invalid) .input:focus,\n:host(:user-invalid) .input:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n.input:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.hint,\n.error {\n margin: var(--spacing-sm) 0 0;\n font-size: var(--typography-size-sm);\n color: var(--text-muted);\n}\n\n.error {\n color: var(--color-status-warning);\n}\n\n/*\n * One field, segmented by letter-spacing rather than by separate boxes: the\n * value stays a single string the platform can autofill and people can paste.\n */\n.input {\n font-family: var(--typography-heading);\n font-size: var(--typography-size-lg);\n letter-spacing: 0.4em;\n text-align: center;\n font-variant-numeric: tabular-nums;\n}\n","import { AttachInternals, Component, Element, Event, type EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\n\nimport { resolveValidity } from '../../utils/validation-message';\n\nlet otpIds = 0;\n\n/**\n * One-time-code input.\n *\n * One native `<input>` holds the whole code, not a box per digit. Per-digit\n * inputs break paste, break SMS autofill (the platform fills a single field\n * carrying `autocomplete=\"one-time-code\"`), and give a keyboard user several\n * tab stops for what is one value. The segmented look is drawn by the shadow\n * CSS over the single field.\n *\n * It never submits on completion: a code entered is not a decision to send it,\n * so the consumer listens to `chComplete` and submits when it decides to.\n */\n@Component({\n tag: 'ch-otp-input',\n styleUrl: 'ch-otp-input.css',\n shadow: true,\n formAssociated: true,\n})\nexport class ChOtpInput {\n private readonly inputId = `ch-otp-input-${++otpIds}`;\n private readonly hintId = `${this.inputId}-hint`;\n private readonly errorId = `${this.inputId}-error`;\n private initialValue = '';\n\n @AttachInternals() internals!: ElementInternals;\n @State() formDisabled = false;\n @Element() private host!: HTMLElement;\n\n /** Visible label, associated with the input via `for`/`id`. */\n @Prop() label?: string;\n\n /** The code without separators. Filtered to alphanumerics on every change. */\n @Prop({ mutable: true }) value = '';\n\n /** How many characters make a complete code. */\n @Prop() length = 6;\n\n /**\n * `numeric` restricts input to digits, which is the shape of nearly every\n * one-time code and lets a phone open the number pad.\n */\n @Prop() inputMode: 'numeric' | 'text' = 'numeric';\n\n /** Whether the codes are masked, as for a short-lived secret. */\n @Prop() secret = false;\n\n /** Placeholder shown when empty. */\n @Prop() placeholder?: string;\n\n /** Name submitted with the form. */\n @Prop({ reflect: true }) name?: string;\n\n /** Whether the field is disabled. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Whether a complete code is required for the field to be valid. */\n @Prop({ reflect: true }) required = false;\n\n /** Helper text, replaced by `errorMessage` when invalid. */\n @Prop() hint?: string;\n\n /** Custom error message; wins over the built-in incomplete-code message. */\n @Prop() errorMessage?: string;\n\n /** Whether the field is marked invalid by the consumer. */\n @Prop() invalid = false;\n\n /** Emitted on every change with the current (possibly partial) code. */\n @Event() chInput: EventEmitter<string>;\n\n /**\n * Emitted once, when the code becomes complete and valid after not being so.\n * Never fires again while it stays complete, so holding a code cannot\n * resubmit it.\n */\n @Event() chComplete: EventEmitter<string>;\n\n private wasComplete = false;\n\n componentDidLoad() {\n this.initialValue = this.value;\n this.wasComplete = this.isComplete;\n this.syncForm();\n this.host.addEventListener('focusout', this.markTouched);\n this.host.addEventListener('invalid', this.markTouched);\n }\n\n /**\n * Leaving the field is what turns an unfinished code into an error. The\n * validity has to be recomputed here: `syncForm` reads the attribute, and\n * setting it alone would not update `ElementInternals`.\n */\n private markTouched = (): void => {\n this.host.setAttribute('data-touched', '');\n this.syncForm();\n };\n\n /** Whether the value is a complete, correctly shaped code. */\n private get isComplete(): boolean {\n if (this.value.length !== this.length) {\n return false;\n }\n return this.inputMode === 'numeric' ? /^\\d+$/u.test(this.value) : /^[a-z0-9]+$/iu.test(this.value);\n }\n\n /** The message for an incomplete code, which is what makes it invalid. */\n private get incompleteMessage(): string | undefined {\n if (this.errorMessage || this.invalid || this.value === '') {\n return undefined;\n }\n return this.isComplete ? undefined : `Enter the ${this.length}-character code.`;\n }\n\n @Watch('value')\n @Watch('required')\n @Watch('invalid')\n @Watch('errorMessage')\n @Watch('length')\n @Watch('inputMode')\n protected syncForm(): void {\n const internals = this.internals;\n if (typeof internals?.setFormValue !== 'function') {\n return;\n }\n internals.setFormValue(this.value);\n\n const empty = this.value === '';\n const base = resolveValidity({ required: this.required, empty, invalid: this.invalid, errorMessage: this.errorMessage });\n\n // A partially typed code is what the user is doing, not an error, unless\n // they have already left the field once.\n const touched = this.host.hasAttribute('data-touched');\n const incomplete = this.incompleteMessage;\n if (incomplete && touched && !empty) {\n internals.setValidity({ ...base.flags, customError: true }, incomplete);\n return;\n }\n internals.setValidity(base.flags, base.message);\n }\n\n formResetCallback(): void {\n this.value = this.initialValue;\n this.wasComplete = this.isComplete;\n this.syncForm();\n const input = this.host.shadowRoot?.querySelector('input');\n if (input) {\n input.value = this.value;\n }\n }\n\n formDisabledCallback(isDisabled: boolean): void {\n this.formDisabled = isDisabled;\n }\n\n /** Strips everything the input mode does not allow, then caps the length. */\n private sanitize(raw: string): string {\n const allowed = this.inputMode === 'numeric' ? raw.replace(/\\D/gu, '') : raw.replace(/[^a-z0-9]/giu, '');\n return allowed.slice(0, Math.max(1, this.length));\n }\n\n private handleInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement;\n const clean = this.sanitize(input.value);\n // The element holds the raw text, so a rejected character has to be\n // written back or it stays visible while the value says otherwise.\n if (input.value !== clean) {\n input.value = clean;\n }\n this.value = clean;\n this.chInput.emit(clean);\n\n const complete = this.isComplete;\n if (complete && !this.wasComplete) {\n this.chComplete.emit(clean);\n }\n this.wasComplete = complete;\n this.syncForm();\n };\n\n private handleBlur = () => {\n this.syncForm();\n };\n\n private get isInvalid(): boolean {\n return this.invalid || (this.host.hasAttribute('data-touched') && this.incompleteMessage !== undefined);\n }\n\n private get describedBy(): string | undefined {\n if (this.isInvalid && this.errorMessage) {\n return this.errorId;\n }\n if (this.hint) {\n return this.hintId;\n }\n return undefined;\n }\n\n render() {\n const showError = this.isInvalid && this.errorMessage;\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n </label>\n )}\n <input\n id={this.label ? this.inputId : undefined}\n class={{ 'input': true, 'input--invalid': this.isInvalid }}\n type={this.secret ? 'password' : 'text'}\n inputMode={this.inputMode}\n // The platform fills a single field carrying this attribute; per-digit\n // inputs never receive the SMS code.\n autocomplete=\"one-time-code\"\n autocapitalize={this.inputMode === 'text' ? 'characters' : 'off'}\n spellcheck={false}\n name={this.name}\n placeholder={this.placeholder}\n maxLength={this.length}\n disabled={this.disabled || this.formDisabled}\n required={this.required}\n value={this.value}\n aria-invalid={this.isInvalid ? 'true' : undefined}\n aria-describedby={this.describedBy}\n onInput={this.handleInput}\n onBlur={this.handleBlur}\n />\n {this.hint && !showError && (\n <p class=\"hint\" id={this.hintId}>\n {this.hint}\n </p>\n )}\n {showError && (\n <p class=\"error\" id={this.errorId} role=\"alert\">\n {this.errorMessage}\n </p>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAgB,IAAM,giDCI5B,IAAIC,EAAS,E,MAoBAC,EAAU,M,8PACJC,QAA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AK6D,WAAa7D,KAAKe,aACzC,OACEkD,EAACC,EAAI,CAAAC,IAAA,4CACFnE,KAAKK,OACJ4D,EAAA,SAAAE,IAAA,2CAAOC,MAAM,QAAQC,QAASrE,KAAKF,SAChCE,KAAKK,OAGV4D,EAAA,SAAAE,IAAA,2CACEG,GAAItE,KAAKK,MAAQL,KAAKF,QAAU+B,UAChCuC,MAAO,CAAE1B,MAAS,KAAM,iBAAkB1C,KAAK6D,WAC/CU,KAAMvE,KAAKS,OAAS,WAAa,OACjCD,UAAWR,KAAKQ,UAGhBgE,aAAa,gBACbC,eAAgBzE,KAAKQ,YAAc,OAAS,aAAe,MAC3DkE,WAAY,MACZ/D,KAAMX,KAAKW,KACXD,YAAaV,KAAKU,YAClBiE,UAAW3E,KAAKO,OAChBK,SAAUZ,KAAKY,UAAYZ,KAAKI,aAChCS,SAAUb,KAAKa,SACfP,MAAON,KAAKM,MAAK,eACHN,KAAK6D,UAAY,OAAShC,UAAS,mBAC/B7B,KAAK8D,YACvBc,QAAS5E,KAAKsD,YACduB,OAAQ7E,KAAK4D,aAEd5D,KAAKc,OAASkD,GACbC,EAAA,KAAAE,IAAA,2CAAGC,MAAM,OAAOE,GAAItE,KAAKD,QACtBC,KAAKc,MAGTkD,GACCC,EAAA,KAAAE,IAAA,2CAAGC,MAAM,QAAQE,GAAItE,KAAKC,QAAS6E,KAAK,SACrC9E,KAAKe,c","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,a as r,h as a,H as s}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,a as r,h as a,H as s}from"./p-8l_6qAY9.js";const o=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-primary)}:host([hidden]){display:none}.table__scroll{overflow-x:auto;min-width:0;border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.table__scroll:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.table{width:100%;border-collapse:collapse;font-size:var(--typography-size-sm)}.cell{min-width:8rem}.caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.cell{padding:var(--spacing-md) var(--spacing-lg);text-align:left;vertical-align:top;border-bottom:var(--border-width) solid var(--color-border-default)}.cell--header{font-weight:var(--typography-weight-semibold);color:var(--color-text-secondary);white-space:nowrap;background:var(--color-surface-hover)}tbody tr:last-child td{border-bottom:0}.sort{all:unset;display:inline-flex;align-items:center;gap:var(--spacing-xs);cursor:pointer;border-radius:var(--radius-sm)}.sort:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.sort__cue{font-size:var(--typography-size-xs);color:var(--color-text-secondary)}.table__empty{padding:var(--spacing-2xl) var(--spacing-lg);text-align:center}.table__empty-message{margin:0;font-size:var(--typography-size-sm);color:var(--color-text-secondary)}`;let i=0;const c=class{constructor(r){e(this,r);this.chSort=t(this,"chSort")}captionId=`ch-table-${++i}-caption`;emptyId=`${this.captionId}-empty`;get host(){return r(this)}columns=[];sortable=false;sortKey;sortDirection="ascending";label;empty="unmeasured";filtered=false;chSort;onFiltered(){this.measure()}rerenderHeaders(){this.rerender=!this.rerender}rerender=false;observer;componentDidLoad(){this.measure();if(typeof MutationObserver==="function"){this.observer=new MutationObserver(this.measure);this.observer.observe(this.host,{childList:true})}}disconnectedCallback(){this.observer?.disconnect();this.observer=undefined}measure=()=>{const e=Array.from(this.host.children).filter((e=>e.tagName==="TR"));this.empty=e.length===0?"true":"none"};get emptyState(){if(this.filtered){return"filtered"}return this.empty}sortCue(e){if(!e){return"⇅"}return this.sortDirection==="ascending"?"▲":"▼"}emptyMessage(e){return e==="filtered"?"No results for these filters.":"Nothing here yet."}nextDirection(e){if(this.sortKey!==e){return"ascending"}return this.sortDirection==="ascending"?"descending":"ascending"}handleSort=e=>{this.chSort.emit({key:e,direction:this.nextDirection(e)})};handleHeaderKeydown=(e,t)=>{if(e.key!=="Enter"&&e.key!==" "){return}e.preventDefault();this.handleSort(t)};renderHeaderCell(e){const t=this.sortable&&e.sortable!==false;if(!t){return a("th",{scope:"col",class:"cell cell--header"},e.label)}const r=this.sortKey===e.key;const s=r?this.sortDirection:"none";return a("th",{scope:"col",class:"cell cell--header","aria-sort":s},a("button",{type:"button",class:"sort",onClick:()=>this.handleSort(e.key),onKeyDown:t=>this.handleHeaderKeydown(t,e.key)},a("span",null,e.label),a("span",{class:"sort__cue","aria-hidden":"true"},this.sortCue(r))))}render(){const e=this.emptyState;return a(s,{key:"e7957ed09b624ec1fdc599f300d7b1a49668ec41",class:{table:true,"table--empty":e==="true"||e==="filtered"}},a("div",{key:"c2fe932de59ee1c557c7a10bdd5f8704b5ee1dd2",class:"table__scroll",tabIndex:0,role:"group","aria-labelledby":this.captionId},a("table",{key:"9e76c06676ef07c3c7fc46e80e78a7baba6f0c33"},a("caption",{key:"3842f79c25b143fdb6d410d985e1d456cbdde190",id:this.captionId,class:"caption"},this.label),a("thead",{key:"1116cf7fed60c9757fac4097332aa2308609cb6b"},a("tr",{key:"f8ea8e04ca4bd02a63768c93c6ce1c5b4e307792"},this.columns.map((e=>this.renderHeaderCell(e))))),a("tbody",{key:"2a2c7b18fad74c854cad9164978753ffe168219f"},a("slot",{key:"514e8c0b56e8beb8c0503723823ce8be7a588af6"})))),(e==="true"||e==="filtered")&&a("div",{key:"a64841b511490e24462b89b8007f79c662de6120",class:"table__empty",id:this.emptyId},a("slot",{key:"32bcbe36421d083883223dadaec7dbd194deab8c",name:"empty"},a("p",{key:"36a9af8b0e9cbb0dfb96d52d057c910a92fe918e",class:"table__empty-message"},this.emptyMessage(e)))))}static get watchers(){return{filtered:[{onFiltered:0}],sortKey:[{rerenderHeaders:0}],sortDirection:[{rerenderHeaders:0}],sortable:[{rerenderHeaders:0}]}}};c.style=o();export{c as ch_table};
|
|
2
|
+
//# sourceMappingURL=p-b42ec9bf.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,h as t,H as i}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,h as t,H as i}from"./p-8l_6qAY9.js";const r=()=>`:host{display:block;width:100%}:host([hidden]){display:none}:host(.skeleton--circle){width:auto;display:inline-flex}.skeleton__item{display:block;background:var(--color-surface-default);border-radius:var(--radius-sm)}.skeleton--circle .skeleton__item{border-radius:50%}.skeleton--rect .skeleton__item{border-radius:var(--radius-md)}.skeleton--animated .skeleton__item{background-image:linear-gradient(90deg, transparent 0%, var(--color-surface-hover) 50%, transparent 100%);background-size:200% 100%;background-repeat:no-repeat;animation:ch-skeleton-shimmer 1.4s ease-in-out infinite}@keyframes ch-skeleton-shimmer{from{background-position:100% 0}to{background-position:-100% 0}}@media (prefers-reduced-motion: reduce){.skeleton--animated .skeleton__item{animation:none;background-image:none}}`;const s=class{constructor(t){e(this,t)}width="100%";height="1rem";shape="line";count=1;animated=true;get items(){const e=Number(this.count);return Number.isInteger(e)&&e>=1?e:1}get sizeStyle(){if(this.shape==="circle"){return{width:this.width,height:this.width}}if(this.shape==="line"){return{width:this.width,height:this.height}}return{width:this.width,height:this.height}}render(){return t(i,{key:"4bf9bb4d0fdfb1ecff7f0a9606da0c3eaa47aca3","aria-hidden":"true",class:{skeleton:true,[`skeleton--${this.shape}`]:true,"skeleton--animated":this.animated}},Array.from({length:this.items}).map(((e,i)=>t("span",{class:"skeleton__item",style:this.sizeStyle,key:i,"data-index":String(e)}))))}};s.style=r();export{s as ch_skeleton};
|
|
2
|
+
//# sourceMappingURL=p-b80c39c3.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,a,h as s,H as i}from"./p-8l_6qAY9.js";import{r}from"./p-BXzZsX2r.js";const o=()=>`:host{display:inline-block;max-width:100%}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.segmented{display:inline-flex;align-items:stretch;max-width:100%;padding:var(--spacing-2xs);border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface)}.control{position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-pill);cursor:pointer;transition:background-color var(--duration-normal) var(--easing-default)}.control:hover:not(.control--disabled){background:var(--surface-hover)}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;margin:0;opacity:0;cursor:inherit}.input:checked~.label-text{background:var(--accent);color:var(--color-accent-text);font-weight:var(--typography-weight-semibold)}.input:focus-visible~.label-text{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.label-text{display:block;padding:var(--spacing-2xs) var(--spacing-3xl);border-radius:inherit;font-size:var(--typography-size-sm);white-space:nowrap;transition:background-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default)}.segmented--sm .label-text{padding:var(--spacing-2xs) var(--spacing-2xl);font-size:var(--typography-size-xs)}:host([data-touched]:invalid) .segmented,:host(:user-invalid) .segmented{border-color:var(--color-status-warning)}@media (prefers-reduced-motion: reduce){.control,.label-text{transition:none}}`;let n=0;const l=class{constructor(a){t(this,a);this.chChange=e(this,"chChange");if(a.$hostElement$["s-ei"]){this.internals=a.$hostElement$["s-ei"]}else{this.internals=a.$hostElement$.attachInternals();a.$hostElement$["s-ei"]=this.internals}}groupId=`ch-segmented-${++n}`;labelId=`${this.groupId}-label`;initialValue;internals;formDisabled=false;get host(){return a(this)}label;options=[];value;size="md";name;disabled=false;required=false;chChange;handleChange=t=>{this.value=t.target.value;this.chChange.emit(this.value)};syncForm(){const t=this.internals;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(this.value??null);const{flags:e,message:a}=r({required:this.required,empty:!this.value});t.setValidity(e,a)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(t){this.formDisabled=t}render(){const t=this.name||`${this.groupId}-group`;return s(i,{key:"521878f5cc2c183a1ac2c89d2fa4d1b26e58dcce"},this.label&&s("span",{key:"d87b35d855bd1185ddff983b7af098dcd867ed3a",class:"group-label",id:this.labelId},this.label),s("div",{key:"008d37b8f9c50b007d7975b8cf0ce7ba52c283a1",class:{segmented:true,[`segmented--${this.size}`]:true},role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((e=>s("label",{class:{control:true,"control--disabled":this.disabled||this.formDisabled||e.disabled}},s("input",{class:"input",type:"radio",name:t,value:e.value,checked:e.value===this.value,disabled:this.disabled||this.formDisabled||e.disabled,onChange:this.handleChange}),s("span",{class:"label-text"},e.label))))))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}]}}};l.style=o();export{l as ch_segmented_control};
|
|
2
|
+
//# sourceMappingURL=p-ba589c2f.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i,c as t,a as e,h as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as i,c as t,a as e,h as r,H as a}from"./p-8l_6qAY9.js";import{r as s}from"./p-BXzZsX2r.js";const o=()=>`:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let n=0;const c=class{constructor(e){i(this,e);this.chChange=t(this,"chChange");if(e.$hostElement$["s-ei"]){this.internals=e.$hostElement$["s-ei"]}else{this.internals=e.$hostElement$.attachInternals();e.$hostElement$["s-ei"]=this.internals}}checkboxId=`ch-checkbox-${++n}`;hintId=`${this.checkboxId}-hint`;errorId=`${this.checkboxId}-error`;initialChecked=false;internals;formDisabled=false;get host(){return e(this)}label;name;value="on";checked=false;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=i=>{this.checked=i.target.checked;this.chChange.emit(this.checked)};syncForm(){const i=this.internals;if(typeof i?.setFormValue!=="function"){return}i.setFormValue(this.checked?this.value:null);const{flags:t,message:e}=s({required:this.required,empty:!this.checked,invalid:this.invalid,errorMessage:this.errorMessage});i.setValidity(t,e)}componentDidLoad(){this.initialChecked=this.checked;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.checked=this.initialChecked}formDisabledCallback(i){this.formDisabled=i}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return r(a,{key:"3e0f2f162d1ec1a4715b44a37211a30c63f830b2"},r("label",{key:"8042cb81ab53a9451a8757dfa63ef8cea8f41954",class:{control:true,"control--disabled":this.disabled||this.formDisabled},htmlFor:this.checkboxId},r("input",{key:"0d55f22c4625f48c8bf2eee15a7710cfb80c4328",id:this.checkboxId,class:{input:true,"input--invalid":this.invalid},type:"checkbox",name:this.name,value:this.value,checked:this.checked,disabled:this.disabled||this.formDisabled,required:this.required,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),this.label&&r("span",{key:"146e3b4fa88237da4af8f8b0a408909b4d11555e",class:"label-text"},this.label)),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"d82032ae57e8e818a91fa04cfd5e505dea47c22d",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"9f418c648d4929086a77ca868a7c13cdccb328cb",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}};c.style=o();export{c as ch_checkbox};
|
|
2
|
+
//# sourceMappingURL=p-c4d68ab7.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as a,h as e,H as r}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as a,h as e,H as r}from"./p-8l_6qAY9.js";const i=()=>`:host{display:block}.tablist{display:flex;gap:var(--spacing-2xl);border-bottom:var(--border-width) solid var(--border)}.tab{appearance:none;position:relative;background:transparent;border:none;padding:var(--spacing-md) 0 var(--spacing-xl);margin-bottom:calc(-1 * var(--border-width));color:var(--text-muted);font-family:inherit;font-size:inherit;font-weight:var(--typography-weight-semibold);cursor:pointer;transition:color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default)}.tab::after{content:'';position:absolute;left:0;right:0;bottom:0;height:var(--border-accent-bar);background:var(--accent);opacity:0;transition:opacity var(--duration-normal) var(--easing-default)}.tab:hover{color:var(--text)}.tab:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.tab--active{color:var(--text)}.tab--active::after{opacity:1}.tab--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.tabpanel{padding-top:var(--spacing-2xl);color:var(--text)}.tabpanel[hidden]{display:none}`;const o=0;const n=-1;const s=1;const l=-1;let c=0;const d=class{constructor(e){t(this,e);this.chChange=a(this,"chChange")}baseId=`ch-tabs-${++c}`;tablistEl;tabs=[];value;label;chChange;tabId(t){return`${this.baseId}-${t}`}panelId(t){return`${this.baseId}-${t}-panel`}get activeValue(){if(this.value&&this.tabs.some((t=>!t.disabled&&t.value===this.value))){return this.value}return this.tabs.find((t=>!t.disabled))?.value}select=t=>{this.value=t;this.chChange.emit(this.value)};focusTab(t){this.tablistEl?.querySelectorAll('[role="tab"]').forEach((a=>{if(a.dataset.value===t){a.focus()}}))}handleKeyDown=t=>{const a=this.tabs.filter((t=>!t.disabled));if(!a.length){return}const e=this.targetFor(t.key,a);if(!e){return}t.preventDefault();this.select(e);this.focusTab(e)};targetFor(t,a){const e=a.findIndex((t=>t.value===this.activeValue));if(t==="ArrowRight"){return a[(e+s)%a.length]?.value}if(t==="ArrowLeft"){return a[(e+l+a.length)%a.length]?.value}if(t==="Home"){return a[o]?.value}if(t==="End"){return a[a.length+n]?.value}return undefined}render(){const t=this.activeValue;return e(r,{key:"596a51404c0d7d87f9988534f65e98135ecfcb75"},e("div",{key:"6eb8cf1c1a986ce1ebd211806d130c0156bad2f1",class:"tablist",role:"tablist","aria-label":this.label,onKeyDown:this.handleKeyDown,ref:t=>this.tablistEl=t},this.tabs.map((a=>{const r=a.value===t;return e("button",{key:a.value,type:"button",class:{tab:true,"tab--active":r,"tab--disabled":Boolean(a.disabled)},role:"tab",id:this.tabId(a.value),"data-value":a.value,"aria-selected":r?"true":"false","aria-controls":this.panelId(a.value),tabIndex:r?o:n,disabled:a.disabled,onClick:()=>this.select(a.value)},a.label)}))),this.tabs.map((a=>e("div",{key:`${a.value}-panel`,class:"tabpanel",id:this.panelId(a.value),role:"tabpanel","aria-labelledby":this.tabId(a.value),tabIndex:o,hidden:a.value!==t},e("slot",{name:`panel-${a.value}`})))))}};d.style=i();export{d as ch_tabs};
|
|
2
|
+
//# sourceMappingURL=p-c98e2a50.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as a,a as g,h as i,H as r}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as a,a as g,h as i,H as r}from"./p-8l_6qAY9.js";const s=()=>`:host{display:grid;grid-template-columns:var(--ch-grid-columns, repeat(auto-fit, minmax(min(16rem, 100%), 1fr)));box-sizing:border-box}:host([hidden]){display:none}.grid--gap-none{gap:0}.grid--gap-2xs{gap:var(--spacing-2xs)}.grid--gap-xs{gap:var(--spacing-xs)}.grid--gap-sm{gap:var(--spacing-sm)}.grid--gap-md{gap:var(--spacing-md)}.grid--gap-lg{gap:var(--spacing-lg)}.grid--gap-xl{gap:var(--spacing-xl)}.grid--gap-2xl{gap:var(--spacing-2xl)}.grid--gap-3xl{gap:var(--spacing-3xl)}.grid--gap-4xl{gap:var(--spacing-4xl)}.grid--gap-5xl{gap:var(--spacing-5xl)}.grid--gap-6xl{gap:var(--spacing-6xl)}`;const p=new Set(["none","2xs","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"]);const t=class{constructor(g){a(this,g)}get el(){return g(this)}columns="auto-fit";gap="md";minItemWidth="16rem";get gapStep(){return p.has(this.gap)?this.gap:"md"}get fixedColumns(){const a=Number(this.columns);return Number.isInteger(a)&&a>=1&&a<=12?a:null}componentWillLoad(){this.applyColumns()}componentDidUpdate(){this.applyColumns()}applyColumns(){const a=this.fixedColumns===null?`repeat(auto-fit, minmax(min(${this.minItemWidth}, 100%), 1fr))`:`repeat(${this.fixedColumns}, minmax(0, 1fr))`;this.el.style.setProperty("--ch-grid-columns",a)}render(){return i(r,{key:"7e22752629d6e8dae0dd6ae05eb12aba96c97fc2",class:{grid:true,[`grid--gap-${this.gapStep}`]:true}},i("slot",{key:"dc7286fa1b34610aa802afc7298422147d936cbd"}))}};t.style=s();export{t as ch_grid};
|
|
2
|
+
//# sourceMappingURL=p-ca3179ae.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i,c as t,h as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as i,c as t,h as a,H as r}from"./p-8l_6qAY9.js";import{c as o}from"./p-CnivhwvG.js";const e=()=>`:host{display:inline-block}.button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:transparent;color:var(--text);cursor:pointer;transition:background-color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default)}.button--sm{width:calc(var(--icon-size-sm) + 2 * var(--spacing-md));height:calc(var(--icon-size-sm) + 2 * var(--spacing-md))}.button--md{width:calc(var(--icon-size-md) + 2 * var(--spacing-xl));height:calc(var(--icon-size-md) + 2 * var(--spacing-xl))}.button--lg{width:calc(var(--icon-size-lg) + 2 * var(--spacing-2xl));height:calc(var(--icon-size-lg) + 2 * var(--spacing-2xl))}.button--sm .icon{width:var(--icon-size-sm);height:var(--icon-size-sm)}.button--md .icon{width:var(--icon-size-md);height:var(--icon-size-md)}.button--lg .icon{width:var(--icon-size-lg);height:var(--icon-size-lg)}.button:hover:not([aria-disabled='true']){border-color:var(--border-hover);background:var(--surface-hover)}.button:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.button[aria-disabled='true']{opacity:var(--opacity-disabled);cursor:not-allowed}.button[aria-busy='true']{cursor:progress}.button[aria-busy='true'] .icon{animation:ch-icon-button-spin var(--duration-spin) linear infinite}@keyframes ch-icon-button-spin{to{transform:rotate(360deg)}}@media (pointer: coarse){.button--sm{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.button{transition:none}.button[aria-busy='true'] .icon{animation:none}}`;const n=class{constructor(a){i(this,a);this.chClick=t(this,"chClick")}name;label;size="md";type="button";disabled=false;loading=false;chClick;handleClick=i=>{if(this.disabled||this.loading){i.preventDefault();i.stopImmediatePropagation();return}this.chClick.emit(i)};render(){const i=this.name?o[this.name]:undefined;return a(r,{key:"eb744fa706b32c5ffca8b174f5cfc5e5cb546879"},a("button",{key:"a0923d38dc46adce13ae3d8e12426a419fe37c4a",class:`button button--${this.size}`,type:this.type,"aria-label":this.label,"aria-busy":this.loading?"true":undefined,"aria-disabled":this.disabled?"true":undefined,onClick:this.handleClick},a("svg",{key:"db67ffae9402ea67849f8b4aa487bf3fb152da63",class:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},(i??[]).map((i=>a(i.tag,i.attrs))))))}};n.style=e();export{n as ch_icon_button};
|
|
2
|
+
//# sourceMappingURL=p-d630f662.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as s,H as e}from"./p-8l_6qAY9.js";const i=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:var(--spacing-sm) var(--spacing-2xl)}.list--columns-2,.list--columns-3{grid-template-columns:repeat(2, minmax(0, 1fr))}.list--columns-3{grid-template-columns:repeat(3, minmax(0, 1fr))}@media (max-width: 48rem){.list--columns-2,.list--columns-3{grid-template-columns:minmax(0, 1fr)}}::slotted(div){display:grid;grid-template-columns:fit-content(min(12rem, 40%)) minmax(0, 1fr);gap:var(--spacing-sm);align-items:baseline}::slotted(dt){font-family:var(--typography-heading);font-weight:var(--typography-weight-semibold);font-size:var(--typography-size-sm);color:var(--color-text-primary)}::slotted(dd){margin:0;font-size:var(--typography-size-sm);min-width:0;overflow-wrap:break-word}`;const a=new Set(["1","2","3"]);const r=class{constructor(s){t(this,s)}columns="1";get columnCount(){return a.has(this.columns)?this.columns:"1"}render(){return s(e,{key:"590fc24614ba9240d7708cff6cb6027eca5904bf"},s("dl",{key:"868ee275cd6c792bff933c2429fe23985b9c30e3",class:`list list--columns-${this.columnCount}`},s("slot",{key:"7433fcda6f0e6b2c738c790839169669c31bd266"})))}};r.style=i();export{r as ch_description_list};
|
|
2
|
+
//# sourceMappingURL=p-d868bdbc.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as e,H as a}from"./p-8l_6qAY9.js";const s=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary);text-align:center}:host([hidden]){display:none}.empty-state__inner{display:flex;flex-direction:column;align-items:center;gap:var(--spacing-sm);padding:var(--spacing-6xl) var(--spacing-2xl);border:var(--border-width) dashed var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.empty-state--sm .empty-state__inner{padding:var(--spacing-3xl) var(--spacing-xl);gap:var(--spacing-xs)}.empty-state__icon{display:contents;font-size:var(--typography-size-xl);line-height:1}.empty-state__icon:empty{display:none}.empty-state__title{margin:0;font-family:var(--typography-heading);font-size:var(--typography-size-md);font-weight:var(--typography-weight-semibold);color:var(--color-text-primary)}.empty-state--md .empty-state__title{font-size:var(--typography-size-lg)}.empty-state__description{margin:0;max-width:36ch;font-size:var(--typography-size-sm);line-height:1.5}.empty-state__actions:empty{display:none}.empty-state__actions{display:flex;flex-wrap:wrap;gap:var(--spacing-sm);justify-content:center;margin-top:var(--spacing-xs)}`;const i=class{constructor(e){t(this,e)}title;description;size="md";render(){return e(a,{key:"ad3644cfbad791e9684b20b9776c8c68d15036e2",class:{"empty-state":true,[`empty-state--${this.size}`]:true}},e("div",{key:"88479d9470be1db6d4d9968ad656297f06a2526c",class:"empty-state__inner"},e("div",{key:"07b46c4f6e086921367b466df1b40eb3f49aeeac",class:"empty-state__icon","aria-hidden":"true"},e("slot",{key:"f2b769787d5b2aaa04493157f39e20c164df2322",name:"icon"})),e("h3",{key:"83131b17b5dac383141f2997ac2dfdde2b620d16",class:"empty-state__title"},this.title),this.description&&e("p",{key:"ca76152650118f55229ebac53c2963cb84982e77",class:"empty-state__description"},this.description),e("div",{key:"552f1319198b0c182cace7956e84ddc9e837043e",class:"empty-state__actions"},e("slot",{key:"b99db3bfac784acf8389f100362371c3a44f4ace"}))))}};i.style=s();export{i as ch_empty_state};
|
|
2
|
+
//# sourceMappingURL=p-e6b7b2da.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as e,a as r,h as a,H as o}from"./p-8l_6qAY9.js";const n=()=>`:host{display:contents;font-family:var(--typography-body)}.confirm__heading{margin:0;font-family:var(--typography-heading);font-size:var(--typography-size-lg);font-weight:var(--typography-weight-semibold);color:var(--color-text-primary)}.confirm__message{margin:0;font-size:var(--typography-size-sm);color:var(--color-text-secondary);overflow-wrap:break-word}.confirm__actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--spacing-md);margin-top:var(--spacing-2xl)}.confirm__button{display:inline-flex;align-items:center;justify-content:center;min-height:2.25rem;padding:0 var(--spacing-lg);border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-sm);background:var(--color-surface-default);color:var(--color-text-primary);font-family:var(--typography-body);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);cursor:pointer}.confirm__button:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.confirm__button:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.confirm__button--confirm{border-color:var(--color-accent-default);background:var(--color-accent-default);color:var(--color-accent-text)}.confirm__button--danger{border-color:var(--color-status-warning);background:var(--color-status-warning);color:var(--color-text-primary)}.confirm__button--danger::before{content:'⚠';margin-right:var(--spacing-xs)}`;const i=class{constructor(r){t(this,r);this.chConfirm=e(this,"chConfirm");this.chCancel=e(this,"chCancel")}get el(){return r(this)}open=false;heading;message;confirmLabel="Confirm";cancelLabel="Cancel";tone="default";pending=false;dismissible=true;chConfirm;chCancel;settled=false;cancelButton;confirmButton;componentDidLoad(){if(this.open){this.onOpening()}}handleOpenChange(t){if(t){this.onOpening();return}this.settled=false}onOpening(){this.settled=false;requestAnimationFrame((()=>{const t=this.tone==="danger"?this.cancelButton:this.confirmButton;t?.focus()}))}settle(t){if(this.settled){return}this.settled=true;if(t==="confirm"){this.chConfirm.emit();return}this.chCancel.emit()}handleConfirm=()=>{if(this.pending){return}this.settle("confirm")};handleCancel=()=>{if(this.pending){return}this.open=false;this.settle("cancel")};handleModalClose=()=>{this.open=false;if(this.pending){return}this.settle("cancel")};handleKeyDown=t=>{if(this.dismissible||t.key!=="Escape"){return}t.preventDefault();t.stopPropagation()};async focusCancel(){this.cancelButton?.focus()}render(){return a(o,{key:"7aa8fd72a281369f47ce7f1eb99c52ab60ba4ee0",onKeyDown:this.handleKeyDown},a("ch-modal",{key:"019663f042f5c2ce3dd1f58433faee170c01e8e6",open:this.open,label:this.heading,size:"sm",onChClose:this.handleModalClose,onChOpen:()=>this.onOpening()},a("h2",{key:"9d97f437e535a3a9feb181e9807dc9c532efd872",slot:"heading",class:"confirm__heading"},this.heading),this.message&&a("p",{key:"a0d64b2b915624473162557972eabdf80b445d58",class:"confirm__message"},this.message),a("div",{key:"0b44308d6eb7a4aea2c1166f8a7f6f19c41cdbb7",class:"confirm__actions"},a("button",{key:"7908d0db96e7c59c7b4673220aa62c2170b29d54",class:{confirm__button:true,"confirm__button--cancel":true},type:"button",ref:t=>this.cancelButton=t,disabled:this.pending,onClick:this.handleCancel},this.cancelLabel),a("button",{key:"43657105b474b303160da19e1fa5fda47f63207c",class:{confirm__button:true,"confirm__button--confirm":true,"confirm__button--danger":this.tone==="danger"},type:"button",ref:t=>this.confirmButton=t,disabled:this.pending,"aria-busy":this.pending?"true":undefined,onClick:this.handleConfirm},this.confirmLabel))))}static get watchers(){return{open:[{handleOpenChange:0}]}}};i.style=n();export{i as ch_confirm_dialog};
|
|
2
|
+
//# sourceMappingURL=p-eb39b9c2.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["chConfirmDialogCss","ChConfirmDialog","open","heading","message","confirmLabel","cancelLabel","tone","pending","dismissible","chConfirm","chCancel","settled","cancelButton","confirmButton","componentDidLoad","this","onOpening","handleOpenChange","requestAnimationFrame","target","focus","settle","outcome","emit","handleConfirm","handleCancel","handleModalClose","handleKeyDown","event","key","preventDefault","stopPropagation","focusCancel","render","h","Host","onKeyDown","label","size","onChClose","onChOpen","slot","class","confirm__button","type","ref","el","disabled","onClick","undefined"],"sources":["src/components/ch-confirm-dialog/ch-confirm-dialog.css?tag=ch-confirm-dialog&encapsulation=shadow","src/components/ch-confirm-dialog/ch-confirm-dialog.tsx"],"sourcesContent":[":host {\n display: contents;\n font-family: var(--typography-body);\n}\n\n.confirm__heading {\n margin: 0;\n font-family: var(--typography-heading);\n font-size: var(--typography-size-lg);\n font-weight: var(--typography-weight-semibold);\n color: var(--color-text-primary);\n}\n\n.confirm__message {\n margin: 0;\n font-size: var(--typography-size-sm);\n color: var(--color-text-secondary);\n overflow-wrap: break-word;\n}\n\n.confirm__actions {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: var(--spacing-md);\n margin-top: var(--spacing-2xl);\n}\n\n.confirm__button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 2.25rem;\n padding: 0 var(--spacing-lg);\n border: var(--border-width) solid var(--color-border-default);\n border-radius: var(--radius-sm);\n background: var(--color-surface-default);\n color: var(--color-text-primary);\n font-family: var(--typography-body);\n font-size: var(--typography-size-sm);\n font-weight: var(--typography-weight-semibold);\n cursor: pointer;\n}\n\n.confirm__button:focus-visible {\n outline: 2px solid var(--color-accent-default);\n outline-offset: 2px;\n}\n\n.confirm__button:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.confirm__button--confirm {\n border-color: var(--color-accent-default);\n background: var(--color-accent-default);\n color: var(--color-accent-text);\n}\n\n/* Destructive intent is carried by weight and iconography as well as colour. */\n.confirm__button--danger {\n border-color: var(--color-status-warning);\n background: var(--color-status-warning);\n color: var(--color-text-primary);\n}\n\n.confirm__button--danger::before {\n content: '⚠';\n margin-right: var(--spacing-xs);\n}\n","import { Component, Element, Event, type EventEmitter, Host, Method, Prop, State, Watch, h } from '@stencil/core';\n\nexport type ChConfirmDialogTone = 'default' | 'danger';\n\n/**\n * A confirmation dialog over `ch-modal`.\n *\n * Declarative only: the consumer opens it with `open` and handles the outcome.\n * The imperative `confirm()` helper is a separate concern and a separate issue,\n * because a promise-returning helper has to own mounting, focus and unhandled\n * rejection, none of which a component should decide for its consumer.\n *\n * The guarantees this adds over a plain `ch-modal` are the ones that make a\n * confirmation safe:\n *\n * - exactly one outcome per interaction — a double click on Confirm emits once;\n * - every dismissal path (Cancel, Escape, backdrop, confirm) is reported, so a\n * consumer awaiting an answer cannot hang;\n * - focus lands on Cancel for a destructive action, so the absent-minded Enter\n * does not destroy anything;\n * - `pending` is not a cancellation: a slow request keeps the dialog open.\n */\n@Component({\n tag: 'ch-confirm-dialog',\n styleUrl: 'ch-confirm-dialog.css',\n shadow: true,\n})\nexport class ChConfirmDialog {\n @Element() el: HTMLElement;\n\n /** Whether the dialog is open. Kept in sync when it is dismissed. */\n @Prop({ mutable: true }) open = false;\n\n /**\n * The question, set as the dialog's accessible name. Required: a dialog\n * without a name is announced as an unlabelled group.\n */\n @Prop() heading!: string;\n\n /** Supporting text, rendered under the heading. */\n @Prop() message?: string;\n\n /** Label of the confirming action. */\n @Prop() confirmLabel = 'Confirm';\n\n /** Label of the dismissing action. */\n @Prop() cancelLabel = 'Cancel';\n\n /**\n * `danger` styles the confirm action as destructive and moves the initial\n * focus to Cancel, so the safe choice is the default one.\n */\n @Prop() tone: ChConfirmDialogTone = 'default';\n\n /** Whether the confirm action is in flight; both buttons are then disabled. */\n @Prop() pending = false;\n\n /**\n * Whether Escape and the backdrop dismiss the dialog. When false, the only\n * way out is one of the two buttons — use it only for a decision that must\n * be answered rather than abandoned.\n */\n @Prop() dismissible = true;\n\n /** Emitted once when the user confirms. */\n @Event() chConfirm: EventEmitter<void>;\n\n /** Emitted once when the dialog is dismissed without confirming. */\n @Event() chCancel: EventEmitter<void>;\n\n /** `true` once an outcome has been emitted for the current opening. */\n @State() private settled = false;\n\n private cancelButton?: HTMLButtonElement;\n private confirmButton?: HTMLButtonElement;\n\n componentDidLoad() {\n if (this.open) {\n this.onOpening();\n }\n }\n\n @Watch('open')\n handleOpenChange(open: boolean) {\n if (open) {\n this.onOpening();\n return;\n }\n this.settled = false;\n }\n\n private onOpening() {\n this.settled = false;\n // Focus is moved once the dialog is actually shown; the modal handles\n // moving focus into itself, and this refines where it lands.\n requestAnimationFrame(() => {\n const target = this.tone === 'danger' ? this.cancelButton : this.confirmButton;\n target?.focus();\n });\n }\n\n private settle(outcome: 'confirm' | 'cancel') {\n if (this.settled) {\n return;\n }\n this.settled = true;\n if (outcome === 'confirm') {\n this.chConfirm.emit();\n return;\n }\n this.chCancel.emit();\n }\n\n private handleConfirm = () => {\n if (this.pending) {\n return;\n }\n this.settle('confirm');\n };\n\n private handleCancel = () => {\n if (this.pending) {\n return;\n }\n this.open = false;\n this.settle('cancel');\n };\n\n /**\n * `ch-modal` reports every close that was not requested by the consumer —\n * Escape and the backdrop. A close while `pending` is the consumer's own\n * doing and is not a cancellation.\n */\n private handleModalClose = () => {\n this.open = false;\n if (this.pending) {\n return;\n }\n this.settle('cancel');\n };\n\n /**\n * Escape is a platform close request on the inner `<dialog>`, so a\n * non-dismissible dialog cancels it before it takes effect. The backdrop is\n * handled by `ch-modal` and is suppressed the same way.\n */\n private handleKeyDown = (event: KeyboardEvent) => {\n if (this.dismissible || event.key !== 'Escape') {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n };\n\n /**\n * Focus the safe action. Exposed so a consumer can return focus deliberately\n * after a request settles.\n */\n @Method()\n async focusCancel(): Promise<void> {\n this.cancelButton?.focus();\n }\n\n render() {\n return (\n <Host onKeyDown={this.handleKeyDown}>\n <ch-modal open={this.open} label={this.heading} size=\"sm\" onChClose={this.handleModalClose} onChOpen={() => this.onOpening()}>\n <h2 slot=\"heading\" class=\"confirm__heading\">\n {this.heading}\n </h2>\n {this.message && <p class=\"confirm__message\">{this.message}</p>}\n <div class=\"confirm__actions\">\n <button\n class={{ 'confirm__button': true, 'confirm__button--cancel': true }}\n type=\"button\"\n ref={el => (this.cancelButton = el as HTMLButtonElement)}\n disabled={this.pending}\n onClick={this.handleCancel}\n >\n {this.cancelLabel}\n </button>\n <button\n class={{ 'confirm__button': true, 'confirm__button--confirm': true, 'confirm__button--danger': this.tone === 'danger' }}\n type=\"button\"\n ref={el => (this.confirmButton = el as HTMLButtonElement)}\n disabled={this.pending}\n aria-busy={this.pending ? 'true' : undefined}\n onClick={this.handleConfirm}\n >\n {this.confirmLabel}\n </button>\n </div>\n </ch-modal>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAqB,IAAM,s5C,MC2BpBC,EAAe,M,qHAIDC,KAAO,MAMxBC,QAGAC,QAGAC,aAAe,UAGfC,YAAc,SAMdC,KAA4B,UAG5BC,QAAU,MAOVC,YAAc,KAGbC,UAGAC,SAGQC,QAAU,MAEnBC,aACAC,cAER,gBAAAC,GACE,GAAIC,KAAKd,KAAM,CACbc,KAAKC,W,EAKT,gBAAAC,CAAiBhB,GACf,GAAIA,EAAM,CACRc,KAAKC,YACL,M,CAEFD,KAAKJ,QAAU,K,CAGT,SAAAK,GACND,KAAKJ,QAAU,MAGfO,uBAAsB,KACpB,MAAMC,EAASJ,KAAKT,OAAS,SAAWS,KAAKH,aAAeG,KAAKF,cACjEM,GAAQC,OAAO,G,CAIX,MAAAC,CAAOC,GACb,GAAIP,KAAKJ,QAAS,CAChB,M,CAEFI,KAAKJ,QAAU,KACf,GAAIW,IAAY,U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UhC,KAAKR,QAAO,YACXQ,KAAKR,QAAU,OAAS0C,UACnCD,QAASjC,KAAKS,eAEbT,KAAKX,gB","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,a as e,f as o,h as i,H as s}from"./p-8l_6qAY9.js";const n={top:"bottom",bottom:"top",left:"right",right:"left"};const r={top:"vertical",bottom:"vertical",left:"horizontal",right:"horizontal"};function a(t,e){return{top:e.top-t.top,left:e.left-t.left,bottom:t.top+t.height-(e.top+e.height),right:t.left+t.width-(e.left+e.width)}}function l(t,e,o,i){switch(t){case"top":return{top:e.top-o.height-i,left:e.left+(e.width-o.width)/2};case"bottom":return{top:e.top+e.height+i,left:e.left+(e.width-o.width)/2};case"left":return{top:e.top+(e.height-o.height)/2,left:e.left-o.width-i};case"right":return{top:e.top+(e.height-o.height)/2,left:e.left+e.width+i}}}function b({anchor:t,surface:e,viewport:o,preferred:i,gap:s}){const b=[i,n[i]];let h=i;let d=Number.POSITIVE_INFINITY;for(const i of b){const{top:n,left:b}=l(i,t,e,s);const f={top:n,left:b,width:e.width,height:e.height};const p=a(f,o);const u=r[i]==="vertical"?c(p.top)+c(p.bottom):c(p.left)+c(p.right);if(u<d){d=u;h=i}}const{top:p,left:u}=l(h,t,e,s);const g={top:p,left:u,width:e.width,height:e.height};const m=a(g,o);const v=r[h]==="vertical"?{top:p,left:u+f(m.left,m.right)}:{top:p+f(m.top,m.bottom),left:u};return{placement:h,top:v.top,left:v.left}}function c(t){return t>0?t:0}function f(t,e){if(t>0){return t}if(e>0){return-e}return 0}const h=()=>`:host{display:inline-block}.anchor{position:relative;display:inline-flex}.probe{position:fixed;top:0;left:0;width:1px;height:1px;visibility:hidden;pointer-events:none}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:min(16rem, calc(100vw - 2 * var(--spacing-2xl)));padding:var(--spacing-md) var(--spacing-2xl);border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-sm);line-height:1.4;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--easing-default), visibility var(--duration-fast) var(--easing-default)}.bubble--visible{opacity:1;visibility:visible}.bubble::before{content:'';position:absolute}.bubble--positioned{position:fixed;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);transform:none;margin:0}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble.bubble--positioned.bubble--top,.bubble.bubble--positioned.bubble--bottom,.bubble.bubble--positioned.bubble--left,.bubble.bubble--positioned.bubble--right{inset:auto;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);right:auto;bottom:auto;transform:none;margin:0}.bubble--top::before{top:100%;left:0;right:0;height:var(--spacing-md)}.bubble--bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:var(--spacing-md)}.bubble--bottom::before{bottom:100%;left:0;right:0;height:var(--spacing-md)}.bubble--left{right:100%;top:50%;transform:translateY(-50%);margin-right:var(--spacing-md)}.bubble--left::before{left:100%;top:0;bottom:0;width:var(--spacing-md)}.bubble--right{left:100%;top:50%;transform:translateY(-50%);margin-left:var(--spacing-md)}.bubble--right::before{right:100%;top:0;bottom:0;width:var(--spacing-md)}@media (prefers-reduced-motion: reduce){.bubble{transition:none}}`;let d=0;const p=8;const u=class{constructor(e){t(this,e)}get el(){return e(this)}fallbackId=`ch-tooltip-${++d}`;bubbleEl;probeEl;cleanup;placement="top";hovered=false;focused=false;dismissed=false;resolvedPlacement;offset;get visible(){return(this.hovered||this.focused)&&!this.dismissed}componentDidLoad(){this.associate()}connectedCallback(){this.watchViewport()}disconnectedCallback(){this.cleanup?.()}handleMouseEnter(){this.hovered=true;this.dismissed=false;this.position()}handleMouseLeave(){this.hovered=false}handleFocusIn(){this.focused=true;this.dismissed=false;this.position()}handleFocusOut(){this.focused=false}handleKeyDown(t){if(t.key==="Escape"&&this.visible&&!t.defaultPrevented){t.preventDefault();this.dismissed=true}}handleScroll(){if(this.visible&&this.offset){this.position()}}handleResize(){this.position()}watchViewport(){if(typeof window==="undefined"){return}const t=window.visualViewport;if(!t||this.cleanup){return}const e=()=>this.position();t.addEventListener("resize",e);t.addEventListener("scroll",e);this.cleanup=()=>{t.removeEventListener("resize",e);t.removeEventListener("scroll",e)}}slotted(t){return Array.from(this.el.children).find((e=>e.getAttribute("slot")===t))}position(){if(typeof window==="undefined"){return}const t=this.bubbleEl??(this.bubbleEl=this.el.shadowRoot?.querySelector(".bubble")??undefined);const e=this.probeEl??(this.probeEl=this.el.shadowRoot?.querySelector(".probe")??undefined);if(!t||!e||t.offsetWidth===0){return}const i=this.slotted("trigger")?.getBoundingClientRect?.();if(!i){return}const s=e.getBoundingClientRect();const n=s.width||1;const r=s.height||1;const a=t=>({top:(t.top-s.top)/r,left:(t.left-s.left)/n,width:t.width/n,height:t.height/r});const l={width:t.offsetWidth+g(t),height:t.offsetHeight};const c=window.visualViewport;const{placement:f,top:h,left:d}=b({anchor:a(i),surface:l,viewport:a(c?{top:c.offsetTop,left:c.offsetLeft,width:c.width,height:c.height}:{top:0,left:0,width:window.innerWidth,height:window.innerHeight}),preferred:this.placement,gap:p});const u=this.offset;const m=u?.top===h&&u?.left===d&&this.resolvedPlacement===f;this.resolvedPlacement=f;this.offset={top:h,left:d};if(!m){o(this)}}associate=()=>{const t=this.slotted("trigger");const e=this.slotted("content");if(!t||!e){return}if(!e.id){e.id=this.fallbackId}e.setAttribute("role","tooltip");t.setAttribute("aria-describedby",e.id)};render(){const{offset:t}=this;return i(s,{key:"ccc4855053e0c1661f37ef6d40dffc4d0ff8fef3"},i("span",{key:"c71b50bd48142031f60017a01e9abbeaad755f83",class:"anchor"},i("span",{key:"aa337facc4dd983a5c2b2cf68ef1b3079e911f0b",class:"probe","aria-hidden":"true",ref:t=>this.probeEl=t}),i("slot",{key:"d4c7db781d9cad1b61d0b17071e41ee9619e5129",name:"trigger",onSlotchange:this.associate}),i("span",{key:"8eda03e816c13ba58721a3f2c058d1e812c5630e",ref:t=>this.bubbleEl=t,style:{"--ch-tooltip-offset-top":t?`${t.top}px`:null,"--ch-tooltip-offset-left":t?`${t.left}px`:null},class:{bubble:true,"bubble--positioned":Boolean(this.offset),[`bubble--${this.resolvedPlacement??this.placement}`]:true,"bubble--visible":this.visible}},i("slot",{key:"402e2c295e88586d78974a2169a75afda1380c96",name:"content",onSlotchange:this.associate}))))}};function g(t){const e=getComputedStyle(t);return(parseFloat(e.marginLeft)||0)+(parseFloat(e.marginRight)||0)}u.style=h();export{u as ch_tooltip};
|
|
2
|
+
//# sourceMappingURL=p-f0c288db.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OPPOSITE","top","bottom","left","right","AXIS","overflowOf","surface","viewport","height","width","offsetFor","placement","anchor","gap","placeOverlay","preferred","candidates","best","Number","POSITIVE_INFINITY","candidate","rect","overflow","main","clamp","shifted","correction","before","after","chTooltipCss","tooltipIds","GAP","ChTooltip","fallbackId","bubbleEl","probeEl","cleanup","hovered","focused","dismissed","resolvedPlacement","offset","visible","this","componentDidLoad","associate","connectedCallback","watchViewport","disconnectedCallback","handleMouseEnter","position","handleMouseLeave","handleFocusIn","handleFocusOut","handleKeyDown","event","key","defaultPrevented","preventDefault","handleScroll","handleResize","window","visualViewport","update","addEventListener","removeEventListener","slotted","name","Array","from","el","children","find","child","getAttribute","bubble","shadowRoot","querySelector","undefined","probe","offsetWidth","anchorRect","getBoundingClientRect","probeRect","scaleX","scaleY","inContainingBlock","horizontalMargin","offsetHeight","offsetTop","offsetLeft","innerWidth","innerHeight","current","unchanged","forceUpdate","trigger","content","id","setAttribute","render","h","Host","class","ref","onSlotchange","style","Boolean","getComputedStyle","parseFloat","marginLeft","marginRight"],"sources":["src/utils/overlay.ts","src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":["export type ChOverlayPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface ChOverlayPosition {\n /** Placement after flipping when the preferred side does not fit. */\n placement: ChOverlayPlacement;\n /** Position in the same coordinate space as `anchor` and `viewport`, in pixels. */\n top: number;\n left: number;\n}\n\nexport interface ChOverlayRect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nexport interface ChOverlayViewport {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nconst OPPOSITE: Record<ChOverlayPlacement, ChOverlayPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\nconst AXIS: Record<ChOverlayPlacement, 'vertical' | 'horizontal'> = {\n top: 'vertical',\n bottom: 'vertical',\n left: 'horizontal',\n right: 'horizontal',\n};\n\n/**\n * How far a placed surface overflows each viewport edge. Positive values are\n * overflow. Used both to pick a placement and to shift the surface back in.\n */\nexport function overflowOf(surface: ChOverlayRect, viewport: ChOverlayViewport) {\n return {\n top: viewport.top - surface.top,\n left: viewport.left - surface.left,\n bottom: surface.top + surface.height - (viewport.top + viewport.height),\n right: surface.left + surface.width - (viewport.left + viewport.width),\n };\n}\n\nfunction offsetFor(placement: ChOverlayPlacement, anchor: ChOverlayRect, surface: { width: number; height: number }, gap: number) {\n switch (placement) {\n case 'top':\n return {\n top: anchor.top - surface.height - gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'bottom':\n return {\n top: anchor.top + anchor.height + gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'left':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left - surface.width - gap,\n };\n case 'right':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left + anchor.width + gap,\n };\n }\n}\n\n/**\n * Picks the placement that overflows least and then shifts the surface along\n * the cross axis so it stays inside the viewport.\n *\n * The main-axis overflow is not compensated with a translate: a tooltip pinned\n * to the top edge would cover its own trigger. Flipping to the other side is\n * what keeps it readable, and the caller decides whether to accept the\n * remaining overflow.\n */\nexport function placeOverlay({\n anchor,\n surface,\n viewport,\n preferred,\n gap,\n}: {\n anchor: ChOverlayRect;\n surface: { width: number; height: number };\n viewport: ChOverlayViewport;\n preferred: ChOverlayPlacement;\n gap: number;\n}): ChOverlayPosition {\n const candidates: ChOverlayPlacement[] = [preferred, OPPOSITE[preferred]];\n let placement = preferred;\n let best = Number.POSITIVE_INFINITY;\n\n for (const candidate of candidates) {\n const { top, left } = offsetFor(candidate, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);\n\n if (main < best) {\n best = main;\n placement = candidate;\n }\n }\n\n const { top, left } = offsetFor(placement, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n\n const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };\n\n return { placement, top: shifted.top, left: shifted.left };\n}\n\n/** Only real overflow counts: the side that fits contributes nothing. */\nfunction clamp(overflow: number) {\n return overflow > 0 ? overflow : 0;\n}\n\n/**\n * Turns the two overflows on an axis into a shift. `before` is the overflow on\n * the leading edge (top or left), `after` the one on the trailing edge; both\n * are positive when the surface spills past that edge.\n *\n * Pushing away from the leading edge moves the surface inwards, so the shift is\n * `+before`. The trailing edge needs the opposite sign. When both overflow the\n * surface is larger than the viewport: pin it to the leading edge and let\n * `max-width` stop the spill.\n */\nfunction correction(before: number, after: number) {\n if (before > 0) {\n return before;\n }\n if (after > 0) {\n return -after;\n }\n return 0;\n}\n",":host {\n display: inline-block;\n}\n\n.anchor {\n position: relative;\n display: inline-flex;\n}\n\n/* Fixed at the origin of the same containing block the bubble uses. */\n.probe {\n position: fixed;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n visibility: hidden;\n pointer-events: none;\n}\n\n.bubble {\n position: absolute;\n z-index: var(--z-index-dropdown);\n width: max-content;\n max-width: min(16rem, calc(100vw - 2 * var(--spacing-2xl)));\n padding: var(--spacing-md) var(--spacing-2xl);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-sm);\n background: var(--color-background-base);\n color: var(--text);\n font-family: var(--font-body);\n font-size: var(--typography-size-sm);\n line-height: 1.4;\n opacity: 0;\n visibility: hidden;\n transition:\n opacity var(--duration-fast) var(--easing-default),\n visibility var(--duration-fast) var(--easing-default);\n}\n\n.bubble--visible {\n opacity: 1;\n visibility: visible;\n}\n\n.bubble::before {\n content: '';\n position: absolute;\n}\n\n/*\n * Once the component has measured the anchor, the bubble is placed with fixed\n * coordinates. Viewport coordinates do not depend on ancestors' transforms or\n * overflow, so a tooltip inside a scrolling drawer or modal stays anchored.\n */\n.bubble--positioned {\n position: fixed;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n transform: none;\n margin: 0;\n}\n\n.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\n}\n\n/* Stencil scopes each rule by doubling its classes, so a three-class selector\n is what actually outranks the single-class placement rules above. */\n.bubble.bubble--positioned.bubble--top,\n.bubble.bubble--positioned.bubble--bottom,\n.bubble.bubble--positioned.bubble--left,\n.bubble.bubble--positioned.bubble--right {\n inset: auto;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n right: auto;\n bottom: auto;\n transform: none;\n margin: 0;\n}\n\n.bubble--top::before {\n top: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--bottom {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: var(--spacing-md);\n}\n\n.bubble--bottom::before {\n bottom: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--left {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: var(--spacing-md);\n}\n\n.bubble--left::before {\n left: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n.bubble--right {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: var(--spacing-md);\n}\n\n.bubble--right::before {\n right: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n}\n","import { Component, Element, forceUpdate, Host, Listen, Prop, State, h } from '@stencil/core';\n\nimport { placeOverlay, type ChOverlayPlacement } from '../../utils/overlay';\n\nexport type ChTooltipPlacement = ChOverlayPlacement;\n\nlet tooltipIds = 0;\n\n/** Space between the trigger and the bubble, matching `--spacing-md`. */\nconst GAP = 8;\n\n/**\n * Short help text shown on hover and on focus.\n *\n * Both the trigger and the text come from the consumer's light DOM through\n * named slots. That is what makes the accessible association work: an\n * `aria-describedby` IDREF only resolves within a single tree, and slotted\n * nodes stay in the document tree even though they render inside the shadow\n * root. Keeping the text in the shadow root instead would need a reference\n * pointing into a shadow tree, which the platform does not allow — element\n * reflection only points outwards, and `referenceTarget` is not available yet.\n *\n * The trigger has to be a natively focusable element (`<button>`, `<a>`,\n * `<input>`). A chucao component such as `ch-button` will not be described,\n * because `aria-*` set on a custom element host does not reach the native\n * element inside it — see the discussion in issue #47.\n *\n * Positioning is measured, not purely CSS: `placement` is the preferred side,\n * and the bubble flips to the opposite side when the preferred one does not\n * fit, then shifts along the other axis to stay inside the viewport. It\n * re-measures on scroll, resize and visual-viewport changes, which is what\n * keeps it correct inside a scrolling modal or drawer and when a mobile\n * keyboard shrinks the visible area.\n */\n@Component({\n tag: 'ch-tooltip',\n styleUrl: 'ch-tooltip.css',\n shadow: true,\n})\nexport class ChTooltip {\n @Element() private el: HTMLElement;\n\n private readonly fallbackId = `ch-tooltip-${++tooltipIds}`;\n\n private bubbleEl?: HTMLElement;\n\n private probeEl?: HTMLElement;\n\n private cleanup?: () => void;\n\n /**\n * The side the bubble is placed on. It is a preference: when that side has no\n * room the bubble flips to the opposite one.\n */\n @Prop() placement: ChTooltipPlacement = 'top';\n\n // Hover and focus are tracked apart so that neither cancels the other: a\n // pointer passing over and away must not hide a tooltip whose trigger still\n // holds keyboard focus.\n @State() hovered = false;\n @State() focused = false;\n @State() dismissed = false;\n\n /** The placement actually used, which may differ from the prop after a flip. */\n @State() resolvedPlacement?: ChTooltipPlacement;\n\n /** Offset applied to the bubble once it has been measured. */\n private offset?: { top: number; left: number };\n\n private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n connectedCallback() {\n this.watchViewport();\n }\n\n disconnectedCallback() {\n this.cleanup?.();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\n this.position();\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Listen('focusin')\n handleFocusIn() {\n this.focused = true;\n this.dismissed = false;\n this.position();\n }\n\n @Listen('focusout')\n handleFocusOut() {\n this.focused = false;\n }\n\n /**\n * Listens on the document because a tooltip opened by hovering leaves focus\n * wherever it was, so a host-scoped handler would never see the key.\n *\n * `preventDefault()` dismisses only the innermost surface: the platform's\n * close request for an open native `<dialog>` is the default action of this\n * same keydown, so cancelling it keeps an enclosing `ch-modal` open. Proven\n * against a real `ch-modal` in `tests/browser/ch-tooltip.browser.spec.ts`.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {\n event.preventDefault();\n this.dismissed = true;\n }\n }\n\n /** Cheap guard so scroll frames do not measure while nothing is shown. */\n @Listen('scroll', { target: 'window', capture: true, passive: true })\n handleScroll() {\n if (this.visible && this.offset) {\n this.position();\n }\n }\n\n @Listen('resize', { target: 'window', passive: true })\n handleResize() {\n this.position();\n }\n\n private watchViewport() {\n if (typeof window === 'undefined') {\n return;\n }\n const viewport = window.visualViewport;\n if (!viewport || this.cleanup) {\n return;\n }\n const update = () => this.position();\n viewport.addEventListener('resize', update);\n viewport.addEventListener('scroll', update);\n this.cleanup = () => {\n viewport.removeEventListener('resize', update);\n viewport.removeEventListener('scroll', update);\n };\n }\n\n private slotted(name: string) {\n return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);\n }\n\n /**\n * Measures the anchor and the bubble and stores the offset that keeps the\n * bubble inside the viewport. Nothing is measured before the bubble has a\n * box to measure, so the pre-paint render uses plain CSS.\n *\n * A fixed bubble is positioned against the nearest ancestor that establishes\n * a containing block (a `transform`, `filter`, `backdrop-filter`, `contain`\n * or `will-change`), not necessarily the viewport. The probe is fixed at the\n * containing block's origin, so both the anchor and the viewport are\n * converted into that same space before `placeOverlay` does its maths.\n */\n private position() {\n if (typeof window === 'undefined') {\n return;\n }\n const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector<HTMLElement>('.bubble') ?? undefined);\n const probe = this.probeEl ?? (this.probeEl = this.el.shadowRoot?.querySelector<HTMLElement>('.probe') ?? undefined);\n if (!bubble || !probe || bubble.offsetWidth === 0) {\n return;\n }\n\n const anchorRect = (this.slotted('trigger') as HTMLElement | undefined)?.getBoundingClientRect?.();\n if (!anchorRect) {\n return;\n }\n\n const probeRect = probe.getBoundingClientRect();\n const scaleX = probeRect.width || 1;\n const scaleY = probeRect.height || 1;\n const inContainingBlock = (rect: { top: number; left: number; width: number; height: number }) => ({\n top: (rect.top - probeRect.top) / scaleY,\n left: (rect.left - probeRect.left) / scaleX,\n width: rect.width / scaleX,\n height: rect.height / scaleY,\n });\n\n const surface = {\n width: bubble.offsetWidth + horizontalMargin(bubble),\n height: bubble.offsetHeight,\n };\n const viewport = window.visualViewport;\n\n const { placement, top, left } = placeOverlay({\n anchor: inContainingBlock(anchorRect),\n surface,\n viewport: inContainingBlock(\n viewport\n ? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }\n : { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },\n ),\n preferred: this.placement,\n gap: GAP,\n });\n\n const current = this.offset;\n const unchanged = current?.top === top && current?.left === left && this.resolvedPlacement === placement;\n this.resolvedPlacement = placement;\n this.offset = { top, left };\n if (!unchanged) {\n forceUpdate(this);\n }\n }\n\n /**\n * Points the trigger at the text with `aria-describedby`. Re-run on\n * `slotchange` because a framework re-render can replace the slotted nodes\n * and take the attributes with them.\n */\n private associate = () => {\n const trigger = this.slotted('trigger');\n const content = this.slotted('content');\n if (!trigger || !content) {\n return;\n }\n if (!content.id) {\n content.id = this.fallbackId;\n }\n content.setAttribute('role', 'tooltip');\n trigger.setAttribute('aria-describedby', content.id);\n };\n\n render() {\n const { offset } = this;\n\n return (\n <Host>\n <span class=\"anchor\">\n <span class=\"probe\" aria-hidden=\"true\" ref={el => (this.probeEl = el)}></span>\n {/* Pre-measure render uses the preferred side so the bubble never\n jumps from the wrong edge on its first frame. */}\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span\n ref={el => (this.bubbleEl = el)}\n style={{\n '--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,\n '--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,\n }}\n class={{\n 'bubble': true,\n 'bubble--positioned': Boolean(this.offset),\n [`bubble--${this.resolvedPlacement ?? this.placement}`]: true,\n 'bubble--visible': this.visible,\n }}\n >\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n\nfunction horizontalMargin(el: HTMLElement) {\n const style = getComputedStyle(el);\n return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);\n}\n"],"mappings":"gEAwBA,MAAMA,EAA2D,CAC/DC,IAAK,SACLC,OAAQ,MACRC,KAAM,QACNC,MAAO,QAGT,MAAMC,EAA8D,CAClEJ,IAAK,WACLC,OAAQ,WACRC,KAAM,aACNC,MAAO,cAOH,SAAUE,EAAWC,EAAwBC,GACjD,MAAO,CACLP,IAAKO,EAASP,IAAMM,EAAQN,IAC5BE,KAAMK,EAASL,KAAOI,EAA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,QAAA7C,IAAA,2CAAMW,KAAK,UAAUsC,aAAc9D,KAAKE,YACxCwD,EAAA,QAAA7C,IAAA,2CACEgD,IAAKlC,GAAO3B,KAAKT,SAAWoC,EAC5BoC,MAAO,CACL,0BAA2BjE,EAAS,GAAGA,EAAOzC,QAAU,KACxD,2BAA4ByC,EAAS,GAAGA,EAAOvC,SAAW,MAE5DqG,MAAO,CACL5B,OAAU,KACV,qBAAsBgC,QAAQhE,KAAKF,QACnC,CAAC,WAAWE,KAAKH,mBAAqBG,KAAKhC,aAAc,KACzD,kBAAmBgC,KAAKD,UAG1B2D,EAAA,QAAA7C,IAAA,2CAAMW,KAAK,UAAUsC,aAAc9D,KAAKE,c,GAQpD,SAAS0C,EAAiBjB,GACxB,MAAMoC,EAAQE,iBAAiBtC,GAC/B,OAAQuC,WAAWH,EAAMI,aAAe,IAAMD,WAAWH,EAAMK,cAAgB,EACjF,C","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-C6khqyw3.js');
|
|
4
4
|
|
|
5
5
|
const chAccordionCss = () => `:host{display:block}.item{background:var(--surface);border:var(--border-width) solid var(--border);border-radius:var(--radius);transition:border-color var(--duration-normal) var(--easing-default)}.item+.item{margin-top:var(--spacing-md)}.item--open{border-color:var(--border-hover)}.item-head{margin:0}.item-toggle{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-lg);width:100%;padding:var(--spacing-2xl) var(--spacing-3xl);background:transparent;border:none;color:var(--text);font-family:inherit;font-size:inherit;font-weight:var(--typography-weight-semibold);cursor:pointer}.item-toggle::after{content:'';width:var(--spacing-md);height:var(--spacing-md);flex-shrink:0;border-right:var(--border-width) solid var(--text-muted);border-bottom:var(--border-width) solid var(--text-muted);transform:rotate(45deg);transition:transform var(--duration-normal) var(--easing-default)}.item--open .item-toggle::after{transform:rotate(-135deg)}.item-toggle:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.item-toggle:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.item-panel{padding:0 var(--spacing-3xl) var(--spacing-3xl);color:var(--text-muted)}.item-panel[hidden]{display:none}`;
|
|
6
6
|
|
|
@@ -34,7 +34,7 @@ const ChAccordion = class {
|
|
|
34
34
|
this.chChange.emit(this.value);
|
|
35
35
|
};
|
|
36
36
|
render() {
|
|
37
|
-
return (index.h(index.Host, { key: '
|
|
37
|
+
return (index.h(index.Host, { key: 'da264a6faa4d8da510d2964bef410d7c733bc507' }, this.items.map(item => {
|
|
38
38
|
const open = this.value === item.value;
|
|
39
39
|
return (index.h("div", { key: item.value, class: { 'item': true, 'item--open': open } }, index.h("h3", { class: "item-head" }, index.h("button", { type: "button", class: "item-toggle", id: this.headerId(item.value), "data-value": item.value, "aria-expanded": open ? 'true' : 'false', "aria-controls": this.panelId(item.value), disabled: item.disabled, onClick: () => this.toggle(item.value) }, item.title)), index.h("div", { class: "item-panel", id: this.panelId(item.value), role: "region", "aria-labelledby": this.headerId(item.value), hidden: !open }, index.h("slot", { name: `panel-${item.value}` }))));
|
|
40
40
|
})));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-C6khqyw3.js');
|
|
4
4
|
var icons = require('./icons-CNyDgV-q.js');
|
|
5
5
|
var validationMessage = require('./validation-message-bbtJ2sa_.js');
|
|
6
6
|
|
|
@@ -52,7 +52,7 @@ const ChAlert = class {
|
|
|
52
52
|
render() {
|
|
53
53
|
const role = this.variant === 'warning' ? 'alert' : 'status';
|
|
54
54
|
const shapes = this.statusCue ? icons.chIcons[VARIANT_ICON[this.variant]] : undefined;
|
|
55
|
-
return (index.h(index.Host, { key: '
|
|
55
|
+
return (index.h(index.Host, { key: 'c7fb041416b2958fcda758a3297a0f9546456ef3' }, index.h("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, shapes && (index.h("svg", { key: '1a89cc6797bd6b425920f61f545f407326422e93', class: "alert-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", focusable: "false" }, shapes.map(shape => index.h(shape.tag, shape.attrs)))), index.h("div", { key: 'd30f1b3897d3ce681789507aa2677b29a83e8346', class: "alert-content" }, index.h("slot", { key: 'a4bc52ace056a573b21ecec083d017b3c5c22245' })), this.dismissLabel && (index.h("button", { key: '571947bd96a9c2f22b7af7989abd406dff860256', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, index.h("span", { key: 'e8d282730aa25aad78f05ce118cb65fce9ea85c5', "aria-hidden": "true" }, "\u00D7"))))));
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
ChAlert.style = chAlertCss();
|
|
@@ -74,7 +74,7 @@ const ChBadge = class {
|
|
|
74
74
|
*/
|
|
75
75
|
statusCue = true;
|
|
76
76
|
render() {
|
|
77
|
-
return (index.h(index.Host, { key: '
|
|
77
|
+
return (index.h(index.Host, { key: '712c653d4047845d6afce4655271f2c80e3fe6a8' }, index.h("span", { key: 'dd24bf1f555b229bee277b77c175b485f4a10680', class: { badge: true, [`badge--${this.variant}`]: true } }, this.statusCue && index.h("span", { key: 'cef4173e40dac2798c2a26381763bb470cf0bacc', class: "badge-dot", "aria-hidden": "true" }), index.h("slot", { key: '6e8c09dd9260d80c9fda09b402dfc3b1cef53907' }))));
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
ChBadge.style = chBadgeCss();
|
|
@@ -178,7 +178,7 @@ const ChCard = class {
|
|
|
178
178
|
index.registerInstance(this, hostRef);
|
|
179
179
|
}
|
|
180
180
|
render() {
|
|
181
|
-
return (index.h(index.Host, { key: '
|
|
181
|
+
return (index.h(index.Host, { key: 'f237dce6afd9f9c88f52784de63073d3b4dc31fd' }, index.h("div", { key: '2256360ad3b736aaf595cb0440903eb90ffc9968', class: "card" }, index.h("slot", { key: '5ce63027b9e1abd925b4a1d7261752a4b579b336' }))));
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
ChCard.style = chCardCss();
|
|
@@ -304,7 +304,7 @@ const ChInput = class {
|
|
|
304
304
|
return undefined;
|
|
305
305
|
}
|
|
306
306
|
render() {
|
|
307
|
-
return (index.h(index.Host, { key: '
|
|
307
|
+
return (index.h(index.Host, { key: '2a892c87f8c2d7840c89b546e53b1cd4274de6d1' }, this.label && (index.h("label", { key: '7c10ad2de5992e8e96accb3752bb62a7ecc5a562', class: "label", htmlFor: this.inputId }, this.label)), index.h("input", { key: '746c04af3a66f8bd3789f037d77560f30b79ae67', id: this.label ? this.inputId : undefined, class: { 'input': true, 'input--invalid': this.invalid }, type: this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled || this.formDisabled, required: this.required, value: this.value, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange }), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: '5c1985773e1ec0de670e5fa0d94b33cea81b9e63', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: '48a2823957aba104c6a6599dbd409824c2f60f79', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
308
308
|
}
|
|
309
309
|
static get formAssociated() { return true; }
|
|
310
310
|
static get watchers() { return {
|
|
@@ -436,7 +436,7 @@ const ChSelect = class {
|
|
|
436
436
|
return undefined;
|
|
437
437
|
}
|
|
438
438
|
render() {
|
|
439
|
-
return (index.h(index.Host, { key: '
|
|
439
|
+
return (index.h(index.Host, { key: '21825ec1b83a93617413179ec79ba42ef2e980fe' }, this.label && (index.h("label", { key: 'e41e1268d92384f93bf492f90c6a727ddd5a05e0', class: "label", htmlFor: this.selectId }, this.label)), index.h("select", { key: '25160df5f7628bf89d6d7bb1f2736b44d02455d9', id: this.label ? this.selectId : undefined, class: { 'select': true, 'select--invalid': this.invalid }, name: this.name, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }, this.placeholder && (index.h("option", { key: '6e6977e6c5d120a2bf28b1b05892ff90ca32e1ff', value: "", disabled: true, hidden: true, selected: !this.value }, this.placeholder)), this.options.map(option => (index.h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label)))), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: '92cb97df6b5ff80857fa6463d189e366697d6fd5', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: '08d3f5deefd5d155c0fd54f06a0f6f5c60db8873', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
440
440
|
}
|
|
441
441
|
static get formAssociated() { return true; }
|
|
442
442
|
static get watchers() { return {
|
|
@@ -477,7 +477,7 @@ const ChSpinner = class {
|
|
|
477
477
|
label;
|
|
478
478
|
render() {
|
|
479
479
|
const labelled = Boolean(this.label);
|
|
480
|
-
return (index.h(index.Host, { key: '
|
|
480
|
+
return (index.h(index.Host, { key: 'ed67d11ad7efe04c34372852f5c4b81c71bf2327' }, index.h("span", { key: 'fff47dcd59f6e8881ea6295f5d062f888328a081', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
|
|
481
481
|
}
|
|
482
482
|
};
|
|
483
483
|
ChSpinner.style = chSpinnerCss();
|
|
@@ -590,7 +590,7 @@ const ChSwitch = class {
|
|
|
590
590
|
return undefined;
|
|
591
591
|
}
|
|
592
592
|
render() {
|
|
593
|
-
return (index.h(index.Host, { key: '
|
|
593
|
+
return (index.h(index.Host, { key: 'f0ad3dab1049febb1e4506c538a938eec237b6ee' }, index.h("label", { key: '0ec252ff6c58a79c3d1054312f6f92dd03352f69', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, index.h("input", { key: 'a2471b09c6e1a026ec6189b3b542edc7147b8759', id: this.switchId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", role: "switch", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), index.h("span", { key: 'dbcf0512d51e71c0072e4d159e23d822a7676da2', class: "track" }, index.h("span", { key: 'e7ef5934e2c03ba12e320fe963b4904237bf05d5', class: "thumb" })), this.label && index.h("span", { key: '90e1fc7560f839ec50014648235cc753c955b82a', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: 'c5150070147fcf40364925a5c164ec80d511b411', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: 'c9cc633cd70f53aa62425faf92e760cf8cb816fd', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
594
594
|
}
|
|
595
595
|
static get formAssociated() { return true; }
|
|
596
596
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-C6khqyw3.js');
|
|
4
4
|
var validationMessage = require('./validation-message-bbtJ2sa_.js');
|
|
5
5
|
|
|
6
6
|
const chCheckboxCss = () => `:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
|
|
@@ -111,7 +111,7 @@ const ChCheckbox = class {
|
|
|
111
111
|
return undefined;
|
|
112
112
|
}
|
|
113
113
|
render() {
|
|
114
|
-
return (index.h(index.Host, { key: '
|
|
114
|
+
return (index.h(index.Host, { key: '3e0f2f162d1ec1a4715b44a37211a30c63f830b2' }, index.h("label", { key: '8042cb81ab53a9451a8757dfa63ef8cea8f41954', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, index.h("input", { key: '0d55f22c4625f48c8bf2eee15a7710cfb80c4328', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && index.h("span", { key: '146e3b4fa88237da4af8f8b0a408909b4d11555e', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: 'd82032ae57e8e818a91fa04cfd5e505dea47c22d', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: '9f418c648d4929086a77ca868a7c13cdccb328cb', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
115
115
|
}
|
|
116
116
|
static get formAssociated() { return true; }
|
|
117
117
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-C6khqyw3.js');
|
|
4
4
|
|
|
5
5
|
const chClusterCss = () => `:host{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;box-sizing:border-box}:host([hidden]){display:none}.cluster--nowrap{flex-wrap:nowrap}.cluster--gap-none{gap:0}.cluster--gap-2xs{gap:var(--spacing-2xs)}.cluster--gap-xs{gap:var(--spacing-xs)}.cluster--gap-sm{gap:var(--spacing-sm)}.cluster--gap-md{gap:var(--spacing-md)}.cluster--gap-lg{gap:var(--spacing-lg)}.cluster--gap-xl{gap:var(--spacing-xl)}.cluster--gap-2xl{gap:var(--spacing-2xl)}.cluster--gap-3xl{gap:var(--spacing-3xl)}.cluster--gap-4xl{gap:var(--spacing-4xl)}.cluster--gap-5xl{gap:var(--spacing-5xl)}.cluster--gap-6xl{gap:var(--spacing-6xl)}.cluster--align-stretch{align-items:stretch}.cluster--align-start{align-items:flex-start}.cluster--align-center{align-items:center}.cluster--align-end{align-items:flex-end}.cluster--align-baseline{align-items:baseline}.cluster--justify-start{justify-content:flex-start}.cluster--justify-center{justify-content:center}.cluster--justify-end{justify-content:flex-end}.cluster--justify-between{justify-content:space-between}.cluster--justify-around{justify-content:space-around}`;
|
|
6
6
|
|
|
@@ -30,13 +30,13 @@ const ChCluster = class {
|
|
|
30
30
|
return GAPS.has(this.gap) ? this.gap : 'md';
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
|
-
return (index.h(index.Host, { key: '
|
|
33
|
+
return (index.h(index.Host, { key: 'd1852bc490835eb559f31039e14b87d59b151b11', class: {
|
|
34
34
|
'cluster': true,
|
|
35
35
|
[`cluster--gap-${this.gapStep}`]: true,
|
|
36
36
|
[`cluster--align-${this.align}`]: true,
|
|
37
37
|
[`cluster--justify-${this.justify}`]: true,
|
|
38
38
|
'cluster--nowrap': !this.wrap,
|
|
39
|
-
} }, index.h("slot", { key: '
|
|
39
|
+
} }, index.h("slot", { key: '7dc3c83e40d8e0d5dd18052bb9c36898a443ce23' })));
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
ChCluster.style = chClusterCss();
|