@robosophy/ui-vue 1.2.1 → 1.2.3

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/AGENTS.md CHANGED
@@ -17,20 +17,38 @@ Use `@robosophy/ui-vue` before creating project-local UI components from scratch
17
17
 
18
18
  ## CSS Imports
19
19
 
20
- PrimeVue apps:
20
+ PrimeVue apps: the consuming app owns the CSS layer order. Put this in an app stylesheet and import it before mounting the app:
21
+
22
+ ```css
23
+ /* src/layers.css */
24
+ @layer primevue, prime-base, prime-design;
25
+ @import "@robosophy/prime-theme/prime.css";
26
+ ```
27
+
28
+ Register the Robosophy preset and PrimeVue runtime layer in the consuming app:
21
29
 
22
30
  ```ts
23
31
  import PrimeVue from "primevue/config";
24
32
  import RobosophyPreset from "@robosophy/prime-theme";
25
- import "@robosophy/prime-theme/prime.css";
33
+ import "./layers.css";
26
34
 
27
35
  app.use(PrimeVue, {
28
36
  theme: {
29
37
  preset: RobosophyPreset,
38
+ options: {
39
+ cssLayer: {
40
+ name: "primevue",
41
+ order: "primevue, prime-base, prime-design",
42
+ },
43
+ },
30
44
  },
31
45
  });
32
46
  ```
33
47
 
48
+ La app define el orden: runtime de PrimeVue en `primevue`, tema base opcional en `prime-base`, overrides de Robosophy en `prime-design` y estilos propios sin layer para que puedan sobrescribirlos.
49
+
50
+ Si la app usa Tailwind CSS v4, incluye sus layers `theme`, `base`, `components` y `utilities` en el orden global. Coloca `primevue`/`prime-design` después de `base` y antes de `components`/`utilities`, y usa ese mismo orden en `theme.options.cssLayer.order`; consulta `README.md` para el ejemplo.
51
+
34
52
  Non-PrimeVue apps:
35
53
 
36
54
  ```ts
package/README.md CHANGED
@@ -26,21 +26,61 @@ npm install @robosophy/ui-vue @robosophy/tokens vue
26
26
 
27
27
  ## PrimeVue theme
28
28
 
29
- Si la app usa PrimeVue, registra el preset de Robosophy y carga sus tokens/overrides una vez:
29
+ Si la app usa PrimeVue sin Tailwind, registra el preset de Robosophy. La app consumidora define las layers y carga los overrides una vez. En el CSS de la app:
30
+
31
+ ```css
32
+ /* src/layers.css */
33
+ @layer primevue, prime-base, prime-design;
34
+ @import "@robosophy/prime-theme/prime.css";
35
+ ```
36
+
37
+ En el entrypoint de la app:
30
38
 
31
39
  ```ts
32
40
  import PrimeVue from "primevue/config";
33
41
  import RobosophyPreset from "@robosophy/prime-theme";
34
- import "@robosophy/prime-theme/prime.css";
42
+ import "./layers.css";
35
43
 
36
44
  app.use(PrimeVue, {
37
45
  theme: {
38
46
  preset: RobosophyPreset,
47
+ options: {
48
+ cssLayer: {
49
+ name: "primevue",
50
+ order: "primevue, prime-base, prime-design",
51
+ },
52
+ },
39
53
  },
40
54
  });
