@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,84 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.header {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
align-items: flex-start;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
gap: var(--spacing-2xl);
|
|
11
|
+
padding-bottom: var(--spacing-2xl);
|
|
12
|
+
border-bottom: var(--border-width) solid var(--border);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.header-text {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: var(--spacing-xs);
|
|
19
|
+
/* Lets a long, unbroken title shrink instead of pushing the actions off the
|
|
20
|
+
row at narrow widths. */
|
|
21
|
+
flex: 1 1 20rem;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.header-eyebrow {
|
|
26
|
+
margin: 0;
|
|
27
|
+
color: var(--text-secondary);
|
|
28
|
+
font-family: var(--font-heading);
|
|
29
|
+
font-size: var(--typography-size-xs);
|
|
30
|
+
letter-spacing: var(--typography-tracking-badge);
|
|
31
|
+
text-transform: uppercase;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.header-title {
|
|
35
|
+
margin: 0;
|
|
36
|
+
color: var(--text);
|
|
37
|
+
font-family: var(--font-heading);
|
|
38
|
+
font-size: var(--typography-size-xl);
|
|
39
|
+
font-weight: var(--typography-weight-bold);
|
|
40
|
+
line-height: 1.2;
|
|
41
|
+
overflow-wrap: anywhere;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.header-description {
|
|
45
|
+
margin: 0;
|
|
46
|
+
color: var(--text-secondary);
|
|
47
|
+
font-size: var(--typography-size-sm);
|
|
48
|
+
line-height: 1.5;
|
|
49
|
+
overflow-wrap: anywhere;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.header-actions {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-wrap: wrap;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: var(--spacing-md);
|
|
57
|
+
/* Never wider than the row: the actions wrap inside it rather than forcing
|
|
58
|
+
horizontal overflow on a 390px screen. */
|
|
59
|
+
max-width: 100%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.header-actions:empty {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.header--stacked .header-actions {
|
|
67
|
+
flex-basis: 100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media (max-width: 30rem) {
|
|
71
|
+
.header {
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.header-actions {
|
|
76
|
+
width: 100%;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@media (forced-colors: active) {
|
|
81
|
+
.header {
|
|
82
|
+
border-bottom-color: CanvasText;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* The heading block at the top of a page: title, optional eyebrow and
|
|
4
|
+
* description, and a trailing actions area.
|
|
5
|
+
*
|
|
6
|
+
* The title is a `title` prop rather than a slot so the heading level always
|
|
7
|
+
* matches the page. A slotted heading lets a consumer nest a second `h1`, and
|
|
8
|
+
* "one top-level heading per page" then depends on every caller remembering it;
|
|
9
|
+
* here the level is explicit and defaults to `h1`. The actions wrap rather than
|
|
10
|
+
* push the page sideways at 390px, and the DOM order keeps the heading before
|
|
11
|
+
* the actions so reading and focus order still start with the title.
|
|
12
|
+
*/
|
|
13
|
+
export class ChPageHeader {
|
|
14
|
+
/**
|
|
15
|
+
* The page title. Rendered as a real heading, so it also works as the
|
|
16
|
+
* accessible name of the page region.
|
|
17
|
+
*/
|
|
18
|
+
title;
|
|
19
|
+
/**
|
|
20
|
+
* Heading element to render. Use `h2` (or `h3`) when the page already has a
|
|
21
|
+
* higher-level heading above this block, so the document outline stays valid.
|
|
22
|
+
*/
|
|
23
|
+
headingLevel = 'h1';
|
|
24
|
+
/**
|
|
25
|
+
* Optional small label above the title, as slotted content. Use it for a
|
|
26
|
+
* section or entity kind ("Proyecto", "Factura #1042"), not for the title.
|
|
27
|
+
*/
|
|
28
|
+
eyebrow;
|
|
29
|
+
/**
|
|
30
|
+
* Optional supporting line under the title.
|
|
31
|
+
*/
|
|
32
|
+
description;
|
|
33
|
+
/**
|
|
34
|
+
* Puts the actions below the title instead of beside it. Use it when the
|
|
35
|
+
* actions are too wide to sit on the same row even after wrapping.
|
|
36
|
+
*/
|
|
37
|
+
actionsStacked = false;
|
|
38
|
+
render() {
|
|
39
|
+
const Heading = this.headingLevel;
|
|
40
|
+
return (h(Host, { key: '0e2bc8c10790e1f6f36a4c679579ac775f6ec3a4' }, h("div", { key: '8ef9876c61f0ff325fedfb899d2e09c02b8e5e53', class: { 'header': true, 'header--stacked': this.actionsStacked } }, h("div", { key: '3bef4d66f8d69397c4117e9d4a0637e978abbe2e', class: "header-text" }, this.eyebrow && h("p", { key: '1ae504669807c48d95d12ce5b7d488f85e5dc864', class: "header-eyebrow" }, this.eyebrow), h(Heading, { key: '9b6374d6b1d18124e49acf67af08443175f4bbaa', class: "header-title" }, this.title), this.description && h("p", { key: '9c3d2d58f1c2dde2c70fc5f86eb2d580a13f8594', class: "header-description" }, this.description)), h("div", { key: '3b48c89c2a8c4c5d3e42f6b78db80b3e9c2e0c50', class: "header-actions" }, h("slot", { key: '77b2010fec0113af7c8ee7c7bcd884dd11b05138', name: "actions" })))));
|
|
41
|
+
}
|
|
42
|
+
static get is() { return "ch-page-header"; }
|
|
43
|
+
static get encapsulation() { return "shadow"; }
|
|
44
|
+
static get originalStyleUrls() {
|
|
45
|
+
return {
|
|
46
|
+
"$": ["ch-page-header.css"]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
static get styleUrls() {
|
|
50
|
+
return {
|
|
51
|
+
"$": ["ch-page-header.css"]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
static get properties() {
|
|
55
|
+
return {
|
|
56
|
+
"title": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"mutable": false,
|
|
59
|
+
"complexType": {
|
|
60
|
+
"original": "string",
|
|
61
|
+
"resolved": "string",
|
|
62
|
+
"references": {}
|
|
63
|
+
},
|
|
64
|
+
"required": true,
|
|
65
|
+
"optional": false,
|
|
66
|
+
"docs": {
|
|
67
|
+
"tags": [],
|
|
68
|
+
"text": "The page title. Rendered as a real heading, so it also works as the\naccessible name of the page region."
|
|
69
|
+
},
|
|
70
|
+
"getter": false,
|
|
71
|
+
"setter": false,
|
|
72
|
+
"reflect": false,
|
|
73
|
+
"attribute": "title"
|
|
74
|
+
},
|
|
75
|
+
"headingLevel": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"mutable": false,
|
|
78
|
+
"complexType": {
|
|
79
|
+
"original": "ChPageHeaderHeadingLevel",
|
|
80
|
+
"resolved": "\"h1\" | \"h2\" | \"h3\"",
|
|
81
|
+
"references": {
|
|
82
|
+
"ChPageHeaderHeadingLevel": {
|
|
83
|
+
"location": "local",
|
|
84
|
+
"path": "/home/runner/work/chucao/chucao/src/components/ch-page-header/ch-page-header.tsx",
|
|
85
|
+
"id": "src/components/ch-page-header/ch-page-header.tsx::ChPageHeaderHeadingLevel"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": "Heading element to render. Use `h2` (or `h3`) when the page already has a\nhigher-level heading above this block, so the document outline stays valid."
|
|
94
|
+
},
|
|
95
|
+
"getter": false,
|
|
96
|
+
"setter": false,
|
|
97
|
+
"reflect": false,
|
|
98
|
+
"attribute": "heading-level",
|
|
99
|
+
"defaultValue": "'h1'"
|
|
100
|
+
},
|
|
101
|
+
"eyebrow": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"mutable": false,
|
|
104
|
+
"complexType": {
|
|
105
|
+
"original": "string",
|
|
106
|
+
"resolved": "string",
|
|
107
|
+
"references": {}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": true,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": "Optional small label above the title, as slotted content. Use it for a\nsection or entity kind (\"Proyecto\", \"Factura #1042\"), not for the title."
|
|
114
|
+
},
|
|
115
|
+
"getter": false,
|
|
116
|
+
"setter": false,
|
|
117
|
+
"reflect": false,
|
|
118
|
+
"attribute": "eyebrow"
|
|
119
|
+
},
|
|
120
|
+
"description": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"mutable": false,
|
|
123
|
+
"complexType": {
|
|
124
|
+
"original": "string",
|
|
125
|
+
"resolved": "string",
|
|
126
|
+
"references": {}
|
|
127
|
+
},
|
|
128
|
+
"required": false,
|
|
129
|
+
"optional": true,
|
|
130
|
+
"docs": {
|
|
131
|
+
"tags": [],
|
|
132
|
+
"text": "Optional supporting line under the title."
|
|
133
|
+
},
|
|
134
|
+
"getter": false,
|
|
135
|
+
"setter": false,
|
|
136
|
+
"reflect": false,
|
|
137
|
+
"attribute": "description"
|
|
138
|
+
},
|
|
139
|
+
"actionsStacked": {
|
|
140
|
+
"type": "boolean",
|
|
141
|
+
"mutable": false,
|
|
142
|
+
"complexType": {
|
|
143
|
+
"original": "boolean",
|
|
144
|
+
"resolved": "boolean",
|
|
145
|
+
"references": {}
|
|
146
|
+
},
|
|
147
|
+
"required": false,
|
|
148
|
+
"optional": false,
|
|
149
|
+
"docs": {
|
|
150
|
+
"tags": [],
|
|
151
|
+
"text": "Puts the actions below the title instead of beside it. Use it when the\nactions are too wide to sit on the same row even after wrapping."
|
|
152
|
+
},
|
|
153
|
+
"getter": false,
|
|
154
|
+
"setter": false,
|
|
155
|
+
"reflect": false,
|
|
156
|
+
"attribute": "actions-stacked",
|
|
157
|
+
"defaultValue": "false"
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=ch-page-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-page-header.js","sourceRoot":"","sources":["../../../../src/components/ch-page-header/ch-page-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIzD;;;;;;;;;;GAUG;AAMH,MAAM,OAAO,YAAY;IACvB;;;OAGG;IACK,KAAK,CAAU;IAEvB;;;OAGG;IACK,YAAY,GAA6B,IAAI,CAAC;IAEtD;;;OAGG;IACK,OAAO,CAAU;IAEzB;;OAEG;IACK,WAAW,CAAU;IAE7B;;;OAGG;IACK,cAAc,GAAG,KAAK,CAAC;IAE/B,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC;QAElC,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,cAAc,EAAE;gBACpE,4DAAK,KAAK,EAAC,aAAa;oBACrB,IAAI,CAAC,OAAO,IAAI,0DAAG,KAAK,EAAC,gBAAgB,IAAE,IAAI,CAAC,OAAO,CAAK;oBAC7D,EAAC,OAAO,qDAAC,KAAK,EAAC,cAAc,IAAE,IAAI,CAAC,KAAK,CAAW;oBACnD,IAAI,CAAC,WAAW,IAAI,0DAAG,KAAK,EAAC,oBAAoB,IAAE,IAAI,CAAC,WAAW,CAAK,CACrE;gBACN,4DAAK,KAAK,EAAC,gBAAgB;oBACzB,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChPageHeaderHeadingLevel = 'h1' | 'h2' | 'h3';\n\n/**\n * The heading block at the top of a page: title, optional eyebrow and\n * description, and a trailing actions area.\n *\n * The title is a `title` prop rather than a slot so the heading level always\n * matches the page. A slotted heading lets a consumer nest a second `h1`, and\n * \"one top-level heading per page\" then depends on every caller remembering it;\n * here the level is explicit and defaults to `h1`. The actions wrap rather than\n * push the page sideways at 390px, and the DOM order keeps the heading before\n * the actions so reading and focus order still start with the title.\n */\n@Component({\n tag: 'ch-page-header',\n styleUrl: 'ch-page-header.css',\n shadow: true,\n})\nexport class ChPageHeader {\n /**\n * The page title. Rendered as a real heading, so it also works as the\n * accessible name of the page region.\n */\n @Prop() title!: string;\n\n /**\n * Heading element to render. Use `h2` (or `h3`) when the page already has a\n * higher-level heading above this block, so the document outline stays valid.\n */\n @Prop() headingLevel: ChPageHeaderHeadingLevel = 'h1';\n\n /**\n * Optional small label above the title, as slotted content. Use it for a\n * section or entity kind (\"Proyecto\", \"Factura #1042\"), not for the title.\n */\n @Prop() eyebrow?: string;\n\n /**\n * Optional supporting line under the title.\n */\n @Prop() description?: string;\n\n /**\n * Puts the actions below the title instead of beside it. Use it when the\n * actions are too wide to sit on the same row even after wrapping.\n */\n @Prop() actionsStacked = false;\n\n render() {\n const Heading = this.headingLevel;\n\n return (\n <Host>\n <div class={{ 'header': true, 'header--stacked': this.actionsStacked }}>\n <div class=\"header-text\">\n {this.eyebrow && <p class=\"header-eyebrow\">{this.eyebrow}</p>}\n <Heading class=\"header-title\">{this.title}</Heading>\n {this.description && <p class=\"header-description\">{this.description}</p>}\n </div>\n <div class=\"header-actions\">\n <slot name=\"actions\"></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -98,7 +98,7 @@ export class ChRadio {
|
|
|
98
98
|
}
|
|
99
99
|
render() {
|
|
100
100
|
const groupName = this.name || `${this.groupId}-group`;
|
|
101
|
-
return (h(Host, { key: '
|
|
101
|
+
return (h(Host, { key: 'f55466f6bcbe3283d294161c02498419066ca958' }, this.label && (h("span", { key: '789131e7d8812ee930db5e0a0c6dc7f7e353249f', class: "group-label", id: this.labelId }, this.label)), h("div", { key: 'fc0a7adbde7feaaca99d156d45aacb6d18d5588e', class: "radio-group", role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (h("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, h("input", { class: { 'input': true, 'input--invalid': this.invalid }, type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), h("span", { class: "mark" }), h("span", { class: "label-text" }, option.label))))), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '53f3e9d368cfefa9a4d85010b65f002a3b92e0f4', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '517b7204ebf91042d293be294d7e936954eb80fb', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
102
102
|
}
|
|
103
103
|
static get is() { return "ch-radio"; }
|
|
104
104
|
static get encapsulation() { return "shadow"; }
|
|
@@ -92,7 +92,7 @@ export class ChSegmentedControl {
|
|
|
92
92
|
}
|
|
93
93
|
render() {
|
|
94
94
|
const groupName = this.name || `${this.groupId}-group`;
|
|
95
|
-
return (h(Host, { key: '
|
|
95
|
+
return (h(Host, { key: 'a8782886fd0c20fa96a5a54c9997fe9d91d3e670' }, this.label && (h("span", { key: '99a2727035a62f71d01f07e0cf222becb118d3b2', class: "group-label", id: this.labelId }, this.label)), h("div", { key: '31b293c379a996e06650c1a6c9fe9c46c32097a2', class: { segmented: true, [`segmented--${this.size}`]: true }, role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (h("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, h("input", { class: "input", type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, onChange: this.handleChange }), h("span", { class: "label-text" }, option.label)))))));
|
|
96
96
|
}
|
|
97
97
|
static get is() { return "ch-segmented-control"; }
|
|
98
98
|
static get encapsulation() { return "shadow"; }
|
|
@@ -99,7 +99,7 @@ export class ChSelect {
|
|
|
99
99
|
return undefined;
|
|
100
100
|
}
|
|
101
101
|
render() {
|
|
102
|
-
return (h(Host, { key: '
|
|
102
|
+
return (h(Host, { key: 'aeba7eff5bf3bd7926922e65376c6508fc1c4dd3' }, this.label && (h("label", { key: '943e5557014e2297368825505513f4ad8b093ee5', class: "label", htmlFor: this.selectId }, this.label)), h("select", { key: 'ccec2dfef1b06b219e7aed536914ebf2b24e370f', id: this.label ? this.selectId : undefined, class: { 'select': true, 'select--invalid': this.invalid }, name: this.name, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }, this.placeholder && (h("option", { key: 'a0c41592c1a5a90f611917da984374edf5305b96', value: "", disabled: true, hidden: true, selected: !this.value }, this.placeholder)), this.options.map(option => (h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label)))), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '28a35ede5d7bb1937d501719244b4b9f7a5d95f2', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: 'b021c848f75367e2e3329aab423f787205ee0491', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
103
103
|
}
|
|
104
104
|
static get is() { return "ch-select"; }
|
|
105
105
|
static get encapsulation() { return "shadow"; }
|
|
@@ -47,7 +47,7 @@ export class ChSkeleton {
|
|
|
47
47
|
return { width: this.width, height: this.height };
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
return (h(Host, { key: '
|
|
50
|
+
return (h(Host, { key: '705e4cd6dac9c8c8578cb8133a700c3297d9fffe', "aria-hidden": "true", class: { 'skeleton': true, [`skeleton--${this.shape}`]: true, 'skeleton--animated': this.animated } }, Array.from({ length: this.items }).map((value, index) => (h("span", { class: "skeleton__item", style: this.sizeStyle, key: index, "data-index": String(value) })))));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "ch-skeleton"; }
|
|
53
53
|
static get encapsulation() { return "shadow"; }
|
|
@@ -23,7 +23,7 @@ export class ChSpinner {
|
|
|
23
23
|
label;
|
|
24
24
|
render() {
|
|
25
25
|
const labelled = Boolean(this.label);
|
|
26
|
-
return (h(Host, { key: '
|
|
26
|
+
return (h(Host, { key: '6d26b2ead7b674058b3d5c56caf9329cf9377ae6' }, h("span", { key: 'a3fa9b56474271154527b9e0f9def3136b158ea4', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
|
|
27
27
|
}
|
|
28
28
|
static get is() { return "ch-spinner"; }
|
|
29
29
|
static get encapsulation() { return "shadow"; }
|
|
@@ -24,7 +24,7 @@ export class ChStack {
|
|
|
24
24
|
return GAPS.has(this.gap) ? this.gap : 'md';
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
|
-
return (h(Host, { key: '
|
|
27
|
+
return (h(Host, { key: 'd4ee90331cd1ff0d65eb9c80aa684d3b2f5e2876', class: { stack: true, [`stack--gap-${this.gapStep}`]: true, [`stack--align-${this.align}`]: true, [`stack--justify-${this.justify}`]: true } }, h("slot", { key: 'bdfe358adc457ed6ba79ca80b9e96f17597fbcb5' })));
|
|
28
28
|
}
|
|
29
29
|
static get is() { return "ch-stack"; }
|
|
30
30
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
font-family: var(--typography-body);
|
|
4
|
+
color: var(--color-text-primary);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host([hidden]) {
|
|
8
|
+
display: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.stat__inner {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: var(--spacing-2xs);
|
|
15
|
+
padding: var(--spacing-md) var(--spacing-lg);
|
|
16
|
+
border: var(--border-width) solid var(--color-border-default);
|
|
17
|
+
border-radius: var(--radius-md);
|
|
18
|
+
background: var(--color-surface-default);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.stat__label {
|
|
22
|
+
font-size: var(--typography-size-xs);
|
|
23
|
+
font-weight: var(--typography-weight-semibold);
|
|
24
|
+
letter-spacing: 0.06em;
|
|
25
|
+
text-transform: uppercase;
|
|
26
|
+
color: var(--color-text-secondary);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.stat__value {
|
|
30
|
+
font-family: var(--typography-heading);
|
|
31
|
+
font-size: var(--typography-size-xl);
|
|
32
|
+
font-weight: var(--typography-weight-bold);
|
|
33
|
+
font-variant-numeric: tabular-nums;
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: baseline;
|
|
36
|
+
gap: var(--spacing-2xs);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* The sign cue carries the tone in greyscale; colour only reinforces it. */
|
|
40
|
+
.stat__cue {
|
|
41
|
+
font-size: var(--typography-size-md);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.stat__value--positive {
|
|
45
|
+
color: var(--color-status-positive);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.stat__value--negative {
|
|
49
|
+
color: var(--color-status-negative);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.stat__value--unavailable {
|
|
53
|
+
color: var(--color-text-tertiary);
|
|
54
|
+
font-style: italic;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.stat__hint {
|
|
58
|
+
font-size: var(--typography-size-sm);
|
|
59
|
+
color: var(--color-text-secondary);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.stat__footer:empty {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.stat__footer {
|
|
67
|
+
margin-top: var(--spacing-2xs);
|
|
68
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
const TONES = new Set(['default', 'positive', 'negative', 'unavailable']);
|
|
3
|
+
/**
|
|
4
|
+
* One dashboard metric: a label, a value and an optional hint.
|
|
5
|
+
*
|
|
6
|
+
* The value is a string the consumer has already formatted — the component
|
|
7
|
+
* never parses numbers, so locale, currency and precision stay where the
|
|
8
|
+
* data comes from. On a fetch error, pass the em dash and the unavailable
|
|
9
|
+
* tone rather than a zero that would read as a real measurement:
|
|
10
|
+
*
|
|
11
|
+
* ```html
|
|
12
|
+
* <ch-stat label="Ventas del mes" value="$1.250.000" tone="positive"></ch-stat>
|
|
13
|
+
* <ch-stat label="Ticket promedio" value="—" tone="unavailable"></ch-stat>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* A tone is never carried by colour alone: positive and negative values get
|
|
17
|
+
* a visible sign cue, so the three states stay distinguishable in greyscale
|
|
18
|
+
* and for colour-blind users. The `value` slot replaces the rendered value
|
|
19
|
+
* for composed content (a link, a spinner), and the `footer` slot sits under
|
|
20
|
+
* the hint for a comparison line or a sparkline.
|
|
21
|
+
*/
|
|
22
|
+
export class ChStat {
|
|
23
|
+
/**
|
|
24
|
+
* Short label naming the metric, rendered in small caps above the value.
|
|
25
|
+
*/
|
|
26
|
+
label;
|
|
27
|
+
/**
|
|
28
|
+
* The metric value, already formatted by the consumer. Shown verbatim.
|
|
29
|
+
*/
|
|
30
|
+
value;
|
|
31
|
+
/**
|
|
32
|
+
* Secondary line under the value — a comparison or a unit note.
|
|
33
|
+
*/
|
|
34
|
+
hint;
|
|
35
|
+
/**
|
|
36
|
+
* Visual tone of the value. `positive` and `negative` add a sign cue so
|
|
37
|
+
* the tone survives greyscale; `unavailable` dims the value for the
|
|
38
|
+
* "could not be measured" case. An unknown value falls back to `default`.
|
|
39
|
+
*/
|
|
40
|
+
tone = 'default';
|
|
41
|
+
get toneClass() {
|
|
42
|
+
return TONES.has(this.tone) ? this.tone : 'default';
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
const cue = this.toneClass === 'positive' ? '+' : this.toneClass === 'negative' ? '−' : null;
|
|
46
|
+
return (h(Host, { key: '5a43c713faab1513866d8f06899bb3fd3184cf09', class: "stat" }, h("div", { key: '9c24e9774cfe0a70b8ba37c06ce7f264b34a9d8c', class: "stat__inner" }, h("span", { key: '1a9330c2b31ec6de29f1b8c77761d7eb16160aae', class: "stat__label" }, this.label), h("span", { key: '3f6c5e76f5c062effcb9793206a949942bcdfb9a', class: {
|
|
47
|
+
stat__value: true,
|
|
48
|
+
[`stat__value--${this.toneClass}`]: this.toneClass !== 'default',
|
|
49
|
+
} }, cue && (h("span", { key: 'b5f79899ec52e7e2b3ec3c00295f755f770a8bca', class: "stat__cue", "aria-hidden": "true" }, cue)), h("slot", { key: 'b64083aa5738b4088cf9029650286b2564649ec9', name: "value" }, this.value)), this.hint && h("span", { key: '9f560c1f1fd23f08ea63eccc9076066a7fd1a0f9', class: "stat__hint" }, this.hint), h("div", { key: '77f3fe1f87e3abc2cce829e06b21f6b2c5f9aa15', class: "stat__footer" }, h("slot", { key: 'd75204702eab0ab1f55df92e9c13c899235f6840', name: "footer" })))));
|
|
50
|
+
}
|
|
51
|
+
static get is() { return "ch-stat"; }
|
|
52
|
+
static get encapsulation() { return "shadow"; }
|
|
53
|
+
static get originalStyleUrls() {
|
|
54
|
+
return {
|
|
55
|
+
"$": ["ch-stat.css"]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
static get styleUrls() {
|
|
59
|
+
return {
|
|
60
|
+
"$": ["ch-stat.css"]
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
static get properties() {
|
|
64
|
+
return {
|
|
65
|
+
"label": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"mutable": false,
|
|
68
|
+
"complexType": {
|
|
69
|
+
"original": "string",
|
|
70
|
+
"resolved": "string",
|
|
71
|
+
"references": {}
|
|
72
|
+
},
|
|
73
|
+
"required": true,
|
|
74
|
+
"optional": false,
|
|
75
|
+
"docs": {
|
|
76
|
+
"tags": [],
|
|
77
|
+
"text": "Short label naming the metric, rendered in small caps above the value."
|
|
78
|
+
},
|
|
79
|
+
"getter": false,
|
|
80
|
+
"setter": false,
|
|
81
|
+
"reflect": false,
|
|
82
|
+
"attribute": "label"
|
|
83
|
+
},
|
|
84
|
+
"value": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"mutable": false,
|
|
87
|
+
"complexType": {
|
|
88
|
+
"original": "string",
|
|
89
|
+
"resolved": "string",
|
|
90
|
+
"references": {}
|
|
91
|
+
},
|
|
92
|
+
"required": true,
|
|
93
|
+
"optional": false,
|
|
94
|
+
"docs": {
|
|
95
|
+
"tags": [],
|
|
96
|
+
"text": "The metric value, already formatted by the consumer. Shown verbatim."
|
|
97
|
+
},
|
|
98
|
+
"getter": false,
|
|
99
|
+
"setter": false,
|
|
100
|
+
"reflect": false,
|
|
101
|
+
"attribute": "value"
|
|
102
|
+
},
|
|
103
|
+
"hint": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"mutable": false,
|
|
106
|
+
"complexType": {
|
|
107
|
+
"original": "string",
|
|
108
|
+
"resolved": "string",
|
|
109
|
+
"references": {}
|
|
110
|
+
},
|
|
111
|
+
"required": false,
|
|
112
|
+
"optional": true,
|
|
113
|
+
"docs": {
|
|
114
|
+
"tags": [],
|
|
115
|
+
"text": "Secondary line under the value \u2014 a comparison or a unit note."
|
|
116
|
+
},
|
|
117
|
+
"getter": false,
|
|
118
|
+
"setter": false,
|
|
119
|
+
"reflect": false,
|
|
120
|
+
"attribute": "hint"
|
|
121
|
+
},
|
|
122
|
+
"tone": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"mutable": false,
|
|
125
|
+
"complexType": {
|
|
126
|
+
"original": "ChStatTone",
|
|
127
|
+
"resolved": "\"default\" | \"negative\" | \"positive\" | \"unavailable\"",
|
|
128
|
+
"references": {
|
|
129
|
+
"ChStatTone": {
|
|
130
|
+
"location": "local",
|
|
131
|
+
"path": "/home/runner/work/chucao/chucao/src/components/ch-stat/ch-stat.tsx",
|
|
132
|
+
"id": "src/components/ch-stat/ch-stat.tsx::ChStatTone"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"required": false,
|
|
137
|
+
"optional": false,
|
|
138
|
+
"docs": {
|
|
139
|
+
"tags": [],
|
|
140
|
+
"text": "Visual tone of the value. `positive` and `negative` add a sign cue so\nthe tone survives greyscale; `unavailable` dims the value for the\n\"could not be measured\" case. An unknown value falls back to `default`."
|
|
141
|
+
},
|
|
142
|
+
"getter": false,
|
|
143
|
+
"setter": false,
|
|
144
|
+
"reflect": false,
|
|
145
|
+
"attribute": "tone",
|
|
146
|
+
"defaultValue": "'default'"
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=ch-stat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-stat.js","sourceRoot":"","sources":["../../../../src/components/ch-stat/ch-stat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIzD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;AAE1E;;;;;;;;;;;;;;;;;;GAkBG;AAMH,MAAM,OAAO,MAAM;IACjB;;OAEG;IACK,KAAK,CAAU;IAEvB;;OAEG;IACK,KAAK,CAAU;IAEvB;;OAEG;IACK,IAAI,CAAU;IAEtB;;;;OAIG;IACK,IAAI,GAAe,SAAS,CAAC;IAErC,IAAY,SAAS;QACnB,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACtD,CAAC;IAED,MAAM;QACJ,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QAE7F,OAAO,CACL,EAAC,IAAI,qDAAC,KAAK,EAAC,MAAM;YAChB,4DAAK,KAAK,EAAC,aAAa;gBACtB,6DAAM,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,KAAK,CAAQ;gBAC7C,6DACE,KAAK,EAAE;wBACL,WAAW,EAAE,IAAI;wBACjB,CAAC,gBAAgB,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,IAAI,CAAC,SAAS,KAAK,SAAS;qBACjE;oBAEA,GAAG,IAAI,CACN,6DAAM,KAAK,EAAC,WAAW,iBAAa,MAAM,IACvC,GAAG,CACC,CACR;oBACD,6DAAM,IAAI,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAQ,CACjC;gBACN,IAAI,CAAC,IAAI,IAAI,6DAAM,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,IAAI,CAAQ;gBACzD,4DAAK,KAAK,EAAC,cAAc;oBACvB,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChStatTone = 'default' | 'positive' | 'negative' | 'unavailable';\n\nconst TONES = new Set(['default', 'positive', 'negative', 'unavailable']);\n\n/**\n * One dashboard metric: a label, a value and an optional hint.\n *\n * The value is a string the consumer has already formatted — the component\n * never parses numbers, so locale, currency and precision stay where the\n * data comes from. On a fetch error, pass the em dash and the unavailable\n * tone rather than a zero that would read as a real measurement:\n *\n * ```html\n * <ch-stat label=\"Ventas del mes\" value=\"$1.250.000\" tone=\"positive\"></ch-stat>\n * <ch-stat label=\"Ticket promedio\" value=\"—\" tone=\"unavailable\"></ch-stat>\n * ```\n *\n * A tone is never carried by colour alone: positive and negative values get\n * a visible sign cue, so the three states stay distinguishable in greyscale\n * and for colour-blind users. The `value` slot replaces the rendered value\n * for composed content (a link, a spinner), and the `footer` slot sits under\n * the hint for a comparison line or a sparkline.\n */\n@Component({\n tag: 'ch-stat',\n styleUrl: 'ch-stat.css',\n shadow: true,\n})\nexport class ChStat {\n /**\n * Short label naming the metric, rendered in small caps above the value.\n */\n @Prop() label!: string;\n\n /**\n * The metric value, already formatted by the consumer. Shown verbatim.\n */\n @Prop() value!: string;\n\n /**\n * Secondary line under the value — a comparison or a unit note.\n */\n @Prop() hint?: string;\n\n /**\n * Visual tone of the value. `positive` and `negative` add a sign cue so\n * the tone survives greyscale; `unavailable` dims the value for the\n * \"could not be measured\" case. An unknown value falls back to `default`.\n */\n @Prop() tone: ChStatTone = 'default';\n\n private get toneClass() {\n return TONES.has(this.tone) ? this.tone : 'default';\n }\n\n render() {\n const cue = this.toneClass === 'positive' ? '+' : this.toneClass === 'negative' ? '−' : null;\n\n return (\n <Host class=\"stat\">\n <div class=\"stat__inner\">\n <span class=\"stat__label\">{this.label}</span>\n <span\n class={{\n stat__value: true,\n [`stat__value--${this.toneClass}`]: this.toneClass !== 'default',\n }}\n >\n {cue && (\n <span class=\"stat__cue\" aria-hidden=\"true\">\n {cue}\n </span>\n )}\n <slot name=\"value\">{this.value}</slot>\n </span>\n {this.hint && <span class=\"stat__hint\">{this.hint}</span>}\n <div class=\"stat__footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -95,7 +95,7 @@ export class ChSwitch {
|
|
|
95
95
|
return undefined;
|
|
96
96
|
}
|
|
97
97
|
render() {
|
|
98
|
-
return (h(Host, { key: '
|
|
98
|
+
return (h(Host, { key: 'e1493afa72058b44b5051cdc641604d02952b6be' }, h("label", { key: '80f2ca9bdb7fab02556f427f4a1fce56744eaf50', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, h("input", { key: '22a873c43b7f9c94455373d80ab5b3c28153ff70', id: this.switchId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", role: "switch", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), h("span", { key: 'd995c061f60ad3040048966da17ad8cb2ebdb622', class: "track" }, h("span", { key: 'ba09dcb23640b2925d0c82f5ab46213acc7e8a86', class: "thumb" })), this.label && h("span", { key: '9849238fd3486bc1d869c6df373e30209e46d264', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '76a5cb6da88dbd7088cf2c0d9c2b5a781a632a7f', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '5ebd8ab9b2390fea801bf75eeb4967e95983e041', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
99
99
|
}
|
|
100
100
|
static get is() { return "ch-switch"; }
|
|
101
101
|
static get encapsulation() { return "shadow"; }
|
|
@@ -77,7 +77,7 @@ export class ChTabs {
|
|
|
77
77
|
}
|
|
78
78
|
render() {
|
|
79
79
|
const active = this.activeValue;
|
|
80
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: 'de167280c159345631f84f5eb7a3dc165396f361' }, h("div", { key: '62c008bcf9eafd1c5f5121540b2841e2a6ada541', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
|
|
81
81
|
const selected = tab.value === active;
|
|
82
82
|
return (h("button", { key: tab.value, type: "button", class: { 'tab': true, 'tab--active': selected, 'tab--disabled': Boolean(tab.disabled) }, role: "tab", id: this.tabId(tab.value), "data-value": tab.value, "aria-selected": selected ? 'true' : 'false', "aria-controls": this.panelId(tab.value), tabIndex: selected ? FIRST_TAB_INDEX : LAST_TAB_INDEX, disabled: tab.disabled, onClick: () => this.select(tab.value) }, tab.label));
|
|
83
83
|
})), this.tabs.map(tab => (h("div", { key: `${tab.value}-panel`, class: "tabpanel", id: this.panelId(tab.value), role: "tabpanel", "aria-labelledby": this.tabId(tab.value), tabIndex: FIRST_TAB_INDEX, hidden: tab.value !== active }, h("slot", { name: `panel-${tab.value}` }))))));
|
|
@@ -108,7 +108,7 @@ export class ChTextarea {
|
|
|
108
108
|
return undefined;
|
|
109
109
|
}
|
|
110
110
|
render() {
|
|
111
|
-
return (h(Host, { key: '
|
|
111
|
+
return (h(Host, { key: 'c4334a23f6ad2394d410498726f3f422a654ffe3' }, this.label && (h("label", { key: 'd935613b40c6c52be41e258aad2a3c17a290a506', class: "label", htmlFor: this.textareaId }, this.label)), h("textarea", { key: 'ab27ae9a6be7d2bcc17638c209ef23eb3757c102', id: this.label ? this.textareaId : undefined, class: { 'textarea': true, 'textarea--invalid': this.invalid }, rows: this.rows, name: this.name, placeholder: this.placeholder, disabled: this.disabled || this.formDisabled, required: this.required, value: this.value, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange }), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: 'eb488704ac6ff76534308aefd0938d848d14608f', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '04c084b29d102f06bf15efc4c416b6ba0967ba8d', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
112
112
|
}
|
|
113
113
|
static get is() { return "ch-textarea"; }
|
|
114
114
|
static get encapsulation() { return "shadow"; }
|