@devschile/chucao 2.1.0 → 2.2.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-d5a9e340.entry.js → p-077dc2a6.entry.js} +2 -2
- package/dist/chucao/{p-4bc8e098.entry.js → p-079c2017.entry.js} +2 -2
- package/dist/chucao/p-37e7f9cc.entry.js +2 -0
- package/dist/chucao/p-37e7f9cc.entry.js.map +1 -0
- package/dist/chucao/{p-121fbfc8.entry.js → p-5ae89a19.entry.js} +2 -2
- package/dist/chucao/p-70285203.entry.js +2 -0
- package/dist/chucao/p-70285203.entry.js.map +1 -0
- package/dist/chucao/{p-5fe8bfff.entry.js → p-9c072600.entry.js} +2 -2
- package/dist/chucao/p-b678a7e2.entry.js +2 -0
- package/dist/chucao/p-b678a7e2.entry.js.map +1 -0
- package/dist/chucao/p-b8bd0310.entry.js +2 -0
- package/dist/chucao/p-b8bd0310.entry.js.map +1 -0
- package/dist/chucao/p-bb2445d1.entry.js +2 -0
- package/dist/chucao/{p-9bb81a65.entry.js → p-c986036f.entry.js} +2 -2
- package/dist/chucao/p-d8DfpzMR.js +2 -0
- package/dist/chucao/p-d8DfpzMR.js.map +1 -0
- package/dist/chucao/{p-1b1e56cd.entry.js → p-e3265e38.entry.js} +2 -2
- package/dist/cjs/ch-alert_8.cjs.entry.js +54 -11
- package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ch-divider.cjs.entry.js +1 -1
- package/dist/cjs/ch-drawer.cjs.entry.js +153 -0
- package/dist/cjs/ch-drawer.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-emoji.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +4 -23
- package/dist/cjs/ch-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/ch-radio.cjs.entry.js +1 -1
- package/dist/cjs/ch-segmented-control.cjs.entry.js +112 -0
- package/dist/cjs/ch-segmented-control.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-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/chucao.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/scroll-lock-DIRqLP4K.js +49 -0
- package/dist/cjs/scroll-lock-DIRqLP4K.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ch-button/ch-button.css +56 -18
- package/dist/collection/components/ch-button/ch-button.js +135 -8
- package/dist/collection/components/ch-button/ch-button.js.map +1 -1
- package/dist/collection/components/ch-card/ch-card.js +1 -1
- package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
- package/dist/collection/components/ch-divider/ch-divider.js +1 -1
- package/dist/collection/components/ch-drawer/ch-drawer.css +152 -0
- package/dist/collection/components/ch-drawer/ch-drawer.js +285 -0
- package/dist/collection/components/ch-drawer/ch-drawer.js.map +1 -0
- package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +4 -23
- package/dist/collection/components/ch-modal/ch-modal.js.map +1 -1
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.css +88 -0
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +295 -0
- package/dist/collection/components/ch-segmented-control/ch-segmented-control.js.map +1 -0
- package/dist/collection/components/ch-select/ch-select.js +1 -1
- package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
- 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-tooltip/ch-tooltip.js +1 -1
- package/dist/collection/utils/scroll-lock.js +42 -0
- package/dist/collection/utils/scroll-lock.js.map +1 -0
- package/dist/components/ch-button.js +1 -1
- package/dist/components/ch-button.js.map +1 -1
- package/dist/components/ch-card.js +1 -1
- package/dist/components/ch-checkbox.js +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-drawer.d.ts +11 -0
- package/dist/components/ch-drawer.js +2 -0
- package/dist/components/ch-drawer.js.map +1 -0
- package/dist/components/ch-emoji.js +1 -1
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-modal.js.map +1 -1
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-segmented-control.d.ts +11 -0
- package/dist/components/ch-segmented-control.js +2 -0
- package/dist/components/ch-segmented-control.js.map +1 -0
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-spinner.js +1 -1
- package/dist/components/ch-spinner.js.map +1 -1
- 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-tooltip.js +1 -1
- package/dist/components/p-C4eGmLcE.js +2 -0
- package/dist/components/p-C4eGmLcE.js.map +1 -0
- package/dist/components/p-d8DfpzMR.js +2 -0
- package/dist/components/p-d8DfpzMR.js.map +1 -0
- package/dist/esm/ch-alert_8.entry.js +54 -11
- package/dist/esm/ch-alert_8.entry.js.map +1 -1
- package/dist/esm/ch-checkbox.entry.js +1 -1
- package/dist/esm/ch-divider.entry.js +1 -1
- package/dist/esm/ch-drawer.entry.js +151 -0
- package/dist/esm/ch-drawer.entry.js.map +1 -0
- package/dist/esm/ch-emoji.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +4 -23
- package/dist/esm/ch-modal.entry.js.map +1 -1
- package/dist/esm/ch-radio.entry.js +1 -1
- package/dist/esm/ch-segmented-control.entry.js +110 -0
- package/dist/esm/ch-segmented-control.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-tooltip.entry.js +1 -1
- package/dist/esm/chucao.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/scroll-lock-d8DfpzMR.js +46 -0
- package/dist/esm/scroll-lock-d8DfpzMR.js.map +1 -0
- package/dist/types/components/ch-button/ch-button.d.ts +29 -5
- package/dist/types/components/ch-drawer/ch-drawer.d.ts +68 -0
- package/dist/types/components/ch-segmented-control/ch-segmented-control.d.ts +72 -0
- package/dist/types/components.d.ts +333 -6
- package/dist/types/utils/scroll-lock.d.ts +17 -0
- package/dist-react/components.d.ts +12 -1
- package/dist-react/components.js +21 -0
- package/dist-react/components.ts +31 -1
- package/dist-vue/index.d.ts +2 -0
- package/dist-vue/index.js +29 -0
- package/dist-vue/index.ts +33 -0
- package/hydrate/index.js +418 -41
- package/hydrate/index.mjs +418 -41
- package/package.json +4 -3
- package/dist/chucao/p-11083711.entry.js +0 -2
- package/dist/chucao/p-11083711.entry.js.map +0 -1
- package/dist/chucao/p-2ab4a6a8.entry.js +0 -2
- package/dist/chucao/p-a955eebf.entry.js +0 -2
- package/dist/chucao/p-a955eebf.entry.js.map +0 -1
- /package/dist/chucao/{p-d5a9e340.entry.js.map → p-077dc2a6.entry.js.map} +0 -0
- /package/dist/chucao/{p-4bc8e098.entry.js.map → p-079c2017.entry.js.map} +0 -0
- /package/dist/chucao/{p-121fbfc8.entry.js.map → p-5ae89a19.entry.js.map} +0 -0
- /package/dist/chucao/{p-5fe8bfff.entry.js.map → p-9c072600.entry.js.map} +0 -0
- /package/dist/chucao/{p-2ab4a6a8.entry.js.map → p-bb2445d1.entry.js.map} +0 -0
- /package/dist/chucao/{p-9bb81a65.entry.js.map → p-c986036f.entry.js.map} +0 -0
- /package/dist/chucao/{p-1b1e56cd.entry.js.map → p-e3265e38.entry.js.map} +0 -0
|
@@ -1,17 +1,38 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class ChButton {
|
|
3
3
|
/**
|
|
4
|
-
* The visual style of the button.
|
|
4
|
+
* The visual style of the button. One of `primary`, `secondary`, `ghost`,
|
|
5
|
+
* or `danger`.
|
|
5
6
|
*/
|
|
6
7
|
variant = 'primary';
|
|
8
|
+
/**
|
|
9
|
+
* The size of the button. One of `sm`, `md`, or `lg`.
|
|
10
|
+
*/
|
|
11
|
+
size = 'md';
|
|
7
12
|
/**
|
|
8
13
|
* Whether the button is disabled.
|
|
9
14
|
*/
|
|
10
15
|
disabled = false;
|
|
11
16
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
17
|
+
* Whether the button is loading. Shows a spinner, disables interaction, and
|
|
18
|
+
* announces the busy state with `aria-busy`.
|
|
19
|
+
*/
|
|
20
|
+
loading = false;
|
|
21
|
+
/**
|
|
22
|
+
* When set, the button renders as an `<a>` pointing to this URL while
|
|
23
|
+
* keeping the button styling.
|
|
24
|
+
*/
|
|
25
|
+
href;
|
|
26
|
+
/**
|
|
27
|
+
* The browsing context the link opens in (e.g. `_blank`). Only used when
|
|
28
|
+
* `href` is set. For `_blank`, a `noopener noreferrer` `rel` is added
|
|
29
|
+
* automatically.
|
|
30
|
+
*/
|
|
31
|
+
target;
|
|
32
|
+
/**
|
|
33
|
+
* Accessible label set as `aria-label` on the native element. Use it when
|
|
34
|
+
* the button's content doesn't convey its purpose on its own (e.g. an
|
|
35
|
+
* icon-only button).
|
|
15
36
|
*/
|
|
16
37
|
label;
|
|
17
38
|
/**
|
|
@@ -19,10 +40,32 @@ export class ChButton {
|
|
|
19
40
|
*/
|
|
20
41
|
chClick;
|
|
21
42
|
handleClick = (ev) => {
|
|
43
|
+
if (this.disabled || this.loading) {
|
|
44
|
+
ev.preventDefault();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
22
47
|
this.chClick.emit(ev);
|
|
23
48
|
};
|
|
49
|
+
get spinnerSize() {
|
|
50
|
+
return this.size === 'lg' ? 'md' : 'sm';
|
|
51
|
+
}
|
|
52
|
+
renderContent() {
|
|
53
|
+
return [this.loading ? h("ch-spinner", { size: this.spinnerSize }) : h("slot", { name: "start" }), h("slot", null), h("slot", { name: "end" })];
|
|
54
|
+
}
|
|
24
55
|
render() {
|
|
25
|
-
|
|
56
|
+
const classes = {
|
|
57
|
+
'btn': true,
|
|
58
|
+
[`btn--${this.variant}`]: true,
|
|
59
|
+
[`btn--${this.size}`]: true,
|
|
60
|
+
'btn--loading': this.loading,
|
|
61
|
+
};
|
|
62
|
+
if (this.href && !this.disabled && !this.loading) {
|
|
63
|
+
return (h(Host, null, h("a", { class: classes, href: this.href, target: this.target, rel: this.target === '_blank' ? 'noopener noreferrer' : undefined, "aria-label": this.label, onClick: this.handleClick }, this.renderContent())));
|
|
64
|
+
}
|
|
65
|
+
if (this.href) {
|
|
66
|
+
return (h(Host, null, h("span", { class: { ...classes, 'btn--disabled': true }, "aria-label": this.label, "aria-disabled": "true", "aria-busy": this.loading ? 'true' : undefined }, this.renderContent())));
|
|
67
|
+
}
|
|
68
|
+
return (h(Host, null, h("button", { class: classes, type: "button", disabled: this.disabled || this.loading, "aria-label": this.label, "aria-busy": this.loading ? 'true' : undefined, onClick: this.handleClick }, this.renderContent())));
|
|
26
69
|
}
|
|
27
70
|
static get is() { return "ch-button"; }
|
|
28
71
|
static get encapsulation() { return "shadow"; }
|
|
@@ -43,7 +86,7 @@ export class ChButton {
|
|
|
43
86
|
"mutable": false,
|
|
44
87
|
"complexType": {
|
|
45
88
|
"original": "ChButtonVariant",
|
|
46
|
-
"resolved": "\"primary\" | \"secondary\"",
|
|
89
|
+
"resolved": "\"danger\" | \"ghost\" | \"primary\" | \"secondary\"",
|
|
47
90
|
"references": {
|
|
48
91
|
"ChButtonVariant": {
|
|
49
92
|
"location": "local",
|
|
@@ -56,7 +99,7 @@ export class ChButton {
|
|
|
56
99
|
"optional": false,
|
|
57
100
|
"docs": {
|
|
58
101
|
"tags": [],
|
|
59
|
-
"text": "The visual style of the button.
|
|
102
|
+
"text": "The visual style of the button. One of `primary`, `secondary`, `ghost`,\nor `danger`."
|
|
60
103
|
},
|
|
61
104
|
"getter": false,
|
|
62
105
|
"setter": false,
|
|
@@ -64,6 +107,32 @@ export class ChButton {
|
|
|
64
107
|
"attribute": "variant",
|
|
65
108
|
"defaultValue": "'primary'"
|
|
66
109
|
},
|
|
110
|
+
"size": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"mutable": false,
|
|
113
|
+
"complexType": {
|
|
114
|
+
"original": "ChButtonSize",
|
|
115
|
+
"resolved": "\"lg\" | \"md\" | \"sm\"",
|
|
116
|
+
"references": {
|
|
117
|
+
"ChButtonSize": {
|
|
118
|
+
"location": "local",
|
|
119
|
+
"path": "/home/runner/work/chucao/chucao/src/components/ch-button/ch-button.tsx",
|
|
120
|
+
"id": "src/components/ch-button/ch-button.tsx::ChButtonSize"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"required": false,
|
|
125
|
+
"optional": false,
|
|
126
|
+
"docs": {
|
|
127
|
+
"tags": [],
|
|
128
|
+
"text": "The size of the button. One of `sm`, `md`, or `lg`."
|
|
129
|
+
},
|
|
130
|
+
"getter": false,
|
|
131
|
+
"setter": false,
|
|
132
|
+
"reflect": false,
|
|
133
|
+
"attribute": "size",
|
|
134
|
+
"defaultValue": "'md'"
|
|
135
|
+
},
|
|
67
136
|
"disabled": {
|
|
68
137
|
"type": "boolean",
|
|
69
138
|
"mutable": false,
|
|
@@ -84,6 +153,64 @@ export class ChButton {
|
|
|
84
153
|
"attribute": "disabled",
|
|
85
154
|
"defaultValue": "false"
|
|
86
155
|
},
|
|
156
|
+
"loading": {
|
|
157
|
+
"type": "boolean",
|
|
158
|
+
"mutable": false,
|
|
159
|
+
"complexType": {
|
|
160
|
+
"original": "boolean",
|
|
161
|
+
"resolved": "boolean",
|
|
162
|
+
"references": {}
|
|
163
|
+
},
|
|
164
|
+
"required": false,
|
|
165
|
+
"optional": false,
|
|
166
|
+
"docs": {
|
|
167
|
+
"tags": [],
|
|
168
|
+
"text": "Whether the button is loading. Shows a spinner, disables interaction, and\nannounces the busy state with `aria-busy`."
|
|
169
|
+
},
|
|
170
|
+
"getter": false,
|
|
171
|
+
"setter": false,
|
|
172
|
+
"reflect": false,
|
|
173
|
+
"attribute": "loading",
|
|
174
|
+
"defaultValue": "false"
|
|
175
|
+
},
|
|
176
|
+
"href": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"mutable": false,
|
|
179
|
+
"complexType": {
|
|
180
|
+
"original": "string",
|
|
181
|
+
"resolved": "string",
|
|
182
|
+
"references": {}
|
|
183
|
+
},
|
|
184
|
+
"required": false,
|
|
185
|
+
"optional": true,
|
|
186
|
+
"docs": {
|
|
187
|
+
"tags": [],
|
|
188
|
+
"text": "When set, the button renders as an `<a>` pointing to this URL while\nkeeping the button styling."
|
|
189
|
+
},
|
|
190
|
+
"getter": false,
|
|
191
|
+
"setter": false,
|
|
192
|
+
"reflect": false,
|
|
193
|
+
"attribute": "href"
|
|
194
|
+
},
|
|
195
|
+
"target": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"mutable": false,
|
|
198
|
+
"complexType": {
|
|
199
|
+
"original": "string",
|
|
200
|
+
"resolved": "string",
|
|
201
|
+
"references": {}
|
|
202
|
+
},
|
|
203
|
+
"required": false,
|
|
204
|
+
"optional": true,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "The browsing context the link opens in (e.g. `_blank`). Only used when\n`href` is set. For `_blank`, a `noopener noreferrer` `rel` is added\nautomatically."
|
|
208
|
+
},
|
|
209
|
+
"getter": false,
|
|
210
|
+
"setter": false,
|
|
211
|
+
"reflect": false,
|
|
212
|
+
"attribute": "target"
|
|
213
|
+
},
|
|
87
214
|
"label": {
|
|
88
215
|
"type": "string",
|
|
89
216
|
"mutable": false,
|
|
@@ -96,7 +223,7 @@ export class ChButton {
|
|
|
96
223
|
"optional": true,
|
|
97
224
|
"docs": {
|
|
98
225
|
"tags": [],
|
|
99
|
-
"text": "Accessible label set as `aria-label` on the native
|
|
226
|
+
"text": "Accessible label set as `aria-label` on the native element. Use it when\nthe button's content doesn't convey its purpose on its own (e.g. an\nicon-only button)."
|
|
100
227
|
},
|
|
101
228
|
"getter": false,
|
|
102
229
|
"setter": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ch-button.js","sourceRoot":"","sources":["../../../../src/components/ch-button/ch-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ch-button.js","sourceRoot":"","sources":["../../../../src/components/ch-button/ch-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAUnF,MAAM,OAAO,QAAQ;IACnB;;;OAGG;IACK,OAAO,GAAoB,SAAS,CAAC;IAE7C;;OAEG;IACK,IAAI,GAAiB,IAAI,CAAC;IAElC;;OAEG;IACK,QAAQ,GAAG,KAAK,CAAC;IAEzB;;;OAGG;IACK,OAAO,GAAG,KAAK,CAAC;IAExB;;;OAGG;IACK,IAAI,CAAU;IAEtB;;;;OAIG;IACK,MAAM,CAAU;IAExB;;;;OAIG;IACK,KAAK,CAAU;IAEvB;;OAEG;IACM,OAAO,CAA2B;IAEnC,WAAW,GAAG,CAAC,EAAc,EAAE,EAAE;QACvC,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAClC,EAAE,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1C,CAAC;IAEO,aAAa;QACnB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAY,IAAI,EAAE,IAAI,CAAC,WAAW,GAAe,CAAC,CAAC,CAAC,YAAM,IAAI,EAAC,OAAO,GAAQ,EAAE,eAAa,EAAE,YAAM,IAAI,EAAC,KAAK,GAAQ,CAAC,CAAC;IAClJ,CAAC;IAED,MAAM;QACJ,MAAM,OAAO,GAAG;YACd,KAAK,EAAE,IAAI;YACX,CAAC,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI;YAC9B,CAAC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;YAC3B,cAAc,EAAE,IAAI,CAAC,OAAO;SAC7B,CAAC;QAEF,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACjD,OAAO,CACL,EAAC,IAAI;gBACH,SACE,KAAK,EAAE,OAAO,EACd,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,gBACrD,IAAI,CAAC,KAAK,EACtB,OAAO,EAAE,IAAI,CAAC,WAAW,IAExB,IAAI,CAAC,aAAa,EAAE,CACnB,CACC,CACR,CAAC;QACJ,CAAC;QAED,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,OAAO,CACL,EAAC,IAAI;gBACH,YAAM,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,gBAAc,IAAI,CAAC,KAAK,mBAAgB,MAAM,eAAY,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,IAC1I,IAAI,CAAC,aAAa,EAAE,CAChB,CACF,CACR,CAAC;QACJ,CAAC;QAED,OAAO,CACL,EAAC,IAAI;YACH,cACE,KAAK,EAAE,OAAO,EACd,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,gBAC3B,IAAI,CAAC,KAAK,eACX,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC5C,OAAO,EAAE,IAAI,CAAC,WAAW,IAExB,IAAI,CAAC,aAAa,EAAE,CACd,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nexport type ChButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\nexport type ChButtonSize = 'sm' | 'md' | 'lg';\n\n@Component({\n tag: 'ch-button',\n styleUrl: 'ch-button.css',\n shadow: true,\n})\nexport class ChButton {\n /**\n * The visual style of the button. One of `primary`, `secondary`, `ghost`,\n * or `danger`.\n */\n @Prop() variant: ChButtonVariant = 'primary';\n\n /**\n * The size of the button. One of `sm`, `md`, or `lg`.\n */\n @Prop() size: ChButtonSize = 'md';\n\n /**\n * Whether the button is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Whether the button is loading. Shows a spinner, disables interaction, and\n * announces the busy state with `aria-busy`.\n */\n @Prop() loading = false;\n\n /**\n * When set, the button renders as an `<a>` pointing to this URL while\n * keeping the button styling.\n */\n @Prop() href?: string;\n\n /**\n * The browsing context the link opens in (e.g. `_blank`). Only used when\n * `href` is set. For `_blank`, a `noopener noreferrer` `rel` is added\n * automatically.\n */\n @Prop() target?: string;\n\n /**\n * Accessible label set as `aria-label` on the native element. Use it when\n * the button's content doesn't convey its purpose on its own (e.g. an\n * icon-only button).\n */\n @Prop() label?: string;\n\n /**\n * Emitted when the button is clicked.\n */\n @Event() chClick: EventEmitter<MouseEvent>;\n\n private handleClick = (ev: MouseEvent) => {\n if (this.disabled || this.loading) {\n ev.preventDefault();\n return;\n }\n this.chClick.emit(ev);\n };\n\n private get spinnerSize() {\n return this.size === 'lg' ? 'md' : 'sm';\n }\n\n private renderContent() {\n return [this.loading ? <ch-spinner size={this.spinnerSize}></ch-spinner> : <slot name=\"start\"></slot>, <slot></slot>, <slot name=\"end\"></slot>];\n }\n\n render() {\n const classes = {\n 'btn': true,\n [`btn--${this.variant}`]: true,\n [`btn--${this.size}`]: true,\n 'btn--loading': this.loading,\n };\n\n if (this.href && !this.disabled && !this.loading) {\n return (\n <Host>\n <a\n class={classes}\n href={this.href}\n target={this.target}\n rel={this.target === '_blank' ? 'noopener noreferrer' : undefined}\n aria-label={this.label}\n onClick={this.handleClick}\n >\n {this.renderContent()}\n </a>\n </Host>\n );\n }\n\n if (this.href) {\n return (\n <Host>\n <span class={{ ...classes, 'btn--disabled': true }} aria-label={this.label} aria-disabled=\"true\" aria-busy={this.loading ? 'true' : undefined}>\n {this.renderContent()}\n </span>\n </Host>\n );\n }\n\n return (\n <Host>\n <button\n class={classes}\n type=\"button\"\n disabled={this.disabled || this.loading}\n aria-label={this.label}\n aria-busy={this.loading ? 'true' : undefined}\n onClick={this.handleClick}\n >\n {this.renderContent()}\n </button>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -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: '7e2833cdc6f37c6b8577c17677840913fb7cd9e1' }, h("div", { key: '223c291e98af73ee2c299b8649773cfcf54388d7', class: "card" }, h("slot", { key: 'e948386bcd492c31e264d50cf27d26e98dd771eb' }))));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "ch-card"; }
|
|
7
7
|
static get encapsulation() { return "shadow"; }
|
|
@@ -97,7 +97,7 @@ export class ChCheckbox {
|
|
|
97
97
|
return undefined;
|
|
98
98
|
}
|
|
99
99
|
render() {
|
|
100
|
-
return (h(Host, { key: '
|
|
100
|
+
return (h(Host, { key: '4011f5a338d2b006a0bfa8217d1ee9b01b987d7d' }, h("label", { key: '8c6c8d6c530d366b26f0cb602dc1e987ed8324d5', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, h("input", { key: 'c1f58eeba34ae5d5371e863f349433852fc3c882', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && h("span", { key: '447812e11253c951cb6a5003adda13357fc6dec3', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '5369375f8dd0c2fa787207f8fcef4feeb78ddda6', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: 'e90274e1df8d205053effe57ceb56f8e8b4deca2', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
101
101
|
}
|
|
102
102
|
static get is() { return "ch-checkbox"; }
|
|
103
103
|
static get encapsulation() { return "shadow"; }
|
|
@@ -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: '26aa4586507d821e539adcf1e057467654c19491', class: { 'divider--vertical': this.orientation === 'vertical' } }, h("hr", { key: '599b22093ffe91c87899d84ad8c63ab6279107cb', 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"; }
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
.drawer {
|
|
2
|
+
position: fixed;
|
|
3
|
+
inset: 0;
|
|
4
|
+
margin: 0;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: var(--spacing-2xl);
|
|
8
|
+
width: min(24rem, 100vw);
|
|
9
|
+
height: 100vh;
|
|
10
|
+
height: 100dvh;
|
|
11
|
+
max-width: 100vw;
|
|
12
|
+
max-height: 100dvh;
|
|
13
|
+
padding: var(--spacing-5xl);
|
|
14
|
+
border: var(--border-width) solid var(--border);
|
|
15
|
+
border-radius: 0;
|
|
16
|
+
background: var(--color-background-base);
|
|
17
|
+
color: var(--text);
|
|
18
|
+
font-family: var(--font-body);
|
|
19
|
+
font-size: var(--typography-size-md);
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.drawer[open] {
|
|
24
|
+
display: flex;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.drawer--start {
|
|
28
|
+
inset: 0 auto 0 0;
|
|
29
|
+
border-inline-start: none;
|
|
30
|
+
animation: drawer-in-start var(--duration-normal) var(--easing-default);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.drawer--end {
|
|
34
|
+
inset: 0 0 0 auto;
|
|
35
|
+
border-inline-end: none;
|
|
36
|
+
animation: drawer-in-end var(--duration-normal) var(--easing-default);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.drawer--top {
|
|
40
|
+
inset: 0 0 auto 0;
|
|
41
|
+
width: 100vw;
|
|
42
|
+
height: auto;
|
|
43
|
+
max-height: 80dvh;
|
|
44
|
+
border-block-start: none;
|
|
45
|
+
animation: drawer-in-top var(--duration-normal) var(--easing-default);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.drawer--bottom {
|
|
49
|
+
inset: auto 0 0 0;
|
|
50
|
+
width: 100vw;
|
|
51
|
+
height: auto;
|
|
52
|
+
max-height: 80dvh;
|
|
53
|
+
border-block-end: none;
|
|
54
|
+
animation: drawer-in-bottom var(--duration-normal) var(--easing-default);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.drawer::backdrop {
|
|
58
|
+
background: var(--color-scrim-default);
|
|
59
|
+
backdrop-filter: blur(var(--effect-blur));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.drawer-head {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: flex-start;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
gap: var(--spacing-2xl);
|
|
67
|
+
flex: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.drawer-body {
|
|
71
|
+
flex: 1;
|
|
72
|
+
min-height: 0;
|
|
73
|
+
overflow-y: auto;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
::slotted([slot='footer']) {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: flex-end;
|
|
80
|
+
gap: var(--spacing-md);
|
|
81
|
+
flex: none;
|
|
82
|
+
padding-top: var(--spacing-2xl);
|
|
83
|
+
border-top: var(--border-width) solid var(--border);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.drawer-close {
|
|
87
|
+
display: inline-flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
flex: none;
|
|
91
|
+
padding: var(--spacing-2xs) var(--spacing-md);
|
|
92
|
+
border: 0;
|
|
93
|
+
border-radius: var(--radius);
|
|
94
|
+
background: none;
|
|
95
|
+
color: var(--text-muted);
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
font-family: var(--font-heading);
|
|
98
|
+
font-size: var(--typography-size-lg);
|
|
99
|
+
line-height: 1;
|
|
100
|
+
transition: background-color var(--duration-normal) var(--easing-default);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.drawer-close:hover {
|
|
104
|
+
background: var(--surface-hover);
|
|
105
|
+
color: var(--text);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.drawer-close:focus-visible {
|
|
109
|
+
outline: var(--focus-outline-width) solid var(--accent);
|
|
110
|
+
outline-offset: var(--focus-outline-offset);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@keyframes drawer-in-start {
|
|
114
|
+
from {
|
|
115
|
+
transform: translateX(-100%);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@keyframes drawer-in-end {
|
|
120
|
+
from {
|
|
121
|
+
transform: translateX(100%);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@keyframes drawer-in-top {
|
|
126
|
+
from {
|
|
127
|
+
transform: translateY(-100%);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@keyframes drawer-in-bottom {
|
|
132
|
+
from {
|
|
133
|
+
transform: translateY(100%);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@media (pointer: coarse) {
|
|
138
|
+
.drawer-close {
|
|
139
|
+
min-width: 44px;
|
|
140
|
+
min-height: 44px;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@media (prefers-reduced-motion: reduce) {
|
|
145
|
+
.drawer {
|
|
146
|
+
animation: none;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.drawer-close {
|
|
150
|
+
transition: none;
|
|
151
|
+
}
|
|
152
|
+
}
|