41
55
  ```
42
56
 
43
- `prime.css` ya importa `@robosophy/tokens/tokens.css`, asi que no dupliques ese import.
57
+ La app controla el orden: estilos runtime de PrimeVue en `primevue`, tema base opcional en `prime-base`, overrides de Robosophy en `prime-design` y estilos propios sin layer para que puedan sobrescribirlos. `prime.css` ya importa `@robosophy/tokens/tokens.css`, asi que no dupliques ese import.
58
+
59
+ ### PrimeVue con Tailwind CSS v4
60
+
61
+ Tailwind v4 añade las layers `theme`, `base`, `components` y `utilities`. Su reset en `base` puede prevalecer sobre los estilos de PrimeVue si esas layers quedan después de `prime-design`. Declara el orden completo antes de importar ambos CSS:
62
+
63
+ ```css
64
+ /* src/layers.css */
65
+ @layer theme, base, primevue, prime-base, prime-design, components, utilities;
66
+ @import "tailwindcss";
67
+ @import "@robosophy/prime-theme/prime.css";
68
+ ```
69
+
70
+ Configura el runtime de PrimeVue con el mismo orden:
71
+
72
+ ```ts
73
+ options: {
74
+ cssLayer: {
75
+ name: "primevue",
76
+ order: "theme, base, primevue, prime-base, prime-design, components, utilities",
77
+ },
78
+ },
79
+ ```
80
+
81
+ Así `primevue` y `prime-design` prevalecen sobre el reset de Tailwind, y las utilidades de Tailwind mantienen prioridad para ajustes locales. Si la app no usa Tailwind, conserva el orden corto `primevue, prime-base, prime-design` del ejemplo anterior.
82
+
83
+ El Storybook interno también usa Tailwind v4 y configura este orden extendido en `packages/ui-vue/.storybook/preview.ts`.
44
84
 
45
85
  Si la app no usa PrimeVue, importa tokens una vez:
46
86
 
@@ -131,12 +171,18 @@ import { createApp } from "vue";
131
171
  import PrimeVue from "primevue/config";
132
172
  import RobosophyPreset from "@robosophy/prime-theme";
133
173
  import RobosophyUiVue from "@robosophy/ui-vue";
134
- import "@robosophy/prime-theme/prime.css";
174
+ import "./layers.css"; // Declara el orden de layers e importa prime.css.
135
175
 
136
176
  createApp(App)
137
177
  .use(PrimeVue, {
138
178
  theme: {
139
179
  preset: RobosophyPreset,
180
+ options: {
181
+ cssLayer: {
182
+ name: "primevue",
183
+ order: "primevue, prime-base, prime-design", // Con Tailwind v4, usa el orden extendido de arriba.
184
+ },
185
+ },
140
186
  },
141
187
  })
142
188
  .use(RobosophyUiVue)
package/ai-context.md CHANGED
@@ -15,7 +15,7 @@ Use this package for shared Vue 3 UI components.
15
15
  - Use PrimeVue `Button` for actions in PrimeVue apps.
16
16
  - Use `RsAvatar` for user/account identity.
17
17
  - Use `RsCard` for content sections and state containers.
18
- - In PrimeVue apps, register `RobosophyPreset` from `@robosophy/prime-theme` in `app.use(PrimeVue, { theme: { preset: RobosophyPreset } })` and import `@robosophy/prime-theme/prime.css`; that CSS already includes tokens.
18
+ - In PrimeVue apps, the consuming app owns the layer order: declare `@layer primevue, prime-base, prime-design;` before importing `@robosophy/prime-theme/prime.css`, and enable `theme.options.cssLayer` with name `primevue` and the same order. `prime.css` includes tokens and places Robosophy overrides in `prime-design`; app styles without a layer can override them. With Tailwind CSS v4, include `theme, base, primevue, prime-base, prime-design, components, utilities` in both the global layer declaration and `cssLayer.order` so Tailwind's base reset does not override PrimeVue.
19
19
  - In non-PrimeVue apps, import `@robosophy/tokens/tokens.css`.
20
20
 
21
21
  ## Component Rules
@@ -25,7 +25,7 @@ Use this package for shared Vue 3 UI components.
25
25
  - Import component CSS from the component `index.ts`; do not add a global package stylesheet export.
26
26
  - Use `@robosophy/tokens` CSS variables for colors, typography, strokes, and component surfaces.
27
27
  - Use PrimeVue only when it provides real behavior for that component; actions should use PrimeVue `Button` in PrimeVue apps.
28
- - `RsSidebar` and `RsAccountSelector` use native PrimeVue controls for interactive UI; PrimeVue apps should register the Robosophy PrimeVue preset and load `@robosophy/prime-theme/prime.css` so Button/Menu states receive Robosophy styling.
28
+ - `RsSidebar` and `RsAccountSelector` use native PrimeVue controls for interactive UI; PrimeVue apps should register the Robosophy preset and configure the app-owned CSS layer order so Button/Menu states receive Robosophy styling.
29
29
  - `RsIcon` needs `robosophyMaterialSymbols()` from `@robosophy/ui-vue/vite` in consuming Vite apps so builds generate an SVG sprite with only the needed icons. The plugin auto-detects icon usage from source — no manual declaration needed for static patterns. Use `rsPrimeIcon()` for PrimeVue APIs that accept icon class strings. Add dynamic icons via `include`. For full control over icon props, use the `#icon` slot instead of `rsPrimeIcon()`.
