@devschile/chucao 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/{p-f5b74bca.entry.js → p-0409c063.entry.js} +2 -2
- package/dist/chucao/{p-0bc141a2.entry.js → p-090d26f1.entry.js} +2 -2
- package/dist/chucao/{p-f9fe752c.entry.js → p-207648f9.entry.js} +2 -2
- package/dist/chucao/{p-9f73855e.entry.js → p-20ea1b18.entry.js} +2 -2
- package/dist/chucao/{p-be7b5c21.entry.js → p-21ca2235.entry.js} +2 -2
- package/dist/chucao/{p-fdf065e6.entry.js → p-2c1bc8bd.entry.js} +2 -2
- package/dist/chucao/{p-2c681cc0.entry.js → p-370d9629.entry.js} +2 -2
- package/dist/chucao/{p-2c681cc0.entry.js.map → p-370d9629.entry.js.map} +1 -1
- package/dist/chucao/{p-6345c9e1.entry.js → p-50cbea7f.entry.js} +2 -2
- package/dist/chucao/p-66ae9e2c.entry.js +2 -0
- package/dist/chucao/p-66ae9e2c.entry.js.map +1 -0
- package/dist/chucao/p-79f20bfd.entry.js +2 -0
- package/dist/chucao/p-79f20bfd.entry.js.map +1 -0
- package/dist/chucao/{p-c251b0d1.entry.js → p-7d4336bd.entry.js} +2 -2
- package/dist/chucao/{p-957acf39.entry.js → p-81b6622f.entry.js} +2 -2
- package/dist/chucao/{p-b53d954e.entry.js → p-925af6b8.entry.js} +2 -2
- package/dist/chucao/p-95061461.entry.js +2 -0
- package/dist/chucao/{p-97655c41.entry.js → p-9794a3fa.entry.js} +2 -2
- package/dist/chucao/{p-26e144ff.entry.js → p-b56f4a29.entry.js} +2 -2
- package/dist/chucao/{p-c165f839.entry.js → p-b9b47942.entry.js} +2 -2
- package/dist/chucao/{p-0e044eff.entry.js → p-c1b35f1b.entry.js} +2 -2
- package/dist/chucao/p-e2f725bd.entry.js +2 -0
- package/dist/chucao/{p-2e785177.entry.js.map → p-e2f725bd.entry.js.map} +1 -1
- package/dist/chucao/{p-350f974d.entry.js → p-e6f959f4.entry.js} +2 -2
- package/dist/chucao/p-f0aea6ed.entry.js +2 -0
- package/dist/chucao/{p-1108062e.entry.js → p-f7305552.entry.js} +2 -2
- package/dist/chucao/p-ffaf1a31.entry.js +2 -0
- package/dist/chucao/p-ffaf1a31.entry.js.map +1 -0
- 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 +29 -0
- package/dist/cjs/ch-description-list.cjs.entry.js.map +1 -0
- 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-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 +46 -0
- package/dist/cjs/ch-stat.cjs.entry.js.map +1 -0
- 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 +20 -0
- package/dist/cjs/ch-timeline.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-tooltip.cjs.entry.js +6 -4
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/chucao.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +9 -6
- 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.css +60 -0
- package/dist/collection/components/ch-description-list/ch-description-list.js +78 -0
- package/dist/collection/components/ch-description-list/ch-description-list.js.map +1 -0
- 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-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.css +68 -0
- package/dist/collection/components/ch-stat/ch-stat.js +151 -0
- package/dist/collection/components/ch-stat/ch-stat.js.map +1 -0
- package/dist/collection/components/ch-switch/ch-switch.js +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
- package/dist/collection/components/ch-timeline/ch-timeline.css +54 -0
- package/dist/collection/components/ch-timeline/ch-timeline.js +43 -0
- package/dist/collection/components/ch-timeline/ch-timeline.js.map +1 -0
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +6 -4
- package/dist/collection/components/ch-tooltip/ch-tooltip.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-card.js.map +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-cluster.js +1 -1
- package/dist/components/ch-description-list.d.ts +11 -0
- package/dist/components/ch-description-list.js +2 -0
- package/dist/components/ch-description-list.js.map +1 -0
- 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-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.d.ts +11 -0
- package/dist/components/ch-stat.js +2 -0
- package/dist/components/ch-stat.js.map +1 -0
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-timeline.d.ts +11 -0
- package/dist/components/ch-timeline.js +2 -0
- package/dist/components/ch-timeline.js.map +1 -0
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/ch-tooltip.js.map +1 -1
- package/dist/components/{p-CV0rD-fF.js → p-Cw0b4OGc.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 +27 -0
- package/dist/esm/ch-description-list.entry.js.map +1 -0
- 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-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 +44 -0
- package/dist/esm/ch-stat.entry.js.map +1 -0
- 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 +18 -0
- package/dist/esm/ch-timeline.entry.js.map +1 -0
- package/dist/esm/ch-tooltip.entry.js +6 -4
- package/dist/esm/ch-tooltip.entry.js.map +1 -1
- package/dist/esm/chucao.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ch-description-list/ch-description-list.d.ts +30 -0
- package/dist/types/components/ch-stat/ch-stat.d.ts +42 -0
- package/dist/types/components/ch-timeline/ch-timeline.d.ts +27 -0
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +4 -2
- package/dist/types/components.d.ts +312 -0
- package/dist-react/components.d.ts +9 -0
- package/dist-react/components.js +27 -0
- package/dist-react/components.ts +36 -0
- package/dist-vue/index.d.ts +3 -0
- package/dist-vue/index.js +13 -0
- package/dist-vue/index.ts +19 -0
- package/hydrate/index.js +200 -30
- package/hydrate/index.mjs +200 -30
- package/package.json +14 -2
- package/dist/chucao/p-2e785177.entry.js +0 -2
- package/dist/chucao/p-4846cac4.entry.js +0 -2
- package/dist/chucao/p-b6cc08f0.entry.js +0 -2
- /package/dist/chucao/{p-f5b74bca.entry.js.map → p-0409c063.entry.js.map} +0 -0
- /package/dist/chucao/{p-0bc141a2.entry.js.map → p-090d26f1.entry.js.map} +0 -0
- /package/dist/chucao/{p-f9fe752c.entry.js.map → p-207648f9.entry.js.map} +0 -0
- /package/dist/chucao/{p-9f73855e.entry.js.map → p-20ea1b18.entry.js.map} +0 -0
- /package/dist/chucao/{p-be7b5c21.entry.js.map → p-21ca2235.entry.js.map} +0 -0
- /package/dist/chucao/{p-fdf065e6.entry.js.map → p-2c1bc8bd.entry.js.map} +0 -0
- /package/dist/chucao/{p-6345c9e1.entry.js.map → p-50cbea7f.entry.js.map} +0 -0
- /package/dist/chucao/{p-c251b0d1.entry.js.map → p-7d4336bd.entry.js.map} +0 -0
- /package/dist/chucao/{p-957acf39.entry.js.map → p-81b6622f.entry.js.map} +0 -0
- /package/dist/chucao/{p-b53d954e.entry.js.map → p-925af6b8.entry.js.map} +0 -0
- /package/dist/chucao/{p-b6cc08f0.entry.js.map → p-95061461.entry.js.map} +0 -0
- /package/dist/chucao/{p-97655c41.entry.js.map → p-9794a3fa.entry.js.map} +0 -0
- /package/dist/chucao/{p-26e144ff.entry.js.map → p-b56f4a29.entry.js.map} +0 -0
- /package/dist/chucao/{p-c165f839.entry.js.map → p-b9b47942.entry.js.map} +0 -0
- /package/dist/chucao/{p-0e044eff.entry.js.map → p-c1b35f1b.entry.js.map} +0 -0
- /package/dist/chucao/{p-350f974d.entry.js.map → p-e6f959f4.entry.js.map} +0 -0
- /package/dist/chucao/{p-4846cac4.entry.js.map → p-f0aea6ed.entry.js.map} +0 -0
- /package/dist/chucao/{p-1108062e.entry.js.map → p-f7305552.entry.js.map} +0 -0
- /package/dist/components/{p-CV0rD-fF.js.map → p-Cw0b4OGc.js.map} +0 -0
|
@@ -47,7 +47,7 @@ const ChSkeleton = class {
|
|
|
47
47
|
return { width: this.width, height: this.height };
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
return (index.h(index.Host, { key: '
|
|
50
|
+
return (index.h(index.Host, { key: '705e4cd6dac9c8c8578cb8133a700c3297d9fffe', "aria-hidden": "true", class: { 'skeleton': true, [`skeleton--${this.shape}`]: true, 'skeleton--animated': this.animated } }, Array.from({ length: this.items }).map((value, index$1) => (index.h("span", { class: "skeleton__item", style: this.sizeStyle, key: index$1, "data-index": String(value) })))));
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
ChSkeleton.style = chSkeletonCss();
|
|
@@ -26,7 +26,7 @@ const ChStack = class {
|
|
|
26
26
|
return GAPS.has(this.gap) ? this.gap : 'md';
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (index.h(index.Host, { key: '
|
|
29
|
+
return (index.h(index.Host, { key: 'd4ee90331cd1ff0d65eb9c80aa684d3b2f5e2876', class: { stack: true, [`stack--gap-${this.gapStep}`]: true, [`stack--align-${this.align}`]: true, [`stack--justify-${this.justify}`]: true } }, index.h("slot", { key: 'bdfe358adc457ed6ba79ca80b9e96f17597fbcb5' })));
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
ChStack.style = chStackCss();
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-ByZY6aTj.js');
|
|
4
|
+
|
|
5
|
+
const chStatCss = () => `: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)}`;
|
|
6
|
+
|
|
7
|
+
const TONES = new Set(['default', 'positive', 'negative', 'unavailable']);
|
|
8
|
+
const ChStat = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Short label naming the metric, rendered in small caps above the value.
|
|
14
|
+
*/
|
|
15
|
+
label;
|
|
16
|
+
/**
|
|
17
|
+
* The metric value, already formatted by the consumer. Shown verbatim.
|
|
18
|
+
*/
|
|
19
|
+
value;
|
|
20
|
+
/**
|
|
21
|
+
* Secondary line under the value — a comparison or a unit note.
|
|
22
|
+
*/
|
|
23
|
+
hint;
|
|
24
|
+
/**
|
|
25
|
+
* Visual tone of the value. `positive` and `negative` add a sign cue so
|
|
26
|
+
* the tone survives greyscale; `unavailable` dims the value for the
|
|
27
|
+
* "could not be measured" case. An unknown value falls back to `default`.
|
|
28
|
+
*/
|
|
29
|
+
tone = 'default';
|
|
30
|
+
get toneClass() {
|
|
31
|
+
return TONES.has(this.tone) ? this.tone : 'default';
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
const cue = this.toneClass === 'positive' ? '+' : this.toneClass === 'negative' ? '−' : null;
|
|
35
|
+
return (index.h(index.Host, { key: '5a43c713faab1513866d8f06899bb3fd3184cf09', class: "stat" }, index.h("div", { key: '9c24e9774cfe0a70b8ba37c06ce7f264b34a9d8c', class: "stat__inner" }, index.h("span", { key: '1a9330c2b31ec6de29f1b8c77761d7eb16160aae', class: "stat__label" }, this.label), index.h("span", { key: '3f6c5e76f5c062effcb9793206a949942bcdfb9a', class: {
|
|
36
|
+
stat__value: true,
|
|
37
|
+
[`stat__value--${this.toneClass}`]: this.toneClass !== 'default',
|
|
38
|
+
} }, cue && (index.h("span", { key: 'b5f79899ec52e7e2b3ec3c00295f755f770a8bca', class: "stat__cue", "aria-hidden": "true" }, cue)), index.h("slot", { key: 'b64083aa5738b4088cf9029650286b2564649ec9', name: "value" }, this.value)), this.hint && index.h("span", { key: '9f560c1f1fd23f08ea63eccc9076066a7fd1a0f9', class: "stat__hint" }, this.hint), index.h("div", { key: '77f3fe1f87e3abc2cce829e06b21f6b2c5f9aa15', class: "stat__footer" }, index.h("slot", { key: 'd75204702eab0ab1f55df92e9c13c899235f6840', name: "footer" })))));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
ChStat.style = chStatCss();
|
|
42
|
+
|
|
43
|
+
exports.ch_stat = ChStat;
|
|
44
|
+
//# sourceMappingURL=ch-stat.entry.cjs.js.map
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=ch-stat.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"ch-stat.cjs.entry.js","mappings":";;;;AAAA,MAAM,SAAS,GAAG,MAAM,CAAC,soCAAsoC,CAAC;;ACIhqC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;MA0B5D,MAAM,GAAA,MAAA;;;;AACjB;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;AACK,IAAA,IAAI;AAEZ;;;;AAIG;IACK,IAAI,GAAe,SAAS;AAEpC,IAAA,IAAY,SAAS,GAAA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EAAC,cAAc,EAAA,EACvBA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,QAAQ,EAAA,CAAQ,CACvB,CACF,CACD;;;;;;;","names":["h","Host"],"sources":["src/components/ch-stat/ch-stat.css?tag=ch-stat&encapsulation=shadow","src/components/ch-stat/ch-stat.tsx"],"sourcesContent":[":host {\n display: block;\n font-family: var(--typography-body);\n color: var(--color-text-primary);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.stat__inner {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-2xs);\n padding: var(--spacing-md) var(--spacing-lg);\n border: var(--border-width) solid var(--color-border-default);\n border-radius: var(--radius-md);\n background: var(--color-surface-default);\n}\n\n.stat__label {\n font-size: var(--typography-size-xs);\n font-weight: var(--typography-weight-semibold);\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--color-text-secondary);\n}\n\n.stat__value {\n font-family: var(--typography-heading);\n font-size: var(--typography-size-xl);\n font-weight: var(--typography-weight-bold);\n font-variant-numeric: tabular-nums;\n display: flex;\n align-items: baseline;\n gap: var(--spacing-2xs);\n}\n\n/* The sign cue carries the tone in greyscale; colour only reinforces it. */\n.stat__cue {\n font-size: var(--typography-size-md);\n}\n\n.stat__value--positive {\n color: var(--color-status-positive);\n}\n\n.stat__value--negative {\n color: var(--color-status-negative);\n}\n\n.stat__value--unavailable {\n color: var(--color-text-tertiary);\n font-style: italic;\n}\n\n.stat__hint {\n font-size: var(--typography-size-sm);\n color: var(--color-text-secondary);\n}\n\n.stat__footer:empty {\n display: none;\n}\n\n.stat__footer {\n margin-top: var(--spacing-2xs);\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChStatTone = 'default' | 'positive' | 'negative' | 'unavailable';\n\nconst TONES = new Set(['default', 'positive', 'negative', 'unavailable']);\n\n/**\n * One dashboard metric: a label, a value and an optional hint.\n *\n * The value is a string the consumer has already formatted — the component\n * never parses numbers, so locale, currency and precision stay where the\n * data comes from. On a fetch error, pass the em dash and the unavailable\n * tone rather than a zero that would read as a real measurement:\n *\n * ```html\n * <ch-stat label=\"Ventas del mes\" value=\"$1.250.000\" tone=\"positive\"></ch-stat>\n * <ch-stat label=\"Ticket promedio\" value=\"—\" tone=\"unavailable\"></ch-stat>\n * ```\n *\n * A tone is never carried by colour alone: positive and negative values get\n * a visible sign cue, so the three states stay distinguishable in greyscale\n * and for colour-blind users. The `value` slot replaces the rendered value\n * for composed content (a link, a spinner), and the `footer` slot sits under\n * the hint for a comparison line or a sparkline.\n */\n@Component({\n tag: 'ch-stat',\n styleUrl: 'ch-stat.css',\n shadow: true,\n})\nexport class ChStat {\n /**\n * Short label naming the metric, rendered in small caps above the value.\n */\n @Prop() label!: string;\n\n /**\n * The metric value, already formatted by the consumer. Shown verbatim.\n */\n @Prop() value!: string;\n\n /**\n * Secondary line under the value — a comparison or a unit note.\n */\n @Prop() hint?: string;\n\n /**\n * Visual tone of the value. `positive` and `negative` add a sign cue so\n * the tone survives greyscale; `unavailable` dims the value for the\n * \"could not be measured\" case. An unknown value falls back to `default`.\n */\n @Prop() tone: ChStatTone = 'default';\n\n private get toneClass() {\n return TONES.has(this.tone) ? this.tone : 'default';\n }\n\n render() {\n const cue = this.toneClass === 'positive' ? '+' : this.toneClass === 'negative' ? '−' : null;\n\n return (\n <Host class=\"stat\">\n <div class=\"stat__inner\">\n <span class=\"stat__label\">{this.label}</span>\n <span\n class={{\n stat__value: true,\n [`stat__value--${this.toneClass}`]: this.toneClass !== 'default',\n }}\n >\n {cue && (\n <span class=\"stat__cue\" aria-hidden=\"true\">\n {cue}\n </span>\n )}\n <slot name=\"value\">{this.value}</slot>\n </span>\n {this.hint && <span class=\"stat__hint\">{this.hint}</span>}\n <div class=\"stat__footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -86,7 +86,7 @@ const ChTabs = class {
|
|
|
86
86
|
}
|
|
87
87
|
render() {
|
|
88
88
|
const active = this.activeValue;
|
|
89
|
-
return (index.h(index.Host, { key: '
|
|
89
|
+
return (index.h(index.Host, { key: 'de167280c159345631f84f5eb7a3dc165396f361' }, index.h("div", { key: '62c008bcf9eafd1c5f5121540b2841e2a6ada541', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
|
|
90
90
|
const selected = tab.value === active;
|
|
91
91
|
return (index.h("button", { key: tab.value, type: "button", class: { 'tab': true, 'tab--active': selected, 'tab--disabled': Boolean(tab.disabled) }, role: "tab", id: this.tabId(tab.value), "data-value": tab.value, "aria-selected": selected ? 'true' : 'false', "aria-controls": this.panelId(tab.value), tabIndex: selected ? FIRST_TAB_INDEX : LAST_TAB_INDEX, disabled: tab.disabled, onClick: () => this.select(tab.value) }, tab.label));
|
|
92
92
|
})), this.tabs.map(tab => (index.h("div", { key: `${tab.value}-panel`, class: "tabpanel", id: this.panelId(tab.value), role: "tabpanel", "aria-labelledby": this.tabId(tab.value), tabIndex: FIRST_TAB_INDEX, hidden: tab.value !== active }, index.h("slot", { name: `panel-${tab.value}` }))))));
|
|
@@ -125,7 +125,7 @@ const ChTextarea = class {
|
|
|
125
125
|
return undefined;
|
|
126
126
|
}
|
|
127
127
|
render() {
|
|
128
|
-
return (index.h(index.Host, { key: '
|
|
128
|
+
return (index.h(index.Host, { key: 'c4334a23f6ad2394d410498726f3f422a654ffe3' }, this.label && (index.h("label", { key: 'd935613b40c6c52be41e258aad2a3c17a290a506', class: "label", htmlFor: this.textareaId }, this.label)), index.h("textarea", { key: 'ab27ae9a6be7d2bcc17638c209ef23eb3757c102', 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) && (index.h("p", { key: 'eb488704ac6ff76534308aefd0938d848d14608f', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: '04c084b29d102f06bf15efc4c416b6ba0967ba8d', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
129
129
|
}
|
|
130
130
|
static get formAssociated() { return true; }
|
|
131
131
|
static get watchers() { return {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-ByZY6aTj.js');
|
|
4
|
+
|
|
5
|
+
const chTimelineCss = () => `: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}`;
|
|
6
|
+
|
|
7
|
+
const ChTimeline = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (index.h(index.Host, { key: 'da3288af540acb92113ba83d08fc5e1693e83b3e', class: "timeline" }, index.h("ol", { key: '1aaee846703dd0a67d6df04945eb4a62e2bbf711', class: "list" }, index.h("slot", { key: '394cfd03640a2cf78bd620338de9ed9ef7b9d9f5' }))));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
ChTimeline.style = chTimelineCss();
|
|
16
|
+
|
|
17
|
+
exports.ch_timeline = ChTimeline;
|
|
18
|
+
//# sourceMappingURL=ch-timeline.entry.cjs.js.map
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=ch-timeline.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"ch-timeline.cjs.entry.js","mappings":";;;;AAAA,MAAM,aAAa,GAAG,MAAM,CAAC,svBAAsvB,CAAC;;MC+BvwB,UAAU,GAAA,MAAA;;;;IACrB,MAAM,GAAA;AACJ,QAAA,QACEA,OAAA,CAACC,UAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAC,KAAK,EAAC,UAAU,EAAA,EACpBD,OAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAI,KAAK,EAAC,MAAM,EAAA,EACdA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAa,CACV,CACA;;;;;;;","names":["h","Host"],"sources":["src/components/ch-timeline/ch-timeline.css?tag=ch-timeline&encapsulation=shadow","src/components/ch-timeline/ch-timeline.tsx"],"sourcesContent":[":host {\n display: block;\n font-family: var(--typography-body);\n color: var(--color-text-secondary);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.list {\n margin: 0;\n padding: 0;\n display: grid;\n gap: var(--spacing-md);\n /* Reserve the rail: every item indents past its marker. */\n list-style: none;\n}\n\n/* Each slotted item indents past its dot; pseudo-elements on slotted\n * content are part of the shadow stylesheet's remit here. */\n::slotted(li) {\n position: relative;\n padding-left: var(--spacing-2xl);\n min-width: 0;\n}\n\n/* The marker dot, vertically on the item's first line. */\n::slotted(li)::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0.35em;\n width: var(--spacing-sm);\n height: var(--spacing-sm);\n border-radius: 50%;\n background: var(--color-border-default);\n}\n\n/* The connector to the next item; the last item never gets one, so the\n * timeline does not trail off into nothing. */\n::slotted(li:not(:last-of-type))::after {\n content: '';\n position: absolute;\n left: calc(var(--spacing-sm) / 2 - var(--border-width));\n top: calc(0.35em + var(--spacing-sm));\n bottom: calc(0px - var(--spacing-md));\n width: var(--border-width);\n background: var(--color-border-default);\n}\n\n::slotted(time) {\n font-variant-numeric: tabular-nums;\n}\n","import { Component, Host, h } from '@stencil/core';\n\n/**\n * Chronological history: a native ordered list with a marker dot per item\n * and a connector line between items — the last item never gets a trailing\n * connector.\n *\n * The component renders the `<ol>` and owns the rail; the consumer writes\n * plain `<li>` items with whatever content each entry needs — a preformatted\n * date, a title, a description, and a non-colour state cue from `ch-icon`:\n *\n * ```html\n * <ch-timeline>\n * <li>\n * <ch-icon name=\"check\"></ch-icon>\n * <time datetime=\"2026-11-02\">2 nov 2026</time> — Creado el pedido\n * </li>\n * <li><ch-icon name=\"spinner\"></ch-icon> Esperando despacho</li>\n * </ch-timeline>\n * ```\n *\n * The list semantics survive untouched because the `li` elements stay native\n * in the light DOM — measured on #83: a wrapped item still counts as a\n * `listitem`, so nothing is gained by a `ch-timeline-item` element, and\n * native markup is the safe bet across browsers.\n */\n@Component({\n tag: 'ch-timeline',\n styleUrl: 'ch-timeline.css',\n shadow: true,\n})\nexport class ChTimeline {\n render() {\n return (\n <Host class=\"timeline\">\n <ol class=\"list\">\n <slot></slot>\n </ol>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -163,8 +163,10 @@ const ChTooltip = class {
|
|
|
163
163
|
* Listens on the document because a tooltip opened by hovering leaves focus
|
|
164
164
|
* wherever it was, so a host-scoped handler would never see the key.
|
|
165
165
|
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
166
|
+
* `preventDefault()` dismisses only the innermost surface: the platform's
|
|
167
|
+
* close request for an open native `<dialog>` is the default action of this
|
|
168
|
+
* same keydown, so cancelling it keeps an enclosing `ch-modal` open. Proven
|
|
169
|
+
* against a real `ch-modal` in `tests/browser/ch-tooltip.browser.spec.ts`.
|
|
168
170
|
*/
|
|
169
171
|
handleKeyDown(event) {
|
|
170
172
|
if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {
|
|
@@ -258,7 +260,7 @@ const ChTooltip = class {
|
|
|
258
260
|
};
|
|
259
261
|
render() {
|
|
260
262
|
const { offset } = this;
|
|
261
|
-
return (index.h(index.Host, { key: '
|
|
263
|
+
return (index.h(index.Host, { key: '676e431d0100ecc9ea688b7e37bc87e8295bb24d' }, index.h("span", { key: '20a388681252e9c4d52e662c014efd9a198efbd7', class: "anchor" }, index.h("slot", { key: 'a06cbe31dd04cba38ef09788359783d816fc1a5b', name: "trigger", onSlotchange: this.associate }), index.h("span", { key: '13cb5b782a7029fc82c10b9b6765de62b94b9afa', ref: el => (this.bubbleEl = el), style: {
|
|
262
264
|
'--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,
|
|
263
265
|
'--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,
|
|
264
266
|
}, class: {
|
|
@@ -266,7 +268,7 @@ const ChTooltip = class {
|
|
|
266
268
|
'bubble--positioned': Boolean(this.offset),
|
|
267
269
|
[`bubble--${this.resolvedPlacement ?? this.placement}`]: true,
|
|
268
270
|
'bubble--visible': this.visible,
|
|
269
|
-
} }, index.h("slot", { key: '
|
|
271
|
+
} }, index.h("slot", { key: '6610bbf299354bb3be07bb273fab3f8fd91fd254', name: "content", onSlotchange: this.associate })))));
|
|
270
272
|
}
|
|
271
273
|
};
|
|
272
274
|
function horizontalMargin(el) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"ch-tooltip.cjs.entry.js","mappings":";;;;AAwBA,MAAM,QAAQ,GAAmD;AAC/D,IAAA,GAAG,EAAE,QAAQ;AACb,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,KAAK,EAAE,MAAM;CACd;AAED,MAAM,IAAI,GAA0D;AAClE,IAAA,GAAG,EAAE,UAAU;AACf,IAAA,MAAM,EAAE,UAAU;AAClB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,KAAK,EAAE,YAAY;CACpB;AAED;;;AAGG;AACG,SAAU,UAAU,CAAC,OAAsB,EAAE,QAA2B,EAAA;IAC5E,OA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,iBAAiB,IAAI,IAAI,CAAC,SAAS,CAAA,CAAE,GAAG,IAAI;gBAC7D,iBAAiB,EAAE,IAAI,CAAC,OAAO;aAChC,EAAA,EAEDA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,CACrD,CACF,CACF;;;AAKb,SAAS,gBAAgB,CAAC,EAAe,EAAA;AACvC,IAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACnF;;;;;","names":["forceUpdate","h","Host"],"sources":["src/utils/overlay.ts","src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":["export type ChOverlayPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface ChOverlayPosition {\n /** Placement after flipping when the preferred side does not fit. */\n placement: ChOverlayPlacement;\n /** Offset from the anchor's top-left corner, in pixels. */\n top: number;\n left: number;\n}\n\nexport interface ChOverlayRect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nexport interface ChOverlayViewport {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nconst OPPOSITE: Record<ChOverlayPlacement, ChOverlayPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\nconst AXIS: Record<ChOverlayPlacement, 'vertical' | 'horizontal'> = {\n top: 'vertical',\n bottom: 'vertical',\n left: 'horizontal',\n right: 'horizontal',\n};\n\n/**\n * How far a placed surface overflows each viewport edge. Positive values are\n * overflow. Used both to pick a placement and to shift the surface back in.\n */\nexport function overflowOf(surface: ChOverlayRect, viewport: ChOverlayViewport) {\n return {\n top: viewport.top - surface.top,\n left: viewport.left - surface.left,\n bottom: surface.top + surface.height - (viewport.top + viewport.height),\n right: surface.left + surface.width - (viewport.left + viewport.width),\n };\n}\n\nfunction offsetFor(placement: ChOverlayPlacement, anchor: ChOverlayRect, surface: { width: number; height: number }, gap: number) {\n switch (placement) {\n case 'top':\n return {\n top: anchor.top - surface.height - gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'bottom':\n return {\n top: anchor.top + anchor.height + gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'left':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left - surface.width - gap,\n };\n case 'right':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left + anchor.width + gap,\n };\n }\n}\n\n/**\n * Picks the placement that overflows least and then shifts the surface along\n * the cross axis so it stays inside the viewport.\n *\n * The main-axis overflow is not compensated with a translate: a tooltip pinned\n * to the top edge would cover its own trigger. Flipping to the other side is\n * what keeps it readable, and the caller decides whether to accept the\n * remaining overflow.\n */\nexport function placeOverlay({\n anchor,\n surface,\n viewport,\n preferred,\n gap,\n}: {\n anchor: ChOverlayRect;\n surface: { width: number; height: number };\n viewport: ChOverlayViewport;\n preferred: ChOverlayPlacement;\n gap: number;\n}): ChOverlayPosition {\n const candidates: ChOverlayPlacement[] = [preferred, OPPOSITE[preferred]];\n let placement = preferred;\n let best = Number.POSITIVE_INFINITY;\n\n for (const candidate of candidates) {\n const { top, left } = offsetFor(candidate, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);\n\n if (main < best) {\n best = main;\n placement = candidate;\n }\n }\n\n const { top, left } = offsetFor(placement, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n\n const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };\n\n return { placement, top: shifted.top, left: shifted.left };\n}\n\n/** Only real overflow counts: the side that fits contributes nothing. */\nfunction clamp(overflow: number) {\n return overflow > 0 ? overflow : 0;\n}\n\n/**\n * Turns the two overflows on an axis into a shift. `before` is the overflow on\n * the leading edge (top or left), `after` the one on the trailing edge; both\n * are positive when the surface spills past that edge.\n *\n * Pushing away from the leading edge moves the surface inwards, so the shift is\n * `+before`. The trailing edge needs the opposite sign. When both overflow the\n * surface is larger than the viewport: pin it to the leading edge and let\n * `max-width` stop the spill.\n */\nfunction correction(before: number, after: number) {\n if (before > 0) {\n return before;\n }\n if (after > 0) {\n return -after;\n }\n return 0;\n}\n",":host {\n display: inline-block;\n}\n\n.anchor {\n position: relative;\n display: inline-flex;\n}\n\n.bubble {\n position: absolute;\n z-index: var(--z-index-dropdown);\n width: max-content;\n max-width: min(16rem, calc(100vw - 2 * var(--spacing-2xl)));\n padding: var(--spacing-md) var(--spacing-2xl);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-sm);\n background: var(--color-background-base);\n color: var(--text);\n font-family: var(--font-body);\n font-size: var(--typography-size-sm);\n line-height: 1.4;\n opacity: 0;\n visibility: hidden;\n transition:\n opacity var(--duration-fast) var(--easing-default),\n visibility var(--duration-fast) var(--easing-default);\n}\n\n.bubble--visible {\n opacity: 1;\n visibility: visible;\n}\n\n.bubble::before {\n content: '';\n position: absolute;\n}\n\n/*\n * Once the component has measured the anchor, the bubble is placed with fixed\n * coordinates. Viewport coordinates do not depend on ancestors' transforms or\n * overflow, so a tooltip inside a scrolling drawer or modal stays anchored.\n */\n.bubble--positioned {\n position: fixed;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n transform: none;\n margin: 0;\n}\n\n.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\n}\n\n/* Stencil scopes each rule by doubling its classes, so a three-class selector\n is what actually outranks the single-class placement rules above. */\n.bubble.bubble--positioned.bubble--top,\n.bubble.bubble--positioned.bubble--bottom,\n.bubble.bubble--positioned.bubble--left,\n.bubble.bubble--positioned.bubble--right {\n inset: auto;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n right: auto;\n bottom: auto;\n transform: none;\n margin: 0;\n}\n\n.bubble--top::before {\n top: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--bottom {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: var(--spacing-md);\n}\n\n.bubble--bottom::before {\n bottom: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--left {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: var(--spacing-md);\n}\n\n.bubble--left::before {\n left: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n.bubble--right {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: var(--spacing-md);\n}\n\n.bubble--right::before {\n right: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n}\n","import { Component, Element, forceUpdate, Host, Listen, Prop, State, h } from '@stencil/core';\n\nimport { placeOverlay, type ChOverlayPlacement } from '../../utils/overlay';\n\nexport type ChTooltipPlacement = ChOverlayPlacement;\n\nlet tooltipIds = 0;\n\n/** Space between the trigger and the bubble, matching `--spacing-md`. */\nconst GAP = 8;\n\n/**\n * Short help text shown on hover and on focus.\n *\n * Both the trigger and the text come from the consumer's light DOM through\n * named slots. That is what makes the accessible association work: an\n * `aria-describedby` IDREF only resolves within a single tree, and slotted\n * nodes stay in the document tree even though they render inside the shadow\n * root. Keeping the text in the shadow root instead would need a reference\n * pointing into a shadow tree, which the platform does not allow — element\n * reflection only points outwards, and `referenceTarget` is not available yet.\n *\n * The trigger has to be a natively focusable element (`<button>`, `<a>`,\n * `<input>`). A chucao component such as `ch-button` will not be described,\n * because `aria-*` set on a custom element host does not reach the native\n * element inside it — see the discussion in issue #47.\n *\n * Positioning is measured, not purely CSS: `placement` is the preferred side,\n * and the bubble flips to the opposite side when the preferred one does not\n * fit, then shifts along the other axis to stay inside the viewport. It\n * re-measures on scroll, resize and visual-viewport changes, which is what\n * keeps it correct inside a scrolling modal or drawer and when a mobile\n * keyboard shrinks the visible area.\n */\n@Component({\n tag: 'ch-tooltip',\n styleUrl: 'ch-tooltip.css',\n shadow: true,\n})\nexport class ChTooltip {\n @Element() private el: HTMLElement;\n\n private readonly fallbackId = `ch-tooltip-${++tooltipIds}`;\n\n private bubbleEl?: HTMLElement;\n\n private cleanup?: () => void;\n\n /**\n * The side the bubble is placed on. It is a preference: when that side has no\n * room the bubble flips to the opposite one.\n */\n @Prop() placement: ChTooltipPlacement = 'top';\n\n // Hover and focus are tracked apart so that neither cancels the other: a\n // pointer passing over and away must not hide a tooltip whose trigger still\n // holds keyboard focus.\n @State() hovered = false;\n @State() focused = false;\n @State() dismissed = false;\n\n /** The placement actually used, which may differ from the prop after a flip. */\n @State() resolvedPlacement?: ChTooltipPlacement;\n\n /** Offset applied to the bubble once it has been measured. */\n private offset?: { top: number; left: number };\n\n private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n connectedCallback() {\n this.watchViewport();\n }\n\n disconnectedCallback() {\n this.cleanup?.();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\n this.position();\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Listen('focusin')\n handleFocusIn() {\n this.focused = true;\n this.dismissed = false;\n this.position();\n }\n\n @Listen('focusout')\n handleFocusOut() {\n this.focused = false;\n }\n\n /**\n * Listens on the document because a tooltip opened by hovering leaves focus\n * wherever it was, so a host-scoped handler would never see the key.\n *\n * Only the outermost Escape handler is stopped from propagating, so a\n * tooltip inside an open modal closes itself and leaves the modal open.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {\n event.preventDefault();\n this.dismissed = true;\n }\n }\n\n /** Cheap guard so scroll frames do not measure while nothing is shown. */\n @Listen('scroll', { target: 'window', capture: true, passive: true })\n handleScroll() {\n if (this.visible && this.offset) {\n this.position();\n }\n }\n\n @Listen('resize', { target: 'window', passive: true })\n handleResize() {\n this.position();\n }\n\n private watchViewport() {\n if (typeof window === 'undefined') {\n return;\n }\n const viewport = window.visualViewport;\n if (!viewport || this.cleanup) {\n return;\n }\n const update = () => this.position();\n viewport.addEventListener('resize', update);\n viewport.addEventListener('scroll', update);\n this.cleanup = () => {\n viewport.removeEventListener('resize', update);\n viewport.removeEventListener('scroll', update);\n };\n }\n\n private slotted(name: string) {\n return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);\n }\n\n /**\n * Measures the anchor and the bubble and stores the offset that keeps the\n * bubble inside the viewport. Nothing is measured before the bubble has a\n * box to measure, so the pre-paint render uses plain CSS.\n */\n private position() {\n if (typeof window === 'undefined') {\n return;\n }\n const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector<HTMLElement>('.bubble') ?? undefined);\n if (!bubble || bubble.offsetWidth === 0) {\n return;\n }\n\n const anchorRect = (this.slotted('trigger') as HTMLElement | undefined)?.getBoundingClientRect?.();\n if (!anchorRect) {\n return;\n }\n\n const surface = {\n width: bubble.offsetWidth + horizontalMargin(bubble),\n height: bubble.offsetHeight,\n };\n const viewport = window.visualViewport;\n\n const { placement, top, left } = placeOverlay({\n anchor: { top: anchorRect.top, left: anchorRect.left, width: anchorRect.width, height: anchorRect.height },\n surface,\n viewport: viewport\n ? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }\n : { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },\n preferred: this.placement,\n gap: GAP,\n });\n\n const current = this.offset;\n const unchanged = current?.top === top && current?.left === left && this.resolvedPlacement === placement;\n this.resolvedPlacement = placement;\n this.offset = { top, left };\n if (!unchanged) {\n forceUpdate(this);\n }\n }\n\n /**\n * Points the trigger at the text with `aria-describedby`. Re-run on\n * `slotchange` because a framework re-render can replace the slotted nodes\n * and take the attributes with them.\n */\n private associate = () => {\n const trigger = this.slotted('trigger');\n const content = this.slotted('content');\n if (!trigger || !content) {\n return;\n }\n if (!content.id) {\n content.id = this.fallbackId;\n }\n content.setAttribute('role', 'tooltip');\n trigger.setAttribute('aria-describedby', content.id);\n };\n\n render() {\n const { offset } = this;\n\n return (\n <Host>\n <span class=\"anchor\">\n {/* Pre-measure render uses the preferred side so the bubble never\n jumps from the wrong edge on its first frame. */}\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span\n ref={el => (this.bubbleEl = el)}\n style={{\n '--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,\n '--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,\n }}\n class={{\n 'bubble': true,\n 'bubble--positioned': Boolean(this.offset),\n [`bubble--${this.resolvedPlacement ?? this.placement}`]: true,\n 'bubble--visible': this.visible,\n }}\n >\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n\nfunction horizontalMargin(el: HTMLElement) {\n const style = getComputedStyle(el);\n return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);\n}\n"],"version":3}
|
|
1
|
+
{"file":"ch-tooltip.cjs.entry.js","mappings":";;;;AAwBA,MAAM,QAAQ,GAAmD;AAC/D,IAAA,GAAG,EAAE,QAAQ;AACb,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,KAAK,EAAE,MAAM;CACd;AAED,MAAM,IAAI,GAA0D;AAClE,IAAA,GAAG,EAAE,UAAU;AACf,IAAA,MAAM,EAAE,UAAU;AAClB,IAAA,IAAI,EAAE,YAAY;AAClB,I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d,gBAAA,oBAAoB,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC1C,CAAC,CAAA,QAAA,EAAW,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,SAAS,CAAA,CAAE,GAAG,IAAI;gBAC7D,iBAAiB,EAAE,IAAI,CAAC,OAAO;aAChC,EAAA,EAEDA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,CACrD,CACF,CACF;;;AAKb,SAAS,gBAAgB,CAAC,EAAe,EAAA;AACvC,IAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACnF;;;;;","names":["forceUpdate","h","Host"],"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"],"version":3}
|
package/dist/cjs/chucao.cjs.js
CHANGED
|
@@ -18,7 +18,7 @@ var patchBrowser = () => {
|
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(async (options) => {
|
|
20
20
|
await index.globalScripts();
|
|
21
|
-
return index.bootstrapLazy([["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-cluster.cjs",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer.cjs",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji.cjs",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state.cjs",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid.cjs",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-icon.cjs",[[513,"ch-icon",{"name":[1],"size":[1],"label":[1]}]]],["ch-icon-button.cjs",[[513,"ch-icon-button",{"name":[1],"label":[1],"size":[1],"type":[1],"disabled":[4],"loading":[4]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-page-header.cjs",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-radio.cjs",[[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control.cjs",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-skeleton.cjs",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack.cjs",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tooltip.cjs",[[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"]]]]],["ch-alert_8.cjs",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"],"statusCue":[4,"status-cue"]}],[769,"ch-badge",{"variant":[1],"statusCue":[4,"status-cue"]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
|
|
21
|
+
return index.bootstrapLazy([["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-cluster.cjs",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-description-list.cjs",[[769,"ch-description-list",{"columns":[1]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer.cjs",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji.cjs",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state.cjs",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid.cjs",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-icon.cjs",[[513,"ch-icon",{"name":[1],"size":[1],"label":[1]}]]],["ch-icon-button.cjs",[[513,"ch-icon-button",{"name":[1],"label":[1],"size":[1],"type":[1],"disabled":[4],"loading":[4]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-page-header.cjs",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-radio.cjs",[[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control.cjs",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-skeleton.cjs",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack.cjs",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-stat.cjs",[[769,"ch-stat",{"label":[1],"value":[1],"hint":[1],"tone":[1]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-timeline.cjs",[[257,"ch-timeline"]]],["ch-tooltip.cjs",[[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"]]]]],["ch-alert_8.cjs",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"],"statusCue":[4,"status-cue"]}],[769,"ch-badge",{"variant":[1],"statusCue":[4,"status-cue"]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
exports.setNonce = index.setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -5,7 +5,7 @@ var index = require('./index-ByZY6aTj.js');
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await index.globalScripts();
|
|
8
|
-
return index.bootstrapLazy([["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-cluster.cjs",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer.cjs",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji.cjs",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state.cjs",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid.cjs",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-icon.cjs",[[513,"ch-icon",{"name":[1],"size":[1],"label":[1]}]]],["ch-icon-button.cjs",[[513,"ch-icon-button",{"name":[1],"label":[1],"size":[1],"type":[1],"disabled":[4],"loading":[4]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-page-header.cjs",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-radio.cjs",[[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control.cjs",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-skeleton.cjs",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack.cjs",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tooltip.cjs",[[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"]]]]],["ch-alert_8.cjs",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"],"statusCue":[4,"status-cue"]}],[769,"ch-badge",{"variant":[1],"statusCue":[4,"status-cue"]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
|
|
8
|
+
return index.bootstrapLazy([["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-cluster.cjs",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-description-list.cjs",[[769,"ch-description-list",{"columns":[1]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer.cjs",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji.cjs",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state.cjs",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid.cjs",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-icon.cjs",[[513,"ch-icon",{"name":[1],"size":[1],"label":[1]}]]],["ch-icon-button.cjs",[[513,"ch-icon-button",{"name":[1],"label":[1],"size":[1],"type":[1],"disabled":[4],"loading":[4]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-page-header.cjs",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-radio.cjs",[[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control.cjs",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-skeleton.cjs",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack.cjs",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-stat.cjs",[[769,"ch-stat",{"label":[1],"value":[1],"hint":[1],"tone":[1]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-timeline.cjs",[[257,"ch-timeline"]]],["ch-tooltip.cjs",[[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"]]]]],["ch-alert_8.cjs",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"],"statusCue":[4,"status-cue"]}],[769,"ch-badge",{"variant":[1],"statusCue":[4,"status-cue"]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
exports.setNonce = index.setNonce;
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
"components/ch-alert/ch-alert.js",
|
|
5
5
|
"components/ch-badge/ch-badge.js",
|
|
6
6
|
"components/ch-button/ch-button.js",
|
|
7
|
+
"components/ch-card/ch-card.js",
|
|
8
|
+
"components/ch-checkbox/ch-checkbox.js",
|
|
7
9
|
"components/ch-cluster/ch-cluster.js",
|
|
10
|
+
"components/ch-description-list/ch-description-list.js",
|
|
8
11
|
"components/ch-divider/ch-divider.js",
|
|
9
12
|
"components/ch-drawer/ch-drawer.js",
|
|
10
13
|
"components/ch-emoji/ch-emoji.js",
|
|
@@ -12,6 +15,7 @@
|
|
|
12
15
|
"components/ch-grid/ch-grid.js",
|
|
13
16
|
"components/ch-icon/ch-icon.js",
|
|
14
17
|
"components/ch-icon-button/ch-icon-button.js",
|
|
18
|
+
"components/ch-input/ch-input.js",
|
|
15
19
|
"components/ch-link/ch-link.js",
|
|
16
20
|
"components/ch-modal/ch-modal.js",
|
|
17
21
|
"components/ch-page-header/ch-page-header.js",
|
|
@@ -21,13 +25,12 @@
|
|
|
21
25
|
"components/ch-skeleton/ch-skeleton.js",
|
|
22
26
|
"components/ch-spinner/ch-spinner.js",
|
|
23
27
|
"components/ch-stack/ch-stack.js",
|
|
24
|
-
"components/ch-
|
|
25
|
-
"components/ch-tooltip/ch-tooltip.js",
|
|
26
|
-
"components/ch-card/ch-card.js",
|
|
27
|
-
"components/ch-checkbox/ch-checkbox.js",
|
|
28
|
-
"components/ch-input/ch-input.js",
|
|
28
|
+
"components/ch-stat/ch-stat.js",
|
|
29
29
|
"components/ch-switch/ch-switch.js",
|
|
30
|
-
"components/ch-
|
|
30
|
+
"components/ch-tabs/ch-tabs.js",
|
|
31
|
+
"components/ch-textarea/ch-textarea.js",
|
|
32
|
+
"components/ch-timeline/ch-timeline.js",
|
|
33
|
+
"components/ch-tooltip/ch-tooltip.js"
|
|
31
34
|
],
|
|
32
35
|
"mixins": [],
|
|
33
36
|
"compiler": {
|
|
@@ -25,7 +25,7 @@ export class ChAccordion {
|
|
|
25
25
|
this.chChange.emit(this.value);
|
|
26
26
|
};
|
|
27
27
|
render() {
|
|
28
|
-
return (h(Host, { key: '
|
|
28
|
+
return (h(Host, { key: '83cb1bb02baec54767edde0241c9f784b35cf336' }, this.items.map(item => {
|
|
29
29
|
const open = this.value === item.value;
|
|
30
30
|
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}` }))));
|
|
31
31
|
})));
|
|
@@ -56,7 +56,7 @@ export class ChAlert {
|
|
|
56
56
|
render() {
|
|
57
57
|
const role = this.variant === 'warning' ? 'alert' : 'status';
|
|
58
58
|
const shapes = this.statusCue ? chIcons[VARIANT_ICON[this.variant]] : undefined;
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: 'a3b0af93e0fd59c088575c1a56265698ca2836b0' }, h("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, shapes && (h("svg", { key: '7bceb09ba57e6b6d2344cb88476f8327c215941d', class: "alert-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", focusable: "false" }, shapes.map(shape => h(shape.tag, shape.attrs)))), h("div", { key: '0e936cb51c852ab375b32b4fd5bcf3e275f56d21', class: "alert-content" }, h("slot", { key: 'f29a5e218b900718505908b0c6731403414eacda' })), this.dismissLabel && (h("button", { key: 'fe80820757f3fe2f76d44f6227f9ce6e0774cb30', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, h("span", { key: 'eb8110f89d6fb3f080f78a8b2e2569f2050bd91d', "aria-hidden": "true" }, "\u00D7"))))));
|
|
60
60
|
}
|
|
61
61
|
static get is() { return "ch-alert"; }
|
|
62
62
|
static get encapsulation() { return "shadow"; }
|
|
@@ -19,7 +19,7 @@ export class ChBadge {
|
|
|
19
19
|
*/
|
|
20
20
|
statusCue = true;
|
|
21
21
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: '4c2874a988c47589bb4b101479e93aba9c1cf05c' }, h("span", { key: '5d78f0c78545ad36f3e8cbfee48b0256545e9964', class: { badge: true, [`badge--${this.variant}`]: true } }, this.statusCue && h("span", { key: '02bebc85a39fca230f09cc4688a05d055396d054', class: "badge-dot", "aria-hidden": "true" }), h("slot", { key: '87d5e53ae4ea195f6f78ce8694048c9cd27af2ac' }))));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "ch-badge"; }
|
|
25
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class ChCard {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: '3f9cac3b9c506e14a27750e0e501a4f524ef9d8d' }, h("div", { key: 'a35fc3f44e85df166a311317d5409ed96664c4e8', class: "card" }, h("slot", { key: '15efcaa33c3fdf8599c78cfe61ee107fd42115b3' }))));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "ch-card"; }
|
|
7
7
|
static get encapsulation() { return "shadow"; }
|
|
@@ -95,7 +95,7 @@ export class ChCheckbox {
|
|
|
95
95
|
return undefined;
|
|
96
96
|
}
|
|
97
97
|
render() {
|
|
98
|
-
return (h(Host, { key: '
|
|
98
|
+
return (h(Host, { key: '09ba208488d214d27ae2d5019a231a17033e5157' }, h("label", { key: '266604e9468f3a12b9593afc0ba25389ae6ab327', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, h("input", { key: 'd068dc3c56fd8c2588821de0f394296305023f1d', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && h("span", { key: '22f1fd5ab55d39da62fee78434794cd488bf1dcd', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: 'ef7de0570aeac42cfedaf7dd90922460e0c822d9', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: 'f4fea80489574d6673176fc1139c496c202a92bc', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
99
99
|
}
|
|
100
100
|
static get is() { return "ch-checkbox"; }
|
|
101
101
|
static get encapsulation() { return "shadow"; }
|
|
@@ -26,13 +26,13 @@ export class ChCluster {
|
|
|
26
26
|
return GAPS.has(this.gap) ? this.gap : 'md';
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (h(Host, { key: '
|
|
29
|
+
return (h(Host, { key: 'e3d17238168f3faaa452740f0aab6a9e0ed5219f', class: {
|
|
30
30
|
'cluster': true,
|
|
31
31
|
[`cluster--gap-${this.gapStep}`]: true,
|
|
32
32
|
[`cluster--align-${this.align}`]: true,
|
|
33
33
|
[`cluster--justify-${this.justify}`]: true,
|
|
34
34
|
'cluster--nowrap': !this.wrap,
|
|
35
|
-
} }, h("slot", { key: '
|
|
35
|
+
} }, h("slot", { key: '638cecec55ed72d53eb5c6e51d1a683833fa5756' })));
|
|
36
36
|
}
|
|
37
37
|
static get is() { return "ch-cluster"; }
|
|
38
38
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
font-family: var(--typography-body);
|
|
4
|
+
color: var(--color-text-secondary);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host([hidden]) {
|
|
8
|
+
display: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* Slotted content is laid out by the <dl> grid: a slot's assigned nodes
|
|
13
|
+
* become its layout children, so each consumer-written <div> group is one
|
|
14
|
+
* grid item and a pair can never split across columns.
|
|
15
|
+
*/
|
|
16
|
+
.list {
|
|
17
|
+
margin: 0;
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
20
|
+
gap: var(--spacing-sm) var(--spacing-2xl);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.list--columns-2,
|
|
24
|
+
.list--columns-3 {
|
|
25
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.list--columns-3 {
|
|
29
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Narrow viewports collapse every column count to one. */
|
|
33
|
+
@media (max-width: 48rem) {
|
|
34
|
+
.list--columns-2,
|
|
35
|
+
.list--columns-3 {
|
|
36
|
+
grid-template-columns: minmax(0, 1fr);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* A group places its term and description on one baseline row. */
|
|
41
|
+
::slotted(div) {
|
|
42
|
+
display: grid;
|
|
43
|
+
grid-template-columns: fit-content(min(12rem, 40%)) minmax(0, 1fr);
|
|
44
|
+
gap: var(--spacing-sm);
|
|
45
|
+
align-items: baseline;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
::slotted(dt) {
|
|
49
|
+
font-family: var(--typography-heading);
|
|
50
|
+
font-weight: var(--typography-weight-semibold);
|
|
51
|
+
font-size: var(--typography-size-sm);
|
|
52
|
+
color: var(--color-text-primary);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
::slotted(dd) {
|
|
56
|
+
margin: 0;
|
|
57
|
+
font-size: var(--typography-size-sm);
|
|
58
|
+
min-width: 0;
|
|
59
|
+
overflow-wrap: break-word;
|
|
60
|
+
}
|