@evoke-tech/stencil-ui-kit 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +314 -2
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/evoke-alert_20.cjs.entry.js +1047 -0
- package/dist/cjs/evoke-ui.cjs.js +25 -0
- package/dist/cjs/index-BpJ5gu8f.js +2130 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/collection/collection-manifest.json +32 -0
- package/dist/collection/components/evoke-alert/evoke-alert.css +18 -0
- package/dist/collection/components/evoke-alert/evoke-alert.js +107 -0
- package/dist/collection/components/evoke-app-bar/evoke-app-bar.css +13 -0
- package/dist/collection/components/evoke-app-bar/evoke-app-bar.js +94 -0
- package/dist/collection/components/evoke-badge/evoke-badge.css +13 -0
- package/dist/collection/components/evoke-badge/evoke-badge.js +162 -0
- package/dist/collection/components/evoke-button/evoke-button.css +31 -0
- package/dist/collection/components/evoke-button/evoke-button.js +243 -0
- package/dist/collection/components/evoke-card/evoke-card.css +12 -0
- package/dist/collection/components/evoke-card/evoke-card.js +140 -0
- package/dist/collection/components/evoke-checkbox/evoke-checkbox.css +22 -0
- package/dist/collection/components/evoke-checkbox/evoke-checkbox.js +180 -0
- package/dist/collection/components/evoke-chip/evoke-chip.css +16 -0
- package/dist/collection/components/evoke-chip/evoke-chip.js +149 -0
- package/dist/collection/components/evoke-input/evoke-input.css +25 -0
- package/dist/collection/components/evoke-input/evoke-input.js +324 -0
- package/dist/collection/components/evoke-modal/evoke-modal.css +21 -0
- package/dist/collection/components/evoke-modal/evoke-modal.js +271 -0
- package/dist/collection/components/evoke-pagination/evoke-pagination.css +12 -0
- package/dist/collection/components/evoke-pagination/evoke-pagination.js +156 -0
- package/dist/collection/components/evoke-progress/evoke-progress.css +12 -0
- package/dist/collection/components/evoke-progress/evoke-progress.js +146 -0
- package/dist/collection/components/evoke-quantity-stepper/evoke-quantity-stepper.css +20 -0
- package/dist/collection/components/evoke-quantity-stepper/evoke-quantity-stepper.js +201 -0
- package/dist/collection/components/evoke-radio-group/evoke-radio-group.css +29 -0
- package/dist/collection/components/evoke-radio-group/evoke-radio-group.js +233 -0
- package/dist/collection/components/evoke-select/evoke-select.css +37 -0
- package/dist/collection/components/evoke-select/evoke-select.js +433 -0
- package/dist/collection/components/evoke-switch/evoke-switch.css +16 -0
- package/dist/collection/components/evoke-switch/evoke-switch.js +151 -0
- package/dist/collection/components/evoke-table/evoke-table.css +20 -0
- package/dist/collection/components/evoke-table/evoke-table.js +222 -0
- package/dist/collection/components/evoke-tabs/evoke-tabs.css +20 -0
- package/dist/collection/components/evoke-tabs/evoke-tabs.js +179 -0
- package/dist/collection/components/evoke-textarea/evoke-textarea.css +19 -0
- package/dist/collection/components/evoke-textarea/evoke-textarea.js +328 -0
- package/dist/collection/components/evoke-toast/evoke-toast.css +24 -0
- package/dist/collection/components/evoke-toast/evoke-toast.js +225 -0
- package/dist/collection/components/evoke-tooltip/evoke-tooltip.css +22 -0
- package/dist/collection/components/evoke-tooltip/evoke-tooltip.js +119 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/icons.js +29 -0
- package/dist/collection/utils/options.js +12 -0
- package/dist/components/evoke-alert.d.ts +11 -0
- package/dist/components/evoke-alert.js +1 -0
- package/dist/components/evoke-app-bar.d.ts +11 -0
- package/dist/components/evoke-app-bar.js +1 -0
- package/dist/components/evoke-badge.d.ts +11 -0
- package/dist/components/evoke-badge.js +1 -0
- package/dist/components/evoke-button.d.ts +11 -0
- package/dist/components/evoke-button.js +1 -0
- package/dist/components/evoke-card.d.ts +11 -0
- package/dist/components/evoke-card.js +1 -0
- package/dist/components/evoke-checkbox.d.ts +11 -0
- package/dist/components/evoke-checkbox.js +1 -0
- package/dist/components/evoke-chip.d.ts +11 -0
- package/dist/components/evoke-chip.js +1 -0
- package/dist/components/evoke-input.d.ts +11 -0
- package/dist/components/evoke-input.js +1 -0
- package/dist/components/evoke-modal.d.ts +11 -0
- package/dist/components/evoke-modal.js +1 -0
- package/dist/components/evoke-pagination.d.ts +11 -0
- package/dist/components/evoke-pagination.js +1 -0
- package/dist/components/evoke-progress.d.ts +11 -0
- package/dist/components/evoke-progress.js +1 -0
- package/dist/components/evoke-quantity-stepper.d.ts +11 -0
- package/dist/components/evoke-quantity-stepper.js +1 -0
- package/dist/components/evoke-radio-group.d.ts +11 -0
- package/dist/components/evoke-radio-group.js +1 -0
- package/dist/components/evoke-select.d.ts +11 -0
- package/dist/components/evoke-select.js +1 -0
- package/dist/components/evoke-switch.d.ts +11 -0
- package/dist/components/evoke-switch.js +1 -0
- package/dist/components/evoke-table.d.ts +11 -0
- package/dist/components/evoke-table.js +1 -0
- package/dist/components/evoke-tabs.d.ts +11 -0
- package/dist/components/evoke-tabs.js +1 -0
- package/dist/components/evoke-textarea.d.ts +11 -0
- package/dist/components/evoke-textarea.js +1 -0
- package/dist/components/evoke-toast.d.ts +11 -0
- package/dist/components/evoke-toast.js +1 -0
- package/dist/components/evoke-tooltip.d.ts +11 -0
- package/dist/components/evoke-tooltip.js +1 -0
- package/dist/components/icons.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/options.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/evoke-alert_20.entry.js +1026 -0
- package/dist/esm/evoke-ui.js +21 -0
- package/dist/esm/index-C-5sEjU8.js +2122 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/evoke-ui/evoke-ui.css +1 -0
- package/dist/evoke-ui/evoke-ui.esm.js +1 -0
- package/dist/evoke-ui/index.esm.js +0 -0
- package/dist/evoke-ui/p-0841be89.entry.js +1 -0
- package/dist/evoke-ui/p-C-5sEjU8.js +3 -0
- package/dist/evoke-ui/p-DQuL1Twl.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/themes/bootstrap.css +26 -0
- package/dist/themes/material.css +24 -0
- package/dist/themes/tailwind.css +27 -0
- package/dist/themes/tokens.css +29 -0
- package/dist/types/components/evoke-alert/evoke-alert.d.ts +10 -0
- package/dist/types/components/evoke-app-bar/evoke-app-bar.d.ts +14 -0
- package/dist/types/components/evoke-badge/evoke-badge.d.ts +17 -0
- package/dist/types/components/evoke-button/evoke-button.d.ts +21 -0
- package/dist/types/components/evoke-card/evoke-card.d.ts +15 -0
- package/dist/types/components/evoke-checkbox/evoke-checkbox.d.ts +18 -0
- package/dist/types/components/evoke-chip/evoke-chip.d.ts +14 -0
- package/dist/types/components/evoke-input/evoke-input.d.ts +27 -0
- package/dist/types/components/evoke-modal/evoke-modal.d.ts +32 -0
- package/dist/types/components/evoke-pagination/evoke-pagination.d.ts +15 -0
- package/dist/types/components/evoke-progress/evoke-progress.d.ts +13 -0
- package/dist/types/components/evoke-quantity-stepper/evoke-quantity-stepper.d.ts +18 -0
- package/dist/types/components/evoke-radio-group/evoke-radio-group.d.ts +20 -0
- package/dist/types/components/evoke-select/evoke-select.d.ts +43 -0
- package/dist/types/components/evoke-switch/evoke-switch.d.ts +15 -0
- package/dist/types/components/evoke-table/evoke-table.d.ts +29 -0
- package/dist/types/components/evoke-tabs/evoke-tabs.d.ts +21 -0
- package/dist/types/components/evoke-textarea/evoke-textarea.d.ts +28 -0
- package/dist/types/components/evoke-toast/evoke-toast.d.ts +24 -0
- package/dist/types/components/evoke-tooltip/evoke-tooltip.d.ts +17 -0
- package/dist/types/components.d.ts +1876 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +1879 -0
- package/dist/types/utils/icons.d.ts +25 -0
- package/dist/types/utils/options.d.ts +7 -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 +65 -4
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { renderIcon } from "../../utils/icons";
|
|
3
|
+
export class EvokeButton {
|
|
4
|
+
constructor() {
|
|
5
|
+
/** Solid variants (primary, secondary, danger), outline, or ghost (text only, no border) */
|
|
6
|
+
this.variant = 'primary';
|
|
7
|
+
this.size = 'md';
|
|
8
|
+
this.type = 'button';
|
|
9
|
+
this.disabled = false;
|
|
10
|
+
/** Shows a spinner and blocks clicks while true */
|
|
11
|
+
this.loading = false;
|
|
12
|
+
/** Square button for icon-only use; set `accessible-label` too */
|
|
13
|
+
this.iconOnly = false;
|
|
14
|
+
/** Stretch to the full width of the container */
|
|
15
|
+
this.block = false;
|
|
16
|
+
/** Extra classes for the inner <button>, e.g. "btn btn-lg" (Bootstrap) or "shadow-lg" (Tailwind) */
|
|
17
|
+
this.buttonClass = '';
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
const cls = `evoke-btn evoke-btn--${this.variant} evoke-btn--${this.size} ${this.iconOnly ? 'evoke-btn--icon' : ''} ${this.loading ? 'evoke-btn--loading' : ''} ${this.buttonClass}`;
|
|
21
|
+
return (h("button", { key: 'f7d86f18cbcfd1d23b82cf37072f5af93c8d7ef3', type: this.type, class: cls.replace(/\s+/g, ' ').trim(), disabled: this.disabled || this.loading, "aria-busy": this.loading ? 'true' : undefined, "aria-label": this.accessibleLabel }, this.loading ? h("span", { class: "evoke-spinner", "aria-hidden": "true" }) : renderIcon(this.icon), h("slot", { key: '15d7302d67b7976d772e6b510e27b7e3f23c0634' })));
|
|
22
|
+
}
|
|
23
|
+
static get is() { return "evoke-button"; }
|
|
24
|
+
static get originalStyleUrls() {
|
|
25
|
+
return {
|
|
26
|
+
"$": ["evoke-button.css"]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static get styleUrls() {
|
|
30
|
+
return {
|
|
31
|
+
"$": ["evoke-button.css"]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static get properties() {
|
|
35
|
+
return {
|
|
36
|
+
"variant": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"mutable": false,
|
|
39
|
+
"complexType": {
|
|
40
|
+
"original": "'primary' | 'secondary' | 'danger' | 'outline' | 'ghost'",
|
|
41
|
+
"resolved": "\"danger\" | \"ghost\" | \"outline\" | \"primary\" | \"secondary\"",
|
|
42
|
+
"references": {}
|
|
43
|
+
},
|
|
44
|
+
"required": false,
|
|
45
|
+
"optional": false,
|
|
46
|
+
"docs": {
|
|
47
|
+
"tags": [],
|
|
48
|
+
"text": "Solid variants (primary, secondary, danger), outline, or ghost (text only, no border)"
|
|
49
|
+
},
|
|
50
|
+
"getter": false,
|
|
51
|
+
"setter": false,
|
|
52
|
+
"reflect": false,
|
|
53
|
+
"attribute": "variant",
|
|
54
|
+
"defaultValue": "'primary'"
|
|
55
|
+
},
|
|
56
|
+
"size": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"mutable": false,
|
|
59
|
+
"complexType": {
|
|
60
|
+
"original": "'sm' | 'md' | 'lg'",
|
|
61
|
+
"resolved": "\"lg\" | \"md\" | \"sm\"",
|
|
62
|
+
"references": {}
|
|
63
|
+
},
|
|
64
|
+
"required": false,
|
|
65
|
+
"optional": false,
|
|
66
|
+
"docs": {
|
|
67
|
+
"tags": [],
|
|
68
|
+
"text": ""
|
|
69
|
+
},
|
|
70
|
+
"getter": false,
|
|
71
|
+
"setter": false,
|
|
72
|
+
"reflect": false,
|
|
73
|
+
"attribute": "size",
|
|
74
|
+
"defaultValue": "'md'"
|
|
75
|
+
},
|
|
76
|
+
"type": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"mutable": false,
|
|
79
|
+
"complexType": {
|
|
80
|
+
"original": "'button' | 'submit' | 'reset'",
|
|
81
|
+
"resolved": "\"button\" | \"reset\" | \"submit\"",
|
|
82
|
+
"references": {}
|
|
83
|
+
},
|
|
84
|
+
"required": false,
|
|
85
|
+
"optional": false,
|
|
86
|
+
"docs": {
|
|
87
|
+
"tags": [],
|
|
88
|
+
"text": ""
|
|
89
|
+
},
|
|
90
|
+
"getter": false,
|
|
91
|
+
"setter": false,
|
|
92
|
+
"reflect": false,
|
|
93
|
+
"attribute": "type",
|
|
94
|
+
"defaultValue": "'button'"
|
|
95
|
+
},
|
|
96
|
+
"disabled": {
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "boolean",
|
|
101
|
+
"resolved": "boolean",
|
|
102
|
+
"references": {}
|
|
103
|
+
},
|
|
104
|
+
"required": false,
|
|
105
|
+
"optional": false,
|
|
106
|
+
"docs": {
|
|
107
|
+
"tags": [],
|
|
108
|
+
"text": ""
|
|
109
|
+
},
|
|
110
|
+
"getter": false,
|
|
111
|
+
"setter": false,
|
|
112
|
+
"reflect": false,
|
|
113
|
+
"attribute": "disabled",
|
|
114
|
+
"defaultValue": "false"
|
|
115
|
+
},
|
|
116
|
+
"loading": {
|
|
117
|
+
"type": "boolean",
|
|
118
|
+
"mutable": false,
|
|
119
|
+
"complexType": {
|
|
120
|
+
"original": "boolean",
|
|
121
|
+
"resolved": "boolean",
|
|
122
|
+
"references": {}
|
|
123
|
+
},
|
|
124
|
+
"required": false,
|
|
125
|
+
"optional": false,
|
|
126
|
+
"docs": {
|
|
127
|
+
"tags": [],
|
|
128
|
+
"text": "Shows a spinner and blocks clicks while true"
|
|
129
|
+
},
|
|
130
|
+
"getter": false,
|
|
131
|
+
"setter": false,
|
|
132
|
+
"reflect": false,
|
|
133
|
+
"attribute": "loading",
|
|
134
|
+
"defaultValue": "false"
|
|
135
|
+
},
|
|
136
|
+
"icon": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"mutable": false,
|
|
139
|
+
"complexType": {
|
|
140
|
+
"original": "EvokeIcon",
|
|
141
|
+
"resolved": "\"alert\" | \"arrow-down\" | \"arrow-right\" | \"arrow-up\" | \"cart\" | \"check\" | \"chevron-down\" | \"chevron-left\" | \"chevron-right\" | \"chevron-up\" | \"info\" | \"lock\" | \"mail\" | \"minus\" | \"plus\" | \"search\" | \"sort\" | \"user\" | \"x\"",
|
|
142
|
+
"references": {
|
|
143
|
+
"EvokeIcon": {
|
|
144
|
+
"location": "import",
|
|
145
|
+
"path": "../../utils/icons",
|
|
146
|
+
"id": "src/utils/icons.tsx::EvokeIcon",
|
|
147
|
+
"referenceLocation": "EvokeIcon"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"required": false,
|
|
152
|
+
"optional": true,
|
|
153
|
+
"docs": {
|
|
154
|
+
"tags": [],
|
|
155
|
+
"text": "Optional leading icon"
|
|
156
|
+
},
|
|
157
|
+
"getter": false,
|
|
158
|
+
"setter": false,
|
|
159
|
+
"reflect": false,
|
|
160
|
+
"attribute": "icon"
|
|
161
|
+
},
|
|
162
|
+
"iconOnly": {
|
|
163
|
+
"type": "boolean",
|
|
164
|
+
"mutable": false,
|
|
165
|
+
"complexType": {
|
|
166
|
+
"original": "boolean",
|
|
167
|
+
"resolved": "boolean",
|
|
168
|
+
"references": {}
|
|
169
|
+
},
|
|
170
|
+
"required": false,
|
|
171
|
+
"optional": false,
|
|
172
|
+
"docs": {
|
|
173
|
+
"tags": [],
|
|
174
|
+
"text": "Square button for icon-only use; set `accessible-label` too"
|
|
175
|
+
},
|
|
176
|
+
"getter": false,
|
|
177
|
+
"setter": false,
|
|
178
|
+
"reflect": true,
|
|
179
|
+
"attribute": "icon-only",
|
|
180
|
+
"defaultValue": "false"
|
|
181
|
+
},
|
|
182
|
+
"accessibleLabel": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"mutable": false,
|
|
185
|
+
"complexType": {
|
|
186
|
+
"original": "string",
|
|
187
|
+
"resolved": "string",
|
|
188
|
+
"references": {}
|
|
189
|
+
},
|
|
190
|
+
"required": false,
|
|
191
|
+
"optional": true,
|
|
192
|
+
"docs": {
|
|
193
|
+
"tags": [],
|
|
194
|
+
"text": "aria-label for the inner button (required when `icon-only`)"
|
|
195
|
+
},
|
|
196
|
+
"getter": false,
|
|
197
|
+
"setter": false,
|
|
198
|
+
"reflect": false,
|
|
199
|
+
"attribute": "accessible-label"
|
|
200
|
+
},
|
|
201
|
+
"block": {
|
|
202
|
+
"type": "boolean",
|
|
203
|
+
"mutable": false,
|
|
204
|
+
"complexType": {
|
|
205
|
+
"original": "boolean",
|
|
206
|
+
"resolved": "boolean",
|
|
207
|
+
"references": {}
|
|
208
|
+
},
|
|
209
|
+
"required": false,
|
|
210
|
+
"optional": false,
|
|
211
|
+
"docs": {
|
|
212
|
+
"tags": [],
|
|
213
|
+
"text": "Stretch to the full width of the container"
|
|
214
|
+
},
|
|
215
|
+
"getter": false,
|
|
216
|
+
"setter": false,
|
|
217
|
+
"reflect": true,
|
|
218
|
+
"attribute": "block",
|
|
219
|
+
"defaultValue": "false"
|
|
220
|
+
},
|
|
221
|
+
"buttonClass": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"mutable": false,
|
|
224
|
+
"complexType": {
|
|
225
|
+
"original": "string",
|
|
226
|
+
"resolved": "string",
|
|
227
|
+
"references": {}
|
|
228
|
+
},
|
|
229
|
+
"required": false,
|
|
230
|
+
"optional": false,
|
|
231
|
+
"docs": {
|
|
232
|
+
"tags": [],
|
|
233
|
+
"text": "Extra classes for the inner <button>, e.g. \"btn btn-lg\" (Bootstrap) or \"shadow-lg\" (Tailwind)"
|
|
234
|
+
},
|
|
235
|
+
"getter": false,
|
|
236
|
+
"setter": false,
|
|
237
|
+
"reflect": false,
|
|
238
|
+
"attribute": "button-class",
|
|
239
|
+
"defaultValue": "''"
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
evoke-card { display: block; }
|
|
2
|
+
evoke-card .evoke-card { background: var(--evoke-surface, #ffffff); color: var(--evoke-text, #1a1a1a); border: 1px solid var(--evoke-border, #dedede); border-radius: var(--evoke-radius, 8px); font-family: var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif); overflow: hidden; transition: box-shadow 0.15s, border-color 0.15s, transform 0.05s; }
|
|
3
|
+
evoke-card .evoke-card--elevated { border-color: transparent; box-shadow: var(--evoke-shadow, 0 4px 12px rgba(0, 0, 0, 0.12)); }
|
|
4
|
+
evoke-card .evoke-card__media img, evoke-card .evoke-card__media video { display: block; width: 100%; height: auto; }
|
|
5
|
+
evoke-card .evoke-card__header { padding: 0.75rem 1rem; font-weight: 600; border-bottom: 1px solid var(--evoke-border, #dedede); }
|
|
6
|
+
evoke-card .evoke-card--elevated .evoke-card__header { border-bottom-color: transparent; }
|
|
7
|
+
evoke-card .evoke-card__body { padding: 1rem; }
|
|
8
|
+
evoke-card .evoke-card--clickable { cursor: pointer; }
|
|
9
|
+
evoke-card .evoke-card--clickable:hover { border-color: var(--evoke-primary, #ff5316); }
|
|
10
|
+
evoke-card .evoke-card--elevated.evoke-card--clickable:hover { border-color: transparent; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }
|
|
11
|
+
evoke-card .evoke-card--clickable:active { transform: translateY(1px); }
|
|
12
|
+
evoke-card .evoke-card--clickable:focus-visible { outline: none; box-shadow: var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15)); border-color: var(--evoke-secondary, #0b1560); }
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class EvokeCard {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.heading = '';
|
|
5
|
+
/** Outlined (border) or elevated (shadow, no border) */
|
|
6
|
+
this.appearance = 'outlined';
|
|
7
|
+
/** Makes the whole card a button (hover/active/focus states, Enter/Space) */
|
|
8
|
+
this.clickable = false;
|
|
9
|
+
/** Extra classes for the card container, e.g. "shadow-md" (Tailwind) or "card" (Bootstrap) */
|
|
10
|
+
this.cardClass = '';
|
|
11
|
+
this.activate = () => {
|
|
12
|
+
if (this.clickable)
|
|
13
|
+
this.evokeClick.emit();
|
|
14
|
+
};
|
|
15
|
+
this.onKeyDown = (e) => {
|
|
16
|
+
if (!this.clickable || e.target !== e.currentTarget)
|
|
17
|
+
return;
|
|
18
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
this.activate();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return (h("div", { key: '770d8327a59c90f0dee5a2150de270e23024e7c2', class: `evoke-card evoke-card--${this.appearance} ${this.clickable ? 'evoke-card--clickable' : ''} ${this.cardClass}`.replace(/\s+/g, ' ').trim(), role: this.clickable ? 'button' : undefined, tabindex: this.clickable ? 0 : undefined, onClick: this.activate, onKeyDown: this.onKeyDown }, h("div", { key: '16ffd16092680ff8c42e9a13e7e7313cc0c4f1d5', class: "evoke-card__media" }, h("slot", { key: '92ba25d16ed81cad2dd4707cde97370b1e9efa33', name: "media" })), this.heading && h("div", { key: '6fd2d9d1fe8afe8074fc38cc8247f007218a7450', class: "evoke-card__header" }, this.heading), h("div", { key: 'afa26c53bfed69d01b350760428456293ebeb7fd', class: "evoke-card__body" }, h("slot", { key: '94e07c3b5f8170fae1667081cdcf39d5a869c249' }))));
|
|
26
|
+
}
|
|
27
|
+
static get is() { return "evoke-card"; }
|
|
28
|
+
static get originalStyleUrls() {
|
|
29
|
+
return {
|
|
30
|
+
"$": ["evoke-card.css"]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
static get styleUrls() {
|
|
34
|
+
return {
|
|
35
|
+
"$": ["evoke-card.css"]
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
static get properties() {
|
|
39
|
+
return {
|
|
40
|
+
"heading": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"mutable": false,
|
|
43
|
+
"complexType": {
|
|
44
|
+
"original": "string",
|
|
45
|
+
"resolved": "string",
|
|
46
|
+
"references": {}
|
|
47
|
+
},
|
|
48
|
+
"required": false,
|
|
49
|
+
"optional": false,
|
|
50
|
+
"docs": {
|
|
51
|
+
"tags": [],
|
|
52
|
+
"text": ""
|
|
53
|
+
},
|
|
54
|
+
"getter": false,
|
|
55
|
+
"setter": false,
|
|
56
|
+
"reflect": false,
|
|
57
|
+
"attribute": "heading",
|
|
58
|
+
"defaultValue": "''"
|
|
59
|
+
},
|
|
60
|
+
"appearance": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"mutable": false,
|
|
63
|
+
"complexType": {
|
|
64
|
+
"original": "'outlined' | 'elevated'",
|
|
65
|
+
"resolved": "\"elevated\" | \"outlined\"",
|
|
66
|
+
"references": {}
|
|
67
|
+
},
|
|
68
|
+
"required": false,
|
|
69
|
+
"optional": false,
|
|
70
|
+
"docs": {
|
|
71
|
+
"tags": [],
|
|
72
|
+
"text": "Outlined (border) or elevated (shadow, no border)"
|
|
73
|
+
},
|
|
74
|
+
"getter": false,
|
|
75
|
+
"setter": false,
|
|
76
|
+
"reflect": false,
|
|
77
|
+
"attribute": "appearance",
|
|
78
|
+
"defaultValue": "'outlined'"
|
|
79
|
+
},
|
|
80
|
+
"clickable": {
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"mutable": false,
|
|
83
|
+
"complexType": {
|
|
84
|
+
"original": "boolean",
|
|
85
|
+
"resolved": "boolean",
|
|
86
|
+
"references": {}
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"optional": false,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": "Makes the whole card a button (hover/active/focus states, Enter/Space)"
|
|
93
|
+
},
|
|
94
|
+
"getter": false,
|
|
95
|
+
"setter": false,
|
|
96
|
+
"reflect": false,
|
|
97
|
+
"attribute": "clickable",
|
|
98
|
+
"defaultValue": "false"
|
|
99
|
+
},
|
|
100
|
+
"cardClass": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"mutable": false,
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "string",
|
|
105
|
+
"resolved": "string",
|
|
106
|
+
"references": {}
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"optional": false,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": "Extra classes for the card container, e.g. \"shadow-md\" (Tailwind) or \"card\" (Bootstrap)"
|
|
113
|
+
},
|
|
114
|
+
"getter": false,
|
|
115
|
+
"setter": false,
|
|
116
|
+
"reflect": false,
|
|
117
|
+
"attribute": "card-class",
|
|
118
|
+
"defaultValue": "''"
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
static get events() {
|
|
123
|
+
return [{
|
|
124
|
+
"method": "evokeClick",
|
|
125
|
+
"name": "evokeClick",
|
|
126
|
+
"bubbles": true,
|
|
127
|
+
"cancelable": true,
|
|
128
|
+
"composed": true,
|
|
129
|
+
"docs": {
|
|
130
|
+
"tags": [],
|
|
131
|
+
"text": "Fired when a `clickable` card is activated"
|
|
132
|
+
},
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "void",
|
|
135
|
+
"resolved": "void",
|
|
136
|
+
"references": {}
|
|
137
|
+
}
|
|
138
|
+
}];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
evoke-checkbox { display: block; }
|
|
2
|
+
evoke-checkbox .evoke-check { display: flex; flex-direction: column; gap: 0.25rem; font-family: var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif); color: var(--evoke-text, #1a1a1a); }
|
|
3
|
+
evoke-checkbox .evoke-check__row { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.875rem; }
|
|
4
|
+
evoke-checkbox .evoke-check__row--disabled { opacity: 0.6; cursor: not-allowed; }
|
|
5
|
+
evoke-checkbox .evoke-check__input {
|
|
6
|
+
appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 16px; height: 16px;
|
|
7
|
+
border: 2px solid var(--evoke-primary, #ff5316); border-radius: 4px; background: var(--evoke-surface, #ffffff) center / 12px no-repeat;
|
|
8
|
+
cursor: inherit; transition: background-color 0.15s, box-shadow 0.15s, filter 0.15s;
|
|
9
|
+
}
|
|
10
|
+
evoke-checkbox .evoke-check__input:hover:not(:disabled) { filter: brightness(0.92); }
|
|
11
|
+
evoke-checkbox .evoke-check__input:active:not(:disabled) { filter: brightness(0.8); }
|
|
12
|
+
evoke-checkbox .evoke-check__input:checked {
|
|
13
|
+
background-color: var(--evoke-primary, #ff5316);
|
|
14
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
|
|
15
|
+
}
|
|
16
|
+
evoke-checkbox .evoke-check__input:indeterminate {
|
|
17
|
+
background-color: var(--evoke-primary, #ff5316);
|
|
18
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
|
|
19
|
+
}
|
|
20
|
+
evoke-checkbox .evoke-check__input:focus-visible { outline: none; box-shadow: var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15)); }
|
|
21
|
+
evoke-checkbox .evoke-check__input--error { border-color: var(--evoke-danger, #dc2626); }
|
|
22
|
+
evoke-checkbox .evoke-check__error { color: var(--evoke-danger, #dc2626); font-size: 0.875rem; }
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class EvokeCheckbox {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.label = '';
|
|
5
|
+
this.checked = false;
|
|
6
|
+
/** Mixed state, e.g. a "select all" box when only some items are selected. Cleared on click. */
|
|
7
|
+
this.indeterminate = false;
|
|
8
|
+
this.disabled = false;
|
|
9
|
+
/** Error message shown below the checkbox */
|
|
10
|
+
this.error = '';
|
|
11
|
+
/** Extra classes for the inner <input> */
|
|
12
|
+
this.inputClass = '';
|
|
13
|
+
this.uid = Math.random().toString(36).slice(2, 9);
|
|
14
|
+
}
|
|
15
|
+
componentDidRender() {
|
|
16
|
+
if (this.inputEl)
|
|
17
|
+
this.inputEl.indeterminate = this.indeterminate;
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
const errId = `evoke-check-${this.uid}-err`;
|
|
21
|
+
return (h("div", { key: 'cc0882102020d6e748ee1c5bac124a3a2640862c', class: "evoke-check" }, h("label", { key: '62390001ac96c2c0602541eafc37559ab95ae80a', class: `evoke-check__row ${this.disabled ? 'evoke-check__row--disabled' : ''}` }, h("input", { key: 'bf8732581d0c36d3ba89c4b3c67b08ebf1268699', type: "checkbox", class: `evoke-check__input ${this.error ? 'evoke-check__input--error' : ''} ${this.inputClass}`.trim(), checked: this.checked, disabled: this.disabled, "aria-checked": this.indeterminate ? 'mixed' : undefined, "aria-invalid": this.error ? 'true' : undefined, "aria-describedby": this.error ? errId : undefined, ref: (el) => (this.inputEl = el), onChange: (e) => {
|
|
22
|
+
this.indeterminate = false;
|
|
23
|
+
this.checked = e.target.checked;
|
|
24
|
+
this.evokeChange.emit(this.checked);
|
|
25
|
+
} }), h("span", { key: '6685db59dad6a3299179a04f67f25ca2d818c87a', class: "evoke-check__label" }, this.label, h("slot", { key: 'd2f72e8580dbfdabdd9e460642558a3b2199f098' }))), this.error && h("span", { key: '2d63862c8cc3489b8e1217fab1aa20da0fb86449', id: errId, class: "evoke-check__error", role: "alert" }, this.error)));
|
|
26
|
+
}
|
|
27
|
+
static get is() { return "evoke-checkbox"; }
|
|
28
|
+
static get originalStyleUrls() {
|
|
29
|
+
return {
|
|
30
|
+
"$": ["evoke-checkbox.css"]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
static get styleUrls() {
|
|
34
|
+
return {
|
|
35
|
+
"$": ["evoke-checkbox.css"]
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
static get properties() {
|
|
39
|
+
return {
|
|
40
|
+
"label": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"mutable": false,
|
|
43
|
+
"complexType": {
|
|
44
|
+
"original": "string",
|
|
45
|
+
"resolved": "string",
|
|
46
|
+
"references": {}
|
|
47
|
+
},
|
|
48
|
+
"required": false,
|
|
49
|
+
"optional": false,
|
|
50
|
+
"docs": {
|
|
51
|
+
"tags": [],
|
|
52
|
+
"text": ""
|
|
53
|
+
},
|
|
54
|
+
"getter": false,
|
|
55
|
+
"setter": false,
|
|
56
|
+
"reflect": false,
|
|
57
|
+
"attribute": "label",
|
|
58
|
+
"defaultValue": "''"
|
|
59
|
+
},
|
|
60
|
+
"checked": {
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"mutable": true,
|
|
63
|
+
"complexType": {
|
|
64
|
+
"original": "boolean",
|
|
65
|
+
"resolved": "boolean",
|
|
66
|
+
"references": {}
|
|
67
|
+
},
|
|
68
|
+
"required": false,
|
|
69
|
+
"optional": false,
|
|
70
|
+
"docs": {
|
|
71
|
+
"tags": [],
|
|
72
|
+
"text": ""
|
|
73
|
+
},
|
|
74
|
+
"getter": false,
|
|
75
|
+
"setter": false,
|
|
76
|
+
"reflect": true,
|
|
77
|
+
"attribute": "checked",
|
|
78
|
+
"defaultValue": "false"
|
|
79
|
+
},
|
|
80
|
+
"indeterminate": {
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"mutable": true,
|
|
83
|
+
"complexType": {
|
|
84
|
+
"original": "boolean",
|
|
85
|
+
"resolved": "boolean",
|
|
86
|
+
"references": {}
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"optional": false,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": "Mixed state, e.g. a \"select all\" box when only some items are selected. Cleared on click."
|
|
93
|
+
},
|
|
94
|
+
"getter": false,
|
|
95
|
+
"setter": false,
|
|
96
|
+
"reflect": true,
|
|
97
|
+
"attribute": "indeterminate",
|
|
98
|
+
"defaultValue": "false"
|
|
99
|
+
},
|
|
100
|
+
"disabled": {
|
|
101
|
+
"type": "boolean",
|
|
102
|
+
"mutable": false,
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "boolean",
|
|
105
|
+
"resolved": "boolean",
|
|
106
|
+
"references": {}
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"optional": false,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": ""
|
|
113
|
+
},
|
|
114
|
+
"getter": false,
|
|
115
|
+
"setter": false,
|
|
116
|
+
"reflect": false,
|
|
117
|
+
"attribute": "disabled",
|
|
118
|
+
"defaultValue": "false"
|
|
119
|
+
},
|
|
120
|
+
"error": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"mutable": false,
|
|
123
|
+
"complexType": {
|
|
124
|
+
"original": "string",
|
|
125
|
+
"resolved": "string",
|
|
126
|
+
"references": {}
|
|
127
|
+
},
|
|
128
|
+
"required": false,
|
|
129
|
+
"optional": false,
|
|
130
|
+
"docs": {
|
|
131
|
+
"tags": [],
|
|
132
|
+
"text": "Error message shown below the checkbox"
|
|
133
|
+
},
|
|
134
|
+
"getter": false,
|
|
135
|
+
"setter": false,
|
|
136
|
+
"reflect": false,
|
|
137
|
+
"attribute": "error",
|
|
138
|
+
"defaultValue": "''"
|
|
139
|
+
},
|
|
140
|
+
"inputClass": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"mutable": false,
|
|
143
|
+
"complexType": {
|
|
144
|
+
"original": "string",
|
|
145
|
+
"resolved": "string",
|
|
146
|
+
"references": {}
|
|
147
|
+
},
|
|
148
|
+
"required": false,
|
|
149
|
+
"optional": false,
|
|
150
|
+
"docs": {
|
|
151
|
+
"tags": [],
|
|
152
|
+
"text": "Extra classes for the inner <input>"
|
|
153
|
+
},
|
|
154
|
+
"getter": false,
|
|
155
|
+
"setter": false,
|
|
156
|
+
"reflect": false,
|
|
157
|
+
"attribute": "input-class",
|
|
158
|
+
"defaultValue": "''"
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
static get events() {
|
|
163
|
+
return [{
|
|
164
|
+
"method": "evokeChange",
|
|
165
|
+
"name": "evokeChange",
|
|
166
|
+
"bubbles": true,
|
|
167
|
+
"cancelable": true,
|
|
168
|
+
"composed": true,
|
|
169
|
+
"docs": {
|
|
170
|
+
"tags": [],
|
|
171
|
+
"text": "Emits the new checked state"
|
|
172
|
+
},
|
|
173
|
+
"complexType": {
|
|
174
|
+
"original": "boolean",
|
|
175
|
+
"resolved": "boolean",
|
|
176
|
+
"references": {}
|
|
177
|
+
}
|
|
178
|
+
}];
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
evoke-chip { display: inline-block; }
|
|
2
|
+
evoke-chip .evoke-chip { box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; font-family: var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif); font-size: 0.875rem; color: var(--evoke-text, #1a1a1a); background: var(--evoke-surface, #ffffff); border: 1px solid var(--evoke-border, #dedede); border-radius: 9999px; transition: background-color 0.15s, border-color 0.15s, filter 0.15s; }
|
|
3
|
+
evoke-chip .evoke-chip .evoke-icon { width: 14px; height: 14px; flex: none; }
|
|
4
|
+
evoke-chip .evoke-chip--filter { cursor: pointer; font: inherit; font-size: 0.875rem; }
|
|
5
|
+
evoke-chip .evoke-chip--filter:hover:not(:disabled):not(.evoke-chip--selected) { background: var(--evoke-surface-muted, #f5f5f5); border-color: var(--evoke-text-muted, #6b6b6b); }
|
|
6
|
+
evoke-chip .evoke-chip--filter:active:not(:disabled) { filter: brightness(0.9); }
|
|
7
|
+
evoke-chip .evoke-chip--filter:focus-visible { outline: none; box-shadow: var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15)); }
|
|
8
|
+
evoke-chip .evoke-chip--selected { background: color-mix(in srgb, var(--evoke-primary, #ff5316) 14%, var(--evoke-surface, #ffffff)); border-color: var(--evoke-primary, #ff5316); color: var(--evoke-text, #1a1a1a); }
|
|
9
|
+
evoke-chip .evoke-chip--selected .evoke-icon { color: var(--evoke-primary, #ff5316); }
|
|
10
|
+
evoke-chip .evoke-chip--filter:disabled, evoke-chip .evoke-chip--disabled { opacity: 0.5; cursor: not-allowed; }
|
|
11
|
+
evoke-chip .evoke-chip--removable { padding-right: 4px; background: var(--evoke-surface-muted, #f5f5f5); border-color: transparent; }
|
|
12
|
+
evoke-chip .evoke-chip__remove { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; color: inherit; background: none; border: 0; border-radius: 50%; cursor: pointer; }
|
|
13
|
+
evoke-chip .evoke-chip__remove:hover:not(:disabled) { background: color-mix(in srgb, var(--evoke-text, #1a1a1a) 14%, transparent); }
|
|
14
|
+
evoke-chip .evoke-chip__remove:active:not(:disabled) { background: color-mix(in srgb, var(--evoke-text, #1a1a1a) 24%, transparent); }
|
|
15
|
+
evoke-chip .evoke-chip__remove:focus-visible { outline: none; box-shadow: var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15)); }
|
|
16
|
+
evoke-chip .evoke-chip__remove:disabled { cursor: not-allowed; }
|