@devschile/chucao 2.4.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/README.md +17 -16
- package/dist/chucao/chucao.css +1 -1
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/index.esm.js +1 -1
- package/dist/chucao/index.esm.js.map +1 -1
- package/dist/chucao/p-0409c063.entry.js +2 -0
- package/dist/chucao/p-0409c063.entry.js.map +1 -0
- package/dist/chucao/{p-1ebd9dc4.entry.js → p-090d26f1.entry.js} +2 -2
- package/dist/chucao/{p-84d875e9.entry.js → p-207648f9.entry.js} +2 -2
- package/dist/chucao/{p-b5552b50.entry.js → p-20ea1b18.entry.js} +2 -2
- package/dist/chucao/p-21ca2235.entry.js +2 -0
- package/dist/chucao/p-21ca2235.entry.js.map +1 -0
- package/dist/chucao/{p-1778a313.entry.js → p-2c1bc8bd.entry.js} +2 -2
- package/dist/chucao/{p-6e95f31f.entry.js → p-337d7f68.entry.js} +2 -2
- package/dist/chucao/p-370d9629.entry.js +2 -0
- package/dist/chucao/p-370d9629.entry.js.map +1 -0
- package/dist/chucao/{p-d0533af6.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-56d64d84.entry.js → p-7d4336bd.entry.js} +2 -2
- package/dist/chucao/p-81b6622f.entry.js +2 -0
- package/dist/chucao/p-81b6622f.entry.js.map +1 -0
- package/dist/chucao/{p-17451d92.entry.js → p-925af6b8.entry.js} +2 -2
- package/dist/chucao/p-95061461.entry.js +2 -0
- package/dist/chucao/{p-34a9d1f4.entry.js → p-9794a3fa.entry.js} +2 -2
- package/dist/chucao/p-CIV5Gg1o.js +3 -0
- package/dist/chucao/p-CIV5Gg1o.js.map +1 -0
- package/dist/chucao/p-CnivhwvG.js +2 -0
- package/dist/chucao/p-CnivhwvG.js.map +1 -0
- package/dist/chucao/{p-85db779c.entry.js → p-b56f4a29.entry.js} +2 -2
- package/dist/chucao/p-b9b47942.entry.js +2 -0
- package/dist/chucao/p-b9b47942.entry.js.map +1 -0
- package/dist/chucao/{p-449e1ba0.entry.js → p-c1b35f1b.entry.js} +2 -2
- package/dist/chucao/{p-0e3c83a6.entry.js → p-e2f725bd.entry.js} +2 -2
- package/dist/chucao/{p-7c85f5fe.entry.js → p-e6f959f4.entry.js} +2 -2
- package/dist/chucao/{p-907195ff.entry.js → p-f0aea6ed.entry.js} +2 -2
- package/dist/chucao/{p-a07e0e97.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 +2 -2
- package/dist/cjs/ch-alert_8.cjs.entry.js +34 -10
- package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ch-cluster.cjs.entry.js +3 -3
- package/dist/cjs/ch-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 +2 -2
- package/dist/cjs/ch-drawer.cjs.entry.js +2 -2
- package/dist/cjs/ch-emoji.cjs.entry.js +2 -2
- package/dist/cjs/ch-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/ch-grid.cjs.entry.js +2 -2
- package/dist/cjs/ch-icon-button.cjs.entry.js +51 -0
- package/dist/cjs/ch-icon-button.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-icon.cjs.entry.js +38 -0
- package/dist/cjs/ch-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +2 -2
- package/dist/cjs/ch-page-header.cjs.entry.js +45 -0
- package/dist/cjs/ch-page-header.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-radio.cjs.entry.js +2 -2
- package/dist/cjs/ch-segmented-control.cjs.entry.js +2 -2
- package/dist/cjs/ch-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ch-stack.cjs.entry.js +2 -2
- package/dist/cjs/ch-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 +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
- 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 +206 -5
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/chucao.cjs.js +2 -2
- package/dist/cjs/icons-CNyDgV-q.js +88 -0
- package/dist/cjs/icons-CNyDgV-q.js.map +1 -0
- package/dist/cjs/{index-ysucLiAq.js → index-ByZY6aTj.js} +81 -5
- package/dist/cjs/index-ByZY6aTj.js.map +1 -0
- package/dist/cjs/index.cjs.js +16 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +12 -6
- package/dist/collection/components/ch-accordion/ch-accordion.js +1 -1
- package/dist/collection/components/ch-alert/ch-alert.css +13 -0
- package/dist/collection/components/ch-alert/ch-alert.js +44 -1
- package/dist/collection/components/ch-alert/ch-alert.js.map +1 -1
- package/dist/collection/components/ch-badge/ch-badge.css +30 -1
- package/dist/collection/components/ch-badge/ch-badge.js +35 -1
- package/dist/collection/components/ch-badge/ch-badge.js.map +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
- package/dist/collection/components/ch-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.css +25 -0
- package/dist/collection/components/ch-icon/ch-icon.js +121 -0
- package/dist/collection/components/ch-icon/ch-icon.js.map +1 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.css +99 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.js +216 -0
- package/dist/collection/components/ch-icon-button/ch-icon-button.js.map +1 -0
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +1 -1
- package/dist/collection/components/ch-page-header/ch-page-header.css +84 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js +162 -0
- package/dist/collection/components/ch-page-header/ch-page-header.js.map +1 -0
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- package/dist/collection/components/ch-stack/ch-stack.js +1 -1
- package/dist/collection/components/ch-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.css +29 -1
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +127 -6
- package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
- package/dist/collection/tokens/tokens.js +12 -0
- package/dist/collection/tokens/tokens.js.map +1 -1
- package/dist/collection/tokens/types.js.map +1 -1
- package/dist/collection/utils/icons.js +82 -0
- package/dist/collection/utils/icons.js.map +1 -0
- package/dist/collection/utils/overlay.js +101 -0
- package/dist/collection/utils/overlay.js.map +1 -0
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-alert.js.map +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-badge.js.map +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-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.d.ts +11 -0
- package/dist/components/ch-icon-button.js +2 -0
- package/dist/components/ch-icon-button.js.map +1 -0
- package/dist/components/ch-icon.d.ts +11 -0
- package/dist/components/ch-icon.js +2 -0
- package/dist/components/ch-icon.js.map +1 -0
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-link.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-page-header.d.ts +11 -0
- package/dist/components/ch-page-header.js +2 -0
- package/dist/components/ch-page-header.js.map +1 -0
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-segmented-control.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-skeleton.js +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-stack.js +1 -1
- package/dist/components/ch-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/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-CnivhwvG.js +2 -0
- package/dist/components/p-CnivhwvG.js.map +1 -0
- package/dist/components/{p-no2_9Jk-.js → p-Cw0b4OGc.js} +2 -2
- package/dist/components/p-qP_9qshx.js +2 -0
- package/dist/components/p-qP_9qshx.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +2 -2
- package/dist/esm/ch-alert_8.entry.js +34 -10
- package/dist/esm/ch-alert_8.entry.js.map +1 -1
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-cluster.entry.js +3 -3
- package/dist/esm/ch-description-list.entry.js +27 -0
- package/dist/esm/ch-description-list.entry.js.map +1 -0
- package/dist/esm/ch-divider.entry.js +2 -2
- package/dist/esm/ch-drawer.entry.js +2 -2
- package/dist/esm/ch-emoji.entry.js +2 -2
- package/dist/esm/ch-empty-state.entry.js +2 -2
- package/dist/esm/ch-grid.entry.js +2 -2
- package/dist/esm/ch-icon-button.entry.js +49 -0
- package/dist/esm/ch-icon-button.entry.js.map +1 -0
- package/dist/esm/ch-icon.entry.js +36 -0
- package/dist/esm/ch-icon.entry.js.map +1 -0
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +2 -2
- package/dist/esm/ch-page-header.entry.js +43 -0
- package/dist/esm/ch-page-header.entry.js.map +1 -0
- package/dist/esm/ch-radio.entry.js +2 -2
- package/dist/esm/ch-segmented-control.entry.js +2 -2
- package/dist/esm/ch-skeleton.entry.js +2 -2
- package/dist/esm/ch-stack.entry.js +2 -2
- package/dist/esm/ch-stat.entry.js +44 -0
- package/dist/esm/ch-stat.entry.js.map +1 -0
- package/dist/esm/ch-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +2 -2
- package/dist/esm/ch-timeline.entry.js +18 -0
- package/dist/esm/ch-timeline.entry.js.map +1 -0
- package/dist/esm/ch-tooltip.entry.js +206 -5
- package/dist/esm/ch-tooltip.entry.js.map +1 -1
- package/dist/esm/chucao.js +3 -3
- package/dist/esm/icons-CnivhwvG.js +86 -0
- package/dist/esm/icons-CnivhwvG.js.map +1 -0
- package/dist/esm/{index-DVKZbUp9.js → index-CIV5Gg1o.js} +81 -6
- package/dist/esm/index-CIV5Gg1o.js.map +1 -0
- package/dist/esm/index.js +13 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-alert/ch-alert.d.ts +11 -0
- package/dist/types/components/ch-badge/ch-badge.d.ts +14 -0
- package/dist/types/components/ch-description-list/ch-description-list.d.ts +30 -0
- package/dist/types/components/ch-icon/ch-icon.d.ts +29 -0
- package/dist/types/components/ch-icon-button/ch-icon-button.d.ts +36 -0
- package/dist/types/components/ch-page-header/ch-page-header.d.ts +39 -0
- package/dist/types/components/ch-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 +34 -2
- package/dist/types/components.d.ts +718 -2
- package/dist/types/tokens/tokens.d.ts +12 -0
- package/dist/types/tokens/types.d.ts +2 -1
- package/dist/types/utils/icons.d.ts +15 -0
- package/dist/types/utils/overlay.d.ts +49 -0
- package/dist-react/components.d.ts +21 -1
- package/dist-react/components.js +54 -0
- package/dist-react/components.ts +73 -1
- package/dist-vue/index.d.ts +6 -0
- package/dist-vue/index.js +42 -1
- package/dist-vue/index.ts +54 -1
- package/hydrate/index.js +772 -35
- package/hydrate/index.mjs +772 -35
- package/package.json +104 -5
- package/dist/chucao/p-82216381.entry.js +0 -2
- package/dist/chucao/p-82216381.entry.js.map +0 -1
- package/dist/chucao/p-DVKZbUp9.js +0 -3
- package/dist/chucao/p-DVKZbUp9.js.map +0 -1
- package/dist/chucao/p-b392021c.entry.js +0 -2
- package/dist/chucao/p-b392021c.entry.js.map +0 -1
- package/dist/chucao/p-d776b092.entry.js +0 -2
- package/dist/cjs/index-ysucLiAq.js.map +0 -1
- package/dist/components/p-DQOKq7af.js +0 -2
- package/dist/components/p-DQOKq7af.js.map +0 -1
- package/dist/esm/index-DVKZbUp9.js.map +0 -1
- /package/dist/chucao/{p-1ebd9dc4.entry.js.map → p-090d26f1.entry.js.map} +0 -0
- /package/dist/chucao/{p-84d875e9.entry.js.map → p-207648f9.entry.js.map} +0 -0
- /package/dist/chucao/{p-b5552b50.entry.js.map → p-20ea1b18.entry.js.map} +0 -0
- /package/dist/chucao/{p-1778a313.entry.js.map → p-2c1bc8bd.entry.js.map} +0 -0
- /package/dist/chucao/{p-6e95f31f.entry.js.map → p-337d7f68.entry.js.map} +0 -0
- /package/dist/chucao/{p-d0533af6.entry.js.map → p-50cbea7f.entry.js.map} +0 -0
- /package/dist/chucao/{p-56d64d84.entry.js.map → p-7d4336bd.entry.js.map} +0 -0
- /package/dist/chucao/{p-17451d92.entry.js.map → p-925af6b8.entry.js.map} +0 -0
- /package/dist/chucao/{p-d776b092.entry.js.map → p-95061461.entry.js.map} +0 -0
- /package/dist/chucao/{p-34a9d1f4.entry.js.map → p-9794a3fa.entry.js.map} +0 -0
- /package/dist/chucao/{p-85db779c.entry.js.map → p-b56f4a29.entry.js.map} +0 -0
- /package/dist/chucao/{p-449e1ba0.entry.js.map → p-c1b35f1b.entry.js.map} +0 -0
- /package/dist/chucao/{p-0e3c83a6.entry.js.map → p-e2f725bd.entry.js.map} +0 -0
- /package/dist/chucao/{p-7c85f5fe.entry.js.map → p-e6f959f4.entry.js.map} +0 -0
- /package/dist/chucao/{p-907195ff.entry.js.map → p-f0aea6ed.entry.js.map} +0 -0
- /package/dist/chucao/{p-a07e0e97.entry.js.map → p-f7305552.entry.js.map} +0 -0
- /package/dist/components/{p-no2_9Jk-.js.map → p-Cw0b4OGc.js.map} +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
const OPPOSITE = {
|
|
2
|
+
top: 'bottom',
|
|
3
|
+
bottom: 'top',
|
|
4
|
+
left: 'right',
|
|
5
|
+
right: 'left',
|
|
6
|
+
};
|
|
7
|
+
const AXIS = {
|
|
8
|
+
top: 'vertical',
|
|
9
|
+
bottom: 'vertical',
|
|
10
|
+
left: 'horizontal',
|
|
11
|
+
right: 'horizontal',
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* How far a placed surface overflows each viewport edge. Positive values are
|
|
15
|
+
* overflow. Used both to pick a placement and to shift the surface back in.
|
|
16
|
+
*/
|
|
17
|
+
export function overflowOf(surface, viewport) {
|
|
18
|
+
return {
|
|
19
|
+
top: viewport.top - surface.top,
|
|
20
|
+
left: viewport.left - surface.left,
|
|
21
|
+
bottom: surface.top + surface.height - (viewport.top + viewport.height),
|
|
22
|
+
right: surface.left + surface.width - (viewport.left + viewport.width),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function offsetFor(placement, anchor, surface, gap) {
|
|
26
|
+
switch (placement) {
|
|
27
|
+
case 'top':
|
|
28
|
+
return {
|
|
29
|
+
top: anchor.top - surface.height - gap,
|
|
30
|
+
left: anchor.left + (anchor.width - surface.width) / 2,
|
|
31
|
+
};
|
|
32
|
+
case 'bottom':
|
|
33
|
+
return {
|
|
34
|
+
top: anchor.top + anchor.height + gap,
|
|
35
|
+
left: anchor.left + (anchor.width - surface.width) / 2,
|
|
36
|
+
};
|
|
37
|
+
case 'left':
|
|
38
|
+
return {
|
|
39
|
+
top: anchor.top + (anchor.height - surface.height) / 2,
|
|
40
|
+
left: anchor.left - surface.width - gap,
|
|
41
|
+
};
|
|
42
|
+
case 'right':
|
|
43
|
+
return {
|
|
44
|
+
top: anchor.top + (anchor.height - surface.height) / 2,
|
|
45
|
+
left: anchor.left + anchor.width + gap,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Picks the placement that overflows least and then shifts the surface along
|
|
51
|
+
* the cross axis so it stays inside the viewport.
|
|
52
|
+
*
|
|
53
|
+
* The main-axis overflow is not compensated with a translate: a tooltip pinned
|
|
54
|
+
* to the top edge would cover its own trigger. Flipping to the other side is
|
|
55
|
+
* what keeps it readable, and the caller decides whether to accept the
|
|
56
|
+
* remaining overflow.
|
|
57
|
+
*/
|
|
58
|
+
export function placeOverlay({ anchor, surface, viewport, preferred, gap, }) {
|
|
59
|
+
const candidates = [preferred, OPPOSITE[preferred]];
|
|
60
|
+
let placement = preferred;
|
|
61
|
+
let best = Number.POSITIVE_INFINITY;
|
|
62
|
+
for (const candidate of candidates) {
|
|
63
|
+
const { top, left } = offsetFor(candidate, anchor, surface, gap);
|
|
64
|
+
const rect = { top, left, width: surface.width, height: surface.height };
|
|
65
|
+
const overflow = overflowOf(rect, viewport);
|
|
66
|
+
const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);
|
|
67
|
+
if (main < best) {
|
|
68
|
+
best = main;
|
|
69
|
+
placement = candidate;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const { top, left } = offsetFor(placement, anchor, surface, gap);
|
|
73
|
+
const rect = { top, left, width: surface.width, height: surface.height };
|
|
74
|
+
const overflow = overflowOf(rect, viewport);
|
|
75
|
+
const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };
|
|
76
|
+
return { placement, top: shifted.top, left: shifted.left };
|
|
77
|
+
}
|
|
78
|
+
/** Only real overflow counts: the side that fits contributes nothing. */
|
|
79
|
+
function clamp(overflow) {
|
|
80
|
+
return overflow > 0 ? overflow : 0;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Turns the two overflows on an axis into a shift. `before` is the overflow on
|
|
84
|
+
* the leading edge (top or left), `after` the one on the trailing edge; both
|
|
85
|
+
* are positive when the surface spills past that edge.
|
|
86
|
+
*
|
|
87
|
+
* Pushing away from the leading edge moves the surface inwards, so the shift is
|
|
88
|
+
* `+before`. The trailing edge needs the opposite sign. When both overflow the
|
|
89
|
+
* surface is larger than the viewport: pin it to the leading edge and let
|
|
90
|
+
* `max-width` stop the spill.
|
|
91
|
+
*/
|
|
92
|
+
function correction(before, after) {
|
|
93
|
+
if (before > 0) {
|
|
94
|
+
return before;
|
|
95
|
+
}
|
|
96
|
+
if (after > 0) {
|
|
97
|
+
return -after;
|
|
98
|
+
}
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.js","sourceRoot":"","sources":["../../../src/utils/overlay.ts"],"names":[],"mappings":"AAwBA,MAAM,QAAQ,GAAmD;IAC/D,GAAG,EAAE,QAAQ;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,IAAI,GAA0D;IAClE,GAAG,EAAE,UAAU;IACf,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,YAAY;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,OAAsB,EAAE,QAA2B;IAC5E,OAAO;QACL,GAAG,EAAE,QAAQ,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG;QAC/B,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI;QAClC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC;QACvE,KAAK,EAAE,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC;KACvE,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,SAA6B,EAAE,MAAqB,EAAE,OAA0C,EAAE,GAAW;IAC9H,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,KAAK;YACR,OAAO;gBACL,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,GAAG;gBACtC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;aACvD,CAAC;QACJ,KAAK,QAAQ;YACX,OAAO;gBACL,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG;gBACrC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;aACvD,CAAC;QACJ,KAAK,MAAM;YACT,OAAO;gBACL,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;gBACtD,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,GAAG,GAAG;aACxC,CAAC;QACJ,KAAK,OAAO;YACV,OAAO;gBACL,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;gBACtD,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,GAAG,GAAG;aACvC,CAAC;IACN,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,GAAG,GAOJ;IACC,MAAM,UAAU,GAAyB,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1E,IAAI,SAAS,GAAG,SAAS,CAAC;IAC1B,IAAI,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAEpC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACjE,MAAM,IAAI,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;QACzE,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAE1I,IAAI,IAAI,GAAG,IAAI,EAAE,CAAC;YAChB,IAAI,GAAG,IAAI,CAAC;YACZ,SAAS,GAAG,SAAS,CAAC;QACxB,CAAC;IACH,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IACjE,MAAM,IAAI,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;IACzE,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAE5C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;IAElL,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;AAC7D,CAAC;AAED,yEAAyE;AACzE,SAAS,KAAK,CAAC,QAAgB;IAC7B,OAAO,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,UAAU,CAAC,MAAc,EAAE,KAAa;IAC/C,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,OAAO,CAAC,KAAK,CAAC;IAChB,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC","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"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,t,H as
|
|
1
|
+
import{p as e,t,H as r,c as a,h as i,d as o}from"./p-qP_9qshx.js";const s=()=>`:host{display:block}.item{background:var(--surface);border:var(--border-width) solid var(--border);border-radius:var(--radius);transition:border-color var(--duration-normal) var(--easing-default)}.item+.item{margin-top:var(--spacing-md)}.item--open{border-color:var(--border-hover)}.item-head{margin:0}.item-toggle{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-lg);width:100%;padding:var(--spacing-2xl) var(--spacing-3xl);background:transparent;border:none;color:var(--text);font-family:inherit;font-size:inherit;font-weight:var(--typography-weight-semibold);cursor:pointer}.item-toggle::after{content:'';width:var(--spacing-md);height:var(--spacing-md);flex-shrink:0;border-right:var(--border-width) solid var(--text-muted);border-bottom:var(--border-width) solid var(--text-muted);transform:rotate(45deg);transition:transform var(--duration-normal) var(--easing-default)}.item--open .item-toggle::after{transform:rotate(-135deg)}.item-toggle:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.item-toggle:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.item-panel{padding:0 var(--spacing-3xl) var(--spacing-3xl);color:var(--text-muted)}.item-panel[hidden]{display:none}`;let n=0;const d=e(class e extends r{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=a(this,"chChange")}baseId=`ch-accordion-${++n}`;items=[];value;chChange;headerId(e){return`${this.baseId}-${e}-header`}panelId(e){return`${this.baseId}-${e}-panel`}toggle=e=>{this.value=this.value===e?undefined:e;this.chChange.emit(this.value)};render(){return i(o,{key:"83cb1bb02baec54767edde0241c9f784b35cf336"},this.items.map((e=>{const t=this.value===e.value;return i("div",{key:e.value,class:{item:true,"item--open":t}},i("h3",{class:"item-head"},i("button",{type:"button",class:"item-toggle",id:this.headerId(e.value),"data-value":e.value,"aria-expanded":t?"true":"false","aria-controls":this.panelId(e.value),disabled:e.disabled,onClick:()=>this.toggle(e.value)},e.title)),i("div",{class:"item-panel",id:this.panelId(e.value),role:"region","aria-labelledby":this.headerId(e.value),hidden:!t},i("slot",{name:`panel-${e.value}`})))})))}static get style(){return s()}},[769,"ch-accordion",{items:[16],value:[1025]}]);function l(){if(typeof customElements==="undefined"){return}const e=["ch-accordion"];e.forEach((e=>{switch(e){case"ch-accordion":if(!customElements.get(t(e))){customElements.define(t(e),d)}break}}))}l();const c=d;const h=l;export{c as ChAccordion,h as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-accordion.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as r,H as
|
|
1
|
+
import{p as r,H as e,c as t,h as s,d as a,t as o}from"./p-qP_9qshx.js";import{c as i}from"./p-CnivhwvG.js";const n=()=>`:host{display:block}.alert{display:flex;align-items:flex-start;gap:var(--spacing-2xl);padding:var(--spacing-2xl) var(--spacing-3xl);border:var(--border-width) solid transparent;border-left:var(--border-accent-bar) solid transparent;border-radius:var(--radius);font-size:var(--typography-size-sm);line-height:1.5}.alert-icon{width:var(--icon-size-md);height:var(--icon-size-md);flex:none;margin-top:1px}.alert-content{flex:1;min-width:0;overflow-wrap:anywhere}.alert--default{color:var(--text);background:var(--surface);border-color:var(--border);border-left-color:var(--color-text-secondary)}.alert--positive{color:var(--color-status-positive);background:var(--color-status-positive-background);border-color:var(--color-status-positive);border-left-color:var(--color-status-positive)}.alert--warning{color:var(--color-status-warning);background:var(--color-status-warning-background);border-color:var(--color-status-warning);border-left-color:var(--color-status-warning)}.alert-dismiss{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:var(--spacing-2xs) var(--spacing-md);border:0;border-radius:var(--radius);background:none;color:inherit;cursor:pointer;font-family:var(--font-heading);font-size:var(--typography-size-lg);line-height:1;transition:background-color var(--duration-normal) var(--easing-default)}.alert-dismiss:hover{background:var(--surface-hover)}.alert-dismiss:focus-visible{outline:var(--focus-outline-width) solid currentColor;outline-offset:var(--focus-outline-offset)}@media (pointer: coarse){.alert-dismiss{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.alert-dismiss{transition:none}}`;const l={default:"info",positive:"success",warning:"alert"};const c=r(class r extends e{constructor(r){super();if(r!==false){this.__registerHost()}this.__attachShadow();this.chDismiss=t(this,"chDismiss")}variant="default";dismissLabel;statusCue=true;chDismiss;handleDismiss=()=>{this.chDismiss.emit()};render(){const r=this.variant==="warning"?"alert":"status";const e=this.statusCue?i[l[this.variant]]:undefined;return s(a,{key:"a3b0af93e0fd59c088575c1a56265698ca2836b0"},s("div",{key:r,class:{alert:true,[`alert--${this.variant}`]:true},role:r},e&&s("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"},e.map((r=>s(r.tag,r.attrs)))),s("div",{key:"0e936cb51c852ab375b32b4fd5bcf3e275f56d21",class:"alert-content"},s("slot",{key:"f29a5e218b900718505908b0c6731403414eacda"})),this.dismissLabel&&s("button",{key:"fe80820757f3fe2f76d44f6227f9ce6e0774cb30",class:"alert-dismiss",type:"button","aria-label":this.dismissLabel,onClick:this.handleDismiss},s("span",{key:"eb8110f89d6fb3f080f78a8b2e2569f2050bd91d","aria-hidden":"true"},"×"))))}static get style(){return n()}},[769,"ch-alert",{variant:[1],dismissLabel:[1,"dismiss-label"],statusCue:[4,"status-cue"]}]);function d(){if(typeof customElements==="undefined"){return}const r=["ch-alert"];r.forEach((r=>{switch(r){case"ch-alert":if(!customElements.get(o(r))){customElements.define(o(r),c)}break}}))}d();const u=c;const f=d;export{u as ChAlert,f as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-alert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["chAlertCss","ChAlert","__stencil_proxyCustomElement","HTMLElement","variant","dismissLabel","chDismiss","handleDismiss","this","emit","render","role","h","Host","key","class","alert","type","onClick"],"sources":["src/components/ch-alert/ch-alert.css?tag=ch-alert&encapsulation=shadow","src/components/ch-alert/ch-alert.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.alert {\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-2xl);\n padding: var(--spacing-2xl) var(--spacing-3xl);\n border: var(--border-width) solid transparent;\n border-radius: var(--radius);\n font-size: var(--typography-size-sm);\n line-height: 1.5;\n}\n\n.alert-content {\n flex: 1;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.alert--default {\n color: var(--text);\n background: var(--surface);\n border-color: var(--border);\n}\n\n.alert--positive {\n color: var(--color-status-positive);\n background: var(--color-status-positive-background);\n border-color: var(--color-status-positive);\n}\n\n.alert--warning {\n color: var(--color-status-warning);\n background: var(--color-status-warning-background);\n border-color: var(--color-status-warning);\n}\n\n.alert-dismiss {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n padding: var(--spacing-2xs) var(--spacing-md);\n border: 0;\n border-radius: var(--radius);\n background: none;\n color: inherit;\n cursor: pointer;\n font-family: var(--font-heading);\n font-size: var(--typography-size-lg);\n line-height: 1;\n transition: background-color var(--duration-normal) var(--easing-default);\n}\n\n.alert-dismiss:hover {\n background: var(--surface-hover);\n}\n\n.alert-dismiss:focus-visible {\n outline: var(--focus-outline-width) solid currentColor;\n outline-offset: var(--focus-outline-offset);\n}\n\n@media (pointer: coarse) {\n .alert-dismiss {\n min-width: 44px;\n min-height: 44px;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .alert-dismiss {\n transition: none;\n }\n}\n","import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nexport type ChAlertVariant = 'default' | 'positive' | 'warning';\n\n/**\n * Block-level status message.\n *\n * `warning` carries `role=\"alert\"` and is announced assertively; `default` and\n * `positive` use `role=\"status\"`, since a confirmation is not urgent enough to\n * interrupt. Both announce reliably when the alert is added to the page in\n * response to something — an alert already present at load may not be read out,\n * which is how live regions work rather than something this component controls.\n */\n@Component({\n tag: 'ch-alert',\n styleUrl: 'ch-alert.css',\n shadow: true,\n})\nexport class ChAlert {\n /**\n * The kind of message. `default` is neutral, `positive` confirms, and\n * `warning` covers both warnings and errors — the token scale has a single\n * status colour for the two of them.\n */\n @Prop() variant: ChAlertVariant = 'default';\n\n /**\n * Accessible label for the dismiss button, set as `aria-label`. Setting it\n * is what adds the button: the button's only content is a decorative glyph,\n * so without a label it would have no accessible name at all.\n */\n @Prop() dismissLabel?: string;\n\n /**\n * Emitted when the dismiss button is clicked. The alert stays in the DOM —\n * whether to remove it is the consumer's decision. If you do remove it, move\n * focus somewhere sensible first: removing the focused button drops focus to\n * `<body>`.\n */\n @Event() chDismiss: EventEmitter<void>;\n\n private handleDismiss = () => {\n this.chDismiss.emit();\n };\n\n render() {\n const role = this.variant === 'warning' ? 'alert' : 'status';\n\n return (\n <Host>\n {/* Keyed on the role so a variant change replaces the node instead of\n mutating its role in place, which assistive technology does not\n reliably re-announce. */}\n <div key={role} class={{ alert: true, [`alert--${this.variant}`]: true }} role={role}>\n <div class=\"alert-content\">\n <slot></slot>\n </div>\n {this.dismissLabel && (\n <button class=\"alert-dismiss\" type=\"button\" aria-label={this.dismissLabel} onClick={this.handleDismiss}>\n <span aria-hidden=\"true\">×</span>\n </button>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["chAlertCss","VARIANT_ICON","default","positive","warning","ChAlert","__stencil_proxyCustomElement","HTMLElement","variant","dismissLabel","statusCue","chDismiss","handleDismiss","this","emit","render","role","shapes","chIcons","undefined","h","Host","key","class","alert","viewBox","fill","stroke","focusable","map","shape","tag","attrs","type","onClick"],"sources":["src/components/ch-alert/ch-alert.css?tag=ch-alert&encapsulation=shadow","src/components/ch-alert/ch-alert.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.alert {\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-2xl);\n padding: var(--spacing-2xl) var(--spacing-3xl);\n /* The leading edge is thicker on every variant, so the block still reads as\n a status message in grayscale or with colour-vision deficiency. */\n border: var(--border-width) solid transparent;\n border-left: var(--border-accent-bar) solid transparent;\n border-radius: var(--radius);\n font-size: var(--typography-size-sm);\n line-height: 1.5;\n}\n\n.alert-icon {\n width: var(--icon-size-md);\n height: var(--icon-size-md);\n flex: none;\n margin-top: 1px;\n}\n\n.alert-content {\n flex: 1;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.alert--default {\n color: var(--text);\n background: var(--surface);\n border-color: var(--border);\n border-left-color: var(--color-text-secondary);\n}\n\n.alert--positive {\n color: var(--color-status-positive);\n background: var(--color-status-positive-background);\n border-color: var(--color-status-positive);\n border-left-color: var(--color-status-positive);\n}\n\n.alert--warning {\n color: var(--color-status-warning);\n background: var(--color-status-warning-background);\n border-color: var(--color-status-warning);\n border-left-color: var(--color-status-warning);\n}\n\n.alert-dismiss {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n padding: var(--spacing-2xs) var(--spacing-md);\n border: 0;\n border-radius: var(--radius);\n background: none;\n color: inherit;\n cursor: pointer;\n font-family: var(--font-heading);\n font-size: var(--typography-size-lg);\n line-height: 1;\n transition: background-color var(--duration-normal) var(--easing-default);\n}\n\n.alert-dismiss:hover {\n background: var(--surface-hover);\n}\n\n.alert-dismiss:focus-visible {\n outline: var(--focus-outline-width) solid currentColor;\n outline-offset: var(--focus-outline-offset);\n}\n\n@media (pointer: coarse) {\n .alert-dismiss {\n min-width: 44px;\n min-height: 44px;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .alert-dismiss {\n transition: none;\n }\n}\n","import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nimport { chIcons, type ChIconName } from '../../utils/icons';\n\nexport type ChAlertVariant = 'default' | 'positive' | 'warning';\n\n/**\n * The glyph paired with each variant. It is what makes the variants\n * distinguishable without colour: `default` is informational, `positive`\n * confirms and `warning` warns, and each reads differently in grayscale.\n */\nconst VARIANT_ICON: Record<ChAlertVariant, ChIconName> = {\n default: 'info',\n positive: 'success',\n warning: 'alert',\n};\n\n/**\n * Block-level status message.\n *\n * `warning` carries `role=\"alert\"` and is announced assertively; `default` and\n * `positive` use `role=\"status\"`, since a confirmation is not urgent enough to\n * interrupt. Both announce reliably when the alert is added to the page in\n * response to something — an alert already present at load may not be read out,\n * which is how live regions work rather than something this component controls.\n *\n * Every variant also carries an icon and a thicker leading edge, so the three\n * states stay distinguishable without colour vision. The icon is decorative:\n * the text next to it already says what happened, and announcing \"check\n * circle\" before it would only add noise.\n */\n@Component({\n tag: 'ch-alert',\n styleUrl: 'ch-alert.css',\n shadow: true,\n})\nexport class ChAlert {\n /**\n * The kind of message. `default` is neutral, `positive` confirms, and\n * `warning` covers both warnings and errors — the token scale has a single\n * status colour for the two of them.\n */\n @Prop() variant: ChAlertVariant = 'default';\n\n /**\n * Accessible label for the dismiss button, set as `aria-label`. Setting it\n * is what adds the button: the button's only content is a decorative glyph,\n * so without a label it would have no accessible name at all.\n */\n @Prop() dismissLabel?: string;\n\n /**\n * Whether to show the variant's icon. On by default so the status is not\n * colour-only; turn it off when the surrounding copy already carries the cue\n * and a second marker would be redundant.\n */\n @Prop() statusCue = true;\n\n /**\n * Emitted when the dismiss button is clicked. The alert stays in the DOM —\n * whether to remove it is the consumer's decision. If you do remove it, move\n * focus somewhere sensible first: removing the focused button drops focus to\n * `<body>`.\n */\n @Event() chDismiss: EventEmitter<void>;\n\n private handleDismiss = () => {\n this.chDismiss.emit();\n };\n\n render() {\n const role = this.variant === 'warning' ? 'alert' : 'status';\n const shapes = this.statusCue ? chIcons[VARIANT_ICON[this.variant]] : undefined;\n\n return (\n <Host>\n {/* Keyed on the role so a variant change replaces the node instead of\n mutating its role in place, which assistive technology does not\n reliably re-announce. */}\n <div key={role} class={{ alert: true, [`alert--${this.variant}`]: true }} role={role}>\n {shapes && (\n <svg\n class=\"alert-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n {shapes.map(shape => h(shape.tag, shape.attrs))}\n </svg>\n )}\n <div class=\"alert-content\">\n <slot></slot>\n </div>\n {this.dismissLabel && (\n <button class=\"alert-dismiss\" type=\"button\" aria-label={this.dismissLabel} onClick={this.handleDismiss}>\n <span aria-hidden=\"true\">×</span>\n </button>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"2GAAA,MAAMA,EAAa,IAAM,koDCWzB,MAAMC,EAAmD,CACvDC,QAAS,OACTC,SAAU,UACVC,QAAS,S,MAsBEC,EAAOC,EAAA,MAAAD,UAAAE,E,oHAMVC,QAA0B,UAO1BC,aAOAC,UAAY,KAQXC,UAEDC,cAAgB,KACtBC,KAAKF,UAAUG,MAAM,EAGvB,MAAAC,GACE,MAAMC,EAAOH,KAAKL,UAAY,UAAY,QAAU,SACpD,MAAMS,EAASJ,KAAKH,UAAYQ,EAAQjB,EAAaY,KAAKL,UAAYW,UAEtE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CAIHF,EAAA,OAAKE,IAAKN,EAAMO,MAAO,CAAEC,MAAO,KAAM,CAAC,UAAUX,KAAKL,WAAY,MAAQQ,KAAMA,GAC7EC,GACCG,EAAA,OAAAE,IAAA,2CACEC,MAAM,aACNE,QAAQ,YACRC,KAAK,OACLC,OAAO,eAAc,eACR,IAAG,iBACD,QAAO,kBACN,QAAO,cACX,OACZC,UAAU,SAETX,EAAOY,KAAIC,GAASV,EAAEU,EAAMC,IAAKD,EAAME,UAG5CZ,EAAA,OAAAE,IAAA,2CAAKC,MAAM,iBACTH,EAAA,QAAAE,IAAA,8CAEDT,KAAKJ,cACJW,EAAA,UAAAE,IAAA,2CAAQC,MAAM,gBAAgBU,KAAK,SAAQ,aAAapB,KAAKJ,aAAcyB,QAASrB,KAAKD,eACvFQ,EAAA,QAAAE,IAAA,yDAAkB,QAAM,O","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as a,H as
|
|
1
|
+
import{p as a,H as r,h as e,d as t,t as s}from"./p-qP_9qshx.js";const o=()=>`:host{display:inline-block}.badge{display:inline-flex;align-items:center;gap:var(--spacing-xs);padding:var(--spacing-2xs) var(--spacing-lg);border:var(--border-width) solid transparent;border-radius:var(--radius-pill);font-size:var(--typography-size-xs);font-weight:var(--typography-weight-semibold);text-transform:uppercase;letter-spacing:var(--typography-tracking-badge)}.badge-dot{display:block;flex:none;width:0.45em;height:0.45em;background:currentColor;border-radius:var(--radius-pill)}.badge--default{background:var(--color-surface-hover);color:var(--accent);border-color:var(--accent)}.badge--positive{background:var(--color-status-positive-background);color:var(--color-status-positive);border-color:var(--color-status-positive)}.badge--positive .badge-dot{background:transparent;border:var(--border-width) solid currentColor;border-radius:var(--radius-pill)}.badge--warning{background:var(--color-status-warning-background);color:var(--color-status-warning);border-color:var(--color-status-warning)}.badge--warning .badge-dot{border-radius:0}`;const c=a(class a extends r{constructor(a){super();if(a!==false){this.__registerHost()}this.__attachShadow()}variant="default";statusCue=true;render(){return e(t,{key:"4c2874a988c47589bb4b101479e93aba9c1cf05c"},e("span",{key:"5d78f0c78545ad36f3e8cbfee48b0256545e9964",class:{badge:true,[`badge--${this.variant}`]:true}},this.statusCue&&e("span",{key:"02bebc85a39fca230f09cc4688a05d055396d054",class:"badge-dot","aria-hidden":"true"}),e("slot",{key:"87d5e53ae4ea195f6f78ce8694048c9cd27af2ac"})))}static get style(){return o()}},[769,"ch-badge",{variant:[1],statusCue:[4,"status-cue"]}]);function d(){if(typeof customElements==="undefined"){return}const a=["ch-badge"];a.forEach((a=>{switch(a){case"ch-badge":if(!customElements.get(s(a))){customElements.define(s(a),c)}break}}))}d();const i=c;const n=d;export{i as ChBadge,n as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["chBadgeCss","ChBadge","__stencil_proxyCustomElement","HTMLElement","variant","render","h","Host","key","class","badge","this"],"sources":["src/components/ch-badge/ch-badge.css?tag=ch-badge&encapsulation=shadow","src/components/ch-badge/ch-badge.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.badge {\n display: inline-
|
|
1
|
+
{"version":3,"names":["chBadgeCss","ChBadge","__stencil_proxyCustomElement","HTMLElement","variant","statusCue","render","h","Host","key","class","badge","this"],"sources":["src/components/ch-badge/ch-badge.css?tag=ch-badge&encapsulation=shadow","src/components/ch-badge/ch-badge.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.badge {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-xs);\n padding: var(--spacing-2xs) var(--spacing-lg);\n border: var(--border-width) solid transparent;\n border-radius: var(--radius-pill);\n font-size: var(--typography-size-xs);\n font-weight: var(--typography-weight-semibold);\n text-transform: uppercase;\n letter-spacing: var(--typography-tracking-badge);\n}\n\n/* The cue is shape first: a badge must not depend on hue to say what state it\n is in, and shape survives grayscale printing and every form of colour-vision\n deficiency. Colour repeats the cue rather than carrying it alone. */\n.badge-dot {\n display: block;\n flex: none;\n width: 0.45em;\n height: 0.45em;\n background: currentColor;\n border-radius: var(--radius-pill);\n}\n\n.badge--default {\n background: var(--color-surface-hover);\n color: var(--accent);\n border-color: var(--accent);\n}\n\n.badge--positive {\n background: var(--color-status-positive-background);\n color: var(--color-status-positive);\n border-color: var(--color-status-positive);\n}\n\n.badge--positive .badge-dot {\n background: transparent;\n border: var(--border-width) solid currentColor;\n border-radius: var(--radius-pill);\n}\n\n.badge--warning {\n background: var(--color-status-warning-background);\n color: var(--color-status-warning);\n border-color: var(--color-status-warning);\n}\n\n.badge--warning .badge-dot {\n border-radius: 0;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChBadgeVariant = 'default' | 'positive' | 'warning';\n\n/**\n * Small status label.\n *\n * Variants are not colour-only: each one also changes the leading dot's shape\n * and adds a matching border, so a badge still says which state it is in when\n * printed in grayscale or seen with colour-vision deficiency. `default` uses a\n * filled dot, `positive` a ring, and `warning` a filled square.\n */\n@Component({\n tag: 'ch-badge',\n styleUrl: 'ch-badge.css',\n shadow: true,\n})\nexport class ChBadge {\n /**\n * The visual style of the badge. Either `default`, `positive`, or `warning`.\n */\n @Prop() variant: ChBadgeVariant = 'default';\n\n /**\n * Whether to show the variant marker. On by default so the state does not\n * depend on colour; turn it off for a badge that only repeats text already\n * carrying the meaning.\n */\n @Prop() statusCue = true;\n\n render() {\n return (\n <Host>\n <span class={{ badge: true, [`badge--${this.variant}`]: true }}>\n {this.statusCue && <span class=\"badge-dot\" aria-hidden=\"true\"></span>}\n <slot></slot>\n </span>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAa,IAAM,+hC,MCiBZC,EAAOC,EAAA,MAAAD,UAAAE,E,iFAIVC,QAA0B,UAO1BC,UAAY,KAEpB,MAAAC,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,QAAAE,IAAA,2CAAMC,MAAO,CAAEC,MAAO,KAAM,CAAC,UAAUC,KAAKR,WAAY,OACrDQ,KAAKP,WAAaE,EAAA,QAAAE,IAAA,2CAAMC,MAAM,YAAW,cAAa,SACvDH,EAAA,QAAAE,IAAA,8C","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as r,H as t,c as a,h as e,d as n,t as s}from"./p-
|
|
1
|
+
import{p as r,H as t,c as a,h as e,d as n,t as s}from"./p-qP_9qshx.js";import{d as i}from"./p-Cw0b4OGc.js";function o(r){return Array.from(r.childNodes).some((r=>{if(r.nodeType!==3&&r.nodeType!==1){return false}if(r.nodeType===1&&r.hasAttribute("slot")){return false}return(r.textContent??"").trim()!==""}))}const l=()=>`:host{display:inline-block}.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--spacing-sm);box-sizing:border-box;border:var(--border-width) solid transparent;border-radius:var(--radius-pill);cursor:pointer;font-family:inherit;font-weight:var(--typography-weight-bold);text-decoration:none;line-height:1.2;transition:background-color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default), transform var(--duration-fast) var(--easing-default)}.btn--sm{padding:var(--spacing-2xs) var(--spacing-lg);font-size:var(--typography-size-sm)}.btn--md{padding:var(--spacing-xs) var(--spacing-xl);font-size:inherit}.btn--lg{padding:var(--spacing-sm) var(--spacing-2xl);font-size:var(--typography-size-lg)}.btn:disabled,.btn--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.btn--loading:disabled,.btn--loading.btn--disabled{opacity:1;cursor:progress}.btn:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.btn--primary{background-color:var(--accent);color:var(--color-accent-text)}.btn--primary:hover:not(:disabled){background-color:var(--accent-hover);transform:translateY(calc(-1 * var(--spacing-elevate)))}.btn--secondary{background-color:transparent;color:var(--text);border-color:var(--border)}.btn--secondary:hover:not(:disabled){border-color:var(--border-hover);background-color:var(--surface-hover);transform:translateY(calc(-1 * var(--spacing-elevate)))}.btn--ghost{background-color:transparent;color:var(--text)}.btn--ghost:hover:not(:disabled){background-color:var(--surface-hover)}.btn--danger{background-color:var(--color-status-warning);color:var(--bg)}.btn--danger:hover:not(:disabled){filter:brightness(0.92);transform:translateY(calc(-1 * var(--spacing-elevate)))}`;const c=r(class r extends t{constructor(r){super();if(r!==false){this.__registerHost()}this.__attachShadow();this.chClick=a(this,"chClick")}get el(){return this}variant="primary";size="md";disabled=false;loading=false;href;target;label;chClick;handleClick=r=>{if(this.disabled||this.loading){r.preventDefault();return}this.chClick.emit(r)};get spinnerSize(){return this.size==="lg"?"md":"sm"}renderContent(){return[this.loading?e("ch-spinner",{size:this.spinnerSize}):e("slot",{name:"start"}),e("slot",null),e("slot",{name:"end"})]}render(){if(!this.label&&!o(this.el));const r={btn:true,[`btn--${this.variant}`]:true,[`btn--${this.size}`]:true,"btn--loading":this.loading};if(this.href&&!this.disabled&&!this.loading){return e(n,null,e("a",{class:r,href:this.href,target:this.target,rel:this.target==="_blank"?"noopener noreferrer":undefined,"aria-label":this.label,onClick:this.handleClick},this.renderContent()))}if(this.href){return e(n,null,e("span",{class:{...r,"btn--disabled":true},"aria-label":this.label,"aria-disabled":"true","aria-busy":this.loading?"true":undefined},this.renderContent()))}return e(n,null,e("button",{class:r,type:"button",disabled:this.disabled||this.loading,"aria-label":this.label,"aria-busy":this.loading?"true":undefined,onClick:this.handleClick},this.renderContent()))}static get style(){return l()}},[769,"ch-button",{variant:[1],size:[1],disabled:[4],loading:[4],href:[1],target:[1],label:[1]}]);function d(){if(typeof customElements==="undefined"){return}const r=["ch-button","ch-spinner"];r.forEach((r=>{switch(r){case"ch-button":if(!customElements.get(s(r))){customElements.define(s(r),c)}break;case"ch-spinner":if(!customElements.get(s(r))){i()}break}}))}d();const b=c;const u=d;export{b as ChButton,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-button.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as r,H as a,h as
|
|
1
|
+
import{p as r,H as a,h as e,d as o,t}from"./p-qP_9qshx.js";const c=()=>`:host{display:block}::slotted(p){color:var(--text-muted)}.card{color:var(--text);background:var(--surface);border:var(--border-width) solid var(--border);border-radius:var(--radius);padding:var(--spacing-4xl) var(--spacing-5xl);backdrop-filter:blur(var(--effect-blur));position:relative;overflow:hidden;transition:border-color var(--duration-normal) var(--easing-default), transform var(--duration-fast) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.card::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var(--border-accent-bar);background:var(--accent);opacity:0;transition:opacity var(--duration-normal) var(--easing-default)}.card:hover{border-color:var(--border-hover);transform:translateX(var(--spacing-shift));box-shadow:var(--shadow-card-hover)}.card:hover::before{opacity:1}`;const s=r(class r extends a{constructor(r){super();if(r!==false){this.__registerHost()}this.__attachShadow()}render(){return e(o,{key:"3f9cac3b9c506e14a27750e0e501a4f524ef9d8d"},e("div",{key:"a35fc3f44e85df166a311317d5409ed96664c4e8",class:"card"},e("slot",{key:"15efcaa33c3fdf8599c78cfe61ee107fd42115b3"})))}static get style(){return c()}},[257,"ch-card"]);function d(){if(typeof customElements==="undefined"){return}const r=["ch-card"];r.forEach((r=>{switch(r){case"ch-card":if(!customElements.get(t(r))){customElements.define(t(r),s)}break}}))}d();const n=s;const i=d;export{n as ChCard,i as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["chCardCss","ChCard","__stencil_proxyCustomElement","HTMLElement","render","h","Host","key","class"],"sources":["src/components/ch-card/ch-card.css?tag=ch-card&encapsulation=shadow","src/components/ch-card/ch-card.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n::slotted(p) {\n color: var(--text-muted);\n}\n\n.card {\n color: var(--text);\n background: var(--surface);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius);\n padding: var(--spacing-4xl) var(--spacing-5xl);\n backdrop-filter: blur(var(--effect-blur));\n position: relative;\n overflow: hidden;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n transform var(--duration-fast) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.card::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: var(--border-accent-bar);\n background: var(--accent);\n opacity: 0;\n transition: opacity var(--duration-normal) var(--easing-default);\n}\n\n.card:hover {\n border-color: var(--border-hover);\n transform: translateX(var(--spacing-shift));\n box-shadow: var(--shadow-card-hover);\n}\n\n.card:hover::before {\n opacity: 1;\n}\n","import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'ch-card',\n styleUrl: 'ch-card.css',\n shadow: true,\n})\nexport class ChCard {\n render() {\n return (\n <Host>\n <div class=\"card\">\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["chCardCss","ChCard","__stencil_proxyCustomElement","HTMLElement","render","h","Host","key","class"],"sources":["src/components/ch-card/ch-card.css?tag=ch-card&encapsulation=shadow","src/components/ch-card/ch-card.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n::slotted(p) {\n color: var(--text-muted);\n}\n\n.card {\n color: var(--text);\n background: var(--surface);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius);\n padding: var(--spacing-4xl) var(--spacing-5xl);\n backdrop-filter: blur(var(--effect-blur));\n position: relative;\n overflow: hidden;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n transform var(--duration-fast) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.card::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: var(--border-accent-bar);\n background: var(--accent);\n opacity: 0;\n transition: opacity var(--duration-normal) var(--easing-default);\n}\n\n.card:hover {\n border-color: var(--border-hover);\n transform: translateX(var(--spacing-shift));\n box-shadow: var(--shadow-card-hover);\n}\n\n.card:hover::before {\n opacity: 1;\n}\n","import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'ch-card',\n styleUrl: 'ch-card.css',\n shadow: true,\n})\nexport class ChCard {\n render() {\n return (\n <Host>\n <div class=\"card\">\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"2DAAA,MAAMA,EAAY,IAAM,20B,MCOXC,EAAMC,EAAA,MAAAD,UAAAE,E,iFACjB,MAAAC,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,OAAAE,IAAA,2CAAKC,MAAM,QACTH,EAAA,QAAAE,IAAA,8C","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as i,c as t,h as
|
|
1
|
+
import{p as e,H as i,c as t,h as s,d as r,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let c=0;const d=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=t(this,"chChange");this.internals=this.attachInternals()}checkboxId=`ch-checkbox-${++c}`;hintId=`${this.checkboxId}-hint`;errorId=`${this.checkboxId}-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=e=>{this.checked=e.target.checked;this.chChange.emit(this.checked)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.checked?this.value:null);const{flags:i,message:t}=o({required:this.required,empty:!this.checked,invalid:this.invalid,errorMessage:this.errorMessage});e.setValidity(i,t)}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(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return s(r,{key:"09ba208488d214d27ae2d5019a231a17033e5157"},s("label",{key:"266604e9468f3a12b9593afc0ba25389ae6ab327",class:{control:true,"control--disabled":this.disabled||this.formDisabled},htmlFor:this.checkboxId},s("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&&s("span",{key:"22f1fd5ab55d39da62fee78434794cd488bf1dcd",class:"label-text"},this.label)),this.hint&&!(this.invalid&&this.errorMessage)&&s("p",{key:"ef7de0570aeac42cfedaf7dd90922460e0c822d9",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&s("p",{key:"f4fea80489574d6673176fc1139c496c202a92bc",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 n()}},[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]},undefined,{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function l(){if(typeof customElements==="undefined"){return}const e=["ch-checkbox"];e.forEach((e=>{switch(e){case"ch-checkbox":if(!customElements.get(a(e))){customElements.define(a(e),d)}break}}))}l();const h=d;const u=l;export{h as ChCheckbox,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-checkbox.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as
|
|
1
|
+
import{p as t,H as e,h as s,d as a,t as r}from"./p-qP_9qshx.js";const l=()=>`:host{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;box-sizing:border-box}:host([hidden]){display:none}.cluster--nowrap{flex-wrap:nowrap}.cluster--gap-none{gap:0}.cluster--gap-2xs{gap:var(--spacing-2xs)}.cluster--gap-xs{gap:var(--spacing-xs)}.cluster--gap-sm{gap:var(--spacing-sm)}.cluster--gap-md{gap:var(--spacing-md)}.cluster--gap-lg{gap:var(--spacing-lg)}.cluster--gap-xl{gap:var(--spacing-xl)}.cluster--gap-2xl{gap:var(--spacing-2xl)}.cluster--gap-3xl{gap:var(--spacing-3xl)}.cluster--gap-4xl{gap:var(--spacing-4xl)}.cluster--gap-5xl{gap:var(--spacing-5xl)}.cluster--gap-6xl{gap:var(--spacing-6xl)}.cluster--align-stretch{align-items:stretch}.cluster--align-start{align-items:flex-start}.cluster--align-center{align-items:center}.cluster--align-end{align-items:flex-end}.cluster--align-baseline{align-items:baseline}.cluster--justify-start{justify-content:flex-start}.cluster--justify-center{justify-content:center}.cluster--justify-end{justify-content:flex-end}.cluster--justify-between{justify-content:space-between}.cluster--justify-around{justify-content:space-around}`;const n=new Set(["none","2xs","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"]);const c=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}gap="md";align="center";justify="start";wrap=true;get gapStep(){return n.has(this.gap)?this.gap:"md"}render(){return s(a,{key:"e3d17238168f3faaa452740f0aab6a9e0ed5219f",class:{cluster:true,[`cluster--gap-${this.gapStep}`]:true,[`cluster--align-${this.align}`]:true,[`cluster--justify-${this.justify}`]:true,"cluster--nowrap":!this.wrap}},s("slot",{key:"638cecec55ed72d53eb5c6e51d1a683833fa5756"}))}static get style(){return l()}},[769,"ch-cluster",{gap:[1],align:[1],justify:[1],wrap:[4]}]);function i(){if(typeof customElements==="undefined"){return}const t=["ch-cluster"];t.forEach((t=>{switch(t){case"ch-cluster":if(!customElements.get(r(t))){customElements.define(r(t),c)}break}}))}i();const u=c;const g=i;export{u as ChCluster,g as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-cluster.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChDescriptionList extends Components.ChDescriptionList, HTMLElement {}
|
|
4
|
+
export const ChDescriptionList: {
|
|
5
|
+
prototype: ChDescriptionList;
|
|
6
|
+
new (): ChDescriptionList;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as t,H as s,h as e,d as i,t as o}from"./p-qP_9qshx.js";const a=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:var(--spacing-sm) var(--spacing-2xl)}.list--columns-2,.list--columns-3{grid-template-columns:repeat(2, minmax(0, 1fr))}.list--columns-3{grid-template-columns:repeat(3, minmax(0, 1fr))}@media (max-width: 48rem){.list--columns-2,.list--columns-3{grid-template-columns:minmax(0, 1fr)}}::slotted(div){display:grid;grid-template-columns:fit-content(min(12rem, 40%)) minmax(0, 1fr);gap:var(--spacing-sm);align-items:baseline}::slotted(dt){font-family:var(--typography-heading);font-weight:var(--typography-weight-semibold);font-size:var(--typography-size-sm);color:var(--color-text-primary)}::slotted(dd){margin:0;font-size:var(--typography-size-sm);min-width:0;overflow-wrap:break-word}`;const n=new Set(["1","2","3"]);const r=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}columns="1";get columnCount(){return n.has(this.columns)?this.columns:"1"}render(){return e(i,{key:"d4905aeabf16e8c0798601a15e9115128c87f367"},e("dl",{key:"f2f85f1cdae61f0d5d8c007509ec75f21a9e69df",class:`list list--columns-${this.columnCount}`},e("slot",{key:"60883fb5884ad38791c7ef811e4f3a0be6396e61"})))}static get style(){return a()}},[769,"ch-description-list",{columns:[1]}]);function l(){if(typeof customElements==="undefined"){return}const t=["ch-description-list"];t.forEach((t=>{switch(t){case"ch-description-list":if(!customElements.get(o(t))){customElements.define(o(t),r)}break}}))}l();const m=r;const c=l;export{m as ChDescriptionList,c as defineCustomElement};
|
|
2
|
+
//# sourceMappingURL=ch-description-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["chDescriptionListCss","COLUMNS","Set","ChDescriptionList","__stencil_proxyCustomElement","HTMLElement","columns","columnCount","has","this","render","h","Host","key","class"],"sources":["src/components/ch-description-list/ch-description-list.css?tag=ch-description-list&encapsulation=shadow","src/components/ch-description-list/ch-description-list.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/*\n * Slotted content is laid out by the <dl> grid: a slot's assigned nodes\n * become its layout children, so each consumer-written <div> group is one\n * grid item and a pair can never split across columns.\n */\n.list {\n margin: 0;\n display: grid;\n grid-template-columns: repeat(1, minmax(0, 1fr));\n gap: var(--spacing-sm) var(--spacing-2xl);\n}\n\n.list--columns-2,\n.list--columns-3 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n\n.list--columns-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n\n/* Narrow viewports collapse every column count to one. */\n@media (max-width: 48rem) {\n .list--columns-2,\n .list--columns-3 {\n grid-template-columns: minmax(0, 1fr);\n }\n}\n\n/* A group places its term and description on one baseline row. */\n::slotted(div) {\n display: grid;\n grid-template-columns: fit-content(min(12rem, 40%)) minmax(0, 1fr);\n gap: var(--spacing-sm);\n align-items: baseline;\n}\n\n::slotted(dt) {\n font-family: var(--typography-heading);\n font-weight: var(--typography-weight-semibold);\n font-size: var(--typography-size-sm);\n color: var(--color-text-primary);\n}\n\n::slotted(dd) {\n margin: 0;\n font-size: var(--typography-size-sm);\n min-width: 0;\n overflow-wrap: break-word;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChDescriptionListColumns = '1' | '2' | '3';\n\nconst COLUMNS = new Set(['1', '2', '3']);\n\n/**\n * Label/value pairs for detail views, on a native `<dl>`.\n *\n * The component renders the `<dl>` and the layout; the consumer writes the\n * terms and descriptions. Group each pair in a `<div>` (valid HTML 5.2\n * grouping) — the group is the grid item, which is what keeps a pair from\n * splitting across columns:\n *\n * ```html\n * <ch-description-list columns=\"2\">\n * <div><dt>Cliente</dt><dd>Aurora SpA</dd></div>\n * <div><dt>Pedido</dt><dd>#1523</dd></div>\n * </ch-description-list>\n * ```\n *\n * The markup stays native in the light DOM, so the `term` role reaches the\n * accessibility tree untouched — the shape decision on #81 measured that a\n * custom wrapper adds nothing in Chromium while risking other browsers. No\n * `ch-description-item` element exists for the same reason.\n */\n@Component({\n tag: 'ch-description-list',\n styleUrl: 'ch-description-list.css',\n shadow: true,\n})\nexport class ChDescriptionList {\n /**\n * How many pairs share a row on a wide viewport. One column is the stacked\n * layout. An unknown value falls back to one column.\n */\n @Prop() columns: ChDescriptionListColumns = '1';\n\n private get columnCount() {\n return COLUMNS.has(this.columns) ? this.columns : '1';\n }\n\n render() {\n return (\n <Host>\n <dl class={`list list--columns-${this.columnCount}`}>\n <slot></slot>\n </dl>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAuB,IAAM,k3BCInC,MAAMC,EAAU,IAAIC,IAAI,CAAC,IAAK,IAAK,M,MA2BtBC,EAAiBC,EAAA,MAAAD,UAAAE,E,iFAKpBC,QAAoC,IAE5C,eAAYC,GACV,OAAON,EAAQO,IAAIC,KAAKH,SAAWG,KAAKH,QAAU,G,CAGpD,MAAAI,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,MAAAE,IAAA,2CAAIC,MAAO,sBAAsBL,KAAKF,eACpCI,EAAA,QAAAE,IAAA,8C","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as i,h as t,d as r,t as d}from"./p-
|
|
1
|
+
import{p as e,H as i,h as t,d as r,t as d}from"./p-qP_9qshx.js";const s=()=>`:host{display:block}:host(.divider--vertical){display:inline-block;height:100%;align-self:stretch}.divider{margin:0;border:none;background:var(--border)}.divider--horizontal{width:100%;height:var(--border-width)}.divider--vertical{width:var(--border-width);height:100%}`;const o=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}orientation="horizontal";render(){return t(r,{key:"c18cffa051e3fde189ed358a748e58d0af534357",class:{"divider--vertical":this.orientation==="vertical"}},t("hr",{key:"2a6fe2c3a2b61eecd03e0b5d2830695328e77453",class:{divider:true,[`divider--${this.orientation}`]:true},"aria-orientation":this.orientation}))}static get style(){return s()}},[513,"ch-divider",{orientation:[1]}]);function a(){if(typeof customElements==="undefined"){return}const e=["ch-divider"];e.forEach((e=>{switch(e){case"ch-divider":if(!customElements.get(d(e))){customElements.define(d(e),o)}break}}))}a();const n=o;const c=a;export{n as ChDivider,c as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-divider.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as r,h as a,d as i,t as n}from"./p-
|
|
1
|
+
import{p as e,H as t,c as r,h as a,d as i,t as n}from"./p-qP_9qshx.js";import{l as o,u as s}from"./p-d8DfpzMR.js";const d=()=>`.drawer{position:fixed;inset:0;margin:0;box-sizing:border-box;flex-direction:column;gap:var(--spacing-2xl);width:min(24rem, 100vw);height:100vh;height:100dvh;max-width:100vw;max-height:100dvh;padding:var(--spacing-5xl);border:var(--border-width) solid var(--border);border-radius:0;background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-md);overflow:hidden}.drawer[open]{display:flex}.drawer--start{inset:0 auto 0 0;border-inline-start:none;animation:drawer-in-start var(--duration-normal) var(--easing-default)}.drawer--end{inset:0 0 0 auto;border-inline-end:none;animation:drawer-in-end var(--duration-normal) var(--easing-default)}.drawer--top{inset:0 0 auto 0;width:100vw;height:auto;max-height:80dvh;border-block-start:none;animation:drawer-in-top var(--duration-normal) var(--easing-default)}.drawer--bottom{inset:auto 0 0 0;width:100vw;height:auto;max-height:80dvh;border-block-end:none;animation:drawer-in-bottom var(--duration-normal) var(--easing-default)}.drawer::backdrop{background:var(--color-scrim-default);backdrop-filter:blur(var(--effect-blur))}.drawer-head{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--spacing-2xl);flex:none}.drawer-body{flex:1;min-height:0;overflow-y:auto}::slotted([slot='footer']){display:flex;align-items:center;justify-content:flex-end;gap:var(--spacing-md);flex:none;padding-top:var(--spacing-2xl);border-top:var(--border-width) solid var(--border)}.drawer-close{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:var(--spacing-2xs) var(--spacing-md);border:0;border-radius:var(--radius);background:none;color:var(--text-muted);cursor:pointer;font-family:var(--font-heading);font-size:var(--typography-size-lg);line-height:1;transition:background-color var(--duration-normal) var(--easing-default)}.drawer-close:hover{background:var(--surface-hover);color:var(--text)}.drawer-close:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}@keyframes drawer-in-start{from{transform:translateX(-100%)}}@keyframes drawer-in-end{from{transform:translateX(100%)}}@keyframes drawer-in-top{from{transform:translateY(-100%)}}@keyframes drawer-in-bottom{from{transform:translateY(100%)}}@media (pointer: coarse){.drawer-close{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.drawer{animation:none}.drawer-close{transition:none}}`;const l=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chOpen=r(this,"chOpen");this.chClose=r(this,"chClose")}get el(){return this}open=false;side="end";label;closeLabel;chOpen;chClose;dialog;scrollLocked=false;pointerDownedOutside=false;componentDidLoad(){this.dialog?.addEventListener("close",this.handleNativeClose);this.dialog?.addEventListener("pointerdown",this.handlePointerDown);this.dialog?.addEventListener("click",this.handleClick);if(this.open){this.showDialog()}}disconnectedCallback(){this.dialog?.removeEventListener("close",this.handleNativeClose);this.dialog?.removeEventListener("pointerdown",this.handlePointerDown);this.dialog?.removeEventListener("click",this.handleClick);this.unlockScroll()}handleOpenChange(e){if(e){this.showDialog()}else{this.closeDialog()}}showDialog(){if(typeof this.dialog?.showModal!=="function"){return}this.lockScroll();this.dialog.showModal();this.chOpen.emit()}closeDialog(){if(typeof this.dialog?.close==="function"&&this.dialog.open){this.dialog.close()}}lockScroll(){if(this.scrollLocked){return}this.scrollLocked=true;o()}unlockScroll(){if(!this.scrollLocked){return}this.scrollLocked=false;s()}isOnBackdrop(e){if(!this.dialog||e.target!==this.dialog){return false}const t=this.dialog.getBoundingClientRect();return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}handlePointerDown=e=>{this.pointerDownedOutside=this.isOnBackdrop(e)};handleClick=e=>{const t=this.pointerDownedOutside&&this.isOnBackdrop(e);this.pointerDownedOutside=false;if(t){this.closeDialog()}};handleNativeClose=()=>{this.unlockScroll();if(this.open){this.open=false}this.chClose.emit()};handleCloseClick=()=>{if(typeof this.dialog?.close==="function"&&this.dialog.open){this.dialog.close();return}this.open=false;this.chClose.emit()};render(){return a(i,{key:"a0406608e57614c79a23673f040191e2d94cdd48"},a("dialog",{key:"84072ff1a87f1033c5b4911089c8c0819fe087ea",class:{drawer:true,[`drawer--${this.side}`]:true},"aria-label":this.label,ref:e=>this.dialog=e},a("div",{key:"57cddba1e04471dc6d0fe6e86311c38bb4329969",class:"drawer-head"},a("slot",{key:"b77179dec88ae4d1b9975b7e6b16184a8aa8bb79",name:"header"}),this.closeLabel&&a("button",{key:"88daedc7a80418e3480b577639e80ef31ff02486",class:"drawer-close",type:"button","aria-label":this.closeLabel,onClick:this.handleCloseClick},a("span",{key:"e5bb3e74f1b4365b0e32e2b8e70bdc46ac882c78","aria-hidden":"true"},"×"))),a("div",{key:"d81831510dd6a0d9e97eddffac99bc0689bf3d31",class:"drawer-body"},a("slot",{key:"f3d72a55ad19021369e117ec5bf9693bc6d72c85"})),a("slot",{key:"339e8989a2ea9f580a756ff89e10c40e55904c11",name:"footer"})))}static get watchers(){return{open:[{handleOpenChange:0}]}}static get style(){return d()}},[769,"ch-drawer",{open:[1028],side:[1],label:[1],closeLabel:[1,"close-label"]},undefined,{open:[{handleOpenChange:0}]}]);function c(){if(typeof customElements==="undefined"){return}const e=["ch-drawer"];e.forEach((e=>{switch(e){case"ch-drawer":if(!customElements.get(n(e))){customElements.define(n(e),l)}break}}))}c();const h=l;const f=c;export{h as ChDrawer,f as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-drawer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,h as o,d as s,t as n}from"./p-
|
|
1
|
+
import{p as e,H as t,h as o,d as s,t as n}from"./p-qP_9qshx.js";const a="aaaa";const i="ameno";const h="huemul-love";const l="huemul-love";const c="humo";const m="hypnotoad";const d="lmao";const u="loading";const r="loco";const g="loco2";const p="lol";const f="lol2";const j="monea";const x="negative";var v={aaaa:a,ameno:i,"huemul-huaso":"huemul-huaso","huemul-love":"huemul-love",heart:h,love:l,"huemul-trusted":"huemul-trusted",humo:c,hypnotoad:m,"lets-fucking-go":"lets-fucking-go",lmao:d,loading:u,loco:r,loco2:g,lol:p,lol2:f,monea:j,negative:x};const b=()=>`:host{display:inline-block;vertical-align:middle}.emoji{display:block;object-fit:contain}.emoji--sm{width:16px;height:16px}.emoji--md{width:24px;height:24px}.emoji--lg{width:32px;height:32px}.emoji--xl{width:48px;height:48px}.emoji--hidden{display:none}`;const y="https://static.devschile.cl/emoji";const k=["png","gif","jpg","svg"];const w=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}extIndex=0;loaded=false;name;alt;size="md";componentWillLoad(){this.resolveAsset()}handleNameChange(){this.resolveAsset()}resolveAsset(){this.extIndex=0;this.loaded=false}get assetName(){return v[this.name]??this.name}get currentSrc(){return`${y}/${this.assetName}.${k[this.extIndex]}`}handleError=()=>{if(this.extIndex<k.length-1){this.extIndex++}};handleLoad=()=>{this.loaded=true};render(){return o(s,{key:"4a5c5b2a917227ab3fb9aabe560718a84dd17730"},o("img",{key:"dbc09e58cd1a6ce899ce82dd1ec13ba15955b4ad",class:{emoji:true,[`emoji--${this.size}`]:true,"emoji--hidden":!this.loaded},src:this.currentSrc,alt:this.alt??this.name,onError:this.handleError,onLoad:this.handleLoad}))}static get watchers(){return{name:[{handleNameChange:0}]}}static get style(){return b()}},[513,"ch-emoji",{name:[1],alt:[1],size:[1],extIndex:[32],loaded:[32]},undefined,{name:[{handleNameChange:0}]}]);function E(){if(typeof customElements==="undefined"){return}const e=["ch-emoji"];e.forEach((e=>{switch(e){case"ch-emoji":if(!customElements.get(n(e))){customElements.define(n(e),w)}break}}))}E();const N=w;const $=E;export{N as ChEmoji,$ as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-emoji.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,h as a,d as s,t as i}from"./p-
|
|
1
|
+
import{p as e,H as t,h as a,d as s,t as i}from"./p-qP_9qshx.js";const r=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary);text-align:center}:host([hidden]){display:none}.empty-state__inner{display:flex;flex-direction:column;align-items:center;gap:var(--spacing-sm);padding:var(--spacing-6xl) var(--spacing-2xl);border:var(--border-width) dashed var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.empty-state--sm .empty-state__inner{padding:var(--spacing-3xl) var(--spacing-xl);gap:var(--spacing-xs)}.empty-state__icon{display:contents;font-size:var(--typography-size-xl);line-height:1}.empty-state__icon:empty{display:none}.empty-state__title{margin:0;font-family:var(--typography-heading);font-size:var(--typography-size-md);font-weight:var(--typography-weight-semibold);color:var(--color-text-primary)}.empty-state--md .empty-state__title{font-size:var(--typography-size-lg)}.empty-state__description{margin:0;max-width:36ch;font-size:var(--typography-size-sm);line-height:1.5}.empty-state__actions:empty{display:none}.empty-state__actions{display:flex;flex-wrap:wrap;gap:var(--spacing-sm);justify-content:center;margin-top:var(--spacing-xs)}`;const c=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}title;description;size="md";render(){return a(s,{key:"73a168213e3f62b73d859dd6e1ad35eff6694746",class:{"empty-state":true,[`empty-state--${this.size}`]:true}},a("div",{key:"81bbad48af38acd640a67673132773a66d06c35b",class:"empty-state__inner"},a("div",{key:"1f9f8953beba68951163a5081ada1254ee6de61c",class:"empty-state__icon","aria-hidden":"true"},a("slot",{key:"70c2b38f1a780b4c39a676d6b4cf4fe9d80a45c5",name:"icon"})),a("h3",{key:"964501021ac65c7edb96c60b9e6f6dc7aece2ebe",class:"empty-state__title"},this.title),this.description&&a("p",{key:"a6effa9b7a24875938fc18ee9e6a7acf1c35b0ba",class:"empty-state__description"},this.description),a("div",{key:"0052d3c169569b96ee73b481f44b669715f90771",class:"empty-state__actions"},a("slot",{key:"3fa51fed8e5f49e02a9f588a3c0577ce9c2c5797"}))))}static get style(){return r()}},[769,"ch-empty-state",{title:[1],description:[1],size:[1]}]);function n(){if(typeof customElements==="undefined"){return}const e=["ch-empty-state"];e.forEach((e=>{switch(e){case"ch-empty-state":if(!customElements.get(i(e))){customElements.define(i(e),c)}break}}))}n();const o=c;const p=n;export{o as ChEmptyState,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-empty-state.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as a,H as
|
|
1
|
+
import{p as a,H as s,h as i,d as t,t as g}from"./p-qP_9qshx.js";const r=()=>`:host{display:grid;grid-template-columns:var(--ch-grid-columns, repeat(auto-fit, minmax(min(16rem, 100%), 1fr)));box-sizing:border-box}:host([hidden]){display:none}.grid--gap-none{gap:0}.grid--gap-2xs{gap:var(--spacing-2xs)}.grid--gap-xs{gap:var(--spacing-xs)}.grid--gap-sm{gap:var(--spacing-sm)}.grid--gap-md{gap:var(--spacing-md)}.grid--gap-lg{gap:var(--spacing-lg)}.grid--gap-xl{gap:var(--spacing-xl)}.grid--gap-2xl{gap:var(--spacing-2xl)}.grid--gap-3xl{gap:var(--spacing-3xl)}.grid--gap-4xl{gap:var(--spacing-4xl)}.grid--gap-5xl{gap:var(--spacing-5xl)}.grid--gap-6xl{gap:var(--spacing-6xl)}`;const e=new Set(["none","2xs","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"]);const n=a(class a extends s{constructor(a){super();if(a!==false){this.__registerHost()}this.__attachShadow()}get el(){return this}columns="auto-fit";gap="md";minItemWidth="16rem";get gapStep(){return e.has(this.gap)?this.gap:"md"}get fixedColumns(){const a=Number(this.columns);return Number.isInteger(a)&&a>=1&&a<=12?a:null}componentWillLoad(){this.applyColumns()}componentDidUpdate(){this.applyColumns()}applyColumns(){const a=this.fixedColumns===null?`repeat(auto-fit, minmax(min(${this.minItemWidth}, 100%), 1fr))`:`repeat(${this.fixedColumns}, minmax(0, 1fr))`;this.el.style.setProperty("--ch-grid-columns",a)}render(){return i(t,{key:"09a37640189b353bd109bce97ad684396f91a06d",class:{grid:true,[`grid--gap-${this.gapStep}`]:true}},i("slot",{key:"e309fee76ea499e4c3b22082218d12fc94cb8fb8"}))}static get style(){return r()}},[769,"ch-grid",{columns:[1],gap:[1],minItemWidth:[1,"min-item-width"]}]);function p(){if(typeof customElements==="undefined"){return}const a=["ch-grid"];a.forEach((a=>{switch(a){case"ch-grid":if(!customElements.get(g(a))){customElements.define(g(a),n)}break}}))}p();const d=n;const l=p;export{d as ChGrid,l as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-grid.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChIconButton extends Components.ChIconButton, HTMLElement {}
|
|
4
|
+
export const ChIconButton: {
|
|
5
|
+
prototype: ChIconButton;
|
|
6
|
+
new (): ChIconButton;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as i,H as t,c as e,h as n,d as o,t as a}from"./p-qP_9qshx.js";import{c as r}from"./p-CnivhwvG.js";const s=()=>`:host{display:inline-block}.button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:transparent;color:var(--text);cursor:pointer;transition:background-color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default)}.button--sm{width:calc(var(--icon-size-sm) + 2 * var(--spacing-md));height:calc(var(--icon-size-sm) + 2 * var(--spacing-md))}.button--md{width:calc(var(--icon-size-md) + 2 * var(--spacing-xl));height:calc(var(--icon-size-md) + 2 * var(--spacing-xl))}.button--lg{width:calc(var(--icon-size-lg) + 2 * var(--spacing-2xl));height:calc(var(--icon-size-lg) + 2 * var(--spacing-2xl))}.button--sm .icon{width:var(--icon-size-sm);height:var(--icon-size-sm)}.button--md .icon{width:var(--icon-size-md);height:var(--icon-size-md)}.button--lg .icon{width:var(--icon-size-lg);height:var(--icon-size-lg)}.button:hover:not([aria-disabled='true']){border-color:var(--border-hover);background:var(--surface-hover)}.button:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.button[aria-disabled='true']{opacity:var(--opacity-disabled);cursor:not-allowed}.button[aria-busy='true']{cursor:progress}.button[aria-busy='true'] .icon{animation:ch-icon-button-spin var(--duration-spin) linear infinite}@keyframes ch-icon-button-spin{to{transform:rotate(360deg)}}@media (pointer: coarse){.button--sm{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.button{transition:none}.button[aria-busy='true'] .icon{animation:none}}`;const c=i(class i extends t{constructor(i){super();if(i!==false){this.__registerHost()}this.__attachShadow();this.chClick=e(this,"chClick")}name;label;size="md";type="button";disabled=false;loading=false;chClick;handleClick=i=>{if(this.disabled||this.loading){i.preventDefault();i.stopImmediatePropagation();return}this.chClick.emit(i)};render(){const i=this.name?r[this.name]:undefined;return n(o,{key:"201ad628b28588bdf40baf822abc60b2c8b7c6f2"},n("button",{key:"21fb01a8b6deef9e330ee2e3805834f5f2b8a953",class:`button button--${this.size}`,type:this.type,"aria-label":this.label,"aria-busy":this.loading?"true":undefined,"aria-disabled":this.disabled?"true":undefined,onClick:this.handleClick},n("svg",{key:"c003a3643d5968f08cf9227f768aea7b4817ab7d",class:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},(i??[]).map((i=>n(i.tag,i.attrs))))))}static get style(){return s()}},[513,"ch-icon-button",{name:[1],label:[1],size:[1],type:[1],disabled:[4],loading:[4]}]);function d(){if(typeof customElements==="undefined"){return}const i=["ch-icon-button"];i.forEach((i=>{switch(i){case"ch-icon-button":if(!customElements.get(a(i))){customElements.define(a(i),c)}break}}))}d();const l=c;const u=d;export{l as ChIconButton,u as defineCustomElement};
|
|
2
|
+
//# sourceMappingURL=ch-icon-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["chIconButtonCss","ChIconButton","__stencil_proxyCustomElement","HTMLElement","name","label","size","type","disabled","loading","chClick","handleClick","event","this","preventDefault","stopImmediatePropagation","emit","render","shapes","chIcons","undefined","h","Host","key","class","onClick","viewBox","fill","stroke","focusable","map","shape","tag","attrs"],"sources":["src/components/ch-icon-button/ch-icon-button.css?tag=ch-icon-button&encapsulation=shadow","src/components/ch-icon-button/ch-icon-button.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-pill);\n background: transparent;\n color: var(--text);\n cursor: pointer;\n transition:\n background-color var(--duration-normal) var(--easing-default),\n border-color var(--duration-normal) var(--easing-default),\n color var(--duration-normal) var(--easing-default);\n}\n\n/* Square hit area at each size, matching the height of the same-size ch-button\n so the two line up in a toolbar. */\n.button--sm {\n width: calc(var(--icon-size-sm) + 2 * var(--spacing-md));\n height: calc(var(--icon-size-sm) + 2 * var(--spacing-md));\n}\n\n.button--md {\n width: calc(var(--icon-size-md) + 2 * var(--spacing-xl));\n height: calc(var(--icon-size-md) + 2 * var(--spacing-xl));\n}\n\n.button--lg {\n width: calc(var(--icon-size-lg) + 2 * var(--spacing-2xl));\n height: calc(var(--icon-size-lg) + 2 * var(--spacing-2xl));\n}\n\n.button--sm .icon {\n width: var(--icon-size-sm);\n height: var(--icon-size-sm);\n}\n\n.button--md .icon {\n width: var(--icon-size-md);\n height: var(--icon-size-md);\n}\n\n.button--lg .icon {\n width: var(--icon-size-lg);\n height: var(--icon-size-lg);\n}\n\n.button:hover:not([aria-disabled='true']) {\n border-color: var(--border-hover);\n background: var(--surface-hover);\n}\n\n.button:focus-visible {\n outline: var(--focus-outline-width) solid var(--accent);\n outline-offset: var(--focus-outline-offset);\n}\n\n/* Disabled stays focusable on purpose: dropping focus to <body> when an action\n completes is worse than a button that can still be read. */\n.button[aria-disabled='true'] {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.button[aria-busy='true'] {\n cursor: progress;\n}\n\n.button[aria-busy='true'] .icon {\n animation: ch-icon-button-spin var(--duration-spin) linear infinite;\n}\n\n@keyframes ch-icon-button-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (pointer: coarse) {\n .button--sm {\n min-width: 44px;\n min-height: 44px;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .button {\n transition: none;\n }\n\n .button[aria-busy='true'] .icon {\n animation: none;\n }\n}\n","import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nimport { chIcons, type ChIconName } from '../../utils/icons';\n\nexport type ChIconButtonSize = 'sm' | 'md' | 'lg';\n\n/**\n * A button whose only content is an icon.\n *\n * The label is required rather than optional. An icon-only button without an\n * accessible name is unusable by voice, screen reader or automation, and there\n * is no adjacent text to fall back on — the same reasoning as `ch-modal`, and\n * the reason this component exists instead of letting consumers bolt an icon\n * slot onto `ch-button` and forget the name.\n */\n@Component({\n tag: 'ch-icon-button',\n styleUrl: 'ch-icon-button.css',\n shadow: true,\n})\nexport class ChIconButton {\n /** The glyph to draw. */\n @Prop() name!: ChIconName;\n\n /**\n * Accessible name, set as `aria-label`. Required: say what the button does\n * (\"Eliminar producto\"), not what the glyph is (\"papelera\").\n */\n @Prop() label!: string;\n\n /** Visual size. `md` matches the height of a default `ch-button`. */\n @Prop() size: ChIconButtonSize = 'md';\n\n /** Native button type, defaulting to `button` so it never submits a form by accident. */\n @Prop() type: 'button' | 'submit' | 'reset' = 'button';\n\n @Prop() disabled = false;\n\n /**\n * Blocks pointer and keyboard activation and marks the button `aria-busy`\n * while keeping it focusable, so focus does not fall to `<body>` when an\n * action completes.\n */\n @Prop() loading = false;\n\n /** Emitted on click. A click while disabled or loading emits nothing. */\n @Event() chClick: EventEmitter<MouseEvent>;\n\n private handleClick = (event: MouseEvent) => {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n this.chClick.emit(event);\n };\n\n render() {\n const shapes = this.name ? chIcons[this.name] : undefined;\n\n return (\n <Host>\n <button\n class={`button button--${this.size}`}\n type={this.type}\n aria-label={this.label}\n aria-busy={this.loading ? 'true' : undefined}\n aria-disabled={this.disabled ? 'true' : undefined}\n onClick={this.handleClick}\n >\n <svg\n class=\"icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n {(shapes ?? []).map(shape => h(shape.tag, shape.attrs))}\n </svg>\n </button>\n </Host>\n );\n }\n}\n"],"mappings":"2GAAA,MAAMA,EAAkB,IAAM,ksD,MCoBjBC,EAAYC,EAAA,MAAAD,UAAAE,E,gHAEfC,KAMAC,MAGAC,KAAyB,KAGzBC,KAAsC,SAEtCC,SAAW,MAOXC,QAAU,MAGTC,QAEDC,YAAeC,IACrB,GAAIC,KAAKL,UAAYK,KAAKJ,QAAS,CACjCG,EAAME,iBACNF,EAAMG,2BACN,M,CAEFF,KAAKH,QAAQM,KAAKJ,EAAM,EAG1B,MAAAK,GACE,MAAMC,EAASL,KAAKT,KAAOe,EAAQN,KAAKT,MAAQgB,UAEhD,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,UAAAE,IAAA,2CACEC,MAAO,kBAAkBX,KAAKP,OAC9BC,KAAMM,KAAKN,KAAI,aACHM,KAAKR,MAAK,YACXQ,KAAKJ,QAAU,OAASW,UAAS,gBAC7BP,KAAKL,SAAW,OAASY,UACxCK,QAASZ,KAAKF,aAEdU,EAAA,OAAAE,IAAA,2CACEC,MAAM,OACNE,QAAQ,YACRC,KAAK,OACLC,OAAO,eAAc,eACR,IAAG,iBACD,QAAO,kBACN,QAAO,cACX,OACZC,UAAU,UAERX,GAAU,IAAIY,KAAIC,GAASV,EAAEU,EAAMC,IAAKD,EAAME,W","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChIcon extends Components.ChIcon, HTMLElement {}
|
|
4
|
+
export const ChIcon: {
|
|
5
|
+
prototype: ChIcon;
|
|
6
|
+
new (): ChIcon;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as i,h as s,d as n,t}from"./p-qP_9qshx.js";import{c as o}from"./p-CnivhwvG.js";const c=()=>`:host{display:inline-flex;line-height:0}.icon{display:block;flex:none;color:inherit}.icon--sm{width:var(--icon-size-sm);height:var(--icon-size-sm)}.icon--md{width:var(--icon-size-md);height:var(--icon-size-md)}.icon--lg{width:var(--icon-size-lg);height:var(--icon-size-lg)}`;const r=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}name;size="md";label;render(){const e=this.name?o[this.name]:undefined;const i=!this.label;return s(n,{key:"c5f0c415136db62b88cfdd17b1535ccabda92060"},s("svg",{key:"55e4f5604d9a6b3e7727fb8354658928104ea156",class:`icon icon--${this.size}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",role:i?undefined:"img","aria-label":this.label,"aria-hidden":i?"true":undefined,focusable:"false"},(e??[]).map((e=>s(e.tag,e.attrs)))))}static get style(){return c()}},[513,"ch-icon",{name:[1],size:[1],label:[1]}]);function a(){if(typeof customElements==="undefined"){return}const e=["ch-icon"];e.forEach((e=>{switch(e){case"ch-icon":if(!customElements.get(t(e))){customElements.define(t(e),r)}break}}))}a();const l=r;const d=a;export{l as ChIcon,d as defineCustomElement};
|
|
2
|
+
//# sourceMappingURL=ch-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["chIconCss","ChIcon","__stencil_proxyCustomElement","HTMLElement","name","size","label","render","shapes","this","chIcons","undefined","decorative","h","Host","key","class","viewBox","fill","stroke","role","focusable","map","shape","tag","attrs"],"sources":["src/components/ch-icon/ch-icon.css?tag=ch-icon&encapsulation=shadow","src/components/ch-icon/ch-icon.tsx"],"sourcesContent":[":host {\n display: inline-flex;\n line-height: 0;\n}\n\n.icon {\n display: block;\n flex: none;\n color: inherit;\n}\n\n.icon--sm {\n width: var(--icon-size-sm);\n height: var(--icon-size-sm);\n}\n\n.icon--md {\n width: var(--icon-size-md);\n height: var(--icon-size-md);\n}\n\n.icon--lg {\n width: var(--icon-size-lg);\n height: var(--icon-size-lg);\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nimport { chIcons, type ChIconName } from '../../utils/icons';\n\nexport type ChIconSize = 'sm' | 'md' | 'lg';\n\n/**\n * A single Lucide glyph.\n *\n * Decorative by default: the icon is hidden from assistive technology unless\n * you give it a `label`, because most icons sit next to text that already says\n * what they mean and a second announcement is noise. Set `label` only when the\n * icon carries meaning on its own; a control whose only content is an icon\n * should use `ch-icon-button`, which requires the name.\n */\n@Component({\n tag: 'ch-icon',\n styleUrl: 'ch-icon.css',\n shadow: true,\n})\nexport class ChIcon {\n /**\n * Which glyph to draw. Unknown values render nothing rather than throwing,\n * so a stale name in a data payload cannot break the page.\n */\n @Prop() name!: ChIconName;\n\n /**\n * `sm` is 16px, `md` is 20px and `lg` is 24px — the sizes the scale's line\n * heights were built around.\n */\n @Prop() size: ChIconSize = 'md';\n\n /**\n * Accessible name. When set, the icon becomes `role=\"img\"` and is announced;\n * when omitted it is `aria-hidden`.\n */\n @Prop() label?: string;\n\n render() {\n const shapes = this.name ? chIcons[this.name] : undefined;\n const decorative = !this.label;\n\n return (\n <Host>\n <svg\n class={`icon icon--${this.size}`}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n role={decorative ? undefined : 'img'}\n aria-label={this.label}\n aria-hidden={decorative ? 'true' : undefined}\n focusable=\"false\"\n >\n {(shapes ?? []).map(shape => h(shape.tag, shape.attrs))}\n </svg>\n </Host>\n );\n }\n}\n"],"mappings":"+FAAA,MAAMA,EAAY,IAAM,oR,MCoBXC,EAAMC,EAAA,MAAAD,UAAAE,E,iFAKTC,KAMAC,KAAmB,KAMnBC,MAER,MAAAC,GACE,MAAMC,EAASC,KAAKL,KAAOM,EAAQD,KAAKL,MAAQO,UAChD,MAAMC,GAAcH,KAAKH,MAEzB,OACEO,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,OAAAE,IAAA,2CACEC,MAAO,cAAcP,KAAKJ,OAC1BY,QAAQ,YACRC,KAAK,OACLC,OAAO,eAAc,eACR,IAAG,iBACD,QAAO,kBACN,QAChBC,KAAMR,EAAaD,UAAY,MAAK,aACxBF,KAAKH,MAAK,cACTM,EAAa,OAASD,UACnCU,UAAU,UAERb,GAAU,IAAIc,KAAIC,GAASV,EAAEU,EAAMC,IAAKD,EAAME,U","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as i,c as r,h as s,d as e,t as a}from"./p-
|
|
1
|
+
import{p as t,H as i,c as r,h as s,d as e,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.input{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input::placeholder{color:var(--text-muted)}.input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus,:host(:user-invalid) .input:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.input:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let d=0;const h=t(class t extends i{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chInput=r(this,"chInput");this.chChange=r(this,"chChange");this.internals=this.attachInternals()}inputId=`ch-input-${++d}`;hintId=`${this.inputId}-hint`;errorId=`${this.inputId}-error`;initialValue="";internals;formDisabled=false;get host(){return this}label;type="text";value="";placeholder;name;disabled=false;required=false;hint;errorMessage;invalid=false;chInput;chChange;handleInput=t=>{this.value=t.target.value;this.chInput.emit(this.value)};handleChange=t=>{this.value=t.target.value;this.chChange.emit(this.value)};syncForm(){const t=this.internals;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(this.value);const{flags:i,message:r}=o({required:this.required,empty:this.value==="",invalid:this.invalid,errorMessage:this.errorMessage});t.setValidity(i,r)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(t){this.formDisabled=t}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return s(e,{key:"d85d2773a340ee1a46f7f76a0d287ff1194d0e0b"},this.label&&s("label",{key:"9ad19457232c703a59eab1062e12c17e8c2b8327",class:"label",htmlFor:this.inputId},this.label),s("input",{key:"f88fe669d2afa183230b1286dd88ccc894eaee5e",id:this.label?this.inputId:undefined,class:{input:true,"input--invalid":this.invalid},type:this.type,name:this.name,placeholder:this.placeholder,disabled:this.disabled||this.formDisabled,required:this.required,value:this.value,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onInput:this.handleInput,onChange:this.handleChange}),this.hint&&!(this.invalid&&this.errorMessage)&&s("p",{key:"31bdbb81ba537cc7d84b8cf7fc24055890b9b000",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&s("p",{key:"50a7cb03654f5deaa70af64ee14d774e94f77816",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[577,"ch-input",{label:[1],type:[1],value:[1025],placeholder:[1],name:[513],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function l(){if(typeof customElements==="undefined"){return}const t=["ch-input"];t.forEach((t=>{switch(t){case"ch-input":if(!customElements.get(a(t))){customElements.define(a(t),h)}break}}))}l();const c=h;const u=l;export{c as ChInput,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-input.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as i,h as r,d as n,t as a}from"./p-
|
|
1
|
+
import{p as t,H as e,c as i,h as r,d as n,t as a}from"./p-qP_9qshx.js";const o=()=>`:host{display:inline}.link{color:var(--accent);font-weight:var(--typography-weight-semibold);text-decoration:var(--ch-link-text-decoration, underline);text-decoration-thickness:var(--border-width);text-underline-offset:var(--spacing-shift);border-radius:var(--radius-sm);transition:color var(--duration-normal) var(--easing-default), opacity var(--duration-normal) var(--easing-default)}.link:hover{color:var(--accent-hover)}.link:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.link--muted{color:var(--text-muted);text-decoration:none}.link--muted:hover{color:var(--text)}.link--disabled{color:var(--text-muted);text-decoration:none;opacity:var(--opacity-disabled);cursor:not-allowed}`;const s=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chClick=i(this,"chClick")}href;target;variant="default";disabled=false;chClick;handleClick=t=>{this.chClick.emit(t)};render(){if(this.disabled){return r(n,null,r("span",{class:{link:true,[`link--${this.variant}`]:true,"link--disabled":true},part:"link","aria-disabled":"true"},r("slot",null)))}return r(n,null,r("a",{class:{link:true,[`link--${this.variant}`]:true},part:"link",href:this.href,target:this.target,rel:this.target==="_blank"?"noopener noreferrer":undefined,onClick:this.handleClick},r("slot",null)))}static get style(){return o()}},[769,"ch-link",{href:[1],target:[1],variant:[1],disabled:[4]}]);function l(){if(typeof customElements==="undefined"){return}const t=["ch-link"];t.forEach((t=>{switch(t){case"ch-link":if(!customElements.get(a(t))){customElements.define(a(t),s)}break}}))}l();const c=s;const d=l;export{c as ChLink,d as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-link.js.map
|