@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
package/README.md
CHANGED
|
@@ -1,3 +1,315 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @evoke-tech/stencil-ui-kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Framework-agnostic web components built with [Stencil](https://stenciljs.com). One package works in Angular, React, Vue, or plain HTML.
|
|
4
|
+
|
|
5
|
+
The kit ships 20 components (see [Components](#components)).
|
|
6
|
+
|
|
7
|
+
## Development
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install
|
|
11
|
+
npm start # dev server with live reload (opens src/index.html)
|
|
12
|
+
npm run build # produces dist/ and loader/
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
See [Test locally](#test-locally-before-publishing) and [Publish to npm](#publish-to-npm) below.
|
|
16
|
+
|
|
17
|
+
## Install & register
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @evoke-tech/stencil-ui-kit
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Include the design tokens once (global CSS):
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
@import '@evoke-tech/stencil-ui-kit/dist/evoke-ui/evoke-ui.css';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Angular
|
|
30
|
+
```ts
|
|
31
|
+
// main.ts
|
|
32
|
+
import { defineCustomElements } from '@evoke-tech/stencil-ui-kit/loader';
|
|
33
|
+
defineCustomElements();
|
|
34
|
+
|
|
35
|
+
// component / module
|
|
36
|
+
@Component({ schemas: [CUSTOM_ELEMENTS_SCHEMA], ... })
|
|
37
|
+
```
|
|
38
|
+
```html
|
|
39
|
+
<evoke-button variant="primary" (click)="save()">Save</evoke-button>
|
|
40
|
+
<evoke-input label="Email" (evokeInput)="email = $event.detail"></evoke-input>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### React
|
|
44
|
+
```tsx
|
|
45
|
+
import { defineCustomElements } from '@evoke-tech/stencil-ui-kit/loader';
|
|
46
|
+
defineCustomElements();
|
|
47
|
+
|
|
48
|
+
<evoke-button variant="danger" onClick={save}>Delete</evoke-button>
|
|
49
|
+
<evoke-input label="Email" ref={el => el?.addEventListener('evokeInput', e => setEmail(e.detail))} />
|
|
50
|
+
```
|
|
51
|
+
(React 19 passes props/events to custom elements natively; for React 18 use `ref` + `addEventListener`.)
|
|
52
|
+
|
|
53
|
+
### Vue
|
|
54
|
+
```ts
|
|
55
|
+
// vite.config.ts: vue({ template: { compilerOptions: { isCustomElement: t => t.startsWith('evoke-') } } })
|
|
56
|
+
import { defineCustomElements } from '@evoke-tech/stencil-ui-kit/loader';
|
|
57
|
+
defineCustomElements();
|
|
58
|
+
```
|
|
59
|
+
```html
|
|
60
|
+
<evoke-input label="Email" @evokeInput="email = $event.detail" />
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Plain HTML / CDN
|
|
64
|
+
```html
|
|
65
|
+
<script type="module" src="https://unpkg.com/@evoke-tech/stencil-ui-kit/dist/evoke-ui/evoke-ui.esm.js"></script>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Default look
|
|
69
|
+
|
|
70
|
+
Out of the box the components follow the Evoke Figma design: orange primary (`#ff5316`), navy secondary (`#0b1560`), Inter font, pill-shaped 56px buttons and 56px inputs with an 8px radius and a `#dedede` border.
|
|
71
|
+
|
|
72
|
+
```html
|
|
73
|
+
<evoke-input label="Username" icon="mail" placeholder="name@company.com"></evoke-input>
|
|
74
|
+
<evoke-input label="Password" icon="lock" type="password" placeholder="Enter your password"></evoke-input>
|
|
75
|
+
<evoke-button block>Sign in to workspace</evoke-button>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- `evoke-button`: `variant` = `primary` (default) | `secondary` | `outline` | `danger`; `block` makes it full width.
|
|
79
|
+
- `evoke-input`: `icon` = `mail` | `lock` | `user` | `search`.
|
|
80
|
+
- Change the look with tokens, e.g. `--evoke-primary`, `--evoke-radius-button`, `--evoke-control-height`. The Material / Tailwind / Bootstrap themes below replace these defaults with that system's look.
|
|
81
|
+
## Components
|
|
82
|
+
|
|
83
|
+
20 components, each with two variants chosen by **one prop** (default = variant 1). Tags start with `evoke-`, events start with `evoke`, and the value is `event.detail` itself.
|
|
84
|
+
|
|
85
|
+
| Component | Variant 1 (default) | Variant 2 | Events (`event.detail`) |
|
|
86
|
+
|---|---|---|---|
|
|
87
|
+
| `evoke-button` | `variant="primary\|secondary\|danger"` (solid) | `variant="ghost"` (text only); also `outline` | native `click` |
|
|
88
|
+
| `evoke-input` | `appearance="outlined"` | `appearance="filled"` | `evokeInput`, `evokeChange` (string) |
|
|
89
|
+
| `evoke-select` | single (native `<select>`) | `multiple` (chips) + optional `searchable` | `evokeChange` (string, or string[] when `multiple`) |
|
|
90
|
+
| `evoke-checkbox` | standard | `indeterminate` | `evokeChange` (boolean) |
|
|
91
|
+
| `evoke-radio-group` | `appearance="classic"` | `appearance="segmented"` | `evokeChange` (string) |
|
|
92
|
+
| `evoke-card` | `appearance="outlined"` | `appearance="elevated"` (+ `clickable`) | `evokeClick` |
|
|
93
|
+
| `evoke-alert` | `appearance="subtle"` | `appearance="solid"` | `evokeDismiss` |
|
|
94
|
+
| `evoke-modal` | `position="center"` | `position="right"` (drawer) | `evokeClose` |
|
|
95
|
+
| `evoke-textarea` | fixed `rows` | `auto-grow` + `max-length` counter | `evokeInput`, `evokeChange` (string) |
|
|
96
|
+
| `evoke-switch` | plain toggle | with `label` + `description` | `evokeChange` (boolean) |
|
|
97
|
+
| `evoke-tabs` | `appearance="underline"` | `appearance="pill"` | `evokeChange` (string) |
|
|
98
|
+
| `evoke-badge` | `count` (with `max`) | `dot` | none |
|
|
99
|
+
| `evoke-tooltip` | `theme="dark"` | `theme="light"` (arrow) | none |
|
|
100
|
+
| `evoke-toast` | message only | message + `action` | `evokeAction`, `evokeClose` |
|
|
101
|
+
| `evoke-table` | basic | `striped` + `sortable` | `evokeSort` ({ key, direction }) |
|
|
102
|
+
| `evoke-pagination` | `appearance="numbered"` | `appearance="compact"` | `evokeChange` (number) |
|
|
103
|
+
| `evoke-chip` | filter (selectable) | `removable` | `evokeChange` (boolean), `evokeRemove` |
|
|
104
|
+
| `evoke-progress` | `type="linear"` | `type="circular"` | none |
|
|
105
|
+
| `evoke-app-bar` | `appearance="light"` | `appearance="dark"` | none (slots `logo`, `nav`, `actions`) |
|
|
106
|
+
| `evoke-quantity-stepper` | `appearance="inline"` | `appearance="compact"` (dropdown) | `evokeChange` (number) |
|
|
107
|
+
|
|
108
|
+
Every component also has a class pass-through prop (`button-class`, `input-class`, `select-class`, `textarea-class`, `card-class`, `modal-class`) and shows `error` text where it applies.
|
|
109
|
+
|
|
110
|
+
### Examples (one per variant)
|
|
111
|
+
|
|
112
|
+
```html
|
|
113
|
+
<!-- Button -->
|
|
114
|
+
<evoke-button>Solid primary</evoke-button>
|
|
115
|
+
<evoke-button variant="ghost" size="sm" icon="arrow-right">Ghost</evoke-button>
|
|
116
|
+
<evoke-button loading>Saving</evoke-button>
|
|
117
|
+
<evoke-button variant="ghost" icon="cart" icon-only accessible-label="Cart"></evoke-button>
|
|
118
|
+
|
|
119
|
+
<!-- Input -->
|
|
120
|
+
<evoke-input label="Email" icon="mail" hint="We never share it"></evoke-input>
|
|
121
|
+
<evoke-input label="Email" appearance="filled" error="Email is required"></evoke-input>
|
|
122
|
+
|
|
123
|
+
<!-- Select: set options as a property (Angular/React/Vue) or a JSON string (plain HTML) -->
|
|
124
|
+
<evoke-select label="Role" placeholder="Select your role" options='[{"label":"Developer","value":"dev"}]'></evoke-select>
|
|
125
|
+
<evoke-select label="Skills" multiple searchable options='[{"label":"Angular","value":"ng"},{"label":"React","value":"react"}]'></evoke-select>
|
|
126
|
+
|
|
127
|
+
<!-- Checkbox -->
|
|
128
|
+
<evoke-checkbox label="Remember me" checked></evoke-checkbox>
|
|
129
|
+
<evoke-checkbox label="Select all" indeterminate></evoke-checkbox>
|
|
130
|
+
|
|
131
|
+
<!-- Radio group -->
|
|
132
|
+
<evoke-radio-group label="Plan" inline options='[{"label":"Free","value":"free"},{"label":"Pro","value":"pro"}]'></evoke-radio-group>
|
|
133
|
+
<evoke-radio-group label="Billing" appearance="segmented" options='[{"label":"Monthly","value":"m"},{"label":"Yearly","value":"y"}]'></evoke-radio-group>
|
|
134
|
+
|
|
135
|
+
<!-- Card (the media slot is optional) -->
|
|
136
|
+
<evoke-card heading="Outlined">Body</evoke-card>
|
|
137
|
+
<evoke-card appearance="elevated" clickable heading="Product"><img slot="media" src="shoe.jpg" alt="" />Body</evoke-card>
|
|
138
|
+
|
|
139
|
+
<!-- Alert -->
|
|
140
|
+
<evoke-alert type="success" dismissible>Saved</evoke-alert>
|
|
141
|
+
<evoke-alert type="danger" appearance="solid">Payment failed</evoke-alert>
|
|
142
|
+
|
|
143
|
+
<!-- Modal: set `open`, listen for evokeClose. Focus is trapped and returned on close. -->
|
|
144
|
+
<evoke-modal open heading="Confirm">Centred dialog</evoke-modal>
|
|
145
|
+
<evoke-modal open heading="Cart" position="right" size="lg">Side drawer</evoke-modal>
|
|
146
|
+
|
|
147
|
+
<!-- Textarea -->
|
|
148
|
+
<evoke-textarea label="Notes" rows="3"></evoke-textarea>
|
|
149
|
+
<evoke-textarea label="Bio" auto-grow max-length="200"></evoke-textarea>
|
|
150
|
+
|
|
151
|
+
<!-- Switch -->
|
|
152
|
+
<evoke-switch accessible-label="Notifications"></evoke-switch>
|
|
153
|
+
<evoke-switch label="Email alerts" description="Get a message when an order ships"></evoke-switch>
|
|
154
|
+
|
|
155
|
+
<!-- Tabs: options are the tab list; put the active panel's content inside -->
|
|
156
|
+
<evoke-tabs label="Product" value="specs" options='[{"label":"Overview","value":"o"},{"label":"Specs","value":"specs"}]'>Panel content</evoke-tabs>
|
|
157
|
+
<evoke-tabs appearance="pill" options='[{"label":"All","value":"all"},{"label":"Sale","value":"sale"}]'></evoke-tabs>
|
|
158
|
+
|
|
159
|
+
<!-- Badge: wrap anything, or use it on its own -->
|
|
160
|
+
<evoke-badge count="3" label="3 items in cart"><evoke-button icon="cart" icon-only accessible-label="Cart"></evoke-button></evoke-badge>
|
|
161
|
+
<evoke-badge dot color="success" label="Online"></evoke-badge>
|
|
162
|
+
|
|
163
|
+
<!-- Tooltip: wrap the trigger; placement = top | bottom | left | right -->
|
|
164
|
+
<evoke-tooltip text="Delete item"><evoke-button variant="outline">Hover</evoke-button></evoke-tooltip>
|
|
165
|
+
<evoke-tooltip text="Details" theme="light" placement="bottom"><evoke-button variant="outline">Info</evoke-button></evoke-tooltip>
|
|
166
|
+
|
|
167
|
+
<!-- Toast: duration 0 keeps it open -->
|
|
168
|
+
<evoke-toast open message="Saved"></evoke-toast>
|
|
169
|
+
<evoke-toast open message="Added to cart" action="View cart" type="success"></evoke-toast>
|
|
170
|
+
|
|
171
|
+
<!-- Table: columns/rows as properties or JSON strings -->
|
|
172
|
+
<evoke-table columns='[{"key":"name","label":"Name"}]' rows='[{"name":"Maya"}]'></evoke-table>
|
|
173
|
+
<evoke-table striped sortable columns='[{"key":"name","label":"Name","sortable":true}]' rows='[{"name":"Maya"}]'></evoke-table>
|
|
174
|
+
|
|
175
|
+
<!-- Pagination: total = number of pages -->
|
|
176
|
+
<evoke-pagination page="2" total="10"></evoke-pagination>
|
|
177
|
+
<evoke-pagination page="2" total="10" appearance="compact"></evoke-pagination>
|
|
178
|
+
|
|
179
|
+
<!-- Chip -->
|
|
180
|
+
<evoke-chip label="In stock"></evoke-chip>
|
|
181
|
+
<evoke-chip label="Red" removable></evoke-chip>
|
|
182
|
+
|
|
183
|
+
<!-- Progress -->
|
|
184
|
+
<evoke-progress value="60" label="Uploading"></evoke-progress>
|
|
185
|
+
<evoke-progress type="circular" indeterminate label="Loading"></evoke-progress>
|
|
186
|
+
|
|
187
|
+
<!-- App bar -->
|
|
188
|
+
<evoke-app-bar sticky>
|
|
189
|
+
<span slot="logo">Evoke</span>
|
|
190
|
+
<span slot="nav"><a href="/" aria-current="page">Home</a><a href="/shop">Shop</a></span>
|
|
191
|
+
<span slot="actions"><evoke-button size="sm">Sign in</evoke-button></span>
|
|
192
|
+
</evoke-app-bar>
|
|
193
|
+
<evoke-app-bar appearance="dark">...</evoke-app-bar>
|
|
194
|
+
|
|
195
|
+
<!-- Quantity stepper -->
|
|
196
|
+
<evoke-quantity-stepper value="2" min="1" max="10"></evoke-quantity-stepper>
|
|
197
|
+
<evoke-quantity-stepper value="3" appearance="compact"></evoke-quantity-stepper>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Props that take lists (`options`, `columns`, `rows`) accept an array property or a JSON string. Bind them as properties in frameworks: `[options]="roles"` (Angular), `options={roles}` (React 19), `:options="roles"` (Vue).
|
|
201
|
+
|
|
202
|
+
### Accessibility
|
|
203
|
+
Real `<button>`, `<input>`, `<select>` and `<textarea>` elements; visible labels; `aria-label` on icon-only controls (`accessible-label`); `aria-invalid` + `role="alert"` for errors; arrow-key navigation for tabs, radios, select (multi/searchable) and the stepper; Esc to close modal, drawer, select and tooltip; focus trapped in modal/drawer and restored on close; `prefers-reduced-motion` respected.
|
|
204
|
+
|
|
205
|
+
Icons (`icon` prop): `mail`, `lock`, `user`, `search`, `plus`, `minus`, `check`, `x`, `arrow-right`, `arrow-up`, `arrow-down`, `cart`, `info`, `alert`, and the chevrons.
|
|
206
|
+
## Styling / themes
|
|
207
|
+
|
|
208
|
+
Components render in the **light DOM** (`shadow: false`), so global stylesheets reach them. Look and feel is driven by `--evoke-*` CSS variables. Pick **one** theme file and import it after the base CSS:
|
|
209
|
+
|
|
210
|
+
| Your stack | Import (global stylesheet) |
|
|
211
|
+
|---|---|
|
|
212
|
+
| Plain CSS | `@import '@evoke-tech/stencil-ui-kit/dist/evoke-ui/evoke-ui.css';` and override `--evoke-*` yourself |
|
|
213
|
+
| Angular + Material | base + `@import '@evoke-tech/stencil-ui-kit/themes/material.css';` (maps to `--mat-sys-*`) |
|
|
214
|
+
| Angular or React + Tailwind | base + `@import '@evoke-tech/stencil-ui-kit/themes/tailwind.css';` (maps to Tailwind `--color-*`, `--radius-*`) |
|
|
215
|
+
| Any + Bootstrap | base + `@import '@evoke-tech/stencil-ui-kit/themes/bootstrap.css';` (maps to `--bs-*`) |
|
|
216
|
+
|
|
217
|
+
```css
|
|
218
|
+
/* styles.css, Angular Material example */
|
|
219
|
+
@import '@evoke-tech/stencil-ui-kit/dist/evoke-ui/evoke-ui.css';
|
|
220
|
+
@import '@evoke-tech/stencil-ui-kit/themes/material.css';
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
On top of the theme you can pass utility classes through the class props: `button-class`, `input-class`, `card-class`, `modal-class`.
|
|
224
|
+
|
|
225
|
+
```html
|
|
226
|
+
<evoke-button button-class="px-6 py-3 rounded-full shadow-lg">Tailwind</evoke-button>
|
|
227
|
+
<evoke-button button-class="btn btn-lg">Bootstrap</evoke-button>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Tokens: `--evoke-primary`, `-primary-contrast`, `-primary-text` (primary colour used for text on light backgrounds), `-surface-muted`, `-shadow`, `-text-muted`, `-danger`, `-success`, `-warning`, `-info`, `-surface`, `-text`, `-border`, `-radius`, `-radius-field`, `-font`, `-focus-ring`.
|
|
231
|
+
|
|
232
|
+
Light-DOM trade-off: component CSS is global, so it is prefixed with the tag name (`evoke-button .evoke-btn`) to avoid collisions.
|
|
233
|
+
|
|
234
|
+
## Test locally before publishing
|
|
235
|
+
|
|
236
|
+
Use `npm pack`: it creates the exact tarball that `npm publish` would upload, so it also catches problems with `files` / `exports`.
|
|
237
|
+
|
|
238
|
+
### 1. Build and pack
|
|
239
|
+
```bash
|
|
240
|
+
cd D:\Stenciljs_NPM_Package
|
|
241
|
+
npm run build
|
|
242
|
+
npm pack
|
|
243
|
+
```
|
|
244
|
+
This creates `evoke-tech-stencil-ui-kit-0.1.0.tgz`. To check what is inside: `npm pack --dry-run`.
|
|
245
|
+
|
|
246
|
+
### 2. Install into a test project (Angular, React or Vue)
|
|
247
|
+
```bash
|
|
248
|
+
cd path/to/your-test-app
|
|
249
|
+
npm install D:\Stenciljs_NPM_Package\evoke-tech-stencil-ui-kit-0.1.0.tgz
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### 3. Register the components and a theme
|
|
253
|
+
- **Angular:** in `main.ts` call `defineCustomElements()` from `@evoke-tech/stencil-ui-kit/loader`, add `schemas: [CUSTOM_ELEMENTS_SCHEMA]` to the component/module, and import the base CSS plus one theme in `styles.css`.
|
|
254
|
+
- **React:** in `main.tsx` call `defineCustomElements()`, and import the base CSS plus one theme in your global CSS.
|
|
255
|
+
|
|
256
|
+
See [Install & register](#install--register) and [Styling / themes](#styling--themes) above for the exact snippets.
|
|
257
|
+
|
|
258
|
+
### 4. Verify
|
|
259
|
+
- Run the app (`ng serve` / `npm run dev`) and use `<evoke-button>`, `<evoke-input>`, `<evoke-card>`, `<evoke-alert>`, `<evoke-modal>`.
|
|
260
|
+
- Check the components are styled and the theme tokens change the look (Material / Tailwind / Bootstrap).
|
|
261
|
+
- Check events: `evokeInput` / `evokeChange` / `evokeClose` / `evokeDismiss` deliver the value in `event.detail`.
|
|
262
|
+
- Check class props work, e.g. `button-class="btn btn-lg"` (Bootstrap) or `button-class="px-6 py-3"` (Tailwind).
|
|
263
|
+
|
|
264
|
+
### 5. After changing the package
|
|
265
|
+
Rebuild and repack, then reinstall in the test app:
|
|
266
|
+
```bash
|
|
267
|
+
cd D:\Stenciljs_NPM_Package && npm run build && npm pack
|
|
268
|
+
cd path/to/your-test-app && npm install D:\Stenciljs_NPM_Package\evoke-tech-stencil-ui-kit-0.1.0.tgz
|
|
269
|
+
```
|
|
270
|
+
(If the app keeps using the old code, delete its `node_modules/.vite` or `.angular/cache` folder and restart.)
|
|
271
|
+
|
|
272
|
+
Alternative: `npm link` (run `npm link` in the package folder, then `npm link @evoke-tech/stencil-ui-kit` in the app). It is faster to iterate but can break with duplicate-dependency or symlink issues; if so, use `npm pack`.
|
|
273
|
+
|
|
274
|
+
## Publish to npm
|
|
275
|
+
|
|
276
|
+
### One-time setup
|
|
277
|
+
1. Create an account at https://www.npmjs.com and enable 2FA.
|
|
278
|
+
2. Log in from the terminal:
|
|
279
|
+
```bash
|
|
280
|
+
npm login
|
|
281
|
+
npm whoami # confirms you are logged in
|
|
282
|
+
```
|
|
283
|
+
3. Confirm the package name is free (a 404 means it is available):
|
|
284
|
+
```bash
|
|
285
|
+
npm view @evoke-tech/stencil-ui-kit
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Every release
|
|
289
|
+
1. Make sure the build and the local test above pass.
|
|
290
|
+
2. Bump the version (follows semver; creates a git tag if this is a git repo):
|
|
291
|
+
```bash
|
|
292
|
+
npm version patch # 0.1.0 -> 0.1.1 (bug fix)
|
|
293
|
+
npm version minor # 0.1.0 -> 0.2.0 (new component/feature)
|
|
294
|
+
npm version major # 0.1.0 -> 1.0.0 (breaking change)
|
|
295
|
+
```
|
|
296
|
+
3. Preview what will be published (only `dist/` and `loader/` should be listed):
|
|
297
|
+
```bash
|
|
298
|
+
npm pack --dry-run
|
|
299
|
+
```
|
|
300
|
+
4. Publish (`prepublishOnly` rebuilds automatically):
|
|
301
|
+
```bash
|
|
302
|
+
npm publish --access public
|
|
303
|
+
```
|
|
304
|
+
If you enabled 2FA you will be asked for a one-time code (`npm publish --otp=123456`).
|
|
305
|
+
5. Verify:
|
|
306
|
+
```bash
|
|
307
|
+
npm view @evoke-tech/stencil-ui-kit
|
|
308
|
+
npm install @evoke-tech/stencil-ui-kit # in a clean project
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Notes
|
|
312
|
+
- Scoped packages are private by default, so the first publish needs `--access public` (see step 4). Later releases remember it.
|
|
313
|
+
- A published version can't be overwritten; fix problems by publishing a new version. Within 72 hours you can `npm unpublish @evoke-tech/stencil-ui-kit@0.1.0`.
|
|
314
|
+
- To try a release before going public, publish a pre-release under a tag: `npm version prerelease --preid=beta && npm publish --tag beta` (installed with `npm install @evoke-tech/stencil-ui-kit@beta`).
|
|
315
|
+
- Add `"repository"` and `"author"` fields to `package.json` so the npm page links to your source.
|