@wippy-fe/theme 0.0.10 → 0.0.12
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 +20 -1
- package/THEMING.md +142 -0
- package/package.json +35 -35
package/README.md
CHANGED
|
@@ -59,6 +59,25 @@ Import PrimeVue component styles in your CSS:
|
|
|
59
59
|
| `@wippy-fe/theme/primevue-plugin` | Vue plugin that installs PrimeVue with `{ theme: 'none' }` |
|
|
60
60
|
| `@wippy-fe/theme/primevue/*` | PrimeVue component CSS files (Tailwind @apply-based) |
|
|
61
61
|
|
|
62
|
+
## Host UI Customization
|
|
63
|
+
|
|
64
|
+
The Wippy host exposes `--wippy-host-*` CSS variables and BEM class names for restyling the chat UI, sidebar, splitter, and message bubbles without forking. See [THEMING.md](./THEMING.md) §6 for the full reference.
|
|
65
|
+
|
|
66
|
+
**Key principle:** Always scope host-only selectors to `.wippy-host-app` — `customCSS` is injected into both the host and nested child iframes, so unscoped rules will leak.
|
|
67
|
+
|
|
68
|
+
```css
|
|
69
|
+
/* Variables are already prefixed — no scoping needed */
|
|
70
|
+
:root { --wippy-host-message-radius: 0.5rem; }
|
|
71
|
+
|
|
72
|
+
/* Class selectors MUST be scoped to .wippy-host-app */
|
|
73
|
+
.wippy-host-app .chat-message__content { border-radius: 4px; }
|
|
74
|
+
|
|
75
|
+
/* Bad — leaks into child iframes */
|
|
76
|
+
.chat-message__content { border-radius: 4px; }
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Available variable groups:** `--wippy-host-message-*` (bubbles), `--wippy-host-tool-*` (tool calls), `--wippy-host-avatar-*`, `--wippy-host-sidebar-*`, `--wippy-host-splitter-*`.
|
|
80
|
+
|
|
62
81
|
## Theming Reference
|
|
63
82
|
|
|
64
|
-
See [THEMING.md](./THEMING.md) for the full reference on CSS variables, Tailwind utility classes, dark mode behavior,
|
|
83
|
+
See [THEMING.md](./THEMING.md) for the full reference on CSS variables, Tailwind utility classes, dark mode behavior, PrimeVue component styling, and host UI customization.
|
package/THEMING.md
CHANGED
|
@@ -348,3 +348,145 @@ Contrast ratio = (L_lighter + 0.05) / (L_darker + 0.05)
|
|
|
348
348
|
```
|
|
349
349
|
|
|
350
350
|
WCAG AA requires 4.5:1 for normal text, 3:1 for large text (18px+ bold or 24px+ regular).
|
|
351
|
+
|
|
352
|
+
## 6. Host UI Customization (CSS Variables & BEM Classes)
|
|
353
|
+
|
|
354
|
+
The Wippy host exposes CSS custom properties and BEM class names on its core UI components. Override these via `AppConfig.customization.cssVariables` or `customCSS` to restyle the host without forking.
|
|
355
|
+
|
|
356
|
+
> **Important:** Because `customCSS` and `cssVariables` are injected into both the host AND all nested child iframes, always scope host-only overrides to `.wippy-host-app`. For example, use `.wippy-host-app .chat-message { ... }` — never `.chat-message { ... }` alone, or the styles will leak into child iframes.
|
|
357
|
+
|
|
358
|
+
### Layout & Sidebar
|
|
359
|
+
|
|
360
|
+
| Variable | Default | Description |
|
|
361
|
+
|---|---|---|
|
|
362
|
+
| `--wippy-host-sidebar-width-open` | `16rem` | Sidebar width when expanded |
|
|
363
|
+
| `--wippy-host-sidebar-width-closed` | `3.5rem` | Sidebar width when collapsed |
|
|
364
|
+
|
|
365
|
+
**BEM classes** (scope with `.wippy-host-app`):
|
|
366
|
+
|
|
367
|
+
| Class | Element |
|
|
368
|
+
|---|---|
|
|
369
|
+
| `.layout` | Root layout wrapper |
|
|
370
|
+
| `.layout__sidebar` | Sidebar container |
|
|
371
|
+
| `.layout__sidebar-header` | Sidebar header (logo + toggle) |
|
|
372
|
+
| `.layout__sidebar-nav` | Navigation list area |
|
|
373
|
+
| `.layout__main` | Main content area (right of sidebar) |
|
|
374
|
+
|
|
375
|
+
### Splitter Gutter
|
|
376
|
+
|
|
377
|
+
The resizable panel divider between main content and the right panel.
|
|
378
|
+
|
|
379
|
+
| Variable | Default | Description |
|
|
380
|
+
|---|---|---|
|
|
381
|
+
| `--wippy-host-splitter-width` | `1px` | Visible line width |
|
|
382
|
+
| `--wippy-host-splitter-hit-area` | `10px` | Draggable hit area width (transparent) |
|
|
383
|
+
| `--wippy-host-splitter-color` | `var(--p-surface-200)` (light) / `var(--p-surface-600)` (dark) | Line color |
|
|
384
|
+
|
|
385
|
+
### Chat Messages
|
|
386
|
+
|
|
387
|
+
| Variable | Default | Description |
|
|
388
|
+
|---|---|---|
|
|
389
|
+
| `--wippy-host-message-radius` | `1rem` | Message bubble border radius |
|
|
390
|
+
| `--wippy-host-message-padding-x` | `1rem` | Message horizontal padding |
|
|
391
|
+
| `--wippy-host-message-padding-y` | `0.5rem` | Message vertical padding |
|
|
392
|
+
| `--wippy-host-message-user-bg` | `var(--p-primary-50)` | User message background |
|
|
393
|
+
| `--wippy-host-message-agent-bg` | `var(--p-yellow-50)` (light) / `var(--p-surface-800)` (dark) | Agent message background |
|
|
394
|
+
| `--wippy-host-tool-bg` | `var(--p-help-50)` | Tool call background |
|
|
395
|
+
| `--wippy-host-tool-border` | `var(--p-help-300)` | Tool call left border |
|
|
396
|
+
| `--wippy-host-avatar-size` | `2rem` | Message avatar diameter |
|
|
397
|
+
|
|
398
|
+
**BEM classes** (scope with `.wippy-host-app`):
|
|
399
|
+
|
|
400
|
+
| Class | Element |
|
|
401
|
+
|---|---|
|
|
402
|
+
| `.chat-message` | Message row container |
|
|
403
|
+
| `.chat-message--user` | User message modifier |
|
|
404
|
+
| `.chat-message--agent-message` | Agent message modifier |
|
|
405
|
+
| `.chat-message--tool` | Tool call message modifier |
|
|
406
|
+
| `.chat-message--error` | Error message modifier |
|
|
407
|
+
| `.chat-message__avatar` | Avatar wrapper |
|
|
408
|
+
| `.chat-message__avatar-icon` | Avatar icon circle |
|
|
409
|
+
| `.chat-message__content` | Message bubble |
|
|
410
|
+
| `.chat-message__body` | Message text content |
|
|
411
|
+
| `.chat-message__footer` | Timestamp row |
|
|
412
|
+
| `.chat-message__tool-name` | Tool name label |
|
|
413
|
+
| `.chat-message__tool-icon` | Tool icon |
|
|
414
|
+
| `.chat-message__agent-content` | Agent name system line |
|
|
415
|
+
| `.chat-message__model-content` | Model name system line |
|
|
416
|
+
| `.chat-message__files` | Attached files row |
|
|
417
|
+
| `.chat-tool-group` | Inline tool call badge group |
|
|
418
|
+
| `.chat-tool-group__badge` | Individual tool badge |
|
|
419
|
+
| `.chat-tool-group__badge--success` | Completed tool badge |
|
|
420
|
+
| `.chat-tool-group__badge--error` | Failed tool badge |
|
|
421
|
+
| `.chat-tool-group__badge--processing` | In-progress tool badge |
|
|
422
|
+
| `.chat-tool-group__icon` | Badge icon |
|
|
423
|
+
|
|
424
|
+
### Chat Input
|
|
425
|
+
|
|
426
|
+
**BEM classes** (scope with `.wippy-host-app`):
|
|
427
|
+
|
|
428
|
+
| Class | Element |
|
|
429
|
+
|---|---|
|
|
430
|
+
| `.chat-input` | Input bar container |
|
|
431
|
+
| `.chat-input__group` | Input field + buttons wrapper |
|
|
432
|
+
| `.chat-input__textarea` | Message textarea |
|
|
433
|
+
| `.chat-input__attach-button` | Attachment button |
|
|
434
|
+
| `.chat-input__send-button` | Send button |
|
|
435
|
+
| `.chat-input__stop-button` | Stop generation button |
|
|
436
|
+
| `.chat-input__upload-list` | Upload queue list |
|
|
437
|
+
| `.chat-input__prompts` | Suggested prompts area |
|
|
438
|
+
|
|
439
|
+
### Chat Container
|
|
440
|
+
|
|
441
|
+
**BEM classes** (scope with `.wippy-host-app`):
|
|
442
|
+
|
|
443
|
+
| Class | Element |
|
|
444
|
+
|---|---|
|
|
445
|
+
| `.chat-container` | Outer chat wrapper |
|
|
446
|
+
| `.chat-container--selected` | Has active session |
|
|
447
|
+
| `.chat-container--non-selected` | No session selected |
|
|
448
|
+
| `.chat-container__empty-state` | Empty state wrapper |
|
|
449
|
+
| `.chat-container__empty-state-icon` | Empty state icon |
|
|
450
|
+
| `.chat-container__empty-state-title` | Empty state heading |
|
|
451
|
+
| `.chat-container__empty-state-description` | Empty state text |
|
|
452
|
+
| `.chat-container__drop-zone` | File drag-and-drop overlay |
|
|
453
|
+
| `.chat-container__drop-zone-icon` | Drop zone icon |
|
|
454
|
+
|
|
455
|
+
### Session Selector
|
|
456
|
+
|
|
457
|
+
**BEM classes** (scope with `.wippy-host-app`):
|
|
458
|
+
|
|
459
|
+
| Class | Element |
|
|
460
|
+
|---|---|
|
|
461
|
+
| `.session-selector` | Selector wrapper |
|
|
462
|
+
| `.session-selector__dropdown` | Dropdown component |
|
|
463
|
+
| `.session-selector__option` | Session option row |
|
|
464
|
+
| `.session-selector__active-dot` | Active session indicator |
|
|
465
|
+
|
|
466
|
+
### Root
|
|
467
|
+
|
|
468
|
+
| Class | Element |
|
|
469
|
+
|---|---|
|
|
470
|
+
| `.wippy-host-app` | Application root element — scope all host-only CSS overrides to this |
|
|
471
|
+
|
|
472
|
+
### Example: Custom-Styled Host
|
|
473
|
+
|
|
474
|
+
```css
|
|
475
|
+
/* Via AppConfig.customization.customCSS */
|
|
476
|
+
|
|
477
|
+
/* Variables are already prefixed — no scoping needed */
|
|
478
|
+
:root {
|
|
479
|
+
--wippy-host-message-radius: 0.5rem;
|
|
480
|
+
--wippy-host-message-user-bg: #e0f2fe;
|
|
481
|
+
--wippy-host-sidebar-width-open: 20rem;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/* Class selectors MUST be scoped to .wippy-host-app */
|
|
485
|
+
.wippy-host-app .chat-message__footer {
|
|
486
|
+
display: none; /* hide timestamps */
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.wippy-host-app .session-selector {
|
|
490
|
+
display: none; /* hide session picker */
|
|
491
|
+
}
|
|
492
|
+
```
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@wippy-fe/theme",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Theme variables, shared Tailwind config, and PrimeVue styling for Wippy web components.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "theme-config.css",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": "./theme-config.css",
|
|
9
|
-
"./theme-config.css": "./theme-config.css",
|
|
10
|
-
"./tailwind.config": "./tailwind.config.ts",
|
|
11
|
-
"./primevue-plugin": "./primevue-plugin.ts",
|
|
12
|
-
"./primevue/*": "./primevue/*"
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"theme-config.css",
|
|
16
|
-
"tailwind.config.ts",
|
|
17
|
-
"primevue-plugin.ts",
|
|
18
|
-
"primevue/",
|
|
19
|
-
"THEMING.md",
|
|
20
|
-
"README.md"
|
|
21
|
-
],
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"tailwindcss-primeui": "^0.6.1",
|
|
24
|
-
"tailwind-scrollbar": "^3.0.0"
|
|
25
|
-
},
|
|
26
|
-
"peerDependencies": {
|
|
27
|
-
"primevue": "^4.0.0"
|
|
28
|
-
},
|
|
29
|
-
"peerDependenciesMeta": {
|
|
30
|
-
"primevue": {
|
|
31
|
-
"optional": true
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"license": "UNLICENSED"
|
|
35
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@wippy-fe/theme",
|
|
3
|
+
"version": "0.0.12",
|
|
4
|
+
"description": "Theme variables, shared Tailwind config, and PrimeVue styling for Wippy web components.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "theme-config.css",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./theme-config.css",
|
|
9
|
+
"./theme-config.css": "./theme-config.css",
|
|
10
|
+
"./tailwind.config": "./tailwind.config.ts",
|
|
11
|
+
"./primevue-plugin": "./primevue-plugin.ts",
|
|
12
|
+
"./primevue/*": "./primevue/*"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"theme-config.css",
|
|
16
|
+
"tailwind.config.ts",
|
|
17
|
+
"primevue-plugin.ts",
|
|
18
|
+
"primevue/",
|
|
19
|
+
"THEMING.md",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"tailwindcss-primeui": "^0.6.1",
|
|
24
|
+
"tailwind-scrollbar": "^3.0.0"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"primevue": "^4.0.0"
|
|
28
|
+
},
|
|
29
|
+
"peerDependenciesMeta": {
|
|
30
|
+
"primevue": {
|
|
31
|
+
"optional": true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"license": "UNLICENSED"
|
|
35
|
+
}
|