@byldpartners/ui 0.0.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 (413) hide show
  1. package/README.md +284 -0
  2. package/dist/chunk-464G63BO.cjs +224 -0
  3. package/dist/chunk-464G63BO.cjs.map +1 -0
  4. package/dist/chunk-JFJY6DZZ.js +224 -0
  5. package/dist/chunk-JFJY6DZZ.js.map +1 -0
  6. package/dist/index.cjs +3894 -0
  7. package/dist/index.cjs.map +1 -0
  8. package/dist/index.d.cts +1543 -0
  9. package/dist/index.d.ts +1543 -0
  10. package/dist/index.js +3894 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/theme/web.cjs +16 -0
  13. package/dist/theme/web.cjs.map +1 -0
  14. package/dist/theme/web.d.cts +81 -0
  15. package/dist/theme/web.d.ts +81 -0
  16. package/dist/theme/web.js +16 -0
  17. package/dist/theme/web.js.map +1 -0
  18. package/package.json +117 -0
  19. package/src/components/Accordion/Accordion.native.tsx +195 -0
  20. package/src/components/Accordion/Accordion.stories.tsx +49 -0
  21. package/src/components/Accordion/Accordion.types.ts +28 -0
  22. package/src/components/Accordion/Accordion.web.tsx +61 -0
  23. package/src/components/Accordion/index.native.ts +12 -0
  24. package/src/components/Accordion/index.ts +12 -0
  25. package/src/components/Accordion/useAccordion.test.ts +114 -0
  26. package/src/components/Accordion/useAccordion.ts +65 -0
  27. package/src/components/Alert/Alert.native.tsx +86 -0
  28. package/src/components/Alert/Alert.stories.tsx +43 -0
  29. package/src/components/Alert/Alert.types.ts +17 -0
  30. package/src/components/Alert/Alert.web.test.tsx +49 -0
  31. package/src/components/Alert/Alert.web.tsx +59 -0
  32. package/src/components/Alert/index.native.ts +2 -0
  33. package/src/components/Alert/index.ts +2 -0
  34. package/src/components/Alert/useAlert.test.ts +19 -0
  35. package/src/components/Alert/useAlert.ts +10 -0
  36. package/src/components/AlertDialog/AlertDialog.native.tsx +281 -0
  37. package/src/components/AlertDialog/AlertDialog.stories.tsx +49 -0
  38. package/src/components/AlertDialog/AlertDialog.types.ts +49 -0
  39. package/src/components/AlertDialog/AlertDialog.web.tsx +138 -0
  40. package/src/components/AlertDialog/index.native.ts +22 -0
  41. package/src/components/AlertDialog/index.ts +24 -0
  42. package/src/components/AlertDialog/useAlertDialog.test.ts +40 -0
  43. package/src/components/AlertDialog/useAlertDialog.ts +36 -0
  44. package/src/components/AspectRatio/AspectRatio.native.tsx +37 -0
  45. package/src/components/AspectRatio/AspectRatio.stories.tsx +44 -0
  46. package/src/components/AspectRatio/AspectRatio.types.ts +5 -0
  47. package/src/components/AspectRatio/AspectRatio.web.tsx +5 -0
  48. package/src/components/AspectRatio/index.native.ts +2 -0
  49. package/src/components/AspectRatio/index.ts +2 -0
  50. package/src/components/AspectRatio/useAspectRatio.test.ts +40 -0
  51. package/src/components/AspectRatio/useAspectRatio.ts +12 -0
  52. package/src/components/Avatar/Avatar.native.tsx +95 -0
  53. package/src/components/Avatar/Avatar.stories.tsx +31 -0
  54. package/src/components/Avatar/Avatar.types.ts +17 -0
  55. package/src/components/Avatar/Avatar.web.tsx +47 -0
  56. package/src/components/Avatar/index.native.ts +2 -0
  57. package/src/components/Avatar/index.ts +2 -0
  58. package/src/components/Avatar/useAvatarImage.test.ts +66 -0
  59. package/src/components/Avatar/useAvatarImage.ts +31 -0
  60. package/src/components/Badge/Badge.native.tsx +64 -0
  61. package/src/components/Badge/Badge.stories.tsx +42 -0
  62. package/src/components/Badge/Badge.types.ts +7 -0
  63. package/src/components/Badge/Badge.web.test.tsx +40 -0
  64. package/src/components/Badge/Badge.web.tsx +41 -0
  65. package/src/components/Badge/index.native.ts +2 -0
  66. package/src/components/Badge/index.ts +2 -0
  67. package/src/components/Breadcrumb/Breadcrumb.native.tsx +158 -0
  68. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +41 -0
  69. package/src/components/Breadcrumb/Breadcrumb.types.ts +37 -0
  70. package/src/components/Breadcrumb/Breadcrumb.web.tsx +125 -0
  71. package/src/components/Breadcrumb/index.native.ts +18 -0
  72. package/src/components/Breadcrumb/index.ts +18 -0
  73. package/src/components/Button/Button.native.tsx +118 -0
  74. package/src/components/Button/Button.stories.tsx +97 -0
  75. package/src/components/Button/Button.types.ts +19 -0
  76. package/src/components/Button/Button.web.test.tsx +69 -0
  77. package/src/components/Button/Button.web.tsx +55 -0
  78. package/src/components/Button/index.native.ts +2 -0
  79. package/src/components/Button/index.ts +2 -0
  80. package/src/components/Calendar/Calendar.native.tsx +108 -0
  81. package/src/components/Calendar/Calendar.stories.tsx +18 -0
  82. package/src/components/Calendar/Calendar.types.ts +8 -0
  83. package/src/components/Calendar/Calendar.web.tsx +143 -0
  84. package/src/components/Calendar/index.native.ts +2 -0
  85. package/src/components/Calendar/index.ts +2 -0
  86. package/src/components/Calendar/useCalendar.test.ts +145 -0
  87. package/src/components/Calendar/useCalendar.ts +94 -0
  88. package/src/components/Card/Card.native.tsx +42 -0
  89. package/src/components/Card/Card.stories.tsx +41 -0
  90. package/src/components/Card/Card.types.ts +4 -0
  91. package/src/components/Card/Card.web.test.tsx +29 -0
  92. package/src/components/Card/Card.web.tsx +23 -0
  93. package/src/components/Card/index.native.ts +2 -0
  94. package/src/components/Card/index.ts +2 -0
  95. package/src/components/Carousel/Carousel.native.tsx +193 -0
  96. package/src/components/Carousel/Carousel.stories.tsx +51 -0
  97. package/src/components/Carousel/Carousel.types.ts +29 -0
  98. package/src/components/Carousel/Carousel.web.tsx +272 -0
  99. package/src/components/Carousel/index.native.ts +2 -0
  100. package/src/components/Carousel/index.ts +2 -0
  101. package/src/components/Carousel/useCarousel.test.ts +111 -0
  102. package/src/components/Carousel/useCarousel.ts +48 -0
  103. package/src/components/Chart/Chart.native.tsx +7 -0
  104. package/src/components/Chart/Chart.stories.tsx +57 -0
  105. package/src/components/Chart/Chart.types.ts +13 -0
  106. package/src/components/Chart/Chart.web.tsx +36 -0
  107. package/src/components/Chart/index.native.ts +2 -0
  108. package/src/components/Chart/index.ts +3 -0
  109. package/src/components/Checkbox/Checkbox.native.tsx +47 -0
  110. package/src/components/Checkbox/Checkbox.stories.tsx +30 -0
  111. package/src/components/Checkbox/Checkbox.types.ts +12 -0
  112. package/src/components/Checkbox/Checkbox.web.tsx +37 -0
  113. package/src/components/Checkbox/index.native.ts +2 -0
  114. package/src/components/Checkbox/index.ts +2 -0
  115. package/src/components/Checkbox/useCheckbox.test.ts +66 -0
  116. package/src/components/Checkbox/useCheckbox.ts +37 -0
  117. package/src/components/Collapsible/Collapsible.native.tsx +111 -0
  118. package/src/components/Collapsible/Collapsible.stories.tsx +35 -0
  119. package/src/components/Collapsible/Collapsible.types.ts +19 -0
  120. package/src/components/Collapsible/Collapsible.web.tsx +9 -0
  121. package/src/components/Collapsible/index.native.ts +2 -0
  122. package/src/components/Collapsible/index.ts +2 -0
  123. package/src/components/Collapsible/useCollapsible.test.ts +53 -0
  124. package/src/components/Collapsible/useCollapsible.ts +38 -0
  125. package/src/components/Combobox/Combobox.native.tsx +146 -0
  126. package/src/components/Combobox/Combobox.stories.tsx +43 -0
  127. package/src/components/Combobox/Combobox.types.ts +15 -0
  128. package/src/components/Combobox/Combobox.web.tsx +145 -0
  129. package/src/components/Combobox/index.native.ts +2 -0
  130. package/src/components/Combobox/index.ts +2 -0
  131. package/src/components/Combobox/useCombobox.test.ts +59 -0
  132. package/src/components/Combobox/useCombobox.ts +42 -0
  133. package/src/components/Command/Command.native.tsx +7 -0
  134. package/src/components/Command/Command.stories.tsx +37 -0
  135. package/src/components/Command/Command.types.ts +43 -0
  136. package/src/components/Command/Command.web.tsx +134 -0
  137. package/src/components/Command/index.native.ts +2 -0
  138. package/src/components/Command/index.ts +18 -0
  139. package/src/components/ContextMenu/ContextMenu.native.tsx +241 -0
  140. package/src/components/ContextMenu/ContextMenu.stories.tsx +43 -0
  141. package/src/components/ContextMenu/ContextMenu.types.ts +69 -0
  142. package/src/components/ContextMenu/ContextMenu.web.tsx +220 -0
  143. package/src/components/ContextMenu/index.native.ts +28 -0
  144. package/src/components/ContextMenu/index.ts +2 -0
  145. package/src/components/ContextMenu/useContextMenu.test.ts +44 -0
  146. package/src/components/ContextMenu/useContextMenu.ts +36 -0
  147. package/src/components/DataTable/DataTable.native.tsx +85 -0
  148. package/src/components/DataTable/DataTable.stories.tsx +72 -0
  149. package/src/components/DataTable/DataTable.types.ts +16 -0
  150. package/src/components/DataTable/DataTable.web.tsx +135 -0
  151. package/src/components/DataTable/index.native.ts +2 -0
  152. package/src/components/DataTable/index.ts +3 -0
  153. package/src/components/DataTable/useDataTable.test.ts +98 -0
  154. package/src/components/DataTable/useDataTable.ts +68 -0
  155. package/src/components/DatePicker/DatePicker.native.tsx +82 -0
  156. package/src/components/DatePicker/DatePicker.stories.tsx +68 -0
  157. package/src/components/DatePicker/DatePicker.types.ts +7 -0
  158. package/src/components/DatePicker/DatePicker.web.tsx +85 -0
  159. package/src/components/DatePicker/index.native.ts +2 -0
  160. package/src/components/DatePicker/index.ts +2 -0
  161. package/src/components/DatePicker/useDatePicker.test.ts +62 -0
  162. package/src/components/DatePicker/useDatePicker.ts +54 -0
  163. package/src/components/Dialog/Dialog.native.tsx +188 -0
  164. package/src/components/Dialog/Dialog.stories.tsx +42 -0
  165. package/src/components/Dialog/Dialog.types.ts +45 -0
  166. package/src/components/Dialog/Dialog.web.tsx +126 -0
  167. package/src/components/Dialog/index.native.ts +2 -0
  168. package/src/components/Dialog/index.ts +2 -0
  169. package/src/components/Dialog/useDialog.test.ts +44 -0
  170. package/src/components/Dialog/useDialog.ts +36 -0
  171. package/src/components/Drawer/Drawer.native.tsx +244 -0
  172. package/src/components/Drawer/Drawer.stories.tsx +39 -0
  173. package/src/components/Drawer/Drawer.types.ts +44 -0
  174. package/src/components/Drawer/Drawer.web.tsx +133 -0
  175. package/src/components/Drawer/index.native.ts +2 -0
  176. package/src/components/Drawer/index.ts +2 -0
  177. package/src/components/Drawer/useDrawer.test.ts +33 -0
  178. package/src/components/Drawer/useDrawer.ts +19 -0
  179. package/src/components/DropdownMenu/DropdownMenu.native.tsx +272 -0
  180. package/src/components/DropdownMenu/DropdownMenu.stories.tsx +36 -0
  181. package/src/components/DropdownMenu/DropdownMenu.types.ts +73 -0
  182. package/src/components/DropdownMenu/DropdownMenu.web.tsx +225 -0
  183. package/src/components/DropdownMenu/index.native.ts +2 -0
  184. package/src/components/DropdownMenu/index.ts +2 -0
  185. package/src/components/DropdownMenu/useDropdownMenu.test.ts +44 -0
  186. package/src/components/DropdownMenu/useDropdownMenu.ts +36 -0
  187. package/src/components/Form/Form.native.tsx +98 -0
  188. package/src/components/Form/Form.stories.tsx +83 -0
  189. package/src/components/Form/Form.types.ts +35 -0
  190. package/src/components/Form/Form.web.test.tsx +73 -0
  191. package/src/components/Form/Form.web.tsx +111 -0
  192. package/src/components/Form/index.native.ts +18 -0
  193. package/src/components/Form/index.ts +18 -0
  194. package/src/components/Form/useFormField.test.ts +25 -0
  195. package/src/components/Form/useFormField.ts +22 -0
  196. package/src/components/HoverCard/HoverCard.native.tsx +15 -0
  197. package/src/components/HoverCard/HoverCard.stories.tsx +34 -0
  198. package/src/components/HoverCard/HoverCard.types.ts +18 -0
  199. package/src/components/HoverCard/HoverCard.web.test.tsx +35 -0
  200. package/src/components/HoverCard/HoverCard.web.tsx +26 -0
  201. package/src/components/HoverCard/index.native.ts +2 -0
  202. package/src/components/HoverCard/index.ts +2 -0
  203. package/src/components/Icon/Icon.native.tsx +27 -0
  204. package/src/components/Icon/index.native.ts +2 -0
  205. package/src/components/Input/Input.native.tsx +32 -0
  206. package/src/components/Input/Input.stories.tsx +42 -0
  207. package/src/components/Input/Input.types.ts +10 -0
  208. package/src/components/Input/Input.web.test.tsx +39 -0
  209. package/src/components/Input/Input.web.tsx +21 -0
  210. package/src/components/Input/index.native.ts +2 -0
  211. package/src/components/Input/index.ts +2 -0
  212. package/src/components/InputOTP/InputOTP.native.tsx +93 -0
  213. package/src/components/InputOTP/InputOTP.stories.tsx +56 -0
  214. package/src/components/InputOTP/InputOTP.types.ts +14 -0
  215. package/src/components/InputOTP/InputOTP.web.tsx +128 -0
  216. package/src/components/InputOTP/index.native.ts +2 -0
  217. package/src/components/InputOTP/index.ts +2 -0
  218. package/src/components/InputOTP/useInputOTP.test.ts +97 -0
  219. package/src/components/InputOTP/useInputOTP.ts +69 -0
  220. package/src/components/Label/Label.native.tsx +25 -0
  221. package/src/components/Label/Label.stories.tsx +20 -0
  222. package/src/components/Label/Label.types.ts +6 -0
  223. package/src/components/Label/Label.web.test.tsx +27 -0
  224. package/src/components/Label/Label.web.tsx +23 -0
  225. package/src/components/Label/index.native.ts +2 -0
  226. package/src/components/Label/index.ts +2 -0
  227. package/src/components/Menubar/Menubar.native.tsx +287 -0
  228. package/src/components/Menubar/Menubar.stories.tsx +46 -0
  229. package/src/components/Menubar/Menubar.types.ts +70 -0
  230. package/src/components/Menubar/Menubar.web.tsx +256 -0
  231. package/src/components/Menubar/index.native.ts +28 -0
  232. package/src/components/Menubar/index.ts +2 -0
  233. package/src/components/Menubar/useMenubar.test.ts +35 -0
  234. package/src/components/Menubar/useMenubar.ts +19 -0
  235. package/src/components/NavigationMenu/NavigationMenu.native.tsx +128 -0
  236. package/src/components/NavigationMenu/NavigationMenu.stories.tsx +35 -0
  237. package/src/components/NavigationMenu/NavigationMenu.types.ts +35 -0
  238. package/src/components/NavigationMenu/NavigationMenu.web.test.tsx +56 -0
  239. package/src/components/NavigationMenu/NavigationMenu.web.tsx +134 -0
  240. package/src/components/NavigationMenu/index.native.ts +16 -0
  241. package/src/components/NavigationMenu/index.ts +2 -0
  242. package/src/components/Pagination/Pagination.native.tsx +192 -0
  243. package/src/components/Pagination/Pagination.stories.tsx +49 -0
  244. package/src/components/Pagination/Pagination.types.ts +41 -0
  245. package/src/components/Pagination/Pagination.web.test.tsx +101 -0
  246. package/src/components/Pagination/Pagination.web.tsx +185 -0
  247. package/src/components/Pagination/index.native.ts +19 -0
  248. package/src/components/Pagination/index.ts +2 -0
  249. package/src/components/Popover/Popover.native.tsx +97 -0
  250. package/src/components/Popover/Popover.stories.tsx +25 -0
  251. package/src/components/Popover/Popover.types.ts +20 -0
  252. package/src/components/Popover/Popover.web.tsx +30 -0
  253. package/src/components/Popover/index.native.ts +2 -0
  254. package/src/components/Popover/index.ts +2 -0
  255. package/src/components/Popover/usePopover.test.ts +40 -0
  256. package/src/components/Popover/usePopover.ts +36 -0
  257. package/src/components/Progress/Progress.native.tsx +65 -0
  258. package/src/components/Progress/Progress.stories.tsx +36 -0
  259. package/src/components/Progress/Progress.types.ts +6 -0
  260. package/src/components/Progress/Progress.web.test.tsx +27 -0
  261. package/src/components/Progress/Progress.web.tsx +30 -0
  262. package/src/components/Progress/index.native.ts +2 -0
  263. package/src/components/Progress/index.ts +2 -0
  264. package/src/components/Progress/useProgress.test.ts +44 -0
  265. package/src/components/Progress/useProgress.ts +11 -0
  266. package/src/components/RadioGroup/RadioGroup.native.tsx +96 -0
  267. package/src/components/RadioGroup/RadioGroup.stories.tsx +31 -0
  268. package/src/components/RadioGroup/RadioGroup.types.ts +16 -0
  269. package/src/components/RadioGroup/RadioGroup.web.tsx +47 -0
  270. package/src/components/RadioGroup/index.native.ts +2 -0
  271. package/src/components/RadioGroup/index.ts +2 -0
  272. package/src/components/RadioGroup/useRadioGroup.test.ts +50 -0
  273. package/src/components/RadioGroup/useRadioGroup.ts +40 -0
  274. package/src/components/ResizablePanel/ResizablePanel.native.tsx +75 -0
  275. package/src/components/ResizablePanel/ResizablePanel.stories.tsx +84 -0
  276. package/src/components/ResizablePanel/ResizablePanel.types.ts +20 -0
  277. package/src/components/ResizablePanel/ResizablePanel.web.test.tsx +52 -0
  278. package/src/components/ResizablePanel/ResizablePanel.web.tsx +77 -0
  279. package/src/components/ResizablePanel/index.native.ts +2 -0
  280. package/src/components/ResizablePanel/index.ts +2 -0
  281. package/src/components/ScrollArea/ScrollArea.native.tsx +43 -0
  282. package/src/components/ScrollArea/ScrollArea.stories.tsx +46 -0
  283. package/src/components/ScrollArea/ScrollArea.types.ts +11 -0
  284. package/src/components/ScrollArea/ScrollArea.web.test.tsx +19 -0
  285. package/src/components/ScrollArea/ScrollArea.web.tsx +45 -0
  286. package/src/components/ScrollArea/index.native.ts +2 -0
  287. package/src/components/ScrollArea/index.ts +2 -0
  288. package/src/components/Select/Select.native.tsx +203 -0
  289. package/src/components/Select/Select.stories.tsx +33 -0
  290. package/src/components/Select/Select.types.ts +14 -0
  291. package/src/components/Select/Select.web.tsx +204 -0
  292. package/src/components/Select/index.native.ts +11 -0
  293. package/src/components/Select/index.ts +2 -0
  294. package/src/components/Select/useSelect.test.ts +38 -0
  295. package/src/components/Select/useSelect.ts +33 -0
  296. package/src/components/Separator/Separator.native.tsx +38 -0
  297. package/src/components/Separator/Separator.stories.tsx +34 -0
  298. package/src/components/Separator/Separator.types.ts +7 -0
  299. package/src/components/Separator/Separator.web.test.tsx +32 -0
  300. package/src/components/Separator/Separator.web.tsx +38 -0
  301. package/src/components/Separator/index.native.ts +2 -0
  302. package/src/components/Separator/index.ts +2 -0
  303. package/src/components/Sheet/Sheet.native.tsx +246 -0
  304. package/src/components/Sheet/Sheet.stories.tsx +43 -0
  305. package/src/components/Sheet/Sheet.types.ts +47 -0
  306. package/src/components/Sheet/Sheet.web.tsx +144 -0
  307. package/src/components/Sheet/index.native.ts +2 -0
  308. package/src/components/Sheet/index.ts +2 -0
  309. package/src/components/Sheet/useSheet.test.ts +40 -0
  310. package/src/components/Sheet/useSheet.ts +19 -0
  311. package/src/components/Sidebar/Sidebar.native.tsx +7 -0
  312. package/src/components/Sidebar/Sidebar.stories.tsx +100 -0
  313. package/src/components/Sidebar/Sidebar.types.ts +30 -0
  314. package/src/components/Sidebar/Sidebar.web.test.tsx +74 -0
  315. package/src/components/Sidebar/Sidebar.web.tsx +200 -0
  316. package/src/components/Sidebar/index.native.ts +2 -0
  317. package/src/components/Sidebar/index.ts +2 -0
  318. package/src/components/Sidebar/useSidebar.test.ts +51 -0
  319. package/src/components/Sidebar/useSidebar.ts +26 -0
  320. package/src/components/Skeleton/Skeleton.native.tsx +45 -0
  321. package/src/components/Skeleton/Skeleton.stories.tsx +32 -0
  322. package/src/components/Skeleton/Skeleton.types.ts +6 -0
  323. package/src/components/Skeleton/Skeleton.web.test.tsx +35 -0
  324. package/src/components/Skeleton/Skeleton.web.tsx +18 -0
  325. package/src/components/Skeleton/index.native.ts +2 -0
  326. package/src/components/Skeleton/index.ts +2 -0
  327. package/src/components/Slider/Slider.native.tsx +98 -0
  328. package/src/components/Slider/Slider.stories.tsx +23 -0
  329. package/src/components/Slider/Slider.types.ts +10 -0
  330. package/src/components/Slider/Slider.web.tsx +25 -0
  331. package/src/components/Slider/index.native.ts +2 -0
  332. package/src/components/Slider/index.ts +2 -0
  333. package/src/components/Slider/useSlider.test.ts +68 -0
  334. package/src/components/Slider/useSlider.ts +55 -0
  335. package/src/components/Switch/Switch.native.tsx +36 -0
  336. package/src/components/Switch/Switch.stories.tsx +28 -0
  337. package/src/components/Switch/Switch.types.ts +7 -0
  338. package/src/components/Switch/Switch.web.test.tsx +44 -0
  339. package/src/components/Switch/Switch.web.tsx +26 -0
  340. package/src/components/Switch/index.native.ts +2 -0
  341. package/src/components/Switch/index.ts +2 -0
  342. package/src/components/Table/Table.native.tsx +165 -0
  343. package/src/components/Table/Table.stories.tsx +54 -0
  344. package/src/components/Table/Table.types.ts +41 -0
  345. package/src/components/Table/Table.web.test.tsx +77 -0
  346. package/src/components/Table/Table.web.tsx +119 -0
  347. package/src/components/Table/index.native.ts +2 -0
  348. package/src/components/Table/index.ts +2 -0
  349. package/src/components/Tabs/Tabs.native.tsx +136 -0
  350. package/src/components/Tabs/Tabs.stories.tsx +35 -0
  351. package/src/components/Tabs/Tabs.types.ts +25 -0
  352. package/src/components/Tabs/Tabs.web.tsx +52 -0
  353. package/src/components/Tabs/index.native.ts +2 -0
  354. package/src/components/Tabs/index.ts +2 -0
  355. package/src/components/Tabs/useTabs.test.ts +40 -0
  356. package/src/components/Tabs/useTabs.ts +20 -0
  357. package/src/components/Textarea/Textarea.native.tsx +33 -0
  358. package/src/components/Textarea/Textarea.stories.tsx +27 -0
  359. package/src/components/Textarea/Textarea.types.ts +10 -0
  360. package/src/components/Textarea/Textarea.web.test.tsx +33 -0
  361. package/src/components/Textarea/Textarea.web.tsx +21 -0
  362. package/src/components/Textarea/index.native.ts +2 -0
  363. package/src/components/Textarea/index.ts +2 -0
  364. package/src/components/Toast/Toast.native.tsx +267 -0
  365. package/src/components/Toast/Toast.stories.tsx +34 -0
  366. package/src/components/Toast/Toast.types.ts +50 -0
  367. package/src/components/Toast/Toast.web.tsx +282 -0
  368. package/src/components/Toast/index.native.ts +17 -0
  369. package/src/components/Toast/index.ts +11 -0
  370. package/src/components/Toast/useToast.test.ts +122 -0
  371. package/src/components/Toast/useToast.ts +64 -0
  372. package/src/components/Toggle/Toggle.native.tsx +70 -0
  373. package/src/components/Toggle/Toggle.stories.tsx +34 -0
  374. package/src/components/Toggle/Toggle.types.ts +13 -0
  375. package/src/components/Toggle/Toggle.web.tsx +42 -0
  376. package/src/components/Toggle/index.native.ts +2 -0
  377. package/src/components/Toggle/index.ts +2 -0
  378. package/src/components/Toggle/useToggle.test.ts +48 -0
  379. package/src/components/Toggle/useToggle.ts +37 -0
  380. package/src/components/ToggleGroup/ToggleGroup.native.tsx +103 -0
  381. package/src/components/ToggleGroup/ToggleGroup.stories.tsx +24 -0
  382. package/src/components/ToggleGroup/ToggleGroup.types.ts +22 -0
  383. package/src/components/ToggleGroup/ToggleGroup.web.tsx +56 -0
  384. package/src/components/ToggleGroup/index.native.ts +2 -0
  385. package/src/components/ToggleGroup/index.ts +2 -0
  386. package/src/components/ToggleGroup/useToggleGroup.test.ts +79 -0
  387. package/src/components/ToggleGroup/useToggleGroup.ts +63 -0
  388. package/src/components/Tooltip/Tooltip.native.tsx +7 -0
  389. package/src/components/Tooltip/Tooltip.stories.tsx +32 -0
  390. package/src/components/Tooltip/Tooltip.types.ts +27 -0
  391. package/src/components/Tooltip/Tooltip.web.test.tsx +42 -0
  392. package/src/components/Tooltip/Tooltip.web.tsx +29 -0
  393. package/src/components/Tooltip/index.native.ts +2 -0
  394. package/src/components/Tooltip/index.ts +2 -0
  395. package/src/components/index.native.ts +50 -0
  396. package/src/components/index.ts +49 -0
  397. package/src/hooks/useControllableState.test.ts +89 -0
  398. package/src/hooks/useControllableState.ts +37 -0
  399. package/src/index.native.ts +20 -0
  400. package/src/index.ts +12 -0
  401. package/src/theme/native.ts +211 -0
  402. package/src/theme/presets/aurora.ts +56 -0
  403. package/src/theme/presets/dark.ts +30 -0
  404. package/src/theme/presets/default.ts +30 -0
  405. package/src/theme/theme.types.ts +64 -0
  406. package/src/theme/tokens.ts +31 -0
  407. package/src/theme/web.ts +123 -0
  408. package/src/uniwind.d.ts +38 -0
  409. package/src/utils/cn.native.ts +10 -0
  410. package/src/utils/cn.test.ts +28 -0
  411. package/src/utils/cn.ts +6 -0
  412. package/src/utils/glass.native.ts +22 -0
  413. package/src/utils/withGlass.native.tsx +59 -0
