@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,444 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"id": "Components-Text",
|
|
4
|
+
"title": "Text",
|
|
5
|
+
"exportName": "Text",
|
|
6
|
+
"description": "Text styles are predefined collections of typography rules (including font-size, font-weight, line-height, and letter-spacing) that create reusable, consistent styles.",
|
|
7
|
+
"lifecycleState": "Stable",
|
|
8
|
+
"order": 999,
|
|
9
|
+
"repoPath": "packages/nimbus/src/components/text/text.mdx",
|
|
10
|
+
"menu": [
|
|
11
|
+
"Components",
|
|
12
|
+
"Typography",
|
|
13
|
+
"Text"
|
|
14
|
+
],
|
|
15
|
+
"route": "components/typography/text",
|
|
16
|
+
"tags": [
|
|
17
|
+
"component",
|
|
18
|
+
"typography",
|
|
19
|
+
"text"
|
|
20
|
+
],
|
|
21
|
+
"toc": [
|
|
22
|
+
{
|
|
23
|
+
"value": "Overview",
|
|
24
|
+
"href": "#overview",
|
|
25
|
+
"depth": 2,
|
|
26
|
+
"numbering": [
|
|
27
|
+
1,
|
|
28
|
+
1
|
|
29
|
+
],
|
|
30
|
+
"parent": "root"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"value": "Resources",
|
|
34
|
+
"href": "#resources",
|
|
35
|
+
"depth": 3,
|
|
36
|
+
"numbering": [
|
|
37
|
+
1,
|
|
38
|
+
1,
|
|
39
|
+
1
|
|
40
|
+
],
|
|
41
|
+
"parent": "root"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"value": "Variables",
|
|
45
|
+
"href": "#variables",
|
|
46
|
+
"depth": 2,
|
|
47
|
+
"numbering": [
|
|
48
|
+
1,
|
|
49
|
+
2
|
|
50
|
+
],
|
|
51
|
+
"parent": "root"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"value": "Typography scale and hierarchy",
|
|
55
|
+
"href": "#typography-scale-and-hierarchy",
|
|
56
|
+
"depth": 3,
|
|
57
|
+
"numbering": [
|
|
58
|
+
1,
|
|
59
|
+
2,
|
|
60
|
+
1
|
|
61
|
+
],
|
|
62
|
+
"parent": "root"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"value": "Text tones and semantic coloring",
|
|
66
|
+
"href": "#text-tones-and-semantic-coloring",
|
|
67
|
+
"depth": 3,
|
|
68
|
+
"numbering": [
|
|
69
|
+
1,
|
|
70
|
+
2,
|
|
71
|
+
2
|
|
72
|
+
],
|
|
73
|
+
"parent": "root"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"figmaLink": "https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?node-id=6041-23913&m=dev",
|
|
77
|
+
"layout": "app-frame",
|
|
78
|
+
"tabs": [
|
|
79
|
+
{
|
|
80
|
+
"key": "overview",
|
|
81
|
+
"title": "Overview",
|
|
82
|
+
"order": 0
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"key": "guidelines",
|
|
86
|
+
"title": "Guidelines",
|
|
87
|
+
"order": 2
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"key": "dev",
|
|
91
|
+
"title": "Implementation",
|
|
92
|
+
"order": 3
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"key": "a11y",
|
|
96
|
+
"title": "Accessibility",
|
|
97
|
+
"order": 4
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"mdx": "\n## Overview\n\nReadable and consistent text styling is important to creating effective user\nfriendly and efficient products. These styles and tools will help give the\nbuilding blocks and provide more options for creation, and there are still ways\nto allow for customization for the rare cases it is needed.\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?node-id=6041-23913&m=dev)\n\n## Variables\n\nGet familiar with the features.\n\n### Typography scale and hierarchy\n\nText styles here are recommended for most body styled text, and made to fit well\nwith component sizes. If you need to render large, bold text with a semantic\nmeaning, you should use the heading component instead.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Box>\n <Text as=\"span\" textStyle=\"md\">Paragraph md</Text>\n <Text as=\"span\"> - Primary body text, long descriptions, standard content blocks.</Text>\n </Box>\n <Box>\n <Text as=\"span\" textStyle=\"sm\">Paragraph sm</Text>\n <Text as=\"span\"> - Secondary text, metadata, table content.</Text>\n </Box>\n <Box>\n <Text as=\"span\" textStyle=\"xs\">Paragraph xs</Text>\n <Text as=\"span\"> - Tertiary content, small notes, timestamps.</Text>\n </Box>\n <Box>\n <Text as=\"span\" textStyle=\"caption\">CAPTION</Text>\n <Text as=\"span\"> - Used for specialized, tracked metadata. (Includes letter-spacing: 1px).</Text>\n </Box>\n </Stack>\n)\n```\n\n### Text tones and semantic coloring\n\nText tones use color to semantically convey status, intent, or hierarchy. The\ndefault tone is used for the majority of UI text.\n\n**Color Rule:** All colored font-color is always set to step 11 of the given\ncolor scale (e.g., tomato.11, indigo.11). This ensures high contrast and\naccessibility.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Box>\n <Text as=\"span\" color=\"fg\">Default tone</Text>\n <Text as=\"span\"> - Standard body copy, primary content.</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"fg.subtle\">Secondary</Text>\n <Text as=\"span\"> - Helper text, metadata, inactive or less important UI elements.</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"primary.11\">Primary</Text>\n <Text as=\"span\"> - Mainly used for links or branded messages.</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"info.11\">Info</Text>\n <Text as=\"span\"> - Non-critical feedback, system messages.</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"positive.11\">Positive</Text>\n <Text as=\"span\"> - Successful actions, positive status indicators (e.g., \"Complete,\" \"Saved\").</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"critical.11\">Critical</Text>\n <Text as=\"span\"> - Validation errors, destructive warnings, critical status indicators.</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"warning.11\">Warning</Text>\n <Text as=\"span\"> - Warnings, temporary issues, actions requiring review.</Text>\n </Box>\n </Stack>\n)\n```\n",
|
|
102
|
+
"views": {
|
|
103
|
+
"overview": {
|
|
104
|
+
"mdx": "\n## Overview\n\nReadable and consistent text styling is important to creating effective user\nfriendly and efficient products. These styles and tools will help give the\nbuilding blocks and provide more options for creation, and there are still ways\nto allow for customization for the rare cases it is needed.\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?node-id=6041-23913&m=dev)\n\n## Variables\n\nGet familiar with the features.\n\n### Typography scale and hierarchy\n\nText styles here are recommended for most body styled text, and made to fit well\nwith component sizes. If you need to render large, bold text with a semantic\nmeaning, you should use the heading component instead.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Box>\n <Text as=\"span\" textStyle=\"md\">Paragraph md</Text>\n <Text as=\"span\"> - Primary body text, long descriptions, standard content blocks.</Text>\n </Box>\n <Box>\n <Text as=\"span\" textStyle=\"sm\">Paragraph sm</Text>\n <Text as=\"span\"> - Secondary text, metadata, table content.</Text>\n </Box>\n <Box>\n <Text as=\"span\" textStyle=\"xs\">Paragraph xs</Text>\n <Text as=\"span\"> - Tertiary content, small notes, timestamps.</Text>\n </Box>\n <Box>\n <Text as=\"span\" textStyle=\"caption\">CAPTION</Text>\n <Text as=\"span\"> - Used for specialized, tracked metadata. (Includes letter-spacing: 1px).</Text>\n </Box>\n </Stack>\n)\n```\n\n### Text tones and semantic coloring\n\nText tones use color to semantically convey status, intent, or hierarchy. The\ndefault tone is used for the majority of UI text.\n\n**Color Rule:** All colored font-color is always set to step 11 of the given\ncolor scale (e.g., tomato.11, indigo.11). This ensures high contrast and\naccessibility.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Box>\n <Text as=\"span\" color=\"fg\">Default tone</Text>\n <Text as=\"span\"> - Standard body copy, primary content.</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"fg.subtle\">Secondary</Text>\n <Text as=\"span\"> - Helper text, metadata, inactive or less important UI elements.</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"primary.11\">Primary</Text>\n <Text as=\"span\"> - Mainly used for links or branded messages.</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"info.11\">Info</Text>\n <Text as=\"span\"> - Non-critical feedback, system messages.</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"positive.11\">Positive</Text>\n <Text as=\"span\"> - Successful actions, positive status indicators (e.g., \"Complete,\" \"Saved\").</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"critical.11\">Critical</Text>\n <Text as=\"span\"> - Validation errors, destructive warnings, critical status indicators.</Text>\n </Box>\n <Box>\n <Text as=\"span\" color=\"warning.11\">Warning</Text>\n <Text as=\"span\"> - Warnings, temporary issues, actions requiring review.</Text>\n </Box>\n </Stack>\n)\n```\n",
|
|
105
|
+
"toc": [
|
|
106
|
+
{
|
|
107
|
+
"value": "Overview",
|
|
108
|
+
"href": "#overview",
|
|
109
|
+
"depth": 2,
|
|
110
|
+
"numbering": [
|
|
111
|
+
1,
|
|
112
|
+
1
|
|
113
|
+
],
|
|
114
|
+
"parent": "root"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"value": "Resources",
|
|
118
|
+
"href": "#resources",
|
|
119
|
+
"depth": 3,
|
|
120
|
+
"numbering": [
|
|
121
|
+
1,
|
|
122
|
+
1,
|
|
123
|
+
1
|
|
124
|
+
],
|
|
125
|
+
"parent": "root"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"value": "Variables",
|
|
129
|
+
"href": "#variables",
|
|
130
|
+
"depth": 2,
|
|
131
|
+
"numbering": [
|
|
132
|
+
1,
|
|
133
|
+
2
|
|
134
|
+
],
|
|
135
|
+
"parent": "root"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"value": "Typography scale and hierarchy",
|
|
139
|
+
"href": "#typography-scale-and-hierarchy",
|
|
140
|
+
"depth": 3,
|
|
141
|
+
"numbering": [
|
|
142
|
+
1,
|
|
143
|
+
2,
|
|
144
|
+
1
|
|
145
|
+
],
|
|
146
|
+
"parent": "root"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"value": "Text tones and semantic coloring",
|
|
150
|
+
"href": "#text-tones-and-semantic-coloring",
|
|
151
|
+
"depth": 3,
|
|
152
|
+
"numbering": [
|
|
153
|
+
1,
|
|
154
|
+
2,
|
|
155
|
+
2
|
|
156
|
+
],
|
|
157
|
+
"parent": "root"
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
"a11y": {
|
|
162
|
+
"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 = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Text as=\"h2\" fontSize=\"600\" fontWeight=\"700\">Header text</Text>\n <Text>Body text</Text>\n <Text textTransform=\"uppercase\" letterSpacing=\"1px\" fontSize=\"350\">CAPTIONS</Text>\n </Stack>\n)\n```\n\n### Accessibility standards\n\n- **Contrast:** The explicit rule of using color step 11 for colored text\n ensures that colored text meets or exceeds minimum WCAG contrast ratios\n against light backgrounds.\n- **Semantic HTML:** Ensure that text styles map correctly to semantic HTML tags\n (e.g., Headlines should use `<h1>` through `<h6>`).\n- **Truncation:** For long body copy or component-specific labels, define clear\n rules for truncation (using ellipses) and ensure a tooltip reveals the full\n text on hover/focus.\n- **Avoid overlap:** Never overlap text elements or place complex colored\n backgrounds behind text, as this voids the consistent contrast guaranteed by\n the defined color scale.\n- **Scale usage:** Only use component-specific styles (e.g., button md) for\n their intended purpose; do not use them to style arbitrary body text.\n",
|
|
163
|
+
"toc": [
|
|
164
|
+
{
|
|
165
|
+
"value": "Accessibility",
|
|
166
|
+
"href": "#accessibility",
|
|
167
|
+
"depth": 2,
|
|
168
|
+
"numbering": [
|
|
169
|
+
1,
|
|
170
|
+
1
|
|
171
|
+
],
|
|
172
|
+
"parent": "root"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"value": "Accessibility standards",
|
|
176
|
+
"href": "#accessibility-standards",
|
|
177
|
+
"depth": 3,
|
|
178
|
+
"numbering": [
|
|
179
|
+
1,
|
|
180
|
+
1,
|
|
181
|
+
1
|
|
182
|
+
],
|
|
183
|
+
"parent": "root"
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"dev": {
|
|
188
|
+
"mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { Text, type TextProps } from '@commercetools/nimbus';\n```\n\n### Basic usage\n\nThe simplest implementation renders a paragraph element with default styling:\n\n```jsx live-dev\nconst App = () => {\n return <Text>This is basic text content.</Text>;\n};\n```\n\n## Usage examples\n\n### Typography scale\n\nThe `textStyle` prop applies predefined typography styles from the design system. These styles include font-size, line-height, and letter-spacing optimized for readability:\n\n```jsx live-dev\nconst App = () => {\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Text textStyle=\"md\">Paragraph md - Primary body text, long descriptions</Text>\n <Text textStyle=\"sm\">Paragraph sm - Secondary text, metadata, table content</Text>\n <Text textStyle=\"xs\">Paragraph xs - Tertiary content, small notes, timestamps</Text>\n <Text textStyle=\"caption\">CAPTION - Specialized metadata with letter spacing</Text>\n </Stack>\n );\n};\n```\n\n### Semantic color tones\n\nUse semantic color tokens to convey meaning and maintain consistent contrast ratios. All colored text uses step 11 of the color scale for accessibility:\n\n```jsx live-dev\nconst App = () => {\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Text color=\"fg\">Default - Standard body text</Text>\n <Text color=\"fg.subtle\">Secondary - Helper text and metadata</Text>\n <Text color=\"primary.11\">Primary - Links and branded messages</Text>\n <Text color=\"info.11\">Info - System messages and non-critical feedback</Text>\n <Text color=\"positive.11\">Positive - Success states and confirmations</Text>\n <Text color=\"warning.11\">Warning - Cautions and items requiring review</Text>\n <Text color=\"critical.11\">Critical - Errors and destructive actions</Text>\n </Stack>\n );\n};\n```\n\n### Polymorphic rendering\n\nUse the `as` prop to render Text as different HTML elements while maintaining the same styling API. This is essential for semantic HTML and accessibility:\n\n```jsx live-dev\nconst App = () => {\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Text as=\"p\">Renders as paragraph (default)</Text>\n <Text as=\"span\">Renders as inline span</Text>\n <Text as=\"div\">Renders as div block</Text>\n <Text as=\"label\" htmlFor=\"example-input\">\n Renders as form label\n </Text>\n <Text as=\"strong\" fontWeight=\"700\">\n Renders as strong (bold)\n </Text>\n <Text as=\"em\" fontStyle=\"italic\">\n Renders as emphasis (italic)\n </Text>\n </Stack>\n );\n};\n```\n\n### Custom styling\n\nText supports all Chakra UI style props, allowing you to customize typography beyond the predefined styles:\n\n```jsx live-dev\nconst App = () => {\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Text fontSize=\"450\" fontWeight=\"600\" lineHeight=\"1.4\">\n Custom font size and weight\n </Text>\n <Text letterSpacing=\"2px\" textTransform=\"uppercase\">\n Custom letter spacing\n </Text>\n <Text textDecoration=\"underline\" textDecorationStyle=\"dashed\">\n Custom text decoration\n </Text>\n <Text\n maxWidth=\"300px\"\n overflow=\"hidden\"\n textOverflow=\"ellipsis\"\n whiteSpace=\"nowrap\"\n >\n This text will truncate with an ellipsis when it exceeds the maximum width\n </Text>\n </Stack>\n );\n};\n```\n\n## Component requirements\n\n## Accessibility\n\nThe Text component provides semantic HTML text rendering. Use appropriate elements via the `as` prop to maintain document structure.\n\n**Semantic HTML best practices:**\n- Use `<p>` (default) for paragraphs\n- Use `<span>` for inline text\n- Use `<label>` for form field labels with `htmlFor` attribute\n- Use `<strong>` or `<em>` for emphasis\n- Avoid using `<div>` for text unless necessary for layout\n\n**Contrast requirements:**\nWhen using colored text, always use step 11 of the color scale (e.g., `primary.11`, `critical.11`) to ensure WCAG AA contrast ratios (4.5:1 minimum) against light backgrounds.\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 = \"product-description-text\";\n\nexport const ProductDescription = () => (\n <Text id={PERSISTENT_ID} textStyle=\"md\">\n Product details and specifications\n </Text>\n);\n```\n\n#### Keyboard navigation\n\nAs a non-interactive display component, Text does not require keyboard interaction.\n\n## API reference\n\n<PropsTable id=\"Text\" />\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using Text 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\n\nVerify that Text renders correctly with different content types\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Text, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Text - Basic rendering\", () => {\n it(\"renders text content\", () => {\n render(\n <NimbusProvider>\n <Text>Hello World</Text>\n </NimbusProvider>\n );\n\n expect(screen.getByText(\"Hello World\")).toBeInTheDocument();\n });\n\n it(\"renders with custom id for tracking\", () => {\n const PERSISTENT_ID = \"product-description-text\";\n\n render(\n <NimbusProvider>\n <Text id={PERSISTENT_ID}>Product description</Text>\n </NimbusProvider>\n );\n\n expect(screen.getByText(\"Product description\")).toHaveAttribute(\n \"id\",\n PERSISTENT_ID\n );\n });\n\n it(\"renders children elements\", () => {\n render(\n <NimbusProvider>\n <Text>\n Text with <strong>bold</strong> and <em>italic</em> content\n </Text>\n </NimbusProvider>\n );\n\n expect(screen.getByText(/Text with/)).toBeInTheDocument();\n expect(screen.getByText(\"bold\")).toBeInTheDocument();\n expect(screen.getByText(\"italic\")).toBeInTheDocument();\n });\n});\n```\n\n### Typography Scale\n\nTest different textStyle variants\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Text, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Text - Typography scale\", () => {\n it(\"applies textStyle variants\", () => {\n const { rerender } = render(\n <NimbusProvider>\n <Text textStyle=\"md\" data-testid=\"text-element\">\n Medium text\n </Text>\n </NimbusProvider>\n );\n\n const textElement = screen.getByTestId(\"text-element\");\n expect(textElement).toBeInTheDocument();\n\n // Test different textStyle values\n const textStyles = [\"sm\", \"xs\", \"caption\"] as const;\n textStyles.forEach((style) => {\n rerender(\n <NimbusProvider>\n <Text textStyle={style} data-testid=\"text-element\">\n {style} text\n </Text>\n </NimbusProvider>\n );\n expect(screen.getByTestId(\"text-element\")).toBeInTheDocument();\n });\n });\n\n it(\"combines textStyle with custom overrides\", () => {\n render(\n <NimbusProvider>\n <Text textStyle=\"sm\" fontWeight=\"700\">\n Bold small text\n </Text>\n </NimbusProvider>\n );\n\n expect(screen.getByText(\"Bold small text\")).toBeInTheDocument();\n });\n});\n```\n\n### Semantic Colors\n\nTest semantic color application\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Text, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Text - Semantic colors\", () => {\n it(\"applies semantic color tokens\", () => {\n const colors = [\n { color: \"fg\", label: \"Default text\" },\n { color: \"fg.subtle\", label: \"Secondary text\" },\n { color: \"primary.11\", label: \"Primary text\" },\n { color: \"info.11\", label: \"Info text\" },\n { color: \"positive.11\", label: \"Success text\" },\n { color: \"warning.11\", label: \"Warning text\" },\n { color: \"critical.11\", label: \"Error text\" },\n ] as const;\n\n render(\n <NimbusProvider>\n {colors.map(({ color, label }) => (\n <Text key={color} color={color}>\n {label}\n </Text>\n ))}\n </NimbusProvider>\n );\n\n colors.forEach(({ label }) => {\n expect(screen.getByText(label)).toBeInTheDocument();\n });\n });\n\n it(\"maintains contrast with colored text\", () => {\n render(\n <NimbusProvider>\n <Text color=\"critical.11\">Error message</Text>\n </NimbusProvider>\n );\n\n const errorText = screen.getByText(\"Error message\");\n expect(errorText).toBeInTheDocument();\n // In a real application, you would verify the actual computed color\n // meets WCAG contrast requirements against the background\n });\n});\n```\n\n### Polymorphic Rendering\n\nTest rendering as different HTML elements\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Text, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Text - Polymorphic rendering\", () => {\n it(\"renders as paragraph by default\", () => {\n const { container } = render(\n <NimbusProvider>\n <Text>Default paragraph</Text>\n </NimbusProvider>\n );\n\n const paragraph = container.querySelector(\"p\");\n expect(paragraph).toBeInTheDocument();\n expect(paragraph).toHaveTextContent(\"Default paragraph\");\n });\n\n it(\"renders as span when specified\", () => {\n const { container } = render(\n <NimbusProvider>\n <Text as=\"span\">Inline text</Text>\n </NimbusProvider>\n );\n\n const span = container.querySelector(\"span\");\n expect(span).toBeInTheDocument();\n expect(span).toHaveTextContent(\"Inline text\");\n });\n\n it(\"renders as label with htmlFor attribute\", () => {\n render(\n <NimbusProvider>\n {/* @ts-expect-error - TypeScript doesn't infer element-specific props with polymorphic as prop */}\n <Text as=\"label\" htmlFor=\"email-input\">\n Email Address\n </Text>\n </NimbusProvider>\n );\n\n const label = screen.getByText(\"Email Address\");\n expect(label.tagName).toBe(\"LABEL\");\n expect(label).toHaveAttribute(\"for\", \"email-input\");\n });\n\n it(\"renders as div for layout purposes\", () => {\n render(\n <NimbusProvider>\n <Text as=\"div\">Block text</Text>\n </NimbusProvider>\n );\n\n const text = screen.getByText(\"Block text\");\n expect(text).toBeInTheDocument();\n expect(text.tagName).toBe(\"DIV\");\n });\n});\n```\n\n### Custom Styling\n\nTest custom style prop application\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Text, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Text - Custom styling\", () => {\n it(\"applies custom typography styles\", () => {\n render(\n <NimbusProvider>\n <Text fontSize=\"450\" fontWeight=\"600\" letterSpacing=\"2px\">\n Custom styled text\n </Text>\n </NimbusProvider>\n );\n\n expect(screen.getByText(\"Custom styled text\")).toBeInTheDocument();\n });\n\n it(\"applies truncation styles\", () => {\n render(\n <NimbusProvider>\n <Text\n maxWidth=\"200px\"\n overflow=\"hidden\"\n textOverflow=\"ellipsis\"\n whiteSpace=\"nowrap\"\n >\n This is a very long text that should be truncated\n </Text>\n </NimbusProvider>\n );\n\n const text = screen.getByText(/This is a very long text/);\n expect(text).toBeInTheDocument();\n });\n\n it(\"applies text transformation\", () => {\n render(\n <NimbusProvider>\n <Text textTransform=\"uppercase\">uppercase text</Text>\n </NimbusProvider>\n );\n\n expect(screen.getByText(\"uppercase text\")).toBeInTheDocument();\n });\n\n it(\"applies responsive styles\", () => {\n render(\n <NimbusProvider>\n <Text fontSize={{ base: \"350\", md: \"400\", lg: \"450\" }}>\n Responsive text\n </Text>\n </NimbusProvider>\n );\n\n expect(screen.getByText(\"Responsive text\")).toBeInTheDocument();\n });\n});\n```\n\n### Accessibility\n\nVerify semantic HTML and accessibility features\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Text, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Text - Accessibility\", () => {\n it(\"maintains semantic structure with as prop\", () => {\n const { container } = render(\n <NimbusProvider>\n <Text as=\"strong\">Important text</Text>\n </NimbusProvider>\n );\n\n const strong = container.querySelector(\"strong\");\n expect(strong).toBeInTheDocument();\n expect(strong).toHaveTextContent(\"Important text\");\n });\n\n it(\"associates label with form control\", () => {\n render(\n <NimbusProvider>\n {/* @ts-expect-error - TypeScript doesn't infer element-specific props with polymorphic as prop */}\n <Text as=\"label\" htmlFor=\"username\">\n Username\n </Text>\n <input id=\"username\" type=\"text\" />\n </NimbusProvider>\n );\n\n const label = screen.getByText(\"Username\");\n const input = screen.getByRole(\"textbox\");\n\n expect(label).toHaveAttribute(\"for\", \"username\");\n expect(input).toHaveAttribute(\"id\", \"username\");\n });\n\n it(\"supports title attribute for truncated text\", () => {\n const longText = \"This is a very long text that will be truncated\";\n\n render(\n <NimbusProvider>\n <Text\n overflow=\"hidden\"\n textOverflow=\"ellipsis\"\n whiteSpace=\"nowrap\"\n title={longText}\n >\n {longText}\n </Text>\n </NimbusProvider>\n );\n\n const text = screen.getByText(longText);\n expect(text).toHaveAttribute(\"title\", longText);\n });\n});\n```\n\n\n## Resources\n\n- [Chakra UI Text Documentation](https://www.chakra-ui.com/docs/components/text)\n- [Heading Component](../components/typography/heading) - Related typography component\n",
|
|
189
|
+
"toc": [
|
|
190
|
+
{
|
|
191
|
+
"value": "Getting started",
|
|
192
|
+
"href": "#getting-started",
|
|
193
|
+
"depth": 2,
|
|
194
|
+
"numbering": [
|
|
195
|
+
1,
|
|
196
|
+
1
|
|
197
|
+
],
|
|
198
|
+
"parent": "root"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"value": "Import",
|
|
202
|
+
"href": "#import",
|
|
203
|
+
"depth": 3,
|
|
204
|
+
"numbering": [
|
|
205
|
+
1,
|
|
206
|
+
1,
|
|
207
|
+
1
|
|
208
|
+
],
|
|
209
|
+
"parent": "root"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"value": "Basic usage",
|
|
213
|
+
"href": "#basic-usage",
|
|
214
|
+
"depth": 3,
|
|
215
|
+
"numbering": [
|
|
216
|
+
1,
|
|
217
|
+
1,
|
|
218
|
+
2
|
|
219
|
+
],
|
|
220
|
+
"parent": "root"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"value": "Usage examples",
|
|
224
|
+
"href": "#usage-examples",
|
|
225
|
+
"depth": 2,
|
|
226
|
+
"numbering": [
|
|
227
|
+
1,
|
|
228
|
+
2
|
|
229
|
+
],
|
|
230
|
+
"parent": "root"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"value": "Typography scale",
|
|
234
|
+
"href": "#typography-scale",
|
|
235
|
+
"depth": 3,
|
|
236
|
+
"numbering": [
|
|
237
|
+
1,
|
|
238
|
+
2,
|
|
239
|
+
1
|
|
240
|
+
],
|
|
241
|
+
"parent": "root"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"value": "Semantic color tones",
|
|
245
|
+
"href": "#semantic-color-tones",
|
|
246
|
+
"depth": 3,
|
|
247
|
+
"numbering": [
|
|
248
|
+
1,
|
|
249
|
+
2,
|
|
250
|
+
2
|
|
251
|
+
],
|
|
252
|
+
"parent": "root"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"value": "Polymorphic rendering",
|
|
256
|
+
"href": "#polymorphic-rendering",
|
|
257
|
+
"depth": 3,
|
|
258
|
+
"numbering": [
|
|
259
|
+
1,
|
|
260
|
+
2,
|
|
261
|
+
3
|
|
262
|
+
],
|
|
263
|
+
"parent": "root"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"value": "Custom styling",
|
|
267
|
+
"href": "#custom-styling",
|
|
268
|
+
"depth": 3,
|
|
269
|
+
"numbering": [
|
|
270
|
+
1,
|
|
271
|
+
2,
|
|
272
|
+
4
|
|
273
|
+
],
|
|
274
|
+
"parent": "root"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"value": "Component requirements",
|
|
278
|
+
"href": "#component-requirements",
|
|
279
|
+
"depth": 2,
|
|
280
|
+
"numbering": [
|
|
281
|
+
1,
|
|
282
|
+
3
|
|
283
|
+
],
|
|
284
|
+
"parent": "root"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"value": "Accessibility",
|
|
288
|
+
"href": "#accessibility",
|
|
289
|
+
"depth": 2,
|
|
290
|
+
"numbering": [
|
|
291
|
+
1,
|
|
292
|
+
4
|
|
293
|
+
],
|
|
294
|
+
"parent": "root"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"value": "Keyboard navigation",
|
|
298
|
+
"href": "#keyboard-navigation",
|
|
299
|
+
"depth": 4,
|
|
300
|
+
"numbering": [
|
|
301
|
+
1,
|
|
302
|
+
4,
|
|
303
|
+
1,
|
|
304
|
+
1
|
|
305
|
+
],
|
|
306
|
+
"parent": "root"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"value": "API reference",
|
|
310
|
+
"href": "#api-reference",
|
|
311
|
+
"depth": 2,
|
|
312
|
+
"numbering": [
|
|
313
|
+
1,
|
|
314
|
+
5
|
|
315
|
+
],
|
|
316
|
+
"parent": "root"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"value": "Testing your implementation",
|
|
320
|
+
"href": "#testing-your-implementation",
|
|
321
|
+
"depth": 2,
|
|
322
|
+
"numbering": [
|
|
323
|
+
1,
|
|
324
|
+
6
|
|
325
|
+
],
|
|
326
|
+
"parent": "root"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"value": "Basic Rendering",
|
|
330
|
+
"href": "#basic-rendering",
|
|
331
|
+
"depth": 3,
|
|
332
|
+
"numbering": [
|
|
333
|
+
1,
|
|
334
|
+
6,
|
|
335
|
+
1
|
|
336
|
+
],
|
|
337
|
+
"parent": "root"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"value": "Typography Scale",
|
|
341
|
+
"href": "#typography-scale-1",
|
|
342
|
+
"depth": 3,
|
|
343
|
+
"numbering": [
|
|
344
|
+
1,
|
|
345
|
+
6,
|
|
346
|
+
2
|
|
347
|
+
],
|
|
348
|
+
"parent": "root"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"value": "Semantic Colors",
|
|
352
|
+
"href": "#semantic-colors",
|
|
353
|
+
"depth": 3,
|
|
354
|
+
"numbering": [
|
|
355
|
+
1,
|
|
356
|
+
6,
|
|
357
|
+
3
|
|
358
|
+
],
|
|
359
|
+
"parent": "root"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"value": "Polymorphic Rendering",
|
|
363
|
+
"href": "#polymorphic-rendering-1",
|
|
364
|
+
"depth": 3,
|
|
365
|
+
"numbering": [
|
|
366
|
+
1,
|
|
367
|
+
6,
|
|
368
|
+
4
|
|
369
|
+
],
|
|
370
|
+
"parent": "root"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"value": "Custom Styling",
|
|
374
|
+
"href": "#custom-styling-1",
|
|
375
|
+
"depth": 3,
|
|
376
|
+
"numbering": [
|
|
377
|
+
1,
|
|
378
|
+
6,
|
|
379
|
+
5
|
|
380
|
+
],
|
|
381
|
+
"parent": "root"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"value": "Accessibility",
|
|
385
|
+
"href": "#accessibility-1",
|
|
386
|
+
"depth": 3,
|
|
387
|
+
"numbering": [
|
|
388
|
+
1,
|
|
389
|
+
6,
|
|
390
|
+
6
|
|
391
|
+
],
|
|
392
|
+
"parent": "root"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"value": "Resources",
|
|
396
|
+
"href": "#resources",
|
|
397
|
+
"depth": 2,
|
|
398
|
+
"numbering": [
|
|
399
|
+
1,
|
|
400
|
+
7
|
|
401
|
+
],
|
|
402
|
+
"parent": "root"
|
|
403
|
+
}
|
|
404
|
+
]
|
|
405
|
+
},
|
|
406
|
+
"guidelines": {
|
|
407
|
+
"mdx": "\n## Guidelines\n\nThe purpose of these guidelines is to establish a clear typographic hierarchy,\noptimize content readability, and enforce accessibility standards.\n\n### Best practices\n\n- **Keep hierarchy consistent:** Use a limited, predefined set of text styles to\n maintain visual consistency across all products. Add custom styles with\n caution.\n- **Prioritize line length:** Use optimal line lengths (typically 50 to 75\n characters per line) to prevent eye strain and facilitate reading.\n- **Use concise language:** Write clearly, avoiding unnecessary jargon or overly\n long sentences to reduce cognitive load.\n- **Break up content:** Use short paragraphs, lists, and headings to break up\n large blocks of text, making content easier to scan.\n- **Maintain consistent tone:** The language, style, and formality should be\n consistent throughout the application, reflecting the brand's voice.\n- **Handle truncation gracefully:** When necessary, truncate long text with\n ellipses and provide a tooltip or interaction element to reveal the full\n content.\n- **Keep length in mind for translation:** When supporting text localization,\n length can expand more than 20%. Design experiences that can be flexible to\n shortening and lengthening of content.\n\n### Text Do's and Don'ts\n\n> [!TIP]\\\n> **Do**\n>\n> - Use predefined headings, body sizes, and weights to clearly signal the\n> importance of content.\n> - Always maintain sufficient contrast between text and its background to meet\n> WCAG AA standards (4.5:1 minimum).\n> - Keep line length between 50 to 75 characters to maximize reading speed and\n> comfort.\n> - Ensure adequate vertical spacing (line-height) to prevent text lines from\n> colliding and improve readability.\n> - Write clearly, avoiding unnecessary jargon and overly long sentences.\n> - Utilize short paragraphs, bullet points, and headings to make content\n> scannable.\n> - Ensure any text used within images or icons has a text alternative or\n> aria-label for screen readers.\n\n> [!CAUTION]\\\n> **Don't**\n>\n> - Avoid introducing too many different font sizes, weights, or families, which\n> destroys visual consistency.\n> - Never use color as the only method to convey meaning (e.g., indicating an\n> error solely with red text).\n> - Avoid excessively long lines of text (over 80 characters), which makes\n> tracking difficult and causes fatigue.\n> - Avoid line heights that are too small, which makes text visually dense and\n> difficult to read.\n> - Never truncate text without providing a clear way (like a tooltip) to view\n> the full content.\n> - Avoid pairing text colors that barely distinguish themselves from the\n> background, even if they look \"stylish.\"\n> - Stick to the approved typeface(s) in your design system.\n",
|
|
408
|
+
"toc": [
|
|
409
|
+
{
|
|
410
|
+
"value": "Guidelines",
|
|
411
|
+
"href": "#guidelines",
|
|
412
|
+
"depth": 2,
|
|
413
|
+
"numbering": [
|
|
414
|
+
1,
|
|
415
|
+
1
|
|
416
|
+
],
|
|
417
|
+
"parent": "root"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"value": "Best practices",
|
|
421
|
+
"href": "#best-practices",
|
|
422
|
+
"depth": 3,
|
|
423
|
+
"numbering": [
|
|
424
|
+
1,
|
|
425
|
+
1,
|
|
426
|
+
1
|
|
427
|
+
],
|
|
428
|
+
"parent": "root"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"value": "Text Do's and Don'ts",
|
|
432
|
+
"href": "#text-dos-and-donts",
|
|
433
|
+
"depth": 3,
|
|
434
|
+
"numbering": [
|
|
435
|
+
1,
|
|
436
|
+
1,
|
|
437
|
+
2
|
|
438
|
+
],
|
|
439
|
+
"parent": "root"
|
|
440
|
+
}
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"id": "Components-Typography",
|
|
4
|
+
"title": "Typography",
|
|
5
|
+
"description": "Components for text styling and formatting.",
|
|
6
|
+
"order": 7,
|
|
7
|
+
"repoPath": "packages/nimbus/src/docs/typography.mdx",
|
|
8
|
+
"menu": [
|
|
9
|
+
"Components",
|
|
10
|
+
"Typography"
|
|
11
|
+
],
|
|
12
|
+
"route": "components/typography",
|
|
13
|
+
"tags": [
|
|
14
|
+
"document"
|
|
15
|
+
],
|
|
16
|
+
"toc": [],
|
|
17
|
+
"icon": "FontDownload",
|
|
18
|
+
"layout": "app-frame",
|
|
19
|
+
"tabs": [
|
|
20
|
+
{
|
|
21
|
+
"key": "overview",
|
|
22
|
+
"title": "Overview",
|
|
23
|
+
"order": 0
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"mdx": "\n# Typography\n\nComponents for text styling and formatting.\n\n<CategoryOverview variant=\"list\" />\n",
|
|
28
|
+
"views": {
|
|
29
|
+
"overview": {
|
|
30
|
+
"mdx": "\n# Typography\n\nComponents for text styling and formatting.\n\n<CategoryOverview variant=\"list\" />\n",
|
|
31
|
+
"toc": []
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|