@commercetools/nimbus-mcp 0.1.0 → 2.10.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.
- package/README.md +63 -14
- package/data/docs/route-manifest.json +10913 -0
- package/data/docs/routes/components-accessibility-visually-hidden.json +388 -0
- package/data/docs/routes/components-accessibility.json +34 -0
- package/data/docs/routes/components-buttons-button.json +715 -0
- package/data/docs/routes/components-buttons-icon-button.json +852 -0
- package/data/docs/routes/components-buttons-icon-toggle-button.json +594 -0
- package/data/docs/routes/components-buttons-split-button.json +670 -0
- package/data/docs/routes/components-buttons-toggle-button-group.json +722 -0
- package/data/docs/routes/components-buttons-toggle-button.json +689 -0
- package/data/docs/routes/components-buttons.json +36 -0
- package/data/docs/routes/components-data-display-badge.json +555 -0
- package/data/docs/routes/components-data-display-card.json +338 -0
- package/data/docs/routes/components-data-display-data-table.json +855 -0
- package/data/docs/routes/components-data-display-draggable-list.json +596 -0
- package/data/docs/routes/components-data-display-table.json +472 -0
- package/data/docs/routes/components-data-display-tag-group.json +535 -0
- package/data/docs/routes/components-data-display.json +34 -0
- package/data/docs/routes/components-feedback-alert.json +696 -0
- package/data/docs/routes/components-feedback-dialog.json +682 -0
- package/data/docs/routes/components-feedback-drawer.json +600 -0
- package/data/docs/routes/components-feedback-loading-spinner.json +415 -0
- package/data/docs/routes/components-feedback-progress-bar.json +661 -0
- package/data/docs/routes/components-feedback-toast.json +1040 -0
- package/data/docs/routes/components-feedback-tooltip.json +510 -0
- package/data/docs/routes/components-feedback.json +34 -0
- package/data/docs/routes/components-forms-field-errors.json +557 -0
- package/data/docs/routes/components-forms-form-field.json +848 -0
- package/data/docs/routes/components-forms-group.json +427 -0
- package/data/docs/routes/components-forms-localized-field.json +770 -0
- package/data/docs/routes/components-forms.json +37 -0
- package/data/docs/routes/components-inputs-calendar.json +611 -0
- package/data/docs/routes/components-inputs-checkbox.json +774 -0
- package/data/docs/routes/components-inputs-combo-box.json +761 -0
- package/data/docs/routes/components-inputs-date-input.json +628 -0
- package/data/docs/routes/components-inputs-date-picker.json +709 -0
- package/data/docs/routes/components-inputs-date-range-picker.json +599 -0
- package/data/docs/routes/components-inputs-money-input.json +721 -0
- package/data/docs/routes/components-inputs-multiline-text-input.json +611 -0
- package/data/docs/routes/components-inputs-number-input.json +647 -0
- package/data/docs/routes/components-inputs-password-input.json +576 -0
- package/data/docs/routes/components-inputs-radio-input.json +583 -0
- package/data/docs/routes/components-inputs-range-calendar.json +607 -0
- package/data/docs/routes/components-inputs-rich-text-input.json +599 -0
- package/data/docs/routes/components-inputs-scoped-search-input.json +570 -0
- package/data/docs/routes/components-inputs-search-input.json +588 -0
- package/data/docs/routes/components-inputs-select-input.json +960 -0
- package/data/docs/routes/components-inputs-switch.json +720 -0
- package/data/docs/routes/components-inputs-text-input.json +566 -0
- package/data/docs/routes/components-inputs-time-input.json +775 -0
- package/data/docs/routes/components-inputs.json +34 -0
- package/data/docs/routes/components-layout-box.json +501 -0
- package/data/docs/routes/components-layout-defaultpage.json +748 -0
- package/data/docs/routes/components-layout-flex.json +587 -0
- package/data/docs/routes/components-layout-grid.json +393 -0
- package/data/docs/routes/components-layout-modalpage.json +716 -0
- package/data/docs/routes/components-layout-pagecontent.json +673 -0
- package/data/docs/routes/components-layout-separator.json +461 -0
- package/data/docs/routes/components-layout-simple-grid.json +519 -0
- package/data/docs/routes/components-layout-spacer.json +573 -0
- package/data/docs/routes/components-layout-stack.json +481 -0
- package/data/docs/routes/components-layout.json +34 -0
- package/data/docs/routes/components-media-avatar.json +427 -0
- package/data/docs/routes/components-media-icon.json +663 -0
- package/data/docs/routes/components-media-image.json +511 -0
- package/data/docs/routes/components-media-inline-svg.json +586 -0
- package/data/docs/routes/components-media.json +34 -0
- package/data/docs/routes/components-navigation-accordion.json +643 -0
- package/data/docs/routes/components-navigation-collapsible-motion.json +628 -0
- package/data/docs/routes/components-navigation-link.json +554 -0
- package/data/docs/routes/components-navigation-menu.json +546 -0
- package/data/docs/routes/components-navigation-pagination.json +502 -0
- package/data/docs/routes/components-navigation-steps.json +629 -0
- package/data/docs/routes/components-navigation-tabnav.json +546 -0
- package/data/docs/routes/components-navigation-tabs.json +635 -0
- package/data/docs/routes/components-navigation-toolbar.json +549 -0
- package/data/docs/routes/components-navigation.json +34 -0
- package/data/docs/routes/components-typography-code.json +39 -0
- package/data/docs/routes/components-typography-heading.json +402 -0
- package/data/docs/routes/components-typography-kbd.json +399 -0
- package/data/docs/routes/components-typography-list.json +593 -0
- package/data/docs/routes/components-typography-text.json +444 -0
- package/data/docs/routes/components-typography.json +34 -0
- package/data/docs/routes/components-utilities-nimbus-i18n-provider.json +295 -0
- package/data/docs/routes/components-utilities-nimbus-provider.json +663 -0
- package/data/docs/routes/components-utilities.json +34 -0
- package/data/docs/routes/components.json +33 -0
- package/data/docs/routes/home-contribute-adrs-adr0001-consumer-component-apis.json +314 -0
- package/data/docs/routes/home-contribute-adrs-adr0002-compound-component-extraction.json +160 -0
- package/data/docs/routes/home-contribute-adrs-adr0003-component-lifecycle-states.json +460 -0
- package/data/docs/routes/home-contribute-adrs.json +205 -0
- package/data/docs/routes/home-contribute-development-setup.json +213 -0
- package/data/docs/routes/home-contribute-stats.json +36 -0
- package/data/docs/routes/home-contribute.json +36 -0
- package/data/docs/routes/home-design-tokens-aspect-ratios.json +36 -0
- package/data/docs/routes/home-design-tokens-borders.json +35 -0
- package/data/docs/routes/home-design-tokens-colors.json +157 -0
- package/data/docs/routes/home-design-tokens-other-animations.json +119 -0
- package/data/docs/routes/home-design-tokens-other-blurs.json +36 -0
- package/data/docs/routes/home-design-tokens-other-breakpoints.json +61 -0
- package/data/docs/routes/home-design-tokens-other-cursors.json +36 -0
- package/data/docs/routes/home-design-tokens-other-z-indices.json +39 -0
- package/data/docs/routes/home-design-tokens-other.json +35 -0
- package/data/docs/routes/home-design-tokens-radii.json +59 -0
- package/data/docs/routes/home-design-tokens-shadows.json +57 -0
- package/data/docs/routes/home-design-tokens-sizes.json +137 -0
- package/data/docs/routes/home-design-tokens-spacing.json +36 -0
- package/data/docs/routes/home-design-tokens-typography.json +184 -0
- package/data/docs/routes/home-design-tokens.json +34 -0
- package/data/docs/routes/home-getting-started-core-concepts.json +301 -0
- package/data/docs/routes/home-getting-started-installation.json +621 -0
- package/data/docs/routes/home-getting-started-mcp-server-overview.json +139 -0
- package/data/docs/routes/home-getting-started-mcp-server-setup.json +316 -0
- package/data/docs/routes/home-getting-started-release-process.json +294 -0
- package/data/docs/routes/home-getting-started-testing-setup.json +296 -0
- package/data/docs/routes/home-playground-markdown.json +638 -0
- package/data/docs/routes/home-playground-toc.json +169 -0
- package/data/docs/routes/home-playground.json +34 -0
- package/data/docs/routes/home-style-props-background.json +236 -0
- package/data/docs/routes/home-style-props-border.json +310 -0
- package/data/docs/routes/home-style-props-display.json +120 -0
- package/data/docs/routes/home-style-props-effects.json +116 -0
- package/data/docs/routes/home-style-props-filters.json +396 -0
- package/data/docs/routes/home-style-props-flex-and-grid.json +496 -0
- package/data/docs/routes/home-style-props-interactivity.json +356 -0
- package/data/docs/routes/home-style-props-layout.json +422 -0
- package/data/docs/routes/home-style-props-list.json +116 -0
- package/data/docs/routes/home-style-props-sizing.json +244 -0
- package/data/docs/routes/home-style-props-spacing.json +228 -0
- package/data/docs/routes/home-style-props-svg.json +96 -0
- package/data/docs/routes/home-style-props-tables.json +116 -0
- package/data/docs/routes/home-style-props-transforms.json +216 -0
- package/data/docs/routes/home-style-props-transitions.json +216 -0
- package/data/docs/routes/home-style-props-typography.json +536 -0
- package/data/docs/routes/home-style-props.json +33 -0
- package/data/docs/routes/home.json +32 -0
- package/data/docs/routes/hooks-usecopytoclipboard.json +76 -0
- package/data/docs/routes/hooks-usehotkeys.json +117 -0
- package/data/docs/routes/hooks.json +33 -0
- package/data/docs/routes/icons.json +32 -0
- package/data/docs/routes/patterns-fields-date-range-picker-field.json +393 -0
- package/data/docs/routes/patterns-fields-money-input-field.json +415 -0
- package/data/docs/routes/patterns-fields-multiline-text-input-field.json +404 -0
- package/data/docs/routes/patterns-fields-number-input-field.json +470 -0
- package/data/docs/routes/patterns-fields-password-input-field.json +319 -0
- package/data/docs/routes/patterns-fields-search-input-field.json +382 -0
- package/data/docs/routes/patterns-fields-text-input-field.json +404 -0
- package/data/docs/routes/patterns-fields.json +78 -0
- package/data/docs/routes/patterns.json +34 -0
- package/data/docs/search-index.json +1 -0
- package/data/docs/types/Accordion.json +12 -0
- package/data/docs/types/AccordionContent.json +286 -0
- package/data/docs/types/AccordionHeader.json +891 -0
- package/data/docs/types/AccordionHeaderRightContent.json +27 -0
- package/data/docs/types/AccordionItem.json +242 -0
- package/data/docs/types/AccordionRoot.json +162 -0
- package/data/docs/types/Alert.json +12 -0
- package/data/docs/types/AlertActions.json +11 -0
- package/data/docs/types/AlertDescription.json +118 -0
- package/data/docs/types/AlertDismissButton.json +937 -0
- package/data/docs/types/AlertRoot.json +42 -0
- package/data/docs/types/AlertTitle.json +118 -0
- package/data/docs/types/Avatar.json +125 -0
- package/data/docs/types/Badge.json +64 -0
- package/data/docs/types/Body.json +67 -0
- package/data/docs/types/Box.json +85 -0
- package/data/docs/types/Button.json +1015 -0
- package/data/docs/types/Calendar.json +565 -0
- package/data/docs/types/Caption.json +67 -0
- package/data/docs/types/Card.json +12 -0
- package/data/docs/types/CardContent.json +27 -0
- package/data/docs/types/CardHeader.json +27 -0
- package/data/docs/types/CardRoot.json +106 -0
- package/data/docs/types/Cell.json +227 -0
- package/data/docs/types/Checkbox.json +897 -0
- package/data/docs/types/Code.json +112 -0
- package/data/docs/types/CollapsibleMotionContent.json +35 -0
- package/data/docs/types/CollapsibleMotionRoot.json +99 -0
- package/data/docs/types/CollapsibleMotionTrigger.json +71 -0
- package/data/docs/types/Column.json +101 -0
- package/data/docs/types/ColumnGroup.json +101 -0
- package/data/docs/types/ColumnHeader.json +193 -0
- package/data/docs/types/ComboBoxListBox.json +751 -0
- package/data/docs/types/ComboBoxOption.json +672 -0
- package/data/docs/types/ComboBoxPopover.json +786 -0
- package/data/docs/types/ComboBoxRoot.json +747 -0
- package/data/docs/types/ComboBoxSection.json +277 -0
- package/data/docs/types/ComboBoxTrigger.json +70 -0
- package/data/docs/types/Content.json +33 -0
- package/data/docs/types/DataTable.json +596 -0
- package/data/docs/types/DataTableBody.json +223 -0
- package/data/docs/types/DataTableFooter.json +27 -0
- package/data/docs/types/DataTableHeader.json +269 -0
- package/data/docs/types/DataTableManager.json +11 -0
- package/data/docs/types/DataTableRoot.json +590 -0
- package/data/docs/types/DataTableTable.json +271 -0
- package/data/docs/types/DateInput.json +792 -0
- package/data/docs/types/DatePicker.json +700 -0
- package/data/docs/types/DateRangePicker.json +936 -0
- package/data/docs/types/DateRangePickerField.json +1047 -0
- package/data/docs/types/DefaultPage.json +12 -0
- package/data/docs/types/DefaultPageActions.json +27 -0
- package/data/docs/types/DefaultPageBackLink.json +213 -0
- package/data/docs/types/DefaultPageContent.json +27 -0
- package/data/docs/types/DefaultPageFooter.json +27 -0
- package/data/docs/types/DefaultPageHeader.json +27 -0
- package/data/docs/types/DefaultPageRoot.json +106 -0
- package/data/docs/types/DefaultPageSubtitle.json +27 -0
- package/data/docs/types/DefaultPageTabNav.json +28 -0
- package/data/docs/types/DefaultPageTitle.json +27 -0
- package/data/docs/types/DialogBody.json +27 -0
- package/data/docs/types/DialogCloseTrigger.json +939 -0
- package/data/docs/types/DialogContent.json +27 -0
- package/data/docs/types/DialogFooter.json +27 -0
- package/data/docs/types/DialogHeader.json +27 -0
- package/data/docs/types/DialogRoot.json +138 -0
- package/data/docs/types/DialogTitle.json +27 -0
- package/data/docs/types/DialogTrigger.json +80 -0
- package/data/docs/types/DraggableList.json +12 -0
- package/data/docs/types/DraggableListField.json +894 -0
- package/data/docs/types/DraggableListItem.json +574 -0
- package/data/docs/types/DraggableListRoot.json +745 -0
- package/data/docs/types/Drawer.json +12 -0
- package/data/docs/types/DrawerBody.json +27 -0
- package/data/docs/types/DrawerCloseTrigger.json +939 -0
- package/data/docs/types/DrawerContent.json +27 -0
- package/data/docs/types/DrawerFooter.json +27 -0
- package/data/docs/types/DrawerHeader.json +27 -0
- package/data/docs/types/DrawerRoot.json +142 -0
- package/data/docs/types/DrawerTitle.json +27 -0
- package/data/docs/types/DrawerTrigger.json +80 -0
- package/data/docs/types/FieldErrors.getBuiltInMessage.json +11 -0
- package/data/docs/types/FieldErrors.getCustomMessage.json +9 -0
- package/data/docs/types/FieldErrors.json +109 -0
- package/data/docs/types/Flex.json +238 -0
- package/data/docs/types/Footer.json +67 -0
- package/data/docs/types/FormFieldDescription.json +11 -0
- package/data/docs/types/FormFieldError.json +11 -0
- package/data/docs/types/FormFieldInfoBox.json +27 -0
- package/data/docs/types/FormFieldInput.json +11 -0
- package/data/docs/types/FormFieldLabel.json +11 -0
- package/data/docs/types/FormFieldRoot.json +148 -0
- package/data/docs/types/Grid.json +253 -0
- package/data/docs/types/GridProps.json +11 -0
- package/data/docs/types/Group.json +143 -0
- package/data/docs/types/Header.json +67 -0
- package/data/docs/types/Heading.json +109 -0
- package/data/docs/types/Icon.json +112 -0
- package/data/docs/types/IconButton.json +1019 -0
- package/data/docs/types/IconToggleButton.json +787 -0
- package/data/docs/types/Image.json +373 -0
- package/data/docs/types/Indicator.json +67 -0
- package/data/docs/types/InlineSvg.json +98 -0
- package/data/docs/types/Item.json +67 -0
- package/data/docs/types/Kbd.json +118 -0
- package/data/docs/types/Link.json +380 -0
- package/data/docs/types/List.json +12 -0
- package/data/docs/types/ListIndicator.json +70 -0
- package/data/docs/types/ListItem.json +70 -0
- package/data/docs/types/ListRoot.json +124 -0
- package/data/docs/types/LoadingSpinner.json +87 -0
- package/data/docs/types/LocalizedField.json +460 -0
- package/data/docs/types/LocalizedStringFormatter.json +9 -0
- package/data/docs/types/MakeElementFocusable.json +196 -0
- package/data/docs/types/MenuContent.json +111 -0
- package/data/docs/types/MenuItem.json +671 -0
- package/data/docs/types/MenuRoot.json +670 -0
- package/data/docs/types/MenuSection.json +364 -0
- package/data/docs/types/MenuSubmenu.json +111 -0
- package/data/docs/types/MenuSubmenuTrigger.json +67 -0
- package/data/docs/types/MenuTrigger.json +906 -0
- package/data/docs/types/ModalPage.json +12 -0
- package/data/docs/types/ModalPageActions.json +27 -0
- package/data/docs/types/ModalPageContent.json +27 -0
- package/data/docs/types/ModalPageFooter.json +27 -0
- package/data/docs/types/ModalPageHeader.json +27 -0
- package/data/docs/types/ModalPageRoot.json +87 -0
- package/data/docs/types/ModalPageSubtitle.json +27 -0
- package/data/docs/types/ModalPageTabNav.json +28 -0
- package/data/docs/types/ModalPageTitle.json +27 -0
- package/data/docs/types/ModalPageTopBar.json +57 -0
- package/data/docs/types/MoneyInput.isEmpty.json +40 -0
- package/data/docs/types/MoneyInput.json +282 -0
- package/data/docs/types/MoneyInputField.json +379 -0
- package/data/docs/types/MoneyInputFieldProps.json +9 -0
- package/data/docs/types/MultilineTextInput.json +1194 -0
- package/data/docs/types/MultilineTextInputField.json +1269 -0
- package/data/docs/types/MultilineTextInputFieldProps.json +9 -0
- package/data/docs/types/NimbusI18nProvider.json +42 -0
- package/data/docs/types/NimbusI18nProviderProps.json +9 -0
- package/data/docs/types/NimbusProvider.json +270 -0
- package/data/docs/types/NumberInput.json +952 -0
- package/data/docs/types/NumberInputField.json +1004 -0
- package/data/docs/types/NumberInputFieldProps.json +9 -0
- package/data/docs/types/PageContent.json +11 -0
- package/data/docs/types/PageContentColumn.json +99 -0
- package/data/docs/types/PageContentRoot.json +114 -0
- package/data/docs/types/Pagination.json +159 -0
- package/data/docs/types/PasswordInput.json +1120 -0
- package/data/docs/types/PasswordInputField.json +1216 -0
- package/data/docs/types/PasswordInputFieldProps.json +9 -0
- package/data/docs/types/ProgressBar.json +280 -0
- package/data/docs/types/RadioInputOption.json +550 -0
- package/data/docs/types/RadioInputRoot.json +514 -0
- package/data/docs/types/RangeCalendar.json +618 -0
- package/data/docs/types/RichTextInput.json +134 -0
- package/data/docs/types/Root.json +122 -0
- package/data/docs/types/Row.json +67 -0
- package/data/docs/types/ScopedSearchInput.isEmpty.json +40 -0
- package/data/docs/types/ScopedSearchInput.json +253 -0
- package/data/docs/types/ScrollArea.json +82 -0
- package/data/docs/types/SearchInput.json +1165 -0
- package/data/docs/types/SearchInputField.json +1240 -0
- package/data/docs/types/Select.json +12 -0
- package/data/docs/types/SelectOption.json +572 -0
- package/data/docs/types/SelectOptionGroup.json +215 -0
- package/data/docs/types/SelectOptions.json +693 -0
- package/data/docs/types/SelectRoot.json +926 -0
- package/data/docs/types/Separator.json +65 -0
- package/data/docs/types/SimpleGrid.json +291 -0
- package/data/docs/types/Spacer.json +27 -0
- package/data/docs/types/SpacerProps.json +9 -0
- package/data/docs/types/SplitButton.json +203 -0
- package/data/docs/types/Stack.json +144 -0
- package/data/docs/types/Steps.json +12 -0
- package/data/docs/types/StepsChangeDetails.json +9 -0
- package/data/docs/types/StepsCompletedContent.json +28 -0
- package/data/docs/types/StepsCompletedContentProps.json +9 -0
- package/data/docs/types/StepsContent.json +43 -0
- package/data/docs/types/StepsContentProps.json +9 -0
- package/data/docs/types/StepsDescription.json +28 -0
- package/data/docs/types/StepsDescriptionProps.json +9 -0
- package/data/docs/types/StepsIndicator.json +28 -0
- package/data/docs/types/StepsIndicatorProps.json +9 -0
- package/data/docs/types/StepsItem.json +43 -0
- package/data/docs/types/StepsItemProps.json +9 -0
- package/data/docs/types/StepsList.json +28 -0
- package/data/docs/types/StepsListProps.json +9 -0
- package/data/docs/types/StepsNextTrigger.json +62 -0
- package/data/docs/types/StepsNextTriggerProps.json +9 -0
- package/data/docs/types/StepsNumber.json +28 -0
- package/data/docs/types/StepsNumberProps.json +9 -0
- package/data/docs/types/StepsPrevTrigger.json +62 -0
- package/data/docs/types/StepsPrevTriggerProps.json +9 -0
- package/data/docs/types/StepsRoot.json +183 -0
- package/data/docs/types/StepsRootProps.json +11 -0
- package/data/docs/types/StepsSeparator.json +28 -0
- package/data/docs/types/StepsSeparatorProps.json +9 -0
- package/data/docs/types/StepsStatus.json +57 -0
- package/data/docs/types/StepsStatusProps.json +9 -0
- package/data/docs/types/StepsTitle.json +28 -0
- package/data/docs/types/StepsTitleProps.json +9 -0
- package/data/docs/types/StepsTrigger.json +47 -0
- package/data/docs/types/StepsTriggerProps.json +9 -0
- package/data/docs/types/Switch.json +371 -0
- package/data/docs/types/TabListProps.json +9 -0
- package/data/docs/types/TabNav.json +12 -0
- package/data/docs/types/TabNavItem.json +300 -0
- package/data/docs/types/TabNavItemProps.json +9 -0
- package/data/docs/types/TabNavProps.json +9 -0
- package/data/docs/types/TabNavRoot.json +80 -0
- package/data/docs/types/TabPanelProps.json +9 -0
- package/data/docs/types/TabPanelsProps.json +9 -0
- package/data/docs/types/TabProps.json +9 -0
- package/data/docs/types/Table.json +9 -0
- package/data/docs/types/TableBody.json +67 -0
- package/data/docs/types/TableBodyProps.json +9 -0
- package/data/docs/types/TableCaption.json +67 -0
- package/data/docs/types/TableCaptionProps.json +9 -0
- package/data/docs/types/TableCell.json +227 -0
- package/data/docs/types/TableCellProps.json +9 -0
- package/data/docs/types/TableColumn.json +101 -0
- package/data/docs/types/TableColumnGroup.json +101 -0
- package/data/docs/types/TableColumnGroupProps.json +9 -0
- package/data/docs/types/TableColumnHeader.json +193 -0
- package/data/docs/types/TableColumnHeaderProps.json +9 -0
- package/data/docs/types/TableColumnProps.json +9 -0
- package/data/docs/types/TableFooter.json +67 -0
- package/data/docs/types/TableFooterProps.json +9 -0
- package/data/docs/types/TableHeader.json +67 -0
- package/data/docs/types/TableHeaderProps.json +9 -0
- package/data/docs/types/TableRoot.json +365 -0
- package/data/docs/types/TableRootProps.json +12 -0
- package/data/docs/types/TableRow.json +67 -0
- package/data/docs/types/TableRowProps.json +9 -0
- package/data/docs/types/TableScrollArea.json +82 -0
- package/data/docs/types/TableScrollAreaProps.json +9 -0
- package/data/docs/types/Tabs.json +12 -0
- package/data/docs/types/TabsList.json +110 -0
- package/data/docs/types/TabsPanel.json +112 -0
- package/data/docs/types/TabsPanels.json +108 -0
- package/data/docs/types/TabsRoot.json +211 -0
- package/data/docs/types/TabsTab.json +174 -0
- package/data/docs/types/TagGroup.json +12 -0
- package/data/docs/types/TagGroupRoot.json +306 -0
- package/data/docs/types/TagGroupTag.json +595 -0
- package/data/docs/types/TagGroupTagList.json +166 -0
- package/data/docs/types/Text.json +119 -0
- package/data/docs/types/TextInput.json +1156 -0
- package/data/docs/types/TextInputField.json +1263 -0
- package/data/docs/types/TimeInput.json +752 -0
- package/data/docs/types/ToastAction.json +9 -0
- package/data/docs/types/ToastManagerApi.json +9 -0
- package/data/docs/types/ToastOptions.json +9 -0
- package/data/docs/types/ToastOutlet.json +12 -0
- package/data/docs/types/ToastPlacement.json +9 -0
- package/data/docs/types/ToastPromiseOptions.json +9 -0
- package/data/docs/types/ToastType.json +9 -0
- package/data/docs/types/ToastVariant.json +9 -0
- package/data/docs/types/ToggleButton.json +789 -0
- package/data/docs/types/ToggleButtonGroup.json +9 -0
- package/data/docs/types/ToggleButtonGroupButton.json +331 -0
- package/data/docs/types/ToggleButtonGroupRoot.json +269 -0
- package/data/docs/types/Toolbar.json +176 -0
- package/data/docs/types/Tooltip.json +12 -0
- package/data/docs/types/TooltipContent.json +372 -0
- package/data/docs/types/TooltipRoot.json +179 -0
- package/data/docs/types/Trigger.json +69 -0
- package/data/docs/types/VisuallyHidden.json +93 -0
- package/data/docs/types/__object.json +12 -0
- package/data/docs/types/filters.json +11 -0
- package/data/docs/types/manifest.json +278 -0
- package/data/docs/types/toast.json +234 -0
- package/data/docs/types/useColorMode.json +13 -0
- package/data/docs/types/useColorModeValue.json +13 -0
- package/data/docs/types/useColorScheme.json +12 -0
- package/data/docs/types/useLocalizedStringFormatter.json +14 -0
- package/data/icons.json +21940 -0
- package/data/tokens.json +40061 -0
- package/dist/index.js +2516 -17
- package/package.json +25 -6
- package/dist/data-loader.d.ts +0 -102
- package/dist/data-loader.js +0 -104
- package/dist/index.d.ts +0 -13
- package/dist/server.d.ts +0 -9
- package/dist/server.js +0 -22
- package/dist/server.spec.d.ts +0 -1
- package/dist/server.spec.js +0 -69
- package/dist/tools/list-components.d.ts +0 -9
- package/dist/tools/list-components.js +0 -42
- package/dist/types.d.ts +0 -28
- package/dist/types.js +0 -4
- package/src/data-loader.ts +0 -226
- package/src/index.ts +0 -29
- package/src/server.spec.ts +0 -86
- package/src/server.ts +0 -28
- package/src/tools/list-components.ts +0 -49
- package/src/types.ts +0 -31
- package/tsconfig.json +0 -14
- package/vitest.config.ts +0 -9
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"id": "Components-Calendar",
|
|
4
|
+
"title": "Calendar",
|
|
5
|
+
"exportName": "Calendar",
|
|
6
|
+
"description": "Calendars display a grid of days in one or more months and allow users to select a single date.",
|
|
7
|
+
"lifecycleState": "Stable",
|
|
8
|
+
"order": 999,
|
|
9
|
+
"repoPath": "packages/nimbus/src/components/calendar/calendar.mdx",
|
|
10
|
+
"menu": [
|
|
11
|
+
"Components",
|
|
12
|
+
"Inputs",
|
|
13
|
+
"Calendar"
|
|
14
|
+
],
|
|
15
|
+
"route": "components/inputs/calendar",
|
|
16
|
+
"tags": [
|
|
17
|
+
"component",
|
|
18
|
+
"calendar",
|
|
19
|
+
"date",
|
|
20
|
+
"picker",
|
|
21
|
+
"month"
|
|
22
|
+
],
|
|
23
|
+
"toc": [
|
|
24
|
+
{
|
|
25
|
+
"value": "Overview",
|
|
26
|
+
"href": "#overview",
|
|
27
|
+
"depth": 2,
|
|
28
|
+
"numbering": [
|
|
29
|
+
1,
|
|
30
|
+
1
|
|
31
|
+
],
|
|
32
|
+
"parent": "root"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"value": "Resources",
|
|
36
|
+
"href": "#resources",
|
|
37
|
+
"depth": 3,
|
|
38
|
+
"numbering": [
|
|
39
|
+
1,
|
|
40
|
+
1,
|
|
41
|
+
1
|
|
42
|
+
],
|
|
43
|
+
"parent": "root"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"value": "Variables",
|
|
47
|
+
"href": "#variables",
|
|
48
|
+
"depth": 2,
|
|
49
|
+
"numbering": [
|
|
50
|
+
1,
|
|
51
|
+
2
|
|
52
|
+
],
|
|
53
|
+
"parent": "root"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"value": "Visual options",
|
|
57
|
+
"href": "#visual-options",
|
|
58
|
+
"depth": 3,
|
|
59
|
+
"numbering": [
|
|
60
|
+
1,
|
|
61
|
+
2,
|
|
62
|
+
1
|
|
63
|
+
],
|
|
64
|
+
"parent": "root"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"layout": "app-frame",
|
|
68
|
+
"tabs": [
|
|
69
|
+
{
|
|
70
|
+
"key": "overview",
|
|
71
|
+
"title": "Overview",
|
|
72
|
+
"order": 0
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"key": "guidelines",
|
|
76
|
+
"title": "Guidelines",
|
|
77
|
+
"order": 2
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"key": "dev",
|
|
81
|
+
"title": "Implementation",
|
|
82
|
+
"order": 3
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"key": "a11y",
|
|
86
|
+
"title": "Accessibility",
|
|
87
|
+
"order": 4
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"mdx": "\n## Overview\n\nThe calendar component is most often used within the popover component when a\nuser interacts with a date input. Easily toggle between month, year, and single\nday selection.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma library](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?m=auto&node-id=5818-15651)\n[Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-date-calendar--docs)\n\n## Variables\n\nGet familiar with the features.\n\n### Visual options\n\n**Single date select**\n\nAllow users to see the current date, and select a single date.\n\n```jsx live\nconst App = () => <Calendar aria-label=\"Enter a date\" />\n```\n",
|
|
92
|
+
"views": {
|
|
93
|
+
"overview": {
|
|
94
|
+
"mdx": "\n## Overview\n\nThe calendar component is most often used within the popover component when a\nuser interacts with a date input. Easily toggle between month, year, and single\nday selection.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma library](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?m=auto&node-id=5818-15651)\n[Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-date-calendar--docs)\n\n## Variables\n\nGet familiar with the features.\n\n### Visual options\n\n**Single date select**\n\nAllow users to see the current date, and select a single date.\n\n```jsx live\nconst App = () => <Calendar aria-label=\"Enter a date\" />\n```\n",
|
|
95
|
+
"toc": [
|
|
96
|
+
{
|
|
97
|
+
"value": "Overview",
|
|
98
|
+
"href": "#overview",
|
|
99
|
+
"depth": 2,
|
|
100
|
+
"numbering": [
|
|
101
|
+
1,
|
|
102
|
+
1
|
|
103
|
+
],
|
|
104
|
+
"parent": "root"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"value": "Resources",
|
|
108
|
+
"href": "#resources",
|
|
109
|
+
"depth": 3,
|
|
110
|
+
"numbering": [
|
|
111
|
+
1,
|
|
112
|
+
1,
|
|
113
|
+
1
|
|
114
|
+
],
|
|
115
|
+
"parent": "root"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"value": "Variables",
|
|
119
|
+
"href": "#variables",
|
|
120
|
+
"depth": 2,
|
|
121
|
+
"numbering": [
|
|
122
|
+
1,
|
|
123
|
+
2
|
|
124
|
+
],
|
|
125
|
+
"parent": "root"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"value": "Visual options",
|
|
129
|
+
"href": "#visual-options",
|
|
130
|
+
"depth": 3,
|
|
131
|
+
"numbering": [
|
|
132
|
+
1,
|
|
133
|
+
2,
|
|
134
|
+
1
|
|
135
|
+
],
|
|
136
|
+
"parent": "root"
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"a11y": {
|
|
141
|
+
"mdx": "\n## Accessibility\n\nAccessibility ensures that digital content and functionality are usable by\neveryone, including people with disabilities, by addressing visual, auditory,\ncognitive, and physical limitations.\n\n```jsx live\nconst App = () => <Calendar aria-label=\"Enter a date\" />\n```\n\n### Accessibility standards\n\n- Ensure the calendar is navigable using a keyboard.\n- Use Tab to move focus to and from the calendar component.\n- Use Enter or Space to activate controls (e.g., to open/close the calendar,\n select a date, or navigate months/years).\n- Use arrow keys to navigate between days within the calendar grid.\n- Ensure focus is clearly visible on the currently selected day or navigated\n day.\n- Clearly indicate the current month and year.\n- Provide accessible controls for navigating to previous and next months/years.\n These controls should have clear aria-label attributes if they are icon-only.\n- Ensure selected dates are clearly distinguished visually and announced by\n screen readers.\n- Communicate invalid or unavailable dates (e.g., past dates, blackout dates) to\n screen readers.\n- Provide a mechanism for users to select a specific date (e.g., clicking a day,\n or typing a date into an associated input field).\n- Announce changes in month or year to screen readers.\n- Ensure sufficient color contrast for all calendar elements (text, borders,\n icons, selected states, hover states).\n",
|
|
142
|
+
"toc": [
|
|
143
|
+
{
|
|
144
|
+
"value": "Accessibility",
|
|
145
|
+
"href": "#accessibility",
|
|
146
|
+
"depth": 2,
|
|
147
|
+
"numbering": [
|
|
148
|
+
1,
|
|
149
|
+
1
|
|
150
|
+
],
|
|
151
|
+
"parent": "root"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"value": "Accessibility standards",
|
|
155
|
+
"href": "#accessibility-standards",
|
|
156
|
+
"depth": 3,
|
|
157
|
+
"numbering": [
|
|
158
|
+
1,
|
|
159
|
+
1,
|
|
160
|
+
1
|
|
161
|
+
],
|
|
162
|
+
"parent": "root"
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
"dev": {
|
|
167
|
+
"mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { Calendar, type CalendarProps } from '@commercetools/nimbus';\n```\n\n### Basic usage\n\nThe simplest implementation displays a calendar with no pre-selected date:\n\n```jsx live-dev\nconst App = () => (\n <Calendar />\n)\n```\n\n## Working with date values\n\nThe Calendar relies on `@internationalized/date`'s library for type-safe date handling. This library provides calendar system support, time zone handling, and locale-aware date formatting.\n\n### Date value types\n\nThree primary date types are available depending on your needs:\n\n```tsx\nimport { CalendarDate, CalendarDateTime, ZonedDateTime } from '@internationalized/date';\n\n// Date only (no time)\nconst dateOnly = new CalendarDate(2024, 1, 15);\n\n// Date with time (no timezone)\nconst dateTime = new CalendarDateTime(2024, 1, 15, 14, 30);\n\n// Date with time and timezone\nconst zonedDate = new ZonedDateTime(2024, 1, 15, 14, 30, 'America/New_York');\n```\n\n### Creating date values\n\nUse helper functions to parse ISO strings or create dates programmatically:\n\n```tsx\nimport { parseDate, parseDateTime, parseZonedDateTime } from '@internationalized/date';\n\n// Parse ISO date strings\nconst date = parseDate('2024-01-15');\nconst dateTime = parseDateTime('2024-01-15T14:30');\nconst zonedDate = parseZonedDateTime('2024-01-15T14:30[America/New_York]');\n```\n\n### Converting to ISO strings\n\nUse `.toString()` to convert date objects for API/backend consumption:\n\n```tsx\nconst date = new CalendarDate(2024, 1, 15);\ndate.toString(); // \"2024-01-15\"\n\nconst dateTime = new CalendarDateTime(2024, 1, 15, 14, 30);\ndateTime.toString(); // \"2024-01-15T14:30:00\"\n```\n\n> [!TIP]\\\n> See [@internationalized/date documentation](https://react-spectrum.adobe.com/internationalized/date/) for complete API reference and advanced usage.\n\n## Usage examples\n\n### Uncontrolled mode\n\nFor simpler use cases, use uncontrolled mode with `defaultValue` and `onChange`:\n\n```jsx live-dev\nconst App = () => {\n const [selectedDate, setSelectedDate] = useState<string>('No selection');\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Calendar\n defaultValue={new CalendarDate(2025, 1, 15)}\n onChange={(date) => {\n setSelectedDate(date ? date.toString() : 'No selection');\n }}\n />\n <Text fontSize=\"sm\">Selected: {selectedDate}</Text>\n </Stack>\n );\n}\n```\n\nUse uncontrolled mode when you need to capture the selected date without managing state yourself.\n\n### Controlled mode\n\nFor scenarios requiring programmatic control or coordination with other components, use controlled mode:\n\n```jsx live-dev\nconst App = () => {\n const [value, setValue] = useState<CalendarProps<DateValue>[\"value\"]>(null);\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Calendar\n value={value}\n onChange={setValue}\n />\n <Text fontSize=\"sm\">\n {value ? `Selected: ${value.toString()}` : 'No selection'}\n </Text>\n </Stack>\n );\n}\n```\n\nUse controlled mode when you need to:\n- Synchronize the date with external state\n- Validate or transform date selections\n- Clear or programmatically set the date\n\n### Multi-month display\n\nDisplay multiple months simultaneously using the `visibleDuration` prop:\n\n```jsx live-dev\nconst App = () => (\n <Calendar\n defaultValue={new CalendarDate(2025, 1, 15)}\n visibleDuration={{ months: 2 }}\n width=\"680px\"\n />\n)\n```\n\nSet an appropriate width to accommodate multiple months (approximately 340px per month).\n\n### Navigation behavior\n\nThe `pageBehavior` prop controls how the calendar navigates when using prev/next buttons:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"600\">\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Single month navigation</Text>\n <Text fontSize=\"sm\" color=\"neutral.11\">Navigates by one month at a time</Text>\n <Calendar\n defaultValue={new CalendarDate(2025, 1, 15)}\n visibleDuration={{ months: 2 }}\n pageBehavior=\"single\"\n width=\"680px\"\n />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Visible duration navigation</Text>\n <Text fontSize=\"sm\" color=\"neutral.11\">Navigates by the number of visible months</Text>\n <Calendar\n defaultValue={new CalendarDate(2025, 1, 15)}\n visibleDuration={{ months: 2 }}\n pageBehavior=\"visible\"\n width=\"680px\"\n />\n </Stack>\n </Stack>\n)\n```\n\n**Behavioral differences:**\n- `pageBehavior=\"single\"`: Advances one month at a time, regardless of how many months are visible\n- `pageBehavior=\"visible\"`: Advances by the full visible duration (e.g., if showing 3 months, advances 3 months)\n\n### Date constraints\n\n#### Minimum and maximum values\n\nRestrict selectable dates using `minValue` and `maxValue`:\n\n```jsx live-dev\nconst App = () => {\n const today = new CalendarDate(2025, 1, 15);\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Minimum date (today onwards)</Text>\n <Calendar\n minValue={today}\n defaultValue={today}\n />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Maximum date (up to 7 days from today)</Text>\n <Calendar\n maxValue={today.add({ days: 7 })}\n defaultValue={today}\n />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Date range (next 7 days only)</Text>\n <Calendar\n minValue={today.add({ days: 1 })}\n maxValue={today.add({ days: 7 })}\n defaultValue={today.add({ days: 1 })}\n />\n </Stack>\n </Stack>\n );\n}\n```\n\n#### Unavailable dates\n\nMark specific dates as unavailable using the `isDateUnavailable` callback:\n\n```jsx live-dev\nconst App = () => {\n const today = new CalendarDate(2025, 1, 15);\n\n return (\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">\n Only weekdays are selectable (weekends are disabled)\n </Text>\n <Calendar\n defaultValue={today}\n isDateUnavailable={(date) => {\n const dayOfWeek = date.toDate(getLocalTimeZone()).getDay();\n return dayOfWeek === 0 || dayOfWeek === 6; // Sunday or Saturday\n }}\n />\n </Stack>\n );\n}\n```\n\n### Custom week start day\n\nSpecify which day starts the week using `firstDayOfWeek`:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Week starts on Sunday (default)</Text>\n <Calendar />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Week starts on Monday</Text>\n <Calendar firstDayOfWeek=\"mon\" />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Week starts on Saturday</Text>\n <Calendar firstDayOfWeek=\"sat\" />\n </Stack>\n </Stack>\n)\n```\n\n### Internationalization\n\nThe Calendar automatically adapts to different locales when wrapped with `NimbusI18nProvider`:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">English (US)</Text>\n <NimbusI18nProvider locale=\"en-US\">\n <Calendar defaultValue={new CalendarDate(2025, 1, 15)} />\n </NimbusI18nProvider>\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">German</Text>\n <NimbusI18nProvider locale=\"de-DE\">\n <Calendar defaultValue={new CalendarDate(2025, 1, 15)} />\n </NimbusI18nProvider>\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">French</Text>\n <NimbusI18nProvider locale=\"fr-FR\">\n <Calendar defaultValue={new CalendarDate(2025, 1, 15)} />\n </NimbusI18nProvider>\n </Stack>\n </Stack>\n)\n```\n\n### State props\n\nControl the calendar's interactive state using `isDisabled`, `isReadOnly`, and `isInvalid`:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Disabled</Text>\n <Text fontSize=\"sm\" color=\"neutral.11\">User cannot interact with the calendar</Text>\n <Calendar isDisabled defaultValue={new CalendarDate(2025, 1, 15)} />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Read-only</Text>\n <Text fontSize=\"sm\" color=\"neutral.11\">Calendar is visible but selection is prevented</Text>\n <Calendar isReadOnly defaultValue={new CalendarDate(2025, 1, 15)} />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Invalid</Text>\n <Text fontSize=\"sm\" color=\"neutral.11\">Indicates validation error state</Text>\n <Calendar isInvalid defaultValue={new CalendarDate(2025, 1, 15)} />\n </Stack>\n </Stack>\n)\n```\n\n## Component requirements\n\n### Date value requirements\n\nAll date values **must** use `@internationalized/date` types:\n- `CalendarDate` for date-only values (recommended for most use cases)\n- `CalendarDateTime` for date with time\n- `ZonedDateTime` for date with time and timezone\n\n## Accessibility\n\nThe Calendar handles most accessibility requirements internally. However, you must always associate an internationalized label with the component. Visual labels are preferable, and can be set by:\n\n- Associating a `<label>` element with the Calendar using `aria-labelledby`:\n\n```tsx\n<label id=\"calendar-label\">\n {msg.format(\"selectDate\")}\n</label>\n<Calendar aria-labelledby=\"calendar-label\" />\n```\n\n- Associating a `<label>` element with the Calendar using `htmlFor`:\n\n```tsx\n<label htmlFor=\"calendar-id\">\n {msg.format(\"selectDate\")}\n</label>\n<Calendar id=\"calendar-id\" />\n```\n\nIf your design requires that the label should not be visible, the label should be set using the `aria-label` prop:\n\n```tsx\n<Calendar aria-label={msg.format(\"selectDate\")} />\n```\n\nIf your use case requires tracking and analytics for this component, it is good practice to add a **persistent**, **unique** id to the component:\n\n```tsx\nconst PERSISTENT_ID = \"booking-calendar\";\n\nexport const BookingForm = () => (\n <Calendar id={PERSISTENT_ID} />\n);\n```\n\n#### Keyboard navigation\n\nThe component supports full keyboard interaction:\n- `Tab` / `Shift+Tab`: Move focus into and out of the calendar\n- `Arrow keys`: Navigate between dates within the grid\n- `Page Up` / `Page Down`: Navigate to the previous/next month\n- `Shift + Page Up` / `Shift + Page Down`: Navigate to the previous/next year\n- `Home` / `End`: Navigate to the start/end of the current week\n- `Enter` / `Space`: Select the focused date\n\n## API reference\n\n<PropsTable id=\"Calendar\" />\n\n## Common patterns\n\n### Booking system with constraints\n\nA typical booking system that prevents past dates and weekends:\n\n```jsx live-dev\nconst App = () => {\n const [value, setValue] = useState<CalendarProps<DateValue>[\"value\"]>(null);\n const today = new CalendarDate(2025, 1, 15);\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Text fontWeight=\"600\">Select your booking date</Text>\n <Text fontSize=\"sm\" color=\"neutral.11\">\n Available dates: Weekdays only, starting tomorrow\n </Text>\n <Calendar\n value={value}\n onChange={setValue}\n minValue={today.add({ days: 1 })}\n isDateUnavailable={(date) => {\n const dayOfWeek = date.toDate(getLocalTimeZone()).getDay();\n return dayOfWeek === 0 || dayOfWeek === 6;\n }}\n />\n {value && (\n <Text fontSize=\"sm\">\n Selected booking date: {value.toString()}\n </Text>\n )}\n </Stack>\n );\n}\n```\n\n### Working days selection\n\nCalendar configured for business day selection with current month focus:\n\n```jsx live-dev\nconst App = () => {\n const [value, setValue] = useState<CalendarProps<DateValue>[\"value\"]>(\n new CalendarDate(2025, 1, 15)\n );\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Text fontWeight=\"600\">Select working day</Text>\n <Calendar\n value={value}\n onChange={setValue}\n isDateUnavailable={(date) => {\n const dayOfWeek = date.toDate(getLocalTimeZone()).getDay();\n return dayOfWeek === 0 || dayOfWeek === 6;\n }}\n />\n {value && (\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\">Selected: {value.toString()}</Text>\n <Text fontSize=\"sm\" color=\"neutral.11\">\n {value.toDate(getLocalTimeZone()).toLocaleDateString('en-US', {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n })}\n </Text>\n </Stack>\n )}\n </Stack>\n );\n}\n```\n\n### Multi-month date selection\n\nDisplay multiple months for easier range visualization:\n\n```jsx live-dev\nconst App = () => {\n const [value, setValue] = useState<CalendarProps<DateValue>[\"value\"]>(null);\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Text fontWeight=\"600\">Select a date across multiple months</Text>\n <Calendar\n value={value}\n onChange={setValue}\n visibleDuration={{ months: 3 }}\n pageBehavior=\"visible\"\n width=\"1000px\"\n />\n {value && (\n <Text fontSize=\"sm\">Selected: {value.toString()}</Text>\n )}\n </Stack>\n );\n}\n```\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using Calendar within your application. As the component's internal functionality is already tested by Nimbus, these patterns help you verify your integration and application-specific logic.\n\n### Basic Rendering Tests\n\nVerify the Calendar component renders with expected grid structure\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, within, act } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Calendar, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, getLocalTimeZone } from \"@internationalized/date\";\n\ndescribe(\"Calendar - Basic rendering\", () => {\n it(\"renders calendar grid\", () => {\n render(\n <NimbusProvider>\n <Calendar aria-label=\"Select date\" />\n </NimbusProvider>\n );\n\n // Calendar uses grid role for accessibility\n expect(screen.getByRole(\"grid\")).toBeInTheDocument();\n });\n\n it(\"renders with default value\", () => {\n const defaultDate = new CalendarDate(2025, 1, 15);\n\n render(\n <NimbusProvider>\n <Calendar aria-label=\"Select date\" defaultValue={defaultDate} />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n expect(grid).toBeInTheDocument();\n\n // Verify selected date is marked with data-selected attribute\n const dateCells = within(grid).getAllByRole(\"button\");\n const selectedCell = dateCells.find(\n (cell) => cell.getAttribute(\"data-selected\") === \"true\"\n );\n // Calendar renders with a selected date\n expect(selectedCell).toBeTruthy();\n if (selectedCell) {\n expect(selectedCell).toHaveTextContent(\"15\");\n }\n });\n\n it(\"renders navigation buttons\", () => {\n render(\n <NimbusProvider>\n <Calendar aria-label=\"Select date\" />\n </NimbusProvider>\n );\n\n // Calendar header contains previous/next month and year navigation\n const previousButtons = screen.getAllByRole(\"button\", {\n name: /previous/i,\n });\n const nextButtons = screen.getAllByRole(\"button\", { name: /next/i });\n\n expect(previousButtons.length).toBeGreaterThan(0);\n expect(nextButtons.length).toBeGreaterThan(0);\n });\n});\n```\n\n### Controlled Mode Tests\n\nTest controlled Calendar with value and onChange props\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, within, act } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Calendar, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, getLocalTimeZone } from \"@internationalized/date\";\n\ndescribe(\"Calendar - Controlled mode\", () => {\n it(\"displays controlled value\", () => {\n const controlledDate = new CalendarDate(2025, 1, 15);\n\n render(\n <NimbusProvider>\n <Calendar aria-label=\"Select date\" value={controlledDate} />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n const dateCells = within(grid).getAllByRole(\"button\");\n const selectedCell = dateCells.find(\n (cell) => cell.getAttribute(\"data-selected\") === \"true\"\n );\n\n expect(selectedCell).toBeTruthy();\n if (selectedCell) {\n expect(selectedCell).toHaveTextContent(\"15\");\n }\n });\n\n it(\"calls onChange when date is selected\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n\n render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n value={null}\n onChange={handleChange}\n defaultFocusedValue={new CalendarDate(2025, 1, 15)}\n />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n // Find an enabled date cell from current month\n const dateCells = within(grid).getAllByRole(\"button\");\n const availableCell = dateCells.find(\n (cell) =>\n cell.getAttribute(\"aria-disabled\") !== \"true\" &&\n cell.textContent &&\n parseInt(cell.textContent) > 0 &&\n parseInt(cell.textContent) <= 31\n );\n\n if (availableCell) {\n await user.click(availableCell);\n expect(handleChange).toHaveBeenCalled();\n // Verify the handler was called with a DateValue\n const callArg = handleChange.mock.calls[0]?.[0];\n expect(callArg).toBeTruthy();\n }\n });\n\n it(\"allows programmatic value updates\", () => {\n const { rerender } = render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n value={new CalendarDate(2025, 1, 15)}\n />\n </NimbusProvider>\n );\n\n let grid = screen.getByRole(\"grid\");\n let dateCells = within(grid).getAllByRole(\"button\");\n let selectedCell = dateCells.find(\n (cell) => cell.getAttribute(\"data-selected\") === \"true\"\n );\n expect(selectedCell).toBeTruthy();\n if (selectedCell) {\n expect(selectedCell).toHaveTextContent(\"15\");\n }\n\n // Update to a new date\n rerender(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n value={new CalendarDate(2025, 1, 20)}\n />\n </NimbusProvider>\n );\n\n grid = screen.getByRole(\"grid\");\n dateCells = within(grid).getAllByRole(\"button\");\n selectedCell = dateCells.find(\n (cell) => cell.getAttribute(\"data-selected\") === \"true\"\n );\n expect(selectedCell).toBeTruthy();\n if (selectedCell) {\n expect(selectedCell).toHaveTextContent(\"20\");\n }\n });\n});\n```\n\n### Date Constraints Tests\n\nTest minValue, maxValue, and isDateUnavailable constraints\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, within, act } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Calendar, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, getLocalTimeZone } from \"@internationalized/date\";\n\ndescribe(\"Calendar - Date constraints\", () => {\n it(\"disables dates before minValue\", () => {\n const minDate = new CalendarDate(2025, 1, 15);\n\n render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n minValue={minDate}\n defaultValue={minDate}\n />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n const dateCells = within(grid).getAllByRole(\"button\");\n\n // Find cells before minValue (they should be disabled)\n const disabledCells = dateCells.filter(\n (cell) => cell.getAttribute(\"aria-disabled\") === \"true\"\n );\n\n expect(disabledCells.length).toBeGreaterThan(0);\n });\n\n it(\"disables dates after maxValue\", () => {\n const maxDate = new CalendarDate(2025, 1, 15);\n\n render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n maxValue={maxDate}\n defaultValue={maxDate}\n />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n const dateCells = within(grid).getAllByRole(\"button\");\n\n // Find cells after maxValue (they should be disabled)\n const disabledCells = dateCells.filter(\n (cell) => cell.getAttribute(\"aria-disabled\") === \"true\"\n );\n\n expect(disabledCells.length).toBeGreaterThan(0);\n });\n\n it(\"marks unavailable dates as disabled\", () => {\n const today = new CalendarDate(2025, 1, 15); // Wednesday\n\n render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n defaultValue={today}\n isDateUnavailable={(date) => {\n const dayOfWeek = date.toDate(getLocalTimeZone()).getDay();\n return dayOfWeek === 0 || dayOfWeek === 6; // Weekends\n }}\n />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n const dateCells = within(grid).getAllByRole(\"button\");\n\n // Filter cells that are disabled due to isDateUnavailable\n const disabledCells = dateCells.filter(\n (cell) => cell.getAttribute(\"aria-disabled\") === \"true\"\n );\n\n // Should have weekend dates disabled\n expect(disabledCells.length).toBeGreaterThan(0);\n });\n});\n```\n\n### Multi-Month Display Tests\n\nTest calendar with multiple visible months\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, within, act } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Calendar, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, getLocalTimeZone } from \"@internationalized/date\";\n\ndescribe(\"Calendar - Multi-month display\", () => {\n it(\"renders multiple months when visibleDuration is set\", () => {\n render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n defaultValue={new CalendarDate(2025, 1, 15)}\n visibleDuration={{ months: 2 }}\n />\n </NimbusProvider>\n );\n\n // Should render multiple grid elements (one per month)\n const grids = screen.getAllByRole(\"grid\");\n expect(grids.length).toBe(2);\n });\n\n it('navigates by visible duration when pageBehavior is \"visible\"', async () => {\n const user = userEvent.setup();\n\n render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n defaultValue={new CalendarDate(2025, 1, 15)}\n visibleDuration={{ months: 2 }}\n pageBehavior=\"visible\"\n />\n </NimbusProvider>\n );\n\n const nextButtons = screen.getAllByRole(\"button\", { name: /next/i });\n expect(nextButtons.length).toBeGreaterThan(0);\n\n await user.click(nextButtons[0]);\n\n // Calendar should advance by 2 months (the visible duration)\n // Verify that calendar still renders two grids after navigation\n const grids = screen.getAllByRole(\"grid\");\n expect(grids.length).toBe(2);\n });\n});\n```\n\n### State Props Tests\n\nTest isDisabled, isReadOnly, and isInvalid state props\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, within, act } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Calendar, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, getLocalTimeZone } from \"@internationalized/date\";\n\ndescribe(\"Calendar - State props\", () => {\n it(\"disables all interactions when isDisabled is true\", () => {\n render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n isDisabled\n defaultValue={new CalendarDate(2025, 1, 15)}\n />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n const dateCells = within(grid).getAllByRole(\"button\");\n\n // All date cells should be disabled\n dateCells.forEach((cell) => {\n expect(cell).toHaveAttribute(\"aria-disabled\", \"true\");\n });\n });\n\n it(\"prevents selection when isReadOnly is true\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n\n render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n isReadOnly\n value={new CalendarDate(2025, 1, 15)}\n onChange={handleChange}\n />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n const dateCells = within(grid).getAllByRole(\"button\");\n const unselectedCell = dateCells.find(\n (cell) => !cell.getAttribute(\"aria-pressed\")\n );\n\n if (unselectedCell) {\n await user.click(unselectedCell);\n // onChange should not be called in read-only mode\n expect(handleChange).not.toHaveBeenCalled();\n }\n });\n\n it(\"applies invalid styling when isInvalid is true\", () => {\n render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n isInvalid\n defaultValue={new CalendarDate(2025, 1, 15)}\n />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n expect(grid).toBeInTheDocument();\n // Component should still render and be functional\n // Visual invalid state is applied via CSS\n });\n});\n```\n\n### Keyboard Navigation Tests\n\nTest keyboard interactions for date selection\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, within, act } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Calendar, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, getLocalTimeZone } from \"@internationalized/date\";\n\ndescribe(\"Calendar - Keyboard navigation\", () => {\n it(\"supports arrow key navigation\", async () => {\n const user = userEvent.setup();\n\n render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n defaultValue={new CalendarDate(2025, 1, 15)}\n />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n const dateCells = within(grid).getAllByRole(\"button\");\n const selectedCell = dateCells.find(\n (cell) => cell.getAttribute(\"data-selected\") === \"true\"\n );\n\n // Focus the selected cell if it exists\n if (selectedCell) {\n // Wrap focus in act() to handle React state updates (React 19 requires async act)\n await act(async () => {\n selectedCell.focus();\n });\n expect(selectedCell).toHaveFocus();\n\n // Arrow keys should navigate to adjacent dates\n await user.keyboard(\"{ArrowRight}\");\n // Focus should move to the next date\n const focusedElement = document.activeElement;\n expect(focusedElement).not.toBe(selectedCell);\n expect(focusedElement?.getAttribute(\"role\")).toBe(\"button\");\n } else {\n // If no selected cell, just verify calendar has navigable buttons\n expect(dateCells.length).toBeGreaterThan(0);\n }\n });\n\n it(\"selects date with Enter key\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n\n render(\n <NimbusProvider>\n <Calendar\n aria-label=\"Select date\"\n value={null}\n onChange={handleChange}\n />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n const dateCells = within(grid).getAllByRole(\"button\");\n const firstAvailableCell = dateCells.find(\n (cell) => cell.getAttribute(\"aria-disabled\") !== \"true\"\n );\n\n if (firstAvailableCell) {\n // Wrap focus in act() to handle React state updates (React 19 requires async act)\n await act(async () => {\n firstAvailableCell.focus();\n });\n await user.keyboard(\"{Enter}\");\n\n expect(handleChange).toHaveBeenCalledTimes(1);\n }\n });\n});\n```\n\n### Internationalization Tests\n\nTest calendar with different locales\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, within, act } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Calendar, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, getLocalTimeZone } from \"@internationalized/date\";\n\ndescribe(\"Calendar - Internationalization\", () => {\n it(\"renders with German locale\", () => {\n render(\n <NimbusProvider locale=\"de-DE\">\n <Calendar\n aria-label=\"Datum wählen\"\n defaultValue={new CalendarDate(2025, 1, 15)}\n />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n expect(grid).toBeInTheDocument();\n\n // German calendar should render with localized content\n // Specific weekday names would be in German\n });\n\n it(\"renders with French locale\", () => {\n render(\n <NimbusProvider locale=\"fr-FR\">\n <Calendar\n aria-label=\"Select date\"\n defaultValue={new CalendarDate(2025, 1, 15)}\n />\n </NimbusProvider>\n );\n\n const grid = screen.getByRole(\"grid\");\n expect(grid).toBeInTheDocument();\n\n // French calendar should render with localized content\n });\n});\n```\n\n\n## Resources\n\n- [Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-date-calendar--docs)\n- [React Aria Calendar](https://react-spectrum.adobe.com/react-aria/Calendar.html)\n- [ARIA Grid Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/)\n- [@internationalized/date](https://react-spectrum.adobe.com/internationalized/date/)\n",
|
|
168
|
+
"toc": [
|
|
169
|
+
{
|
|
170
|
+
"value": "Getting started",
|
|
171
|
+
"href": "#getting-started",
|
|
172
|
+
"depth": 2,
|
|
173
|
+
"numbering": [
|
|
174
|
+
1,
|
|
175
|
+
1
|
|
176
|
+
],
|
|
177
|
+
"parent": "root"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"value": "Import",
|
|
181
|
+
"href": "#import",
|
|
182
|
+
"depth": 3,
|
|
183
|
+
"numbering": [
|
|
184
|
+
1,
|
|
185
|
+
1,
|
|
186
|
+
1
|
|
187
|
+
],
|
|
188
|
+
"parent": "root"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"value": "Basic usage",
|
|
192
|
+
"href": "#basic-usage",
|
|
193
|
+
"depth": 3,
|
|
194
|
+
"numbering": [
|
|
195
|
+
1,
|
|
196
|
+
1,
|
|
197
|
+
2
|
|
198
|
+
],
|
|
199
|
+
"parent": "root"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"value": "Working with date values",
|
|
203
|
+
"href": "#working-with-date-values",
|
|
204
|
+
"depth": 2,
|
|
205
|
+
"numbering": [
|
|
206
|
+
1,
|
|
207
|
+
2
|
|
208
|
+
],
|
|
209
|
+
"parent": "root"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"value": "Date value types",
|
|
213
|
+
"href": "#date-value-types",
|
|
214
|
+
"depth": 3,
|
|
215
|
+
"numbering": [
|
|
216
|
+
1,
|
|
217
|
+
2,
|
|
218
|
+
1
|
|
219
|
+
],
|
|
220
|
+
"parent": "root"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"value": "Creating date values",
|
|
224
|
+
"href": "#creating-date-values",
|
|
225
|
+
"depth": 3,
|
|
226
|
+
"numbering": [
|
|
227
|
+
1,
|
|
228
|
+
2,
|
|
229
|
+
2
|
|
230
|
+
],
|
|
231
|
+
"parent": "root"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"value": "Converting to ISO strings",
|
|
235
|
+
"href": "#converting-to-iso-strings",
|
|
236
|
+
"depth": 3,
|
|
237
|
+
"numbering": [
|
|
238
|
+
1,
|
|
239
|
+
2,
|
|
240
|
+
3
|
|
241
|
+
],
|
|
242
|
+
"parent": "root"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"value": "Usage examples",
|
|
246
|
+
"href": "#usage-examples",
|
|
247
|
+
"depth": 2,
|
|
248
|
+
"numbering": [
|
|
249
|
+
1,
|
|
250
|
+
3
|
|
251
|
+
],
|
|
252
|
+
"parent": "root"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"value": "Uncontrolled mode",
|
|
256
|
+
"href": "#uncontrolled-mode",
|
|
257
|
+
"depth": 3,
|
|
258
|
+
"numbering": [
|
|
259
|
+
1,
|
|
260
|
+
3,
|
|
261
|
+
1
|
|
262
|
+
],
|
|
263
|
+
"parent": "root"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"value": "Controlled mode",
|
|
267
|
+
"href": "#controlled-mode",
|
|
268
|
+
"depth": 3,
|
|
269
|
+
"numbering": [
|
|
270
|
+
1,
|
|
271
|
+
3,
|
|
272
|
+
2
|
|
273
|
+
],
|
|
274
|
+
"parent": "root"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"value": "Multi-month display",
|
|
278
|
+
"href": "#multi-month-display",
|
|
279
|
+
"depth": 3,
|
|
280
|
+
"numbering": [
|
|
281
|
+
1,
|
|
282
|
+
3,
|
|
283
|
+
3
|
|
284
|
+
],
|
|
285
|
+
"parent": "root"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"value": "Navigation behavior",
|
|
289
|
+
"href": "#navigation-behavior",
|
|
290
|
+
"depth": 3,
|
|
291
|
+
"numbering": [
|
|
292
|
+
1,
|
|
293
|
+
3,
|
|
294
|
+
4
|
|
295
|
+
],
|
|
296
|
+
"parent": "root"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"value": "Date constraints",
|
|
300
|
+
"href": "#date-constraints",
|
|
301
|
+
"depth": 3,
|
|
302
|
+
"numbering": [
|
|
303
|
+
1,
|
|
304
|
+
3,
|
|
305
|
+
5
|
|
306
|
+
],
|
|
307
|
+
"parent": "root"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"value": "Minimum and maximum values",
|
|
311
|
+
"href": "#minimum-and-maximum-values",
|
|
312
|
+
"depth": 4,
|
|
313
|
+
"numbering": [
|
|
314
|
+
1,
|
|
315
|
+
3,
|
|
316
|
+
5,
|
|
317
|
+
1
|
|
318
|
+
],
|
|
319
|
+
"parent": "root"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"value": "Unavailable dates",
|
|
323
|
+
"href": "#unavailable-dates",
|
|
324
|
+
"depth": 4,
|
|
325
|
+
"numbering": [
|
|
326
|
+
1,
|
|
327
|
+
3,
|
|
328
|
+
5,
|
|
329
|
+
2
|
|
330
|
+
],
|
|
331
|
+
"parent": "root"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"value": "Custom week start day",
|
|
335
|
+
"href": "#custom-week-start-day",
|
|
336
|
+
"depth": 3,
|
|
337
|
+
"numbering": [
|
|
338
|
+
1,
|
|
339
|
+
3,
|
|
340
|
+
6
|
|
341
|
+
],
|
|
342
|
+
"parent": "root"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"value": "Internationalization",
|
|
346
|
+
"href": "#internationalization",
|
|
347
|
+
"depth": 3,
|
|
348
|
+
"numbering": [
|
|
349
|
+
1,
|
|
350
|
+
3,
|
|
351
|
+
7
|
|
352
|
+
],
|
|
353
|
+
"parent": "root"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"value": "State props",
|
|
357
|
+
"href": "#state-props",
|
|
358
|
+
"depth": 3,
|
|
359
|
+
"numbering": [
|
|
360
|
+
1,
|
|
361
|
+
3,
|
|
362
|
+
8
|
|
363
|
+
],
|
|
364
|
+
"parent": "root"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"value": "Component requirements",
|
|
368
|
+
"href": "#component-requirements",
|
|
369
|
+
"depth": 2,
|
|
370
|
+
"numbering": [
|
|
371
|
+
1,
|
|
372
|
+
4
|
|
373
|
+
],
|
|
374
|
+
"parent": "root"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"value": "Date value requirements",
|
|
378
|
+
"href": "#date-value-requirements",
|
|
379
|
+
"depth": 3,
|
|
380
|
+
"numbering": [
|
|
381
|
+
1,
|
|
382
|
+
4,
|
|
383
|
+
1
|
|
384
|
+
],
|
|
385
|
+
"parent": "root"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"value": "Accessibility",
|
|
389
|
+
"href": "#accessibility",
|
|
390
|
+
"depth": 2,
|
|
391
|
+
"numbering": [
|
|
392
|
+
1,
|
|
393
|
+
5
|
|
394
|
+
],
|
|
395
|
+
"parent": "root"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"value": "Keyboard navigation",
|
|
399
|
+
"href": "#keyboard-navigation",
|
|
400
|
+
"depth": 4,
|
|
401
|
+
"numbering": [
|
|
402
|
+
1,
|
|
403
|
+
5,
|
|
404
|
+
1,
|
|
405
|
+
1
|
|
406
|
+
],
|
|
407
|
+
"parent": "root"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"value": "API reference",
|
|
411
|
+
"href": "#api-reference",
|
|
412
|
+
"depth": 2,
|
|
413
|
+
"numbering": [
|
|
414
|
+
1,
|
|
415
|
+
6
|
|
416
|
+
],
|
|
417
|
+
"parent": "root"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"value": "Common patterns",
|
|
421
|
+
"href": "#common-patterns",
|
|
422
|
+
"depth": 2,
|
|
423
|
+
"numbering": [
|
|
424
|
+
1,
|
|
425
|
+
7
|
|
426
|
+
],
|
|
427
|
+
"parent": "root"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"value": "Booking system with constraints",
|
|
431
|
+
"href": "#booking-system-with-constraints",
|
|
432
|
+
"depth": 3,
|
|
433
|
+
"numbering": [
|
|
434
|
+
1,
|
|
435
|
+
7,
|
|
436
|
+
1
|
|
437
|
+
],
|
|
438
|
+
"parent": "root"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"value": "Working days selection",
|
|
442
|
+
"href": "#working-days-selection",
|
|
443
|
+
"depth": 3,
|
|
444
|
+
"numbering": [
|
|
445
|
+
1,
|
|
446
|
+
7,
|
|
447
|
+
2
|
|
448
|
+
],
|
|
449
|
+
"parent": "root"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"value": "Multi-month date selection",
|
|
453
|
+
"href": "#multi-month-date-selection",
|
|
454
|
+
"depth": 3,
|
|
455
|
+
"numbering": [
|
|
456
|
+
1,
|
|
457
|
+
7,
|
|
458
|
+
3
|
|
459
|
+
],
|
|
460
|
+
"parent": "root"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"value": "Testing your implementation",
|
|
464
|
+
"href": "#testing-your-implementation",
|
|
465
|
+
"depth": 2,
|
|
466
|
+
"numbering": [
|
|
467
|
+
1,
|
|
468
|
+
8
|
|
469
|
+
],
|
|
470
|
+
"parent": "root"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"value": "Basic Rendering Tests",
|
|
474
|
+
"href": "#basic-rendering-tests",
|
|
475
|
+
"depth": 3,
|
|
476
|
+
"numbering": [
|
|
477
|
+
1,
|
|
478
|
+
8,
|
|
479
|
+
1
|
|
480
|
+
],
|
|
481
|
+
"parent": "root"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"value": "Controlled Mode Tests",
|
|
485
|
+
"href": "#controlled-mode-tests",
|
|
486
|
+
"depth": 3,
|
|
487
|
+
"numbering": [
|
|
488
|
+
1,
|
|
489
|
+
8,
|
|
490
|
+
2
|
|
491
|
+
],
|
|
492
|
+
"parent": "root"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"value": "Date Constraints Tests",
|
|
496
|
+
"href": "#date-constraints-tests",
|
|
497
|
+
"depth": 3,
|
|
498
|
+
"numbering": [
|
|
499
|
+
1,
|
|
500
|
+
8,
|
|
501
|
+
3
|
|
502
|
+
],
|
|
503
|
+
"parent": "root"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"value": "Multi-Month Display Tests",
|
|
507
|
+
"href": "#multi-month-display-tests",
|
|
508
|
+
"depth": 3,
|
|
509
|
+
"numbering": [
|
|
510
|
+
1,
|
|
511
|
+
8,
|
|
512
|
+
4
|
|
513
|
+
],
|
|
514
|
+
"parent": "root"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"value": "State Props Tests",
|
|
518
|
+
"href": "#state-props-tests",
|
|
519
|
+
"depth": 3,
|
|
520
|
+
"numbering": [
|
|
521
|
+
1,
|
|
522
|
+
8,
|
|
523
|
+
5
|
|
524
|
+
],
|
|
525
|
+
"parent": "root"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"value": "Keyboard Navigation Tests",
|
|
529
|
+
"href": "#keyboard-navigation-tests",
|
|
530
|
+
"depth": 3,
|
|
531
|
+
"numbering": [
|
|
532
|
+
1,
|
|
533
|
+
8,
|
|
534
|
+
6
|
|
535
|
+
],
|
|
536
|
+
"parent": "root"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"value": "Internationalization Tests",
|
|
540
|
+
"href": "#internationalization-tests",
|
|
541
|
+
"depth": 3,
|
|
542
|
+
"numbering": [
|
|
543
|
+
1,
|
|
544
|
+
8,
|
|
545
|
+
7
|
|
546
|
+
],
|
|
547
|
+
"parent": "root"
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"value": "Resources",
|
|
551
|
+
"href": "#resources",
|
|
552
|
+
"depth": 2,
|
|
553
|
+
"numbering": [
|
|
554
|
+
1,
|
|
555
|
+
9
|
|
556
|
+
],
|
|
557
|
+
"parent": "root"
|
|
558
|
+
}
|
|
559
|
+
]
|
|
560
|
+
},
|
|
561
|
+
"guidelines": {
|
|
562
|
+
"mdx": "\n## Guidelines\n\nCalendar guidelines focus on creating intuitive and accessible interfaces for\nviewing, navigating, and interacting with dates and events.\n\n### Best practices\n\n- **Clear visual hierarchy:** Distinguished between days, weeks, months, and\n years. Highlight the current date and any selected dates.\n- **Intuitive navigation:** Clear controls to move between different time\n periods (days, weeks, months, years).\n- **Clear labels and instructions:** Clear labels for navigation controls and\n any interactive elements within the calendar.\n\n### Usage\n\nA calendar is used to visually display and manage time-based information,\nallowing users to view, schedule, and interact with dates. A common way this\ncomponent is used is within the popover, and paired with the date input.\n\n> [!TIP]\\\n> When to use\n\n- **Scheduling:** When users need to select specific dates and times.\n- **Visualizing time-based data:** To display data or to filter data in a\n corresponding visual.\n- **Browsing dates:** When users need to navigate through different days, weeks,\n or months to find a specific date or time.\n- **Contextual awareness of dates:** When the day of the week or the\n relationship between dates is important for decision-making.\n- **Recurring events:** To allow users to set up and manage events that repeat\n on a regular basis.\n\n> [!CAUTION]\\\n> When not to use\n\n- **Simple date input:** If users already know the specific date (e.g., date of\n birth) and typing it in a formatted field is quicker and easier.\n- **Selecting a single \"today\" or \"now\":** For actions that inherently refer to\n the current date and time, a button or automatic function is more efficient.\n- **Limited screen space:** On very small interfaces, a compact date input or a\n simplified selection method might be necessary.\n- **Linear processes:** For step-by-step workflows where date selection is just\n one field, a calendar might be an unnecessary interruption.\n- **Non-time-related data:** For displaying or managing information that isn't\n tied to specific dates or times.\n\n#### Keeping interactions simple\n\nSimple calendar interactions are vital because they minimize user effort and\ncognitive load, allowing for quick and efficient time management, the calendar's\nprimary function.\n\n> [!TIP]\\\n> **Do**\n>\n> - Provide clear navigation. Make it easy to move between days, weeks, months,\n> and years using intuitive controls (arrows, drop downs).\n> - Ensure navigation controls are clearly labeled and their function is\n> obvious.\n\n```jsx live\nconst App = () => <Calendar defaultValue={new CalendarDate(2025, 1, 15)} />;\n```\n\n> [!CAUTION]\\\n> **Don't**\n>\n> - Don't over clutter. Avoid displaying too much information on the calendar\n> grid at once, which can make it overwhelming.\n> - Don't make navigation confusing. Ensure navigation controls are clearly\n> labeled and their function is obvious.\n> - Don't use it for simple date input. If users know the exact date, a direct\n> date input field might be more efficient.\n> - Don't auto-submit on date selection. Avoid automatically submitting forms or\n> triggering actions immediately after a date is selected.\n\n\n",
|
|
563
|
+
"toc": [
|
|
564
|
+
{
|
|
565
|
+
"value": "Guidelines",
|
|
566
|
+
"href": "#guidelines",
|
|
567
|
+
"depth": 2,
|
|
568
|
+
"numbering": [
|
|
569
|
+
1,
|
|
570
|
+
1
|
|
571
|
+
],
|
|
572
|
+
"parent": "root"
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
"value": "Best practices",
|
|
576
|
+
"href": "#best-practices",
|
|
577
|
+
"depth": 3,
|
|
578
|
+
"numbering": [
|
|
579
|
+
1,
|
|
580
|
+
1,
|
|
581
|
+
1
|
|
582
|
+
],
|
|
583
|
+
"parent": "root"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"value": "Usage",
|
|
587
|
+
"href": "#usage",
|
|
588
|
+
"depth": 3,
|
|
589
|
+
"numbering": [
|
|
590
|
+
1,
|
|
591
|
+
1,
|
|
592
|
+
2
|
|
593
|
+
],
|
|
594
|
+
"parent": "root"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"value": "Keeping interactions simple",
|
|
598
|
+
"href": "#keeping-interactions-simple",
|
|
599
|
+
"depth": 4,
|
|
600
|
+
"numbering": [
|
|
601
|
+
1,
|
|
602
|
+
1,
|
|
603
|
+
2,
|
|
604
|
+
1
|
|
605
|
+
],
|
|
606
|
+
"parent": "root"
|
|
607
|
+
}
|
|
608
|
+
]
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|