package/README.md ADDED
@@ -0,0 +1,284 @@
1
+ # @byldpartners/ui
2
+
3
+ Cross-platform UI component library for **web** (React + Radix + Tailwind) and **React Native** (Expo + uniwind).
4
+
5
+ One import, two platforms — the same component API and Tailwind classes work on both web and mobile.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @byldpartners/ui
11
+ # or
12
+ pnpm add @byldpartners/ui
13
+ ```
14
+
15
+ ### Peer dependencies
16
+
17
+ **Web:**
18
+
19
+ ```bash
20
+ pnpm add react react-dom
21
+ ```
22
+
23
+ **React Native:**
24
+
25
+ ```bash
26
+ pnpm add react react-native react-native-svg lucide-react-native uniwind
27
+ ```
28
+
29
+ | Package | Version | Required | Platform |
30
+ |---------|---------|----------|----------|
31
+ | `react` | `>=18` | Yes | Both |
32
+ | `react-dom` | `>=18` | Yes | Web |
33
+ | `react-native` | `>=0.81` | Yes | Native |
34
+ | `react-native-svg` | `>=13.0` | Yes | Native |
35
+ | `lucide-react-native` | `>=0.300` | Yes | Native |
36
+ | `uniwind` | `>=1.0` | Yes | Native |
37
+ | `expo-glass-effect` | `>=0.1.0` | No | Native |
38
+
39
+ ## Quick Start
40
+
41
+ ### Web
42
+
43
+ Wrap your app in `ThemeProvider` and import components:
44
+
45
+ ```tsx
46
+ import { ThemeProvider, Button } from "@byldpartners/ui";
47
+
48
+ function App() {
49
+ return (
50
+ <ThemeProvider>
51
+ <Button variant="default" size="lg">
52
+ Get Started
53
+ </Button>
54
+ </ThemeProvider>
55
+ );
56
+ }
57
+ ```
58
+
59
+ The `ThemeProvider` injects CSS custom properties onto `document.documentElement`. Make sure you have Tailwind CSS configured in your project.
60
+
61
+ ### React Native
62
+
63
+ Components use Tailwind classes via [uniwind](https://uniwind.dev). Set up your project:
64
+
65
+ **1. Create `global.css`** at your project root:
66
+
67
+ ```css
68
+ @import 'tailwindcss';
69
+ @import 'uniwind';
70
+ ```
71
+
72
+ **2. Configure Metro** in `metro.config.js`:
73
+
74
+ ```js
75
+ const { getDefaultConfig } = require('expo/metro-config');
76
+ const { withUniwindConfig } = require('uniwind/metro');
77
+
78
+ const config = getDefaultConfig(__dirname);
79
+
80
+ module.exports = withUniwindConfig(config, {
81
+ cssEntryFile: './global.css',
82
+ });
83
+ ```
84
+
85
+ **3. Import CSS** in your `App.tsx`:
86
+
87
+ ```tsx
88
+ import './global.css';
89
+ import { Button } from "@byldpartners/ui";
90
+
91
+ export default function App() {
92
+ return (
93
+ <Button variant="default" onPress={() => console.log("pressed")}>
94
+ Get Started
95
+ </Button>
96
+ );
97
+ }
98
+ ```
99
+
100
+ Both platforms use the same Tailwind semantic classes (`bg-primary`, `text-foreground`, `rounded-md`, etc.) — web via Tailwind CSS, native via uniwind.
101
+
102
+ ## Components
103
+
104
+ 50 components with full web (shadcn/Radix) and React Native (uniwind) implementations:
105
+
106
+ | Phase | Components |
107
+ |-------|-----------|
108
+ | **Foundation** | Accordion, Alert, AlertDialog, AspectRatio, Avatar, Badge, Breadcrumb, Button |
109
+ | **Form & Input** | Calendar, Checkbox, Collapsible, Combobox, Command, DatePicker, Form, Input, InputOTP, Label, RadioGroup, Select, Slider, Switch, Textarea, Toggle, ToggleGroup |
110
+ | **Layout & Display** | Card, Carousel, Chart, DataTable, HoverCard, Icon, ResizablePanel, Separator, Skeleton, Table, Tabs |
111
+ | **Overlay & Feedback** | ContextMenu, Dialog, Drawer, DropdownMenu, Menubar, NavigationMenu, Popover, Sheet, Sidebar, Toast, Tooltip |
112
+ | **Misc** | Pagination, Progress, ScrollArea |
113
+
114
+ Every component follows the same file structure:
115
+
116
+ ```
117
+ ComponentName/
118
+ ├── ComponentName.types.ts # Shared props interface
119
+ ├── useComponentName.ts # Shared state hook (platform-agnostic)
120
+ ├── ComponentName.web.tsx # Web implementation (Radix + Tailwind)
121
+ ├── ComponentName.native.tsx # React Native implementation (uniwind)
122
+ ├── index.ts # Web barrel
123
+ └── index.native.ts # Native barrel
124
+ ```
125
+
126
+ ## Theming
127
+
128
+ ### Web — ThemeProvider
129
+
130
+ Three presets ship out of the box: `default` (light), `dark`, and `aurora`.
131
+
132
+ ```tsx
133
+ import { ThemeProvider } from "@byldpartners/ui";
134
+
135
+ <ThemeProvider defaultTheme="dark">
136
+ <App />
137
+ </ThemeProvider>
138
+ ```
139
+
140
+ Switch themes at runtime:
141
+
142
+ ```tsx
143
+ import { useTheme } from "@byldpartners/ui";
144
+
145
+ function ThemeSwitcher() {
146
+ const { theme, setTheme } = useTheme();
147
+
148
+ return (
149
+ <button onClick={() => setTheme(theme === "default" ? "dark" : "default")}>
150
+ Toggle theme
151
+ </button>
152
+ );
153
+ }
154
+ ```
155
+
156
+ ### Native — Tailwind dark mode
157
+
158
+ On native, theming works through Tailwind's built-in dark mode via uniwind. Components use semantic classes like `bg-primary` and `text-foreground` which automatically respond to your Tailwind theme configuration.
159
+
160
+ ### Custom themes
161
+
162
+ Define a custom preset and pass it to the web provider:
163
+
164
+ ```tsx
165
+ import { ThemeProvider } from "@byldpartners/ui";
166
+ import type { ThemePreset } from "@byldpartners/ui";
167
+ import { defaultPreset, darkPreset, auroraPreset } from "@byldpartners/ui/theme";
168
+
169
+ const brand: ThemePreset = {
170
+ name: "brand",
171
+ tokens: {
172
+ ...defaultPreset.tokens,
173
+ colors: {
174
+ ...defaultPreset.tokens.colors,
175
+ primary: "oklch(0.6 0.2 260)",
176
+ primaryForeground: "oklch(1 0 0)",
177
+ },
178
+ },
179
+ };
180
+
181
+ <ThemeProvider defaultTheme="brand" presets={[defaultPreset, darkPreset, brand]}>
182
+ <App />
183
+ </ThemeProvider>
184
+ ```
185
+
186
+ On native, customize themes by extending your `global.css` with Tailwind CSS variable overrides.
187
+
188
+ ### Token structure
189
+
190
+ Tokens are defined in `src/theme/tokens.ts` and cover:
191
+
192
+ - **Colors** — oklch values for background, foreground, primary, secondary, muted, accent, destructive, border, input, ring
193
+ - **Radius** — sm, md, lg, xl, full
194
+ - **Spacing** — xs, sm, md, lg, xl, 2xl, 3xl
195
+ - **Typography** — fontFamily, fontFamilyMono
196
+
197
+ ## Button
198
+
199
+ ```tsx
200
+ import { Button } from "@byldpartners/ui";
201
+
202
+ // Variants
203
+ <Button variant="default">Default</Button>
204
+ <Button variant="secondary">Secondary</Button>
205
+ <Button variant="destructive">Destructive</Button>
206
+ <Button variant="outline">Outline</Button>
207
+ <Button variant="ghost">Ghost</Button>
208
+ <Button variant="link">Link</Button>
209
+
210
+ // Sizes
211
+ <Button size="sm">Small</Button>
212
+ <Button size="default">Default</Button>
213
+ <Button size="lg">Large</Button>
214
+ <Button size="icon">+</Button>
215
+
216
+ // Disabled
217
+ <Button disabled>Disabled</Button>
218
+
219
+ // Slot pattern (web only) — render as child element
220
+ <Button asChild>
221
+ <a href="/dashboard">Go to Dashboard</a>
222
+ </Button>
223
+ ```
224
+
225
+ ## Drop-in Mode
226
+
227
+ You can copy the source directly into your project instead of using the npm package, similar to how shadcn works:
228
+
229
+ ```bash
230
+ cp -r node_modules/@byldpartners/ui/src ./packages/ui
231
+ ```
232
+
233
+ Then add a path alias in your `tsconfig.json`:
234
+
235
+ ```json
236
+ {
237
+ "compilerOptions": {
238
+ "paths": {
239
+ "@byldpartners/ui": ["./packages/ui/index.ts"],
240
+ "@byldpartners/ui/*": ["./packages/ui/*"]
241
+ }
242
+ }
243
+ }
244
+ ```
245
+
246
+ ## How It Works
247
+
248
+ The package uses **conditional exports** in `package.json` to serve different code per platform:
249
+
250
+ - **Web** (Vite, webpack, etc.) — resolves pre-built ESM/CJS bundles from `dist/`
251
+ - **React Native** (Metro) — resolves raw TypeScript source from `src/`, and Metro auto-picks `.native.tsx` files over `.web.tsx`
252
+
253
+ Both platforms use Tailwind classes for styling:
254
+ - **Web** — standard Tailwind CSS with `class-variance-authority` for variants
255
+ - **Native** — uniwind compiles Tailwind classes to React Native styles at build time
256
+
257
+ This means web consumers get optimized bundles while native consumers get source that Metro compiles alongside your app code.
258
+
259
+ ## Development
260
+
261
+ ```bash
262
+ # Install dependencies
263
+ pnpm install
264
+
265
+ # Build the library
266
+ pnpm build
267
+
268
+ # Run the web playground + Storybook
269
+ pnpm --filter @byldpartners/web dev
270
+ pnpm --filter @byldpartners/web storybook
271
+
272
+ # Run the native playground
273
+ pnpm --filter @byldpartners/native start
274
+
275
+ # Scaffold a new component
276
+ pnpm new-component ComponentName
277
+
278
+ # Type check both platforms
279
+ pnpm --filter @byldpartners/ui check-types
280
+ ```
281
+
282
+ ## License
283
+
284
+ MIT
@@ -0,0 +1,224 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/theme/web.ts
2
+ var _react = require('react');
3
+
4
+ // src/theme/tokens.ts
5
+ var baseTokens = {
6
+ radius: {
7
+ sm: "0.25rem",
8
+ md: "0.375rem",
9
+ lg: "0.5rem",
10
+ xl: "0.75rem",
11
+ full: "9999px"
12
+ },
13
+ spacing: {
14
+ xs: "0.25rem",
15
+ sm: "0.5rem",
16
+ md: "1rem",
17
+ lg: "1.5rem",
18
+ xl: "2rem",
19
+ "2xl": "3rem",
20
+ "3xl": "4rem"
21
+ },
22
+ typography: {
23
+ fontFamily: 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
24
+ fontFamilyMono: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace'
25
+ }
26
+ };
27
+
28
+ // src/theme/presets/default.ts
29
+ var defaultPreset = {
30
+ name: "default",
31
+ tokens: {
32
+ ...baseTokens,
33
+ colors: {
34
+ background: "oklch(1 0 0)",
35
+ foreground: "oklch(0.145 0 0)",
36
+ card: "oklch(1 0 0)",
37
+ cardForeground: "oklch(0.145 0 0)",
38
+ popover: "oklch(1 0 0)",
39
+ popoverForeground: "oklch(0.145 0 0)",
40
+ primary: "oklch(0.205 0 0)",
41
+ primaryForeground: "oklch(0.985 0 0)",
42
+ secondary: "oklch(0.965 0 0)",
43
+ secondaryForeground: "oklch(0.205 0 0)",
44
+ muted: "oklch(0.965 0 0)",
45
+ mutedForeground: "oklch(0.556 0 0)",
46
+ accent: "oklch(0.965 0 0)",
47
+ accentForeground: "oklch(0.205 0 0)",
48
+ destructive: "oklch(0.577 0.245 27.325)",
49
+ destructiveForeground: "oklch(0.985 0 0)",
50
+ border: "oklch(0.922 0 0)",
51
+ input: "oklch(0.922 0 0)",
52
+ ring: "oklch(0.708 0 0)"
53
+ }
54
+ }
55
+ };
56
+
57
+ // src/theme/presets/dark.ts
58
+ var darkPreset = {
59
+ name: "dark",
60
+ tokens: {
61
+ ...baseTokens,
62
+ colors: {
63
+ background: "oklch(0.145 0 0)",
64
+ foreground: "oklch(0.985 0 0)",
65
+ card: "oklch(0.145 0 0)",
66
+ cardForeground: "oklch(0.985 0 0)",
67
+ popover: "oklch(0.145 0 0)",
68
+ popoverForeground: "oklch(0.985 0 0)",
69
+ primary: "oklch(0.985 0 0)",
70
+ primaryForeground: "oklch(0.205 0 0)",
71
+ secondary: "oklch(0.269 0 0)",
72
+ secondaryForeground: "oklch(0.985 0 0)",
73
+ muted: "oklch(0.269 0 0)",
74
+ mutedForeground: "oklch(0.708 0 0)",
75
+ accent: "oklch(0.269 0 0)",
76
+ accentForeground: "oklch(0.985 0 0)",
77
+ destructive: "oklch(0.396 0.141 25.723)",
78
+ destructiveForeground: "oklch(0.637 0.237 25.331)",
79
+ border: "oklch(0.269 0 0)",
80
+ input: "oklch(0.269 0 0)",
81
+ ring: "oklch(0.439 0 0)"
82
+ }
83
+ }
84
+ };
85
+
86
+ // src/theme/presets/aurora.ts
87
+ var auroraPreset = {
88
+ name: "aurora",
89
+ tokens: {
90
+ colors: {
91
+ background: "oklch(0.18 0.04 270)",
92
+ foreground: "oklch(0.93 0.01 250)",
93
+ card: "oklch(0.22 0.045 270)",
94
+ cardForeground: "oklch(0.93 0.01 250)",
95
+ popover: "oklch(0.22 0.045 270)",
96
+ popoverForeground: "oklch(0.93 0.01 250)",
97
+ primary: "oklch(0.75 0.15 190)",
98
+ primaryForeground: "oklch(0.15 0.04 270)",
99
+ secondary: "oklch(0.35 0.08 290)",
100
+ secondaryForeground: "oklch(0.90 0.03 290)",
101
+ muted: "oklch(0.28 0.04 270)",
102
+ mutedForeground: "oklch(0.65 0.04 260)",
103
+ accent: "oklch(0.30 0.05 270)",
104
+ accentForeground: "oklch(0.93 0.01 250)",
105
+ destructive: "oklch(0.65 0.22 15)",
106
+ destructiveForeground: "oklch(0.95 0.01 15)",
107
+ border: "oklch(0.26 0.035 270)",
108
+ input: "oklch(0.26 0.035 270)",
109
+ ring: "oklch(0.65 0.12 190)"
110
+ },
111
+ radius: {
112
+ sm: "0.5rem",
113
+ md: "0.75rem",
114
+ lg: "1rem",
115
+ xl: "1.5rem",
116
+ full: "9999px"
117
+ },
118
+ spacing: {
119
+ xs: "0.375rem",
120
+ sm: "0.75rem",
121
+ md: "1.25rem",
122
+ lg: "2rem",
123
+ xl: "2.5rem",
124
+ "2xl": "3.5rem",
125
+ "3xl": "5rem"
126
+ },
127
+ typography: {
128
+ fontFamily: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',
129
+ fontFamilyMono: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace'
130
+ },
131
+ shadow: {
132
+ sm: "0 1px 3px 0 oklch(0.55 0.12 190 / 0.3), 0 1px 2px -1px oklch(0.55 0.12 190 / 0.2)",
133
+ md: "0 4px 8px -1px oklch(0.55 0.12 190 / 0.35), 0 2px 4px -2px oklch(0.55 0.12 190 / 0.25)",
134
+ lg: "0 10px 20px -3px oklch(0.55 0.12 190 / 0.4), 0 4px 8px -4px oklch(0.55 0.12 190 / 0.3)",
135
+ xl: "0 20px 30px -5px oklch(0.55 0.12 190 / 0.45), 0 8px 12px -6px oklch(0.55 0.12 190 / 0.35)"
136
+ }
137
+ }
138
+ };
139
+
140
+ // src/theme/web.ts
141
+ function colorToCssVar(key) {
142
+ return `--color-${key.replace(/([A-Z])/g, "-$1").toLowerCase()}`;
143
+ }
144
+ function radiusToCssVar(key) {
145
+ return `--radius-${key}`;
146
+ }
147
+ function spacingToCssVar(key) {
148
+ return `--spacing-${key}`;
149
+ }
150
+ function generateCssVars(tokens) {
151
+ const vars = {};
152
+ for (const [key, value] of Object.entries(tokens.colors)) {
153
+ vars[colorToCssVar(key)] = value;
154
+ }
155
+ for (const [key, value] of Object.entries(tokens.radius)) {
156
+ vars[radiusToCssVar(key)] = value;
157
+ }
158
+ for (const [key, value] of Object.entries(tokens.spacing)) {
159
+ vars[spacingToCssVar(key)] = value;
160
+ }
161
+ vars["--font-family"] = tokens.typography.fontFamily;
162
+ vars["--font-family-mono"] = tokens.typography.fontFamilyMono;
163
+ if (tokens.shadow) {
164
+ for (const [key, value] of Object.entries(tokens.shadow)) {
165
+ vars[`--shadow-${key}`] = value;
166
+ }
167
+ }
168
+ return vars;
169
+ }
170
+ var SHADOW_KEYS = ["--shadow-sm", "--shadow-md", "--shadow-lg", "--shadow-xl"];
171
+ function applyCssVars(vars, element = document.documentElement) {
172
+ for (const key of SHADOW_KEYS) {
173
+ if (!(key in vars)) {
174
+ element.style.removeProperty(key);
175
+ }
176
+ }
177
+ for (const [key, value] of Object.entries(vars)) {
178
+ element.style.setProperty(key, value);
179
+ }
180
+ }
181
+ var ThemeContext = _react.createContext.call(void 0, null);
182
+ function useTheme() {
183
+ const ctx = _react.useContext.call(void 0, ThemeContext);
184
+ if (!ctx) {
185
+ throw new Error("useTheme must be used within a ThemeProvider");
186
+ }
187
+ return ctx;
188
+ }
189
+ function ThemeProvider({
190
+ children,
191
+ defaultTheme = "default",
192
+ presets: customPresets
193
+ }) {
194
+ const presets = _nullishCoalesce(customPresets, () => ( [defaultPreset, darkPreset, auroraPreset]));
195
+ const presetMap = new Map(presets.map((p) => [p.name, p]));
196
+ const [themeName, setThemeName] = _react.useState.call(void 0, defaultTheme);
197
+ const currentPreset = _nullishCoalesce(presetMap.get(themeName), () => ( presets[0]));
198
+ const tokens = currentPreset.tokens;
199
+ _react.useEffect.call(void 0, () => {
200
+ const vars = generateCssVars(tokens);
201
+ applyCssVars(vars);
202
+ }, [tokens]);
203
+ const setTheme = (name) => {
204
+ if (presetMap.has(name)) {
205
+ setThemeName(name);
206
+ } else {
207
+ console.warn(`Theme "${name}" not found. Available: ${Array.from(presetMap.keys()).join(", ")}`);
208
+ }
209
+ };
210
+ return _react.createElement.call(void 0,
211
+ ThemeContext.Provider,
212
+ { value: { theme: themeName, setTheme, tokens } },
213
+ children
214
+ );
215
+ }
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+ exports.defaultPreset = defaultPreset; exports.darkPreset = darkPreset; exports.auroraPreset = auroraPreset; exports.useTheme = useTheme; exports.ThemeProvider = ThemeProvider;
224
+ //# sourceMappingURL=chunk-464G63BO.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/lucasgismondi/Desktop/dev/byld/internal/byld.ui/packages/ui/dist/chunk-464G63BO.cjs","../src/theme/web.ts","../src/theme/tokens.ts","../src/theme/presets/default.ts","../src/theme/presets/dark.ts","../src/theme/presets/aurora.ts"],"names":[],"mappings":"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","file":"/Users/lucasgismondi/Desktop/dev/byld/internal/byld.ui/packages/ui/dist/chunk-464G63BO.cjs","sourcesContent":[null,"\"use client\";\n\nimport { createContext, useContext, useEffect, useState, createElement } from \"react\";\nimport type { ThemePreset, ThemeTokens, ThemeColors, ThemeRadius, ThemeSpacing, ThemeShadow } from \"./theme.types\";\nimport { defaultPreset } from \"./presets/default\";\nimport { darkPreset } from \"./presets/dark\";\nimport { auroraPreset } from \"./presets/aurora\";\n\n// --- CSS Variable Generation ---\n\nfunction colorToCssVar(key: string): string {\n // camelCase → kebab-case\n return `--color-${key.replace(/([A-Z])/g, \"-$1\").toLowerCase()}`;\n}\n\nfunction radiusToCssVar(key: string): string {\n return `--radius-${key}`;\n}\n\nfunction spacingToCssVar(key: string): string {\n return `--spacing-${key}`;\n}\n\nfunction generateCssVars(tokens: ThemeTokens): Record<string, string> {\n const vars: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(tokens.colors)) {\n vars[colorToCssVar(key)] = value;\n }\n for (const [key, value] of Object.entries(tokens.radius)) {\n vars[radiusToCssVar(key)] = value;\n }\n for (const [key, value] of Object.entries(tokens.spacing)) {\n vars[spacingToCssVar(key)] = value;\n }\n vars[\"--font-family\"] = tokens.typography.fontFamily;\n vars[\"--font-family-mono\"] = tokens.typography.fontFamilyMono;\n\n if (tokens.shadow) {\n for (const [key, value] of Object.entries(tokens.shadow)) {\n vars[`--shadow-${key}`] = value;\n }\n }\n\n return vars;\n}\n\n// Shadow CSS var keys that may have been set by a previous theme and need clearing\nconst SHADOW_KEYS = [\"--shadow-sm\", \"--shadow-md\", \"--shadow-lg\", \"--shadow-xl\"];\n\nfunction applyCssVars(vars: Record<string, string>, element: HTMLElement = document.documentElement) {\n // Clear shadow overrides that may have been set by a previous theme\n for (const key of SHADOW_KEYS) {\n if (!(key in vars)) {\n element.style.removeProperty(key);\n }\n }\n for (const [key, value] of Object.entries(vars)) {\n element.style.setProperty(key, value);\n }\n}\n\n// --- Theme Context ---\n\ninterface ThemeContextValue {\n theme: string;\n setTheme: (name: string) => void;\n tokens: ThemeTokens;\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\nexport function useTheme(): ThemeContextValue {\n const ctx = useContext(ThemeContext);\n if (!ctx) {\n throw new Error(\"useTheme must be used within a ThemeProvider\");\n }\n return ctx;\n}\n\n// --- ThemeProvider ---\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n defaultTheme?: string;\n presets?: ThemePreset[];\n}\n\nexport function ThemeProvider({\n children,\n defaultTheme = \"default\",\n presets: customPresets,\n}: ThemeProviderProps) {\n const presets = customPresets ?? [defaultPreset, darkPreset, auroraPreset];\n const presetMap = new Map(presets.map((p) => [p.name, p]));\n\n const [themeName, setThemeName] = useState(defaultTheme);\n\n const currentPreset = presetMap.get(themeName) ?? presets[0];\n const tokens = currentPreset.tokens;\n\n useEffect(() => {\n const vars = generateCssVars(tokens);\n applyCssVars(vars);\n }, [tokens]);\n\n const setTheme = (name: string) => {\n if (presetMap.has(name)) {\n setThemeName(name);\n } else {\n console.warn(`Theme \"${name}\" not found. Available: ${Array.from(presetMap.keys()).join(\", \")}`);\n }\n };\n\n return createElement(\n ThemeContext.Provider,\n { value: { theme: themeName, setTheme, tokens } },\n children,\n );\n}\n\nexport { defaultPreset, darkPreset, auroraPreset };\nexport type { ThemePreset, ThemeTokens, ThemeColors, ThemeRadius, ThemeSpacing, ThemeShadow };\n","import type { ThemeTokens } from \"./theme.types\";\n\n/**\n * Canonical theme token definitions.\n * All values are CSS-compatible strings.\n * Native side converts rem → numbers automatically.\n */\nexport const baseTokens: Omit<ThemeTokens, \"colors\"> = {\n radius: {\n sm: \"0.25rem\",\n md: \"0.375rem\",\n lg: \"0.5rem\",\n xl: \"0.75rem\",\n full: \"9999px\",\n },\n spacing: {\n xs: \"0.25rem\",\n sm: \"0.5rem\",\n md: \"1rem\",\n lg: \"1.5rem\",\n xl: \"2rem\",\n \"2xl\": \"3rem\",\n \"3xl\": \"4rem\",\n },\n typography: {\n fontFamily:\n 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif',\n fontFamilyMono:\n 'ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace',\n },\n};\n","import type { ThemePreset } from \"../theme.types\";\nimport { baseTokens } from \"../tokens\";\n\nexport const defaultPreset: ThemePreset = {\n name: \"default\",\n tokens: {\n ...baseTokens,\n colors: {\n background: \"oklch(1 0 0)\",\n foreground: \"oklch(0.145 0 0)\",\n card: \"oklch(1 0 0)\",\n cardForeground: \"oklch(0.145 0 0)\",\n popover: \"oklch(1 0 0)\",\n popoverForeground: \"oklch(0.145 0 0)\",\n primary: \"oklch(0.205 0 0)\",\n primaryForeground: \"oklch(0.985 0 0)\",\n secondary: \"oklch(0.965 0 0)\",\n secondaryForeground: \"oklch(0.205 0 0)\",\n muted: \"oklch(0.965 0 0)\",\n mutedForeground: \"oklch(0.556 0 0)\",\n accent: \"oklch(0.965 0 0)\",\n accentForeground: \"oklch(0.205 0 0)\",\n destructive: \"oklch(0.577 0.245 27.325)\",\n destructiveForeground: \"oklch(0.985 0 0)\",\n border: \"oklch(0.922 0 0)\",\n input: \"oklch(0.922 0 0)\",\n ring: \"oklch(0.708 0 0)\",\n },\n },\n};\n","import type { ThemePreset } from \"../theme.types\";\nimport { baseTokens } from \"../tokens\";\n\nexport const darkPreset: ThemePreset = {\n name: \"dark\",\n tokens: {\n ...baseTokens,\n colors: {\n background: \"oklch(0.145 0 0)\",\n foreground: \"oklch(0.985 0 0)\",\n card: \"oklch(0.145 0 0)\",\n cardForeground: \"oklch(0.985 0 0)\",\n popover: \"oklch(0.145 0 0)\",\n popoverForeground: \"oklch(0.985 0 0)\",\n primary: \"oklch(0.985 0 0)\",\n primaryForeground: \"oklch(0.205 0 0)\",\n secondary: \"oklch(0.269 0 0)\",\n secondaryForeground: \"oklch(0.985 0 0)\",\n muted: \"oklch(0.269 0 0)\",\n mutedForeground: \"oklch(0.708 0 0)\",\n accent: \"oklch(0.269 0 0)\",\n accentForeground: \"oklch(0.985 0 0)\",\n destructive: \"oklch(0.396 0.141 25.723)\",\n destructiveForeground: \"oklch(0.637 0.237 25.331)\",\n border: \"oklch(0.269 0 0)\",\n input: \"oklch(0.269 0 0)\",\n ring: \"oklch(0.439 0 0)\",\n },\n },\n};\n","import type { ThemePreset } from \"../theme.types\";\n\nexport const auroraPreset: ThemePreset = {\n name: \"aurora\",\n tokens: {\n colors: {\n background: \"oklch(0.18 0.04 270)\",\n foreground: \"oklch(0.93 0.01 250)\",\n card: \"oklch(0.22 0.045 270)\",\n cardForeground: \"oklch(0.93 0.01 250)\",\n popover: \"oklch(0.22 0.045 270)\",\n popoverForeground: \"oklch(0.93 0.01 250)\",\n primary: \"oklch(0.75 0.15 190)\",\n primaryForeground: \"oklch(0.15 0.04 270)\",\n secondary: \"oklch(0.35 0.08 290)\",\n secondaryForeground: \"oklch(0.90 0.03 290)\",\n muted: \"oklch(0.28 0.04 270)\",\n mutedForeground: \"oklch(0.65 0.04 260)\",\n accent: \"oklch(0.30 0.05 270)\",\n accentForeground: \"oklch(0.93 0.01 250)\",\n destructive: \"oklch(0.65 0.22 15)\",\n destructiveForeground: \"oklch(0.95 0.01 15)\",\n border: \"oklch(0.26 0.035 270)\",\n input: \"oklch(0.26 0.035 270)\",\n ring: \"oklch(0.65 0.12 190)\",\n },\n radius: {\n sm: \"0.5rem\",\n md: \"0.75rem\",\n lg: \"1rem\",\n xl: \"1.5rem\",\n full: \"9999px\",\n },\n spacing: {\n xs: \"0.375rem\",\n sm: \"0.75rem\",\n md: \"1.25rem\",\n lg: \"2rem\",\n xl: \"2.5rem\",\n \"2xl\": \"3.5rem\",\n \"3xl\": \"5rem\",\n },\n typography: {\n fontFamily:\n 'ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace',\n fontFamilyMono:\n 'ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace',\n },\n shadow: {\n sm: \"0 1px 3px 0 oklch(0.55 0.12 190 / 0.3), 0 1px 2px -1px oklch(0.55 0.12 190 / 0.2)\",\n md: \"0 4px 8px -1px oklch(0.55 0.12 190 / 0.35), 0 2px 4px -2px oklch(0.55 0.12 190 / 0.25)\",\n lg: \"0 10px 20px -3px oklch(0.55 0.12 190 / 0.4), 0 4px 8px -4px oklch(0.55 0.12 190 / 0.3)\",\n xl: \"0 20px 30px -5px oklch(0.55 0.12 190 / 0.45), 0 8px 12px -6px oklch(0.55 0.12 190 / 0.35)\",\n },\n },\n};\n"]}