@wippy-fe/theme 0.0.42 → 0.0.43

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/THEMING.md CHANGED
@@ -676,6 +676,14 @@ The CSS files use theme variables via Tailwind classes. Example from `button.css
676
676
 
677
677
  The `tailwind.css` master file imports all component CSS files organized by category (form, button, data, overlay, menu, panel, file, message, media, misc).
678
678
 
679
+ ### Overlays render inside the shadow root
680
+
681
+ PrimeVue overlays — `Dialog`, `Drawer`, `Select`, `Popover`, `Menu`, `MultiSelect`, … — teleport their panel through one shared primitive (`primevue/portal`) whose default target is `document.body`. Inside a **web component** that escapes the shadow root, so the panel loses the module's shadow-scoped CSS (and the injected `primeVueCssUrl`) and renders unstyled next to `<body>`.
682
+
683
+ `PrimeVuePlugin` handles this for you: at `install()` it flips the shared Portal's `appendTo` default from `'body'` to `'self'`, so every overlay renders **inline, inside the shadow root**, by default — you do nothing. A component that passes its own `appendTo` (e.g. `<Dialog appendTo="body">`) still wins; the override only changes the default. This matters most for `Drawer`, which hard-wires its Portal with no `appendTo` and so is the one overlay that otherwise *always* escapes.
684
+
685
+ > PrimeVue 4 exposes no global overlay / `appendTo` config, and all overlays share the one Portal — so this single default-flip is the whole fix. No per-component `appendTo="self"` boilerplate and no per-app `patch-package` needed. (Requires `@wippy-fe/theme` with this behavior; see the package version.)
686
+
679
687
  ### Available PrimeVue component styles
680
688
 
681
689
  **Form**: autocomplete, cascadeselect, checkbox, colorpicker, datepicker, iconfield, iftalabel, inputgroup, inputnumber, inputotp, inputtext, floatlabel, knob, listbox, multiselect, password, radiobutton, rating, select, selectbutton, slider, textarea, togglebutton, toggleswitch, treeselect
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wippy-fe/theme",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "Theme variables, shared Tailwind config, and PrimeVue styling for Wippy web components.",
5
5
  "type": "module",
6
6
  "main": "theme-config.css",
@@ -1,8 +1,33 @@
1
1
  import type { App } from 'vue'
2
2
  import PrimeVue from 'primevue/config'
3
+ import Portal from 'primevue/portal'
4
+
5
+ /**
6
+ * Make PrimeVue overlays render inside the shadow root by default.
7
+ *
8
+ * Every PrimeVue overlay (Dialog, Drawer, Select, Popover, Menu, …) teleports
9
+ * through the ONE shared `primevue/portal`, whose `appendTo` default is `'body'`.
10
+ * Inside a web component that escapes the shadow root, so the module's
11
+ * shadow-scoped CSS no longer styles the overlay. Most components expose
12
+ * `appendTo` (an app can pass `'self'`), but `Drawer` hard-wires its Portal with
13
+ * no `appendTo`, so it ALWAYS escapes — and PrimeVue 4 has no global config for
14
+ * this. Flipping the shared Portal's default to `'self'` fixes every overlay at
15
+ * once; the components that pass their own `appendTo` are unaffected.
16
+ *
17
+ * Must run before the first overlay renders (install time is early enough — Vue
18
+ * normalizes a component's prop defaults lazily on first instantiation).
19
+ */
20
+ function keepOverlaysInShadowRoot(): void {
21
+ const appendTo = (Portal as any)?.props?.appendTo
22
+ if (appendTo && appendTo.default === 'body')
23
+ appendTo.default = 'self'
24
+ }
3
25
 
4
26
  export const PrimeVuePlugin = {
5
- install: (app: App) => app.use(PrimeVue, { theme: 'none' }),
27
+ install: (app: App) => {
28
+ keepOverlaysInShadowRoot()
29
+ app.use(PrimeVue, { theme: 'none' })
30
+ },
6
31
  }
7
32
 
8
33
  export default PrimeVuePlugin
package/tokens.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "generatedFrom": "theme-config.css",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "grammar": "every color family = --p-<fam> + --p-<fam>-{50..950} + --p-<fam>-{color,contrast-color,hover-color,active-color}; --p-surface-<shade>; text/content/highlight semantic aliases; --p-font-<role>-<prop>",
5
5
  "families": [
6
6
  "primary",