@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.
Files changed (453) hide show
  1. package/README.md +63 -14
  2. package/data/docs/route-manifest.json +10998 -0
  3. package/data/docs/routes/components-accessibility-visually-hidden.json +388 -0
  4. package/data/docs/routes/components-accessibility.json +34 -0
  5. package/data/docs/routes/components-buttons-button.json +715 -0
  6. package/data/docs/routes/components-buttons-icon-button.json +852 -0
  7. package/data/docs/routes/components-buttons-icon-toggle-button.json +594 -0
  8. package/data/docs/routes/components-buttons-split-button.json +670 -0
  9. package/data/docs/routes/components-buttons-toggle-button-group.json +722 -0
  10. package/data/docs/routes/components-buttons-toggle-button.json +689 -0
  11. package/data/docs/routes/components-buttons.json +36 -0
  12. package/data/docs/routes/components-data-display-badge.json +555 -0
  13. package/data/docs/routes/components-data-display-card.json +338 -0
  14. package/data/docs/routes/components-data-display-data-table.json +855 -0
  15. package/data/docs/routes/components-data-display-draggable-list.json +596 -0
  16. package/data/docs/routes/components-data-display-table.json +472 -0
  17. package/data/docs/routes/components-data-display-tag-group.json +535 -0
  18. package/data/docs/routes/components-data-display.json +34 -0
  19. package/data/docs/routes/components-feedback-alert.json +696 -0
  20. package/data/docs/routes/components-feedback-dialog.json +682 -0
  21. package/data/docs/routes/components-feedback-drawer.json +600 -0
  22. package/data/docs/routes/components-feedback-loading-spinner.json +415 -0
  23. package/data/docs/routes/components-feedback-progress-bar.json +661 -0
  24. package/data/docs/routes/components-feedback-toast.json +1040 -0
  25. package/data/docs/routes/components-feedback-tooltip.json +510 -0
  26. package/data/docs/routes/components-feedback.json +34 -0
  27. package/data/docs/routes/components-forms-field-errors.json +557 -0
  28. package/data/docs/routes/components-forms-form-field.json +848 -0
  29. package/data/docs/routes/components-forms-group.json +427 -0
  30. package/data/docs/routes/components-forms-localized-field.json +770 -0
  31. package/data/docs/routes/components-forms.json +37 -0
  32. package/data/docs/routes/components-inputs-calendar.json +611 -0
  33. package/data/docs/routes/components-inputs-checkbox.json +774 -0
  34. package/data/docs/routes/components-inputs-combo-box.json +761 -0
  35. package/data/docs/routes/components-inputs-date-input.json +628 -0
  36. package/data/docs/routes/components-inputs-date-picker.json +709 -0
  37. package/data/docs/routes/components-inputs-date-range-picker.json +599 -0
  38. package/data/docs/routes/components-inputs-money-input.json +721 -0
  39. package/data/docs/routes/components-inputs-multiline-text-input.json +611 -0
  40. package/data/docs/routes/components-inputs-number-input.json +647 -0
  41. package/data/docs/routes/components-inputs-password-input.json +576 -0
  42. package/data/docs/routes/components-inputs-radio-input.json +583 -0
  43. package/data/docs/routes/components-inputs-range-calendar.json +607 -0
  44. package/data/docs/routes/components-inputs-rich-text-input.json +599 -0
  45. package/data/docs/routes/components-inputs-scoped-search-input.json +570 -0
  46. package/data/docs/routes/components-inputs-search-input.json +588 -0
  47. package/data/docs/routes/components-inputs-select-input.json +960 -0
  48. package/data/docs/routes/components-inputs-switch.json +720 -0
  49. package/data/docs/routes/components-inputs-text-input.json +566 -0
  50. package/data/docs/routes/components-inputs-time-input.json +775 -0
  51. package/data/docs/routes/components-inputs.json +34 -0
  52. package/data/docs/routes/components-layout-box.json +501 -0
  53. package/data/docs/routes/components-layout-defaultpage.json +748 -0
  54. package/data/docs/routes/components-layout-flex.json +587 -0
  55. package/data/docs/routes/components-layout-grid.json +393 -0
  56. package/data/docs/routes/components-layout-modalpage.json +716 -0
  57. package/data/docs/routes/components-layout-pagecontent.json +673 -0
  58. package/data/docs/routes/components-layout-scrollarea.json +428 -0
  59. package/data/docs/routes/components-layout-separator.json +461 -0
  60. package/data/docs/routes/components-layout-simple-grid.json +519 -0
  61. package/data/docs/routes/components-layout-spacer.json +573 -0
  62. package/data/docs/routes/components-layout-stack.json +481 -0
  63. package/data/docs/routes/components-layout.json +34 -0
  64. package/data/docs/routes/components-media-avatar.json +427 -0
  65. package/data/docs/routes/components-media-icon.json +663 -0
  66. package/data/docs/routes/components-media-image.json +511 -0
  67. package/data/docs/routes/components-media-inline-svg.json +586 -0
  68. package/data/docs/routes/components-media.json +34 -0
  69. package/data/docs/routes/components-navigation-accordion.json +643 -0
  70. package/data/docs/routes/components-navigation-collapsible-motion.json +628 -0
  71. package/data/docs/routes/components-navigation-link.json +554 -0
  72. package/data/docs/routes/components-navigation-menu.json +546 -0
  73. package/data/docs/routes/components-navigation-pagination.json +502 -0
  74. package/data/docs/routes/components-navigation-steps.json +629 -0
  75. package/data/docs/routes/components-navigation-tabnav.json +546 -0
  76. package/data/docs/routes/components-navigation-tabs.json +635 -0
  77. package/data/docs/routes/components-navigation-toolbar.json +549 -0
  78. package/data/docs/routes/components-navigation.json +34 -0
  79. package/data/docs/routes/components-typography-code.json +39 -0
  80. package/data/docs/routes/components-typography-heading.json +402 -0
  81. package/data/docs/routes/components-typography-kbd.json +399 -0
  82. package/data/docs/routes/components-typography-list.json +593 -0
  83. package/data/docs/routes/components-typography-text.json +444 -0
  84. package/data/docs/routes/components-typography.json +34 -0
  85. package/data/docs/routes/components-utilities-nimbus-i18n-provider.json +295 -0
  86. package/data/docs/routes/components-utilities-nimbus-provider.json +663 -0
  87. package/data/docs/routes/components-utilities.json +34 -0
  88. package/data/docs/routes/components.json +33 -0
  89. package/data/docs/routes/home-contribute-adrs-adr0001-consumer-component-apis.json +314 -0
  90. package/data/docs/routes/home-contribute-adrs-adr0002-compound-component-extraction.json +160 -0
  91. package/data/docs/routes/home-contribute-adrs-adr0003-component-lifecycle-states.json +460 -0
  92. package/data/docs/routes/home-contribute-adrs.json +205 -0
  93. package/data/docs/routes/home-contribute-development-setup.json +213 -0
  94. package/data/docs/routes/home-contribute-stats.json +36 -0
  95. package/data/docs/routes/home-contribute.json +36 -0
  96. package/data/docs/routes/home-design-tokens-aspect-ratios.json +36 -0
  97. package/data/docs/routes/home-design-tokens-borders.json +35 -0
  98. package/data/docs/routes/home-design-tokens-colors.json +157 -0
  99. package/data/docs/routes/home-design-tokens-other-animations.json +119 -0
  100. package/data/docs/routes/home-design-tokens-other-blurs.json +36 -0
  101. package/data/docs/routes/home-design-tokens-other-breakpoints.json +61 -0
  102. package/data/docs/routes/home-design-tokens-other-cursors.json +36 -0
  103. package/data/docs/routes/home-design-tokens-other-z-indices.json +39 -0
  104. package/data/docs/routes/home-design-tokens-other.json +35 -0
  105. package/data/docs/routes/home-design-tokens-radii.json +59 -0
  106. package/data/docs/routes/home-design-tokens-shadows.json +57 -0
  107. package/data/docs/routes/home-design-tokens-sizes.json +137 -0
  108. package/data/docs/routes/home-design-tokens-spacing.json +36 -0
  109. package/data/docs/routes/home-design-tokens-typography.json +184 -0
  110. package/data/docs/routes/home-design-tokens.json +34 -0
  111. package/data/docs/routes/home-getting-started-core-concepts.json +301 -0
  112. package/data/docs/routes/home-getting-started-installation.json +621 -0
  113. package/data/docs/routes/home-getting-started-mcp-server-overview.json +139 -0
  114. package/data/docs/routes/home-getting-started-mcp-server-setup.json +316 -0
  115. package/data/docs/routes/home-getting-started-release-process.json +294 -0
  116. package/data/docs/routes/home-getting-started-testing-setup.json +296 -0
  117. package/data/docs/routes/home-playground-markdown.json +638 -0
  118. package/data/docs/routes/home-playground-toc.json +169 -0
  119. package/data/docs/routes/home-playground.json +34 -0
  120. package/data/docs/routes/home-style-props-background.json +236 -0
  121. package/data/docs/routes/home-style-props-border.json +310 -0
  122. package/data/docs/routes/home-style-props-display.json +120 -0
  123. package/data/docs/routes/home-style-props-effects.json +116 -0
  124. package/data/docs/routes/home-style-props-filters.json +396 -0
  125. package/data/docs/routes/home-style-props-flex-and-grid.json +496 -0
  126. package/data/docs/routes/home-style-props-interactivity.json +356 -0
  127. package/data/docs/routes/home-style-props-layout.json +422 -0
  128. package/data/docs/routes/home-style-props-list.json +116 -0
  129. package/data/docs/routes/home-style-props-sizing.json +244 -0
  130. package/data/docs/routes/home-style-props-spacing.json +228 -0
  131. package/data/docs/routes/home-style-props-svg.json +96 -0
  132. package/data/docs/routes/home-style-props-tables.json +116 -0
  133. package/data/docs/routes/home-style-props-transforms.json +216 -0
  134. package/data/docs/routes/home-style-props-transitions.json +216 -0
  135. package/data/docs/routes/home-style-props-typography.json +536 -0
  136. package/data/docs/routes/home-style-props.json +33 -0
  137. package/data/docs/routes/home.json +32 -0
  138. package/data/docs/routes/hooks-usecopytoclipboard.json +76 -0
  139. package/data/docs/routes/hooks-usehotkeys.json +117 -0
  140. package/data/docs/routes/hooks.json +33 -0
  141. package/data/docs/routes/icons.json +32 -0
  142. package/data/docs/routes/patterns-fields-date-range-picker-field.json +393 -0
  143. package/data/docs/routes/patterns-fields-money-input-field.json +415 -0
  144. package/data/docs/routes/patterns-fields-multiline-text-input-field.json +404 -0
  145. package/data/docs/routes/patterns-fields-number-input-field.json +470 -0
  146. package/data/docs/routes/patterns-fields-password-input-field.json +319 -0
  147. package/data/docs/routes/patterns-fields-search-input-field.json +382 -0
  148. package/data/docs/routes/patterns-fields-text-input-field.json +404 -0
  149. package/data/docs/routes/patterns-fields.json +78 -0
  150. package/data/docs/routes/patterns.json +34 -0
  151. package/data/docs/search-index.json +1 -0
  152. package/data/docs/types/Accordion.json +12 -0
  153. package/data/docs/types/AccordionContent.json +286 -0
  154. package/data/docs/types/AccordionHeader.json +891 -0
  155. package/data/docs/types/AccordionHeaderRightContent.json +27 -0
  156. package/data/docs/types/AccordionItem.json +242 -0
  157. package/data/docs/types/AccordionRoot.json +162 -0
  158. package/data/docs/types/Alert.json +12 -0
  159. package/data/docs/types/AlertActions.json +11 -0
  160. package/data/docs/types/AlertDescription.json +118 -0
  161. package/data/docs/types/AlertDismissButton.json +937 -0
  162. package/data/docs/types/AlertRoot.json +42 -0
  163. package/data/docs/types/AlertTitle.json +118 -0
  164. package/data/docs/types/Avatar.json +125 -0
  165. package/data/docs/types/Badge.json +64 -0
  166. package/data/docs/types/Body.json +67 -0
  167. package/data/docs/types/Box.json +85 -0
  168. package/data/docs/types/Button.json +1015 -0
  169. package/data/docs/types/Calendar.json +565 -0
  170. package/data/docs/types/Caption.json +67 -0
  171. package/data/docs/types/Card.json +12 -0
  172. package/data/docs/types/CardContent.json +27 -0
  173. package/data/docs/types/CardHeader.json +27 -0
  174. package/data/docs/types/CardRoot.json +106 -0
  175. package/data/docs/types/Cell.json +227 -0
  176. package/data/docs/types/Checkbox.json +897 -0
  177. package/data/docs/types/Code.json +112 -0
  178. package/data/docs/types/CollapsibleMotionContent.json +35 -0
  179. package/data/docs/types/CollapsibleMotionRoot.json +99 -0
  180. package/data/docs/types/CollapsibleMotionTrigger.json +71 -0
  181. package/data/docs/types/Column.json +101 -0
  182. package/data/docs/types/ColumnGroup.json +101 -0
  183. package/data/docs/types/ColumnHeader.json +193 -0
  184. package/data/docs/types/ComboBoxListBox.json +751 -0
  185. package/data/docs/types/ComboBoxOption.json +672 -0
  186. package/data/docs/types/ComboBoxPopover.json +786 -0
  187. package/data/docs/types/ComboBoxRoot.json +747 -0
  188. package/data/docs/types/ComboBoxSection.json +277 -0
  189. package/data/docs/types/ComboBoxTrigger.json +70 -0
  190. package/data/docs/types/Content.json +33 -0
  191. package/data/docs/types/DataTable.json +596 -0
  192. package/data/docs/types/DataTableBody.json +223 -0
  193. package/data/docs/types/DataTableFooter.json +27 -0
  194. package/data/docs/types/DataTableHeader.json +269 -0
  195. package/data/docs/types/DataTableManager.json +11 -0
  196. package/data/docs/types/DataTableRoot.json +590 -0
  197. package/data/docs/types/DataTableTable.json +271 -0
  198. package/data/docs/types/DateInput.json +792 -0
  199. package/data/docs/types/DatePicker.json +700 -0
  200. package/data/docs/types/DateRangePicker.json +936 -0
  201. package/data/docs/types/DateRangePickerField.json +1047 -0
  202. package/data/docs/types/DefaultPage.json +12 -0
  203. package/data/docs/types/DefaultPageActions.json +27 -0
  204. package/data/docs/types/DefaultPageBackLink.json +213 -0
  205. package/data/docs/types/DefaultPageContent.json +27 -0
  206. package/data/docs/types/DefaultPageFooter.json +27 -0
  207. package/data/docs/types/DefaultPageHeader.json +27 -0
  208. package/data/docs/types/DefaultPageRoot.json +106 -0
  209. package/data/docs/types/DefaultPageSubtitle.json +27 -0
  210. package/data/docs/types/DefaultPageTabNav.json +28 -0
  211. package/data/docs/types/DefaultPageTitle.json +27 -0
  212. package/data/docs/types/DialogBody.json +27 -0
  213. package/data/docs/types/DialogCloseTrigger.json +939 -0
  214. package/data/docs/types/DialogContent.json +27 -0
  215. package/data/docs/types/DialogFooter.json +27 -0
  216. package/data/docs/types/DialogHeader.json +27 -0
  217. package/data/docs/types/DialogRoot.json +138 -0
  218. package/data/docs/types/DialogTitle.json +27 -0
  219. package/data/docs/types/DialogTrigger.json +80 -0
  220. package/data/docs/types/DraggableList.json +12 -0
  221. package/data/docs/types/DraggableListField.json +894 -0
  222. package/data/docs/types/DraggableListItem.json +574 -0
  223. package/data/docs/types/DraggableListRoot.json +745 -0
  224. package/data/docs/types/Drawer.json +12 -0
  225. package/data/docs/types/DrawerBody.json +27 -0
  226. package/data/docs/types/DrawerCloseTrigger.json +939 -0
  227. package/data/docs/types/DrawerContent.json +27 -0
  228. package/data/docs/types/DrawerFooter.json +27 -0
  229. package/data/docs/types/DrawerHeader.json +27 -0
  230. package/data/docs/types/DrawerRoot.json +142 -0
  231. package/data/docs/types/DrawerTitle.json +27 -0
  232. package/data/docs/types/DrawerTrigger.json +80 -0
  233. package/data/docs/types/FieldErrors.getBuiltInMessage.json +11 -0
  234. package/data/docs/types/FieldErrors.getCustomMessage.json +9 -0
  235. package/data/docs/types/FieldErrors.json +109 -0
  236. package/data/docs/types/Flex.json +238 -0
  237. package/data/docs/types/Footer.json +67 -0
  238. package/data/docs/types/FormFieldDescription.json +11 -0
  239. package/data/docs/types/FormFieldError.json +11 -0
  240. package/data/docs/types/FormFieldInfoBox.json +27 -0
  241. package/data/docs/types/FormFieldInput.json +11 -0
  242. package/data/docs/types/FormFieldLabel.json +11 -0
  243. package/data/docs/types/FormFieldRoot.json +148 -0
  244. package/data/docs/types/Grid.json +253 -0
  245. package/data/docs/types/GridProps.json +11 -0
  246. package/data/docs/types/Group.json +143 -0
  247. package/data/docs/types/Header.json +67 -0
  248. package/data/docs/types/Heading.json +109 -0
  249. package/data/docs/types/Icon.json +112 -0
  250. package/data/docs/types/IconButton.json +1019 -0
  251. package/data/docs/types/IconToggleButton.json +787 -0
  252. package/data/docs/types/Image.json +373 -0
  253. package/data/docs/types/Indicator.json +67 -0
  254. package/data/docs/types/InlineSvg.json +98 -0
  255. package/data/docs/types/Item.json +67 -0
  256. package/data/docs/types/Kbd.json +118 -0
  257. package/data/docs/types/Link.json +380 -0
  258. package/data/docs/types/List.json +12 -0
  259. package/data/docs/types/ListIndicator.json +70 -0
  260. package/data/docs/types/ListItem.json +70 -0
  261. package/data/docs/types/ListRoot.json +124 -0
  262. package/data/docs/types/LoadingSpinner.json +87 -0
  263. package/data/docs/types/LocalizedField.json +460 -0
  264. package/data/docs/types/LocalizedStringFormatter.json +9 -0
  265. package/data/docs/types/MakeElementFocusable.json +196 -0
  266. package/data/docs/types/MenuContent.json +111 -0
  267. package/data/docs/types/MenuItem.json +671 -0
  268. package/data/docs/types/MenuRoot.json +670 -0
  269. package/data/docs/types/MenuSection.json +364 -0
  270. package/data/docs/types/MenuSubmenu.json +111 -0
  271. package/data/docs/types/MenuSubmenuTrigger.json +67 -0
  272. package/data/docs/types/MenuTrigger.json +906 -0
  273. package/data/docs/types/ModalPage.json +12 -0
  274. package/data/docs/types/ModalPageActions.json +27 -0
  275. package/data/docs/types/ModalPageContent.json +27 -0
  276. package/data/docs/types/ModalPageFooter.json +27 -0
  277. package/data/docs/types/ModalPageHeader.json +27 -0
  278. package/data/docs/types/ModalPageRoot.json +87 -0
  279. package/data/docs/types/ModalPageSubtitle.json +27 -0
  280. package/data/docs/types/ModalPageTabNav.json +28 -0
  281. package/data/docs/types/ModalPageTitle.json +27 -0
  282. package/data/docs/types/ModalPageTopBar.json +57 -0
  283. package/data/docs/types/MoneyInput.isEmpty.json +40 -0
  284. package/data/docs/types/MoneyInput.json +282 -0
  285. package/data/docs/types/MoneyInputField.json +379 -0
  286. package/data/docs/types/MoneyInputFieldProps.json +9 -0
  287. package/data/docs/types/MultilineTextInput.json +1194 -0
  288. package/data/docs/types/MultilineTextInputField.json +1269 -0
  289. package/data/docs/types/MultilineTextInputFieldProps.json +9 -0
  290. package/data/docs/types/NimbusI18nProvider.json +42 -0
  291. package/data/docs/types/NimbusI18nProviderProps.json +9 -0
  292. package/data/docs/types/NimbusProvider.json +270 -0
  293. package/data/docs/types/NumberInput.json +952 -0
  294. package/data/docs/types/NumberInputField.json +1004 -0
  295. package/data/docs/types/NumberInputFieldProps.json +9 -0
  296. package/data/docs/types/PageContent.json +11 -0
  297. package/data/docs/types/PageContentColumn.json +99 -0
  298. package/data/docs/types/PageContentRoot.json +114 -0
  299. package/data/docs/types/Pagination.json +159 -0
  300. package/data/docs/types/PasswordInput.json +1120 -0
  301. package/data/docs/types/PasswordInputField.json +1216 -0
  302. package/data/docs/types/PasswordInputFieldProps.json +9 -0
  303. package/data/docs/types/ProgressBar.json +280 -0
  304. package/data/docs/types/RadioInputOption.json +550 -0
  305. package/data/docs/types/RadioInputRoot.json +514 -0
  306. package/data/docs/types/RangeCalendar.json +618 -0
  307. package/data/docs/types/RichTextInput.json +134 -0
  308. package/data/docs/types/Root.json +122 -0
  309. package/data/docs/types/Row.json +67 -0
  310. package/data/docs/types/ScopedSearchInput.isEmpty.json +40 -0
  311. package/data/docs/types/ScopedSearchInput.json +253 -0
  312. package/data/docs/types/ScrollArea.json +179 -0
  313. package/data/docs/types/ScrollAreaElementIds.json +9 -0
  314. package/data/docs/types/ScrollAreaProps.json +9 -0
  315. package/data/docs/types/SearchInput.json +1165 -0
  316. package/data/docs/types/SearchInputField.json +1240 -0
  317. package/data/docs/types/Select.json +12 -0
  318. package/data/docs/types/SelectOption.json +572 -0
  319. package/data/docs/types/SelectOptionGroup.json +215 -0
  320. package/data/docs/types/SelectOptions.json +693 -0
  321. package/data/docs/types/SelectRoot.json +926 -0
  322. package/data/docs/types/Separator.json +65 -0
  323. package/data/docs/types/SimpleGrid.json +291 -0
  324. package/data/docs/types/Spacer.json +27 -0
  325. package/data/docs/types/SpacerProps.json +9 -0
  326. package/data/docs/types/SplitButton.json +203 -0
  327. package/data/docs/types/Stack.json +144 -0
  328. package/data/docs/types/Steps.json +12 -0
  329. package/data/docs/types/StepsChangeDetails.json +9 -0
  330. package/data/docs/types/StepsCompletedContent.json +28 -0
  331. package/data/docs/types/StepsCompletedContentProps.json +9 -0
  332. package/data/docs/types/StepsContent.json +43 -0
  333. package/data/docs/types/StepsContentProps.json +9 -0
  334. package/data/docs/types/StepsDescription.json +28 -0
  335. package/data/docs/types/StepsDescriptionProps.json +9 -0
  336. package/data/docs/types/StepsIndicator.json +28 -0
  337. package/data/docs/types/StepsIndicatorProps.json +9 -0
  338. package/data/docs/types/StepsItem.json +43 -0
  339. package/data/docs/types/StepsItemProps.json +9 -0
  340. package/data/docs/types/StepsList.json +28 -0
  341. package/data/docs/types/StepsListProps.json +9 -0
  342. package/data/docs/types/StepsNextTrigger.json +62 -0
  343. package/data/docs/types/StepsNextTriggerProps.json +9 -0
  344. package/data/docs/types/StepsNumber.json +28 -0
  345. package/data/docs/types/StepsNumberProps.json +9 -0
  346. package/data/docs/types/StepsPrevTrigger.json +62 -0
  347. package/data/docs/types/StepsPrevTriggerProps.json +9 -0
  348. package/data/docs/types/StepsRoot.json +183 -0
  349. package/data/docs/types/StepsRootProps.json +11 -0
  350. package/data/docs/types/StepsSeparator.json +28 -0
  351. package/data/docs/types/StepsSeparatorProps.json +9 -0
  352. package/data/docs/types/StepsStatus.json +57 -0
  353. package/data/docs/types/StepsStatusProps.json +9 -0
  354. package/data/docs/types/StepsTitle.json +28 -0
  355. package/data/docs/types/StepsTitleProps.json +9 -0
  356. package/data/docs/types/StepsTrigger.json +47 -0
  357. package/data/docs/types/StepsTriggerProps.json +9 -0
  358. package/data/docs/types/Switch.json +371 -0
  359. package/data/docs/types/TabListProps.json +9 -0
  360. package/data/docs/types/TabNav.json +12 -0
  361. package/data/docs/types/TabNavItem.json +300 -0
  362. package/data/docs/types/TabNavItemProps.json +9 -0
  363. package/data/docs/types/TabNavProps.json +9 -0
  364. package/data/docs/types/TabNavRoot.json +80 -0
  365. package/data/docs/types/TabPanelProps.json +9 -0
  366. package/data/docs/types/TabPanelsProps.json +9 -0
  367. package/data/docs/types/TabProps.json +9 -0
  368. package/data/docs/types/Table.json +9 -0
  369. package/data/docs/types/TableBody.json +67 -0
  370. package/data/docs/types/TableBodyProps.json +9 -0
  371. package/data/docs/types/TableCaption.json +67 -0
  372. package/data/docs/types/TableCaptionProps.json +9 -0
  373. package/data/docs/types/TableCell.json +227 -0
  374. package/data/docs/types/TableCellProps.json +9 -0
  375. package/data/docs/types/TableColumn.json +101 -0
  376. package/data/docs/types/TableColumnGroup.json +101 -0
  377. package/data/docs/types/TableColumnGroupProps.json +9 -0
  378. package/data/docs/types/TableColumnHeader.json +193 -0
  379. package/data/docs/types/TableColumnHeaderProps.json +9 -0
  380. package/data/docs/types/TableColumnProps.json +9 -0
  381. package/data/docs/types/TableFooter.json +67 -0
  382. package/data/docs/types/TableFooterProps.json +9 -0
  383. package/data/docs/types/TableHeader.json +67 -0
  384. package/data/docs/types/TableHeaderProps.json +9 -0
  385. package/data/docs/types/TableRoot.json +365 -0
  386. package/data/docs/types/TableRootProps.json +12 -0
  387. package/data/docs/types/TableRow.json +67 -0
  388. package/data/docs/types/TableRowProps.json +9 -0
  389. package/data/docs/types/TableScrollArea.json +82 -0
  390. package/data/docs/types/TableScrollAreaProps.json +9 -0
  391. package/data/docs/types/Tabs.json +12 -0
  392. package/data/docs/types/TabsList.json +110 -0
  393. package/data/docs/types/TabsPanel.json +112 -0
  394. package/data/docs/types/TabsPanels.json +108 -0
  395. package/data/docs/types/TabsRoot.json +211 -0
  396. package/data/docs/types/TabsTab.json +174 -0
  397. package/data/docs/types/TagGroup.json +12 -0
  398. package/data/docs/types/TagGroupRoot.json +306 -0
  399. package/data/docs/types/TagGroupTag.json +595 -0
  400. package/data/docs/types/TagGroupTagList.json +166 -0
  401. package/data/docs/types/Text.json +119 -0
  402. package/data/docs/types/TextInput.json +1156 -0
  403. package/data/docs/types/TextInputField.json +1263 -0
  404. package/data/docs/types/TimeInput.json +752 -0
  405. package/data/docs/types/ToastAction.json +9 -0
  406. package/data/docs/types/ToastManagerApi.json +9 -0
  407. package/data/docs/types/ToastOptions.json +9 -0
  408. package/data/docs/types/ToastOutlet.json +12 -0
  409. package/data/docs/types/ToastPlacement.json +9 -0
  410. package/data/docs/types/ToastPromiseOptions.json +9 -0
  411. package/data/docs/types/ToastType.json +9 -0
  412. package/data/docs/types/ToastVariant.json +9 -0
  413. package/data/docs/types/ToggleButton.json +789 -0
  414. package/data/docs/types/ToggleButtonGroup.json +9 -0
  415. package/data/docs/types/ToggleButtonGroupButton.json +331 -0
  416. package/data/docs/types/ToggleButtonGroupRoot.json +269 -0
  417. package/data/docs/types/Toolbar.json +176 -0
  418. package/data/docs/types/Tooltip.json +12 -0
  419. package/data/docs/types/TooltipContent.json +372 -0
  420. package/data/docs/types/TooltipRoot.json +179 -0
  421. package/data/docs/types/Trigger.json +69 -0
  422. package/data/docs/types/VisuallyHidden.json +93 -0
  423. package/data/docs/types/__object.json +12 -0
  424. package/data/docs/types/filters.json +11 -0
  425. package/data/docs/types/manifest.json +280 -0
  426. package/data/docs/types/toast.json +234 -0
  427. package/data/docs/types/useColorMode.json +13 -0
  428. package/data/docs/types/useColorModeValue.json +13 -0
  429. package/data/docs/types/useColorScheme.json +12 -0
  430. package/data/docs/types/useLocalizedStringFormatter.json +14 -0
  431. package/data/icons.json +21940 -0
  432. package/data/tokens.json +40061 -0
  433. package/dist/index.js +2516 -17
  434. package/package.json +25 -6
  435. package/dist/data-loader.d.ts +0 -102
  436. package/dist/data-loader.js +0 -104
  437. package/dist/index.d.ts +0 -13
  438. package/dist/server.d.ts +0 -9
  439. package/dist/server.js +0 -22
  440. package/dist/server.spec.d.ts +0 -1
  441. package/dist/server.spec.js +0 -69
  442. package/dist/tools/list-components.d.ts +0 -9
  443. package/dist/tools/list-components.js +0 -42
  444. package/dist/types.d.ts +0 -28
  445. package/dist/types.js +0 -4
  446. package/src/data-loader.ts +0 -226
  447. package/src/index.ts +0 -29
  448. package/src/server.spec.ts +0 -86
  449. package/src/server.ts +0 -28
  450. package/src/tools/list-components.ts +0 -49
  451. package/src/types.ts +0 -31
  452. package/tsconfig.json +0 -14
  453. package/vitest.config.ts +0 -9
