@evoke-tech/stencil-ui-kit 0.1.0 → 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 +120 -20
- 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 +3 -0
- 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/package.json +11 -4
- 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
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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
4
|
|
|
5
|
-
|
|
5
|
+
The kit ships 20 components (see [Components](#components)).
|
|
6
6
|
|
|
7
7
|
## Development
|
|
8
8
|
|
|
@@ -78,31 +78,131 @@ Out of the box the components follow the Evoke Figma design: orange primary (`#f
|
|
|
78
78
|
- `evoke-button`: `variant` = `primary` (default) | `secondary` | `outline` | `danger`; `block` makes it full width.
|
|
79
79
|
- `evoke-input`: `icon` = `mail` | `lock` | `user` | `search`.
|
|
80
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
|
-
##
|
|
82
|
-
|
|
83
|
-
|
|
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)
|
|
84
111
|
|
|
85
112
|
```html
|
|
86
|
-
|
|
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>
|
|
87
118
|
|
|
88
|
-
|
|
89
|
-
|
|
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>
|
|
90
122
|
|
|
91
|
-
|
|
92
|
-
<evoke-
|
|
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>
|
|
93
126
|
|
|
94
|
-
|
|
95
|
-
|
|
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>
|
|
96
198
|
```
|
|
97
199
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
| `evoke-checkbox` | `label`, `checked`, `disabled`, `error`, `input-class` | `evokeChange` (boolean) |
|
|
103
|
-
| `evoke-radio-group` | `label`, `options`, `value`, `name`, `inline`, `disabled`, `error` | `evokeChange` (string) |
|
|
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.
|
|
104
204
|
|
|
105
|
-
`
|
|
205
|
+
Icons (`icon` prop): `mail`, `lock`, `user`, `search`, `plus`, `minus`, `check`, `x`, `arrow-right`, `arrow-up`, `arrow-down`, `cart`, `info`, `alert`, and the chevrons.
|
|
106
206
|
## Styling / themes
|
|
107
207
|
|
|
108
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:
|
|
@@ -127,7 +227,7 @@ On top of the theme you can pass utility classes through the class props: `butto
|
|
|
127
227
|
<evoke-button button-class="btn btn-lg">Bootstrap</evoke-button>
|
|
128
228
|
```
|
|
129
229
|
|
|
130
|
-
Tokens: `--evoke-primary`, `-primary-contrast`, `-danger`, `-success`, `-warning`, `-info`, `-surface`, `-text`, `-border`, `-radius`, `-radius-field`, `-font`, `-focus-ring`.
|
|
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`.
|
|
131
231
|
|
|
132
232
|
Light-DOM trade-off: component CSS is global, so it is prefixed with the tag name (`evoke-button .evoke-btn`) to avoid collisions.
|
|
133
233
|
|
|
@@ -212,4 +312,4 @@ Alternative: `npm link` (run `npm link` in the package folder, then `npm link @e
|
|
|
212
312
|
- Scoped packages are private by default, so the first publish needs `--access public` (see step 4). Later releases remember it.
|
|
213
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`.
|
|
214
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`).
|
|
215
|
-
- Add `"repository"` and `"author"` fields to `package.json` so the npm page links to your source.
|
|
315
|
+
- Add `"repository"` and `"author"` fields to `package.json` so the npm page links to your source.
|