@majapisoftwares/ui 4.3.17 → 6.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 (517) hide show
  1. package/AGENTS.md +27 -0
  2. package/README.md +79 -0
  3. package/THIRD_PARTY_NOTICES.md +39 -0
  4. package/components.json +25 -0
  5. package/docs/MIGRATION-0.2.md +20 -0
  6. package/docs/MIGRATION-6.0.md +33 -0
  7. package/docs/NEXT-STARTER-VALIDATION.md +14 -0
  8. package/docs/STANDARDS.md +41 -0
  9. package/docs/VALIDATION.md +11 -0
  10. package/docs/VERSIONING.md +28 -0
  11. package/package.json +78 -2
  12. package/scripts/check-standards.mjs +41 -0
  13. package/src/components/ui/accordion.tsx +82 -0
  14. package/src/components/ui/alert-dialog.tsx +187 -0
  15. package/src/components/ui/alert.tsx +77 -0
  16. package/src/components/ui/avatar.tsx +108 -0
  17. package/src/components/ui/badge.tsx +55 -0
  18. package/src/components/ui/breadcrumb.tsx +125 -0
  19. package/src/components/ui/button-group.tsx +89 -0
  20. package/src/components/ui/button.tsx +59 -0
  21. package/src/components/ui/card.tsx +101 -0
  22. package/src/components/ui/checkbox.tsx +27 -0
  23. package/src/components/ui/collapsible.tsx +21 -0
  24. package/src/components/ui/context-menu.tsx +271 -0
  25. package/src/components/ui/dialog.tsx +161 -0
  26. package/src/components/ui/dropdown-menu.tsx +271 -0
  27. package/src/components/ui/empty.tsx +105 -0
  28. package/src/components/ui/field.tsx +238 -0
  29. package/src/components/ui/hover-card.tsx +50 -0
  30. package/src/components/ui/input-group.tsx +155 -0
  31. package/src/components/ui/input.tsx +21 -0
  32. package/src/components/ui/kbd.tsx +28 -0
  33. package/src/components/ui/label.tsx +19 -0
  34. package/src/components/ui/orb.css +1002 -0
  35. package/src/components/ui/orb.tsx +752 -0
  36. package/src/components/ui/popover.tsx +89 -0
  37. package/src/components/ui/progress.tsx +82 -0
  38. package/src/components/ui/radio-group.tsx +37 -0
  39. package/src/components/ui/scroll-area.tsx +54 -0
  40. package/src/components/ui/select.tsx +204 -0
  41. package/src/components/ui/separator.tsx +24 -0
  42. package/src/components/ui/sheet.tsx +139 -0
  43. package/src/components/ui/sidebar.tsx +1035 -0
  44. package/src/components/ui/skeleton.tsx +15 -0
  45. package/src/components/ui/slider.tsx +53 -0
  46. package/src/components/ui/sonner.tsx +44 -0
  47. package/src/components/ui/spinner.tsx +32 -0
  48. package/src/components/ui/switch.tsx +31 -0
  49. package/src/components/ui/table.tsx +121 -0
  50. package/src/components/ui/tabs.tsx +81 -0
  51. package/src/components/ui/textarea.tsx +19 -0
  52. package/src/components/ui/toggle-group.tsx +89 -0
  53. package/src/components/ui/toggle.tsx +44 -0
  54. package/src/components/ui/tooltip.tsx +65 -0
  55. package/src/hooks/use-mobile.ts +20 -0
  56. package/src/lib/i18n.tsx +109 -0
  57. package/src/lib/utils.ts +1 -0
  58. package/src/patterns/app-shell.tsx +175 -0
  59. package/src/patterns/data-table.tsx +2486 -0
  60. package/src/patterns/details-sheet.tsx +53 -0
  61. package/src/patterns/filter-tabs.tsx +53 -0
  62. package/src/patterns/majapi-logo.tsx +32 -0
  63. package/src/patterns/page-header.tsx +62 -0
  64. package/src/patterns/preferences.tsx +172 -0
  65. package/src/patterns/status-badge.tsx +24 -0
  66. package/src/styles.css +165 -0
  67. package/src/templates/admin-dashboard.tsx +44 -0
  68. package/src/templates/auth-layout.tsx +30 -0
  69. package/src/templates/login-form.tsx +129 -0
  70. package/src/templates/signup-form.tsx +177 -0
  71. package/base.css +0 -360
  72. package/bootstrap/AppProps.d.ts +0 -9
  73. package/bootstrap/AppProps.js +0 -1
  74. package/bootstrap/index.d.ts +0 -1
  75. package/bootstrap/index.js +0 -1
  76. package/bootstrap/modeScript.d.ts +0 -2
  77. package/bootstrap/modeScript.js +0 -35
  78. package/bootstrap/nprogress.d.ts +0 -1
  79. package/bootstrap/nprogress.js +0 -19
  80. package/bootstrap/scrolledScript.d.ts +0 -2
  81. package/bootstrap/scrolledScript.js +0 -27
  82. package/bootstrap/setupFocusManager.d.ts +0 -1
  83. package/bootstrap/setupFocusManager.js +0 -13
  84. package/bootstrap/suppressConsoleLog.d.ts +0 -1
  85. package/bootstrap/suppressConsoleLog.js +0 -8
  86. package/components/Accordion/Accordion.d.ts +0 -16
  87. package/components/Accordion/Accordion.jsx +0 -27
  88. package/components/Accordion/index.d.ts +0 -3
  89. package/components/Accordion/index.jsx +0 -3
  90. package/components/Alert/Alert.d.ts +0 -31
  91. package/components/Alert/Alert.jsx +0 -53
  92. package/components/Alert/index.d.ts +0 -3
  93. package/components/Alert/index.jsx +0 -3
  94. package/components/AntiClickjacking/AntiClickjacking.d.ts +0 -1
  95. package/components/AntiClickjacking/AntiClickjacking.jsx +0 -17
  96. package/components/AntiClickjacking/index.d.ts +0 -2
  97. package/components/AntiClickjacking/index.jsx +0 -2
  98. package/components/Aurora/Aurora.d.ts +0 -10
  99. package/components/Aurora/Aurora.jsx +0 -189
  100. package/components/Aurora/index.d.ts +0 -3
  101. package/components/Aurora/index.jsx +0 -3
  102. package/components/Autocomplete/Autocomplete.d.ts +0 -7
  103. package/components/Autocomplete/Autocomplete.jsx +0 -23
  104. package/components/Autocomplete/UnstyledAutocomplete.d.ts +0 -36
  105. package/components/Autocomplete/UnstyledAutocomplete.jsx +0 -72
  106. package/components/Autocomplete/index.d.ts +0 -5
  107. package/components/Autocomplete/index.jsx +0 -5
  108. package/components/BackgroundEffects/BottomBlurryPoint.d.ts +0 -3
  109. package/components/BackgroundEffects/BottomBlurryPoint.jsx +0 -14
  110. package/components/BackgroundEffects/TopBlurryPoint.d.ts +0 -3
  111. package/components/BackgroundEffects/TopBlurryPoint.jsx +0 -14
  112. package/components/Badge/Badge.d.ts +0 -42
  113. package/components/Badge/Badge.jsx +0 -51
  114. package/components/Badge/index.d.ts +0 -3
  115. package/components/Badge/index.jsx +0 -3
  116. package/components/Breadcrumbs/Breadcrumbs.d.ts +0 -20
  117. package/components/Breadcrumbs/Breadcrumbs.jsx +0 -42
  118. package/components/Breadcrumbs/index.d.ts +0 -3
  119. package/components/Breadcrumbs/index.jsx +0 -3
  120. package/components/Button/Button.d.ts +0 -111
  121. package/components/Button/Button.jsx +0 -129
  122. package/components/Button/UnstyledButton.d.ts +0 -10
  123. package/components/Button/UnstyledButton.jsx +0 -13
  124. package/components/Button/index.d.ts +0 -3
  125. package/components/Button/index.jsx +0 -3
  126. package/components/Carousel/Carousel.d.ts +0 -19
  127. package/components/Carousel/Carousel.jsx +0 -55
  128. package/components/Carousel/index.d.ts +0 -3
  129. package/components/Carousel/index.jsx +0 -3
  130. package/components/Checkbox/Checkbox.d.ts +0 -14
  131. package/components/Checkbox/Checkbox.jsx +0 -45
  132. package/components/Checkbox/index.d.ts +0 -3
  133. package/components/Checkbox/index.js +0 -3
  134. package/components/Code/Code.d.ts +0 -12
  135. package/components/Code/Code.jsx +0 -25
  136. package/components/Code/Json.d.ts +0 -5
  137. package/components/Code/Json.jsx +0 -7
  138. package/components/Code/index.d.ts +0 -4
  139. package/components/Code/index.jsx +0 -4
  140. package/components/ConfirmationButton/ConfirmationButton.d.ts +0 -17
  141. package/components/ConfirmationButton/ConfirmationButton.jsx +0 -13
  142. package/components/ConfirmationButton/index.d.ts +0 -3
  143. package/components/ConfirmationButton/index.jsx +0 -3
  144. package/components/ContextMenu/ContextMenu.d.ts +0 -28
  145. package/components/ContextMenu/ContextMenu.jsx +0 -70
  146. package/components/ContextMenu/index.d.ts +0 -3
  147. package/components/ContextMenu/index.jsx +0 -3
  148. package/components/CopyButton/CopyButton.d.ts +0 -7
  149. package/components/CopyButton/CopyButton.jsx +0 -29
  150. package/components/CopyButton/index.d.ts +0 -3
  151. package/components/CopyButton/index.jsx +0 -3
  152. package/components/DateInput/DateInput.d.ts +0 -6
  153. package/components/DateInput/DateInput.jsx +0 -19
  154. package/components/DateInput/DateTimeInput.d.ts +0 -3
  155. package/components/DateInput/DateTimeInput.jsx +0 -8
  156. package/components/DateInput/index.d.ts +0 -4
  157. package/components/DateInput/index.jsx +0 -4
  158. package/components/DateInput/useRefValue.d.ts +0 -5
  159. package/components/DateInput/useRefValue.js +0 -48
  160. package/components/DatePicker/DatePicker.d.ts +0 -19
  161. package/components/DatePicker/DatePicker.jsx +0 -55
  162. package/components/DatePicker/index.d.ts +0 -3
  163. package/components/DatePicker/index.jsx +0 -3
  164. package/components/DateRangePicker/DateRangePicker.d.ts +0 -16
  165. package/components/DateRangePicker/DateRangePicker.jsx +0 -56
  166. package/components/DateRangePicker/index.d.ts +0 -3
  167. package/components/DateRangePicker/index.jsx +0 -3
  168. package/components/Dialog/Dialog.d.ts +0 -25
  169. package/components/Dialog/Dialog.jsx +0 -35
  170. package/components/Dialog/Dialogs.d.ts +0 -1
  171. package/components/Dialog/Dialogs.jsx +0 -21
  172. package/components/Dialog/dialogs.state.d.ts +0 -21
  173. package/components/Dialog/dialogs.state.js +0 -40
  174. package/components/Dialog/index.d.ts +0 -6
  175. package/components/Dialog/index.jsx +0 -7
  176. package/components/Drawer/Drawer.d.ts +0 -15
  177. package/components/Drawer/Drawer.jsx +0 -72
  178. package/components/Drawer/index.d.ts +0 -3
  179. package/components/Drawer/index.jsx +0 -3
  180. package/components/DropdownMenu/DropdownMenu.d.ts +0 -33
  181. package/components/DropdownMenu/DropdownMenu.jsx +0 -74
  182. package/components/DropdownMenu/index.d.ts +0 -3
  183. package/components/DropdownMenu/index.jsx +0 -3
  184. package/components/ErrorBoundary/ErrorBoundary.d.ts +0 -18
  185. package/components/ErrorBoundary/ErrorBoundary.jsx +0 -32
  186. package/components/ErrorBoundary/index.d.ts +0 -3
  187. package/components/ErrorBoundary/index.jsx +0 -3
  188. package/components/ErrorPage/Error404Page.d.ts +0 -1
  189. package/components/ErrorPage/Error404Page.jsx +0 -4
  190. package/components/ErrorPage/Error500Page.d.ts +0 -1
  191. package/components/ErrorPage/Error500Page.jsx +0 -4
  192. package/components/ErrorPage/ErrorPage.d.ts +0 -11
  193. package/components/ErrorPage/ErrorPage.jsx +0 -23
  194. package/components/FileInput/FileInput.d.ts +0 -53
  195. package/components/FileInput/FileInput.jsx +0 -141
  196. package/components/FileInput/PreviewFile.d.ts +0 -18
  197. package/components/FileInput/PreviewFile.jsx +0 -54
  198. package/components/FileInput/index.d.ts +0 -3
  199. package/components/FileInput/index.jsx +0 -3
  200. package/components/FileInput/isImage.d.ts +0 -1
  201. package/components/FileInput/isImage.js +0 -10
  202. package/components/FileInput/isVideo.d.ts +0 -1
  203. package/components/FileInput/isVideo.js +0 -10
  204. package/components/FileSelect/FileSelect.d.ts +0 -31
  205. package/components/FileSelect/FileSelect.jsx +0 -146
  206. package/components/FileSelect/index.d.ts +0 -3
  207. package/components/FileSelect/index.jsx +0 -3
  208. package/components/Footer/Footer.d.ts +0 -19
  209. package/components/Footer/Footer.jsx +0 -30
  210. package/components/Footer/index.d.ts +0 -3
  211. package/components/Footer/index.jsx +0 -3
  212. package/components/GridPattern/GridPattern.d.ts +0 -2
  213. package/components/GridPattern/GridPattern.jsx +0 -12
  214. package/components/GridPattern/index.d.ts +0 -3
  215. package/components/GridPattern/index.jsx +0 -3
  216. package/components/Group/Group.d.ts +0 -5
  217. package/components/Group/Group.jsx +0 -6
  218. package/components/Group/index.d.ts +0 -3
  219. package/components/Group/index.jsx +0 -3
  220. package/components/Header/Header.d.ts +0 -5
  221. package/components/Header/Header.jsx +0 -19
  222. package/components/Header/index.d.ts +0 -3
  223. package/components/Header/index.jsx +0 -3
  224. package/components/ImageInput/ImageInput.d.ts +0 -4
  225. package/components/ImageInput/ImageInput.jsx +0 -8
  226. package/components/ImageInput/index.d.ts +0 -3
  227. package/components/ImageInput/index.jsx +0 -3
  228. package/components/Input/Input.d.ts +0 -14
  229. package/components/Input/Input.jsx +0 -57
  230. package/components/Input/InputIcon.d.ts +0 -9
  231. package/components/Input/InputIcon.jsx +0 -7
  232. package/components/Input/MultiSelectInput.d.ts +0 -16
  233. package/components/Input/MultiSelectInput.jsx +0 -48
  234. package/components/Input/NumericInput.d.ts +0 -6
  235. package/components/Input/NumericInput.jsx +0 -6
  236. package/components/Input/PatternInput.d.ts +0 -6
  237. package/components/Input/PatternInput.jsx +0 -6
  238. package/components/Input/SelectInput.d.ts +0 -12
  239. package/components/Input/SelectInput.jsx +0 -25
  240. package/components/Input/UnstyledInput.d.ts +0 -22
  241. package/components/Input/UnstyledInput.jsx +0 -28
  242. package/components/Input/index.d.ts +0 -6
  243. package/components/Input/index.jsx +0 -6
  244. package/components/Input/useInputRefValue.d.ts +0 -11
  245. package/components/Input/useInputRefValue.jsx +0 -51
  246. package/components/Input2/InputWrapper.d.ts +0 -11
  247. package/components/Input2/InputWrapper.jsx +0 -11
  248. package/components/Link/Link.d.ts +0 -3
  249. package/components/Link/Link.jsx +0 -9
  250. package/components/Link/index.d.ts +0 -3
  251. package/components/Link/index.jsx +0 -3
  252. package/components/Loading/Loading.d.ts +0 -5
  253. package/components/Loading/Loading.jsx +0 -15
  254. package/components/Loading/index.d.ts +0 -3
  255. package/components/Loading/index.jsx +0 -3
  256. package/components/Magnet/Magnet.d.ts +0 -13
  257. package/components/Magnet/Magnet.jsx +0 -50
  258. package/components/Magnet/index.d.ts +0 -3
  259. package/components/Magnet/index.jsx +0 -3
  260. package/components/Markdown/Markdown.d.ts +0 -8
  261. package/components/Markdown/Markdown.jsx +0 -11
  262. package/components/Markdown/index.d.ts +0 -3
  263. package/components/Markdown/index.jsx +0 -3
  264. package/components/Menu/Menu.d.ts +0 -28
  265. package/components/Menu/Menu.jsx +0 -54
  266. package/components/Modal/Modal.d.ts +0 -45
  267. package/components/Modal/Modal.jsx +0 -65
  268. package/components/Modal/index.d.ts +0 -4
  269. package/components/Modal/index.jsx +0 -4
  270. package/components/Modal/useModalState.d.ts +0 -6
  271. package/components/Modal/useModalState.js +0 -16
  272. package/components/ModeToggle/ModeToggle.d.ts +0 -9
  273. package/components/ModeToggle/ModeToggle.jsx +0 -12
  274. package/components/ModeToggle/index.d.ts +0 -4
  275. package/components/ModeToggle/index.jsx +0 -5
  276. package/components/ModeToggle/useModeToggle.d.ts +0 -1
  277. package/components/ModeToggle/useModeToggle.js +0 -21
  278. package/components/MultiSelect/MultiSelect.d.ts +0 -28
  279. package/components/MultiSelect/MultiSelect.jsx +0 -116
  280. package/components/MultiSelect/MultiSelectInput.d.ts +0 -12
  281. package/components/MultiSelect/MultiSelectInput.jsx +0 -27
  282. package/components/MultiSelect/index.d.ts +0 -5
  283. package/components/MultiSelect/index.jsx +0 -5
  284. package/components/MultiText/MultiText.d.ts +0 -23
  285. package/components/MultiText/MultiText.jsx +0 -118
  286. package/components/MultiText/index.d.ts +0 -3
  287. package/components/MultiText/index.jsx +0 -3
  288. package/components/NavigationDrawer/NavigationDrawer.d.ts +0 -9
  289. package/components/NavigationDrawer/NavigationDrawer.jsx +0 -29
  290. package/components/NavigationDrawer/NavigationItem.d.ts +0 -13
  291. package/components/NavigationDrawer/NavigationItem.jsx +0 -24
  292. package/components/NavigationDrawer/index.d.ts +0 -6
  293. package/components/NavigationDrawer/index.jsx +0 -6
  294. package/components/NavigationDrawer/navigationDrawer.state.d.ts +0 -9
  295. package/components/NavigationDrawer/navigationDrawer.state.js +0 -19
  296. package/components/NoSsr/NoSsr.d.ts +0 -4
  297. package/components/NoSsr/NoSsr.jsx +0 -8
  298. package/components/NoSsr/index.d.ts +0 -3
  299. package/components/NoSsr/index.jsx +0 -3
  300. package/components/Noise/Noise.d.ts +0 -11
  301. package/components/Noise/Noise.jsx +0 -69
  302. package/components/Noise/index.d.ts +0 -3
  303. package/components/Noise/index.jsx +0 -3
  304. package/components/Notifications/Notifications.d.ts +0 -3
  305. package/components/Notifications/Notifications.jsx +0 -60
  306. package/components/Notifications/index.d.ts +0 -5
  307. package/components/Notifications/index.jsx +0 -6
  308. package/components/Notifications/notifications.state.d.ts +0 -24
  309. package/components/Notifications/notifications.state.js +0 -41
  310. package/components/Orb/Orb.d.ts +0 -8
  311. package/components/Orb/Orb.jsx +0 -258
  312. package/components/Orb/index.d.ts +0 -3
  313. package/components/Orb/index.jsx +0 -3
  314. package/components/Pagination/Pagination.d.ts +0 -13
  315. package/components/Pagination/Pagination.jsx +0 -64
  316. package/components/Pagination/index.d.ts +0 -3
  317. package/components/Pagination/index.jsx +0 -3
  318. package/components/Particles/Particles.d.ts +0 -18
  319. package/components/Particles/Particles.jsx +0 -205
  320. package/components/Particles/index.d.ts +0 -3
  321. package/components/Particles/index.jsx +0 -3
  322. package/components/PictureCropInput/PictureCropInput.d.ts +0 -20
  323. package/components/PictureCropInput/PictureCropInput.jsx +0 -174
  324. package/components/PictureCropInput/canvasPreview.d.ts +0 -2
  325. package/components/PictureCropInput/canvasPreview.js +0 -37
  326. package/components/PictureCropInput/index.d.ts +0 -3
  327. package/components/PictureCropInput/index.js +0 -3
  328. package/components/Popover/Popover.d.ts +0 -13
  329. package/components/Popover/Popover.jsx +0 -22
  330. package/components/Popover/index.d.ts +0 -3
  331. package/components/Popover/index.jsx +0 -3
  332. package/components/Resizable/Resizable.d.ts +0 -12
  333. package/components/Resizable/Resizable.jsx +0 -54
  334. package/components/Resizable/index.d.ts +0 -3
  335. package/components/Resizable/index.jsx +0 -3
  336. package/components/ScrollArea/ScrollArea.d.ts +0 -9
  337. package/components/ScrollArea/ScrollArea.jsx +0 -16
  338. package/components/ScrollArea/index.d.ts +0 -3
  339. package/components/ScrollArea/index.jsx +0 -3
  340. package/components/Select/Select.d.ts +0 -25
  341. package/components/Select/Select.jsx +0 -55
  342. package/components/Select/index.d.ts +0 -3
  343. package/components/Select/index.jsx +0 -3
  344. package/components/Skeleton/Skeleton.d.ts +0 -2
  345. package/components/Skeleton/Skeleton.jsx +0 -8
  346. package/components/Skeleton/index.d.ts +0 -3
  347. package/components/Skeleton/index.jsx +0 -3
  348. package/components/Slider/Slider.d.ts +0 -10
  349. package/components/Slider/Slider.jsx +0 -21
  350. package/components/Slider/index.d.ts +0 -3
  351. package/components/Slider/index.jsx +0 -3
  352. package/components/Spotlight/Spotlight.d.ts +0 -30
  353. package/components/Spotlight/Spotlight.jsx +0 -86
  354. package/components/Spotlight/index.d.ts +0 -3
  355. package/components/Spotlight/index.jsx +0 -3
  356. package/components/SpotlightCard/SpotlightCard.d.ts +0 -7
  357. package/components/SpotlightCard/SpotlightCard.jsx +0 -35
  358. package/components/SpotlightCard/index.d.ts +0 -3
  359. package/components/SpotlightCard/index.jsx +0 -3
  360. package/components/Stack/Stack.d.ts +0 -4
  361. package/components/Stack/Stack.jsx +0 -5
  362. package/components/Stack/index.d.ts +0 -3
  363. package/components/Stack/index.jsx +0 -3
  364. package/components/StarBorder/StarBorder.d.ts +0 -10
  365. package/components/StarBorder/StarBorder.jsx +0 -19
  366. package/components/StarBorder/index.d.ts +0 -3
  367. package/components/StarBorder/index.jsx +0 -3
  368. package/components/Switch/Switch.d.ts +0 -16
  369. package/components/Switch/Switch.jsx +0 -24
  370. package/components/Switch/index.d.ts +0 -3
  371. package/components/Switch/index.jsx +0 -3
  372. package/components/Table/DataTable.d.ts +0 -57
  373. package/components/Table/DataTable.jsx +0 -155
  374. package/components/Table/Table.d.ts +0 -27
  375. package/components/Table/Table.jsx +0 -31
  376. package/components/Table/TableActionButton.d.ts +0 -6
  377. package/components/Table/TableActionButton.jsx +0 -20
  378. package/components/Table/TableBody.d.ts +0 -6
  379. package/components/Table/TableBody.jsx +0 -10
  380. package/components/Table/TableCell.d.ts +0 -9
  381. package/components/Table/TableCell.jsx +0 -18
  382. package/components/Table/TableFooter.d.ts +0 -5
  383. package/components/Table/TableFooter.jsx +0 -5
  384. package/components/Table/TableFooterWithPagination.d.ts +0 -13
  385. package/components/Table/TableFooterWithPagination.jsx +0 -57
  386. package/components/Table/TableHead.d.ts +0 -5
  387. package/components/Table/TableHead.jsx +0 -9
  388. package/components/Table/TableHeadContext.d.ts +0 -4
  389. package/components/Table/TableHeadContext.jsx +0 -3
  390. package/components/Table/TableHeader.d.ts +0 -7
  391. package/components/Table/TableHeader.jsx +0 -15
  392. package/components/Table/TableRow.d.ts +0 -8
  393. package/components/Table/TableRow.jsx +0 -9
  394. package/components/Table/index.d.ts +0 -3
  395. package/components/Table/index.jsx +0 -3
  396. package/components/Tabs/Tabs.d.ts +0 -9
  397. package/components/Tabs/Tabs.jsx +0 -13
  398. package/components/Tabs/index.d.ts +0 -3
  399. package/components/Tabs/index.jsx +0 -3
  400. package/components/TabsSwitcher/Tab.d.ts +0 -15
  401. package/components/TabsSwitcher/Tab.jsx +0 -18
  402. package/components/TabsSwitcher/TabsSwitcher.d.ts +0 -22
  403. package/components/TabsSwitcher/TabsSwitcher.jsx +0 -31
  404. package/components/TabsSwitcher/index.d.ts +0 -4
  405. package/components/TabsSwitcher/index.jsx +0 -4
  406. package/components/Text/Text.d.ts +0 -24
  407. package/components/Text/Text.jsx +0 -29
  408. package/components/Text/index.d.ts +0 -3
  409. package/components/Text/index.jsx +0 -3
  410. package/components/Textarea/Textarea.d.ts +0 -5
  411. package/components/Textarea/Textarea.jsx +0 -6
  412. package/components/Textarea/index.d.ts +0 -3
  413. package/components/Textarea/index.js +0 -3
  414. package/components/Threads/Threads.d.ts +0 -9
  415. package/components/Threads/Threads.jsx +0 -203
  416. package/components/Threads/index.d.ts +0 -3
  417. package/components/Threads/index.jsx +0 -3
  418. package/components/Tooltip/Tooltip.d.ts +0 -11
  419. package/components/Tooltip/Tooltip.jsx +0 -21
  420. package/components/Tooltip/index.d.ts +0 -3
  421. package/components/Tooltip/index.jsx +0 -3
  422. package/components/VisibilityActivatedButton/VisibilityActivatedButton.d.ts +0 -7
  423. package/components/VisibilityActivatedButton/VisibilityActivatedButton.jsx +0 -18
  424. package/components/VisibilityActivatedButton/index.d.ts +0 -3
  425. package/components/VisibilityActivatedButton/index.jsx +0 -3
  426. package/form.d.ts +0 -82
  427. package/form.js +0 -113
  428. package/form2.d.ts +0 -15
  429. package/form2.jsx +0 -30
  430. package/hooks/useBeforeUnload.d.ts +0 -1
  431. package/hooks/useBeforeUnload.js +0 -17
  432. package/hooks/useDebounceEffect.d.ts +0 -2
  433. package/hooks/useDebounceEffect.js +0 -14
  434. package/hooks/useDebouncedValue.d.ts +0 -2
  435. package/hooks/useDebouncedValue.js +0 -14
  436. package/hooks/useLagRadar.d.ts +0 -1
  437. package/hooks/useLagRadar.jsx +0 -124
  438. package/hooks/useMediaQuery.d.ts +0 -1
  439. package/hooks/useMediaQuery.js +0 -37
  440. package/hooks/useMutationWindowCloseProtection.d.ts +0 -2
  441. package/hooks/useMutationWindowCloseProtection.js +0 -13
  442. package/hooks/useScroll.d.ts +0 -3
  443. package/hooks/useScroll.js +0 -47
  444. package/hooks/useTranslation.d.ts +0 -4
  445. package/hooks/useTranslation.js +0 -11
  446. package/hooks/useWhyDidYouUpdate.d.ts +0 -3
  447. package/hooks/useWhyDidYouUpdate.js +0 -44
  448. package/imgur.d.ts +0 -1
  449. package/imgur.js +0 -13
  450. package/styles/DayPicker.classNames.d.ts +0 -29
  451. package/styles/DayPicker.classNames.js +0 -30
  452. package/styles/DayPicker.classNames.ts +0 -81
  453. package/styles/Dropdown.classNames.d.ts +0 -6
  454. package/styles/Dropdown.classNames.js +0 -7
  455. package/styles/Dropdown.classNames.ts +0 -38
  456. package/styles/Input.css +0 -23
  457. package/styles/Modal.classNames.d.ts +0 -2
  458. package/styles/Modal.classNames.js +0 -3
  459. package/styles/Modal.classNames.ts +0 -15
  460. package/styles/MultiText.css +0 -40
  461. package/styles/Pagination.css +0 -19
  462. package/styles/Tabs.css +0 -23
  463. package/tsconfig.tsbuildinfo +0 -1
  464. package/types.d.ts +0 -6
  465. package/types.js +0 -1
  466. package/utils/UseState.d.ts +0 -2
  467. package/utils/UseState.js +0 -1
  468. package/utils/blobToText.d.ts +0 -1
  469. package/utils/blobToText.js +0 -13
  470. package/utils/capitalize.d.ts +0 -1
  471. package/utils/capitalize.js +0 -6
  472. package/utils/clsx.d.ts +0 -2
  473. package/utils/clsx.js +0 -5
  474. package/utils/copy2DToClipboard.d.ts +0 -1
  475. package/utils/copy2DToClipboard.js +0 -44
  476. package/utils/cpfCpnjUtils.d.ts +0 -3
  477. package/utils/cpfCpnjUtils.js +0 -43
  478. package/utils/createLocalStorageStateHydration.d.ts +0 -1
  479. package/utils/createLocalStorageStateHydration.js +0 -18
  480. package/utils/createStateHydration.d.ts +0 -3
  481. package/utils/createStateHydration.js +0 -49
  482. package/utils/csvBlobToJson.d.ts +0 -2
  483. package/utils/csvBlobToJson.js +0 -59
  484. package/utils/downloadArrayAsCSV.d.ts +0 -1
  485. package/utils/downloadArrayAsCSV.js +0 -34
  486. package/utils/emailRegExp.d.ts +0 -2
  487. package/utils/emailRegExp.js +0 -2
  488. package/utils/fakeArray.d.ts +0 -1
  489. package/utils/fakeArray.js +0 -3
  490. package/utils/filterBoolean.d.ts +0 -1
  491. package/utils/filterBoolean.js +0 -3
  492. package/utils/formatClock.d.ts +0 -1
  493. package/utils/formatClock.js +0 -21
  494. package/utils/getInitials.d.ts +0 -4
  495. package/utils/getInitials.js +0 -22
  496. package/utils/isBrowser.d.ts +0 -12
  497. package/utils/isBrowser.js +0 -26
  498. package/utils/ms.d.ts +0 -6
  499. package/utils/ms.js +0 -31
  500. package/utils/preventDefault.d.ts +0 -2
  501. package/utils/preventDefault.js +0 -3
  502. package/utils/recursiveChildrenMap.d.ts +0 -2
  503. package/utils/recursiveChildrenMap.js +0 -16
  504. package/utils/setSelectionRange.d.ts +0 -1
  505. package/utils/setSelectionRange.js +0 -55
  506. package/utils/smoothScrollToHref.d.ts +0 -2
  507. package/utils/smoothScrollToHref.js +0 -14
  508. package/utils/stopPropagation.d.ts +0 -2
  509. package/utils/stopPropagation.js +0 -3
  510. package/utils/stripHtml.d.ts +0 -1
  511. package/utils/stripHtml.js +0 -4
  512. package/utils/stripLineBreak.d.ts +0 -1
  513. package/utils/stripLineBreak.js +0 -4
  514. package/utils/stripMarkdown.d.ts +0 -1
  515. package/utils/stripMarkdown.js +0 -28
  516. package/utils/xlsxBlobToJson.d.ts +0 -2
  517. package/utils/xlsxBlobToJson.js +0 -62
