@moltenship/calendar 2.0.0-beta.1 → 2.0.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 (75) hide show
  1. package/README.md +11 -10
  2. package/dist/index.d.mts +2 -2
  3. package/dist/index.mjs +2 -2
  4. package/docs/accessibility.md +5 -4
  5. package/docs/agents/changes.md +3 -3
  6. package/docs/agents/coding-agents.md +19 -20
  7. package/docs/agents/connect.md +20 -11
  8. package/docs/agents/deleting.md +2 -2
  9. package/docs/agents/reference.md +5 -6
  10. package/docs/agents/server.md +4 -4
  11. package/docs/agents/webmcp.md +2 -2
  12. package/docs/agents.md +10 -8
  13. package/docs/annotations.md +10 -8
  14. package/docs/api/changes.md +37 -21
  15. package/docs/api/{react.md → components.md} +65 -56
  16. package/docs/api/dnd-kit.md +1 -3
  17. package/docs/api/events.md +14 -13
  18. package/docs/api/primitives.md +61 -11
  19. package/docs/api/store.md +3 -3
  20. package/docs/api.md +23 -23
  21. package/docs/availability.md +25 -22
  22. package/docs/comparison.md +23 -24
  23. package/docs/concepts/anatomy.md +3 -3
  24. package/docs/concepts/events.md +2 -3
  25. package/docs/concepts/how-it-works.md +33 -16
  26. package/docs/concepts/state.md +1 -1
  27. package/docs/concepts/time.md +5 -7
  28. package/docs/customization.md +271 -0
  29. package/docs/frameworks.md +116 -0
  30. package/docs/guides/dnd-kit.md +2 -2
  31. package/docs/guides/google-calendar-sync.md +3 -3
  32. package/docs/guides/google-calendar.md +4 -4
  33. package/docs/guides/motion.md +2 -2
  34. package/docs/guides/nextjs-app-router.md +1 -1
  35. package/docs/guides/nextjs.md +1 -1
  36. package/docs/guides/performance.md +6 -6
  37. package/docs/guides/tanstack-query.md +2 -2
  38. package/docs/{guides/ics.md → ics/feed.md} +7 -9
  39. package/docs/ics/import.md +183 -0
  40. package/docs/{api/ics.md → ics/reference.md} +11 -53
  41. package/docs/ics.md +142 -0
  42. package/docs/index.md +81 -50
  43. package/docs/installation.md +48 -33
  44. package/docs/interactions.md +36 -3
  45. package/docs/llms.txt +81 -68
  46. package/docs/migrating-to-2.md +200 -25
  47. package/docs/quick-start.md +27 -23
  48. package/docs/{guides/recurring-events.md → recurrence/calendar.md} +23 -8
  49. package/docs/{concepts/recurrence.md → recurrence/model.md} +13 -12
  50. package/docs/{api/recurrence.md → recurrence/reference.md} +22 -61
  51. package/docs/recurrence.md +122 -0
  52. package/docs/stylex.md +74 -49
  53. package/docs/temporal/daylight-saving-time.md +172 -0
  54. package/docs/temporal/month-grid.md +119 -0
  55. package/docs/{api/temporal.md → temporal/reference.md} +7 -12
  56. package/docs/temporal.md +105 -0
  57. package/docs/testing.md +20 -1
  58. package/docs/theme-builder.md +9 -8
  59. package/docs/theming.md +108 -2
  60. package/docs/undo-redo.md +24 -16
  61. package/docs/views/agenda.md +14 -13
  62. package/docs/views/custom-views.md +13 -10
  63. package/docs/views/month.md +10 -9
  64. package/docs/views/resource-columns.md +21 -17
  65. package/docs/views/resource-timeline.md +16 -15
  66. package/docs/views/scrolling.md +7 -6
  67. package/docs/views/week-and-day.md +15 -14
  68. package/docs/views/year.md +11 -11
  69. package/docs/views.md +1 -1
  70. package/package.json +7 -6
  71. package/skills/moltenship-time/SKILL.md +7 -5
  72. package/skills/moltenship-time/references/compose.md +13 -6
  73. package/skills/moltenship-time/references/mistakes.md +4 -2
  74. package/skills/moltenship-time/references/solid.md +36 -25
  75. package/docs/api/solid.md +0 -460
