@cocoar/vue-ui 3.1.0 → 3.2.0-beta.11
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/bin/cli.mjs +53 -0
- package/dist/components/checkbox/CoarCheckbox.vue.d.ts +1 -1
- package/dist/components/checkbox/CoarCheckbox.vue.d.ts.map +1 -1
- package/dist/components/code-block/CoarCodeBlock.vue.d.ts +1 -1
- package/dist/components/code-block/CoarCodeBlock.vue.d.ts.map +1 -1
- package/dist/components/data-list/CoarDataList.vue.d.ts +158 -0
- package/dist/components/data-list/CoarDataList.vue.d.ts.map +1 -0
- package/dist/components/data-list/CoarDataListToolbar.vue.d.ts +30 -0
- package/dist/components/data-list/CoarDataListToolbar.vue.d.ts.map +1 -0
- package/dist/components/data-list/data-list-builder.d.ts +288 -0
- package/dist/components/data-list/data-list-builder.d.ts.map +1 -0
- package/dist/components/data-list/index.d.ts +12 -0
- package/dist/components/data-list/index.d.ts.map +1 -0
- package/dist/components/data-list/internal/compare.d.ts +14 -0
- package/dist/components/data-list/internal/compare.d.ts.map +1 -0
- package/dist/components/data-list/internal/reorder-core.d.ts +46 -0
- package/dist/components/data-list/internal/reorder-core.d.ts.map +1 -0
- package/dist/components/data-list/internal/search.d.ts +16 -0
- package/dist/components/data-list/internal/search.d.ts.map +1 -0
- package/dist/components/data-list/internal/useDataListLines.d.ts +92 -0
- package/dist/components/data-list/internal/useDataListLines.d.ts.map +1 -0
- package/dist/components/data-list/internal/useDataListReorder.d.ts +68 -0
- package/dist/components/data-list/internal/useDataListReorder.d.ts.map +1 -0
- package/dist/components/data-list/internal/useSearchHighlight.d.ts +19 -0
- package/dist/components/data-list/internal/useSearchHighlight.d.ts.map +1 -0
- package/dist/components/data-list/types.d.ts +185 -0
- package/dist/components/data-list/types.d.ts.map +1 -0
- package/dist/components/data-list/useDataListModel.d.ts +79 -0
- package/dist/components/data-list/useDataListModel.d.ts.map +1 -0
- package/dist/components/date-time/_shared/maskito-config.d.ts +7 -2
- package/dist/components/date-time/_shared/maskito-config.d.ts.map +1 -1
- package/dist/components/date-time/_shared/time-helpers.d.ts +11 -4
- package/dist/components/date-time/_shared/time-helpers.d.ts.map +1 -1
- package/dist/components/date-time/_shared/use-date-picker-base.d.ts +1 -1
- package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts +1 -1
- package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts +1 -1
- package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts +1 -1
- package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts.map +1 -1
- package/dist/components/dual-listbox/CoarDualListbox.vue.d.ts +3 -0
- package/dist/components/dual-listbox/CoarDualListbox.vue.d.ts.map +1 -1
- package/dist/components/form-field/CoarFormField.vue.d.ts +1 -1
- package/dist/components/form-field/CoarFormField.vue.d.ts.map +1 -1
- package/dist/components/icon/CoarIcon.vue.d.ts +2 -2
- package/dist/components/icon/CoarIcon.vue.d.ts.map +1 -1
- package/dist/components/listbox/CoarListbox.vue.d.ts +7 -0
- package/dist/components/listbox/CoarListbox.vue.d.ts.map +1 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts +1 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts.map +1 -1
- package/dist/components/otp-input/CoarOtpInput.vue.d.ts +1 -1
- package/dist/components/otp-input/CoarOtpInput.vue.d.ts.map +1 -1
- package/dist/components/password-input/CoarPasswordInput.vue.d.ts +1 -1
- package/dist/components/password-input/CoarPasswordInput.vue.d.ts.map +1 -1
- package/dist/components/switch/CoarSwitch.vue.d.ts +1 -1
- package/dist/components/switch/CoarSwitch.vue.d.ts.map +1 -1
- package/dist/components/text-input/CoarTextInput.vue.d.ts +1 -1
- package/dist/components/text-input/CoarTextInput.vue.d.ts.map +1 -1
- package/dist/composables/dragRegistry.d.ts +12 -0
- package/dist/composables/dragRegistry.d.ts.map +1 -1
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/useDragDrop.d.ts +62 -6
- package/dist/composables/useDragDrop.d.ts.map +1 -1
- package/dist/composables/useVirtualList.d.ts +21 -1
- package/dist/composables/useVirtualList.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4508 -2039
- package/package.json +9 -3
- package/skills/cocoar-vue-ui/SKILL.md +244 -0
- package/skills/cocoar-vue-ui/references/components/avatar.md +178 -0
- package/skills/cocoar-vue-ui/references/components/badge.md +290 -0
- package/skills/cocoar-vue-ui/references/components/breadcrumb.md +238 -0
- package/skills/cocoar-vue-ui/references/components/button.md +252 -0
- package/skills/cocoar-vue-ui/references/components/calendar/agenda-view.md +372 -0
- package/skills/cocoar-vue-ui/references/components/calendar/coar-calendar.md +1647 -0
- package/skills/cocoar-vue-ui/references/components/calendar/day-view.md +361 -0
- package/skills/cocoar-vue-ui/references/components/calendar/index.md +312 -0
- package/skills/cocoar-vue-ui/references/components/calendar/month-view.md +486 -0
- package/skills/cocoar-vue-ui/references/components/calendar/performance.md +186 -0
- package/skills/cocoar-vue-ui/references/components/calendar/timeline-view.md +301 -0
- package/skills/cocoar-vue-ui/references/components/calendar/week-view.md +382 -0
- package/skills/cocoar-vue-ui/references/components/calendar/work-week-view.md +145 -0
- package/skills/cocoar-vue-ui/references/components/calendar/year-view.md +63 -0
- package/skills/cocoar-vue-ui/references/components/card.md +151 -0
- package/skills/cocoar-vue-ui/references/components/checkbox-group.md +103 -0
- package/skills/cocoar-vue-ui/references/components/checkbox.md +279 -0
- package/skills/cocoar-vue-ui/references/components/code-block.md +241 -0
- package/skills/cocoar-vue-ui/references/components/context-menu.md +355 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/checkbox.md +213 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/date-columns.md +272 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/editing.md +236 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/multi-select.md +193 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/number.md +147 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/select.md +202 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/text.md +127 -0
- package/skills/cocoar-vue-ui/references/components/data-grid.md +1225 -0
- package/skills/cocoar-vue-ui/references/components/data-list.md +2121 -0
- package/skills/cocoar-vue-ui/references/components/date-or-time-picker.md +200 -0
- package/skills/cocoar-vue-ui/references/components/date-picker.md +203 -0
- package/skills/cocoar-vue-ui/references/components/date-time-picker.md +154 -0
- package/skills/cocoar-vue-ui/references/components/date-views.md +212 -0
- package/skills/cocoar-vue-ui/references/components/dialog.md +148 -0
- package/skills/cocoar-vue-ui/references/components/divider.md +157 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/annotations.md +400 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/coar-document-viewer.md +327 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/index.md +234 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/toolbar.md +221 -0
- package/skills/cocoar-vue-ui/references/components/drag-drop.md +267 -0
- package/skills/cocoar-vue-ui/references/components/dual-listbox.md +449 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/asset-store.md +327 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/in-memory-store.md +176 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/index.md +311 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/use-file-explorer.md +300 -0
- package/skills/cocoar-vue-ui/references/components/form-field.md +1025 -0
- package/skills/cocoar-vue-ui/references/components/fragment-parser.md +298 -0
- package/skills/cocoar-vue-ui/references/components/link.md +235 -0
- package/skills/cocoar-vue-ui/references/components/listbox.md +575 -0
- package/skills/cocoar-vue-ui/references/components/map/editor.md +448 -0
- package/skills/cocoar-vue-ui/references/components/map/index.md +351 -0
- package/skills/cocoar-vue-ui/references/components/markdown-diagrams.md +210 -0
- package/skills/cocoar-vue-ui/references/components/markdown-editor.md +1478 -0
- package/skills/cocoar-vue-ui/references/components/markdown-embeds.md +387 -0
- package/skills/cocoar-vue-ui/references/components/markdown-form.md +447 -0
- package/skills/cocoar-vue-ui/references/components/markdown.md +276 -0
- package/skills/cocoar-vue-ui/references/components/menu.md +380 -0
- package/skills/cocoar-vue-ui/references/components/mermaid.md +172 -0
- package/skills/cocoar-vue-ui/references/components/navbar.md +147 -0
- package/skills/cocoar-vue-ui/references/components/note.md +96 -0
- package/skills/cocoar-vue-ui/references/components/notice.md +131 -0
- package/skills/cocoar-vue-ui/references/components/number-input.md +215 -0
- package/skills/cocoar-vue-ui/references/components/otp-input.md +324 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/authoring-contract.md +271 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-builder.md +476 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-renderer.md +677 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/custom-elements.md +441 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/idp-integration.md +122 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/index.md +573 -0
- package/skills/cocoar-vue-ui/references/components/pagination.md +150 -0
- package/skills/cocoar-vue-ui/references/components/panel-layout.md +372 -0
- package/skills/cocoar-vue-ui/references/components/password-input.md +175 -0
- package/skills/cocoar-vue-ui/references/components/popconfirm.md +186 -0
- package/skills/cocoar-vue-ui/references/components/popover.md +173 -0
- package/skills/cocoar-vue-ui/references/components/progress-bar.md +178 -0
- package/skills/cocoar-vue-ui/references/components/radio-group.md +225 -0
- package/skills/cocoar-vue-ui/references/components/script-editor.md +1271 -0
- package/skills/cocoar-vue-ui/references/components/segmented-control.md +238 -0
- package/skills/cocoar-vue-ui/references/components/select.md +463 -0
- package/skills/cocoar-vue-ui/references/components/sidebar.md +421 -0
- package/skills/cocoar-vue-ui/references/components/spinner.md +132 -0
- package/skills/cocoar-vue-ui/references/components/switch.md +195 -0
- package/skills/cocoar-vue-ui/references/components/table.md +170 -0
- package/skills/cocoar-vue-ui/references/components/tabs.md +382 -0
- package/skills/cocoar-vue-ui/references/components/tag.md +178 -0
- package/skills/cocoar-vue-ui/references/components/text-input.md +256 -0
- package/skills/cocoar-vue-ui/references/components/toast.md +160 -0
- package/skills/cocoar-vue-ui/references/components/tooltip.md +121 -0
- package/skills/cocoar-vue-ui/references/components/transitions.md +193 -0
- package/skills/cocoar-vue-ui/references/components/tree.md +2388 -0
- package/skills/cocoar-vue-ui/references/components/virtual-list.md +212 -0
- package/skills/cocoar-vue-ui/references/components/wizard.md +251 -0
- package/skills/cocoar-vue-ui/references/components/zoned-date-time-picker.md +177 -0
- package/skills/cocoar-vue-ui/references/foundations/colors.md +708 -0
- package/skills/cocoar-vue-ui/references/foundations/design-principles.md +115 -0
- package/skills/cocoar-vue-ui/references/foundations/icons.md +381 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/formatting.md +530 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/setup.md +86 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/timezones.md +182 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/translations.md +305 -0
- package/skills/cocoar-vue-ui/references/foundations/motion.md +549 -0
- package/skills/cocoar-vue-ui/references/foundations/spacing.md +330 -0
- package/skills/cocoar-vue-ui/references/foundations/theming.md +140 -0
- package/skills/cocoar-vue-ui/references/foundations/typography.md +206 -0
- package/skills/cocoar-vue-ui/references/guide/error-handling.md +162 -0
- package/skills/cocoar-vue-ui/references/guide/getting-started.md +116 -0
- package/skills/cocoar-vue-ui/references/guide/migration-page-builder-3.md +207 -0
- package/skills/cocoar-vue-ui/references/guide/migration.md +140 -0
- 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,116 @@
|
|
|
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
|
+
Once `@cocoar/vue-ui` is installed, one command installs the skill of exactly that version:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npx @cocoar/vue-ui skill
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
It hands the package's skill folder to the [skills CLI](https://github.com/vercel-labs/skills),
|
|
101
|
+
which detects the agents in your project (Claude Code, Cursor, Codex, Copilot and others) and
|
|
102
|
+
asks where to install. Its options pass through: `-y` accepts the defaults, `-g` installs
|
|
103
|
+
user-wide instead of into the project, `-a claude-code` targets one agent.
|
|
104
|
+
|
|
105
|
+
Two alternatives: `npx skills add cocoar-dev/cocoar-ui-vue` takes the latest docs straight from
|
|
106
|
+
GitHub, and [agentskills-cli](https://mysticmind.github.io/agentskills-cli/) (a .NET tool that
|
|
107
|
+
also reads npm packages) installs it with `agentskills-cli add @cocoar/vue-ui`.
|
|
108
|
+
|
|
109
|
+
Either places the skill in `.claude/skills/` for Claude Code and `.agents/skills/` for the
|
|
110
|
+
agents that read the standard. Without a tool, copy
|
|
111
|
+
`node_modules/@cocoar/vue-ui/skills/cocoar-vue-ui/` into the same folder by hand.
|
|
112
|
+
|
|
113
|
+
The skill is generated from these docs, so it says what the docs say for the version you
|
|
114
|
+
reference. The same content is available online as [llms.txt](https://docs.cocoar.dev/cocoar-ui-vue/llms.txt) (an index with one line
|
|
115
|
+
per page) and [llms-full.txt](https://docs.cocoar.dev/cocoar-ui-vue/llms-full.txt) (everything in one file) for assistants that fetch
|
|
116
|
+
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.)
|