@@ -1,57 +0,0 @@
1
- import UnstyledInput, {} from "../Input/UnstyledInput";
2
- import { defaultTextStyles } from "../Text";
3
- import { ExclamationCircleIcon } from "@heroicons/react/20/solid";
4
- import InputIcon from "./InputIcon";
5
- import { cloneElement, Fragment } from "react";
6
- import recursiveChildrenMap from "../../utils/recursiveChildrenMap";
7
- import clsx from "../../utils/clsx";
8
- export const defaultLabelClassName = `ui-input-label block ${defaultTextStyles.variant.label} mb-1`;
9
- export const defaultInputClassNameUncolored = "block w-full rounded-md shadow-xs sm:text-sm data-disabled:cursor-not-allowed dark:bg-zinc-800 dark:placeholder:text-zinc-500 px-2.5";
10
- export const defaultInputClassName = clsx("ui-input-input", defaultInputClassNameUncolored, "border-zinc-300 focus:border-primary-500 focus:ring-primary-500 data-disabled:border-zinc-200 data-disabled:bg-zinc-50", "dark:border-zinc-700 dark:focus:border-primary-500 dark:data-disabled:border-zinc-800 dark:data-disabled:bg-zinc-900/90 data-disabled:text-zinc-500");
11
- export const defaultHelpTextClassName = `mt-2 ${defaultTextStyles.variant.secondary}`;
12
- export const defaultTrailingClassName = "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2.5 text-zinc-500 text-sm";
13
- export const defaultLeadingClassName = "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2.5 text-zinc-500 text-sm";
14
- export const defaultLeadingInputClassName = "pl-10";
15
- export const defaultTrailingInputClassName = "pr-10";
16
- function Input({ error, trailing, labelClassName, inputClassName, helpTextClassName, trailingClassName, leadingClassName, leadingInputClassName, trailingInputClassName, required, label, loading, readOnly, children, disabled, helpText, ref, ...props }) {
17
- trailing =
18
- trailing ||
19
- (error ? (<InputIcon className="text-error-500">
20
- <ExclamationCircleIcon aria-hidden="true"/>
21
- </InputIcon>) : undefined);
22
- labelClassName = clsx(defaultLabelClassName, labelClassName);
23
- inputClassName = clsx(error ? defaultInputClassNameUncolored : defaultInputClassName, inputClassName, {
24
- "animate-pulse": loading,
25
- });
26
- helpTextClassName = clsx(defaultHelpTextClassName, helpTextClassName);
27
- trailingClassName = clsx(defaultTrailingClassName, trailingClassName);
28
- leadingClassName = clsx(defaultLeadingClassName, leadingClassName);
29
- leadingInputClassName = clsx(defaultLeadingInputClassName, leadingInputClassName);
30
- trailingInputClassName = clsx(defaultTrailingInputClassName, trailingInputClassName);
31
- if (typeof error === "string") {
32
- helpText = error;
33
- error = true;
34
- }
35
- if (error) {
36
- inputClassName = `${inputClassName} border-error-300 dark:border-error-500 text-error-900 dark:text-error-500 placeholder-error-300 focus:border-error-500 dark:focus:border-error-500 focus:ring-error-500`;
37
- helpTextClassName = `${helpTextClassName} text-error-600! dark:text-error-500!`;
38
- }
39
- if (readOnly) {
40
- inputClassName = `${inputClassName} border-dashed`;
41
- }
42
- if (label && required) {
43
- label = (<>
44
- {label} <span className="text-red-500">*</span>
45
- </>);
46
- }
47
- return (<UnstyledInput
48
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
- {...props} trailing={trailing} labelClassName={labelClassName} inputClassName={inputClassName} helpTextClassName={helpTextClassName} trailingClassName={trailingClassName} leadingClassName={leadingClassName} leadingInputClassName={leadingInputClassName} trailingInputClassName={trailingInputClassName} ref={ref} required={required} label={label} readOnly={readOnly} disabled={disabled} data-disabled={disabled || undefined} helpText={helpText}>
50
- {recursiveChildrenMap(children, (child) => cloneElement(child, child.type !== Fragment
51
- ? {
52
- disabled: readOnly || disabled || child.props.disabled,
53
- }
54
- : undefined))}
55
- </UnstyledInput>);
56
- }
57
- export default Input;
@@ -1,9 +0,0 @@
1
- import { type ReactElement } from "react";
2
- export default function InputIcon({ className, children, }: {
3
- className?: string;
4
- children: ReactElement<{
5
- className?: string;
6
- }>;
7
- }): ReactElement<{
8
- className?: string;
9
- }, string | import("react").JSXElementConstructor<any>>;
@@ -1,7 +0,0 @@
1
- import { cloneElement } from "react";
2
- import clsx from "../../utils/clsx";
3
- export default function InputIcon({ className, children, }) {
4
- return cloneElement(children, {
5
- className: clsx("h-5 w-5", className),
6
- });
7
- }
@@ -1,16 +0,0 @@
1
- import type { ComponentProps } from "react";
2
- import { type InputProps } from "./Input";
3
- declare function MultiSelectInput({ options, value, onChange, emptyLabel, ref, badgeClassName, name, onValueChange, inputClassName, emptyClassName, noneLabel, ...props }: Omit<InputProps<undefined>, "value"> & {
4
- options: {
5
- value: string;
6
- name: string;
7
- }[];
8
- value?: string[];
9
- onValueChange?: (value: string[]) => void;
10
- emptyLabel?: string;
11
- badgeClassName?: string;
12
- emptyClassName?: string;
13
- noneLabel?: string;
14
- }): import("react").JSX.Element;
15
- export type MultiSelectInputProps = ComponentProps<typeof MultiSelectInput>;
16
- export default MultiSelectInput;
@@ -1,48 +0,0 @@
1
- import Input, {} from "./Input";
2
- import DropdownMenu from "../DropdownMenu";
3
- import Button from "../Button";
4
- import { ChevronDownIcon } from "@heroicons/react/16/solid";
5
- import { xor } from "lodash-es";
6
- import clsx from "../../utils/clsx";
7
- import Badge from "../Badge";
8
- import useInputRefValue from "./useInputRefValue";
9
- import { useDeepCompareEffect } from "react-use";
10
- function MultiSelectInput({ options, value, onChange, emptyLabel = "None", ref, badgeClassName, name, onValueChange, inputClassName, emptyClassName, noneLabel = "None", ...props }) {
11
- const { innerRef, innerValue, setInnerValue } = useInputRefValue({
12
- value,
13
- ref,
14
- name,
15
- onChange,
16
- });
17
- const isEmpty = !innerValue?.length;
18
- useDeepCompareEffect(() => {
19
- if (onValueChange) {
20
- onValueChange(innerValue || []);
21
- }
22
- }, [{ innerValue }]);
23
- emptyClassName = isEmpty
24
- ? clsx("text-zinc-500 dark:text-zinc-500", emptyClassName)
25
- : "p-1.5";
26
- return (<DropdownMenu.Root>
27
- <DropdownMenu.Trigger asChild>
28
- <Input as={Button} {...props} name={name} ref={innerRef} trailing={<ChevronDownIcon className="h-5 w-5 shrink-0"/>} inputClassName={clsx("text-left dark:hover:bg-zinc-700/70 bg-white gap-1.5 flex justify-start flex-wrap", emptyClassName, inputClassName)}>
29
- {isEmpty
30
- ? emptyLabel
31
- : options
32
- .filter((option) => innerValue.includes(option.value))
33
- .map((option, index) => (<Badge key={index} className={badgeClassName} onActionClick={() => setInnerValue(xor(innerValue, [option.value]))}>
34
- {option.name}
35
- </Badge>))}
36
- </Input>
37
- </DropdownMenu.Trigger>
38
- <DropdownMenu.Content>
39
- <DropdownMenu.Item onClick={() => setInnerValue([])}>
40
- {noneLabel}
41
- </DropdownMenu.Item>
42
- {options.map((option) => (<DropdownMenu.CheckboxItem key={option.name} checked={innerValue?.includes(option.value)} onClick={() => setInnerValue(xor(innerValue, [option.value]))}>
43
- {option.name}
44
- </DropdownMenu.CheckboxItem>))}
45
- </DropdownMenu.Content>
46
- </DropdownMenu.Root>);
47
- }
48
- export default MultiSelectInput;
@@ -1,6 +0,0 @@
1
- import type { ComponentProps } from "react";
2
- import { type InputProps } from "./Input";
3
- import { type NumericFormatProps } from "react-number-format";
4
- declare function NumericInput({ ref, ...props }: Omit<NumericFormatProps, "customInput"> & InputProps<undefined>): import("react").JSX.Element;
5
- export type NumericInputProps = ComponentProps<typeof NumericInput>;
6
- export default NumericInput;
@@ -1,6 +0,0 @@
1
- import Input, {} from "./Input";
2
- import { NumericFormat } from "react-number-format";
3
- function NumericInput({ ref, ...props }) {
4
- return <NumericFormat getInputRef={ref} customInput={Input} {...props}/>;
5
- }
6
- export default NumericInput;
@@ -1,6 +0,0 @@
1
- import type { ComponentProps } from "react";
2
- import { type InputProps } from "./Input";
3
- import { type PatternFormatProps } from "react-number-format";
4
- declare function PatternInput(props: Omit<PatternFormatProps, "customInput"> & InputProps<undefined>): import("react").JSX.Element;
5
- export type PatternInputProps = ComponentProps<typeof PatternInput>;
6
- export default PatternInput;
@@ -1,6 +0,0 @@
1
- import Input, {} from "./Input";
2
- import { PatternFormat } from "react-number-format";
3
- function PatternInput(props) {
4
- return <PatternFormat customInput={Input} {...props}/>;
5
- }
6
- export default PatternInput;
@@ -1,12 +0,0 @@
1
- import { type ComponentProps, type ReactNode } from "react";
2
- import { type InputProps } from "./index";
3
- declare function SelectInput({ options, onChange, ref, placeholder, inputClassName, value, name, ...props }: InputProps<false> & {
4
- options: {
5
- value: string;
6
- name: ReactNode;
7
- }[];
8
- children?: ReactNode;
9
- placeholder?: string;
10
- }): import("react").JSX.Element;
11
- export type SelectInputProps = ComponentProps<typeof SelectInput>;
12
- export default SelectInput;
@@ -1,25 +0,0 @@
1
- import {} from "react";
2
- import Input, {} from "./index";
3
- import Select from "../Select/Select";
4
- import clsx from "../../utils/clsx";
5
- import useInputRefValue from "./useInputRefValue";
6
- function SelectInput({ options, onChange, ref, placeholder, inputClassName, value, name, ...props }) {
7
- const { innerRef, innerValue, setInnerValue } = useInputRefValue({
8
- value,
9
- ref,
10
- name,
11
- onChange,
12
- });
13
- return (<Input as={Select.Root} {...props} ref={innerRef} {...{
14
- value: innerValue ?? "",
15
- onValueChange: setInnerValue,
16
- }}>
17
- <Select.Trigger placeholder={placeholder} buttonClassName={clsx("bg-white dark:hover:bg-zinc-700/70 dark:bg-zinc-800 w-full justify-between min-h-[38px]", inputClassName)}/>
18
- <Select.Content>
19
- {options?.map((option) => (<Select.Item key={option.value} value={option.value}>
20
- {option.name}
21
- </Select.Item>))}
22
- </Select.Content>
23
- </Input>);
24
- }
25
- export default SelectInput;
@@ -1,22 +0,0 @@
1
- import { type ComponentType, type DetailedHTMLProps, type InputHTMLAttributes, type ReactNode } from "react";
2
- export type UnstyledInputCommonProps = {
3
- label?: ReactNode;
4
- inputClassName?: string;
5
- labelClassName?: string;
6
- helpTextClassName?: string;
7
- trailingClassName?: string;
8
- trailingInputClassName?: string;
9
- leadingClassName?: string;
10
- leadingInputClassName?: string;
11
- helpText?: ReactNode;
12
- trailing?: ReactNode;
13
- leading?: ReactNode;
14
- as?: ComponentType;
15
- innerClassName?: string;
16
- error?: boolean | string;
17
- };
18
- export type UnstyledInputProps<Select extends boolean | undefined> = UnstyledInputCommonProps & {
19
- select?: Select;
20
- } & (Select extends string ? DetailedHTMLProps<InputHTMLAttributes<HTMLSelectElement>, HTMLSelectElement> : DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>);
21
- declare function UnstyledInput<Select extends boolean | undefined>({ id, label, className, inputClassName, labelClassName, helpTextClassName, trailingClassName, trailingInputClassName, leadingClassName, leadingInputClassName, helpText, type, leading, trailing, select, children, as, innerClassName, value, ...props }: UnstyledInputProps<Select>): import("react").JSX.Element;
22
- export default UnstyledInput;
@@ -1,28 +0,0 @@
1
- import { useId, } from "react";
2
- import clsx from "../../utils/clsx";
3
- function UnstyledInput({ id, label, className, inputClassName, labelClassName, helpTextClassName, trailingClassName, trailingInputClassName, leadingClassName, leadingInputClassName, helpText, type = "text", leading, trailing, select, children, as, innerClassName, value, ...props }) {
4
- const innerId = useId();
5
- id = id || innerId;
6
- const Component = as || (select ? "select" : "input");
7
- inputClassName = clsx(inputClassName, leadingInputClassName && {
8
- [leadingInputClassName]: !!leading,
9
- }, trailingInputClassName && {
10
- [trailingInputClassName]: !!trailing,
11
- });
12
- return (<div className={className}>
13
- {label && (<label htmlFor={id} className={labelClassName}>
14
- {label}
15
- </label>)}
16
- <div style={{ position: "relative" }} className={innerClassName}>
17
- {leading && <div className={leadingClassName}>{leading}</div>}
18
- <Component
19
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
20
- {...props} className={inputClassName} id={id} type={type} value={value}>
21
- {children}
22
- </Component>
23
- {trailing && <div className={trailingClassName}>{trailing}</div>}
24
- </div>
25
- {helpText && <div className={helpTextClassName}>{helpText}</div>}
26
- </div>);
27
- }
28
- export default UnstyledInput;
@@ -1,6 +0,0 @@
1
- import Input from "./Input";
2
- export * from "./Input";
3
- export default Input;
4
- export { default as InputIcon } from "./InputIcon";
5
- export * from "./UnstyledInput";
6
- export { default as UnstyledInput } from "./UnstyledInput";
@@ -1,6 +0,0 @@
1
- import Input from "./Input";
2
- export * from "./Input";
3
- export default Input;
4
- export { default as InputIcon } from "./InputIcon";
5
- export * from "./UnstyledInput";
6
- export { default as UnstyledInput } from "./UnstyledInput";
@@ -1,11 +0,0 @@
1
- import { type ChangeEvent, type Ref } from "react";
2
- export default function useInputRefValue<T>({ value, ref, name, onChange, }: {
3
- value?: T;
4
- ref?: Ref<HTMLInputElement>;
5
- name?: string;
6
- onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
7
- }): {
8
- innerRef: import("react").RefObject<HTMLInputElement>;
9
- innerValue: T | undefined;
10
- setInnerValue: import("react").Dispatch<import("react").SetStateAction<T | undefined>>;
11
- };
@@ -1,51 +0,0 @@
1
- import { useEffect, useRef, useState } from "react";
2
- import { useDeepCompareEffect } from "react-use";
3
- import { isEqual } from "lodash-es";
4
- export default function useInputRefValue({ value, ref, name, onChange, }) {
5
- const [innerValue, setInnerValue] = useState(value);
6
- useDeepCompareEffect(() => {
7
- if (value && !isEqual(value, innerValue)) {
8
- setInnerValue(value);
9
- }
10
- }, [{ value }]);
11
- const innerRef = useRef({
12
- get value() {
13
- return innerValue;
14
- },
15
- set value(value) {
16
- setInnerValue(value);
17
- },
18
- });
19
- useEffect(() => {
20
- if (ref) {
21
- if (typeof ref === "function") {
22
- ref(innerRef.current);
23
- }
24
- else {
25
- try {
26
- ref.current = innerRef.current;
27
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
- }
29
- catch (e) {
30
- // do nothing
31
- }
32
- }
33
- }
34
- }, [ref]);
35
- useDeepCompareEffect(() => {
36
- if (onChange) {
37
- onChange({
38
- target: {
39
- name,
40
- value: innerValue,
41
- },
42
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
43
- });
44
- }
45
- }, [{ innerValue }]);
46
- return {
47
- innerRef,
48
- innerValue,
49
- setInnerValue,
50
- };
51
- }
@@ -1,11 +0,0 @@
1
- import type { ReactNode } from "react";
2
- export interface InputWrapperProps {
3
- children?: ReactNode;
4
- className?: string;
5
- label?: string;
6
- id?: string;
7
- helpText?: string;
8
- error?: boolean;
9
- required?: boolean;
10
- }
11
- export default function InputWrapper({ children, className, label, id, helpText, error, required, }: InputWrapperProps): import("react").JSX.Element;
@@ -1,11 +0,0 @@
1
- import clsx from "../../utils/clsx";
2
- export default function InputWrapper({ children, className, label, id, helpText, error, required, }) {
3
- return (<div className={clsx("ui-input-wrapper", className)} data-error={error ? "" : undefined}>
4
- {label && (<label htmlFor={id} className="ui-input-wrapper-label">
5
- {label}
6
- {required && <span className="text-red-500"> *</span>}
7
- </label>)}
8
- {children}
9
- {helpText && <div className="ui-input-wrapper-help-text">{helpText}</div>}
10
- </div>);
11
- }
@@ -1,3 +0,0 @@
1
- import type { ComponentProps } from "react";
2
- import NextLink from "next/link";
3
- export default function Link({ className, href, ...props }: Partial<ComponentProps<typeof NextLink>>): import("react").JSX.Element;
@@ -1,9 +0,0 @@
1
- import NextLink from "next/link";
2
- import clsx from "../../utils/clsx";
3
- export default function Link({ className, href, ...props }) {
4
- className = clsx("text-primary-500 underline decoration-primary-500/40 decoration-2 transition-colors hover:decoration-primary-500", className);
5
- if (href) {
6
- return <NextLink href={href} {...props} className={className}/>;
7
- }
8
- return (<button {...props} className={className} type="button"/>);
9
- }
@@ -1,3 +0,0 @@
1
- import Link from "./Link";
2
- export * from "./Link";
3
- export default Link;
@@ -1,3 +0,0 @@
1
- import Link from "./Link";
2
- export * from "./Link";
3
- export default Link;
@@ -1,5 +0,0 @@
1
- declare function Loading({ className }: {
2
- className?: string;
3
- }): import("react").JSX.Element;
4
- declare const _default: import("react").MemoExoticComponent<typeof Loading>;
5
- export default _default;
@@ -1,15 +0,0 @@
1
- import { memo } from "react";
2
- function Loading({ className }) {
3
- return (<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" className={className}>
4
- <circle cx="4" cy="12" r="3" fill="currentColor">
5
- <animate attributeName="opacity" begin="0s" dur="1.5s" repeatCount="indefinite" values="1;0.2;1"/>
6
- </circle>
7
- <circle cx="12" cy="12" r="3" fill="currentColor">
8
- <animate attributeName="opacity" begin="0.3s" dur="1.5s" repeatCount="indefinite" values="1;0.2;1"/>
9
- </circle>
10
- <circle cx="20" cy="12" r="3" fill="currentColor">
11
- <animate attributeName="opacity" begin="0.6s" dur="1.5s" repeatCount="indefinite" values="1;0.2;1"/>
12
- </circle>
13
- </svg>);
14
- }
15
- export default memo(Loading);
@@ -1,3 +0,0 @@
1
- import Loading from "./Loading";
2
- export * from "./Loading";
3
- export default Loading;
@@ -1,3 +0,0 @@
1
- import Loading from "./Loading";
2
- export * from "./Loading";
3
- export default Loading;
@@ -1,13 +0,0 @@
1
- import React, { type ReactNode, type HTMLAttributes } from "react";
2
- interface MagnetProps extends HTMLAttributes<HTMLDivElement> {
3
- children: ReactNode;
4
- padding?: number;
5
- disabled?: boolean;
6
- magnetStrength?: number;
7
- activeTransition?: string;
8
- inactiveTransition?: string;
9
- wrapperClassName?: string;
10
- innerClassName?: string;
11
- }
12
- declare const Magnet: React.FC<MagnetProps>;
13
- export default Magnet;
@@ -1,50 +0,0 @@
1
- import React, { useState, useEffect, useRef, } from "react";
2
- import clsx from "../../utils/clsx";
3
- const Magnet = ({ children, padding = 100, disabled = false, magnetStrength = 2, activeTransition = "transform 0.3s ease-out", inactiveTransition = "transform 0.5s ease-in-out", wrapperClassName = "", innerClassName = "", ...props }) => {
4
- const [isActive, setIsActive] = useState(false);
5
- const [position, setPosition] = useState({
6
- x: 0,
7
- y: 0,
8
- });
9
- const magnetRef = useRef(null);
10
- useEffect(() => {
11
- if (disabled) {
12
- setPosition({ x: 0, y: 0 });
13
- return;
14
- }
15
- const handleMouseMove = (e) => {
16
- if (!magnetRef.current)
17
- return;
18
- const { left, top, width, height } = magnetRef.current.getBoundingClientRect();
19
- const centerX = left + width / 2;
20
- const centerY = top + height / 2;
21
- const distX = Math.abs(centerX - e.clientX);
22
- const distY = Math.abs(centerY - e.clientY);
23
- if (distX < width / 2 + padding && distY < height / 2 + padding) {
24
- setIsActive(true);
25
- const offsetX = (e.clientX - centerX) / magnetStrength;
26
- const offsetY = (e.clientY - centerY) / magnetStrength;
27
- setPosition({ x: offsetX, y: offsetY });
28
- }
29
- else {
30
- setIsActive(false);
31
- setPosition({ x: 0, y: 0 });
32
- }
33
- };
34
- window.addEventListener("mousemove", handleMouseMove);
35
- return () => {
36
- window.removeEventListener("mousemove", handleMouseMove);
37
- };
38
- }, [padding, disabled, magnetStrength]);
39
- const transitionStyle = isActive ? activeTransition : inactiveTransition;
40
- return (<div ref={magnetRef} className={clsx("relative inline-block", wrapperClassName)} {...props}>
41
- <div className={innerClassName} style={{
42
- transform: `translate3d(${position.x}px, ${position.y}px, 0)`,
43
- transition: transitionStyle,
44
- willChange: "transform",
45
- }}>
46
- {children}
47
- </div>
48
- </div>);
49
- };
50
- export default Magnet;
@@ -1,3 +0,0 @@
1
- import Magnet from "./Magnet";
2
- export * from "./Magnet";
3
- export default Magnet;
@@ -1,3 +0,0 @@
1
- import Magnet from "./Magnet";
2
- export * from "./Magnet";
3
- export default Magnet;
@@ -1,8 +0,0 @@
1
- import React, { type ComponentProps } from "react";
2
- import ReactMarkdown from "react-markdown";
3
- export type MarkdownProps = {
4
- children?: string;
5
- className?: string;
6
- options?: ComponentProps<typeof ReactMarkdown>;
7
- };
8
- export default function Markdown({ children, className, options, }: MarkdownProps): React.JSX.Element;
@@ -1,11 +0,0 @@
1
- import React, {} from "react";
2
- import ReactMarkdown from "react-markdown";
3
- import clsx from "../../utils/clsx";
4
- import remarkGfm from "remark-gfm";
5
- export default function Markdown({ children, className, options, }) {
6
- return (<div className={clsx("prose prose-zinc dark:prose-invert max-w-full leading-normal", "[&_.contains-task-list]:list-none [&_.contains-task-list]:pl-0", "[&_.task-list-item_input[type='checkbox']]:-mt-1", "prose-a:break-all", className)}>
7
- <ReactMarkdown remarkPlugins={[remarkGfm, ...(options?.remarkPlugins || [])]} {...options}>
8
- {children}
9
- </ReactMarkdown>
10
- </div>);
11
- }
@@ -1,3 +0,0 @@
1
- import Markdown from "./Markdown";
2
- export * from "./Markdown";
3
- export default Markdown;
@@ -1,3 +0,0 @@
1
- import Markdown from "./Markdown";
2
- export * from "./Markdown";
3
- export default Markdown;
@@ -1,28 +0,0 @@
1
- import { type ComponentPropsWithoutRef, type ReactElement, type ReactNode, type Ref } from "react";
2
- import Button from "../Button/Button";
3
- import { type UnstyledButtonProps } from "../Button/UnstyledButton";
4
- import { type TextProps } from "../Text";
5
- export declare const defaultMenuItemsClassName = "z-10 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-hidden dark:bg-zinc-800";
6
- export type MenuProps = {
7
- className?: string;
8
- position?: "left" | "right" | "bottom-right" | "bottom-left";
9
- iconClassName?: string;
10
- menuItemsClassName?: string;
11
- buttonProps?: ComponentPropsWithoutRef<typeof Button>;
12
- label?: ReactNode;
13
- children?: ReactNode;
14
- button?: ReactNode;
15
- unmount?: boolean;
16
- ref?: Ref<HTMLDivElement>;
17
- };
18
- export type MenuItemProps<T extends HTMLElement = HTMLButtonElement> = UnstyledButtonProps<T> & {
19
- icon?: ReactElement<{
20
- className?: string;
21
- }>;
22
- };
23
- export type MenuLabelProps = TextProps;
24
- declare const _default: (({ className, iconClassName, position, children, label, button, buttonProps, unmount, menuItemsClassName, ...props }: MenuProps) => import("react").JSX.Element) & {
25
- Label: (props: MenuLabelProps) => import("react").JSX.Element;
26
- Item: <T extends HTMLElement = HTMLButtonElement>({ className, icon, children, ...props }: MenuItemProps<T>) => import("react").JSX.Element;
27
- };
28
- export default _default;
@@ -1,54 +0,0 @@
1
- import { cloneElement, Fragment, } from "react";
2
- import { Menu as HuiMenu, Transition } from "@headlessui/react";
3
- import { ChevronDownIcon } from "@heroicons/react/20/solid";
4
- import clsx from "../../utils/clsx";
5
- import Button from "../Button/Button";
6
- import UnstyledButton, {} from "../Button/UnstyledButton";
7
- import Text, {} from "../Text";
8
- import { useMount } from "react-use";
9
- export const defaultMenuItemsClassName = "z-10 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-hidden dark:bg-zinc-800";
10
- const Item = function MenuItem({ className, icon, children, ...props }) {
11
- return (<HuiMenu.Item>
12
- {({ active }) => (<UnstyledButton {...props} type="button" className={clsx("flex w-full items-center text-left", active
13
- ? "bg-zinc-100 text-zinc-900 dark:bg-zinc-700/50 dark:text-zinc-100"
14
- : "text-zinc-700 dark:text-zinc-200", "block px-4 py-2 text-sm", className)}>
15
- {icon &&
16
- cloneElement(icon, {
17
- className: clsx("w-5 mr-2", icon.props.className),
18
- })}
19
- {children}
20
- </UnstyledButton>)}
21
- </HuiMenu.Item>);
22
- };
23
- const Label = function MenuLabel(props) {
24
- return (<Text {...props} variant="label" className={clsx("w-full text-left", "block px-4 py-2 text-sm", props.className)}/>);
25
- };
26
- const Menu = function Menu({ className, iconClassName, position = "right", children, label, button, buttonProps, unmount, menuItemsClassName, ...props }) {
27
- useMount(() => {
28
- console.warn("<Menu> was deprecated and should be replaced with <DropdownMenu>");
29
- });
30
- return (<HuiMenu as="div" className={clsx("relative inline-block text-left", className)} {...props}>
31
- <div>
32
- {button ? (<HuiMenu.Button as={Fragment}>{button}</HuiMenu.Button>) : (<HuiMenu.Button
33
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
34
- as={Button} className={clsx("flex w-full", buttonProps?.className)} trailing={<ChevronDownIcon className={iconClassName}/>} {...buttonProps}>
35
- {label}
36
- </HuiMenu.Button>)}
37
- </div>
38
-
39
- <Transition as={Fragment} enter="transition ease-out duration-100" enterFrom="transform opacity-0 scale-95" enterTo="transform opacity-100 scale-100" leave="transition ease-in duration-75" leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95">
40
- <HuiMenu.Items unmount={unmount} className={clsx(defaultMenuItemsClassName, "absolute mt-2 min-w-[14rem]", {
41
- "right-0": position.includes("right"),
42
- "origin-top-right": position.includes("right") && !position.includes("bottom"),
43
- "origin-top-left": position.includes("left") && !position.includes("bottom"),
44
- "origin-bottom-right": position.includes("right") && position.includes("bottom"),
45
- "origin-bottom-left": position.includes("left") && position.includes("bottom"),
46
- "left-0": position.includes("left"),
47
- "bottom-0": position.includes("bottom"),
48
- }, menuItemsClassName)}>
49
- <div className="py-1">{children}</div>
50
- </HuiMenu.Items>
51
- </Transition>
52
- </HuiMenu>);
53
- };
54
- export default Object.assign(Menu, { Label, Item });