@devschile/chucao 2.7.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/{p-d1e9f563.entry.js → p-01b6c7bf.entry.js} +2 -2
- package/dist/chucao/{p-39815ee2.entry.js → p-0c7f6f8d.entry.js} +2 -2
- package/dist/chucao/p-10f6801e.entry.js +2 -0
- package/dist/chucao/p-10f6801e.entry.js.map +1 -0
- package/dist/chucao/{p-339e3c30.entry.js → p-15d27bb7.entry.js} +2 -2
- package/dist/chucao/{p-afe45116.entry.js → p-1b70e3f1.entry.js} +2 -2
- package/dist/chucao/{p-d2077ae4.entry.js → p-1e4cd3aa.entry.js} +2 -2
- package/dist/chucao/{p-36c59ad1.entry.js → p-2e37c61b.entry.js} +2 -2
- package/dist/chucao/{p-999dba28.entry.js → p-42028c97.entry.js} +2 -2
- package/dist/chucao/{p-14184080.entry.js → p-472ec451.entry.js} +2 -2
- package/dist/chucao/{p-3f9894a4.entry.js → p-5240f5ac.entry.js} +2 -2
- package/dist/chucao/{p-62e762f7.entry.js → p-60e1c1df.entry.js} +2 -2
- package/dist/chucao/{p-e2fe7c5d.entry.js → p-7cdc71cc.entry.js} +2 -2
- package/dist/chucao/{p-4c8838a0.entry.js → p-8ae680a4.entry.js} +2 -2
- package/dist/chucao/{p-3e6614ee.entry.js → p-90284ebe.entry.js} +2 -2
- package/dist/chucao/{p-93f25dd5.entry.js → p-9db118d9.entry.js} +2 -2
- package/dist/chucao/{p-a84d4493.entry.js → p-9ebcc7be.entry.js} +2 -2
- package/dist/chucao/{p-507d4b69.entry.js → p-a7c674b7.entry.js} +2 -2
- package/dist/chucao/{p-4cda7f71.entry.js → p-c4b2bd1f.entry.js} +2 -2
- package/dist/chucao/{p-1852dfdb.entry.js → p-c90da3c0.entry.js} +2 -2
- package/dist/chucao/{p-08d90a3d.entry.js → p-d8b71751.entry.js} +2 -2
- package/dist/chucao/{p-10109256.entry.js → p-deb2571b.entry.js} +2 -2
- package/dist/chucao/{p-f17b186f.entry.js → p-e77d35c3.entry.js} +2 -2
- package/dist/chucao/{p-1e8d921d.entry.js → p-f6ab0a11.entry.js} +2 -2
- package/dist/chucao/{p-afacd489.entry.js → p-f917d34f.entry.js} +2 -2
- package/dist/chucao/{p-bf036509.entry.js → p-ffecdf25.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +7 -7
- package/dist/cjs/ch-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ch-cluster.cjs.entry.js +2 -2
- package/dist/cjs/ch-description-list.cjs.entry.js +1 -1
- package/dist/cjs/ch-divider.cjs.entry.js +1 -1
- package/dist/cjs/ch-drawer.cjs.entry.js +1 -1
- package/dist/cjs/ch-emoji.cjs.entry.js +1 -1
- package/dist/cjs/ch-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/ch-grid.cjs.entry.js +1 -1
- package/dist/cjs/ch-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/ch-icon.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +1 -1
- package/dist/cjs/ch-number-input.cjs.entry.js +2 -2
- package/dist/cjs/ch-page-header.cjs.entry.js +1 -1
- package/dist/cjs/ch-radio.cjs.entry.js +1 -1
- package/dist/cjs/ch-segmented-control.cjs.entry.js +1 -1
- package/dist/cjs/ch-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ch-stack.cjs.entry.js +1 -1
- package/dist/cjs/ch-stat.cjs.entry.js +2 -2
- package/dist/cjs/ch-table.cjs.entry.js +1 -1
- package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ch-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ch-timeline.cjs.entry.js +1 -1
- package/dist/cjs/ch-tooltip.cjs.entry.js +24 -7
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
- package/dist/collection/components/ch-accordion/ch-accordion.js +1 -1
- package/dist/collection/components/ch-alert/ch-alert.js +1 -1
- package/dist/collection/components/ch-badge/ch-badge.js +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
- package/dist/collection/components/ch-description-list/ch-description-list.js +1 -1
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
- package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
- package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
- package/dist/collection/components/ch-grid/ch-grid.js +1 -1
- package/dist/collection/components/ch-icon/ch-icon.js +1 -1
- package/dist/collection/components/ch-icon-button/ch-icon-button.js +1 -1
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +1 -1
- package/dist/collection/components/ch-number-input/ch-number-input.js +2 -2
- package/dist/collection/components/ch-page-header/ch-page-header.js +1 -1
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- package/dist/collection/components/ch-stack/ch-stack.js +1 -1
- package/dist/collection/components/ch-stat/ch-stat.js +2 -2
- package/dist/collection/components/ch-switch/ch-switch.js +1 -1
- package/dist/collection/components/ch-table/ch-table.js +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
- package/dist/collection/components/ch-timeline/ch-timeline.js +1 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.css +11 -0
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +23 -6
- package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
- package/dist/collection/utils/overlay.js.map +1 -1
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-cluster.js +1 -1
- package/dist/components/ch-description-list.js +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-drawer.js +1 -1
- package/dist/components/ch-emoji.js +1 -1
- package/dist/components/ch-empty-state.js +1 -1
- package/dist/components/ch-grid.js +1 -1
- package/dist/components/ch-icon-button.js +1 -1
- package/dist/components/ch-icon.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-number-input.js +1 -1
- package/dist/components/ch-page-header.js +1 -1
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-segmented-control.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-skeleton.js +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-stack.js +1 -1
- package/dist/components/ch-stat.js +1 -1
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-table.js +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-timeline.js +1 -1
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/ch-tooltip.js.map +1 -1
- package/dist/components/{p-CuczWSQU.js → p-DiUN1WGc.js} +2 -2
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +7 -7
- package/dist/esm/ch-checkbox.entry.js +1 -1
- package/dist/esm/ch-cluster.entry.js +2 -2
- package/dist/esm/ch-description-list.entry.js +1 -1
- package/dist/esm/ch-divider.entry.js +1 -1
- package/dist/esm/ch-drawer.entry.js +1 -1
- package/dist/esm/ch-emoji.entry.js +1 -1
- package/dist/esm/ch-empty-state.entry.js +1 -1
- package/dist/esm/ch-grid.entry.js +1 -1
- package/dist/esm/ch-icon-button.entry.js +1 -1
- package/dist/esm/ch-icon.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +1 -1
- package/dist/esm/ch-number-input.entry.js +2 -2
- package/dist/esm/ch-page-header.entry.js +1 -1
- package/dist/esm/ch-radio.entry.js +1 -1
- package/dist/esm/ch-segmented-control.entry.js +1 -1
- package/dist/esm/ch-skeleton.entry.js +1 -1
- package/dist/esm/ch-stack.entry.js +1 -1
- package/dist/esm/ch-stat.entry.js +2 -2
- package/dist/esm/ch-table.entry.js +1 -1
- package/dist/esm/ch-tabs.entry.js +1 -1
- package/dist/esm/ch-textarea.entry.js +1 -1
- package/dist/esm/ch-timeline.entry.js +1 -1
- package/dist/esm/ch-tooltip.entry.js +24 -7
- package/dist/esm/ch-tooltip.entry.js.map +1 -1
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +7 -0
- package/dist/types/utils/overlay.d.ts +1 -1
- package/hydrate/index.js +57 -40
- package/hydrate/index.mjs +57 -40
- package/package.json +1 -1
- package/dist/chucao/p-5c253fa0.entry.js +0 -2
- package/dist/chucao/p-5c253fa0.entry.js.map +0 -1
- /package/dist/chucao/{p-d1e9f563.entry.js.map → p-01b6c7bf.entry.js.map} +0 -0
- /package/dist/chucao/{p-39815ee2.entry.js.map → p-0c7f6f8d.entry.js.map} +0 -0
- /package/dist/chucao/{p-339e3c30.entry.js.map → p-15d27bb7.entry.js.map} +0 -0
- /package/dist/chucao/{p-afe45116.entry.js.map → p-1b70e3f1.entry.js.map} +0 -0
- /package/dist/chucao/{p-d2077ae4.entry.js.map → p-1e4cd3aa.entry.js.map} +0 -0
- /package/dist/chucao/{p-36c59ad1.entry.js.map → p-2e37c61b.entry.js.map} +0 -0
- /package/dist/chucao/{p-999dba28.entry.js.map → p-42028c97.entry.js.map} +0 -0
- /package/dist/chucao/{p-14184080.entry.js.map → p-472ec451.entry.js.map} +0 -0
- /package/dist/chucao/{p-3f9894a4.entry.js.map → p-5240f5ac.entry.js.map} +0 -0
- /package/dist/chucao/{p-62e762f7.entry.js.map → p-60e1c1df.entry.js.map} +0 -0
- /package/dist/chucao/{p-e2fe7c5d.entry.js.map → p-7cdc71cc.entry.js.map} +0 -0
- /package/dist/chucao/{p-4c8838a0.entry.js.map → p-8ae680a4.entry.js.map} +0 -0
- /package/dist/chucao/{p-3e6614ee.entry.js.map → p-90284ebe.entry.js.map} +0 -0
- /package/dist/chucao/{p-93f25dd5.entry.js.map → p-9db118d9.entry.js.map} +0 -0
- /package/dist/chucao/{p-a84d4493.entry.js.map → p-9ebcc7be.entry.js.map} +0 -0
- /package/dist/chucao/{p-507d4b69.entry.js.map → p-a7c674b7.entry.js.map} +0 -0
- /package/dist/chucao/{p-4cda7f71.entry.js.map → p-c4b2bd1f.entry.js.map} +0 -0
- /package/dist/chucao/{p-1852dfdb.entry.js.map → p-c90da3c0.entry.js.map} +0 -0
- /package/dist/chucao/{p-08d90a3d.entry.js.map → p-d8b71751.entry.js.map} +0 -0
- /package/dist/chucao/{p-10109256.entry.js.map → p-deb2571b.entry.js.map} +0 -0
- /package/dist/chucao/{p-f17b186f.entry.js.map → p-e77d35c3.entry.js.map} +0 -0
- /package/dist/chucao/{p-1e8d921d.entry.js.map → p-f6ab0a11.entry.js.map} +0 -0
- /package/dist/chucao/{p-afacd489.entry.js.map → p-f917d34f.entry.js.map} +0 -0
- /package/dist/chucao/{p-bf036509.entry.js.map → p-ffecdf25.entry.js.map} +0 -0
- /package/dist/components/{p-CuczWSQU.js.map → p-DiUN1WGc.js.map} +0 -0
|
@@ -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 s,d as e,t as n}from"./p-qP_9qshx.js";import{r as a}from"./p-BXzZsX2r.js";const o=()=>`:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.input{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input::placeholder{color:var(--text-muted)}.input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus,:host(:user-invalid) .input:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.input:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let h=0;const d=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-number-input-${++h}`;hintId=`${this.inputId}-hint`;errorId=`${this.inputId}-error`;initialValue="";internals;formDisabled=false;get host(){return this}label;value="";format="plain";placeholder;name;disabled=false;required=false;min;max;step="any";hint;errorMessage;invalid=false;chInput;chChange;draft="";typing=false;componentWillLoad(){this.draft=this.formatDisplay(this.value)}get decimals(){return this.format!=="clp"}formatDisplay(t){if(t===""){return""}if(this.format==="clp"){const i=t.replace(/\D/gu,"");return i===""?"":Number(i).toLocaleString("es-CL")}return t}toCanonical(t){if(this.format==="clp"){return t.replace(/\D/gu,"")}const i=t.replace(/\s/gu,"").replace(",",".");const r=/^-?\d*(?:\.\d*)?/u.exec(i);return r?r[0]:""}get isEmpty(){return!/^-?\d/u.test(this.toCanonical(this.draft))}get canonical(){return this.isEmpty?"":this.toCanonical(this.draft)}get numericValue(){return Number(this.canonical)}outOfRange(t){const{min:i,max:r}=this;if(i!==undefined&&t<i){return`Enter a value of at least ${i}.`}if(r!==undefined&&t>r){return`Enter a value of at most ${r}.`}return undefined}rangeError(){if(this.errorMessage||this.isEmpty||this.invalid){return undefined}const t=this.numericValue;return Number.isNaN(t)?"Enter a valid number.":this.outOfRange(t)}syncForm(){const{internals:t,required:i,invalid:r,errorMessage:s,canonical:e}=this;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(e);const n=a({required:i,empty:e==="",invalid:r,errorMessage:s});const o=this.rangeError();if(o){t.setValidity({...n.flags,badInput:true},o);return}t.setValidity(n.flags,n.message)}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;this.draft=this.formatDisplay(this.initialValue);this.typing=false;this.syncForm();const t=this.host.shadowRoot?.querySelector("input");if(t){t.value=this.formatDisplay(this.initialValue)}}formDisabledCallback(t){this.formDisabled=t}commit(t){this.typing=true;this.draft=t;this.value=this.canonical;this.chInput.emit(this.value);this.syncForm()}handleInput=t=>{this.commit(t.target.value)};handleChange=t=>{this.commit(t.target.value);this.chChange.emit(this.value)};handleBlur=()=>{if(this.format==="clp"){this.draft=this.formatDisplay(this.canonical)}};get isInvalid(){return this.invalid||this.rangeError()!==undefined}get describedBy(){if(this.isInvalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){const t=this.isInvalid&&this.errorMessage;return s(e,{key:"1c424d9d76ec39e6cc6018d6ba483f95bd203d32"},this.label&&s("label",{key:"4fc03334128c33cc425da773df063cd99fee215c",class:"label",htmlFor:this.inputId},this.label),s("input",{key:"ece15737f83c181d615e906aba5cce80c0bcb8ba",id:this.label?this.inputId:undefined,class:{input:true,"input--invalid":this.isInvalid},type:"text",inputMode:this.decimals?"decimal":"numeric",name:this.name,placeholder:this.placeholder,disabled:this.disabled||this.formDisabled,required:this.required,value:this.typing?this.draft:this.formatDisplay(this.value),"aria-invalid":this.isInvalid?"true":undefined,"aria-describedby":this.describedBy,onInput:this.handleInput,onChange:this.handleChange,onBlur:this.handleBlur}),this.hint&&!t&&s("p",{key:"7a2e3031b8bfebf26857dd60eb18340f21a01f3d",class:"hint",id:this.hintId},this.hint),t&&s("p",{key:"f90492532d27088f18b258f885d5d471f31d27cb",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}],min:[{syncForm:0}],max:[{syncForm:0}]}}static get style(){return o()}},[577,"ch-number-input",{label:[1],value:[1025],format:[1],placeholder:[1],name:[513],disabled:[516],required:[516],min:[2],max:[2],step:[8],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32],draft:[32],typing:[32]},undefined,{required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}],min:[{syncForm:0}],max:[{syncForm:0}]}]);function c(){if(typeof customElements==="undefined"){return}const t=["ch-number-input"];t.forEach((t=>{switch(t){case"ch-number-input":if(!customElements.get(n(t))){customElements.define(n(t),d)}break}}))}c();const u=d;const l=c;export{u as ChNumberInput,l as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-number-input.js.map
|
|
@@ -1,2 +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 d=()=>`: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 i=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:"
|
|
1
|
+
import{p as e,H as a,h as t,d as r,t as s}from"./p-qP_9qshx.js";const d=()=>`: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 i=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:"3d8de76e3df7fba8be55d0708861c7d136b05722"},t("div",{key:"057d2b4359b9faff34b9fbf6886b04d5d89dc9ac",class:{header:true,"header--stacked":this.actionsStacked}},t("div",{key:"1ff40b1cd100d41a72d80ab35e619f93b4a43633",class:"header-text"},this.eyebrow&&t("p",{key:"6c2538bf1d450a6dca25fd2815968a9622f7fcbf",class:"header-eyebrow"},this.eyebrow),t(e,{key:"54cdf8e62468e11cf9fe084023e4fe624f958452",class:"header-title"},this.title),this.description&&t("p",{key:"fe9c6cc78354b38b8833871ddc53d412007abe29",class:"header-description"},this.description)),t("div",{key:"e91a66715e2c23478c375ce9ddcf29c04f85b3eb",class:"header-actions"},t("slot",{key:"06654c2a28d004791ed5b9c213cd66ef80bbcc85",name:"actions"}))))}static get style(){return d()}},[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),i)}break}}))}c();const o=i;const n=c;export{o as ChPageHeader,n as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-page-header.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as i,H as e,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 c=i(class i extends e{constructor(i){super();if(i!==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=i=>{this.value=i.target.value;this.chChange.emit(this.value)};syncForm(){const i=this.internals;if(typeof i?.setFormValue!=="function"){return}i.setFormValue(this.value??null);const{flags:e,message:t}=o({required:this.required,empty:!this.value,invalid:this.invalid,errorMessage:this.errorMessage});i.setValidity(e,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(i){this.formDisabled=i}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){const i=this.name||`${this.groupId}-group`;return s(r,{key:"
|
|
1
|
+
import{p as i,H as e,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 c=i(class i extends e{constructor(i){super();if(i!==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=i=>{this.value=i.target.value;this.chChange.emit(this.value)};syncForm(){const i=this.internals;if(typeof i?.setFormValue!=="function"){return}i.setFormValue(this.value??null);const{flags:e,message:t}=o({required:this.required,empty:!this.value,invalid:this.invalid,errorMessage:this.errorMessage});i.setValidity(e,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(i){this.formDisabled=i}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){const i=this.name||`${this.groupId}-group`;return s(r,{key:"a027da2d803a6e8a2a35afa1920dd3b0f8e06b01"},this.label&&s("span",{key:"28e11cd1148a89a4f3e85d331f00e39f1d7751ce",class:"group-label",id:this.labelId},this.label),s("div",{key:"43d8a53c9bec1dc129b6588c0118ebe2109b4b7e",class:"radio-group",role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((e=>s("label",{class:{control:true,"control--disabled":this.disabled||this.formDisabled||e.disabled}},s("input",{class:{input:true,"input--invalid":this.invalid},type:"radio",name:i,value:e.value,checked:e.value===this.value,disabled:this.disabled||this.formDisabled||e.disabled,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),s("span",{class:"mark"}),s("span",{class:"label-text"},e.label))))),this.hint&&!(this.invalid&&this.errorMessage)&&s("p",{key:"27335cc50f8b280f93857eea370aa37e2290b46b",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&s("p",{key:"83f93bdc0739961136062acb784a3d6e666de349",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 d(){if(typeof customElements==="undefined"){return}const i=["ch-radio"];i.forEach((i=>{switch(i){case"ch-radio":if(!customElements.get(a(i))){customElements.define(a(i),c)}break}}))}d();const h=c;const u=d;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-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 d=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:"
|
|
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 d=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:"59e0782a5c120cd243bbd67eb727ba1a7755d45f"},this.label&&a("span",{key:"f1faf9b240224e4c2b10059ed7bf667e24e5997d",class:"group-label",id:this.labelId},this.label),a("div",{key:"b9e59c0fbd4af04ad4d079415497440ec0a60801",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 c(){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),d)}break}}))}c();const h=d;const u=c;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-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)}.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
|
|
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 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)}.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 d=0;const c=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-${++d}`;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:"f57fbcbfaaf64a9cbf1f201edd2f9f714db9afee"},this.label&&r("label",{key:"e7a4a802ff85cd597e5bdb9a54858e3cbbbcf73b",class:"label",htmlFor:this.selectId},this.label),r("select",{key:"5d70a598757d9440d90351e8639a876388b5f7a7",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:"9a002af8f52ab2bb2d2c762417cad071b7dd06c7",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:"0224ab6e0a54b925e0754c43bb15ceaab84c34a4",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"1624ae9938d47971ee8195f986c45454dad7f846",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-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),c)}break}}))}l();const h=c;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-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
|
|
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 a=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:"b28cd1be6da1721ff6b93ed1e4bab119ea066ad4","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 o(){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),a)}break}}))}o();const d=a;const h=o;export{d as ChSkeleton,h 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-DiUN1WGc.js";const t=o;const c=s;export{t as ChSpinner,c 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-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:"
|
|
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:"1c70344ce291ba78a533f99ac6c4c135296251e1",class:{stack:true,[`stack--gap-${this.gapStep}`]:true,[`stack--align-${this.align}`]:true,[`stack--justify-${this.justify}`]:true}},a("slot",{key:"f4167e47a2fdee42f97611fba5907d79f8d0448d"}))}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
|
|
1
|
+
import{p as t,H as a,h as e,d as s,t as o}from"./p-qP_9qshx.js";const r=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-primary)}:host([hidden]){display:none}.stat__inner{display:flex;flex-direction:column;gap:var(--spacing-2xs);padding:var(--spacing-md) var(--spacing-lg);border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.stat__label{font-size:var(--typography-size-xs);font-weight:var(--typography-weight-semibold);letter-spacing:0.06em;text-transform:uppercase;color:var(--color-text-secondary)}.stat__value{font-family:var(--typography-heading);font-size:var(--typography-size-xl);font-weight:var(--typography-weight-bold);font-variant-numeric:tabular-nums;display:flex;align-items:baseline;gap:var(--spacing-2xs)}.stat__cue{font-size:var(--typography-size-md)}.stat__value--positive{color:var(--color-status-positive)}.stat__value--negative{color:var(--color-status-negative)}.stat__value--unavailable{color:var(--color-text-tertiary);font-style:italic}.stat__hint{font-size:var(--typography-size-sm);color:var(--color-text-secondary)}.stat__footer:empty{display:none}.stat__footer{margin-top:var(--spacing-2xs)}`;const i=new Set(["default","positive","negative","unavailable"]);const l=t(class t extends a{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}label;value;hint;tone="default";get toneClass(){return i.has(this.tone)?this.tone:"default"}render(){const t=this.toneClass==="positive"?"+":this.toneClass==="negative"?"−":null;return e(s,{key:"76d71c964efeb4e5a07aabff0b895f1ded21b345",class:"stat"},e("div",{key:"103db766f21c91c8406e8d3368049f4e4a018007",class:"stat__inner"},e("span",{key:"74e45654072a92ba4f894aee5366852561f8f352",class:"stat__label"},this.label),e("span",{key:"deb8d0d20c70d7fbab392641fd9d0e617ab8daf5",class:{stat__value:true,[`stat__value--${this.toneClass}`]:this.toneClass!=="default"}},t&&e("span",{key:"82b83cb7182f10ceca5172fc790aad01882645cc",class:"stat__cue","aria-hidden":"true"},t),e("slot",{key:"e9c3095eca4ed3907fc0e95395f3cc62bfd4158a",name:"value"},this.value)),this.hint&&e("span",{key:"4b892b35299def40a62c386e6af7c5f19aebe44b",class:"stat__hint"},this.hint),e("div",{key:"0535d9fb62ddf5ed1ee2b5993689cb080f753ff9",class:"stat__footer"},e("slot",{key:"1d8e09fa8db2d4a6e188f8deaa93631df9cc2a36",name:"footer"}))))}static get style(){return r()}},[769,"ch-stat",{label:[1],value:[1],hint:[1],tone:[1]}]);function n(){if(typeof customElements==="undefined"){return}const t=["ch-stat"];t.forEach((t=>{switch(t){case"ch-stat":if(!customElements.get(o(t))){customElements.define(o(t),l)}break}}))}n();const c=l;const d=n;export{c as ChStat,d as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-stat.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as
|
|
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:"8bafcbe9b03858f278f0884d43b9ce579a98c84e"},r("label",{key:"8783c0e8ce0bb9c03a3772a08afb383e338b5be4",class:{control:true,"control--disabled":this.disabled||this.formDisabled},htmlFor:this.switchId},r("input",{key:"4093d398ed167ede08749050b6a9c9d5b25f2470",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:"eea728ebbf6c6fefd761415bf8cb00765e5c2e76",class:"track"},r("span",{key:"4d18d8c9ed871bbf6e537b93bcce14c0f00f00e9",class:"thumb"})),this.label&&r("span",{key:"048657735d8fdf9a03a89b83cf3f3d65a466d886",class:"label-text"},this.label)),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"869a40f9ce8bd2f93d918426f119c637039ac5e9",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"08d947e2909706290b7efbb3e8af6999ad249dea",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 e,H as t,c as r,h as s,d as a,t as o}from"./p-qP_9qshx.js";const i=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-primary)}:host([hidden]){display:none}.table__scroll{overflow-x:auto;min-width:0;border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.table__scroll:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.table{width:100%;border-collapse:collapse;font-size:var(--typography-size-sm)}.cell{min-width:8rem}.caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.cell{padding:var(--spacing-md) var(--spacing-lg);text-align:left;vertical-align:top;border-bottom:var(--border-width) solid var(--color-border-default)}.cell--header{font-weight:var(--typography-weight-semibold);color:var(--color-text-secondary);white-space:nowrap;background:var(--color-surface-hover)}tbody tr:last-child td{border-bottom:0}.sort{all:unset;display:inline-flex;align-items:center;gap:var(--spacing-xs);cursor:pointer;border-radius:var(--radius-sm)}.sort:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.sort__cue{font-size:var(--typography-size-xs);color:var(--color-text-secondary)}.table__empty{padding:var(--spacing-2xl) var(--spacing-lg);text-align:center}.table__empty-message{margin:0;font-size:var(--typography-size-sm);color:var(--color-text-secondary)}`;let n=0;const l=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chSort=r(this,"chSort")}captionId=`ch-table-${++n}-caption`;emptyId=`${this.captionId}-empty`;get host(){return this}columns=[];sortable=false;sortKey;sortDirection="ascending";label;empty="unmeasured";filtered=false;chSort;onFiltered(){this.measure()}rerenderHeaders(){this.rerender=!this.rerender}rerender=false;observer;componentDidLoad(){this.measure();if(typeof MutationObserver==="function"){this.observer=new MutationObserver(this.measure);this.observer.observe(this.host,{childList:true})}}disconnectedCallback(){this.observer?.disconnect();this.observer=undefined}measure=()=>{const e=Array.from(this.host.children).filter((e=>e.tagName==="TR"));this.empty=e.length===0?"true":"none"};get emptyState(){if(this.filtered){return"filtered"}return this.empty}sortCue(e){if(!e){return"⇅"}return this.sortDirection==="ascending"?"▲":"▼"}emptyMessage(e){return e==="filtered"?"No results for these filters.":"Nothing here yet."}nextDirection(e){if(this.sortKey!==e){return"ascending"}return this.sortDirection==="ascending"?"descending":"ascending"}handleSort=e=>{this.chSort.emit({key:e,direction:this.nextDirection(e)})};handleHeaderKeydown=(e,t)=>{if(e.key!=="Enter"&&e.key!==" "){return}e.preventDefault();this.handleSort(t)};renderHeaderCell(e){const t=this.sortable&&e.sortable!==false;if(!t){return s("th",{scope:"col",class:"cell cell--header"},e.label)}const r=this.sortKey===e.key;const a=r?this.sortDirection:"none";return s("th",{scope:"col",class:"cell cell--header","aria-sort":a},s("button",{type:"button",class:"sort",onClick:()=>this.handleSort(e.key),onKeyDown:t=>this.handleHeaderKeydown(t,e.key)},s("span",null,e.label),s("span",{class:"sort__cue","aria-hidden":"true"},this.sortCue(r))))}render(){const e=this.emptyState;return s(a,{key:"
|
|
1
|
+
import{p as e,H as t,c as r,h as s,d as a,t as o}from"./p-qP_9qshx.js";const i=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-primary)}:host([hidden]){display:none}.table__scroll{overflow-x:auto;min-width:0;border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.table__scroll:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.table{width:100%;border-collapse:collapse;font-size:var(--typography-size-sm)}.cell{min-width:8rem}.caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.cell{padding:var(--spacing-md) var(--spacing-lg);text-align:left;vertical-align:top;border-bottom:var(--border-width) solid var(--color-border-default)}.cell--header{font-weight:var(--typography-weight-semibold);color:var(--color-text-secondary);white-space:nowrap;background:var(--color-surface-hover)}tbody tr:last-child td{border-bottom:0}.sort{all:unset;display:inline-flex;align-items:center;gap:var(--spacing-xs);cursor:pointer;border-radius:var(--radius-sm)}.sort:focus-visible{outline:2px solid var(--color-accent-default);outline-offset:2px}.sort__cue{font-size:var(--typography-size-xs);color:var(--color-text-secondary)}.table__empty{padding:var(--spacing-2xl) var(--spacing-lg);text-align:center}.table__empty-message{margin:0;font-size:var(--typography-size-sm);color:var(--color-text-secondary)}`;let n=0;const l=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chSort=r(this,"chSort")}captionId=`ch-table-${++n}-caption`;emptyId=`${this.captionId}-empty`;get host(){return this}columns=[];sortable=false;sortKey;sortDirection="ascending";label;empty="unmeasured";filtered=false;chSort;onFiltered(){this.measure()}rerenderHeaders(){this.rerender=!this.rerender}rerender=false;observer;componentDidLoad(){this.measure();if(typeof MutationObserver==="function"){this.observer=new MutationObserver(this.measure);this.observer.observe(this.host,{childList:true})}}disconnectedCallback(){this.observer?.disconnect();this.observer=undefined}measure=()=>{const e=Array.from(this.host.children).filter((e=>e.tagName==="TR"));this.empty=e.length===0?"true":"none"};get emptyState(){if(this.filtered){return"filtered"}return this.empty}sortCue(e){if(!e){return"⇅"}return this.sortDirection==="ascending"?"▲":"▼"}emptyMessage(e){return e==="filtered"?"No results for these filters.":"Nothing here yet."}nextDirection(e){if(this.sortKey!==e){return"ascending"}return this.sortDirection==="ascending"?"descending":"ascending"}handleSort=e=>{this.chSort.emit({key:e,direction:this.nextDirection(e)})};handleHeaderKeydown=(e,t)=>{if(e.key!=="Enter"&&e.key!==" "){return}e.preventDefault();this.handleSort(t)};renderHeaderCell(e){const t=this.sortable&&e.sortable!==false;if(!t){return s("th",{scope:"col",class:"cell cell--header"},e.label)}const r=this.sortKey===e.key;const a=r?this.sortDirection:"none";return s("th",{scope:"col",class:"cell cell--header","aria-sort":a},s("button",{type:"button",class:"sort",onClick:()=>this.handleSort(e.key),onKeyDown:t=>this.handleHeaderKeydown(t,e.key)},s("span",null,e.label),s("span",{class:"sort__cue","aria-hidden":"true"},this.sortCue(r))))}render(){const e=this.emptyState;return s(a,{key:"f4511d753b9140b08eee0e50041ba4e7408930ec",class:{table:true,"table--empty":e==="true"||e==="filtered"}},s("div",{key:"8cc987803f5d000d7efbbc6b605561d2c6ca1c46",class:"table__scroll",tabIndex:0,role:"group","aria-labelledby":this.captionId},s("table",{key:"9eff6abfe0fecfd3559bfe397db3957fa60e288a"},s("caption",{key:"35d88e56267aff1ae9753326ffc807cf6e04bfba",id:this.captionId,class:"caption"},this.label),s("thead",{key:"0b01e865f3c0f40e9e86634f701b77886713e2e3"},s("tr",{key:"92ded28a12867b8a2a372a9b04e8fd251870a5c7"},this.columns.map((e=>this.renderHeaderCell(e))))),s("tbody",{key:"68d7a49aa51cf1e958f1af7ebc36cdb5f6acfdd0"},s("slot",{key:"79e296699379971e93b8a91b7823987be835ce8e"})))),(e==="true"||e==="filtered")&&s("div",{key:"b7b2734f3d83ced393377fbe6f2911d2466ce714",class:"table__empty",id:this.emptyId},s("slot",{key:"926191c01eef1f1898ad7fc800824021a697da35",name:"empty"},s("p",{key:"6302a52795029b3d31200ae3c1c4ff53af3ab81c",class:"table__empty-message"},this.emptyMessage(e)))))}static get watchers(){return{filtered:[{onFiltered:0}],sortKey:[{rerenderHeaders:0}],sortDirection:[{rerenderHeaders:0}],sortable:[{rerenderHeaders:0}]}}static get style(){return i()}},[769,"ch-table",{columns:[16],sortable:[516],sortKey:[1,"sort-key"],sortDirection:[1,"sort-direction"],label:[1],filtered:[516],empty:[32],rerender:[32]},undefined,{filtered:[{onFiltered:0}],sortKey:[{rerenderHeaders:0}],sortDirection:[{rerenderHeaders:0}],sortable:[{rerenderHeaders:0}]}]);function c(){if(typeof customElements==="undefined"){return}const e=["ch-table"];e.forEach((e=>{switch(e){case"ch-table":if(!customElements.get(o(e))){customElements.define(o(e),l)}break}}))}c();const d=l;const f=c;export{d as ChTable,f as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-table.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-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:"
|
|
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:"5fd5208bb1b9b75f13b9d3830d042f623aaca651"},r("div",{key:"8d602a604a8315db01f3e4d28a39e866efabdb48",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 d=0;const h=4;const l=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-${++d}`;hintId=`${this.textareaId}-hint`;errorId=`${this.textareaId}-error`;initialValue="";internals;formDisabled=false;get host(){return this}label;value="";placeholder;rows=h;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:"0f2b76444b3bff5d37d069bf1fe307781c5e59d1"},this.label&&a("label",{key:"08b83be70f33dc2c9b93a6d748564aad4eb63d76",class:"label",htmlFor:this.textareaId},this.label),a("textarea",{key:"749876530342e5ff9d70ab7039dded1a4f0faa5a",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:"36e41249852346df559bd278256cc89a79371a88",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&a("p",{key:"90bda1f377da78e07eae82ee13069813c7ed1e8b",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 c(){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),l)}break}}))}c();const u=l;const b=c;export{u as ChTextarea,b as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-textarea.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,h as s,d as a,t as o}from"./p-qP_9qshx.js";const i=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;padding:0;display:grid;gap:var(--spacing-md);list-style:none}::slotted(li){position:relative;padding-left:var(--spacing-2xl);min-width:0}::slotted(li)::before{content:'';position:absolute;left:0;top:0.35em;width:var(--spacing-sm);height:var(--spacing-sm);border-radius:50%;background:var(--color-border-default)}::slotted(li:not(:last-of-type))::after{content:'';position:absolute;left:calc(var(--spacing-sm) / 2 - var(--border-width));top:calc(0.35em + var(--spacing-sm));bottom:calc(0px - var(--spacing-md));width:var(--border-width);background:var(--color-border-default)}::slotted(time){font-variant-numeric:tabular-nums}`;const r=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}render(){return s(a,{key:"
|
|
1
|
+
import{p as t,H as e,h as s,d as a,t as o}from"./p-qP_9qshx.js";const i=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;padding:0;display:grid;gap:var(--spacing-md);list-style:none}::slotted(li){position:relative;padding-left:var(--spacing-2xl);min-width:0}::slotted(li)::before{content:'';position:absolute;left:0;top:0.35em;width:var(--spacing-sm);height:var(--spacing-sm);border-radius:50%;background:var(--color-border-default)}::slotted(li:not(:last-of-type))::after{content:'';position:absolute;left:calc(var(--spacing-sm) / 2 - var(--border-width));top:calc(0.35em + var(--spacing-sm));bottom:calc(0px - var(--spacing-md));width:var(--border-width);background:var(--color-border-default)}::slotted(time){font-variant-numeric:tabular-nums}`;const r=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}render(){return s(a,{key:"50b3a225915e4223fa3eaf560cb1e15898026ec0",class:"timeline"},s("ol",{key:"5b5e218a419f63990deca2d1a7e0f8f36f63cc09",class:"list"},s("slot",{key:"69ff4592e898cdecb078437b6633e5e24c626e61"})))}static get style(){return i()}},[257,"ch-timeline"]);function n(){if(typeof customElements==="undefined"){return}const t=["ch-timeline"];t.forEach((t=>{switch(t){case"ch-timeline":if(!customElements.get(o(t))){customElements.define(o(t),r)}break}}))}n();const c=r;const l=n;export{c as ChTimeline,l as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-timeline.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
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
|
|
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 c(t,e,o,i){switch(t){case"top":return{top:e.top-o.height-i,left:e.left+(e.width-o.width)/2};case"bottom":return{top:e.top+e.height+i,left:e.left+(e.width-o.width)/2};case"left":return{top:e.top+(e.height-o.height)/2,left:e.left-o.width-i};case"right":return{top:e.top+(e.height-o.height)/2,left:e.left+e.width+i}}}function b({anchor:t,surface:e,viewport:o,preferred:i,gap:s}){const n=[i,r[i]];let b=i;let d=Number.POSITIVE_INFINITY;for(const i of n){const{top:n,left:r}=c(i,t,e,s);const h={top:n,left:r,width:e.width,height:e.height};const p=a(h,o);const u=l[i]==="vertical"?f(p.top)+f(p.bottom):f(p.left)+f(p.right);if(u<d){d=u;b=i}}const{top:p,left:u}=c(b,t,e,s);const m={top:p,left:u,width:e.width,height:e.height};const g=a(m,o);const v=l[b]==="vertical"?{top:p,left:u+h(g.left,g.right)}:{top:p+h(g.top,g.bottom),left:u};return{placement:b,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}.probe{position:fixed;top:0;left:0;width:1px;height:1px;visibility:hidden;pointer-events:none}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:min(16rem, calc(100vw - 2 * var(--spacing-2xl)));padding:var(--spacing-md) var(--spacing-2xl);border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-sm);line-height:1.4;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--easing-default), visibility var(--duration-fast) var(--easing-default)}.bubble--visible{opacity:1;visibility:visible}.bubble::before{content:'';position:absolute}.bubble--positioned{position:fixed;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);transform:none;margin:0}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble.bubble--positioned.bubble--top,.bubble.bubble--positioned.bubble--bottom,.bubble.bubble--positioned.bubble--left,.bubble.bubble--positioned.bubble--right{inset:auto;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);right:auto;bottom:auto;transform:none;margin:0}.bubble--top::before{top:100%;left:0;right:0;height:var(--spacing-md)}.bubble--bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:var(--spacing-md)}.bubble--bottom::before{bottom:100%;left:0;right:0;height:var(--spacing-md)}.bubble--left{right:100%;top:50%;transform:translateY(-50%);margin-right:var(--spacing-md)}.bubble--left::before{left:100%;top:0;bottom:0;width:var(--spacing-md)}.bubble--right{left:100%;top:50%;transform:translateY(-50%);margin-left:var(--spacing-md)}.bubble--right::before{right:100%;top:0;bottom:0;width:var(--spacing-md)}@media (prefers-reduced-motion: reduce){.bubble{transition:none}}`;let p=0;const u=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-${++p}`;bubbleEl;probeEl;cleanup;placement="top";hovered=false;focused=false;dismissed=false;resolvedPlacement;offset;get visible(){return(this.hovered||this.focused)&&!this.dismissed}componentDidLoad(){this.associate()}connectedCallback(){this.watchViewport()}disconnectedCallback(){this.cleanup?.()}handleMouseEnter(){this.hovered=true;this.dismissed=false;this.position()}handleMouseLeave(){this.hovered=false}handleFocusIn(){this.focused=true;this.dismissed=false;this.position()}handleFocusOut(){this.focused=false}handleKeyDown(t){if(t.key==="Escape"&&this.visible&&!t.defaultPrevented){t.preventDefault();this.dismissed=true}}handleScroll(){if(this.visible&&this.offset){this.position()}}handleResize(){this.position()}watchViewport(){if(typeof window==="undefined"){return}const t=window.visualViewport;if(!t||this.cleanup){return}const e=()=>this.position();t.addEventListener("resize",e);t.addEventListener("scroll",e);this.cleanup=()=>{t.removeEventListener("resize",e);t.removeEventListener("scroll",e)}}slotted(t){return Array.from(this.el.children).find((e=>e.getAttribute("slot")===t))}position(){if(typeof window==="undefined"){return}const t=this.bubbleEl??(this.bubbleEl=this.el.shadowRoot?.querySelector(".bubble")??undefined);const e=this.probeEl??(this.probeEl=this.el.shadowRoot?.querySelector(".probe")??undefined);if(!t||!e||t.offsetWidth===0){return}const i=this.slotted("trigger")?.getBoundingClientRect?.();if(!i){return}const s=e.getBoundingClientRect();const n=s.width||1;const r=s.height||1;const l=t=>({top:(t.top-s.top)/r,left:(t.left-s.left)/n,width:t.width/n,height:t.height/r});const a={width:t.offsetWidth+g(t),height:t.offsetHeight};const c=window.visualViewport;const{placement:f,top:h,left:d}=b({anchor:l(i),surface:a,viewport:l(c?{top:c.offsetTop,left:c.offsetLeft,width:c.width,height:c.height}:{top:0,left:0,width:window.innerWidth,height:window.innerHeight}),preferred:this.placement,gap:u});const p=this.offset;const m=p?.top===h&&p?.left===d&&this.resolvedPlacement===f;this.resolvedPlacement=f;this.offset={top:h,left:d};if(!m){o(this)}}associate=()=>{const t=this.slotted("trigger");const e=this.slotted("content");if(!t||!e){return}if(!e.id){e.id=this.fallbackId}e.setAttribute("role","tooltip");t.setAttribute("aria-describedby",e.id)};render(){const{offset:t}=this;return i(s,{key:"c88fafd18dfa217051213dc510d7c3edd7e6fa45"},i("span",{key:"97b027bccda9cfcfed684556ed11211317ca97b3",class:"anchor"},i("span",{key:"30f76981b7d295b4459f3ca4045168e24ec1ee65",class:"probe","aria-hidden":"true",ref:t=>this.probeEl=t}),i("slot",{key:"f99a7e5b4ca3775e7af26edf9a9e9d76e7c7a292",name:"trigger",onSlotchange:this.associate}),i("span",{key:"17b396847c0be20c03fc010b57dfe3c299dbf3c1",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:"d11e591c095b29033db96242dbeafa4347ee4326",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":["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 * `preventDefault()` dismisses only the innermost surface: the platform's\n * close request for an open native `<dialog>` is the default action of this\n * same keydown, so cancelling it keeps an enclosing `ch-modal` open. Proven\n * against a real `ch-modal` in `tests/browser/ch-tooltip.browser.spec.ts`.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {\n event.preventDefault();\n this.dismissed = true;\n }\n }\n\n /** Cheap guard so scroll frames do not measure while nothing is shown. */\n @Listen('scroll', { target: 'window', capture: true, passive: true })\n handleScroll() {\n if (this.visible && this.offset) {\n this.position();\n }\n }\n\n @Listen('resize', { target: 'window', passive: true })\n handleResize() {\n this.position();\n }\n\n private watchViewport() {\n if (typeof window === 'undefined') {\n return;\n }\n const viewport = window.visualViewport;\n if (!viewport || this.cleanup) {\n return;\n }\n const update = () => this.position();\n viewport.addEventListener('resize', update);\n viewport.addEventListener('scroll', update);\n this.cleanup = () => {\n viewport.removeEventListener('resize', update);\n viewport.removeEventListener('scroll', update);\n };\n }\n\n private slotted(name: string) {\n return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);\n }\n\n /**\n * Measures the anchor and the bubble and stores the offset that keeps the\n * bubble inside the viewport. Nothing is measured before the bubble has a\n * box to measure, so the pre-paint render uses plain CSS.\n */\n 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,KAAO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C,GAC/B,OAAQkC,WAAWH,EAAMI,aAAe,IAAMD,WAAWH,EAAMK,cAAgB,EACjF,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","probeEl","cleanup","hovered","focused","dismissed","resolvedPlacement","offset","visible","this","componentDidLoad","associate","connectedCallback","watchViewport","disconnectedCallback","handleMouseEnter","position","handleMouseLeave","handleFocusIn","handleFocusOut","handleKeyDown","event","key","defaultPrevented","preventDefault","handleScroll","handleResize","window","visualViewport","update","addEventListener","removeEventListener","slotted","name","Array","from","el","children","find","child","getAttribute","bubble","shadowRoot","querySelector","undefined","probe","offsetWidth","anchorRect","getBoundingClientRect","probeRect","scaleX","scaleY","inContainingBlock","horizontalMargin","offsetHeight","offsetTop","offsetLeft","innerWidth","innerHeight","current","unchanged","forceUpdate","trigger","content","id","setAttribute","render","h","Host","class","ref","onSlotchange","style","Boolean","getComputedStyle","parseFloat","marginLeft","marginRight"],"sources":["src/utils/overlay.ts","src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":["export type ChOverlayPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface ChOverlayPosition {\n /** Placement after flipping when the preferred side does not fit. */\n placement: ChOverlayPlacement;\n /** Position in the same coordinate space as `anchor` and `viewport`, in pixels. */\n top: number;\n left: number;\n}\n\nexport interface ChOverlayRect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nexport interface ChOverlayViewport {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nconst OPPOSITE: Record<ChOverlayPlacement, ChOverlayPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\nconst AXIS: Record<ChOverlayPlacement, 'vertical' | 'horizontal'> = {\n top: 'vertical',\n bottom: 'vertical',\n left: 'horizontal',\n right: 'horizontal',\n};\n\n/**\n * How far a placed surface overflows each viewport edge. Positive values are\n * overflow. Used both to pick a placement and to shift the surface back in.\n */\nexport function overflowOf(surface: ChOverlayRect, viewport: ChOverlayViewport) {\n return {\n top: viewport.top - surface.top,\n left: viewport.left - surface.left,\n bottom: surface.top + surface.height - (viewport.top + viewport.height),\n right: surface.left + surface.width - (viewport.left + viewport.width),\n };\n}\n\nfunction offsetFor(placement: ChOverlayPlacement, anchor: ChOverlayRect, surface: { width: number; height: number }, gap: number) {\n switch (placement) {\n case 'top':\n return {\n top: anchor.top - surface.height - gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'bottom':\n return {\n top: anchor.top + anchor.height + gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'left':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left - surface.width - gap,\n };\n case 'right':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left + anchor.width + gap,\n };\n }\n}\n\n/**\n * Picks the placement that overflows least and then shifts the surface along\n * the cross axis so it stays inside the viewport.\n *\n * The main-axis overflow is not compensated with a translate: a tooltip pinned\n * to the top edge would cover its own trigger. Flipping to the other side is\n * what keeps it readable, and the caller decides whether to accept the\n * remaining overflow.\n */\nexport function placeOverlay({\n anchor,\n surface,\n viewport,\n preferred,\n gap,\n}: {\n anchor: ChOverlayRect;\n surface: { width: number; height: number };\n viewport: ChOverlayViewport;\n preferred: ChOverlayPlacement;\n gap: number;\n}): ChOverlayPosition {\n const candidates: ChOverlayPlacement[] = [preferred, OPPOSITE[preferred]];\n let placement = preferred;\n let best = Number.POSITIVE_INFINITY;\n\n for (const candidate of candidates) {\n const { top, left } = offsetFor(candidate, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);\n\n if (main < best) {\n best = main;\n placement = candidate;\n }\n }\n\n const { top, left } = offsetFor(placement, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n\n const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };\n\n return { placement, top: shifted.top, left: shifted.left };\n}\n\n/** Only real overflow counts: the side that fits contributes nothing. */\nfunction clamp(overflow: number) {\n return overflow > 0 ? overflow : 0;\n}\n\n/**\n * Turns the two overflows on an axis into a shift. `before` is the overflow on\n * the leading edge (top or left), `after` the one on the trailing edge; both\n * are positive when the surface spills past that edge.\n *\n * Pushing away from the leading edge moves the surface inwards, so the shift is\n * `+before`. The trailing edge needs the opposite sign. When both overflow the\n * surface is larger than the viewport: pin it to the leading edge and let\n * `max-width` stop the spill.\n */\nfunction correction(before: number, after: number) {\n if (before > 0) {\n return before;\n }\n if (after > 0) {\n return -after;\n }\n return 0;\n}\n",":host {\n display: inline-block;\n}\n\n.anchor {\n position: relative;\n display: inline-flex;\n}\n\n/* Fixed at the origin of the same containing block the bubble uses. */\n.probe {\n position: fixed;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n visibility: hidden;\n pointer-events: none;\n}\n\n.bubble {\n position: absolute;\n z-index: var(--z-index-dropdown);\n width: max-content;\n max-width: min(16rem, calc(100vw - 2 * var(--spacing-2xl)));\n padding: var(--spacing-md) var(--spacing-2xl);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-sm);\n background: var(--color-background-base);\n color: var(--text);\n font-family: var(--font-body);\n font-size: var(--typography-size-sm);\n line-height: 1.4;\n opacity: 0;\n visibility: hidden;\n transition:\n opacity var(--duration-fast) var(--easing-default),\n visibility var(--duration-fast) var(--easing-default);\n}\n\n.bubble--visible {\n opacity: 1;\n visibility: visible;\n}\n\n.bubble::before {\n content: '';\n position: absolute;\n}\n\n/*\n * Once the component has measured the anchor, the bubble is placed with fixed\n * coordinates. Viewport coordinates do not depend on ancestors' transforms or\n * overflow, so a tooltip inside a scrolling drawer or modal stays anchored.\n */\n.bubble--positioned {\n position: fixed;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n transform: none;\n margin: 0;\n}\n\n.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\n}\n\n/* Stencil scopes each rule by doubling its classes, so a three-class selector\n is what actually outranks the single-class placement rules above. */\n.bubble.bubble--positioned.bubble--top,\n.bubble.bubble--positioned.bubble--bottom,\n.bubble.bubble--positioned.bubble--left,\n.bubble.bubble--positioned.bubble--right {\n inset: auto;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n right: auto;\n bottom: auto;\n transform: none;\n margin: 0;\n}\n\n.bubble--top::before {\n top: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--bottom {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: var(--spacing-md);\n}\n\n.bubble--bottom::before {\n bottom: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--left {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: var(--spacing-md);\n}\n\n.bubble--left::before {\n left: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n.bubble--right {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: var(--spacing-md);\n}\n\n.bubble--right::before {\n right: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n}\n","import { Component, Element, forceUpdate, Host, Listen, Prop, State, h } from '@stencil/core';\n\nimport { placeOverlay, type ChOverlayPlacement } from '../../utils/overlay';\n\nexport type ChTooltipPlacement = ChOverlayPlacement;\n\nlet tooltipIds = 0;\n\n/** Space between the trigger and the bubble, matching `--spacing-md`. */\nconst GAP = 8;\n\n/**\n * Short help text shown on hover and on focus.\n *\n * Both the trigger and the text come from the consumer's light DOM through\n * named slots. That is what makes the accessible association work: an\n * `aria-describedby` IDREF only resolves within a single tree, and slotted\n * nodes stay in the document tree even though they render inside the shadow\n * root. Keeping the text in the shadow root instead would need a reference\n * pointing into a shadow tree, which the platform does not allow — element\n * reflection only points outwards, and `referenceTarget` is not available yet.\n *\n * The trigger has to be a natively focusable element (`<button>`, `<a>`,\n * `<input>`). A chucao component such as `ch-button` will not be described,\n * because `aria-*` set on a custom element host does not reach the native\n * element inside it — see the discussion in issue #47.\n *\n * Positioning is measured, not purely CSS: `placement` is the preferred side,\n * and the bubble flips to the opposite side when the preferred one does not\n * fit, then shifts along the other axis to stay inside the viewport. It\n * re-measures on scroll, resize and visual-viewport changes, which is what\n * keeps it correct inside a scrolling modal or drawer and when a mobile\n * keyboard shrinks the visible area.\n */\n@Component({\n tag: 'ch-tooltip',\n styleUrl: 'ch-tooltip.css',\n shadow: true,\n})\nexport class ChTooltip {\n @Element() private el: HTMLElement;\n\n private readonly fallbackId = `ch-tooltip-${++tooltipIds}`;\n\n private bubbleEl?: HTMLElement;\n\n private probeEl?: HTMLElement;\n\n private cleanup?: () => void;\n\n /**\n * The side the bubble is placed on. It is a preference: when that side has no\n * room the bubble flips to the opposite one.\n */\n @Prop() placement: ChTooltipPlacement = 'top';\n\n // Hover and focus are tracked apart so that neither cancels the other: a\n // pointer passing over and away must not hide a tooltip whose trigger still\n // holds keyboard focus.\n @State() hovered = false;\n @State() focused = false;\n @State() dismissed = false;\n\n /** The placement actually used, which may differ from the prop after a flip. */\n @State() resolvedPlacement?: ChTooltipPlacement;\n\n /** Offset applied to the bubble once it has been measured. */\n private offset?: { top: number; left: number };\n\n private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n connectedCallback() {\n this.watchViewport();\n }\n\n disconnectedCallback() {\n this.cleanup?.();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\n this.position();\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Listen('focusin')\n handleFocusIn() {\n this.focused = true;\n this.dismissed = false;\n this.position();\n }\n\n @Listen('focusout')\n handleFocusOut() {\n this.focused = false;\n }\n\n /**\n * Listens on the document because a tooltip opened by hovering leaves focus\n * wherever it was, so a host-scoped handler would never see the key.\n *\n * `preventDefault()` dismisses only the innermost surface: the platform's\n * close request for an open native `<dialog>` is the default action of this\n * same keydown, so cancelling it keeps an enclosing `ch-modal` open. Proven\n * against a real `ch-modal` in `tests/browser/ch-tooltip.browser.spec.ts`.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {\n event.preventDefault();\n this.dismissed = true;\n }\n }\n\n /** Cheap guard so scroll frames do not measure while nothing is shown. */\n @Listen('scroll', { target: 'window', capture: true, passive: true })\n handleScroll() {\n if (this.visible && this.offset) {\n this.position();\n }\n }\n\n @Listen('resize', { target: 'window', passive: true })\n handleResize() {\n this.position();\n }\n\n private watchViewport() {\n if (typeof window === 'undefined') {\n return;\n }\n const viewport = window.visualViewport;\n if (!viewport || this.cleanup) {\n return;\n }\n const update = () => this.position();\n viewport.addEventListener('resize', update);\n viewport.addEventListener('scroll', update);\n this.cleanup = () => {\n viewport.removeEventListener('resize', update);\n viewport.removeEventListener('scroll', update);\n };\n }\n\n private slotted(name: string) {\n return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);\n }\n\n /**\n * Measures the anchor and the bubble and stores the offset that keeps the\n * bubble inside the viewport. Nothing is measured before the bubble has a\n * box to measure, so the pre-paint render uses plain CSS.\n *\n * A fixed bubble is positioned against the nearest ancestor that establishes\n * a containing block (a `transform`, `filter`, `backdrop-filter`, `contain`\n * or `will-change`), not necessarily the viewport. The probe is fixed at the\n * containing block's origin, so both the anchor and the viewport are\n * converted into that same space before `placeOverlay` does its maths.\n */\n private position() {\n if (typeof window === 'undefined') {\n return;\n }\n const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector<HTMLElement>('.bubble') ?? undefined);\n const probe = this.probeEl ?? (this.probeEl = this.el.shadowRoot?.querySelector<HTMLElement>('.probe') ?? undefined);\n if (!bubble || !probe || bubble.offsetWidth === 0) {\n return;\n }\n\n const anchorRect = (this.slotted('trigger') as HTMLElement | undefined)?.getBoundingClientRect?.();\n if (!anchorRect) {\n return;\n }\n\n const probeRect = probe.getBoundingClientRect();\n const scaleX = probeRect.width || 1;\n const scaleY = probeRect.height || 1;\n const inContainingBlock = (rect: { top: number; left: number; width: number; height: number }) => ({\n top: (rect.top - probeRect.top) / scaleY,\n left: (rect.left - probeRect.left) / scaleX,\n width: rect.width / scaleX,\n height: rect.height / scaleY,\n });\n\n const surface = {\n width: bubble.offsetWidth + horizontalMargin(bubble),\n height: bubble.offsetHeight,\n };\n const viewport = window.visualViewport;\n\n const { placement, top, left } = placeOverlay({\n anchor: inContainingBlock(anchorRect),\n surface,\n viewport: inContainingBlock(\n viewport\n ? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }\n : { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },\n ),\n preferred: this.placement,\n gap: GAP,\n });\n\n const current = this.offset;\n const unchanged = current?.top === top && current?.left === left && this.resolvedPlacement === placement;\n this.resolvedPlacement = placement;\n this.offset = { top, left };\n if (!unchanged) {\n forceUpdate(this);\n }\n }\n\n /**\n * Points the trigger at the text with `aria-describedby`. Re-run on\n * `slotchange` because a framework re-render can replace the slotted nodes\n * and take the attributes with them.\n */\n private associate = () => {\n const trigger = this.slotted('trigger');\n const content = this.slotted('content');\n if (!trigger || !content) {\n return;\n }\n if (!content.id) {\n content.id = this.fallbackId;\n }\n content.setAttribute('role', 'tooltip');\n trigger.setAttribute('aria-describedby', content.id);\n };\n\n render() {\n const { offset } = this;\n\n return (\n <Host>\n <span class=\"anchor\">\n <span class=\"probe\" aria-hidden=\"true\" ref={el => (this.probeEl = el)}></span>\n {/* Pre-measure render uses the preferred side so the bubble never\n jumps from the wrong edge on its first frame. */}\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span\n ref={el => (this.bubbleEl = el)}\n style={{\n '--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,\n '--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,\n }}\n class={{\n 'bubble': true,\n 'bubble--positioned': Boolean(this.offset),\n [`bubble--${this.resolvedPlacement ?? this.placement}`]: true,\n 'bubble--visible': this.visible,\n }}\n >\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n\nfunction horizontalMargin(el: HTMLElement) {\n const style = getComputedStyle(el);\n return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);\n}\n"],"mappings":"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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F,QACnC,CAAC,WAAWE,KAAKH,mBAAqBG,KAAKlC,aAAc,KACzD,kBAAmBkC,KAAKD,UAG1B2D,EAAA,QAAA7C,IAAA,2CAAMW,KAAK,UAAUsC,aAAc9D,KAAKE,c,oWAQpD,SAAS0C,EAAiBjB,GACxB,MAAMoC,EAAQE,iBAAiBtC,GAC/B,OAAQuC,WAAWH,EAAMI,aAAe,IAAMD,WAAWH,EAAMK,cAAgB,EACjF,C","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as n,h as r,d as s,t as i}from"./p-qP_9qshx.js";const t=()=>`:host{display:inline-block;vertical-align:middle}.spinner{display:block;box-sizing:border-box;width:1em;height:1em;border:0.125em solid currentColor;border-top-color:transparent;border-radius:50%;animation:ch-spinner-rotate var(--duration-spin) var(--easing-linear) infinite}.spinner--sm{font-size:var(--typography-size-sm)}.spinner--md{font-size:var(--typography-size-lg)}.spinner--lg{font-size:var(--typography-size-xl)}@keyframes ch-spinner-rotate{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spinner{animation-duration:calc(var(--duration-spin) * 4)}}`;const a=e(class e extends n{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}size="md";label;render(){const e=Boolean(this.label);return r(s,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as e,H as n,h as r,d as s,t as i}from"./p-qP_9qshx.js";const t=()=>`:host{display:inline-block;vertical-align:middle}.spinner{display:block;box-sizing:border-box;width:1em;height:1em;border:0.125em solid currentColor;border-top-color:transparent;border-radius:50%;animation:ch-spinner-rotate var(--duration-spin) var(--easing-linear) infinite}.spinner--sm{font-size:var(--typography-size-sm)}.spinner--md{font-size:var(--typography-size-lg)}.spinner--lg{font-size:var(--typography-size-xl)}@keyframes ch-spinner-rotate{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spinner{animation-duration:calc(var(--duration-spin) * 4)}}`;const a=e(class e extends n{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}size="md";label;render(){const e=Boolean(this.label);return r(s,{key:"1d8ef18f03d7a52d61854cc84fb39994ee8ce0a9"},r("span",{key:"28ec4657d1a0de9181f9d31742fc6bd26b284b14",class:{spinner:true,[`spinner--${this.size}`]:true},role:e?"status":undefined,"aria-label":e?this.label:undefined,"aria-hidden":e?undefined:"true"}))}static get style(){return t()}},[513,"ch-spinner",{size:[1],label:[1]}]);function o(){if(typeof customElements==="undefined"){return}const e=["ch-spinner"];e.forEach((e=>{switch(e){case"ch-spinner":if(!customElements.get(i(e))){customElements.define(i(e),a)}break}}))}o();export{a as C,o as d};
|
|
2
|
+
//# sourceMappingURL=p-DiUN1WGc.js.map
|
|
@@ -32,7 +32,7 @@ const ChAccordion = class {
|
|
|
32
32
|
this.chChange.emit(this.value);
|
|
33
33
|
};
|
|
34
34
|
render() {
|
|
35
|
-
return (h(Host, { key: '
|
|
35
|
+
return (h(Host, { key: 'f147314134464f7455ac179fad62c1b9318efc92' }, this.items.map(item => {
|
|
36
36
|
const open = this.value === item.value;
|
|
37
37
|
return (h("div", { key: item.value, class: { 'item': true, 'item--open': open } }, h("h3", { class: "item-head" }, h("button", { type: "button", class: "item-toggle", id: this.headerId(item.value), "data-value": item.value, "aria-expanded": open ? 'true' : 'false', "aria-controls": this.panelId(item.value), disabled: item.disabled, onClick: () => this.toggle(item.value) }, item.title)), h("div", { class: "item-panel", id: this.panelId(item.value), role: "region", "aria-labelledby": this.headerId(item.value), hidden: !open }, h("slot", { name: `panel-${item.value}` }))));
|
|
38
38
|
})));
|