@kadoui/react 2.0.1 → 2.1.1

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 (336) hide show
  1. package/README.md +1052 -376
  2. package/dist/react-components/Accordion/Accordion.d.ts +1 -0
  3. package/dist/react-components/Accordion/Accordion.d.ts.map +1 -1
  4. package/dist/react-components/Accordion/Accordion.js +1 -0
  5. package/dist/react-components/Accordion/AccordionBody.d.ts +1 -2
  6. package/dist/react-components/Accordion/AccordionBody.d.ts.map +1 -1
  7. package/dist/react-components/Accordion/AccordionContext.d.ts +1 -5
  8. package/dist/react-components/Accordion/AccordionContext.d.ts.map +1 -1
  9. package/dist/react-components/Accordion/AccordionRoot.d.ts +1 -2
  10. package/dist/react-components/Accordion/AccordionRoot.d.ts.map +1 -1
  11. package/dist/react-components/Accordion/AccordionToggle.d.ts +1 -4
  12. package/dist/react-components/Accordion/AccordionToggle.d.ts.map +1 -1
  13. package/dist/react-components/Accordion/accordionTypes.d.ts +12 -0
  14. package/dist/react-components/Accordion/accordionTypes.d.ts.map +1 -0
  15. package/dist/react-components/Accordion/accordionTypes.js +1 -0
  16. package/dist/react-components/Affix/Affix.d.ts +1 -2
  17. package/dist/react-components/Affix/Affix.d.ts.map +1 -1
  18. package/dist/react-components/Affix/affixTypes.d.ts +3 -0
  19. package/dist/react-components/Affix/affixTypes.d.ts.map +1 -0
  20. package/dist/react-components/Affix/affixTypes.js +1 -0
  21. package/dist/react-components/Breadcrumbs/Breadcrumbs.d.ts +1 -0
  22. package/dist/react-components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  23. package/dist/react-components/Breadcrumbs/Breadcrumbs.js +1 -0
  24. package/dist/react-components/Breadcrumbs/BreadcrumbsContext.d.ts +1 -4
  25. package/dist/react-components/Breadcrumbs/BreadcrumbsContext.d.ts.map +1 -1
  26. package/dist/react-components/Breadcrumbs/BreadcrumbsItem.d.ts +1 -4
  27. package/dist/react-components/Breadcrumbs/BreadcrumbsItem.d.ts.map +1 -1
  28. package/dist/react-components/Breadcrumbs/BreadcrumbsRoot.d.ts +1 -4
  29. package/dist/react-components/Breadcrumbs/BreadcrumbsRoot.d.ts.map +1 -1
  30. package/dist/react-components/Breadcrumbs/breadcrumbsTypes.d.ts +11 -0
  31. package/dist/react-components/Breadcrumbs/breadcrumbsTypes.d.ts.map +1 -0
  32. package/dist/react-components/Breadcrumbs/breadcrumbsTypes.js +1 -0
  33. package/dist/react-components/Carousel/Carousel.d.ts +1 -0
  34. package/dist/react-components/Carousel/Carousel.d.ts.map +1 -1
  35. package/dist/react-components/Carousel/Carousel.js +1 -0
  36. package/dist/react-components/Carousel/CarouselContainer.d.ts +1 -2
  37. package/dist/react-components/Carousel/CarouselContainer.d.ts.map +1 -1
  38. package/dist/react-components/Carousel/CarouselContext.d.ts +1 -8
  39. package/dist/react-components/Carousel/CarouselContext.d.ts.map +1 -1
  40. package/dist/react-components/Carousel/CarouselLeftFade.d.ts +1 -3
  41. package/dist/react-components/Carousel/CarouselLeftFade.d.ts.map +1 -1
  42. package/dist/react-components/Carousel/CarouselNextBtn.d.ts +1 -2
  43. package/dist/react-components/Carousel/CarouselNextBtn.d.ts.map +1 -1
  44. package/dist/react-components/Carousel/CarouselPrevBtn.d.ts +1 -2
  45. package/dist/react-components/Carousel/CarouselPrevBtn.d.ts.map +1 -1
  46. package/dist/react-components/Carousel/CarouselRightFade.d.ts +1 -3
  47. package/dist/react-components/Carousel/CarouselRightFade.d.ts.map +1 -1
  48. package/dist/react-components/Carousel/CarouselRoot.d.ts +1 -4
  49. package/dist/react-components/Carousel/CarouselRoot.d.ts.map +1 -1
  50. package/dist/react-components/Carousel/carouselTypes.d.ts +17 -0
  51. package/dist/react-components/Carousel/carouselTypes.d.ts.map +1 -0
  52. package/dist/react-components/Carousel/carouselTypes.js +1 -0
  53. package/dist/react-components/Choice/Choice.d.ts +1 -0
  54. package/dist/react-components/Choice/Choice.d.ts.map +1 -1
  55. package/dist/react-components/Choice/Choice.js +1 -0
  56. package/dist/react-components/Choice/ChoiceContext.d.ts +1 -16
  57. package/dist/react-components/Choice/ChoiceContext.d.ts.map +1 -1
  58. package/dist/react-components/Choice/ChoiceNavigation.d.ts +1 -3
  59. package/dist/react-components/Choice/ChoiceNavigation.d.ts.map +1 -1
  60. package/dist/react-components/Choice/ChoiceRoot.d.ts +1 -4
  61. package/dist/react-components/Choice/ChoiceRoot.d.ts.map +1 -1
  62. package/dist/react-components/Choice/ChoiceTrigger.d.ts +1 -5
  63. package/dist/react-components/Choice/ChoiceTrigger.d.ts.map +1 -1
  64. package/dist/react-components/Choice/choiceTypes.d.ts +23 -0
  65. package/dist/react-components/Choice/choiceTypes.d.ts.map +1 -0
  66. package/dist/react-components/Choice/choiceTypes.js +1 -0
  67. package/dist/react-components/ClientOnly/ClientOnly.d.ts +1 -2
  68. package/dist/react-components/ClientOnly/ClientOnly.d.ts.map +1 -1
  69. package/dist/react-components/ClientOnly/clientOnlyTypes.d.ts +3 -0
  70. package/dist/react-components/ClientOnly/clientOnlyTypes.d.ts.map +1 -0
  71. package/dist/react-components/ClientOnly/clientOnlyTypes.js +1 -0
  72. package/dist/react-components/Clipboard/Clipboard.d.ts +1 -6
  73. package/dist/react-components/Clipboard/Clipboard.d.ts.map +1 -1
  74. package/dist/react-components/Clipboard/clipboardTypes.d.ts +7 -0
  75. package/dist/react-components/Clipboard/clipboardTypes.d.ts.map +1 -0
  76. package/dist/react-components/Clipboard/clipboardTypes.js +1 -0
  77. package/dist/react-components/ContextMenu/ContextMenu.d.ts +1 -0
  78. package/dist/react-components/ContextMenu/ContextMenu.d.ts.map +1 -1
  79. package/dist/react-components/ContextMenu/ContextMenu.js +1 -0
  80. package/dist/react-components/ContextMenu/ContextMenuBody.d.ts +1 -2
  81. package/dist/react-components/ContextMenu/ContextMenuBody.d.ts.map +1 -1
  82. package/dist/react-components/ContextMenu/ContextMenuContext.d.ts +1 -10
  83. package/dist/react-components/ContextMenu/ContextMenuContext.d.ts.map +1 -1
  84. package/dist/react-components/ContextMenu/ContextMenuContext.js +1 -1
  85. package/dist/react-components/ContextMenu/ContextMenuItem.d.ts +1 -3
  86. package/dist/react-components/ContextMenu/ContextMenuItem.d.ts.map +1 -1
  87. package/dist/react-components/ContextMenu/ContextMenuNavigation.d.ts +1 -3
  88. package/dist/react-components/ContextMenu/ContextMenuNavigation.d.ts.map +1 -1
  89. package/dist/react-components/ContextMenu/ContextMenuNavigation.js +1 -1
  90. package/dist/react-components/ContextMenu/ContextMenuRoot.d.ts +1 -2
  91. package/dist/react-components/ContextMenu/ContextMenuRoot.d.ts.map +1 -1
  92. package/dist/react-components/ContextMenu/contextMenuTypes.d.ts +16 -0
  93. package/dist/react-components/ContextMenu/contextMenuTypes.d.ts.map +1 -0
  94. package/dist/react-components/ContextMenu/contextMenuTypes.js +1 -0
  95. package/dist/react-components/Drawer/Drawer.d.ts +1 -0
  96. package/dist/react-components/Drawer/Drawer.d.ts.map +1 -1
  97. package/dist/react-components/Drawer/Drawer.js +1 -0
  98. package/dist/react-components/Drawer/DrawerBody.d.ts +1 -4
  99. package/dist/react-components/Drawer/DrawerBody.d.ts.map +1 -1
  100. package/dist/react-components/Drawer/DrawerBody.js +1 -1
  101. package/dist/react-components/Drawer/DrawerContext.d.ts +1 -5
  102. package/dist/react-components/Drawer/DrawerContext.d.ts.map +1 -1
  103. package/dist/react-components/Drawer/DrawerPortal.d.ts +1 -2
  104. package/dist/react-components/Drawer/DrawerPortal.d.ts.map +1 -1
  105. package/dist/react-components/Drawer/DrawerPortal.js +1 -1
  106. package/dist/react-components/Drawer/DrawerRoot.d.ts +1 -2
  107. package/dist/react-components/Drawer/DrawerRoot.d.ts.map +1 -1
  108. package/dist/react-components/Drawer/DrawerRoot.js +1 -1
  109. package/dist/react-components/Drawer/DrawerToggle.d.ts +1 -2
  110. package/dist/react-components/Drawer/DrawerToggle.d.ts.map +1 -1
  111. package/dist/react-components/Drawer/drawerTypes.d.ts +13 -0
  112. package/dist/react-components/Drawer/drawerTypes.d.ts.map +1 -0
  113. package/dist/react-components/Drawer/drawerTypes.js +1 -0
  114. package/dist/react-components/Modal/Modal.d.ts +1 -0
  115. package/dist/react-components/Modal/Modal.d.ts.map +1 -1
  116. package/dist/react-components/Modal/Modal.js +1 -0
  117. package/dist/react-components/Modal/ModalBody.d.ts +1 -2
  118. package/dist/react-components/Modal/ModalBody.d.ts.map +1 -1
  119. package/dist/react-components/Modal/ModalBody.js +1 -1
  120. package/dist/react-components/Modal/ModalContent.d.ts +1 -2
  121. package/dist/react-components/Modal/ModalContent.d.ts.map +1 -1
  122. package/dist/react-components/Modal/ModalContext.d.ts +1 -5
  123. package/dist/react-components/Modal/ModalContext.d.ts.map +1 -1
  124. package/dist/react-components/Modal/ModalHeader.d.ts +1 -2
  125. package/dist/react-components/Modal/ModalHeader.d.ts.map +1 -1
  126. package/dist/react-components/Modal/ModalPortal.d.ts +1 -2
  127. package/dist/react-components/Modal/ModalPortal.d.ts.map +1 -1
  128. package/dist/react-components/Modal/ModalPortal.js +1 -1
  129. package/dist/react-components/Modal/ModalRoot.d.ts +1 -4
  130. package/dist/react-components/Modal/ModalRoot.d.ts.map +1 -1
  131. package/dist/react-components/Modal/ModalRoot.js +1 -1
  132. package/dist/react-components/Modal/ModalTrigger.d.ts +1 -2
  133. package/dist/react-components/Modal/ModalTrigger.d.ts.map +1 -1
  134. package/dist/react-components/Modal/modalTypes.d.ts +15 -0
  135. package/dist/react-components/Modal/modalTypes.d.ts.map +1 -0
  136. package/dist/react-components/Modal/modalTypes.js +1 -0
  137. package/dist/react-components/Otp/Otp.d.ts +1 -0
  138. package/dist/react-components/Otp/Otp.d.ts.map +1 -1
  139. package/dist/react-components/Otp/Otp.js +1 -0
  140. package/dist/react-components/Otp/OtpContext.d.ts +2 -6
  141. package/dist/react-components/Otp/OtpContext.d.ts.map +1 -1
  142. package/dist/react-components/Otp/OtpHiddenInput.d.ts +1 -2
  143. package/dist/react-components/Otp/OtpHiddenInput.d.ts.map +1 -1
  144. package/dist/react-components/Otp/OtpInputs.d.ts +1 -5
  145. package/dist/react-components/Otp/OtpInputs.d.ts.map +1 -1
  146. package/dist/react-components/Otp/OtpRoot.d.ts +1 -4
  147. package/dist/react-components/Otp/OtpRoot.d.ts.map +1 -1
  148. package/dist/react-components/Otp/OtpRoot.js +1 -1
  149. package/dist/react-components/Otp/otpTypes.d.ts +15 -0
  150. package/dist/react-components/Otp/otpTypes.d.ts.map +1 -0
  151. package/dist/react-components/Otp/otpTypes.js +1 -0
  152. package/dist/react-components/Pagination/PaginationContext.d.ts +1 -10
  153. package/dist/react-components/Pagination/PaginationContext.d.ts.map +1 -1
  154. package/dist/react-components/Pagination/PaginationCounts.d.ts +1 -2
  155. package/dist/react-components/Pagination/PaginationCounts.d.ts.map +1 -1
  156. package/dist/react-components/Pagination/PaginationNextBtn.d.ts +1 -4
  157. package/dist/react-components/Pagination/PaginationNextBtn.d.ts.map +1 -1
  158. package/dist/react-components/Pagination/PaginationPrevBtn.d.ts +1 -4
  159. package/dist/react-components/Pagination/PaginationPrevBtn.d.ts.map +1 -1
  160. package/dist/react-components/Pagination/PaginationSearchParamsRoot.d.ts +1 -4
  161. package/dist/react-components/Pagination/PaginationSearchParamsRoot.d.ts.map +1 -1
  162. package/dist/react-components/Pagination/PaginationStateRoot.d.ts +1 -7
  163. package/dist/react-components/Pagination/PaginationStateRoot.d.ts.map +1 -1
  164. package/dist/react-components/Pagination/PaginationTypes.d.ts +23 -1
  165. package/dist/react-components/Pagination/PaginationTypes.d.ts.map +1 -1
  166. package/dist/react-components/PasswordInput/PasswordInput.d.ts +1 -0
  167. package/dist/react-components/PasswordInput/PasswordInput.d.ts.map +1 -1
  168. package/dist/react-components/PasswordInput/PasswordInput.js +1 -0
  169. package/dist/react-components/PasswordInput/PasswordInputContext.d.ts +1 -5
  170. package/dist/react-components/PasswordInput/PasswordInputContext.d.ts.map +1 -1
  171. package/dist/react-components/PasswordInput/PasswordInputField.d.ts +1 -2
  172. package/dist/react-components/PasswordInput/PasswordInputField.d.ts.map +1 -1
  173. package/dist/react-components/PasswordInput/PasswordInputRoot.d.ts +1 -2
  174. package/dist/react-components/PasswordInput/PasswordInputRoot.d.ts.map +1 -1
  175. package/dist/react-components/PasswordInput/PasswordInputToggle.d.ts +1 -4
  176. package/dist/react-components/PasswordInput/PasswordInputToggle.d.ts.map +1 -1
  177. package/dist/react-components/PasswordInput/passwordInputTypes.d.ts +11 -0
  178. package/dist/react-components/PasswordInput/passwordInputTypes.d.ts.map +1 -0
  179. package/dist/react-components/PasswordInput/passwordInputTypes.js +1 -0
  180. package/dist/react-components/Popover/Popover.d.ts +1 -0
  181. package/dist/react-components/Popover/Popover.d.ts.map +1 -1
  182. package/dist/react-components/Popover/Popover.js +1 -0
  183. package/dist/react-components/Popover/PopoverBody.d.ts +1 -4
  184. package/dist/react-components/Popover/PopoverBody.d.ts.map +1 -1
  185. package/dist/react-components/Popover/PopoverContext.d.ts +1 -8
  186. package/dist/react-components/Popover/PopoverContext.d.ts.map +1 -1
  187. package/dist/react-components/Popover/PopoverNavigation.d.ts +2 -2
  188. package/dist/react-components/Popover/PopoverNavigation.d.ts.map +1 -1
  189. package/dist/react-components/Popover/PopoverNavigation.js +1 -1
  190. package/dist/react-components/Popover/PopoverRoot.d.ts +1 -5
  191. package/dist/react-components/Popover/PopoverRoot.d.ts.map +1 -1
  192. package/dist/react-components/Popover/PopoverToggle.d.ts +1 -2
  193. package/dist/react-components/Popover/PopoverToggle.d.ts.map +1 -1
  194. package/dist/react-components/Popover/popoverTypes.d.ts +18 -0
  195. package/dist/react-components/Popover/popoverTypes.d.ts.map +1 -0
  196. package/dist/react-components/Popover/popoverTypes.js +1 -0
  197. package/dist/react-components/Portal/Portal.d.ts +1 -4
  198. package/dist/react-components/Portal/Portal.d.ts.map +1 -1
  199. package/dist/react-components/Portal/portalTypes.d.ts +5 -0
  200. package/dist/react-components/Portal/portalTypes.d.ts.map +1 -0
  201. package/dist/react-components/Portal/portalTypes.js +1 -0
  202. package/dist/react-components/Progress/Progress.d.ts +1 -0
  203. package/dist/react-components/Progress/Progress.d.ts.map +1 -1
  204. package/dist/react-components/Progress/Progress.js +1 -0
  205. package/dist/react-components/Progress/ProgressBar.d.ts +1 -4
  206. package/dist/react-components/Progress/ProgressBar.d.ts.map +1 -1
  207. package/dist/react-components/Progress/ProgressContext.d.ts +1 -4
  208. package/dist/react-components/Progress/ProgressContext.d.ts.map +1 -1
  209. package/dist/react-components/Progress/ProgressRoot.d.ts +1 -5
  210. package/dist/react-components/Progress/ProgressRoot.d.ts.map +1 -1
  211. package/dist/react-components/Progress/progressTypes.d.ts +14 -0
  212. package/dist/react-components/Progress/progressTypes.d.ts.map +1 -0
  213. package/dist/react-components/Progress/progressTypes.js +1 -0
  214. package/dist/react-components/QrCode/QrCode.d.ts +1 -6
  215. package/dist/react-components/QrCode/QrCode.d.ts.map +1 -1
  216. package/dist/react-components/QrCode/qrCodeTypes.d.ts +7 -0
  217. package/dist/react-components/QrCode/qrCodeTypes.d.ts.map +1 -0
  218. package/dist/react-components/QrCode/qrCodeTypes.js +1 -0
  219. package/dist/react-components/Rating/Rating.d.ts +2 -1
  220. package/dist/react-components/Rating/Rating.d.ts.map +1 -1
  221. package/dist/react-components/Rating/Rating.js +1 -0
  222. package/dist/react-components/Rating/RatingContext.d.ts +1 -5
  223. package/dist/react-components/Rating/RatingContext.d.ts.map +1 -1
  224. package/dist/react-components/Rating/RatingItems.d.ts +1 -8
  225. package/dist/react-components/Rating/RatingItems.d.ts.map +1 -1
  226. package/dist/react-components/Rating/RatingRoot.d.ts +1 -2
  227. package/dist/react-components/Rating/RatingRoot.d.ts.map +1 -1
  228. package/dist/react-components/Rating/ratingTypes.d.ts +14 -0
  229. package/dist/react-components/Rating/ratingTypes.d.ts.map +1 -0
  230. package/dist/react-components/Rating/ratingTypes.js +1 -0
  231. package/dist/react-components/Sheet/Sheet.d.ts +1 -0
  232. package/dist/react-components/Sheet/Sheet.d.ts.map +1 -1
  233. package/dist/react-components/Sheet/Sheet.js +1 -0
  234. package/dist/react-components/Sheet/SheetBody.d.ts +1 -2
  235. package/dist/react-components/Sheet/SheetBody.d.ts.map +1 -1
  236. package/dist/react-components/Sheet/SheetBody.js +1 -1
  237. package/dist/react-components/Sheet/SheetContent.d.ts +1 -2
  238. package/dist/react-components/Sheet/SheetContent.d.ts.map +1 -1
  239. package/dist/react-components/Sheet/SheetContext.d.ts +1 -9
  240. package/dist/react-components/Sheet/SheetContext.d.ts.map +1 -1
  241. package/dist/react-components/Sheet/SheetHandlebar.d.ts +1 -2
  242. package/dist/react-components/Sheet/SheetHandlebar.d.ts.map +1 -1
  243. package/dist/react-components/Sheet/SheetHeader.d.ts +1 -2
  244. package/dist/react-components/Sheet/SheetHeader.d.ts.map +1 -1
  245. package/dist/react-components/Sheet/SheetPortal.d.ts +1 -2
  246. package/dist/react-components/Sheet/SheetPortal.d.ts.map +1 -1
  247. package/dist/react-components/Sheet/SheetPortal.js +1 -1
  248. package/dist/react-components/Sheet/SheetRoot.d.ts +1 -2
  249. package/dist/react-components/Sheet/SheetRoot.d.ts.map +1 -1
  250. package/dist/react-components/Sheet/SheetRoot.js +1 -1
  251. package/dist/react-components/Sheet/SheetToggle.d.ts +1 -2
  252. package/dist/react-components/Sheet/SheetToggle.d.ts.map +1 -1
  253. package/dist/react-components/Sheet/sheetTypes.d.ts +17 -0
  254. package/dist/react-components/Sheet/sheetTypes.d.ts.map +1 -0
  255. package/dist/react-components/Sheet/sheetTypes.js +1 -0
  256. package/dist/react-components/ShowMore/ShowMore.d.ts +1 -0
  257. package/dist/react-components/ShowMore/ShowMore.d.ts.map +1 -1
  258. package/dist/react-components/ShowMore/ShowMore.js +1 -0
  259. package/dist/react-components/ShowMore/ShowMoreContent.d.ts +1 -2
  260. package/dist/react-components/ShowMore/ShowMoreContent.d.ts.map +1 -1
  261. package/dist/react-components/ShowMore/ShowMoreContext.d.ts +1 -8
  262. package/dist/react-components/ShowMore/ShowMoreContext.d.ts.map +1 -1
  263. package/dist/react-components/ShowMore/ShowMoreFade.d.ts +1 -2
  264. package/dist/react-components/ShowMore/ShowMoreFade.d.ts.map +1 -1
  265. package/dist/react-components/ShowMore/ShowMoreRoot.d.ts +1 -5
  266. package/dist/react-components/ShowMore/ShowMoreRoot.d.ts.map +1 -1
  267. package/dist/react-components/ShowMore/ShowMoreToggle.d.ts +1 -2
  268. package/dist/react-components/ShowMore/ShowMoreToggle.d.ts.map +1 -1
  269. package/dist/react-components/ShowMore/showMoreTypes.d.ts +16 -0
  270. package/dist/react-components/ShowMore/showMoreTypes.d.ts.map +1 -0
  271. package/dist/react-components/ShowMore/showMoreTypes.js +1 -0
  272. package/dist/react-components/Spoiler/Spoiler.d.ts +1 -0
  273. package/dist/react-components/Spoiler/Spoiler.d.ts.map +1 -1
  274. package/dist/react-components/Spoiler/Spoiler.js +1 -0
  275. package/dist/react-components/Spoiler/SpoilerBlur.d.ts +1 -2
  276. package/dist/react-components/Spoiler/SpoilerBlur.d.ts.map +1 -1
  277. package/dist/react-components/Spoiler/SpoilerContext.d.ts +1 -5
  278. package/dist/react-components/Spoiler/SpoilerContext.d.ts.map +1 -1
  279. package/dist/react-components/Spoiler/SpoilerRoot.d.ts +1 -2
  280. package/dist/react-components/Spoiler/SpoilerRoot.d.ts.map +1 -1
  281. package/dist/react-components/Spoiler/spoilerTypes.d.ts +8 -0
  282. package/dist/react-components/Spoiler/spoilerTypes.d.ts.map +1 -0
  283. package/dist/react-components/Spoiler/spoilerTypes.js +1 -0
  284. package/dist/react-components/Submit/Submit.d.ts +1 -0
  285. package/dist/react-components/Submit/Submit.d.ts.map +1 -1
  286. package/dist/react-components/Submit/Submit.js +1 -0
  287. package/dist/react-components/Submit/SubmitContext.d.ts +1 -3
  288. package/dist/react-components/Submit/SubmitContext.d.ts.map +1 -1
  289. package/dist/react-components/Submit/SubmitLoader.d.ts +2 -5
  290. package/dist/react-components/Submit/SubmitLoader.d.ts.map +1 -1
  291. package/dist/react-components/Submit/SubmitRoot.d.ts +1 -4
  292. package/dist/react-components/Submit/SubmitRoot.d.ts.map +1 -1
  293. package/dist/react-components/Submit/submitTypes.d.ts +11 -0
  294. package/dist/react-components/Submit/submitTypes.d.ts.map +1 -0
  295. package/dist/react-components/Submit/submitTypes.js +1 -0
  296. package/dist/react-components/Swap/Swap.d.ts +1 -0
  297. package/dist/react-components/Swap/Swap.d.ts.map +1 -1
  298. package/dist/react-components/Swap/Swap.js +1 -0
  299. package/dist/react-components/Swap/SwapBtn.d.ts +1 -4
  300. package/dist/react-components/Swap/SwapBtn.d.ts.map +1 -1
  301. package/dist/react-components/Swap/SwapContext.d.ts +1 -6
  302. package/dist/react-components/Swap/SwapContext.d.ts.map +1 -1
  303. package/dist/react-components/Swap/SwapRoot.d.ts +1 -6
  304. package/dist/react-components/Swap/SwapRoot.d.ts.map +1 -1
  305. package/dist/react-components/Swap/swapTypes.d.ts +15 -0
  306. package/dist/react-components/Swap/swapTypes.d.ts.map +1 -0
  307. package/dist/react-components/Swap/swapTypes.js +1 -0
  308. package/dist/react-components/Tabs/Tabs.d.ts +1 -0
  309. package/dist/react-components/Tabs/Tabs.d.ts.map +1 -1
  310. package/dist/react-components/Tabs/Tabs.js +1 -0
  311. package/dist/react-components/Tabs/TabsContext.d.ts +1 -5
  312. package/dist/react-components/Tabs/TabsContext.d.ts.map +1 -1
  313. package/dist/react-components/Tabs/TabsList.d.ts +1 -2
  314. package/dist/react-components/Tabs/TabsList.d.ts.map +1 -1
  315. package/dist/react-components/Tabs/TabsPanel.d.ts +1 -4
  316. package/dist/react-components/Tabs/TabsPanel.d.ts.map +1 -1
  317. package/dist/react-components/Tabs/TabsRoot.d.ts +1 -5
  318. package/dist/react-components/Tabs/TabsRoot.d.ts.map +1 -1
  319. package/dist/react-components/Tabs/TabsTab.d.ts +1 -4
  320. package/dist/react-components/Tabs/TabsTab.d.ts.map +1 -1
  321. package/dist/react-components/Tabs/tabsTypes.d.ts +18 -0
  322. package/dist/react-components/Tabs/tabsTypes.d.ts.map +1 -0
  323. package/dist/react-components/Tabs/tabsTypes.js +1 -0
  324. package/dist/react-components/Theme/Theme.d.ts +1 -0
  325. package/dist/react-components/Theme/Theme.d.ts.map +1 -1
  326. package/dist/react-components/Theme/Theme.js +1 -0
  327. package/dist/react-components/Theme/ThemeContext.d.ts +1 -5
  328. package/dist/react-components/Theme/ThemeContext.d.ts.map +1 -1
  329. package/dist/react-components/Theme/ThemeProvider.d.ts +1 -3
  330. package/dist/react-components/Theme/ThemeProvider.d.ts.map +1 -1
  331. package/dist/react-components/Theme/themeTypes.d.ts +8 -0
  332. package/dist/react-components/Theme/themeTypes.d.ts.map +1 -0
  333. package/dist/react-components/Theme/themeTypes.js +1 -0
  334. package/dist/react-components/Theme/useTheme.d.ts +2 -2
  335. package/dist/tsconfig.tsbuildinfo +1 -1
  336. package/package.json +1 -1
