@primecoderin/fast-ui-react 0.0.0-stage → 0.1.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 +90 -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 +41 -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 +4574 -0
  353. package/llms.txt +52 -0
  354. package/package.json +166 -6
@@ -0,0 +1,221 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { forwardRef } from "react";
4
+ import { Button as Button$1 } from "@base-ui/react/button";
5
+ import { cva } from "class-variance-authority";
6
+ import { cn } from "../../utils/cn.js";
7
+ import { Spinner } from "../Spinner/Spinner.js";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ // src/components/Button/Button.tsx
10
+ /**
11
+ * The variants, as the Figma file names its buttons (`.button-*`):
12
+ * primary button-primary the teal fill with a soft teal glow; once per view, for the main action
13
+ * secondary button-secondary white with a grey border, teal on hover: Cancel, Filters, and the default
14
+ * subtle button-ghost no chrome until hovered: quiet actions in a toolbar
15
+ * destructive button-danger red fill
16
+ * icon the row-menu dots, a dialog's close: a glyph that tints teal on hover (give it no children)
17
+ * and two more, which Figma's button set does not name:
18
+ * outline teal outline and teal text
19
+ * tertiary teal text, underlined on hover
20
+ *
21
+ * Sizes: medium is Figma's 42px button (`padding: 0 16px`, 13px semibold, 17px
22
+ * icons, 8px apart); small is 30px, large 48px. An icon-only button is a square
23
+ * of the same height (the 42px back button, the 30px row-menu dots). Every
24
+ * variant dims to 48% when disabled, as in the file.
25
+ */
26
+ var buttonVariants = cva([
27
+ "inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-md border border-transparent font-semibold",
28
+ "transition-[color,background-color,border-color,box-shadow,translate] duration-200 ease-standard",
29
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-page",
30
+ "data-disabled:cursor-not-allowed data-disabled:shadow-none data-disabled:not-data-loading:opacity-48",
31
+ "data-loading:cursor-progress"
32
+ ], {
33
+ variants: {
34
+ variant: {
35
+ primary: [
36
+ "bg-primary text-on-primary shadow-primary",
37
+ "not-data-disabled:hover:-translate-y-px not-data-disabled:hover:bg-primary-hover",
38
+ "not-data-disabled:active:translate-y-0 not-data-disabled:active:bg-primary-active"
39
+ ],
40
+ secondary: [
41
+ "border-line bg-surface text-fg-body",
42
+ "not-data-disabled:hover:border-primary not-data-disabled:hover:text-primary-text",
43
+ "not-data-disabled:active:bg-primary-pale"
44
+ ],
45
+ outline: ["border-primary text-primary-text", "not-data-disabled:hover:bg-primary-light not-data-disabled:active:bg-primary-light"],
46
+ tertiary: ["text-primary-text", "not-data-disabled:hover:text-primary-text-hover not-data-disabled:hover:underline not-data-disabled:active:text-primary-text-pressed"],
47
+ subtle: ["text-fg-secondary", "not-data-disabled:hover:bg-subtle not-data-disabled:hover:text-fg not-data-disabled:active:bg-pressed"],
48
+ destructive: ["bg-destructive text-on-destructive", "not-data-disabled:hover:bg-destructive-hover not-data-disabled:active:bg-destructive-active"],
49
+ icon: ["text-fg-tertiary", "not-data-disabled:hover:bg-primary-light not-data-disabled:hover:text-primary-text not-data-disabled:active:bg-primary-light"]
50
+ },
51
+ size: {
52
+ small: "h-7.5 px-3 text-caption [&_svg]:size-3.75",
53
+ medium: "h-10.5 px-4 text-body-sm [&_svg]:size-4.25",
54
+ large: "h-12 px-5 text-body [&_svg]:size-4.5"
55
+ },
56
+ iconOnly: {
57
+ true: "px-0",
58
+ false: ""
59
+ }
60
+ },
61
+ compoundVariants: [
62
+ {
63
+ iconOnly: true,
64
+ size: "small",
65
+ className: "w-7.5"
66
+ },
67
+ {
68
+ iconOnly: true,
69
+ size: "medium",
70
+ className: "w-10.5"
71
+ },
72
+ {
73
+ iconOnly: true,
74
+ size: "large",
75
+ className: "w-12"
76
+ },
77
+ {
78
+ variant: "tertiary",
79
+ size: "small",
80
+ className: "px-2"
81
+ }
82
+ ],
83
+ defaultVariants: {
84
+ variant: "secondary",
85
+ size: "medium",
86
+ iconOnly: false
87
+ }
88
+ });
89
+ /**
90
+ * A native button in one of the variants: primary for the one main action of a view, secondary (the
91
+ * default) for the rest, subtle in a toolbar, destructive to delete, icon for a lone glyph. Its type is
92
+ * "button" unless another is given, so it never submits a form by accident.
93
+ */
94
+ var Button = forwardRef((t0, ref) => {
95
+ const $ = c(36);
96
+ let children;
97
+ let className;
98
+ let icon;
99
+ let onClick;
100
+ let rest;
101
+ let size;
102
+ let t1;
103
+ let t2;
104
+ let t3;
105
+ let t4;
106
+ let variant;
107
+ if ($[0] !== t0) {
108
+ ({variant, size, icon, iconPosition: t1, disabledFocusable: t2, isLoading: t3, disabled: t4, className, children, onClick, ...rest} = t0);
109
+ $[0] = t0;
110
+ $[1] = children;
111
+ $[2] = className;
112
+ $[3] = icon;
113
+ $[4] = onClick;
114
+ $[5] = rest;
115
+ $[6] = size;
116
+ $[7] = t1;
117
+ $[8] = t2;
118
+ $[9] = t3;
119
+ $[10] = t4;
120
+ $[11] = variant;
121
+ } else {
122
+ children = $[1];
123
+ className = $[2];
124
+ icon = $[3];
125
+ onClick = $[4];
126
+ rest = $[5];
127
+ size = $[6];
128
+ t1 = $[7];
129
+ t2 = $[8];
130
+ t3 = $[9];
131
+ t4 = $[10];
132
+ variant = $[11];
133
+ }
134
+ const iconPosition = t1 === void 0 ? "before" : t1;
135
+ const disabledFocusable = t2 === void 0 ? false : t2;
136
+ const isLoading = t3 === void 0 ? false : t3;
137
+ const disabled = t4 === void 0 ? false : t4;
138
+ const isBlocked = disabledFocusable || isLoading;
139
+ const hasChildren = children !== void 0 && children !== null && children !== false;
140
+ let t5;
141
+ if ($[12] !== isBlocked || $[13] !== onClick) {
142
+ t5 = (event) => {
143
+ if (isBlocked) {
144
+ event.preventDefault();
145
+ return;
146
+ }
147
+ onClick?.(event);
148
+ };
149
+ $[12] = isBlocked;
150
+ $[13] = onClick;
151
+ $[14] = t5;
152
+ } else t5 = $[14];
153
+ const handleClick = t5;
154
+ let t6;
155
+ if ($[15] !== icon || $[16] !== isLoading) {
156
+ t6 = isLoading ? /* @__PURE__ */ jsx(Spinner, {
157
+ size: "tiny",
158
+ inherit: true
159
+ }) : icon;
160
+ $[15] = icon;
161
+ $[16] = isLoading;
162
+ $[17] = t6;
163
+ } else t6 = $[17];
164
+ const iconNode = t6;
165
+ const t7 = rest.type ?? "button";
166
+ const t8 = disabled || isBlocked;
167
+ const t9 = !disabled && isBlocked;
168
+ let t10;
169
+ if ($[18] !== className || $[19] !== hasChildren || $[20] !== size || $[21] !== variant) {
170
+ t10 = cn(buttonVariants({
171
+ variant,
172
+ size,
173
+ iconOnly: !hasChildren
174
+ }), className);
175
+ $[18] = className;
176
+ $[19] = hasChildren;
177
+ $[20] = size;
178
+ $[21] = variant;
179
+ $[22] = t10;
180
+ } else t10 = $[22];
181
+ const t11 = isLoading || void 0;
182
+ const t12 = isLoading || void 0;
183
+ const t13 = iconPosition === "before" ? iconNode : null;
184
+ const t14 = hasChildren ? children : null;
185
+ const t15 = iconPosition === "after" ? iconNode : null;
186
+ let t16;
187
+ if ($[23] !== handleClick || $[24] !== ref || $[25] !== rest || $[26] !== t10 || $[27] !== t11 || $[28] !== t12 || $[29] !== t13 || $[30] !== t14 || $[31] !== t15 || $[32] !== t7 || $[33] !== t8 || $[34] !== t9) {
188
+ t16 = /* @__PURE__ */ jsxs(Button$1, {
189
+ ...rest,
190
+ ref,
191
+ type: t7,
192
+ disabled: t8,
193
+ focusableWhenDisabled: t9,
194
+ className: t10,
195
+ "data-loading": t11,
196
+ "aria-busy": t12,
197
+ onClick: handleClick,
198
+ children: [
199
+ t13,
200
+ t14,
201
+ t15
202
+ ]
203
+ });
204
+ $[23] = handleClick;
205
+ $[24] = ref;
206
+ $[25] = rest;
207
+ $[26] = t10;
208
+ $[27] = t11;
209
+ $[28] = t12;
210
+ $[29] = t13;
211
+ $[30] = t14;
212
+ $[31] = t15;
213
+ $[32] = t7;
214
+ $[33] = t8;
215
+ $[34] = t9;
216
+ $[35] = t16;
217
+ } else t16 = $[35];
218
+ return t16;
219
+ });
220
+ Button.displayName = "Button";
221
+ export { Button };
@@ -0,0 +1,33 @@
1
+ import type { FocusEventHandler, Ref } from "react";
2
+ export interface CheckboxBoxProps {
3
+ /** Whether the box is ticked. */
4
+ checked: boolean;
5
+ /** The mixed state, e.g. a table header when only some rows are selected. */
6
+ indeterminate?: boolean | undefined;
7
+ /** Called with the new state when the person ticks or clears the box (a click or Space). */
8
+ onCheckedChange: (checked: boolean) => void;
9
+ /** "large" is a 20px box (the default is 17px). */
10
+ size?: "medium" | "large" | undefined;
11
+ /** Greys the box out; it cannot be ticked or focused. */
12
+ disabled?: boolean | undefined;
13
+ /** For a box with no visible label beside it. */
14
+ "aria-label"?: string | undefined;
15
+ /**
16
+ * The id of the element that names the box. Inside a form field Base UI names every control after the field's
17
+ * label; this gives a box its own name (a row of a list, one of several boxes in one field).
18
+ */
19
+ "aria-labelledby"?: string | undefined;
20
+ /** The field's name in a submitted form: the box's hidden input submits "on" while ticked. */
21
+ name?: string | undefined;
22
+ /** The box's hidden `<input type="checkbox">`, e.g. for a form library to focus the first invalid field. */
23
+ inputRef?: Ref<HTMLInputElement> | undefined;
24
+ /** The box lost focus. */
25
+ onBlur?: FocusEventHandler<HTMLElement> | undefined;
26
+ /** Keeps a click on the box from also reaching the row or card around it. */
27
+ stopClickPropagation?: boolean | undefined;
28
+ }
29
+ /**
30
+ * The checkbox square on its own, for form fields (inside a label) and table
31
+ * selection. It is the one place the foundation's checkbox look is defined.
32
+ */
33
+ export declare const CheckboxBox: ({ checked, indeterminate, onCheckedChange, size, disabled, name, inputRef, onBlur, stopClickPropagation, ...rest }: CheckboxBoxProps) => import("react").JSX.Element;
@@ -0,0 +1,148 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { Checkbox } from "@base-ui/react/checkbox";
4
+ import { Check, Minus } from "lucide-react";
5
+ import { cva } from "class-variance-authority";
6
+ import { jsx } from "react/jsx-runtime";
7
+ // src/components/Checkbox/CheckboxBox.tsx
8
+ /**
9
+ * Figma: a 17px square, `rounded-check` (4px) with a 1px grey border. Ticked and
10
+ * mixed, it fills with the deeper teal (`primary-active`) and carries a white
11
+ * 2.5px mark, 3.7:1 against the fill. The border turns teal on hover.
12
+ */
13
+ var checkboxBox = cva([
14
+ "box-border inline-flex shrink-0 items-center justify-center rounded-check border border-line-strong bg-surface p-0 text-white outline-none [&_svg]:stroke-[2.5]",
15
+ "transition-colors duration-150 ease-standard",
16
+ "not-data-disabled:not-data-checked:not-data-indeterminate:hover:border-primary",
17
+ "not-data-disabled:data-checked:border-primary-active not-data-disabled:data-checked:bg-primary-active",
18
+ "not-data-disabled:data-indeterminate:border-primary-active not-data-disabled:data-indeterminate:bg-primary-active",
19
+ "not-data-disabled:data-invalid:not-data-checked:not-data-indeterminate:border-error-solid",
20
+ "focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-page",
21
+ "data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-subtle data-disabled:text-fg-disabled"
22
+ ], {
23
+ variants: { size: {
24
+ medium: "size-4.25 [&_svg]:size-3",
25
+ large: "size-5 [&_svg]:size-3.25"
26
+ } },
27
+ defaultVariants: { size: "medium" }
28
+ });
29
+ /**
30
+ * The checkbox square on its own, for form fields (inside a label) and table
31
+ * selection. It is the one place the foundation's checkbox look is defined.
32
+ */
33
+ var CheckboxBox = (t0) => {
34
+ const $ = c(37);
35
+ let checked;
36
+ let disabled;
37
+ let inputRef;
38
+ let name;
39
+ let onBlur;
40
+ let onCheckedChange;
41
+ let rest;
42
+ let t1;
43
+ let t2;
44
+ let t3;
45
+ if ($[0] !== t0) {
46
+ ({checked, indeterminate: t1, onCheckedChange, size: t2, disabled, name, inputRef, onBlur, stopClickPropagation: t3, ...rest} = t0);
47
+ $[0] = t0;
48
+ $[1] = checked;
49
+ $[2] = disabled;
50
+ $[3] = inputRef;
51
+ $[4] = name;
52
+ $[5] = onBlur;
53
+ $[6] = onCheckedChange;
54
+ $[7] = rest;
55
+ $[8] = t1;
56
+ $[9] = t2;
57
+ $[10] = t3;
58
+ } else {
59
+ checked = $[1];
60
+ disabled = $[2];
61
+ inputRef = $[3];
62
+ name = $[4];
63
+ onBlur = $[5];
64
+ onCheckedChange = $[6];
65
+ rest = $[7];
66
+ t1 = $[8];
67
+ t2 = $[9];
68
+ t3 = $[10];
69
+ }
70
+ const indeterminate = t1 === void 0 ? false : t1;
71
+ const size = t2 === void 0 ? "medium" : t2;
72
+ const stopClickPropagation = t3 === void 0 ? false : t3;
73
+ let t4;
74
+ if ($[11] !== size) {
75
+ t4 = checkboxBox({ size });
76
+ $[11] = size;
77
+ $[12] = t4;
78
+ } else t4 = $[12];
79
+ let t5;
80
+ if ($[13] !== disabled) {
81
+ t5 = disabled === void 0 ? {} : { disabled };
82
+ $[13] = disabled;
83
+ $[14] = t5;
84
+ } else t5 = $[14];
85
+ let t6;
86
+ if ($[15] !== name) {
87
+ t6 = name === void 0 ? {} : { name };
88
+ $[15] = name;
89
+ $[16] = t6;
90
+ } else t6 = $[16];
91
+ let t7;
92
+ if ($[17] !== inputRef) {
93
+ t7 = inputRef === void 0 ? {} : { inputRef };
94
+ $[17] = inputRef;
95
+ $[18] = t7;
96
+ } else t7 = $[18];
97
+ let t8;
98
+ if ($[19] !== onBlur) {
99
+ t8 = onBlur === void 0 ? {} : { onBlur };
100
+ $[19] = onBlur;
101
+ $[20] = t8;
102
+ } else t8 = $[20];
103
+ let t9;
104
+ if ($[21] !== stopClickPropagation) {
105
+ t9 = stopClickPropagation ? { onClick: _temp } : {};
106
+ $[21] = stopClickPropagation;
107
+ $[22] = t9;
108
+ } else t9 = $[22];
109
+ let t10;
110
+ if ($[23] !== indeterminate) {
111
+ t10 = /* @__PURE__ */ jsx(Checkbox.Indicator, { render: indeterminate ? /* @__PURE__ */ jsx(Minus, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Check, { "aria-hidden": "true" }) });
112
+ $[23] = indeterminate;
113
+ $[24] = t10;
114
+ } else t10 = $[24];
115
+ let t11;
116
+ if ($[25] !== checked || $[26] !== indeterminate || $[27] !== onCheckedChange || $[28] !== rest || $[29] !== t10 || $[30] !== t4 || $[31] !== t5 || $[32] !== t6 || $[33] !== t7 || $[34] !== t8 || $[35] !== t9) {
117
+ t11 = /* @__PURE__ */ jsx(Checkbox.Root, {
118
+ className: t4,
119
+ checked,
120
+ indeterminate,
121
+ onCheckedChange,
122
+ ...t5,
123
+ ...t6,
124
+ ...t7,
125
+ ...t8,
126
+ ...t9,
127
+ ...rest,
128
+ children: t10
129
+ });
130
+ $[25] = checked;
131
+ $[26] = indeterminate;
132
+ $[27] = onCheckedChange;
133
+ $[28] = rest;
134
+ $[29] = t10;
135
+ $[30] = t4;
136
+ $[31] = t5;
137
+ $[32] = t6;
138
+ $[33] = t7;
139
+ $[34] = t8;
140
+ $[35] = t9;
141
+ $[36] = t11;
142
+ } else t11 = $[36];
143
+ return t11;
144
+ };
145
+ function _temp(event) {
146
+ event.stopPropagation();
147
+ }
148
+ export { CheckboxBox };
@@ -0,0 +1,26 @@
1
+ /** The texts of the snippet. The design system has no i18n, so the caller supplies them. */
2
+ export interface CodeSnippetLabels {
3
+ /** Accessible name of the copy button, e.g. "Copy code". */
4
+ copy: string;
5
+ /** Announced, and shown as the button's name, after the code was copied, e.g. "Copied". */
6
+ copied: string;
7
+ }
8
+ export interface CodeSnippetProps {
9
+ /** The code or command, as text. Line breaks are kept. */
10
+ code: string;
11
+ /** Needed for the copy button; leave it out for a snippet with no button. */
12
+ labels?: CodeSnippetLabels | undefined;
13
+ /** "block" (default) is a box of its own; "inline" sits in a line of text, with no copy button. */
14
+ variant?: "block" | "inline" | undefined;
15
+ /** The language, e.g. "tsx": it is written on the element as `data-language` for the app's own highlighter. */
16
+ language?: string | undefined;
17
+ /** How long "Copied" shows, in milliseconds. Default 2000. */
18
+ copiedDuration?: number | undefined;
19
+ className?: string | undefined;
20
+ }
21
+ /**
22
+ * Code or a command in the system's monospace, with a button that copies it. A long line scrolls sideways (the
23
+ * box takes the keyboard focus then, so the keys scroll it); the text is plain, for the app to colour if it wants.
24
+ * Inline, it is a `<code>` in a sentence.
25
+ */
26
+ export declare const CodeSnippet: ({ code, labels, variant, language, copiedDuration, className }: CodeSnippetProps) => import("react").JSX.Element;
@@ -0,0 +1,153 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { Check, Copy } from "lucide-react";
5
+ import { cn } from "../../utils/cn.js";
6
+ import { Button } from "../Button/Button.js";
7
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
+ // src/components/CodeSnippet/CodeSnippet.tsx
9
+ /**
10
+ * Code or a command in the system's monospace, with a button that copies it. A long line scrolls sideways (the
11
+ * box takes the keyboard focus then, so the keys scroll it); the text is plain, for the app to colour if it wants.
12
+ * Inline, it is a `<code>` in a sentence.
13
+ */
14
+ var CodeSnippet = (t0) => {
15
+ const $ = c(33);
16
+ const { code, labels, variant: t1, language, copiedDuration: t2, className } = t0;
17
+ const variant = t1 === void 0 ? "block" : t1;
18
+ const copiedDuration = t2 === void 0 ? 2e3 : t2;
19
+ const [copied, setCopied] = useState(false);
20
+ const timer = useRef(void 0);
21
+ let t3;
22
+ let t4;
23
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
24
+ t3 = () => () => {
25
+ clearTimeout(timer.current);
26
+ };
27
+ t4 = [];
28
+ $[0] = t3;
29
+ $[1] = t4;
30
+ } else {
31
+ t3 = $[0];
32
+ t4 = $[1];
33
+ }
34
+ useEffect(t3, t4);
35
+ if (variant === "inline") {
36
+ let t5;
37
+ if ($[2] !== className) {
38
+ t5 = cn("rounded-sm bg-subtle px-1.5 py-0.5 font-mono text-[0.9em] text-fg", className);
39
+ $[2] = className;
40
+ $[3] = t5;
41
+ } else t5 = $[3];
42
+ let t6;
43
+ if ($[4] !== language) {
44
+ t6 = language ? { "data-language": language } : {};
45
+ $[4] = language;
46
+ $[5] = t6;
47
+ } else t6 = $[5];
48
+ let t7;
49
+ if ($[6] !== code || $[7] !== t5 || $[8] !== t6) {
50
+ t7 = /* @__PURE__ */ jsx("code", {
51
+ className: t5,
52
+ ...t6,
53
+ children: code
54
+ });
55
+ $[6] = code;
56
+ $[7] = t5;
57
+ $[8] = t6;
58
+ $[9] = t7;
59
+ } else t7 = $[9];
60
+ return t7;
61
+ }
62
+ let t5;
63
+ if ($[10] !== code || $[11] !== copiedDuration) {
64
+ t5 = () => {
65
+ const clipboard = navigator.clipboard;
66
+ if (!clipboard) return;
67
+ clipboard.writeText(code).then(() => {
68
+ setCopied(true);
69
+ clearTimeout(timer.current);
70
+ timer.current = setTimeout(() => {
71
+ setCopied(false);
72
+ }, copiedDuration);
73
+ }, _temp);
74
+ };
75
+ $[10] = code;
76
+ $[11] = copiedDuration;
77
+ $[12] = t5;
78
+ } else t5 = $[12];
79
+ const copy = t5;
80
+ let t6;
81
+ if ($[13] !== className) {
82
+ t6 = cn("relative rounded-md border border-line bg-subtle", className);
83
+ $[13] = className;
84
+ $[14] = t6;
85
+ } else t6 = $[14];
86
+ const t7 = labels && "pe-12";
87
+ let t8;
88
+ if ($[15] !== t7) {
89
+ t8 = cn("m-0 overflow-x-auto p-3 font-mono text-caption leading-[1.6] text-fg outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-inset", t7);
90
+ $[15] = t7;
91
+ $[16] = t8;
92
+ } else t8 = $[16];
93
+ let t9;
94
+ if ($[17] !== language) {
95
+ t9 = language ? { "data-language": language } : {};
96
+ $[17] = language;
97
+ $[18] = t9;
98
+ } else t9 = $[18];
99
+ let t10;
100
+ if ($[19] !== code || $[20] !== t9) {
101
+ t10 = /* @__PURE__ */ jsx("code", {
102
+ ...t9,
103
+ children: code
104
+ });
105
+ $[19] = code;
106
+ $[20] = t9;
107
+ $[21] = t10;
108
+ } else t10 = $[21];
109
+ let t11;
110
+ if ($[22] !== t10 || $[23] !== t8) {
111
+ t11 = /* @__PURE__ */ jsx("pre", {
112
+ tabIndex: 0,
113
+ className: t8,
114
+ children: t10
115
+ });
116
+ $[22] = t10;
117
+ $[23] = t8;
118
+ $[24] = t11;
119
+ } else t11 = $[24];
120
+ let t12;
121
+ if ($[25] !== copied || $[26] !== copy || $[27] !== labels) {
122
+ t12 = labels ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
123
+ variant: "subtle",
124
+ size: "small",
125
+ className: "absolute end-1.5 top-1.5",
126
+ "aria-label": copied ? labels.copied : labels.copy,
127
+ icon: copied ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {}),
128
+ onClick: copy
129
+ }), /* @__PURE__ */ jsx("span", {
130
+ role: "status",
131
+ className: "sr-only",
132
+ children: copied ? labels.copied : ""
133
+ })] }) : null;
134
+ $[25] = copied;
135
+ $[26] = copy;
136
+ $[27] = labels;
137
+ $[28] = t12;
138
+ } else t12 = $[28];
139
+ let t13;
140
+ if ($[29] !== t11 || $[30] !== t12 || $[31] !== t6) {
141
+ t13 = /* @__PURE__ */ jsxs("div", {
142
+ className: t6,
143
+ children: [t11, t12]
144
+ });
145
+ $[29] = t11;
146
+ $[30] = t12;
147
+ $[31] = t6;
148
+ $[32] = t13;
149
+ } else t13 = $[32];
150
+ return t13;
151
+ };
152
+ function _temp() {}
153
+ export { CodeSnippet };
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from "react";
2
+ export interface CollapsibleProps {
3
+ /** The button's content: the section's name. */
4
+ trigger: ReactNode;
5
+ /** What shows while the section is open. */
6
+ children: ReactNode;
7
+ /** Whether the section is open. Leave it out to let the section keep its own. */
8
+ open?: boolean | undefined;
9
+ /** Whether the section starts open, when it keeps its own state. */
10
+ defaultOpen?: boolean | undefined;
11
+ /** Called with the new state when the person opens or closes the section. */
12
+ onOpenChange?: ((open: boolean) => void) | undefined;
13
+ disabled?: boolean | undefined;
14
+ className?: string | undefined;
15
+ }
16
+ /**
17
+ * One section that opens and closes under a button: "Advanced options", "Show details". The button carries
18
+ * `aria-expanded`. For several in a stack, see Accordion.
19
+ */
20
+ export declare const Collapsible: ({ trigger, children, open, defaultOpen, onOpenChange, disabled, className, }: CollapsibleProps) => import("react").JSX.Element;
@@ -0,0 +1,97 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
4
+ import { ChevronDown } from "lucide-react";
5
+ import { cn } from "../../utils/cn.js";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ // src/components/Collapsible/Collapsible.tsx
8
+ /**
9
+ * One section that opens and closes under a button: "Advanced options", "Show details". The button carries
10
+ * `aria-expanded`. For several in a stack, see Accordion.
11
+ */
12
+ var Collapsible = (t0) => {
13
+ const $ = c(21);
14
+ const { trigger, children, open, defaultOpen: t1, onOpenChange, disabled: t2, className } = t0;
15
+ const defaultOpen = t1 === void 0 ? false : t1;
16
+ const disabled = t2 === void 0 ? false : t2;
17
+ let t3;
18
+ if ($[0] !== defaultOpen || $[1] !== open) {
19
+ t3 = open === void 0 ? { defaultOpen } : { open };
20
+ $[0] = defaultOpen;
21
+ $[1] = open;
22
+ $[2] = t3;
23
+ } else t3 = $[2];
24
+ let t4;
25
+ if ($[3] !== onOpenChange) {
26
+ t4 = (next) => {
27
+ onOpenChange?.(next);
28
+ };
29
+ $[3] = onOpenChange;
30
+ $[4] = t4;
31
+ } else t4 = $[4];
32
+ let t5;
33
+ if ($[5] !== className) {
34
+ t5 = cn("w-full", className);
35
+ $[5] = className;
36
+ $[6] = t5;
37
+ } else t5 = $[6];
38
+ let t6;
39
+ let t7;
40
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
41
+ t6 = cn("group/trigger inline-flex cursor-pointer items-center gap-2 rounded-sm border-0 bg-transparent p-0 text-start text-body-sm font-semibold text-fg outline-none", "hover:text-primary-text focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-page", "data-disabled:cursor-not-allowed data-disabled:text-fg-disabled");
42
+ t7 = /* @__PURE__ */ jsx(ChevronDown, {
43
+ "aria-hidden": "true",
44
+ className: "size-4 shrink-0 text-fg-secondary transition-transform duration-200 ease-standard -rotate-90 group-data-panel-open/trigger:rotate-0 rtl:rotate-90 rtl:group-data-panel-open/trigger:rotate-0 motion-reduce:transition-none"
45
+ });
46
+ $[7] = t6;
47
+ $[8] = t7;
48
+ } else {
49
+ t6 = $[7];
50
+ t7 = $[8];
51
+ }
52
+ let t8;
53
+ if ($[9] !== trigger) {
54
+ t8 = /* @__PURE__ */ jsxs(Collapsible$1.Trigger, {
55
+ className: t6,
56
+ children: [t7, trigger]
57
+ });
58
+ $[9] = trigger;
59
+ $[10] = t8;
60
+ } else t8 = $[10];
61
+ let t9;
62
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
63
+ t9 = cn("h-(--collapsible-panel-height) overflow-hidden text-body-sm text-fg-body transition-[height] duration-200 ease-standard motion-reduce:transition-none", "data-ending-style:h-0 data-starting-style:h-0");
64
+ $[11] = t9;
65
+ } else t9 = $[11];
66
+ let t10;
67
+ if ($[12] !== children) {
68
+ t10 = /* @__PURE__ */ jsx(Collapsible$1.Panel, {
69
+ className: t9,
70
+ children: /* @__PURE__ */ jsx("div", {
71
+ className: "pt-2",
72
+ children
73
+ })
74
+ });
75
+ $[12] = children;
76
+ $[13] = t10;
77
+ } else t10 = $[13];
78
+ let t11;
79
+ if ($[14] !== disabled || $[15] !== t10 || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 || $[19] !== t8) {
80
+ t11 = /* @__PURE__ */ jsxs(Collapsible$1.Root, {
81
+ ...t3,
82
+ onOpenChange: t4,
83
+ disabled,
84
+ className: t5,
85
+ children: [t8, t10]
86
+ });
87
+ $[14] = disabled;
88
+ $[15] = t10;
89
+ $[16] = t3;
90
+ $[17] = t4;
91
+ $[18] = t5;
92
+ $[19] = t8;
93
+ $[20] = t11;
94
+ } else t11 = $[20];
95
+ return t11;
96
+ };
97
+ export { Collapsible };