@@ -0,0 +1,271 @@
1
+ # Customization
2
+
3
+ How much of the calendar's UI is yours to change, from its tokens to every element on screen, built on the unstyled parts and hooks.
4
+
5
+ Source: https://time.molten.sh/docs/react/customization
6
+
7
+ Time is a headless core and one ready-made UI on top of it.
8
+
9
+ - **The core is the npm packages.** They hold the engine, the calendar's state and actions, and
10
+ parts and hooks that render plain elements. They ship no CSS.
11
+ - **The UI is the registry.** It's a set of React source files built on those packages: the views,
12
+ the toolbar, a kit of controls and a theme, in Tailwind CSS on shadcn/ui's tokens or in
13
+ [StyleX](./stylex.md). `shadcn add` copies them into your app, and from then on
14
+ they are your code.
15
+
16
+ Nothing in the packages depends on the registry. So every part of that UI is yours to change or
17
+ replace, and an app on MUI, Mantine or its own design system uses the same packages without it.
18
+
19
+ There are four levels, from the least work to the most:
20
+
21
+ | Level | You change | Where | What it costs |
22
+ | -------------------- | -------------------------------------------- | ------------------------- | ------------------------------------------------------------------- |
23
+ | 1. Set tokens | Colors, the event palette, sizes | Your global CSS | Nothing |
24
+ | 2. Edit the files | Markup, classes, layout, a view's behaviour | `components/calendar/` | A merge when a file you edited gets an update |
25
+ | 3. Swap the controls | The buttons, tooltips, popovers and the rest | `components/calendar/ui/` | That merge, and an agent sees less of your controls |
26
+ | 4. Build your own UI | Everything on screen | Your own components | You write the views, with their keyboard support and their dragging |
27
+
28
+ [What each level costs](#what-each-level-costs) has the details.
29
+
30
+ The levels mix. One calendar can show the registry's month view, a toolbar you edited and a view
31
+ you wrote.
32
+
33
+ ## Level 1: set tokens
34
+
35
+ The registry's views read their colors and sizes from CSS variables. Override them in your own
36
+ CSS:
37
+
38
+ ```css title="globals.css"
39
+ :root {
40
+ --calendar-today: oklch(0.55 0.17 150);
41
+ --calendar-hour-height: 4rem;
42
+ }
43
+
44
+ .dark {
45
+ --calendar-today: oklch(0.72 0.15 150);
46
+ }
47
+ ```
48
+
49
+ Most calendar tokens derive from the shadcn tokens, so an app with its own shadcn theme gets a
50
+ calendar in its colors before it writes a rule. [Theming](./theming.md) lists every token, and the
51
+ [Theme builder](./theme-builder.md) shows your changes live and gives you the CSS to paste. The
52
+ StyleX items have the same tokens as StyleX variables, which
53
+ [Change the tokens](./stylex.md#change-the-tokens) covers.
54
+
55
+ You keep everything, updates included. `shadcn add` writes the theme's own block again each time,
56
+ and your rules sit outside that block. Tokens change colors, the event palette, the hour height
57
+ and the event padding. They don't change markup or layout.
58
+
59
+ ## Level 2: edit the files you added
60
+
61
+ `shadcn add` puts source files in `components/calendar/`: a folder for each view, the toolbar,
62
+ the view switcher and the event chip beside them, and the controls in `ui/`. Open a file and
63
+ change it. The toolbar's tooltips open after 400 ms, for example. To open them sooner, change the
64
+ default in the tooltip's file:
65
+
66
+ ```ts title="components/calendar/ui/tooltip.styles.ts"
67
+ export const tooltipDefaults = { delay: 150, sideOffset: 4 } as const;
68
+ ```
69
+
70
+ The same goes for a view's markup, the toolbar's layout in `calendar-toolbar.tsx`, and a control's
71
+ classes in its `*.styles.ts` file.
72
+
73
+ ### Updates
74
+
75
+ The files are copies, so a fix in the registry reaches your app when you add the item again:
76
+
77
+ ```bash
78
+ npx shadcn@latest add https://time.molten.sh/r/month-view.json
79
+ ```
80
+
81
+ The command goes through the item's files and the files of the items it builds on. It writes a
82
+ file your app doesn't have, skips a file that matches the registry's, and asks before it replaces
83
+ a file that differs. Answer no to keep yours. `--overwrite` replaces every file without asking,
84
+ with any edits you made.
85
+
86
+ To see what the command would do before it writes anything, add `--dry-run`. It lists each file
87
+ as `create`, `skip (identical)` or `overwrite`, which marks a file that differs. `--diff` with a
88
+ path from that list prints the difference between your file and the registry's, and writes
89
+ nothing either:
90
+
91
+ ```bash
92
+ npx shadcn@latest add https://time.molten.sh/r/month-view.json --dry-run
93
+ npx shadcn@latest add https://time.molten.sh/r/month-view.json \
94
+ --diff components/calendar/month-view/month-view.tsx
95
+ ```
96
+
97
+ The diff compares the two files as they are now, so it shows your edits and the registry's changes
98
+ together. To separate them, commit your work, let `shadcn add` replace the file, and put your edits
99
+ back from `git diff`.
100
+
101
+ You keep the registry's UI and everything it does. You take on that merge for each file you
102
+ edited. Files you didn't touch update without a question.
103
+
104
+ ## Level 3: swap the controls
105
+
106
+ The Tailwind views take their controls from `button.tsx`, `badge.tsx`, `tooltip.tsx`,
107
+ `select.tsx`, `popover.tsx`, `dialog.tsx` and `toast.tsx` in `components/calendar/ui/`: the
108
+ buttons, badges, tooltips, view select, popovers, the recurrence dialog and the undo toast. Since
109
+ 2.0 those controls are built on [ui-sdk](https://ui-sdk.dev), and they are a default. The views import them from
110
+ those files only and use them through a short list of props. To use a control of your own,
111
+ replace the body of its file and keep the names it exports. With shadcn's button:
112
+
113
+ ```tsx title="components/calendar/ui/button.tsx"
114
+ import type { ComponentProps } from "react";
115
+
116
+ import { Button as AppButton, buttonVariants } from "@/components/ui/button";
117
+
118
+ export type ButtonProps = ComponentProps<typeof AppButton>;
119
+
120
+ export function Button(props: ButtonProps) {
121
+ return <AppButton {...props} />;
122
+ }
123
+
124
+ export { buttonVariants };
125
+ ```
126
+
127
+ Every view now renders your button, and no view's file changes.
128
+ [Use your own controls](./theming.md#use-your-own-controls) lists what the views import from each
129
+ file and the props they pass, and how to give a shadcn popover the handle that one popover for
130
+ many triggers needs.
131
+
132
+ This is an edit like any other, so `shadcn add` asks before it replaces the file. Swapping also
133
+ has [two costs of its own](#what-each-level-costs).
134
+
135
+ ## Level 4: build your own UI
136
+
137
+ Your app adds nothing from the registry at this level. It installs the packages, writes its own
138
+ markup or uses any library's components, and connects them to the calendar through parts and
139
+ hooks:
140
+
141
+ - **Parts.** `Frame`, `Toolbar`, `Title`, `Viewport` and the previous, next and today triggers
142
+ each render one plain element with a `data-calendar-part` attribute. They take `className`,
143
+ `style`, `ref` and event handlers, and bring no class or style of their own.
144
+ [Components](./api/components.md#components) lists them.
145
+ - **Hooks.** `useCalendarActions()` returns `navigateNext`, `setView`, `proposeEventChange` and
146
+ the other [actions](./api/components.md#actions), for controls of your own.
147
+ `useCalendarSelector` and the other [hooks](./api/components.md#hooks) read the state.
148
+ - **Views.** A [custom view](./views/custom-views.md) is a strategy, which picks the dates and
149
+ the events, and a `Renderer`, which is your component.
150
+
151
+ This calendar uses plain elements and class names from the app's own CSS:
152
+
153
+ ```tsx title="meeting-calendar.tsx"
154
+ // The strategy picks the dates and the meetings. The Renderer is your markup.
155
+ const weekView = defineCalendarView({
156
+ name: "week",
157
+ strategy: {
158
+ getRange: (anchor) => plainDateInterval(anchor, anchor.add({ days: 7 })),
159
+ navigate: (anchor, delta) => anchor.add({ weeks: delta }),
160
+ getTitle: (range, { locale }) => range.start.toLocaleString(locale, { dateStyle: "medium" }),
161
+ project: ({ snapshot, instantRange }: CalendarViewProjectionInput<undefined, Meeting>) =>
162
+ snapshot.queryTimed(instantRange),
163
+ },
164
+ Renderer: ({ projection, environment }) => (
165
+ <ul className="meeting-list">
166
+ {projection.map(({ event }) => (
167
+ <li key={event.id}>
168
+ <time dateTime={event.start.toString()}>
169
+ {event.start.toLocaleString(environment.locale, {
170
+ dateStyle: "medium",
171
+ timeStyle: "short",
172
+ timeZone: environment.timeZone,
173
+ })}
174
+ </time>{" "}
175
+ {event.title}
176
+ </li>
177
+ ))}
178
+ </ul>
179
+ ),
180
+ });
181
+
182
+ export const Calendar = createCalendar<Meeting>()({ eventAdapter, views: [weekView] });
183
+
184
+ function Toolbar() {
185
+ const { navigateToday } = Calendar.useCalendarActions();
186
+
187
+ return (
188
+ <Calendar.Toolbar className="toolbar">
189
+ {/* A control of your own calls an action. */}
190
+ <button
191
+ className="button"
192
+ type="button"
193
+ onClick={(event) => navigateToday({ event: event.nativeEvent })}
194
+ >
195
+ Today
196
+ </button>
197
+ {/* The calendar's triggers are plain buttons that take your classes. */}
198
+ <Calendar.PreviousTrigger className="button">Previous</Calendar.PreviousTrigger>
199
+ <Calendar.NextTrigger className="button">Next</Calendar.NextTrigger>
200
+ <Calendar.Title className="title" />
201
+ </Calendar.Toolbar>
202
+ );
203
+ }
204
+
205
+ export function MeetingCalendar({ meetings }: { readonly meetings: readonly Meeting[] }) {
206
+ return (
207
+ <Calendar.Root
208
+ events={meetings}
209
+ defaultAnchorDate={Temporal.PlainDate.from("2026-10-05")}
210
+ defaultTimeZone="Europe/Berlin"
211
+ label="Team meetings"
212
+ locale="en-US"
213
+ weekRules={{ firstDay: 1, minimalDays: 4, weekend: [6, 7] }}
214
+ >
215
+ <Calendar.Frame className="calendar">
216
+ <Toolbar />
217
+ <Calendar.Viewport>
218
+ <Calendar.ActiveView />
219
+ </Calendar.Viewport>
220
+ </Calendar.Frame>
221
+ </Calendar.Root>
222
+ );
223
+ }
224
+ ```
225
+
226
+ A library's components go where the plain elements are. The Today button can be your library's
227
+ `Button` with the same `onClick`. Pass the click's native event as `event`, so a
228
+ [state handler](./concepts/state.md#what-a-handler-hears) hears how the person caused the
229
+ change. A button that can render another element in its place can render one of the
230
+ calendar's triggers instead, as the registry's toolbar does with
231
+ `<Button render={<TodayTrigger aria-label="Today" />}>`.
232
+
233
+ `@ui-sdk/core` and `@ui-sdk/react` are peer dependencies since 2.0. The calendar's state, its actions and what an agent reads are written on ui-sdk, and ui-sdk's
234
+ parts are unstyled too. Installing them adds no look to your page and doesn't decide which
235
+ components you use.
236
+
237
+ You keep the engine, the state, [saving changes](./interactions.md#saving-changes) with policies
238
+ and pending state, and the actions an agent calls: an [agent bridge](./agents/connect.md) lists a
239
+ calendar that renders `Frame`, whatever draws its views. You write the rest:
240
+
241
+ - **The views.** The registry's views get their layouts from functions the packages export, such
242
+ as `projectMonth` and `projectList`. Your view's `project` can call the same ones, and your
243
+ `Renderer` draws the result.
244
+ - **Dragging.** [`useCalendarPointer`](./interactions.md#in-your-own-views) turns drags in your
245
+ markup into changes, from a few `data-*` attributes.
246
+ - **Keyboard support and announcements.**
247
+ [In your own views](./accessibility.md#in-your-own-views) has the hooks, and
248
+ `Calendar.Announcer` speaks the changes.
249
+
250
+ A Solid app can start at any level: the Solid registry has every view, and the
251
+ [Solid quick start](https://time.molten.sh/docs/solid/quick-start.md) builds a calendar at this one.
252
+
253
+ ## What each level costs
254
+
255
+ - **An edited file takes a merge.** From level 2 on, `shadcn add` no longer updates a file you
256
+ changed without asking. You bring the registry's fixes into that file yourself, as
257
+ [Updates](#updates) describes.
258
+ - **An agent sees less of a control that isn't built on ui-sdk.** An
259
+ [agent bridge](./agents/connect.md) lists ui-sdk's components. The kit's buttons and view
260
+ select are entries in that list. A control of your own is there only as far as your component
261
+ tells the bridge, and a control from a library that isn't built on ui-sdk, such as stock shadcn
262
+ or MUI, tells it nothing. The calendar stays on the bridge at every level, so an agent still
263
+ navigates and changes the view with the calendar's own actions.
264
+ - **A React control needs a Solid twin.** ui-sdk has the same components in React and Solid, so a
265
+ control built on it behaves alike in both. A control built on a React library exists in React
266
+ only, so a Solid app needs its own version of it. The Solid registry's views use its own
267
+ kit, so that matters only for a control of yours.
268
+ - **At level 4, the views are yours to write and test.** That includes laying out overlapping
269
+ events, keyboard navigation, dragging and screen reader announcements. The packages give you the
270
+ functions and hooks for each, and the registry's views are source you can read while you write
271
+ yours.
@@ -0,0 +1,116 @@
1
+ # React and Solid
2
+
3
+ What the React and SolidJS 2 integrations share, what each one has, and what Solid doesn't have.
4
+
5
+ Source: https://time.molten.sh/docs/react/frameworks
6
+
7
+ Time's engine is in packages that import no UI framework. An integration package renders it in
8
+ one framework. There are two integrations, and each has its own docs: the select at the top of the
9
+ sidebar switches between them and keeps you on the same page where both have it. React's
10
+ integration and SolidJS 2's have the same parts and hooks, and the registry has every view for
11
+ both, in StyleX for React alone.
12
+
13
+ ## The layers
14
+
15
+ ```text
16
+ views React or Solid source from the registry, or components you write
17
+ integration @moltenship/calendar (React) @moltenship/calendar-solid (Solid)
18
+ calendar @moltenship/calendar-primitives state, actions, what an agent can call
19
+ engine @moltenship/calendar-core events, time zones, layout, changes, policies
20
+ @moltenship/calendar-temporal
21
+ ```
22
+
23
+ The engine and the calendar layer import neither React nor Solid. Each integration is a thin
24
+ package over them. It renders the parts and binds state to its framework's reactivity. The React
25
+ and Solid integrations don't import each other.
26
+
27
+ The calendar layer also holds the logic for keyboard navigation, roving focus, gesture drafts and
28
+ undo history, and `@moltenship/calendar-dnd`, the pointer layer, imports no framework. Both
29
+ integrations bind all of them, so a key or a drag does the same thing in both.
30
+
31
+ ## What is the same
32
+
33
+ These work the same in both frameworks, because they run below the integration:
34
+
35
+ | Topic | What both frameworks share | Read |
36
+ | ----------------- | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
37
+ | Events | `defineEventAdapter`, validation, snapshots and queries | [Events and adapters](./concepts/events.md) |
38
+ | Time | `Temporal` values, timed, all-day and floating events, time zones and daylight saving time | [Time and time zones](./concepts/time.md) |
39
+ | State | The six state values, controlled and uncontrolled props, change handlers, and `createCalendarStore` | [State](./concepts/state.md) |
40
+ | Recurrence | `@moltenship/calendar-recurrence` turns series into ordinary events before the calendar sees them | [Series and occurrences](./recurrence/model.md) |
41
+ | Changes | Proposals, `onEventChange`, `onEventChangeResult`, policies and pending changes | [Interactions](./interactions.md#saving-changes) |
42
+ | Undo history | `createEventHistory` records results, and `useCalendarHistory` takes them back | [Undo and redo](./undo-redo.md) |
43
+ | Keyboard | The keys, roving focus and keyboard move, resize and create, through `useCalendarKeyboard` | [Keyboard](./accessibility.md#keyboard) |
44
+ | Pointer gestures | Drag, resize and create with a mouse, a pen or touch, through `useCalendarPointer` | [Pointer layer](./api/changes.md#pointer-layer) |
45
+ | Announcements | `Announcer` and the messages a screen reader hears | [Announcements](./accessibility.md#announcements) |
46
+ | Agents | The actions an agent can call, with the same names, inputs, results and errors | [Agents in your app](./agents.md) |
47
+ | `Root` | Its props have the same names, types and defaults | [`Root`](./api/components.md#root) |
48
+ | A view's strategy | `getRange`, `navigate`, `getTitle` and `project`, and the engine's projections, such as `projectMonth` | [Custom views](./views/custom-views.md#strategy) |
49
+ | CSS hooks | Each part renders the same `data-calendar-part` attribute, so a selector written for one matches the other | [Components](./api/components.md#components) |
50
+
51
+ ## What differs
52
+
53
+ | | React | Solid |
54
+ | ----------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
55
+ | Framework version | React 19 | SolidJS 2.0 |
56
+ | Packages you install | `@moltenship/calendar`, `@ui-sdk/core`, `@ui-sdk/react` | `@moltenship/calendar-solid`, `@ui-sdk/core`, `@ui-sdk/solid` |
57
+ | Parts | `Root`, the structural parts, `Event` and `Announcer` | The same parts |
58
+ | Hooks | Every hook, returning values | The same hooks: accessors for state, refs from `useCalendarKeyboard` and `useCalendarPointer` |
59
+ | Ready-made views | The registry's views, in shadcn/ui with Tailwind CSS or in StyleX | The registry's views, in Tailwind CSS; none in StyleX |
60
+ | Keyboard navigation in a view | Yes | Yes |
61
+ | Drag, resize and create | Yes, with a mouse, a pen or touch | Yes, with a mouse, a pen or touch |
62
+ | Undo and redo | `useCalendarHistory`, its shortcuts and the registry's toast | The same, with the registry's toast |
63
+ | Screen reader announcements | `Calendar.Announcer` | `Calendar.Announcer` |
64
+ | Server rendering | Yes | Yes, with `renderToString` and `hydrate` |
65
+ | Testing package | `@moltenship/calendar-testing` | None. That package has React as a peer dependency |
66
+ | Agent bridge | `@ui-sdk/react/agent` | `@ui-sdk/solid/agent` |
67
+
68
+ ## What Solid doesn't have
69
+
70
+ | Missing | In React it's |
71
+ | ----------------- | -------------------------------------------------------------------- |
72
+ | StyleX views | The registry's `stylex-` items, which are React source |
73
+ | A testing package | `@moltenship/calendar-testing`, which is React only |
74
+ | A dnd-kit adapter | `@moltenship/calendar-dnd-kit`, which has React as a peer dependency |
75
+
76
+ The registry's Solid items install with the same `shadcn add` command as React's, from the Solid
77
+ registry, and `calendar-full` installs all of them. [Issue #279](https://github.com/Moltenship/time/issues/279)
78
+ tracked the steps. StyleX views for Solid are out of scope for 2.0, and the testing package and
79
+ the dnd-kit adapter have no Solid plan yet.
80
+
81
+ For a view the registry doesn't have, you write its `Renderer` with the package's hooks, as
82
+ [Custom views](https://time.molten.sh/docs/solid/views/custom-views.md) does. The
83
+ [Solid demo](https://moltenship-time-demo.vercel.app/solid/) is the React demo's app in Solid, on
84
+ the registry's views, with keyboard navigation, dragging and undo. Its source is the repository's
85
+ [`apps/demo-solid`](https://github.com/Moltenship/time/tree/main/apps/demo-solid).
86
+
87
+ The Solid docs have no page on something Solid lacks, so they have none on StyleX, testing or the
88
+ dnd-kit adapter.
89
+
90
+ ## From React to Solid
91
+
92
+ The same calendar reads differently in the two frameworks in these places:
93
+
94
+ | In React | In Solid |
95
+ | -------------------------------------------- | ------------------------------------------------------------------------------------------------- |
96
+ | Hooks return values | Hooks that read state return accessors: `state().view`, not `state.view` |
97
+ | `useCalendar()` returns plain objects | `meta` and `state` are getters. Read them in JSX, a memo or an effect, and don't destructure them |
98
+ | A `Renderer` gets props you can destructure | A `Renderer`'s props are getters: `props.projection`, read where it's used |
99
+ | `meta.refs` holds React refs | `meta.refs` holds accessors: `meta().refs.viewport()` |
100
+ | `useCalendarKeyboard()` returns handlers | It returns a ref, which binds `keydown` and `focusout` on the element itself |
101
+ | A cell's `onKeyDown` runs before the view's | It runs after, since Solid delegates it. Listen natively from a ref to take a key first |
102
+ | `useRovingFocus` listens for `focusin` | It listens for `focus`, so a focus handler of yours hears `"focus"` |
103
+ | `Calendar.Event`'s children get a value | They get an accessor, and stay rendered while the event changes |
104
+ | A state change is visible on the next render | An accessor has the new value once Solid flushes: a microtask later, or after `flush()` |
105
+ | `@moltenship/calendar` is the one package | `@moltenship/calendar-solid` is the one package too: it re-exports the engine |
106
+ | The bridge is `@ui-sdk/react/agent` | The bridge is `@ui-sdk/solid/agent` |
107
+
108
+ The state model, controlled and uncontrolled props, change handlers, `onEventChange` and
109
+ `onEventChangeResult`, policies, pending changes and every agent action are the same.
110
+
111
+ ## Other frameworks
112
+
113
+ Time has no integration for Vue, Svelte, Angular or any framework other than these two. You'd write
114
+ one on `@moltenship/calendar-primitives`, and its API can still change.
115
+
116
+ See [Primitives](./api/primitives.md).
@@ -2,9 +2,9 @@
2
2
 
3
3
  Drag a backlog of your own into the calendar, and meetings back out, with dnd-kit and @moltenship/calendar-dnd-kit.
4
4
 
5
- Source: https://time.molten.sh/docs/guides/dnd-kit
5
+ Source: https://time.molten.sh/docs/react/guides/dnd-kit
6
6
 
7
- > Live example: see it at https://time.molten.sh/docs/guides/dnd-kit
7
+ > Live example: see it at https://time.molten.sh/docs/react/guides/dnd-kit
8
8
 
9
9
  Drag a task from the backlog onto the week: the week shows the slots it would take, from the slot
10
10
  under the pointer, and it becomes a meeting there when you let go. Drag a meeting onto the backlog
@@ -2,9 +2,9 @@
2
2
 
3
3
  Load a Google calendar from the dates on screen, keep it current with sync tokens, and write changes back with etags.
4
4
 
5
- Source: https://time.molten.sh/docs/guides/google-calendar-sync
5
+ Source: https://time.molten.sh/docs/react/guides/google-calendar-sync
6
6
 
7
- > Live example: see it at https://time.molten.sh/docs/guides/google-calendar-sync
7
+ > Live example: see it at https://time.molten.sh/docs/react/guides/google-calendar-sync
8
8
 
9
9
  This calendar syncs with a Google calendar. There are no Google credentials on this page, so it
10
10
  talks to a fake Calendar API that runs in your browser. It answers with API v3's JSON, pages, sync
@@ -515,7 +515,7 @@ grid would keep its `date` beside the new `dateTime`.
515
515
  but not the series' rule.
516
516
  - **Masters**, the default. Each series comes once, with its rule in `recurrence`, plus the
517
517
  occurrences that changed or were cancelled. `@moltenship/calendar-recurrence` expands them for the
518
- dates on screen, as [Show and edit recurring events](./recurring-events.md) does.
518
+ dates on screen, as [Show and edit recurring events](../recurrence/calendar.md) does.
519
519
 
520
520
  This guide loads masters:
521
521
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Read recurring events from the Google Calendar API, with their RRULE, EXDATE and RDATE lines, and show and edit them.
4
4
 
5
- Source: https://time.molten.sh/docs/guides/google-calendar
5
+ Source: https://time.molten.sh/docs/react/guides/google-calendar
6
6
 
7
7
  The Google Calendar API stores a repeating event the way iCalendar does. `events.list`, without
8
8
  `singleEvents=true`, returns each series once:
@@ -40,8 +40,8 @@ The Google Calendar API stores a repeating event the way iCalendar does. `events
40
40
  ```
41
41
 
42
42
  That's a master, overrides and cancelled overrides, as in
43
- [Recurring events](../concepts/recurrence.md). This page maps them to `RecurringCalendarEvent`s,
44
- which the calendar from [Show and edit recurring events](./recurring-events.md) expands and
43
+ [Recurring events](../recurrence/model.md). This page maps them to `RecurringCalendarEvent`s,
44
+ which the calendar from [Show and edit recurring events](../recurrence/calendar.md) expands and
45
45
  edits. Here, the stand-up shows on Monday at 09:00, Tuesday at 11:00 and Friday at 09:00.
46
46
 
47
47
  With `singleEvents=true`, Google expands series itself, between `timeMin` and `timeMax`, and
@@ -287,7 +287,7 @@ function instantOf(dateTime: string, timeZone: string | undefined): Temporal.Ins
287
287
  override only hides its occurrence and never shows, so its length doesn't matter.
288
288
 
289
289
  Give the events to the calendar with the canonical adapters, as the
290
- [guide](./recurring-events.md#wire-the-adapters) does:
290
+ [guide](../recurrence/calendar.md#wire-the-adapters) does:
291
291
 
292
292
  ```ts
293
293
  import {
@@ -2,9 +2,9 @@
2
2
 
3
3
  Grow a clicked meeting into its card and let a card follow each drag, with Motion and the calendar's own hooks.
4
4
 
5
- Source: https://time.molten.sh/docs/guides/motion
5
+ Source: https://time.molten.sh/docs/react/guides/motion
6
6
 
7
- > Live example: see it at https://time.molten.sh/docs/guides/motion
7
+ > Live example: see it at https://time.molten.sh/docs/react/guides/motion
8
8
 
9
9
  Click a meeting: its chip grows into a card, and its title flies into the card's heading. Close
10
10
  the card and it shrinks back into the meeting. Drag a meeting: a copy of it trails the pointer on a
@@ -2,7 +2,7 @@
2
2
 
3
3
  A calendar whose view and date live in the URL, loaded by a Server Component and saved through Server Actions.
4
4
 
5
- Source: https://time.molten.sh/docs/guides/nextjs-app-router
5
+ Source: https://time.molten.sh/docs/react/guides/nextjs-app-router
6
6
 
7
7
  [Next.js and server rendering](./nextjs.md) covers the basics: Client Components, strings
8
8
  instead of Temporal values, and `now` and the time zone from the server. This page walks through a
@@ -2,7 +2,7 @@
2
2
 
3
3
  Fetch events in a Server Component and render the same calendar on the server and in the browser.
4
4
 
5
- Source: https://time.molten.sh/docs/guides/nextjs
5
+ Source: https://time.molten.sh/docs/react/guides/nextjs
6
6
 
7
7
  Time works with any React 19 framework that renders on the server. This guide uses the Next.js App
8
8
  Router. The same rules apply elsewhere.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Where Time does its work, and how to keep that work small.
4
4
 
5
- Source: https://time.molten.sh/docs/guides/performance
5
+ Source: https://time.molten.sh/docs/react/guides/performance
6
6
 
7
7
  Time does its work in two steps, and caches each one:
8
8
 
@@ -17,8 +17,7 @@ Everything else is a normal React render. These habits keep both steps rare and
17
17
  ## Replace records, don't mutate them
18
18
 
19
19
  `Root` compares `events` item by item. A new array with the same record objects in the same order
20
- counts as unchanged, so you can filter or map inline, as in
21
- `events={meetings.filter((meeting) => !meeting.cancelled)}`.
20
+ counts as unchanged, so you can filter or map inline, as in `events={meetings.filter((meeting) => !meeting.cancelled)}`.
22
21
 
23
22
  When the array changes, Time reads every record through the adapter again, except those with an
24
23
  unchanged [revision](#add-a-revision-to-your-adapter); if every record comes out the same, in the
@@ -48,8 +47,7 @@ time.
48
47
 
49
48
  ## Do the heavy work in project
50
49
 
51
- A view's `project` runs only when its inputs change, while its `Renderer` re-renders like any
52
- component. Put filtering, sorting, and layout in `project`, and keep the Renderer to drawing.
50
+ A view's `project` runs only when its inputs change, while its `Renderer` re-renders like any component. Put filtering, sorting, and layout in `project`, and keep the Renderer to drawing.
53
51
 
54
52
  Inside `project`, ask the snapshot for the visible range instead of looping over every event:
55
53
 
@@ -66,7 +64,9 @@ array.
66
64
  `Root` compares `locale`, `weekRules`, `now` and a controlled `anchorDate`, `timeZone` or `view` by
67
65
  value, and each view's options key by key, so an inline options object is fine. Its values are
68
66
  compared by identity, though: a new function or nested object, such as a time grid's `annotations`,
69
- is a new value. A `getEventColor` written inline in `viewOptions` makes the view project again on
67
+ is a new value.
68
+
69
+ A `getEventColor` written inline in `viewOptions` makes the view project again on
70
70
  every render of the component that renders `Root`. Define it once instead:
71
71
 
72
72
  ```tsx
@@ -2,9 +2,9 @@
2
2
 
3
3
  Fetch the dates the calendar shows with useQuery, and save its changes with useMutation and optimistic updates.
4
4
 
5
- Source: https://time.molten.sh/docs/guides/tanstack-query
5
+ Source: https://time.molten.sh/docs/react/guides/tanstack-query
6
6
 
7
- > Live example: see it at https://time.molten.sh/docs/guides/tanstack-query
7
+ > Live example: see it at https://time.molten.sh/docs/react/guides/tanstack-query
8
8
 
9
9
  These events come from a pretend server that takes 0.7 seconds to answer. Go to another week or
10
10
  month and the calendar keeps its events on screen while the next ones load. Drag an event and it
@@ -2,9 +2,9 @@
2
2
 
3
3
  Parse a Google, Outlook or iCloud feed on the server and show its events in the calendar.
4
4
 
5
- Source: https://time.molten.sh/docs/guides/ics
5
+ Source: https://time.molten.sh/docs/react/ics/feed
6
6
 
7
- > Live example: see it at https://time.molten.sh/docs/guides/ics
7
+ > Live example: see it at https://time.molten.sh/docs/react/ics/feed
8
8
 
9
9
  These events come from an ICS feed, the iCalendar text that Google Calendar, Outlook and iCloud
10
10
  publish. The feed was written for this week, parsed in your browser with `@moltenship/ics`, and
@@ -12,7 +12,7 @@ shown in your time zone. Each title says where its time came from: a New York ti
12
12
  zone name, UTC, a date, or a floating time with no zone at all. Open the source to compare.
13
13
 
14
14
  This guide does the same in a Next.js app: the server fetches and parses the feed, and the browser
15
- shows it. The [Next.js guide](./nextjs.md) covers the rules for server rendering that apply
15
+ shows it. The [Next.js guide](../guides/nextjs.md) covers the rules for server rendering that apply
16
16
  here too.
17
17
 
18
18
  ## Install
@@ -20,8 +20,6 @@ here too.
20
20
  The parser is a separate package. It reads iCalendar text into Temporal values and doesn't depend
21
21
  on the calendar, so it works on its own too.
22
22
 
23
- Like the calendar, `@moltenship/ics` is on npm as a release candidate for 1.0.0.
24
-
25
23
  **pnpm**
26
24
 
27
25
  ```bash
@@ -314,7 +312,7 @@ export function toFeedEvents(
314
312
  - **A recurring event once,** at its DTSTART, which is the first occurrence.
315
313
  - **A changed occurrence as its own event,** at its new time.
316
314
 
317
- [`@moltenship/calendar-recurrence`](../api/recurrence.md) expands them. `recurringEventsFromIcs`
315
+ [`@moltenship/calendar-recurrence`](../recurrence/reference.md) expands them. `recurringEventsFromIcs`
318
316
  groups a calendar's events into series masters, overrides and one-off events, and an expander turns
319
317
  them into the occurrences for the dates on screen. Those dates are known in the browser, so the
320
318
  server sends the feed's text, a string, instead of mapped events. In the page above, have the
@@ -434,7 +432,7 @@ export function RecurringFeedCalendar({ text, now, timeZone }: RecurringFeedCale
434
432
 
435
433
  To expand on the server instead, call the expander there for a range you choose, and map each
436
434
  occurrence's `interval` to JSON as `toFeedEvent` maps an event's times. The calendar then shows only
437
- that range. [Show and edit recurring events](./recurring-events.md) covers expansion in
435
+ that range. [Show and edit recurring events](../recurrence/calendar.md) covers expansion in
438
436
  more detail.
439
437
 
440
438
  ## Time zones
@@ -454,7 +452,7 @@ const { calendars, issues } = parseIcs(text, {
454
452
  });
455
453
  ```
456
454
 
457
- The [API reference](../api/ics.md) lists every rule, in order.
455
+ The [API reference](./reference.md) lists every rule, in order.
458
456
 
459
457
  ## Issues
460
458
 
@@ -482,5 +480,5 @@ function readUpload(text: string) {
482
480
  ```
483
481
 
484
482
  A parser from `createIcsParser` is also a [Standard Schema](https://standardschema.dev), so a form
485
- or router library that takes one can validate the upload. The [API reference](../api/ics.md) covers
483
+ or router library that takes one can validate the upload. The [API reference](./reference.md) covers
486
484
  both.