Skip to content

docs: add guided documentation for the library - #28

Draft
dogmar wants to merge 1 commit into
mainfrom
claude/guided-library-docs-1gz85r
Draft

docs: add guided documentation for the library#28
dogmar wants to merge 1 commit into
mainfrom
claude/guided-library-docs-1gz85r

Conversation

@dogmar

@dogmar dogmar commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds full guided documentation to the docs site, modeled on Base UI's docs structure. Until now the site had a stub Getting Started page and three API-table-only component pages; this PR adds a proper Overview → Guides → Components narrative around the autogenerated API reference.

New pages (website/content/docs/)

Overview

  • Introduction — what Colander is, its core ideas (headless, Temporal-first, two views, selection model, a11y), an honest comparison with react-day-picker / react-datepicker / MUI X / React Aria, "when not to use it," and the pre-stable/alpha caveat.
  • Quick start — install (incl. Temporal polyfill and peer deps), providing temporal, assembling a complete calendar step-by-step, reading the selection, and a working plain-CSS styling pass.
  • Accessibility — full keyboard interaction table (from keyboard.ts), roving tabindex, grid semantics/labelling, live regions, drag-handle ARIA, localization, and the consumer's responsibilities (focus rings, contrast, hit targets).

Guides

  • Composition — the component tree, template components, MonthView vs CalendarProvider + MonthView.Root, the render prop contract, and building custom parts with the hooks/contexts.
  • Styling — the three styling layers, a complete data-* attribute reference (verified against dayStateAttributesMapping and each component's mapping), plain CSS + Tailwind examples, range overlays, and grid-layout tips (--calendar-days-per-week).
  • Selection modes — single/multiple/range, controlled vs uncontrolled rules, onValueChange meta, the six rangeMode policies, preventRangeReversal, hover preview / previewRange, setRange, drag handles, and date restriction props.
  • Dates & formats — the temporal prop and polyfill options, the format table, format-narrowed subpath entry points, bounds, time zones, locale, and weekStartDay.

Components (rewritten with guided prose; {% api %} tables kept at the bottom)

  • CalendarProvider — when to use it explicitly, what it does/doesn't manage, the stable/state hook split, and a warning about nesting the view wrappers inside it.
  • MonthView — navigation, controlled month, multi-month, fixedWeeks, outsideDays, bounds behavior, week numbers.
  • WeeksView — the window concept vs MonthView, firstWeek specs, scrolling + scrollToWeek snap modes, all five outOfRangeBehavior values, month separators.

Example fixes/additions (website/src/examples/)

  • Fixed basic-calendar.tsx: it wrapped CalendarProvider around MonthView, but MonthView creates its own inner provider — so the outer onValueChange was never wired to the grid. The example now passes props to MonthView directly, adds header navigation, and models the temporal prop as consumers need it.
  • New range-calendar.tsx, multiple-months.tsx, weeks-view-basic.tsx examples referenced by the guides.
  • Landing page "Get Started" CTA now points at /docs/quick-start (old route is pruned automatically).

Verification

  • pnpm ready passes (fmt, lint, 445 package + 54 website tests).
  • pnpm --filter website build succeeds; all 10 doc routes generate.
  • Rendered site verified in a browser via vite preview: sidebar section order (Overview → Guides → Components → API groups), GFM tables, TS/JS example tabs, and API tables all render correctly.

Notes / possible follow-ups

  • {% example %} blocks are code-only today; live rendered previews would be a nice follow-up feature for these guides.
  • website/src/config.ts GITHUB_REPO_URL points at dogmar/colander rather than klink-ing/colander — left untouched here, but worth a look.

🤖 Generated with Claude Code

https://claude.ai/code/session_019HXuPqRT1HnbeqSKMrAhjs


Generated by Claude Code

Replace the stub Getting Started page with a full set of guided docs
modeled on Base UI's documentation structure:

- Overview: Introduction (what/why, comparison with other date
  pickers), Quick start (install → assemble → read value → style),
  and Accessibility (keyboard map, ARIA semantics, localization)
- Guides: Composition (component tree, templates, render prop,
  custom parts), Styling (data-attribute reference, CSS/Tailwind,
  range overlays), Selection modes (single/multiple/range,
  controlled/uncontrolled, rangeMode, previews, drag handles), and
  Dates & formats (temporal prop, format types, subpaths, tz/locale)
- Components: rewrite CalendarProvider, MonthView, and WeeksView
  pages with guided prose and examples ahead of the API tables

Also:
- Fix basic-calendar example: MonthView creates its own provider, so
  the outer CalendarProvider's onValueChange was never wired up; pass
  props to MonthView directly and model the temporal prop
- Add range-calendar, multiple-months, and weeks-view-basic examples
- Point the landing page CTA at /docs/quick-start

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019HXuPqRT1HnbeqSKMrAhjs
@netlify

netlify Bot commented Jul 12, 2026

Copy link
Copy Markdown

Deploy Preview for colander-cal ready!

Name Link
🔨 Latest commit 005d1ce
🔍 Latest deploy log https://app.netlify.com/projects/colander-cal/deploys/6a53f1ad33e6cd0008e63059
😎 Deploy Preview https://deploy-preview-28--colander-cal.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants