@cocoar/vue-ui 3.1.0 → 3.2.0-beta.6

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.
Files changed (179) hide show
  1. package/dist/components/checkbox/CoarCheckbox.vue.d.ts +1 -1
  2. package/dist/components/checkbox/CoarCheckbox.vue.d.ts.map +1 -1
  3. package/dist/components/code-block/CoarCodeBlock.vue.d.ts +1 -1
  4. package/dist/components/code-block/CoarCodeBlock.vue.d.ts.map +1 -1
  5. package/dist/components/data-list/CoarDataList.vue.d.ts +158 -0
  6. package/dist/components/data-list/CoarDataList.vue.d.ts.map +1 -0
  7. package/dist/components/data-list/CoarDataListToolbar.vue.d.ts +30 -0
  8. package/dist/components/data-list/CoarDataListToolbar.vue.d.ts.map +1 -0
  9. package/dist/components/data-list/data-list-builder.d.ts +288 -0
  10. package/dist/components/data-list/data-list-builder.d.ts.map +1 -0
  11. package/dist/components/data-list/index.d.ts +12 -0
  12. package/dist/components/data-list/index.d.ts.map +1 -0
  13. package/dist/components/data-list/internal/compare.d.ts +14 -0
  14. package/dist/components/data-list/internal/compare.d.ts.map +1 -0
  15. package/dist/components/data-list/internal/reorder-core.d.ts +46 -0
  16. package/dist/components/data-list/internal/reorder-core.d.ts.map +1 -0
  17. package/dist/components/data-list/internal/search.d.ts +16 -0
  18. package/dist/components/data-list/internal/search.d.ts.map +1 -0
  19. package/dist/components/data-list/internal/useDataListLines.d.ts +92 -0
  20. package/dist/components/data-list/internal/useDataListLines.d.ts.map +1 -0
  21. package/dist/components/data-list/internal/useDataListReorder.d.ts +68 -0
  22. package/dist/components/data-list/internal/useDataListReorder.d.ts.map +1 -0
  23. package/dist/components/data-list/internal/useSearchHighlight.d.ts +19 -0
  24. package/dist/components/data-list/internal/useSearchHighlight.d.ts.map +1 -0
  25. package/dist/components/data-list/types.d.ts +185 -0
  26. package/dist/components/data-list/types.d.ts.map +1 -0
  27. package/dist/components/data-list/useDataListModel.d.ts +79 -0
  28. package/dist/components/data-list/useDataListModel.d.ts.map +1 -0
  29. package/dist/components/date-time/_shared/maskito-config.d.ts +7 -2
  30. package/dist/components/date-time/_shared/maskito-config.d.ts.map +1 -1
  31. package/dist/components/date-time/_shared/time-helpers.d.ts +11 -4
  32. package/dist/components/date-time/_shared/time-helpers.d.ts.map +1 -1
  33. package/dist/components/date-time/_shared/use-date-picker-base.d.ts +1 -1
  34. package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts +1 -1
  35. package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts.map +1 -1
  36. package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts +1 -1
  37. package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts.map +1 -1
  38. package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts +1 -1
  39. package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts.map +1 -1
  40. package/dist/components/dual-listbox/CoarDualListbox.vue.d.ts +3 -0
  41. package/dist/components/dual-listbox/CoarDualListbox.vue.d.ts.map +1 -1
  42. package/dist/components/form-field/CoarFormField.vue.d.ts +1 -1
  43. package/dist/components/form-field/CoarFormField.vue.d.ts.map +1 -1
  44. package/dist/components/icon/CoarIcon.vue.d.ts +2 -2
  45. package/dist/components/icon/CoarIcon.vue.d.ts.map +1 -1
  46. package/dist/components/listbox/CoarListbox.vue.d.ts +7 -0
  47. package/dist/components/listbox/CoarListbox.vue.d.ts.map +1 -1
  48. package/dist/components/number-input/CoarNumberInput.vue.d.ts +1 -1
  49. package/dist/components/number-input/CoarNumberInput.vue.d.ts.map +1 -1
  50. package/dist/components/otp-input/CoarOtpInput.vue.d.ts +1 -1
  51. package/dist/components/otp-input/CoarOtpInput.vue.d.ts.map +1 -1
  52. package/dist/components/password-input/CoarPasswordInput.vue.d.ts +1 -1
  53. package/dist/components/password-input/CoarPasswordInput.vue.d.ts.map +1 -1
  54. package/dist/components/switch/CoarSwitch.vue.d.ts +1 -1
  55. package/dist/components/switch/CoarSwitch.vue.d.ts.map +1 -1
  56. package/dist/components/text-input/CoarTextInput.vue.d.ts +1 -1
  57. package/dist/components/text-input/CoarTextInput.vue.d.ts.map +1 -1
  58. package/dist/composables/dragRegistry.d.ts +12 -0
  59. package/dist/composables/dragRegistry.d.ts.map +1 -1
  60. package/dist/composables/index.d.ts +2 -2
  61. package/dist/composables/index.d.ts.map +1 -1
  62. package/dist/composables/useDragDrop.d.ts +62 -6
  63. package/dist/composables/useDragDrop.d.ts.map +1 -1
  64. package/dist/composables/useVirtualList.d.ts +21 -1
  65. package/dist/composables/useVirtualList.d.ts.map +1 -1
  66. package/dist/index.css +1 -1
  67. package/dist/index.d.ts +4 -2
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +4508 -2039
  70. package/package.json +5 -3
  71. package/skills/cocoar-vue-ui/SKILL.md +244 -0
  72. package/skills/cocoar-vue-ui/references/components/avatar.md +178 -0
  73. package/skills/cocoar-vue-ui/references/components/badge.md +290 -0
  74. package/skills/cocoar-vue-ui/references/components/breadcrumb.md +238 -0
  75. package/skills/cocoar-vue-ui/references/components/button.md +252 -0
  76. package/skills/cocoar-vue-ui/references/components/calendar/agenda-view.md +353 -0
  77. package/skills/cocoar-vue-ui/references/components/calendar/coar-calendar.md +1645 -0
  78. package/skills/cocoar-vue-ui/references/components/calendar/day-view.md +361 -0
  79. package/skills/cocoar-vue-ui/references/components/calendar/index.md +312 -0
  80. package/skills/cocoar-vue-ui/references/components/calendar/month-view.md +475 -0
  81. package/skills/cocoar-vue-ui/references/components/calendar/performance.md +186 -0
  82. package/skills/cocoar-vue-ui/references/components/calendar/timeline-view.md +301 -0
  83. package/skills/cocoar-vue-ui/references/components/calendar/week-view.md +382 -0
  84. package/skills/cocoar-vue-ui/references/components/calendar/work-week-view.md +145 -0
  85. package/skills/cocoar-vue-ui/references/components/calendar/year-view.md +63 -0
  86. package/skills/cocoar-vue-ui/references/components/card.md +151 -0
  87. package/skills/cocoar-vue-ui/references/components/checkbox-group.md +103 -0
  88. package/skills/cocoar-vue-ui/references/components/checkbox.md +279 -0
  89. package/skills/cocoar-vue-ui/references/components/code-block.md +241 -0
  90. package/skills/cocoar-vue-ui/references/components/context-menu.md +355 -0
  91. package/skills/cocoar-vue-ui/references/components/data-grid/checkbox.md +213 -0
  92. package/skills/cocoar-vue-ui/references/components/data-grid/date-columns.md +272 -0
  93. package/skills/cocoar-vue-ui/references/components/data-grid/editing.md +236 -0
  94. package/skills/cocoar-vue-ui/references/components/data-grid/multi-select.md +193 -0
  95. package/skills/cocoar-vue-ui/references/components/data-grid/number.md +147 -0
  96. package/skills/cocoar-vue-ui/references/components/data-grid/select.md +202 -0
  97. package/skills/cocoar-vue-ui/references/components/data-grid/text.md +127 -0
  98. package/skills/cocoar-vue-ui/references/components/data-grid.md +1225 -0
  99. package/skills/cocoar-vue-ui/references/components/data-list.md +2121 -0
  100. package/skills/cocoar-vue-ui/references/components/date-or-time-picker.md +200 -0
  101. package/skills/cocoar-vue-ui/references/components/date-picker.md +203 -0
  102. package/skills/cocoar-vue-ui/references/components/date-time-picker.md +154 -0
  103. package/skills/cocoar-vue-ui/references/components/date-views.md +212 -0
  104. package/skills/cocoar-vue-ui/references/components/dialog.md +148 -0
  105. package/skills/cocoar-vue-ui/references/components/divider.md +157 -0
  106. package/skills/cocoar-vue-ui/references/components/document-viewer/annotations.md +400 -0
  107. package/skills/cocoar-vue-ui/references/components/document-viewer/coar-document-viewer.md +327 -0
  108. package/skills/cocoar-vue-ui/references/components/document-viewer/index.md +234 -0
  109. package/skills/cocoar-vue-ui/references/components/document-viewer/toolbar.md +221 -0
  110. package/skills/cocoar-vue-ui/references/components/drag-drop.md +267 -0
  111. package/skills/cocoar-vue-ui/references/components/dual-listbox.md +449 -0
  112. package/skills/cocoar-vue-ui/references/components/file-explorer/asset-store.md +327 -0
  113. package/skills/cocoar-vue-ui/references/components/file-explorer/in-memory-store.md +176 -0
  114. package/skills/cocoar-vue-ui/references/components/file-explorer/index.md +311 -0
  115. package/skills/cocoar-vue-ui/references/components/file-explorer/use-file-explorer.md +300 -0
  116. package/skills/cocoar-vue-ui/references/components/form-field.md +1025 -0
  117. package/skills/cocoar-vue-ui/references/components/fragment-parser.md +298 -0
  118. package/skills/cocoar-vue-ui/references/components/link.md +235 -0
  119. package/skills/cocoar-vue-ui/references/components/listbox.md +575 -0
  120. package/skills/cocoar-vue-ui/references/components/map/editor.md +448 -0
  121. package/skills/cocoar-vue-ui/references/components/map/index.md +351 -0
  122. package/skills/cocoar-vue-ui/references/components/markdown-diagrams.md +210 -0
  123. package/skills/cocoar-vue-ui/references/components/markdown-editor.md +1478 -0
  124. package/skills/cocoar-vue-ui/references/components/markdown-embeds.md +387 -0
  125. package/skills/cocoar-vue-ui/references/components/markdown-form.md +447 -0
  126. package/skills/cocoar-vue-ui/references/components/markdown.md +276 -0
  127. package/skills/cocoar-vue-ui/references/components/menu.md +380 -0
  128. package/skills/cocoar-vue-ui/references/components/mermaid.md +172 -0
  129. package/skills/cocoar-vue-ui/references/components/navbar.md +147 -0
  130. package/skills/cocoar-vue-ui/references/components/note.md +96 -0
  131. package/skills/cocoar-vue-ui/references/components/notice.md +131 -0
  132. package/skills/cocoar-vue-ui/references/components/number-input.md +215 -0
  133. package/skills/cocoar-vue-ui/references/components/otp-input.md +324 -0
  134. package/skills/cocoar-vue-ui/references/components/page-builder/authoring-contract.md +271 -0
  135. package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-builder.md +476 -0
  136. package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-renderer.md +677 -0
  137. package/skills/cocoar-vue-ui/references/components/page-builder/custom-elements.md +441 -0
  138. package/skills/cocoar-vue-ui/references/components/page-builder/idp-integration.md +122 -0
  139. package/skills/cocoar-vue-ui/references/components/page-builder/index.md +573 -0
  140. package/skills/cocoar-vue-ui/references/components/pagination.md +150 -0
  141. package/skills/cocoar-vue-ui/references/components/panel-layout.md +372 -0
  142. package/skills/cocoar-vue-ui/references/components/password-input.md +175 -0
  143. package/skills/cocoar-vue-ui/references/components/popconfirm.md +186 -0
  144. package/skills/cocoar-vue-ui/references/components/popover.md +173 -0
  145. package/skills/cocoar-vue-ui/references/components/progress-bar.md +178 -0
  146. package/skills/cocoar-vue-ui/references/components/radio-group.md +225 -0
  147. package/skills/cocoar-vue-ui/references/components/script-editor.md +1271 -0
  148. package/skills/cocoar-vue-ui/references/components/segmented-control.md +238 -0
  149. package/skills/cocoar-vue-ui/references/components/select.md +463 -0
  150. package/skills/cocoar-vue-ui/references/components/sidebar.md +421 -0
  151. package/skills/cocoar-vue-ui/references/components/spinner.md +132 -0
  152. package/skills/cocoar-vue-ui/references/components/switch.md +195 -0
  153. package/skills/cocoar-vue-ui/references/components/table.md +170 -0
  154. package/skills/cocoar-vue-ui/references/components/tabs.md +382 -0
  155. package/skills/cocoar-vue-ui/references/components/tag.md +178 -0
  156. package/skills/cocoar-vue-ui/references/components/text-input.md +256 -0
  157. package/skills/cocoar-vue-ui/references/components/toast.md +160 -0
  158. package/skills/cocoar-vue-ui/references/components/tooltip.md +121 -0
  159. package/skills/cocoar-vue-ui/references/components/transitions.md +193 -0
  160. package/skills/cocoar-vue-ui/references/components/tree.md +2388 -0
  161. package/skills/cocoar-vue-ui/references/components/virtual-list.md +212 -0
  162. package/skills/cocoar-vue-ui/references/components/wizard.md +251 -0
  163. package/skills/cocoar-vue-ui/references/components/zoned-date-time-picker.md +177 -0
  164. package/skills/cocoar-vue-ui/references/foundations/colors.md +708 -0
  165. package/skills/cocoar-vue-ui/references/foundations/design-principles.md +115 -0
  166. package/skills/cocoar-vue-ui/references/foundations/icons.md +381 -0
  167. package/skills/cocoar-vue-ui/references/foundations/localization/formatting.md +530 -0
  168. package/skills/cocoar-vue-ui/references/foundations/localization/setup.md +86 -0
  169. package/skills/cocoar-vue-ui/references/foundations/localization/timezones.md +182 -0
  170. package/skills/cocoar-vue-ui/references/foundations/localization/translations.md +305 -0
  171. package/skills/cocoar-vue-ui/references/foundations/motion.md +549 -0
  172. package/skills/cocoar-vue-ui/references/foundations/spacing.md +330 -0
  173. package/skills/cocoar-vue-ui/references/foundations/theming.md +140 -0
  174. package/skills/cocoar-vue-ui/references/foundations/typography.md +206 -0
  175. package/skills/cocoar-vue-ui/references/guide/error-handling.md +162 -0
  176. package/skills/cocoar-vue-ui/references/guide/getting-started.md +119 -0
  177. package/skills/cocoar-vue-ui/references/guide/migration-page-builder-3.md +207 -0
  178. package/skills/cocoar-vue-ui/references/guide/migration.md +140 -0
  179. package/skills/cocoar-vue-ui/references/guide/theming.md +98 -0
