@devschile/chucao 2.4.0 → 2.5.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/README.md +17 -16
- package/dist/chucao/chucao.css +1 -1
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/index.esm.js +1 -1
- package/dist/chucao/index.esm.js.map +1 -1
- package/dist/chucao/{p-1ebd9dc4.entry.js → p-0bc141a2.entry.js} +2 -2
- package/dist/chucao/{p-449e1ba0.entry.js → p-0e044eff.entry.js} +2 -2
- package/dist/chucao/{p-a07e0e97.entry.js → p-1108062e.entry.js} +2 -2
- package/dist/chucao/{p-85db779c.entry.js → p-26e144ff.entry.js} +2 -2
- package/dist/chucao/p-2c681cc0.entry.js +2 -0
- package/dist/chucao/p-2c681cc0.entry.js.map +1 -0
- package/dist/chucao/p-2e785177.entry.js +2 -0
- package/dist/chucao/{p-0e3c83a6.entry.js.map → p-2e785177.entry.js.map} +1 -1
- package/dist/chucao/{p-6e95f31f.entry.js → p-337d7f68.entry.js} +2 -2
- package/dist/chucao/{p-7c85f5fe.entry.js → p-350f974d.entry.js} +2 -2
- package/dist/chucao/p-4846cac4.entry.js +2 -0
- package/dist/chucao/{p-d0533af6.entry.js → p-6345c9e1.entry.js} +2 -2
- package/dist/chucao/p-957acf39.entry.js +2 -0
- package/dist/chucao/p-957acf39.entry.js.map +1 -0
- package/dist/chucao/{p-34a9d1f4.entry.js → p-97655c41.entry.js} +2 -2
- package/dist/chucao/{p-b5552b50.entry.js → p-9f73855e.entry.js} +2 -2
- package/dist/chucao/p-CIV5Gg1o.js +3 -0
- package/dist/chucao/p-CIV5Gg1o.js.map +1 -0
- package/dist/chucao/p-CnivhwvG.js +2 -0
- package/dist/chucao/p-CnivhwvG.js.map +1 -0
- package/dist/chucao/{p-17451d92.entry.js → p-b53d954e.entry.js} +2 -2
- package/dist/chucao/{p-d776b092.entry.js → p-b6cc08f0.entry.js} +2 -2
- package/dist/chucao/p-be7b5c21.entry.js +2 -0
- package/dist/chucao/p-be7b5c21.entry.js.map +1 -0
- package/dist/chucao/p-c165f839.entry.js +2 -0
- package/dist/chucao/p-c165f839.entry.js.map +1 -0
- package/dist/chucao/{p-56d64d84.entry.js → p-c251b0d1.entry.js} +2 -2
- package/dist/chucao/p-f5b74bca.entry.js +2 -0
- package/dist/chucao/p-f5b74bca.entry.js.map +1 -0
- package/dist/chucao/{p-84d875e9.entry.js → p-f9fe752c.entry.js} +2 -2
- package/dist/chucao/{p-1778a313.entry.js → p-fdf065e6.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +34 -10
- package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ch-cluster.cjs.entry.js +3 -3
- 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 +51 -0
- package/dist/cjs/ch-icon-button.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-icon.cjs.entry.js +38 -0
- package/dist/cjs/ch-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +2 -2
- package/dist/cjs/ch-page-header.cjs.entry.js +45 -0
- package/dist/cjs/ch-page-header.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-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ch-tooltip.cjs.entry.js +204 -5
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/chucao.cjs.js +2 -2
- package/dist/cjs/icons-CNyDgV-q.js +88 -0
- package/dist/cjs/icons-CNyDgV-q.js.map +1 -0
- package/dist/cjs/{index-ysucLiAq.js → index-ByZY6aTj.js} +81 -5
- package/dist/cjs/index-ByZY6aTj.js.map +1 -0
- package/dist/cjs/index.cjs.js +16 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/ch-alert/ch-alert.css +13 -0
- package/dist/collection/components/ch-alert/ch-alert.js +44 -1
- package/dist/collection/components/ch-alert/ch-alert.js.map +1 -1
- package/dist/collection/components/ch-badge/ch-badge.css +30 -1
- package/dist/collection/components/ch-badge/ch-badge.js +35 -1
- package/dist/collection/components/ch-badge/ch-badge.js.map +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-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.css +25 -0
- package/dist/collection/components/ch-icon/ch-icon.js +121 -0
- package/dist/collection/components/ch-icon/ch-icon.js.map +1 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.css +99 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.js +216 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.js.map +1 -0
- 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-page-header/ch-page-header.css +84 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js +162 -0
- package/dist/collection/components/ch-page-header/ch-page-header.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-switch/ch-switch.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-tooltip/ch-tooltip.css +29 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +125 -6
- package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
- package/dist/collection/tokens/tokens.js +12 -0
- package/dist/collection/tokens/tokens.js.map +1 -1
- package/dist/collection/tokens/types.js.map +1 -1
- package/dist/collection/utils/icons.js +82 -0
- package/dist/collection/utils/icons.js.map +1 -0
- package/dist/collection/utils/overlay.js +101 -0
- package/dist/collection/utils/overlay.js.map +1 -0
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-alert.js.map +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-badge.js.map +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-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.d.ts +11 -0
- package/dist/components/ch-icon-button.js +2 -0
- package/dist/components/ch-icon-button.js.map +1 -0
- package/dist/components/ch-icon.d.ts +11 -0
- package/dist/components/ch-icon.js +2 -0
- package/dist/components/ch-icon.js.map +1 -0
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-link.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-page-header.d.ts +11 -0
- package/dist/components/ch-page-header.js +2 -0
- package/dist/components/ch-page-header.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-switch.js +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/ch-tooltip.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-no2_9Jk-.js → p-CV0rD-fF.js} +2 -2
- package/dist/components/p-CnivhwvG.js +2 -0
- package/dist/components/p-CnivhwvG.js.map +1 -0
- package/dist/components/p-qP_9qshx.js +2 -0
- package/dist/components/p-qP_9qshx.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +34 -10
- package/dist/esm/ch-alert_8.entry.js.map +1 -1
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-cluster.entry.js +3 -3
- 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 +49 -0
- package/dist/esm/ch-icon-button.entry.js.map +1 -0
- package/dist/esm/ch-icon.entry.js +36 -0
- package/dist/esm/ch-icon.entry.js.map +1 -0
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +2 -2
- package/dist/esm/ch-page-header.entry.js +43 -0
- package/dist/esm/ch-page-header.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-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +2 -2
- package/dist/esm/ch-tooltip.entry.js +204 -5
- package/dist/esm/ch-tooltip.entry.js.map +1 -1
- package/dist/esm/chucao.js +3 -3
- package/dist/esm/icons-CnivhwvG.js +86 -0
- package/dist/esm/icons-CnivhwvG.js.map +1 -0
- package/dist/esm/{index-DVKZbUp9.js → index-CIV5Gg1o.js} +81 -6
- package/dist/esm/index-CIV5Gg1o.js.map +1 -0
- package/dist/esm/index.js +13 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-alert/ch-alert.d.ts +11 -0
- package/dist/types/components/ch-badge/ch-badge.d.ts +14 -0
- package/dist/types/components/ch-icon/ch-icon.d.ts +29 -0
- package/dist/types/components/ch-icon-button/ch-icon-button.d.ts +36 -0
- package/dist/types/components/ch-page-header/ch-page-header.d.ts +39 -0
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +32 -2
- package/dist/types/components.d.ts +406 -2
- package/dist/types/tokens/tokens.d.ts +12 -0
- package/dist/types/tokens/types.d.ts +2 -1
- package/dist/types/utils/icons.d.ts +15 -0
- package/dist/types/utils/overlay.d.ts +49 -0
- package/dist-react/components.d.ts +12 -1
- package/dist-react/components.js +27 -0
- package/dist-react/components.ts +37 -1
- package/dist-vue/index.d.ts +3 -0
- package/dist-vue/index.js +29 -1
- package/dist-vue/index.ts +35 -1
- package/hydrate/index.js +601 -34
- package/hydrate/index.mjs +601 -34
- package/package.json +91 -4
- package/dist/chucao/p-0e3c83a6.entry.js +0 -2
- package/dist/chucao/p-82216381.entry.js +0 -2
- package/dist/chucao/p-82216381.entry.js.map +0 -1
- package/dist/chucao/p-907195ff.entry.js +0 -2
- package/dist/chucao/p-DVKZbUp9.js +0 -3
- package/dist/chucao/p-DVKZbUp9.js.map +0 -1
- package/dist/chucao/p-b392021c.entry.js +0 -2
- package/dist/chucao/p-b392021c.entry.js.map +0 -1
- package/dist/cjs/index-ysucLiAq.js.map +0 -1
- package/dist/components/p-DQOKq7af.js +0 -2
- package/dist/components/p-DQOKq7af.js.map +0 -1
- package/dist/esm/index-DVKZbUp9.js.map +0 -1
- /package/dist/chucao/{p-1ebd9dc4.entry.js.map → p-0bc141a2.entry.js.map} +0 -0
- /package/dist/chucao/{p-449e1ba0.entry.js.map → p-0e044eff.entry.js.map} +0 -0
- /package/dist/chucao/{p-a07e0e97.entry.js.map → p-1108062e.entry.js.map} +0 -0
- /package/dist/chucao/{p-85db779c.entry.js.map → p-26e144ff.entry.js.map} +0 -0
- /package/dist/chucao/{p-6e95f31f.entry.js.map → p-337d7f68.entry.js.map} +0 -0
- /package/dist/chucao/{p-7c85f5fe.entry.js.map → p-350f974d.entry.js.map} +0 -0
- /package/dist/chucao/{p-907195ff.entry.js.map → p-4846cac4.entry.js.map} +0 -0
- /package/dist/chucao/{p-d0533af6.entry.js.map → p-6345c9e1.entry.js.map} +0 -0
- /package/dist/chucao/{p-34a9d1f4.entry.js.map → p-97655c41.entry.js.map} +0 -0
- /package/dist/chucao/{p-b5552b50.entry.js.map → p-9f73855e.entry.js.map} +0 -0
- /package/dist/chucao/{p-17451d92.entry.js.map → p-b53d954e.entry.js.map} +0 -0
- /package/dist/chucao/{p-d776b092.entry.js.map → p-b6cc08f0.entry.js.map} +0 -0
- /package/dist/chucao/{p-56d64d84.entry.js.map → p-c251b0d1.entry.js.map} +0 -0
- /package/dist/chucao/{p-84d875e9.entry.js.map → p-f9fe752c.entry.js.map} +0 -0
- /package/dist/chucao/{p-1778a313.entry.js.map → p-fdf065e6.entry.js.map} +0 -0
- /package/dist/components/{p-no2_9Jk-.js.map → p-CV0rD-fF.js.map} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChIconButton extends Components.ChIconButton, HTMLElement {}
|
|
4
|
+
export const ChIconButton: {
|
|
5
|
+
prototype: ChIconButton;
|
|
6
|
+
new (): ChIconButton;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as i,H as t,c as e,h as n,d as o,t as a}from"./p-qP_9qshx.js";import{c as r}from"./p-CnivhwvG.js";const s=()=>`: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 c=i(class i extends t{constructor(i){super();if(i!==false){this.__registerHost()}this.__attachShadow();this.chClick=e(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?r[this.name]:undefined;return n(o,{key:"235a3813a30b5e98cc0b37774e0fe9cce680ac4c"},n("button",{key:"e2d76ea663bb4746f1431affde538c2429033615",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},n("svg",{key:"3cbc2fc57cf274920dbb12fb7f0a6eed189e7b23",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=>n(i.tag,i.attrs))))))}static get style(){return s()}},[513,"ch-icon-button",{name:[1],label:[1],size:[1],type:[1],disabled:[4],loading:[4]}]);function d(){if(typeof customElements==="undefined"){return}const i=["ch-icon-button"];i.forEach((i=>{switch(i){case"ch-icon-button":if(!customElements.get(a(i))){customElements.define(a(i),c)}break}}))}d();const l=c;const u=d;export{l as ChIconButton,u as defineCustomElement};
|
|
2
|
+
//# sourceMappingURL=ch-icon-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["chIconButtonCss","ChIconButton","__stencil_proxyCustomElement","HTMLElement","name","label","size","type","disabled","loading","chClick","handleClick","event","this","preventDefault","stopImmediatePropagation","emit","render","shapes","chIcons","undefined","h","Host","key","class","onClick","viewBox","fill","stroke","focusable","map","shape","tag","attrs"],"sources":["src/components/ch-icon-button/ch-icon-button.css?tag=ch-icon-button&encapsulation=shadow","src/components/ch-icon-button/ch-icon-button.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-pill);\n background: transparent;\n color: var(--text);\n cursor: pointer;\n transition:\n background-color var(--duration-normal) var(--easing-default),\n border-color var(--duration-normal) var(--easing-default),\n color var(--duration-normal) var(--easing-default);\n}\n\n/* Square hit area at each size, matching the height of the same-size ch-button\n so the two line up in a toolbar. */\n.button--sm {\n width: calc(var(--icon-size-sm) + 2 * var(--spacing-md));\n height: calc(var(--icon-size-sm) + 2 * var(--spacing-md));\n}\n\n.button--md {\n width: calc(var(--icon-size-md) + 2 * var(--spacing-xl));\n height: calc(var(--icon-size-md) + 2 * var(--spacing-xl));\n}\n\n.button--lg {\n width: calc(var(--icon-size-lg) + 2 * var(--spacing-2xl));\n height: calc(var(--icon-size-lg) + 2 * var(--spacing-2xl));\n}\n\n.button--sm .icon {\n width: var(--icon-size-sm);\n height: var(--icon-size-sm);\n}\n\n.button--md .icon {\n width: var(--icon-size-md);\n height: var(--icon-size-md);\n}\n\n.button--lg .icon {\n width: var(--icon-size-lg);\n height: var(--icon-size-lg);\n}\n\n.button:hover:not([aria-disabled='true']) {\n border-color: var(--border-hover);\n background: var(--surface-hover);\n}\n\n.button:focus-visible {\n outline: var(--focus-outline-width) solid var(--accent);\n outline-offset: var(--focus-outline-offset);\n}\n\n/* Disabled stays focusable on purpose: dropping focus to <body> when an action\n completes is worse than a button that can still be read. */\n.button[aria-disabled='true'] {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.button[aria-busy='true'] {\n cursor: progress;\n}\n\n.button[aria-busy='true'] .icon {\n animation: ch-icon-button-spin var(--duration-spin) linear infinite;\n}\n\n@keyframes ch-icon-button-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (pointer: coarse) {\n .button--sm {\n min-width: 44px;\n min-height: 44px;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .button {\n transition: none;\n }\n\n .button[aria-busy='true'] .icon {\n animation: none;\n }\n}\n","import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nimport { chIcons, type ChIconName } from '../../utils/icons';\n\nexport type ChIconButtonSize = 'sm' | 'md' | 'lg';\n\n/**\n * A button whose only content is an icon.\n *\n * The label is required rather than optional. An icon-only button without an\n * accessible name is unusable by voice, screen reader or automation, and there\n * is no adjacent text to fall back on — the same reasoning as `ch-modal`, and\n * the reason this component exists instead of letting consumers bolt an icon\n * slot onto `ch-button` and forget the name.\n */\n@Component({\n tag: 'ch-icon-button',\n styleUrl: 'ch-icon-button.css',\n shadow: true,\n})\nexport class ChIconButton {\n /** The glyph to draw. */\n @Prop() name!: ChIconName;\n\n /**\n * Accessible name, set as `aria-label`. Required: say what the button does\n * (\"Eliminar producto\"), not what the glyph is (\"papelera\").\n */\n @Prop() label!: string;\n\n /** Visual size. `md` matches the height of a default `ch-button`. */\n @Prop() size: ChIconButtonSize = 'md';\n\n /** Native button type, defaulting to `button` so it never submits a form by accident. */\n @Prop() type: 'button' | 'submit' | 'reset' = 'button';\n\n @Prop() disabled = false;\n\n /**\n * Blocks pointer and keyboard activation and marks the button `aria-busy`\n * while keeping it focusable, so focus does not fall to `<body>` when an\n * action completes.\n */\n @Prop() loading = false;\n\n /** Emitted on click. A click while disabled or loading emits nothing. */\n @Event() chClick: EventEmitter<MouseEvent>;\n\n private handleClick = (event: MouseEvent) => {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n this.chClick.emit(event);\n };\n\n render() {\n const shapes = this.name ? chIcons[this.name] : undefined;\n\n return (\n <Host>\n <button\n class={`button button--${this.size}`}\n type={this.type}\n aria-label={this.label}\n aria-busy={this.loading ? 'true' : undefined}\n aria-disabled={this.disabled ? 'true' : undefined}\n onClick={this.handleClick}\n >\n <svg\n class=\"icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n {(shapes ?? []).map(shape => h(shape.tag, shape.attrs))}\n </svg>\n </button>\n </Host>\n );\n }\n}\n"],"mappings":"2GAAA,MAAMA,EAAkB,IAAM,ksD,MCoBjBC,EAAYC,EAAA,MAAAD,UAAAE,E,gHAEfC,KAMAC,MAGAC,KAAyB,KAGzBC,KAAsC,SAEtCC,SAAW,MAOXC,QAAU,MAGTC,QAEDC,YAAeC,IACrB,GAAIC,KAAKL,UAAYK,KAAKJ,QAAS,CACjCG,EAAME,iBACNF,EAAMG,2BACN,M,CAEFF,KAAKH,QAAQM,KAAKJ,EAAM,EAG1B,MAAAK,GACE,MAAMC,EAASL,KAAKT,KAAOe,EAAQN,KAAKT,MAAQgB,UAEhD,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,UAAAE,IAAA,2CACEC,MAAO,kBAAkBX,KAAKP,OAC9BC,KAAMM,KAAKN,KAAI,aACHM,KAAKR,MAAK,YACXQ,KAAKJ,QAAU,OAASW,UAAS,gBAC7BP,KAAKL,SAAW,OAASY,UACxCK,QAASZ,KAAKF,aAEdU,EAAA,OAAAE,IAAA,2CACEC,MAAM,OACNE,QAAQ,YACRC,KAAK,OACLC,OAAO,eAAc,eACR,IAAG,iBACD,QAAO,kBACN,QAAO,cACX,OACZC,UAAU,UAERX,GAAU,IAAIY,KAAIC,GAASV,EAAEU,EAAMC,IAAKD,EAAME,W","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChIcon extends Components.ChIcon, HTMLElement {}
|
|
4
|
+
export const ChIcon: {
|
|
5
|
+
prototype: ChIcon;
|
|
6
|
+
new (): ChIcon;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as i,h as s,d as n,t}from"./p-qP_9qshx.js";import{c as o}from"./p-CnivhwvG.js";const c=()=>`:host{display:inline-flex;line-height:0}.icon{display:block;flex:none;color:inherit}.icon--sm{width:var(--icon-size-sm);height:var(--icon-size-sm)}.icon--md{width:var(--icon-size-md);height:var(--icon-size-md)}.icon--lg{width:var(--icon-size-lg);height:var(--icon-size-lg)}`;const r=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}name;size="md";label;render(){const e=this.name?o[this.name]:undefined;const i=!this.label;return s(n,{key:"46040274042301b799f103c483281a0c8088c23d"},s("svg",{key:"9e116b6983020700ceababc691216b1f05d1c460",class:`icon icon--${this.size}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",role:i?undefined:"img","aria-label":this.label,"aria-hidden":i?"true":undefined,focusable:"false"},(e??[]).map((e=>s(e.tag,e.attrs)))))}static get style(){return c()}},[513,"ch-icon",{name:[1],size:[1],label:[1]}]);function a(){if(typeof customElements==="undefined"){return}const e=["ch-icon"];e.forEach((e=>{switch(e){case"ch-icon":if(!customElements.get(t(e))){customElements.define(t(e),r)}break}}))}a();const l=r;const h=a;export{l as ChIcon,h as defineCustomElement};
|
|
2
|
+
//# sourceMappingURL=ch-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["chIconCss","ChIcon","__stencil_proxyCustomElement","HTMLElement","name","size","label","render","shapes","this","chIcons","undefined","decorative","h","Host","key","class","viewBox","fill","stroke","role","focusable","map","shape","tag","attrs"],"sources":["src/components/ch-icon/ch-icon.css?tag=ch-icon&encapsulation=shadow","src/components/ch-icon/ch-icon.tsx"],"sourcesContent":[":host {\n display: inline-flex;\n line-height: 0;\n}\n\n.icon {\n display: block;\n flex: none;\n color: inherit;\n}\n\n.icon--sm {\n width: var(--icon-size-sm);\n height: var(--icon-size-sm);\n}\n\n.icon--md {\n width: var(--icon-size-md);\n height: var(--icon-size-md);\n}\n\n.icon--lg {\n width: var(--icon-size-lg);\n height: var(--icon-size-lg);\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nimport { chIcons, type ChIconName } from '../../utils/icons';\n\nexport type ChIconSize = 'sm' | 'md' | 'lg';\n\n/**\n * A single Lucide glyph.\n *\n * Decorative by default: the icon is hidden from assistive technology unless\n * you give it a `label`, because most icons sit next to text that already says\n * what they mean and a second announcement is noise. Set `label` only when the\n * icon carries meaning on its own; a control whose only content is an icon\n * should use `ch-icon-button`, which requires the name.\n */\n@Component({\n tag: 'ch-icon',\n styleUrl: 'ch-icon.css',\n shadow: true,\n})\nexport class ChIcon {\n /**\n * Which glyph to draw. Unknown values render nothing rather than throwing,\n * so a stale name in a data payload cannot break the page.\n */\n @Prop() name!: ChIconName;\n\n /**\n * `sm` is 16px, `md` is 20px and `lg` is 24px — the sizes the scale's line\n * heights were built around.\n */\n @Prop() size: ChIconSize = 'md';\n\n /**\n * Accessible name. When set, the icon becomes `role=\"img\"` and is announced;\n * when omitted it is `aria-hidden`.\n */\n @Prop() label?: string;\n\n render() {\n const shapes = this.name ? chIcons[this.name] : undefined;\n const decorative = !this.label;\n\n return (\n <Host>\n <svg\n class={`icon icon--${this.size}`}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n role={decorative ? undefined : 'img'}\n aria-label={this.label}\n aria-hidden={decorative ? 'true' : undefined}\n focusable=\"false\"\n >\n {(shapes ?? []).map(shape => h(shape.tag, shape.attrs))}\n </svg>\n </Host>\n );\n }\n}\n"],"mappings":"+FAAA,MAAMA,EAAY,IAAM,oR,MCoBXC,EAAMC,EAAA,MAAAD,UAAAE,E,iFAKTC,KAMAC,KAAmB,KAMnBC,MAER,MAAAC,GACE,MAAMC,EAASC,KAAKL,KAAOM,EAAQD,KAAKL,MAAQO,UAChD,MAAMC,GAAcH,KAAKH,MAEzB,OACEO,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,OAAAE,IAAA,2CACEC,MAAO,cAAcP,KAAKJ,OAC1BY,QAAQ,YACRC,KAAK,OACLC,OAAO,eAAc,eACR,IAAG,iBACD,QAAO,kBACN,QAChBC,KAAMR,EAAaD,UAAY,MAAK,aACxBF,KAAKH,MAAK,cACTM,EAAa,OAASD,UACnCU,UAAU,UAERb,GAAU,IAAIc,KAAIC,GAASV,EAAEU,EAAMC,IAAKD,EAAME,U","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as i,c as r,h as
|
|
1
|
+
import{p as t,H as i,c as r,h as e,d as s,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`: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)}`;let d=0;const h=t(class t extends i{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chInput=r(this,"chInput");this.chChange=r(this,"chChange");this.internals=this.attachInternals()}inputId=`ch-input-${++d}`;hintId=`${this.inputId}-hint`;errorId=`${this.inputId}-error`;initialValue="";internals;formDisabled=false;get host(){return this}label;type="text";value="";placeholder;name;disabled=false;required=false;hint;errorMessage;invalid=false;chInput;chChange;handleInput=t=>{this.value=t.target.value;this.chInput.emit(this.value)};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);const{flags:i,message:r}=o({required:this.required,empty:this.value==="",invalid:this.invalid,errorMessage:this.errorMessage});t.setValidity(i,r)}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}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return e(s,{key:"e0bbbb592d8c90897f48060f570606453c125ce5"},this.label&&e("label",{key:"2748fad40236a1ebe4acba6405c73f26e1284dd1",class:"label",htmlFor:this.inputId},this.label),e("input",{key:"b7c6ed3c9135ecaddde161a88077bd415900b465",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)&&e("p",{key:"f87c7300a6cfca70770cd9eb05e5ba242698b3cf",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&e("p",{key:"e8ed5e8059e06d23c0e742de33c0a9b651e1ced4",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}]}}static get style(){return n()}},[577,"ch-input",{label:[1],type:[1],value:[1025],placeholder:[1],name:[513],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function c(){if(typeof customElements==="undefined"){return}const t=["ch-input"];t.forEach((t=>{switch(t){case"ch-input":if(!customElements.get(a(t))){customElements.define(a(t),h)}break}}))}c();const l=h;const u=c;export{l as ChInput,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-input.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as i,h as r,d as n,t as a}from"./p-
|
|
1
|
+
import{p as t,H as e,c as i,h as r,d as n,t as a}from"./p-qP_9qshx.js";const o=()=>`:host{display:inline}.link{color:var(--accent);font-weight:var(--typography-weight-semibold);text-decoration:var(--ch-link-text-decoration, underline);text-decoration-thickness:var(--border-width);text-underline-offset:var(--spacing-shift);border-radius:var(--radius-sm);transition:color var(--duration-normal) var(--easing-default), opacity var(--duration-normal) var(--easing-default)}.link:hover{color:var(--accent-hover)}.link:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.link--muted{color:var(--text-muted);text-decoration:none}.link--muted:hover{color:var(--text)}.link--disabled{color:var(--text-muted);text-decoration:none;opacity:var(--opacity-disabled);cursor:not-allowed}`;const s=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chClick=i(this,"chClick")}href;target;variant="default";disabled=false;chClick;handleClick=t=>{this.chClick.emit(t)};render(){if(this.disabled){return r(n,null,r("span",{class:{link:true,[`link--${this.variant}`]:true,"link--disabled":true},part:"link","aria-disabled":"true"},r("slot",null)))}return r(n,null,r("a",{class:{link:true,[`link--${this.variant}`]:true},part:"link",href:this.href,target:this.target,rel:this.target==="_blank"?"noopener noreferrer":undefined,onClick:this.handleClick},r("slot",null)))}static get style(){return o()}},[769,"ch-link",{href:[1],target:[1],variant:[1],disabled:[4]}]);function l(){if(typeof customElements==="undefined"){return}const t=["ch-link"];t.forEach((t=>{switch(t){case"ch-link":if(!customElements.get(a(t))){customElements.define(a(t),s)}break}}))}l();const c=s;const d=l;export{c as ChLink,d as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-link.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as
|
|
1
|
+
import{p as e,H as t,c as a,h as i,d as s,t as o}from"./p-qP_9qshx.js";import{l,u as r}from"./p-d8DfpzMR.js";const c=()=>`.modal{box-sizing:border-box;max-height:calc(100vh - var(--spacing-6xl));padding:var(--spacing-5xl);border:var(--border-width) solid var(--border);border-radius:var(--radius);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-md)}.modal--sm{max-width:min(var(--ch-modal-width, 24rem), calc(100vw - var(--spacing-6xl)))}.modal--md{max-width:min(var(--ch-modal-width, 32rem), calc(100vw - var(--spacing-6xl)))}.modal--lg{max-width:min(var(--ch-modal-width, 48rem), calc(100vw - var(--spacing-6xl)))}.modal::backdrop{background:var(--color-scrim-default);backdrop-filter:blur(var(--effect-blur))}.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--spacing-2xl);margin-bottom:var(--spacing-2xl)}.modal-body{overflow-y:auto}.modal-close{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:var(--spacing-2xs) var(--spacing-md);border:0;border-radius:var(--radius);background:none;color:var(--text-muted);cursor:pointer;font-family:var(--font-heading);font-size:var(--typography-size-lg);line-height:1;transition:background-color var(--duration-normal) var(--easing-default)}.modal-close:hover{background:var(--surface-hover);color:var(--text)}.modal-close:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}@media (pointer: coarse){.modal-close{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.modal-close{transition:none}}`;const n=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chOpen=a(this,"chOpen");this.chClose=a(this,"chClose")}get el(){return this}open=false;label;closeLabel;size="md";chOpen;chClose;dialog;scrollLocked=false;pointerDownedOutside=false;componentDidLoad(){this.dialog?.addEventListener("close",this.handleNativeClose);this.dialog?.addEventListener("pointerdown",this.handlePointerDown);this.dialog?.addEventListener("click",this.handleClick);if(this.open){this.showDialog()}}disconnectedCallback(){this.dialog?.removeEventListener("close",this.handleNativeClose);this.dialog?.removeEventListener("pointerdown",this.handlePointerDown);this.dialog?.removeEventListener("click",this.handleClick);this.unlockScroll()}handleOpenChange(e){if(e){this.showDialog()}else{this.closeDialog()}}showDialog(){if(typeof this.dialog?.showModal!=="function"){return}this.lockScroll();this.dialog.showModal();this.chOpen.emit()}closeDialog(){if(typeof this.dialog?.close==="function"&&this.dialog.open){this.dialog.close()}}lockScroll(){if(this.scrollLocked){return}this.scrollLocked=true;l()}unlockScroll(){if(!this.scrollLocked){return}this.scrollLocked=false;r()}isOnBackdrop(e){if(!this.dialog||e.target!==this.dialog){return false}const t=this.dialog.getBoundingClientRect();return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}handlePointerDown=e=>{this.pointerDownedOutside=this.isOnBackdrop(e)};handleClick=e=>{const t=this.pointerDownedOutside&&this.isOnBackdrop(e);this.pointerDownedOutside=false;if(t){this.closeDialog()}};handleNativeClose=()=>{this.unlockScroll();if(this.open){this.open=false}this.chClose.emit()};handleCloseClick=()=>{if(typeof this.dialog?.close==="function"&&this.dialog.open){this.dialog.close();return}this.open=false;this.chClose.emit()};render(){return i(s,{key:"c50dad31f2b1897549837aed1d8e6df2df8cd491"},i("dialog",{key:"327f6ef27b447386c180248bbeab4cc3ee0160eb",class:{modal:true,[`modal--${this.size}`]:true},"aria-label":this.label,ref:e=>this.dialog=e},i("div",{key:"c8c2f8eacf26c817073920bc2ef1c7ac89fe8208",class:"modal-head"},i("slot",{key:"73d0e3ae45c7936d345ce6f3262d9ce08058b9e7",name:"heading"}),this.closeLabel&&i("button",{key:"a72d04701cd9d60e6c1486f5c38f46f7f3ff1da5",class:"modal-close",type:"button","aria-label":this.closeLabel,onClick:this.handleCloseClick},i("span",{key:"10d1b697611309e79f28dcad9385fa7e4300c916","aria-hidden":"true"},"×"))),i("div",{key:"040029fdc7dc7544a15b51f3c0b7d855902b7028",class:"modal-body"},i("slot",{key:"00291b7d78f49dcf366c1780562893260be3dc74"}))))}static get watchers(){return{open:[{handleOpenChange:0}]}}static get style(){return c()}},[769,"ch-modal",{open:[1028],label:[1],closeLabel:[1,"close-label"],size:[1]},undefined,{open:[{handleOpenChange:0}]}]);function d(){if(typeof customElements==="undefined"){return}const e=["ch-modal"];e.forEach((e=>{switch(e){case"ch-modal":if(!customElements.get(o(e))){customElements.define(o(e),n)}break}}))}d();const h=n;const f=d;export{h as ChModal,f as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-modal.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChPageHeader extends Components.ChPageHeader, HTMLElement {}
|
|
4
|
+
export const ChPageHeader: {
|
|
5
|
+
prototype: ChPageHeader;
|
|
6
|
+
new (): ChPageHeader;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as a,h as t,d as r,t as s}from"./p-qP_9qshx.js";const i=()=>`:host{display:block}.header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:var(--spacing-2xl);padding-bottom:var(--spacing-2xl);border-bottom:var(--border-width) solid var(--border)}.header-text{display:flex;flex-direction:column;gap:var(--spacing-xs);flex:1 1 20rem;min-width:0}.header-eyebrow{margin:0;color:var(--text-secondary);font-family:var(--font-heading);font-size:var(--typography-size-xs);letter-spacing:var(--typography-tracking-badge);text-transform:uppercase}.header-title{margin:0;color:var(--text);font-family:var(--font-heading);font-size:var(--typography-size-xl);font-weight:var(--typography-weight-bold);line-height:1.2;overflow-wrap:anywhere}.header-description{margin:0;color:var(--text-secondary);font-size:var(--typography-size-sm);line-height:1.5;overflow-wrap:anywhere}.header-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacing-md);max-width:100%}.header-actions:empty{display:none}.header--stacked .header-actions{flex-basis:100%}@media (max-width: 30rem){.header{flex-direction:column}.header-actions{width:100%}}@media (forced-colors: active){.header{border-bottom-color:CanvasText}}`;const d=e(class e extends a{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}title;headingLevel="h1";eyebrow;description;actionsStacked=false;render(){const e=this.headingLevel;return t(r,{key:"02317c9b8a8164400ac269cbfd872e066e3269e3"},t("div",{key:"c1ab176079e95f4854826588405cd49c1bc42b58",class:{header:true,"header--stacked":this.actionsStacked}},t("div",{key:"57553e0d8ac563dfd55bedb23fb6896f922c187c",class:"header-text"},this.eyebrow&&t("p",{key:"b38cbdfbc5a08cfddf60e9f82481df3ed8ad48e6",class:"header-eyebrow"},this.eyebrow),t(e,{key:"521003f555a4adaae81bac11a6410638db923399",class:"header-title"},this.title),this.description&&t("p",{key:"0625bcd1903f52dfe16963bfc6d3ccf7e404d13a",class:"header-description"},this.description)),t("div",{key:"23b65e1729bfa24324c24958b946435ff247cb4d",class:"header-actions"},t("slot",{key:"45b4c24e4ce2bb4edc2929a2f17563260efb410f",name:"actions"}))))}static get style(){return i()}},[769,"ch-page-header",{title:[1],headingLevel:[1,"heading-level"],eyebrow:[1],description:[1],actionsStacked:[4,"actions-stacked"]}]);function c(){if(typeof customElements==="undefined"){return}const e=["ch-page-header"];e.forEach((e=>{switch(e){case"ch-page-header":if(!customElements.get(s(e))){customElements.define(s(e),d)}break}}))}c();const o=d;const n=c;export{o as ChPageHeader,n as defineCustomElement};
|
|
2
|
+
//# sourceMappingURL=ch-page-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["chPageHeaderCss","ChPageHeader","__stencil_proxyCustomElement","HTMLElement","title","headingLevel","eyebrow","description","actionsStacked","render","Heading","this","h","Host","key","class","header","name"],"sources":["src/components/ch-page-header/ch-page-header.css?tag=ch-page-header&encapsulation=shadow","src/components/ch-page-header/ch-page-header.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.header {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--spacing-2xl);\n padding-bottom: var(--spacing-2xl);\n border-bottom: var(--border-width) solid var(--border);\n}\n\n.header-text {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-xs);\n /* Lets a long, unbroken title shrink instead of pushing the actions off the\n row at narrow widths. */\n flex: 1 1 20rem;\n min-width: 0;\n}\n\n.header-eyebrow {\n margin: 0;\n color: var(--text-secondary);\n font-family: var(--font-heading);\n font-size: var(--typography-size-xs);\n letter-spacing: var(--typography-tracking-badge);\n text-transform: uppercase;\n}\n\n.header-title {\n margin: 0;\n color: var(--text);\n font-family: var(--font-heading);\n font-size: var(--typography-size-xl);\n font-weight: var(--typography-weight-bold);\n line-height: 1.2;\n overflow-wrap: anywhere;\n}\n\n.header-description {\n margin: 0;\n color: var(--text-secondary);\n font-size: var(--typography-size-sm);\n line-height: 1.5;\n overflow-wrap: anywhere;\n}\n\n.header-actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--spacing-md);\n /* Never wider than the row: the actions wrap inside it rather than forcing\n horizontal overflow on a 390px screen. */\n max-width: 100%;\n}\n\n.header-actions:empty {\n display: none;\n}\n\n.header--stacked .header-actions {\n flex-basis: 100%;\n}\n\n@media (max-width: 30rem) {\n .header {\n flex-direction: column;\n }\n\n .header-actions {\n width: 100%;\n }\n}\n\n@media (forced-colors: active) {\n .header {\n border-bottom-color: CanvasText;\n }\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChPageHeaderHeadingLevel = 'h1' | 'h2' | 'h3';\n\n/**\n * The heading block at the top of a page: title, optional eyebrow and\n * description, and a trailing actions area.\n *\n * The title is a `title` prop rather than a slot so the heading level always\n * matches the page. A slotted heading lets a consumer nest a second `h1`, and\n * \"one top-level heading per page\" then depends on every caller remembering it;\n * here the level is explicit and defaults to `h1`. The actions wrap rather than\n * push the page sideways at 390px, and the DOM order keeps the heading before\n * the actions so reading and focus order still start with the title.\n */\n@Component({\n tag: 'ch-page-header',\n styleUrl: 'ch-page-header.css',\n shadow: true,\n})\nexport class ChPageHeader {\n /**\n * The page title. Rendered as a real heading, so it also works as the\n * accessible name of the page region.\n */\n @Prop() title!: string;\n\n /**\n * Heading element to render. Use `h2` (or `h3`) when the page already has a\n * higher-level heading above this block, so the document outline stays valid.\n */\n @Prop() headingLevel: ChPageHeaderHeadingLevel = 'h1';\n\n /**\n * Optional small label above the title, as slotted content. Use it for a\n * section or entity kind (\"Proyecto\", \"Factura #1042\"), not for the title.\n */\n @Prop() eyebrow?: string;\n\n /**\n * Optional supporting line under the title.\n */\n @Prop() description?: string;\n\n /**\n * Puts the actions below the title instead of beside it. Use it when the\n * actions are too wide to sit on the same row even after wrapping.\n */\n @Prop() actionsStacked = false;\n\n render() {\n const Heading = this.headingLevel;\n\n return (\n <Host>\n <div class={{ 'header': true, 'header--stacked': this.actionsStacked }}>\n <div class=\"header-text\">\n {this.eyebrow && <p class=\"header-eyebrow\">{this.eyebrow}</p>}\n <Heading class=\"header-title\">{this.title}</Heading>\n {this.description && <p class=\"header-description\">{this.description}</p>}\n </div>\n <div class=\"header-actions\">\n <slot name=\"actions\"></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAkB,IAAM,upC,MCoBjBC,EAAYC,EAAA,MAAAD,UAAAE,E,iFAKfC,MAMAC,aAAyC,KAMzCC,QAKAC,YAMAC,eAAiB,MAEzB,MAAAC,GACE,MAAMC,EAAUC,KAAKN,aAErB,OACEO,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,OAAAE,IAAA,2CAAKC,MAAO,CAAEC,OAAU,KAAM,kBAAmBL,KAAKH,iBACpDI,EAAA,OAAAE,IAAA,2CAAKC,MAAM,eACRJ,KAAKL,SAAWM,EAAA,KAAAE,IAAA,2CAAGC,MAAM,kBAAkBJ,KAAKL,SACjDM,EAACF,EAAO,CAAAI,IAAA,2CAACC,MAAM,gBAAgBJ,KAAKP,OACnCO,KAAKJ,aAAeK,EAAA,KAAAE,IAAA,2CAAGC,MAAM,sBAAsBJ,KAAKJ,cAE3DK,EAAA,OAAAE,IAAA,2CAAKC,MAAM,kBACTH,EAAA,QAAAE,IAAA,2CAAMG,KAAK,c","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as i,c as t,h as s,d as r,t as a}from"./p-
|
|
1
|
+
import{p as e,H as i,c as t,h as s,d as r,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.radio-group{display:flex;flex-direction:column;gap:var(--spacing-lg)}.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:50%;background:var(--surface);cursor:pointer;transition:border-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)}.input:checked::before{content:'';width:var(--spacing-md);height:var(--spacing-md);border-radius:50%;background:var(--accent)}.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 l=0;const d=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=t(this,"chChange");this.internals=this.attachInternals()}groupId=`ch-radio-${++l}`;labelId=`${this.groupId}-label`;hintId=`${this.groupId}-hint`;errorId=`${this.groupId}-error`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;name;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value??null);const{flags:i,message:t}=o({required:this.required,empty:!this.value,invalid:this.invalid,errorMessage:this.errorMessage});e.setValidity(i,t)}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(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){const e=this.name||`${this.groupId}-group`;return s(r,{key:"9803d5b41d3985503d1b304d53504239d2a2de1d"},this.label&&s("span",{key:"f75cf217d50a300e5c6ddcdcfb9c5832e1f6b964",class:"group-label",id:this.labelId},this.label),s("div",{key:"d8e9e24e82dfb77f728e8d9c994102202a9ce85b",class:"radio-group",role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((i=>s("label",{class:{control:true,"control--disabled":this.disabled||this.formDisabled||i.disabled}},s("input",{class:{input:true,"input--invalid":this.invalid},type:"radio",name:e,value:i.value,checked:i.value===this.value,disabled:this.disabled||this.formDisabled||i.disabled,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),s("span",{class:"mark"}),s("span",{class:"label-text"},i.label))))),this.hint&&!(this.invalid&&this.errorMessage)&&s("p",{key:"91bed0d5cd70a032de7b8ba6e298903b387e1a4a",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&s("p",{key:"a2e6d6c87d60e98ac3d396f7dde907ce1e46946a",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}]}}static get style(){return n()}},[577,"ch-radio",{label:[1],options:[16],value:[1025],name:[513],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function c(){if(typeof customElements==="undefined"){return}const e=["ch-radio"];e.forEach((e=>{switch(e){case"ch-radio":if(!customElements.get(a(e))){customElements.define(a(e),d)}break}}))}c();const h=d;const u=c;export{h as ChRadio,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-radio.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as s,h as a,d as i,t as r}from"./p-
|
|
1
|
+
import{p as e,H as t,c as s,h as a,d as i,t as r}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`: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 l=0;const c=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=s(this,"chChange");this.internals=this.attachInternals()}groupId=`ch-segmented-${++l}`;labelId=`${this.groupId}-label`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;size="md";name;disabled=false;required=false;chChange;handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value??null);const{flags:t,message:s}=o({required:this.required,empty:!this.value});e.setValidity(t,s)}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(e){this.formDisabled=e}render(){const e=this.name||`${this.groupId}-group`;return a(i,{key:"d6a9a720a1a210c73711cff1f7cd6c1ffa0c89b2"},this.label&&a("span",{key:"af5fb9ab87e918ac6047ebd6e65e540044c6a2d0",class:"group-label",id:this.labelId},this.label),a("div",{key:"8dd76ea8d792d918ac5e413946e8a08cb89480c7",class:{segmented:true,[`segmented--${this.size}`]:true},role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((t=>a("label",{class:{control:true,"control--disabled":this.disabled||this.formDisabled||t.disabled}},a("input",{class:"input",type:"radio",name:e,value:t.value,checked:t.value===this.value,disabled:this.disabled||this.formDisabled||t.disabled,onChange:this.handleChange}),a("span",{class:"label-text"},t.label))))))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}]}}static get style(){return n()}},[577,"ch-segmented-control",{label:[1],options:[16],value:[1025],size:[1],name:[513],disabled:[516],required:[516],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const e=["ch-segmented-control"];e.forEach((e=>{switch(e){case"ch-segmented-control":if(!customElements.get(r(e))){customElements.define(r(e),c)}break}}))}d();const h=c;const u=d;export{h as ChSegmentedControl,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-segmented-control.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as r,d as i,t as a}from"./p-
|
|
1
|
+
import{p as e,H as s,c as t,h as r,d as i,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const c=()=>`: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)}.select{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;cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.select:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.select--invalid{border-color:var(--color-status-warning)}.select--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .select,:host(:user-invalid) .select{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .select:focus,:host(:user-invalid) .select:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.select:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.select option{background:var(--bg);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 d=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=t(this,"chChange");this.internals=this.attachInternals()}selectId=`ch-select-${++n}`;hintId=`${this.selectId}-hint`;errorId=`${this.selectId}-error`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;placeholder;name;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value??"");const{flags:s,message:t}=o({required:this.required,empty:!this.value,invalid:this.invalid,errorMessage:this.errorMessage});e.setValidity(s,t)}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(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return r(i,{key:"b01c1dca70dbf88556521faa1be7430dc3d2355c"},this.label&&r("label",{key:"265a09b70dafca0c9330ceaec2477b6b203a71eb",class:"label",htmlFor:this.selectId},this.label),r("select",{key:"43b387edff4fd326beac608fa16e50f3407e8cac",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&&r("option",{key:"456e5220d2fd6fdb2a2171d10bcd11c6d2c58956",value:"",disabled:true,hidden:true,selected:!this.value},this.placeholder),this.options.map((e=>r("option",{value:e.value,disabled:e.disabled,selected:e.value===this.value},e.label)))),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"7f4609f6441f9ce6c5f13b4a12875d85c110ccd8",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"e05a04a3f43ad055cd7cc57deb48f8b19d1a7084",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}]}}static get style(){return c()}},[577,"ch-select",{label:[1],options:[16],value:[1025],placeholder:[1],name:[513],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function l(){if(typeof customElements==="undefined"){return}const e=["ch-select"];e.forEach((e=>{switch(e){case"ch-select":if(!customElements.get(a(e))){customElements.define(a(e),d)}break}}))}l();const h=d;const u=l;export{h as ChSelect,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-select.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,h as s,d as i,t as n}from"./p-
|
|
1
|
+
import{p as e,H as t,h as s,d as i,t as n}from"./p-qP_9qshx.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 o=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}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 s(i,{key:"bbcafacc79f0288204028378f2cf460f793ca702","aria-hidden":"true",class:{skeleton:true,[`skeleton--${this.shape}`]:true,"skeleton--animated":this.animated}},Array.from({length:this.items}).map(((e,t)=>s("span",{class:"skeleton__item",style:this.sizeStyle,key:t,"data-index":String(e)}))))}static get style(){return r()}},[513,"ch-skeleton",{width:[1],height:[1],shape:[1],count:[2],animated:[4]}]);function a(){if(typeof customElements==="undefined"){return}const e=["ch-skeleton"];e.forEach((e=>{switch(e){case"ch-skeleton":if(!customElements.get(n(e))){customElements.define(n(e),o)}break}}))}a();const c=o;const d=a;export{c as ChSkeleton,d as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-skeleton.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{C as o,d as s}from"./p-
|
|
1
|
+
import{C as o,d as s}from"./p-CV0rD-fF.js";const r=o;const t=s;export{r as ChSpinner,t as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-spinner.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as s,h as a,d as e,t as c}from"./p-
|
|
1
|
+
import{p as t,H as s,h as a,d as e,t as c}from"./p-qP_9qshx.js";const n=()=>`:host{display:flex;flex-direction:column;box-sizing:border-box}:host([hidden]){display:none}.stack--gap-none{gap:0}.stack--gap-2xs{gap:var(--spacing-2xs)}.stack--gap-xs{gap:var(--spacing-xs)}.stack--gap-sm{gap:var(--spacing-sm)}.stack--gap-md{gap:var(--spacing-md)}.stack--gap-lg{gap:var(--spacing-lg)}.stack--gap-xl{gap:var(--spacing-xl)}.stack--gap-2xl{gap:var(--spacing-2xl)}.stack--gap-3xl{gap:var(--spacing-3xl)}.stack--gap-4xl{gap:var(--spacing-4xl)}.stack--gap-5xl{gap:var(--spacing-5xl)}.stack--gap-6xl{gap:var(--spacing-6xl)}.stack--align-stretch{align-items:stretch}.stack--align-start{align-items:flex-start}.stack--align-center{align-items:center}.stack--align-end{align-items:flex-end}.stack--justify-start{justify-content:flex-start}.stack--justify-center{justify-content:center}.stack--justify-end{justify-content:flex-end}.stack--justify-between{justify-content:space-between}.stack--justify-around{justify-content:space-around}`;const i=new Set(["none","2xs","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"]);const g=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}gap="md";align="stretch";justify="start";get gapStep(){return i.has(this.gap)?this.gap:"md"}render(){return a(e,{key:"646286c45adc0d816b0fdbcdfe9e70f809fedb95",class:{stack:true,[`stack--gap-${this.gapStep}`]:true,[`stack--align-${this.align}`]:true,[`stack--justify-${this.justify}`]:true}},a("slot",{key:"1c18713eb95fc568a08bcbd6e018add9336a0fd0"}))}static get style(){return n()}},[769,"ch-stack",{gap:[1],align:[1],justify:[1]}]);function p(){if(typeof customElements==="undefined"){return}const t=["ch-stack"];t.forEach((t=>{switch(t){case"ch-stack":if(!customElements.get(c(t))){customElements.define(c(t),g)}break}}))}p();const l=g;const r=p;export{l as ChStack,r as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-stack.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as i,h as r,d as s,t as a}from"./p-
|
|
1
|
+
import{p as t,H as e,c as i,h as r,d as s,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const c=()=>`:host{display:inline-block}.control{position:relative;display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.input:focus-visible~.track{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.track{position:relative;box-sizing:border-box;width:var(--spacing-6xl);height:var(--spacing-5xl);flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface);transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.thumb{position:absolute;top:50%;left:var(--spacing-2xs);width:var(--spacing-2xl);height:var(--spacing-2xl);border-radius:50%;background:var(--text-muted);transform:translateY(-50%);transition:left var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.input:checked~.track{border-color:var(--accent);background:var(--accent)}.input:checked~.track .thumb{left:calc(100% - var(--spacing-2xl) - var(--spacing-2xs));background:var(--color-accent-text)}.input--invalid~.track{border-color:var(--color-status-warning)}.input--invalid:focus-visible~.track{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .track,:host(:user-invalid) .track{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible~.track,:host(:user-invalid) .input:focus-visible~.track{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 l=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chChange=i(this,"chChange");this.internals=this.attachInternals()}switchId=`ch-switch-${++n}`;hintId=`${this.switchId}-hint`;errorId=`${this.switchId}-error`;initialChecked=false;internals;formDisabled=false;get host(){return this}label;name;value="on";checked=false;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=t=>{this.checked=t.target.checked;this.chChange.emit(this.checked)};syncForm(){const t=this.internals;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(this.checked?this.value:null);const{flags:e,message:i}=o({required:this.required,empty:!this.checked,invalid:this.invalid,errorMessage:this.errorMessage});t.setValidity(e,i)}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(t){this.formDisabled=t}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return r(s,{key:"7c862590fa8ce9c53d168cb670361259405c72bb"},r("label",{key:"e5602d4daa8ebf1a9832282fffb9e538fc1592a8",class:{control:true,"control--disabled":this.disabled||this.formDisabled},htmlFor:this.switchId},r("input",{key:"d29c00496c4a05ccbe66ffdbebf3a496c5ae6995",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}),r("span",{key:"5739a0b689ac7ed9ebc917e6102b3951e80ac06d",class:"track"},r("span",{key:"e10c21f740092750dd9bb00cde84fa1c26746eb9",class:"thumb"})),this.label&&r("span",{key:"bec86897b1ef0023d3eb8c8438bf6740f32a5921",class:"label-text"},this.label)),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"2568bcf74334e5f081df8efa9a1196c69cb3093d",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"319d5583cf10e329f05430a577d2f1f956ac8dd5",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}]}}static get style(){return c()}},[577,"ch-switch",{label:[1],name:[513],value:[1],checked:[1028],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const t=["ch-switch"];t.forEach((t=>{switch(t){case"ch-switch":if(!customElements.get(a(t))){customElements.define(a(t),l)}break}}))}d();const h=l;const u=d;export{h as ChSwitch,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-switch.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as a,c as e,h as r,d as i,t as s}from"./p-
|
|
1
|
+
import{p as t,H as a,c as e,h as r,d as i,t as s}from"./p-qP_9qshx.js";const o=()=>`: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 n=0;const l=-1;const c=1;const d=-1;let b=0;const h=t(class t extends a{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chChange=e(this,"chChange")}baseId=`ch-tabs-${++b}`;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+c)%a.length]?.value}if(t==="ArrowLeft"){return a[(e+d+a.length)%a.length]?.value}if(t==="Home"){return a[n]?.value}if(t==="End"){return a[a.length+l]?.value}return undefined}render(){const t=this.activeValue;return r(i,{key:"915c7a584397bbe10a72642a1ce5ed68f2264ed2"},r("div",{key:"b37a294722442c73d224410793cd0c098734993f",class:"tablist",role:"tablist","aria-label":this.label,onKeyDown:this.handleKeyDown,ref:t=>this.tablistEl=t},this.tabs.map((a=>{const e=a.value===t;return r("button",{key:a.value,type:"button",class:{tab:true,"tab--active":e,"tab--disabled":Boolean(a.disabled)},role:"tab",id:this.tabId(a.value),"data-value":a.value,"aria-selected":e?"true":"false","aria-controls":this.panelId(a.value),tabIndex:e?n:l,disabled:a.disabled,onClick:()=>this.select(a.value)},a.label)}))),this.tabs.map((a=>r("div",{key:`${a.value}-panel`,class:"tabpanel",id:this.panelId(a.value),role:"tabpanel","aria-labelledby":this.tabId(a.value),tabIndex:n,hidden:a.value!==t},r("slot",{name:`panel-${a.value}`})))))}static get style(){return o()}},[769,"ch-tabs",{tabs:[16],value:[1025],label:[1]}]);function u(){if(typeof customElements==="undefined"){return}const t=["ch-tabs"];t.forEach((t=>{switch(t){case"ch-tabs":if(!customElements.get(s(t))){customElements.define(s(t),h)}break}}))}u();const f=h;const p=u;export{f as ChTabs,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-tabs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as e,H as t,c as r,h as a,d as s,t as i}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`: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)}.textarea{box-sizing:border-box;width:100%;min-height:var(--spacing-6xl);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;line-height:var(--spacing-5xl);resize:vertical;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.textarea::placeholder{color:var(--text-muted)}.textarea:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.textarea--invalid{border-color:var(--color-status-warning)}.textarea--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .textarea,:host(:user-invalid) .textarea{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .textarea:focus,:host(:user-invalid) .textarea:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.textarea: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)}`;let h=0;const d=4;const c=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chInput=r(this,"chInput");this.chChange=r(this,"chChange");this.internals=this.attachInternals()}textareaId=`ch-textarea-${++h}`;hintId=`${this.textareaId}-hint`;errorId=`${this.textareaId}-error`;initialValue="";internals;formDisabled=false;get host(){return this}label;value="";placeholder;rows=d;name;disabled=false;required=false;hint;errorMessage;invalid=false;chInput;chChange;handleInput=e=>{this.value=e.target.value;this.chInput.emit(this.value)};handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value);const{flags:t,message:r}=o({required:this.required,empty:this.value==="",invalid:this.invalid,errorMessage:this.errorMessage});e.setValidity(t,r)}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(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return a(s,{key:"5e7f4e6c779b677f259b56ebf6cb2e829511275e"},this.label&&a("label",{key:"73a3a3d44b4926aaf0681aa68f878932c7932dae",class:"label",htmlFor:this.textareaId},this.label),a("textarea",{key:"10edc56d4846b578bd11c7bd001e7ca47aa1838d",id:this.label?this.textareaId:undefined,class:{textarea:true,"textarea--invalid":this.invalid},rows:this.rows,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)&&a("p",{key:"393ea00da6e7def75d4305c242a9cf957013359b",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&a("p",{key:"ba405aec9d92b410e063cec29235240a4a4ec715",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}]}}static get style(){return n()}},[577,"ch-textarea",{label:[1],value:[1025],placeholder:[1],rows:[2],name:[513],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function l(){if(typeof customElements==="undefined"){return}const e=["ch-textarea"];e.forEach((e=>{switch(e){case"ch-textarea":if(!customElements.get(i(e))){customElements.define(i(e),c)}break}}))}l();const u=c;const b=l;export{u as ChTextarea,b as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-textarea.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as t,H as e,f as o,h as i,d as s,t as n}from"./p-qP_9qshx.js";const r={top:"bottom",bottom:"top",left:"right",right:"left"};const l={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 b(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 c({anchor:t,surface:e,viewport:o,preferred:i,gap:s}){const n=[i,r[i]];let c=i;let d=Number.POSITIVE_INFINITY;for(const i of n){const{top:n,left:r}=b(i,t,e,s);const h={top:n,left:r,width:e.width,height:e.height};const u=a(h,o);const p=l[i]==="vertical"?f(u.top)+f(u.bottom):f(u.left)+f(u.right);if(p<d){d=p;c=i}}const{top:u,left:p}=b(c,t,e,s);const m={top:u,left:p,width:e.width,height:e.height};const g=a(m,o);const v=l[c]==="vertical"?{top:u,left:p+h(g.left,g.right)}:{top:u+h(g.top,g.bottom),left:p};return{placement:c,top:v.top,left:v.left}}function f(t){return t>0?t:0}function h(t,e){if(t>0){return t}if(e>0){return-e}return 0}const d=()=>`:host{display:inline-block}.anchor{position:relative;display:inline-flex}.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 u=0;const p=8;const m=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}get el(){return this}fallbackId=`ch-tooltip-${++u}`;bubbleEl;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);if(!t||t.offsetWidth===0){return}const e=this.slotted("trigger")?.getBoundingClientRect?.();if(!e){return}const i={width:t.offsetWidth+g(t),height:t.offsetHeight};const s=window.visualViewport;const{placement:n,top:r,left:l}=c({anchor:{top:e.top,left:e.left,width:e.width,height:e.height},surface:i,viewport:s?{top:s.offsetTop,left:s.offsetLeft,width:s.width,height:s.height}:{top:0,left:0,width:window.innerWidth,height:window.innerHeight},preferred:this.placement,gap:p});const a=this.offset;const b=a?.top===r&&a?.left===l&&this.resolvedPlacement===n;this.resolvedPlacement=n;this.offset={top:r,left:l};if(!b){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:"fb651dc0bf007fb86c9f69b2c714106520df4d4a"},i("span",{key:"74324b8e4c0b7c552255605c6aa4ae739e16d832",class:"anchor"},i("slot",{key:"d4c2025af2d96b2ea4e7d8d601ce803be82a4a3e",name:"trigger",onSlotchange:this.associate}),i("span",{key:"f6561dce022d8d9d2d0fb2b6984591301483b1f3",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:"a099d15660ea17211b4c50912842b3152e5f652c",name:"content",onSlotchange:this.associate}))))}static get style(){return d()}},[769,"ch-tooltip",{placement:[1],hovered:[32],focused:[32],dismissed:[32],resolvedPlacement:[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"],[11,"scroll","handleScroll"],[9,"resize","handleResize"]]]);function g(t){const e=getComputedStyle(t);return(parseFloat(e.marginLeft)||0)+(parseFloat(e.marginRight)||0)}function v(){if(typeof customElements==="undefined"){return}const t=["ch-tooltip"];t.forEach((t=>{switch(t){case"ch-tooltip":if(!customElements.get(n(t))){customElements.define(n(t),m)}break}}))}v();const w=m;const y=v;export{w as ChTooltip,y as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["chTooltipCss","tooltipIds","ChTooltip","__stencil_proxyCustomElement","HTMLElement","fallbackId","placement","hovered","focused","dismissed","visible","this","componentDidLoad","associate","handleMouseEnter","handleMouseLeave","handleFocusIn","handleFocusOut","handleKeyDown","event","key","slotted","name","Array","from","el","children","find","child","getAttribute","trigger","content","id","setAttribute","render","h","Host","class","onSlotchange","bubble"],"sources":["src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.anchor {\n position: relative;\n display: inline-flex;\n}\n\n.bubble {\n position: absolute;\n z-index: var(--z-index-dropdown);\n width: max-content;\n max-width: 16rem;\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.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\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, Host, Listen, Prop, State, h } from '@stencil/core';\n\nexport type ChTooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nlet tooltipIds = 0;\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@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 /**\n * Which side of the trigger the bubble is placed on.\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 private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\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 }\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 @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible) {\n this.dismissed = true;\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 * 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 return (\n <Host>\n <span class=\"anchor\">\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span class={{ 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible }}>\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAe,IAAM,62CCI3B,IAAIC,EAAa,E,MAuBJC,EAASC,EAAA,MAAAD,UAAAE,E,sGAGHC,WAAa,gBAAgBJ,IAKtCK,UAAgC,MAK/BC,QAAU,MACVC,QAAU,MACVC,UAAY,MAErB,WAAYC,GACV,OAAQC,KAAKJ,SAAWI,KAAKH,WAAaG,KAAKF,S,CAGjD,gBAAAG,GACED,KAAKE,W,CAIP,gBAAAC,GACEH,KAAKJ,QAAU,KACfI,KAAKF,UAAY,K,CAInB,gBAAAM,GACEJ,KAAKJ,QAAU,K,CAIjB,aAAAS,GACEL,KAAKH,QAAU,KACfG,KAAKF,UAAY,K,CAInB,cAAAQ,GACEN,KAAKH,QAAU,K,CAQjB,aAAAU,CAAcC,GACZ,GAAIA,EAAMC,MAAQ,UAAYT,KAAKD,QAAS,CAC1CC,KAAKF,UAAY,I,EAIb,OAAAY,CAAQC,GACd,OAAOC,MAAMC,KAAKb,KAAKc,GAAGC,UAAUC,MAAKC,GAASA,EAAMC,aAAa,UAAYP,G,CAQ3ET,UAAY,KAClB,MAAMiB,EAAUnB,KAAKU,QAAQ,WAC7B,MAAMU,EAAUpB,KAAKU,QAAQ,WAC7B,IAAKS,IAAYC,EAAS,CACxB,M,CAEF,IAAKA,EAAQC,GAAI,CACfD,EAAQC,GAAKrB,KAAKN,U,CAEpB0B,EAAQE,aAAa,OAAQ,WAC7BH,EAAQG,aAAa,mBAAoBF,EAAQC,GAAG,EAGtD,MAAAE,GACE,OACEC,EAACC,EAAI,CAAAhB,IAAA,4CACHe,EAAA,QAAAf,IAAA,2CAAMiB,MAAM,UACVF,EAAA,QAAAf,IAAA,2CAAME,KAAK,UAAUgB,aAAc3B,KAAKE,YACxCsB,EAAA,QAAAf,IAAA,2CAAMiB,MAAO,CAAEE,OAAU,KAAM,CAAC,WAAW5B,KAAKL,aAAc,KAAM,kBAAmBK,KAAKD,UAC1FyB,EAAA,QAAAf,IAAA,2CAAME,KAAK,UAAUgB,aAAc3B,KAAKE,c","ignoreList":[]}
|
|
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","__stencil_proxyCustomElement","HTMLElement","fallbackId","bubbleEl","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","offsetWidth","anchorRect","getBoundingClientRect","horizontalMargin","offsetHeight","offsetTop","offsetLeft","innerWidth","innerHeight","current","unchanged","forceUpdate","trigger","content","id","setAttribute","render","h","Host","class","onSlotchange","ref","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 /** Offset from the anchor's top-left corner, 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.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 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 * Only the outermost Escape handler is stopped from propagating, so a\n * tooltip inside an open modal closes itself and leaves the modal open.\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 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 if (!bubble || 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 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: { top: anchorRect.top, left: anchorRect.left, width: anchorRect.width, height: anchorRect.height },\n surface,\n viewport: 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 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 {/* 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":"uEAwBA,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,EAAQJ,KAC9BD,OAAQK,EAAQN,IAAMM,EAAQE,QAAUD,EAASP,IAAMO,EAASC,QAChEL,MAAOG,EAAQJ,KAAOI,EAAQG,OAASF,EAASL,KAAOK,EAASE,OAEpE,CAEA,SAASC,EAAUC,EAA+BC,EAAuBN,EAA4CO,GACnH,OAAQF,GACN,IAAK,MACH,MAAO,CACLX,IAAKY,EAAOZ,IAAMM,EAAQE,OAASK,EACnCX,KAAMU,EAAOV,MAAQU,EAAOH,MAAQH,EAAQG,OAAS,GAEzD,IAAK,SACH,MAAO,CACLT,IAAKY,EAAOZ,IAAMY,EAAOJ,OAASK,EAClCX,KAAMU,EAAOV,MAAQU,EAAOH,MAAQH,EAAQG,OAAS,GAEzD,IAAK,OACH,MAAO,CACLT,IAAKY,EAAOZ,KAAOY,EAAOJ,OAASF,EAAQE,QAAU,EACrDN,KAAMU,EAAOV,KAAOI,EAAQG,MAAQI,GAExC,IAAK,QACH,MAAO,CACLb,IAAKY,EAAOZ,KAAOY,EAAOJ,OAASF,EAAQE,QAAU,EACrDN,KAAMU,EAAOV,KAAOU,EAAOH,MAAQI,GAG3C,CAWM,SAAUC,GAAaF,OAC3BA,EAAMN,QACNA,EAAOC,SACPA,EAAQQ,UACRA,EAASF,IACTA,IAQA,MAAMG,EAAmC,CAACD,EAAWhB,EAASgB,IAC9D,IAAIJ,EAAYI,EAChB,IAAIE,EAAOC,OAAOC,kBAElB,IAAK,MAAMC,KAAaJ,EAAY,CAClC,MAAMhB,IAAEA,EAAGE,KAAEA,GAASQ,EAAUU,EAAWR,EAAQN,EAASO,GAC5D,MAAMQ,EAAO,CAAErB,MAAKE,OAAMO,MAAOH,EAAQG,MAAOD,OAAQF,EAAQE,QAChE,MAAMc,EAAWjB,EAAWgB,EAAMd,GAClC,MAAMgB,EAAOnB,EAAKgB,KAAe,WAAaI,EAAMF,EAAStB,KAAOwB,EAAMF,EAASrB,QAAUuB,EAAMF,EAASpB,MAAQsB,EAAMF,EAASnB,OAEnI,GAAIoB,EAAON,EAAM,CACfA,EAAOM,EACPZ,EAAYS,C,EAIhB,MAAMpB,IAAEA,EAAGE,KAAEA,GAASQ,EAAUC,EAAWC,EAAQN,EAASO,GAC5D,MAAMQ,EAAO,CAAErB,MAAKE,OAAMO,MAAOH,EAAQG,MAAOD,OAAQF,EAAQE,QAChE,MAAMc,EAAWjB,EAAWgB,EAAMd,GAElC,MAAMkB,EAAUrB,EAAKO,KAAe,WAAa,CAAEX,MAAKE,KAAMA,EAAOwB,EAAWJ,EAASpB,KAAMoB,EAASnB,QAAW,CAAEH,IAAKA,EAAM0B,EAAWJ,EAAStB,IAAKsB,EAASrB,QAASC,QAE3K,MAAO,CAAES,YAAWX,IAAKyB,EAAQzB,IAAKE,KAAMuB,EAAQvB,KACtD,CAGA,SAASsB,EAAMF,GACb,OAAOA,EAAW,EAAIA,EAAW,CACnC,CAYA,SAASI,EAAWC,EAAgBC,GAClC,GAAID,EAAS,EAAG,CACd,OAAOA,C,CAET,GAAIC,EAAQ,EAAG,CACb,OAAQA,C,CAEV,OAAO,CACT,CClJA,MAAMC,EAAe,IAAM,uzDCM3B,IAAIC,EAAa,EAGjB,MAAMC,EAAM,E,MA8BCC,EAASC,EAAA,MAAAD,UAAAE,E,sGAGHC,WAAa,gBAAgBL,IAEtCM,SAEAC,QAMA1B,UAAgC,MAK/B2B,QAAU,MACVC,QAAU,MACVC,UAAY,MAGZC,kBAGDC,OAER,WAAYC,GACV,OAAQC,KAAKN,SAAWM,KAAKL,WAAaK,KAAKJ,S,CAGjD,gBAAAK,GACED,KAAKE,W,CAGP,iBAAAC,GACEH,KAAKI,e,CAGP,oBAAAC,GACEL,KAAKP,W,CAIP,gBAAAa,GACEN,KAAKN,QAAU,KACfM,KAAKJ,UAAY,MACjBI,KAAKO,U,CAIP,gBAAAC,GACER,KAAKN,QAAU,K,CAIjB,aAAAe,GACET,KAAKL,QAAU,KACfK,KAAKJ,UAAY,MACjBI,KAAKO,U,CAIP,cAAAG,GACEV,KAAKL,QAAU,K,CAWjB,aAAAgB,CAAcC,GACZ,GAAIA,EAAMC,MAAQ,UAAYb,KAAKD,UAAYa,EAAME,iBAAkB,CACrEF,EAAMG,iBACNf,KAAKJ,UAAY,I,EAMrB,YAAAoB,GACE,GAAIhB,KAAKD,SAAWC,KAAKF,OAAQ,CAC/BE,KAAKO,U,EAKT,YAAAU,GACEjB,KAAKO,U,CAGC,aAAAH,GACN,UAAWc,SAAW,YAAa,CACjC,M,CAEF,MAAMvD,EAAWuD,OAAOC,eACxB,IAAKxD,GAAYqC,KAAKP,QAAS,CAC7B,M,CAEF,MAAM2B,EAAS,IAAMpB,KAAKO,WAC1B5C,EAAS0D,iBAAiB,SAAUD,GACpCzD,EAAS0D,iBAAiB,SAAUD,GACpCpB,KAAKP,QAAU,KACb9B,EAAS2D,oBAAoB,SAAUF,GACvCzD,EAAS2D,oBAAoB,SAAUF,EAAO,C,CAI1C,OAAAG,CAAQC,GACd,OAAOC,MAAMC,KAAK1B,KAAK2B,GAAGC,UAAUC,MAAKC,GAASA,EAAMC,aAAa,UAAYP,G,CAQ3E,QAAAjB,GACN,UAAWW,SAAW,YAAa,CACjC,M,CAEF,MAAMc,EAAShC,KAAKR,WAAaQ,KAAKR,SAAWQ,KAAK2B,GAAGM,YAAYC,cAA2B,YAAcC,WAC9G,IAAKH,GAAUA,EAAOI,cAAgB,EAAG,CACvC,M,CAGF,MAAMC,EAAcrC,KAAKuB,QAAQ,YAAwCe,0BACzE,IAAKD,EAAY,CACf,M,CAGF,MAAM3E,EAAU,CACdG,MAAOmE,EAAOI,YAAcG,EAAiBP,GAC7CpE,OAAQoE,EAAOQ,cAEjB,MAAM7E,EAAWuD,OAAOC,eAExB,MAAMpD,UAAEA,EAASX,IAAEA,EAAGE,KAAEA,GAASY,EAAa,CAC5CF,OAAQ,CAAEZ,IAAKiF,EAAWjF,IAAKE,KAAM+E,EAAW/E,KAAMO,MAAOwE,EAAWxE,MAAOD,OAAQyE,EAAWzE,QAClGF,UACAC,SAAUA,EACN,CAAEP,IAAKO,EAAS8E,UAAWnF,KAAMK,EAAS+E,WAAY7E,MAAOF,EAASE,MAAOD,OAAQD,EAASC,QAC9F,CAAER,IAAK,EAAGE,KAAM,EAAGO,MAAOqD,OAAOyB,WAAY/E,OAAQsD,OAAO0B,aAChEzE,UAAW6B,KAAKjC,UAChBE,IAAKkB,IAGP,MAAM0D,EAAU7C,KAAKF,OACrB,MAAMgD,EAAYD,GAASzF,MAAQA,GAAOyF,GAASvF,OAASA,GAAQ0C,KAAKH,oBAAsB9B,EAC/FiC,KAAKH,kBAAoB9B,EACzBiC,KAAKF,OAAS,CAAE1C,MAAKE,QACrB,IAAKwF,EAAW,CACdC,EAAY/C,K,EASRE,UAAY,KAClB,MAAM8C,EAAUhD,KAAKuB,QAAQ,WAC7B,MAAM0B,EAAUjD,KAAKuB,QAAQ,WAC7B,IAAKyB,IAAYC,EAAS,CACxB,M,CAEF,IAAKA,EAAQC,GAAI,CACfD,EAAQC,GAAKlD,KAAKT,U,CAEpB0D,EAAQE,aAAa,OAAQ,WAC7BH,EAAQG,aAAa,mBAAoBF,EAAQC,GAAG,EAGtD,MAAAE,GACE,MAAMtD,OAAEA,GAAWE,KAEnB,OACEqD,EAACC,EAAI,CAAAzC,IAAA,4CACHwC,EAAA,QAAAxC,IAAA,2CAAM0C,MAAM,UAGVF,EAAA,QAAAxC,IAAA,2CAAMW,KAAK,UAAUgC,aAAcxD,KAAKE,YACxCmD,EAAA,QAAAxC,IAAA,2CACE4C,IAAK9B,GAAO3B,KAAKR,SAAWmC,EAC5B+B,MAAO,CACL,0BAA2B5D,EAAS,GAAGA,EAAO1C,QAAU,KACxD,2BAA4B0C,EAAS,GAAGA,EAAOxC,SAAW,MAE5DiG,MAAO,CACLvB,OAAU,KACV,qBAAsB2B,QAAQ3D,KAAKF,QACnC,CAAC,WAAWE,KAAKH,mBAAqBG,KAAKjC,aAAc,KACzD,kBAAmBiC,KAAKD,UAG1BsD,EAAA,QAAAxC,IAAA,2CAAMW,KAAK,UAAUgC,aAAcxD,KAAKE,c,oWAQpD,SAASqC,EAAiBZ,GACxB,MAAM+B,EAAQE,iBAAiBjC,GAC/B,OAAQkC,WAAWH,EAAMI,aAAe,IAAMD,WAAWH,EAAMK,cAAgB,EACjF,C","ignoreList":[]}
|
package/dist/components/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-qP_9qshx.js";const o="#100a1c";const t="#201e40";const e="#261226";const n="rgba(32, 30, 64, 0.6)";const c="rgba(45, 212, 191, 0.08)";const m="rgba(0, 0, 0, 0.6)";const p="rgba(255, 255, 255, 0.08)";const x="rgba(45, 212, 191, 0.3)";const d="#2dd4bf";const i="#5ee8d4";const l="#06210f";const f="#4ade80";const u="rgba(34, 197, 94, 0.18)";const h="#f87171";const v="rgba(248, 113, 113, 0.15)";const w="#ffffff";const k="rgba(255, 255, 255, 0.55)";const y="#85422b";const P="#b45b38";const S="#1d1d1b";const z="Fira Sans, Droid Sans, Helvetica Neue, sans-serif";const B="Inconsolata, monospace";const D="0.68rem";const H="0.85rem";const N="1rem";const q="1.25rem";const A="1.5rem";const F="400";const G="600";const I="700";const O="0.03em";const W="0.18rem";const j="0.25rem";const L="0.35rem";const R="0.5rem";const _="0.6rem";const C="0.8rem";const E="1rem";const J="1.25rem";const K="1.35rem";const M="1.5rem";const Q="2rem";const T="2px";const U="1px";const V="6px";const X="8px";const Y="999px";const Z="1px";const $="3px";const ss="0 0 0 3px rgba(45, 212, 191, 0.12)";const os="0 4px 20px rgba(45, 212, 191, 0.06)";const ts="10px";const es="150ms";const ns="200ms";const rs="800ms";const cs="ease";const as="linear";const ms="2px";const ps="2px";const xs=.5;const ds=0;const bs=100;const is=1e3;const ls="68rem";const gs="16px";const fs="20px";const us="24px";const hs="2px";const vs={color:{background:{base:"#100a1c",topGlow:"#201e40",bottomGlow:"#261226"},surface:{default:"rgba(32, 30, 64, 0.6)",hover:"rgba(45, 212, 191, 0.08)"},scrim:{default:"rgba(0, 0, 0, 0.6)"},border:{default:"rgba(255, 255, 255, 0.08)",hover:"rgba(45, 212, 191, 0.3)"},accent:{default:"#2dd4bf",hover:"#5ee8d4",text:"#06210f"},status:{positive:"#4ade80",positiveBackground:"rgba(34, 197, 94, 0.18)",warning:"#f87171",warningBackground:"rgba(248, 113, 113, 0.15)"},text:{primary:"#ffffff",secondary:"rgba(255, 255, 255, 0.55)"},brand:{huemulDark:"#85422b",huemulLight:"#b45b38",stroke:"#1d1d1b"}},typography:{body:"Fira Sans, Droid Sans, Helvetica Neue, sans-serif",heading:"Inconsolata, monospace",size:{xs:"0.68rem",sm:"0.85rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},weight:{regular:"400",semibold:"600",bold:"700"},tracking:{badge:"0.03em"}},spacing:{"2xs":"0.18rem",xs:"0.25rem",sm:"0.35rem",md:"0.5rem",lg:"0.6rem",xl:"0.8rem","2xl":"1rem","3xl":"1.25rem","4xl":"1.35rem","5xl":"1.5rem","6xl":"2rem",shift:"2px",elevate:"1px"},radius:{sm:"6px",md:"8px",pill:"999px"},border:{width:"1px",accentBar:"3px"},shadow:{focusRing:"0 0 0 3px rgba(45, 212, 191, 0.12)",cardHover:"0 4px 20px rgba(45, 212, 191, 0.06)"},effect:{blur:"10px"},duration:{fast:"150ms",normal:"200ms",spin:"800ms"},easing:{default:"ease",linear:"linear"},focus:{outlineWidth:"2px",outlineOffset:"2px"},opacity:{disabled:.5},"z-index":{base:0,dropdown:100,modal:1e3},layout:{maxWidth:"68rem"},icon:{size:{sm:"16px",md:"20px",lg:"24px"},stroke:"2px"}};export{$ as borderAccentBar,Z as borderWidth,d as colorAccentDefault,i as colorAccentHover,l as colorAccentText,o as colorBackgroundBase,e as colorBackgroundBottomGlow,t as colorBackgroundTopGlow,p as colorBorderDefault,x as colorBorderHover,y as colorBrandHuemulDark,P as colorBrandHuemulLight,S as colorBrandStroke,m as colorScrimDefault,f as colorStatusPositive,u as colorStatusPositiveBackground,h as colorStatusWarning,v as colorStatusWarningBackground,n as colorSurfaceDefault,c as colorSurfaceHover,w as colorTextPrimary,k as colorTextSecondary,es as durationFast,ns as durationNormal,rs as durationSpin,cs as easingDefault,as as easingLinear,ts as effectBlur,ps as focusOutlineOffset,ms as focusOutlineWidth,us as iconSizeLg,fs as iconSizeMd,gs as iconSizeSm,hs as iconStroke,ls as layoutMaxWidth,xs as opacityDisabled,X as radiusMd,Y as radiusPill,V as radiusSm,os as shadowCardHover,ss as shadowFocusRing,E as spacing2xl,W as spacing2xs,J as spacing3xl,K as spacing4xl,M as spacing5xl,Q as spacing6xl,U as spacingElevate,_ as spacingLg,R as spacingMd,T as spacingShift,L as spacingSm,C as spacingXl,j as spacingXs,vs as tokens,z as typographyBody,B as typographyHeading,q as typographySizeLg,N as typographySizeMd,H as typographySizeSm,A as typographySizeXl,D as typographySizeXs,O as typographyTrackingBadge,I as typographyWeightBold,F as typographyWeightRegular,G as typographyWeightSemibold,ds as zIndexBase,bs as zIndexDropdown,is as zIndexModal};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|