package/README.md CHANGED
@@ -1,488 +1,855 @@
1
- # Kadoui-react
1
+ # @kadoui/react
2
2
 
3
- Primitive components for `React` powered by `Kadoui-css` styles.
3
+ <div align="center">
4
4
 
5
- We recommend use `Kadoui-css` for styling the components:
6
- [Read about `Kadoui-css`](https://www.npmjs.com/package/@kadoui/css)
5
+ **Primitive, unstyled, and accessible React components built with modern patterns**
7
6
 
8
- Also use `lucide-react` for icons:
9
- [Read about `lucide-react`](https://www.npmjs.com/package/lucide-react)
7
+ [![npm version](https://img.shields.io/npm/v/@kadoui/react.svg)](https://www.npmjs.com/package/@kadoui/react)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9+-blue.svg)](https://www.typescriptlang.org/)
10
+
11
+ </div>
12
+
13
+ ---
14
+
15
+ ## Introduction
16
+
17
+ `@kadoui/react` is a collection of primitive, unstyled React components that provide accessible, composable building blocks for your UI. These components are designed to be styled with your own CSS framework (we recommend [@kadoui/css](https://www.npmjs.com/package/@kadoui/css)) and follow modern React patterns.
18
+
19
+ ### Key Features
20
+
21
+ - 🎨 **Unstyled & Composable** - Style components however you want
22
+ - ♿ **Accessible** - Built with accessibility in mind
23
+ - 🎯 **TypeScript** - Full TypeScript support with exported types
24
+ - 🚀 **Modern Patterns** - Uses React 19 features and best practices
25
+ - 📦 **Tree-shakeable** - Import only what you need
26
+ - 🎭 **Flexible** - Works with any styling solution
10
27
 
11
28
  ---
12
29
 
30
+ ## Installation
31
+
32
+ ```bash
33
+ npm install @kadoui/react
34
+ # or
35
+ pnpm add @kadoui/react
36
+ # or
37
+ yarn add @kadoui/react
38
+ ```
39
+
40
+ ### Peer Dependencies
41
+
42
+ ```bash
43
+ npm install react react-dom
44
+ ```
45
+
46
+ ### Optional Dependencies
47
+
48
+ For animations, we use `framer-motion`:
49
+ ```bash
50
+ npm install framer-motion
51
+ ```
52
+
53
+ For icons, we recommend `lucide-react`:
54
+ ```bash
55
+ npm install lucide-react
56
+ ```
57
+
58
+ For styling, we recommend `@kadoui/css`:
59
+ ```bash
60
+ npm install @kadoui/css
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Quick Start
66
+
67
+ ```tsx
68
+ import { Accordion } from "@kadoui/react";
69
+ import { ChevronDownIcon } from "lucide-react";
70
+
71
+ function App() {
72
+ return (
73
+ <Accordion>
74
+ <Accordion.Toggle className="btn">
75
+ Toggle Accordion
76
+ <ChevronDownIcon />
77
+ </Accordion.Toggle>
78
+ <Accordion.Body>
79
+ <p>Accordion content goes here</p>
80
+ </Accordion.Body>
81
+ </Accordion>
82
+ );
83
+ }
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Components
89
+
13
90
  ### AccessNavigation
14
91
 
15
- For add arrow-key nagivations to your UIs.
92
+ Add keyboard navigation (arrow keys) to your UI elements.
93
+
94
+ **Props:**
95
+ - `direction: "x" | "y"` - Navigation direction
96
+ - `focusOnMount?: boolean` - Auto-focus first element on mount
97
+ - `dir?: "ltr" | "rtl"` - Text direction (defaults to document direction)
98
+
99
+ **Example:**
100
+
101
+ ```tsx
102
+ import { AccessNavigation } from "@kadoui/react";
103
+
104
+ <AccessNavigation direction="x" className="join">
105
+ <button className="btn">One</button>
106
+ <button className="btn">Two</button>
107
+ <button className="btn">Three</button>
108
+ </AccessNavigation>
109
+ ```
110
+
111
+ **Vertical Navigation:**
16
112
 
17
113
  ```tsx
18
- <AccessNavigation
19
- direction="x"
20
- className="join mt-6">
21
- <button className="btn btn-soft">One</button>
22
- <button className="btn btn-soft">Two</button>
23
- <button className="btn btn-soft">Three</button>
24
- <button className="btn btn-soft">Four</button>
114
+ <AccessNavigation direction="y" className="flex flex-col gap-2">
115
+ <button className="btn">Item 1</button>
116
+ <button className="btn">Item 2</button>
117
+ <button className="btn">Item 3</button>
25
118
  </AccessNavigation>
26
119
  ```
27
120
 
121
+ ---
122
+
28
123
  ### Accordion
29
124
 
125
+ A collapsible content component.
126
+
127
+ **Components:**
128
+ - `Accordion` (Root) - Wrapper component
129
+ - `Accordion.Toggle` - Button to toggle accordion
130
+ - `Accordion.Body` - Collapsible content
131
+
132
+ **Example:**
133
+
30
134
  ```tsx
135
+ import { Accordion } from "@kadoui/react";
136
+ import { ChevronDownIcon } from "lucide-react";
137
+
31
138
  <Accordion>
32
- <Accordion.Toggle className="btn btn-full data-[state=true]:btn-fill data-[state=false]:btn-soft justify-between mt-6 group">
139
+ <Accordion.Toggle className="btn justify-between group">
33
140
  <span>Open accordion</span>
34
- <ChevronDownIcon className="transition-transform element-icon-size group-data-[state=true]:-scale-y-100" />
141
+ <ChevronDownIcon className="transition-transform group-data-[state=true]:-scale-y-100" />
35
142
  </Accordion.Toggle>
36
143
  <Accordion.Body>
37
144
  <p className="p-3">
38
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Quos fugit accusamus unde,
39
- repellendus dolores, fuga nam commodi sapiente omnis voluptatum error earum culpa
40
- asperiores eaque ea enim possimus vero esse!
145
+ Lorem ipsum dolor sit amet consectetur adipisicing elit.
41
146
  </p>
42
147
  </Accordion.Body>
43
148
  </Accordion>
44
149
  ```
45
150
 
46
- ### Breadcrumbs
151
+ **API:**
152
+ - `Accordion` - Accepts `PropsWithChildren`
153
+ - `Accordion.Toggle` - Accepts `ComponentProps<"button"> & { icon?: ReactNode }`
154
+ - `Accordion.Body` - Accepts `HTMLMotionProps<"div">`
155
+
156
+ ---
157
+
158
+ ### Affix
159
+
160
+ A button that appears when scrolling down, typically used for "scroll to top" functionality.
161
+
162
+ **Props:**
163
+ - `AffixPropsT` - Extends `ComponentProps<"button">`
164
+
165
+ **Example:**
47
166
 
48
167
  ```tsx
49
- <Breadcrumbs className="breadcrumbs">
50
- <Breadcrumbs.Item className="breadcrumbs-item">
51
- <button className="btn btn-soft">Home</button>
52
- </Breadcrumbs.Item>
53
- <Breadcrumbs.Item className="breadcrumbs-item">
54
- <button className="btn btn-soft">Articles</button>
55
- </Breadcrumbs.Item>
56
- <Breadcrumbs.Item
57
- className="breadcrumbs-item"
58
- isLastItem>
59
- <button className="btn btn-fill">How to gain money?</button>
60
- </Breadcrumbs.Item>
61
- </Breadcrumbs>
168
+ import { Affix } from "@kadoui/react";
169
+ import { ArrowUpIcon } from "lucide-react";
170
+
171
+ <Affix className="btn btn-fill fixed bottom-4 right-4">
172
+ <ArrowUpIcon />
173
+ </Affix>
62
174
  ```
63
175
 
64
- or
176
+ The component automatically shows/hides based on scroll position and scrolls to top when clicked.
177
+
178
+ ---
179
+
180
+ ### Breadcrumbs
181
+
182
+ Display navigation hierarchy.
183
+
184
+ **Components:**
185
+ - `Breadcrumbs` (Root) - Requires `separator: ReactNode` prop
186
+ - `Breadcrumbs.Item` - Individual breadcrumb item
187
+
188
+ **Props:**
189
+ - `Breadcrumbs` - `ComponentProps<"nav"> & { separator: ReactNode }`
190
+ - `Breadcrumbs.Item` - `ComponentProps<"div"> & { isLastItem?: boolean }`
191
+
192
+ **Example:**
65
193
 
66
194
  ```tsx
67
- <Breadcrumbs className="breadcrumbs">
195
+ import { Breadcrumbs } from "@kadoui/react";
196
+ import { ChevronRightIcon } from "lucide-react";
197
+
198
+ <Breadcrumbs separator={<ChevronRightIcon />} className="breadcrumbs">
68
199
  <Breadcrumbs.Item className="breadcrumbs-item">
69
- <button className="btn btn-soft">Home</button>
200
+ <button className="btn">Home</button>
70
201
  </Breadcrumbs.Item>
71
202
  <Breadcrumbs.Item className="breadcrumbs-item">
72
- <button className="btn btn-soft">Articles</button>
203
+ <button className="btn">Articles</button>
73
204
  </Breadcrumbs.Item>
74
- <Breadcrumbs.Item
75
- className="breadcrumbs-item"
76
- isLastItem>
77
- <button className="btn btn-fill">How to gain money?</button>
205
+ <Breadcrumbs.Item isLastItem className="breadcrumbs-item">
206
+ <button className="btn btn-fill">Current Page</button>
78
207
  </Breadcrumbs.Item>
79
208
  </Breadcrumbs>
80
209
  ```
81
210
 
211
+ ---
212
+
82
213
  ### Carousel
83
214
 
215
+ A horizontal scrolling carousel with fade effects and navigation buttons.
216
+
217
+ **Components:**
218
+ - `Carousel` (Root) - Accepts `mouseScroll?: "auto" | "swipe"`
219
+ - `Carousel.Container` - Scrollable container (children must have `carousel-children` class)
220
+ - `Carousel.LeftFade` - Left fade overlay
221
+ - `Carousel.RightFade` - Right fade overlay
222
+ - `Carousel.PrevBtn` - Previous button
223
+ - `Carousel.NextBtn` - Next button
224
+
225
+ **Props:**
226
+ - `Carousel` - `ComponentProps<"div"> & { mouseScroll?: "auto" | "swipe" }`
227
+ - `mouseScroll="auto"` - Smooth scrolling with mouse drag
228
+ - `mouseScroll="swipe"` - Snap to items on swipe
229
+
230
+ **Example:**
231
+
84
232
  ```tsx
85
- <Carousel className="carousel">
233
+ import { Carousel } from "@kadoui/react";
234
+ import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";
235
+
236
+ <Carousel className="carousel" mouseScroll="auto">
86
237
  <Carousel.LeftFade className="carousel-left-fade" />
87
238
  <Carousel.RightFade className="carousel-right-fade" />
88
239
 
89
240
  <Carousel.Container className="carousel-container gap-3 scroll-smooth">
90
241
  {Array.from({ length: 12 }).map((_, index) => (
91
- <article
92
- key={index}
93
- className="carousel-children card slidable">
94
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Asperiores doloremque
95
- error rem ex, necessitatibus dolore deleniti alias aperiam cum ipsum, suscipit
96
- possimus porro provident totam mollitia? Voluptate, eaque quas. Culpa.
242
+ <article key={index} className="carousel-children card">
243
+ Card {index + 1}
97
244
  </article>
98
245
  ))}
99
246
  </Carousel.Container>
100
247
 
101
248
  <div className="flex items-center justify-center gap-3 mt-3">
102
249
  <Carousel.PrevBtn className="btn btn-outline btn-square">
103
- <ArrowLeftIcon className="element-icon-size" />
250
+ <ArrowLeftIcon />
104
251
  </Carousel.PrevBtn>
105
252
  <Carousel.NextBtn className="btn btn-outline btn-square">
106
- <ArrowRightIcon className="element-icon-size" />
253
+ <ArrowRightIcon />
107
254
  </Carousel.NextBtn>
108
255
  </div>
109
256
  </Carousel>
110
257
  ```
111
258
 
259
+ **Important:** Children inside `Carousel.Container` must have the `carousel-children` class for proper width calculation.
260
+
261
+ ---
262
+
263
+ ### Choice
264
+
265
+ A flexible component for radio buttons, checkboxes, filters, and switches.
266
+
267
+ **Components:**
268
+ - `Choice` (Root) - Manages choice state
269
+ - `Choice.Trigger` - Individual choice trigger
270
+ - `Choice.Navigation` - Optional keyboard navigation wrapper
271
+
272
+ **Props:**
273
+ - `Choice` - `ComponentProps<"div"> & ChoiceContextT`
274
+ - `multiple?: boolean` - Enable multiple selection
275
+ - `activeChoice: string | string[] | null` - Current selection
276
+ - `setActiveChoice: Dispatch<SetStateAction<...>>` - State setter
277
+ - `requiredOne?: boolean` - Prevent deselecting last item when `multiple` is true
278
+ - `Choice.Trigger` - `ComponentProps<"button"> & { choiceName: string }`
279
+
280
+ **Single Selection (Radio):**
281
+
282
+ ```tsx
283
+ import { Choice } from "@kadoui/react";
284
+
285
+ const [choice, setChoice] = useState<string | null>("1");
286
+
287
+ <Choice activeChoice={choice} setActiveChoice={setChoice}>
288
+ <Choice.Navigation direction="x" className="flex gap-3">
289
+ <Choice.Trigger choiceName="1" className="btn">
290
+ Option 1
291
+ </Choice.Trigger>
292
+ <Choice.Trigger choiceName="2" className="btn">
293
+ Option 2
294
+ </Choice.Trigger>
295
+ </Choice.Navigation>
296
+ </Choice>
297
+ ```
298
+
299
+ **Multiple Selection (Checkbox/Filter):**
300
+
301
+ ```tsx
302
+ const [filters, setFilters] = useState<string[]>([]);
303
+
304
+ <Choice multiple activeChoice={filters} setActiveChoice={setFilters}>
305
+ <Choice.Navigation direction="x" className="flex gap-3">
306
+ <Choice.Trigger choiceName="filter1" className="btn">
307
+ Filter 1
308
+ </Choice.Trigger>
309
+ <Choice.Trigger choiceName="filter2" className="btn">
310
+ Filter 2
311
+ </Choice.Trigger>
312
+ </Choice.Navigation>
313
+ </Choice>
314
+ ```
315
+
316
+ **Required One (Prevent Empty Selection):**
317
+
318
+ ```tsx
319
+ <Choice
320
+ multiple
321
+ requiredOne
322
+ activeChoice={filters}
323
+ setActiveChoice={setFilters}
324
+ >
325
+ {/* At least one item must always be selected */}
326
+ </Choice>
327
+ ```
328
+
329
+ ---
330
+
112
331
  ### ClientOnly
113
332
 
333
+ Render children only on the client side (useful for SSR).
334
+
335
+ **Props:**
336
+ - `ClientOnlyPropsT` - `PropsWithChildren`
337
+
338
+ **Example:**
339
+
114
340
  ```tsx
115
- <p>There is server</p>
341
+ import { ClientOnly } from "@kadoui/react";
342
+
343
+ <p>This renders on server and client</p>
116
344
  <ClientOnly>
117
- <p>There is client</p>
345
+ <p>This only renders on client</p>
118
346
  </ClientOnly>
119
347
  ```
120
348
 
349
+ ---
350
+
121
351
  ### Clipboard
122
352
 
353
+ Copy text to clipboard with visual feedback.
354
+
355
+ **Props:**
356
+ - `ClipboardPropsT` - `ComponentProps<"button"> & { text: string; timeout?: number; copiedChildren?: ReactNode }`
357
+ - `text: string` - Text to copy
358
+ - `timeout?: number` - Timeout for copied state (default: 3000ms)
359
+ - `copiedChildren?: ReactNode` - Content to show when copied
360
+
361
+ **Example:**
362
+
123
363
  ```tsx
364
+ import { Clipboard } from "@kadoui/react";
365
+ import { CopyIcon, CopyCheckIcon } from "lucide-react";
366
+
124
367
  <Clipboard
125
- text="Kadoui-react"
126
- className="btn btn-soft btn-square"
127
- copiedChildren={<CopyCheckIcon className="element-icon-size" />}>
128
- <CopyIcon className="element-icon-size" />
368
+ text="Hello World"
369
+ className="btn btn-soft"
370
+ copiedChildren={<CopyCheckIcon />}
371
+ timeout={2000}
372
+ >
373
+ <CopyIcon />
129
374
  </Clipboard>
130
375
  ```
131
376
 
377
+ ---
378
+
132
379
  ### ContextMenu
133
380
 
381
+ Right-click context menu.
382
+
383
+ **Components:**
384
+ - `ContextMenu` (Root) - Wrapper (responds to right-click)
385
+ - `ContextMenu.Body` - Menu content
386
+ - `ContextMenu.Item` - Menu item
387
+ - `ContextMenu.Navigation` - Optional keyboard navigation
388
+
389
+ **Example:**
390
+
134
391
  ```tsx
135
- <ContextMenu className="context-menu border-4 border-dashed border-foreground h-[33vh]">
136
- <span className="absolute inset-center">Context menu!</span>
392
+ import { ContextMenu } from "@kadoui/react";
393
+ import { TrashIcon, RefreshCwIcon } from "lucide-react";
394
+
395
+ <ContextMenu className="border-4 border-dashed h-[33vh]">
396
+ <span>Right-click here!</span>
137
397
 
138
398
  <ContextMenu.Body className="context-menu-body">
139
- <AccessNavigation className="card card-menu card-y">
140
- <button className="btn btn-ghost">
141
- <TrashIcon className="compatible-icon" />
142
- <span>DELETE</span>
143
- </button>
144
- <button className="btn btn-ghost">
145
- <RefreshCwIcon className="compatible-icon" />
146
- <span>RELOAD</span>
147
- </button>
148
- <button className="btn btn-ghost">
149
- <FlagIcon className="compatible-icon" />
150
- <span>IGNORE IT</span>
151
- </button>
152
- </AccessNavigation>
399
+ <ContextMenu.Navigation direction="y" className="card card-menu">
400
+ <ContextMenu.Item className="btn btn-ghost">
401
+ <TrashIcon />
402
+ <span>Delete</span>
403
+ </ContextMenu.Item>
404
+ <ContextMenu.Item className="btn btn-ghost">
405
+ <RefreshCwIcon />
406
+ <span>Reload</span>
407
+ </ContextMenu.Item>
408
+ </ContextMenu.Navigation>
153
409
  </ContextMenu.Body>
154
410
  </ContextMenu>
155
411
  ```
156
412
 
157
- ### Drawer
413
+ **API:**
414
+ - `ContextMenu` - `ComponentProps<"div">`
415
+ - `ContextMenu.Body` - `ComponentProps<"div">`
416
+ - `ContextMenu.Item` - `ComponentProps<"button">`
417
+ - `ContextMenu.Navigation` - `AccessNavigationPropsT`
158
418
 
159
- ```tsx
160
- <Drawer>
161
- <Drawer.Toggle className="btn btn-soft">Open left drawer</Drawer.Toggle>
419
+ ---
162
420
 
163
- <Drawer.Portal className="drawer-portal">
164
- <Drawer.Body className="drawer-body">
165
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum porro vero delectus
166
- eum qui laboriosam, dolore veritatis eligendi amet voluptatibus incidunt temporibus
167
- dolores fuga adipisci eius saepe quod aspernatur iure.
168
- </Drawer.Body>
169
- </Drawer.Portal>
170
- </Drawer>
171
- ```
421
+ ### Drawer
172
422
 
173
- or
423
+ Slide-out panel from any edge.
174
424
 
175
- ```tsx
176
- <Drawer>
177
- <Drawer.Toggle className="btn btn-soft">Open top drawer</Drawer.Toggle>
425
+ **Components:**
426
+ - `Drawer` (Root)
427
+ - `Drawer.Toggle` - Button to open drawer
428
+ - `Drawer.Portal` - Portal wrapper (required)
429
+ - `Drawer.Body` - Drawer content
178
430
 
179
- <Drawer.Portal className="drawer-portal">
180
- <Drawer.Body
181
- className="drawer-body"
182
- position="top">
183
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum porro vero delectus
184
- eum qui laboriosam, dolore veritatis eligendi amet voluptatibus incidunt temporibus
185
- dolores fuga adipisci eius saepe quod aspernatur iure.
186
- </Drawer.Body>
187
- </Drawer.Portal>
188
- </Drawer>
189
- ```
431
+ **Props:**
432
+ - `Drawer` - `PropsWithChildren`
433
+ - `Drawer.Body` - `HTMLMotionProps<"div"> & { position?: "top" | "right" | "bottom" | "left" }`
190
434
 
191
- or
435
+ **Example:**
192
436
 
193
437
  ```tsx
438
+ import { Drawer } from "@kadoui/react";
439
+
194
440
  <Drawer>
195
- <Drawer.Toggle className="btn btn-soft">Open right drawer</Drawer.Toggle>
441
+ <Drawer.Toggle className="btn">Open Drawer</Drawer.Toggle>
196
442
 
197
443
  <Drawer.Portal className="drawer-portal">
198
- <Drawer.Body
199
- className="drawer-body"
200
- position="right">
201
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum porro vero delectus
202
- eum qui laboriosam, dolore veritatis eligendi amet voluptatibus incidunt temporibus
203
- dolores fuga adipisci eius saepe quod aspernatur iure.
444
+ <Drawer.Body className="drawer-body" position="left">
445
+ <p>Drawer content</p>
204
446
  </Drawer.Body>
205
447
  </Drawer.Portal>
206
448
  </Drawer>
207
449
  ```
208
450
 
209
- or
451
+ **Positions:**
452
+ - `position="left"` (default in LTR)
453
+ - `position="right"` (default in RTL)
454
+ - `position="top"`
455
+ - `position="bottom"`
210
456
 
211
- ```tsx
212
- <Drawer>
213
- <Drawer.Toggle className="btn btn-soft">Open bottom drawer</Drawer.Toggle>
457
+ **Focus Management:**
458
+ Add `data-drawer="focus"` to any focusable element to auto-focus when drawer opens:
214
459
 
215
- <Drawer.Portal className="drawer-portal">
216
- <Drawer.Body
217
- className="drawer-body"
218
- position="bottom">
219
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum porro vero delectus
220
- eum qui laboriosam, dolore veritatis eligendi amet voluptatibus incidunt temporibus
221
- dolores fuga adipisci eius saepe quod aspernatur iure.
222
- </Drawer.Body>
223
- </Drawer.Portal>
224
- </Drawer>
460
+ ```tsx
461
+ <Drawer.Body>
462
+ <input type="text" data-drawer="focus" placeholder="Auto-focused input" />
463
+ </Drawer.Body>
225
464
  ```
226
465
 
466
+ ---
467
+
227
468
  ### Modal
228
469
 
470
+ Centered modal dialog.
471
+
472
+ **Components:**
473
+ - `Modal` (Root) - Accepts `defaultOpen?: boolean`
474
+ - `Modal.Toggle` - Button to toggle modal
475
+ - `Modal.Portal` - Portal wrapper (required)
476
+ - `Modal.Body` - Modal container
477
+ - `Modal.Header` - Header section
478
+ - `Modal.Content` - Content section
479
+
480
+ **Example:**
481
+
229
482
  ```tsx
230
- <Modal>
231
- <Modal.Toggle className="btn btn-soft">Open modal</Modal.Toggle>
483
+ import { Modal } from "@kadoui/react";
484
+
485
+ <Modal defaultOpen={false}>
486
+ <Modal.Toggle className="btn">Open Modal</Modal.Toggle>
232
487
 
233
488
  <Modal.Portal className="modal-portal">
234
489
  <Modal.Body className="modal-body">
235
- <Modal.Header className="modal-header font-bold justify-center">
236
- Say hello to modal
490
+ <Modal.Header className="modal-header">
491
+ Modal Title
237
492
  </Modal.Header>
238
- <Modal.Content className="modal-content max-w-xl">
239
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Dignissimos, ratione
240
- repudiandae eveniet quisquam, vitae, nobis iure voluptas harum est incidunt odio?
241
- Dolorem quod numquam placeat sed beatae, natus cum porro!
493
+ <Modal.Content className="modal-content">
494
+ <p>Modal content goes here</p>
242
495
  </Modal.Content>
243
496
  </Modal.Body>
244
497
  </Modal.Portal>
245
498
  </Modal>
246
499
  ```
247
500
 
248
- ### OTP
501
+ **Focus Management:**
502
+ Add `data-modal="focus"` to auto-focus when modal opens:
503
+
504
+ ```tsx
505
+ <Modal.Content>
506
+ <input type="text" data-modal="focus" />
507
+ </Modal.Content>
508
+ ```
509
+
510
+ **API:**
511
+ - `Modal` - `PropsWithChildren & { defaultOpen?: boolean }`
512
+ - `Modal.Toggle` - `ComponentProps<"button">`
513
+ - `Modal.Portal` - `HTMLMotionProps<"div">`
514
+ - `Modal.Body` - `HTMLMotionProps<"div">`
515
+ - `Modal.Header` - `ComponentProps<"div">`
516
+ - `Modal.Content` - `ComponentProps<"div">`
517
+
518
+ ---
519
+
520
+ ### OTP (One-Time Password)
521
+
522
+ Input component for OTP codes with auto-advance and paste support.
523
+
524
+ **Components:**
525
+ - `Otp` (Root) - Accepts `autoFocus?: boolean`
526
+ - `Otp.Inputs` - Renders multiple inputs
527
+ - `Otp.HiddenInput` - Hidden input for form submission
528
+
529
+ **Props:**
530
+ - `Otp` - `Omit<AccessNavigationPropsT, "direction"> & { autoFocus?: boolean }`
531
+ - `Otp.Inputs` - `ComponentProps<"input"> & { length: number; onLastChange?: (otp: string) => void }`
532
+ - `Otp.HiddenInput` - `ComponentProps<"input">`
533
+
534
+ **Example:**
249
535
 
250
536
  ```tsx
251
- <Otp className="otp">
537
+ import { Otp } from "@kadoui/react";
538
+
539
+ <Otp className="otp" autoFocus>
252
540
  <Otp.Inputs
253
541
  length={6}
254
542
  className="input input-outline input-square"
255
- onLastChange={(otp) => alert(otp)}
543
+ onLastChange={(otp) => console.log("OTP:", otp)}
256
544
  />
257
-
258
- <Otp.HiddenInput />
545
+ <Otp.HiddenInput name="otp" />
259
546
  </Otp>
260
547
  ```
261
548
 
549
+ **Features:**
550
+ - Auto-advances to next input on typing
551
+ - Supports paste (pastes across all inputs)
552
+ - Backspace navigates to previous input
553
+ - `onLastChange` callback when all inputs are filled
554
+
555
+ ---
556
+
262
557
  ### Pagination
263
558
 
264
- With state:
559
+ Pagination component with two variants: state-based and URL search params-based.
560
+
561
+ **Variants:**
562
+ - `PaginationWithState` - Uses React state
563
+ - `PaginationWithSearchParams` - Uses URL search params (Next.js)
564
+
565
+ **Components:**
566
+ - `PaginationWithState` / `PaginationWithSearchParams` (Root)
567
+ - `.Pages` - Renders page content (when using `pages` prop)
568
+ - `.Counts` - Page number buttons
569
+ - `.PrevBtn` - Previous button
570
+ - `.NextBtn` - Next button
571
+
572
+ **Props:**
573
+ - Root: `PaginationPropsT` - `ComponentProps<"div"> & (PaginationWithLengthT | PaginationWithPagesT)`
574
+ - `pagesLength: number` OR `pages: PaginationPagesT[]`
575
+ - `PaginationWithState` also requires: `page: number; setPage: Dispatch<SetStateAction<number>>`
576
+ - `PaginationWithSearchParams` accepts: `pageKey?: string` (default: "page")
577
+
578
+ **With State (Simple):**
265
579
 
266
580
  ```tsx
267
- <PaginationWithState pagesLength={6}>
268
- <div className="pagination">
269
- <PaginationWithState.PrevBtn className="btn btn-soft btn-square">
270
- <ChevronLeftIcon className="element-icon-size" />
271
- </PaginationWithState.PrevBtn>
581
+ import { PaginationWithState } from "@kadoui/react";
582
+ import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
272
583
 
273
- <PaginationWithState.Counts className="btn data-[state=false]:btn-ghost data-[state=true]:btn-fill" />
584
+ const [page, setPage] = useState(1);
274
585
 
275
- <PaginationWithState.NextBtn className="btn btn-soft btn-square">
276
- <ChevronRightIcon className="element-icon-size" />
586
+ <PaginationWithState pagesLength={10} page={page} setPage={setPage}>
587
+ <div className="pagination">
588
+ <PaginationWithState.PrevBtn className="btn btn-square">
589
+ <ChevronLeftIcon />
590
+ </PaginationWithState.PrevBtn>
591
+ <PaginationWithState.Counts className="btn" />
592
+ <PaginationWithState.NextBtn className="btn btn-square">
593
+ <ChevronRightIcon />
277
594
  </PaginationWithState.NextBtn>
278
595
  </div>
279
596
  </PaginationWithState>
280
597
  ```
281
598
 
282
- With search params:
599
+ **With Search Params (Next.js):**
283
600
 
284
601
  ```tsx
602
+ import { PaginationWithSearchParams } from "@kadoui/react";
603
+ import { Suspense } from "react";
604
+
285
605
  <Suspense>
286
- <PaginationWithSearchParams pagesLength={6}>
606
+ <PaginationWithSearchParams pagesLength={10} pageKey="p">
287
607
  <div className="pagination">
288
- <PaginationWithSearchParams.PrevBtn className="btn btn-soft btn-square">
289
- <ChevronLeftIcon className="element-icon-size" />
608
+ <PaginationWithSearchParams.PrevBtn className="btn">
609
+ Previous
290
610
  </PaginationWithSearchParams.PrevBtn>
291
-
292
- <PaginationWithSearchParams.Counts className="btn data-[state=false]:btn-ghost data-[state=true]:btn-fill" />
293
-
294
- <PaginationWithSearchParams.NextBtn className="btn btn-soft btn-square">
295
- <ChevronRightIcon className="element-icon-size" />
611
+ <PaginationWithSearchParams.Counts className="btn" />
612
+ <PaginationWithSearchParams.NextBtn className="btn">
613
+ Next
296
614
  </PaginationWithSearchParams.NextBtn>
297
615
  </div>
298
616
  </PaginationWithSearchParams>
299
617
  </Suspense>
300
618
  ```
301
619
 
302
- ### Pagination with pages
303
-
304
- With state:
620
+ **With Custom Pages:**
305
621
 
306
622
  ```tsx
307
- const PAGES_WITH_STATE = [
623
+ const pages = [
308
624
  {
309
- name: "Hello world",
310
- component: (
311
- <p>
312
- One: Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quis officiis quia,
313
- dolores similique, cumque ut vel aspernatur non vitae voluptas reiciendis? Veniam,
314
- voluptates impedit soluta blanditiis ad nam eligendi dignissimos.
315
- </p>
316
- ),
625
+ name: "Page 1",
626
+ component: <div>Page 1 Content</div>
317
627
  },
318
628
  {
319
- name: "Finish",
320
- component: (
321
- <p>
322
- Two: Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quis officiis quia,
323
- dolores similique, cumque ut vel aspernatur non vitae voluptas reiciendis? Veniam,
324
- voluptates impedit soluta blanditiis ad nam eligendi dignissimos.
325
- </p>
326
- ),
327
- },
629
+ name: "Page 2",
630
+ component: <div>Page 2 Content</div>
631
+ }
328
632
  ];
329
633
 
330
- <PaginationWithState pages={PAGES_WITH_STATE}>
331
- <div className="max-w-96">
332
- <PaginationWithState.Pages />
333
-
334
- <div className="pagination">
335
- <PaginationWithState.PrevBtn className="btn btn-soft btn-square">
336
- <ChevronLeftIcon className="element-icon-size" />
337
- </PaginationWithState.PrevBtn>
338
-
339
- <PaginationWithState.Counts className="btn data-[state=false]:btn-ghost data-[state=true]:btn-fill" />
340
-
341
- <PaginationWithState.NextBtn className="btn btn-soft btn-square">
342
- <ChevronRightIcon className="element-icon-size" />
343
- </PaginationWithState.NextBtn>
344
- </div>
345
- </div>
346
- </PaginationWithState>;
634
+ <PaginationWithState pages={pages} page={page} setPage={setPage}>
635
+ <PaginationWithState.Pages />
636
+ {/* Navigation buttons */}
637
+ </PaginationWithState>
347
638
  ```
348
639
 
349
- With search params:
350
-
351
- ```tsx
352
- const PAGES_WITH_SEARCHPARAMS = [
353
- {
354
- name: "Hello world",
355
- component: (
356
- <p>
357
- One: Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quis officiis quia,
358
- dolores similique, cumque ut vel aspernatur non vitae voluptas reiciendis? Veniam,
359
- voluptates impedit soluta blanditiis ad nam eligendi dignissimos.
360
- </p>
361
- ),
362
- },
363
- {
364
- name: "Finish",
365
- component: (
366
- <p>
367
- Two: Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quis officiis quia,
368
- dolores similique, cumque ut vel aspernatur non vitae voluptas reiciendis? Veniam,
369
- voluptates impedit soluta blanditiis ad nam eligendi dignissimos.
370
- </p>
371
- ),
372
- },
373
- ];
374
-
375
- <Suspense>
376
- <PaginationWithSearchParams pages={PAGES_WITH_SEARCHPARAMS}>
377
- <div className="max-w-96">
378
- <PaginationWithSearchParams.Pages />
640
+ ---
379
641
 
380
- <div className="pagination">
381
- <PaginationWithSearchParams.PrevBtn className="btn btn-soft btn-square">
382
- <ChevronLeftIcon className="element-icon-size" />
383
- </PaginationWithSearchParams.PrevBtn>
642
+ ### PasswordInput
384
643
 
385
- <PaginationWithSearchParams.Counts className="btn data-[state=false]:btn-ghost data-[state=true]:btn-fill" />
644
+ Password input with visibility toggle.
386
645
 
387
- <PaginationWithSearchParams.NextBtn className="btn btn-soft btn-square">
388
- <ChevronRightIcon className="element-icon-size" />
389
- </PaginationWithSearchParams.NextBtn>
390
- </div>
391
- </div>
392
- </PaginationWithSearchParams>
393
- </Suspense>;
394
- ```
646
+ **Components:**
647
+ - `PasswordInput` (Root)
648
+ - `PasswordInput.Field` - Input field
649
+ - `PasswordInput.Toggle` - Visibility toggle button
395
650
 
396
- ### PasswordInput
651
+ **Example:**
397
652
 
398
653
  ```tsx
654
+ import { PasswordInput } from "@kadoui/react";
655
+ import { EyeIcon, EyeClosedIcon } from "lucide-react";
656
+
399
657
  <PasswordInput className="input input-outline">
400
- <PasswordInput.Field className="input-field" />
658
+ <PasswordInput.Field className="input-field" placeholder="Password" />
401
659
  <PasswordInput.Toggle
402
660
  className="btn btn-ghost btn-sm"
403
- visibleChildren={<EyeIcon className="element-icon-size" />}>
404
- <EyeClosedIcon className="element-icon-size" />
661
+ visibleChildren={<EyeIcon />}
662
+ >
663
+ <EyeClosedIcon />
405
664
  </PasswordInput.Toggle>
406
665
  </PasswordInput>
407
666
  ```
408
667
 
668
+ **API:**
669
+ - `PasswordInput` - `ComponentProps<"label">`
670
+ - `PasswordInput.Field` - `ComponentProps<"input">`
671
+ - `PasswordInput.Toggle` - `ComponentProps<"button"> & { visibleChildren: ReactNode }`
672
+
673
+ ---
674
+
409
675
  ### Popover
410
676
 
677
+ Popover component with multiple trigger modes.
678
+
679
+ **Components:**
680
+ - `Popover` (Root) - Accepts `mode?: "click" | "hover" | "both"`
681
+ - `Popover.Toggle` - Trigger button
682
+ - `Popover.Body` - Popover content
683
+ - `Popover.Navigation` - Optional keyboard navigation
684
+
685
+ **Props:**
686
+ - `Popover` - `ComponentProps<"div"> & { mode?: "click" | "hover" | "both" }`
687
+ - `Popover.Body` - `ComponentProps<"div"> & { preventClose?: boolean }`
688
+
689
+ **Click Mode:**
690
+
411
691
  ```tsx
412
- <Popover
413
- className="popover"
414
- mode="hover">
415
- <Popover.Toggle className="btn btn-soft">Hover me</Popover.Toggle>
692
+ import { Popover } from "@kadoui/react";
416
693
 
417
- <Popover.Body className="popover-body popover-body-b card card-menu max-w-[200%]">
418
- Lorem ipsum dolor sit amet, consectetur adipisicing.
694
+ <Popover mode="click" className="popover">
695
+ <Popover.Toggle className="btn">Click me</Popover.Toggle>
696
+ <Popover.Body className="popover-body card">
697
+ Popover content
419
698
  </Popover.Body>
420
699
  </Popover>
421
700
  ```
422
701
 
423
- or
702
+ **Hover Mode:**
424
703
 
425
704
  ```tsx
426
- <Popover
427
- className="popover"
428
- mode="both">
429
- <Popover.Toggle className="btn btn-soft">Hover and click me</Popover.Toggle>
705
+ <Popover mode="hover" className="popover">
706
+ <Popover.Toggle className="btn">Hover me</Popover.Toggle>
707
+ <Popover.Body className="popover-body card">
708
+ Popover content
709
+ </Popover.Body>
710
+ </Popover>
711
+ ```
430
712
 
431
- <Popover.Body className="popover-body popover-body-b card card-menu max-w-[200%]">
432
- Lorem ipsum dolor sit amet, consectetur adipisicing.
713
+ **Both Mode:**
714
+
715
+ ```tsx
716
+ <Popover mode="both" className="popover">
717
+ <Popover.Toggle className="btn">Hover or click</Popover.Toggle>
718
+ <Popover.Body className="popover-body card">
719
+ Popover content
433
720
  </Popover.Body>
434
721
  </Popover>
435
722
  ```
436
723
 
437
- or
724
+ **With Navigation:**
438
725
 
439
726
  ```tsx
440
- <Popover
441
- className="popover"
442
- mode="click">
443
- <Popover.Toggle className="btn btn-soft">Click me</Popover.Toggle>
727
+ <Popover mode="click">
728
+ <Popover.Navigation direction="y">
729
+ <Popover.Toggle className="btn">Menu</Popover.Toggle>
730
+ <Popover.Body className="card card-menu">
731
+ <button className="btn">Option 1</button>
732
+ <button className="btn">Option 2</button>
733
+ </Popover.Body>
734
+ </Popover.Navigation>
735
+ </Popover>
736
+ ```
737
+
738
+ **Nested Popovers:**
444
739
 
445
- <Popover.Body className="popover-body popover-body-b card card-menu max-w-[200%]">
446
- Lorem ipsum dolor sit amet, consectetur adipisicing.
740
+ ```tsx
741
+ <Popover mode="click">
742
+ <Popover.Toggle>Parent</Popover.Toggle>
743
+ <Popover.Body>
744
+ <Popover mode="click">
745
+ <Popover.Toggle>Child</Popover.Toggle>
746
+ <Popover.Body>Nested content</Popover.Body>
747
+ </Popover>
447
748
  </Popover.Body>
448
749
  </Popover>
449
750
  ```
450
751
 
752
+ ---
753
+
451
754
  ### Portal
452
755
 
756
+ Render children into a different DOM node.
757
+
758
+ **Props:**
759
+ - `PortalPropsT` - `PropsWithChildren & { container?: Element }`
760
+
761
+ **Example:**
762
+
453
763
  ```tsx
454
- <Portal>
455
- <p>
456
- Lorem ipsum dolor sit, amet consectetur adipisicing elit. Similique placeat eligendi
457
- dolore adipisci sunt magni quo accusamus commodi rerum excepturi! Temporibus
458
- molestias, et nesciunt ut aut labore quod nihil magni?
459
- </p>
764
+ import { Portal } from "@kadoui/react";
765
+
766
+ <Portal container={document.getElementById("portal-root")}>
767
+ <p>This renders in a different DOM node</p>
460
768
  </Portal>
461
769
  ```
462
770
 
771
+ **Default Behavior:**
772
+ If no `container` is provided, children are rendered into `document.body`.
773
+
774
+ ---
775
+
463
776
  ### Progress
464
777
 
778
+ Progress bar component.
779
+
780
+ **Components:**
781
+ - `Progress` (Root) - Requires `value: number; maxValue?: number`
782
+ - `Progress.Bar` - Progress bar element
783
+
784
+ **Props:**
785
+ - `Progress` - `ComponentProps<"div"> & { value: number; maxValue?: number }`
786
+ - `Progress.Bar` - `HTMLMotionProps<"div"> & { duration?: number }`
787
+
788
+ **Example:**
789
+
790
+ ```tsx
791
+ import { Progress } from "@kadoui/react";
792
+
793
+ <Progress className="progress" value={45} maxValue={100}>
794
+ <Progress.Bar className="progress-bar" duration={2} />
795
+ </Progress>
796
+ ```
797
+
798
+ **With Custom Content:**
799
+
465
800
  ```tsx
466
- <Progress
467
- className="progress"
468
- value={45}>
469
- <Progress.Bar className="progress-bar" />
801
+ <Progress value={75}>
802
+ <Progress.Bar>
803
+ <span>75%</span>
804
+ </Progress.Bar>
470
805
  </Progress>
471
806
  ```
472
807
 
808
+ ---
809
+
473
810
  ### QrCode
474
811
 
812
+ Generate QR codes from text/URLs.
813
+
814
+ **Props:**
815
+ - `QrCodePropsT` - `ComponentProps<"canvas"> & { value: string; options?: QRCodeRenderersOptions }`
816
+
817
+ **Example:**
818
+
475
819
  ```tsx
820
+ import { QrCode } from "@kadoui/react";
821
+
476
822
  <QrCode
477
823
  className="w-96 rounded-lg"
478
824
  value="https://github.com/FarzadVav"
479
- options={{ width: 384 }}
825
+ options={{ width: 384, margin: 2 }}
480
826
  />
481
827
  ```
482
828
 
829
+ **Options:**
830
+ See [qrcode library options](https://www.npmjs.com/package/qrcode#options) for available configuration.
831
+
832
+ ---
833
+
483
834
  ### Rating
484
835
 
836
+ Star rating component with hover effects.
837
+
838
+ **Components:**
839
+ - `Rating` (Root)
840
+ - `Rating.Items` - Rating items
841
+
842
+ **Props:**
843
+ - `Rating` - `ComponentProps<"div">`
844
+ - `Rating.Items` - `ComponentProps<"button"> & { count: number; value: number; onValueChange: (value: number) => void; element: ReactNode; activeElement: ReactNode }`
845
+
846
+ **Example:**
847
+
485
848
  ```tsx
849
+ import { Rating } from "@kadoui/react";
850
+ import { StarIcon } from "lucide-react";
851
+ import { useState } from "react";
852
+
486
853
  const [rating, setRating] = useState(3);
487
854
 
488
855
  <Rating className="rating">
@@ -494,186 +861,495 @@ const [rating, setRating] = useState(3);
494
861
  element={<StarIcon className="size-9" />}
495
862
  activeElement={<StarIcon className="fill-foreground size-9" />}
496
863
  />
497
- </Rating>;
864
+ </Rating>
865
+ ```
866
+
867
+ ---
868
+
869
+ ### SelectBox
870
+
871
+ Advanced select component with search and multi-select support.
872
+
873
+ **Components:**
874
+ - `SelectBox` (Root) - Requires `options: SelectBoxOptionT[]` and selection state
875
+ - `SelectBox.Input` - Input wrapper
876
+ - `SelectBox.Field` - Display field
877
+ - `SelectBox.List` - Dropdown list
878
+ - `SelectBox.SearchInput` - Search input wrapper
879
+ - `SelectBox.SearchField` - Search input field
880
+ - `SelectBox.Options` - Option buttons
881
+
882
+ **Types:**
883
+ ```tsx
884
+ type SelectBoxOptionT = { name: string; value: string };
498
885
  ```
499
886
 
887
+ **Single Select:**
888
+
889
+ ```tsx
890
+ import { SelectBox, SelectBoxOptionT } from "@kadoui/react";
891
+ import { ChevronDownIcon, SearchIcon } from "lucide-react";
892
+ import { useState } from "react";
893
+
894
+ const options: SelectBoxOptionT[] = [
895
+ { name: "one", value: "One" },
896
+ { name: "two", value: "Two" },
897
+ { name: "three", value: "Three" }
898
+ ];
899
+
900
+ const [selected, setSelected] = useState<SelectBoxOptionT | null>(null);
901
+
902
+ <SelectBox
903
+ options={options}
904
+ optionValue={selected}
905
+ setOptionValue={setSelected}
906
+ >
907
+ <SelectBox.Input className="select-box-input input">
908
+ <ChevronDownIcon />
909
+ <SelectBox.Field className="input-field" placeholder="Select..." />
910
+ <SelectBox.List className="select-box-list">
911
+ <SelectBox.SearchInput className="input">
912
+ <SearchIcon />
913
+ <SelectBox.SearchField className="input-field" />
914
+ </SelectBox.SearchInput>
915
+ <SelectBox.Options className="select-box-option btn" />
916
+ </SelectBox.List>
917
+ </SelectBox.Input>
918
+ </SelectBox>
919
+ ```
920
+
921
+ **Multi Select:**
922
+
923
+ ```tsx
924
+ const [selected, setSelected] = useState<SelectBoxOptionT[]>([]);
925
+
926
+ <SelectBox
927
+ multiSelect
928
+ options={options}
929
+ optionValue={selected}
930
+ setOptionValue={setSelected}
931
+ >
932
+ {/* Same structure as single select */}
933
+ </SelectBox>
934
+ ```
935
+
936
+ **API:**
937
+ - `SelectBox` - `ComponentPropsWithoutRef<"div"> & MergedSelectMode & { options: SelectBoxOptionT[] }`
938
+ - `SelectBox.Field` - `ComponentProps<"input">`
939
+ - `SelectBox.SearchField` - `ComponentProps<"input">`
940
+ - `SelectBox.Options` - `ComponentProps<"button">`
941
+
942
+ ---
943
+
500
944
  ### Sheet
501
945
 
946
+ Bottom sheet component (mobile-friendly drawer from bottom).
947
+
948
+ **Components:**
949
+ - `Sheet` (Root)
950
+ - `Sheet.Toggle` - Toggle button
951
+ - `Sheet.Portal` - Portal wrapper
952
+ - `Sheet.Body` - Sheet container
953
+ - `Sheet.Header` - Header section
954
+ - `Sheet.Handlebar` - Drag handle
955
+ - `Sheet.Content` - Scrollable content
956
+
957
+ **Example:**
958
+
502
959
  ```tsx
960
+ import { Sheet } from "@kadoui/react";
961
+
503
962
  <Sheet>
504
- <Sheet.Toggle className="btn btn-soft">Open sheet</Sheet.Toggle>
963
+ <Sheet.Toggle className="btn">Open Sheet</Sheet.Toggle>
505
964
 
506
965
  <Sheet.Portal className="sheet-portal">
507
966
  <Sheet.Body className="sheet-body">
508
967
  <Sheet.Header className="sheet-header">
509
968
  <Sheet.Handlebar className="sheet-handlebar" />
510
969
  </Sheet.Header>
511
-
512
970
  <Sheet.Content className="sheet-content">
513
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestiae explicabo
514
- numquam sed dolorem nesciunt repellat deleniti quisquam laudantium? Quas ullam
515
- magni voluptate esse animi vero dicta maxime mollitia amet dolor.
971
+ <p>Sheet content</p>
516
972
  </Sheet.Content>
517
973
  </Sheet.Body>
518
974
  </Sheet.Portal>
519
975
  </Sheet>
520
976
  ```
521
977
 
978
+ **Features:**
979
+ - Drag to close (drag down)
980
+ - Auto-focus support with `data-sheet="focus"`
981
+ - Smooth animations
982
+
983
+ ---
984
+
522
985
  ### ShowMore
523
986
 
987
+ Truncate text with "show more" functionality.
988
+
989
+ **Components:**
990
+ - `ShowMore` (Root) - Requires `maxLines: number; defaultExpanded?: boolean`
991
+ - `ShowMore.Content` - Content to truncate
992
+ - `ShowMore.Fade` - Fade overlay (shown when collapsed)
993
+ - `ShowMore.Toggle` - Toggle button
994
+
995
+ **Example:**
996
+
524
997
  ```tsx
525
- <ShowMore
526
- className="max-w-96"
527
- maxLines={3}>
998
+ import { ShowMore } from "@kadoui/react";
999
+
1000
+ <ShowMore className="max-w-96" maxLines={3} defaultExpanded={false}>
528
1001
  <ShowMore.Content>
529
- Lorem ipsum dolor sit, amet consectetur adipisicing elit. Accusantium exercitationem
530
- repellendus debitis, dignissimos non quis! Fugit ducimus adipisci minus quas est
531
- expedita, voluptatibus minima ad facere quis, dolor ipsum debitis!
1002
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit...
532
1003
  </ShowMore.Content>
533
-
534
1004
  <ShowMore.Fade className="show-more-fade" />
535
-
536
- <ShowMore.Toggle className="btn btn-soft mt-1.5">Show more</ShowMore.Toggle>
1005
+ <ShowMore.Toggle className="btn">Show more</ShowMore.Toggle>
537
1006
  </ShowMore>
538
1007
  ```
539
1008
 
1009
+ **API:**
1010
+ - `ShowMore` - `ComponentProps<"div"> & { maxLines: number; defaultExpanded?: boolean }`
1011
+ - `ShowMore.Content` - `ComponentProps<"div">`
1012
+ - `ShowMore.Fade` - `ComponentProps<"div">`
1013
+ - `ShowMore.Toggle` - `ComponentProps<"button">`
1014
+
1015
+ ---
1016
+
540
1017
  ### Spoiler
541
1018
 
1019
+ Click to reveal hidden text (useful for spoiler warnings).
1020
+
1021
+ **Components:**
1022
+ - `Spoiler` (Root)
1023
+ - `Spoiler.Blur` - Blurred/hidden content
1024
+
1025
+ **Example:**
1026
+
542
1027
  ```tsx
1028
+ import { Spoiler } from "@kadoui/react";
1029
+
543
1030
  <p>
544
1031
  Lorem ipsum dolor sit{" "}
545
1032
  <Spoiler className="spoiler">
546
- <Spoiler.Blur className="spoiler-blur">amet consectetur adipisicing</Spoiler.Blur>
1033
+ <Spoiler.Blur className="spoiler-blur">
1034
+ amet consectetur adipisicing
1035
+ </Spoiler.Blur>
547
1036
  </Spoiler>{" "}
548
- elit. Officiis nemo incidunt tenetur assumenda consequuntur beatae harum iusto, libero
549
- labore! Ea quo dolore accusantium veniam illo vel quae nihil iure aliquid.
1037
+ elit.
550
1038
  </p>
551
1039
  ```
552
1040
 
1041
+ **API:**
1042
+ - `Spoiler` - `ComponentProps<"span">`
1043
+ - `Spoiler.Blur` - `ComponentProps<"span">`
1044
+
1045
+ ---
1046
+
553
1047
  ### Submit
554
1048
 
1049
+ Form submit button with loading state.
1050
+
1051
+ **Components:**
1052
+ - `Submit` (Root) - Must be inside a `<form>` with `action`
1053
+ - `Submit.Loader` - Loading indicator
1054
+
1055
+ **Example:**
1056
+
555
1057
  ```tsx
556
- <form
557
- action={async () => {
558
- await new Promise((resolve) => setTimeout(resolve, 1000));
559
- }}>
560
- <Submit className="btn btn-soft">
561
- <span>Press the from</span>
562
- <Submit.Loader loader={<LoaderIcon className="element-icon-size animate-spin" />}>
563
- <SendHorizonalIcon className="element-icon-size" />
1058
+ import { Submit } from "@kadoui/react";
1059
+ import { SendHorizonalIcon, LoaderIcon } from "lucide-react";
1060
+
1061
+ <form action={async () => {
1062
+ await new Promise(resolve => setTimeout(resolve, 1000));
1063
+ }}>
1064
+ <Submit className="btn">
1065
+ <span>Submit</span>
1066
+ <Submit.Loader loader={<LoaderIcon className="animate-spin" />}>
1067
+ <SendHorizonalIcon />
564
1068
  </Submit.Loader>
565
1069
  </Submit>
566
1070
  </form>
567
1071
  ```
568
1072
 
1073
+ **Features:**
1074
+ - Automatically disabled during form submission
1075
+ - Uses React Server Actions (`useFormStatus`)
1076
+ - Shows loader during pending state
1077
+
1078
+ **API:**
1079
+ - `Submit` - `ComponentProps<"button"> & { loader?: ReactNode }`
1080
+ - `Submit.Loader` - `PropsWithChildren & { loader: ReactNode }`
1081
+
1082
+ ---
1083
+
569
1084
  ### Swap
570
1085
 
571
- ```tsx
572
- const SWAP_KEYS = ["one", "two", "three"];
1086
+ Cycle through different states/content.
573
1087
 
574
- const [swapKey, setSwapKey] = useState(SWAP_KEYS[0] as string);
1088
+ **Components:**
1089
+ - `Swap` (Root) - Requires `keys: string[]; activeKey: string; setActiveKey: Dispatch<SetStateAction<string>>`
1090
+ - `Swap.Btn` - Button that cycles through keys
575
1091
 
576
- <Swap
577
- keys={SWAP_KEYS}
578
- activeKey={swapKey}
579
- setActiveKey={setSwapKey}>
580
- <Swap.Btn
581
- className="btn btn-soft"
582
- btnKey={SWAP_KEYS[0] as string}
583
- />
1092
+ **Example:**
584
1093
 
585
- <Swap.Btn
586
- className="btn btn-soft"
587
- btnKey={SWAP_KEYS[1] as string}
588
- />
1094
+ ```tsx
1095
+ import { Swap } from "@kadoui/react";
1096
+ import { useState } from "react";
589
1097
 
590
- <Swap.Btn
591
- className="btn btn-soft"
592
- btnKey={SWAP_KEYS[2] as string}
593
- />
594
- </Swap>;
1098
+ const SWAP_KEYS = ["one", "two", "three"];
1099
+ const [swapKey, setSwapKey] = useState(SWAP_KEYS[0]);
1100
+
1101
+ <Swap keys={SWAP_KEYS} activeKey={swapKey} setActiveKey={setSwapKey}>
1102
+ <Swap.Btn className="btn" btnKey={SWAP_KEYS[0]}>
1103
+ {SWAP_KEYS[0]}
1104
+ </Swap.Btn>
1105
+ <Swap.Btn className="btn" btnKey={SWAP_KEYS[1]}>
1106
+ {SWAP_KEYS[1]}
1107
+ </Swap.Btn>
1108
+ <Swap.Btn className="btn" btnKey={SWAP_KEYS[2]}>
1109
+ {SWAP_KEYS[2]}
1110
+ </Swap.Btn>
1111
+ </Swap>
595
1112
  ```
596
1113
 
1114
+ **Behavior:**
1115
+ - Only the button matching `activeKey` is rendered
1116
+ - Clicking cycles to the next key in the array
1117
+ - Wraps around (last → first)
1118
+
1119
+ ---
1120
+
597
1121
  ### Tabs
598
1122
 
1123
+ Tabbed interface component.
1124
+
1125
+ **Components:**
1126
+ - `Tabs` (Root) - Requires `activeTab: string; setActiveTab: Dispatch<SetStateAction<string>>`
1127
+ - `Tabs.List` - Tab list container
1128
+ - `Tabs.Tab` - Individual tab button
1129
+ - `Tabs.Panel` - Tab panel content
1130
+
1131
+ **Example:**
1132
+
599
1133
  ```tsx
1134
+ import { Tabs } from "@kadoui/react";
1135
+ import { useState } from "react";
1136
+
600
1137
  const [activeTab, setActiveTab] = useState("1");
601
1138
 
602
- <Tabs
603
- activeTab={activeTab}
604
- setActiveTab={setActiveTab}>
1139
+ <Tabs activeTab={activeTab} setActiveTab={setActiveTab}>
1140
+ <Tabs.List className="tabs-list" direction="x">
1141
+ <Tabs.Tab value="1" className="btn">
1142
+ Tab 1
1143
+ </Tabs.Tab>
1144
+ <Tabs.Tab value="2" className="btn">
1145
+ Tab 2
1146
+ </Tabs.Tab>
1147
+ </Tabs.List>
1148
+
1149
+ <Tabs.Panel value="1" className="tabs-panel">
1150
+ Content for Tab 1
1151
+ </Tabs.Panel>
1152
+ <Tabs.Panel value="2" className="tabs-panel">
1153
+ Content for Tab 2
1154
+ </Tabs.Panel>
1155
+ </Tabs>
1156
+ ```
1157
+
1158
+ **With AccessNavigation:**
1159
+
1160
+ ```tsx
1161
+ import { AccessNavigation } from "@kadoui/react";
1162
+
1163
+ <Tabs activeTab={activeTab} setActiveTab={setActiveTab}>
605
1164
  <AccessNavigation direction="x">
606
- <Tabs.List className="tabs-list join-border">
607
- <Tabs.Tab
608
- value="1"
609
- className="btn data-[state=false]:btn-soft data-[state=true]:btn-fill">
610
- Tab 1
611
- </Tabs.Tab>
612
- <Tabs.Tab
613
- value="2"
614
- className="btn data-[state=false]:btn-soft data-[state=true]:btn-fill">
615
- Tab 2
616
- </Tabs.Tab>
617
- <Tabs.Tab
618
- value="3"
619
- className="btn data-[state=false]:btn-soft data-[state=true]:btn-fill">
620
- Tab 3
621
- </Tabs.Tab>
1165
+ <Tabs.List className="join">
1166
+ <Tabs.Tab value="1" className="btn">Tab 1</Tabs.Tab>
1167
+ <Tabs.Tab value="2" className="btn">Tab 2</Tabs.Tab>
622
1168
  </Tabs.List>
623
1169
  </AccessNavigation>
1170
+ {/* Panels */}
1171
+ </Tabs>
1172
+ ```
624
1173
 
625
- <Tabs.Panel
626
- className="tabs-panel card-lg"
627
- key={"1"}
628
- value="1">
629
- Tab 1: Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptates, animi
630
- nisi, magni quis dolore cum molestias ipsam accusantium sunt repudiandae repellendus
631
- perspiciatis cumque unde commodi reprehenderit distinctio nostrum quisquam nihil?
632
- </Tabs.Panel>
1174
+ **API:**
1175
+ - `Tabs` - `PropsWithChildren & { activeTab: string; setActiveTab: Dispatch<SetStateAction<string>> }`
1176
+ - `Tabs.List` - `AccessNavigationPropsT`
1177
+ - `Tabs.Tab` - `ComponentProps<"button"> & { value: string }`
1178
+ - `Tabs.Panel` - `ComponentProps<"div"> & { value: string }`
633
1179
 
634
- <Tabs.Panel
635
- className="tabs-panel card-lg"
636
- key={"2"}
637
- value="2">
638
- Tab 2: Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptates, animi
639
- nisi, magni quis dolore cum molestias ipsam accusantium sunt repudiandae quisquam
640
- nihil?
641
- </Tabs.Panel>
1180
+ ---
642
1181
 
643
- <Tabs.Panel
644
- className="tabs-panel card-lg"
645
- key={"3"}
646
- value="3">
647
- Tab 3: Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptates, animi
648
- nisi, magni quis dolore cum molestias ipsam accusantium sunt repudiandae repellendus
649
- perspiciatis cumque unde commodi reprehenderit distinctio nostrum quisquam nihil?
650
- <br />
651
- Lorem ipsum dolor sit amet consectetur, adipisicing elit. Fugiat ut corporis sequi
652
- expedita deserunt aliquid iste facere, nisi ipsa iure ad nostrum animi. Adipisci
653
- placeat eos laborum error magnam officiis necessitatibus illo commodi a, aperiam
654
- tempora alias voluptatum eveniet, atque quas dolores, facilis architecto quisquam
655
- ipsum dolore officia debitis facere! Dicta iste consectetur, illo amet obcaecati aut
656
- error, ipsam optio at earum odio laudantium voluptatibus? Nemo, nisi debitis et, nam
657
- voluptas tempora ipsa ipsum culpa nobis perferendis ipsam cumque blanditiis quos
658
- corrupti, rerum eos? Sapiente fugiat voluptatibus laborum culpa at. Quidem, suscipit
659
- perferendis. Illum doloribus in cumque fuga laboriosam dignissimos!
660
- </Tabs.Panel>
661
- </Tabs>;
1182
+ ### Theme
1183
+
1184
+ Theme management with dark/light/system modes.
1185
+
1186
+ **Components & Hooks:**
1187
+ - `ThemeProvider` - Context provider (wrap your app)
1188
+ - `ThemeScript` - SSR script (add to `<head>`)
1189
+ - `useTheme` - Hook to access theme
1190
+
1191
+ **Setup:**
1192
+
1193
+ 1. Add script to your HTML `<head>`:
1194
+
1195
+ ```tsx
1196
+ import { ThemeScript } from "@kadoui/react";
1197
+
1198
+ <head>
1199
+ <ThemeScript />
1200
+ </head>
1201
+ ```
1202
+
1203
+ 2. Wrap your app with `ThemeProvider`:
1204
+
1205
+ ```tsx
1206
+ import { ThemeProvider } from "@kadoui/react";
1207
+
1208
+ function App() {
1209
+ return (
1210
+ <ThemeProvider>
1211
+ {/* Your app */}
1212
+ </ThemeProvider>
1213
+ );
1214
+ }
662
1215
  ```
663
1216
 
1217
+ 3. Use the hook:
1218
+
1219
+ ```tsx
1220
+ import { useTheme } from "@kadoui/react";
1221
+
1222
+ function ThemeToggle() {
1223
+ const { theme, setTheme } = useTheme();
1224
+
1225
+ return (
1226
+ <div>
1227
+ <button onClick={() => setTheme("light")}>Light</button>
1228
+ <button onClick={() => setTheme("dark")}>Dark</button>
1229
+ <button onClick={() => setTheme("system")}>System</button>
1230
+ </div>
1231
+ );
1232
+ }
1233
+ ```
1234
+
1235
+ **Types:**
1236
+ ```tsx
1237
+ type ThemeT = "dark" | "light" | "system";
1238
+ ```
1239
+
1240
+ ---
1241
+
1242
+ ## Next.js Integration
1243
+
664
1244
  ### LinkLoader
665
1245
 
1246
+ Show loading state during Next.js Link navigation.
1247
+
1248
+ **Import:**
666
1249
  ```tsx
667
- <Link
668
- className="btn btn-soft mt-6"
669
- href={"/test"}>
670
- <span>Test page</span>
671
- <LinkLoader loader={<LoaderIcon className="element-icon-size animate-spin" />}>
672
- <ArrowRightIcon className="element-icon-size" />
1250
+ import { LinkLoader } from "@kadoui/react/next";
1251
+ ```
1252
+
1253
+ **Example:**
1254
+
1255
+ ```tsx
1256
+ import Link from "next/link";
1257
+ import { LinkLoader } from "@kadoui/react/next";
1258
+ import { ArrowRightIcon, LoaderIcon } from "lucide-react";
1259
+
1260
+ <Link href="/page" className="btn">
1261
+ <span>Go to Page</span>
1262
+ <LinkLoader loader={<LoaderIcon className="animate-spin" />}>
1263
+ <ArrowRightIcon />
673
1264
  </LinkLoader>
674
1265
  </Link>
675
1266
  ```
676
1267
 
677
1268
  ---
678
1269
 
679
- Written with ❤️ by [Farzad Vahdati](https://github.com/FarzadVav)
1270
+ ## Utilities
1271
+
1272
+ Import utilities from `@kadoui/react/utils`:
1273
+
1274
+ ```tsx
1275
+ import { cn, getBrowserScrollbarWidth } from "@kadoui/react/utils";
1276
+ ```
1277
+
1278
+ **Available Utilities:**
1279
+ - `cn` - Class name utility (clsx + tailwind-merge)
1280
+ - `getBrowserScrollbarWidth` - Get browser scrollbar width
1281
+ - Form utilities (see source for details)
1282
+
1283
+ ---
1284
+
1285
+ ## TypeScript
1286
+
1287
+ All components are fully typed. Import types as needed:
1288
+
1289
+ ```tsx
1290
+ import type {
1291
+ SelectBoxOptionT,
1292
+ ModalRootPropsT,
1293
+ AccordionContextT
1294
+ } from "@kadoui/react";
1295
+ ```
1296
+
1297
+ ---
1298
+
1299
+ ## Styling
1300
+
1301
+ Components are unstyled by default. We recommend using [@kadoui/css](https://www.npmjs.com/package/@kadoui/css) for styling, but you can use any CSS solution:
1302
+
1303
+ - Tailwind CSS
1304
+ - CSS Modules
1305
+ - Styled Components
1306
+ - Emotion
1307
+ - Plain CSS
1308
+
1309
+ **Example with Tailwind:**
1310
+
1311
+ ```tsx
1312
+ <Accordion.Toggle className="flex items-center justify-between p-4 bg-gray-100 rounded-lg hover:bg-gray-200">
1313
+ Toggle
1314
+ </Accordion.Toggle>
1315
+ ```
1316
+
1317
+ ---
1318
+
1319
+ ## Accessibility
1320
+
1321
+ All components follow accessibility best practices:
1322
+
1323
+ - Proper ARIA attributes
1324
+ - Keyboard navigation support
1325
+ - Focus management
1326
+ - Screen reader friendly
1327
+
1328
+ ---
1329
+
1330
+ ## Browser Support
1331
+
1332
+ - Chrome (latest)
1333
+ - Firefox (latest)
1334
+ - Safari (latest)
1335
+ - Edge (latest)
1336
+
1337
+ ---
1338
+
1339
+ ## Contributing
1340
+
1341
+ Contributions are welcome! Please feel free to submit a Pull Request.
1342
+
1343
+ ---
1344
+
1345
+ ## License
1346
+
1347
+ MIT © [Farzad Vahdati](https://github.com/FarzadVav)
1348
+
1349
+ ---
1350
+
1351
+ <div align="center">
1352
+
1353
+ Made with ❤️ by [Farzad Vahdati](https://github.com/FarzadVav)
1354
+
1355
+ </div>