@@ -0,0 +1,162 @@
1
+ <!-- Generated from apps/docs/guide/error-handling.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
2
+
3
+ # Error Handling
4
+
5
+ Cocoar UI components are designed to fail gracefully. Internal errors are either caught and recovered silently, or surfaced to the user through controlled feedback mechanisms. This guide explains the patterns used throughout the library and how to handle errors in your own application code.
6
+
7
+ ## Library Philosophy: Fail Gracefully
8
+
9
+ Components never throw unhandled exceptions into your application. Instead they follow one of two patterns:
10
+
11
+ - **Silent fallback** — return a safe default (`null`, `'UTC'`, `false`) and continue
12
+ - **User feedback** — surface the error visibly via a Toast or state change
13
+
14
+ ## Overlay Promises
15
+
16
+ `CoarDialog` and `CoarPopconfirm` return Promises. Always handle the rejection case:
17
+
18
+ ```ts
19
+ import { useDialog } from '@cocoar/vue-ui';
20
+
21
+ const dialog = useDialog();
22
+
23
+ // ✅ Always add .catch()
24
+ dialog.confirm({
25
+ title: 'Delete item',
26
+ message: 'This cannot be undone.',
27
+ })
28
+ .then((confirmed) => {
29
+ if (confirmed) deleteItem();
30
+ })
31
+ .catch(() => {
32
+ // Dialog was closed unexpectedly (e.g. overlay destroyed before user responded)
33
+ });
34
+ ```
35
+
36
+ With async/await:
37
+
38
+ ```ts
39
+ try {
40
+ const confirmed = await dialog.confirm({ title: 'Delete item', message: '...' });
41
+ if (confirmed) await deleteItem();
42
+ } catch {
43
+ // Handle unexpected close
44
+ }
45
+ ```
46
+
47
+ > **Tip: Popconfirm**
48
+ >
49
+ > `CoarPopconfirm` emits `@confirmed` and `@cancelled` events — no Promise handling needed there. Use it for simple inline confirmations, and reserve `useDialog()` for programmatic flows where error handling is more important.
50
+
51
+ ## Toast for Error Feedback
52
+
53
+ Use `useToast().error()` to surface errors to the user. Error toasts are persistent by default (duration `0`) — they stay until the user dismisses them, which is appropriate for errors that require attention.
54
+
55
+ ```ts
56
+ import { useToast } from '@cocoar/vue-ui';
57
+
58
+ const toast = useToast();
59
+
60
+ async function saveData() {
61
+ try {
62
+ await api.save(payload);
63
+ toast.success('Saved successfully');
64
+ } catch (err) {
65
+ toast.error('Save failed', {
66
+ message: err instanceof Error ? err.message : 'Please try again.',
67
+ });
68
+ }
69
+ }
70
+ ```
71
+
72
+ ```ts
73
+ // With a retry action
74
+ toast.error('Connection lost', {
75
+ message: 'Could not reach the server.',
76
+ action: {
77
+ label: 'Retry',
78
+ callback: () => saveData(),
79
+ },
80
+ });
81
+ ```
82
+
83
+ ## Date and Time Parsing
84
+
85
+ Date parsing functions return `null` on failure instead of throwing. Always null-check the result before using it:
86
+
87
+ ```ts
88
+ import { coarParsePlainDate } from '@cocoar/vue-ui';
89
+
90
+ const date = coarParsePlainDate(userInput);
91
+
92
+ if (date === null) {
93
+ // Input was invalid — show validation error
94
+ toast.error('Invalid date format');
95
+ return;
96
+ }
97
+
98
+ // date is a Temporal.PlainDate — safe to use
99
+ processDate(date);
100
+ ```
101
+
102
+ The date picker components handle this internally — invalid input simply doesn't update the model value. Your `v-model` will remain `null` until the user enters a valid date.
103
+
104
+ ## Timezone Fallbacks
105
+
106
+ Timezone utilities default to `'UTC'` when the browser API fails or the timezone identifier is unrecognised. This keeps date/time components functional even in restricted environments:
107
+
108
+ ```ts
109
+ import { useTimezone } from '@cocoar/vue-localization';
110
+
111
+ const { timezone } = useTimezone();
112
+ // Always a valid IANA identifier — 'UTC' as last resort
113
+ ```
114
+
115
+ ## Async Operations in Overlays
116
+
117
+ When loading data inside a Dialog or Popover, manage loading and error states yourself:
118
+
119
+ ```vue
120
+ <script setup>
121
+ import { ref } from 'vue';
122
+ import { useDialog, useToast } from '@cocoar/vue-ui';
123
+
124
+ const dialog = useDialog();
125
+ const toast = useToast();
126
+
127
+ async function openEditDialog(id: string) {
128
+ let data;
129
+ try {
130
+ data = await fetchItem(id);
131
+ } catch {
132
+ toast.error('Could not load item');
133
+ return; // Don't open the dialog if data failed to load
134
+ }
135
+
136
+ const saved = await dialog.confirm({
137
+ title: 'Edit item',
138
+ // ... pass data to dialog body component
139
+ }).catch(() => false);
140
+
141
+ if (saved) {
142
+ try {
143
+ await saveItem(data);
144
+ toast.success('Saved');
145
+ } catch {
146
+ toast.error('Save failed');
147
+ }
148
+ }
149
+ }
150
+ </script>
151
+ ```
152
+
153
+ ## Pattern Summary
154
+
155
+ | Situation | Recommended pattern |
156
+ |-----------|---------------------|
157
+ | Dialog/Popconfirm result | `.then().catch()` or `try/await/catch` |
158
+ | API call in component | `try/catch` + `toast.error()` |
159
+ | Date input validation | Null-check return value of parse functions |
160
+ | Non-recoverable error | `toast.error()` with persistent duration (default) |
161
+ | Recoverable error | `toast.error()` with `action: { label: 'Retry', callback }` |
162
+ | Silent failures OK | Rely on library defaults (`null`, `'UTC'`, `false`) |
@@ -0,0 +1,119 @@
1
+ <!-- Generated from apps/docs/guide/getting-started.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
2
+
3
+ # Getting Started
4
+
5
+ Set up the Cocoar Design System in your Vue 3 project in a few steps.
6
+
7
+ ## 1. Install
8
+
9
+ ```bash
10
+ pnpm add @cocoar/vue-ui
11
+ ```
12
+
13
+ ## 2. Import Fonts & Styles
14
+
15
+ Import fonts and styles in your app's entry point. Fonts are self-hosted via `@fontsource` — no external CDN needed.
16
+
17
+ ```ts
18
+ // main.ts
19
+ import '@cocoar/vue-ui/fonts'; // Poppins + Inter (self-hosted)
20
+ import '@cocoar/vue-ui/styles'; // Design tokens + component styles
21
+ ```
22
+
23
+ > **Info: Bring your own fonts?**
24
+ >
25
+ > The font import is optional. If you prefer a CDN or custom fonts, skip `@cocoar/vue-ui/fonts` and load them yourself. Components fall back to system fonts gracefully.
26
+
27
+ ## 3. Use Components
28
+
29
+ Import components directly — no global registration required. Tree-shaking is automatic.
30
+
31
+ ```vue
32
+ <script setup>
33
+ import { CoarButton } from '@cocoar/vue-ui';
34
+ </script>
35
+
36
+ <template>
37
+ <CoarButton>Hello Coar</CoarButton>
38
+ </template>
39
+ ```
40
+
41
+ ## 4. Dark Mode
42
+
43
+ Toggle dark mode by adding the `.dark-mode` class to the root element. All design tokens and components adapt automatically.
44
+
45
+ ```ts
46
+ document.documentElement.classList.toggle('dark-mode', isDark);
47
+ ```
48
+
49
+ ## 5. Overlay System
50
+
51
+ For components that render overlays (Dialog, Toast, Popover, Tooltip), register the plugin once:
52
+
53
+ ```ts
54
+ // main.ts
55
+ import { createApp } from 'vue';
56
+ import { CoarOverlayPlugin } from '@cocoar/vue-ui';
57
+
58
+ createApp(App)
59
+ .use(CoarOverlayPlugin)
60
+ .mount('#app');
61
+ ```
62
+
63
+ And add the overlay host to your root layout:
64
+
65
+ ```vue
66
+ <template>
67
+ <router-view />
68
+ <CoarOverlayHost />
69
+ </template>
70
+ ```
71
+
72
+ ## Date/Time Components
73
+
74
+ The date and time pickers use the [Temporal API](https://tc39.es/proposal-temporal/docs/) via `@js-temporal/polyfill`, which is included as a dependency of `@cocoar/vue-ui`. No extra install needed. When native Temporal support reaches all browsers, the polyfill can be dropped in a future major release.
75
+
76
+ ## Additional Packages
77
+
78
+ Optional packages for extended functionality:
79
+
80
+ ```bash
81
+ pnpm add @cocoar/vue-localization # i18n & timezone
82
+ pnpm add @cocoar/vue-data-grid # AG Grid wrapper
83
+ pnpm add @cocoar/vue-markdown # Markdown viewer
84
+ ```
85
+
86
+ ## AI Coding Assistants
87
+
88
+ `@cocoar/vue-ui` ships an [Agent Skill](https://agentskills.io/) — a `SKILL.md` plus this
89
+ documentation page by page, with every demo inlined as a `vue` code block — so a coding assistant
90
+ in your project knows the library's API and the mistakes it would otherwise make. It sits in a
91
+ `skills/` folder at the package root and takes no part in your build: nothing is loaded unless you
92
+ install it.
93
+
94
+ With the [skills CLI](https://github.com/vercel-labs/skills) (no extra tooling; Claude Code,
95
+ Cursor, Codex, Copilot and others):
96
+
97
+ ```bash
98
+ # From the installed package — matches the version you use
99
+ npx skills add ./node_modules/@cocoar/vue-ui
100
+
101
+ # Or straight from GitHub — the latest docs
102
+ npx skills add cocoar-dev/cocoar-ui-vue
103
+ ```
104
+
105
+ With [agentskills-cli](https://mysticmind.github.io/agentskills-cli/) (a .NET tool that also
106
+ reads npm packages):
107
+
108
+ ```bash
109
+ agentskills-cli add @cocoar/vue-ui
110
+ ```
111
+
112
+ Either places the skill in `.claude/skills/` for Claude Code and `.agents/skills/` for the
113
+ agents that read the standard; `-g` installs it globally instead. Without a tool, copy
114
+ `node_modules/@cocoar/vue-ui/skills/cocoar-vue-ui/` into the same folder by hand.
115
+
116
+ The skill is generated from these docs, so it says what the docs say for the version you
117
+ reference. The same content is available online as [llms.txt](https://docs.cocoar.dev/cocoar-ui-vue/llms.txt) (an index with one line
118
+ per page) and [llms-full.txt](https://docs.cocoar.dev/cocoar-ui-vue/llms-full.txt) (everything in one file) for assistants that fetch
119
+ documentation by URL.
@@ -0,0 +1,207 @@
1
+ <!-- Generated from apps/docs/guide/migration-page-builder-3.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
2
+
3
+ # Migrating Page Builder to 3.0
4
+
5
+ This release is confined to `@cocoar/vue-page-builder`. Every other package is
6
+ untouched.
7
+
8
+ > **Warning: The package is back under Preview**
9
+ >
10
+ > Page Builder shipped as GA in 2.17. That was an oversight — the authoring model
11
+ > is still moving, as this release shows. From 3.0 it carries the **Preview**
12
+ > badge again: expect the public API, `PageConfig` and the document schema to keep
13
+ > changing in minor releases, and pin a version if you depend on them. Documents
14
+ > stay safe either way — every schema change ships a migration that runs on
15
+ > ingest.
16
+
17
+ It removes four `PageConfig` concepts and renames several more. The removals all
18
+ answer the same question — *who does this protect, from whom?* — and the renames
19
+ all fix one word covering two things. The reasoning behind each is on the
20
+ [Authoring contract](../components/page-builder/authoring-contract.md) page.
21
+
22
+ **Your documents migrate themselves.** One document field changed
23
+ (`repeat.props.source`), and it is renamed on ingest like every earlier schema
24
+ migration. Nothing to do by hand.
25
+
26
+ ## TL;DR
27
+
28
+ | If your `PageConfig` sets… | …then |
29
+ | --- | --- |
30
+ | `fields` | Rename to **`dataContract`**. |
31
+ | `elements` | Rename to **`elementTypes`**. |
32
+ | `availableStates` | Remove. Pass the state through `runtimeContext` and declare the field's `allowedValues` — see [§3](#_3-view-state-becomes-ordinary-context). |
33
+ | `previewFixtures` | Remove. Bind your own sample to `previewContext` — see [§4](#_4-preview-fixtures-become-host-chrome). |
34
+ | `stylePresets` | Remove. Styling is `NodeStyle`, `CoarTheme` and `visual-markup` — see [§1](#_1-style-presets-are-gone). |
35
+ | `requiredNodes` | Remove. Enforce it in your publication endpoint — see [§2](#_2-required-nodes-are-gone). |
36
+ | None of these | Check the [rename table](#_6-renamed-api) — you may still import a renamed symbol. |
37
+
38
+ ---
39
+
40
+ ## 1. Style presets are gone
41
+
42
+ Removed: `config.stylePresets`, `node.stylePreset`, the `PageStylePreset` type,
43
+ `findStylePreset()` and `isSafeStylePreset()`.
44
+
45
+ They let a host register named CSS classes for the author to pick by id. The
46
+ justification was that a page author must not put CSS into a page they do not
47
+ own — but a page author *does* own the realm their page renders in, so the
48
+ restriction protected nobody. The feature was also never finished: the Editor
49
+ canvas never applied the class, so picking a preset changed nothing until you
50
+ switched to the Preview tab.
51
+
52
+ **What to use instead.** Styling has three channels and always did:
53
+
54
+ | Want | Use |
55
+ | --- | --- |
56
+ | Per-node appearance | `NodeStyle` — surface, typography, layout, box |
57
+ | Brand colours, radii, fonts | `CoarTheme` via `CoarThemeScope` / `previewTheme` |
58
+ | Free-form decoration | The `visual-markup` element (sealed iframe, free CSS) |
59
+
60
+ A leftover `stylePreset` key in a stored document is **reported as an authoring
61
+ warning, never stripped**. The renderer ignores it and emits no class from it.
62
+
63
+ ## 2. Required nodes are gone
64
+
65
+ Removed: `config.requiredNodes` (with `lockVisibility`, `lockStyle`, `parentId`
66
+ and `maxIndex`).
67
+
68
+ It pinned a node as present, placed and visually untouchable. Besides the
69
+ ownership argument above, it did not work: a node carrying both locks still
70
+ disappeared when the container **above** it was hidden, and
71
+ `validatePageDocument()` reported the document as valid.
72
+
73
+ **What to use instead.** Enforce it where activation happens. Your publish
74
+ endpoint already validates the document before a revision goes live; a check
75
+ there cannot be bypassed from the browser, which was never true of the config
76
+ flag.
77
+
78
+ ```ts
79
+ // in the publish endpoint, on the document about to become active
80
+ if (!containsVisibleNode(document, 'legal-notice')) {
81
+ return reject('The legal notice must stay on the page.');
82
+ }
83
+ ```
84
+
85
+ The builder no longer withholds delete, move or the drag grip from any node.
86
+
87
+ ## 3. View state becomes ordinary context
88
+
89
+ Removed: `config.availableStates`, `<CoarPageRenderer>`'s `viewState` prop,
90
+ `<CoarPageBuilder>`'s `previewState` prop, `visibleWhen.source: 'state'`, and
91
+ `page.viewState` in the code scope.
92
+
93
+ The host's "which screen is this right now" was a second mechanism for something
94
+ `runtimeContext` already carried. Note that **Page State is untouched**:
95
+ `definePageState`, `page.state` and `source: 'state'` *bindings* all keep working
96
+ — they mean the page author's own shared data, and losing the name collision is
97
+ part of the point.
98
+
99
+ **Before**
100
+
101
+ ```ts
102
+ const config: PageConfig = {
103
+ availableStates: [{ id: 'prompt', label: 'Prompt' }, { id: 'expired', label: 'Expired' }],
104
+ };
105
+ ```
106
+ ```vue
107
+ <CoarPageRenderer :schema :config :view-state="viewState" />
108
+ ```
109
+
110
+ **After**
111
+
112
+ ```ts
113
+ const config: PageConfig = {
114
+ contextFields: [
115
+ { path: 'runtime.viewState', type: 'string', allowedValues: ['prompt', 'expired'] },
116
+ ],
117
+ };
118
+ ```
119
+ ```vue
120
+ <CoarPageRenderer :schema :config :runtime-context="{ runtime: { viewState } }" />
121
+ ```
122
+
123
+ `allowedValues` is new: a context field that declares it gets a **dropdown** in
124
+ the condition editor instead of a free-text box — which is what
125
+ `availableStates` used to provide, now available to every enumerable field.
126
+
127
+ Documents using `visibleWhen: { source: 'state', … }` must move to
128
+ `{ source: 'context', path: 'runtime.viewState', operator: 'equals', value: … }`,
129
+ or express the condition in Element Code.
130
+
131
+ ## 4. Preview fixtures become host chrome
132
+
133
+ Removed: `config.previewFixtures` and the `PagePreviewFixture` type.
134
+
135
+ A fixture was a named bundle of `{ context, state, locale, viewport }` plus a
136
+ dropdown in the builder toolbar — but the host already owns `previewContext` and
137
+ `previewLocale`. The only thing the config added was the builder drawing the
138
+ picker, and the host is the one who knows what "empty" or "50 items" means for
139
+ its own data.
140
+
141
+ ```vue
142
+ <!-- your own picker, bound to the props you already pass -->
143
+ <select v-model="sample">…</select>
144
+ <CoarPageBuilder v-model="schema" :config :preview-context="samples[sample]" :preview-locale="locale" />
145
+ ```
146
+
147
+ The preview now runs when the host supplies the inputs its own `config`
148
+ declares (`contextFields`, `locales`), and otherwise says so rather than
149
+ rendering against invented data.
150
+
151
+ ## 5. Auth presets are gone
152
+
153
+ Removed: `createAuthPageConfig()` and `createAuthPageDocument()`.
154
+
155
+ The package ships nothing auth-specific. An IDP owns its own `PageConfig` and
156
+ starting documents; `apps/playground/src/views/auth-customization/` in this
157
+ repository is a worked example of all four slots.
158
+
159
+ ## 6. Renamed API
160
+
161
+ Mechanical, and a search-and-replace covers all of them.
162
+
163
+ | Before | After |
164
+ | --- | --- |
165
+ | `config.fields` | `config.dataContract` |
166
+ | `config.elements` | `config.elementTypes` |
167
+ | `PAGE_ELEMENTS_KEY` | `PAGE_ELEMENT_TYPES_KEY` |
168
+ | `useSchemaValidation()` | `useAuthoringFindings()` — returns `{ findings, byNodeId }`, not `{ issues, … }` |
169
+ | `ValidationIssue` | `AuthoringFinding` |
170
+ | `IssueSeverity` | `FindingSeverity` |
171
+ | `@validation` event | `@findings` |
172
+ | `PageVisualFont.source` | `PageVisualFont.src` |
173
+ | `repeat.props.source` | `repeat.props.contextPath` *(auto-migrated)* |
174
+
175
+ Each pair existed because one word covered two things: `fields` was both the DTO
176
+ contract and the live values, `elements` was both the type registry and this
177
+ page's nodes, `validation` covered field rules, the activation contract **and**
178
+ the builder's authoring hints, and `source` was an enum, a context path and a
179
+ data URL at once. `binding.source` keeps the name — it is the dominant meaning.
180
+
181
+ ## 7. Documents move to `schemaVersion: 6`
182
+
183
+ The only document change is the repeat rename, applied by
184
+ `migrateRepeatContextPath` on the same ingest path as every earlier migration —
185
+ identity-preserving, idempotent, and skipped when the new key is already there.
186
+ It runs on `v-model` assignment, on the initial value and on the JSON tab's
187
+ Apply, so a stored v5 document opens and renders unchanged.
188
+
189
+ Persist the version as-is; a document saved by 3.0 comes back stamped `6`.
190
+
191
+ ## Also worth knowing
192
+
193
+ Not breaking, but new in the same release:
194
+
195
+ - **`@findings`** mirrors the builder's authoring findings to the host, so a
196
+ save button can grey out on errors. `useAuthoringFindings()` is exported for
197
+ the same check outside a mounted builder.
198
+ - **`previewInitialValues`** starts the embedded preview from host values,
199
+ merged over the authored `defaultValue`s — the edit-form case, and the case
200
+ where a default is computed per tenant.
201
+ - **The page is exactly its host container.** Size values on the page root are
202
+ dropped and the root offers no size fields; the container owns the box. Its
203
+ contract is that the container must have a determinable height — for `body`,
204
+ `html, body { height: 100% }`. A document that set a root size is told so.
205
+ - **Quick Properties resolve per breakpoint.** They showed the base value while
206
+ the canvas rendered the resolved one; an inherited value now also names the
207
+ override it came from.
@@ -0,0 +1,140 @@
1
+ <!-- Generated from apps/docs/guide/migration.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
2
+
3
+ # Migrating to 2.11
4
+
5
+ The 2.11 release unifies the whole input family onto one internal shell
6
+ (`CoarInputFrame`) and a single field-padding token. **Visually almost nothing
7
+ changes** — padding and sizing values were preserved — and the public props and
8
+ slots of the text / number / password / select family are unchanged.
9
+
10
+ For most apps the migration is **one search-and-replace or nothing at all**. The
11
+ checklist below is ordered by how likely it is to affect you.
12
+
13
+ ## TL;DR
14
+
15
+ | If you… | …then you need to |
16
+ | --- | --- |
17
+ | Use the **date / time pickers** with a `label`, `hint`, or `error="message"` | Wrap them in [`CoarFormField`](../components/form-field.md) (see below) — a consistency fix that brings them in line with every other input. **The only real code change.** |
18
+ | Rely on the **auto clear ✕** on text / number / password / date inputs | Add the `clearable` prop where you want it. |
19
+ | **Override `--coar-input-padding-x`** in your own CSS | Rename it to `--coar-field-padding-x`. |
20
+ | **Use `--coar-spacing-2xs` / `-xxl` / `-xxxl`** in your own CSS | Switch `2xs → xxs`; pick another step for `xxl` / `xxxl`. |
21
+ | None of the above | **Nothing — you're done.** |
22
+
23
+ ---
24
+
25
+ ## 1. Date & time pickers move onto `CoarFormField`
26
+
27
+ This is really a **consistency fix**, not a feature removal. The date/time
28
+ pickers were the only inputs that rendered their *own* label and below-field
29
+ message instead of delegating to [`CoarFormField`](../components/form-field.md) like
30
+ every other field — an oversight from when they were first built. They now follow
31
+ the same pattern as the rest of the family, which also **fixes** a latent bug
32
+ where a `CoarFormField`-wrapped picker didn't pick up the error border.
33
+
34
+ Concretely: `CoarPlainDatePicker`, `CoarPlainDateTimePicker` and
35
+ `CoarZonedDateTimePicker` no longer render their own label, required asterisk, or
36
+ below-field hint/error message, and they no longer take `label` / `hint` props.
37
+ Their `error` prop is now a **`boolean`** (it flips the red border + `aria-invalid`),
38
+ matching `CoarTextInput` and the rest of the field family.
39
+
40
+ Wrap them in [`CoarFormField`](../components/form-field.md) — exactly like every other
41
+ input — to get the label, the required `*`, validation messages and the inline
42
+ status icon.
43
+
44
+ **Before:**
45
+
46
+ ```vue
47
+ <CoarPlainDatePicker
48
+ v-model="date"
49
+ label="Start date"
50
+ hint="When the project kicks off"
51
+ :error="errorMessage"
52
+ required
53
+ />
54
+ ```
55
+
56
+ **After:**
57
+
58
+ ```vue
59
+ <CoarFormField
60
+ label="Start date"
61
+ hint="When the project kicks off"
62
+ :error="errorMessage"
63
+ required
64
+ >
65
+ <CoarPlainDatePicker v-model="date" :error="!!errorMessage" />
66
+ </CoarFormField>
67
+ ```
68
+
69
+ Notes:
70
+
71
+ - `error` on the **picker** is now a boolean — pass `!!errorMessage` (or any
72
+ boolean). The human-readable message lives on `CoarFormField`.
73
+ - New `id` prop on each picker (explicit input id; otherwise taken from the
74
+ wrapping `CoarFormField`, otherwise auto-generated) for parity with the other
75
+ inputs.
76
+
77
+ ## 2. `clearable` is now opt-in (defaults to `false`)
78
+
79
+ `CoarTextInput`, `CoarPasswordInput`, `CoarNumberInput` and the three date/time
80
+ pickers previously defaulted `clearable` to `true`. They now default to `false`,
81
+ in line with the library rule that **every boolean prop defaults `false`** (and
82
+ matching `CoarSelect` / `CoarMultiSelect`, which were already `false`).
83
+
84
+ Nothing errors — the inline clear ✕ simply no longer appears unless you ask for it.
85
+
86
+ **Before** (✕ shown automatically):
87
+
88
+ ```vue
89
+ <CoarTextInput v-model="name" />
90
+ ```
91
+
92
+ **After** (add `clearable` where you want the ✕):
93
+
94
+ ```vue
95
+ <CoarTextInput v-model="name" clearable />
96
+ ```
97
+
98
+ `@cocoar/vue-data-grid` is unaffected — its cell editors already pass `clearable`
99
+ explicitly.
100
+
101
+ ## 3. Renamed / removed CSS tokens
102
+
103
+ These only affect you if you **override Cocoar design tokens** in your own
104
+ stylesheet. If you consume the components as-is, skip this section.
105
+
106
+ ### Renamed
107
+
108
+ | Old | New |
109
+ | --- | --- |
110
+ | `--coar-input-padding-x` | `--coar-field-padding-x` |
111
+
112
+ `--coar-field-padding-x` (`12px`) is the single source of truth for form-field
113
+ horizontal padding. It is intentionally **off** the spacing scale and decoupled
114
+ from it, so tuning `--coar-spacing-*` no longer moves field padding. Each control
115
+ size scales it by `--coar-component-{xs,s,m,l}-scale`.
116
+
117
+ ### Removed
118
+
119
+ | Removed | Use instead |
120
+ | --- | --- |
121
+ | `--coar-spacing-2xs` (was a duplicate of `xxs`, both `2px`) | `--coar-spacing-xxs` |
122
+ | `--coar-spacing-xxl` (`48px`, unused in the library) | a remaining step, e.g. `--coar-spacing-xl` (`32px`) |
123
+ | `--coar-spacing-xxxl` (`64px`, unused in the library) | a remaining step |
124
+
125
+ The spacing scale is now: `3xs 1 · xxs 2 · xs 4 · s 8 · m 16 · l 24 · xl 32`.
126
+
127
+ ---
128
+
129
+ ## What did **not** change
130
+
131
+ - **Public props & slots** of `CoarTextInput`, `CoarPasswordInput`,
132
+ `CoarNumberInput`, `CoarSelect`, `CoarMultiSelect`, `CoarTagSelect` — including
133
+ the `prefix` / `suffix` / `leading` / `trailing` slots. The move onto the
134
+ internal `CoarInputFrame` shell is invisible to consumers.
135
+ - **Visual output** — padding, radius and sizing values were preserved. Fields
136
+ may differ by a sub-pixel at most; nothing reflows.
137
+ - **Toggle, listbox and segmented controls** — `CoarCheckbox`, `CoarSwitch`,
138
+ `CoarRadioGroup`, `CoarListbox`, `CoarDualListbox`, `CoarSegmentedControl` got
139
+ token-consistency polish only, no API change. (`CoarSwitch` and
140
+ `CoarRadioGroup` additionally **gain** an `xs` size — additive.)