@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,200 @@
1
+ <!-- Generated from apps/docs/components/date-or-time-picker.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
2
+
3
+ # Date · optional time
4
+
5
+ Sometimes a field is "a date, and *maybe* a time" — a due date that's usually
6
+ just a day but occasionally needs an hour, a reminder that can be all-day or
7
+ timed. Instead of a separate checkbox, these pickers put a small **clock toggle
8
+ beside the field**: off means a plain date, on means a date with time.
9
+
10
+ Two variants, by whether the time carries a timezone:
11
+
12
+ ```ts
13
+ import {
14
+ CoarZonedDateTimeOrDatePicker, // PlainDate ⇄ ZonedDateTime (with IANA zone)
15
+ CoarPlainDateTimeOrDatePicker, // PlainDate ⇄ PlainDateTime (zone-less)
16
+ } from '@cocoar/vue-ui';
17
+ ```
18
+
19
+ ## Basic usage
20
+
21
+ Click the clock to switch modes. The value is one of two `Temporal` types — read
22
+ it directly to know what you got.
23
+
24
+ **Demo — `date-or-time-picker/demos/BasicOptionalTime.vue`**
25
+
26
+ ```vue
27
+ <template>
28
+ <div style="display: flex; flex-direction: column; gap: 12px; max-width: 420px;">
29
+ <CoarFormField label="Due">
30
+ <CoarZonedDateTimeOrDatePicker v-model="value" v-model:with-time="withTime" clearable />
31
+ </CoarFormField>
32
+ <span style="font-size: 13px; color: #64748b;">
33
+ {{ withTime ? 'with time' : 'date only' }} →
34
+ <code>{{ value ? `${value.constructor.name}: ${value.toString()}` : 'null' }}</code>
35
+ </span>
36
+ </div>
37
+ </template>
38
+
39
+ <script setup lang="ts">
40
+ import { ref } from 'vue';
41
+ import { CoarZonedDateTimeOrDatePicker, CoarFormField } from '@cocoar/vue-ui';
42
+ import type { Temporal } from '@js-temporal/polyfill';
43
+
44
+ // One value, two shapes: a PlainDate while the clock is off, a ZonedDateTime when on.
45
+ const value = ref<Temporal.ZonedDateTime | Temporal.PlainDate | null>(null);
46
+ const withTime = ref(false);
47
+ </script>
48
+ ```
49
+
50
+ ## The value model
51
+
52
+ A single `v-model` carries the **union** value, and `v-model:withTime` is the
53
+ toggle. They stay in sync: a non-null value's own type *is* the mode, and while
54
+ empty the toggle decides.
55
+
56
+ ```vue
57
+ <CoarZonedDateTimeOrDatePicker v-model="value" v-model:with-time="withTime" />
58
+ ```
59
+
60
+ ```ts
61
+ // value is Temporal.ZonedDateTime | Temporal.PlainDate | null
62
+ if (value instanceof Temporal.ZonedDateTime) {
63
+ // time was on — persist a timestamp
64
+ } else if (value instanceof Temporal.PlainDate) {
65
+ // date only — persist a calendar date
66
+ }
67
+ ```
68
+
69
+ Toggling **on** keeps the date and adds a time (the current time, rounded to
70
+ `minuteStep`) — and, for the zoned variant, the `timeZone` (or the user's zone).
71
+ Toggling **off** drops the time (and zone) back to the date. So flipping the
72
+ clock never loses the day.
73
+
74
+ ## Zone-less variant
75
+
76
+ `CoarPlainDateTimeOrDatePicker` is the same idea without timezones — the with-time
77
+ value is a `Temporal.PlainDateTime`.
78
+
79
+ **Demo — `date-or-time-picker/demos/PlainOptionalTime.vue`**
80
+
81
+ ```vue
82
+ <template>
83
+ <div style="display: flex; flex-direction: column; gap: 12px; max-width: 420px;">
84
+ <CoarFormField label="Reminder">
85
+ <CoarPlainDateTimeOrDatePicker v-model="value" v-model:with-time="withTime" clearable />
86
+ </CoarFormField>
87
+ <span style="font-size: 13px; color: #64748b;">
88
+ {{ withTime ? 'with time' : 'date only' }} →
89
+ <code>{{ value ? `${value.constructor.name}: ${value.toString()}` : 'null' }}</code>
90
+ </span>
91
+ </div>
92
+ </template>
93
+
94
+ <script setup lang="ts">
95
+ import { ref } from 'vue';
96
+ import { CoarPlainDateTimeOrDatePicker, CoarFormField } from '@cocoar/vue-ui';
97
+ import type { Temporal } from '@js-temporal/polyfill';
98
+
99
+ // The zone-less variant: PlainDate while off, PlainDateTime when on.
100
+ const value = ref<Temporal.PlainDateTime | Temporal.PlainDate | null>(null);
101
+ const withTime = ref(false);
102
+ </script>
103
+ ```
104
+
105
+ ## Toggle position & sizes
106
+
107
+ The clock sits to the **left** by default; set `toggle-position="end"` for the
108
+ right. Sizes match the rest of the form-control family (`xs` · `s` · `m` · `l`),
109
+ and the toggle scales with the field.
110
+
111
+ **Demo — `date-or-time-picker/demos/OptionalTimeSizes.vue`**
112
+
113
+ ```vue
114
+ <template>
115
+ <div style="display: flex; flex-direction: column; gap: 16px; max-width: 460px;">
116
+ <div v-for="s in sizes" :key="s" style="display: flex; align-items: center; gap: 12px;">
117
+ <code style="width: 24px; font-size: 12px; color: #64748b;">{{ s }}</code>
118
+ <CoarZonedDateTimeOrDatePicker v-model="value" v-model:with-time="withTime" :size="s" />
119
+ </div>
120
+ <span style="font-size: 13px; color: #64748b;">Toggle position: <code>start</code> (default) — use <code>toggle-position="end"</code> to put the clock on the right.</span>
121
+ </div>
122
+ </template>
123
+
124
+ <script setup lang="ts">
125
+ import { ref } from 'vue';
126
+ import { CoarZonedDateTimeOrDatePicker, type CoarZonedDateTimeOrDatePickerSize } from '@cocoar/vue-ui';
127
+ import type { Temporal } from '@js-temporal/polyfill';
128
+
129
+ const sizes: CoarZonedDateTimeOrDatePickerSize[] = ['xs', 's', 'm', 'l'];
130
+ const value = ref<Temporal.ZonedDateTime | Temporal.PlainDate | null>(null);
131
+ const withTime = ref(false);
132
+ </script>
133
+ ```
134
+
135
+ > **Info: Composition, not reinvention**
136
+ >
137
+ > These are thin wrappers over [`CoarPlainDatePicker`](./date-picker.md),
138
+ > [`CoarPlainDateTimePicker`](./date-time-picker.md) and
139
+ > [`CoarZonedDateTimePicker`](./zoned-date-time-picker.md) — they render the
140
+ > existing picker for the active mode and add the toggle beside it. All the
141
+ > common props pass straight through.
142
+
143
+ ## Theming
144
+
145
+ There's no new chrome to theme: the field is a `CoarInputFrame` and the toggle a
146
+ `CoarButton`, both driven by the usual tokens. The toggle's roundness **tracks
147
+ `--coar-input-radius`**, so it always matches the adjacent field (a pill theme
148
+ gives a round toggle), and the gap uses `--coar-spacing-xs`. Nothing to register
149
+ in the theme editor — tuning the existing input / button / spacing / accent
150
+ tokens restyles these too.
151
+
152
+ ## Accessibility
153
+
154
+ The clock is a toggle button: it exposes `aria-pressed` for its state and a
155
+ state-aware tooltip + `aria-label` (**Add time** when off, **Remove time** when
156
+ on, both overridable). The active field itself is the underlying picker, so its
157
+ keyboard and screen-reader behaviour is identical to the standalone pickers.
158
+
159
+ > Wrap the picker in a [`CoarFormField`](./form-field.md) for a label, the
160
+ > required asterisk, validation message and status icon — exactly like the other
161
+ > date pickers. The field auto-adopts the form field's id and error state.
162
+
163
+ ## API
164
+
165
+ Both components share this surface (the zoned variant adds the timezone props).
166
+
167
+ ### Props
168
+
169
+ | Prop | Type | Default | Description |
170
+ |------|------|---------|-------------|
171
+ | `v-model` | `PlainDate \| ZonedDateTime \| null` (zoned)<br>`PlainDate \| PlainDateTime \| null` (plain) | `null` | The union value. |
172
+ | `v-model:withTime` | `boolean` | `false` | The clock toggle / mode. |
173
+ | `placeholder` | `string` | `''` | Placeholder text. |
174
+ | `size` | `'xs' \| 's' \| 'm' \| 'l'` | `'m'` | Field + toggle size. |
175
+ | `disabled` | `boolean` | `false` | Disable the field and toggle. |
176
+ | `readonly` | `boolean` | `false` | Read-only (toggle disabled too). |
177
+ | `required` | `boolean` | `false` | Mark as required. |
178
+ | `error` | `boolean` | `false` | Error state. Auto-injected from a wrapping `CoarFormField`. |
179
+ | `clearable` | `boolean` | `false` | Show the inline clear button. |
180
+ | `locale` | `string` | — | Locale override. |
181
+ | `min` / `max` | with-time type | `null` | Bounds; the date mode uses their date part. |
182
+ | `minuteStep` | `1 \| 5 \| 10 \| 15` | `5` | Time-of-day step (also the default-time rounding). |
183
+ | `togglePosition` | `'start' \| 'end'` | `'start'` | Clock side, relative to the field. |
184
+ | `addTimeLabel` | `string` | `'Add time'` | Tooltip + label while time is off. |
185
+ | `removeTimeLabel` | `string` | `'Remove time'` | Tooltip + label while time is on. |
186
+
187
+ **Zoned variant only:**
188
+
189
+ | Prop | Type | Default | Description |
190
+ |------|------|---------|-------------|
191
+ | `timeZone` | `string \| null` | `null` | Default IANA zone for a value gaining a time (else the user's zone). |
192
+ | `timezoneFilter` | `string[]` | `[]` | Wildcard filters for the timezone list (e.g. `['Europe/*']`). |
193
+
194
+ ### Events
195
+
196
+ | Event | Payload | Description |
197
+ |-------|---------|-------------|
198
+ | `update:modelValue` | union value | The value changed. |
199
+ | `update:withTime` | `boolean` | The mode changed. |
200
+ | `opened` / `closed` | — | The calendar panel opened / closed. |
@@ -0,0 +1,203 @@
1
+ <!-- Generated from apps/docs/components/date-picker.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
2
+
3
+ # Date Picker
4
+
5
+ A calendar-backed date picker that returns a `Temporal.PlainDate` -- a date without time or timezone. Perfect for birthdays, deadlines, due dates, and any scenario where "which day" is all that matters.
6
+
7
+ ```ts
8
+ import { CoarPlainDatePicker } from '@cocoar/vue-ui';
9
+ ```
10
+
11
+ ## Basic Usage
12
+
13
+ Click the input to open a calendar dropdown. The selected value is a proper `Temporal.PlainDate`, so date math and formatting are straightforward.
14
+
15
+ **Demo — `date-picker/demos/BasicDatePicker.vue`**
16
+
17
+ ```vue
18
+ <template>
19
+ <div style="display: flex; flex-direction: column; gap: 12px; max-width: 320px;">
20
+ <CoarFormField label="Select date">
21
+ <CoarPlainDatePicker
22
+ v-model="date"
23
+ placeholder="DD.MM.YYYY"
24
+ />
25
+ </CoarFormField>
26
+ <span style="font-size: 13px; color: #64748b;">Selected: {{ date?.toString() ?? 'none' }}</span>
27
+ </div>
28
+ </template>
29
+
30
+ <script setup lang="ts">
31
+ import { ref } from 'vue';
32
+ import { CoarPlainDatePicker, CoarFormField } from '@cocoar/vue-ui';
33
+ import type { Temporal } from '@js-temporal/polyfill';
34
+
35
+ const date = ref<Temporal.PlainDate | null>(null);
36
+ </script>
37
+ ```
38
+
39
+ ## Required & Error States
40
+
41
+ Combine `required` and `error` props for form validation. The required asterisk and error message integrate with the same patterns as every other Cocoar input.
42
+
43
+ **Demo — `date-picker/demos/DatePickerValidation.vue`**
44
+
45
+ ```vue
46
+ <template>
47
+ <div style="display: flex; flex-direction: column; gap: 12px; max-width: 320px;">
48
+ <CoarFormField label="Birth date" hint="Enter your date of birth" required>
49
+ <CoarPlainDatePicker
50
+ placeholder="DD.MM.YYYY"
51
+ :required="true"
52
+ />
53
+ </CoarFormField>
54
+ <CoarFormField label="Expiry date" error="Date is in the past">
55
+ <CoarPlainDatePicker
56
+ placeholder="DD.MM.YYYY"
57
+ />
58
+ </CoarFormField>
59
+ </div>
60
+ </template>
61
+
62
+ <script setup lang="ts">
63
+ import { CoarPlainDatePicker, CoarFormField } from '@cocoar/vue-ui';
64
+ </script>
65
+ ```
66
+
67
+ ## Disabled & Readonly
68
+
69
+ `disabled` greys out the entire picker; `readonly` lets users see the selected date but prevents changes.
70
+
71
+ **Demo — `date-picker/demos/DatePickerDisabledReadonly.vue`**
72
+
73
+ ```vue
74
+ <template>
75
+ <div style="display: flex; flex-direction: column; gap: 12px; max-width: 320px;">
76
+ <CoarFormField label="Disabled">
77
+ <CoarPlainDatePicker placeholder="DD.MM.YYYY" :disabled="true" />
78
+ </CoarFormField>
79
+ <CoarFormField label="Readonly">
80
+ <CoarPlainDatePicker placeholder="DD.MM.YYYY" :readonly="true" />
81
+ </CoarFormField>
82
+ </div>
83
+ </template>
84
+
85
+ <script setup lang="ts">
86
+ import { CoarPlainDatePicker, CoarFormField } from '@cocoar/vue-ui';
87
+ </script>
88
+ ```
89
+
90
+ ## Date Range (Manual)
91
+
92
+ For start/end date pairs, use two pickers and pass the start date as `:min` on the end picker. This prevents users from selecting an end date before the start.
93
+
94
+ **Demo — `date-picker/demos/DatePickerRange.vue`**
95
+
96
+ ```vue
97
+ <template>
98
+ <div style="display: flex; flex-direction: column; gap: 12px; max-width: 320px;">
99
+ <CoarFormField label="Start date">
100
+ <CoarPlainDatePicker v-model="start" placeholder="From" />
101
+ </CoarFormField>
102
+ <CoarFormField label="End date">
103
+ <CoarPlainDatePicker v-model="end" placeholder="To" :min="start ?? undefined" />
104
+ </CoarFormField>
105
+ <span style="font-size: 13px; color: #64748b;">
106
+ Range: {{ start?.toString() ?? '?' }} &rarr; {{ end?.toString() ?? '?' }}
107
+ </span>
108
+ </div>
109
+ </template>
110
+
111
+ <script setup lang="ts">
112
+ import { ref } from 'vue';
113
+ import { CoarPlainDatePicker, CoarFormField } from '@cocoar/vue-ui';
114
+ import type { Temporal } from '@js-temporal/polyfill';
115
+
116
+ const start = ref<Temporal.PlainDate | null>(null);
117
+ const end = ref<Temporal.PlainDate | null>(null);
118
+ </script>
119
+ ```
120
+
121
+ ## Sizes
122
+
123
+ Four sizes to stay consistent with other form controls across your layout.
124
+
125
+ **Demo — `date-picker/demos/DatePickerSizes.vue`**
126
+
127
+ ```vue
128
+ <template>
129
+ <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px;">
130
+ <CoarFormField label="Extra Small">
131
+ <CoarPlainDatePicker size="xs" placeholder="DD.MM.YYYY" />
132
+ </CoarFormField>
133
+ <CoarFormField label="Small">
134
+ <CoarPlainDatePicker size="s" placeholder="DD.MM.YYYY" />
135
+ </CoarFormField>
136
+ <CoarFormField label="Medium">
137
+ <CoarPlainDatePicker size="m" placeholder="DD.MM.YYYY" />
138
+ </CoarFormField>
139
+ <CoarFormField label="Large">
140
+ <CoarPlainDatePicker size="l" placeholder="DD.MM.YYYY" />
141
+ </CoarFormField>
142
+ </div>
143
+ </template>
144
+
145
+ <script setup lang="ts">
146
+ import { CoarPlainDatePicker, CoarFormField } from '@cocoar/vue-ui';
147
+ </script>
148
+ ```
149
+
150
+ > **Info**
151
+ >
152
+ > **Temporal.PlainDate:** This component uses the TC39 Temporal API (`@js-temporal/polyfill`). PlainDate represents a calendar date without time or timezone -- no more wrestling with midnight UTC offsets.
153
+
154
+ ## Accessibility
155
+
156
+ ### Keyboard Navigation
157
+
158
+ | Key | Action |
159
+ |-----|--------|
160
+ | `Tab` | Move focus to input / calendar |
161
+ | `Enter` | Open calendar / select date |
162
+ | `Escape` | Close calendar dropdown |
163
+ | `Arrow Keys` | Navigate within the calendar |
164
+
165
+ ### Screen Reader Support
166
+
167
+ - Label text announces on focus
168
+ - Selected date is read aloud
169
+ - Calendar navigation is keyboard accessible
170
+ - Required and error states announced
171
+
172
+ ## API
173
+
174
+ ### Props
175
+
176
+ | Prop | Type | Default | Description |
177
+ |------|------|---------|-------------|
178
+ | `v-model` | `Temporal.PlainDate \| null` | `null` | Selected date |
179
+ | `placeholder` | `string` | `''` | Placeholder text |
180
+ | `min` | `Temporal.PlainDate` | `undefined` | Minimum selectable date |
181
+ | `max` | `Temporal.PlainDate` | `undefined` | Maximum selectable date |
182
+ | `size` | `'xs' \| 's' \| 'm' \| 'l'` | `'m'` | Input size |
183
+ | `disabled` | `boolean` | `false` | Disable the picker |
184
+ | `readonly` | `boolean` | `false` | Make read-only |
185
+ | `required` | `boolean` | `false` | Mark as required |
186
+ | `error` | `boolean` | `false` | Error state (red border + `aria-invalid`). Auto-injected from a wrapping [`CoarFormField`](./form-field.md). |
187
+ | `id` | `string` | `''` | Explicit input id (else taken from `CoarFormField`, else auto). |
188
+
189
+ > **Label, hint, error message and the status icon live on the wrapping [`CoarFormField`](./form-field.md)** — not on the picker. Wrap the picker in a `CoarFormField` to get a label, the required asterisk, validation messages and the inline status indicator. The picker auto-adopts the field's id, error state and `aria-describedby` via injection.
190
+
191
+ ## i18n Keys
192
+
193
+ These keys can be translated via [`@cocoar/vue-localization`](../foundations/localization/translations.md).
194
+
195
+ | Key | Default (English) | Used as |
196
+ |-----|-------------------|---------|
197
+ | `coar.ui.datePicker.previousYear` | `'Previous year'` | Previous year button `aria-label` |
198
+ | `coar.ui.datePicker.nextYear` | `'Next year'` | Next year button `aria-label` |
199
+ | `coar.ui.datePicker.jumpToToday` | `'Jump to today\'s month'` | Scroll-to-today button `aria-label` |
200
+ | `coar.ui.datePicker.months` | `'Months'` | Month grid `aria-label` |
201
+ | `coar.ui.datePicker.dialog` | `'Date picker'` | Overlay dialog `aria-label` |
202
+ | `coar.ui.datePicker.clearDate` | `'Clear date'` | Clear button `aria-label` |
203
+ | `coar.ui.datePicker.openPicker` | `'Open picker'` | Calendar button `aria-label` |
@@ -0,0 +1,154 @@
1
+ <!-- Generated from apps/docs/components/date-time-picker.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
2
+
3
+ # DateTime Picker
4
+
5
+ Combines a calendar date picker with a time input and returns a `Temporal.PlainDateTime` -- a date and time without any timezone attached. Use this when the timezone is implicit (the user's local time) or irrelevant (an alarm, a reminder). If you need timezone awareness, reach for the [Zoned DateTime Picker](./zoned-date-time-picker.md) instead.
6
+
7
+ ```ts
8
+ import { CoarPlainDateTimePicker } from '@cocoar/vue-ui';
9
+ ```
10
+
11
+ ## Basic Usage
12
+
13
+ Select a date from the calendar, then adjust the time. The bound value is a `Temporal.PlainDateTime` you can format, compare, or serialize as needed.
14
+
15
+ **Demo — `date-time-picker/demos/BasicDateTimePicker.vue`**
16
+
17
+ ```vue
18
+ <template>
19
+ <div style="display: flex; flex-direction: column; gap: 12px; max-width: 320px;">
20
+ <CoarFormField label="Appointment">
21
+ <CoarPlainDateTimePicker
22
+ v-model="dateTime"
23
+ placeholder="DD.MM.YYYY HH:mm"
24
+ />
25
+ </CoarFormField>
26
+ <span style="font-size: 13px; color: #64748b;">Selected: {{ dateTime?.toString() ?? 'none' }}</span>
27
+ </div>
28
+ </template>
29
+
30
+ <script setup lang="ts">
31
+ import { ref } from 'vue';
32
+ import { CoarPlainDateTimePicker, CoarFormField } from '@cocoar/vue-ui';
33
+ import type { Temporal } from '@js-temporal/polyfill';
34
+
35
+ const dateTime = ref<Temporal.PlainDateTime | null>(null);
36
+ </script>
37
+ ```
38
+
39
+ ## States
40
+
41
+ Supports `required`, `error`, `disabled`, and `readonly` -- the same set of states you will find on every Cocoar form control.
42
+
43
+ **Demo — `date-time-picker/demos/DateTimePickerStates.vue`**
44
+
45
+ ```vue
46
+ <template>
47
+ <div style="display: flex; flex-direction: column; gap: 12px; max-width: 320px;">
48
+ <CoarFormField label="Required" required>
49
+ <CoarPlainDateTimePicker placeholder="DD.MM.YYYY HH:mm" :required="true" />
50
+ </CoarFormField>
51
+ <CoarFormField label="With Error" error="Invalid date/time">
52
+ <CoarPlainDateTimePicker placeholder="DD.MM.YYYY HH:mm" />
53
+ </CoarFormField>
54
+ <CoarFormField label="Disabled">
55
+ <CoarPlainDateTimePicker placeholder="DD.MM.YYYY HH:mm" :disabled="true" />
56
+ </CoarFormField>
57
+ <CoarFormField label="Readonly">
58
+ <CoarPlainDateTimePicker placeholder="DD.MM.YYYY HH:mm" :readonly="true" />
59
+ </CoarFormField>
60
+ </div>
61
+ </template>
62
+
63
+ <script setup lang="ts">
64
+ import { CoarPlainDateTimePicker, CoarFormField } from '@cocoar/vue-ui';
65
+ </script>
66
+ ```
67
+
68
+ ## Sizes
69
+
70
+ Four sizes to match surrounding inputs and keep your forms visually balanced.
71
+
72
+ **Demo — `date-time-picker/demos/DateTimePickerSizes.vue`**
73
+
74
+ ```vue
75
+ <template>
76
+ <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px;">
77
+ <CoarFormField label="Extra Small">
78
+ <CoarPlainDateTimePicker size="xs" placeholder="DD.MM.YYYY HH:mm" />
79
+ </CoarFormField>
80
+ <CoarFormField label="Small">
81
+ <CoarPlainDateTimePicker size="s" placeholder="DD.MM.YYYY HH:mm" />
82
+ </CoarFormField>
83
+ <CoarFormField label="Medium">
84
+ <CoarPlainDateTimePicker size="m" placeholder="DD.MM.YYYY HH:mm" />
85
+ </CoarFormField>
86
+ <CoarFormField label="Large">
87
+ <CoarPlainDateTimePicker size="l" placeholder="DD.MM.YYYY HH:mm" />
88
+ </CoarFormField>
89
+ </div>
90
+ </template>
91
+
92
+ <script setup lang="ts">
93
+ import { CoarPlainDateTimePicker, CoarFormField } from '@cocoar/vue-ui';
94
+ </script>
95
+ ```
96
+
97
+ > **Info**
98
+ >
99
+ > **PlainDateTime vs ZonedDateTime:** Choose `PlainDateTime` when the timezone is always the user's local time or when it simply does not matter (alarm clocks, recurring events). Choose `ZonedDateTime` when you need to pin a specific instant in time and derive UTC for storage or sharing across timezones.
100
+
101
+ ## Accessibility
102
+
103
+ ### Keyboard Navigation
104
+
105
+ | Key | Action |
106
+ |-----|--------|
107
+ | `Tab` | Move focus between date and time inputs |
108
+ | `Enter` | Open calendar / confirm selection |
109
+ | `Escape` | Close calendar dropdown |
110
+ | `Arrow Keys` | Navigate within the calendar |
111
+
112
+ ### Screen Reader Support
113
+
114
+ - Label text announces on focus
115
+ - Date and time portions are independently accessible
116
+ - Required and error states announced
117
+ - Calendar navigation is keyboard accessible
118
+
119
+ ## i18n Keys
120
+
121
+ These keys can be translated via [`@cocoar/vue-localization`](../foundations/localization/translations.md).
122
+
123
+ | Key | Default (English) | Used as |
124
+ |-----|-------------------|---------|
125
+ | `coar.ui.dateTimePicker.dialog` | `'Date time picker'` | Overlay dialog `aria-label` |
126
+ | `coar.ui.dateTimePicker.clearDate` | `'Clear date'` | Clear button `aria-label` |
127
+ | `coar.ui.dateTimePicker.openPicker` | `'Open picker'` | Calendar button `aria-label` |
128
+ | `coar.ui.datePicker.jumpToToday` | `'Jump to today\'s month'` | Scroll-to-today button `aria-label` |
129
+ | `coar.ui.datePicker.previousYear` | `'Previous year'` | Previous year button `aria-label` |
130
+ | `coar.ui.datePicker.nextYear` | `'Next year'` | Next year button `aria-label` |
131
+ | `coar.ui.datePicker.months` | `'Months'` | Month grid `aria-label` |
132
+ | `coar.ui.timePicker.increaseHours` | `'Increase hours'` | Hours increment button `aria-label` |
133
+ | `coar.ui.timePicker.decreaseHours` | `'Decrease hours'` | Hours decrement button `aria-label` |
134
+ | `coar.ui.timePicker.hours` | `'Hours'` | Hours spinbutton `aria-label` |
135
+ | `coar.ui.timePicker.increaseMinutes` | `'Increase minutes'` | Minutes increment button `aria-label` |
136
+ | `coar.ui.timePicker.decreaseMinutes` | `'Decrease minutes'` | Minutes decrement button `aria-label` |
137
+ | `coar.ui.timePicker.minutes` | `'Minutes'` | Minutes spinbutton `aria-label` |
138
+
139
+ ## API
140
+
141
+ ### Props
142
+
143
+ | Prop | Type | Default | Description |
144
+ |------|------|---------|-------------|
145
+ | `v-model` | `Temporal.PlainDateTime \| null` | `null` | Selected date+time |
146
+ | `placeholder` | `string` | `''` | Placeholder text |
147
+ | `size` | `'xs' \| 's' \| 'm' \| 'l'` | `'m'` | Input size |
148
+ | `disabled` | `boolean` | `false` | Disable the picker |
149
+ | `readonly` | `boolean` | `false` | Make read-only |
150
+ | `required` | `boolean` | `false` | Mark as required |
151
+ | `error` | `boolean` | `false` | Error state (red border + `aria-invalid`). Auto-injected from a wrapping [`CoarFormField`](./form-field.md). |
152
+ | `id` | `string` | `''` | Explicit input id (else taken from `CoarFormField`, else auto). |
153
+
154
+ > **Label, hint, error message and the status icon live on the wrapping [`CoarFormField`](./form-field.md)** — not on the picker. Wrap the picker in a `CoarFormField` for a label, the required asterisk, validation messages and the inline status indicator; the picker auto-adopts the field's id, error state and `aria-describedby` via injection.