@evoke-tech/stencil-ui-kit 0.1.0 → 0.2.1
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 +142 -26
- package/dist/cjs/evoke-alert_20.cjs.entry.js +1047 -0
- package/dist/cjs/evoke-ui.cjs.js +2 -2
- package/dist/cjs/{index-B8xS0y1i.js → index-BpJ5gu8f.js} +146 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +13 -1
- package/dist/collection/components/evoke-alert/evoke-alert.css +17 -6
- package/dist/collection/components/evoke-alert/evoke-alert.js +25 -1
- 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 +16 -2
- package/dist/collection/components/evoke-button/evoke-button.js +117 -5
- package/dist/collection/components/evoke-card/evoke-card.css +9 -1
- package/dist/collection/components/evoke-card/evoke-card.js +75 -1
- package/dist/collection/components/evoke-checkbox/evoke-checkbox.css +7 -1
- package/dist/collection/components/evoke-checkbox/evoke-checkbox.js +31 -2
- 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 +11 -3
- package/dist/collection/components/evoke-input/evoke-input.js +103 -13
- package/dist/collection/components/evoke-modal/evoke-modal.css +21 -5
- package/dist/collection/components/evoke-modal/evoke-modal.js +129 -4
- 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 +14 -1
- package/dist/collection/components/evoke-radio-group/evoke-radio-group.js +34 -8
- package/dist/collection/components/evoke-select/evoke-select.css +25 -4
- package/dist/collection/components/evoke-select/evoke-select.js +245 -15
- 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/utils/icons.js +29 -0
- package/dist/components/evoke-alert.js +1 -1
- 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.js +1 -1
- package/dist/components/evoke-card.js +1 -1
- package/dist/components/evoke-checkbox.js +1 -1
- package/dist/components/evoke-chip.d.ts +11 -0
- package/dist/components/evoke-chip.js +1 -0
- package/dist/components/evoke-input.js +1 -1
- package/dist/components/evoke-modal.js +1 -1
- 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.js +1 -1
- package/dist/components/evoke-select.js +1 -1
- 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/esm/evoke-alert_20.entry.js +1026 -0
- package/dist/esm/evoke-ui.js +3 -3
- package/dist/esm/{index-BtM1wZ-I.js → index-C-5sEjU8.js} +146 -6
- package/dist/esm/loader.js +3 -3
- package/dist/evoke-ui/evoke-ui.css +1 -1
- package/dist/evoke-ui/evoke-ui.esm.js +1 -1
- package/dist/evoke-ui/p-0841be89.entry.js +1 -0
- package/dist/evoke-ui/p-C-5sEjU8.js +3 -0
- package/dist/themes/bootstrap.css +3 -0
- package/dist/themes/material.css +5 -2
- package/dist/themes/tailwind.css +3 -0
- package/dist/themes/tokens.css +4 -1
- package/dist/types/components/evoke-alert/evoke-alert.d.ts +2 -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 +12 -2
- package/dist/types/components/evoke-card/evoke-card.d.ts +9 -0
- package/dist/types/components/evoke-checkbox/evoke-checkbox.d.ts +5 -0
- package/dist/types/components/evoke-chip/evoke-chip.d.ts +14 -0
- package/dist/types/components/evoke-input/evoke-input.d.ts +9 -1
- package/dist/types/components/evoke-modal/evoke-modal.d.ts +19 -1
- 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 +4 -2
- package/dist/types/components/evoke-select/evoke-select.d.ts +31 -6
- 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 +1237 -18
- package/dist/types/utils/icons.d.ts +25 -0
- package/dist/vue/components.d.ts +22 -0
- package/dist/vue/components.js +220 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +2 -0
- package/dist/vue/plugin.d.ts +3 -0
- package/dist/vue/plugin.js +7 -0
- package/package.json +30 -6
- package/dist/cjs/evoke-alert_6.cjs.entry.js +0 -172
- package/dist/cjs/evoke-card.cjs.entry.js +0 -20
- package/dist/cjs/evoke-modal.cjs.entry.js +0 -34
- package/dist/esm/evoke-alert_6.entry.js +0 -165
- package/dist/esm/evoke-card.entry.js +0 -18
- package/dist/esm/evoke-modal.entry.js +0 -32
- package/dist/evoke-ui/p-243075cd.entry.js +0 -1
- package/dist/evoke-ui/p-605d4757.entry.js +0 -1
- package/dist/evoke-ui/p-9a6eaeb6.entry.js +0 -1
- package/dist/evoke-ui/p-BtM1wZ-I.js +0 -3
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class EvokeBadge {
|
|
3
|
+
constructor() {
|
|
4
|
+
/** Number to show (count badge) */
|
|
5
|
+
this.count = 0;
|
|
6
|
+
/** Counts above this show as "max+" (e.g. 99+) */
|
|
7
|
+
this.max = 99;
|
|
8
|
+
/** Show a small status dot instead of a number */
|
|
9
|
+
this.dot = false;
|
|
10
|
+
/** Show the badge even when the count is 0 */
|
|
11
|
+
this.showZero = false;
|
|
12
|
+
this.color = 'danger';
|
|
13
|
+
/** Screen-reader text, e.g. "3 items in cart". A dot without a label is treated as decorative. */
|
|
14
|
+
this.label = '';
|
|
15
|
+
this.hasContent = false;
|
|
16
|
+
}
|
|
17
|
+
componentWillLoad() {
|
|
18
|
+
this.hasContent = Array.from(this.el.childNodes).some((n) => { var _a; return n.nodeType === 1 || (n.nodeType === 3 && !!((_a = n.textContent) === null || _a === void 0 ? void 0 : _a.trim())); });
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
const text = this.count > this.max ? `${this.max}+` : String(this.count);
|
|
22
|
+
const showCount = !this.dot && (this.count > 0 || this.showZero);
|
|
23
|
+
const bubble = this.dot ? (h("span", { class: `evoke-badge evoke-badge--dot evoke-badge--${this.color}`, role: this.label ? 'status' : undefined, "aria-label": this.label || undefined, "aria-hidden": this.label ? undefined : 'true' })) : showCount ? (h("span", { class: `evoke-badge evoke-badge--count evoke-badge--${this.color}` }, h("span", { "aria-hidden": this.label ? 'true' : undefined }, text), this.label && h("span", { class: "evoke-badge__sr" }, this.label))) : null;
|
|
24
|
+
return (h("span", { key: 'c49ac8a3361b9dcdfa3ebc3eacfca2079a3da60f', class: `evoke-badge-wrap ${this.hasContent ? 'evoke-badge-wrap--anchored' : ''}`.trim() }, h("slot", { key: 'b25c9150dcca4299ccae5735dcd0ea9a0c7e973a' }), bubble));
|
|
25
|
+
}
|
|
26
|
+
static get is() { return "evoke-badge"; }
|
|
27
|
+
static get originalStyleUrls() {
|
|
28
|
+
return {
|
|
29
|
+
"$": ["evoke-badge.css"]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static get styleUrls() {
|
|
33
|
+
return {
|
|
34
|
+
"$": ["evoke-badge.css"]
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
static get properties() {
|
|
38
|
+
return {
|
|
39
|
+
"count": {
|
|
40
|
+
"type": "number",
|
|
41
|
+
"mutable": false,
|
|
42
|
+
"complexType": {
|
|
43
|
+
"original": "number",
|
|
44
|
+
"resolved": "number",
|
|
45
|
+
"references": {}
|
|
46
|
+
},
|
|
47
|
+
"required": false,
|
|
48
|
+
"optional": false,
|
|
49
|
+
"docs": {
|
|
50
|
+
"tags": [],
|
|
51
|
+
"text": "Number to show (count badge)"
|
|
52
|
+
},
|
|
53
|
+
"getter": false,
|
|
54
|
+
"setter": false,
|
|
55
|
+
"reflect": false,
|
|
56
|
+
"attribute": "count",
|
|
57
|
+
"defaultValue": "0"
|
|
58
|
+
},
|
|
59
|
+
"max": {
|
|
60
|
+
"type": "number",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "number",
|
|
64
|
+
"resolved": "number",
|
|
65
|
+
"references": {}
|
|
66
|
+
},
|
|
67
|
+
"required": false,
|
|
68
|
+
"optional": false,
|
|
69
|
+
"docs": {
|
|
70
|
+
"tags": [],
|
|
71
|
+
"text": "Counts above this show as \"max+\" (e.g. 99+)"
|
|
72
|
+
},
|
|
73
|
+
"getter": false,
|
|
74
|
+
"setter": false,
|
|
75
|
+
"reflect": false,
|
|
76
|
+
"attribute": "max",
|
|
77
|
+
"defaultValue": "99"
|
|
78
|
+
},
|
|
79
|
+
"dot": {
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"mutable": false,
|
|
82
|
+
"complexType": {
|
|
83
|
+
"original": "boolean",
|
|
84
|
+
"resolved": "boolean",
|
|
85
|
+
"references": {}
|
|
86
|
+
},
|
|
87
|
+
"required": false,
|
|
88
|
+
"optional": false,
|
|
89
|
+
"docs": {
|
|
90
|
+
"tags": [],
|
|
91
|
+
"text": "Show a small status dot instead of a number"
|
|
92
|
+
},
|
|
93
|
+
"getter": false,
|
|
94
|
+
"setter": false,
|
|
95
|
+
"reflect": false,
|
|
96
|
+
"attribute": "dot",
|
|
97
|
+
"defaultValue": "false"
|
|
98
|
+
},
|
|
99
|
+
"showZero": {
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "boolean",
|
|
104
|
+
"resolved": "boolean",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Show the badge even when the count is 0"
|
|
112
|
+
},
|
|
113
|
+
"getter": false,
|
|
114
|
+
"setter": false,
|
|
115
|
+
"reflect": false,
|
|
116
|
+
"attribute": "show-zero",
|
|
117
|
+
"defaultValue": "false"
|
|
118
|
+
},
|
|
119
|
+
"color": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"mutable": false,
|
|
122
|
+
"complexType": {
|
|
123
|
+
"original": "'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'info'",
|
|
124
|
+
"resolved": "\"danger\" | \"info\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"",
|
|
125
|
+
"references": {}
|
|
126
|
+
},
|
|
127
|
+
"required": false,
|
|
128
|
+
"optional": false,
|
|
129
|
+
"docs": {
|
|
130
|
+
"tags": [],
|
|
131
|
+
"text": ""
|
|
132
|
+
},
|
|
133
|
+
"getter": false,
|
|
134
|
+
"setter": false,
|
|
135
|
+
"reflect": false,
|
|
136
|
+
"attribute": "color",
|
|
137
|
+
"defaultValue": "'danger'"
|
|
138
|
+
},
|
|
139
|
+
"label": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"mutable": false,
|
|
142
|
+
"complexType": {
|
|
143
|
+
"original": "string",
|
|
144
|
+
"resolved": "string",
|
|
145
|
+
"references": {}
|
|
146
|
+
},
|
|
147
|
+
"required": false,
|
|
148
|
+
"optional": false,
|
|
149
|
+
"docs": {
|
|
150
|
+
"tags": [],
|
|
151
|
+
"text": "Screen-reader text, e.g. \"3 items in cart\". A dot without a label is treated as decorative."
|
|
152
|
+
},
|
|
153
|
+
"getter": false,
|
|
154
|
+
"setter": false,
|
|
155
|
+
"reflect": false,
|
|
156
|
+
"attribute": "label",
|
|
157
|
+
"defaultValue": "''"
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
static get elementRef() { return "el"; }
|
|
162
|
+
}
|
|
@@ -4,14 +4,28 @@ evoke-button .evoke-btn {
|
|
|
4
4
|
height: var(--evoke-control-height, 56px); padding: 0 var(--evoke-button-padding-x, 36px);
|
|
5
5
|
display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
|
|
6
6
|
border: 1px solid transparent; border-radius: var(--evoke-radius-button, 9999px);
|
|
7
|
-
transition: filter 0.15s, box-shadow 0.15s;
|
|
7
|
+
transition: filter 0.15s, background-color 0.15s, box-shadow 0.15s, transform 0.05s;
|
|
8
8
|
}
|
|
9
|
+
evoke-button .evoke-btn--sm { height: calc(var(--evoke-control-height, 56px) * 0.75); padding: 0 calc(var(--evoke-button-padding-x, 36px) * 0.6); font-size: 0.875rem; }
|
|
10
|
+
evoke-button .evoke-btn--lg { height: calc(var(--evoke-control-height, 56px) * 1.15); padding: 0 calc(var(--evoke-button-padding-x, 36px) * 1.2); font-size: 1.125rem; }
|
|
11
|
+
evoke-button .evoke-btn--icon { padding: 0; width: var(--evoke-control-height, 56px); }
|
|
12
|
+
evoke-button .evoke-btn--icon.evoke-btn--sm { width: calc(var(--evoke-control-height, 56px) * 0.75); }
|
|
13
|
+
evoke-button .evoke-btn--icon.evoke-btn--lg { width: calc(var(--evoke-control-height, 56px) * 1.15); }
|
|
14
|
+
evoke-button .evoke-icon { width: 1.1em; height: 1.1em; flex: none; }
|
|
9
15
|
evoke-button .evoke-btn:hover:not(:disabled) { filter: brightness(0.92); }
|
|
16
|
+
evoke-button .evoke-btn:active:not(:disabled) { filter: brightness(0.82); transform: translateY(1px); }
|
|
10
17
|
evoke-button .evoke-btn:focus-visible { outline: none; box-shadow: var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15)); }
|
|
11
18
|
evoke-button .evoke-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
19
|
+
evoke-button .evoke-btn--loading:disabled { cursor: progress; opacity: 0.8; }
|
|
12
20
|
evoke-button .evoke-btn--primary { background: var(--evoke-primary, #ff5316); color: var(--evoke-primary-contrast, #ffffff); }
|
|
13
21
|
evoke-button .evoke-btn--secondary { background: var(--evoke-secondary, #0b1560); color: var(--evoke-secondary-contrast, #ffffff); }
|
|
14
22
|
evoke-button .evoke-btn--danger { background: var(--evoke-danger, #dc2626); color: #fff; }
|
|
15
|
-
evoke-button .evoke-btn--outline { background: transparent; color: var(--evoke-primary, #
|
|
23
|
+
evoke-button .evoke-btn--outline { background: transparent; color: var(--evoke-primary-text, #cc3d0d); border-color: var(--evoke-primary, #ff5316); }
|
|
24
|
+
evoke-button .evoke-btn--ghost { background: transparent; color: var(--evoke-primary-text, #cc3d0d); border-color: transparent; }
|
|
25
|
+
evoke-button .evoke-btn--ghost:hover:not(:disabled) { filter: none; background: color-mix(in srgb, var(--evoke-primary, #ff5316) 10%, transparent); }
|
|
26
|
+
evoke-button .evoke-btn--ghost:active:not(:disabled) { filter: none; background: color-mix(in srgb, var(--evoke-primary, #ff5316) 18%, transparent); }
|
|
27
|
+
evoke-button .evoke-spinner { width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: evoke-spin 0.7s linear infinite; }
|
|
28
|
+
@keyframes evoke-spin { to { transform: rotate(360deg); } }
|
|
29
|
+
@media (prefers-reduced-motion: reduce) { evoke-button .evoke-spinner { animation-duration: 2s; } }
|
|
16
30
|
evoke-button[block] { display: block; }
|
|
17
31
|
evoke-button[block] .evoke-btn { width: 100%; }
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { renderIcon } from "../../utils/icons";
|
|
2
3
|
export class EvokeButton {
|
|
3
4
|
constructor() {
|
|
4
|
-
/**
|
|
5
|
+
/** Solid variants (primary, secondary, danger), outline, or ghost (text only, no border) */
|
|
5
6
|
this.variant = 'primary';
|
|
7
|
+
this.size = 'md';
|
|
6
8
|
this.type = 'button';
|
|
7
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;
|
|
8
14
|
/** Stretch to the full width of the container */
|
|
9
15
|
this.block = false;
|
|
10
16
|
/** Extra classes for the inner <button>, e.g. "btn btn-lg" (Bootstrap) or "shadow-lg" (Tailwind) */
|
|
11
17
|
this.buttonClass = '';
|
|
12
18
|
}
|
|
13
19
|
render() {
|
|
14
|
-
|
|
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' })));
|
|
15
22
|
}
|
|
16
23
|
static get is() { return "evoke-button"; }
|
|
17
24
|
static get originalStyleUrls() {
|
|
@@ -30,15 +37,15 @@ export class EvokeButton {
|
|
|
30
37
|
"type": "string",
|
|
31
38
|
"mutable": false,
|
|
32
39
|
"complexType": {
|
|
33
|
-
"original": "'primary' | 'secondary' | 'danger' | 'outline'",
|
|
34
|
-
"resolved": "\"danger\" | \"outline\" | \"primary\" | \"secondary\"",
|
|
40
|
+
"original": "'primary' | 'secondary' | 'danger' | 'outline' | 'ghost'",
|
|
41
|
+
"resolved": "\"danger\" | \"ghost\" | \"outline\" | \"primary\" | \"secondary\"",
|
|
35
42
|
"references": {}
|
|
36
43
|
},
|
|
37
44
|
"required": false,
|
|
38
45
|
"optional": false,
|
|
39
46
|
"docs": {
|
|
40
47
|
"tags": [],
|
|
41
|
-
"text": "
|
|
48
|
+
"text": "Solid variants (primary, secondary, danger), outline, or ghost (text only, no border)"
|
|
42
49
|
},
|
|
43
50
|
"getter": false,
|
|
44
51
|
"setter": false,
|
|
@@ -46,6 +53,26 @@ export class EvokeButton {
|
|
|
46
53
|
"attribute": "variant",
|
|
47
54
|
"defaultValue": "'primary'"
|
|
48
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
|
+
},
|
|
49
76
|
"type": {
|
|
50
77
|
"type": "string",
|
|
51
78
|
"mutable": false,
|
|
@@ -86,6 +113,91 @@ export class EvokeButton {
|
|
|
86
113
|
"attribute": "disabled",
|
|
87
114
|
"defaultValue": "false"
|
|
88
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
|
+
},
|
|
89
201
|
"block": {
|
|
90
202
|
"type": "boolean",
|
|
91
203
|
"mutable": false,
|
|
@@ -1,4 +1,12 @@
|
|
|
1
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
|
|
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; }
|
|
3
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; }
|
|
4
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); }
|
|
@@ -2,11 +2,27 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
export class EvokeCard {
|
|
3
3
|
constructor() {
|
|
4
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;
|
|
5
9
|
/** Extra classes for the card container, e.g. "shadow-md" (Tailwind) or "card" (Bootstrap) */
|
|
6
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
|
+
};
|
|
7
23
|
}
|
|
8
24
|
render() {
|
|
9
|
-
return (h("div", { key: '
|
|
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' }))));
|
|
10
26
|
}
|
|
11
27
|
static get is() { return "evoke-card"; }
|
|
12
28
|
static get originalStyleUrls() {
|
|
@@ -41,6 +57,46 @@ export class EvokeCard {
|
|
|
41
57
|
"attribute": "heading",
|
|
42
58
|
"defaultValue": "''"
|
|
43
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
|
+
},
|
|
44
100
|
"cardClass": {
|
|
45
101
|
"type": "string",
|
|
46
102
|
"mutable": false,
|
|
@@ -63,4 +119,22 @@ export class EvokeCard {
|
|
|
63
119
|
}
|
|
64
120
|
};
|
|
65
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
|
+
}
|
|
66
140
|
}
|
|
@@ -5,12 +5,18 @@ evoke-checkbox .evoke-check__row--disabled { opacity: 0.6; cursor: not-allowed;
|
|
|
5
5
|
evoke-checkbox .evoke-check__input {
|
|
6
6
|
appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 16px; height: 16px;
|
|
7
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;
|
|
8
|
+
cursor: inherit; transition: background-color 0.15s, box-shadow 0.15s, filter 0.15s;
|
|
9
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); }
|
|
10
12
|
evoke-checkbox .evoke-check__input:checked {
|
|
11
13
|
background-color: var(--evoke-primary, #ff5316);
|
|
12
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");
|
|
13
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
|
+
}
|
|
14
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)); }
|
|
15
21
|
evoke-checkbox .evoke-check__input--error { border-color: var(--evoke-danger, #dc2626); }
|
|
16
22
|
evoke-checkbox .evoke-check__error { color: var(--evoke-danger, #dc2626); font-size: 0.875rem; }
|
|
@@ -3,17 +3,26 @@ export class EvokeCheckbox {
|
|
|
3
3
|
constructor() {
|
|
4
4
|
this.label = '';
|
|
5
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;
|
|
6
8
|
this.disabled = false;
|
|
7
9
|
/** Error message shown below the checkbox */
|
|
8
10
|
this.error = '';
|
|
9
11
|
/** Extra classes for the inner <input> */
|
|
10
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;
|
|
11
18
|
}
|
|
12
19
|
render() {
|
|
13
|
-
|
|
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;
|
|
14
23
|
this.checked = e.target.checked;
|
|
15
24
|
this.evokeChange.emit(this.checked);
|
|
16
|
-
} }), h("span", { key: '
|
|
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)));
|
|
17
26
|
}
|
|
18
27
|
static get is() { return "evoke-checkbox"; }
|
|
19
28
|
static get originalStyleUrls() {
|
|
@@ -68,6 +77,26 @@ export class EvokeCheckbox {
|
|
|
68
77
|
"attribute": "checked",
|
|
69
78
|
"defaultValue": "false"
|
|
70
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
|
+
},
|
|
71
100
|
"disabled": {
|
|
72
101
|
"type": "boolean",
|
|
73
102
|
"mutable": false,
|
|
@@ -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; }
|