@devschile/chucao 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/{p-f5b74bca.entry.js → p-0409c063.entry.js} +2 -2
- package/dist/chucao/{p-0bc141a2.entry.js → p-090d26f1.entry.js} +2 -2
- package/dist/chucao/{p-f9fe752c.entry.js → p-207648f9.entry.js} +2 -2
- package/dist/chucao/{p-9f73855e.entry.js → p-20ea1b18.entry.js} +2 -2
- package/dist/chucao/{p-be7b5c21.entry.js → p-21ca2235.entry.js} +2 -2
- package/dist/chucao/{p-fdf065e6.entry.js → p-2c1bc8bd.entry.js} +2 -2
- package/dist/chucao/{p-2c681cc0.entry.js → p-370d9629.entry.js} +2 -2
- package/dist/chucao/{p-2c681cc0.entry.js.map → p-370d9629.entry.js.map} +1 -1
- package/dist/chucao/{p-6345c9e1.entry.js → p-50cbea7f.entry.js} +2 -2
- package/dist/chucao/p-66ae9e2c.entry.js +2 -0
- package/dist/chucao/p-66ae9e2c.entry.js.map +1 -0
- package/dist/chucao/p-79f20bfd.entry.js +2 -0
- package/dist/chucao/p-79f20bfd.entry.js.map +1 -0
- package/dist/chucao/{p-c251b0d1.entry.js → p-7d4336bd.entry.js} +2 -2
- package/dist/chucao/{p-957acf39.entry.js → p-81b6622f.entry.js} +2 -2
- package/dist/chucao/{p-b53d954e.entry.js → p-925af6b8.entry.js} +2 -2
- package/dist/chucao/p-95061461.entry.js +2 -0
- package/dist/chucao/{p-97655c41.entry.js → p-9794a3fa.entry.js} +2 -2
- package/dist/chucao/{p-26e144ff.entry.js → p-b56f4a29.entry.js} +2 -2
- package/dist/chucao/{p-c165f839.entry.js → p-b9b47942.entry.js} +2 -2
- package/dist/chucao/{p-0e044eff.entry.js → p-c1b35f1b.entry.js} +2 -2
- package/dist/chucao/p-e2f725bd.entry.js +2 -0
- package/dist/chucao/{p-2e785177.entry.js.map → p-e2f725bd.entry.js.map} +1 -1
- package/dist/chucao/{p-350f974d.entry.js → p-e6f959f4.entry.js} +2 -2
- package/dist/chucao/p-f0aea6ed.entry.js +2 -0
- package/dist/chucao/{p-1108062e.entry.js → p-f7305552.entry.js} +2 -2
- package/dist/chucao/p-ffaf1a31.entry.js +2 -0
- package/dist/chucao/p-ffaf1a31.entry.js.map +1 -0
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +7 -7
- package/dist/cjs/ch-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ch-cluster.cjs.entry.js +2 -2
- package/dist/cjs/ch-description-list.cjs.entry.js +29 -0
- package/dist/cjs/ch-description-list.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-divider.cjs.entry.js +1 -1
- package/dist/cjs/ch-drawer.cjs.entry.js +1 -1
- package/dist/cjs/ch-emoji.cjs.entry.js +1 -1
- package/dist/cjs/ch-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/ch-grid.cjs.entry.js +1 -1
- package/dist/cjs/ch-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/ch-icon.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +1 -1
- package/dist/cjs/ch-page-header.cjs.entry.js +1 -1
- package/dist/cjs/ch-radio.cjs.entry.js +1 -1
- package/dist/cjs/ch-segmented-control.cjs.entry.js +1 -1
- package/dist/cjs/ch-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ch-stack.cjs.entry.js +1 -1
- package/dist/cjs/ch-stat.cjs.entry.js +46 -0
- package/dist/cjs/ch-stat.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ch-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ch-timeline.cjs.entry.js +20 -0
- package/dist/cjs/ch-timeline.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-tooltip.cjs.entry.js +6 -4
- package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/chucao.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +9 -6
- package/dist/collection/components/ch-accordion/ch-accordion.js +1 -1
- package/dist/collection/components/ch-alert/ch-alert.js +1 -1
- package/dist/collection/components/ch-badge/ch-badge.js +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
- package/dist/collection/components/ch-description-list/ch-description-list.css +60 -0
- package/dist/collection/components/ch-description-list/ch-description-list.js +78 -0
- package/dist/collection/components/ch-description-list/ch-description-list.js.map +1 -0
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
- package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
- package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
- package/dist/collection/components/ch-grid/ch-grid.js +1 -1
- package/dist/collection/components/ch-icon/ch-icon.js +1 -1
- package/dist/collection/components/ch-icon-button/ch-icon-button.js +1 -1
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +1 -1
- package/dist/collection/components/ch-page-header/ch-page-header.js +1 -1
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- package/dist/collection/components/ch-stack/ch-stack.js +1 -1
- package/dist/collection/components/ch-stat/ch-stat.css +68 -0
- package/dist/collection/components/ch-stat/ch-stat.js +151 -0
- package/dist/collection/components/ch-stat/ch-stat.js.map +1 -0
- package/dist/collection/components/ch-switch/ch-switch.js +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
- package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
- package/dist/collection/components/ch-timeline/ch-timeline.css +54 -0
- package/dist/collection/components/ch-timeline/ch-timeline.js +43 -0
- package/dist/collection/components/ch-timeline/ch-timeline.js.map +1 -0
- package/dist/collection/components/ch-tooltip/ch-tooltip.js +6 -4
- package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
- package/dist/components/ch-accordion.js +1 -1
- package/dist/components/ch-alert.js +1 -1
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-card.js.map +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-cluster.js +1 -1
- package/dist/components/ch-description-list.d.ts +11 -0
- package/dist/components/ch-description-list.js +2 -0
- package/dist/components/ch-description-list.js.map +1 -0
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-drawer.js +1 -1
- package/dist/components/ch-emoji.js +1 -1
- package/dist/components/ch-empty-state.js +1 -1
- package/dist/components/ch-grid.js +1 -1
- package/dist/components/ch-icon-button.js +1 -1
- package/dist/components/ch-icon.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-page-header.js +1 -1
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-segmented-control.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-skeleton.js +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-stack.js +1 -1
- package/dist/components/ch-stat.d.ts +11 -0
- package/dist/components/ch-stat.js +2 -0
- package/dist/components/ch-stat.js.map +1 -0
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-tabs.js +1 -1
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/ch-timeline.d.ts +11 -0
- package/dist/components/ch-timeline.js +2 -0
- package/dist/components/ch-timeline.js.map +1 -0
- package/dist/components/ch-tooltip.js +1 -1
- package/dist/components/ch-tooltip.js.map +1 -1
- package/dist/components/{p-CV0rD-fF.js → p-Cw0b4OGc.js} +2 -2
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +7 -7
- package/dist/esm/ch-checkbox.entry.js +1 -1
- package/dist/esm/ch-cluster.entry.js +2 -2
- package/dist/esm/ch-description-list.entry.js +27 -0
- package/dist/esm/ch-description-list.entry.js.map +1 -0
- package/dist/esm/ch-divider.entry.js +1 -1
- package/dist/esm/ch-drawer.entry.js +1 -1
- package/dist/esm/ch-emoji.entry.js +1 -1
- package/dist/esm/ch-empty-state.entry.js +1 -1
- package/dist/esm/ch-grid.entry.js +1 -1
- package/dist/esm/ch-icon-button.entry.js +1 -1
- package/dist/esm/ch-icon.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +1 -1
- package/dist/esm/ch-page-header.entry.js +1 -1
- package/dist/esm/ch-radio.entry.js +1 -1
- package/dist/esm/ch-segmented-control.entry.js +1 -1
- package/dist/esm/ch-skeleton.entry.js +1 -1
- package/dist/esm/ch-stack.entry.js +1 -1
- package/dist/esm/ch-stat.entry.js +44 -0
- package/dist/esm/ch-stat.entry.js.map +1 -0
- package/dist/esm/ch-tabs.entry.js +1 -1
- package/dist/esm/ch-textarea.entry.js +1 -1
- package/dist/esm/ch-timeline.entry.js +18 -0
- package/dist/esm/ch-timeline.entry.js.map +1 -0
- package/dist/esm/ch-tooltip.entry.js +6 -4
- package/dist/esm/ch-tooltip.entry.js.map +1 -1
- package/dist/esm/chucao.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ch-description-list/ch-description-list.d.ts +30 -0
- package/dist/types/components/ch-stat/ch-stat.d.ts +42 -0
- package/dist/types/components/ch-timeline/ch-timeline.d.ts +27 -0
- package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +4 -2
- package/dist/types/components.d.ts +312 -0
- package/dist-react/components.d.ts +9 -0
- package/dist-react/components.js +27 -0
- package/dist-react/components.ts +36 -0
- package/dist-vue/index.d.ts +3 -0
- package/dist-vue/index.js +13 -0
- package/dist-vue/index.ts +19 -0
- package/hydrate/index.js +200 -30
- package/hydrate/index.mjs +200 -30
- package/package.json +14 -2
- package/dist/chucao/p-2e785177.entry.js +0 -2
- package/dist/chucao/p-4846cac4.entry.js +0 -2
- package/dist/chucao/p-b6cc08f0.entry.js +0 -2
- /package/dist/chucao/{p-f5b74bca.entry.js.map → p-0409c063.entry.js.map} +0 -0
- /package/dist/chucao/{p-0bc141a2.entry.js.map → p-090d26f1.entry.js.map} +0 -0
- /package/dist/chucao/{p-f9fe752c.entry.js.map → p-207648f9.entry.js.map} +0 -0
- /package/dist/chucao/{p-9f73855e.entry.js.map → p-20ea1b18.entry.js.map} +0 -0
- /package/dist/chucao/{p-be7b5c21.entry.js.map → p-21ca2235.entry.js.map} +0 -0
- /package/dist/chucao/{p-fdf065e6.entry.js.map → p-2c1bc8bd.entry.js.map} +0 -0
- /package/dist/chucao/{p-6345c9e1.entry.js.map → p-50cbea7f.entry.js.map} +0 -0
- /package/dist/chucao/{p-c251b0d1.entry.js.map → p-7d4336bd.entry.js.map} +0 -0
- /package/dist/chucao/{p-957acf39.entry.js.map → p-81b6622f.entry.js.map} +0 -0
- /package/dist/chucao/{p-b53d954e.entry.js.map → p-925af6b8.entry.js.map} +0 -0
- /package/dist/chucao/{p-b6cc08f0.entry.js.map → p-95061461.entry.js.map} +0 -0
- /package/dist/chucao/{p-97655c41.entry.js.map → p-9794a3fa.entry.js.map} +0 -0
- /package/dist/chucao/{p-26e144ff.entry.js.map → p-b56f4a29.entry.js.map} +0 -0
- /package/dist/chucao/{p-c165f839.entry.js.map → p-b9b47942.entry.js.map} +0 -0
- /package/dist/chucao/{p-0e044eff.entry.js.map → p-c1b35f1b.entry.js.map} +0 -0
- /package/dist/chucao/{p-350f974d.entry.js.map → p-e6f959f4.entry.js.map} +0 -0
- /package/dist/chucao/{p-4846cac4.entry.js.map → p-f0aea6ed.entry.js.map} +0 -0
- /package/dist/chucao/{p-1108062e.entry.js.map → p-f7305552.entry.js.map} +0 -0
- /package/dist/components/{p-CV0rD-fF.js.map → p-Cw0b4OGc.js.map} +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
const COLUMNS = new Set(['1', '2', '3']);
|
|
3
|
+
/**
|
|
4
|
+
* Label/value pairs for detail views, on a native `<dl>`.
|
|
5
|
+
*
|
|
6
|
+
* The component renders the `<dl>` and the layout; the consumer writes the
|
|
7
|
+
* terms and descriptions. Group each pair in a `<div>` (valid HTML 5.2
|
|
8
|
+
* grouping) — the group is the grid item, which is what keeps a pair from
|
|
9
|
+
* splitting across columns:
|
|
10
|
+
*
|
|
11
|
+
* ```html
|
|
12
|
+
* <ch-description-list columns="2">
|
|
13
|
+
* <div><dt>Cliente</dt><dd>Aurora SpA</dd></div>
|
|
14
|
+
* <div><dt>Pedido</dt><dd>#1523</dd></div>
|
|
15
|
+
* </ch-description-list>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* The markup stays native in the light DOM, so the `term` role reaches the
|
|
19
|
+
* accessibility tree untouched — the shape decision on #81 measured that a
|
|
20
|
+
* custom wrapper adds nothing in Chromium while risking other browsers. No
|
|
21
|
+
* `ch-description-item` element exists for the same reason.
|
|
22
|
+
*/
|
|
23
|
+
export class ChDescriptionList {
|
|
24
|
+
/**
|
|
25
|
+
* How many pairs share a row on a wide viewport. One column is the stacked
|
|
26
|
+
* layout. An unknown value falls back to one column.
|
|
27
|
+
*/
|
|
28
|
+
columns = '1';
|
|
29
|
+
get columnCount() {
|
|
30
|
+
return COLUMNS.has(this.columns) ? this.columns : '1';
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return (h(Host, { key: 'd4905aeabf16e8c0798601a15e9115128c87f367' }, h("dl", { key: 'f2f85f1cdae61f0d5d8c007509ec75f21a9e69df', class: `list list--columns-${this.columnCount}` }, h("slot", { key: '60883fb5884ad38791c7ef811e4f3a0be6396e61' }))));
|
|
34
|
+
}
|
|
35
|
+
static get is() { return "ch-description-list"; }
|
|
36
|
+
static get encapsulation() { return "shadow"; }
|
|
37
|
+
static get originalStyleUrls() {
|
|
38
|
+
return {
|
|
39
|
+
"$": ["ch-description-list.css"]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
static get styleUrls() {
|
|
43
|
+
return {
|
|
44
|
+
"$": ["ch-description-list.css"]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static get properties() {
|
|
48
|
+
return {
|
|
49
|
+
"columns": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"mutable": false,
|
|
52
|
+
"complexType": {
|
|
53
|
+
"original": "ChDescriptionListColumns",
|
|
54
|
+
"resolved": "\"1\" | \"2\" | \"3\"",
|
|
55
|
+
"references": {
|
|
56
|
+
"ChDescriptionListColumns": {
|
|
57
|
+
"location": "local",
|
|
58
|
+
"path": "/home/runner/work/chucao/chucao/src/components/ch-description-list/ch-description-list.tsx",
|
|
59
|
+
"id": "src/components/ch-description-list/ch-description-list.tsx::ChDescriptionListColumns"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"required": false,
|
|
64
|
+
"optional": false,
|
|
65
|
+
"docs": {
|
|
66
|
+
"tags": [],
|
|
67
|
+
"text": "How many pairs share a row on a wide viewport. One column is the stacked\nlayout. An unknown value falls back to one column."
|
|
68
|
+
},
|
|
69
|
+
"getter": false,
|
|
70
|
+
"setter": false,
|
|
71
|
+
"reflect": false,
|
|
72
|
+
"attribute": "columns",
|
|
73
|
+
"defaultValue": "'1'"
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=ch-description-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-description-list.js","sourceRoot":"","sources":["../../../../src/components/ch-description-list/ch-description-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIzD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,MAAM,OAAO,iBAAiB;IAC5B;;;OAGG;IACK,OAAO,GAA6B,GAAG,CAAC;IAEhD,IAAY,WAAW;QACrB,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IACxD,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,2DAAI,KAAK,EAAE,sBAAsB,IAAI,CAAC,WAAW,EAAE;gBACjD,8DAAa,CACV,CACA,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
|
|
@@ -5,7 +5,7 @@ export class ChDivider {
|
|
|
5
5
|
*/
|
|
6
6
|
orientation = 'horizontal';
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: 'c18cffa051e3fde189ed358a748e58d0af534357', class: { 'divider--vertical': this.orientation === 'vertical' } }, h("hr", { key: '2a6fe2c3a2b61eecd03e0b5d2830695328e77453', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "ch-divider"; }
|
|
11
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -145,7 +145,7 @@ export class ChDrawer {
|
|
|
145
145
|
if (!this.label) {
|
|
146
146
|
warnMissingName(this.el, 'ch-drawer', 'pass label with the same text as the header');
|
|
147
147
|
}
|
|
148
|
-
return (h(Host, { key: '
|
|
148
|
+
return (h(Host, { key: 'a0406608e57614c79a23673f040191e2d94cdd48' }, h("dialog", { key: '84072ff1a87f1033c5b4911089c8c0819fe087ea', class: { drawer: true, [`drawer--${this.side}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, h("div", { key: '57cddba1e04471dc6d0fe6e86311c38bb4329969', class: "drawer-head" }, h("slot", { key: 'b77179dec88ae4d1b9975b7e6b16184a8aa8bb79', name: "header" }), this.closeLabel && (h("button", { key: '88daedc7a80418e3480b577639e80ef31ff02486', class: "drawer-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, h("span", { key: 'e5bb3e74f1b4365b0e32e2b8e70bdc46ac882c78', "aria-hidden": "true" }, "\u00D7")))), h("div", { key: 'd81831510dd6a0d9e97eddffac99bc0689bf3d31', class: "drawer-body" }, h("slot", { key: 'f3d72a55ad19021369e117ec5bf9693bc6d72c85' })), h("slot", { key: '339e8989a2ea9f580a756ff89e10c40e55904c11', name: "footer" }))));
|
|
149
149
|
}
|
|
150
150
|
static get is() { return "ch-drawer"; }
|
|
151
151
|
static get encapsulation() { return "shadow"; }
|
|
@@ -49,7 +49,7 @@ export class ChEmoji {
|
|
|
49
49
|
this.loaded = true;
|
|
50
50
|
};
|
|
51
51
|
render() {
|
|
52
|
-
return (h(Host, { key: '
|
|
52
|
+
return (h(Host, { key: '4a5c5b2a917227ab3fb9aabe560718a84dd17730' }, h("img", { key: 'dbc09e58cd1a6ce899ce82dd1ec13ba15955b4ad', class: {
|
|
53
53
|
'emoji': true,
|
|
54
54
|
[`emoji--${this.size}`]: true,
|
|
55
55
|
'emoji--hidden': !this.loaded,
|
|
@@ -22,7 +22,7 @@ export class ChEmptyState {
|
|
|
22
22
|
*/
|
|
23
23
|
size = 'md';
|
|
24
24
|
render() {
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '73a168213e3f62b73d859dd6e1ad35eff6694746', class: { 'empty-state': true, [`empty-state--${this.size}`]: true } }, h("div", { key: '81bbad48af38acd640a67673132773a66d06c35b', class: "empty-state__inner" }, h("div", { key: '1f9f8953beba68951163a5081ada1254ee6de61c', class: "empty-state__icon", "aria-hidden": "true" }, h("slot", { key: '70c2b38f1a780b4c39a676d6b4cf4fe9d80a45c5', name: "icon" })), h("h3", { key: '964501021ac65c7edb96c60b9e6f6dc7aece2ebe', class: "empty-state__title" }, this.title), this.description && h("p", { key: 'a6effa9b7a24875938fc18ee9e6a7acf1c35b0ba', class: "empty-state__description" }, this.description), h("div", { key: '0052d3c169569b96ee73b481f44b669715f90771', class: "empty-state__actions" }, h("slot", { key: '3fa51fed8e5f49e02a9f588a3c0577ce9c2c5797' })))));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "ch-empty-state"; }
|
|
28
28
|
static get encapsulation() { return "shadow"; }
|
|
@@ -48,7 +48,7 @@ export class ChGrid {
|
|
|
48
48
|
this.el.style.setProperty('--ch-grid-columns', template);
|
|
49
49
|
}
|
|
50
50
|
render() {
|
|
51
|
-
return (h(Host, { key: '
|
|
51
|
+
return (h(Host, { key: '09a37640189b353bd109bce97ad684396f91a06d', class: { grid: true, [`grid--gap-${this.gapStep}`]: true } }, h("slot", { key: 'e309fee76ea499e4c3b22082218d12fc94cb8fb8' })));
|
|
52
52
|
}
|
|
53
53
|
static get is() { return "ch-grid"; }
|
|
54
54
|
static get encapsulation() { return "shadow"; }
|
|
@@ -28,7 +28,7 @@ export class ChIcon {
|
|
|
28
28
|
render() {
|
|
29
29
|
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
30
30
|
const decorative = !this.label;
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: 'c5f0c415136db62b88cfdd17b1535ccabda92060' }, h("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: decorative ? undefined : 'img', "aria-label": this.label, "aria-hidden": decorative ? 'true' : undefined, focusable: "false" }, (shapes ?? []).map(shape => h(shape.tag, shape.attrs)))));
|
|
32
32
|
}
|
|
33
33
|
static get is() { return "ch-icon"; }
|
|
34
34
|
static get encapsulation() { return "shadow"; }
|
|
@@ -40,7 +40,7 @@ export class ChIconButton {
|
|
|
40
40
|
};
|
|
41
41
|
render() {
|
|
42
42
|
const shapes = this.name ? chIcons[this.name] : undefined;
|
|
43
|
-
return (h(Host, { key: '
|
|
43
|
+
return (h(Host, { key: '201ad628b28588bdf40baf822abc60b2c8b7c6f2' }, h("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 }, h("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" }, (shapes ?? []).map(shape => h(shape.tag, shape.attrs))))));
|
|
44
44
|
}
|
|
45
45
|
static get is() { return "ch-icon-button"; }
|
|
46
46
|
static get encapsulation() { return "shadow"; }
|
|
@@ -107,7 +107,7 @@ export class ChInput {
|
|
|
107
107
|
return undefined;
|
|
108
108
|
}
|
|
109
109
|
render() {
|
|
110
|
-
return (h(Host, { key: '
|
|
110
|
+
return (h(Host, { key: 'd85d2773a340ee1a46f7f76a0d287ff1194d0e0b' }, this.label && (h("label", { key: '9ad19457232c703a59eab1062e12c17e8c2b8327', class: "label", htmlFor: this.inputId }, this.label)), h("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) && (h("p", { key: '31bdbb81ba537cc7d84b8cf7fc24055890b9b000', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '50a7cb03654f5deaa70af64ee14d774e94f77816', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
111
111
|
}
|
|
112
112
|
static get is() { return "ch-input"; }
|
|
113
113
|
static get encapsulation() { return "shadow"; }
|
|
@@ -152,7 +152,7 @@ export class ChModal {
|
|
|
152
152
|
if (!this.label) {
|
|
153
153
|
warnMissingName(this.el, 'ch-modal', 'pass label with the same text as the heading');
|
|
154
154
|
}
|
|
155
|
-
return (h(Host, { key: '
|
|
155
|
+
return (h(Host, { key: '01e01a6927352410f85cb7022aa653482e52f010' }, h("dialog", { key: '166798e913c662fad6c517d3c5ac957b3d9a44cf', class: { modal: true, [`modal--${this.size}`]: true }, "aria-label": this.label, ref: el => (this.dialog = el) }, h("div", { key: '3d0766206306e7efe1c613313a99d049aea168ef', class: "modal-head" }, h("slot", { key: '9b50ec72180b64e7eef52dab2f9246eee1cbe788', name: "heading" }), this.closeLabel && (h("button", { key: 'd6c375363d9debb0c3858bb0dc1a67c816b24442', class: "modal-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, h("span", { key: '128216aa8fca200775cd7ab28b23555bd516d1db', "aria-hidden": "true" }, "\u00D7")))), h("div", { key: 'eebabfd71be502cc99e8337526cd31d4406d5eb8', class: "modal-body" }, h("slot", { key: '1bbc38d606a23c6b499a80a6695a1ee6334c414f' })))));
|
|
156
156
|
}
|
|
157
157
|
static get is() { return "ch-modal"; }
|
|
158
158
|
static get encapsulation() { return "shadow"; }
|
|
@@ -37,7 +37,7 @@ export class ChPageHeader {
|
|
|
37
37
|
actionsStacked = false;
|
|
38
38
|
render() {
|
|
39
39
|
const Heading = this.headingLevel;
|
|
40
|
-
return (h(Host, { key: '
|
|
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
41
|
}
|
|
42
42
|
static get is() { return "ch-page-header"; }
|
|
43
43
|
static get encapsulation() { return "shadow"; }
|
|
@@ -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"; }
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
font-family: var(--typography-body);
|
|
4
|
+
color: var(--color-text-secondary);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host([hidden]) {
|
|
8
|
+
display: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.list {
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
display: grid;
|
|
15
|
+
gap: var(--spacing-md);
|
|
16
|
+
/* Reserve the rail: every item indents past its marker. */
|
|
17
|
+
list-style: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Each slotted item indents past its dot; pseudo-elements on slotted
|
|
21
|
+
* content are part of the shadow stylesheet's remit here. */
|
|
22
|
+
::slotted(li) {
|
|
23
|
+
position: relative;
|
|
24
|
+
padding-left: var(--spacing-2xl);
|
|
25
|
+
min-width: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* The marker dot, vertically on the item's first line. */
|
|
29
|
+
::slotted(li)::before {
|
|
30
|
+
content: '';
|
|
31
|
+
position: absolute;
|
|
32
|
+
left: 0;
|
|
33
|
+
top: 0.35em;
|
|
34
|
+
width: var(--spacing-sm);
|
|
35
|
+
height: var(--spacing-sm);
|
|
36
|
+
border-radius: 50%;
|
|
37
|
+
background: var(--color-border-default);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* The connector to the next item; the last item never gets one, so the
|
|
41
|
+
* timeline does not trail off into nothing. */
|
|
42
|
+
::slotted(li:not(:last-of-type))::after {
|
|
43
|
+
content: '';
|
|
44
|
+
position: absolute;
|
|
45
|
+
left: calc(var(--spacing-sm) / 2 - var(--border-width));
|
|
46
|
+
top: calc(0.35em + var(--spacing-sm));
|
|
47
|
+
bottom: calc(0px - var(--spacing-md));
|
|
48
|
+
width: var(--border-width);
|
|
49
|
+
background: var(--color-border-default);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
::slotted(time) {
|
|
53
|
+
font-variant-numeric: tabular-nums;
|
|
54
|
+
}
|