docs: add documentation for calendar and date field components#3276
docs: add documentation for calendar and date field components#3276anna-lach wants to merge 1 commit into
Conversation
|
🕸 Website previewYou can view a preview here (commit |
🕸 Storybook previewYou can view a preview here (commit |
There was a problem hiding this comment.
Pull request overview
Adds website documentation and site registration for the new Calendar and Date field form components, and updates a couple of existing component docs to “ready” status.
Changes:
- Register
@sl-design-system/calendarand@sl-design-system/date-fieldin the website component loader. - Add new documentation pages (overview/usage/accessibility/code) and metadata JSON for Calendar and Date field.
- Mark
CalloutandTool bardocumentation status asready.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| website/src/ts/scripts/slds-components.ts | Registers Calendar and Date field so they load on the documentation site. |
| website/src/categories/components/tool-bar/tool-bar.md | Updates Tool bar navigation status to ready. |
| website/src/categories/components/callout/callout.md | Updates Callout navigation status to ready. |
| website/src/categories/components/calendar/calendar.md | Adds Calendar component overview frontmatter page. |
| website/src/categories/components/calendar/usage.md | Adds Calendar usage guidance and behavior documentation. |
| website/src/categories/components/calendar/accessibility.md | Adds Calendar keyboard/ARIA accessibility documentation. |
| website/src/categories/components/calendar/code.md | Adds Calendar code examples and API description mapping. |
| website/src/categories/components/calendar/calendar.json | Adds Calendar component metadata (tag names/selectors, status). |
| website/src/categories/components/date-field/date-field.md | Adds Date field component overview frontmatter page. |
| website/src/categories/components/date-field/usage.md | Adds Date field usage guidance and behavior documentation. |
| website/src/categories/components/date-field/accessibility.md | Adds Date field keyboard/ARIA accessibility documentation. |
| website/src/categories/components/date-field/code.md | Adds Date field code examples and API description mapping. |
| website/src/categories/components/date-field/date-field.json | Adds Date field component metadata (tag name/selector, status). |
| Click a day or focus it with the keyboard and press `Enter` / `Space` to select it. Selecting a date emits an `sl-change` event. | ||
|
|
||
| ### Navigating months and years | ||
| Use the navigation buttons in the header, or use `Page Up` / `Page Down` (and `Shift + Page Up` / `Shift + Page Down`) to move between months and years from the keyboard. |
| |Page Up/Down| Moves focus to the same day in the previous or next month. | | ||
| |Shift + Page Up/Down| Moves focus to the same day in the previous or next year. | | ||
| |Home/End| Moves focus to the first or last day of the current week. | |
| |Page Up/Down (in calendar)| Moves focus to the same day in the previous or next month. | | ||
| |Shift + Page Up/Down (in calendar)| Moves focus to the same day in the previous or next year. | | ||
| |Home/End (in calendar)| Moves focus to the first or last day of the current month. | |
| ### Free Typing (Default) | ||
| Users can type any valid date matching the locale-aware format. The component validates for format, parsability, and the optional `min` / `max` range when the field loses focus. | ||
|
|
| The Calendar may not be the best choice in the following scenarios: | ||
|
|
||
| ### Quick, known date entry | ||
| When users already know the exact date and just need to type it (for example a birth date), prefer the [Date Field](/categories/components/date-field/usage) which combines free typing with a popover calendar. |
This pull request introduces comprehensive documentation and registration for two new form components:
CalendarandDate Field. It adds detailed usage guides, accessibility documentation, code examples, and supporting metadata for both components, as well as registers them within the design system's component loader. Additionally, it updates the status of some existing components to "ready".New Component Documentation and Registration
Calendar Component:
calendar.md), usage guidance (usage.md), accessibility details (accessibility.md), code examples (code.md), and metadata (calendar.json) for theCalendarandMonth viewcomponents. These cover anatomy, states, behaviors, keyboard interactions, WAI-ARIA attributes, and configuration options. [1] [2] [3] [4] [5]Calendarcomponent in the system loader (slds-components.ts).Date Field Component:
date-field.md), usage guidance (usage.md), accessibility details (accessibility.md), code examples (code.md), and metadata (date-field.json) for theDate Fieldcomponent. These include details on anatomy, behaviors, keyboard support, ARIA attributes, select-only mode, and validation. [1] [2] [3] [4] [5]Date Fieldcomponent in the system loader (slds-components.ts).Component Status Updates
Status Changes:
CalloutandTool barcomponents from "new" to "ready" in their respective documentation files, reflecting their production readiness. [1] [2]