@devschile/chucao 1.0.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/LICENSE +21 -0
- package/README.md +358 -0
- package/dist/chucao/chucao.css +2 -0
- package/dist/chucao/chucao.esm.js +2 -0
- package/dist/chucao/chucao.esm.js.map +1 -0
- package/dist/chucao/fonts/fira-sans-latin-400-normal.woff2 +0 -0
- package/dist/chucao/fonts/fira-sans-latin-600-normal.woff2 +0 -0
- package/dist/chucao/fonts/fira-sans-latin-700-normal.woff2 +0 -0
- package/dist/chucao/fonts/inconsolata-latin-400-normal.woff2 +0 -0
- package/dist/chucao/index.esm.js +2 -0
- package/dist/chucao/index.esm.js.map +1 -0
- package/dist/chucao/p-2eeff869.entry.js +2 -0
- package/dist/chucao/p-2eeff869.entry.js.map +1 -0
- package/dist/chucao/p-QBEhw78y.js +3 -0
- package/dist/chucao/p-QBEhw78y.js.map +1 -0
- package/dist/cjs/ch-badge_5.cjs.entry.js +187 -0
- package/dist/cjs/ch-badge_5.cjs.entry.js.map +1 -0
- package/dist/cjs/chucao.cjs.js +27 -0
- package/dist/cjs/chucao.cjs.js.map +1 -0
- package/dist/cjs/index-Do8JpTKQ.js +1485 -0
- package/dist/cjs/index-Do8JpTKQ.js.map +1 -0
- package/dist/cjs/index.cjs.js +98 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +17 -0
- package/dist/collection/components/ch-badge/ch-badge.css +27 -0
- package/dist/collection/components/ch-badge/ch-badge.js +53 -0
- package/dist/collection/components/ch-badge/ch-badge.js.map +1 -0
- package/dist/collection/components/ch-button/ch-button.css +58 -0
- package/dist/collection/components/ch-button/ch-button.js +132 -0
- package/dist/collection/components/ch-button/ch-button.js.map +1 -0
- package/dist/collection/components/ch-card/ch-card.css +44 -0
- package/dist/collection/components/ch-card/ch-card.js +19 -0
- package/dist/collection/components/ch-card/ch-card.js.map +1 -0
- package/dist/collection/components/ch-input/ch-input.css +43 -0
- package/dist/collection/components/ch-input/ch-input.js +240 -0
- package/dist/collection/components/ch-input/ch-input.js.map +1 -0
- package/dist/collection/components/ch-select/ch-select.css +45 -0
- package/dist/collection/components/ch-select/ch-select.js +220 -0
- package/dist/collection/components/ch-select/ch-select.js.map +1 -0
- package/dist/collection/fonts/fira-sans-latin-400-normal.woff2 +0 -0
- package/dist/collection/fonts/fira-sans-latin-600-normal.woff2 +0 -0
- package/dist/collection/fonts/fira-sans-latin-700-normal.woff2 +0 -0
- package/dist/collection/fonts/inconsolata-latin-400-normal.woff2 +0 -0
- package/dist/collection/index.js +11 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/tokens/tokens.js +70 -0
- package/dist/collection/tokens/tokens.js.map +1 -0
- package/dist/collection/tokens/types.js +2 -0
- package/dist/collection/tokens/types.js.map +1 -0
- package/dist/components/ch-badge.d.ts +11 -0
- package/dist/components/ch-badge.js +2 -0
- package/dist/components/ch-badge.js.map +1 -0
- package/dist/components/ch-button.d.ts +11 -0
- package/dist/components/ch-button.js +2 -0
- package/dist/components/ch-button.js.map +1 -0
- package/dist/components/ch-card.d.ts +11 -0
- package/dist/components/ch-card.js +2 -0
- package/dist/components/ch-card.js.map +1 -0
- package/dist/components/ch-input.d.ts +11 -0
- package/dist/components/ch-input.js +2 -0
- package/dist/components/ch-input.js.map +1 -0
- package/dist/components/ch-select.d.ts +11 -0
- package/dist/components/ch-select.js +2 -0
- package/dist/components/ch-select.js.map +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/p-BImgfbXx.js +2 -0
- package/dist/components/p-BImgfbXx.js.map +1 -0
- package/dist/esm/ch-badge_5.entry.js +181 -0
- package/dist/esm/ch-badge_5.entry.js.map +1 -0
- package/dist/esm/chucao.js +23 -0
- package/dist/esm/chucao.js.map +1 -0
- package/dist/esm/index-QBEhw78y.js +1476 -0
- package/dist/esm/index-QBEhw78y.js.map +1 -0
- package/dist/esm/index.js +74 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/ch-badge/ch-badge.d.ts +8 -0
- package/dist/types/components/ch-button/ch-button.d.ts +24 -0
- package/dist/types/components/ch-card/ch-card.d.ts +3 -0
- package/dist/types/components/ch-input/ch-input.d.ts +44 -0
- package/dist/types/components/ch-select/ch-select.d.ts +44 -0
- package/dist/types/components.d.ts +348 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/stencil-public-runtime.d.ts +1861 -0
- package/dist/types/tokens/tokens.d.ts +69 -0
- package/dist/types/tokens/types.d.ts +5 -0
- package/dist-react/components.d.ts +29 -0
- package/dist-react/components.js +51 -0
- package/dist-react/components.ts +81 -0
- package/dist-vue/index.d.ts +7 -0
- package/dist-vue/index.js +47 -0
- package/dist-vue/index.ts +63 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +125 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
let inputIds = 0;
|
|
3
|
+
export class ChInput {
|
|
4
|
+
inputId = `ch-input-${++inputIds}`;
|
|
5
|
+
/**
|
|
6
|
+
* Visible label rendered above the input and associated with it via
|
|
7
|
+
* `for`/`id`, so assistive technology announces the input's purpose.
|
|
8
|
+
*/
|
|
9
|
+
label;
|
|
10
|
+
/**
|
|
11
|
+
* The type of the input, mirroring the native `<input type>` attribute.
|
|
12
|
+
*/
|
|
13
|
+
type = 'text';
|
|
14
|
+
/**
|
|
15
|
+
* The value of the input.
|
|
16
|
+
*/
|
|
17
|
+
value = '';
|
|
18
|
+
/**
|
|
19
|
+
* Placeholder text shown when the input is empty.
|
|
20
|
+
*/
|
|
21
|
+
placeholder;
|
|
22
|
+
/**
|
|
23
|
+
* The name of the input, submitted with form data.
|
|
24
|
+
*/
|
|
25
|
+
name;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the input is disabled.
|
|
28
|
+
*/
|
|
29
|
+
disabled = false;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the input is required.
|
|
32
|
+
*/
|
|
33
|
+
required = false;
|
|
34
|
+
/**
|
|
35
|
+
* Emitted on every keystroke, with the current input value.
|
|
36
|
+
*/
|
|
37
|
+
chInput;
|
|
38
|
+
/**
|
|
39
|
+
* Emitted when the input value is committed (on native `change`).
|
|
40
|
+
*/
|
|
41
|
+
chChange;
|
|
42
|
+
handleInput = (ev) => {
|
|
43
|
+
this.value = ev.target.value;
|
|
44
|
+
this.chInput.emit(this.value);
|
|
45
|
+
};
|
|
46
|
+
handleChange = (ev) => {
|
|
47
|
+
this.value = ev.target.value;
|
|
48
|
+
this.chChange.emit(this.value);
|
|
49
|
+
};
|
|
50
|
+
render() {
|
|
51
|
+
return (h(Host, { key: '83f68aa09efcfcd544012ffde27f116c122ba215' }, this.label && (h("label", { key: 'd8ca4d52450a024991a3c8f22876483d2031593c', class: "label", htmlFor: this.inputId }, this.label)), h("input", { key: 'fe8c7ce352397b8b0401226501039fc87e8cef57', id: this.label ? this.inputId : undefined, class: "input", type: this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.value, onInput: this.handleInput, onChange: this.handleChange })));
|
|
52
|
+
}
|
|
53
|
+
static get is() { return "ch-input"; }
|
|
54
|
+
static get encapsulation() { return "shadow"; }
|
|
55
|
+
static get originalStyleUrls() {
|
|
56
|
+
return {
|
|
57
|
+
"$": ["ch-input.css"]
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
static get styleUrls() {
|
|
61
|
+
return {
|
|
62
|
+
"$": ["ch-input.css"]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
static get properties() {
|
|
66
|
+
return {
|
|
67
|
+
"label": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"mutable": false,
|
|
70
|
+
"complexType": {
|
|
71
|
+
"original": "string",
|
|
72
|
+
"resolved": "string",
|
|
73
|
+
"references": {}
|
|
74
|
+
},
|
|
75
|
+
"required": false,
|
|
76
|
+
"optional": true,
|
|
77
|
+
"docs": {
|
|
78
|
+
"tags": [],
|
|
79
|
+
"text": "Visible label rendered above the input and associated with it via\n`for`/`id`, so assistive technology announces the input's purpose."
|
|
80
|
+
},
|
|
81
|
+
"getter": false,
|
|
82
|
+
"setter": false,
|
|
83
|
+
"reflect": false,
|
|
84
|
+
"attribute": "label"
|
|
85
|
+
},
|
|
86
|
+
"type": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"mutable": false,
|
|
89
|
+
"complexType": {
|
|
90
|
+
"original": "string",
|
|
91
|
+
"resolved": "string",
|
|
92
|
+
"references": {}
|
|
93
|
+
},
|
|
94
|
+
"required": false,
|
|
95
|
+
"optional": false,
|
|
96
|
+
"docs": {
|
|
97
|
+
"tags": [],
|
|
98
|
+
"text": "The type of the input, mirroring the native `<input type>` attribute."
|
|
99
|
+
},
|
|
100
|
+
"getter": false,
|
|
101
|
+
"setter": false,
|
|
102
|
+
"reflect": false,
|
|
103
|
+
"attribute": "type",
|
|
104
|
+
"defaultValue": "'text'"
|
|
105
|
+
},
|
|
106
|
+
"value": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"mutable": true,
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "string",
|
|
111
|
+
"resolved": "string",
|
|
112
|
+
"references": {}
|
|
113
|
+
},
|
|
114
|
+
"required": false,
|
|
115
|
+
"optional": false,
|
|
116
|
+
"docs": {
|
|
117
|
+
"tags": [],
|
|
118
|
+
"text": "The value of the input."
|
|
119
|
+
},
|
|
120
|
+
"getter": false,
|
|
121
|
+
"setter": false,
|
|
122
|
+
"reflect": false,
|
|
123
|
+
"attribute": "value",
|
|
124
|
+
"defaultValue": "''"
|
|
125
|
+
},
|
|
126
|
+
"placeholder": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "string",
|
|
131
|
+
"resolved": "string",
|
|
132
|
+
"references": {}
|
|
133
|
+
},
|
|
134
|
+
"required": false,
|
|
135
|
+
"optional": true,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "Placeholder text shown when the input is empty."
|
|
139
|
+
},
|
|
140
|
+
"getter": false,
|
|
141
|
+
"setter": false,
|
|
142
|
+
"reflect": false,
|
|
143
|
+
"attribute": "placeholder"
|
|
144
|
+
},
|
|
145
|
+
"name": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"mutable": false,
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "string",
|
|
150
|
+
"resolved": "string",
|
|
151
|
+
"references": {}
|
|
152
|
+
},
|
|
153
|
+
"required": false,
|
|
154
|
+
"optional": true,
|
|
155
|
+
"docs": {
|
|
156
|
+
"tags": [],
|
|
157
|
+
"text": "The name of the input, submitted with form data."
|
|
158
|
+
},
|
|
159
|
+
"getter": false,
|
|
160
|
+
"setter": false,
|
|
161
|
+
"reflect": false,
|
|
162
|
+
"attribute": "name"
|
|
163
|
+
},
|
|
164
|
+
"disabled": {
|
|
165
|
+
"type": "boolean",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "boolean",
|
|
169
|
+
"resolved": "boolean",
|
|
170
|
+
"references": {}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": false,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": "Whether the input is disabled."
|
|
177
|
+
},
|
|
178
|
+
"getter": false,
|
|
179
|
+
"setter": false,
|
|
180
|
+
"reflect": false,
|
|
181
|
+
"attribute": "disabled",
|
|
182
|
+
"defaultValue": "false"
|
|
183
|
+
},
|
|
184
|
+
"required": {
|
|
185
|
+
"type": "boolean",
|
|
186
|
+
"mutable": false,
|
|
187
|
+
"complexType": {
|
|
188
|
+
"original": "boolean",
|
|
189
|
+
"resolved": "boolean",
|
|
190
|
+
"references": {}
|
|
191
|
+
},
|
|
192
|
+
"required": false,
|
|
193
|
+
"optional": false,
|
|
194
|
+
"docs": {
|
|
195
|
+
"tags": [],
|
|
196
|
+
"text": "Whether the input is required."
|
|
197
|
+
},
|
|
198
|
+
"getter": false,
|
|
199
|
+
"setter": false,
|
|
200
|
+
"reflect": false,
|
|
201
|
+
"attribute": "required",
|
|
202
|
+
"defaultValue": "false"
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
static get events() {
|
|
207
|
+
return [{
|
|
208
|
+
"method": "chInput",
|
|
209
|
+
"name": "chInput",
|
|
210
|
+
"bubbles": true,
|
|
211
|
+
"cancelable": true,
|
|
212
|
+
"composed": true,
|
|
213
|
+
"docs": {
|
|
214
|
+
"tags": [],
|
|
215
|
+
"text": "Emitted on every keystroke, with the current input value."
|
|
216
|
+
},
|
|
217
|
+
"complexType": {
|
|
218
|
+
"original": "string",
|
|
219
|
+
"resolved": "string",
|
|
220
|
+
"references": {}
|
|
221
|
+
}
|
|
222
|
+
}, {
|
|
223
|
+
"method": "chChange",
|
|
224
|
+
"name": "chChange",
|
|
225
|
+
"bubbles": true,
|
|
226
|
+
"cancelable": true,
|
|
227
|
+
"composed": true,
|
|
228
|
+
"docs": {
|
|
229
|
+
"tags": [],
|
|
230
|
+
"text": "Emitted when the input value is committed (on native `change`)."
|
|
231
|
+
},
|
|
232
|
+
"complexType": {
|
|
233
|
+
"original": "string",
|
|
234
|
+
"resolved": "string",
|
|
235
|
+
"references": {}
|
|
236
|
+
}
|
|
237
|
+
}];
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=ch-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-input.js","sourceRoot":"","sources":["../../../../src/components/ch-input/ch-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnF,IAAI,QAAQ,GAAG,CAAC,CAAC;AAOjB,MAAM,OAAO,OAAO;IACD,OAAO,GAAG,YAAY,EAAE,QAAQ,EAAE,CAAC;IAEpD;;;OAGG;IACK,KAAK,CAAU;IAEvB;;OAEG;IACK,IAAI,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACsB,KAAK,GAAG,EAAE,CAAC;IAEpC;;OAEG;IACK,WAAW,CAAU;IAE7B;;OAEG;IACK,IAAI,CAAU;IAEtB;;OAEG;IACK,QAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACK,QAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACM,OAAO,CAAuB;IAEvC;;OAEG;IACM,QAAQ,CAAuB;IAEhC,WAAW,GAAG,CAAC,EAAc,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,GAAI,EAAE,CAAC,MAA2B,CAAC,KAAK,CAAC;QACnD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC,CAAC;IAEM,YAAY,GAAG,CAAC,EAAS,EAAE,EAAE;QACnC,IAAI,CAAC,KAAK,GAAI,EAAE,CAAC,MAA2B,CAAC,KAAK,CAAC;QACnD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC,CAAC;IAEF,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACF,IAAI,CAAC,KAAK,IAAI,CACb,8DAAO,KAAK,EAAC,OAAO,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,IACvC,IAAI,CAAC,KAAK,CACL,CACT;YACD,8DACE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACzC,KAAK,EAAC,OAAO,EACb,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,QAAQ,EAAE,IAAI,CAAC,YAAY,GAC3B,CACG,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nlet inputIds = 0;\n\n@Component({\n tag: 'ch-input',\n styleUrl: 'ch-input.css',\n shadow: true,\n})\nexport class ChInput {\n private readonly inputId = `ch-input-${++inputIds}`;\n\n /**\n * Visible label rendered above the input and associated with it via\n * `for`/`id`, so assistive technology announces the input's purpose.\n */\n @Prop() label?: string;\n\n /**\n * The type of the input, mirroring the native `<input type>` attribute.\n */\n @Prop() type = 'text';\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value = '';\n\n /**\n * Placeholder text shown when the input is empty.\n */\n @Prop() placeholder?: string;\n\n /**\n * The name of the input, submitted with form data.\n */\n @Prop() name?: string;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Whether the input is required.\n */\n @Prop() required = false;\n\n /**\n * Emitted on every keystroke, with the current input value.\n */\n @Event() chInput: EventEmitter<string>;\n\n /**\n * Emitted when the input value is committed (on native `change`).\n */\n @Event() chChange: EventEmitter<string>;\n\n private handleInput = (ev: InputEvent) => {\n this.value = (ev.target as HTMLInputElement).value;\n this.chInput.emit(this.value);\n };\n\n private handleChange = (ev: Event) => {\n this.value = (ev.target as HTMLInputElement).value;\n this.chChange.emit(this.value);\n };\n\n render() {\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n </label>\n )}\n <input\n id={this.label ? this.inputId : undefined}\n class=\"input\"\n type={this.type}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n value={this.value}\n onInput={this.handleInput}\n onChange={this.handleChange}\n />\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.label {
|
|
7
|
+
display: block;
|
|
8
|
+
margin-bottom: 0.35rem;
|
|
9
|
+
font-size: 0.85rem;
|
|
10
|
+
font-weight: 600;
|
|
11
|
+
color: var(--text);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.select {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
width: 100%;
|
|
17
|
+
padding: 0.8rem 1.25rem;
|
|
18
|
+
border-radius: var(--radius);
|
|
19
|
+
border: 1px solid var(--border);
|
|
20
|
+
background: var(--surface);
|
|
21
|
+
color: var(--text);
|
|
22
|
+
backdrop-filter: blur(10px);
|
|
23
|
+
font-family: inherit;
|
|
24
|
+
font-size: inherit;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
transition:
|
|
27
|
+
border-color 0.2s,
|
|
28
|
+
box-shadow 0.2s;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.select:focus {
|
|
32
|
+
border-color: var(--accent);
|
|
33
|
+
box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
|
|
34
|
+
outline: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.select:disabled {
|
|
38
|
+
opacity: 0.5;
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.select option {
|
|
43
|
+
background: var(--bg);
|
|
44
|
+
color: var(--text);
|
|
45
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
let selectIds = 0;
|
|
3
|
+
export class ChSelect {
|
|
4
|
+
selectId = `ch-select-${++selectIds}`;
|
|
5
|
+
/**
|
|
6
|
+
* Visible label rendered above the select and associated with it via
|
|
7
|
+
* `for`/`id`, so assistive technology announces the select's purpose.
|
|
8
|
+
*/
|
|
9
|
+
label;
|
|
10
|
+
/**
|
|
11
|
+
* The list of options rendered inside the select.
|
|
12
|
+
*/
|
|
13
|
+
options = [];
|
|
14
|
+
/**
|
|
15
|
+
* The value of the selected option.
|
|
16
|
+
*/
|
|
17
|
+
value;
|
|
18
|
+
/**
|
|
19
|
+
* Placeholder shown as a disabled, hidden first option when no value is selected.
|
|
20
|
+
*/
|
|
21
|
+
placeholder;
|
|
22
|
+
/**
|
|
23
|
+
* The name of the select, submitted with form data.
|
|
24
|
+
*/
|
|
25
|
+
name;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the select is disabled.
|
|
28
|
+
*/
|
|
29
|
+
disabled = false;
|
|
30
|
+
/**
|
|
31
|
+
* Whether a value is required.
|
|
32
|
+
*/
|
|
33
|
+
required = false;
|
|
34
|
+
/**
|
|
35
|
+
* Emitted when the selected option changes, with the new value.
|
|
36
|
+
*/
|
|
37
|
+
chChange;
|
|
38
|
+
handleChange = (ev) => {
|
|
39
|
+
this.value = ev.target.value;
|
|
40
|
+
this.chChange.emit(this.value);
|
|
41
|
+
};
|
|
42
|
+
render() {
|
|
43
|
+
return (h(Host, { key: '57cb1bebbc8ab5ddc01ca1d568cd6871ad6591a2' }, this.label && (h("label", { key: '4f89a32b4dea704c6e4f59d7c070281bffbe6dae', class: "label", htmlFor: this.selectId }, this.label)), h("select", { key: 'f4d5badf61e6d72f3f1c9383a0f1b4093303acd3', id: this.label ? this.selectId : undefined, class: "select", name: this.name, disabled: this.disabled, required: this.required, onChange: this.handleChange }, this.placeholder && (h("option", { key: '241c5db4c8947c8b6bb0ad855e71e99b7315eb73', 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))))));
|
|
44
|
+
}
|
|
45
|
+
static get is() { return "ch-select"; }
|
|
46
|
+
static get encapsulation() { return "shadow"; }
|
|
47
|
+
static get originalStyleUrls() {
|
|
48
|
+
return {
|
|
49
|
+
"$": ["ch-select.css"]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
static get styleUrls() {
|
|
53
|
+
return {
|
|
54
|
+
"$": ["ch-select.css"]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
static get properties() {
|
|
58
|
+
return {
|
|
59
|
+
"label": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "string",
|
|
64
|
+
"resolved": "string",
|
|
65
|
+
"references": {}
|
|
66
|
+
},
|
|
67
|
+
"required": false,
|
|
68
|
+
"optional": true,
|
|
69
|
+
"docs": {
|
|
70
|
+
"tags": [],
|
|
71
|
+
"text": "Visible label rendered above the select and associated with it via\n`for`/`id`, so assistive technology announces the select's purpose."
|
|
72
|
+
},
|
|
73
|
+
"getter": false,
|
|
74
|
+
"setter": false,
|
|
75
|
+
"reflect": false,
|
|
76
|
+
"attribute": "label"
|
|
77
|
+
},
|
|
78
|
+
"options": {
|
|
79
|
+
"type": "unknown",
|
|
80
|
+
"mutable": false,
|
|
81
|
+
"complexType": {
|
|
82
|
+
"original": "ChSelectOption[]",
|
|
83
|
+
"resolved": "ChSelectOption[]",
|
|
84
|
+
"references": {
|
|
85
|
+
"ChSelectOption": {
|
|
86
|
+
"location": "local",
|
|
87
|
+
"path": "/Users/hectorpalmatellez/dev/chucao/src/components/ch-select/ch-select.tsx",
|
|
88
|
+
"id": "src/components/ch-select/ch-select.tsx::ChSelectOption"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"required": false,
|
|
93
|
+
"optional": false,
|
|
94
|
+
"docs": {
|
|
95
|
+
"tags": [],
|
|
96
|
+
"text": "The list of options rendered inside the select."
|
|
97
|
+
},
|
|
98
|
+
"getter": false,
|
|
99
|
+
"setter": false,
|
|
100
|
+
"defaultValue": "[]"
|
|
101
|
+
},
|
|
102
|
+
"value": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"mutable": true,
|
|
105
|
+
"complexType": {
|
|
106
|
+
"original": "string",
|
|
107
|
+
"resolved": "string",
|
|
108
|
+
"references": {}
|
|
109
|
+
},
|
|
110
|
+
"required": false,
|
|
111
|
+
"optional": true,
|
|
112
|
+
"docs": {
|
|
113
|
+
"tags": [],
|
|
114
|
+
"text": "The value of the selected option."
|
|
115
|
+
},
|
|
116
|
+
"getter": false,
|
|
117
|
+
"setter": false,
|
|
118
|
+
"reflect": false,
|
|
119
|
+
"attribute": "value"
|
|
120
|
+
},
|
|
121
|
+
"placeholder": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"mutable": false,
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "string",
|
|
126
|
+
"resolved": "string",
|
|
127
|
+
"references": {}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": true,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": "Placeholder shown as a disabled, hidden first option when no value is selected."
|
|
134
|
+
},
|
|
135
|
+
"getter": false,
|
|
136
|
+
"setter": false,
|
|
137
|
+
"reflect": false,
|
|
138
|
+
"attribute": "placeholder"
|
|
139
|
+
},
|
|
140
|
+
"name": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"mutable": false,
|
|
143
|
+
"complexType": {
|
|
144
|
+
"original": "string",
|
|
145
|
+
"resolved": "string",
|
|
146
|
+
"references": {}
|
|
147
|
+
},
|
|
148
|
+
"required": false,
|
|
149
|
+
"optional": true,
|
|
150
|
+
"docs": {
|
|
151
|
+
"tags": [],
|
|
152
|
+
"text": "The name of the select, submitted with form data."
|
|
153
|
+
},
|
|
154
|
+
"getter": false,
|
|
155
|
+
"setter": false,
|
|
156
|
+
"reflect": false,
|
|
157
|
+
"attribute": "name"
|
|
158
|
+
},
|
|
159
|
+
"disabled": {
|
|
160
|
+
"type": "boolean",
|
|
161
|
+
"mutable": false,
|
|
162
|
+
"complexType": {
|
|
163
|
+
"original": "boolean",
|
|
164
|
+
"resolved": "boolean",
|
|
165
|
+
"references": {}
|
|
166
|
+
},
|
|
167
|
+
"required": false,
|
|
168
|
+
"optional": false,
|
|
169
|
+
"docs": {
|
|
170
|
+
"tags": [],
|
|
171
|
+
"text": "Whether the select is disabled."
|
|
172
|
+
},
|
|
173
|
+
"getter": false,
|
|
174
|
+
"setter": false,
|
|
175
|
+
"reflect": false,
|
|
176
|
+
"attribute": "disabled",
|
|
177
|
+
"defaultValue": "false"
|
|
178
|
+
},
|
|
179
|
+
"required": {
|
|
180
|
+
"type": "boolean",
|
|
181
|
+
"mutable": false,
|
|
182
|
+
"complexType": {
|
|
183
|
+
"original": "boolean",
|
|
184
|
+
"resolved": "boolean",
|
|
185
|
+
"references": {}
|
|
186
|
+
},
|
|
187
|
+
"required": false,
|
|
188
|
+
"optional": false,
|
|
189
|
+
"docs": {
|
|
190
|
+
"tags": [],
|
|
191
|
+
"text": "Whether a value is required."
|
|
192
|
+
},
|
|
193
|
+
"getter": false,
|
|
194
|
+
"setter": false,
|
|
195
|
+
"reflect": false,
|
|
196
|
+
"attribute": "required",
|
|
197
|
+
"defaultValue": "false"
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
static get events() {
|
|
202
|
+
return [{
|
|
203
|
+
"method": "chChange",
|
|
204
|
+
"name": "chChange",
|
|
205
|
+
"bubbles": true,
|
|
206
|
+
"cancelable": true,
|
|
207
|
+
"composed": true,
|
|
208
|
+
"docs": {
|
|
209
|
+
"tags": [],
|
|
210
|
+
"text": "Emitted when the selected option changes, with the new value."
|
|
211
|
+
},
|
|
212
|
+
"complexType": {
|
|
213
|
+
"original": "string",
|
|
214
|
+
"resolved": "string",
|
|
215
|
+
"references": {}
|
|
216
|
+
}
|
|
217
|
+
}];
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=ch-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ch-select.js","sourceRoot":"","sources":["../../../../src/components/ch-select/ch-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQnF,IAAI,SAAS,GAAG,CAAC,CAAC;AAOlB,MAAM,OAAO,QAAQ;IACF,QAAQ,GAAG,aAAa,EAAE,SAAS,EAAE,CAAC;IAEvD;;;OAGG;IACK,KAAK,CAAU;IAEvB;;OAEG;IACK,OAAO,GAAqB,EAAE,CAAC;IAEvC;;OAEG;IACsB,KAAK,CAAU;IAExC;;OAEG;IACK,WAAW,CAAU;IAE7B;;OAEG;IACK,IAAI,CAAU;IAEtB;;OAEG;IACK,QAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACK,QAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACM,QAAQ,CAAuB;IAEhC,YAAY,GAAG,CAAC,EAAS,EAAE,EAAE;QACnC,IAAI,CAAC,KAAK,GAAI,EAAE,CAAC,MAA4B,CAAC,KAAK,CAAC;QACpD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC,CAAC;IAEF,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACF,IAAI,CAAC,KAAK,IAAI,CACb,8DAAO,KAAK,EAAC,OAAO,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,IACxC,IAAI,CAAC,KAAK,CACL,CACT;YACD,+DACE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAC1C,KAAK,EAAC,QAAQ,EACd,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,YAAY;gBAE1B,IAAI,CAAC,WAAW,IAAI,CACnB,+DAAQ,KAAK,EAAC,EAAE,EAAC,QAAQ,QAAC,MAAM,QAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,IACnD,IAAI,CAAC,WAAW,CACV,CACV;gBACA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAC1B,cAAQ,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,IAC1F,MAAM,CAAC,KAAK,CACN,CACV,CAAC,CACK,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nexport interface ChSelectOption {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\nlet selectIds = 0;\n\n@Component({\n tag: 'ch-select',\n styleUrl: 'ch-select.css',\n shadow: true,\n})\nexport class ChSelect {\n private readonly selectId = `ch-select-${++selectIds}`;\n\n /**\n * Visible label rendered above the select and associated with it via\n * `for`/`id`, so assistive technology announces the select's purpose.\n */\n @Prop() label?: string;\n\n /**\n * The list of options rendered inside the select.\n */\n @Prop() options: ChSelectOption[] = [];\n\n /**\n * The value of the selected option.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * Placeholder shown as a disabled, hidden first option when no value is selected.\n */\n @Prop() placeholder?: string;\n\n /**\n * The name of the select, submitted with form data.\n */\n @Prop() name?: string;\n\n /**\n * Whether the select is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Whether a value is required.\n */\n @Prop() required = false;\n\n /**\n * Emitted when the selected option changes, with the new value.\n */\n @Event() chChange: EventEmitter<string>;\n\n private handleChange = (ev: Event) => {\n this.value = (ev.target as HTMLSelectElement).value;\n this.chChange.emit(this.value);\n };\n\n render() {\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.selectId}>\n {this.label}\n </label>\n )}\n <select\n id={this.label ? this.selectId : undefined}\n class=\"select\"\n name={this.name}\n disabled={this.disabled}\n required={this.required}\n onChange={this.handleChange}\n >\n {this.placeholder && (\n <option value=\"\" disabled hidden selected={!this.value}>\n {this.placeholder}\n </option>\n )}\n {this.options.map(option => (\n <option value={option.value} disabled={option.disabled} selected={option.value === this.value}>\n {option.label}\n </option>\n ))}\n </select>\n </Host>\n );\n }\n}\n"]}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview entry point for your component library
|
|
3
|
+
*
|
|
4
|
+
* This is the entry point for your component library. Use this file to export utilities,
|
|
5
|
+
* constants or data structure that accompany your components.
|
|
6
|
+
*
|
|
7
|
+
* DO NOT use this file to export your components. Instead, use the recommended approaches
|
|
8
|
+
* to consume components of this package as outlined in the `README.md`.
|
|
9
|
+
*/
|
|
10
|
+
export * from './tokens/tokens';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,iBAAiB,CAAC","sourcesContent":["/**\n * @fileoverview entry point for your component library\n *\n * This is the entry point for your component library. Use this file to export utilities,\n * constants or data structure that accompany your components.\n *\n * DO NOT use this file to export your components. Instead, use the recommended approaches\n * to consume components of this package as outlined in the `README.md`.\n */\n\nexport * from './tokens/tokens';\nexport type * from './tokens/types';\nexport type * from './components.d.ts';\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* Generated by toki v1.10.0 — do not edit */
|
|
2
|
+
export const colorBackgroundBase = '#100a1c';
|
|
3
|
+
export const colorBackgroundTopGlow = '#201e40';
|
|
4
|
+
export const colorBackgroundBottomGlow = '#261226';
|
|
5
|
+
export const colorSurfaceDefault = 'rgba(32, 30, 64, 0.6)';
|
|
6
|
+
export const colorSurfaceHover = 'rgba(45, 212, 191, 0.08)';
|
|
7
|
+
export const colorBorderDefault = 'rgba(255, 255, 255, 0.08)';
|
|
8
|
+
export const colorBorderHover = 'rgba(45, 212, 191, 0.3)';
|
|
9
|
+
export const colorAccentDefault = '#2dd4bf';
|
|
10
|
+
export const colorAccentHover = '#5ee8d4';
|
|
11
|
+
export const colorStatusPositive = '#4ade80';
|
|
12
|
+
export const colorStatusPositiveBackground = 'rgba(34, 197, 94, 0.18)';
|
|
13
|
+
export const colorStatusWarning = '#f87171';
|
|
14
|
+
export const colorStatusWarningBackground = 'rgba(248, 113, 113, 0.15)';
|
|
15
|
+
export const colorTextPrimary = '#ffffff';
|
|
16
|
+
export const colorTextSecondary = 'rgba(255, 255, 255, 0.55)';
|
|
17
|
+
export const colorBrandHuemulDark = '#85422b';
|
|
18
|
+
export const colorBrandHuemulLight = '#b45b38';
|
|
19
|
+
export const colorBrandStroke = '#1d1d1b';
|
|
20
|
+
export const typographyBody = 'Fira Sans, Droid Sans, Helvetica Neue, sans-serif';
|
|
21
|
+
export const typographyHeading = 'Inconsolata, monospace';
|
|
22
|
+
export const spacingRadius = '6px';
|
|
23
|
+
export const layoutMaxWidth = '68rem';
|
|
24
|
+
export const tokens = {
|
|
25
|
+
color: {
|
|
26
|
+
background: {
|
|
27
|
+
base: '#100a1c',
|
|
28
|
+
topGlow: '#201e40',
|
|
29
|
+
bottomGlow: '#261226',
|
|
30
|
+
},
|
|
31
|
+
surface: {
|
|
32
|
+
default: 'rgba(32, 30, 64, 0.6)',
|
|
33
|
+
hover: 'rgba(45, 212, 191, 0.08)',
|
|
34
|
+
},
|
|
35
|
+
border: {
|
|
36
|
+
default: 'rgba(255, 255, 255, 0.08)',
|
|
37
|
+
hover: 'rgba(45, 212, 191, 0.3)',
|
|
38
|
+
},
|
|
39
|
+
accent: {
|
|
40
|
+
default: '#2dd4bf',
|
|
41
|
+
hover: '#5ee8d4',
|
|
42
|
+
},
|
|
43
|
+
status: {
|
|
44
|
+
positive: '#4ade80',
|
|
45
|
+
positiveBackground: 'rgba(34, 197, 94, 0.18)',
|
|
46
|
+
warning: '#f87171',
|
|
47
|
+
warningBackground: 'rgba(248, 113, 113, 0.15)',
|
|
48
|
+
},
|
|
49
|
+
text: {
|
|
50
|
+
primary: '#ffffff',
|
|
51
|
+
secondary: 'rgba(255, 255, 255, 0.55)',
|
|
52
|
+
},
|
|
53
|
+
brand: {
|
|
54
|
+
huemulDark: '#85422b',
|
|
55
|
+
huemulLight: '#b45b38',
|
|
56
|
+
stroke: '#1d1d1b',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
typography: {
|
|
60
|
+
body: 'Fira Sans, Droid Sans, Helvetica Neue, sans-serif',
|
|
61
|
+
heading: 'Inconsolata, monospace',
|
|
62
|
+
},
|
|
63
|
+
spacing: {
|
|
64
|
+
radius: '6px',
|
|
65
|
+
},
|
|
66
|
+
layout: {
|
|
67
|
+
maxWidth: '68rem',
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/tokens/tokens.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAC7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAS,CAAC;AAChD,MAAM,CAAC,MAAM,yBAAyB,GAAG,SAAS,CAAC;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAC3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AAC5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAC1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAC1C,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAC7C,MAAM,CAAC,MAAM,6BAA6B,GAAG,yBAAyB,CAAC;AACvE,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAC5C,MAAM,CAAC,MAAM,4BAA4B,GAAG,2BAA2B,CAAC;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAC9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAC9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,mDAAmD,CAAC;AAClF,MAAM,CAAC,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAC1D,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC;AACnC,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE;QACL,UAAU,EAAE;YACV,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,SAAS;SACtB;QACD,OAAO,EAAE;YACP,OAAO,EAAE,uBAAuB;YAChC,KAAK,EAAE,0BAA0B;SAClC;QACD,MAAM,EAAE;YACN,OAAO,EAAE,2BAA2B;YACpC,KAAK,EAAE,yBAAyB;SACjC;QACD,MAAM,EAAE;YACN,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,SAAS;SACjB;QACD,MAAM,EAAE;YACN,QAAQ,EAAE,SAAS;YACnB,kBAAkB,EAAE,yBAAyB;YAC7C,OAAO,EAAE,SAAS;YAClB,iBAAiB,EAAE,2BAA2B;SAC/C;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,2BAA2B;SACvC;QACD,KAAK,EAAE;YACL,UAAU,EAAE,SAAS;YACrB,WAAW,EAAE,SAAS;YACtB,MAAM,EAAE,SAAS;SAClB;KACF;IACD,UAAU,EAAE;QACV,IAAI,EAAE,mDAAmD;QACzD,OAAO,EAAE,wBAAwB;KAClC;IACD,OAAO,EAAE;QACP,MAAM,EAAE,KAAK;KACd;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,OAAO;KAClB;CACO,CAAC","sourcesContent":["/* Generated by toki v1.10.0 — do not edit */\n\nexport const colorBackgroundBase = '#100a1c';\nexport const colorBackgroundTopGlow = '#201e40';\nexport const colorBackgroundBottomGlow = '#261226';\nexport const colorSurfaceDefault = 'rgba(32, 30, 64, 0.6)';\nexport const colorSurfaceHover = 'rgba(45, 212, 191, 0.08)';\nexport const colorBorderDefault = 'rgba(255, 255, 255, 0.08)';\nexport const colorBorderHover = 'rgba(45, 212, 191, 0.3)';\nexport const colorAccentDefault = '#2dd4bf';\nexport const colorAccentHover = '#5ee8d4';\nexport const colorStatusPositive = '#4ade80';\nexport const colorStatusPositiveBackground = 'rgba(34, 197, 94, 0.18)';\nexport const colorStatusWarning = '#f87171';\nexport const colorStatusWarningBackground = 'rgba(248, 113, 113, 0.15)';\nexport const colorTextPrimary = '#ffffff';\nexport const colorTextSecondary = 'rgba(255, 255, 255, 0.55)';\nexport const colorBrandHuemulDark = '#85422b';\nexport const colorBrandHuemulLight = '#b45b38';\nexport const colorBrandStroke = '#1d1d1b';\nexport const typographyBody = 'Fira Sans, Droid Sans, Helvetica Neue, sans-serif';\nexport const typographyHeading = 'Inconsolata, monospace';\nexport const spacingRadius = '6px';\nexport const layoutMaxWidth = '68rem';\n\nexport const tokens = {\n color: {\n background: {\n base: '#100a1c',\n topGlow: '#201e40',\n bottomGlow: '#261226',\n },\n surface: {\n default: 'rgba(32, 30, 64, 0.6)',\n hover: 'rgba(45, 212, 191, 0.08)',\n },\n border: {\n default: 'rgba(255, 255, 255, 0.08)',\n hover: 'rgba(45, 212, 191, 0.3)',\n },\n accent: {\n default: '#2dd4bf',\n hover: '#5ee8d4',\n },\n status: {\n positive: '#4ade80',\n positiveBackground: 'rgba(34, 197, 94, 0.18)',\n warning: '#f87171',\n warningBackground: 'rgba(248, 113, 113, 0.15)',\n },\n text: {\n primary: '#ffffff',\n secondary: 'rgba(255, 255, 255, 0.55)',\n },\n brand: {\n huemulDark: '#85422b',\n huemulLight: '#b45b38',\n stroke: '#1d1d1b',\n },\n },\n typography: {\n body: 'Fira Sans, Droid Sans, Helvetica Neue, sans-serif',\n heading: 'Inconsolata, monospace',\n },\n spacing: {\n radius: '6px',\n },\n layout: {\n maxWidth: '68rem',\n },\n} as const;\n\nexport type TokenCategory = keyof typeof tokens;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/tokens/types.ts"],"names":[],"mappings":"AAAA,6CAA6C","sourcesContent":["/* Generated by toki v1.10.0 — do not edit */\n\nexport type ColorToken =\n | 'color.background.base'\n | 'color.background.top-glow'\n | 'color.background.bottom-glow'\n | 'color.surface.default'\n | 'color.surface.hover'\n | 'color.border.default'\n | 'color.border.hover'\n | 'color.accent.default'\n | 'color.accent.hover'\n | 'color.status.positive'\n | 'color.status.positive-background'\n | 'color.status.warning'\n | 'color.status.warning-background'\n | 'color.text.primary'\n | 'color.text.secondary'\n | 'color.brand.huemul-dark'\n | 'color.brand.huemul-light'\n | 'color.brand.stroke';\n\nexport type TypographyToken = 'typography.body' | 'typography.heading';\n\nexport type SpacingToken = 'spacing.radius';\n\nexport type LayoutToken = 'layout.max-width';\n\nexport type TokenName = ColorToken | TypographyToken | SpacingToken | LayoutToken;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ChBadge extends Components.ChBadge, HTMLElement {}
|
|
4
|
+
export const ChBadge: {
|
|
5
|
+
prototype: ChBadge;
|
|
6
|
+
new (): ChBadge;
|
|
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,t as a,H as t,h as c,c as r}from"./p-BImgfbXx.js";const s=()=>`:host{display:inline-block}.badge{display:inline-block;padding:0.18rem 0.6rem;border-radius:999px;font-size:0.68rem;font-weight:600;text-transform:uppercase;letter-spacing:0.03em}.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 o=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}variant="default";render(){return c(r,{key:"9bac1191887568872ad75b1eec3a6084310253db"},c("span",{key:"fae2007c430f102f8ad4e0cc7d97c606dde69eed",class:{badge:true,[`badge--${this.variant}`]:true}},c("slot",{key:"56913dac3a8c18e76a419c22c27c69ca1adc8cc0"})))}static get style(){return s()}},[769,"ch-badge",{variant:[1]}]);function n(){if(typeof customElements==="undefined"){return}const e=["ch-badge"];e.forEach((e=>{switch(e){case"ch-badge":if(!customElements.get(a(e))){customElements.define(a(e),o)}break}}))}n();const d=o;const i=n;export{d as ChBadge,i as defineCustomElement};
|
|
2
|
+
//# sourceMappingURL=ch-badge.js.map
|