@@ -0,0 +1,720 @@
1
+ {
2
+ "meta": {
3
+ "id": "Components-Switch",
4
+ "title": "Switch",
5
+ "exportName": "Switch",
6
+ "description": "A clear, visual toggle, allowing users to activate or deactivate a setting quickly.",
7
+ "lifecycleState": "Stable",
8
+ "order": 999,
9
+ "repoPath": "packages/nimbus/src/components/switch/switch.mdx",
10
+ "menu": [
11
+ "Components",
12
+ "Inputs",
13
+ "Switch"
14
+ ],
15
+ "route": "components/inputs/switch",
16
+ "tags": [
17
+ "component",
18
+ "input",
19
+ "toggle"
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": "Size",
55
+ "href": "#size",
56
+ "depth": 3,
57
+ "numbering": [
58
+ 1,
59
+ 2,
60
+ 1
61
+ ],
62
+ "parent": "root"
63
+ },
64
+ {
65
+ "value": "Medium (md)",
66
+ "href": "#medium-md",
67
+ "depth": 4,
68
+ "numbering": [
69
+ 1,
70
+ 2,
71
+ 1,
72
+ 1
73
+ ],
74
+ "parent": "root"
75
+ },
76
+ {
77
+ "value": "Small (sm)",
78
+ "href": "#small-sm",
79
+ "depth": 4,
80
+ "numbering": [
81
+ 1,
82
+ 2,
83
+ 1,
84
+ 2
85
+ ],
86
+ "parent": "root"
87
+ },
88
+ {
89
+ "value": "Labels",
90
+ "href": "#labels",
91
+ "depth": 3,
92
+ "numbering": [
93
+ 1,
94
+ 2,
95
+ 2
96
+ ],
97
+ "parent": "root"
98
+ },
99
+ {
100
+ "value": "With label",
101
+ "href": "#with-label",
102
+ "depth": 4,
103
+ "numbering": [
104
+ 1,
105
+ 2,
106
+ 2,
107
+ 1
108
+ ],
109
+ "parent": "root"
110
+ },
111
+ {
112
+ "value": "Without visible label",
113
+ "href": "#without-visible-label",
114
+ "depth": 4,
115
+ "numbering": [
116
+ 1,
117
+ 2,
118
+ 2,
119
+ 2
120
+ ],
121
+ "parent": "root"
122
+ }
123
+ ],
124
+ "figmaLink": "https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?m=auto&node-id=346-2572&t=0Gug4G6TEF60mpzZ-1",
125
+ "layout": "app-frame",
126
+ "tabs": [
127
+ {
128
+ "key": "overview",
129
+ "title": "Overview",
130
+ "order": 0
131
+ },
132
+ {
133
+ "key": "guidelines",
134
+ "title": "Guidelines",
135
+ "order": 2
136
+ },
137
+ {
138
+ "key": "dev",
139
+ "title": "Implementation",
140
+ "order": 3
141
+ },
142
+ {
143
+ "key": "a11y",
144
+ "title": "Accessibility",
145
+ "order": 4
146
+ }
147
+ ]
148
+ },
149
+ "mdx": "\n## Overview\n\nThis switch is an interactive element that provides instant visual feedback\nallowing users to toggle binary options.\n\n### Resources\n\n- [Figma](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?m=auto&node-id=346-2572&t=0Gug4G6TEF60mpzZ-1)\n\n## Variables\n\nGet familiar with the features.\n\n### Size\n\n#### Medium (md)\n\n```jsx live\nconst App = () => <Switch size=\"md\">Label</Switch>;\n```\n\n#### Small (sm)\n\n```jsx live\nconst App = () => <Switch size=\"sm\">Label</Switch>;\n```\n\n### Labels\n\n#### With label\n\nIt is always good practice to have a label paired with a switch so a user knows\nwhat is being toggled. The label responds to both switch sizes to match use\ncases.\n\n```jsx live\nconst App = () => <Switch>Label</Switch>;\n```\n\n#### Without visible label\n\nYou can use switch without visible label if the use is clear enough to not need\na label for the user.\n\n```jsx live\nconst App = () => <Switch aria-label=\"I still need an aria-label for a11y purposes\" />;\n```\n",
150
+ "views": {
151
+ "overview": {
152
+ "mdx": "\n## Overview\n\nThis switch is an interactive element that provides instant visual feedback\nallowing users to toggle binary options.\n\n### Resources\n\n- [Figma](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?m=auto&node-id=346-2572&t=0Gug4G6TEF60mpzZ-1)\n\n## Variables\n\nGet familiar with the features.\n\n### Size\n\n#### Medium (md)\n\n```jsx live\nconst App = () => <Switch size=\"md\">Label</Switch>;\n```\n\n#### Small (sm)\n\n```jsx live\nconst App = () => <Switch size=\"sm\">Label</Switch>;\n```\n\n### Labels\n\n#### With label\n\nIt is always good practice to have a label paired with a switch so a user knows\nwhat is being toggled. The label responds to both switch sizes to match use\ncases.\n\n```jsx live\nconst App = () => <Switch>Label</Switch>;\n```\n\n#### Without visible label\n\nYou can use switch without visible label if the use is clear enough to not need\na label for the user.\n\n```jsx live\nconst App = () => <Switch aria-label=\"I still need an aria-label for a11y purposes\" />;\n```\n",
153
+ "toc": [
154
+ {
155
+ "value": "Overview",
156
+ "href": "#overview",
157
+ "depth": 2,
158
+ "numbering": [
159
+ 1,
160
+ 1
161
+ ],
162
+ "parent": "root"
163
+ },
164
+ {
165
+ "value": "Resources",
166
+ "href": "#resources",
167
+ "depth": 3,
168
+ "numbering": [
169
+ 1,
170
+ 1,
171
+ 1
172
+ ],
173
+ "parent": "root"
174
+ },
175
+ {
176
+ "value": "Variables",
177
+ "href": "#variables",
178
+ "depth": 2,
179
+ "numbering": [
180
+ 1,
181
+ 2
182
+ ],
183
+ "parent": "root"
184
+ },
185
+ {
186
+ "value": "Size",
187
+ "href": "#size",
188
+ "depth": 3,
189
+ "numbering": [
190
+ 1,
191
+ 2,
192
+ 1
193
+ ],
194
+ "parent": "root"
195
+ },
196
+ {
197
+ "value": "Medium (md)",
198
+ "href": "#medium-md",
199
+ "depth": 4,
200
+ "numbering": [
201
+ 1,
202
+ 2,
203
+ 1,
204
+ 1
205
+ ],
206
+ "parent": "root"
207
+ },
208
+ {
209
+ "value": "Small (sm)",
210
+ "href": "#small-sm",
211
+ "depth": 4,
212
+ "numbering": [
213
+ 1,
214
+ 2,
215
+ 1,
216
+ 2
217
+ ],
218
+ "parent": "root"
219
+ },
220
+ {
221
+ "value": "Labels",
222
+ "href": "#labels",
223
+ "depth": 3,
224
+ "numbering": [
225
+ 1,
226
+ 2,
227
+ 2
228
+ ],
229
+ "parent": "root"
230
+ },
231
+ {
232
+ "value": "With label",
233
+ "href": "#with-label",
234
+ "depth": 4,
235
+ "numbering": [
236
+ 1,
237
+ 2,
238
+ 2,
239
+ 1
240
+ ],
241
+ "parent": "root"
242
+ },
243
+ {
244
+ "value": "Without visible label",
245
+ "href": "#without-visible-label",
246
+ "depth": 4,
247
+ "numbering": [
248
+ 1,
249
+ 2,
250
+ 2,
251
+ 2
252
+ ],
253
+ "parent": "root"
254
+ }
255
+ ]
256
+ },
257
+ "a11y": {
258
+ "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 = () => <Switch size=\"md\">Label</Switch>;\n```\n\n### Accessibility standards\n\n- **Info and relationships:** Ensure the switch's state and purpose are\n programmatically determinable. Use ARIA attributes like `aria-checked` to\n convey the on/off state to assistive technologies. Associate a clear label\n with the switch using the `<label>` element or `aria-label`.\n- **Use of color:** Don't rely solely on color to indicate the switch's state.\n Use other visual cues like position or icons.\n- **Color contrast:** Ensure sufficient color contrast between the switch's\n elements (background, toggle, label) and surrounding content.\n- **Keyboard accessibility:** Make the switch fully operable via keyboard. Users\n should be able to focus on the switch using the Tab key and toggle it using\n the Spacebar or Enter key.\n- **Focus visible:** Provide a clear visual focus indicator when the switch\n receives keyboard focus.\n- **On focus:** Ensure that focusing on the switch doesn't trigger unexpected\n changes or actions.\n- **Labels or instructions:** Provide clear and concise labels that accurately\n describe the switch's function.\n- **Name, role, value:** Use appropriate semantic HTML and ARIA attributes to\n define the switch's role, name, and value. This ensures compatibility with\n assistive technologies. `aria-checked` must accurately reflect the on/off\n state.\n",
259
+ "toc": [
260
+ {
261
+ "value": "Accessibility",
262
+ "href": "#accessibility",
263
+ "depth": 2,
264
+ "numbering": [
265
+ 1,
266
+ 1
267
+ ],
268
+ "parent": "root"
269
+ },
270
+ {
271
+ "value": "Accessibility standards",
272
+ "href": "#accessibility-standards",
273
+ "depth": 3,
274
+ "numbering": [
275
+ 1,
276
+ 1,
277
+ 1
278
+ ],
279
+ "parent": "root"
280
+ }
281
+ ]
282
+ },
283
+ "dev": {
284
+ "mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { Switch, type SwitchProps } from '@commercetools/nimbus';\n```\n\n### Basic usage\n\n```jsx live-dev\nconst App = () => {\n return <Switch>Enable notifications</Switch>;\n};\n```\n\n## Usage examples\n\n### Size options\n\nSwitch supports two size variants: `sm` (small) and `md` (medium, default).\n\n#### Small size\n\n```jsx live-dev\nconst App = () => {\n return <Switch size=\"sm\">Small switch</Switch>;\n};\n```\n\n#### Medium size\n\n```jsx live-dev\nconst App = () => {\n return <Switch size=\"md\">Medium switch</Switch>;\n};\n```\n\n### With label\n\nIt's best practice to provide a visible label that describes what the switch controls.\n\n```jsx live-dev\nconst App = () => {\n return (\n <Stack gap=\"400\">\n <Switch>Dark mode</Switch>\n <Switch>Email notifications</Switch>\n <Switch>Auto-save drafts</Switch>\n </Stack>\n );\n};\n```\n\n### Without visible label\n\nWhen the context makes the switch's purpose clear, you can omit the visible label. However, you must still provide an accessible label using `aria-label`.\n\n```jsx live-dev\nconst App = () => {\n return (\n <Stack gap=\"400\">\n <Text>Notifications</Text>\n <Switch aria-label=\"Enable notifications\" />\n </Stack>\n );\n};\n```\n\n### Disabled state\n\nUse `isDisabled` to prevent user interaction with the switch.\n\n```jsx live-dev\nconst App = () => {\n return (\n <Stack gap=\"400\">\n <Switch isDisabled>Disabled switch (off)</Switch>\n <Switch isDisabled defaultSelected>\n Disabled switch (on)\n </Switch>\n </Stack>\n );\n};\n```\n\n### Invalid state\n\nUse `isInvalid` to indicate that the switch's current state is not valid, such as when a required setting must be enabled.\n\n```jsx live-dev\nconst App = () => {\n return (\n <Stack gap=\"400\">\n <Switch isInvalid>Accept terms and conditions</Switch>\n <Text fontSize=\"350\" color=\"danger.11\">\n You must accept the terms to continue\n </Text>\n </Stack>\n );\n};\n```\n\n### Default selected\n\nUse `defaultSelected` to set the initial state in uncontrolled mode.\n\n```jsx live-dev\nconst App = () => {\n return (\n <Stack gap=\"400\">\n <Switch defaultSelected={false}>Default off</Switch>\n <Switch defaultSelected={true}>Default on</Switch>\n </Stack>\n );\n};\n```\n\n### Uncontrolled mode\n\nIn uncontrolled mode, the Switch manages its own state internally. Use `defaultSelected` to set the initial value and `onChange` to be notified of changes.\n\n```jsx live-dev\nconst App = () => {\n const [lastChanged, setLastChanged] = React.useState('');\n\n return (\n <Stack gap=\"400\">\n <Switch\n defaultSelected={false}\n onChange={(isSelected) => {\n setLastChanged(`Switch is now ${isSelected ? 'on' : 'off'}`);\n }}\n >\n Enable feature\n </Switch>\n {lastChanged && <Text fontSize=\"350\">{lastChanged}</Text>}\n </Stack>\n );\n};\n```\n\n### Controlled mode\n\nIn controlled mode, you manage the switch state externally using the `isSelected` prop.\n\n```jsx live-dev\nconst App = () => {\n const [isEnabled, setIsEnabled] = React.useState<\n SwitchProps['isSelected']\n >(false);\n\n return (\n <Stack gap=\"400\">\n <Switch isSelected={isEnabled} onChange={setIsEnabled}>\n Notifications enabled\n </Switch>\n <Text fontSize=\"350\">\n Current state: <strong>{isEnabled ? 'On' : 'Off'}</strong>\n </Text>\n <Button onClick={() => setIsEnabled(!isEnabled)}>\n Toggle programmatically\n </Button>\n </Stack>\n );\n};\n```\n\n### Read-only state\n\nUse `isReadOnly` to display a switch that cannot be toggled by the user but shows a specific state.\n\n```jsx live-dev\nconst App = () => {\n return (\n <Stack gap=\"400\">\n <Switch isReadOnly isSelected={false}>\n Read-only off\n </Switch>\n <Switch isReadOnly isSelected={true}>\n Read-only on\n </Switch>\n </Stack>\n );\n};\n```\n\n## Component requirements\n\n## Accessibility\n\nThe Switch component follows the [WAI-ARIA Switch pattern](https://www.w3.org/WAI/ARIA/apg/patterns/switch/) and meets accessibility standards:\n\n#### Role\n\n- The switch uses a checkbox input with `type=\"checkbox\"` and `role=\"switch\"` semantics\n- The component properly communicates its state through ARIA attributes\n\n#### Labeling\n\n**With visible label:**\n```tsx\n<Switch>Enable dark mode</Switch>\n```\n\n**Without visible label (using aria-label):**\n```tsx\n<Switch aria-label=\"Enable dark mode\" />\n```\n\n**With external label (using aria-labelledby):**\n```tsx\n<>\n <span id=\"dark-mode-label\">Enable dark mode</span>\n <Switch aria-labelledby=\"dark-mode-label\" />\n</>\n```\n\n#### Keyboard navigation\n\n| Key | Action |\n|-----|--------|\n| <kbd>Tab</kbd> | Moves focus to/from the switch |\n| <kbd>Space</kbd> | Toggles the switch between on and off states |\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<Switch id=\"notification-toggle\">Enable notifications</Switch>\n```\n\n## API reference\n\n<PropsTable id=\"Switch\" />\n\n## Common patterns\n\n### Settings toggle\n\nUse switches for user preference settings that can be turned on or off.\n\n```jsx live-dev\nconst App = () => {\n const [settings, setSettings] = React.useState({\n emailNotifications: true,\n pushNotifications: false,\n weeklyDigest: true,\n });\n\n return (\n <Stack gap=\"400\">\n <Text fontSize=\"450\" fontWeight=\"medium\">\n Notification Settings\n </Text>\n <Switch\n isSelected={settings.emailNotifications}\n onChange={(value) =>\n setSettings({ ...settings, emailNotifications: value })\n }\n >\n Email notifications\n </Switch>\n <Switch\n isSelected={settings.pushNotifications}\n onChange={(value) =>\n setSettings({ ...settings, pushNotifications: value })\n }\n >\n Push notifications\n </Switch>\n <Switch\n isSelected={settings.weeklyDigest}\n onChange={(value) =>\n setSettings({ ...settings, weeklyDigest: value })\n }\n >\n Weekly digest emails\n </Switch>\n </Stack>\n );\n};\n```\n\n### Feature enable/disable\n\nUse switches to enable or disable application features.\n\n```jsx live-dev\nconst App = () => {\n const [darkMode, setDarkMode] = React.useState(false);\n const [autoSave, setAutoSave] = React.useState(true);\n\n return (\n <Stack gap=\"400\">\n <Text fontSize=\"450\" fontWeight=\"medium\">\n Editor Settings\n </Text>\n <Switch isSelected={darkMode} onChange={setDarkMode}>\n Dark mode\n </Switch>\n <Switch isSelected={autoSave} onChange={setAutoSave}>\n Auto-save\n </Switch>\n {autoSave && (\n <Text fontSize=\"350\" color=\"neutral.11\">\n Changes will be saved automatically every 30 seconds\n </Text>\n )}\n </Stack>\n );\n};\n```\n\n### Conditional content display\n\nShow or hide content based on switch state.\n\n```jsx live-dev\nconst App = () => {\n const [showAdvanced, setShowAdvanced] = React.useState(false);\n\n return (\n <Stack gap=\"400\">\n <Switch isSelected={showAdvanced} onChange={setShowAdvanced}>\n Show advanced options\n </Switch>\n {showAdvanced && (\n <Stack gap=\"300\" p=\"400\" bg=\"neutral.3\" borderRadius=\"200\">\n <Text fontSize=\"400\" fontWeight=\"medium\">\n Advanced Options\n </Text>\n <Text fontSize=\"350\">\n Additional configuration options appear here\n </Text>\n </Stack>\n )}\n </Stack>\n );\n};\n```\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using Switch within your application. As the component's internal functionality is already tested by Nimbus, these patterns help you verify your integration and application-specific logic.\n\n### Basic Rendering Tests\n\nVerify the Switch renders with expected elements and attributes\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Switch, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Switch - Basic rendering\", () => {\n it(\"renders with label\", () => {\n render(\n <NimbusProvider>\n <Switch>Enable notifications</Switch>\n </NimbusProvider>\n );\n\n expect(screen.getByText(\"Enable notifications\")).toBeInTheDocument();\n expect(screen.getByRole(\"switch\")).toBeInTheDocument();\n });\n\n it(\"renders without visible label using aria-label\", () => {\n render(\n <NimbusProvider>\n <Switch aria-label=\"Toggle feature\" />\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).toHaveAccessibleName(\"Toggle feature\");\n });\n});\n```\n\n### Interaction Tests\n\nTest user interactions with the Switch\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Switch, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Switch - Interactions\", () => {\n it(\"toggles when clicked\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n\n render(\n <NimbusProvider>\n <Switch onChange={handleChange}>Toggle me</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).not.toBeChecked();\n\n await user.click(switchElement);\n expect(handleChange).toHaveBeenCalledWith(true);\n });\n\n it(\"toggles with keyboard (Space)\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n\n render(\n <NimbusProvider>\n <Switch onChange={handleChange}>Keyboard toggle</Switch>\n </NimbusProvider>\n );\n\n // Use userEvent.tab() instead of element.focus() to avoid act() warnings\n await user.tab();\n await user.keyboard(\" \");\n expect(handleChange).toHaveBeenCalledWith(true);\n });\n\n it(\"maintains state through multiple toggles\", async () => {\n const user = userEvent.setup();\n\n render(\n <NimbusProvider>\n <Switch defaultSelected={false}>Multi-toggle</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).not.toBeChecked();\n\n await user.click(switchElement);\n expect(switchElement).toBeChecked();\n\n await user.click(switchElement);\n expect(switchElement).not.toBeChecked();\n });\n\n it(\"can be focused with Tab key\", async () => {\n const user = userEvent.setup();\n\n render(\n <NimbusProvider>\n <Switch>Focusable switch</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n\n await user.tab();\n expect(switchElement).toHaveFocus();\n });\n});\n```\n\n### Controlled Mode Tests\n\nTest controlled state management\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Switch, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Switch - Controlled mode\", () => {\n it(\"respects controlled isSelected prop\", () => {\n const { rerender } = render(\n <NimbusProvider>\n <Switch isSelected={false}>Controlled switch</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).not.toBeChecked();\n\n rerender(\n <NimbusProvider>\n <Switch isSelected={true}>Controlled switch</Switch>\n </NimbusProvider>\n );\n\n expect(switchElement).toBeChecked();\n });\n\n it(\"calls onChange with new value\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n\n render(\n <NimbusProvider>\n <Switch isSelected={false} onChange={handleChange}>\n Controlled switch\n </Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n await user.click(switchElement);\n\n expect(handleChange).toHaveBeenCalledWith(true);\n });\n\n it(\"updates when isSelected prop changes\", () => {\n const { rerender } = render(\n <NimbusProvider>\n <Switch isSelected={false}>Toggle</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).not.toBeChecked();\n\n rerender(\n <NimbusProvider>\n <Switch isSelected={true}>Toggle</Switch>\n </NimbusProvider>\n );\n\n expect(switchElement).toBeChecked();\n });\n});\n```\n\n### Uncontrolled Mode Tests\n\nTest uncontrolled state management with defaultSelected\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Switch, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Switch - Uncontrolled mode\", () => {\n it(\"uses defaultSelected for initial state\", () => {\n render(\n <NimbusProvider>\n <Switch defaultSelected={true}>Default on</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).toBeChecked();\n });\n\n it(\"manages its own state after initial render\", async () => {\n const user = userEvent.setup();\n\n render(\n <NimbusProvider>\n <Switch defaultSelected={false}>Uncontrolled</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).not.toBeChecked();\n\n await user.click(switchElement);\n expect(switchElement).toBeChecked();\n\n await user.click(switchElement);\n expect(switchElement).not.toBeChecked();\n });\n});\n```\n\n### State Tests\n\nTest different component states (disabled, invalid, readonly)\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Switch, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Switch - States\", () => {\n it(\"renders in disabled state\", () => {\n render(\n <NimbusProvider>\n <Switch isDisabled>Disabled switch</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).toBeDisabled();\n });\n\n it(\"does not respond to clicks when disabled\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n\n render(\n <NimbusProvider>\n <Switch isDisabled onChange={handleChange}>\n Disabled\n </Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n await user.click(switchElement);\n\n expect(handleChange).not.toHaveBeenCalled();\n });\n\n it(\"renders in invalid state\", () => {\n render(\n <NimbusProvider>\n <Switch isInvalid>Invalid switch</Switch>\n </NimbusProvider>\n );\n\n const switchRoot = screen\n .getByText(\"Invalid switch\")\n .closest(\"[data-slot='root']\");\n expect(switchRoot).toHaveAttribute(\"data-invalid\", \"true\");\n });\n\n it(\"renders in readonly state\", () => {\n render(\n <NimbusProvider>\n <Switch isReadOnly isSelected={true}>\n Read-only switch\n </Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).toHaveAttribute(\"aria-readonly\", \"true\");\n });\n\n it(\"does not toggle when readonly\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n\n render(\n <NimbusProvider>\n <Switch isReadOnly isSelected={false} onChange={handleChange}>\n Read-only\n </Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n await user.click(switchElement);\n\n expect(handleChange).not.toHaveBeenCalled();\n });\n});\n```\n\n### Accessibility Tests\n\nVerify accessibility attributes and keyboard navigation\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Switch, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Switch - Accessibility\", () => {\n it(\"has proper switch role\", () => {\n render(\n <NimbusProvider>\n <Switch>Accessible switch</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).toBeInTheDocument();\n });\n\n it(\"has accessible name from label\", () => {\n render(\n <NimbusProvider>\n <Switch>Enable feature</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).toHaveAccessibleName(\"Enable feature\");\n });\n\n it(\"has accessible name from aria-label\", () => {\n render(\n <NimbusProvider>\n <Switch aria-label=\"Toggle notifications\" />\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).toHaveAccessibleName(\"Toggle notifications\");\n });\n\n it(\"supports aria-labelledby\", () => {\n render(\n <NimbusProvider>\n <div>\n <span id=\"switch-label\">Custom label</span>\n <Switch aria-labelledby=\"switch-label\" />\n </div>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).toHaveAccessibleName(\"Custom label\");\n });\n});\n```\n\n### Form Integration Tests\n\nTest form-related functionality\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Switch, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Switch - Form integration\", () => {\n it(\"supports name attribute for form submission\", () => {\n render(\n <NimbusProvider>\n <Switch name=\"notifications\">Enable notifications</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).toHaveAttribute(\"name\", \"notifications\");\n });\n\n it(\"supports value attribute\", () => {\n render(\n <NimbusProvider>\n <Switch value=\"enabled\">Enable feature</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).toHaveAttribute(\"value\", \"enabled\");\n });\n\n it(\"accepts isRequired prop\", () => {\n render(\n <NimbusProvider>\n <Switch isRequired>Accept terms</Switch>\n </NimbusProvider>\n );\n\n const switchElement = screen.getByRole(\"switch\");\n expect(switchElement).toBeInTheDocument();\n });\n});\n```\n\n\n## Resources\n\n- [Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-switch--docs)\n- [React Aria Switch](https://react-spectrum.adobe.com/react-aria/useSwitch.html)\n- [WAI-ARIA Switch Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/switch/)\n- [ARIA: switch role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/switch_role)\n",
285
+ "toc": [
286
+ {
287
+ "value": "Getting started",
288
+ "href": "#getting-started",
289
+ "depth": 2,
290
+ "numbering": [
291
+ 1,
292
+ 1
293
+ ],
294
+ "parent": "root"
295
+ },
296
+ {
297
+ "value": "Import",
298
+ "href": "#import",
299
+ "depth": 3,
300
+ "numbering": [
301
+ 1,
302
+ 1,
303
+ 1
304
+ ],
305
+ "parent": "root"
306
+ },
307
+ {
308
+ "value": "Basic usage",
309
+ "href": "#basic-usage",
310
+ "depth": 3,
311
+ "numbering": [
312
+ 1,
313
+ 1,
314
+ 2
315
+ ],
316
+ "parent": "root"
317
+ },
318
+ {
319
+ "value": "Usage examples",
320
+ "href": "#usage-examples",
321
+ "depth": 2,
322
+ "numbering": [
323
+ 1,
324
+ 2
325
+ ],
326
+ "parent": "root"
327
+ },
328
+ {
329
+ "value": "Size options",
330
+ "href": "#size-options",
331
+ "depth": 3,
332
+ "numbering": [
333
+ 1,
334
+ 2,
335
+ 1
336
+ ],
337
+ "parent": "root"
338
+ },
339
+ {
340
+ "value": "Small size",
341
+ "href": "#small-size",
342
+ "depth": 4,
343
+ "numbering": [
344
+ 1,
345
+ 2,
346
+ 1,
347
+ 1
348
+ ],
349
+ "parent": "root"
350
+ },
351
+ {
352
+ "value": "Medium size",
353
+ "href": "#medium-size",
354
+ "depth": 4,
355
+ "numbering": [
356
+ 1,
357
+ 2,
358
+ 1,
359
+ 2
360
+ ],
361
+ "parent": "root"
362
+ },
363
+ {
364
+ "value": "With label",
365
+ "href": "#with-label",
366
+ "depth": 3,
367
+ "numbering": [
368
+ 1,
369
+ 2,
370
+ 2
371
+ ],
372
+ "parent": "root"
373
+ },
374
+ {
375
+ "value": "Without visible label",
376
+ "href": "#without-visible-label",
377
+ "depth": 3,
378
+ "numbering": [
379
+ 1,
380
+ 2,
381
+ 3
382
+ ],
383
+ "parent": "root"
384
+ },
385
+ {
386
+ "value": "Disabled state",
387
+ "href": "#disabled-state",
388
+ "depth": 3,
389
+ "numbering": [
390
+ 1,
391
+ 2,
392
+ 4
393
+ ],
394
+ "parent": "root"
395
+ },
396
+ {
397
+ "value": "Invalid state",
398
+ "href": "#invalid-state",
399
+ "depth": 3,
400
+ "numbering": [
401
+ 1,
402
+ 2,
403
+ 5
404
+ ],
405
+ "parent": "root"
406
+ },
407
+ {
408
+ "value": "Default selected",
409
+ "href": "#default-selected",
410
+ "depth": 3,
411
+ "numbering": [
412
+ 1,
413
+ 2,
414
+ 6
415
+ ],
416
+ "parent": "root"
417
+ },
418
+ {
419
+ "value": "Uncontrolled mode",
420
+ "href": "#uncontrolled-mode",
421
+ "depth": 3,
422
+ "numbering": [
423
+ 1,
424
+ 2,
425
+ 7
426
+ ],
427
+ "parent": "root"
428
+ },
429
+ {
430
+ "value": "Controlled mode",
431
+ "href": "#controlled-mode",
432
+ "depth": 3,
433
+ "numbering": [
434
+ 1,
435
+ 2,
436
+ 8
437
+ ],
438
+ "parent": "root"
439
+ },
440
+ {
441
+ "value": "Read-only state",
442
+ "href": "#read-only-state",
443
+ "depth": 3,
444
+ "numbering": [
445
+ 1,
446
+ 2,
447
+ 9
448
+ ],
449
+ "parent": "root"
450
+ },
451
+ {
452
+ "value": "Component requirements",
453
+ "href": "#component-requirements",
454
+ "depth": 2,
455
+ "numbering": [
456
+ 1,
457
+ 3
458
+ ],
459
+ "parent": "root"
460
+ },
461
+ {
462
+ "value": "Accessibility",
463
+ "href": "#accessibility",
464
+ "depth": 2,
465
+ "numbering": [
466
+ 1,
467
+ 4
468
+ ],
469
+ "parent": "root"
470
+ },
471
+ {
472
+ "value": "Role",
473
+ "href": "#role",
474
+ "depth": 4,
475
+ "numbering": [
476
+ 1,
477
+ 4,
478
+ 1,
479
+ 1
480
+ ],
481
+ "parent": "root"
482
+ },
483
+ {
484
+ "value": "Labeling",
485
+ "href": "#labeling",
486
+ "depth": 4,
487
+ "numbering": [
488
+ 1,
489
+ 4,
490
+ 1,
491
+ 2
492
+ ],
493
+ "parent": "root"
494
+ },
495
+ {
496
+ "value": "Keyboard navigation",
497
+ "href": "#keyboard-navigation",
498
+ "depth": 4,
499
+ "numbering": [
500
+ 1,
501
+ 4,
502
+ 1,
503
+ 3
504
+ ],
505
+ "parent": "root"
506
+ },
507
+ {
508
+ "value": "Persistent ID",
509
+ "href": "#persistent-id",
510
+ "depth": 4,
511
+ "numbering": [
512
+ 1,
513
+ 4,
514
+ 1,
515
+ 4
516
+ ],
517
+ "parent": "root"
518
+ },
519
+ {
520
+ "value": "API reference",
521
+ "href": "#api-reference",
522
+ "depth": 2,
523
+ "numbering": [
524
+ 1,
525
+ 5
526
+ ],
527
+ "parent": "root"
528
+ },
529
+ {
530
+ "value": "Common patterns",
531
+ "href": "#common-patterns",
532
+ "depth": 2,
533
+ "numbering": [
534
+ 1,
535
+ 6
536
+ ],
537
+ "parent": "root"
538
+ },
539
+ {
540
+ "value": "Settings toggle",
541
+ "href": "#settings-toggle",
542
+ "depth": 3,
543
+ "numbering": [
544
+ 1,
545
+ 6,
546
+ 1
547
+ ],
548
+ "parent": "root"
549
+ },
550
+ {
551
+ "value": "Feature enable/disable",
552
+ "href": "#feature-enabledisable",
553
+ "depth": 3,
554
+ "numbering": [
555
+ 1,
556
+ 6,
557
+ 2
558
+ ],
559
+ "parent": "root"
560
+ },
561
+ {
562
+ "value": "Conditional content display",
563
+ "href": "#conditional-content-display",
564
+ "depth": 3,
565
+ "numbering": [
566
+ 1,
567
+ 6,
568
+ 3
569
+ ],
570
+ "parent": "root"
571
+ },
572
+ {
573
+ "value": "Testing your implementation",
574
+ "href": "#testing-your-implementation",
575
+ "depth": 2,
576
+ "numbering": [
577
+ 1,
578
+ 7
579
+ ],
580
+ "parent": "root"
581
+ },
582
+ {
583
+ "value": "Basic Rendering Tests",
584
+ "href": "#basic-rendering-tests",
585
+ "depth": 3,
586
+ "numbering": [
587
+ 1,
588
+ 7,
589
+ 1
590
+ ],
591
+ "parent": "root"
592
+ },
593
+ {
594
+ "value": "Interaction Tests",
595
+ "href": "#interaction-tests",
596
+ "depth": 3,
597
+ "numbering": [
598
+ 1,
599
+ 7,
600
+ 2
601
+ ],
602
+ "parent": "root"
603
+ },
604
+ {
605
+ "value": "Controlled Mode Tests",
606
+ "href": "#controlled-mode-tests",
607
+ "depth": 3,
608
+ "numbering": [
609
+ 1,
610
+ 7,
611
+ 3
612
+ ],
613
+ "parent": "root"
614
+ },
615
+ {
616
+ "value": "Uncontrolled Mode Tests",
617
+ "href": "#uncontrolled-mode-tests",
618
+ "depth": 3,
619
+ "numbering": [
620
+ 1,
621
+ 7,
622
+ 4
623
+ ],
624
+ "parent": "root"
625
+ },
626
+ {
627
+ "value": "State Tests",
628
+ "href": "#state-tests",
629
+ "depth": 3,
630
+ "numbering": [
631
+ 1,
632
+ 7,
633
+ 5
634
+ ],
635
+ "parent": "root"
636
+ },
637
+ {
638
+ "value": "Accessibility Tests",
639
+ "href": "#accessibility-tests",
640
+ "depth": 3,
641
+ "numbering": [
642
+ 1,
643
+ 7,
644
+ 6
645
+ ],
646
+ "parent": "root"
647
+ },
648
+ {
649
+ "value": "Form Integration Tests",
650
+ "href": "#form-integration-tests",
651
+ "depth": 3,
652
+ "numbering": [
653
+ 1,
654
+ 7,
655
+ 7
656
+ ],
657
+ "parent": "root"
658
+ },
659
+ {
660
+ "value": "Resources",
661
+ "href": "#resources",
662
+ "depth": 2,
663
+ "numbering": [
664
+ 1,
665
+ 8
666
+ ],
667
+ "parent": "root"
668
+ }
669
+ ]
670
+ },
671
+ "guidelines": {
672
+ "mdx": "\n## Guidelines\n\nSwitch guidelines focus on providing a clear, accessible, and visually\nconsistent binary toggle for on/off states, ensuring discoverability, ease of\ninteraction, and proper communication of the current setting.\n\n### Best practices\n\n- **Labels & feedback**: Use clear labels and provide instant visual feedback on\n state changes.\n- **Functionality**: Employ switches solely for binary on/off actions, avoiding\n overuse.\n- **Accessibility**: Ensure keyboard navigation and proper ARIA for screen\n readers.\n\n### Usage\n\n- **Simple on/off settings**: When users need to toggle a single feature or\n preference between two states (e.g., \"Notifications: On/Off,\" \"Dark Mode:\n On/Off\").\n- **Immediate, direct control**: When users want to quickly and directly change\n a setting without navigating through menus or dialogs.\n- **Visual clarity of state**: When it's important to visually represent the\n current state of a setting at a glance.\n- **User preferences**: When users are setting personal preferences that are\n binary.\n- **Feature toggles**: When users want to enable or disable features of an\n application.\n\n### Mixed interaction states\n\nSwitches should represent binary options, without mixing states. Avoid use cases\nthat will need to represent summaries when options are mixed. Try using\ncheckboxes if you have many settings that are selectable.\n\n> [!TIP]\\\n> **Do**\n>\n> - Keep switches to binary options, simplifying for the user.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"200\" alignItems=\"flex-start\">\n <Text fontWeight=\"700\">Notifications</Text>\n <Separator />\n <Switch>Email notifications</Switch>\n <Switch>Text notifications</Switch>\n </Stack>\n);\n```\n\n> [!CAUTION]\\\n> **Don't**\n>\n> - There is not an indeterminate state for switches. Do not design experiences\n> where a switch is being used to summarize mixed settings.\n> - Do not excessively use switches, other options like checkboxes are\n> available.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"200\" alignItems=\"flex-start\">\n <Switch>Notifications</Switch>\n <Separator />\n <Switch defaultSelected>Email notifications</Switch>\n <Switch>Text notifications</Switch>\n </Stack>\n);\n```\n",
673
+ "toc": [
674
+ {
675
+ "value": "Guidelines",
676
+ "href": "#guidelines",
677
+ "depth": 2,
678
+ "numbering": [
679
+ 1,
680
+ 1
681
+ ],
682
+ "parent": "root"
683
+ },
684
+ {
685
+ "value": "Best practices",
686
+ "href": "#best-practices",
687
+ "depth": 3,
688
+ "numbering": [
689
+ 1,
690
+ 1,
691
+ 1
692
+ ],
693
+ "parent": "root"
694
+ },
695
+ {
696
+ "value": "Usage",
697
+ "href": "#usage",
698
+ "depth": 3,
699
+ "numbering": [
700
+ 1,
701
+ 1,
702
+ 2
703
+ ],
704
+ "parent": "root"
705
+ },
706
+ {
707
+ "value": "Mixed interaction states",
708
+ "href": "#mixed-interaction-states",
709
+ "depth": 3,
710
+ "numbering": [
711
+ 1,
712
+ 1,
713
+ 3
714
+ ],
715
+ "parent": "root"
716
+ }
717
+ ]
718
+ }
719
+ }
720
+ }