@robosophy/ui-vue 1.1.11 → 1.1.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/AGENTS.md CHANGED
@@ -1,40 +1,40 @@
1
- # Robosophy UI Vue Agent Notes
2
-
3
- Use `@robosophy/ui-vue` before creating project-local UI components from scratch.
4
-
5
- ## Consumer Rules
6
-
7
- - Import shared components from `@robosophy/ui-vue`.
8
- - Read `components.md` for available components, API shape, and composition examples.
9
- - Read `dist/index.d.ts` when exact prop, emit, or type names are needed.
10
- - Keep app-specific behavior in the consuming project: router pushes, stores, API calls, permissions, logout, redirects, and module switching.
11
- - Prefer props and event handlers over hardcoded actions inside components.
12
- - Use slots for project-specific content when the component exposes one.
13
- - Use PrimeVue `Button` for actions in PrimeVue apps.
14
- - Use `RsSidebar` for module navigation and `RsAccountSelector` for user/account switching.
15
- - Use `@robosophy/tokens` CSS variables (`--rs-*`) for new styles.
16
- - Do not duplicate `@robosophy/tokens/tokens.css` when the app already imports `@robosophy/prime-theme/prime.css`.
17
-
18
- ## CSS Imports
19
-
20
- PrimeVue apps:
21
-
22
- ```ts
23
- import PrimeVue from "primevue/config";
24
- import RobosophyPreset from "@robosophy/prime-theme";
25
- import "@robosophy/prime-theme/prime.css";
26
-
27
- app.use(PrimeVue, {
28
- theme: {
29
- preset: RobosophyPreset,
30
- },
31
- });
32
- ```
33
-
34
- Non-PrimeVue apps:
35
-
36
- ```ts
37
- import "@robosophy/tokens/tokens.css";
38
- ```
39
-
40
- Component styles are carried by the component entrypoints. This package does not expose a global `styles.css`.
1
+ # Robosophy UI Vue Agent Notes
2
+
3
+ Use `@robosophy/ui-vue` before creating project-local UI components from scratch.
4
+
5
+ ## Consumer Rules
6
+
7
+ - Import shared components from `@robosophy/ui-vue`.
8
+ - Read `components.md` for available components, API shape, and composition examples.
9
+ - Read `dist/index.d.ts` when exact prop, emit, or type names are needed.
10
+ - Keep app-specific behavior in the consuming project: router pushes, stores, API calls, permissions, logout, redirects, and module switching.
11
+ - Prefer props and event handlers over hardcoded actions inside components.
12
+ - Use slots for project-specific content when the component exposes one.
13
+ - Use PrimeVue `Button` for actions in PrimeVue apps.
14
+ - Use `RsSidebar` for module navigation and `RsAccountSelector` for user/account switching.
15
+ - Use `@robosophy/tokens` CSS variables (`--rs-*`) for new styles.
16
+ - Do not duplicate `@robosophy/tokens/tokens.css` when the app already imports `@robosophy/prime-theme/prime.css`.
17
+
18
+ ## CSS Imports
19
+
20
+ PrimeVue apps:
21
+
22
+ ```ts
23
+ import PrimeVue from "primevue/config";
24
+ import RobosophyPreset from "@robosophy/prime-theme";
25
+ import "@robosophy/prime-theme/prime.css";
26
+
27
+ app.use(PrimeVue, {
28
+ theme: {
29
+ preset: RobosophyPreset,
30
+ },
31
+ });
32
+ ```
33
+
34
+ Non-PrimeVue apps:
35
+
36
+ ```ts
37
+ import "@robosophy/tokens/tokens.css";
38
+ ```
39
+
40
+ Component styles are carried by the component entrypoints. This package does not expose a global `styles.css`.
package/README.md CHANGED
@@ -1,235 +1,235 @@
1
- # @robosophy/ui-vue
2
-
3
- Vue 3 component library for shared Robosophy UI.
4
-
5
- ## Documentation
6
-
7
- Interactive component documentation, examples, props, and usage notes are published with Storybook:
8
-
9
- https://robosophy.gitlab.io/robosophy-basf/robosophy-library/
10
-
11
- The npmjs page shows this README as the package overview. Use the Storybook docs for the full component library reference.
12
-
13
- ## Install
14
-
15
- Con PrimeVue:
16
-
17
- ```sh
18
- npm install @robosophy/ui-vue @robosophy/prime-theme vue primevue
19
- ```
20
-
21
- Sin PrimeVue:
22
-
23
- ```sh
24
- npm install @robosophy/ui-vue @robosophy/tokens vue
25
- ```
26
-
27
- ## PrimeVue theme
28
-
29
- Si la app usa PrimeVue, registra el preset de Robosophy y carga sus tokens/overrides una vez:
30
-
31
- ```ts
32
- import PrimeVue from "primevue/config";
33
- import RobosophyPreset from "@robosophy/prime-theme";
34
- import "@robosophy/prime-theme/prime.css";
35
-
36
- app.use(PrimeVue, {
37
- theme: {
38
- preset: RobosophyPreset,
39
- },
40
- });
41
- ```
42
-
43
- `prime.css` ya importa `@robosophy/tokens/tokens.css`, asi que no dupliques ese import.
44
-
45
- Si la app no usa PrimeVue, importa tokens una vez:
46
-
47
- ```ts
48
- import "@robosophy/tokens/tokens.css";
49
- ```
50
-
51
- Components carry their own local styles through their component entrypoint. This package does not expose a global `styles.css`.
52
-
53
- ## AI agent context
54
-
55
- For agents working inside a consuming project, read these package files first:
56
-
57
- - `node_modules/@robosophy/ui-vue/AGENTS.md`: short rules for prioritizing Robosophy components.
58
- - `node_modules/@robosophy/ui-vue/components.md`: component inventory, APIs, and examples.
59
- - `node_modules/@robosophy/ui-vue/dist/index.d.ts`: exact exported types and component contracts.
60
-
61
- Use `@robosophy/ui-vue` components before creating local equivalents. Keep router, stores, fetches, permissions, and logout in the consuming app.
62
-
63
- ## Usage
64
-
65
- ```vue
66
- <script setup lang="ts">
67
- import { RsAccountSelector, RsCard, RsIcon, RsSidebar, rsPrimeIcon } from "@robosophy/ui-vue";
68
-
69
- const user = {
70
- email: "usuario@robosophy.com",
71
- initials: "UR",
72
- name: "Usuario Robosophy",
73
- };
74
-
75
- const accounts = [
76
- { id: "1000", label: "Cuenta Activa SA", initials: "CA", active: true },
77
- { id: "2000", label: "Cuenta Inactiva SRL", initials: "CI" },
78
- ];
79
-
80
- const actions = [
81
- { id: "profile", label: "Ver mi perfil", icon: "manage_accounts" },
82
- ];
83
-
84
- const footerActions = [
85
- { id: "logout", label: "Cerrar sesion", icon: "logout", variant: "danger" },
86
- ];
87
-
88
- const sidebarItems = [
89
- { id: "dashboard", label: "Dashboard", icon: "dashboard", active: true },
90
- { id: "settings", label: "Configuracion", icon: "settings" },
91
- ];
92
-
93
- const sidebarModules = [
94
- { text: "Mi Alta", link: "/alta" },
95
- { text: "Mi Cuenta y Orden", link: "/cyo", active: true },
96
- { text: "Mi Cuenta Corriente", link: "/cc" },
97
- ];
98
- </script>
99
-
100
- <template>
101
- <RsSidebar
102
- :items="sidebarItems"
103
- :modules="sidebarModules"
104
- :navigate-on-module-select="false"
105
- @item-click="navigateToSection"
106
- @module-select="trackModuleSelection"
107
- />
108
-
109
- <RsAccountSelector
110
- :user="user"
111
- :accounts="accounts"
112
- :actions="actions"
113
- :footer-actions="footerActions"
114
- @select-account="switchAccount"
115
- @action="handleAction"
116
- @footer-action="handleFooterAction"
117
- />
118
-
119
- <RsCard title="Reusable card" subtitle="Shared layout">
120
- Content from the consuming project.
121
- </RsCard>
122
-
123
- <RsIcon name="home" />
124
- </template>
125
- ```
126
-
127
- Optional plugin registration:
128
-
129
- ```ts
130
- import { createApp } from "vue";
131
- import PrimeVue from "primevue/config";
132
- import RobosophyPreset from "@robosophy/prime-theme";
133
- import RobosophyUiVue from "@robosophy/ui-vue";
134
- import "@robosophy/prime-theme/prime.css";
135
-
136
- createApp(App)
137
- .use(PrimeVue, {
138
- theme: {
139
- preset: RobosophyPreset,
140
- },
141
- })
142
- .use(RobosophyUiVue)
143
- .mount("#app");
144
- ```
145
-
146
- ## Material Symbols
147
-
148
- `RsIcon` renderiza iconos SVG inline. Combinalo con el plugin de Vite que descarga solo los SVGs
149
- necesarios desde el repositorio oficial de Google y genera un sprite inyectado en el HTML:
150
-
151
- ```ts
152
- // vite.config.ts
153
- import { defineConfig } from "vite";
154
- import vue from "@vitejs/plugin-vue";
155
- import { robosophyMaterialSymbols } from "@robosophy/ui-vue/vite";
156
-
157
- export default defineConfig({
158
- plugins: [
159
- vue(),
160
- robosophyMaterialSymbols(),
161
- ],
162
- });
163
- ```
164
-
165
- El plugin escanea automaticamente usos de `<RsIcon name="..." />`, `rsPrimeIcon("...")` y
166
- objetos con `icon: "..."` en el codigo fuente. No hace falta declarar iconos a mano.
167
- En build descarga los SVGs del CDN de GitHub, los cachea localmente y genera un sprite SVG
168
- inline. No se cargan fuentes tipograficas.
169
-
170
- El sprite incluye variantes para fill (outlined/filled) y grade (-25, 0, 200).
171
-
172
- ### Iconos dinamicos (opcional)
173
-
174
- Si un icono se calcula en runtime (API, permisos, configuracion remota, etc.), declaralo
175
- en `include` para que el scanner lo incluya:
176
-
177
- ```ts
178
- robosophyMaterialSymbols({
179
- include: [
180
- "home",
181
- { family: "rounded", name: "settings" },
182
- ],
183
- });
184
- ```
185
-
186
- ### PrimeVue
187
-
188
- Para APIs de PrimeVue que reciben `icon` como string, usa el helper:
189
-
190
- ```vue
191
- <Button label="Inicio" :icon="rsPrimeIcon('home')" />
192
- <Button label="Configurar" :icon="rsPrimeIcon('settings', { family: 'rounded' })" />
193
- ```
194
-
195
- Para control total sobre props (fill, grade, etc.), usa el slot `#icon`:
196
-
197
- ```vue
198
- <Button label="Favorito">
199
- <template #icon>
200
- <RsIcon name="favorite" fill color="danger" />
201
- </template>
202
- </Button>
203
- ```
204
-
205
- ## Component Structure
206
-
207
- Every public component must be self-contained:
208
-
209
- ```txt
210
- src/components/RsCard/
211
- RsCard.vue
212
- RsCard.css
213
- RsCard.types.ts
214
- RsCard.test.ts
215
- RsCard.stories.ts
216
- index.ts
217
- ```
218
-
219
- Rules:
220
-
221
- - use `@robosophy/tokens` variables for visual decisions;
222
- - keep styles local to the component folder;
223
- - add tests and Storybook stories with every exported component;
224
- - use props for stable API and slots for flexible project content;
225
- - use PrimeVue only when it provides behavior that belongs inside the component.
226
- - use PrimeVue `Button` for actions in PrimeVue apps.
227
- - use `RsSidebar` for reusable module navigation instead of project-local navbars.
228
-
229
- ## Scripts
230
-
231
- ```sh
232
- npm run build -w @robosophy/ui-vue
233
- npm run test -w @robosophy/ui-vue
234
- npm run build:storybook -w @robosophy/ui-vue
235
- ```
1
+ # @robosophy/ui-vue
2
+
3
+ Vue 3 component library for shared Robosophy UI.
4
+
5
+ ## Documentation
6
+
7
+ Interactive component documentation, examples, props, and usage notes are published with Storybook:
8
+
9
+ https://robosophy.gitlab.io/robosophy-basf/robosophy-library/
10
+
11
+ The npmjs page shows this README as the package overview. Use the Storybook docs for the full component library reference.
12
+
13
+ ## Install
14
+
15
+ Con PrimeVue:
16
+
17
+ ```sh
18
+ npm install @robosophy/ui-vue @robosophy/prime-theme vue primevue
19
+ ```
20
+
21
+ Sin PrimeVue:
22
+
23
+ ```sh
24
+ npm install @robosophy/ui-vue @robosophy/tokens vue
25
+ ```
26
+
27
+ ## PrimeVue theme
28
+
29
+ Si la app usa PrimeVue, registra el preset de Robosophy y carga sus tokens/overrides una vez:
30
+
31
+ ```ts
32
+ import PrimeVue from "primevue/config";
33
+ import RobosophyPreset from "@robosophy/prime-theme";
34
+ import "@robosophy/prime-theme/prime.css";
35
+
36
+ app.use(PrimeVue, {
37
+ theme: {
38
+ preset: RobosophyPreset,
39
+ },
40
+ });
41
+ ```
42
+
43
+ `prime.css` ya importa `@robosophy/tokens/tokens.css`, asi que no dupliques ese import.
44
+
45
+ Si la app no usa PrimeVue, importa tokens una vez:
46
+
47
+ ```ts
48
+ import "@robosophy/tokens/tokens.css";
49
+ ```
50
+
51
+ Components carry their own local styles through their component entrypoint. This package does not expose a global `styles.css`.
52
+
53
+ ## AI agent context
54
+
55
+ For agents working inside a consuming project, read these package files first:
56
+
57
+ - `node_modules/@robosophy/ui-vue/AGENTS.md`: short rules for prioritizing Robosophy components.
58
+ - `node_modules/@robosophy/ui-vue/components.md`: component inventory, APIs, and examples.
59
+ - `node_modules/@robosophy/ui-vue/dist/index.d.ts`: exact exported types and component contracts.
60
+
61
+ Use `@robosophy/ui-vue` components before creating local equivalents. Keep router, stores, fetches, permissions, and logout in the consuming app.
62
+
63
+ ## Usage
64
+
65
+ ```vue
66
+ <script setup lang="ts">
67
+ import { RsAccountSelector, RsCard, RsIcon, RsSidebar, rsPrimeIcon } from "@robosophy/ui-vue";
68
+
69
+ const user = {
70
+ email: "usuario@robosophy.com",
71
+ initials: "UR",
72
+ name: "Usuario Robosophy",
73
+ };
74
+
75
+ const accounts = [
76
+ { id: "1000", label: "Cuenta Activa SA", initials: "CA", active: true },
77
+ { id: "2000", label: "Cuenta Inactiva SRL", initials: "CI" },
78
+ ];
79
+
80
+ const actions = [
81
+ { id: "profile", label: "Ver mi perfil", icon: "manage_accounts" },
82
+ ];
83
+
84
+ const footerActions = [
85
+ { id: "logout", label: "Cerrar sesion", icon: "logout", variant: "danger" },
86
+ ];
87
+
88
+ const sidebarItems = [
89
+ { id: "dashboard", label: "Dashboard", icon: "dashboard", active: true },
90
+ { id: "settings", label: "Configuracion", icon: "settings" },
91
+ ];
92
+
93
+ const sidebarModules = [
94
+ { text: "Mi Alta", link: "/alta" },
95
+ { text: "Mi Cuenta y Orden", link: "/cyo", active: true },
96
+ { text: "Mi Cuenta Corriente", link: "/cc" },
97
+ ];
98
+ </script>
99
+
100
+ <template>
101
+ <RsSidebar
102
+ :items="sidebarItems"
103
+ :modules="sidebarModules"
104
+ :navigate-on-module-select="false"
105
+ @item-click="navigateToSection"
106
+ @module-select="trackModuleSelection"
107
+ />
108
+
109
+ <RsAccountSelector
110
+ :user="user"
111
+ :accounts="accounts"
112
+ :actions="actions"
113
+ :footer-actions="footerActions"
114
+ @select-account="switchAccount"
115
+ @action="handleAction"
116
+ @footer-action="handleFooterAction"
117
+ />
118
+
119
+ <RsCard title="Reusable card" subtitle="Shared layout">
120
+ Content from the consuming project.
121
+ </RsCard>
122
+
123
+ <RsIcon name="home" />
124
+ </template>
125
+ ```
126
+
127
+ Optional plugin registration:
128
+
129
+ ```ts
130
+ import { createApp } from "vue";
131
+ import PrimeVue from "primevue/config";
132
+ import RobosophyPreset from "@robosophy/prime-theme";
133
+ import RobosophyUiVue from "@robosophy/ui-vue";
134
+ import "@robosophy/prime-theme/prime.css";
135
+
136
+ createApp(App)
137
+ .use(PrimeVue, {
138
+ theme: {
139
+ preset: RobosophyPreset,
140
+ },
141
+ })
142
+ .use(RobosophyUiVue)
143
+ .mount("#app");
144
+ ```
145
+
146
+ ## Material Symbols
147
+
148
+ `RsIcon` renderiza iconos SVG inline. Combinalo con el plugin de Vite que descarga solo los SVGs
149
+ necesarios desde el repositorio oficial de Google y genera un sprite inyectado en el HTML:
150
+
151
+ ```ts
152
+ // vite.config.ts
153
+ import { defineConfig } from "vite";
154
+ import vue from "@vitejs/plugin-vue";
155
+ import { robosophyMaterialSymbols } from "@robosophy/ui-vue/vite";
156
+
157
+ export default defineConfig({
158
+ plugins: [
159
+ vue(),
160
+ robosophyMaterialSymbols(),
161
+ ],
162
+ });
163
+ ```
164
+
165
+ El plugin escanea automaticamente usos de `<RsIcon name="..." />`, `rsPrimeIcon("...")` y
166
+ objetos con `icon: "..."` en el codigo fuente. No hace falta declarar iconos a mano.
167
+ En build descarga los SVGs del CDN de GitHub, los cachea localmente y genera un sprite SVG
168
+ inline. No se cargan fuentes tipograficas.
169
+
170
+ El sprite incluye variantes para fill (outlined/filled) y grade (-25, 0, 200).
171
+
172
+ ### Iconos dinamicos (opcional)
173
+
174
+ Si un icono se calcula en runtime (API, permisos, configuracion remota, etc.), declaralo
175
+ en `include` para que el scanner lo incluya:
176
+
177
+ ```ts
178
+ robosophyMaterialSymbols({
179
+ include: [
180
+ "home",
181
+ { family: "rounded", name: "settings" },
182
+ ],
183
+ });
184
+ ```
185
+
186
+ ### PrimeVue
187
+
188
+ Para APIs de PrimeVue que reciben `icon` como string, usa el helper:
189
+
190
+ ```vue
191
+ <Button label="Inicio" :icon="rsPrimeIcon('home')" />
192
+ <Button label="Configurar" :icon="rsPrimeIcon('settings', { family: 'rounded' })" />
193
+ ```
194
+
195
+ Para control total sobre props (fill, grade, etc.), usa el slot `#icon`:
196
+
197
+ ```vue
198
+ <Button label="Favorito">
199
+ <template #icon>
200
+ <RsIcon name="favorite" fill color="danger" />
201
+ </template>
202
+ </Button>
203
+ ```
204
+
205
+ ## Component Structure
206
+
207
+ Every public component must be self-contained:
208
+
209
+ ```txt
210
+ src/components/RsCard/
211
+ RsCard.vue
212
+ RsCard.css
213
+ RsCard.types.ts
214
+ RsCard.test.ts
215
+ RsCard.stories.ts
216
+ index.ts
217
+ ```
218
+
219
+ Rules:
220
+
221
+ - use `@robosophy/tokens` variables for visual decisions;
222
+ - keep styles local to the component folder;
223
+ - add tests and Storybook stories with every exported component;
224
+ - use props for stable API and slots for flexible project content;
225
+ - use PrimeVue only when it provides behavior that belongs inside the component.
226
+ - use PrimeVue `Button` for actions in PrimeVue apps.
227
+ - use `RsSidebar` for reusable module navigation instead of project-local navbars.
228
+
229
+ ## Scripts
230
+
231
+ ```sh
232
+ npm run build -w @robosophy/ui-vue
233
+ npm run test -w @robosophy/ui-vue
234
+ npm run build:storybook -w @robosophy/ui-vue
235
+ ```
package/ai-context.md CHANGED
@@ -1,53 +1,53 @@
1
- # @robosophy/ui-vue AI Context
2
-
3
- Use this package for shared Vue 3 UI components.
4
-
5
- ## For Consuming Projects
6
-
7
- - Prefer existing `@robosophy/ui-vue` components before creating local UI components.
8
- - Read `AGENTS.md` for short agent rules.
9
- - Read `components.md` for component inventory, APIs, and examples.
10
- - Read `dist/index.d.ts` for exact exported types.
11
- - Keep app-specific behavior in the consuming project: router, stores, fetches, permissions, and logout.
12
- - Use `RsSidebar` for module navigation.
13
- - Use `RsAccountSelector` for user/account selection.
14
- - Use `RsIcon` for Material Symbols icons.
15
- - Use PrimeVue `Button` for actions in PrimeVue apps.
16
- - Use `RsAvatar` for user/account identity.
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.
19
- - In non-PrimeVue apps, import `@robosophy/tokens/tokens.css`.
20
-
21
- ## Component Rules
22
-
23
- - Every exported component lives in `src/components/<ComponentName>/`.
24
- - Every component folder must include the Vue component, local CSS, public types, tests, Storybook stories, and an `index.ts`.
25
- - Import component CSS from the component `index.ts`; do not add a global package stylesheet export.
26
- - Use `@robosophy/tokens` CSS variables for colors, typography, strokes, and component surfaces.
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.
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
- - **Icon detection rules:** the scanner detects 5 patterns. Read `icon-scanner.md` for the full reference. Key rules for agent work:
31
- - `<RsIcon name="..." />` — always detected (Pattern 1)
32
- - `rsPrimeIcon("...")` — detected (Pattern 2)
33
- - `{ icon: "..." }` in objects — detected with weight/family extraction (Pattern 3)
34
- - `// @robosophy-icon: name` magic comments — detected (Pattern 4, use for props/variables)
35
- - Arrays like `const iconNames = ["home", ...]` — detected if variable name contains "icon" (Pattern 5)
36
- - `<RsIcon :name="variable" />` — NOT detected; add magic comment or `include`
37
- - `<RsIcon :name="item.icon" />` — NOT detected from template, but the `icon: "..."` in the data source IS detected by Pattern 3
38
- - Use `RsSidebar` for reusable module navigation. `item-click` stays in the consuming app; the optional `modules` dropdown can redirect with the provided `link` when `navigateOnModuleSelect` is `true`.
39
- - Keep props focused on stable component API. Use slots for flexible content.
40
- - Export every public component and public type from `src/index.ts`.
41
-
42
- ## Required Files
43
-
44
- - `<ComponentName>.vue`
45
- - `<ComponentName>.css`
46
- - `<ComponentName>.types.ts`
47
- - `<ComponentName>.test.ts`
48
- - `<ComponentName>.stories.ts`
49
- - `index.ts`
50
-
51
- ## Validation
52
-
53
- Run the package build, component tests, and Storybook build before publishing component changes.
1
+ # @robosophy/ui-vue AI Context
2
+
3
+ Use this package for shared Vue 3 UI components.
4
+
5
+ ## For Consuming Projects
6
+
7
+ - Prefer existing `@robosophy/ui-vue` components before creating local UI components.
8
+ - Read `AGENTS.md` for short agent rules.
9
+ - Read `components.md` for component inventory, APIs, and examples.
10
+ - Read `dist/index.d.ts` for exact exported types.
11
+ - Keep app-specific behavior in the consuming project: router, stores, fetches, permissions, and logout.
12
+ - Use `RsSidebar` for module navigation.
13
+ - Use `RsAccountSelector` for user/account selection.
14
+ - Use `RsIcon` for Material Symbols icons.
15
+ - Use PrimeVue `Button` for actions in PrimeVue apps.
16
+ - Use `RsAvatar` for user/account identity.
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.
19
+ - In non-PrimeVue apps, import `@robosophy/tokens/tokens.css`.
20
+
21
+ ## Component Rules
22
+
23
+ - Every exported component lives in `src/components/<ComponentName>/`.
24
+ - Every component folder must include the Vue component, local CSS, public types, tests, Storybook stories, and an `index.ts`.
25
+ - Import component CSS from the component `index.ts`; do not add a global package stylesheet export.
26
+ - Use `@robosophy/tokens` CSS variables for colors, typography, strokes, and component surfaces.
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.
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
+ - **Icon detection rules:** the scanner detects 5 patterns. Read `icon-scanner.md` for the full reference. Key rules for agent work:
31
+ - `<RsIcon name="..." />` — always detected (Pattern 1)
32
+ - `rsPrimeIcon("...")` — detected (Pattern 2)
33
+ - `{ icon: "..." }` in objects — detected with weight/family extraction (Pattern 3)
34
+ - `// @robosophy-icon: name` magic comments — detected (Pattern 4, use for props/variables)
35
+ - Arrays like `const iconNames = ["home", ...]` — detected if variable name contains "icon" (Pattern 5)
36
+ - `<RsIcon :name="variable" />` — NOT detected; add magic comment or `include`
37
+ - `<RsIcon :name="item.icon" />` — NOT detected from template, but the `icon: "..."` in the data source IS detected by Pattern 3
38
+ - Use `RsSidebar` for reusable module navigation. `item-click` stays in the consuming app; the optional `modules` dropdown can redirect with the provided `link` when `navigateOnModuleSelect` is `true`.
39
+ - Keep props focused on stable component API. Use slots for flexible content.
40
+ - Export every public component and public type from `src/index.ts`.
41
+
42
+ ## Required Files
43
+
44
+ - `<ComponentName>.vue`
45
+ - `<ComponentName>.css`
46
+ - `<ComponentName>.types.ts`
47
+ - `<ComponentName>.test.ts`
48
+ - `<ComponentName>.stories.ts`
49
+ - `index.ts`
50
+
51
+ ## Validation
52
+
53
+ Run the package build, component tests, and Storybook build before publishing component changes.