@commercetools/nimbus-mcp 0.1.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/README.md +63 -14
  2. package/data/docs/route-manifest.json +10913 -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-separator.json +461 -0
  59. package/data/docs/routes/components-layout-simple-grid.json +519 -0
  60. package/data/docs/routes/components-layout-spacer.json +573 -0
  61. package/data/docs/routes/components-layout-stack.json +481 -0
  62. package/data/docs/routes/components-layout.json +34 -0
  63. package/data/docs/routes/components-media-avatar.json +427 -0
  64. package/data/docs/routes/components-media-icon.json +663 -0
  65. package/data/docs/routes/components-media-image.json +511 -0
  66. package/data/docs/routes/components-media-inline-svg.json +586 -0
  67. package/data/docs/routes/components-media.json +34 -0
  68. package/data/docs/routes/components-navigation-accordion.json +643 -0
  69. package/data/docs/routes/components-navigation-collapsible-motion.json +628 -0
  70. package/data/docs/routes/components-navigation-link.json +554 -0
  71. package/data/docs/routes/components-navigation-menu.json +546 -0
  72. package/data/docs/routes/components-navigation-pagination.json +502 -0
  73. package/data/docs/routes/components-navigation-steps.json +629 -0
  74. package/data/docs/routes/components-navigation-tabnav.json +546 -0
  75. package/data/docs/routes/components-navigation-tabs.json +635 -0
  76. package/data/docs/routes/components-navigation-toolbar.json +549 -0
  77. package/data/docs/routes/components-navigation.json +34 -0
  78. package/data/docs/routes/components-typography-code.json +39 -0
  79. package/data/docs/routes/components-typography-heading.json +402 -0
  80. package/data/docs/routes/components-typography-kbd.json +399 -0
  81. package/data/docs/routes/components-typography-list.json +593 -0
  82. package/data/docs/routes/components-typography-text.json +444 -0
  83. package/data/docs/routes/components-typography.json +34 -0
  84. package/data/docs/routes/components-utilities-nimbus-i18n-provider.json +295 -0
  85. package/data/docs/routes/components-utilities-nimbus-provider.json +663 -0
  86. package/data/docs/routes/components-utilities.json +34 -0
  87. package/data/docs/routes/components.json +33 -0
  88. package/data/docs/routes/home-contribute-adrs-adr0001-consumer-component-apis.json +314 -0
  89. package/data/docs/routes/home-contribute-adrs-adr0002-compound-component-extraction.json +160 -0
  90. package/data/docs/routes/home-contribute-adrs-adr0003-component-lifecycle-states.json +460 -0
  91. package/data/docs/routes/home-contribute-adrs.json +205 -0
  92. package/data/docs/routes/home-contribute-development-setup.json +213 -0
  93. package/data/docs/routes/home-contribute-stats.json +36 -0
  94. package/data/docs/routes/home-contribute.json +36 -0
  95. package/data/docs/routes/home-design-tokens-aspect-ratios.json +36 -0
  96. package/data/docs/routes/home-design-tokens-borders.json +35 -0
  97. package/data/docs/routes/home-design-tokens-colors.json +157 -0
  98. package/data/docs/routes/home-design-tokens-other-animations.json +119 -0
  99. package/data/docs/routes/home-design-tokens-other-blurs.json +36 -0
  100. package/data/docs/routes/home-design-tokens-other-breakpoints.json +61 -0
  101. package/data/docs/routes/home-design-tokens-other-cursors.json +36 -0
  102. package/data/docs/routes/home-design-tokens-other-z-indices.json +39 -0
  103. package/data/docs/routes/home-design-tokens-other.json +35 -0
  104. package/data/docs/routes/home-design-tokens-radii.json +59 -0
  105. package/data/docs/routes/home-design-tokens-shadows.json +57 -0
  106. package/data/docs/routes/home-design-tokens-sizes.json +137 -0
  107. package/data/docs/routes/home-design-tokens-spacing.json +36 -0
  108. package/data/docs/routes/home-design-tokens-typography.json +184 -0
  109. package/data/docs/routes/home-design-tokens.json +34 -0
  110. package/data/docs/routes/home-getting-started-core-concepts.json +301 -0
  111. package/data/docs/routes/home-getting-started-installation.json +621 -0
  112. package/data/docs/routes/home-getting-started-mcp-server-overview.json +139 -0
  113. package/data/docs/routes/home-getting-started-mcp-server-setup.json +316 -0
  114. package/data/docs/routes/home-getting-started-release-process.json +294 -0
  115. package/data/docs/routes/home-getting-started-testing-setup.json +296 -0
  116. package/data/docs/routes/home-playground-markdown.json +638 -0
  117. package/data/docs/routes/home-playground-toc.json +169 -0
  118. package/data/docs/routes/home-playground.json +34 -0
  119. package/data/docs/routes/home-style-props-background.json +236 -0
  120. package/data/docs/routes/home-style-props-border.json +310 -0
  121. package/data/docs/routes/home-style-props-display.json +120 -0
  122. package/data/docs/routes/home-style-props-effects.json +116 -0
  123. package/data/docs/routes/home-style-props-filters.json +396 -0
  124. package/data/docs/routes/home-style-props-flex-and-grid.json +496 -0
  125. package/data/docs/routes/home-style-props-interactivity.json +356 -0
  126. package/data/docs/routes/home-style-props-layout.json +422 -0
  127. package/data/docs/routes/home-style-props-list.json +116 -0
  128. package/data/docs/routes/home-style-props-sizing.json +244 -0
  129. package/data/docs/routes/home-style-props-spacing.json +228 -0
  130. package/data/docs/routes/home-style-props-svg.json +96 -0
  131. package/data/docs/routes/home-style-props-tables.json +116 -0
  132. package/data/docs/routes/home-style-props-transforms.json +216 -0
  133. package/data/docs/routes/home-style-props-transitions.json +216 -0
  134. package/data/docs/routes/home-style-props-typography.json +536 -0
  135. package/data/docs/routes/home-style-props.json +33 -0
  136. package/data/docs/routes/home.json +32 -0
  137. package/data/docs/routes/hooks-usecopytoclipboard.json +76 -0
  138. package/data/docs/routes/hooks-usehotkeys.json +117 -0
  139. package/data/docs/routes/hooks.json +33 -0
  140. package/data/docs/routes/icons.json +32 -0
  141. package/data/docs/routes/patterns-fields-date-range-picker-field.json +393 -0
  142. package/data/docs/routes/patterns-fields-money-input-field.json +415 -0
  143. package/data/docs/routes/patterns-fields-multiline-text-input-field.json +404 -0
  144. package/data/docs/routes/patterns-fields-number-input-field.json +470 -0
  145. package/data/docs/routes/patterns-fields-password-input-field.json +319 -0
  146. package/data/docs/routes/patterns-fields-search-input-field.json +382 -0
  147. package/data/docs/routes/patterns-fields-text-input-field.json +404 -0
  148. package/data/docs/routes/patterns-fields.json +78 -0
  149. package/data/docs/routes/patterns.json +34 -0
  150. package/data/docs/search-index.json +1 -0
  151. package/data/docs/types/Accordion.json +12 -0
  152. package/data/docs/types/AccordionContent.json +286 -0
  153. package/data/docs/types/AccordionHeader.json +891 -0
  154. package/data/docs/types/AccordionHeaderRightContent.json +27 -0
  155. package/data/docs/types/AccordionItem.json +242 -0
  156. package/data/docs/types/AccordionRoot.json +162 -0
  157. package/data/docs/types/Alert.json +12 -0
  158. package/data/docs/types/AlertActions.json +11 -0
  159. package/data/docs/types/AlertDescription.json +118 -0
  160. package/data/docs/types/AlertDismissButton.json +937 -0
  161. package/data/docs/types/AlertRoot.json +42 -0
  162. package/data/docs/types/AlertTitle.json +118 -0
  163. package/data/docs/types/Avatar.json +125 -0
  164. package/data/docs/types/Badge.json +64 -0
  165. package/data/docs/types/Body.json +67 -0
  166. package/data/docs/types/Box.json +85 -0
  167. package/data/docs/types/Button.json +1015 -0
  168. package/data/docs/types/Calendar.json +565 -0
  169. package/data/docs/types/Caption.json +67 -0
  170. package/data/docs/types/Card.json +12 -0
  171. package/data/docs/types/CardContent.json +27 -0
  172. package/data/docs/types/CardHeader.json +27 -0
  173. package/data/docs/types/CardRoot.json +106 -0
  174. package/data/docs/types/Cell.json +227 -0
  175. package/data/docs/types/Checkbox.json +897 -0
  176. package/data/docs/types/Code.json +112 -0
  177. package/data/docs/types/CollapsibleMotionContent.json +35 -0
  178. package/data/docs/types/CollapsibleMotionRoot.json +99 -0
  179. package/data/docs/types/CollapsibleMotionTrigger.json +71 -0
  180. package/data/docs/types/Column.json +101 -0
  181. package/data/docs/types/ColumnGroup.json +101 -0
  182. package/data/docs/types/ColumnHeader.json +193 -0
  183. package/data/docs/types/ComboBoxListBox.json +751 -0
  184. package/data/docs/types/ComboBoxOption.json +672 -0
  185. package/data/docs/types/ComboBoxPopover.json +786 -0
  186. package/data/docs/types/ComboBoxRoot.json +747 -0
  187. package/data/docs/types/ComboBoxSection.json +277 -0
  188. package/data/docs/types/ComboBoxTrigger.json +70 -0
  189. package/data/docs/types/Content.json +33 -0
  190. package/data/docs/types/DataTable.json +596 -0
  191. package/data/docs/types/DataTableBody.json +223 -0
  192. package/data/docs/types/DataTableFooter.json +27 -0
  193. package/data/docs/types/DataTableHeader.json +269 -0
  194. package/data/docs/types/DataTableManager.json +11 -0
  195. package/data/docs/types/DataTableRoot.json +590 -0
  196. package/data/docs/types/DataTableTable.json +271 -0
  197. package/data/docs/types/DateInput.json +792 -0
  198. package/data/docs/types/DatePicker.json +700 -0
  199. package/data/docs/types/DateRangePicker.json +936 -0
  200. package/data/docs/types/DateRangePickerField.json +1047 -0
  201. package/data/docs/types/DefaultPage.json +12 -0
  202. package/data/docs/types/DefaultPageActions.json +27 -0
  203. package/data/docs/types/DefaultPageBackLink.json +213 -0
  204. package/data/docs/types/DefaultPageContent.json +27 -0
  205. package/data/docs/types/DefaultPageFooter.json +27 -0
  206. package/data/docs/types/DefaultPageHeader.json +27 -0
  207. package/data/docs/types/DefaultPageRoot.json +106 -0
  208. package/data/docs/types/DefaultPageSubtitle.json +27 -0
  209. package/data/docs/types/DefaultPageTabNav.json +28 -0
  210. package/data/docs/types/DefaultPageTitle.json +27 -0
  211. package/data/docs/types/DialogBody.json +27 -0
  212. package/data/docs/types/DialogCloseTrigger.json +939 -0
  213. package/data/docs/types/DialogContent.json +27 -0
  214. package/data/docs/types/DialogFooter.json +27 -0
  215. package/data/docs/types/DialogHeader.json +27 -0
  216. package/data/docs/types/DialogRoot.json +138 -0
  217. package/data/docs/types/DialogTitle.json +27 -0
  218. package/data/docs/types/DialogTrigger.json +80 -0
  219. package/data/docs/types/DraggableList.json +12 -0
  220. package/data/docs/types/DraggableListField.json +894 -0
  221. package/data/docs/types/DraggableListItem.json +574 -0
  222. package/data/docs/types/DraggableListRoot.json +745 -0
  223. package/data/docs/types/Drawer.json +12 -0
  224. package/data/docs/types/DrawerBody.json +27 -0
  225. package/data/docs/types/DrawerCloseTrigger.json +939 -0
  226. package/data/docs/types/DrawerContent.json +27 -0
  227. package/data/docs/types/DrawerFooter.json +27 -0
  228. package/data/docs/types/DrawerHeader.json +27 -0
  229. package/data/docs/types/DrawerRoot.json +142 -0
  230. package/data/docs/types/DrawerTitle.json +27 -0
  231. package/data/docs/types/DrawerTrigger.json +80 -0
  232. package/data/docs/types/FieldErrors.getBuiltInMessage.json +11 -0
  233. package/data/docs/types/FieldErrors.getCustomMessage.json +9 -0
  234. package/data/docs/types/FieldErrors.json +109 -0
  235. package/data/docs/types/Flex.json +238 -0
  236. package/data/docs/types/Footer.json +67 -0
  237. package/data/docs/types/FormFieldDescription.json +11 -0
  238. package/data/docs/types/FormFieldError.json +11 -0
  239. package/data/docs/types/FormFieldInfoBox.json +27 -0
  240. package/data/docs/types/FormFieldInput.json +11 -0
  241. package/data/docs/types/FormFieldLabel.json +11 -0
  242. package/data/docs/types/FormFieldRoot.json +148 -0
  243. package/data/docs/types/Grid.json +253 -0
  244. package/data/docs/types/GridProps.json +11 -0
  245. package/data/docs/types/Group.json +143 -0
  246. package/data/docs/types/Header.json +67 -0
  247. package/data/docs/types/Heading.json +109 -0
  248. package/data/docs/types/Icon.json +112 -0
  249. package/data/docs/types/IconButton.json +1019 -0
  250. package/data/docs/types/IconToggleButton.json +787 -0
  251. package/data/docs/types/Image.json +373 -0
  252. package/data/docs/types/Indicator.json +67 -0
  253. package/data/docs/types/InlineSvg.json +98 -0
  254. package/data/docs/types/Item.json +67 -0
  255. package/data/docs/types/Kbd.json +118 -0
  256. package/data/docs/types/Link.json +380 -0
  257. package/data/docs/types/List.json +12 -0
  258. package/data/docs/types/ListIndicator.json +70 -0
  259. package/data/docs/types/ListItem.json +70 -0
  260. package/data/docs/types/ListRoot.json +124 -0
  261. package/data/docs/types/LoadingSpinner.json +87 -0
  262. package/data/docs/types/LocalizedField.json +460 -0
  263. package/data/docs/types/LocalizedStringFormatter.json +9 -0
  264. package/data/docs/types/MakeElementFocusable.json +196 -0
  265. package/data/docs/types/MenuContent.json +111 -0
  266. package/data/docs/types/MenuItem.json +671 -0
  267. package/data/docs/types/MenuRoot.json +670 -0
  268. package/data/docs/types/MenuSection.json +364 -0
  269. package/data/docs/types/MenuSubmenu.json +111 -0
  270. package/data/docs/types/MenuSubmenuTrigger.json +67 -0
  271. package/data/docs/types/MenuTrigger.json +906 -0
  272. package/data/docs/types/ModalPage.json +12 -0
  273. package/data/docs/types/ModalPageActions.json +27 -0
  274. package/data/docs/types/ModalPageContent.json +27 -0
  275. package/data/docs/types/ModalPageFooter.json +27 -0
  276. package/data/docs/types/ModalPageHeader.json +27 -0
  277. package/data/docs/types/ModalPageRoot.json +87 -0
  278. package/data/docs/types/ModalPageSubtitle.json +27 -0
  279. package/data/docs/types/ModalPageTabNav.json +28 -0
  280. package/data/docs/types/ModalPageTitle.json +27 -0
  281. package/data/docs/types/ModalPageTopBar.json +57 -0
  282. package/data/docs/types/MoneyInput.isEmpty.json +40 -0
  283. package/data/docs/types/MoneyInput.json +282 -0
  284. package/data/docs/types/MoneyInputField.json +379 -0
  285. package/data/docs/types/MoneyInputFieldProps.json +9 -0
  286. package/data/docs/types/MultilineTextInput.json +1194 -0
  287. package/data/docs/types/MultilineTextInputField.json +1269 -0
  288. package/data/docs/types/MultilineTextInputFieldProps.json +9 -0
  289. package/data/docs/types/NimbusI18nProvider.json +42 -0
  290. package/data/docs/types/NimbusI18nProviderProps.json +9 -0
  291. package/data/docs/types/NimbusProvider.json +270 -0
  292. package/data/docs/types/NumberInput.json +952 -0
  293. package/data/docs/types/NumberInputField.json +1004 -0
  294. package/data/docs/types/NumberInputFieldProps.json +9 -0
  295. package/data/docs/types/PageContent.json +11 -0
  296. package/data/docs/types/PageContentColumn.json +99 -0
  297. package/data/docs/types/PageContentRoot.json +114 -0
  298. package/data/docs/types/Pagination.json +159 -0
  299. package/data/docs/types/PasswordInput.json +1120 -0
  300. package/data/docs/types/PasswordInputField.json +1216 -0
  301. package/data/docs/types/PasswordInputFieldProps.json +9 -0
  302. package/data/docs/types/ProgressBar.json +280 -0
  303. package/data/docs/types/RadioInputOption.json +550 -0
  304. package/data/docs/types/RadioInputRoot.json +514 -0
  305. package/data/docs/types/RangeCalendar.json +618 -0
  306. package/data/docs/types/RichTextInput.json +134 -0
  307. package/data/docs/types/Root.json +122 -0
  308. package/data/docs/types/Row.json +67 -0
  309. package/data/docs/types/ScopedSearchInput.isEmpty.json +40 -0
  310. package/data/docs/types/ScopedSearchInput.json +253 -0
  311. package/data/docs/types/ScrollArea.json +82 -0
  312. package/data/docs/types/SearchInput.json +1165 -0
  313. package/data/docs/types/SearchInputField.json +1240 -0
  314. package/data/docs/types/Select.json +12 -0
  315. package/data/docs/types/SelectOption.json +572 -0
  316. package/data/docs/types/SelectOptionGroup.json +215 -0
  317. package/data/docs/types/SelectOptions.json +693 -0
  318. package/data/docs/types/SelectRoot.json +926 -0
  319. package/data/docs/types/Separator.json +65 -0
  320. package/data/docs/types/SimpleGrid.json +291 -0
  321. package/data/docs/types/Spacer.json +27 -0
  322. package/data/docs/types/SpacerProps.json +9 -0
  323. package/data/docs/types/SplitButton.json +203 -0
  324. package/data/docs/types/Stack.json +144 -0
  325. package/data/docs/types/Steps.json +12 -0
  326. package/data/docs/types/StepsChangeDetails.json +9 -0
  327. package/data/docs/types/StepsCompletedContent.json +28 -0
  328. package/data/docs/types/StepsCompletedContentProps.json +9 -0
  329. package/data/docs/types/StepsContent.json +43 -0
  330. package/data/docs/types/StepsContentProps.json +9 -0
  331. package/data/docs/types/StepsDescription.json +28 -0
  332. package/data/docs/types/StepsDescriptionProps.json +9 -0
  333. package/data/docs/types/StepsIndicator.json +28 -0
  334. package/data/docs/types/StepsIndicatorProps.json +9 -0
  335. package/data/docs/types/StepsItem.json +43 -0
  336. package/data/docs/types/StepsItemProps.json +9 -0
  337. package/data/docs/types/StepsList.json +28 -0
  338. package/data/docs/types/StepsListProps.json +9 -0
  339. package/data/docs/types/StepsNextTrigger.json +62 -0
  340. package/data/docs/types/StepsNextTriggerProps.json +9 -0
  341. package/data/docs/types/StepsNumber.json +28 -0
  342. package/data/docs/types/StepsNumberProps.json +9 -0
  343. package/data/docs/types/StepsPrevTrigger.json +62 -0
  344. package/data/docs/types/StepsPrevTriggerProps.json +9 -0
  345. package/data/docs/types/StepsRoot.json +183 -0
  346. package/data/docs/types/StepsRootProps.json +11 -0
  347. package/data/docs/types/StepsSeparator.json +28 -0
  348. package/data/docs/types/StepsSeparatorProps.json +9 -0
  349. package/data/docs/types/StepsStatus.json +57 -0
  350. package/data/docs/types/StepsStatusProps.json +9 -0
  351. package/data/docs/types/StepsTitle.json +28 -0
  352. package/data/docs/types/StepsTitleProps.json +9 -0
  353. package/data/docs/types/StepsTrigger.json +47 -0
  354. package/data/docs/types/StepsTriggerProps.json +9 -0
  355. package/data/docs/types/Switch.json +371 -0
  356. package/data/docs/types/TabListProps.json +9 -0
  357. package/data/docs/types/TabNav.json +12 -0
  358. package/data/docs/types/TabNavItem.json +300 -0
  359. package/data/docs/types/TabNavItemProps.json +9 -0
  360. package/data/docs/types/TabNavProps.json +9 -0
  361. package/data/docs/types/TabNavRoot.json +80 -0
  362. package/data/docs/types/TabPanelProps.json +9 -0
  363. package/data/docs/types/TabPanelsProps.json +9 -0
  364. package/data/docs/types/TabProps.json +9 -0
  365. package/data/docs/types/Table.json +9 -0
  366. package/data/docs/types/TableBody.json +67 -0
  367. package/data/docs/types/TableBodyProps.json +9 -0
  368. package/data/docs/types/TableCaption.json +67 -0
  369. package/data/docs/types/TableCaptionProps.json +9 -0
  370. package/data/docs/types/TableCell.json +227 -0
  371. package/data/docs/types/TableCellProps.json +9 -0
  372. package/data/docs/types/TableColumn.json +101 -0
  373. package/data/docs/types/TableColumnGroup.json +101 -0
  374. package/data/docs/types/TableColumnGroupProps.json +9 -0
  375. package/data/docs/types/TableColumnHeader.json +193 -0
  376. package/data/docs/types/TableColumnHeaderProps.json +9 -0
  377. package/data/docs/types/TableColumnProps.json +9 -0
  378. package/data/docs/types/TableFooter.json +67 -0
  379. package/data/docs/types/TableFooterProps.json +9 -0
  380. package/data/docs/types/TableHeader.json +67 -0
  381. package/data/docs/types/TableHeaderProps.json +9 -0
  382. package/data/docs/types/TableRoot.json +365 -0
  383. package/data/docs/types/TableRootProps.json +12 -0
  384. package/data/docs/types/TableRow.json +67 -0
  385. package/data/docs/types/TableRowProps.json +9 -0
  386. package/data/docs/types/TableScrollArea.json +82 -0
  387. package/data/docs/types/TableScrollAreaProps.json +9 -0
  388. package/data/docs/types/Tabs.json +12 -0
  389. package/data/docs/types/TabsList.json +110 -0
  390. package/data/docs/types/TabsPanel.json +112 -0
  391. package/data/docs/types/TabsPanels.json +108 -0
  392. package/data/docs/types/TabsRoot.json +211 -0
  393. package/data/docs/types/TabsTab.json +174 -0
  394. package/data/docs/types/TagGroup.json +12 -0
  395. package/data/docs/types/TagGroupRoot.json +306 -0
  396. package/data/docs/types/TagGroupTag.json +595 -0
  397. package/data/docs/types/TagGroupTagList.json +166 -0
  398. package/data/docs/types/Text.json +119 -0
  399. package/data/docs/types/TextInput.json +1156 -0
  400. package/data/docs/types/TextInputField.json +1263 -0
  401. package/data/docs/types/TimeInput.json +752 -0
  402. package/data/docs/types/ToastAction.json +9 -0
  403. package/data/docs/types/ToastManagerApi.json +9 -0
  404. package/data/docs/types/ToastOptions.json +9 -0
  405. package/data/docs/types/ToastOutlet.json +12 -0
  406. package/data/docs/types/ToastPlacement.json +9 -0
  407. package/data/docs/types/ToastPromiseOptions.json +9 -0
  408. package/data/docs/types/ToastType.json +9 -0
  409. package/data/docs/types/ToastVariant.json +9 -0
  410. package/data/docs/types/ToggleButton.json +789 -0
  411. package/data/docs/types/ToggleButtonGroup.json +9 -0
  412. package/data/docs/types/ToggleButtonGroupButton.json +331 -0
  413. package/data/docs/types/ToggleButtonGroupRoot.json +269 -0
  414. package/data/docs/types/Toolbar.json +176 -0
  415. package/data/docs/types/Tooltip.json +12 -0
  416. package/data/docs/types/TooltipContent.json +372 -0
  417. package/data/docs/types/TooltipRoot.json +179 -0
  418. package/data/docs/types/Trigger.json +69 -0
  419. package/data/docs/types/VisuallyHidden.json +93 -0
  420. package/data/docs/types/__object.json +12 -0
  421. package/data/docs/types/filters.json +11 -0
  422. package/data/docs/types/manifest.json +278 -0
  423. package/data/docs/types/toast.json +234 -0
  424. package/data/docs/types/useColorMode.json +13 -0
  425. package/data/docs/types/useColorModeValue.json +13 -0
  426. package/data/docs/types/useColorScheme.json +12 -0
  427. package/data/docs/types/useLocalizedStringFormatter.json +14 -0
  428. package/data/icons.json +21940 -0
  429. package/data/tokens.json +40061 -0
  430. package/dist/index.js +2516 -17
  431. package/package.json +25 -6
  432. package/dist/data-loader.d.ts +0 -102
  433. package/dist/data-loader.js +0 -104
  434. package/dist/index.d.ts +0 -13
  435. package/dist/server.d.ts +0 -9
  436. package/dist/server.js +0 -22
  437. package/dist/server.spec.d.ts +0 -1
  438. package/dist/server.spec.js +0 -69
  439. package/dist/tools/list-components.d.ts +0 -9
  440. package/dist/tools/list-components.js +0 -42
  441. package/dist/types.d.ts +0 -28
  442. package/dist/types.js +0 -4
  443. package/src/data-loader.ts +0 -226
  444. package/src/index.ts +0 -29
  445. package/src/server.spec.ts +0 -86
  446. package/src/server.ts +0 -28
  447. package/src/tools/list-components.ts +0 -49
  448. package/src/types.ts +0 -31
  449. package/tsconfig.json +0 -14
  450. package/vitest.config.ts +0 -9
