@kerf-js/veneer 0.0.0-stage → 0.1.0

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 (389) hide show
  1. package/LICENSE +16 -0
  2. package/README.md +1338 -2
  3. package/package.json +56 -3
  4. package/plugin.d.mts +187 -0
  5. package/plugin.mjs +399 -0
  6. package/src/Accordion.tsx +98 -0
  7. package/src/Alert.tsx +55 -0
  8. package/src/Badge.tsx +39 -0
  9. package/src/Button.tsx +175 -0
  10. package/src/Calendar-month.tsx +140 -0
  11. package/src/Calendar.tsx +335 -0
  12. package/src/Canvas.tsx +221 -0
  13. package/src/Card.tsx +85 -0
  14. package/src/Chart.tsx +278 -0
  15. package/src/Charts.tsx +158 -0
  16. package/src/Chip.tsx +61 -0
  17. package/src/Choice-checkbox.tsx +53 -0
  18. package/src/Choice-parts.tsx +7 -0
  19. package/src/Choice-radio.tsx +78 -0
  20. package/src/Choice-segmented.tsx +76 -0
  21. package/src/Choice-switch.tsx +51 -0
  22. package/src/Choice.tsx +4 -0
  23. package/src/CloseX.tsx +14 -0
  24. package/src/CodeBlock.tsx +81 -0
  25. package/src/CodeInput.tsx +256 -0
  26. package/src/Combobox.tsx +281 -0
  27. package/src/CommandPalette-controller.ts +314 -0
  28. package/src/CommandPalette-rows.tsx +137 -0
  29. package/src/CommandPalette.tsx +196 -0
  30. package/src/DataGrid-actions.ts +119 -0
  31. package/src/DataGrid-body.tsx +58 -0
  32. package/src/DataGrid-controller.ts +145 -0
  33. package/src/DataGrid-header.tsx +108 -0
  34. package/src/DataGrid-model.ts +248 -0
  35. package/src/DataGrid-pivot.tsx +108 -0
  36. package/src/DataGrid-rows.tsx +296 -0
  37. package/src/DataGrid-toolbar.tsx +127 -0
  38. package/src/DataGrid-tree.ts +149 -0
  39. package/src/DataGrid-viewport.tsx +37 -0
  40. package/src/DataGrid.tsx +145 -0
  41. package/src/DateField-presets.tsx +27 -0
  42. package/src/DateField-range.tsx +370 -0
  43. package/src/DateField.tsx +295 -0
  44. package/src/Dither.tsx +313 -0
  45. package/src/Drawer.tsx +123 -0
  46. package/src/DurationField.tsx +227 -0
  47. package/src/Feed.tsx +78 -0
  48. package/src/Field/view.tsx +147 -0
  49. package/src/Field.tsx +238 -0
  50. package/src/HamburgerMenu.tsx +119 -0
  51. package/src/Icon.tsx +15 -0
  52. package/src/Kbd.tsx +6 -0
  53. package/src/KeyValueEditor/actions.ts +75 -0
  54. package/src/KeyValueEditor/rows.tsx +104 -0
  55. package/src/KeyValueEditor.tsx +112 -0
  56. package/src/Layout.tsx +221 -0
  57. package/src/Markdown.tsx +127 -0
  58. package/src/MentionsInput/actions.ts +161 -0
  59. package/src/MentionsInput/end.tsx +82 -0
  60. package/src/MentionsInput.tsx +103 -0
  61. package/src/Menu.tsx +221 -0
  62. package/src/Modal.tsx +109 -0
  63. package/src/MonthPicker/month.tsx +117 -0
  64. package/src/MonthPicker/period.tsx +197 -0
  65. package/src/MonthPicker/shared.tsx +272 -0
  66. package/src/MonthPicker/week.tsx +103 -0
  67. package/src/MonthPicker.tsx +11 -0
  68. package/src/MultiSelect.tsx +139 -0
  69. package/src/Nav.tsx +36 -0
  70. package/src/NumberField.tsx +156 -0
  71. package/src/Pagination.tsx +335 -0
  72. package/src/PaymentCard.tsx +111 -0
  73. package/src/Picker.tsx +228 -0
  74. package/src/PlaceField.tsx +285 -0
  75. package/src/Popover.tsx +88 -0
  76. package/src/Presence.tsx +37 -0
  77. package/src/Progress.tsx +71 -0
  78. package/src/RecurrenceField.tsx +372 -0
  79. package/src/RichSelect/codes.tsx +94 -0
  80. package/src/RichSelect/list.tsx +380 -0
  81. package/src/RichSelect/phone-view.tsx +114 -0
  82. package/src/RichSelect/phone.tsx +305 -0
  83. package/src/RichSelect/search-keys.ts +28 -0
  84. package/src/RichSelect/timezone.tsx +53 -0
  85. package/src/RichSelect.tsx +13 -0
  86. package/src/RichTextEditor/controller.tsx +305 -0
  87. package/src/RichTextEditor/editor.tsx +61 -0
  88. package/src/RichTextEditor/tools.tsx +132 -0
  89. package/src/RichTextEditor/view.tsx +210 -0
  90. package/src/RichTextEditor.tsx +9 -0
  91. package/src/ScrollGrid/measure.ts +39 -0
  92. package/src/ScrollGrid/parts.tsx +112 -0
  93. package/src/ScrollGrid.tsx +375 -0
  94. package/src/ScrollRail.tsx +114 -0
  95. package/src/ScrollView.tsx +57 -0
  96. package/src/Segments/controller.tsx +148 -0
  97. package/src/Segments/events.ts +99 -0
  98. package/src/Segments/view.tsx +77 -0
  99. package/src/Segments.tsx +2 -0
  100. package/src/Select.tsx +343 -0
  101. package/src/Shape.tsx +41 -0
  102. package/src/Shell/branches.tsx +108 -0
  103. package/src/Shell/button.tsx +33 -0
  104. package/src/Shell/shared.tsx +220 -0
  105. package/src/Shell/shell.tsx +25 -0
  106. package/src/Shell/state.ts +138 -0
  107. package/src/Shell/view.tsx +280 -0
  108. package/src/Shell.tsx +17 -0
  109. package/src/SideNav/sections.tsx +50 -0
  110. package/src/SideNav/state.ts +140 -0
  111. package/src/SideNav.tsx +130 -0
  112. package/src/SideNavTitle.tsx +25 -0
  113. package/src/SignaturePad/state.ts +172 -0
  114. package/src/SignaturePad/view.tsx +69 -0
  115. package/src/SignaturePad.tsx +76 -0
  116. package/src/Skeleton.tsx +46 -0
  117. package/src/Slider.tsx +81 -0
  118. package/src/Spinner.tsx +21 -0
  119. package/src/Stage-director.ts +361 -0
  120. package/src/Stage-look.ts +75 -0
  121. package/src/Stage-poster.tsx +62 -0
  122. package/src/Stage-types.ts +206 -0
  123. package/src/Stage.tsx +147 -0
  124. package/src/TabBar.tsx +114 -0
  125. package/src/Table-actions.tsx +51 -0
  126. package/src/Table-base.ts +70 -0
  127. package/src/Table-body.tsx +84 -0
  128. package/src/Table-columns.tsx +58 -0
  129. package/src/Table-details.tsx +66 -0
  130. package/src/Table-editor.tsx +66 -0
  131. package/src/Table-head.tsx +52 -0
  132. package/src/Table-model.ts +82 -0
  133. package/src/Table-notice.ts +39 -0
  134. package/src/Table-paging.ts +50 -0
  135. package/src/Table-rows.tsx +308 -0
  136. package/src/Table-selection.ts +63 -0
  137. package/src/Table-sortbar.tsx +41 -0
  138. package/src/Table-source.ts +66 -0
  139. package/src/Table-toolbar.tsx +71 -0
  140. package/src/Table-types.ts +115 -0
  141. package/src/Table-view.tsx +87 -0
  142. package/src/Table.tsx +31 -0
  143. package/src/Tabs.tsx +129 -0
  144. package/src/Tag.tsx +40 -0
  145. package/src/Ticker.tsx +42 -0
  146. package/src/TimeField-date-model.ts +77 -0
  147. package/src/TimeField-date-view.tsx +152 -0
  148. package/src/TimeField-model.ts +80 -0
  149. package/src/TimeField-options.tsx +224 -0
  150. package/src/TimeField-slots.tsx +32 -0
  151. package/src/TimeField-types.ts +33 -0
  152. package/src/TimeField-view.tsx +124 -0
  153. package/src/TimeField.tsx +126 -0
  154. package/src/Toast.tsx +143 -0
  155. package/src/Toggle.tsx +75 -0
  156. package/src/Tooltip.tsx +69 -0
  157. package/src/Type.tsx +136 -0
  158. package/src/VirtualList-controls.ts +105 -0
  159. package/src/VirtualList-data.ts +43 -0
  160. package/src/VirtualList-measure.ts +169 -0
  161. package/src/VirtualList-metrics.ts +41 -0
  162. package/src/VirtualList-mount.ts +145 -0
  163. package/src/VirtualList-rows.tsx +91 -0
  164. package/src/VirtualList-types.ts +76 -0
  165. package/src/VirtualList-view.tsx +123 -0
  166. package/src/VirtualList.tsx +81 -0
  167. package/src/admin/ApiKeys-actions.ts +124 -0
  168. package/src/admin/ApiKeys-form.tsx +64 -0
  169. package/src/admin/ApiKeys-view.tsx +101 -0
  170. package/src/admin/ApiKeys.tsx +224 -0
  171. package/src/admin/Audit.tsx +246 -0
  172. package/src/admin/Billing.tsx +307 -0
  173. package/src/admin/Cart.tsx +177 -0
  174. package/src/admin/Checkout-address.tsx +125 -0
  175. package/src/admin/Checkout-cart.tsx +78 -0
  176. package/src/admin/Checkout-coupon.ts +34 -0
  177. package/src/admin/Checkout-done.tsx +31 -0
  178. package/src/admin/Checkout-model.ts +33 -0
  179. package/src/admin/Checkout-navigation.ts +76 -0
  180. package/src/admin/Checkout-payment-view.tsx +49 -0
  181. package/src/admin/Checkout-payment.ts +80 -0
  182. package/src/admin/Checkout-review.tsx +60 -0
  183. package/src/admin/Checkout-shipping.tsx +47 -0
  184. package/src/admin/Checkout-state.ts +122 -0
  185. package/src/admin/Checkout-steps.ts +10 -0
  186. package/src/admin/Checkout-summary.tsx +97 -0
  187. package/src/admin/Checkout-types.ts +60 -0
  188. package/src/admin/Checkout-view.tsx +51 -0
  189. package/src/admin/Checkout.tsx +72 -0
  190. package/src/admin/CsvImport-actions.ts +131 -0
  191. package/src/admin/CsvImport.tsx +379 -0
  192. package/src/admin/Danger.tsx +240 -0
  193. package/src/admin/Integrations/Card.tsx +82 -0
  194. package/src/admin/Integrations/Webhooks.tsx +341 -0
  195. package/src/admin/Integrations.tsx +169 -0
  196. package/src/admin/InviteDialog.tsx +153 -0
  197. package/src/admin/Members/columns.tsx +181 -0
  198. package/src/admin/Members.tsx +316 -0
  199. package/src/admin/Order.tsx +115 -0
  200. package/src/admin/PlainTable.tsx +34 -0
  201. package/src/admin/Plans.tsx +375 -0
  202. package/src/admin/SaveBar/actions.ts +86 -0
  203. package/src/admin/SaveBar.tsx +153 -0
  204. package/src/admin/Secret.tsx +74 -0
  205. package/src/admin/Settings.tsx +145 -0
  206. package/src/admin/StepBar.tsx +66 -0
  207. package/src/admin/TagsInput/actions.ts +60 -0
  208. package/src/admin/TagsInput.tsx +95 -0
  209. package/src/admin/atoms.tsx +73 -0
  210. package/src/admin/index.ts +67 -0
  211. package/src/agent/Actions/reasons.tsx +38 -0
  212. package/src/agent/Actions.tsx +166 -0
  213. package/src/agent/AgentPlan.tsx +86 -0
  214. package/src/agent/ArtifactPanel.tsx +299 -0
  215. package/src/agent/Assistant.tsx +168 -0
  216. package/src/agent/Checkpoint.tsx +19 -0
  217. package/src/agent/Cite.tsx +70 -0
  218. package/src/agent/ContextMeter.tsx +70 -0
  219. package/src/agent/Conversation.tsx +70 -0
  220. package/src/agent/Message.tsx +92 -0
  221. package/src/agent/ModelPicker.tsx +167 -0
  222. package/src/agent/Prompt-model.ts +118 -0
  223. package/src/agent/Prompt-view.tsx +246 -0
  224. package/src/agent/Prompt.tsx +128 -0
  225. package/src/agent/Prose.tsx +118 -0
  226. package/src/agent/Question.tsx +137 -0
  227. package/src/agent/Reasoning.tsx +31 -0
  228. package/src/agent/Shimmer.tsx +11 -0
  229. package/src/agent/Sources.tsx +23 -0
  230. package/src/agent/SpeechInput.tsx +243 -0
  231. package/src/agent/Suggestions.tsx +36 -0
  232. package/src/agent/ToolCall.tsx +219 -0
  233. package/src/agent/TraceViewer.tsx +96 -0
  234. package/src/agent/bits.tsx +88 -0
  235. package/src/agent/index.ts +38 -0
  236. package/src/bind.ts +57 -0
  237. package/src/collab/AutoTrack.tsx +91 -0
  238. package/src/collab/Comments.tsx +204 -0
  239. package/src/collab/Composer/state.ts +125 -0
  240. package/src/collab/Composer/view.tsx +155 -0
  241. package/src/collab/Composer.tsx +141 -0
  242. package/src/collab/ConversationList.tsx +120 -0
  243. package/src/collab/Cursors.tsx +71 -0
  244. package/src/collab/DataIntegrity.tsx +103 -0
  245. package/src/collab/Kanban-card.ts +74 -0
  246. package/src/collab/Kanban.tsx +368 -0
  247. package/src/collab/Lock.tsx +36 -0
  248. package/src/collab/PresenceStack.tsx +176 -0
  249. package/src/collab/ShareDialog.tsx +273 -0
  250. package/src/collab/Status.tsx +101 -0
  251. package/src/collab/SyncedForm.tsx +42 -0
  252. package/src/collab/Thread/Message.tsx +265 -0
  253. package/src/collab/Thread/rows.tsx +56 -0
  254. package/src/collab/Thread.tsx +323 -0
  255. package/src/collab/VersionHistory.tsx +173 -0
  256. package/src/collab/ViewportRail.tsx +73 -0
  257. package/src/collab/index.ts +37 -0
  258. package/src/collab/peer.tsx +42 -0
  259. package/src/fields.ts +5 -0
  260. package/src/flow/AuthScreen.tsx +81 -0
  261. package/src/flow/AuthSteps.tsx +296 -0
  262. package/src/flow/Checklist.tsx +211 -0
  263. package/src/flow/ConnBanner.tsx +304 -0
  264. package/src/flow/Flow.tsx +97 -0
  265. package/src/flow/MfaSetup.tsx +244 -0
  266. package/src/flow/Otp.tsx +243 -0
  267. package/src/flow/ReauthDialog.tsx +79 -0
  268. package/src/flow/ShortcutsOverlay.tsx +121 -0
  269. package/src/flow/SignGate.tsx +184 -0
  270. package/src/flow/SignIn.tsx +136 -0
  271. package/src/flow/SignUp.tsx +149 -0
  272. package/src/flow/Sso.tsx +96 -0
  273. package/src/flow/SystemPage/accounts.tsx +74 -0
  274. package/src/flow/SystemPage/art.tsx +113 -0
  275. package/src/flow/SystemPage.tsx +395 -0
  276. package/src/flow/Tour.tsx +207 -0
  277. package/src/flow/index.ts +29 -0
  278. package/src/flow/kit.tsx +334 -0
  279. package/src/index.ts +237 -0
  280. package/src/layout.css +4 -0
  281. package/src/links.css +4 -0
  282. package/src/live/ActivityFeed.tsx +88 -0
  283. package/src/live/Bell.tsx +108 -0
  284. package/src/live/Connection.tsx +113 -0
  285. package/src/live/Inbox.tsx +113 -0
  286. package/src/live/InboxFeed.tsx +67 -0
  287. package/src/live/InboxGestures.ts +41 -0
  288. package/src/live/InboxHandlers.ts +102 -0
  289. package/src/live/InboxHeader.tsx +81 -0
  290. package/src/live/InboxModel.ts +81 -0
  291. package/src/live/InboxRow.tsx +125 -0
  292. package/src/live/MeetingRoom.tsx +22 -0
  293. package/src/live/MeetingRoomControlBar.tsx +197 -0
  294. package/src/live/MeetingRoomHandlers.ts +53 -0
  295. package/src/live/MeetingRoomLayout.tsx +27 -0
  296. package/src/live/MeetingRoomModel.ts +49 -0
  297. package/src/live/MeetingRoomMount.ts +49 -0
  298. package/src/live/MeetingRoomParts.tsx +178 -0
  299. package/src/live/MeetingRoomPerson.tsx +21 -0
  300. package/src/live/MeetingRoomState.ts +88 -0
  301. package/src/live/MeetingRoomTile.tsx +84 -0
  302. package/src/live/MeetingRoomTypes.ts +68 -0
  303. package/src/live/MeetingRoomView.tsx +36 -0
  304. package/src/live/NotificationPreferences.tsx +99 -0
  305. package/src/live/NotificationPreferencesActions.ts +55 -0
  306. package/src/live/NotificationPreferencesCell.tsx +26 -0
  307. package/src/live/NotificationPreferencesCells.tsx +59 -0
  308. package/src/live/NotificationPreferencesGrid.tsx +129 -0
  309. package/src/live/NotificationPreferencesModel.tsx +91 -0
  310. package/src/live/NotificationPreferencesSave.ts +85 -0
  311. package/src/live/NotificationPreferencesWatch.ts +31 -0
  312. package/src/live/Prejoin.tsx +238 -0
  313. package/src/live/PrejoinMeter.tsx +26 -0
  314. package/src/live/PrejoinPreview.tsx +53 -0
  315. package/src/live/PushSoftAsk.tsx +63 -0
  316. package/src/live/TransportPicker.tsx +341 -0
  317. package/src/live/TransportPickerDetails.tsx +130 -0
  318. package/src/live/index.ts +31 -0
  319. package/src/live/notify.tsx +22 -0
  320. package/src/live/shared.tsx +110 -0
  321. package/src/parts.tsx +199 -0
  322. package/src/plugin/catalog.mjs +129 -0
  323. package/src/plugin/dtcg.mjs +79 -0
  324. package/src/plugin/icons.mjs +7 -0
  325. package/src/plugin/seed.mjs +40 -0
  326. package/src/plugin/theme-context.mjs +44 -0
  327. package/src/plugin/theme-css.mjs +143 -0
  328. package/src/plugin/theme-motion.mjs +43 -0
  329. package/src/plugin/theme-parts.d.mts +41 -0
  330. package/src/plugin/theme-parts.mjs +224 -0
  331. package/src/plugin/theme-text.mjs +93 -0
  332. package/src/plugin/theme-values.mjs +15 -0
  333. package/src/plugin/theme.d.mts +82 -0
  334. package/src/plugin/theme.mjs +316 -0
  335. package/src/schedule/Agenda.tsx +124 -0
  336. package/src/schedule/AgendaActions.ts +31 -0
  337. package/src/schedule/AgendaDay.tsx +124 -0
  338. package/src/schedule/AgendaGestures.ts +27 -0
  339. package/src/schedule/AgendaKeys.ts +52 -0
  340. package/src/schedule/AgendaModel.ts +82 -0
  341. package/src/schedule/AgendaNavigation.ts +38 -0
  342. package/src/schedule/AgendaPage.tsx +39 -0
  343. package/src/schedule/AgendaStrip.tsx +55 -0
  344. package/src/schedule/AvailabilityEditor-actions.ts +146 -0
  345. package/src/schedule/AvailabilityEditor-day.tsx +119 -0
  346. package/src/schedule/AvailabilityEditor-view.tsx +205 -0
  347. package/src/schedule/AvailabilityEditor.tsx +113 -0
  348. package/src/schedule/BookingCalendar.tsx +121 -0
  349. package/src/schedule/BookingCalendarActions.ts +85 -0
  350. package/src/schedule/BookingCalendarModel.ts +86 -0
  351. package/src/schedule/BookingCalendarParts.tsx +87 -0
  352. package/src/schedule/Calendar/AgendaView.tsx +45 -0
  353. package/src/schedule/Calendar/CalendarDialogs.tsx +105 -0
  354. package/src/schedule/Calendar/CalendarMain.tsx +47 -0
  355. package/src/schedule/Calendar/CalendarToolbar.tsx +106 -0
  356. package/src/schedule/Calendar/Column.tsx +129 -0
  357. package/src/schedule/Calendar/EventBlock.tsx +71 -0
  358. package/src/schedule/Calendar/MiniMonth.tsx +169 -0
  359. package/src/schedule/Calendar/MonthGrid.tsx +296 -0
  360. package/src/schedule/Calendar/TimeGrid.tsx +252 -0
  361. package/src/schedule/Calendar/Timeline.tsx +287 -0
  362. package/src/schedule/Calendar/ZoneChip.tsx +73 -0
  363. package/src/schedule/Calendar/calendar-shell.ts +160 -0
  364. package/src/schedule/Calendar/calendar-state.ts +30 -0
  365. package/src/schedule/Calendar/now-spans.tsx +33 -0
  366. package/src/schedule/Calendar/shared.ts +3 -0
  367. package/src/schedule/Calendar/state-actions.ts +189 -0
  368. package/src/schedule/Calendar/state-base.ts +143 -0
  369. package/src/schedule/Calendar/state-keys.ts +128 -0
  370. package/src/schedule/Calendar/time-fit.ts +84 -0
  371. package/src/schedule/Calendar.tsx +182 -0
  372. package/src/schedule/EventEditor.tsx +267 -0
  373. package/src/schedule/EventPopover.tsx +190 -0
  374. package/src/schedule/MeetingPlanner-model.ts +222 -0
  375. package/src/schedule/MeetingPlanner-view.tsx +310 -0
  376. package/src/schedule/MeetingPlanner.tsx +122 -0
  377. package/src/schedule/MoveSheet.tsx +168 -0
  378. package/src/schedule/YearView-model.ts +164 -0
  379. package/src/schedule/YearView-parts.tsx +147 -0
  380. package/src/schedule/YearView.tsx +100 -0
  381. package/src/schedule/bits.tsx +65 -0
  382. package/src/schedule/index.ts +25 -0
  383. package/src/skeleton-css.ts +4 -0
  384. package/src/styles.ts +13 -0
  385. package/src/type.css +15 -0
  386. package/src/ui.ts +41 -0
  387. package/src/use-ui.ts +10 -0
  388. package/tailwind.css +38 -0
  389. package/tokens/color.mjs +87 -0
