@voxket-ai/events-sdk 1.0.6 → 1.0.7
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 +53 -1
- package/dist/components/ShadowWrapper.d.ts +1 -0
- package/dist/events-sdk.js +1717 -1552
- package/dist/events-sdk.umd.cjs +4 -5
- package/dist/utils/themeUtils.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -184,7 +184,7 @@ All available options for the `WidgetConfig` object:
|
|
|
184
184
|
| `themeMode` | `'light' \| 'dark'` | `'light'` | Controls the base color scheme (clean white/gray or deep black `#000` with high-contrast text). |
|
|
185
185
|
| `theme` | `object` | `{}` | Detailed appearance customization (see below). |
|
|
186
186
|
| `theme.primaryColor` | `string` | `'#2563eb'` | Brand color used for primary buttons, tabs, highlights, and headers. |
|
|
187
|
-
| `theme.fontFamily` | `string` |
|
|
187
|
+
| `theme.fontFamily` | `string` | Host page's font | Leave it out to use the host page's font. Pass a font family CSS string (e.g. `'Inter, sans-serif'`) to use a different one. See [Matching the Host Site's Design](#matching-the-host-sites-design). |
|
|
188
188
|
| `theme.mode` | `'light' \| 'dark' \| 'blue' \| 'white' \| 'custom'` | `'light'` | Preset theme mode alias. |
|
|
189
189
|
| `isAbstract` | `boolean` | `false` | Abstract submission page: no attendee login, shows `is_review` fields, adds `accept_review_file: true` on submit. See [Abstract Submission Page](#3-abstract-submission-page). |
|
|
190
190
|
| `headerBannerImage` | `string` | `undefined` | Banner image on the right of the top header, scaled to the header's height; its left edge fades into the header's theme-color gradient. See [Banner & Background Images](#banner--background-images). |
|
|
@@ -346,6 +346,58 @@ const config: WidgetConfig = {
|
|
|
346
346
|
|
|
347
347
|
---
|
|
348
348
|
|
|
349
|
+
## Matching the Host Site's Design
|
|
350
|
+
|
|
351
|
+
The widget renders inside a Shadow DOM, so the host site's classes (Tailwind, shadcn, global CSS) never reach it and never break it. The host site can still restyle it in two ways. Both are opt-in: if the host site sets nothing, the widget looks exactly as before.
|
|
352
|
+
|
|
353
|
+
### 1. Fonts
|
|
354
|
+
|
|
355
|
+
The widget uses the host page's font by default, with nothing to configure. To use a different font, pass it in the config:
|
|
356
|
+
|
|
357
|
+
```typescript
|
|
358
|
+
theme: { fontFamily: 'Inter, sans-serif' }
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Headings use the same font unless the host page sets `--vx-font-heading`. Both can be set as CSS variables anywhere on the host page (`:root` works; they pass into the Shadow DOM), and they take priority over `theme.fontFamily`:
|
|
362
|
+
|
|
363
|
+
```css
|
|
364
|
+
:root {
|
|
365
|
+
--vx-font-family: var(--font-sans); /* body text, inputs, buttons */
|
|
366
|
+
--vx-font-heading: var(--font-heading); /* titles and headings */
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### 2. Element styles with `::part()`
|
|
371
|
+
|
|
372
|
+
Key elements carry a `part` name. Target them from the host site's CSS through the widget host element `[data-voxket-shadow-host]`. These rules override the widget's own styles, including hover and focus states you target yourself (`::part(card):hover`, `::part(input):focus`).
|
|
373
|
+
|
|
374
|
+
```css
|
|
375
|
+
[data-voxket-shadow-host]::part(card) {
|
|
376
|
+
border-radius: 1.75rem;
|
|
377
|
+
border: 1px solid var(--border);
|
|
378
|
+
box-shadow: none;
|
|
379
|
+
}
|
|
380
|
+
[data-voxket-shadow-host]::part(card-title) { color: var(--foreground); }
|
|
381
|
+
[data-voxket-shadow-host]::part(button-primary) { border-radius: 9999px; }
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
| Area | Part names |
|
|
385
|
+
| :--- | :--- |
|
|
386
|
+
| Whole widget | `widget`, `launcher` (popup "Join" button) |
|
|
387
|
+
| Form-types list | `page`, `header`, `header-title`, `header-subtitle`, `tabs`, `tab`, `tab-active`, `list`, `search` (title + search toolbar), `list-title`, `list-count`, `search-input`, `empty-state`, `card-grid` |
|
|
388
|
+
| Form-type card | `card`, `card-category`, `card-seats`, `card-title`, `card-price`, `card-tax`, `card-description`, `card-perks`, `card-button` |
|
|
389
|
+
| Registration form | `form-page`, `form-header`, `back-button`, `form-type-name`, `form-type-price`, `form`, `form-intro`, `form-title`, `notice`, `notice-title`, `form-card` (card holding all fields), `field` (one section per field), `field-label`, `field-description`, `upload`, `review-upload`, `submit-button` |
|
|
390
|
+
| Result screens | `screen`, `screen-payment`, `screen-success`, `screen-error`, `screen-header`, `screen-header-title`, `screen-title`, `screen-message`, `registration-number`, `copy-button` |
|
|
391
|
+
| Attendee portal | `portal`, `portal-card` (login / get code / set password card, and every profile card), `profile-card`, `details-card`, `addons-card`, `logout-button`, `portal-title`, `back-button`, `field-label`, `upload`, `submit-button` |
|
|
392
|
+
| Shared | `input` (text inputs, selects, textareas), `select`, `textarea`, `button`, `button-primary`, `button-secondary`, `button-link` |
|
|
393
|
+
|
|
394
|
+
Notes:
|
|
395
|
+
- `::part()` cannot reach inside a part (`::part(card) h3` does not work). Use the dedicated part (`::part(card-title)`).
|
|
396
|
+
- Many inputs have an icon on the left. Avoid overriding `padding` on `::part(input)`, or the text will overlap the icon.
|
|
397
|
+
- The widget's colors are still driven by `theme.primaryColor` and `themeMode`. Rules you add apply in both light and dark mode.
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
349
401
|
## Client API Methods (`EventWidgetClient`)
|
|
350
402
|
|
|
351
403
|
When using the vanilla JavaScript / non-React API:
|