30
30
  - **Icon detection rules:** the scanner detects 8 patterns. Read `icon-scanner.md` for the full reference. Key rules for agent work:
31
31
  - `<RsIcon name="..." />` — always detected (Pattern 1)
package/components.md CHANGED
@@ -26,21 +26,37 @@ import {
26
26
  } from "@robosophy/ui-vue";
27
27
  ```
28
28
 
29
- PrimeVue apps should register the Robosophy preset and import the theme CSS:
29
+ PrimeVue apps should register the Robosophy preset. The consuming app owns the layer order; define it in an app stylesheet before importing the Prime Theme CSS:
30
+
31
+ ```css
32
+ /* src/layers.css */
33
+ @layer primevue, prime-base, prime-design;
34
+ @import "@robosophy/prime-theme/prime.css";
35
+ ```
36
+
37
+ Then configure the PrimeVue runtime layer in the app:
30
38
 
31
39
  ```ts
32
40
  import PrimeVue from "primevue/config";
33
41
  import RobosophyPreset from "@robosophy/prime-theme";
34
- import "@robosophy/prime-theme/prime.css";
42
+ import "./layers.css";
35
43
 
36
44
  app.use(PrimeVue, {
37
45
  theme: {
38
46
  preset: RobosophyPreset,
47
+ options: {
48
+ cssLayer: {
49
+ name: "primevue",
50
+ order: "primevue, prime-base, prime-design",
51
+ },
52
+ },
39
53
  },
40
54
  });
41
55
  ```
42
56
 
43
- `RsSidebar` and `RsAccountSelector` render their interactive controls with PrimeVue components, so PrimeVue apps should use the setup above to apply PrimeVue defaults plus Robosophy Button/Menu styling.
57
+ The app order is PrimeVue runtime styles in `primevue`, optional base theme styles in `prime-base`, then Robosophy overrides in `prime-design`. App styles without a layer can override all of them. `RsSidebar` and `RsAccountSelector` render their interactive controls with PrimeVue components, so PrimeVue apps should use the setup above to apply PrimeVue defaults plus Robosophy Button/Menu styling.
58
+
59
+ If the app also uses Tailwind CSS v4, include its `theme`, `base`, `components`, and `utilities` layers in the global order. Put `primevue` and `prime-design` after Tailwind's `base` reset, and keep `components`/`utilities` after `prime-design`. Use the same full order in `theme.options.cssLayer.order`; see the Tailwind example in `README.md`.
44
60
 
45
61
  Apps without PrimeVue should import:
46
62
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robosophy/ui-vue",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://robosophy.gitlab.io/robosophy-basf/robosophy-library/",
@@ -48,24 +48,25 @@
48
48
  "test": "vitest run"
49
49
  },
50
50
  "peerDependencies": {
51
- "@robosophy/tokens": "^1.0.4",
51
+ "@robosophy/tokens": "^1.1.0",
52
52
  "primevue": ">=4",
53
53
  "vue": ">=3.4"
54
54
  },
55
55
  "devDependencies": {
56
- "@robosophy/prime-theme": "^1.0.3",
57
- "@robosophy/tokens": "^1.0.4",
56
+ "@robosophy/prime-theme": "^3.0.0",
57
+ "@robosophy/tokens": "^1.1.0",
58
58
  "@storybook/addon-docs": "^9.1.0",
59
59
  "@storybook/vue3-vite": "^9.1.0",
60
+ "@tailwindcss/vite": "^4.3.3",
60
61
  "@vitejs/plugin-vue": "^6.0.0",
61
62
  "@vue/test-utils": "^2.4.6",
62
63
  "happy-dom": "^20.0.0",
63
64
  "primevue": "^4.5.5",
65
+ "tailwindcss": "^4.3.3",
64
66
  "typescript": "^5.9.3",
65
67
  "vite": "^7.2.0",
66
68
  "vitest": "^4.0.0",
67
69
  "vue": "^3.5.0",
68
70
  "vue-tsc": "^3.1.0"
69
- },
70
- "dependencies": {}
71
+ }
71
72
  }