@@ -0,0 +1,647 @@
1
+ {
2
+ "meta": {
3
+ "id": "Components-NumberInput",
4
+ "title": "Number input",
5
+ "exportName": "NumberInput",
6
+ "description": "A number input allows users to enter numerical values and adjust them incrementally.",
7
+ "lifecycleState": "Stable",
8
+ "order": 999,
9
+ "repoPath": "packages/nimbus/src/components/number-input/number-input.mdx",
10
+ "menu": [
11
+ "Components",
12
+ "Inputs",
13
+ "Number input"
14
+ ],
15
+ "route": "components/inputs/number-input",
16
+ "tags": [
17
+ "component",
18
+ "number",
19
+ "input",
20
+ "numeric",
21
+ "stepper"
22
+ ],
23
+ "toc": [
24
+ {
25
+ "value": "Overview",
26
+ "href": "#overview",
27
+ "depth": 2,
28
+ "numbering": [
29
+ 1,
30
+ 1
31
+ ],
32
+ "parent": "root"
33
+ },
34
+ {
35
+ "value": "Key features",
36
+ "href": "#key-features",
37
+ "depth": 3,
38
+ "numbering": [
39
+ 1,
40
+ 1,
41
+ 1
42
+ ],
43
+ "parent": "root"
44
+ },
45
+ {
46
+ "value": "Resources",
47
+ "href": "#resources",
48
+ "depth": 3,
49
+ "numbering": [
50
+ 1,
51
+ 1,
52
+ 2
53
+ ],
54
+ "parent": "root"
55
+ },
56
+ {
57
+ "value": "Variables",
58
+ "href": "#variables",
59
+ "depth": 2,
60
+ "numbering": [
61
+ 1,
62
+ 2
63
+ ],
64
+ "parent": "root"
65
+ },
66
+ {
67
+ "value": "Visual options",
68
+ "href": "#visual-options",
69
+ "depth": 3,
70
+ "numbering": [
71
+ 1,
72
+ 2,
73
+ 1
74
+ ],
75
+ "parent": "root"
76
+ },
77
+ {
78
+ "value": "Size",
79
+ "href": "#size",
80
+ "depth": 4,
81
+ "numbering": [
82
+ 1,
83
+ 2,
84
+ 1,
85
+ 1
86
+ ],
87
+ "parent": "root"
88
+ },
89
+ {
90
+ "value": "Appearance",
91
+ "href": "#appearance",
92
+ "depth": 4,
93
+ "numbering": [
94
+ 1,
95
+ 2,
96
+ 1,
97
+ 2
98
+ ],
99
+ "parent": "root"
100
+ }
101
+ ],
102
+ "layout": "app-frame",
103
+ "tabs": [
104
+ {
105
+ "key": "overview",
106
+ "title": "Overview",
107
+ "order": 0
108
+ },
109
+ {
110
+ "key": "guidelines",
111
+ "title": "Guidelines",
112
+ "order": 2
113
+ },
114
+ {
115
+ "key": "dev",
116
+ "title": "Implementation",
117
+ "order": 3
118
+ },
119
+ {
120
+ "key": "a11y",
121
+ "title": "Accessibility",
122
+ "order": 4
123
+ }
124
+ ]
125
+ },
126
+ "mdx": "\n## Overview\n\nA number input allows users to enter a numeric value and adjust it using stepper\nbuttons. It provides a quick and precise way to modify values within defined\nparameters, especially for small incremental changes.\n\n### Key features\n\n- **Value Clamping:** If a user types a value outside the defined min or max\n range, the value will snap to the nearest valid step or the min/max value on\n blur.\n- **Decimals:** Supports decimal values and step sizes.\n- **Percentages:** Can be configured to display values as percentages,\n automatically multiplying input by 100 for display and dividing by 100 for\n output.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma library](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?m=auto&node-id=3889-9640)\n\n## Variables\n\nGet familiar with the features.\n\n### Visual options\n\n#### Size\n\nMedium is the default size, with a small size for compact needs.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"horizontal\" gap=\"400\" alignItems=\"center\">\n <NumberInput size=\"md\" defaultValue={123} />\n <NumberInput size=\"sm\" defaultValue={123} />\n </Stack>\n)\n```\n\n#### Appearance\n\nMedium is the default size, with a small size for compact needs.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"horizontal\" gap=\"400\" alignItems=\"center\">\n <NumberInput defaultValue={123} />\n <NumberInput size=\"sm\" defaultValue={123} />\n </Stack>\n)\n```\n",
127
+ "views": {
128
+ "overview": {
129
+ "mdx": "\n## Overview\n\nA number input allows users to enter a numeric value and adjust it using stepper\nbuttons. It provides a quick and precise way to modify values within defined\nparameters, especially for small incremental changes.\n\n### Key features\n\n- **Value Clamping:** If a user types a value outside the defined min or max\n range, the value will snap to the nearest valid step or the min/max value on\n blur.\n- **Decimals:** Supports decimal values and step sizes.\n- **Percentages:** Can be configured to display values as percentages,\n automatically multiplying input by 100 for display and dividing by 100 for\n output.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma library](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?m=auto&node-id=3889-9640)\n\n## Variables\n\nGet familiar with the features.\n\n### Visual options\n\n#### Size\n\nMedium is the default size, with a small size for compact needs.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"horizontal\" gap=\"400\" alignItems=\"center\">\n <NumberInput size=\"md\" defaultValue={123} />\n <NumberInput size=\"sm\" defaultValue={123} />\n </Stack>\n)\n```\n\n#### Appearance\n\nMedium is the default size, with a small size for compact needs.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"horizontal\" gap=\"400\" alignItems=\"center\">\n <NumberInput defaultValue={123} />\n <NumberInput size=\"sm\" defaultValue={123} />\n </Stack>\n)\n```\n",
130
+ "toc": [
131
+ {
132
+ "value": "Overview",
133
+ "href": "#overview",
134
+ "depth": 2,
135
+ "numbering": [
136
+ 1,
137
+ 1
138
+ ],
139
+ "parent": "root"
140
+ },
141
+ {
142
+ "value": "Key features",
143
+ "href": "#key-features",
144
+ "depth": 3,
145
+ "numbering": [
146
+ 1,
147
+ 1,
148
+ 1
149
+ ],
150
+ "parent": "root"
151
+ },
152
+ {
153
+ "value": "Resources",
154
+ "href": "#resources",
155
+ "depth": 3,
156
+ "numbering": [
157
+ 1,
158
+ 1,
159
+ 2
160
+ ],
161
+ "parent": "root"
162
+ },
163
+ {
164
+ "value": "Variables",
165
+ "href": "#variables",
166
+ "depth": 2,
167
+ "numbering": [
168
+ 1,
169
+ 2
170
+ ],
171
+ "parent": "root"
172
+ },
173
+ {
174
+ "value": "Visual options",
175
+ "href": "#visual-options",
176
+ "depth": 3,
177
+ "numbering": [
178
+ 1,
179
+ 2,
180
+ 1
181
+ ],
182
+ "parent": "root"
183
+ },
184
+ {
185
+ "value": "Size",
186
+ "href": "#size",
187
+ "depth": 4,
188
+ "numbering": [
189
+ 1,
190
+ 2,
191
+ 1,
192
+ 1
193
+ ],
194
+ "parent": "root"
195
+ },
196
+ {
197
+ "value": "Appearance",
198
+ "href": "#appearance",
199
+ "depth": 4,
200
+ "numbering": [
201
+ 1,
202
+ 2,
203
+ 1,
204
+ 2
205
+ ],
206
+ "parent": "root"
207
+ }
208
+ ]
209
+ },
210
+ "a11y": {
211
+ "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 <NumberInput\n defaultValue={10}\n aria-label=\"Quantity\"\n min={1}\n max={100}\n step={1}\n />\n)\n```\n\n### Accessibility standards\n\n- Always provide a visible label for the input.\n- If a visible label is not used, provide an `aria-label` or `aria-labelledby`\n for screen readers.\n- Ensure sufficient color contrast for all elements (text, borders, icons).\n- Communicate errors clearly, using both visual cues (e.g., color) and\n descriptive error messages.\n- Clearly indicate the focused state.\n- Support keyboard navigation with arrow keys, scroll wheel, and modifier keys.\n- Provide clear feedback for value changes and constraints.\n\n### Resources\n\n- [React Spectrum NumberField](https://react-spectrum.adobe.com/react-spectrum/NumberField.html)\n- [W3C ARIA Authoring Practices Guide (APG)](https://www.w3.org/WAI/ARIA/apg/)\n (Search for \"spinbutton\" or \"number input\" patterns)\n",
212
+ "toc": [
213
+ {
214
+ "value": "Accessibility",
215
+ "href": "#accessibility",
216
+ "depth": 2,
217
+ "numbering": [
218
+ 1,
219
+ 1
220
+ ],
221
+ "parent": "root"
222
+ },
223
+ {
224
+ "value": "Accessibility standards",
225
+ "href": "#accessibility-standards",
226
+ "depth": 3,
227
+ "numbering": [
228
+ 1,
229
+ 1,
230
+ 1
231
+ ],
232
+ "parent": "root"
233
+ },
234
+ {
235
+ "value": "Resources",
236
+ "href": "#resources",
237
+ "depth": 3,
238
+ "numbering": [
239
+ 1,
240
+ 1,
241
+ 2
242
+ ],
243
+ "parent": "root"
244
+ }
245
+ ]
246
+ },
247
+ "dev": {
248
+ "mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { NumberInput, type NumberInputProps } from '@commercetools/nimbus';\n```\n\n### Basic usage\n\nThe simplest implementation uses uncontrolled mode:\n\n```jsx live-dev\nconst App = () => (\n <NumberInput placeholder=\"Enter a number\" />\n)\n```\n\n## Usage examples\n\n### Size options\n\nThe `sm` and `md` size variants are available to match your interface density:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <NumberInput size=\"sm\" placeholder=\"Small input\" />\n <NumberInput size=\"md\" placeholder=\"Medium input (default)\" />\n </Stack>\n)\n```\n\n### Visual variants\n\nChoose between `solid` and `ghost` variants to match your design context:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <NumberInput variant=\"solid\" placeholder=\"Solid variant (default)\" />\n <NumberInput variant=\"ghost\" placeholder=\"Ghost variant\" />\n </Stack>\n)\n```\n\n### Leading and trailing elements\n\nAdd icons, buttons, or other elements before or after the input using `leadingElement` and `trailingElement` props:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <NumberInput\n placeholder=\"Quantity\"\n leadingElement={<Icons.ShoppingCart />}\n />\n <NumberInput\n placeholder=\"Amount\"\n leadingElement={<Icons.AttachMoney />}\n trailingElement={<Icons.TrendingUp />}\n />\n </Stack>\n)\n```\n\n**Behavioral notes:**\n- Elements automatically respect text direction (LTR/RTL)\n- Leading element appears at the start (left in LTR, right in RTL)\n- Trailing element appears before increment/decrement buttons\n- Icon sizing automatically adjusts based on the `size` prop\n\n### Number constraints\n\nControl the acceptable range and increment values using `minValue`, `maxValue`, and `step` props:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">Range constraint (1-100):</Text>\n <NumberInput\n placeholder=\"Enter 1-100\"\n minValue={1}\n maxValue={100}\n />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">Step increment (multiples of 5):</Text>\n <NumberInput\n placeholder=\"Multiples of 5\"\n step={5}\n defaultValue={0}\n />\n </Stack>\n \n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">Combining constraints (10-100, step 10):</Text>\n <NumberInput\n placeholder=\"10, 20, 30...\"\n minValue={10}\n maxValue={100}\n step={10}\n />\n </Stack>\n </Stack>\n)\n```\n\n**Behavioral notes:**\n- `minValue` and `maxValue` enforce valid ranges\n- Increment/decrement buttons respect these limits\n- Users can still type values outside the range, but validation will apply\n- `step` determines the increment/decrement amount (default is 1)\n\n### Decimal numbers\n\nSupport decimal precision by setting the `step` prop to a decimal value:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">Two decimal places (step 0.01):</Text>\n <NumberInput\n placeholder=\"0.00\"\n step={0.01}\n defaultValue={0}\n />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">One decimal place (step 0.1):</Text>\n <NumberInput\n placeholder=\"0.0\"\n step={0.1}\n defaultValue={0}\n />\n </Stack>\n </Stack>\n)\n```\n\n**Behavioral notes:**\n- `step` value determines decimal precision\n- Increment/decrement buttons adjust by the step amount\n- Users can type any decimal value\n- Use with `minValue={0}` for positive-only numbers (prices, quantities)\n\n### Format options\n\nCustomize number display using `formatOptions`, which leverages the [Intl.NumberFormat API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for sophisticated formatting:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">Currency (USD):</Text>\n <NumberInput\n defaultValue={1234.56}\n formatOptions={{\n style: 'currency',\n currency: 'USD'\n }}\n />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">Currency (EUR):</Text>\n <NumberInput\n defaultValue={1234.56}\n formatOptions={{\n style: 'currency',\n currency: 'EUR',\n currencyDisplay: 'code'\n }}\n />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">Percentage:</Text>\n <NumberInput\n defaultValue={0.85}\n step={0.01}\n minValue={0}\n maxValue={1}\n formatOptions={{\n style: 'percent',\n minimumFractionDigits: 0,\n maximumFractionDigits: 2\n }}\n />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">Unit (kilograms):</Text>\n <NumberInput\n defaultValue={45.5}\n step={0.1}\n formatOptions={{\n style: 'unit',\n unit: 'kilogram',\n unitDisplay: 'short'\n }}\n />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">Compact notation (millions):</Text>\n <NumberInput\n defaultValue={1500000}\n step={100000}\n formatOptions={{\n notation: 'compact',\n compactDisplay: 'short'\n }}\n />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">Scientific notation:</Text>\n <NumberInput\n defaultValue={12345}\n step={1000}\n formatOptions={{\n notation: 'scientific',\n maximumFractionDigits: 2\n }}\n />\n </Stack>\n </Stack>\n)\n```\n\n**Common format options:**\n- **Currency**: `{ style: 'currency', currency: 'USD' }` - Formats as money\n- **Percentage**: `{ style: 'percent' }` - Formats decimals as percentages (0.85 → 85%)\n- **Unit**: `{ style: 'unit', unit: 'kilogram' }` - Adds unit labels\n- **Compact**: `{ notation: 'compact' }` - Short form (1,500,000 → 1.5M)\n- **Scientific**: `{ notation: 'scientific' }` - Exponential notation (12345 → 1.23E4)\n\n**Precision control:**\n- `minimumFractionDigits` - Minimum decimal places\n- `maximumFractionDigits` - Maximum decimal places\n- `minimumSignificantDigits` - Minimum significant digits\n- `maximumSignificantDigits` - Maximum significant digits\n\n**Behavioral notes:**\n- Format options affect display only, not the underlying numeric value\n- Parsing automatically handles formatted input\n- Combine with `step` for appropriate increment/decrement amounts\n- Format options work with locale formatting (see Locale formatting section)\n\n### Disabled state\n\nDisable input interaction with the `isDisabled` prop:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <NumberInput placeholder=\"Enabled input\" />\n <NumberInput placeholder=\"Disabled input\" isDisabled />\n <NumberInput\n value={42}\n isDisabled\n onChange={() => {}}\n />\n </Stack>\n)\n```\n\n**Behavioral notes:**\n- Increment and decrement buttons are also disabled\n- Input cannot receive focus or accept keyboard input\n- Visual styling indicates disabled state\n\n### Invalid state\n\nMark inputs as invalid for validation feedback:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <NumberInput\n placeholder=\"Valid input\"\n value={50}\n onChange={() => {}}\n />\n <NumberInput\n placeholder=\"Invalid input\"\n value={150}\n isInvalid\n onChange={() => {}}\n />\n </Stack>\n)\n```\n\n### Read-only state\n\nUse `isReadOnly` to display values without allowing editing:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <NumberInput\n value={42}\n onChange={() => {}}\n />\n <NumberInput\n value={42}\n isReadOnly\n onChange={() => {}}\n />\n </Stack>\n)\n```\n\n**Behavioral notes:**\n- Users can select and copy text but cannot edit\n- Increment and decrement buttons are disabled in read-only mode\n- Input still receives focus for accessibility\n\n### Required field\n\nMark inputs as required using the `isRequired` prop:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <NumberInput\n placeholder=\"Optional field\"\n />\n <NumberInput\n placeholder=\"Required field\"\n isRequired\n />\n </Stack>\n)\n```\n\n### Uncontrolled mode\n\nFor simpler use cases, use uncontrolled mode with `defaultValue` and `onChange`:\n\n```jsx live-dev\nconst App = () => {\n const [displayValue, setDisplayValue] = useState<number | undefined>(undefined);\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <NumberInput\n placeholder=\"Type a number...\"\n defaultValue={0}\n onChange={(value) => {\n setDisplayValue(value);\n }}\n />\n <Text fontSize=\"sm\">\n Current value: {displayValue !== undefined ? displayValue : '(not set)'}\n </Text>\n </Stack>\n );\n}\n```\n\nUse uncontrolled mode when you need to capture the number value without managing state yourself.\n\n**Note:** NumberInput's `onChange` receives the number value directly, not an event object.\n\n### Controlled mode\n\nFor scenarios requiring programmatic control or coordination with other components, use controlled mode:\n\n```jsx live-dev\nconst App = () => {\n const [value, setValue] = useState<NumberInputProps[\"value\"]>(0);\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <NumberInput\n value={value}\n onChange={setValue}\n placeholder=\"Controlled input\"\n minValue={0}\n maxValue={100}\n />\n <Text fontSize=\"sm\">\n {value !== undefined ? `Value: ${value}` : 'No value'}\n </Text>\n <Stack direction=\"row\" gap=\"300\">\n <Button onPress={() => setValue(0)}>\n Reset to 0\n </Button>\n <Button onPress={() => setValue(50)}>\n Set to 50\n </Button>\n <Button onPress={() => setValue(100)}>\n Set to 100\n </Button>\n </Stack>\n </Stack>\n );\n}\n```\n\nUse controlled mode when you need to:\n- Synchronize the value with external state\n- Validate or transform input values\n- Clear or programmatically set the value\n- React to changes in real-time\n\n### Locale formatting\n\nNumberInput automatically formats numbers according to the user's locale when using React Aria's I18nProvider:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">US English (default):</Text>\n <NumberInput defaultValue={1234.56} placeholder=\"1,234.56\" />\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">German (de-DE):</Text>\n <NimbusI18nProvider locale=\"de-DE\">\n <NumberInput defaultValue={1234.56} placeholder=\"1.234,56\" />\n </NimbusI18nProvider>\n </Stack>\n\n <Stack direction=\"column\" gap=\"200\">\n <Text fontSize=\"sm\" color=\"neutral.11\">French (fr-FR):</Text>\n <NimbusI18nProvider locale=\"fr-FR\">\n <NumberInput defaultValue={1234.56} placeholder=\"1 234,56\" />\n </NimbusI18nProvider>\n </Stack>\n </Stack>\n)\n```\n\n**Behavioral notes:**\n- Number formatting automatically adapts to the locale\n- Thousands separators and decimal symbols change based on locale\n- Input parsing handles locale-specific formats\n- Wrap your app with `NimbusI18nProvider` to set the locale\n\n## Component requirements\n\n## Accessibility\n\nThe NumberInput handles most accessibility requirements internally. However, you must always associate an internationalized label with the component. Visual labels are preferable, and can be set by:\n\n- Using the `NumberInputField` pattern component (recommended)\n- Associating a `<label>` element with the `NumberInput` using `aria-labelledby`:\n\n```tsx\n<label id=\"quantity-label\">\n {msg.format(quantityMessage)}\n</label>\n<NumberInput aria-labelledby=\"quantity-label\" />\n```\n\n- Associating a `<label>` element with the `NumberInput` using `htmlFor`:\n\n```tsx\n<label htmlFor=\"quantity-input\">\n {msg.format(quantityMessage)}\n</label>\n<NumberInput id=\"quantity-input\" />\n```\n\nIf your design requires that the label should not be visible, the label should be set using the `aria-label` prop:\n\n```tsx\n<NumberInput aria-label={msg.format(quantityMessage)} />\n```\n\nIf your use case requires tracking and analytics for this component, it is good practice to add a **persistent**, **unique** id to the component:\n\n```tsx\nconst PERSISTENT_ID = \"product-quantity-input\";\n\nexport const QuantityField = () => (\n <NumberInput id={PERSISTENT_ID} placeholder=\"Quantity\" />\n);\n```\n\n#### Keyboard navigation\n\nThe component supports full keyboard interaction:\n- `Tab` / `Shift+Tab`: Navigate to/from the input field\n- `Arrow Up` / `Arrow Down`: Increment/decrement the value by `step` amount\n- `Page Up` / `Page Down`: Increment/decrement by larger amounts (10x step)\n- `Home`: Set to minimum value (if `minValue` is defined)\n- `End`: Set to maximum value (if `maxValue` is defined)\n- `Enter`: Submit form (if inside a form)\n- Standard text editing shortcuts: Cut, Copy, Paste, Undo, Redo\n\n**Increment/Decrement buttons:**\n- Click on increment (up arrow) or decrement (down arrow) buttons to adjust value\n- Buttons are automatically disabled when reaching `minValue` or `maxValue`\n- Buttons have localized aria-labels for screen readers\n\n#### Click-to-focus behavior\n\nClicking anywhere within the input container (including leading/trailing elements area) will focus the input field, providing a larger interactive target for better usability.\n\n## API reference\n\n<PropsTable id=\"NumberInput\" />\n\n## Common patterns\n\n### Quantity selector with constraints\n\nCreate a quantity input with minimum and maximum values:\n\n```jsx live-dev\nconst App = () => {\n const [quantity, setQuantity] = useState<number>(1);\n const totalPrice = quantity * 29.99;\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"200\">\n <Text fontWeight=\"semibold\">Select Quantity</Text>\n <NumberInput\n value={quantity}\n onChange={(value) => setQuantity(value ?? 1)}\n minValue={1}\n maxValue={10}\n step={1}\n />\n <Text fontSize=\"sm\" color=\"neutral.11\">\n Minimum: 1, Maximum: 10\n </Text>\n </Stack>\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <Text>Total:</Text>\n <Text fontWeight=\"bold\" fontSize=\"lg\">\n ${totalPrice.toFixed(2)}\n </Text>\n </Stack>\n </Stack>\n );\n}\n```\n\n### Measurement input with units\n\nCreate inputs for measurements with unit labels displayed as trailing elements:\n\n```jsx live-dev\nconst App = () => {\n const [weight, setWeight] = useState<number>(0);\n const [height, setHeight] = useState<number>(0);\n const bmi = weight && height ? (weight / Math.pow(height / 100, 2)).toFixed(1) : 0;\n\n return (\n <Stack direction=\"column\" gap=\"600\">\n <Stack direction=\"column\" gap=\"300\">\n <Text fontWeight=\"semibold\">Weight</Text>\n <NumberInput\n value={weight}\n onChange={(value) => setWeight(value ?? 0)}\n placeholder=\"0\"\n minValue={0}\n maxValue={300}\n step={0.1}\n trailingElement={<Text fontSize=\"sm\" color=\"neutral.11\">kg</Text>}\n />\n </Stack>\n\n <Stack direction=\"column\" gap=\"300\">\n <Text fontWeight=\"semibold\">Height</Text>\n <NumberInput\n value={height}\n onChange={(value) => setHeight(value ?? 0)}\n placeholder=\"0\"\n minValue={0}\n maxValue={250}\n step={1}\n trailingElement={<Text fontSize=\"sm\" color=\"neutral.11\">cm</Text>}\n />\n </Stack>\n\n {weight > 0 && height > 0 && (\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <Text>BMI:</Text>\n <Text fontWeight=\"bold\" fontSize=\"lg\">{bmi}</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 NumberInput 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 component renders with expected elements\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 { NumberInput, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"NumberInput - Basic rendering\", () => {\n it(\"renders input element\", () => {\n render(\n <NimbusProvider>\n <NumberInput aria-label=\"Quantity\" />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\", { name: /quantity/i });\n expect(input).toBeInTheDocument();\n expect(input.tagName).toBe(\"INPUT\");\n });\n\n it(\"renders with placeholder text\", () => {\n render(\n <NimbusProvider>\n <NumberInput placeholder=\"Enter quantity\" aria-label=\"Quantity\" />\n </NimbusProvider>\n );\n\n expect(screen.getByPlaceholderText(/enter quantity/i)).toBeInTheDocument();\n });\n\n it(\"renders increment and decrement buttons\", () => {\n render(\n <NimbusProvider>\n <NumberInput aria-label=\"Quantity\" />\n </NimbusProvider>\n );\n\n expect(\n screen.getByRole(\"button\", { name: /increment/i })\n ).toBeInTheDocument();\n expect(\n screen.getByRole(\"button\", { name: /decrement/i })\n ).toBeInTheDocument();\n });\n});\n```\n\n### Interaction Tests\n\nTest user interactions with the number input\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 { NumberInput, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"NumberInput - Interactions\", () => {\n it(\"handles typing numeric values\", async () => {\n const user = userEvent.setup();\n render(\n <NimbusProvider>\n <NumberInput aria-label=\"Quantity\" />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n await user.type(input, \"42\");\n\n expect(input).toHaveValue(\"42\");\n });\n\n it(\"calls onChange with numeric value\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n render(\n <NimbusProvider>\n <NumberInput onChange={handleChange} aria-label=\"Quantity\" />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n await user.clear(input);\n await user.type(input, \"10\");\n // Blur the input to trigger onChange\n await user.tab();\n\n // NumberInput calls onChange with the numeric value after blur\n expect(handleChange).toHaveBeenCalled();\n expect(handleChange).toHaveBeenCalledWith(10);\n });\n\n /**\n * Note: React Aria's stepper buttons use pointer events that JSDOM doesn't\n * fully support. These tests use keyboard-based interactions (ArrowUp/ArrowDown)\n * which test the same onChange behavior through a different, equally valid\n * user interaction pattern. Storybook play functions should test actual\n * button clicks in a real browser environment.\n */\n it(\"handles increment via keyboard\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n render(\n <NimbusProvider>\n <NumberInput\n defaultValue={5}\n onChange={handleChange}\n aria-label=\"Quantity\"\n />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n await user.click(input);\n await user.keyboard(\"{ArrowUp}\");\n\n expect(handleChange).toHaveBeenCalledWith(6);\n });\n\n it(\"handles decrement via keyboard\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n render(\n <NimbusProvider>\n <NumberInput\n defaultValue={5}\n onChange={handleChange}\n aria-label=\"Quantity\"\n />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n await user.click(input);\n await user.keyboard(\"{ArrowDown}\");\n\n expect(handleChange).toHaveBeenCalledWith(4);\n });\n});\n```\n\n### Testing Constraints\n\nVerify minimum, maximum, and step constraints\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 { NumberInput, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"NumberInput - Constraints\", () => {\n it(\"respects minimum value\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n render(\n <NimbusProvider>\n <NumberInput\n defaultValue={2}\n minValue={1}\n onChange={handleChange}\n aria-label=\"Quantity\"\n />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n await user.click(input);\n\n // Decrement once: 2 -> 1 (at minimum)\n await user.keyboard(\"{ArrowDown}\");\n expect(handleChange).toHaveBeenCalledWith(1);\n\n // Try again - should stay at minimum\n await user.keyboard(\"{ArrowDown}\");\n // Component still calls onChange but with the same minimum value\n expect(handleChange).toHaveBeenLastCalledWith(1);\n });\n\n it(\"respects maximum value\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n render(\n <NimbusProvider>\n <NumberInput\n defaultValue={9}\n maxValue={10}\n onChange={handleChange}\n aria-label=\"Quantity\"\n />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n await user.click(input);\n\n // Increment once: 9 -> 10 (at maximum)\n await user.keyboard(\"{ArrowUp}\");\n expect(handleChange).toHaveBeenCalledWith(10);\n\n // Try again - should stay at maximum\n await user.keyboard(\"{ArrowUp}\");\n // Component still calls onChange but with the same maximum value\n expect(handleChange).toHaveBeenLastCalledWith(10);\n });\n\n it(\"increments by step amount\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n render(\n <NimbusProvider>\n <NumberInput\n defaultValue={0}\n step={5}\n onChange={handleChange}\n aria-label=\"Quantity\"\n />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n await user.click(input);\n await user.keyboard(\"{ArrowUp}\");\n\n expect(handleChange).toHaveBeenCalledWith(5);\n });\n});\n```\n\n### Testing Validation States\n\nVerify different component states render correctly\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 { NumberInput, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"NumberInput - Validation states\", () => {\n it(\"handles disabled state\", async () => {\n const user = userEvent.setup();\n render(\n <NimbusProvider>\n <NumberInput isDisabled aria-label=\"Quantity\" />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n const incrementButton = screen.getByRole(\"button\", { name: /increment/i });\n\n expect(input).toBeDisabled();\n expect(incrementButton).toBeDisabled();\n\n // Verify cannot type when disabled\n await user.type(input, \"42\");\n expect(input).toHaveValue(\"\");\n });\n\n it(\"handles invalid state\", () => {\n render(\n <NimbusProvider>\n <NumberInput isInvalid aria-label=\"Quantity\" />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n expect(input).toHaveAttribute(\"data-invalid\", \"true\");\n });\n\n it(\"handles required state\", () => {\n render(\n <NimbusProvider>\n <NumberInput isRequired aria-label=\"Quantity\" />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n expect(input).toHaveAttribute(\"aria-required\", \"true\");\n });\n\n it(\"handles read-only state\", () => {\n render(\n <NimbusProvider>\n <NumberInput\n isReadOnly\n value={42}\n onChange={() => {}}\n aria-label=\"Quantity\"\n />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n const incrementButton = screen.getByRole(\"button\", { name: /increment/i });\n\n expect(input).toHaveAttribute(\"readonly\");\n expect(incrementButton).toBeDisabled();\n });\n});\n```\n\n### Testing Decimal Precision\n\nTest precision handling for decimal numbers\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 { NumberInput, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"NumberInput - Decimal precision\", () => {\n it(\"handles decimal step increments\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n render(\n <NimbusProvider>\n <NumberInput\n defaultValue={0}\n step={0.1}\n onChange={handleChange}\n aria-label=\"Price\"\n />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n await user.click(input);\n await user.keyboard(\"{ArrowUp}\");\n\n expect(handleChange).toHaveBeenCalledWith(0.1);\n });\n\n it(\"accepts decimal input\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n render(\n <NimbusProvider>\n <NumberInput step={0.01} onChange={handleChange} aria-label=\"Price\" />\n </NimbusProvider>\n );\n\n const input = screen.getByRole(\"textbox\");\n await user.clear(input);\n await user.type(input, \"12.34\");\n // Blur the input to trigger onChange\n await user.tab();\n\n // NumberInput calls onChange with the numeric value after blur\n expect(handleChange).toHaveBeenCalled();\n expect(handleChange).toHaveBeenCalledWith(12.34);\n });\n});\n```\n\n\n## Resources\n\n- [Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-numberinput--docs)\n- [React Aria NumberField](https://react-spectrum.adobe.com/react-aria/NumberField.html)\n",
249
+ "toc": [
250
+ {
251
+ "value": "Getting started",
252
+ "href": "#getting-started",
253
+ "depth": 2,
254
+ "numbering": [
255
+ 1,
256
+ 1
257
+ ],
258
+ "parent": "root"
259
+ },
260
+ {
261
+ "value": "Import",
262
+ "href": "#import",
263
+ "depth": 3,
264
+ "numbering": [
265
+ 1,
266
+ 1,
267
+ 1
268
+ ],
269
+ "parent": "root"
270
+ },
271
+ {
272
+ "value": "Basic usage",
273
+ "href": "#basic-usage",
274
+ "depth": 3,
275
+ "numbering": [
276
+ 1,
277
+ 1,
278
+ 2
279
+ ],
280
+ "parent": "root"
281
+ },
282
+ {
283
+ "value": "Usage examples",
284
+ "href": "#usage-examples",
285
+ "depth": 2,
286
+ "numbering": [
287
+ 1,
288
+ 2
289
+ ],
290
+ "parent": "root"
291
+ },
292
+ {
293
+ "value": "Size options",
294
+ "href": "#size-options",
295
+ "depth": 3,
296
+ "numbering": [
297
+ 1,
298
+ 2,
299
+ 1
300
+ ],
301
+ "parent": "root"
302
+ },
303
+ {
304
+ "value": "Visual variants",
305
+ "href": "#visual-variants",
306
+ "depth": 3,
307
+ "numbering": [
308
+ 1,
309
+ 2,
310
+ 2
311
+ ],
312
+ "parent": "root"
313
+ },
314
+ {
315
+ "value": "Leading and trailing elements",
316
+ "href": "#leading-and-trailing-elements",
317
+ "depth": 3,
318
+ "numbering": [
319
+ 1,
320
+ 2,
321
+ 3
322
+ ],
323
+ "parent": "root"
324
+ },
325
+ {
326
+ "value": "Number constraints",
327
+ "href": "#number-constraints",
328
+ "depth": 3,
329
+ "numbering": [
330
+ 1,
331
+ 2,
332
+ 4
333
+ ],
334
+ "parent": "root"
335
+ },
336
+ {
337
+ "value": "Decimal numbers",
338
+ "href": "#decimal-numbers",
339
+ "depth": 3,
340
+ "numbering": [
341
+ 1,
342
+ 2,
343
+ 5
344
+ ],
345
+ "parent": "root"
346
+ },
347
+ {
348
+ "value": "Format options",
349
+ "href": "#format-options",
350
+ "depth": 3,
351
+ "numbering": [
352
+ 1,
353
+ 2,
354
+ 6
355
+ ],
356
+ "parent": "root"
357
+ },
358
+ {
359
+ "value": "Disabled state",
360
+ "href": "#disabled-state",
361
+ "depth": 3,
362
+ "numbering": [
363
+ 1,
364
+ 2,
365
+ 7
366
+ ],
367
+ "parent": "root"
368
+ },
369
+ {
370
+ "value": "Invalid state",
371
+ "href": "#invalid-state",
372
+ "depth": 3,
373
+ "numbering": [
374
+ 1,
375
+ 2,
376
+ 8
377
+ ],
378
+ "parent": "root"
379
+ },
380
+ {
381
+ "value": "Read-only state",
382
+ "href": "#read-only-state",
383
+ "depth": 3,
384
+ "numbering": [
385
+ 1,
386
+ 2,
387
+ 9
388
+ ],
389
+ "parent": "root"
390
+ },
391
+ {
392
+ "value": "Required field",
393
+ "href": "#required-field",
394
+ "depth": 3,
395
+ "numbering": [
396
+ 1,
397
+ 2,
398
+ 10
399
+ ],
400
+ "parent": "root"
401
+ },
402
+ {
403
+ "value": "Uncontrolled mode",
404
+ "href": "#uncontrolled-mode",
405
+ "depth": 3,
406
+ "numbering": [
407
+ 1,
408
+ 2,
409
+ 11
410
+ ],
411
+ "parent": "root"
412
+ },
413
+ {
414
+ "value": "Controlled mode",
415
+ "href": "#controlled-mode",
416
+ "depth": 3,
417
+ "numbering": [
418
+ 1,
419
+ 2,
420
+ 12
421
+ ],
422
+ "parent": "root"
423
+ },
424
+ {
425
+ "value": "Locale formatting",
426
+ "href": "#locale-formatting",
427
+ "depth": 3,
428
+ "numbering": [
429
+ 1,
430
+ 2,
431
+ 13
432
+ ],
433
+ "parent": "root"
434
+ },
435
+ {
436
+ "value": "Component requirements",
437
+ "href": "#component-requirements",
438
+ "depth": 2,
439
+ "numbering": [
440
+ 1,
441
+ 3
442
+ ],
443
+ "parent": "root"
444
+ },
445
+ {
446
+ "value": "Accessibility",
447
+ "href": "#accessibility",
448
+ "depth": 2,
449
+ "numbering": [
450
+ 1,
451
+ 4
452
+ ],
453
+ "parent": "root"
454
+ },
455
+ {
456
+ "value": "Keyboard navigation",
457
+ "href": "#keyboard-navigation",
458
+ "depth": 4,
459
+ "numbering": [
460
+ 1,
461
+ 4,
462
+ 1,
463
+ 1
464
+ ],
465
+ "parent": "root"
466
+ },
467
+ {
468
+ "value": "Click-to-focus behavior",
469
+ "href": "#click-to-focus-behavior",
470
+ "depth": 4,
471
+ "numbering": [
472
+ 1,
473
+ 4,
474
+ 1,
475
+ 2
476
+ ],
477
+ "parent": "root"
478
+ },
479
+ {
480
+ "value": "API reference",
481
+ "href": "#api-reference",
482
+ "depth": 2,
483
+ "numbering": [
484
+ 1,
485
+ 5
486
+ ],
487
+ "parent": "root"
488
+ },
489
+ {
490
+ "value": "Common patterns",
491
+ "href": "#common-patterns",
492
+ "depth": 2,
493
+ "numbering": [
494
+ 1,
495
+ 6
496
+ ],
497
+ "parent": "root"
498
+ },
499
+ {
500
+ "value": "Quantity selector with constraints",
501
+ "href": "#quantity-selector-with-constraints",
502
+ "depth": 3,
503
+ "numbering": [
504
+ 1,
505
+ 6,
506
+ 1
507
+ ],
508
+ "parent": "root"
509
+ },
510
+ {
511
+ "value": "Measurement input with units",
512
+ "href": "#measurement-input-with-units",
513
+ "depth": 3,
514
+ "numbering": [
515
+ 1,
516
+ 6,
517
+ 2
518
+ ],
519
+ "parent": "root"
520
+ },
521
+ {
522
+ "value": "Testing your implementation",
523
+ "href": "#testing-your-implementation",
524
+ "depth": 2,
525
+ "numbering": [
526
+ 1,
527
+ 7
528
+ ],
529
+ "parent": "root"
530
+ },
531
+ {
532
+ "value": "Basic Rendering Tests",
533
+ "href": "#basic-rendering-tests",
534
+ "depth": 3,
535
+ "numbering": [
536
+ 1,
537
+ 7,
538
+ 1
539
+ ],
540
+ "parent": "root"
541
+ },
542
+ {
543
+ "value": "Interaction Tests",
544
+ "href": "#interaction-tests",
545
+ "depth": 3,
546
+ "numbering": [
547
+ 1,
548
+ 7,
549
+ 2
550
+ ],
551
+ "parent": "root"
552
+ },
553
+ {
554
+ "value": "Testing Constraints",
555
+ "href": "#testing-constraints",
556
+ "depth": 3,
557
+ "numbering": [
558
+ 1,
559
+ 7,
560
+ 3
561
+ ],
562
+ "parent": "root"
563
+ },
564
+ {
565
+ "value": "Testing Validation States",
566
+ "href": "#testing-validation-states",
567
+ "depth": 3,
568
+ "numbering": [
569
+ 1,
570
+ 7,
571
+ 4
572
+ ],
573
+ "parent": "root"
574
+ },
575
+ {
576
+ "value": "Testing Decimal Precision",
577
+ "href": "#testing-decimal-precision",
578
+ "depth": 3,
579
+ "numbering": [
580
+ 1,
581
+ 7,
582
+ 5
583
+ ],
584
+ "parent": "root"
585
+ },
586
+ {
587
+ "value": "Resources",
588
+ "href": "#resources",
589
+ "depth": 2,
590
+ "numbering": [
591
+ 1,
592
+ 8
593
+ ],
594
+ "parent": "root"
595
+ }
596
+ ]
597
+ },
598
+ "guidelines": {
599
+ "mdx": "\n## Guidelines\n\nNumber input guidelines focus on clear labels, suitable ranges, easy interaction\nvia keyboard and buttons, and strong error handling, all while following WCAG\naccessibility rules.\n\n### Best practices\n\n- **Labels:** Always include a concise and clear label using sentence case.\n Labels should not be hidden. In the rare case where context is sufficient and\n label can be absent, review the design with an accessibility expert.\n- **Default values:** Provide a clear default value (e.g., '1' for quantity, '0'\n for children) that is likely to be the most common selection. Avoid leaving\n the input blank.\n- **Helper text:** Use helper text to indicate maximum or minimum values, or\n other constraints. It is optional and is replaced by error messages during\n validation.\n- **Increment size:** Determine an increment size that is relative to the value\n range. For example, use increments of 1 for a 0-10 range and increments of 10\n for a 0-100 range.\n- **Unit symbols:** Include unit symbols to the right of the input field or\n increase button when applicable, using standard abbreviations.\n- **Read-only state:** Use when the user can view but not modify the value.\n- **Disabled state:** Use when the number input is not interactive.\n- **Validation:**\n - Provide clear and concise error messages below the input field, replacing\n any helper text.\n - Highlight errors visually, for example, with a red border and an error icon.\n - Avoid immediate validation that may frustrate users; allow them to complete\n their input before displaying validation results.\n\n### Usage\n\nA number input lets users enter and adjust a numeric value with stepper buttons,\nbest for small, incremental changes within set limits.\n\n> [!TIP]\\\n> When to use\n\n- **Numeric values:** When the input is exclusively a number (e.g., quantity,\n age).\n- **Small, incremental adjustments:** When users need to change values by a few\n clicks, or relative to the current state, without knowing exact figures.\n- **Bypassing keyboard limitations:** Particularly useful for mobile devices\n where direct numerical input might be cumbersome.\n\n> [!CAUTION]\\\n> When not to use\n\n- **Large value changes:** When a wide range of values requires many clicks\n (e.g., 1 to 300); a slider is more appropriate.\n- **Continuous variables:** For values like prices or distances where exact,\n precise input within a wide range is crucial; a text input is better.\n- **Infinite numeric ranges:** Without defined limits, users are unsure of\n \"reasonable\" values, causing frustration. Storing infinite values on the\n backend is often unfeasible; applications need concrete data.\n- **Non-mathematical numbers:** Values like credit card numbers, phone numbers,\n or postal codes, which are strings despite containing digits.\n\n### Keeping interactions simple\n\nSimple interactions are vital because they minimize user effort and cognitive\nload, allowing for quick and efficient value management.\n\n> [!TIP]\\\n> **Do**\n>\n> - Use for quantifiable numeric values.\n> - Provide clear and concise labels.\n> - Set appropriate min and max values.\n> - Define a logical step value.\n> - Include units (e.g., \"$\", \"kg\", \"%\") as prefixes or suffixes.\n> - Allow keyboard interaction for incrementing and decrementing.\n> - Provide helpful error messages for invalid input.\n> - Design for clear visual feedback in all states (hover, focus, disabled,\n> invalid).\n\n```jsx live\nconst App = () => (\n <Grid templateColumns=\"auto 1fr\" gap=\"400\">\n <Image\n width=\"4000\"\n src=\"/images/number-input/pencil-sample.png\"\n alt=\"Number 2 pencils\"\n />\n <Stack gap=\"200\" alignItems=\"start\">\n <Text fontWeight=\"700\">#2 Pencils</Text>\n <FormField.Root>\n <FormField.Label>Quantity</FormField.Label>\n <FormField.Input>\n <NumberInput defaultValue={12} width=\"2400\" />\n </FormField.Input>\n </FormField.Root>\n <Button variant=\"solid\" colorPalette=\"primary\">\n Add to cart\n </Button>\n </Stack>\n </Grid>\n);\n```\n\n> [!CAUTION]\\\n> **Don't**\n>\n> - Use for non-numeric input (e.g., phone numbers that are better suited for\n> text fields to allow for formatting).\n> - Omit clear labels or help text.\n> - Forget to set min and max values when there are constraints.\n> - Use excessively small or large step values that hinder usability.\n> - Rely solely on visual cues for accessibility; use ARIA attributes.\n> - Present a number input without clear feedback for different states.\n\n```jsx live\nconst App = () => (\n <FormField.Root>\n <FormField.Label>Birthdate</FormField.Label>\n <FormField.Input>\n <NumberInput placeholder=\"01/01/1990\" />\n </FormField.Input>\n </FormField.Root>\n);\n```\n",
600
+ "toc": [
601
+ {
602
+ "value": "Guidelines",
603
+ "href": "#guidelines",
604
+ "depth": 2,
605
+ "numbering": [
606
+ 1,
607
+ 1
608
+ ],
609
+ "parent": "root"
610
+ },
611
+ {
612
+ "value": "Best practices",
613
+ "href": "#best-practices",
614
+ "depth": 3,
615
+ "numbering": [
616
+ 1,
617
+ 1,
618
+ 1
619
+ ],
620
+ "parent": "root"
621
+ },
622
+ {
623
+ "value": "Usage",
624
+ "href": "#usage",
625
+ "depth": 3,
626
+ "numbering": [
627
+ 1,
628
+ 1,
629
+ 2
630
+ ],
631
+ "parent": "root"
632
+ },
633
+ {
634
+ "value": "Keeping interactions simple",
635
+ "href": "#keeping-interactions-simple",
636
+ "depth": 3,
637
+ "numbering": [
638
+ 1,
639
+ 1,
640
+ 3
641
+ ],
642
+ "parent": "root"
643
+ }
644
+ ]
645
+ }
646
+ }
647
+ }