@devschile/chucao 1.4.0 → 1.5.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 +3 -0
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/{p-438e1401.entry.js → p-12e02f8e.entry.js} +2 -2
- package/dist/chucao/{p-7413b8c3.entry.js → p-21fa1897.entry.js} +2 -2
- package/dist/chucao/p-5c5048cf.entry.js +2 -0
- package/dist/chucao/p-5c5048cf.entry.js.map +1 -0
- package/dist/chucao/p-5df14f4b.entry.js +2 -0
- package/dist/chucao/p-5df14f4b.entry.js.map +1 -0
- package/dist/chucao/p-5e0ba154.entry.js +2 -0
- package/dist/chucao/p-5e0ba154.entry.js.map +1 -0
- package/dist/chucao/p-C_GZnvOi.js +3 -0
- package/dist/chucao/p-C_GZnvOi.js.map +1 -0
- package/dist/chucao/{p-1f47dd08.entry.js → p-bd015077.entry.js} +2 -2
- package/dist/chucao/p-ca96fa8a.entry.js +2 -0
- package/dist/chucao/p-ca96fa8a.entry.js.map +1 -0
- package/dist/chucao/{p-90db80a2.entry.js → p-ccae6c46.entry.js} +2 -2
- package/dist/chucao/{p-faa21ce0.entry.js → p-ecf098bb.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +48 -0
- package/dist/cjs/ch-accordion.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-badge_5.cjs.entry.js +6 -6
- package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ch-divider.cjs.entry.js +24 -0
- package/dist/cjs/ch-divider.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-link.cjs.entry.js +49 -0
- package/dist/cjs/ch-link.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-radio.cjs.entry.js +2 -2
- package/dist/cjs/ch-switch.cjs.entry.js +2 -2
- package/dist/cjs/ch-tabs.cjs.entry.js +100 -0
- package/dist/cjs/ch-tabs.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
- package/dist/cjs/chucao.cjs.js +2 -2
- package/dist/cjs/{index-DX3RZKi8.js → index-Ha3VDOML.js} +32 -3
- package/dist/cjs/index-Ha3VDOML.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/ch-accordion/ch-accordion.css +72 -0
- package/dist/collection/components/ch-accordion/ch-accordion.js +111 -0
- package/dist/collection/components/ch-accordion/ch-accordion.js.map +1 -0
- package/dist/collection/components/ch-badge/ch-badge.js +1 -1
- package/dist/collection/components/ch-button/ch-button.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-divider/ch-divider.css +25 -0
- package/dist/collection/components/ch-divider/ch-divider.js +53 -0
- package/dist/collection/components/ch-divider/ch-divider.js.map +1 -0
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-link/ch-link.css +40 -0
- package/dist/collection/components/ch-link/ch-link.js +158 -0
- package/dist/collection/components/ch-link/ch-link.js.map +1 -0
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-switch/ch-switch.js +1 -1
- package/dist/collection/components/ch-tabs/ch-tabs.css +69 -0
- package/dist/collection/components/ch-tabs/ch-tabs.js +182 -0
- package/dist/collection/components/ch-tabs/ch-tabs.js.map +1 -0
- package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
- package/dist/components/ch-accordion.d.ts +11 -0
- package/dist/components/ch-accordion.js +2 -0
- package/dist/components/ch-accordion.js.map +1 -0
- package/dist/components/ch-badge.js +1 -1
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-divider.d.ts +11 -0
- package/dist/components/ch-divider.js +2 -0
- package/dist/components/ch-divider.js.map +1 -0
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-link.d.ts +11 -0
- package/dist/components/ch-link.js +2 -0
- package/dist/components/ch-link.js.map +1 -0
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-switch.js +1 -1
- package/dist/components/ch-tabs.d.ts +11 -0
- package/dist/components/ch-tabs.js +2 -0
- package/dist/components/ch-tabs.js.map +1 -0
- package/dist/components/ch-textarea.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-C3Jfy_hI.js +2 -0
- package/dist/components/p-C3Jfy_hI.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +46 -0
- package/dist/esm/ch-accordion.entry.js.map +1 -0
- package/dist/esm/ch-badge_5.entry.js +6 -6
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-divider.entry.js +22 -0
- package/dist/esm/ch-divider.entry.js.map +1 -0
- package/dist/esm/ch-link.entry.js +47 -0
- package/dist/esm/ch-link.entry.js.map +1 -0
- package/dist/esm/ch-radio.entry.js +2 -2
- package/dist/esm/ch-switch.entry.js +2 -2
- package/dist/esm/ch-tabs.entry.js +98 -0
- package/dist/esm/ch-tabs.entry.js.map +1 -0
- package/dist/esm/ch-textarea.entry.js +2 -2
- package/dist/esm/chucao.js +3 -3
- package/dist/esm/{index-Bk9pvIKL.js → index-C_GZnvOi.js} +32 -3
- package/dist/esm/index-C_GZnvOi.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-accordion/ch-accordion.d.ts +25 -0
- package/dist/types/components/ch-divider/ch-divider.d.ts +8 -0
- package/dist/types/components/ch-link/ch-link.d.ts +28 -0
- package/dist/types/components/ch-tabs/ch-tabs.d.ts +34 -0
- package/dist/types/components.d.ts +223 -0
- package/dist-react/components.d.ts +19 -1
- package/dist-react/components.js +36 -0
- package/dist-react/components.ts +49 -1
- package/dist-vue/index.d.ts +4 -0
- package/dist-vue/index.js +31 -0
- package/dist-vue/index.ts +39 -0
- package/package.json +1 -1
- package/dist/chucao/p-Bk9pvIKL.js +0 -3
- package/dist/chucao/p-Bk9pvIKL.js.map +0 -1
- package/dist/cjs/index-DX3RZKi8.js.map +0 -1
- package/dist/components/p-CcEsJ4Ml.js +0 -2
- package/dist/components/p-CcEsJ4Ml.js.map +0 -1
- package/dist/esm/index-Bk9pvIKL.js.map +0 -1
- /package/dist/chucao/{p-438e1401.entry.js.map → p-12e02f8e.entry.js.map} +0 -0
- /package/dist/chucao/{p-7413b8c3.entry.js.map → p-21fa1897.entry.js.map} +0 -0
- /package/dist/chucao/{p-1f47dd08.entry.js.map → p-bd015077.entry.js.map} +0 -0
- /package/dist/chucao/{p-90db80a2.entry.js.map → p-ccae6c46.entry.js.map} +0 -0
- /package/dist/chucao/{p-faa21ce0.entry.js.map → p-ecf098bb.entry.js.map} +0 -0
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Ha3VDOML.js');
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await index.globalScripts();
|
|
8
|
-
return index.bootstrapLazy([["ch-badge_5.cjs",[[769,"ch-badge",{"variant":[1]}],[769,"ch-button",{"variant":[1],"disabled":[4],"label":[1]}],[257,"ch-card"],[513,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}],[513,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-checkbox.cjs",[[513,"ch-checkbox",{"label":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-radio.cjs",[[513,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-switch.cjs",[[513,"ch-switch",{"label":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-textarea.cjs",[[513,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]]], options);
|
|
8
|
+
return index.bootstrapLazy([["ch-badge_5.cjs",[[769,"ch-badge",{"variant":[1]}],[769,"ch-button",{"variant":[1],"disabled":[4],"label":[1]}],[257,"ch-card"],[513,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}],[513,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[513,"ch-checkbox",{"label":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-radio.cjs",[[513,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-switch.cjs",[[513,"ch-switch",{"label":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[513,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
exports.setNonce = index.setNonce;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
"components/ch-accordion/ch-accordion.js",
|
|
3
4
|
"components/ch-badge/ch-badge.js",
|
|
4
5
|
"components/ch-button/ch-button.js",
|
|
6
|
+
"components/ch-divider/ch-divider.js",
|
|
7
|
+
"components/ch-link/ch-link.js",
|
|
5
8
|
"components/ch-radio/ch-radio.js",
|
|
6
9
|
"components/ch-select/ch-select.js",
|
|
10
|
+
"components/ch-tabs/ch-tabs.js",
|
|
7
11
|
"components/ch-card/ch-card.js",
|
|
8
12
|
"components/ch-checkbox/ch-checkbox.js",
|
|
9
13
|
"components/ch-input/ch-input.js",
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.item {
|
|
6
|
+
background: var(--surface);
|
|
7
|
+
border: var(--border-width) solid var(--border);
|
|
8
|
+
border-radius: var(--radius);
|
|
9
|
+
transition: border-color var(--duration-normal) var(--easing-default);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.item + .item {
|
|
13
|
+
margin-top: var(--spacing-md);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.item--open {
|
|
17
|
+
border-color: var(--border-hover);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.item-head {
|
|
21
|
+
margin: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.item-toggle {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
gap: var(--spacing-lg);
|
|
29
|
+
width: 100%;
|
|
30
|
+
padding: var(--spacing-2xl) var(--spacing-3xl);
|
|
31
|
+
background: transparent;
|
|
32
|
+
border: none;
|
|
33
|
+
color: var(--text);
|
|
34
|
+
font-family: inherit;
|
|
35
|
+
font-size: inherit;
|
|
36
|
+
font-weight: var(--typography-weight-semibold);
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.item-toggle::after {
|
|
41
|
+
content: '';
|
|
42
|
+
width: var(--spacing-md);
|
|
43
|
+
height: var(--spacing-md);
|
|
44
|
+
flex-shrink: 0;
|
|
45
|
+
border-right: var(--border-width) solid var(--text-muted);
|
|
46
|
+
border-bottom: var(--border-width) solid var(--text-muted);
|
|
47
|
+
transform: rotate(45deg);
|
|
48
|
+
transition: transform var(--duration-normal) var(--easing-default);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.item--open .item-toggle::after {
|
|
52
|
+
transform: rotate(-135deg);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.item-toggle:focus-visible {
|
|
56
|
+
outline: var(--focus-outline-width) solid var(--accent);
|
|
57
|
+
outline-offset: var(--focus-outline-offset);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.item-toggle:disabled {
|
|
61
|
+
opacity: var(--opacity-disabled);
|
|
62
|
+
cursor: not-allowed;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.item-panel {
|
|
66
|
+
padding: 0 var(--spacing-3xl) var(--spacing-3xl);
|
|
67
|
+
color: var(--text-muted);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.item-panel[hidden] {
|
|
71
|
+
display: none;
|
|
72
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
let accordionIds = 0;
|
|
3
|
+
export class ChAccordion {
|
|
4
|
+
baseId = `ch-accordion-${++accordionIds}`;
|
|
5
|
+
/**
|
|
6
|
+
* The list of items, each with a `title`, a `value`, and an optional `disabled` flag.
|
|
7
|
+
*/
|
|
8
|
+
items = [];
|
|
9
|
+
/**
|
|
10
|
+
* The value of the currently open item. When unset, no item is open.
|
|
11
|
+
*/
|
|
12
|
+
value;
|
|
13
|
+
/**
|
|
14
|
+
* Emitted when the open item changes, with the new value (`undefined` when all items are closed).
|
|
15
|
+
*/
|
|
16
|
+
chChange;
|
|
17
|
+
headerId(value) {
|
|
18
|
+
return `${this.baseId}-${value}-header`;
|
|
19
|
+
}
|
|
20
|
+
panelId(value) {
|
|
21
|
+
return `${this.baseId}-${value}-panel`;
|
|
22
|
+
}
|
|
23
|
+
toggle = (value) => {
|
|
24
|
+
this.value = this.value === value ? undefined : value;
|
|
25
|
+
this.chChange.emit(this.value);
|
|
26
|
+
};
|
|
27
|
+
render() {
|
|
28
|
+
return (h(Host, { key: 'a0b6859c9efc45b158825f2b44aab73a5eb63f0b' }, this.items.map(item => {
|
|
29
|
+
const open = this.value === item.value;
|
|
30
|
+
return (h("div", { key: item.value, class: { 'item': true, 'item--open': open } }, h("h3", { class: "item-head" }, h("button", { type: "button", class: "item-toggle", id: this.headerId(item.value), "data-value": item.value, "aria-expanded": open ? 'true' : 'false', "aria-controls": this.panelId(item.value), disabled: item.disabled, onClick: () => this.toggle(item.value) }, item.title)), h("div", { class: "item-panel", id: this.panelId(item.value), role: "region", "aria-labelledby": this.headerId(item.value), hidden: !open }, h("slot", { name: `panel-${item.value}` }))));
|
|
31
|
+
})));
|
|
32
|
+
}
|
|
33
|
+
static get is() { return "ch-accordion"; }
|
|
34
|
+
static get encapsulation() { return "shadow"; }
|
|
35
|
+
static get originalStyleUrls() {
|
|
36
|
+
return {
|
|
37
|
+
"$": ["ch-accordion.css"]
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
static get styleUrls() {
|
|
41
|
+
return {
|
|
42
|
+
"$": ["ch-accordion.css"]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
static get properties() {
|
|
46
|
+
return {
|
|
47
|
+
"items": {
|
|
48
|
+
"type": "unknown",
|
|
49
|
+
"mutable": false,
|
|
50
|
+
"complexType": {
|
|
51
|
+
"original": "ChAccordionItem[]",
|
|
52
|
+
"resolved": "ChAccordionItem[]",
|
|
53
|
+
"references": {
|
|
54
|
+
"ChAccordionItem": {
|
|
55
|
+
"location": "local",
|
|
56
|
+
"path": "/home/runner/work/chucao/chucao/src/components/ch-accordion/ch-accordion.tsx",
|
|
57
|
+
"id": "src/components/ch-accordion/ch-accordion.tsx::ChAccordionItem"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": false,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": "The list of items, each with a `title`, a `value`, and an optional `disabled` flag."
|
|
66
|
+
},
|
|
67
|
+
"getter": false,
|
|
68
|
+
"setter": false,
|
|
69
|
+
"defaultValue": "[]"
|
|
70
|
+
},
|
|
71
|
+
"value": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"mutable": true,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "string",
|
|
76
|
+
"resolved": "string",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": true,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": "The value of the currently open item. When unset, no item is open."
|
|
84
|
+
},
|
|
85
|
+
"getter": false,
|
|
86
|
+
"setter": false,
|
|
87
|
+
"reflect": false,
|
|
88
|
+
"attribute": "value"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
static get events() {
|
|
93
|
+
return [{
|
|
94
|
+
"method": "chChange",
|
|
95
|
+
"name": "chChange",
|
|
96
|
+
"bubbles": true,
|
|
97
|
+
"cancelable": true,
|
|
98
|
+
"composed": true,
|
|
99
|
+
"docs": {
|
|
100
|
+
"tags": [],
|
|
101
|
+
"text": "Emitted when the open item changes, with the new value (`undefined` when all items are closed)."
|
|
102
|
+
},
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "string | undefined",
|
|
105
|
+
"resolved": "string",
|
|
106
|
+
"references": {}
|
|
107
|
+
}
|
|
108
|
+
}];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=ch-accordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-accordion.js","sourceRoot":"","sources":["../../../../src/components/ch-accordion/ch-accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQnF,IAAI,YAAY,GAAG,CAAC,CAAC;AAOrB,MAAM,OAAO,WAAW;IACL,MAAM,GAAG,gBAAgB,EAAE,YAAY,EAAE,CAAC;IAE3D;;OAEG;IACK,KAAK,GAAsB,EAAE,CAAC;IAEtC;;OAEG;IACsB,KAAK,CAAU;IAExC;;OAEG;IACM,QAAQ,CAAmC;IAE5C,QAAQ,CAAC,KAAa;QAC5B,OAAO,GAAG,IAAI,CAAC,MAAM,IAAI,KAAK,SAAS,CAAC;IAC1C,CAAC;IAEO,OAAO,CAAC,KAAa;QAC3B,OAAO,GAAG,IAAI,CAAC,MAAM,IAAI,KAAK,QAAQ,CAAC;IACzC,CAAC;IAEO,MAAM,GAAG,CAAC,KAAa,EAAE,EAAE;QACjC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;QACtD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC,CAAC;IAEF,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,uDACF,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACrB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC;YACvC,OAAO,CACL,WAAK,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE;gBAC/D,UAAI,KAAK,EAAC,WAAW;oBACnB,cACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,aAAa,EACnB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,gBACjB,IAAI,CAAC,KAAK,mBACP,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,mBACvB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EACvC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAErC,IAAI,CAAC,KAAK,CACJ,CACN;gBACL,WAAK,KAAK,EAAC,YAAY,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,QAAQ,qBAAkB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,IAAI;oBAC3H,YAAM,IAAI,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE,GAAS,CACtC,CACF,CACP,CAAC;QACJ,CAAC,CAAC,CACG,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nexport interface ChAccordionItem {\n title: string;\n value: string;\n disabled?: boolean;\n}\n\nlet accordionIds = 0;\n\n@Component({\n tag: 'ch-accordion',\n styleUrl: 'ch-accordion.css',\n shadow: true,\n})\nexport class ChAccordion {\n private readonly baseId = `ch-accordion-${++accordionIds}`;\n\n /**\n * The list of items, each with a `title`, a `value`, and an optional `disabled` flag.\n */\n @Prop() items: ChAccordionItem[] = [];\n\n /**\n * The value of the currently open item. When unset, no item is open.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * Emitted when the open item changes, with the new value (`undefined` when all items are closed).\n */\n @Event() chChange: EventEmitter<string | undefined>;\n\n private headerId(value: string) {\n return `${this.baseId}-${value}-header`;\n }\n\n private panelId(value: string) {\n return `${this.baseId}-${value}-panel`;\n }\n\n private toggle = (value: string) => {\n this.value = this.value === value ? undefined : value;\n this.chChange.emit(this.value);\n };\n\n render() {\n return (\n <Host>\n {this.items.map(item => {\n const open = this.value === item.value;\n return (\n <div key={item.value} class={{ 'item': true, 'item--open': open }}>\n <h3 class=\"item-head\">\n <button\n type=\"button\"\n class=\"item-toggle\"\n id={this.headerId(item.value)}\n data-value={item.value}\n aria-expanded={open ? 'true' : 'false'}\n aria-controls={this.panelId(item.value)}\n disabled={item.disabled}\n onClick={() => this.toggle(item.value)}\n >\n {item.title}\n </button>\n </h3>\n <div class=\"item-panel\" id={this.panelId(item.value)} role=\"region\" aria-labelledby={this.headerId(item.value)} hidden={!open}>\n <slot name={`panel-${item.value}`}></slot>\n </div>\n </div>\n );\n })}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -5,7 +5,7 @@ export class ChBadge {
|
|
|
5
5
|
*/
|
|
6
6
|
variant = 'default';
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: 'c0acd8486b8265884b3c4a2a5a68bf10098a09cd' }, h("span", { key: '2ae6af3f7ac4c6967dc6eefe607b3910ba341741', class: { badge: true, [`badge--${this.variant}`]: true } }, h("slot", { key: '2aab4bb7e25492dc01cb94cf055efde3897f736b' }))));
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "ch-badge"; }
|
|
11
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -22,7 +22,7 @@ export class ChButton {
|
|
|
22
22
|
this.chClick.emit(ev);
|
|
23
23
|
};
|
|
24
24
|
render() {
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '1fc74b55b6d69be97fba63f0fb2d72ffd217eafb' }, h("button", { key: 'af6721f9eb066f7e0cb7a23031d43eb46fbbdf9e', class: { btn: true, [`btn--${this.variant}`]: true }, type: "button", disabled: this.disabled, "aria-label": this.label, onClick: this.handleClick }, h("slot", { key: '2c42b74352aa7a79ac6bc231cdd828b7a62f5083' }))));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "ch-button"; }
|
|
28
28
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class ChCard {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: '89781abc150f0078e9d36233f02d2bb29f3d2cc1' }, h("div", { key: '41271ca28fd5c045a4dad746ec7e2c7264a35aac', class: "card" }, h("slot", { key: '1786ea797968b94fc48de08836fc0195b0731469' }))));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "ch-card"; }
|
|
7
7
|
static get encapsulation() { return "shadow"; }
|
|
@@ -60,7 +60,7 @@ export class ChCheckbox {
|
|
|
60
60
|
return undefined;
|
|
61
61
|
}
|
|
62
62
|
render() {
|
|
63
|
-
return (h(Host, { key: '
|
|
63
|
+
return (h(Host, { key: '746f0c29ea01a3a0c24360d964b3c0d65985f941' }, h("label", { key: '9e423a2055ec4e2d77848b7c4b86cb200315a77d', class: { 'control': true, 'control--disabled': this.disabled }, htmlFor: this.checkboxId }, h("input", { key: 'b355914b0b02c9887f93e2a50fcebaf60b21d5bb', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && h("span", { key: '6f7128ccac345af5c9224c0388f960575aebc150', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '402417ceee995e578248307a24ba6f9b1955bda8', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '281930b92221157759d3652391b0cdc337a1f25d', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
64
64
|
}
|
|
65
65
|
static get is() { return "ch-checkbox"; }
|
|
66
66
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
:host(.divider--vertical) {
|
|
6
|
+
display: inline-block;
|
|
7
|
+
height: 100%;
|
|
8
|
+
align-self: stretch;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.divider {
|
|
12
|
+
margin: 0;
|
|
13
|
+
border: none;
|
|
14
|
+
background: var(--border);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.divider--horizontal {
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: var(--border-width);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.divider--vertical {
|
|
23
|
+
width: var(--border-width);
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class ChDivider {
|
|
3
|
+
/**
|
|
4
|
+
* The orientation of the divider. Either `horizontal` (default) or `vertical`.
|
|
5
|
+
*/
|
|
6
|
+
orientation = 'horizontal';
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, { key: '30ad155d178afd93745eb4072a2d9a8012705191', class: { 'divider--vertical': this.orientation === 'vertical' } }, h("hr", { key: 'ce239ccdebec97a2735e14ad62b81d14888881a5', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
|
|
9
|
+
}
|
|
10
|
+
static get is() { return "ch-divider"; }
|
|
11
|
+
static get encapsulation() { return "shadow"; }
|
|
12
|
+
static get originalStyleUrls() {
|
|
13
|
+
return {
|
|
14
|
+
"$": ["ch-divider.css"]
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
static get styleUrls() {
|
|
18
|
+
return {
|
|
19
|
+
"$": ["ch-divider.css"]
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
static get properties() {
|
|
23
|
+
return {
|
|
24
|
+
"orientation": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"mutable": false,
|
|
27
|
+
"complexType": {
|
|
28
|
+
"original": "ChDividerOrientation",
|
|
29
|
+
"resolved": "\"horizontal\" | \"vertical\"",
|
|
30
|
+
"references": {
|
|
31
|
+
"ChDividerOrientation": {
|
|
32
|
+
"location": "local",
|
|
33
|
+
"path": "/home/runner/work/chucao/chucao/src/components/ch-divider/ch-divider.tsx",
|
|
34
|
+
"id": "src/components/ch-divider/ch-divider.tsx::ChDividerOrientation"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"required": false,
|
|
39
|
+
"optional": false,
|
|
40
|
+
"docs": {
|
|
41
|
+
"tags": [],
|
|
42
|
+
"text": "The orientation of the divider. Either `horizontal` (default) or `vertical`."
|
|
43
|
+
},
|
|
44
|
+
"getter": false,
|
|
45
|
+
"setter": false,
|
|
46
|
+
"reflect": false,
|
|
47
|
+
"attribute": "orientation",
|
|
48
|
+
"defaultValue": "'horizontal'"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=ch-divider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-divider.js","sourceRoot":"","sources":["../../../../src/components/ch-divider/ch-divider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AASzD,MAAM,OAAO,SAAS;IACpB;;OAEG;IACK,WAAW,GAAyB,YAAY,CAAC;IAEzD,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,KAAK,EAAE,EAAE,mBAAmB,EAAE,IAAI,CAAC,WAAW,KAAK,UAAU,EAAE;YACnE,2DAAI,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,YAAY,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAoB,IAAI,CAAC,WAAW,GAAI,CACvG,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChDividerOrientation = 'horizontal' | 'vertical';\n\n@Component({\n tag: 'ch-divider',\n styleUrl: 'ch-divider.css',\n shadow: true,\n})\nexport class ChDivider {\n /**\n * The orientation of the divider. Either `horizontal` (default) or `vertical`.\n */\n @Prop() orientation: ChDividerOrientation = 'horizontal';\n\n render() {\n return (\n <Host class={{ 'divider--vertical': this.orientation === 'vertical' }}>\n <hr class={{ divider: true, [`divider--${this.orientation}`]: true }} aria-orientation={this.orientation} />\n </Host>\n );\n }\n}\n"]}
|
|
@@ -72,7 +72,7 @@ export class ChInput {
|
|
|
72
72
|
return undefined;
|
|
73
73
|
}
|
|
74
74
|
render() {
|
|
75
|
-
return (h(Host, { key: '
|
|
75
|
+
return (h(Host, { key: '82557c17d49bf048b7056853a088565a243325be' }, this.label && (h("label", { key: 'cc774b0001daa6c7f4e4bb8d62ea21698bd744e9', class: "label", htmlFor: this.inputId }, this.label)), h("input", { key: 'dc30d9f798611a0a4bb577c18a2696d065a281ee', 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, 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: '21b76002a309dfe167e671fd270699f8699ed6b9', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: 'be64956da00a76dccdbf0979f3352b263a21fb12', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
76
76
|
}
|
|
77
77
|
static get is() { return "ch-input"; }
|
|
78
78
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.link {
|
|
6
|
+
color: var(--accent);
|
|
7
|
+
font-weight: var(--typography-weight-semibold);
|
|
8
|
+
text-decoration: underline;
|
|
9
|
+
text-decoration-thickness: var(--border-width);
|
|
10
|
+
text-underline-offset: var(--spacing-shift);
|
|
11
|
+
border-radius: var(--radius-sm);
|
|
12
|
+
transition:
|
|
13
|
+
color var(--duration-normal) var(--easing-default),
|
|
14
|
+
opacity var(--duration-normal) var(--easing-default);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.link:hover {
|
|
18
|
+
color: var(--accent-hover);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.link:focus-visible {
|
|
22
|
+
outline: var(--focus-outline-width) solid var(--accent);
|
|
23
|
+
outline-offset: var(--focus-outline-offset);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.link--muted {
|
|
27
|
+
color: var(--text-muted);
|
|
28
|
+
text-decoration: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.link--muted:hover {
|
|
32
|
+
color: var(--text);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.link--disabled {
|
|
36
|
+
color: var(--text-muted);
|
|
37
|
+
text-decoration: none;
|
|
38
|
+
opacity: var(--opacity-disabled);
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class ChLink {
|
|
3
|
+
/**
|
|
4
|
+
* The URL the link points to.
|
|
5
|
+
*/
|
|
6
|
+
href;
|
|
7
|
+
/**
|
|
8
|
+
* The browsing context the link opens in (e.g. `_blank`). For `_blank`, a
|
|
9
|
+
* `noopener noreferrer` `rel` is added automatically.
|
|
10
|
+
*/
|
|
11
|
+
target;
|
|
12
|
+
/**
|
|
13
|
+
* The visual style of the link. Either `default` or `muted`.
|
|
14
|
+
*/
|
|
15
|
+
variant = 'default';
|
|
16
|
+
/**
|
|
17
|
+
* Whether the link is disabled. Renders a non-interactive element with
|
|
18
|
+
* `aria-disabled="true"` instead of an anchor.
|
|
19
|
+
*/
|
|
20
|
+
disabled = false;
|
|
21
|
+
/**
|
|
22
|
+
* Emitted when the link is clicked.
|
|
23
|
+
*/
|
|
24
|
+
chClick;
|
|
25
|
+
handleClick = (ev) => {
|
|
26
|
+
this.chClick.emit(ev);
|
|
27
|
+
};
|
|
28
|
+
render() {
|
|
29
|
+
if (this.disabled) {
|
|
30
|
+
return (h(Host, null, h("span", { class: { 'link': true, [`link--${this.variant}`]: true, 'link--disabled': true }, "aria-disabled": "true" }, h("slot", null))));
|
|
31
|
+
}
|
|
32
|
+
return (h(Host, null, h("a", { class: { link: true, [`link--${this.variant}`]: true }, href: this.href, target: this.target, rel: this.target === '_blank' ? 'noopener noreferrer' : undefined, onClick: this.handleClick }, h("slot", null))));
|
|
33
|
+
}
|
|
34
|
+
static get is() { return "ch-link"; }
|
|
35
|
+
static get encapsulation() { return "shadow"; }
|
|
36
|
+
static get originalStyleUrls() {
|
|
37
|
+
return {
|
|
38
|
+
"$": ["ch-link.css"]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
static get styleUrls() {
|
|
42
|
+
return {
|
|
43
|
+
"$": ["ch-link.css"]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
static get properties() {
|
|
47
|
+
return {
|
|
48
|
+
"href": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"mutable": false,
|
|
51
|
+
"complexType": {
|
|
52
|
+
"original": "string",
|
|
53
|
+
"resolved": "string",
|
|
54
|
+
"references": {}
|
|
55
|
+
},
|
|
56
|
+
"required": false,
|
|
57
|
+
"optional": true,
|
|
58
|
+
"docs": {
|
|
59
|
+
"tags": [],
|
|
60
|
+
"text": "The URL the link points to."
|
|
61
|
+
},
|
|
62
|
+
"getter": false,
|
|
63
|
+
"setter": false,
|
|
64
|
+
"reflect": false,
|
|
65
|
+
"attribute": "href"
|
|
66
|
+
},
|
|
67
|
+
"target": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"mutable": false,
|
|
70
|
+
"complexType": {
|
|
71
|
+
"original": "string",
|
|
72
|
+
"resolved": "string",
|
|
73
|
+
"references": {}
|
|
74
|
+
},
|
|
75
|
+
"required": false,
|
|
76
|
+
"optional": true,
|
|
77
|
+
"docs": {
|
|
78
|
+
"tags": [],
|
|
79
|
+
"text": "The browsing context the link opens in (e.g. `_blank`). For `_blank`, a\n`noopener noreferrer` `rel` is added automatically."
|
|
80
|
+
},
|
|
81
|
+
"getter": false,
|
|
82
|
+
"setter": false,
|
|
83
|
+
"reflect": false,
|
|
84
|
+
"attribute": "target"
|
|
85
|
+
},
|
|
86
|
+
"variant": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"mutable": false,
|
|
89
|
+
"complexType": {
|
|
90
|
+
"original": "ChLinkVariant",
|
|
91
|
+
"resolved": "\"default\" | \"muted\"",
|
|
92
|
+
"references": {
|
|
93
|
+
"ChLinkVariant": {
|
|
94
|
+
"location": "local",
|
|
95
|
+
"path": "/home/runner/work/chucao/chucao/src/components/ch-link/ch-link.tsx",
|
|
96
|
+
"id": "src/components/ch-link/ch-link.tsx::ChLinkVariant"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": false,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": "The visual style of the link. Either `default` or `muted`."
|
|
105
|
+
},
|
|
106
|
+
"getter": false,
|
|
107
|
+
"setter": false,
|
|
108
|
+
"reflect": false,
|
|
109
|
+
"attribute": "variant",
|
|
110
|
+
"defaultValue": "'default'"
|
|
111
|
+
},
|
|
112
|
+
"disabled": {
|
|
113
|
+
"type": "boolean",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "boolean",
|
|
117
|
+
"resolved": "boolean",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": false,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "Whether the link is disabled. Renders a non-interactive element with\n`aria-disabled=\"true\"` instead of an anchor."
|
|
125
|
+
},
|
|
126
|
+
"getter": false,
|
|
127
|
+
"setter": false,
|
|
128
|
+
"reflect": false,
|
|
129
|
+
"attribute": "disabled",
|
|
130
|
+
"defaultValue": "false"
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
static get events() {
|
|
135
|
+
return [{
|
|
136
|
+
"method": "chClick",
|
|
137
|
+
"name": "chClick",
|
|
138
|
+
"bubbles": true,
|
|
139
|
+
"cancelable": true,
|
|
140
|
+
"composed": true,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": "Emitted when the link is clicked."
|
|
144
|
+
},
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "MouseEvent",
|
|
147
|
+
"resolved": "MouseEvent",
|
|
148
|
+
"references": {
|
|
149
|
+
"MouseEvent": {
|
|
150
|
+
"location": "global",
|
|
151
|
+
"id": "global::MouseEvent"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}];
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=ch-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-link.js","sourceRoot":"","sources":["../../../../src/components/ch-link/ch-link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AASnF,MAAM,OAAO,MAAM;IACjB;;OAEG;IACK,IAAI,CAAU;IAEtB;;;OAGG;IACK,MAAM,CAAU;IAExB;;OAEG;IACK,OAAO,GAAkB,SAAS,CAAC;IAE3C;;;OAGG;IACK,QAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACM,OAAO,CAA2B;IAEnC,WAAW,GAAG,CAAC,EAAc,EAAE,EAAE;QACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,MAAM;QACJ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CACL,EAAC,IAAI;gBACH,YAAM,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,mBAAgB,MAAM;oBAC1G,eAAa,CACR,CACF,CACR,CAAC;QACJ,CAAC;QACD,OAAO,CACL,EAAC,IAAI;YACH,SACE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EACtD,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,GAAG,EAAE,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EACjE,OAAO,EAAE,IAAI,CAAC,WAAW;gBAEzB,eAAa,CACX,CACC,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nexport type ChLinkVariant = 'default' | 'muted';\n\n@Component({\n tag: 'ch-link',\n styleUrl: 'ch-link.css',\n shadow: true,\n})\nexport class ChLink {\n /**\n * The URL the link points to.\n */\n @Prop() href?: string;\n\n /**\n * The browsing context the link opens in (e.g. `_blank`). For `_blank`, a\n * `noopener noreferrer` `rel` is added automatically.\n */\n @Prop() target?: string;\n\n /**\n * The visual style of the link. Either `default` or `muted`.\n */\n @Prop() variant: ChLinkVariant = 'default';\n\n /**\n * Whether the link is disabled. Renders a non-interactive element with\n * `aria-disabled=\"true\"` instead of an anchor.\n */\n @Prop() disabled = false;\n\n /**\n * Emitted when the link is clicked.\n */\n @Event() chClick: EventEmitter<MouseEvent>;\n\n private handleClick = (ev: MouseEvent) => {\n this.chClick.emit(ev);\n };\n\n render() {\n if (this.disabled) {\n return (\n <Host>\n <span class={{ 'link': true, [`link--${this.variant}`]: true, 'link--disabled': true }} aria-disabled=\"true\">\n <slot></slot>\n </span>\n </Host>\n );\n }\n return (\n <Host>\n <a\n class={{ link: true, [`link--${this.variant}`]: true }}\n href={this.href}\n target={this.target}\n rel={this.target === '_blank' ? 'noopener noreferrer' : undefined}\n onClick={this.handleClick}\n >\n <slot></slot>\n </a>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -63,7 +63,7 @@ export class ChRadio {
|
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
65
|
const groupName = this.name || `${this.groupId}-group`;
|
|
66
|
-
return (h(Host, { key: '
|
|
66
|
+
return (h(Host, { key: 'd9a24c29e5fe841d5c6fefc68bc22db1d9c4ee02' }, this.label && (h("span", { key: 'c8dc580a29569ca98f7e6dafce797fa6ac5f7442', class: "group-label", id: this.labelId }, this.label)), h("div", { key: '6b10d53fbf83286ad18b29d3238df4927b3341db', 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 || 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 || 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: '654315541c6b5ed2886283fae2fb72c37f91f575', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '1ed129bddbf96f3b6562552edf416293a0ba0071', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
67
67
|
}
|
|
68
68
|
static get is() { return "ch-radio"; }
|
|
69
69
|
static get encapsulation() { return "shadow"; }
|
|
@@ -64,7 +64,7 @@ export class ChSelect {
|
|
|
64
64
|
return undefined;
|
|
65
65
|
}
|
|
66
66
|
render() {
|
|
67
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: '206697f7162cbac4e5486a937d7e44bb971b6ee4' }, this.label && (h("label", { key: '664e7423e7ac1a5dd6c626f2094c0ffe63d7ea36', class: "label", htmlFor: this.selectId }, this.label)), h("select", { key: 'd010c2ea52bf449d823d115fa835b53dfa28390a', id: this.label ? this.selectId : undefined, class: { 'select': true, 'select--invalid': this.invalid }, name: this.name, disabled: this.disabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }, this.placeholder && (h("option", { key: '9a28e73a3ef6742d037eaa825f1a66dfd4447ae6', 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: '6d3ff7d72bc488b723a3d9cd0982f5e3d4d46c87', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: 'bbc4b768cb94c39b57663d27a86b886e2ff9a556', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
68
68
|
}
|
|
69
69
|
static get is() { return "ch-select"; }
|
|
70
70
|
static get encapsulation() { return "shadow"; }
|
|
@@ -60,7 +60,7 @@ export class ChSwitch {
|
|
|
60
60
|
return undefined;
|
|
61
61
|
}
|
|
62
62
|
render() {
|
|
63
|
-
return (h(Host, { key: '
|
|
63
|
+
return (h(Host, { key: 'a2872e01803daa52a44e9ffe16e5c57ebd8f2a93' }, h("label", { key: 'fb94e4de3381b617a17b8aec2342ee5c72be775a', class: { 'control': true, 'control--disabled': this.disabled }, htmlFor: this.switchId }, h("input", { key: '4861655716af08d93965d78d98fe09a871ab409b', 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, 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: 'e94675c142dd85c09d1e188a80cffc6978e98369', class: "track" }), h("span", { key: 'efe2a5e5123d47f9b0eafa88f8da49db64064205', class: "thumb" }), this.label && h("span", { key: '25813b7563ba7c4591ed06e95231977cb0c97147', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '00919d4ddc1e00b634dc917cdbe8fc68f1229a7f', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '799a59b00f93534a01b6eb0da04bf6457c8df725', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
64
64
|
}
|
|
65
65
|
static get is() { return "ch-switch"; }
|
|
66
66
|
static get encapsulation() { return "shadow"; }
|