@devschile/chucao 2.0.0 → 2.1.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 +2 -0
- package/dist/chucao/chucao.esm.js +1 -1
- package/dist/chucao/chucao.esm.js.map +1 -1
- package/dist/chucao/{p-a0ec231a.entry.js → p-04dbcfa0.entry.js} +2 -2
- package/dist/chucao/{p-75184fe1.entry.js → p-11083711.entry.js} +2 -2
- package/dist/chucao/{p-f04d2f75.entry.js → p-121fbfc8.entry.js} +2 -2
- package/dist/chucao/{p-10658dc9.entry.js → p-1b1e56cd.entry.js} +2 -2
- package/dist/chucao/{p-e48912c7.entry.js → p-2ab4a6a8.entry.js} +2 -2
- package/dist/chucao/{p-19dde4f9.entry.js → p-4bc8e098.entry.js} +2 -2
- package/dist/chucao/{p-2e20c7a1.entry.js → p-5fe8bfff.entry.js} +2 -2
- package/dist/chucao/p-9bb81a65.entry.js +2 -0
- package/dist/chucao/p-9bb81a65.entry.js.map +1 -0
- package/dist/chucao/{p-BaKXvAYc.js → p-DWC12BJ-.js} +2 -2
- package/dist/chucao/p-DWC12BJ-.js.map +1 -0
- package/dist/chucao/{p-66dce533.entry.js → p-a955eebf.entry.js} +2 -2
- package/dist/chucao/{p-96c852f5.entry.js → p-d5a9e340.entry.js} +2 -2
- package/dist/chucao/{p-f62e1da2.entry.js → p-ff5f5c1f.entry.js} +2 -2
- package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ch-alert_8.cjs.entry.js +6 -6
- package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ch-divider.cjs.entry.js +1 -1
- package/dist/cjs/ch-emoji.cjs.entry.js +104 -0
- package/dist/cjs/ch-emoji.cjs.entry.js.map +1 -0
- package/dist/cjs/ch-link.cjs.entry.js +1 -1
- package/dist/cjs/ch-modal.cjs.entry.js +2 -2
- package/dist/cjs/ch-radio.cjs.entry.js +2 -2
- package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ch-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/chucao.cjs.js +3 -3
- package/dist/cjs/chucao.cjs.js.map +1 -1
- package/dist/cjs/{index-C9Abf0td.js → index-C9cpLteP.js} +15 -8
- package/dist/cjs/index-C9cpLteP.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -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-emoji/ch-emoji.css +33 -0
- package/dist/collection/components/ch-emoji/ch-emoji.js +151 -0
- package/dist/collection/components/ch-emoji/ch-emoji.js.map +1 -0
- package/dist/collection/components/ch-input/ch-input.js +1 -1
- package/dist/collection/components/ch-modal/ch-modal.js +1 -1
- package/dist/collection/components/ch-radio/ch-radio.js +1 -1
- 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/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-checkbox.js +1 -1
- package/dist/components/ch-divider.js +1 -1
- package/dist/components/ch-emoji.d.ts +11 -0
- package/dist/components/ch-emoji.js +2 -0
- package/dist/components/ch-emoji.js.map +1 -0
- package/dist/components/ch-input.js +1 -1
- package/dist/components/ch-link.js +1 -1
- package/dist/components/ch-modal.js +1 -1
- package/dist/components/ch-radio.js +1 -1
- package/dist/components/ch-select.js +1 -1
- package/dist/components/ch-spinner.js +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/index.js +1 -1
- package/dist/components/{p-DL-bL54o.js → p-BhAZrOxf.js} +2 -2
- package/dist/components/p-BhAZrOxf.js.map +1 -0
- package/dist/esm/ch-accordion.entry.js +1 -1
- package/dist/esm/ch-alert_8.entry.js +6 -6
- package/dist/esm/ch-checkbox.entry.js +2 -2
- package/dist/esm/ch-divider.entry.js +1 -1
- package/dist/esm/ch-emoji.entry.js +102 -0
- package/dist/esm/ch-emoji.entry.js.map +1 -0
- package/dist/esm/ch-link.entry.js +1 -1
- package/dist/esm/ch-modal.entry.js +2 -2
- package/dist/esm/ch-radio.entry.js +2 -2
- package/dist/esm/ch-tabs.entry.js +2 -2
- package/dist/esm/ch-textarea.entry.js +2 -2
- package/dist/esm/ch-tooltip.entry.js +2 -2
- package/dist/esm/chucao.js +4 -4
- package/dist/esm/chucao.js.map +1 -1
- package/dist/esm/{index-BaKXvAYc.js → index-DWC12BJ-.js} +15 -8
- package/dist/esm/index-DWC12BJ-.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ch-emoji/ch-emoji.d.ts +32 -0
- package/dist/types/components.d.ts +72 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist-react/components.d.ts +3 -0
- package/dist-react/components.js +9 -0
- package/dist-react/components.ts +12 -0
- package/dist-vue/index.d.ts +1 -0
- package/dist-vue/index.js +6 -0
- package/dist-vue/index.ts +8 -0
- package/hydrate/index.js +135 -17
- package/hydrate/index.mjs +135 -17
- package/loader/index.d.ts +1 -1
- package/package.json +2 -1
- package/dist/chucao/p-BaKXvAYc.js.map +0 -1
- package/dist/cjs/index-C9Abf0td.js.map +0 -1
- package/dist/components/p-DL-bL54o.js.map +0 -1
- package/dist/esm/index-BaKXvAYc.js.map +0 -1
- /package/dist/chucao/{p-a0ec231a.entry.js.map → p-04dbcfa0.entry.js.map} +0 -0
- /package/dist/chucao/{p-75184fe1.entry.js.map → p-11083711.entry.js.map} +0 -0
- /package/dist/chucao/{p-f04d2f75.entry.js.map → p-121fbfc8.entry.js.map} +0 -0
- /package/dist/chucao/{p-10658dc9.entry.js.map → p-1b1e56cd.entry.js.map} +0 -0
- /package/dist/chucao/{p-e48912c7.entry.js.map → p-2ab4a6a8.entry.js.map} +0 -0
- /package/dist/chucao/{p-19dde4f9.entry.js.map → p-4bc8e098.entry.js.map} +0 -0
- /package/dist/chucao/{p-2e20c7a1.entry.js.map → p-5fe8bfff.entry.js.map} +0 -0
- /package/dist/chucao/{p-66dce533.entry.js.map → p-a955eebf.entry.js.map} +0 -0
- /package/dist/chucao/{p-96c852f5.entry.js.map → p-d5a9e340.entry.js.map} +0 -0
- /package/dist/chucao/{p-f62e1da2.entry.js.map → p-ff5f5c1f.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-C9cpLteP.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-alert_8.cjs",[[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"]}],[769,"ch-badge",{"variant":[1]}],[769,"ch-button",{"variant":[1],"disabled":[4],"label":[1]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}],[577,"ch-switch",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-radio.cjs",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[577,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tooltip.cjs",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"]]]]]], options);
|
|
8
|
+
return index.bootstrapLazy([["ch-alert_8.cjs",[[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"]}],[769,"ch-badge",{"variant":[1]}],[769,"ch-button",{"variant":[1],"disabled":[4],"label":[1]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}],[577,"ch-switch",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-emoji.cjs",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-radio.cjs",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[577,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tooltip.cjs",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"]]]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
exports.setNonce = index.setNonce;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"components/ch-badge/ch-badge.js",
|
|
6
6
|
"components/ch-button/ch-button.js",
|
|
7
7
|
"components/ch-divider/ch-divider.js",
|
|
8
|
+
"components/ch-emoji/ch-emoji.js",
|
|
8
9
|
"components/ch-link/ch-link.js",
|
|
9
10
|
"components/ch-radio/ch-radio.js",
|
|
10
11
|
"components/ch-select/ch-select.js",
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
"mixins": [],
|
|
22
23
|
"compiler": {
|
|
23
24
|
"name": "@stencil/core",
|
|
24
|
-
"version": "4.44.
|
|
25
|
+
"version": "4.44.2",
|
|
25
26
|
"typescriptVersion": "5.8.3"
|
|
26
27
|
},
|
|
27
28
|
"collections": [],
|
|
@@ -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: 'de570a460eff697eb242ef56fcedd5b400d6b03f' }, h("div", { key: '3350619356a929c5d922948d52d6635420dc8547', class: "card" }, h("slot", { key: 'b50679202b5fea142702de0babf62587186d4dc8' }))));
|
|
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: 'ad83b999d4dbafbd7b6f2369bae8fbce8e068cad' }, h("label", { key: 'e5927ad9d76db7cd9418debe8e635767b597e27a', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, h("input", { key: '93c49822bf5a470d67a7077354adcd9144643843', 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: 'da90747e3339879a744569c98befed94507bebdd', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '3c10c9e29a943bc12983d4ef6b9fa00d95293c80', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '76e4a8debadd36dae475bd2439410c0f2a82cb62', 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"; }
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
vertical-align: middle;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.emoji {
|
|
7
|
+
display: block;
|
|
8
|
+
object-fit: contain;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.emoji--sm {
|
|
12
|
+
width: 16px;
|
|
13
|
+
height: 16px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.emoji--md {
|
|
17
|
+
width: 24px;
|
|
18
|
+
height: 24px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.emoji--lg {
|
|
22
|
+
width: 32px;
|
|
23
|
+
height: 32px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.emoji--xl {
|
|
27
|
+
width: 48px;
|
|
28
|
+
height: 48px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.emoji--hidden {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import emojiMap from "./emoji-map.json";
|
|
3
|
+
const CDN_BASE = 'https://static.devschile.cl/emoji';
|
|
4
|
+
const EXTENSIONS = ['png', 'gif', 'jpg', 'svg'];
|
|
5
|
+
/**
|
|
6
|
+
* Inline emoji from the devsChile CDN.
|
|
7
|
+
*
|
|
8
|
+
* Given a name (or alias from the emoji map), the component resolves the
|
|
9
|
+
* asset URL and tries each possible file extension until one loads.
|
|
10
|
+
* Size is controlled via the `size` prop.
|
|
11
|
+
*/
|
|
12
|
+
export class ChEmoji {
|
|
13
|
+
extIndex = 0;
|
|
14
|
+
loaded = false;
|
|
15
|
+
/**
|
|
16
|
+
* The emoji name or alias, e.g. `"huemul-love"` or `"heart"`.
|
|
17
|
+
*/
|
|
18
|
+
name;
|
|
19
|
+
/**
|
|
20
|
+
* Accessible alt text for the image. Defaults to the `name` prop.
|
|
21
|
+
*/
|
|
22
|
+
alt;
|
|
23
|
+
/**
|
|
24
|
+
* Size of the emoji. Either `sm`, `md`, `lg`, or `xl`.
|
|
25
|
+
*/
|
|
26
|
+
size = 'md';
|
|
27
|
+
componentWillLoad() {
|
|
28
|
+
this.resolveAsset();
|
|
29
|
+
}
|
|
30
|
+
handleNameChange() {
|
|
31
|
+
this.resolveAsset();
|
|
32
|
+
}
|
|
33
|
+
resolveAsset() {
|
|
34
|
+
this.extIndex = 0;
|
|
35
|
+
this.loaded = false;
|
|
36
|
+
}
|
|
37
|
+
get assetName() {
|
|
38
|
+
return emojiMap[this.name] ?? this.name;
|
|
39
|
+
}
|
|
40
|
+
get currentSrc() {
|
|
41
|
+
return `${CDN_BASE}/${this.assetName}.${EXTENSIONS[this.extIndex]}`;
|
|
42
|
+
}
|
|
43
|
+
handleError = () => {
|
|
44
|
+
if (this.extIndex < EXTENSIONS.length - 1) {
|
|
45
|
+
this.extIndex++;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
handleLoad = () => {
|
|
49
|
+
this.loaded = true;
|
|
50
|
+
};
|
|
51
|
+
render() {
|
|
52
|
+
return (h(Host, { key: 'bfc646f047dae03aa8079825012305d7beb1fa6d' }, h("img", { key: 'c397cc1f928c6871df10adc1f43874738e1cbf33', class: {
|
|
53
|
+
'emoji': true,
|
|
54
|
+
[`emoji--${this.size}`]: true,
|
|
55
|
+
'emoji--hidden': !this.loaded,
|
|
56
|
+
}, src: this.currentSrc, alt: this.alt ?? this.name, onError: this.handleError, onLoad: this.handleLoad })));
|
|
57
|
+
}
|
|
58
|
+
static get is() { return "ch-emoji"; }
|
|
59
|
+
static get encapsulation() { return "shadow"; }
|
|
60
|
+
static get originalStyleUrls() {
|
|
61
|
+
return {
|
|
62
|
+
"$": ["ch-emoji.css"]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
static get styleUrls() {
|
|
66
|
+
return {
|
|
67
|
+
"$": ["ch-emoji.css"]
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
static get properties() {
|
|
71
|
+
return {
|
|
72
|
+
"name": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"mutable": false,
|
|
75
|
+
"complexType": {
|
|
76
|
+
"original": "string",
|
|
77
|
+
"resolved": "string",
|
|
78
|
+
"references": {}
|
|
79
|
+
},
|
|
80
|
+
"required": true,
|
|
81
|
+
"optional": false,
|
|
82
|
+
"docs": {
|
|
83
|
+
"tags": [],
|
|
84
|
+
"text": "The emoji name or alias, e.g. `\"huemul-love\"` or `\"heart\"`."
|
|
85
|
+
},
|
|
86
|
+
"getter": false,
|
|
87
|
+
"setter": false,
|
|
88
|
+
"reflect": false,
|
|
89
|
+
"attribute": "name"
|
|
90
|
+
},
|
|
91
|
+
"alt": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"mutable": false,
|
|
94
|
+
"complexType": {
|
|
95
|
+
"original": "string",
|
|
96
|
+
"resolved": "string",
|
|
97
|
+
"references": {}
|
|
98
|
+
},
|
|
99
|
+
"required": false,
|
|
100
|
+
"optional": true,
|
|
101
|
+
"docs": {
|
|
102
|
+
"tags": [],
|
|
103
|
+
"text": "Accessible alt text for the image. Defaults to the `name` prop."
|
|
104
|
+
},
|
|
105
|
+
"getter": false,
|
|
106
|
+
"setter": false,
|
|
107
|
+
"reflect": false,
|
|
108
|
+
"attribute": "alt"
|
|
109
|
+
},
|
|
110
|
+
"size": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"mutable": false,
|
|
113
|
+
"complexType": {
|
|
114
|
+
"original": "ChEmojiSize",
|
|
115
|
+
"resolved": "\"lg\" | \"md\" | \"sm\" | \"xl\"",
|
|
116
|
+
"references": {
|
|
117
|
+
"ChEmojiSize": {
|
|
118
|
+
"location": "local",
|
|
119
|
+
"path": "/home/runner/work/chucao/chucao/src/components/ch-emoji/ch-emoji.tsx",
|
|
120
|
+
"id": "src/components/ch-emoji/ch-emoji.tsx::ChEmojiSize"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"required": false,
|
|
125
|
+
"optional": false,
|
|
126
|
+
"docs": {
|
|
127
|
+
"tags": [],
|
|
128
|
+
"text": "Size of the emoji. Either `sm`, `md`, `lg`, or `xl`."
|
|
129
|
+
},
|
|
130
|
+
"getter": false,
|
|
131
|
+
"setter": false,
|
|
132
|
+
"reflect": false,
|
|
133
|
+
"attribute": "size",
|
|
134
|
+
"defaultValue": "'md'"
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
static get states() {
|
|
139
|
+
return {
|
|
140
|
+
"extIndex": {},
|
|
141
|
+
"loaded": {}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
static get watchers() {
|
|
145
|
+
return [{
|
|
146
|
+
"propName": "name",
|
|
147
|
+
"methodName": "handleNameChange"
|
|
148
|
+
}];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=ch-emoji.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-emoji.js","sourceRoot":"","sources":["../../../../src/components/ch-emoji/ch-emoji.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AAIxC,MAAM,QAAQ,GAAG,mCAAmC,CAAC;AACrD,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAEhD;;;;;;GAMG;AAMH,MAAM,OAAO,OAAO;IACD,QAAQ,GAAG,CAAC,CAAC;IACb,MAAM,GAAG,KAAK,CAAC;IAEhC;;OAEG;IACK,IAAI,CAAU;IAEtB;;OAEG;IACK,GAAG,CAAU;IAErB;;OAEG;IACK,IAAI,GAAgB,IAAI,CAAC;IAEjC,iBAAiB;QACf,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAGD,gBAAgB;QACd,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,IAAY,SAAS;QACnB,OAAQ,QAAmC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC;IACtE,CAAC;IAED,IAAY,UAAU;QACpB,OAAO,GAAG,QAAQ,IAAI,IAAI,CAAC,SAAS,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;IACtE,CAAC;IAEO,WAAW,GAAG,GAAS,EAAE;QAC/B,IAAI,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1C,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,CAAC;IACH,CAAC,CAAC;IAEM,UAAU,GAAG,GAAS,EAAE;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC,CAAC;IAEF,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DACE,KAAK,EAAE;oBACL,OAAO,EAAE,IAAI;oBACb,CAAC,UAAU,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;oBAC7B,eAAe,EAAE,CAAC,IAAI,CAAC,MAAM;iBAC9B,EACD,GAAG,EAAE,IAAI,CAAC,UAAU,EACpB,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,EAC1B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,GACvB,CACG,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, State, Watch, h } from '@stencil/core';\n\nimport emojiMap from './emoji-map.json';\n\nexport type ChEmojiSize = 'sm' | 'md' | 'lg' | 'xl';\n\nconst CDN_BASE = 'https://static.devschile.cl/emoji';\nconst EXTENSIONS = ['png', 'gif', 'jpg', 'svg'];\n\n/**\n * Inline emoji from the devsChile CDN.\n *\n * Given a name (or alias from the emoji map), the component resolves the\n * asset URL and tries each possible file extension until one loads.\n * Size is controlled via the `size` prop.\n */\n@Component({\n tag: 'ch-emoji',\n styleUrl: 'ch-emoji.css',\n shadow: true,\n})\nexport class ChEmoji {\n @State() private extIndex = 0;\n @State() private loaded = false;\n\n /**\n * The emoji name or alias, e.g. `\"huemul-love\"` or `\"heart\"`.\n */\n @Prop() name!: string;\n\n /**\n * Accessible alt text for the image. Defaults to the `name` prop.\n */\n @Prop() alt?: string;\n\n /**\n * Size of the emoji. Either `sm`, `md`, `lg`, or `xl`.\n */\n @Prop() size: ChEmojiSize = 'md';\n\n componentWillLoad(): void {\n this.resolveAsset();\n }\n\n @Watch('name')\n handleNameChange(): void {\n this.resolveAsset();\n }\n\n private resolveAsset(): void {\n this.extIndex = 0;\n this.loaded = false;\n }\n\n private get assetName(): string {\n return (emojiMap as Record<string, string>)[this.name] ?? this.name;\n }\n\n private get currentSrc(): string {\n return `${CDN_BASE}/${this.assetName}.${EXTENSIONS[this.extIndex]}`;\n }\n\n private handleError = (): void => {\n if (this.extIndex < EXTENSIONS.length - 1) {\n this.extIndex++;\n }\n };\n\n private handleLoad = (): void => {\n this.loaded = true;\n };\n\n render() {\n return (\n <Host>\n <img\n class={{\n 'emoji': true,\n [`emoji--${this.size}`]: true,\n 'emoji--hidden': !this.loaded,\n }}\n src={this.currentSrc}\n alt={this.alt ?? this.name}\n onError={this.handleError}\n onLoad={this.handleLoad}\n />\n </Host>\n );\n }\n}\n"]}
|
|
@@ -109,7 +109,7 @@ export class ChInput {
|
|
|
109
109
|
return undefined;
|
|
110
110
|
}
|
|
111
111
|
render() {
|
|
112
|
-
return (h(Host, { key: '
|
|
112
|
+
return (h(Host, { key: '8a4b7cf5b80097afb849e2de9620fdd205774923' }, this.label && (h("label", { key: '7400206e6c27d61e7b9afadeba8a2131059af59a', class: "label", htmlFor: this.inputId }, this.label)), h("input", { key: '2c4fd9215d5b21f28d57a1c49eeaa64224e21e05', 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: '6e6a381f81442622784afc480eb79327ae8a8525', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '743215633ca399d801c813194b054d40631b7be6', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
113
113
|
}
|
|
114
114
|
static get is() { return "ch-input"; }
|
|
115
115
|
static get encapsulation() { return "shadow"; }
|
|
@@ -159,7 +159,7 @@ export class ChModal {
|
|
|
159
159
|
this.chClose.emit();
|
|
160
160
|
};
|
|
161
161
|
render() {
|
|
162
|
-
return (h(Host, { key: '
|
|
162
|
+
return (h(Host, { key: '8f5f8c340291feb4385076bfdefc02a849e08efe' }, h("dialog", { key: 'e435367c1e3dc5c7e8102f6ac76792394f5097fa', class: "modal", "aria-label": this.label, ref: el => (this.dialog = el) }, h("div", { key: '05a0d306dc7e3f917c47de28ed6359280c0472b8', class: "modal-head" }, h("slot", { key: '79e25ed41f98a5ceee2dca9afc200d8980d9f284', name: "heading" }), this.closeLabel && (h("button", { key: '0620b914cb51cae7ab74f2ccccb25e9fc324811f', class: "modal-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, h("span", { key: 'e2a1e0ec6c1d1cbdb2de684bfe4c7e0ed07ceaee', "aria-hidden": "true" }, "\u00D7")))), h("div", { key: 'af254d18e1538ea5dac06c421ba03d897ddf057d', class: "modal-body" }, h("slot", { key: '645876d63f275108a2a9d27f563bb6918dcb9deb' })))));
|
|
163
163
|
}
|
|
164
164
|
static get is() { return "ch-modal"; }
|
|
165
165
|
static get encapsulation() { return "shadow"; }
|
|
@@ -100,7 +100,7 @@ export class ChRadio {
|
|
|
100
100
|
}
|
|
101
101
|
render() {
|
|
102
102
|
const groupName = this.name || `${this.groupId}-group`;
|
|
103
|
-
return (h(Host, { key: '
|
|
103
|
+
return (h(Host, { key: '2d0f02cbeae89b8c60664825f3885bbeeafd896a' }, this.label && (h("span", { key: 'c32fd25be5eaf0d05c2d8d6aae01dda281f4b952', class: "group-label", id: this.labelId }, this.label)), h("div", { key: 'bd05a360ad1fd794c95d8066dbb93300152a88dc', 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: '8c451f8d166c6002a4f30bfb72acd6b863ec38c2', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '8ac12f60e463c908dff76d64d7ae0e216ed51489', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
104
104
|
}
|
|
105
105
|
static get is() { return "ch-radio"; }
|
|
106
106
|
static get encapsulation() { return "shadow"; }
|
|
@@ -101,7 +101,7 @@ export class ChSelect {
|
|
|
101
101
|
return undefined;
|
|
102
102
|
}
|
|
103
103
|
render() {
|
|
104
|
-
return (h(Host, { key: '
|
|
104
|
+
return (h(Host, { key: 'ffca23504c723f60f7430e6db2e1fa00db1fd4d8' }, this.label && (h("label", { key: '697998ec67f01f3ca2849b1fb2aa88790d98010b', class: "label", htmlFor: this.selectId }, this.label)), h("select", { key: 'f344d240f38dd123bdfd2d34cd15fbc7b5ae0a2c', 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: '34200e96dad92ed55632f0430abde5bc34cf6e6a', 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: '55690dbf57cad7c974d0bf1b8eedb733ddc5b571', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '7d4598b112d21ebc96ac04bca553f63dd5825996', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
105
105
|
}
|
|
106
106
|
static get is() { return "ch-select"; }
|
|
107
107
|
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: '9182eecf066be099714a870fa601f744362e697d' }, h("span", { key: 'd67f2572ab80facadd4d49043a892b16816b4fef', 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"; }
|
|
@@ -97,7 +97,7 @@ export class ChSwitch {
|
|
|
97
97
|
return undefined;
|
|
98
98
|
}
|
|
99
99
|
render() {
|
|
100
|
-
return (h(Host, { key: '
|
|
100
|
+
return (h(Host, { key: 'c1a98e9b04710ed014a8c18d6591fee427df0033' }, h("label", { key: '4b14ec7d7709090235b0e9b74a45d4c76dd52f25', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, h("input", { key: '4f2c9472b3bf34db582a94e307cc8b47b5dfcd38', 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: '6b2c20c6242178bba39f105a535bb12fc5198cd0', class: "track" }, h("span", { key: '4ae0e675ce335417b867f6b688ec5545769b2d2c', class: "thumb" })), this.label && h("span", { key: 'd5383fac3349441104c0926a6c88078b85bda05c', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '41ed07a95f8d627fb4ed8c903b6ba5ee39baa6a5', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '71cf8526dec44e2099235e3bc744db2aa53d70f0', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
101
101
|
}
|
|
102
102
|
static get is() { return "ch-switch"; }
|
|
103
103
|
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: '7c6b34c34e73f034eb03473ad9941eade91317c3' }, h("div", { key: '601bae37f4fb3e5e0d07fb7a91968171b0bd18a3', 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}` }))))));
|
|
@@ -110,7 +110,7 @@ export class ChTextarea {
|
|
|
110
110
|
return undefined;
|
|
111
111
|
}
|
|
112
112
|
render() {
|
|
113
|
-
return (h(Host, { key: '
|
|
113
|
+
return (h(Host, { key: '6e738612514b114571c1edfad0fb85e2228653a8' }, this.label && (h("label", { key: '3b58b49a02dd532430cfd9096c326288a5120d6d', class: "label", htmlFor: this.textareaId }, this.label)), h("textarea", { key: '0922df038ea6ce6d1567ffe8d02c5b65534bec7a', 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: '6d3518345b9afaad782741a854053ed2b32e31db', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '8a26edd5a1ef3647133813003fb1a53b1a5f99d6', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
114
114
|
}
|
|
115
115
|
static get is() { return "ch-textarea"; }
|
|
116
116
|
static get encapsulation() { return "shadow"; }
|
|
@@ -79,7 +79,7 @@ export class ChTooltip {
|
|
|
79
79
|
trigger.setAttribute('aria-describedby', content.id);
|
|
80
80
|
};
|
|
81
81
|
render() {
|
|
82
|
-
return (h(Host, { key: '
|
|
82
|
+
return (h(Host, { key: 'cebea73595fe515f952e60c72c42e92888e57133' }, h("span", { key: 'c2eadb27d9d89b19d821ae1da93dcb7125d07bb0', class: "anchor" }, h("slot", { key: '9eccdd49e741ffaed3d7d95c54697666e6e13cf0', name: "trigger", onSlotchange: this.associate }), h("span", { key: '0842bbc4061da0be353e58bc897548e75c730e43', class: { 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible } }, h("slot", { key: '43812aac1e6e2853057e6d34f484906a17b16a5a', name: "content", onSlotchange: this.associate })))));
|
|
83
83
|
}
|
|
84
84
|
static get is() { return "ch-tooltip"; }
|
|
85
85
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,t,H as
|
|
1
|
+
import{p as e,t,H as r,c as a,h as i,d as o}from"./p-BhAZrOxf.js";const s=()=>`:host{display:block}.item{background:var(--surface);border:var(--border-width) solid var(--border);border-radius:var(--radius);transition:border-color var(--duration-normal) var(--easing-default)}.item+.item{margin-top:var(--spacing-md)}.item--open{border-color:var(--border-hover)}.item-head{margin:0}.item-toggle{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-lg);width:100%;padding:var(--spacing-2xl) var(--spacing-3xl);background:transparent;border:none;color:var(--text);font-family:inherit;font-size:inherit;font-weight:var(--typography-weight-semibold);cursor:pointer}.item-toggle::after{content:'';width:var(--spacing-md);height:var(--spacing-md);flex-shrink:0;border-right:var(--border-width) solid var(--text-muted);border-bottom:var(--border-width) solid var(--text-muted);transform:rotate(45deg);transition:transform var(--duration-normal) var(--easing-default)}.item--open .item-toggle::after{transform:rotate(-135deg)}.item-toggle:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.item-toggle:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.item-panel{padding:0 var(--spacing-3xl) var(--spacing-3xl);color:var(--text-muted)}.item-panel[hidden]{display:none}`;let n=0;const d=e(class e extends r{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=a(this,"chChange")}baseId=`ch-accordion-${++n}`;items=[];value;chChange;headerId(e){return`${this.baseId}-${e}-header`}panelId(e){return`${this.baseId}-${e}-panel`}toggle=e=>{this.value=this.value===e?undefined:e;this.chChange.emit(this.value)};render(){return i(o,{key:"a0b6859c9efc45b158825f2b44aab73a5eb63f0b"},this.items.map((e=>{const t=this.value===e.value;return i("div",{key:e.value,class:{item:true,"item--open":t}},i("h3",{class:"item-head"},i("button",{type:"button",class:"item-toggle",id:this.headerId(e.value),"data-value":e.value,"aria-expanded":t?"true":"false","aria-controls":this.panelId(e.value),disabled:e.disabled,onClick:()=>this.toggle(e.value)},e.title)),i("div",{class:"item-panel",id:this.panelId(e.value),role:"region","aria-labelledby":this.headerId(e.value),hidden:!t},i("slot",{name:`panel-${e.value}`})))})))}static get style(){return s()}},[769,"ch-accordion",{items:[16],value:[1025]}]);function l(){if(typeof customElements==="undefined"){return}const e=["ch-accordion"];e.forEach((e=>{switch(e){case"ch-accordion":if(!customElements.get(t(e))){customElements.define(t(e),d)}break}}))}l();const c=d;const h=l;export{c as ChAccordion,h as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-accordion.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as r,H as s,c as e,h as a,d as t,t as i}from"./p-
|
|
1
|
+
import{p as r,H as s,c as e,h as a,d as t,t as i}from"./p-BhAZrOxf.js";const o=()=>`:host{display:block}.alert{display:flex;align-items:flex-start;gap:var(--spacing-2xl);padding:var(--spacing-2xl) var(--spacing-3xl);border:var(--border-width) solid transparent;border-radius:var(--radius);font-size:var(--typography-size-sm);line-height:1.5}.alert-content{flex:1;min-width:0;overflow-wrap:anywhere}.alert--default{color:var(--text);background:var(--surface);border-color:var(--border)}.alert--positive{color:var(--color-status-positive);background:var(--color-status-positive-background);border-color:var(--color-status-positive)}.alert--warning{color:var(--color-status-warning);background:var(--color-status-warning-background);border-color:var(--color-status-warning)}.alert-dismiss{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:var(--spacing-2xs) var(--spacing-md);border:0;border-radius:var(--radius);background:none;color:inherit;cursor:pointer;font-family:var(--font-heading);font-size:var(--typography-size-lg);line-height:1;transition:background-color var(--duration-normal) var(--easing-default)}.alert-dismiss:hover{background:var(--surface-hover)}.alert-dismiss:focus-visible{outline:var(--focus-outline-width) solid currentColor;outline-offset:var(--focus-outline-offset)}@media (pointer: coarse){.alert-dismiss{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.alert-dismiss{transition:none}}`;const n=r(class r extends s{constructor(r){super();if(r!==false){this.__registerHost()}this.__attachShadow();this.chDismiss=e(this,"chDismiss")}variant="default";dismissLabel;chDismiss;handleDismiss=()=>{this.chDismiss.emit()};render(){const r=this.variant==="warning"?"alert":"status";return a(t,{key:"7d96602ad2c2b3824588f01d5b94d73098da6ce4"},a("div",{key:r,class:{alert:true,[`alert--${this.variant}`]:true},role:r},a("div",{key:"64d7af5aad0e4b103b35cc2ba3756b1a1601b148",class:"alert-content"},a("slot",{key:"44573092407161bbeafe5117bddb54168b183d90"})),this.dismissLabel&&a("button",{key:"018858ac292c0fb7f26c788f629638f533d0dfd6",class:"alert-dismiss",type:"button","aria-label":this.dismissLabel,onClick:this.handleDismiss},a("span",{key:"f6454d5285ed9c7c414d839d2d35d2ce0c271dd4","aria-hidden":"true"},"×"))))}static get style(){return o()}},[769,"ch-alert",{variant:[1],dismissLabel:[1,"dismiss-label"]}]);function d(){if(typeof customElements==="undefined"){return}const r=["ch-alert"];r.forEach((r=>{switch(r){case"ch-alert":if(!customElements.get(i(r))){customElements.define(i(r),n)}break}}))}d();const l=n;const c=d;export{l as ChAlert,c as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-alert.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as a,H as e,h as t,d as r,t as s}from"./p-
|
|
1
|
+
import{p as a,H as e,h as t,d as r,t as s}from"./p-BhAZrOxf.js";const o=()=>`:host{display:inline-block}.badge{display:inline-block;padding:var(--spacing-2xs) var(--spacing-lg);border-radius:var(--radius-pill);font-size:var(--typography-size-xs);font-weight:var(--typography-weight-semibold);text-transform:uppercase;letter-spacing:var(--typography-tracking-badge)}.badge--default{background:var(--color-surface-hover);color:var(--accent)}.badge--positive{background:var(--color-status-positive-background);color:var(--color-status-positive)}.badge--warning{background:var(--color-status-warning-background);color:var(--color-status-warning)}`;const c=a(class a extends e{constructor(a){super();if(a!==false){this.__registerHost()}this.__attachShadow()}variant="default";render(){return t(r,{key:"ca1fb0c9d678b6ea5b68ca131ba153116bbd577d"},t("span",{key:"929e2268094bdad7df6e3c8371896e364ebf79c3",class:{badge:true,[`badge--${this.variant}`]:true}},t("slot",{key:"64422988ad046244722755d39e564295f79a6ce1"})))}static get style(){return o()}},[769,"ch-badge",{variant:[1]}]);function n(){if(typeof customElements==="undefined"){return}const a=["ch-badge"];a.forEach((a=>{switch(a){case"ch-badge":if(!customElements.get(s(a))){customElements.define(s(a),c)}break}}))}n();const i=c;const d=n;export{i as ChBadge,d as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-badge.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as a,H as r,c as t,h as e,d as o,t as n}from"./p-
|
|
1
|
+
import{p as a,H as r,c as t,h as e,d as o,t as n}from"./p-BhAZrOxf.js";const i=()=>`:host{display:inline-block}.btn{display:inline-flex;align-items:center;gap:var(--spacing-sm);border:none;cursor:pointer;font-family:inherit;font-size:inherit}.btn:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.btn:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.btn--primary{background-color:var(--accent);color:var(--color-accent-text);font-weight:var(--typography-weight-bold);padding:var(--spacing-xs) var(--spacing-xl);border-radius:var(--radius-pill);transition:background-color var(--duration-normal) var(--easing-default), transform var(--duration-fast) var(--easing-default)}.btn--primary:hover{background-color:var(--accent-hover);transform:translateY(calc(-1 * var(--spacing-elevate)))}.btn--secondary{background-color:transparent;color:var(--text);font-weight:var(--typography-weight-bold);padding:var(--spacing-xs) var(--spacing-xl);border-radius:var(--radius-pill);border:var(--border-width) solid var(--border);transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), transform var(--duration-fast) var(--easing-default)}.btn--secondary:hover{border-color:var(--border-hover);background-color:var(--surface-hover);transform:translateY(calc(-1 * var(--spacing-elevate)))}`;const s=a(class a extends r{constructor(a){super();if(a!==false){this.__registerHost()}this.__attachShadow();this.chClick=t(this,"chClick")}variant="primary";disabled=false;label;chClick;handleClick=a=>{this.chClick.emit(a)};render(){return e(o,{key:"9363b49e8d38c0fab49ed10356380ded20a8cf5e"},e("button",{key:"3c98506ae1418c4bc88f5aa72dfe058948556ed5",class:{btn:true,[`btn--${this.variant}`]:true},type:"button",disabled:this.disabled,"aria-label":this.label,onClick:this.handleClick},e("slot",{key:"cdcf4f656b995fa527d4139a41b2ea3c7086e065"})))}static get style(){return i()}},[769,"ch-button",{variant:[1],disabled:[4],label:[1]}]);function c(){if(typeof customElements==="undefined"){return}const a=["ch-button"];a.forEach((a=>{switch(a){case"ch-button":if(!customElements.get(n(a))){customElements.define(n(a),s)}break}}))}c();const l=s;const d=c;export{l as ChButton,d as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-button.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as r,H as a,h as e,d as o,t}from"./p-
|
|
1
|
+
import{p as r,H as a,h as e,d as o,t}from"./p-BhAZrOxf.js";const d=()=>`:host{display:block}::slotted(p){color:var(--text-muted)}.card{color:var(--text);background:var(--surface);border:var(--border-width) solid var(--border);border-radius:var(--radius);padding:var(--spacing-4xl) var(--spacing-5xl);backdrop-filter:blur(var(--effect-blur));position:relative;overflow:hidden;transition:border-color var(--duration-normal) var(--easing-default), transform var(--duration-fast) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.card::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var(--border-accent-bar);background:var(--accent);opacity:0;transition:opacity var(--duration-normal) var(--easing-default)}.card:hover{border-color:var(--border-hover);transform:translateX(var(--spacing-shift));box-shadow:var(--shadow-card-hover)}.card:hover::before{opacity:1}`;const s=r(class r extends a{constructor(r){super();if(r!==false){this.__registerHost()}this.__attachShadow()}render(){return e(o,{key:"de570a460eff697eb242ef56fcedd5b400d6b03f"},e("div",{key:"3350619356a929c5d922948d52d6635420dc8547",class:"card"},e("slot",{key:"b50679202b5fea142702de0babf62587186d4dc8"})))}static get style(){return d()}},[257,"ch-card"]);function c(){if(typeof customElements==="undefined"){return}const r=["ch-card"];r.forEach((r=>{switch(r){case"ch-card":if(!customElements.get(t(r))){customElements.define(t(r),s)}break}}))}c();const n=s;const i=c;export{n as ChCard,i as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-card.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as i,h as s,d as r,t as a}from"./p-
|
|
1
|
+
import{p as e,H as t,c as i,h as s,d as r,t as a}from"./p-BhAZrOxf.js";const n=()=>`:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let o=0;const c=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=i(this,"chChange");this.internals=this.attachInternals()}checkboxId=`ch-checkbox-${++o}`;hintId=`${this.checkboxId}-hint`;errorId=`${this.checkboxId}-error`;initialChecked=false;internals;formDisabled=false;get host(){return this}label;name;value="on";checked=false;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=e=>{this.checked=e.target.checked;this.chChange.emit(this.checked)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.checked?this.value:null);const t={};let i;if(this.required&&!this.checked){t.valueMissing=true}if(this.invalid&&this.errorMessage){t.customError=true}i=this.errorMessage??(t.valueMissing?"Please fill out this field.":undefined);e.setValidity(t,i)}componentDidLoad(){this.initialChecked=this.checked;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.checked=this.initialChecked}formDisabledCallback(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return s(r,{key:"ad83b999d4dbafbd7b6f2369bae8fbce8e068cad"},s("label",{key:"e5927ad9d76db7cd9418debe8e635767b597e27a",class:{control:true,"control--disabled":this.disabled||this.formDisabled},htmlFor:this.checkboxId},s("input",{key:"93c49822bf5a470d67a7077354adcd9144643843",id:this.checkboxId,class:{input:true,"input--invalid":this.invalid},type:"checkbox",name:this.name,value:this.value,checked:this.checked,disabled:this.disabled||this.formDisabled,required:this.required,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),this.label&&s("span",{key:"da90747e3339879a744569c98befed94507bebdd",class:"label-text"},this.label)),this.hint&&!(this.invalid&&this.errorMessage)&&s("p",{key:"3c10c9e29a943bc12983d4ef6b9fa00d95293c80",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&s("p",{key:"76e4a8debadd36dae475bd2439410c0f2a82cb62",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[577,"ch-checkbox",{label:[1],name:[513],value:[1],checked:[1028],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const e=["ch-checkbox"];e.forEach((e=>{switch(e){case"ch-checkbox":if(!customElements.get(a(e))){customElements.define(a(e),c)}break}}))}d();const l=c;const h=d;export{l as ChCheckbox,h as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-checkbox.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as i,h as t,d as r,t as d}from"./p-
|
|
1
|
+
import{p as e,H as i,h as t,d as r,t as d}from"./p-BhAZrOxf.js";const s=()=>`:host{display:block}:host(.divider--vertical){display:inline-block;height:100%;align-self:stretch}.divider{margin:0;border:none;background:var(--border)}.divider--horizontal{width:100%;height:var(--border-width)}.divider--vertical{width:var(--border-width);height:100%}`;const a=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}orientation="horizontal";render(){return t(r,{key:"888debaaee690d5bbc5e276773f16ac7ead0129a",class:{"divider--vertical":this.orientation==="vertical"}},t("hr",{key:"ae175f047605cfbe2b24d50e0dab56ac362c49a1",class:{divider:true,[`divider--${this.orientation}`]:true},"aria-orientation":this.orientation}))}static get style(){return s()}},[513,"ch-divider",{orientation:[1]}]);function o(){if(typeof customElements==="undefined"){return}const e=["ch-divider"];e.forEach((e=>{switch(e){case"ch-divider":if(!customElements.get(d(e))){customElements.define(d(e),a)}break}}))}o();const c=a;const n=o;export{c as ChDivider,n as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-divider.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChEmoji extends Components.ChEmoji, HTMLElement {}
|
|
4
|
+
export const ChEmoji: {
|
|
5
|
+
prototype: ChEmoji;
|
|
6
|
+
new (): ChEmoji;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as t,h as o,d as s,t as n}from"./p-BhAZrOxf.js";const i="aaaa";const a="ameno";const h="huemul-love";const l="huemul-love";const c="humo";const m="hypnotoad";const d="lmao";const r="loading";const u="loco";const g="loco2";const f="lol";const p="lol2";const j="monea";const x="negative";var v={aaaa:i,ameno:a,"huemul-huaso":"huemul-huaso","huemul-love":"huemul-love",heart:h,love:l,"huemul-trusted":"huemul-trusted",humo:c,hypnotoad:m,"lets-fucking-go":"lets-fucking-go",lmao:d,loading:r,loco:u,loco2:g,lol:f,lol2:p,monea:j,negative:x};const y=()=>`:host{display:inline-block;vertical-align:middle}.emoji{display:block;object-fit:contain}.emoji--sm{width:16px;height:16px}.emoji--md{width:24px;height:24px}.emoji--lg{width:32px;height:32px}.emoji--xl{width:48px;height:48px}.emoji--hidden{display:none}`;const b="https://static.devschile.cl/emoji";const k=["png","gif","jpg","svg"];const w=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}extIndex=0;loaded=false;name;alt;size="md";componentWillLoad(){this.resolveAsset()}handleNameChange(){this.resolveAsset()}resolveAsset(){this.extIndex=0;this.loaded=false}get assetName(){return v[this.name]??this.name}get currentSrc(){return`${b}/${this.assetName}.${k[this.extIndex]}`}handleError=()=>{if(this.extIndex<k.length-1){this.extIndex++}};handleLoad=()=>{this.loaded=true};render(){return o(s,{key:"bfc646f047dae03aa8079825012305d7beb1fa6d"},o("img",{key:"c397cc1f928c6871df10adc1f43874738e1cbf33",class:{emoji:true,[`emoji--${this.size}`]:true,"emoji--hidden":!this.loaded},src:this.currentSrc,alt:this.alt??this.name,onError:this.handleError,onLoad:this.handleLoad}))}static get watchers(){return{name:[{handleNameChange:0}]}}static get style(){return y()}},[513,"ch-emoji",{name:[1],alt:[1],size:[1],extIndex:[32],loaded:[32]},undefined,{name:[{handleNameChange:0}]}]);function E(){if(typeof customElements==="undefined"){return}const e=["ch-emoji"];e.forEach((e=>{switch(e){case"ch-emoji":if(!customElements.get(n(e))){customElements.define(n(e),w)}break}}))}E();const N=w;const $=E;export{N as ChEmoji,$ as defineCustomElement};
|
|
2
|
+
//# sourceMappingURL=ch-emoji.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["chEmojiCss","CDN_BASE","EXTENSIONS","ChEmoji","__stencil_proxyCustomElement","HTMLElement","extIndex","loaded","name","alt","size","componentWillLoad","this","resolveAsset","handleNameChange","assetName","emojiMap","currentSrc","handleError","length","handleLoad","render","h","Host","key","class","emoji","src","onError","onLoad"],"sources":["src/components/ch-emoji/ch-emoji.css?tag=ch-emoji&encapsulation=shadow","src/components/ch-emoji/ch-emoji.tsx"],"sourcesContent":[":host {\n display: inline-block;\n vertical-align: middle;\n}\n\n.emoji {\n display: block;\n object-fit: contain;\n}\n\n.emoji--sm {\n width: 16px;\n height: 16px;\n}\n\n.emoji--md {\n width: 24px;\n height: 24px;\n}\n\n.emoji--lg {\n width: 32px;\n height: 32px;\n}\n\n.emoji--xl {\n width: 48px;\n height: 48px;\n}\n\n.emoji--hidden {\n display: none;\n}\n","import { Component, Host, Prop, State, Watch, h } from '@stencil/core';\n\nimport emojiMap from './emoji-map.json';\n\nexport type ChEmojiSize = 'sm' | 'md' | 'lg' | 'xl';\n\nconst CDN_BASE = 'https://static.devschile.cl/emoji';\nconst EXTENSIONS = ['png', 'gif', 'jpg', 'svg'];\n\n/**\n * Inline emoji from the devsChile CDN.\n *\n * Given a name (or alias from the emoji map), the component resolves the\n * asset URL and tries each possible file extension until one loads.\n * Size is controlled via the `size` prop.\n */\n@Component({\n tag: 'ch-emoji',\n styleUrl: 'ch-emoji.css',\n shadow: true,\n})\nexport class ChEmoji {\n @State() private extIndex = 0;\n @State() private loaded = false;\n\n /**\n * The emoji name or alias, e.g. `\"huemul-love\"` or `\"heart\"`.\n */\n @Prop() name!: string;\n\n /**\n * Accessible alt text for the image. Defaults to the `name` prop.\n */\n @Prop() alt?: string;\n\n /**\n * Size of the emoji. Either `sm`, `md`, `lg`, or `xl`.\n */\n @Prop() size: ChEmojiSize = 'md';\n\n componentWillLoad(): void {\n this.resolveAsset();\n }\n\n @Watch('name')\n handleNameChange(): void {\n this.resolveAsset();\n }\n\n private resolveAsset(): void {\n this.extIndex = 0;\n this.loaded = false;\n }\n\n private get assetName(): string {\n return (emojiMap as Record<string, string>)[this.name] ?? this.name;\n }\n\n private get currentSrc(): string {\n return `${CDN_BASE}/${this.assetName}.${EXTENSIONS[this.extIndex]}`;\n }\n\n private handleError = (): void => {\n if (this.extIndex < EXTENSIONS.length - 1) {\n this.extIndex++;\n }\n };\n\n private handleLoad = (): void => {\n this.loaded = true;\n };\n\n render() {\n return (\n <Host>\n <img\n class={{\n 'emoji': true,\n [`emoji--${this.size}`]: true,\n 'emoji--hidden': !this.loaded,\n }}\n src={this.currentSrc}\n alt={this.alt ?? this.name}\n onError={this.handleError}\n onLoad={this.handleLoad}\n />\n </Host>\n );\n }\n}\n"],"mappings":"uiBAAA,MAAMA,EAAa,IAAM,gQCMzB,MAAMC,EAAW,oCACjB,MAAMC,EAAa,CAAC,MAAO,MAAO,MAAO,O,MAc5BC,EAAOC,EAAA,MAAAD,UAAAE,E,iFACDC,SAAW,EACXC,OAAS,MAKlBC,KAKAC,IAKAC,KAAoB,KAE5B,iBAAAC,GACEC,KAAKC,c,CAIP,gBAAAC,GACEF,KAAKC,c,CAGC,YAAAA,GACND,KAAKN,SAAW,EAChBM,KAAKL,OAAS,K,CAGhB,aAAYQ,GACV,OAAQC,EAAoCJ,KAAKJ,OAASI,KAAKJ,I,CAGjE,cAAYS,GACV,MAAO,GAAGhB,KAAYW,KAAKG,aAAab,EAAWU,KAAKN,W,CAGlDY,YAAc,KACpB,GAAIN,KAAKN,SAAWJ,EAAWiB,OAAS,EAAG,CACzCP,KAAKN,U,GAIDc,WAAa,KACnBR,KAAKL,OAAS,IAAI,EAGpB,MAAAc,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,OAAAE,IAAA,2CACEC,MAAO,CACLC,MAAS,KACT,CAAC,UAAUd,KAAKF,QAAS,KACzB,iBAAkBE,KAAKL,QAEzBoB,IAAKf,KAAKK,WACVR,IAAKG,KAAKH,KAAOG,KAAKJ,KACtBoB,QAAShB,KAAKM,YACdW,OAAQjB,KAAKQ,a","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as i,c as
|
|
1
|
+
import{p as t,H as i,c as r,h as e,d as s,t as a}from"./p-BhAZrOxf.js";const o=()=>`:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.input{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input::placeholder{color:var(--text-muted)}.input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus,:host(:user-invalid) .input:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.input:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let n=0;const h=t(class t extends i{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chInput=r(this,"chInput");this.chChange=r(this,"chChange");this.internals=this.attachInternals()}inputId=`ch-input-${++n}`;hintId=`${this.inputId}-hint`;errorId=`${this.inputId}-error`;initialValue="";internals;formDisabled=false;get host(){return this}label;type="text";value="";placeholder;name;disabled=false;required=false;hint;errorMessage;invalid=false;chInput;chChange;handleInput=t=>{this.value=t.target.value;this.chInput.emit(this.value)};handleChange=t=>{this.value=t.target.value;this.chChange.emit(this.value)};syncForm(){const t=this.internals;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(this.value);const i={};let r;if(this.required&&this.value===""){i.valueMissing=true}if(this.invalid&&this.errorMessage){i.customError=true}r=this.errorMessage??(i.valueMissing?"Please fill out this field.":undefined);t.setValidity(i,r)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(t){this.formDisabled=t}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return e(s,{key:"8a4b7cf5b80097afb849e2de9620fdd205774923"},this.label&&e("label",{key:"7400206e6c27d61e7b9afadeba8a2131059af59a",class:"label",htmlFor:this.inputId},this.label),e("input",{key:"2c4fd9215d5b21f28d57a1c49eeaa64224e21e05",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)&&e("p",{key:"6e6a381f81442622784afc480eb79327ae8a8525",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&e("p",{key:"743215633ca399d801c813194b054d40631b7be6",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return o()}},[577,"ch-input",{label:[1],type:[1],value:[1025],placeholder:[1],name:[513],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const t=["ch-input"];t.forEach((t=>{switch(t){case"ch-input":if(!customElements.get(a(t))){customElements.define(a(t),h)}break}}))}d();const l=h;const c=d;export{l as ChInput,c as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-input.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as
|
|
1
|
+
import{p as t,H as e,c as r,h as i,d as n,t as a}from"./p-BhAZrOxf.js";const o=()=>`:host{display:inline}.link{color:var(--accent);font-weight:var(--typography-weight-semibold);text-decoration:var(--ch-link-text-decoration, underline);text-decoration-thickness:var(--border-width);text-underline-offset:var(--spacing-shift);border-radius:var(--radius-sm);transition:color var(--duration-normal) var(--easing-default), opacity var(--duration-normal) var(--easing-default)}.link:hover{color:var(--accent-hover)}.link:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.link--muted{color:var(--text-muted);text-decoration:none}.link--muted:hover{color:var(--text)}.link--disabled{color:var(--text-muted);text-decoration:none;opacity:var(--opacity-disabled);cursor:not-allowed}`;const s=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chClick=r(this,"chClick")}href;target;variant="default";disabled=false;chClick;handleClick=t=>{this.chClick.emit(t)};render(){if(this.disabled){return i(n,null,i("span",{class:{link:true,[`link--${this.variant}`]:true,"link--disabled":true},part:"link","aria-disabled":"true"},i("slot",null)))}return i(n,null,i("a",{class:{link:true,[`link--${this.variant}`]:true},part:"link",href:this.href,target:this.target,rel:this.target==="_blank"?"noopener noreferrer":undefined,onClick:this.handleClick},i("slot",null)))}static get style(){return o()}},[769,"ch-link",{href:[1],target:[1],variant:[1],disabled:[4]}]);function l(){if(typeof customElements==="undefined"){return}const t=["ch-link"];t.forEach((t=>{switch(t){case"ch-link":if(!customElements.get(a(t))){customElements.define(a(t),s)}break}}))}l();const c=s;const d=l;export{c as ChLink,d as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ch-link.js.map
|