@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,364 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { Fragment, useId } from "react";
4
+ import { ArrowDown, ArrowUp, ChevronRight, ChevronsUpDown } from "lucide-react";
5
+ import { CheckboxBox } from "../../components/Checkbox/CheckboxBox.js";
6
+ import { SkeletonItem } from "../../components/Skeleton/Skeleton.js";
7
+ import { cn } from "../../utils/cn.js";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
+ // src/patterns/DataTable/DataTable.tsx
10
+ var ALIGN = {
11
+ start: "text-start",
12
+ center: "text-center",
13
+ end: "text-end"
14
+ };
15
+ var HEADER_CELL = "h-11.5 bg-muted px-5 text-body-sm font-semibold tracking-[0.02em] whitespace-nowrap text-fg-body shadow-[inset_0_1px_0_var(--fast-line),inset_0_-1px_0_var(--fast-line)]";
16
+ var CELL = "h-15.5 px-5 text-body-sm font-normal text-fg-body";
17
+ /** The checkbox column: 20px of air on each side of the 17px box. */
18
+ var SELECT_CELL = "w-14.25";
19
+ var ROW = "border-b border-line-subtle transition-colors duration-150 last:border-0";
20
+ /** The button that opens a row's panel, at the start of its first cell. */
21
+ var DISCLOSURE = "me-2 inline-flex size-6 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-0 align-middle text-fg-secondary transition-colors duration-150 ease-standard hover:bg-subtle hover:text-fg focus-visible:outline-2 focus-visible:outline-focus";
22
+ /** What a click in a row leaves to the control it lands on. */
23
+ var CONTROLS = "a, button, input, select, textarea, label, [role=checkbox], [role=button], [role=link]";
24
+ /** Stands in for the rows of a windowed list that are out of view. */
25
+ var SpacerRow = (t0) => {
26
+ const $ = c(5);
27
+ const { height } = t0;
28
+ let t1;
29
+ if ($[0] !== height) {
30
+ t1 = { height };
31
+ $[0] = height;
32
+ $[1] = t1;
33
+ } else t1 = $[1];
34
+ let t2;
35
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
36
+ t2 = /* @__PURE__ */ jsx("td", {
37
+ colSpan: 100,
38
+ className: "p-0"
39
+ });
40
+ $[2] = t2;
41
+ } else t2 = $[2];
42
+ let t3;
43
+ if ($[3] !== t1) {
44
+ t3 = /* @__PURE__ */ jsx("tr", {
45
+ "aria-hidden": "true",
46
+ style: t1,
47
+ children: t2
48
+ });
49
+ $[3] = t1;
50
+ $[4] = t3;
51
+ } else t3 = $[4];
52
+ return t3;
53
+ };
54
+ /**
55
+ * An edge-to-edge table. When rows are activatable, a
56
+ * click is ignored while the user has text selected, so copying a cell's text
57
+ * does not navigate away.
58
+ */
59
+ var DataTable = (t0) => {
60
+ const $ = c(73);
61
+ const { columns, rows, getRowId, onRowActivate, "aria-label": ariaLabel, sort, onSortChange, selection, expansion, isLoading: t1, loadingRows: t2, emptyState, stickyHeader: t3, rowClassName, virtualPadding } = t0;
62
+ const isLoading = t1 === void 0 ? false : t1;
63
+ const loadingRows = t2 === void 0 ? 5 : t2;
64
+ const stickyHeader = t3 === void 0 ? false : t3;
65
+ const idPrefix = useId();
66
+ let handleKeyDown;
67
+ let rowIds;
68
+ let selectedIds;
69
+ let showEmptyState;
70
+ let t4;
71
+ let t5;
72
+ let t6;
73
+ let t7;
74
+ let t8;
75
+ let toggleRow;
76
+ if ($[0] !== ariaLabel || $[1] !== columns || $[2] !== emptyState || $[3] !== getRowId || $[4] !== isLoading || $[5] !== onRowActivate || $[6] !== onSortChange || $[7] !== rows || $[8] !== selection || $[9] !== sort || $[10] !== stickyHeader) {
77
+ const headerCell = cn(HEADER_CELL, stickyHeader && "sticky top-0 z-3");
78
+ let t9;
79
+ if ($[21] !== onRowActivate) {
80
+ t9 = (event, row) => {
81
+ if (event.target !== event.currentTarget) return;
82
+ if (event.key !== "Enter" && event.key !== " ") return;
83
+ event.preventDefault();
84
+ onRowActivate?.(row);
85
+ };
86
+ $[21] = onRowActivate;
87
+ $[22] = t9;
88
+ } else t9 = $[22];
89
+ handleKeyDown = t9;
90
+ let isAllSelected;
91
+ let t10;
92
+ if ($[23] !== getRowId || $[24] !== rows || $[25] !== selection?.selectedIds) {
93
+ rowIds = rows.map(getRowId);
94
+ selectedIds = selection?.selectedIds;
95
+ isAllSelected = rowIds.length > 0 && rowIds.every((id) => selectedIds?.has(id) === true);
96
+ let t11;
97
+ if ($[30] !== selectedIds) {
98
+ t11 = (id_0) => selectedIds?.has(id_0) === true;
99
+ $[30] = selectedIds;
100
+ $[31] = t11;
101
+ } else t11 = $[31];
102
+ t10 = rowIds.some(t11);
103
+ $[23] = getRowId;
104
+ $[24] = rows;
105
+ $[25] = selection?.selectedIds;
106
+ $[26] = isAllSelected;
107
+ $[27] = rowIds;
108
+ $[28] = selectedIds;
109
+ $[29] = t10;
110
+ } else {
111
+ isAllSelected = $[26];
112
+ rowIds = $[27];
113
+ selectedIds = $[28];
114
+ t10 = $[29];
115
+ }
116
+ const isSomeSelected = t10;
117
+ let t11;
118
+ if ($[32] !== isAllSelected || $[33] !== rowIds || $[34] !== selection) {
119
+ t11 = () => {
120
+ if (!selection) return;
121
+ const next = new Set(selection.selectedIds);
122
+ rowIds.forEach((id_1) => {
123
+ if (isAllSelected) next.delete(id_1);
124
+ else next.add(id_1);
125
+ });
126
+ selection.onSelectionChange(next);
127
+ };
128
+ $[32] = isAllSelected;
129
+ $[33] = rowIds;
130
+ $[34] = selection;
131
+ $[35] = t11;
132
+ } else t11 = $[35];
133
+ const toggleAll = t11;
134
+ let t12;
135
+ if ($[36] !== selection) {
136
+ t12 = (id_2) => {
137
+ if (!selection) return;
138
+ const next_0 = new Set(selection.selectedIds);
139
+ if (next_0.has(id_2)) next_0.delete(id_2);
140
+ else next_0.add(id_2);
141
+ selection.onSelectionChange(next_0);
142
+ };
143
+ $[36] = selection;
144
+ $[37] = t12;
145
+ } else t12 = $[37];
146
+ toggleRow = t12;
147
+ showEmptyState = !isLoading && rows.length === 0 && emptyState !== void 0;
148
+ t6 = ariaLabel;
149
+ t7 = isLoading || void 0;
150
+ t8 = "w-full border-collapse text-body-sm text-fg-body";
151
+ t4 = selection ? /* @__PURE__ */ jsx("th", {
152
+ scope: "col",
153
+ className: cn(headerCell, "text-start", SELECT_CELL),
154
+ children: /* @__PURE__ */ jsx(CheckboxBox, {
155
+ "aria-label": selection.labels.selectAll,
156
+ checked: isAllSelected,
157
+ indeterminate: !isAllSelected && isSomeSelected,
158
+ onCheckedChange: toggleAll
159
+ })
160
+ }) : null;
161
+ t5 = columns.map((column) => {
162
+ const sortDirection = sort?.columnId === column.id ? sort.direction : void 0;
163
+ return /* @__PURE__ */ jsx("th", {
164
+ scope: "col",
165
+ className: cn(headerCell, ALIGN[column.align ?? "start"]),
166
+ style: column.width ? { width: column.width } : void 0,
167
+ ...column.sortable ? { "aria-sort": sortDirection ?? "none" } : {},
168
+ children: column.sortable ? /* @__PURE__ */ jsxs("button", {
169
+ type: "button",
170
+ className: "inline-flex cursor-pointer items-center gap-1 border-0 bg-transparent p-0 text-inherit transition-colors duration-150 ease-standard hover:text-fg [&>svg]:size-3.5",
171
+ onClick: () => {
172
+ onSortChange?.(column.id);
173
+ },
174
+ children: [column.header, sortDirection === "ascending" ? /* @__PURE__ */ jsx(ArrowUp, { "aria-hidden": "true" }) : sortDirection === "descending" ? /* @__PURE__ */ jsx(ArrowDown, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronsUpDown, {
175
+ "aria-hidden": "true",
176
+ className: "text-line-strong"
177
+ })]
178
+ }) : column.header
179
+ }, column.id);
180
+ });
181
+ $[0] = ariaLabel;
182
+ $[1] = columns;
183
+ $[2] = emptyState;
184
+ $[3] = getRowId;
185
+ $[4] = isLoading;
186
+ $[5] = onRowActivate;
187
+ $[6] = onSortChange;
188
+ $[7] = rows;
189
+ $[8] = selection;
190
+ $[9] = sort;
191
+ $[10] = stickyHeader;
192
+ $[11] = handleKeyDown;
193
+ $[12] = rowIds;
194
+ $[13] = selectedIds;
195
+ $[14] = showEmptyState;
196
+ $[15] = t4;
197
+ $[16] = t5;
198
+ $[17] = t6;
199
+ $[18] = t7;
200
+ $[19] = t8;
201
+ $[20] = toggleRow;
202
+ } else {
203
+ handleKeyDown = $[11];
204
+ rowIds = $[12];
205
+ selectedIds = $[13];
206
+ showEmptyState = $[14];
207
+ t4 = $[15];
208
+ t5 = $[16];
209
+ t6 = $[17];
210
+ t7 = $[18];
211
+ t8 = $[19];
212
+ toggleRow = $[20];
213
+ }
214
+ let t9;
215
+ if ($[38] !== t4 || $[39] !== t5) {
216
+ t9 = /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [t4, t5] }) });
217
+ $[38] = t4;
218
+ $[39] = t5;
219
+ $[40] = t9;
220
+ } else t9 = $[40];
221
+ let t10;
222
+ if ($[41] !== virtualPadding) {
223
+ t10 = virtualPadding && virtualPadding.top > 0 ? /* @__PURE__ */ jsx(SpacerRow, { height: virtualPadding.top }) : null;
224
+ $[41] = virtualPadding;
225
+ $[42] = t10;
226
+ } else t10 = $[42];
227
+ let t11;
228
+ if ($[43] !== columns || $[44] !== expansion || $[45] !== getRowId || $[46] !== handleKeyDown || $[47] !== idPrefix || $[48] !== isLoading || $[49] !== loadingRows || $[50] !== onRowActivate || $[51] !== rowClassName || $[52] !== rowIds || $[53] !== rows || $[54] !== selectedIds || $[55] !== selection || $[56] !== toggleRow) {
229
+ t11 = isLoading ? Array.from({ length: loadingRows }, (_, index) => /* @__PURE__ */ jsxs("tr", {
230
+ className: ROW,
231
+ children: [selection ? /* @__PURE__ */ jsx("td", { className: cn(CELL, "text-start", SELECT_CELL) }) : null, columns.map(_temp)]
232
+ }, index)) : rows.map((row_0, index_0) => {
233
+ const id_3 = rowIds[index_0] ?? getRowId(row_0);
234
+ const isSelected = selectedIds?.has(id_3) === true;
235
+ const isExpanded = expansion?.isExpanded(row_0) === true;
236
+ const panelId = `${idPrefix}-panel-${String(index_0)}`;
237
+ const onRowClick = (event_0) => {
238
+ if (window.getSelection()?.toString()) return;
239
+ if (onRowActivate) {
240
+ onRowActivate(row_0);
241
+ return;
242
+ }
243
+ if (!expansion) return;
244
+ const control = event_0.target.closest(CONTROLS);
245
+ if (control && event_0.currentTarget.contains(control)) return;
246
+ expansion.onExpandedChange(row_0, !isExpanded);
247
+ };
248
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("tr", {
249
+ "aria-selected": selection ? isSelected : void 0,
250
+ className: cn(ROW, "not-data-selected:hover:bg-surface-hover data-activatable:cursor-pointer", "data-selected:bg-selected data-expanded:bg-primary-pale", "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus", rowClassName?.(row_0)),
251
+ "data-activatable": onRowActivate || expansion ? "" : void 0,
252
+ "data-selected": isSelected || void 0,
253
+ "data-expanded": isExpanded || void 0,
254
+ ...onRowActivate || expansion ? { onClick: onRowClick } : {},
255
+ ...onRowActivate ? {
256
+ tabIndex: 0,
257
+ onKeyDown: (event_1) => {
258
+ handleKeyDown(event_1, row_0);
259
+ }
260
+ } : {},
261
+ children: [selection ? /* @__PURE__ */ jsx("td", {
262
+ className: cn(CELL, "text-start", SELECT_CELL),
263
+ children: /* @__PURE__ */ jsx(CheckboxBox, {
264
+ "aria-label": selection.labels.selectRow(row_0),
265
+ checked: isSelected,
266
+ stopClickPropagation: true,
267
+ onCheckedChange: () => {
268
+ toggleRow(id_3);
269
+ }
270
+ })
271
+ }) : null, columns.map((column_1, at) => /* @__PURE__ */ jsxs("td", {
272
+ className: cn(CELL, ALIGN[column_1.align ?? "start"], column_1.cellClassName),
273
+ children: [expansion && at === 0 ? /* @__PURE__ */ jsx("button", {
274
+ type: "button",
275
+ "aria-label": expansion.toggleLabel(row_0),
276
+ "aria-expanded": isExpanded,
277
+ ...isExpanded ? { "aria-controls": panelId } : {},
278
+ className: DISCLOSURE,
279
+ onClick: (event_2) => {
280
+ event_2.stopPropagation();
281
+ expansion.onExpandedChange(row_0, !isExpanded);
282
+ },
283
+ children: /* @__PURE__ */ jsx(ChevronRight, {
284
+ "aria-hidden": "true",
285
+ className: cn("size-4 transition-transform duration-150 motion-reduce:transition-none rtl:rotate-180", isExpanded && "rotate-90 rtl:rotate-90")
286
+ })
287
+ }) : null, column_1.cell(row_0)]
288
+ }, column_1.id))]
289
+ }), isExpanded ? /* @__PURE__ */ jsx("tr", {
290
+ className: cn(ROW, "bg-primary-pale"),
291
+ children: /* @__PURE__ */ jsx("td", {
292
+ id: panelId,
293
+ colSpan: columns.length + (selection ? 1 : 0),
294
+ className: "px-4.5 pb-4",
295
+ children: expansion.render(row_0)
296
+ })
297
+ }) : null] }, id_3);
298
+ });
299
+ $[43] = columns;
300
+ $[44] = expansion;
301
+ $[45] = getRowId;
302
+ $[46] = handleKeyDown;
303
+ $[47] = idPrefix;
304
+ $[48] = isLoading;
305
+ $[49] = loadingRows;
306
+ $[50] = onRowActivate;
307
+ $[51] = rowClassName;
308
+ $[52] = rowIds;
309
+ $[53] = rows;
310
+ $[54] = selectedIds;
311
+ $[55] = selection;
312
+ $[56] = toggleRow;
313
+ $[57] = t11;
314
+ } else t11 = $[57];
315
+ let t12;
316
+ if ($[58] !== virtualPadding) {
317
+ t12 = virtualPadding && virtualPadding.bottom > 0 ? /* @__PURE__ */ jsx(SpacerRow, { height: virtualPadding.bottom }) : null;
318
+ $[58] = virtualPadding;
319
+ $[59] = t12;
320
+ } else t12 = $[59];
321
+ let t13;
322
+ if ($[60] !== t10 || $[61] !== t11 || $[62] !== t12) {
323
+ t13 = /* @__PURE__ */ jsxs("tbody", { children: [
324
+ t10,
325
+ t11,
326
+ t12
327
+ ] });
328
+ $[60] = t10;
329
+ $[61] = t11;
330
+ $[62] = t12;
331
+ $[63] = t13;
332
+ } else t13 = $[63];
333
+ let t14;
334
+ if ($[64] !== t13 || $[65] !== t6 || $[66] !== t7 || $[67] !== t8 || $[68] !== t9) {
335
+ t14 = /* @__PURE__ */ jsxs("table", {
336
+ "aria-label": t6,
337
+ "aria-busy": t7,
338
+ className: t8,
339
+ children: [t9, t13]
340
+ });
341
+ $[64] = t13;
342
+ $[65] = t6;
343
+ $[66] = t7;
344
+ $[67] = t8;
345
+ $[68] = t9;
346
+ $[69] = t14;
347
+ } else t14 = $[69];
348
+ const t15 = showEmptyState ? emptyState : null;
349
+ let t16;
350
+ if ($[70] !== t14 || $[71] !== t15) {
351
+ t16 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t14, t15] });
352
+ $[70] = t14;
353
+ $[71] = t15;
354
+ $[72] = t16;
355
+ } else t16 = $[72];
356
+ return t16;
357
+ };
358
+ function _temp(column_0) {
359
+ return /* @__PURE__ */ jsx("td", {
360
+ className: cn(CELL, "text-start"),
361
+ children: /* @__PURE__ */ jsx(SkeletonItem, {})
362
+ }, column_0.id);
363
+ }
364
+ export { DataTable };
@@ -0,0 +1,28 @@
1
+ import type { Locale } from "date-fns";
2
+ import type { DateTimePickerLabels } from "./picker-labels.js";
3
+ import { type PickerBounds, type PickerKind } from "./picker-values.js";
4
+ interface DateTimePanelProps {
5
+ /** The picker's value, as its kind writes it; empty when nothing is chosen. */
6
+ value: string;
7
+ kind: PickerKind;
8
+ withSeconds: boolean;
9
+ bounds: PickerBounds;
10
+ labels: DateTimePickerLabels;
11
+ /** For the names of months and days. */
12
+ locale: Locale;
13
+ /** The time a day gets when it is picked while the value has none. The time now if omitted. */
14
+ defaultTime: string | undefined;
15
+ clearable: boolean;
16
+ showNow: boolean;
17
+ onChange: (value: string) => void;
18
+ onDone: () => void;
19
+ }
20
+ /**
21
+ * The panel a picker opens: a month with arrows, the days from the locale's first day of the
22
+ * week, the hour, minute and second sliders, and Today or Now, Clear and Done. The keyboard
23
+ * moves through the days, and the month's name opens a month and year list so a date years
24
+ * away is not months of clicking. Every change is sent as it is made; Done only closes. It is
25
+ * mounted when the picker opens, so what it starts from is the value then.
26
+ */
27
+ export declare const DateTimePanel: ({ value, kind, withSeconds, bounds, labels, locale, defaultTime, clearable, showNow, onChange, onDone, }: DateTimePanelProps) => import("react").JSX.Element;
28
+ export {};