@@ -0,0 +1,168 @@
1
+ import { LeftIcon, RightIcon } from '@kerf-js/veneer-icons'
2
+ import {
3
+ clock,
4
+ clockRange,
5
+ dateOf,
6
+ fmt,
7
+ longDuration,
8
+ moveSlots,
9
+ slotOf,
10
+ weekDates,
11
+ type CalEvent,
12
+ type Slot,
13
+ } from '@kerf-js/veneer-core'
14
+ import { derived, state, untrack, type State } from '@kerf-js/core'
15
+ import { Alert } from '../Alert'
16
+ import { Button } from '../Button'
17
+ import { Chip } from '../Chip'
18
+ import { Drawer } from '../Drawer'
19
+ import { SweepParts, confirmSweep } from './bits'
20
+ import '@kerf-js/veneer-core/styles/app/booking.css'
21
+
22
+ /** Props for MoveSheet. */
23
+ export type MoveSheetProps = {
24
+ open: State<boolean>
25
+ event: CalEvent | null
26
+ /** Everything else on the calendar: a start that collides is disabled. */
27
+ events: CalEvent[]
28
+ /** The day the week strip starts on, 0 for Sunday to 6. Default 1, Monday. */
29
+ firstDayOfWeek?: number | undefined
30
+ locale?: string | undefined
31
+ /** `h12` for AM and PM, `h23` for a 24-hour clock. The locale's otherwise. */
32
+ hourCycle?: string | undefined
33
+ step?: number | undefined
34
+ onMove: (e: CalEvent, to: Slot) => void
35
+ onClose?: (() => void) | undefined
36
+ }
37
+
38
+ /** The move sheet (07 §2.2, `#move-sheet`): a bottom Sheet with day, start and duration, the touch path for a drag. */
39
+ export function MoveSheet(p: MoveSheetProps) {
40
+ const title = derived(() => (p.event ? `Move “${p.event.title}”` : 'Move event'))
41
+ const hold = state<(() => void) | null>(null)
42
+ const go = () => hold.value?.()
43
+ const cancel = () => {
44
+ p.open.value = false
45
+ p.onClose?.()
46
+ }
47
+ return (
48
+ <Drawer
49
+ open={p.open}
50
+ side="bottom"
51
+ title={title.value}
52
+ description={
53
+ p.event
54
+ ? `${longDuration(slotOf(p.event).e - slotOf(p.event).s)} · now ${fmt(dateOf(p.event.start), { weekday: 'short' }, p.locale ?? 'en-US')} ${clockRange(slotOf(p.event).s, slotOf(p.event).e, p.locale ?? 'en-US', p.hourCycle)}`
55
+ : undefined
56
+ }
57
+ footer={
58
+ <>
59
+ <Button emphasis="outline" tone="neutral" onClick={cancel}>
60
+ Cancel
61
+ </Button>
62
+ <Button onClick={go}>Move event</Button>
63
+ </>
64
+ }
65
+ >
66
+ {p.event && p.open.value && (
67
+ <Body key={p.event.id} event={p.event} props={p} bind={(f) => (hold.value = f)} />
68
+ )}
69
+ </Drawer>
70
+ )
71
+ }
72
+
73
+ function bodyModel(event: CalEvent, p: MoveSheetProps, bind: (go: () => void) => void) {
74
+ const e = untrack(() => event)
75
+ const origin = slotOf(e)
76
+ const day = state<string>(origin.date)
77
+ const start = state(origin.s)
78
+ const len = state(origin.e - origin.s)
79
+ const locale = derived(() => p.locale ?? 'en-US')
80
+ const week = derived(() => weekDates(origin.date, p.firstDayOfWeek ?? 1))
81
+ const slots = derived(() => moveSlots(p.events, e, { date: day.value, len: len.value }))
82
+ const stepBy = untrack(() => p.step ?? 15)
83
+ const go = () => {
84
+ const to = {
85
+ date: day.value,
86
+ s: start.value,
87
+ e: start.value + len.value,
88
+ resource: origin.resource,
89
+ }
90
+ p.open.value = false
91
+ p.onMove(e, to)
92
+ p.onClose?.()
93
+ }
94
+ untrack(() => bind(go))
95
+ const pick = (s: number, ev: MouseEvent) => {
96
+ start.value = s
97
+ confirmSweep(ev.currentTarget as Element)
98
+ }
99
+ return { e, day, start, len, locale, week, slots, stepBy, pick }
100
+ }
101
+
102
+ function Body({
103
+ event,
104
+ props: p,
105
+ bind,
106
+ }: {
107
+ event: CalEvent
108
+ props: MoveSheetProps
109
+ bind: (go: () => void) => void
110
+ }) {
111
+ const { e, day, start, len, locale, week, slots, stepBy, pick } = untrack(() =>
112
+ bodyModel(event, p, bind),
113
+ )
114
+ return (
115
+ <div class="stack">
116
+ <div class="chips" role="group" aria-label="Day">
117
+ {week.value.map((d) => (
118
+ <Chip key={d} pressed={d === day.value} onClick={() => (day.value = d)}>
119
+ {fmt(d, { weekday: 'short', day: 'numeric' }, locale.value)}
120
+ </Chip>
121
+ ))}
122
+ </div>
123
+ <div data-scope="booking" data-part="root">
124
+ <div data-part="slots" role="group" aria-label="Start time">
125
+ {slots.value.map((x) => (
126
+ <button
127
+ key={x.s}
128
+ type="button"
129
+ data-part="slot"
130
+ data-sweep=""
131
+ aria-pressed={x.s === start.value ? 'true' : 'false'}
132
+ disabled={x.busy}
133
+ onClick={(ev: MouseEvent) => pick(x.s, ev)}
134
+ >
135
+ <SweepParts />
136
+ {clock(x.s, locale.value, p.hourCycle)}
137
+ </button>
138
+ ))}
139
+ </div>
140
+ </div>
141
+ <div class="row" role="group" aria-label="Duration">
142
+ <Button
143
+ emphasis="outline"
144
+ tone="neutral"
145
+ size="sm"
146
+ label="Shorter"
147
+ icon={LeftIcon}
148
+ disabled={len.value <= stepBy}
149
+ onClick={() => (len.value = Math.max(stepBy, len.value - stepBy))}
150
+ />
151
+ <output aria-live="polite">{longDuration(len.value)}</output>
152
+ <Button
153
+ emphasis="outline"
154
+ tone="neutral"
155
+ size="sm"
156
+ label="Longer"
157
+ icon={RightIcon}
158
+ onClick={() => (len.value += stepBy)}
159
+ />
160
+ </div>
161
+ {e.recurrence && (
162
+ <Alert tone="info" title="This event repeats">
163
+ Moving changes this one only. Use Edit for the series.
164
+ </Alert>
165
+ )}
166
+ </div>
167
+ )
168
+ }
@@ -0,0 +1,164 @@
1
+ import {
2
+ announce,
3
+ eventsOn,
4
+ fmt,
5
+ monthStart,
6
+ monthSummary,
7
+ monthWeeks,
8
+ motionOff,
9
+ uid,
10
+ weekStart,
11
+ weekdays,
12
+ ymd,
13
+ yearKey,
14
+ yearMonths,
15
+ yearTotal,
16
+ type IsoDate,
17
+ } from '@kerf-js/veneer-core'
18
+ import { derived, flush, state, untrack } from '@kerf-js/core'
19
+ import { usePickerEnv } from '../Picker'
20
+ import type { YearViewProps } from './YearView'
21
+
22
+ const events = (n: number) => (n ? `${n} event${n > 1 ? 's' : ''}` : 'no events')
23
+
24
+ export function yearData(p: YearViewProps) {
25
+ const id = uid('year')
26
+ const env = usePickerEnv(
27
+ () => p.locale,
28
+ () => p.today,
29
+ )
30
+ const first = derived(() => p.firstDayOfWeek ?? weekStart(env.locale.value))
31
+ const heads = derived(() => weekdays(first.value, env.locale.value))
32
+ const focus = state<string>(
33
+ untrack(() =>
34
+ p.year && p.year !== ymd(env.today.value)[0] ? `${p.year}-01-01` : env.today.value,
35
+ ),
36
+ )
37
+ const year = derived(() => ymd(focus.value)[0])
38
+ const picked = state<{ iso: string; kind: 'day' | 'month' } | null>(null)
39
+ const swapping = state(false)
40
+ const list = derived(() =>
41
+ yearMonths(year.value).map((month) => {
42
+ const { total } = monthSummary(p.counts, month)
43
+ return {
44
+ month,
45
+ total,
46
+ name: fmt(month, { month: 'long' }, env.locale.value),
47
+ current: month === monthStart(env.today.value),
48
+ weeks: monthWeeks(month, first.value).map((days, r) => ({
49
+ key: `${month}-${r}`,
50
+ cells: days.map((iso, c) => ({
51
+ key: iso ?? `${month}-${r}-${c}`,
52
+ iso,
53
+ count: iso ? (p.counts[iso] ?? 0) : 0,
54
+ weekend: (first.value + c) % 7 === 0 || (first.value + c) % 7 === 6,
55
+ })),
56
+ })),
57
+ }
58
+ }),
59
+ )
60
+ return { id, env, first, heads, focus, year, picked, swapping, list }
61
+ }
62
+
63
+ export function yearDetail(
64
+ p: YearViewProps,
65
+ data: ReturnType<typeof yearData>,
66
+ long: (iso: string) => string,
67
+ ) {
68
+ const { env, year, picked } = data
69
+ const detail = derived(() => {
70
+ const at = picked.value
71
+ if (!at || ymd(at.iso)[0] !== year.value) return null
72
+ if (at.kind === 'month') {
73
+ const s = monthSummary(p.counts, at.iso)
74
+ return {
75
+ kind: 'month' as const,
76
+ iso: at.iso,
77
+ head: `${fmt(at.iso, { month: 'long', year: 'numeric' }, env.locale.value)} · ${s.total} events`,
78
+ busiest: s.busiest ? `Busiest day: ${long(s.busiest)}, ${s.most} events.` : undefined,
79
+ }
80
+ }
81
+ const n = p.counts[at.iso] ?? 0
82
+ const rows = p.events ? eventsOn(p.events, at.iso) : []
83
+ return {
84
+ kind: 'day' as const,
85
+ iso: at.iso,
86
+ head: `${long(at.iso)} · ${n ? events(n) : 'nothing booked'}`,
87
+ rows: rows.slice(0, 4),
88
+ more: Math.max(0, rows.length - 4),
89
+ }
90
+ })
91
+ return detail
92
+ }
93
+
94
+ export function yearNavigation(p: YearViewProps, data: ReturnType<typeof yearData>) {
95
+ const { env, first, focus, year, picked, swapping } = data
96
+ let months: HTMLDivElement | undefined
97
+ const say = (t: string) => months && announce(months.ownerDocument, t)
98
+ const long = (iso: string) =>
99
+ fmt(iso, { weekday: 'long', month: 'long', day: 'numeric', year: 'numeric' }, env.locale.value)
100
+ const toCell = () => {
101
+ flush()
102
+ months?.querySelector<HTMLElement>('[data-day][tabindex="0"]')?.focus()
103
+ }
104
+ const go = (iso: string, move = true) => {
105
+ const was = year.value
106
+ const swap = ymd(iso)[0] !== was
107
+ const apply = () => {
108
+ focus.value = iso
109
+ swapping.value = false
110
+ if (move) toCell()
111
+ if (swap) {
112
+ say(
113
+ `${ymd(iso)[0]}, ${yearTotal(p.counts, ymd(iso)[0]).toLocaleString(env.locale.value)} events`,
114
+ )
115
+ p.onYearChange?.(ymd(iso)[0])
116
+ }
117
+ }
118
+ if (!swap || !months || motionOff(months)) return apply()
119
+ swapping.value = true
120
+ setTimeout(apply, 140)
121
+ }
122
+ const dayName = (iso: string) => `${long(iso)}, ${events(p.counts[iso] ?? 0)}`
123
+ const day = (iso: string) => {
124
+ if (p.direct !== false && p.openDay?.(iso as IsoDate)) return say(`Day view, ${long(iso)}`)
125
+ focus.value = iso
126
+ picked.value = { iso, kind: 'day' }
127
+ say(dayName(iso))
128
+ }
129
+ const month = (iso: string) => {
130
+ const m = monthStart(iso)
131
+ if (p.direct !== false && p.openMonth?.(m))
132
+ return say(`Month view, ${fmt(m, { month: 'long', year: 'numeric' }, env.locale.value)}`)
133
+ focus.value = m
134
+ picked.value = { iso: m, kind: 'month' }
135
+ toCell()
136
+ const s = monthSummary(p.counts, m)
137
+ say(`${fmt(m, { month: 'long', year: 'numeric' }, env.locale.value)}, ${s.total} events`)
138
+ }
139
+ const onKey = (e: KeyboardEvent) => {
140
+ const c = (e.target as Element).closest?.<HTMLElement>('[data-day]')
141
+ if (!c || e.metaKey || e.ctrlKey) return
142
+ const to = yearKey(
143
+ e.key,
144
+ e.shiftKey,
145
+ c.dataset.day!,
146
+ first.value,
147
+ getComputedStyle(c).direction === 'rtl',
148
+ )
149
+ if (!to) return
150
+ e.preventDefault()
151
+ if (to === 'pick') day(c.dataset.day!)
152
+ else if (to === 'month') month(c.dataset.day!)
153
+ else if (to === 'today') go(env.today.value)
154
+ else go(to)
155
+ }
156
+ const onClick = (e: MouseEvent) => {
157
+ const t = e.target as Element
158
+ const title = t.closest?.<HTMLElement>('[data-part="month-title"]')
159
+ if (title) return month(title.dataset.month!)
160
+ const c = t.closest?.<HTMLElement>('[data-day]')
161
+ if (c) day(c.dataset.day!)
162
+ }
163
+ return { long, dayName, go, onKey, onClick, setMonths: (n: HTMLDivElement) => (months = n) }
164
+ }
@@ -0,0 +1,147 @@
1
+ import { clock, minuteOf, monthStart, ymd, yearLevel, type IsoDate } from '@kerf-js/veneer-core'
2
+ import { Button } from '../Button'
3
+ import type { YearViewProps } from './YearView'
4
+ import type { yearData, yearDetail, yearNavigation } from './YearView-model'
5
+
6
+ export function yearMonthsView(
7
+ data: ReturnType<typeof yearData>,
8
+ nav: ReturnType<typeof yearNavigation>,
9
+ ) {
10
+ const { id, swapping, list, heads, focus, picked, env } = data
11
+ const { setMonths, onKey, onClick, dayName } = nav
12
+ return (
13
+ <div
14
+ ref={setMonths}
15
+ data-part="months"
16
+ role="group"
17
+ aria-labelledby={`${id}-t`}
18
+ aria-describedby={`${id}-h`}
19
+ data-swapping={swapping.value ? '' : undefined}
20
+ onKeyDown={onKey}
21
+ onClick={onClick}
22
+ >
23
+ {list.value.map((m) => (
24
+ <div key={m.month} data-part="year-month" data-current={m.current ? '' : undefined}>
25
+ <button
26
+ type="button"
27
+ data-part="month-title"
28
+ id={`${id}-${m.month}`}
29
+ data-month={m.month}
30
+ tabindex="-1"
31
+ >
32
+ {m.name}{' '}
33
+ <small>
34
+ {m.total}
35
+ <span class="sr"> events</span>
36
+ </small>
37
+ </button>
38
+ <div role="grid" aria-labelledby={`${id}-${m.month}`}>
39
+ <div role="row">
40
+ {heads.value.map((h) => (
41
+ <span key={h[0]} role="columnheader">
42
+ <span aria-hidden="true">{h[0][0]}</span>
43
+ <span class="sr">{h[0]}</span>
44
+ </span>
45
+ ))}
46
+ </div>
47
+ {m.weeks.map((w) => (
48
+ <div key={w.key} role="row">
49
+ {w.cells.map((c) =>
50
+ c.iso ? (
51
+ <span
52
+ key={c.key}
53
+ role="gridcell"
54
+ data-day={c.iso}
55
+ tabindex={c.iso === focus.value ? '0' : '-1'}
56
+ aria-selected={
57
+ picked.value?.iso === c.iso && picked.value.kind === 'day'
58
+ ? 'true'
59
+ : 'false'
60
+ }
61
+ aria-current={c.iso === env.today.value ? 'date' : undefined}
62
+ data-weekend={c.weekend ? '' : undefined}
63
+ aria-label={`${dayName(c.iso)}${c.iso === env.today.value ? ', today' : ''}`}
64
+ >
65
+ <span data-part="num" aria-hidden="true">
66
+ {ymd(c.iso)[2]}
67
+ </span>
68
+ <i
69
+ data-part="dots"
70
+ style={`--_n:${yearLevel(c.count)}`}
71
+ aria-hidden="true"
72
+ ></i>
73
+ </span>
74
+ ) : (
75
+ <span key={c.key} role="gridcell" data-outside="" aria-hidden="true"></span>
76
+ ),
77
+ )}
78
+ </div>
79
+ ))}
80
+ </div>
81
+ </div>
82
+ ))}
83
+ </div>
84
+ )
85
+ }
86
+
87
+ export function yearDetailView(
88
+ p: YearViewProps,
89
+ data: ReturnType<typeof yearData>,
90
+ detail: ReturnType<typeof yearDetail>,
91
+ ) {
92
+ const { picked, env } = data
93
+ return (
94
+ <div data-part="detail" role="status" aria-live="polite">
95
+ {detail.value ? (
96
+ <>
97
+ <div class="row">
98
+ <b>{detail.value.head}</b>
99
+ {detail.value.kind === 'day' && p.openDay && (
100
+ <Button
101
+ emphasis="outline"
102
+ tone="neutral"
103
+ size="sm"
104
+ onClick={() => p.openDay!(picked.value!.iso as IsoDate)}
105
+ >
106
+ Open in Day view
107
+ </Button>
108
+ )}
109
+ {p.openMonth && (
110
+ <Button
111
+ emphasis="ghost"
112
+ tone="neutral"
113
+ size="sm"
114
+ onClick={() => p.openMonth!(monthStart(picked.value!.iso))}
115
+ >
116
+ Open in Month view
117
+ </Button>
118
+ )}
119
+ </div>
120
+ {detail.value.kind === 'month'
121
+ ? detail.value.busiest && <span class="muted">{detail.value.busiest}</span>
122
+ : detail.value.rows.length > 0 && (
123
+ <ul>
124
+ {detail.value.rows.map((e) => (
125
+ <li key={e.id}>
126
+ <i data-cal={e.cal ?? 1}></i>
127
+ <span>
128
+ {e.allDay
129
+ ? 'All day'
130
+ : clock(minuteOf(e.start), env.locale.value, p.hourCycle)}
131
+ </span>
132
+ {e.title}
133
+ </li>
134
+ ))}
135
+ {detail.value.more > 0 && <li>+{detail.value.more} more</li>}
136
+ </ul>
137
+ )}
138
+ </>
139
+ ) : (
140
+ <span class="muted">
141
+ Pick a day to see what's on it. More dots, busier day: one for 1–2 events, two for 3–4,
142
+ three for 5 or more.
143
+ </span>
144
+ )}
145
+ </div>
146
+ )
147
+ }
@@ -0,0 +1,100 @@
1
+ import { LeftIcon, RightIcon } from '@kerf-js/veneer-icons'
2
+ import { addMonths, type CalEvent, type IsoDate } from '@kerf-js/veneer-core'
3
+ import { untrack } from '@kerf-js/core'
4
+ import { Button } from '../Button'
5
+ import { yearData, yearDetail, yearNavigation } from './YearView-model'
6
+ import { yearMonthsView, yearDetailView } from './YearView-parts'
7
+ import './bits'
8
+ import '@kerf-js/veneer-core/styles/app/year.css'
9
+
10
+ /** Props for YearView. */
11
+ export type YearViewProps = {
12
+ /** `{ [isoDay]: n }`: a year's counts only (07 §2.7). */
13
+ counts: Record<string, number>
14
+ /** Names the section when the year alone won't do: two on a page. */
15
+ label?: string | undefined
16
+ /** Events for the picked day's detail: from `events`, or fetched by the app when it is picked. */
17
+ events?: CalEvent[] | undefined
18
+ year?: number | undefined
19
+ /** Pins today's date, for server rendering and tests. The browser's clock otherwise. */
20
+ today?: string | undefined
21
+ locale?: string | undefined
22
+ /** `h12` for AM and PM, `h23` for a 24-hour clock. The locale's otherwise. */
23
+ hourCycle?: string | undefined
24
+ /** The day each month's rows start on, 0 for Sunday to 6. The locale's otherwise. */
25
+ firstDayOfWeek?: number | undefined
26
+ /** Inside a Calendar: return true when the day or month opened there, and the picker stays out of the way. */
27
+ openDay?: ((iso: IsoDate) => boolean | void) | undefined
28
+ openMonth?: ((iso: IsoDate) => boolean | void) | undefined
29
+ /** Open straight away; off, a pick shows the detail and offers the jump. */
30
+ direct?: boolean | undefined
31
+ /** Called with the new year when you page. */
32
+ onYearChange?: ((y: number) => void) | undefined
33
+ }
34
+
35
+ /**
36
+ * The year (07 §2.7): twelve mini months with density dots, one roving stop across all twelve grids, a polite detail
37
+ * for the picked day or month. Columns follow the container. Enter opens the day, `M` its month, `T` today.
38
+ */
39
+ export function YearView(p: YearViewProps) {
40
+ const props = untrack(() => p)
41
+ const data = yearData(props)
42
+ const nav = yearNavigation(props, data)
43
+ const { id, env, focus, year } = data
44
+ const { go } = nav
45
+ const detail = yearDetail(props, data, nav.long)
46
+ return (
47
+ <section
48
+ data-scope="year"
49
+ aria-label={p.label}
50
+ aria-labelledby={p.label ? undefined : `${id}-t`}
51
+ >
52
+ <div data-part="toolbar">
53
+ <Button
54
+ emphasis="ghost"
55
+ tone="neutral"
56
+ size="sm"
57
+ icon={LeftIcon}
58
+ label="Previous year"
59
+ direction="back"
60
+ onClick={() => go(addMonths(focus.value, -12), false)}
61
+ />
62
+ <h3 data-part="title" id={`${id}-t`} aria-live="polite">
63
+ {year.value}
64
+ </h3>
65
+ <Button
66
+ emphasis="ghost"
67
+ tone="neutral"
68
+ size="sm"
69
+ icon={RightIcon}
70
+ label="Next year"
71
+ onClick={() => go(addMonths(focus.value, 12), false)}
72
+ />
73
+ <Button emphasis="outline" tone="neutral" size="sm" onClick={() => go(env.today.value)}>
74
+ Today
75
+ </Button>
76
+ <span data-part="legend" aria-hidden="true">
77
+ <span>
78
+ <i data-part="dots" data-zero=""></i>none
79
+ </span>
80
+ <span>
81
+ <i data-part="dots" style="--_n:1"></i>1–2
82
+ </span>
83
+ <span>
84
+ <i data-part="dots" style="--_n:2"></i>3–4
85
+ </span>
86
+ <span>
87
+ <i data-part="dots" style="--_n:3"></i>5+
88
+ </span>
89
+ </span>
90
+ </div>
91
+ {yearMonthsView(data, nav)}
92
+ <span class="sr" id={`${id}-h`}>
93
+ One stop for the whole year. Arrow keys move by day and week, Home and End to the week's
94
+ ends, Page Up and Page Down by month, with Shift by year. Enter opens the day, M opens its
95
+ month, T goes to today.
96
+ </span>
97
+ {yearDetailView(p, data, detail)}
98
+ </section>
99
+ )
100
+ }
@@ -0,0 +1,65 @@
1
+ // What the schedule pack's components share: sweep parts, glyphs, the clock.
2
+ import { RepeatIcon } from '@kerf-js/veneer-icons'
3
+ import { installSweep, nowIn } from '@kerf-js/veneer-core'
4
+ import { onCleanup, onMount, state, untrack, watch } from '@kerf-js/core'
5
+ import '../styles'
6
+ import '@kerf-js/veneer-core/styles/app/tokens.css'
7
+ import '@kerf-js/veneer-core/styles/app/base.css'
8
+ import '@kerf-js/veneer-core/styles/rich/helpers.css'
9
+
10
+ export const SweepParts = () => (
11
+ <>
12
+ <span data-part="sweep-base" aria-hidden="true"></span>
13
+ <span data-part="sweep" aria-hidden="true"></span>
14
+ </>
15
+ )
16
+
17
+ /** calendar.css and agenda.css default `--_c` on the same element as `data-cal`, so the source's colour is set inline too. */
18
+ export const tint = (cal?: number) => `--_c:var(--veneer-color-data-${cal ?? 1})`
19
+ export const RepeatGlyph = () => <RepeatIcon />
20
+
21
+ /**
22
+ * The wall clock for the now line (07 §2.2): the prop when there is one, else null through hydration and the browser's
23
+ * clock a microtask after mount, then on each minute. It pauses while the page is hidden.
24
+ */
25
+ export function useNow(now: () => string | undefined, zone: () => string | undefined) {
26
+ const value = state<string | null>(untrack(now) ?? null)
27
+ onMount(() => {
28
+ let timer: ReturnType<typeof setTimeout> | undefined
29
+ const tick = () => {
30
+ clearTimeout(timer)
31
+ if (untrack(now) || document.hidden) return
32
+ value.value = nowIn(untrack(zone))
33
+ timer = setTimeout(tick, 60000 - (Date.now() % 60000))
34
+ }
35
+ queueMicrotask(tick)
36
+ document.addEventListener('visibilitychange', tick)
37
+ watch(now, (n) => {
38
+ if (n) value.value = n
39
+ })
40
+ onCleanup(() => {
41
+ clearTimeout(timer)
42
+ document.removeEventListener('visibilitychange', tick)
43
+ })
44
+ })
45
+ return value
46
+ }
47
+
48
+ /** The container's width, 0 until it has been measured after mount. */
49
+ export function useWidth(el: () => Element | undefined) {
50
+ const width = state(0)
51
+ onMount(() => {
52
+ const node = el()
53
+ if (!node || typeof ResizeObserver === 'undefined') return
54
+ const ro = new ResizeObserver((r) => {
55
+ width.value = r[0]!.contentRect.width
56
+ })
57
+ ro.observe(node)
58
+ onCleanup(() => ro.disconnect())
59
+ })
60
+ return width
61
+ }
62
+
63
+ export const confirmSweep = (el: Element | null | undefined) => {
64
+ if (el) installSweep(el.ownerDocument).confirm(el)
65
+ }
@@ -0,0 +1,25 @@
1
+ // The schedule pack (07 §2, §6.4): calendar, agenda, year, booking, planner, availability. One file per family; each imports only its own CSS.
2
+ export {
3
+ Calendar,
4
+ type CalendarProps,
5
+ type EventChange,
6
+ type RecurrenceScope,
7
+ type Resource,
8
+ } from './Calendar'
9
+ export { EventPopover, type EventPopoverProps } from './EventPopover'
10
+ export { EventEditor, type EventEditorProps, type CalendarSource } from './EventEditor'
11
+ export { MoveSheet, type MoveSheetProps } from './MoveSheet'
12
+ export { Agenda, AgendaDay, type AgendaProps } from './Agenda'
13
+ export { YearView, type YearViewProps } from './YearView'
14
+ export {
15
+ BookingCalendar,
16
+ type BookingCalendarProps,
17
+ type BookingSlot,
18
+ type BookingDetails,
19
+ } from './BookingCalendar'
20
+ export { MeetingPlanner, type MeetingPlannerProps, type MeetingDetails } from './MeetingPlanner'
21
+ export {
22
+ AvailabilityEditor,
23
+ type AvailabilityEditorProps,
24
+ type Availability,
25
+ } from './AvailabilityEditor'
@@ -0,0 +1,4 @@
1
+ // veneer's skeleton CSS for a page that uses `<Boundary pending="shape">` without a <Shape> or <Skeleton> (research 31 §5):
2
+ // `import '@kerf-js/veneer/skeleton'` once. A shape variant is core markup, so nothing else pulls the CSS in.
3
+ import './styles'
4
+ import '@kerf-js/veneer-core/styles/components/skeleton.css'
package/src/styles.ts ADDED
@@ -0,0 +1,13 @@
1
+ /// <reference types="@kerf-js/core/client" />
2
+
3
+ // The shared base every veneer component loads first: the spec tokens, base and signature layers (veneer-core/styles/
4
+ // veneer.css), an app's seed and field defaults from veneer() (kerf:tokens/veneer, empty without the plugin), and the
5
+ // components' plumbing (tone channels, icon strokes, kbd, panels), and the skeleton paint. `links.css` is veneer's colour for a bare `<a>`.
6
+ // CSS alone: code here would run as every component's module loads, and keep each island holding one from waiting
7
+ // (hydration.json H010). veneer.flow is the page's, so the app's client entry arms it (`flow()` from @kerf-js/veneer-core).
8
+ import '@kerf-js/veneer-core/styles/veneer.css'
9
+ import 'kerf:tokens/veneer'
10
+ import '@kerf-js/veneer-core/styles/components/base.css'
11
+ import './links.css'
12
+ // Every page can show a skeleton: navigation stands a route's generated shape in while it loads, whatever it imports.
13
+ import '@kerf-js/veneer-core/styles/components/skeleton.css'