@primecoderin/fast-ui-react 0.0.0-stage → 1.0.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 (354) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/LICENSE +21 -0
  3. package/README.md +180 -3
  4. package/dist/_virtual/_rolldown/runtime.js +12 -0
  5. package/dist/charts.d.ts +7 -0
  6. package/dist/charts.js +7 -0
  7. package/dist/components/Avatar/Avatar.d.ts +12 -0
  8. package/dist/components/Avatar/Avatar.js +92 -0
  9. package/dist/components/Button/Button.d.ts +44 -0
  10. package/dist/components/Button/Button.js +221 -0
  11. package/dist/components/Checkbox/CheckboxBox.d.ts +33 -0
  12. package/dist/components/Checkbox/CheckboxBox.js +148 -0
  13. package/dist/components/CodeSnippet/CodeSnippet.d.ts +26 -0
  14. package/dist/components/CodeSnippet/CodeSnippet.js +153 -0
  15. package/dist/components/Collapsible/Collapsible.d.ts +20 -0
  16. package/dist/components/Collapsible/Collapsible.js +97 -0
  17. package/dist/components/Container/Container.d.ts +301 -0
  18. package/dist/components/Container/Container.js +20 -0
  19. package/dist/components/FloatingActionButton/FloatingActionButton.d.ts +22 -0
  20. package/dist/components/FloatingActionButton/FloatingActionButton.js +141 -0
  21. package/dist/components/Grid/Grid.d.ts +311 -0
  22. package/dist/components/Grid/Grid.js +30 -0
  23. package/dist/components/IconTile/IconTile.d.ts +12 -0
  24. package/dist/components/IconTile/IconTile.js +70 -0
  25. package/dist/components/InlineError/InlineError.d.ts +9 -0
  26. package/dist/components/InlineError/InlineError.js +62 -0
  27. package/dist/components/Kbd/Kbd.d.ts +11 -0
  28. package/dist/components/Kbd/Kbd.js +31 -0
  29. package/dist/components/Link/Link.d.ts +18 -0
  30. package/dist/components/Link/Link.js +68 -0
  31. package/dist/components/Menu/ContextMenu.d.ts +18 -0
  32. package/dist/components/Menu/ContextMenu.js +68 -0
  33. package/dist/components/Menu/Menu.d.ts +86 -0
  34. package/dist/components/Menu/Menu.js +394 -0
  35. package/dist/components/OtpInput/OtpInput.d.ts +32 -0
  36. package/dist/components/OtpInput/OtpInput.js +177 -0
  37. package/dist/components/Popover/HoverPopover.d.ts +22 -0
  38. package/dist/components/Popover/HoverPopover.js +74 -0
  39. package/dist/components/Popover/Popover.d.ts +21 -0
  40. package/dist/components/Popover/Popover.js +64 -0
  41. package/dist/components/ProgressBar/ProgressBar.d.ts +17 -0
  42. package/dist/components/ProgressBar/ProgressBar.js +44 -0
  43. package/dist/components/Rating/Rating.d.ts +49 -0
  44. package/dist/components/Rating/Rating.js +241 -0
  45. package/dist/components/ScrollArea/ScrollArea.d.ts +23 -0
  46. package/dist/components/ScrollArea/ScrollArea.js +90 -0
  47. package/dist/components/SegmentedControl/SegmentedControl.d.ts +29 -0
  48. package/dist/components/SegmentedControl/SegmentedControl.js +99 -0
  49. package/dist/components/Separator/Separator.d.ts +9 -0
  50. package/dist/components/Separator/Separator.js +34 -0
  51. package/dist/components/Skeleton/Skeleton.d.ts +31 -0
  52. package/dist/components/Skeleton/Skeleton.js +152 -0
  53. package/dist/components/Slider/Slider.d.ts +54 -0
  54. package/dist/components/Slider/Slider.js +178 -0
  55. package/dist/components/Spinner/Spinner.d.ts +17 -0
  56. package/dist/components/Spinner/Spinner.js +118 -0
  57. package/dist/components/Stack/Stack.d.ts +302 -0
  58. package/dist/components/Stack/Stack.js +14 -0
  59. package/dist/components/StateIcon/StateIcon.d.ts +11 -0
  60. package/dist/components/StateIcon/StateIcon.js +65 -0
  61. package/dist/components/StatusBadge/StatusBadge.d.ts +19 -0
  62. package/dist/components/StatusBadge/StatusBadge.js +82 -0
  63. package/dist/components/Tabs/Tabs.d.ts +28 -0
  64. package/dist/components/Tabs/Tabs.js +109 -0
  65. package/dist/components/Tag/Tag.d.ts +11 -0
  66. package/dist/components/Tag/Tag.js +66 -0
  67. package/dist/components/Toast/AppToaster.d.ts +8 -0
  68. package/dist/components/Toast/AppToaster.js +135 -0
  69. package/dist/components/Toast/toast-manager.d.ts +28 -0
  70. package/dist/components/Toast/toast-manager.js +47 -0
  71. package/dist/components/ToggleButton/ToggleButton.d.ts +26 -0
  72. package/dist/components/ToggleButton/ToggleButton.js +106 -0
  73. package/dist/components/ToggleGroup/ToggleGroup.d.ts +32 -0
  74. package/dist/components/ToggleGroup/ToggleGroup.js +79 -0
  75. package/dist/components/Tooltip/Tooltip.d.ts +16 -0
  76. package/dist/components/Tooltip/Tooltip.js +58 -0
  77. package/dist/components/Tooltip/TooltipGroup.d.ts +22 -0
  78. package/dist/components/Tooltip/TooltipGroup.js +65 -0
  79. package/dist/components/Typography/Typography.d.ts +17 -0
  80. package/dist/components/Typography/Typography.js +100 -0
  81. package/dist/editor-forms.d.ts +1 -0
  82. package/dist/editor-forms.js +1 -0
  83. package/dist/editor.d.ts +1 -0
  84. package/dist/editor.js +1 -0
  85. package/dist/fonts/LICENSE +93 -0
  86. package/dist/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
  87. package/dist/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
  88. package/dist/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
  89. package/dist/fonts/inter-greek-wght-normal.woff2 +0 -0
  90. package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  91. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  92. package/dist/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
  93. package/dist/fonts.css +69 -0
  94. package/dist/forms.d.ts +22 -0
  95. package/dist/forms.js +23 -0
  96. package/dist/foundation.css +23 -0
  97. package/dist/global.css +116 -0
  98. package/dist/hooks/useAppToast.d.ts +12 -0
  99. package/dist/hooks/useAppToast.js +29 -0
  100. package/dist/icons/icons.d.ts +43 -0
  101. package/dist/icons/icons.js +44 -0
  102. package/dist/index.d.ts +106 -0
  103. package/dist/index.js +101 -0
  104. package/dist/patterns/Accordion/Accordion.d.ts +35 -0
  105. package/dist/patterns/Accordion/Accordion.js +139 -0
  106. package/dist/patterns/Alert/Alert.d.ts +38 -0
  107. package/dist/patterns/Alert/Alert.js +151 -0
  108. package/dist/patterns/AppShell/AppShell.d.ts +39 -0
  109. package/dist/patterns/AppShell/AppShell.js +218 -0
  110. package/dist/patterns/Breadcrumbs/Breadcrumbs.d.ts +21 -0
  111. package/dist/patterns/Breadcrumbs/Breadcrumbs.js +73 -0
  112. package/dist/patterns/Calendar/Calendar.d.ts +59 -0
  113. package/dist/patterns/Calendar/Calendar.js +283 -0
  114. package/dist/patterns/Calendar/DateRangePicker.d.ts +53 -0
  115. package/dist/patterns/Calendar/DateRangePicker.js +266 -0
  116. package/dist/patterns/Calendar/FormDateRangeField.d.ts +24 -0
  117. package/dist/patterns/Calendar/FormDateRangeField.js +138 -0
  118. package/dist/patterns/Card/Card.d.ts +26 -0
  119. package/dist/patterns/Card/Card.js +125 -0
  120. package/dist/patterns/Carousel/Carousel.d.ts +33 -0
  121. package/dist/patterns/Carousel/Carousel.js +127 -0
  122. package/dist/patterns/Cascader/Cascader.d.ts +53 -0
  123. package/dist/patterns/Cascader/Cascader.js +371 -0
  124. package/dist/patterns/Cascader/FormCascaderField.d.ts +21 -0
  125. package/dist/patterns/Cascader/FormCascaderField.js +130 -0
  126. package/dist/patterns/Charts/AreaChart.d.ts +13 -0
  127. package/dist/patterns/Charts/AreaChart.js +220 -0
  128. package/dist/patterns/Charts/BarChart.d.ts +11 -0
  129. package/dist/patterns/Charts/BarChart.js +220 -0
  130. package/dist/patterns/Charts/DonutChart.d.ts +37 -0
  131. package/dist/patterns/Charts/DonutChart.js +215 -0
  132. package/dist/patterns/Charts/GaugeChart.d.ts +44 -0
  133. package/dist/patterns/Charts/GaugeChart.js +210 -0
  134. package/dist/patterns/Charts/LineChart.d.ts +14 -0
  135. package/dist/patterns/Charts/LineChart.js +222 -0
  136. package/dist/patterns/Charts/Sparkline.d.ts +24 -0
  137. package/dist/patterns/Charts/Sparkline.js +81 -0
  138. package/dist/patterns/Charts/chart-parts.d.ts +139 -0
  139. package/dist/patterns/Charts/chart-parts.js +385 -0
  140. package/dist/patterns/Charts/gauge-math.d.ts +20 -0
  141. package/dist/patterns/Charts/gauge-math.js +21 -0
  142. package/dist/patterns/Charts/sparkline-path.d.ts +11 -0
  143. package/dist/patterns/Charts/sparkline-path.js +24 -0
  144. package/dist/patterns/ColorPicker/ColorPicker.d.ts +50 -0
  145. package/dist/patterns/ColorPicker/ColorPicker.js +590 -0
  146. package/dist/patterns/ColorPicker/FormColorField.d.ts +21 -0
  147. package/dist/patterns/ColorPicker/FormColorField.js +130 -0
  148. package/dist/patterns/ColorPicker/color-value.d.ts +19 -0
  149. package/dist/patterns/ColorPicker/color-value.js +72 -0
  150. package/dist/patterns/Combobox/Autocomplete.d.ts +48 -0
  151. package/dist/patterns/Combobox/Autocomplete.js +158 -0
  152. package/dist/patterns/Combobox/Combobox.d.ts +52 -0
  153. package/dist/patterns/Combobox/Combobox.js +195 -0
  154. package/dist/patterns/Combobox/ComboboxPopup.d.ts +24 -0
  155. package/dist/patterns/Combobox/ComboboxPopup.js +107 -0
  156. package/dist/patterns/Combobox/FormAutocompleteField.d.ts +17 -0
  157. package/dist/patterns/Combobox/FormAutocompleteField.js +119 -0
  158. package/dist/patterns/Combobox/FormComboboxField.d.ts +18 -0
  159. package/dist/patterns/Combobox/FormComboboxField.js +119 -0
  160. package/dist/patterns/Combobox/FormMultiSelectField.d.ts +18 -0
  161. package/dist/patterns/Combobox/FormMultiSelectField.js +119 -0
  162. package/dist/patterns/Combobox/MultiSelect.d.ts +54 -0
  163. package/dist/patterns/Combobox/MultiSelect.js +175 -0
  164. package/dist/patterns/CommandPalette/CommandPalette.d.ts +50 -0
  165. package/dist/patterns/CommandPalette/CommandPalette.js +193 -0
  166. package/dist/patterns/DataTable/DataTable.d.ts +107 -0
  167. package/dist/patterns/DataTable/DataTable.js +364 -0
  168. package/dist/patterns/DateTimePicker/DateTimePanel.d.ts +28 -0
  169. package/dist/patterns/DateTimePicker/DateTimePanel.js +444 -0
  170. package/dist/patterns/DateTimePicker/DateTimePicker.d.ts +75 -0
  171. package/dist/patterns/DateTimePicker/DateTimePicker.js +271 -0
  172. package/dist/patterns/DateTimePicker/FormDateTimeField.d.ts +32 -0
  173. package/dist/patterns/DateTimePicker/FormDateTimeField.js +148 -0
  174. package/dist/patterns/DateTimePicker/TimeSliders.d.ts +14 -0
  175. package/dist/patterns/DateTimePicker/TimeSliders.js +206 -0
  176. package/dist/patterns/DateTimePicker/picker-labels.d.ts +30 -0
  177. package/dist/patterns/DateTimePicker/picker-labels.js +23 -0
  178. package/dist/patterns/DateTimePicker/picker-values.d.ts +98 -0
  179. package/dist/patterns/DateTimePicker/picker-values.js +194 -0
  180. package/dist/patterns/DescriptionList/DescriptionList.d.ts +20 -0
  181. package/dist/patterns/DescriptionList/DescriptionList.js +57 -0
  182. package/dist/patterns/Dialog/Dialog.d.ts +26 -0
  183. package/dist/patterns/Dialog/Dialog.js +212 -0
  184. package/dist/patterns/Drawer/Drawer.d.ts +33 -0
  185. package/dist/patterns/Drawer/Drawer.js +153 -0
  186. package/dist/patterns/EmptyState/EmptyState.d.ts +35 -0
  187. package/dist/patterns/EmptyState/EmptyState.js +44 -0
  188. package/dist/patterns/FileUpload/FileUpload.d.ts +87 -0
  189. package/dist/patterns/FileUpload/FileUpload.js +417 -0
  190. package/dist/patterns/FileUpload/FormFileUploadField.d.ts +19 -0
  191. package/dist/patterns/FileUpload/FormFileUploadField.js +117 -0
  192. package/dist/patterns/FileUpload/add-files.d.ts +26 -0
  193. package/dist/patterns/FileUpload/add-files.js +35 -0
  194. package/dist/patterns/FileUpload/file-size.d.ts +14 -0
  195. package/dist/patterns/FileUpload/file-size.js +44 -0
  196. package/dist/patterns/FormField/CheckboxField.d.ts +26 -0
  197. package/dist/patterns/FormField/CheckboxField.js +97 -0
  198. package/dist/patterns/FormField/FieldFrame.d.ts +85 -0
  199. package/dist/patterns/FormField/FieldFrame.js +257 -0
  200. package/dist/patterns/FormField/FormCheckboxField.d.ts +17 -0
  201. package/dist/patterns/FormField/FormCheckboxField.js +92 -0
  202. package/dist/patterns/FormField/FormRadioGroupField.d.ts +16 -0
  203. package/dist/patterns/FormField/FormRadioGroupField.js +97 -0
  204. package/dist/patterns/FormField/FormRatingField.d.ts +19 -0
  205. package/dist/patterns/FormField/FormRatingField.js +119 -0
  206. package/dist/patterns/FormField/FormSelectField.d.ts +16 -0
  207. package/dist/patterns/FormField/FormSelectField.js +91 -0
  208. package/dist/patterns/FormField/FormSliderField.d.ts +22 -0
  209. package/dist/patterns/FormField/FormSliderField.js +128 -0
  210. package/dist/patterns/FormField/FormSwitchField.d.ts +19 -0
  211. package/dist/patterns/FormField/FormSwitchField.js +88 -0
  212. package/dist/patterns/FormField/FormTextAreaField.d.ts +12 -0
  213. package/dist/patterns/FormField/FormTextAreaField.js +91 -0
  214. package/dist/patterns/FormField/FormTextField.d.ts +23 -0
  215. package/dist/patterns/FormField/FormTextField.js +103 -0
  216. package/dist/patterns/FormField/RadioGroupField.d.ts +38 -0
  217. package/dist/patterns/FormField/RadioGroupField.js +201 -0
  218. package/dist/patterns/FormField/SelectField.d.ts +43 -0
  219. package/dist/patterns/FormField/SelectField.js +211 -0
  220. package/dist/patterns/FormField/SwitchField.d.ts +27 -0
  221. package/dist/patterns/FormField/SwitchField.js +105 -0
  222. package/dist/patterns/FormField/TextAreaField.d.ts +37 -0
  223. package/dist/patterns/FormField/TextAreaField.js +134 -0
  224. package/dist/patterns/FormField/TextField.d.ts +51 -0
  225. package/dist/patterns/FormField/TextField.js +256 -0
  226. package/dist/patterns/FormField/error-message.d.ts +6 -0
  227. package/dist/patterns/FormField/error-message.js +8 -0
  228. package/dist/patterns/FormField/field-styles.d.ts +44 -0
  229. package/dist/patterns/FormField/field-styles.js +89 -0
  230. package/dist/patterns/FormField/field-types.d.ts +4 -0
  231. package/dist/patterns/FormField/use-field-ids.d.ts +18 -0
  232. package/dist/patterns/FormField/use-field-ids.js +53 -0
  233. package/dist/patterns/List/List.d.ts +38 -0
  234. package/dist/patterns/List/List.js +174 -0
  235. package/dist/patterns/MentionsInput/FormMentionsField.d.ts +18 -0
  236. package/dist/patterns/MentionsInput/FormMentionsField.js +124 -0
  237. package/dist/patterns/MentionsInput/MentionsInput.d.ts +57 -0
  238. package/dist/patterns/MentionsInput/MentionsInput.js +133 -0
  239. package/dist/patterns/MentionsInput/mention-text.d.ts +24 -0
  240. package/dist/patterns/MentionsInput/mention-text.js +31 -0
  241. package/dist/patterns/Menubar/Menubar.d.ts +22 -0
  242. package/dist/patterns/Menubar/Menubar.js +79 -0
  243. package/dist/patterns/NavigationMenu/NavigationMenu.d.ts +27 -0
  244. package/dist/patterns/NavigationMenu/NavigationMenu.js +104 -0
  245. package/dist/patterns/NumberField/FormNumberField.d.ts +18 -0
  246. package/dist/patterns/NumberField/FormNumberField.js +119 -0
  247. package/dist/patterns/NumberField/NumberField.d.ts +57 -0
  248. package/dist/patterns/NumberField/NumberField.js +242 -0
  249. package/dist/patterns/Pagination/Pagination.d.ts +31 -0
  250. package/dist/patterns/Pagination/Pagination.js +275 -0
  251. package/dist/patterns/Pagination/page-items.d.ts +18 -0
  252. package/dist/patterns/Pagination/page-items.js +40 -0
  253. package/dist/patterns/PhoneField/FormPhoneField.d.ts +22 -0
  254. package/dist/patterns/PhoneField/FormPhoneField.js +97 -0
  255. package/dist/patterns/PhoneField/PhoneField.d.ts +60 -0
  256. package/dist/patterns/PhoneField/PhoneField.js +448 -0
  257. package/dist/patterns/PhoneField/phone-value.d.ts +26 -0
  258. package/dist/patterns/PhoneField/phone-value.js +38 -0
  259. package/dist/patterns/QRCode/QRCode.d.ts +37 -0
  260. package/dist/patterns/QRCode/QRCode.js +120 -0
  261. package/dist/patterns/QRCode/qr-path.d.ts +7 -0
  262. package/dist/patterns/QRCode/qr-path.js +25 -0
  263. package/dist/patterns/ResizablePanels/ResizablePanels.d.ts +34 -0
  264. package/dist/patterns/ResizablePanels/ResizablePanels.js +175 -0
  265. package/dist/patterns/ResizablePanels/panel-sizes.d.ts +31 -0
  266. package/dist/patterns/ResizablePanels/panel-sizes.js +54 -0
  267. package/dist/patterns/RichTextEditor/FormRichTextField.d.ts +18 -0
  268. package/dist/patterns/RichTextEditor/FormRichTextField.js +118 -0
  269. package/dist/patterns/RichTextEditor/RichTextEditor.d.ts +71 -0
  270. package/dist/patterns/RichTextEditor/RichTextEditor.js +453 -0
  271. package/dist/patterns/SearchInput/SearchInput.d.ts +26 -0
  272. package/dist/patterns/SearchInput/SearchInput.js +98 -0
  273. package/dist/patterns/SideNav/SideNav.d.ts +50 -0
  274. package/dist/patterns/SideNav/SideNav.js +269 -0
  275. package/dist/patterns/Stat/Stat.d.ts +51 -0
  276. package/dist/patterns/Stat/Stat.js +292 -0
  277. package/dist/patterns/Stepper/Stepper.d.ts +35 -0
  278. package/dist/patterns/Stepper/Stepper.js +110 -0
  279. package/dist/patterns/TagGroup/TagGroup.d.ts +44 -0
  280. package/dist/patterns/TagGroup/TagGroup.js +151 -0
  281. package/dist/patterns/TagsInput/FormTagsInputField.d.ts +18 -0
  282. package/dist/patterns/TagsInput/FormTagsInputField.js +124 -0
  283. package/dist/patterns/TagsInput/TagsInput.d.ts +51 -0
  284. package/dist/patterns/TagsInput/TagsInput.js +97 -0
  285. package/dist/patterns/Timeline/Timeline.d.ts +29 -0
  286. package/dist/patterns/Timeline/Timeline.js +85 -0
  287. package/dist/patterns/Toolbar/Toolbar.d.ts +31 -0
  288. package/dist/patterns/Toolbar/Toolbar.js +105 -0
  289. package/dist/patterns/Tour/Tour.d.ts +38 -0
  290. package/dist/patterns/Tour/Tour.js +333 -0
  291. package/dist/patterns/TransferList/FormTransferListField.d.ts +19 -0
  292. package/dist/patterns/TransferList/FormTransferListField.js +117 -0
  293. package/dist/patterns/TransferList/TransferList.d.ts +53 -0
  294. package/dist/patterns/TransferList/TransferList.js +441 -0
  295. package/dist/patterns/TreeSelect/FormTreeSelectField.d.ts +28 -0
  296. package/dist/patterns/TreeSelect/FormTreeSelectField.js +88 -0
  297. package/dist/patterns/TreeSelect/TreeSelect.d.ts +49 -0
  298. package/dist/patterns/TreeSelect/TreeSelect.js +375 -0
  299. package/dist/patterns/TreeView/TreeView.d.ts +40 -0
  300. package/dist/patterns/TreeView/TreeView.js +296 -0
  301. package/dist/provider/DesignSystemProvider.d.ts +54 -0
  302. package/dist/provider/DesignSystemProvider.js +270 -0
  303. package/dist/provider/nonce.d.ts +7 -0
  304. package/dist/provider/nonce.js +13 -0
  305. package/dist/styles.css +2 -0
  306. package/dist/theme/chart-palette.d.ts +51 -0
  307. package/dist/theme/chart-palette.js +112 -0
  308. package/dist/theme/create-theme.d.ts +52 -0
  309. package/dist/theme/create-theme.js +75 -0
  310. package/dist/theme/style-element.d.ts +28 -0
  311. package/dist/theme/style-element.js +79 -0
  312. package/dist/theme/tenant-branding.d.ts +48 -0
  313. package/dist/theme/tenant-branding.js +65 -0
  314. package/dist/theme/theme-switch.d.ts +25 -0
  315. package/dist/theme/theme-switch.js +90 -0
  316. package/dist/theme/token-names.d.ts +3 -0
  317. package/dist/theme/token-names.js +166 -0
  318. package/dist/theme.css +241 -0
  319. package/dist/tokens.css +383 -0
  320. package/dist/types/direction.d.ts +4 -0
  321. package/dist/types/tone.d.ts +7 -0
  322. package/dist/utils/cn.d.ts +7 -0
  323. package/dist/utils/cn.js +50 -0
  324. package/dist/utils/first-field.d.ts +8 -0
  325. package/dist/utils/first-field.js +10 -0
  326. package/dist/utils/layout.d.ts +33 -0
  327. package/dist/utils/layout.js +30 -0
  328. package/dist/utils/popup.d.ts +12 -0
  329. package/dist/utils/popup.js +27 -0
  330. package/docs/accessibility.md +61 -0
  331. package/docs/advanced-components.md +38 -0
  332. package/docs/ai-assistants.md +44 -0
  333. package/docs/architecture.md +65 -0
  334. package/docs/browser-support.md +30 -0
  335. package/docs/charts.md +56 -0
  336. package/docs/components.md +2928 -0
  337. package/docs/conventions.md +19 -0
  338. package/docs/customization.md +79 -0
  339. package/docs/dates-files-data.md +48 -0
  340. package/docs/design-principles.md +50 -0
  341. package/docs/faq.md +68 -0
  342. package/docs/forms.md +114 -0
  343. package/docs/getting-started.md +64 -0
  344. package/docs/icons.md +48 -0
  345. package/docs/internationalization.md +64 -0
  346. package/docs/layout-and-navigation.md +51 -0
  347. package/docs/nextjs.md +69 -0
  348. package/docs/releasing.md +40 -0
  349. package/docs/testing.md +242 -0
  350. package/docs/theming.md +118 -0
  351. package/docs/typescript.md +62 -0
  352. package/llms-full.txt +4573 -0
  353. package/llms.txt +52 -0
  354. package/package.json +193 -6
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
4
+ import { cn } from "../../utils/cn.js";
5
+ import { positioner } from "../../utils/popup.js";
6
+ import { MENU_POPUP } from "./Menu.js";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ // src/components/Menu/ContextMenu.tsx
9
+ /**
10
+ * A menu that opens where the pointer is, from a right click or a long press on its area, or from the keyboard's
11
+ * Menu key or Shift and F10 while the area (or something in it) has the focus. The area is a tab stop for that, and
12
+ * the browser sends those keys to it as a `contextmenu` event. Its items are the same as Menu's, and closing the
13
+ * menu puts the focus back. A context menu is a shortcut, never the only way: whatever it does must be reachable
14
+ * another way too.
15
+ */
16
+ var ContextMenu = (t0) => {
17
+ const $ = c(13);
18
+ const { menu, children, "aria-label": ariaLabel, className } = t0;
19
+ let t1;
20
+ if ($[0] !== ariaLabel) {
21
+ t1 = ariaLabel ? {
22
+ role: "group",
23
+ "aria-label": ariaLabel
24
+ } : {};
25
+ $[0] = ariaLabel;
26
+ $[1] = t1;
27
+ } else t1 = $[1];
28
+ let t2;
29
+ if ($[2] !== className) {
30
+ t2 = cn("outline-none focus-visible:ring-2 focus-visible:ring-focus", className);
31
+ $[2] = className;
32
+ $[3] = t2;
33
+ } else t2 = $[3];
34
+ let t3;
35
+ if ($[4] !== children || $[5] !== t1 || $[6] !== t2) {
36
+ t3 = /* @__PURE__ */ jsx(ContextMenu$1.Trigger, {
37
+ tabIndex: 0,
38
+ ...t1,
39
+ className: t2,
40
+ children
41
+ });
42
+ $[4] = children;
43
+ $[5] = t1;
44
+ $[6] = t2;
45
+ $[7] = t3;
46
+ } else t3 = $[7];
47
+ let t4;
48
+ if ($[8] !== menu) {
49
+ t4 = /* @__PURE__ */ jsx(ContextMenu$1.Portal, { children: /* @__PURE__ */ jsx(ContextMenu$1.Positioner, {
50
+ className: positioner,
51
+ children: /* @__PURE__ */ jsx(ContextMenu$1.Popup, {
52
+ className: MENU_POPUP,
53
+ children: menu
54
+ })
55
+ }) });
56
+ $[8] = menu;
57
+ $[9] = t4;
58
+ } else t4 = $[9];
59
+ let t5;
60
+ if ($[10] !== t3 || $[11] !== t4) {
61
+ t5 = /* @__PURE__ */ jsxs(ContextMenu$1.Root, { children: [t3, t4] });
62
+ $[10] = t3;
63
+ $[11] = t4;
64
+ $[12] = t5;
65
+ } else t5 = $[12];
66
+ return t5;
67
+ };
68
+ export { ContextMenu };
@@ -0,0 +1,86 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ interface MenuProps {
3
+ /** The button that opens the menu. It is the trigger itself, so it keeps its own look and props. */
4
+ trigger: ReactElement;
5
+ children: ReactNode;
6
+ /** Which edge of the trigger the menu lines up with. */
7
+ align?: "start" | "center" | "end" | undefined;
8
+ /** "large" is the roomier menu: 40px rows and 16px text. */
9
+ size?: "default" | "large" | undefined;
10
+ }
11
+ /** A menu that opens from a button: items, radio choices, separators. */
12
+ export declare const Menu: ({ trigger, children, align, size }: MenuProps) => import("react").JSX.Element;
13
+ interface MenuItemProps {
14
+ children: ReactNode;
15
+ /** An icon sized by font-size, before the label. It takes the row's colour. */
16
+ icon?: ReactNode | undefined;
17
+ onClick?: (() => void) | undefined;
18
+ disabled?: boolean | undefined;
19
+ /** "danger" for an action that deletes or removes. */
20
+ tone?: "default" | "danger" | undefined;
21
+ }
22
+ /** One command of a `Menu`: a label with an optional icon. `tone="danger"` marks one that deletes or removes. */
23
+ export declare const MenuItem: ({ children, icon, onClick, disabled, tone }: MenuItemProps) => import("react").JSX.Element;
24
+ /** The popup's own look, shared with the context menu and the menu bar's menus. */
25
+ export declare const MENU_POPUP: string;
26
+ /** A rule between groups of items, e.g. before a destructive one. */
27
+ export declare const MenuSeparator: () => import("react").JSX.Element;
28
+ interface MenuRadioGroupProps<TValue extends string> {
29
+ value: TValue;
30
+ onValueChange: (value: TValue) => void;
31
+ /** Accessible name of the group, e.g. "Language". */
32
+ "aria-label": string;
33
+ children: ReactNode;
34
+ }
35
+ /** A set of mutually exclusive choices; the one in force is ticked. */
36
+ export declare const MenuRadioGroup: <TValue extends string>({ value, onValueChange, "aria-label": ariaLabel, children, }: MenuRadioGroupProps<TValue>) => import("react").JSX.Element;
37
+ interface MenuRadioItemProps {
38
+ value: string;
39
+ children: ReactNode;
40
+ }
41
+ /** A radio choice: the label, with a check at the end edge when it is the one in force. */
42
+ export declare const MenuRadioItem: ({ value, children }: MenuRadioItemProps) => import("react").JSX.Element;
43
+ interface MenuCheckboxItemProps {
44
+ /** Whether the option is on. */
45
+ checked: boolean;
46
+ /** Called with the new state when the person chooses the item. */
47
+ onCheckedChange: (checked: boolean) => void;
48
+ children: ReactNode;
49
+ disabled?: boolean | undefined;
50
+ /** Close the menu when the item is chosen. Default false: a person often sets several options in one visit. */
51
+ closeOnClick?: boolean | undefined;
52
+ }
53
+ /** An option that is on or off, with a check at the end edge while it is on ("Show grid", "Word wrap"). */
54
+ export declare const MenuCheckboxItem: ({ checked, onCheckedChange, children, disabled, closeOnClick }: MenuCheckboxItemProps) => import("react").JSX.Element;
55
+ interface MenuLinkItemProps {
56
+ href?: string | undefined;
57
+ children: ReactNode;
58
+ /** An icon sized by font-size, before the label. */
59
+ icon?: ReactNode | undefined;
60
+ /** The app's router link, `<RouterLink to="/settings" />`, to render in place of the plain `<a>`. */
61
+ render?: ReactElement | undefined;
62
+ }
63
+ /** An item that goes to a page: a real link, so it can be opened in a new tab and a screen reader announces it as one. */
64
+ export declare const MenuLinkItem: ({ href, children, icon, render }: MenuLinkItemProps) => import("react").JSX.Element;
65
+ interface MenuGroupProps {
66
+ /** The group's name: shown above its items in small type, and its accessible name. */
67
+ label: string;
68
+ children: ReactNode;
69
+ }
70
+ /** Items under a small heading: "Sort by", "View". */
71
+ export declare const MenuGroup: ({ label, children }: MenuGroupProps) => import("react").JSX.Element;
72
+ interface MenuSubmenuProps {
73
+ /** The item that opens the submenu. */
74
+ label: string;
75
+ /** An icon sized by font-size, before the label. */
76
+ icon?: ReactNode | undefined;
77
+ disabled?: boolean | undefined;
78
+ /** The submenu's items. */
79
+ children: ReactNode;
80
+ }
81
+ /**
82
+ * An item that opens a menu of its own beside it, with a chevron that points the way the page reads. The arrow
83
+ * keys open it (toward the end edge) and close it (toward the start edge).
84
+ */
85
+ export declare const MenuSubmenu: ({ label, icon, disabled, children }: MenuSubmenuProps) => import("react").JSX.Element;
86
+ export {};
@@ -0,0 +1,394 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { Menu as Menu$1 } from "@base-ui/react/menu";
4
+ import { Check, ChevronRight } from "lucide-react";
5
+ import { cn } from "../../utils/cn.js";
6
+ import { item, popup, positioner, separator } from "../../utils/popup.js";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ // src/components/Menu/Menu.tsx
9
+ /** A menu row; the roomier "large" menu of the app bar raises the row to 40px and the text to 16px. */
10
+ var MENU_ITEM = cn(item, "cursor-pointer justify-start data-disabled:cursor-not-allowed [&_svg]:size-3.75", "group-data-[size=large]/menu:min-h-10 group-data-[size=large]/menu:text-body-lg");
11
+ /**
12
+ * Deleting, removing: red at rest and on a red wash while highlighted. In the dark theme the text takes the
13
+ * lighter red made for text, as the button red is under 4.5:1 on the dark popup.
14
+ */
15
+ var MENU_ITEM_DANGER = cn("text-destructive data-highlighted:bg-error-wash data-highlighted:text-destructive", "dark:text-error-text dark:data-highlighted:text-error-text");
16
+ /** The choice in force: a brand tint and brand text, kept while the row is highlighted. */
17
+ var MENU_RADIO_ITEM = cn(MENU_ITEM, "data-checked:bg-primary-light data-checked:text-primary-text data-checked:data-highlighted:bg-primary-light");
18
+ /** A menu that opens from a button: items, radio choices, separators. */
19
+ var Menu = (t0) => {
20
+ const $ = c(11);
21
+ const { trigger, children, align: t1, size: t2 } = t0;
22
+ const align = t1 === void 0 ? "end" : t1;
23
+ const size = t2 === void 0 ? "default" : t2;
24
+ let t3;
25
+ if ($[0] !== trigger) {
26
+ t3 = /* @__PURE__ */ jsx(Menu$1.Trigger, { render: trigger });
27
+ $[0] = trigger;
28
+ $[1] = t3;
29
+ } else t3 = $[1];
30
+ let t4;
31
+ if ($[2] !== children || $[3] !== size) {
32
+ t4 = /* @__PURE__ */ jsx(Menu$1.Popup, {
33
+ className: MENU_POPUP,
34
+ "data-size": size,
35
+ children
36
+ });
37
+ $[2] = children;
38
+ $[3] = size;
39
+ $[4] = t4;
40
+ } else t4 = $[4];
41
+ let t5;
42
+ if ($[5] !== align || $[6] !== t4) {
43
+ t5 = /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
44
+ className: positioner,
45
+ sideOffset: 6,
46
+ align,
47
+ children: t4
48
+ }) });
49
+ $[5] = align;
50
+ $[6] = t4;
51
+ $[7] = t5;
52
+ } else t5 = $[7];
53
+ let t6;
54
+ if ($[8] !== t3 || $[9] !== t5) {
55
+ t6 = /* @__PURE__ */ jsxs(Menu$1.Root, { children: [t3, t5] });
56
+ $[8] = t3;
57
+ $[9] = t5;
58
+ $[10] = t6;
59
+ } else t6 = $[10];
60
+ return t6;
61
+ };
62
+ /** One command of a `Menu`: a label with an optional icon. `tone="danger"` marks one that deletes or removes. */
63
+ var MenuItem = (t0) => {
64
+ const $ = c(14);
65
+ const { children, icon, onClick, disabled, tone: t1 } = t0;
66
+ const t2 = (t1 === void 0 ? "default" : t1) === "danger" && MENU_ITEM_DANGER;
67
+ let t3;
68
+ if ($[0] !== t2) {
69
+ t3 = cn(MENU_ITEM, t2);
70
+ $[0] = t2;
71
+ $[1] = t3;
72
+ } else t3 = $[1];
73
+ let t4;
74
+ if ($[2] !== disabled) {
75
+ t4 = disabled === void 0 ? {} : { disabled };
76
+ $[2] = disabled;
77
+ $[3] = t4;
78
+ } else t4 = $[3];
79
+ let t5;
80
+ if ($[4] !== onClick) {
81
+ t5 = onClick ? { onClick: () => {
82
+ onClick();
83
+ } } : {};
84
+ $[4] = onClick;
85
+ $[5] = t5;
86
+ } else t5 = $[5];
87
+ let t6;
88
+ if ($[6] !== icon) {
89
+ t6 = icon ? /* @__PURE__ */ jsx("span", {
90
+ className: "inline-flex shrink-0",
91
+ children: icon
92
+ }) : null;
93
+ $[6] = icon;
94
+ $[7] = t6;
95
+ } else t6 = $[7];
96
+ let t7;
97
+ if ($[8] !== children || $[9] !== t3 || $[10] !== t4 || $[11] !== t5 || $[12] !== t6) {
98
+ t7 = /* @__PURE__ */ jsxs(Menu$1.Item, {
99
+ className: t3,
100
+ ...t4,
101
+ ...t5,
102
+ children: [t6, children]
103
+ });
104
+ $[8] = children;
105
+ $[9] = t3;
106
+ $[10] = t4;
107
+ $[11] = t5;
108
+ $[12] = t6;
109
+ $[13] = t7;
110
+ } else t7 = $[13];
111
+ return t7;
112
+ };
113
+ /** The popup's own look, shared with the context menu and the menu bar's menus. */
114
+ var MENU_POPUP = cn(popup, "group/menu min-w-43.5");
115
+ /** A rule between groups of items, e.g. before a destructive one. */
116
+ var MenuSeparator = () => {
117
+ const $ = c(1);
118
+ let t0;
119
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
120
+ t0 = /* @__PURE__ */ jsx(Menu$1.Separator, { className: separator });
121
+ $[0] = t0;
122
+ } else t0 = $[0];
123
+ return t0;
124
+ };
125
+ /** A set of mutually exclusive choices; the one in force is ticked. */
126
+ var MenuRadioGroup = (t0) => {
127
+ const $ = c(7);
128
+ const { value, onValueChange, "aria-label": ariaLabel, children } = t0;
129
+ let t1;
130
+ if ($[0] !== onValueChange) {
131
+ t1 = (next) => {
132
+ onValueChange(next);
133
+ };
134
+ $[0] = onValueChange;
135
+ $[1] = t1;
136
+ } else t1 = $[1];
137
+ let t2;
138
+ if ($[2] !== ariaLabel || $[3] !== children || $[4] !== t1 || $[5] !== value) {
139
+ t2 = /* @__PURE__ */ jsx(Menu$1.RadioGroup, {
140
+ value,
141
+ "aria-label": ariaLabel,
142
+ onValueChange: t1,
143
+ children
144
+ });
145
+ $[2] = ariaLabel;
146
+ $[3] = children;
147
+ $[4] = t1;
148
+ $[5] = value;
149
+ $[6] = t2;
150
+ } else t2 = $[6];
151
+ return t2;
152
+ };
153
+ /** A radio choice: the label, with a check at the end edge when it is the one in force. */
154
+ var MenuRadioItem = (t0) => {
155
+ const $ = c(6);
156
+ const { value, children } = t0;
157
+ let t1;
158
+ if ($[0] !== children) {
159
+ t1 = /* @__PURE__ */ jsx("span", {
160
+ className: "flex-1",
161
+ children
162
+ });
163
+ $[0] = children;
164
+ $[1] = t1;
165
+ } else t1 = $[1];
166
+ let t2;
167
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
168
+ t2 = /* @__PURE__ */ jsx(Menu$1.RadioItemIndicator, {
169
+ className: "inline-flex shrink-0 [&_svg]:size-4",
170
+ children: /* @__PURE__ */ jsx(Check, { "aria-hidden": "true" })
171
+ });
172
+ $[2] = t2;
173
+ } else t2 = $[2];
174
+ let t3;
175
+ if ($[3] !== t1 || $[4] !== value) {
176
+ t3 = /* @__PURE__ */ jsxs(Menu$1.RadioItem, {
177
+ value,
178
+ closeOnClick: true,
179
+ className: MENU_RADIO_ITEM,
180
+ children: [t1, t2]
181
+ });
182
+ $[3] = t1;
183
+ $[4] = value;
184
+ $[5] = t3;
185
+ } else t3 = $[5];
186
+ return t3;
187
+ };
188
+ /** An option that is on or off, with a check at the end edge while it is on ("Show grid", "Word wrap"). */
189
+ var MenuCheckboxItem = (t0) => {
190
+ const $ = c(13);
191
+ const { checked, onCheckedChange, children, disabled, closeOnClick: t1 } = t0;
192
+ const closeOnClick = t1 === void 0 ? false : t1;
193
+ let t2;
194
+ if ($[0] !== onCheckedChange) {
195
+ t2 = (next) => {
196
+ onCheckedChange(next);
197
+ };
198
+ $[0] = onCheckedChange;
199
+ $[1] = t2;
200
+ } else t2 = $[1];
201
+ let t3;
202
+ if ($[2] !== disabled) {
203
+ t3 = disabled === void 0 ? {} : { disabled };
204
+ $[2] = disabled;
205
+ $[3] = t3;
206
+ } else t3 = $[3];
207
+ let t4;
208
+ if ($[4] !== children) {
209
+ t4 = /* @__PURE__ */ jsx("span", {
210
+ className: "flex-1",
211
+ children
212
+ });
213
+ $[4] = children;
214
+ $[5] = t4;
215
+ } else t4 = $[5];
216
+ let t5;
217
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
218
+ t5 = /* @__PURE__ */ jsx(Menu$1.CheckboxItemIndicator, {
219
+ className: "inline-flex shrink-0 [&_svg]:size-4",
220
+ children: /* @__PURE__ */ jsx(Check, { "aria-hidden": "true" })
221
+ });
222
+ $[6] = t5;
223
+ } else t5 = $[6];
224
+ let t6;
225
+ if ($[7] !== checked || $[8] !== closeOnClick || $[9] !== t2 || $[10] !== t3 || $[11] !== t4) {
226
+ t6 = /* @__PURE__ */ jsxs(Menu$1.CheckboxItem, {
227
+ checked,
228
+ onCheckedChange: t2,
229
+ closeOnClick,
230
+ ...t3,
231
+ className: MENU_RADIO_ITEM,
232
+ children: [t4, t5]
233
+ });
234
+ $[7] = checked;
235
+ $[8] = closeOnClick;
236
+ $[9] = t2;
237
+ $[10] = t3;
238
+ $[11] = t4;
239
+ $[12] = t6;
240
+ } else t6 = $[12];
241
+ return t6;
242
+ };
243
+ /** An item that goes to a page: a real link, so it can be opened in a new tab and a screen reader announces it as one. */
244
+ var MenuLinkItem = (t0) => {
245
+ const $ = c(12);
246
+ const { href, children, icon, render } = t0;
247
+ let t1;
248
+ if ($[0] !== href) {
249
+ t1 = href ? { href } : {};
250
+ $[0] = href;
251
+ $[1] = t1;
252
+ } else t1 = $[1];
253
+ let t2;
254
+ if ($[2] !== render) {
255
+ t2 = render ? { render } : {};
256
+ $[2] = render;
257
+ $[3] = t2;
258
+ } else t2 = $[3];
259
+ let t3;
260
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
261
+ t3 = cn(MENU_ITEM, "no-underline");
262
+ $[4] = t3;
263
+ } else t3 = $[4];
264
+ let t4;
265
+ if ($[5] !== icon) {
266
+ t4 = icon ? /* @__PURE__ */ jsx("span", {
267
+ className: "inline-flex shrink-0",
268
+ children: icon
269
+ }) : null;
270
+ $[5] = icon;
271
+ $[6] = t4;
272
+ } else t4 = $[6];
273
+ let t5;
274
+ if ($[7] !== children || $[8] !== t1 || $[9] !== t2 || $[10] !== t4) {
275
+ t5 = /* @__PURE__ */ jsxs(Menu$1.LinkItem, {
276
+ ...t1,
277
+ ...t2,
278
+ className: t3,
279
+ children: [t4, children]
280
+ });
281
+ $[7] = children;
282
+ $[8] = t1;
283
+ $[9] = t2;
284
+ $[10] = t4;
285
+ $[11] = t5;
286
+ } else t5 = $[11];
287
+ return t5;
288
+ };
289
+ /** Items under a small heading: "Sort by", "View". */
290
+ var MenuGroup = (t0) => {
291
+ const $ = c(5);
292
+ const { label, children } = t0;
293
+ let t1;
294
+ if ($[0] !== label) {
295
+ t1 = /* @__PURE__ */ jsx(Menu$1.GroupLabel, {
296
+ className: "px-2.5 pt-1.5 pb-1 text-caption font-semibold text-fg-secondary",
297
+ children: label
298
+ });
299
+ $[0] = label;
300
+ $[1] = t1;
301
+ } else t1 = $[1];
302
+ let t2;
303
+ if ($[2] !== children || $[3] !== t1) {
304
+ t2 = /* @__PURE__ */ jsxs(Menu$1.Group, { children: [t1, children] });
305
+ $[2] = children;
306
+ $[3] = t1;
307
+ $[4] = t2;
308
+ } else t2 = $[4];
309
+ return t2;
310
+ };
311
+ /**
312
+ * An item that opens a menu of its own beside it, with a chevron that points the way the page reads. The arrow
313
+ * keys open it (toward the end edge) and close it (toward the start edge).
314
+ */
315
+ var MenuSubmenu = (t0) => {
316
+ const $ = c(17);
317
+ const { label, icon, disabled, children } = t0;
318
+ let t1;
319
+ if ($[0] !== disabled) {
320
+ t1 = disabled === void 0 ? {} : { disabled };
321
+ $[0] = disabled;
322
+ $[1] = t1;
323
+ } else t1 = $[1];
324
+ let t2;
325
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
326
+ t2 = cn(MENU_ITEM, "data-popup-open:bg-primary-light data-popup-open:text-primary-text");
327
+ $[2] = t2;
328
+ } else t2 = $[2];
329
+ let t3;
330
+ if ($[3] !== icon) {
331
+ t3 = icon ? /* @__PURE__ */ jsx("span", {
332
+ className: "inline-flex shrink-0",
333
+ children: icon
334
+ }) : null;
335
+ $[3] = icon;
336
+ $[4] = t3;
337
+ } else t3 = $[4];
338
+ let t4;
339
+ if ($[5] !== label) {
340
+ t4 = /* @__PURE__ */ jsx("span", {
341
+ className: "flex-1 text-start",
342
+ children: label
343
+ });
344
+ $[5] = label;
345
+ $[6] = t4;
346
+ } else t4 = $[6];
347
+ let t5;
348
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
349
+ t5 = /* @__PURE__ */ jsx(ChevronRight, {
350
+ "aria-hidden": "true",
351
+ className: "size-4 shrink-0 text-fg-secondary rtl:rotate-180"
352
+ });
353
+ $[7] = t5;
354
+ } else t5 = $[7];
355
+ let t6;
356
+ if ($[8] !== t1 || $[9] !== t3 || $[10] !== t4) {
357
+ t6 = /* @__PURE__ */ jsxs(Menu$1.SubmenuTrigger, {
358
+ ...t1,
359
+ className: t2,
360
+ children: [
361
+ t3,
362
+ t4,
363
+ t5
364
+ ]
365
+ });
366
+ $[8] = t1;
367
+ $[9] = t3;
368
+ $[10] = t4;
369
+ $[11] = t6;
370
+ } else t6 = $[11];
371
+ let t7;
372
+ if ($[12] !== children) {
373
+ t7 = /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
374
+ className: positioner,
375
+ sideOffset: 4,
376
+ alignOffset: -7,
377
+ children: /* @__PURE__ */ jsx(Menu$1.Popup, {
378
+ className: MENU_POPUP,
379
+ children
380
+ })
381
+ }) });
382
+ $[12] = children;
383
+ $[13] = t7;
384
+ } else t7 = $[13];
385
+ let t8;
386
+ if ($[14] !== t6 || $[15] !== t7) {
387
+ t8 = /* @__PURE__ */ jsxs(Menu$1.SubmenuRoot, { children: [t6, t7] });
388
+ $[14] = t6;
389
+ $[15] = t7;
390
+ $[16] = t8;
391
+ } else t8 = $[16];
392
+ return t8;
393
+ };
394
+ export { MENU_POPUP, Menu, MenuCheckboxItem, MenuGroup, MenuItem, MenuLinkItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSubmenu };
@@ -0,0 +1,32 @@
1
+ export interface OtpInputProps {
2
+ /** The digits typed so far, as text: "" up to a full code. Never holds a gap, so "12" is the first two boxes. */
3
+ value: string;
4
+ /** Called with the new digits as the person types, deletes, pastes or cuts. */
5
+ onValueChange: (value: string) => void;
6
+ /** How many boxes; the code's length. */
7
+ length?: number | undefined;
8
+ /** Names the whole code for assistive technology, such as "Verification code". */
9
+ label: string;
10
+ /** Names one box (`position` counts from 1), such as "Digit 3 of 6". */
11
+ getDigitLabel: (position: number, total: number) => string;
12
+ /** Marks every box as holding a rejected code. Say why in text next to the input and point `aria-describedby` at it. */
13
+ invalid?: boolean | undefined;
14
+ /** Dims the boxes and takes them out of the tab order. */
15
+ disabled?: boolean | undefined;
16
+ /** The code cannot be edited (typing, Backspace, paste and cut do nothing), but is still shown and read (a check is under way). */
17
+ readOnly?: boolean | undefined;
18
+ /** Puts the cursor in the first box when the input appears. */
19
+ autoFocus?: boolean | undefined;
20
+ /** The ids of the text that describes the code, such as why it was rejected; given to every box. */
21
+ "aria-describedby"?: string | undefined;
22
+ /** Classes for the row of boxes, merged last. */
23
+ className?: string | undefined;
24
+ }
25
+ /**
26
+ * A code entered one digit per box, for the codes emailed to a user. Typing moves on to the next box,
27
+ * Backspace on an empty box steps back, the arrow keys move between boxes. A pasted code (Ctrl/Cmd+V, the
28
+ * context menu, a long press on a phone) or one the browser fills in from a message fills all the boxes at
29
+ * once, wherever it lands, with anything that is not a digit left out. Copy and cut take the whole code, not
30
+ * one box of it. The boxes read left to right in every language, as the digits of a number do.
31
+ */
32
+ export declare const OtpInput: ({ value, onValueChange, length, label, getDigitLabel, invalid, disabled, readOnly, autoFocus, "aria-describedby": describedBy, className, }: OtpInputProps) => import("react").JSX.Element;