@evoke-tech/stencil-ui-kit 0.0.0-stage → 0.1.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 +214 -2
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/evoke-alert_6.cjs.entry.js +172 -0
- package/dist/cjs/evoke-card.cjs.entry.js +20 -0
- package/dist/cjs/evoke-modal.cjs.entry.js +34 -0
- package/dist/cjs/evoke-ui.cjs.js +25 -0
- package/dist/cjs/index-B8xS0y1i.js +1989 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/collection/collection-manifest.json +20 -0
- package/dist/collection/components/evoke-alert/evoke-alert.css +7 -0
- package/dist/collection/components/evoke-alert/evoke-alert.js +83 -0
- package/dist/collection/components/evoke-button/evoke-button.css +17 -0
- package/dist/collection/components/evoke-button/evoke-button.js +131 -0
- package/dist/collection/components/evoke-card/evoke-card.css +4 -0
- package/dist/collection/components/evoke-card/evoke-card.js +66 -0
- package/dist/collection/components/evoke-checkbox/evoke-checkbox.css +16 -0
- package/dist/collection/components/evoke-checkbox/evoke-checkbox.js +151 -0
- package/dist/collection/components/evoke-input/evoke-input.css +17 -0
- package/dist/collection/components/evoke-input/evoke-input.js +234 -0
- package/dist/collection/components/evoke-modal/evoke-modal.css +5 -0
- package/dist/collection/components/evoke-modal/evoke-modal.js +146 -0
- package/dist/collection/components/evoke-radio-group/evoke-radio-group.css +16 -0
- package/dist/collection/components/evoke-radio-group/evoke-radio-group.js +207 -0
- package/dist/collection/components/evoke-select/evoke-select.css +16 -0
- package/dist/collection/components/evoke-select/evoke-select.js +203 -0
- package/dist/collection/index.js +1 -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-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-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-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/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_6.entry.js +165 -0
- package/dist/esm/evoke-card.entry.js +18 -0
- package/dist/esm/evoke-modal.entry.js +32 -0
- package/dist/esm/evoke-ui.js +21 -0
- package/dist/esm/index-BtM1wZ-I.js +1982 -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-243075cd.entry.js +1 -0
- package/dist/evoke-ui/p-605d4757.entry.js +1 -0
- package/dist/evoke-ui/p-9a6eaeb6.entry.js +1 -0
- package/dist/evoke-ui/p-BtM1wZ-I.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 +23 -0
- package/dist/themes/material.css +21 -0
- package/dist/themes/tailwind.css +24 -0
- package/dist/themes/tokens.css +26 -0
- package/dist/types/components/evoke-alert/evoke-alert.d.ts +8 -0
- package/dist/types/components/evoke-button/evoke-button.d.ts +11 -0
- package/dist/types/components/evoke-card/evoke-card.d.ts +6 -0
- package/dist/types/components/evoke-checkbox/evoke-checkbox.d.ts +13 -0
- package/dist/types/components/evoke-input/evoke-input.d.ts +19 -0
- package/dist/types/components/evoke-modal/evoke-modal.d.ts +14 -0
- package/dist/types/components/evoke-radio-group/evoke-radio-group.d.ts +18 -0
- package/dist/types/components/evoke-select/evoke-select.d.ts +18 -0
- package/dist/types/components.d.ts +657 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +1879 -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 +58 -4
package/README.md
CHANGED
|
@@ -1,3 +1,215 @@
|
|
|
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
|
+
Components: `evoke-button`, `evoke-input`, `evoke-select`, `evoke-checkbox`, `evoke-radio-group`, `evoke-card`, `evoke-alert`, `evoke-modal`.
|
|
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
|
+
## Form components
|
|
82
|
+
|
|
83
|
+
All form components show an error message when you set the `error` prop, and emit `evokeChange` (inputs also emit `evokeInput` on each keystroke).
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<evoke-input label="Username" icon="mail" error="Username is required"></evoke-input>
|
|
87
|
+
|
|
88
|
+
<evoke-select label="Sign in as" placeholder="Select your role"
|
|
89
|
+
options='[{"label":"Developer","value":"dev"},{"label":"Designer","value":"designer"}]'></evoke-select>
|
|
90
|
+
|
|
91
|
+
<evoke-checkbox label="Remember me" checked></evoke-checkbox>
|
|
92
|
+
<evoke-checkbox label="I accept the terms" error="You must accept the terms"></evoke-checkbox>
|
|
93
|
+
|
|
94
|
+
<evoke-radio-group label="Plan" value="pro" inline
|
|
95
|
+
options='[{"label":"Free","value":"free"},{"label":"Pro","value":"pro"}]'></evoke-radio-group>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
| Component | Props | Event (`event.detail`) |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `evoke-input` | `label`, `value`, `type`, `placeholder`, `icon`, `disabled`, `error`, `input-class` | `evokeInput`, `evokeChange` (string) |
|
|
101
|
+
| `evoke-select` | `label`, `options`, `value`, `placeholder`, `disabled`, `error`, `select-class` | `evokeChange` (string) |
|
|
102
|
+
| `evoke-checkbox` | `label`, `checked`, `disabled`, `error`, `input-class` | `evokeChange` (boolean) |
|
|
103
|
+
| `evoke-radio-group` | `label`, `options`, `value`, `name`, `inline`, `disabled`, `error` | `evokeChange` (string) |
|
|
104
|
+
|
|
105
|
+
`options` is an array of `{ label, value, disabled? }`. In Angular/React/Vue bind it as a property (`[options]="roles"`, `options={roles}`, `:options="roles"`); in plain HTML pass a JSON string.
|
|
106
|
+
## Styling / themes
|
|
107
|
+
|
|
108
|
+
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:
|
|
109
|
+
|
|
110
|
+
| Your stack | Import (global stylesheet) |
|
|
111
|
+
|---|---|
|
|
112
|
+
| Plain CSS | `@import '@evoke-tech/stencil-ui-kit/dist/evoke-ui/evoke-ui.css';` and override `--evoke-*` yourself |
|
|
113
|
+
| Angular + Material | base + `@import '@evoke-tech/stencil-ui-kit/themes/material.css';` (maps to `--mat-sys-*`) |
|
|
114
|
+
| Angular or React + Tailwind | base + `@import '@evoke-tech/stencil-ui-kit/themes/tailwind.css';` (maps to Tailwind `--color-*`, `--radius-*`) |
|
|
115
|
+
| Any + Bootstrap | base + `@import '@evoke-tech/stencil-ui-kit/themes/bootstrap.css';` (maps to `--bs-*`) |
|
|
116
|
+
|
|
117
|
+
```css
|
|
118
|
+
/* styles.css, Angular Material example */
|
|
119
|
+
@import '@evoke-tech/stencil-ui-kit/dist/evoke-ui/evoke-ui.css';
|
|
120
|
+
@import '@evoke-tech/stencil-ui-kit/themes/material.css';
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
On top of the theme you can pass utility classes through the class props: `button-class`, `input-class`, `card-class`, `modal-class`.
|
|
124
|
+
|
|
125
|
+
```html
|
|
126
|
+
<evoke-button button-class="px-6 py-3 rounded-full shadow-lg">Tailwind</evoke-button>
|
|
127
|
+
<evoke-button button-class="btn btn-lg">Bootstrap</evoke-button>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Tokens: `--evoke-primary`, `-primary-contrast`, `-danger`, `-success`, `-warning`, `-info`, `-surface`, `-text`, `-border`, `-radius`, `-radius-field`, `-font`, `-focus-ring`.
|
|
131
|
+
|
|
132
|
+
Light-DOM trade-off: component CSS is global, so it is prefixed with the tag name (`evoke-button .evoke-btn`) to avoid collisions.
|
|
133
|
+
|
|
134
|
+
## Test locally before publishing
|
|
135
|
+
|
|
136
|
+
Use `npm pack`: it creates the exact tarball that `npm publish` would upload, so it also catches problems with `files` / `exports`.
|
|
137
|
+
|
|
138
|
+
### 1. Build and pack
|
|
139
|
+
```bash
|
|
140
|
+
cd D:\Stenciljs_NPM_Package
|
|
141
|
+
npm run build
|
|
142
|
+
npm pack
|
|
143
|
+
```
|
|
144
|
+
This creates `evoke-tech-stencil-ui-kit-0.1.0.tgz`. To check what is inside: `npm pack --dry-run`.
|
|
145
|
+
|
|
146
|
+
### 2. Install into a test project (Angular, React or Vue)
|
|
147
|
+
```bash
|
|
148
|
+
cd path/to/your-test-app
|
|
149
|
+
npm install D:\Stenciljs_NPM_Package\evoke-tech-stencil-ui-kit-0.1.0.tgz
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 3. Register the components and a theme
|
|
153
|
+
- **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`.
|
|
154
|
+
- **React:** in `main.tsx` call `defineCustomElements()`, and import the base CSS plus one theme in your global CSS.
|
|
155
|
+
|
|
156
|
+
See [Install & register](#install--register) and [Styling / themes](#styling--themes) above for the exact snippets.
|
|
157
|
+
|
|
158
|
+
### 4. Verify
|
|
159
|
+
- Run the app (`ng serve` / `npm run dev`) and use `<evoke-button>`, `<evoke-input>`, `<evoke-card>`, `<evoke-alert>`, `<evoke-modal>`.
|
|
160
|
+
- Check the components are styled and the theme tokens change the look (Material / Tailwind / Bootstrap).
|
|
161
|
+
- Check events: `evokeInput` / `evokeChange` / `evokeClose` / `evokeDismiss` deliver the value in `event.detail`.
|
|
162
|
+
- Check class props work, e.g. `button-class="btn btn-lg"` (Bootstrap) or `button-class="px-6 py-3"` (Tailwind).
|
|
163
|
+
|
|
164
|
+
### 5. After changing the package
|
|
165
|
+
Rebuild and repack, then reinstall in the test app:
|
|
166
|
+
```bash
|
|
167
|
+
cd D:\Stenciljs_NPM_Package && npm run build && npm pack
|
|
168
|
+
cd path/to/your-test-app && npm install D:\Stenciljs_NPM_Package\evoke-tech-stencil-ui-kit-0.1.0.tgz
|
|
169
|
+
```
|
|
170
|
+
(If the app keeps using the old code, delete its `node_modules/.vite` or `.angular/cache` folder and restart.)
|
|
171
|
+
|
|
172
|
+
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`.
|
|
173
|
+
|
|
174
|
+
## Publish to npm
|
|
175
|
+
|
|
176
|
+
### One-time setup
|
|
177
|
+
1. Create an account at https://www.npmjs.com and enable 2FA.
|
|
178
|
+
2. Log in from the terminal:
|
|
179
|
+
```bash
|
|
180
|
+
npm login
|
|
181
|
+
npm whoami # confirms you are logged in
|
|
182
|
+
```
|
|
183
|
+
3. Confirm the package name is free (a 404 means it is available):
|
|
184
|
+
```bash
|
|
185
|
+
npm view @evoke-tech/stencil-ui-kit
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Every release
|
|
189
|
+
1. Make sure the build and the local test above pass.
|
|
190
|
+
2. Bump the version (follows semver; creates a git tag if this is a git repo):
|
|
191
|
+
```bash
|
|
192
|
+
npm version patch # 0.1.0 -> 0.1.1 (bug fix)
|
|
193
|
+
npm version minor # 0.1.0 -> 0.2.0 (new component/feature)
|
|
194
|
+
npm version major # 0.1.0 -> 1.0.0 (breaking change)
|
|
195
|
+
```
|
|
196
|
+
3. Preview what will be published (only `dist/` and `loader/` should be listed):
|
|
197
|
+
```bash
|
|
198
|
+
npm pack --dry-run
|
|
199
|
+
```
|
|
200
|
+
4. Publish (`prepublishOnly` rebuilds automatically):
|
|
201
|
+
```bash
|
|
202
|
+
npm publish --access public
|
|
203
|
+
```
|
|
204
|
+
If you enabled 2FA you will be asked for a one-time code (`npm publish --otp=123456`).
|
|
205
|
+
5. Verify:
|
|
206
|
+
```bash
|
|
207
|
+
npm view @evoke-tech/stencil-ui-kit
|
|
208
|
+
npm install @evoke-tech/stencil-ui-kit # in a clean project
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Notes
|
|
212
|
+
- Scoped packages are private by default, so the first publish needs `--access public` (see step 4). Later releases remember it.
|
|
213
|
+
- 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
|
+
- 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.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-B8xS0y1i.js');
|
|
4
|
+
|
|
5
|
+
const evokeAlertCss = () => `evoke-alert{display:block}evoke-alert .evoke-alert{display:flex;justify-content:space-between;gap:1rem;padding:0.75rem 1rem;border-radius:var(--evoke-radius, 8px);border:1px solid currentColor;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)}evoke-alert .evoke-alert--info{color:var(--evoke-info, #0891b2);background:#ecfeff}evoke-alert .evoke-alert--success{color:var(--evoke-success, #16a34a);background:#f0fdf4}evoke-alert .evoke-alert--warning{color:var(--evoke-warning, #d97706);background:#fffbeb}evoke-alert .evoke-alert--danger{color:var(--evoke-danger, #dc2626);background:#fef2f2}evoke-alert .evoke-alert__close{background:none;border:0;color:inherit;font-size:1.25rem;cursor:pointer;line-height:1}`;
|
|
6
|
+
|
|
7
|
+
const EvokeAlert = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.evokeDismiss = index.createEvent(this, "evokeDismiss");
|
|
11
|
+
this.type = 'info';
|
|
12
|
+
this.dismissible = false;
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return (index.h("div", { key: 'aa100cfbdf5f8551d0a46c50aa649a523bd05da7', class: `evoke-alert evoke-alert--${this.type}`, role: "alert" }, index.h("div", { key: '93c4881344307580c8d1411259651f5eb22a72f5', class: "evoke-alert__content" }, index.h("slot", { key: 'ba362718033dff392088efed51e8332b8cccfa2d' })), this.dismissible && (index.h("button", { key: '5dcdd2e50ca6df6e430f59a4f88b63b3419c42b3', type: "button", class: "evoke-alert__close", "aria-label": "Dismiss", onClick: () => this.evokeDismiss.emit() }, "\u00D7"))));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
EvokeAlert.style = evokeAlertCss();
|
|
19
|
+
|
|
20
|
+
const evokeButtonCss = () => `evoke-button{display:inline-block}evoke-button .evoke-btn{box-sizing:border-box;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:var(--evoke-font-size, 16px);line-height:1.5;cursor:pointer;height:var(--evoke-control-height, 56px);padding:0 var(--evoke-button-padding-x, 36px);display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;border:1px solid transparent;border-radius:var(--evoke-radius-button, 9999px);transition:filter 0.15s, box-shadow 0.15s}evoke-button .evoke-btn:hover:not(:disabled){filter:brightness(0.92)}evoke-button .evoke-btn:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-button .evoke-btn:disabled{opacity:0.5;cursor:not-allowed}evoke-button .evoke-btn--primary{background:var(--evoke-primary, #ff5316);color:var(--evoke-primary-contrast, #ffffff)}evoke-button .evoke-btn--secondary{background:var(--evoke-secondary, #0b1560);color:var(--evoke-secondary-contrast, #ffffff)}evoke-button .evoke-btn--danger{background:var(--evoke-danger, #dc2626);color:#fff}evoke-button .evoke-btn--outline{background:transparent;color:var(--evoke-primary, #ff5316);border-color:var(--evoke-primary, #ff5316)}evoke-button[block]{display:block}evoke-button[block] .evoke-btn{width:100%}`;
|
|
21
|
+
|
|
22
|
+
const EvokeButton = class {
|
|
23
|
+
constructor(hostRef) {
|
|
24
|
+
index.registerInstance(this, hostRef);
|
|
25
|
+
/** Visual variant */
|
|
26
|
+
this.variant = 'primary';
|
|
27
|
+
this.type = 'button';
|
|
28
|
+
this.disabled = false;
|
|
29
|
+
/** Stretch to the full width of the container */
|
|
30
|
+
this.block = false;
|
|
31
|
+
/** Extra classes for the inner <button>, e.g. "btn btn-lg" (Bootstrap) or "shadow-lg" (Tailwind) */
|
|
32
|
+
this.buttonClass = '';
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (index.h("button", { key: 'b48e546fa722334e82989fe1125d7c9ab3fb4b17', type: this.type, disabled: this.disabled, class: `evoke-btn evoke-btn--${this.variant} ${this.buttonClass}`.trim() }, index.h("slot", { key: '04716e70e788b071b67bbb25b8bc9d57b5066641' })));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
EvokeButton.style = evokeButtonCss();
|
|
39
|
+
|
|
40
|
+
const evokeCheckboxCss = () => `evoke-checkbox{display:block}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)}evoke-checkbox .evoke-check__row{display:inline-flex;align-items:center;gap:0.5rem;cursor:pointer;font-size:0.875rem}evoke-checkbox .evoke-check__row--disabled{opacity:0.6;cursor:not-allowed}evoke-checkbox .evoke-check__input{appearance:none;-webkit-appearance:none;margin:0;flex:none;width:16px;height:16px;border:2px solid var(--evoke-primary, #ff5316);border-radius:4px;background:var(--evoke-surface, #ffffff) center / 12px no-repeat;cursor:inherit;transition:background-color 0.15s, box-shadow 0.15s}evoke-checkbox .evoke-check__input:checked{background-color:var(--evoke-primary, #ff5316);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")}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))}evoke-checkbox .evoke-check__input--error{border-color:var(--evoke-danger, #dc2626)}evoke-checkbox .evoke-check__error{color:var(--evoke-danger, #dc2626);font-size:0.875rem}`;
|
|
41
|
+
|
|
42
|
+
const EvokeCheckbox = class {
|
|
43
|
+
constructor(hostRef) {
|
|
44
|
+
index.registerInstance(this, hostRef);
|
|
45
|
+
this.evokeChange = index.createEvent(this, "evokeChange");
|
|
46
|
+
this.label = '';
|
|
47
|
+
this.checked = false;
|
|
48
|
+
this.disabled = false;
|
|
49
|
+
/** Error message shown below the checkbox */
|
|
50
|
+
this.error = '';
|
|
51
|
+
/** Extra classes for the inner <input> */
|
|
52
|
+
this.inputClass = '';
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
return (index.h("div", { key: '873dc82ace76a0e84e3ee13e9275b9db130e96eb', class: "evoke-check" }, index.h("label", { key: '26b9e5ee359f855eca9f8e7722c06e62d6856005', class: `evoke-check__row ${this.disabled ? 'evoke-check__row--disabled' : ''}` }, index.h("input", { key: 'a338d54a0d91b8f2766dc540a0af2defa1241aa0', type: "checkbox", class: `evoke-check__input ${this.error ? 'evoke-check__input--error' : ''} ${this.inputClass}`.trim(), checked: this.checked, disabled: this.disabled, "aria-invalid": this.error ? 'true' : undefined, onChange: (e) => {
|
|
56
|
+
this.checked = e.target.checked;
|
|
57
|
+
this.evokeChange.emit(this.checked);
|
|
58
|
+
} }), index.h("span", { key: '7036e0576bb0fcf561f1fa5a970409bd419cd363', class: "evoke-check__label" }, this.label, index.h("slot", { key: 'fba4bd96cecebce1b68297a7a59bbc660ad00107' }))), this.error && index.h("span", { key: '924e7ca9becb279c733b9fa79daea6c1f7b4d140', class: "evoke-check__error", role: "alert" }, this.error)));
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
EvokeCheckbox.style = evokeCheckboxCss();
|
|
62
|
+
|
|
63
|
+
const evokeInputCss = () => `evoke-input{display:block}evoke-input .evoke-field{display:flex;flex-direction:column;gap:0.5rem;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:var(--evoke-font-size, 16px);color:var(--evoke-text, #1a1a1a)}evoke-input .evoke-field__label{color:var(--evoke-text, #1a1a1a)}evoke-input .evoke-field__control{position:relative}evoke-input .evoke-field__icon{position:absolute;left:16px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--evoke-text-muted, #7a7a7a);pointer-events:none}evoke-input .evoke-field__input{box-sizing:border-box;width:100%;height:var(--evoke-control-height, 56px);padding:0 24px;border:1px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius-field, 8px);background:var(--evoke-surface, #ffffff);color:var(--evoke-text, #1a1a1a);font:inherit;transition:border-color 0.15s, box-shadow 0.15s}evoke-input .evoke-field__input--icon{padding-left:44px}evoke-input .evoke-field__input::placeholder{color:var(--evoke-text-muted, #7a7a7a)}evoke-input .evoke-field__input:focus{outline:none;border-color:var(--evoke-secondary, #0b1560);box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-input .evoke-field__input:disabled{opacity:0.6;cursor:not-allowed}evoke-input .evoke-field__input--error{border-color:var(--evoke-danger, #dc2626)}evoke-input .evoke-field__error{color:var(--evoke-danger, #dc2626);font-size:0.875rem}`;
|
|
64
|
+
|
|
65
|
+
const ICONS = {
|
|
66
|
+
mail: ['M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z', 'm22 7-10 6L2 7'],
|
|
67
|
+
lock: ['M5 11h14a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2z', 'M7 11V7a5 5 0 0 1 10 0v4'],
|
|
68
|
+
user: ['M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2', 'M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z'],
|
|
69
|
+
search: ['M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16z', 'm21 21-4.3-4.3'],
|
|
70
|
+
};
|
|
71
|
+
const EvokeInput = class {
|
|
72
|
+
constructor(hostRef) {
|
|
73
|
+
index.registerInstance(this, hostRef);
|
|
74
|
+
this.evokeInput = index.createEvent(this, "evokeInput");
|
|
75
|
+
this.evokeChange = index.createEvent(this, "evokeChange");
|
|
76
|
+
this.label = '';
|
|
77
|
+
this.value = '';
|
|
78
|
+
this.type = 'text';
|
|
79
|
+
this.placeholder = '';
|
|
80
|
+
this.disabled = false;
|
|
81
|
+
this.error = '';
|
|
82
|
+
/** Extra classes for the inner <input>, e.g. "form-control" (Bootstrap) */
|
|
83
|
+
this.inputClass = '';
|
|
84
|
+
this.inputId = `evoke-input-${Math.random().toString(36).slice(2, 9)}`;
|
|
85
|
+
}
|
|
86
|
+
render() {
|
|
87
|
+
const iconPaths = this.icon ? ICONS[this.icon] : undefined;
|
|
88
|
+
return (index.h("div", { key: '1d86d23ab15a3f626d9fb970032d5214a94df0ef', class: "evoke-field" }, this.label && index.h("label", { key: 'c3fea666855f42bf73dafb585645cb9035191d03', htmlFor: this.inputId, class: "evoke-field__label" }, this.label), index.h("div", { key: '78656110961b784f80ce1a6efd5152452bff5f08', class: "evoke-field__control" }, iconPaths && (index.h("svg", { key: '5635c5c5066042ea8c8a7a11067a1b00e6d92915', class: "evoke-field__icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, iconPaths.map((d) => index.h("path", { d: d })))), index.h("input", { key: '33ce669be666a515f053173c2a6f3105b4f806c9', id: this.inputId, class: `evoke-field__input ${iconPaths ? 'evoke-field__input--icon' : ''} ${this.error ? 'evoke-field__input--error' : ''} ${this.inputClass}`.trim(), type: this.type, value: this.value, placeholder: this.placeholder, disabled: this.disabled, "aria-invalid": this.error ? 'true' : undefined, onInput: (e) => {
|
|
89
|
+
this.value = e.target.value;
|
|
90
|
+
this.evokeInput.emit(this.value);
|
|
91
|
+
}, onChange: (e) => this.evokeChange.emit(e.target.value) })), this.error && index.h("span", { key: 'c396800cb6a6f10309e936b1300ed9652e56d153', class: "evoke-field__error", role: "alert" }, this.error)));
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
EvokeInput.style = evokeInputCss();
|
|
95
|
+
|
|
96
|
+
/** Accepts an array, or a JSON string (so options can be set as an HTML attribute). */
|
|
97
|
+
function parseOptions(options) {
|
|
98
|
+
if (Array.isArray(options))
|
|
99
|
+
return options;
|
|
100
|
+
try {
|
|
101
|
+
const parsed = JSON.parse(options);
|
|
102
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
103
|
+
}
|
|
104
|
+
catch (_a) {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const evokeRadioGroupCss = () => `evoke-radio-group{display:block}evoke-radio-group .evoke-radio{display:flex;flex-direction:column;gap:0.5rem;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);color:var(--evoke-text, #1a1a1a)}evoke-radio-group .evoke-radio__label{font-size:var(--evoke-font-size, 16px)}evoke-radio-group .evoke-radio__options{display:flex;flex-direction:column;gap:0.5rem}evoke-radio-group .evoke-radio__options--inline{flex-direction:row;flex-wrap:wrap;gap:1.25rem}evoke-radio-group .evoke-radio__row{display:inline-flex;align-items:center;gap:0.5rem;cursor:pointer;font-size:0.875rem}evoke-radio-group .evoke-radio__row--disabled{opacity:0.6;cursor:not-allowed}evoke-radio-group .evoke-radio__input{appearance:none;-webkit-appearance:none;margin:0;flex:none;width:16px;height:16px;border:2px solid var(--evoke-primary, #ff5316);border-radius:50%;background:var(--evoke-surface, #ffffff);cursor:inherit;transition:box-shadow 0.15s}evoke-radio-group .evoke-radio__input:checked{background:radial-gradient(circle, var(--evoke-primary, #ff5316) 0 40%, var(--evoke-surface, #ffffff) 45%)}evoke-radio-group .evoke-radio__input:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-radio-group .evoke-radio__input--error{border-color:var(--evoke-danger, #dc2626)}evoke-radio-group .evoke-radio__error{color:var(--evoke-danger, #dc2626);font-size:0.875rem}`;
|
|
110
|
+
|
|
111
|
+
const EvokeRadioGroup = class {
|
|
112
|
+
constructor(hostRef) {
|
|
113
|
+
index.registerInstance(this, hostRef);
|
|
114
|
+
this.evokeChange = index.createEvent(this, "evokeChange");
|
|
115
|
+
this.label = '';
|
|
116
|
+
/** Options as an array of { label, value, disabled? } or a JSON string of the same */
|
|
117
|
+
this.options = [];
|
|
118
|
+
this.value = '';
|
|
119
|
+
this.name = '';
|
|
120
|
+
this.disabled = false;
|
|
121
|
+
/** Lay options out in a row instead of a column */
|
|
122
|
+
this.inline = false;
|
|
123
|
+
/** Error message shown below the group */
|
|
124
|
+
this.error = '';
|
|
125
|
+
this.groupName = `evoke-radio-${Math.random().toString(36).slice(2, 9)}`;
|
|
126
|
+
}
|
|
127
|
+
render() {
|
|
128
|
+
const name = this.name || this.groupName;
|
|
129
|
+
return (index.h("div", { key: 'f90c5bee5d2eff847373e075c32689be55ded5b7', class: "evoke-radio", role: "radiogroup", "aria-label": this.label || undefined }, this.label && index.h("span", { key: '1fbc7f744f3ec03637afce04a0dba2ee7beeec37', class: "evoke-radio__label" }, this.label), index.h("div", { key: 'cec0e44939dbca02e5623ce9b49c5c074f7c6fa7', class: `evoke-radio__options ${this.inline ? 'evoke-radio__options--inline' : ''}` }, parseOptions(this.options).map((o) => {
|
|
130
|
+
const off = this.disabled || o.disabled;
|
|
131
|
+
return (index.h("label", { class: `evoke-radio__row ${off ? 'evoke-radio__row--disabled' : ''}` }, index.h("input", { type: "radio", class: `evoke-radio__input ${this.error ? 'evoke-radio__input--error' : ''}`.trim(), name: name, value: o.value, checked: o.value === this.value, disabled: off, onChange: () => {
|
|
132
|
+
this.value = o.value;
|
|
133
|
+
this.evokeChange.emit(this.value);
|
|
134
|
+
} }), index.h("span", null, o.label)));
|
|
135
|
+
})), this.error && index.h("span", { key: 'd19f6043ee840711e62a6feb577a3f44dbed48be', class: "evoke-radio__error", role: "alert" }, this.error)));
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
EvokeRadioGroup.style = evokeRadioGroupCss();
|
|
139
|
+
|
|
140
|
+
const evokeSelectCss = () => `evoke-select{display:block}evoke-select .evoke-field{display:flex;flex-direction:column;gap:0.5rem;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:var(--evoke-font-size, 16px);color:var(--evoke-text, #1a1a1a)}evoke-select .evoke-field__control{position:relative}evoke-select .evoke-field__input{box-sizing:border-box;width:100%;height:var(--evoke-control-height, 56px);padding:0 48px 0 24px;border:1px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius-field, 8px);background:var(--evoke-surface, #ffffff);color:var(--evoke-text, #1a1a1a);font:inherit;appearance:none;-webkit-appearance:none;cursor:pointer;transition:border-color 0.15s, box-shadow 0.15s}evoke-select .evoke-field__select--empty{color:var(--evoke-text-muted, #7a7a7a)}evoke-select .evoke-field__input:focus{outline:none;border-color:var(--evoke-secondary, #0b1560);box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-select .evoke-field__input:disabled{opacity:0.6;cursor:not-allowed}evoke-select .evoke-field__input--error{border-color:var(--evoke-danger, #dc2626)}evoke-select .evoke-field__chevron{position:absolute;right:16px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--evoke-text-muted, #7a7a7a);pointer-events:none}evoke-select .evoke-field__error{color:var(--evoke-danger, #dc2626);font-size:0.875rem}`;
|
|
141
|
+
|
|
142
|
+
const EvokeSelect = class {
|
|
143
|
+
constructor(hostRef) {
|
|
144
|
+
index.registerInstance(this, hostRef);
|
|
145
|
+
this.evokeChange = index.createEvent(this, "evokeChange");
|
|
146
|
+
this.label = '';
|
|
147
|
+
/** Options as an array of { label, value, disabled? } or a JSON string of the same */
|
|
148
|
+
this.options = [];
|
|
149
|
+
this.value = '';
|
|
150
|
+
this.placeholder = 'Select an option';
|
|
151
|
+
this.disabled = false;
|
|
152
|
+
/** Error message shown below the field */
|
|
153
|
+
this.error = '';
|
|
154
|
+
/** Extra classes for the inner <select>, e.g. "form-select" (Bootstrap) */
|
|
155
|
+
this.selectClass = '';
|
|
156
|
+
this.selectId = `evoke-select-${Math.random().toString(36).slice(2, 9)}`;
|
|
157
|
+
}
|
|
158
|
+
render() {
|
|
159
|
+
return (index.h("div", { key: '4a1543d6630c1594254213c2cafcfc6883f32ce2', class: "evoke-field" }, this.label && index.h("label", { key: 'e387eb1dd52bd755ad848908603c06f45e99a9d8', htmlFor: this.selectId, class: "evoke-field__label" }, this.label), index.h("div", { key: '4a23b2f05d408cd8f5d4942dc578e5a07233d17d', class: "evoke-field__control" }, index.h("select", { key: '3aae8448326e8e4008570b07320f28a576d4c08c', id: this.selectId, class: `evoke-field__input evoke-field__select ${this.value === '' ? 'evoke-field__select--empty' : ''} ${this.error ? 'evoke-field__input--error' : ''} ${this.selectClass}`.trim(), disabled: this.disabled, "aria-invalid": this.error ? 'true' : undefined, onChange: (e) => {
|
|
160
|
+
this.value = e.target.value;
|
|
161
|
+
this.evokeChange.emit(this.value);
|
|
162
|
+
} }, index.h("option", { key: '04defa87db88f21fc5bec7577afb7bb2ded1d6c6', value: "", disabled: true, selected: this.value === '' }, this.placeholder), parseOptions(this.options).map((o) => (index.h("option", { value: o.value, disabled: o.disabled, selected: o.value === this.value }, o.label)))), index.h("svg", { key: '35046765ad125b7c7bfc66b3a55e8c2dfeae05a0', class: "evoke-field__chevron", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { key: 'e65fd0cf45dd70061f37afa51db756906fe819d0', d: "m6 9 6 6 6-6" }))), this.error && index.h("span", { key: '055c84a93853e14c2d1ec7c493c59f2d864c071a', class: "evoke-field__error", role: "alert" }, this.error)));
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
EvokeSelect.style = evokeSelectCss();
|
|
166
|
+
|
|
167
|
+
exports.evoke_alert = EvokeAlert;
|
|
168
|
+
exports.evoke_button = EvokeButton;
|
|
169
|
+
exports.evoke_checkbox = EvokeCheckbox;
|
|
170
|
+
exports.evoke_input = EvokeInput;
|
|
171
|
+
exports.evoke_radio_group = EvokeRadioGroup;
|
|
172
|
+
exports.evoke_select = EvokeSelect;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-B8xS0y1i.js');
|
|
4
|
+
|
|
5
|
+
const evokeCardCss = () => `evoke-card{display:block}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-field, 8px);font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);overflow:hidden}evoke-card .evoke-card__header{padding:0.75rem 1rem;font-weight:600;border-bottom:1px solid var(--evoke-border, #dedede)}evoke-card .evoke-card__body{padding:1rem}`;
|
|
6
|
+
|
|
7
|
+
const EvokeCard = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.heading = '';
|
|
11
|
+
/** Extra classes for the card container, e.g. "shadow-md" (Tailwind) or "card" (Bootstrap) */
|
|
12
|
+
this.cardClass = '';
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return (index.h("div", { key: 'cc5ba924fc7779952a0677c2e70303781928fe48', class: `evoke-card ${this.cardClass}`.trim() }, this.heading && index.h("div", { key: 'bc64916a89f0309642d9b255c424e6764efbe76b', class: "evoke-card__header" }, this.heading), index.h("div", { key: 'bf3c54ab8eed335f9ce9143b8a29168563c1773f', class: "evoke-card__body" }, index.h("slot", { key: 'e4668d5c4fc9bd870012c84780918de81fb7a8f3' }))));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
EvokeCard.style = evokeCardCss();
|
|
19
|
+
|
|
20
|
+
exports.evoke_card = EvokeCard;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-B8xS0y1i.js');
|
|
4
|
+
|
|
5
|
+
const evokeModalCss = () => `evoke-modal .evoke-modal__backdrop{position:fixed;inset:0;background:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1000}evoke-modal .evoke-modal{background:var(--evoke-surface, #ffffff);color:var(--evoke-text, #1a1a1a);border-radius:var(--evoke-radius-field, 8px);font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);min-width:min(90vw, 360px);max-width:90vw;max-height:90vh;overflow:auto;box-shadow:0 20px 40px rgba(0, 0, 0, 0.25)}evoke-modal .evoke-modal__header{display:flex;justify-content:space-between;align-items:center;padding:0.75rem 1rem;font-weight:600;border-bottom:1px solid var(--evoke-border, #dedede)}evoke-modal .evoke-modal__close{background:none;border:0;color:inherit;font-size:1.25rem;cursor:pointer;line-height:1}evoke-modal .evoke-modal__body{padding:1rem}`;
|
|
6
|
+
|
|
7
|
+
const EvokeModal = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.evokeClose = index.createEvent(this, "evokeClose");
|
|
11
|
+
/** Whether the modal is visible */
|
|
12
|
+
this.open = false;
|
|
13
|
+
this.heading = '';
|
|
14
|
+
this.closeOnBackdrop = true;
|
|
15
|
+
/** Extra classes for the dialog panel */
|
|
16
|
+
this.modalClass = '';
|
|
17
|
+
}
|
|
18
|
+
onKeydown(e) {
|
|
19
|
+
if (this.open && e.key === 'Escape')
|
|
20
|
+
this.close();
|
|
21
|
+
}
|
|
22
|
+
close() {
|
|
23
|
+
this.open = false;
|
|
24
|
+
this.evokeClose.emit();
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
if (!this.open)
|
|
28
|
+
return null;
|
|
29
|
+
return (index.h("div", { class: "evoke-modal__backdrop", onClick: () => this.closeOnBackdrop && this.close() }, index.h("div", { class: `evoke-modal ${this.modalClass}`.trim(), role: "dialog", "aria-modal": "true", "aria-label": this.heading || undefined, onClick: (e) => e.stopPropagation() }, index.h("div", { class: "evoke-modal__header" }, index.h("span", null, this.heading), index.h("button", { type: "button", class: "evoke-modal__close", "aria-label": "Close", onClick: () => this.close() }, "\u00D7")), index.h("div", { class: "evoke-modal__body" }, index.h("slot", null)))));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
EvokeModal.style = evokeModalCss();
|
|
33
|
+
|
|
34
|
+
exports.evoke_modal = EvokeModal;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-B8xS0y1i.js');
|
|
4
|
+
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
|
+
|
|
6
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Browser v4.45.2 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
var patchBrowser = () => {
|
|
12
|
+
const importMeta = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('evoke-ui.cjs.js', document.baseURI).href));
|
|
13
|
+
const opts = {};
|
|
14
|
+
if (importMeta !== "") {
|
|
15
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
16
|
+
}
|
|
17
|
+
return index.promiseResolve(opts);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
patchBrowser().then(async (options) => {
|
|
21
|
+
await appGlobals.globalScripts();
|
|
22
|
+
return index.bootstrapLazy([["evoke-alert_6.cjs",[[260,"evoke-alert",{"type":[1],"dismissible":[4]}],[260,"evoke-button",{"variant":[1],"type":[1],"disabled":[4],"block":[516],"buttonClass":[1,"button-class"]}],[260,"evoke-checkbox",{"label":[1],"checked":[1540],"disabled":[4],"error":[1],"inputClass":[1,"input-class"]}],[0,"evoke-input",{"label":[1],"value":[1025],"type":[1],"placeholder":[1],"disabled":[4],"error":[1],"icon":[1],"inputClass":[1,"input-class"]}],[0,"evoke-radio-group",{"label":[1],"options":[1],"value":[1025],"name":[1],"disabled":[4],"inline":[4],"error":[1]}],[0,"evoke-select",{"label":[1],"options":[1],"value":[1025],"placeholder":[1],"disabled":[4],"error":[1],"selectClass":[1,"select-class"]}]]],["evoke-card.cjs",[[260,"evoke-card",{"heading":[1],"cardClass":[1,"card-class"]}]]],["evoke-modal.cjs",[[260,"evoke-modal",{"open":[1540],"heading":[1],"closeOnBackdrop":[4,"close-on-backdrop"],"modalClass":[1,"modal-class"]},[[8,"keydown","onKeydown"]]]]]], options);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
exports.setNonce = index.setNonce;
|