@commercetools/nimbus-mcp 0.1.0 → 2.11.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 +10998 -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-scrollarea.json +428 -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 +179 -0
- package/data/docs/types/ScrollAreaElementIds.json +9 -0
- package/data/docs/types/ScrollAreaProps.json +9 -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 +280 -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,599 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"id": "Components-RichTextInput",
|
|
4
|
+
"title": "Rich text input",
|
|
5
|
+
"exportName": "RichTextInput",
|
|
6
|
+
"description": "The rich text input component allows users to input and format text using a user friendly interface. Changing standard text inputs into fully featured edits, supporting formatting, linking, and embedding.",
|
|
7
|
+
"lifecycleState": "Stable",
|
|
8
|
+
"order": 999,
|
|
9
|
+
"repoPath": "packages/nimbus/src/components/rich-text-input/rich-text-input.mdx",
|
|
10
|
+
"menu": [
|
|
11
|
+
"Components",
|
|
12
|
+
"Inputs",
|
|
13
|
+
"Rich text input"
|
|
14
|
+
],
|
|
15
|
+
"route": "components/inputs/rich-text-input",
|
|
16
|
+
"tags": [
|
|
17
|
+
"component",
|
|
18
|
+
"rich-text",
|
|
19
|
+
"editor",
|
|
20
|
+
"formatting"
|
|
21
|
+
],
|
|
22
|
+
"toc": [
|
|
23
|
+
{
|
|
24
|
+
"value": "Overview",
|
|
25
|
+
"href": "#overview",
|
|
26
|
+
"depth": 2,
|
|
27
|
+
"numbering": [
|
|
28
|
+
1,
|
|
29
|
+
1
|
|
30
|
+
],
|
|
31
|
+
"parent": "root"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"value": "Resources",
|
|
35
|
+
"href": "#resources",
|
|
36
|
+
"depth": 3,
|
|
37
|
+
"numbering": [
|
|
38
|
+
1,
|
|
39
|
+
1,
|
|
40
|
+
1
|
|
41
|
+
],
|
|
42
|
+
"parent": "root"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"value": "Variables",
|
|
46
|
+
"href": "#variables",
|
|
47
|
+
"depth": 2,
|
|
48
|
+
"numbering": [
|
|
49
|
+
1,
|
|
50
|
+
2
|
|
51
|
+
],
|
|
52
|
+
"parent": "root"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"value": "Toolbar features",
|
|
56
|
+
"href": "#toolbar-features",
|
|
57
|
+
"depth": 3,
|
|
58
|
+
"numbering": [
|
|
59
|
+
1,
|
|
60
|
+
2,
|
|
61
|
+
1
|
|
62
|
+
],
|
|
63
|
+
"parent": "root"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"value": "Minimum and maximum height",
|
|
67
|
+
"href": "#minimum-and-maximum-height",
|
|
68
|
+
"depth": 3,
|
|
69
|
+
"numbering": [
|
|
70
|
+
1,
|
|
71
|
+
2,
|
|
72
|
+
2
|
|
73
|
+
],
|
|
74
|
+
"parent": "root"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"figmaLink": "https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?node-id=7190-34429&m=dev",
|
|
78
|
+
"layout": "app-frame",
|
|
79
|
+
"tabs": [
|
|
80
|
+
{
|
|
81
|
+
"key": "overview",
|
|
82
|
+
"title": "Overview",
|
|
83
|
+
"order": 0
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"key": "guidelines",
|
|
87
|
+
"title": "Guidelines",
|
|
88
|
+
"order": 2
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"key": "dev",
|
|
92
|
+
"title": "Implementation",
|
|
93
|
+
"order": 3
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"key": "a11y",
|
|
97
|
+
"title": "Accessibility",
|
|
98
|
+
"order": 4
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"mdx": "\n## Overview\n\nRich text input is made of two parts, the input where users can add text, and a\ntoolbar. This toolbar has been arranged to suit user's needs for text editing.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Slate.js Documentation](https://docs.slatejs.org/)\n[Figma library](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?node-id=7190-34429&m=dev)\n\n## Variables\n\nGet familiar with the features.\n\n### Toolbar features\n\nUsers can change type styles, toggle bold, italics, underline, strikethrough,\ncode sections, superscript, subscript, bullet points and numbered lists. Undo\nand redo buttons are icon buttons.\n\n```jsx live\nconst App = () => {\n const [value, setValue] = React.useState(\"<p><strong>Nimbus</strong> dolor sit amet, consectetur adipiscing elit. Aliquam <em>component</em> felis, vel consistency elementum. Sed design tokens ut turpis ac <u>user experience</u> maximus. Integer accessibility vitae nibh id clarity interface tincidunt.</p>\");\n\n return (\n <RichTextInput\n value={value}\n onChange={setValue}\n placeholder=\"Try formatting some text...\"\n />\n );\n};\n```\n\n### Minimum and maximum height\n\nThese can be fully configured as needed. Toolbar should remain sticky to the top\nof the input. Set the minimum height to ensure at least a few lines of content\nare visible.\n\n```jsx live\nconst App = () => {\n const [value, setValue] = React.useState(\"<p>Nimbus dolor sit amet, consectetur adipiscing elit. Aliquam component felis, vel consistency elementum. Sed design tokens ut turpis ac user experience maximus. Integer accessibility vitae nibh id clarity interface tincidunt.</p>\");\n\n return (\n <RichTextInput\n minHeight=\"7200\"\n maxHeight=\"9600\"\n value={value}\n onChange={setValue}\n placeholder=\"Start typing...\"\n />\n );\n};\n```\n",
|
|
103
|
+
"views": {
|
|
104
|
+
"overview": {
|
|
105
|
+
"mdx": "\n## Overview\n\nRich text input is made of two parts, the input where users can add text, and a\ntoolbar. This toolbar has been arranged to suit user's needs for text editing.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Slate.js Documentation](https://docs.slatejs.org/)\n[Figma library](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?node-id=7190-34429&m=dev)\n\n## Variables\n\nGet familiar with the features.\n\n### Toolbar features\n\nUsers can change type styles, toggle bold, italics, underline, strikethrough,\ncode sections, superscript, subscript, bullet points and numbered lists. Undo\nand redo buttons are icon buttons.\n\n```jsx live\nconst App = () => {\n const [value, setValue] = React.useState(\"<p><strong>Nimbus</strong> dolor sit amet, consectetur adipiscing elit. Aliquam <em>component</em> felis, vel consistency elementum. Sed design tokens ut turpis ac <u>user experience</u> maximus. Integer accessibility vitae nibh id clarity interface tincidunt.</p>\");\n\n return (\n <RichTextInput\n value={value}\n onChange={setValue}\n placeholder=\"Try formatting some text...\"\n />\n );\n};\n```\n\n### Minimum and maximum height\n\nThese can be fully configured as needed. Toolbar should remain sticky to the top\nof the input. Set the minimum height to ensure at least a few lines of content\nare visible.\n\n```jsx live\nconst App = () => {\n const [value, setValue] = React.useState(\"<p>Nimbus dolor sit amet, consectetur adipiscing elit. Aliquam component felis, vel consistency elementum. Sed design tokens ut turpis ac user experience maximus. Integer accessibility vitae nibh id clarity interface tincidunt.</p>\");\n\n return (\n <RichTextInput\n minHeight=\"7200\"\n maxHeight=\"9600\"\n value={value}\n onChange={setValue}\n placeholder=\"Start typing...\"\n />\n );\n};\n```\n",
|
|
106
|
+
"toc": [
|
|
107
|
+
{
|
|
108
|
+
"value": "Overview",
|
|
109
|
+
"href": "#overview",
|
|
110
|
+
"depth": 2,
|
|
111
|
+
"numbering": [
|
|
112
|
+
1,
|
|
113
|
+
1
|
|
114
|
+
],
|
|
115
|
+
"parent": "root"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"value": "Resources",
|
|
119
|
+
"href": "#resources",
|
|
120
|
+
"depth": 3,
|
|
121
|
+
"numbering": [
|
|
122
|
+
1,
|
|
123
|
+
1,
|
|
124
|
+
1
|
|
125
|
+
],
|
|
126
|
+
"parent": "root"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"value": "Variables",
|
|
130
|
+
"href": "#variables",
|
|
131
|
+
"depth": 2,
|
|
132
|
+
"numbering": [
|
|
133
|
+
1,
|
|
134
|
+
2
|
|
135
|
+
],
|
|
136
|
+
"parent": "root"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"value": "Toolbar features",
|
|
140
|
+
"href": "#toolbar-features",
|
|
141
|
+
"depth": 3,
|
|
142
|
+
"numbering": [
|
|
143
|
+
1,
|
|
144
|
+
2,
|
|
145
|
+
1
|
|
146
|
+
],
|
|
147
|
+
"parent": "root"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"value": "Minimum and maximum height",
|
|
151
|
+
"href": "#minimum-and-maximum-height",
|
|
152
|
+
"depth": 3,
|
|
153
|
+
"numbering": [
|
|
154
|
+
1,
|
|
155
|
+
2,
|
|
156
|
+
2
|
|
157
|
+
],
|
|
158
|
+
"parent": "root"
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
"a11y": {
|
|
163
|
+
"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 const [value, setValue] = React.useState(\"\");\n\n return (\n <RichTextInput\n value={value}\n onChange={setValue}\n placeholder=\"Start typing...\"\n />\n );\n};\n```\n\n### Accessibility standards\n\n- **Semantic markup:** Ensure the editor outputs semantic HTML (e.g., `<h1>`,\n `<ul>`, `<strong>`) to be correctly interpreted by screen readers.\n- **Keyboard access:** Ensure all toolbar controls are accessible via the tab\n key. Users must be able to navigate and apply formatting without a mouse.\n- **ARIA:** Apply appropriate ARIA attributes to the toolbar and its controls,\n such as `aria-label` for toggle icon buttons.\n",
|
|
164
|
+
"toc": [
|
|
165
|
+
{
|
|
166
|
+
"value": "Accessibility",
|
|
167
|
+
"href": "#accessibility",
|
|
168
|
+
"depth": 2,
|
|
169
|
+
"numbering": [
|
|
170
|
+
1,
|
|
171
|
+
1
|
|
172
|
+
],
|
|
173
|
+
"parent": "root"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"value": "Accessibility standards",
|
|
177
|
+
"href": "#accessibility-standards",
|
|
178
|
+
"depth": 3,
|
|
179
|
+
"numbering": [
|
|
180
|
+
1,
|
|
181
|
+
1,
|
|
182
|
+
1
|
|
183
|
+
],
|
|
184
|
+
"parent": "root"
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
"dev": {
|
|
189
|
+
"mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { RichTextInput, type RichTextInputProps } from '@commercetools/nimbus';\n```\n\n### Basic usage\n\nThe simplest implementation uses uncontrolled mode:\n\n```jsx live-dev\nconst App = () => (\n <RichTextInput placeholder=\"Start typing...\" />\n)\n```\n\n## Working with Slate.js and HTML values\n\nThe RichTextInput relies on Slate.js for rich text editing capabilities. Slate.js is a customizable framework for building rich text editors in React. While Slate.js uses its own internal data structure, RichTextInput handles conversion to and from HTML automatically.\n\n### HTML value format\n\nRichTextInput accepts and returns HTML strings for the `value`, `defaultValue`, and `onChange` props:\n\n```tsx\n// Example HTML value\nconst htmlValue = `\n<p>This is a <strong>paragraph</strong> with formatting.</p>\n<h2>This is a heading</h2>\n<ul>\n <li>List item 1</li>\n <li>List item 2</li>\n</ul>\n`;\n```\n\n### Supported HTML elements\n\nRichTextInput supports these HTML elements through the formatting toolbar:\n\n- **Paragraphs**: `<p>`\n- **Headings**: `<h1>`, `<h2>`, `<h3>`, `<h4>`, `<h5>`\n- **Text formatting**: `<strong>` (bold), `<em>` (italic), `<u>` (underline), `<del>` (strikethrough)\n- **Lists**: `<ul>` (unordered), `<ol>` (ordered), `<li>` (list items)\n- **Code**: `<code>` (inline), `<pre><code>` (code block)\n- **Quotes**: `<blockquote>`\n- **Links**: `<a href=\"...\">`\n- **Subscript/Superscript**: `<sub>`, `<sup>`\n\n### Internal conversion\n\nRichTextInput automatically handles conversion between HTML and Slate.js's internal format:\n\n1. **Input**: HTML string → Slate.js structure (when setting `value` or `defaultValue`)\n2. **Output**: Slate.js structure → HTML string (when calling `onChange`)\n\nYou don't need to work with Slate.js types directly - just provide and receive HTML strings.\n\n> [!TIP]\\\n> For advanced use cases requiring direct Slate.js manipulation, see the [Slate.js documentation](https://docs.slatejs.org/) for complete API reference.\n\n## Usage examples\n\n### Uncontrolled mode\n\nUse `defaultValue` for simple forms where you don't need to control the value:\n\n```jsx live-dev\nconst App = () => {\n const handleSubmit = (event) => {\n event.preventDefault();\n const formData = new FormData(event.currentTarget);\n const content = formData.get('content');\n console.log('Submitted content:', content);\n };\n\n return (\n <form onSubmit={handleSubmit}>\n <Stack direction=\"column\" gap=\"400\">\n <RichTextInput\n name=\"content\"\n defaultValue=\"<p>Edit this <strong>content</strong>!</p>\"\n placeholder=\"Enter your content...\"\n />\n <Button type=\"submit\">Submit</Button>\n </Stack>\n </form>\n );\n};\n```\n\n### Controlled mode\n\nUse `value` and `onChange` when you need to manage the editor state:\n\n```jsx live-dev\nconst App = () => {\n const [value, setValue] = React.useState<RichTextInputProps['value']>(\n '<p>This is <strong>controlled</strong> content.</p>'\n );\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <RichTextInput\n value={value}\n onChange={setValue}\n placeholder=\"Type something...\"\n />\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"600\">Current HTML value:</Text>\n <Box\n padding=\"300\"\n backgroundColor=\"neutral.2\"\n borderRadius=\"200\"\n maxHeight=\"200px\"\n overflow=\"auto\"\n >\n <Text fontFamily=\"mono\" fontSize=\"300\">\n {value}\n </Text>\n </Box>\n </Stack>\n </Stack>\n );\n};\n```\n\n### With placeholder\n\nShow helpful placeholder text when the editor is empty:\n\n```jsx live-dev\nconst App = () => (\n <RichTextInput placeholder=\"Enter your blog post content here...\" />\n)\n```\n\n### With default value\n\nInitialize the editor with existing content:\n\n```jsx live-dev\nconst App = () => (\n <RichTextInput\n defaultValue={`\n <h2>Welcome to Rich Text Editing</h2>\n <p>This editor supports <strong>bold</strong>, <em>italic</em>, and <u>underlined</u> text.</p>\n <ul>\n <li>Create bullet lists</li>\n <li>Format text with the toolbar</li>\n <li>Use keyboard shortcuts</li>\n </ul>\n `}\n />\n)\n```\n\n### Disabled state\n\nPrevent editing with the `isDisabled` prop:\n\n```jsx live-dev\nconst App = () => (\n <RichTextInput\n isDisabled\n defaultValue=\"<p>This editor is <strong>disabled</strong> and cannot be edited.</p>\"\n />\n)\n```\n\n### Read-only state\n\nDisplay content without editing capabilities (toolbar is hidden):\n\n```jsx live-dev\nconst App = () => (\n <RichTextInput\n isReadOnly\n defaultValue={`\n <h3>Read-Only Content</h3>\n <p>This content can be <strong>selected</strong> but not <em>edited</em>.</p>\n <p>Note: The toolbar is hidden in read-only mode.</p>\n `}\n />\n)\n```\n\n### Invalid state\n\nShow validation errors with the `isInvalid` prop:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"200\">\n <RichTextInput\n isInvalid\n placeholder=\"This field is required...\"\n />\n <Text color=\"critical.11\" fontSize=\"350\">\n Content is required\n </Text>\n </Stack>\n)\n```\n\n## Component requirements\n\n## Accessibility\n\nRichTextInput is built with accessibility in mind and follows WCAG 2.1 AA guidelines.\n\n#### Role\n\nThe editor exposes a `textbox` role with `contenteditable` for keyboard and screen reader accessibility.\n\n#### Labeling\n\nWhen using RichTextInput in forms, provide a visible label using FormField or a custom label element:\n\n```jsx live-dev\nconst App = () => (\n <FormField.Root>\n <FormField.Label>Article Content</FormField.Label>\n <FormField.Input>\n <RichTextInput placeholder=\"Write your article...\" />\n </FormField.Input>\n <FormField.Description>\n Use the toolbar to format your content\n </FormField.Description>\n </FormField.Root>\n)\n```\n\n#### Keyboard shortcuts\n\nRichTextInput supports standard keyboard shortcuts for formatting:\n\n| Shortcut | Action |\n|----------|--------|\n| `Cmd/Ctrl + B` | Toggle bold |\n| `Cmd/Ctrl + I` | Toggle italic |\n| `Cmd/Ctrl + U` | Toggle underline |\n| `Cmd/Ctrl + K` | Insert/edit link |\n| `Cmd/Ctrl + Z` | Undo |\n| `Cmd/Ctrl + Shift + Z` | Redo |\n| `Tab` | Navigate between toolbar buttons |\n| `Enter` | Activate focused toolbar button |\n\n#### Persistent ID\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\n<RichTextInput id=\"article-content-editor\" />\n```\n\n## API reference\n\n<PropsTable id=\"RichTextInput\" />\n\n## Common patterns\n\n### Form integration with validation\n\nIntegrate RichTextInput with form libraries:\n\n```jsx live-dev\nconst App = () => {\n const [content, setContent] = React.useState('');\n const [touched, setTouched] = React.useState(false);\n const [submitted, setSubmitted] = React.useState(false);\n\n const isEmpty = (html) => {\n const text = html.replace(/<[^>]*>/g, '').trim();\n return text.length === 0;\n };\n\n const error = (touched || submitted) && isEmpty(content)\n ? 'Content is required'\n : null;\n\n const handleSubmit = (event) => {\n event.preventDefault();\n setSubmitted(true);\n\n if (!isEmpty(content)) {\n console.log('Submitted:', content);\n alert('Form submitted successfully!');\n }\n };\n\n return (\n <form onSubmit={handleSubmit}>\n <Stack direction=\"column\" gap=\"400\">\n <FormField.Root isInvalid={!!error}>\n <FormField.Label isRequired>\n Article Content\n </FormField.Label>\n <FormField.Input>\n <RichTextInput\n value={content}\n onChange={setContent}\n onBlur={() => setTouched(true)}\n placeholder=\"Write your article...\"\n isInvalid={!!error}\n />\n </FormField.Input>\n <FormField.Description>\n Minimum 10 characters required\n </FormField.Description>\n {error && (\n <FormField.Error>{error}</FormField.Error>\n )}\n </FormField.Root>\n <Button type=\"submit\">Submit Article</Button>\n </Stack>\n </form>\n );\n};\n```\n\n### Content length validation\n\nValidate content length by parsing HTML:\n\n```jsx live-dev\nconst App = () => {\n const [content, setContent] = React.useState('');\n\n const getTextLength = (html) => {\n return html.replace(/<[^>]*>/g, '').trim().length;\n };\n\n const textLength = getTextLength(content);\n const minLength = 10;\n const maxLength = 500;\n const isValid = textLength >= minLength && textLength <= maxLength;\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <FormField.Root isInvalid={!isValid && textLength > 0}>\n <FormField.Label>Post Content</FormField.Label>\n <FormField.Input>\n <RichTextInput\n value={content}\n onChange={setContent}\n placeholder=\"Write your post...\"\n isInvalid={!isValid && textLength > 0}\n />\n </FormField.Input>\n <Stack direction=\"row\" justifyContent=\"space-between\">\n <FormField.Description>\n {textLength < minLength && textLength > 0\n ? `${minLength - textLength} more characters needed`\n : textLength > maxLength\n ? `${textLength - maxLength} characters over limit`\n : 'Character count within range'}\n </FormField.Description>\n <Text\n fontSize=\"350\"\n color={isValid || textLength === 0 ? 'neutral.11' : 'critical.11'}\n >\n {textLength} / {maxLength}\n </Text>\n </Stack>\n </FormField.Root>\n </Stack>\n );\n};\n```\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using RichTextInput in 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 Usage Tests\n\nTest basic RichTextInput rendering and HTML value handling\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen, waitFor } from \"@testing-library/react\";\nimport { useState } from \"react\";\nimport { RichTextInput, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"RichTextInput - Basic usage\", () => {\n it(\"renders with default HTML value\", () => {\n const initialContent = \"<p>Welcome to the <strong>editor</strong>!</p>\";\n\n render(\n <NimbusProvider>\n <RichTextInput defaultValue={initialContent} />\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n expect(editor).toHaveTextContent(\"Welcome to the editor!\");\n expect(editor.querySelector(\"strong\")).toHaveTextContent(\"editor\");\n });\n\n it(\"displays placeholder when empty\", async () => {\n render(\n <NimbusProvider>\n <RichTextInput placeholder=\"Start typing...\" />\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n // Slate.js uses data-slate-placeholder for empty state\n await waitFor(() => {\n const placeholder = editor.querySelector(\"[data-slate-placeholder]\");\n expect(placeholder).toBeInTheDocument();\n });\n });\n});\n```\n\n### Controlled vs Uncontrolled Tests\n\nTest controlled and uncontrolled component patterns\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen, waitFor } from \"@testing-library/react\";\nimport { useState } from \"react\";\nimport { RichTextInput, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"RichTextInput - Controlled vs Uncontrolled\", () => {\n it(\"works in uncontrolled mode with defaultValue\", () => {\n render(\n <NimbusProvider>\n <RichTextInput defaultValue=\"<p>Uncontrolled content</p>\" />\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n expect(editor).toHaveTextContent(\"Uncontrolled content\");\n });\n\n it(\"works in controlled mode with value and onChange\", () => {\n const TestComponent = () => {\n const [value, setValue] = useState(\"<p>Controlled content</p>\");\n return <RichTextInput value={value} onChange={setValue} />;\n };\n\n render(\n <NimbusProvider>\n <TestComponent />\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n expect(editor).toHaveTextContent(\"Controlled content\");\n });\n});\n```\n\n### HTML Format Support Tests\n\nTest different HTML formats and structures the component accepts\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen, waitFor } from \"@testing-library/react\";\nimport { useState } from \"react\";\nimport { RichTextInput, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"RichTextInput - HTML format support\", () => {\n it(\"renders text formatting (bold, italic, underline)\", () => {\n const html =\n \"<p>Plain <strong>bold</strong> <em>italic</em> <u>underline</u></p>\";\n\n render(\n <NimbusProvider>\n <RichTextInput defaultValue={html} />\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n expect(editor.querySelector(\"strong\")).toHaveTextContent(\"bold\");\n expect(editor.querySelector(\"em\")).toHaveTextContent(\"italic\");\n expect(editor.querySelector(\"u\")).toHaveTextContent(\"underline\");\n });\n\n it(\"renders headings (h1-h5)\", () => {\n const html = `\n <h1>Heading 1</h1>\n <h2>Heading 2</h2>\n <h3>Heading 3</h3>\n `;\n\n render(\n <NimbusProvider>\n <RichTextInput defaultValue={html} />\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n expect(editor.querySelector(\"h1\")).toHaveTextContent(\"Heading 1\");\n expect(editor.querySelector(\"h2\")).toHaveTextContent(\"Heading 2\");\n expect(editor.querySelector(\"h3\")).toHaveTextContent(\"Heading 3\");\n });\n\n it(\"renders lists (ordered and unordered)\", () => {\n const html = `\n <ul>\n <li>Bullet 1</li>\n <li>Bullet 2</li>\n </ul>\n <ol>\n <li>Number 1</li>\n <li>Number 2</li>\n </ol>\n `;\n\n render(\n <NimbusProvider>\n <RichTextInput defaultValue={html} />\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n const bulletList = editor.querySelector(\"ul\");\n const numberedList = editor.querySelector(\"ol\");\n\n expect(bulletList?.querySelectorAll(\"li\")).toHaveLength(2);\n expect(numberedList?.querySelectorAll(\"li\")).toHaveLength(2);\n });\n\n it(\"renders blockquotes and code\", () => {\n const html = `\n <blockquote>This is a quote</blockquote>\n <p>Inline <code>code</code> example</p>\n <pre><code>Block code example</code></pre>\n `;\n\n render(\n <NimbusProvider>\n <RichTextInput defaultValue={html} />\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n expect(editor.querySelector(\"blockquote\")).toHaveTextContent(\n \"This is a quote\"\n );\n expect(editor.querySelector(\"code\")).toHaveTextContent(\"code\");\n });\n});\n```\n\n### State Management Tests\n\nTest disabled, read-only, and invalid states\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen, waitFor } from \"@testing-library/react\";\nimport { useState } from \"react\";\nimport { RichTextInput, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"RichTextInput - State management\", () => {\n it(\"disables editor when isDisabled is true\", () => {\n render(\n <NimbusProvider>\n <RichTextInput isDisabled defaultValue=\"<p>Cannot edit this</p>\" />\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n expect(editor).toHaveAttribute(\"contenteditable\", \"false\");\n });\n\n it(\"hides toolbar in read-only mode\", () => {\n render(\n <NimbusProvider>\n <RichTextInput isReadOnly defaultValue=\"<p>Read-only content</p>\" />\n </NimbusProvider>\n );\n\n const toolbar = screen.queryByRole(\"toolbar\");\n expect(toolbar).not.toBeInTheDocument();\n });\n\n it(\"applies invalid styling for validation errors\", () => {\n const { container } = render(\n <NimbusProvider>\n <RichTextInput isInvalid />\n </NimbusProvider>\n );\n\n const root = container.querySelector('[role=\"group\"]');\n expect(root).toHaveAttribute(\"data-invalid\", \"true\");\n });\n});\n```\n\n### Form Validation Tests\n\nTest validation patterns and utility functions for forms\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen, waitFor } from \"@testing-library/react\";\nimport { useState } from \"react\";\nimport { RichTextInput, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"RichTextInput - Form validation\", () => {\n it(\"provides isEmpty utility for content validation\", () => {\n const isEmpty = (html: string) => {\n const text = html.replace(/<[^>]*>/g, \"\").trim();\n return text.length === 0;\n };\n\n // Empty states\n expect(isEmpty(\"\")).toBe(true);\n expect(isEmpty(\"<p></p>\")).toBe(true);\n expect(isEmpty(\"<p> </p>\")).toBe(true);\n\n // Non-empty states\n expect(isEmpty(\"<p>Content</p>\")).toBe(false);\n expect(isEmpty(\"<p> Content </p>\")).toBe(false);\n });\n\n it(\"provides getTextLength utility for character counting\", () => {\n const getTextLength = (html: string) => {\n return html.replace(/<[^>]*>/g, \"\").trim().length;\n };\n\n const html = \"<p>Hello <strong>world</strong>!</p>\";\n const length = getTextLength(html);\n\n // Should count only visible characters, not HTML tags\n expect(length).toBe(12); // \"Hello world!\" = 12 characters\n });\n\n it(\"integrates with form validation patterns\", () => {\n const isEmpty = (html: string) => {\n const text = html.replace(/<[^>]*>/g, \"\").trim();\n return text.length === 0;\n };\n\n const TestForm = () => {\n const [content, setContent] = useState(\"\");\n const [error, setError] = useState(\"\");\n\n const validate = () => {\n if (isEmpty(content)) {\n setError(\"Content is required\");\n } else {\n setError(\"\");\n }\n };\n\n return (\n <form>\n <RichTextInput\n value={content}\n onChange={setContent}\n isInvalid={!!error}\n aria-describedby={error ? \"error-message\" : undefined}\n />\n {error && (\n <div id=\"error-message\" role=\"alert\">\n {error}\n </div>\n )}\n <button type=\"button\" onClick={validate}>\n Validate\n </button>\n </form>\n );\n };\n\n render(\n <NimbusProvider>\n <TestForm />\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n expect(editor).toBeInTheDocument();\n expect(editor).toHaveAttribute(\"contenteditable\", \"true\");\n });\n});\n```\n\n### Accessibility Tests\n\nTest accessibility features and ARIA attributes\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen, waitFor } from \"@testing-library/react\";\nimport { useState } from \"react\";\nimport { RichTextInput, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"RichTextInput - Accessibility\", () => {\n it(\"provides textbox role for screen readers\", () => {\n render(\n <NimbusProvider>\n <RichTextInput />\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n expect(editor).toBeInTheDocument();\n });\n\n it(\"provides toolbar role for formatting controls\", () => {\n render(\n <NimbusProvider>\n <RichTextInput />\n </NimbusProvider>\n );\n\n const toolbar = screen.getByRole(\"toolbar\");\n expect(toolbar).toBeInTheDocument();\n });\n\n it(\"works with error messages for validation feedback\", () => {\n render(\n <NimbusProvider>\n <div>\n <RichTextInput isInvalid />\n <div role=\"alert\">Content is required</div>\n </div>\n </NimbusProvider>\n );\n\n const editor = screen.getByRole(\"textbox\");\n expect(editor).toBeInTheDocument();\n\n const errorMessage = screen.getByRole(\"alert\");\n expect(errorMessage).toHaveTextContent(\"Content is required\");\n });\n});\n```\n\n\n## Resources\n\n- [RichTextInput Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-richtextinput--docs)\n- [Slate.js Documentation](https://docs.slatejs.org/)\n- [FormField Component](/components/inputs/formfield)\n",
|
|
190
|
+
"toc": [
|
|
191
|
+
{
|
|
192
|
+
"value": "Getting started",
|
|
193
|
+
"href": "#getting-started",
|
|
194
|
+
"depth": 2,
|
|
195
|
+
"numbering": [
|
|
196
|
+
1,
|
|
197
|
+
1
|
|
198
|
+
],
|
|
199
|
+
"parent": "root"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"value": "Import",
|
|
203
|
+
"href": "#import",
|
|
204
|
+
"depth": 3,
|
|
205
|
+
"numbering": [
|
|
206
|
+
1,
|
|
207
|
+
1,
|
|
208
|
+
1
|
|
209
|
+
],
|
|
210
|
+
"parent": "root"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"value": "Basic usage",
|
|
214
|
+
"href": "#basic-usage",
|
|
215
|
+
"depth": 3,
|
|
216
|
+
"numbering": [
|
|
217
|
+
1,
|
|
218
|
+
1,
|
|
219
|
+
2
|
|
220
|
+
],
|
|
221
|
+
"parent": "root"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"value": "Working with Slate.js and HTML values",
|
|
225
|
+
"href": "#working-with-slatejs-and-html-values",
|
|
226
|
+
"depth": 2,
|
|
227
|
+
"numbering": [
|
|
228
|
+
1,
|
|
229
|
+
2
|
|
230
|
+
],
|
|
231
|
+
"parent": "root"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"value": "HTML value format",
|
|
235
|
+
"href": "#html-value-format",
|
|
236
|
+
"depth": 3,
|
|
237
|
+
"numbering": [
|
|
238
|
+
1,
|
|
239
|
+
2,
|
|
240
|
+
1
|
|
241
|
+
],
|
|
242
|
+
"parent": "root"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"value": "Supported HTML elements",
|
|
246
|
+
"href": "#supported-html-elements",
|
|
247
|
+
"depth": 3,
|
|
248
|
+
"numbering": [
|
|
249
|
+
1,
|
|
250
|
+
2,
|
|
251
|
+
2
|
|
252
|
+
],
|
|
253
|
+
"parent": "root"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"value": "Internal conversion",
|
|
257
|
+
"href": "#internal-conversion",
|
|
258
|
+
"depth": 3,
|
|
259
|
+
"numbering": [
|
|
260
|
+
1,
|
|
261
|
+
2,
|
|
262
|
+
3
|
|
263
|
+
],
|
|
264
|
+
"parent": "root"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"value": "Usage examples",
|
|
268
|
+
"href": "#usage-examples",
|
|
269
|
+
"depth": 2,
|
|
270
|
+
"numbering": [
|
|
271
|
+
1,
|
|
272
|
+
3
|
|
273
|
+
],
|
|
274
|
+
"parent": "root"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"value": "Uncontrolled mode",
|
|
278
|
+
"href": "#uncontrolled-mode",
|
|
279
|
+
"depth": 3,
|
|
280
|
+
"numbering": [
|
|
281
|
+
1,
|
|
282
|
+
3,
|
|
283
|
+
1
|
|
284
|
+
],
|
|
285
|
+
"parent": "root"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"value": "Controlled mode",
|
|
289
|
+
"href": "#controlled-mode",
|
|
290
|
+
"depth": 3,
|
|
291
|
+
"numbering": [
|
|
292
|
+
1,
|
|
293
|
+
3,
|
|
294
|
+
2
|
|
295
|
+
],
|
|
296
|
+
"parent": "root"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"value": "With placeholder",
|
|
300
|
+
"href": "#with-placeholder",
|
|
301
|
+
"depth": 3,
|
|
302
|
+
"numbering": [
|
|
303
|
+
1,
|
|
304
|
+
3,
|
|
305
|
+
3
|
|
306
|
+
],
|
|
307
|
+
"parent": "root"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"value": "With default value",
|
|
311
|
+
"href": "#with-default-value",
|
|
312
|
+
"depth": 3,
|
|
313
|
+
"numbering": [
|
|
314
|
+
1,
|
|
315
|
+
3,
|
|
316
|
+
4
|
|
317
|
+
],
|
|
318
|
+
"parent": "root"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"value": "Disabled state",
|
|
322
|
+
"href": "#disabled-state",
|
|
323
|
+
"depth": 3,
|
|
324
|
+
"numbering": [
|
|
325
|
+
1,
|
|
326
|
+
3,
|
|
327
|
+
5
|
|
328
|
+
],
|
|
329
|
+
"parent": "root"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"value": "Read-only state",
|
|
333
|
+
"href": "#read-only-state",
|
|
334
|
+
"depth": 3,
|
|
335
|
+
"numbering": [
|
|
336
|
+
1,
|
|
337
|
+
3,
|
|
338
|
+
6
|
|
339
|
+
],
|
|
340
|
+
"parent": "root"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"value": "Invalid state",
|
|
344
|
+
"href": "#invalid-state",
|
|
345
|
+
"depth": 3,
|
|
346
|
+
"numbering": [
|
|
347
|
+
1,
|
|
348
|
+
3,
|
|
349
|
+
7
|
|
350
|
+
],
|
|
351
|
+
"parent": "root"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"value": "Component requirements",
|
|
355
|
+
"href": "#component-requirements",
|
|
356
|
+
"depth": 2,
|
|
357
|
+
"numbering": [
|
|
358
|
+
1,
|
|
359
|
+
4
|
|
360
|
+
],
|
|
361
|
+
"parent": "root"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"value": "Accessibility",
|
|
365
|
+
"href": "#accessibility",
|
|
366
|
+
"depth": 2,
|
|
367
|
+
"numbering": [
|
|
368
|
+
1,
|
|
369
|
+
5
|
|
370
|
+
],
|
|
371
|
+
"parent": "root"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"value": "Role",
|
|
375
|
+
"href": "#role",
|
|
376
|
+
"depth": 4,
|
|
377
|
+
"numbering": [
|
|
378
|
+
1,
|
|
379
|
+
5,
|
|
380
|
+
1,
|
|
381
|
+
1
|
|
382
|
+
],
|
|
383
|
+
"parent": "root"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"value": "Labeling",
|
|
387
|
+
"href": "#labeling",
|
|
388
|
+
"depth": 4,
|
|
389
|
+
"numbering": [
|
|
390
|
+
1,
|
|
391
|
+
5,
|
|
392
|
+
1,
|
|
393
|
+
2
|
|
394
|
+
],
|
|
395
|
+
"parent": "root"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"value": "Keyboard shortcuts",
|
|
399
|
+
"href": "#keyboard-shortcuts",
|
|
400
|
+
"depth": 4,
|
|
401
|
+
"numbering": [
|
|
402
|
+
1,
|
|
403
|
+
5,
|
|
404
|
+
1,
|
|
405
|
+
3
|
|
406
|
+
],
|
|
407
|
+
"parent": "root"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"value": "Persistent ID",
|
|
411
|
+
"href": "#persistent-id",
|
|
412
|
+
"depth": 4,
|
|
413
|
+
"numbering": [
|
|
414
|
+
1,
|
|
415
|
+
5,
|
|
416
|
+
1,
|
|
417
|
+
4
|
|
418
|
+
],
|
|
419
|
+
"parent": "root"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"value": "API reference",
|
|
423
|
+
"href": "#api-reference",
|
|
424
|
+
"depth": 2,
|
|
425
|
+
"numbering": [
|
|
426
|
+
1,
|
|
427
|
+
6
|
|
428
|
+
],
|
|
429
|
+
"parent": "root"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"value": "Common patterns",
|
|
433
|
+
"href": "#common-patterns",
|
|
434
|
+
"depth": 2,
|
|
435
|
+
"numbering": [
|
|
436
|
+
1,
|
|
437
|
+
7
|
|
438
|
+
],
|
|
439
|
+
"parent": "root"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"value": "Form integration with validation",
|
|
443
|
+
"href": "#form-integration-with-validation",
|
|
444
|
+
"depth": 3,
|
|
445
|
+
"numbering": [
|
|
446
|
+
1,
|
|
447
|
+
7,
|
|
448
|
+
1
|
|
449
|
+
],
|
|
450
|
+
"parent": "root"
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
"value": "Content length validation",
|
|
454
|
+
"href": "#content-length-validation",
|
|
455
|
+
"depth": 3,
|
|
456
|
+
"numbering": [
|
|
457
|
+
1,
|
|
458
|
+
7,
|
|
459
|
+
2
|
|
460
|
+
],
|
|
461
|
+
"parent": "root"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"value": "Testing your implementation",
|
|
465
|
+
"href": "#testing-your-implementation",
|
|
466
|
+
"depth": 2,
|
|
467
|
+
"numbering": [
|
|
468
|
+
1,
|
|
469
|
+
8
|
|
470
|
+
],
|
|
471
|
+
"parent": "root"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"value": "Basic Usage Tests",
|
|
475
|
+
"href": "#basic-usage-tests",
|
|
476
|
+
"depth": 3,
|
|
477
|
+
"numbering": [
|
|
478
|
+
1,
|
|
479
|
+
8,
|
|
480
|
+
1
|
|
481
|
+
],
|
|
482
|
+
"parent": "root"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"value": "Controlled vs Uncontrolled Tests",
|
|
486
|
+
"href": "#controlled-vs-uncontrolled-tests",
|
|
487
|
+
"depth": 3,
|
|
488
|
+
"numbering": [
|
|
489
|
+
1,
|
|
490
|
+
8,
|
|
491
|
+
2
|
|
492
|
+
],
|
|
493
|
+
"parent": "root"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"value": "HTML Format Support Tests",
|
|
497
|
+
"href": "#html-format-support-tests",
|
|
498
|
+
"depth": 3,
|
|
499
|
+
"numbering": [
|
|
500
|
+
1,
|
|
501
|
+
8,
|
|
502
|
+
3
|
|
503
|
+
],
|
|
504
|
+
"parent": "root"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"value": "State Management Tests",
|
|
508
|
+
"href": "#state-management-tests",
|
|
509
|
+
"depth": 3,
|
|
510
|
+
"numbering": [
|
|
511
|
+
1,
|
|
512
|
+
8,
|
|
513
|
+
4
|
|
514
|
+
],
|
|
515
|
+
"parent": "root"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"value": "Form Validation Tests",
|
|
519
|
+
"href": "#form-validation-tests",
|
|
520
|
+
"depth": 3,
|
|
521
|
+
"numbering": [
|
|
522
|
+
1,
|
|
523
|
+
8,
|
|
524
|
+
5
|
|
525
|
+
],
|
|
526
|
+
"parent": "root"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"value": "Accessibility Tests",
|
|
530
|
+
"href": "#accessibility-tests",
|
|
531
|
+
"depth": 3,
|
|
532
|
+
"numbering": [
|
|
533
|
+
1,
|
|
534
|
+
8,
|
|
535
|
+
6
|
|
536
|
+
],
|
|
537
|
+
"parent": "root"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"value": "Resources",
|
|
541
|
+
"href": "#resources",
|
|
542
|
+
"depth": 2,
|
|
543
|
+
"numbering": [
|
|
544
|
+
1,
|
|
545
|
+
9
|
|
546
|
+
],
|
|
547
|
+
"parent": "root"
|
|
548
|
+
}
|
|
549
|
+
]
|
|
550
|
+
},
|
|
551
|
+
"guidelines": {
|
|
552
|
+
"mdx": "\n## Guidelines\n\nThese guidelines provide comprehensive direction for designing and developing\nrich text inputs within Nimbus.\n\n### Best practices\n\n- **Make responsive changes:** Apply changes immediately to the selected text\n upon clicking a toolbar control.\n- **Utilize tooltips and labels:** Include tooltips for all toolbar actions to\n enhance discoverability and accessibility.\n- **Keep a user's focus:** Maintain the user's focus within the text area after\n an action or toggle is selected.\n- **Allow for common shortcuts:** Support standard keyboard shortcuts for\n formatting (e.g., Ctrl/Cmd+B for bold).\n- **Make it easier to correct mistakes:** Offer an undo/redo history for content\n changes, and allow for a large enough input window so a user can quickly read\n content without needing to scroll line by line.\n- **Tailor tooling:** Determine the required formatting options based on the\n user's needs for the specific application.\n- **Curate tools into meaningful similar collections:** Group related controls\n logically in the toolbar (e.g., text styling, lists, media).\n\n## Usage\n\nRich text inputs should be used in areas where a user knows that a longer\nresponse or description is expected.\n\n> [!TIP]\\\n> When to use\n\n- **Editing long-form content:** Such as product descriptions, knowledge base\n articles, or email bodies, where visual hierarchy and style are necessary for\n readability.\n- **Formatting text:** Such as applying bold, italics, underlines, or specific\n heading levels.\n- **Structuring content:** With bulleted or numbered lists.\n- **Embedding external elements:** Like links, images, or videos within other\n content.\n\n> [!CAUTION]\\\n> When not to use\n\n- **Short answers:** Or single-line inputs, such as names, titles, or search\n queries.\n- **Specific data entry:** Unformatted text is required, like SKUs, passwords,\n or simple codes.\n- **Plain text communication:** Such as chat messages or comments, where\n formatting options can clutter the interface or distract from the\n conversation.\n- **Inputs that need to be strictly controlled:** Where the application's style\n guide should be the only source of formatting (e.g., when there is passing\n through of styling and content to another site).\n\n### Rich text input in use\n\n> [!TIP]\\\n> **Do**\n>\n> - Do use tooltips for tools represented by icons. In the case of paragraph\n> styles show the style in the dropdown, not just stated in plain text.\n> - Do provide more height for the input to see a few lines of text and reduce\n> scrolling.\n> - Do utilize an undo and redo button to assist a user with writing and editing\n> text when possible.\n\n```jsx live\nconst App = () => (\n <RichTextInput\n defaultValue=\"<p>Nimbus dolor sit amet, consectetur adipiscing elit. Aliquam component felis, vel consistency elementum. Sed design tokens ut turpis ac <strong>user experience</strong> maximus. Integer accessibility vitae nibh id clarity interface tincidunt.</p>\"\n placeholder=\"Write your product description here.\"\n />\n);\n```\n\n> [!CAUTION]\\\n> **Don't**\n>\n> - Don't make the input so small that you cannot easily see a few lines of\n> text.\n> - Don't move the rich text toolbar to sit on the bottom of the input.\n> - Don't overload the rich text toolbar with tools that are unnecessary.\n\n```jsx live\nconst App = () => (\n <RichTextInput\n height=\"2000\"\n defaultValue=\"<p>Nimbus dolor sit amet, consectetur adipiscing elit. Aliquam component felis, vel consistency elementum. Sed design tokens ut turpis ac <strong>user experience</strong> maximus. Integer accessibility vitae nibh id clarity interface tincidunt.</p>\"\n placeholder=\"Write your product description here.\"\n />\n);\n```\n",
|
|
553
|
+
"toc": [
|
|
554
|
+
{
|
|
555
|
+
"value": "Guidelines",
|
|
556
|
+
"href": "#guidelines",
|
|
557
|
+
"depth": 2,
|
|
558
|
+
"numbering": [
|
|
559
|
+
1,
|
|
560
|
+
1
|
|
561
|
+
],
|
|
562
|
+
"parent": "root"
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"value": "Best practices",
|
|
566
|
+
"href": "#best-practices",
|
|
567
|
+
"depth": 3,
|
|
568
|
+
"numbering": [
|
|
569
|
+
1,
|
|
570
|
+
1,
|
|
571
|
+
1
|
|
572
|
+
],
|
|
573
|
+
"parent": "root"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"value": "Usage",
|
|
577
|
+
"href": "#usage",
|
|
578
|
+
"depth": 2,
|
|
579
|
+
"numbering": [
|
|
580
|
+
1,
|
|
581
|
+
2
|
|
582
|
+
],
|
|
583
|
+
"parent": "root"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"value": "Rich text input in use",
|
|
587
|
+
"href": "#rich-text-input-in-use",
|
|
588
|
+
"depth": 3,
|
|
589
|
+
"numbering": [
|
|
590
|
+
1,
|
|
591
|
+
2,
|
|
592
|
+
1
|
|
593
|
+
],
|
|
594
|
+
"parent": "root"
|
|
595
|
+
}
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|