@nori-ui/core 0.0.5 → 1.0.2

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 (387) hide show
  1. package/dist/animation/animated-view.cjs +13 -0
  2. package/dist/animation/animated-view.cjs.map +1 -0
  3. package/dist/animation/animated-view.d.cts +6 -0
  4. package/dist/animation/animated-view.d.ts +6 -0
  5. package/dist/animation/animated-view.js +4 -0
  6. package/dist/animation/animated-view.js.map +1 -0
  7. package/dist/animation/animated-view.web.cjs +9 -0
  8. package/dist/animation/animated-view.web.cjs.map +1 -0
  9. package/dist/animation/animated-view.web.d.cts +5 -0
  10. package/dist/animation/animated-view.web.d.ts +5 -0
  11. package/dist/animation/animated-view.web.js +8 -0
  12. package/dist/animation/animated-view.web.js.map +1 -0
  13. package/dist/animation/use-animated-number.cjs +80 -0
  14. package/dist/animation/use-animated-number.cjs.map +1 -0
  15. package/dist/animation/use-animated-number.d.cts +8 -0
  16. package/dist/animation/use-animated-number.d.ts +8 -0
  17. package/dist/animation/use-animated-number.js +4 -0
  18. package/dist/animation/use-animated-number.js.map +1 -0
  19. package/dist/animation/use-animated-number.web.cjs +28 -0
  20. package/dist/animation/use-animated-number.web.cjs.map +1 -0
  21. package/dist/animation/use-animated-number.web.d.cts +8 -0
  22. package/dist/animation/use-animated-number.web.d.ts +8 -0
  23. package/dist/animation/use-animated-number.web.js +25 -0
  24. package/dist/animation/use-animated-number.web.js.map +1 -0
  25. package/dist/{chunk-RX7UULY3.js → chunk-33S7ADWM.js} +3 -3
  26. package/dist/{chunk-RX7UULY3.js.map → chunk-33S7ADWM.js.map} +1 -1
  27. package/dist/chunk-3BDDPFCI.js +108 -0
  28. package/dist/chunk-3BDDPFCI.js.map +1 -0
  29. package/dist/chunk-3F4TXKDY.js +314 -0
  30. package/dist/chunk-3F4TXKDY.js.map +1 -0
  31. package/dist/chunk-5A2QOOVN.js +15 -0
  32. package/dist/chunk-5A2QOOVN.js.map +1 -0
  33. package/dist/chunk-5XEGZFG5.js +208 -0
  34. package/dist/chunk-5XEGZFG5.js.map +1 -0
  35. package/dist/chunk-6AD6KCVB.js +178 -0
  36. package/dist/chunk-6AD6KCVB.js.map +1 -0
  37. package/dist/chunk-7GPDNQSX.js +967 -0
  38. package/dist/chunk-7GPDNQSX.js.map +1 -0
  39. package/dist/chunk-7UKRN73P.js +42 -0
  40. package/dist/chunk-7UKRN73P.js.map +1 -0
  41. package/dist/chunk-7Z4NMNX6.js +64 -0
  42. package/dist/chunk-7Z4NMNX6.js.map +1 -0
  43. package/dist/chunk-ACLHDHX3.js +29 -0
  44. package/dist/chunk-ACLHDHX3.js.map +1 -0
  45. package/dist/chunk-BZLT6R62.js +80 -0
  46. package/dist/chunk-BZLT6R62.js.map +1 -0
  47. package/dist/chunk-CCUXO2HN.js +450 -0
  48. package/dist/chunk-CCUXO2HN.js.map +1 -0
  49. package/dist/chunk-CHXHRJNZ.js +43 -0
  50. package/dist/chunk-CHXHRJNZ.js.map +1 -0
  51. package/dist/chunk-DDGMLLS3.js +188 -0
  52. package/dist/chunk-DDGMLLS3.js.map +1 -0
  53. package/dist/chunk-EWWQQ5DB.js +654 -0
  54. package/dist/chunk-EWWQQ5DB.js.map +1 -0
  55. package/dist/chunk-FEPTH5RV.js +169 -0
  56. package/dist/chunk-FEPTH5RV.js.map +1 -0
  57. package/dist/{chunk-SSTXLK5I.js → chunk-FT2XBBQJ.js} +42 -6
  58. package/dist/chunk-FT2XBBQJ.js.map +1 -0
  59. package/dist/chunk-IKLA2CVQ.js +260 -0
  60. package/dist/chunk-IKLA2CVQ.js.map +1 -0
  61. package/dist/chunk-JQQ3FBN7.js +18 -0
  62. package/dist/chunk-JQQ3FBN7.js.map +1 -0
  63. package/dist/chunk-JSAG5YO7.js +69 -0
  64. package/dist/chunk-JSAG5YO7.js.map +1 -0
  65. package/dist/chunk-JZ774T7U.js +76 -0
  66. package/dist/chunk-JZ774T7U.js.map +1 -0
  67. package/dist/chunk-KWRDJPP3.js +10 -0
  68. package/dist/chunk-KWRDJPP3.js.map +1 -0
  69. package/dist/chunk-LVWNMQGR.js +1106 -0
  70. package/dist/chunk-LVWNMQGR.js.map +1 -0
  71. package/dist/chunk-LWLK6HSW.js +143 -0
  72. package/dist/chunk-LWLK6HSW.js.map +1 -0
  73. package/dist/chunk-MDOZGILD.js +134 -0
  74. package/dist/chunk-MDOZGILD.js.map +1 -0
  75. package/dist/chunk-MKSDYRWQ.js +446 -0
  76. package/dist/chunk-MKSDYRWQ.js.map +1 -0
  77. package/dist/chunk-MRJWPRCX.js +80 -0
  78. package/dist/chunk-MRJWPRCX.js.map +1 -0
  79. package/dist/chunk-NRYWNOG5.js +410 -0
  80. package/dist/chunk-NRYWNOG5.js.map +1 -0
  81. package/dist/chunk-OMU4R4Y5.js +144 -0
  82. package/dist/chunk-OMU4R4Y5.js.map +1 -0
  83. package/dist/chunk-PNP7L4TA.js +103 -0
  84. package/dist/chunk-PNP7L4TA.js.map +1 -0
  85. package/dist/chunk-QI6646JZ.js +3 -0
  86. package/dist/{chunk-UAKFCMWK.js.map → chunk-QI6646JZ.js.map} +1 -1
  87. package/dist/chunk-QJNV7YQP.js +138 -0
  88. package/dist/chunk-QJNV7YQP.js.map +1 -0
  89. package/dist/chunk-R5JMDDCB.js +292 -0
  90. package/dist/chunk-R5JMDDCB.js.map +1 -0
  91. package/dist/chunk-RB3YBWQ4.js +77 -0
  92. package/dist/chunk-RB3YBWQ4.js.map +1 -0
  93. package/dist/chunk-RFW5SRZA.js +23 -0
  94. package/dist/chunk-RFW5SRZA.js.map +1 -0
  95. package/dist/chunk-RGJ3NBKE.js +8 -0
  96. package/dist/chunk-RGJ3NBKE.js.map +1 -0
  97. package/dist/chunk-SFNDR6DI.js +485 -0
  98. package/dist/chunk-SFNDR6DI.js.map +1 -0
  99. package/dist/chunk-SWC5CNKE.js +13 -0
  100. package/dist/chunk-SWC5CNKE.js.map +1 -0
  101. package/dist/chunk-TLS54G6Y.js +15 -0
  102. package/dist/chunk-TLS54G6Y.js.map +1 -0
  103. package/dist/chunk-WCQVDF3K.js +12 -0
  104. package/dist/{chunk-7QVYU63E.js.map → chunk-WCQVDF3K.js.map} +1 -1
  105. package/dist/chunk-WGT345SV.js +427 -0
  106. package/dist/chunk-WGT345SV.js.map +1 -0
  107. package/dist/chunk-X7APG7G2.js +1566 -0
  108. package/dist/chunk-X7APG7G2.js.map +1 -0
  109. package/dist/chunk-XALU6LOT.js +306 -0
  110. package/dist/chunk-XALU6LOT.js.map +1 -0
  111. package/dist/chunk-YNKKEO2A.js +336 -0
  112. package/dist/chunk-YNKKEO2A.js.map +1 -0
  113. package/dist/chunk-ZBW3BA5R.js +148 -0
  114. package/dist/chunk-ZBW3BA5R.js.map +1 -0
  115. package/dist/{chunk-FXKIWONG.js → chunk-ZIBNLXIV.js} +12 -6
  116. package/dist/chunk-ZIBNLXIV.js.map +1 -0
  117. package/dist/chunk-ZMSIYLSI.js +563 -0
  118. package/dist/chunk-ZMSIYLSI.js.map +1 -0
  119. package/dist/chunk-ZQMNGPLE.js +981 -0
  120. package/dist/chunk-ZQMNGPLE.js.map +1 -0
  121. package/dist/chunk-ZRD4FQBT.js +153 -0
  122. package/dist/chunk-ZRD4FQBT.js.map +1 -0
  123. package/dist/client.cjs +11289 -439
  124. package/dist/client.cjs.map +1 -1
  125. package/dist/client.d.cts +68 -117
  126. package/dist/client.d.ts +68 -117
  127. package/dist/client.js +58 -40
  128. package/dist/client.js.map +1 -1
  129. package/dist/components/Accordion/index.cjs +900 -0
  130. package/dist/components/Accordion/index.cjs.map +1 -0
  131. package/dist/components/Accordion/index.d.cts +72 -0
  132. package/dist/components/Accordion/index.d.ts +72 -0
  133. package/dist/components/Accordion/index.js +10 -0
  134. package/dist/components/Accordion/index.js.map +1 -0
  135. package/dist/components/Alert/index.cjs +567 -0
  136. package/dist/components/Alert/index.cjs.map +1 -0
  137. package/dist/components/Alert/index.d.cts +41 -0
  138. package/dist/components/Alert/index.d.ts +41 -0
  139. package/dist/components/Alert/index.js +8 -0
  140. package/dist/components/Alert/index.js.map +1 -0
  141. package/dist/components/AlertDialog/index.cjs +892 -0
  142. package/dist/components/AlertDialog/index.cjs.map +1 -0
  143. package/dist/components/AlertDialog/index.d.cts +68 -0
  144. package/dist/components/AlertDialog/index.d.ts +68 -0
  145. package/dist/components/AlertDialog/index.js +9 -0
  146. package/dist/components/AlertDialog/index.js.map +1 -0
  147. package/dist/components/Avatar/index.cjs +427 -0
  148. package/dist/components/Avatar/index.cjs.map +1 -0
  149. package/dist/components/Avatar/index.d.cts +40 -0
  150. package/dist/components/Avatar/index.d.ts +40 -0
  151. package/dist/components/Avatar/index.js +7 -0
  152. package/dist/components/Avatar/index.js.map +1 -0
  153. package/dist/components/Badge/index.cjs +433 -0
  154. package/dist/components/Badge/index.cjs.map +1 -0
  155. package/dist/components/Badge/index.d.cts +35 -0
  156. package/dist/components/Badge/index.d.ts +35 -0
  157. package/dist/components/Badge/index.js +7 -0
  158. package/dist/components/Badge/index.js.map +1 -0
  159. package/dist/components/Box/index.cjs +415 -0
  160. package/dist/components/Box/index.cjs.map +1 -0
  161. package/dist/components/Box/index.d.cts +24 -0
  162. package/dist/components/Box/index.d.ts +24 -0
  163. package/dist/components/Box/index.js +9 -0
  164. package/dist/components/Box/index.js.map +1 -0
  165. package/dist/components/Breadcrumb/index.cjs +1939 -0
  166. package/dist/components/Breadcrumb/index.cjs.map +1 -0
  167. package/dist/components/Breadcrumb/index.d.cts +186 -0
  168. package/dist/components/Breadcrumb/index.d.ts +186 -0
  169. package/dist/components/Breadcrumb/index.js +11 -0
  170. package/dist/components/Breadcrumb/index.js.map +1 -0
  171. package/dist/components/Button/index.cjs +631 -0
  172. package/dist/components/Button/index.cjs.map +1 -0
  173. package/dist/components/Button/index.d.cts +27 -0
  174. package/dist/components/Button/index.d.ts +27 -0
  175. package/dist/components/Button/index.js +9 -0
  176. package/dist/components/Button/index.js.map +1 -0
  177. package/dist/components/Calendar/index.cjs +3017 -0
  178. package/dist/components/Calendar/index.cjs.map +1 -0
  179. package/dist/components/Calendar/index.d.cts +169 -0
  180. package/dist/components/Calendar/index.d.ts +169 -0
  181. package/dist/components/Calendar/index.js +11 -0
  182. package/dist/components/Calendar/index.js.map +1 -0
  183. package/dist/components/Card/index.cjs +469 -0
  184. package/dist/components/Card/index.cjs.map +1 -0
  185. package/dist/components/Card/index.d.cts +33 -0
  186. package/dist/components/Card/index.d.ts +33 -0
  187. package/dist/components/Card/index.js +7 -0
  188. package/dist/components/Card/index.js.map +1 -0
  189. package/dist/components/Checkbox/index.cjs +590 -0
  190. package/dist/components/Checkbox/index.cjs.map +1 -0
  191. package/dist/components/Checkbox/index.d.cts +22 -0
  192. package/dist/components/Checkbox/index.d.ts +22 -0
  193. package/dist/components/Checkbox/index.js +9 -0
  194. package/dist/components/Checkbox/index.js.map +1 -0
  195. package/dist/components/Dialog/index.cjs +888 -0
  196. package/dist/components/Dialog/index.cjs.map +1 -0
  197. package/dist/components/Dialog/index.d.cts +56 -0
  198. package/dist/components/Dialog/index.d.ts +56 -0
  199. package/dist/components/Dialog/index.js +10 -0
  200. package/dist/components/Dialog/index.js.map +1 -0
  201. package/dist/components/FloatButton/index.cjs +1254 -0
  202. package/dist/components/FloatButton/index.cjs.map +1 -0
  203. package/dist/components/FloatButton/index.d.cts +133 -0
  204. package/dist/components/FloatButton/index.d.ts +133 -0
  205. package/dist/components/FloatButton/index.js +11 -0
  206. package/dist/components/FloatButton/index.js.map +1 -0
  207. package/dist/components/HStack/index.cjs +480 -0
  208. package/dist/components/HStack/index.cjs.map +1 -0
  209. package/dist/components/HStack/index.d.cts +24 -0
  210. package/dist/components/HStack/index.d.ts +24 -0
  211. package/dist/components/HStack/index.js +9 -0
  212. package/dist/components/HStack/index.js.map +1 -0
  213. package/dist/components/InputGroup/index.cjs +638 -0
  214. package/dist/components/InputGroup/index.cjs.map +1 -0
  215. package/dist/components/InputGroup/index.d.cts +33 -0
  216. package/dist/components/InputGroup/index.d.ts +33 -0
  217. package/dist/components/InputGroup/index.js +7 -0
  218. package/dist/components/InputGroup/index.js.map +1 -0
  219. package/dist/components/Pagination/index.cjs +2501 -0
  220. package/dist/components/Pagination/index.cjs.map +1 -0
  221. package/dist/components/Pagination/index.d.cts +164 -0
  222. package/dist/components/Pagination/index.d.ts +164 -0
  223. package/dist/components/Pagination/index.js +12 -0
  224. package/dist/components/Pagination/index.js.map +1 -0
  225. package/dist/components/Popover/index.cjs +739 -0
  226. package/dist/components/Popover/index.cjs.map +1 -0
  227. package/dist/components/Popover/index.d.cts +44 -0
  228. package/dist/components/Popover/index.d.ts +44 -0
  229. package/dist/components/Popover/index.js +8 -0
  230. package/dist/components/Popover/index.js.map +1 -0
  231. package/dist/components/Progress/index.cjs +493 -0
  232. package/dist/components/Progress/index.cjs.map +1 -0
  233. package/dist/components/Progress/index.d.cts +63 -0
  234. package/dist/components/Progress/index.d.ts +63 -0
  235. package/dist/components/Progress/index.js +7 -0
  236. package/dist/components/Progress/index.js.map +1 -0
  237. package/dist/components/Radio/index.cjs +584 -0
  238. package/dist/components/Radio/index.cjs.map +1 -0
  239. package/dist/components/Radio/index.d.cts +51 -0
  240. package/dist/components/Radio/index.d.ts +51 -0
  241. package/dist/components/Radio/index.js +7 -0
  242. package/dist/components/Radio/index.js.map +1 -0
  243. package/dist/components/SegmentedControl/index.cjs +502 -0
  244. package/dist/components/SegmentedControl/index.cjs.map +1 -0
  245. package/dist/components/SegmentedControl/index.d.cts +45 -0
  246. package/dist/components/SegmentedControl/index.d.ts +45 -0
  247. package/dist/components/SegmentedControl/index.js +7 -0
  248. package/dist/components/SegmentedControl/index.js.map +1 -0
  249. package/dist/components/Select/index.cjs +1359 -0
  250. package/dist/components/Select/index.cjs.map +1 -0
  251. package/dist/components/Select/index.d.cts +140 -0
  252. package/dist/components/Select/index.d.ts +140 -0
  253. package/dist/components/Select/index.js +8 -0
  254. package/dist/components/Select/index.js.map +1 -0
  255. package/dist/components/Separator/index.cjs +358 -0
  256. package/dist/components/Separator/index.cjs.map +1 -0
  257. package/dist/components/Separator/index.d.cts +28 -0
  258. package/dist/components/Separator/index.d.ts +28 -0
  259. package/dist/components/Separator/index.js +6 -0
  260. package/dist/components/Separator/index.js.map +1 -0
  261. package/dist/components/Skeleton/index.cjs +384 -0
  262. package/dist/components/Skeleton/index.cjs.map +1 -0
  263. package/dist/components/Skeleton/index.d.cts +30 -0
  264. package/dist/components/Skeleton/index.d.ts +30 -0
  265. package/dist/components/Skeleton/index.js +6 -0
  266. package/dist/components/Skeleton/index.js.map +1 -0
  267. package/dist/components/Slider/index.cjs +880 -0
  268. package/dist/components/Slider/index.cjs.map +1 -0
  269. package/dist/components/Slider/index.d.cts +84 -0
  270. package/dist/components/Slider/index.d.ts +84 -0
  271. package/dist/components/Slider/index.js +6 -0
  272. package/dist/components/Slider/index.js.map +1 -0
  273. package/dist/components/Spinner/index.cjs +32 -0
  274. package/dist/components/Spinner/index.cjs.map +1 -0
  275. package/dist/components/Spinner/index.d.cts +25 -0
  276. package/dist/components/Spinner/index.d.ts +25 -0
  277. package/dist/components/Spinner/index.js +4 -0
  278. package/dist/components/Spinner/index.js.map +1 -0
  279. package/dist/components/Switch/index.cjs +623 -0
  280. package/dist/components/Switch/index.cjs.map +1 -0
  281. package/dist/components/Switch/index.d.cts +22 -0
  282. package/dist/components/Switch/index.d.ts +22 -0
  283. package/dist/components/Switch/index.js +10 -0
  284. package/dist/components/Switch/index.js.map +1 -0
  285. package/dist/components/Tabs/index.cjs +630 -0
  286. package/dist/components/Tabs/index.cjs.map +1 -0
  287. package/dist/components/Tabs/index.d.cts +63 -0
  288. package/dist/components/Tabs/index.d.ts +63 -0
  289. package/dist/components/Tabs/index.js +7 -0
  290. package/dist/components/Tabs/index.js.map +1 -0
  291. package/dist/components/Text/index.cjs +401 -0
  292. package/dist/components/Text/index.cjs.map +1 -0
  293. package/dist/components/Text/index.d.cts +24 -0
  294. package/dist/components/Text/index.d.ts +24 -0
  295. package/dist/components/Text/index.js +7 -0
  296. package/dist/components/Text/index.js.map +1 -0
  297. package/dist/components/TextArea/index.cjs +482 -0
  298. package/dist/components/TextArea/index.cjs.map +1 -0
  299. package/dist/components/TextArea/index.d.cts +25 -0
  300. package/dist/components/TextArea/index.d.ts +25 -0
  301. package/dist/components/TextArea/index.js +8 -0
  302. package/dist/components/TextArea/index.js.map +1 -0
  303. package/dist/components/TextInput/index.cjs +477 -0
  304. package/dist/components/TextInput/index.cjs.map +1 -0
  305. package/dist/components/TextInput/index.d.cts +33 -0
  306. package/dist/components/TextInput/index.d.ts +33 -0
  307. package/dist/components/TextInput/index.js +7 -0
  308. package/dist/components/TextInput/index.js.map +1 -0
  309. package/dist/components/Toast/index.cjs +167 -0
  310. package/dist/components/Toast/index.cjs.map +1 -0
  311. package/dist/components/Toast/index.d.cts +143 -0
  312. package/dist/components/Toast/index.d.ts +143 -0
  313. package/dist/components/Toast/index.js +4 -0
  314. package/dist/components/Toast/index.js.map +1 -0
  315. package/dist/components/Toggle/index.cjs +770 -0
  316. package/dist/components/Toggle/index.cjs.map +1 -0
  317. package/dist/components/Toggle/index.d.cts +83 -0
  318. package/dist/components/Toggle/index.d.ts +83 -0
  319. package/dist/components/Toggle/index.js +7 -0
  320. package/dist/components/Toggle/index.js.map +1 -0
  321. package/dist/components/Tooltip/index.cjs +813 -0
  322. package/dist/components/Tooltip/index.cjs.map +1 -0
  323. package/dist/components/Tooltip/index.d.cts +55 -0
  324. package/dist/components/Tooltip/index.d.ts +55 -0
  325. package/dist/components/Tooltip/index.js +8 -0
  326. package/dist/components/Tooltip/index.js.map +1 -0
  327. package/dist/components/VStack/index.cjs +480 -0
  328. package/dist/components/VStack/index.cjs.map +1 -0
  329. package/dist/components/VStack/index.d.cts +19 -0
  330. package/dist/components/VStack/index.d.ts +19 -0
  331. package/dist/components/VStack/index.js +9 -0
  332. package/dist/components/VStack/index.js.map +1 -0
  333. package/dist/i18n/index.cjs +39 -3
  334. package/dist/i18n/index.cjs.map +1 -1
  335. package/dist/i18n/index.d.cts +4 -60
  336. package/dist/i18n/index.d.ts +4 -60
  337. package/dist/i18n/index.js +3 -2
  338. package/dist/icons/index.cjs +326 -26
  339. package/dist/icons/index.cjs.map +1 -1
  340. package/dist/icons/index.js +4 -3
  341. package/dist/index-D3_M3G6U.d.ts +19 -0
  342. package/dist/index-uXPK_Rg8.d.cts +19 -0
  343. package/dist/index.cjs +11176 -463
  344. package/dist/index.cjs.map +1 -1
  345. package/dist/index.d.cts +39 -183
  346. package/dist/index.d.ts +39 -183
  347. package/dist/index.js +49 -9
  348. package/dist/resolve-D-GOaxZy.d.cts +60 -0
  349. package/dist/resolve-D-GOaxZy.d.ts +60 -0
  350. package/dist/slot/index.cjs +9 -3
  351. package/dist/slot/index.cjs.map +1 -1
  352. package/dist/slot/index.js +2 -2
  353. package/dist/stories/index.cjs +108 -0
  354. package/dist/stories/index.cjs.map +1 -0
  355. package/dist/stories/index.d.cts +46 -0
  356. package/dist/stories/index.d.ts +46 -0
  357. package/dist/stories/index.js +94 -0
  358. package/dist/stories/index.js.map +1 -0
  359. package/dist/theme/index.cjs +259 -26
  360. package/dist/theme/index.cjs.map +1 -1
  361. package/dist/theme/index.d.cts +26 -0
  362. package/dist/theme/index.d.ts +26 -0
  363. package/dist/theme/index.js +4 -3
  364. package/dist/use-theme-CoqfnvRs.d.cts +112 -0
  365. package/dist/use-theme-CoqfnvRs.d.ts +112 -0
  366. package/dist/utils/cn.cjs +18 -6
  367. package/dist/utils/cn.cjs.map +1 -1
  368. package/dist/utils/cn.js +2 -2
  369. package/package.json +41 -10
  370. package/dist/chunk-6OABNXBY.js +0 -213
  371. package/dist/chunk-6OABNXBY.js.map +0 -1
  372. package/dist/chunk-7QVYU63E.js +0 -6
  373. package/dist/chunk-FXKIWONG.js.map +0 -1
  374. package/dist/chunk-NDEDMCHT.js +0 -40
  375. package/dist/chunk-NDEDMCHT.js.map +0 -1
  376. package/dist/chunk-SSTXLK5I.js.map +0 -1
  377. package/dist/chunk-UAKFCMWK.js +0 -3
  378. package/dist/chunk-X3AJNNF6.js +0 -539
  379. package/dist/chunk-X3AJNNF6.js.map +0 -1
  380. package/dist/chunk-XGM2K4TT.js +0 -31
  381. package/dist/chunk-XGM2K4TT.js.map +0 -1
  382. package/dist/stories/story-registry.cjs +0 -776
  383. package/dist/stories/story-registry.cjs.map +0 -1
  384. package/dist/stories/story-registry.d.cts +0 -13
  385. package/dist/stories/story-registry.d.ts +0 -13
  386. package/dist/stories/story-registry.js +0 -106
  387. package/dist/stories/story-registry.js.map +0 -1
@@ -0,0 +1,314 @@
1
+ import { px } from './chunk-5A2QOOVN.js';
2
+ import { cn } from './chunk-CHXHRJNZ.js';
3
+ import { useThemeColors } from './chunk-R5JMDDCB.js';
4
+ import { __name } from './chunk-WCQVDF3K.js';
5
+ import { createContext, useId, useState, useRef, useCallback, Children, useMemo, useContext, isValidElement } from 'react';
6
+ import { Text, View, TextInput, Platform, Pressable } from 'react-native';
7
+ import { jsx, jsxs } from 'nativewind/jsx-runtime';
8
+
9
+ var InputGroupContext = createContext(null);
10
+ var useInputGroupContext = /* @__PURE__ */ __name((label) => {
11
+ const ctx = useContext(InputGroupContext);
12
+ if (!ctx) {
13
+ throw new Error(`<${label}> must be rendered inside an <InputGroup>.`);
14
+ }
15
+ return ctx;
16
+ }, "useInputGroupContext");
17
+ var ADDON_TYPE = /* @__PURE__ */ Symbol.for("nori-ui.InputGroupAddon");
18
+ var INPUT_TYPE = /* @__PURE__ */ Symbol.for("nori-ui.InputGroupInput");
19
+ var isAddon = /* @__PURE__ */ __name((child) => isValidElement(child) && child.type?.__noriType === ADDON_TYPE, "isAddon");
20
+ var isInput = /* @__PURE__ */ __name((child) => isValidElement(child) && child.type?.__noriType === INPUT_TYPE, "isInput");
21
+ var CONTAINER_LAYOUT_BASE = { flexDirection: "column" };
22
+ var FIELD_LAYOUT_BASE = {
23
+ flexDirection: "row",
24
+ alignItems: "stretch",
25
+ borderWidth: 1,
26
+ overflow: "hidden"
27
+ };
28
+ var InputGroupRoot = /* @__PURE__ */ __name(({
29
+ children,
30
+ disabled = false,
31
+ error: groupErrorProp = false,
32
+ className,
33
+ containerClassName,
34
+ testID
35
+ }) => {
36
+ const colors = useThemeColors();
37
+ const reactId = useId();
38
+ const inputId = `nori-ui-input-${reactId}`;
39
+ const describeId = `${inputId}-describe`;
40
+ const [focused, setFocused] = useState(false);
41
+ const inputRef = useRef(null);
42
+ const focusInput = useCallback(() => {
43
+ inputRef.current?.focus();
44
+ }, []);
45
+ const childArray = Children.toArray(children);
46
+ const inputIndex = childArray.findIndex(isInput);
47
+ const inputElement = inputIndex >= 0 ? childArray[inputIndex] : null;
48
+ const prefixNodes = inputIndex >= 0 ? childArray.slice(0, inputIndex).filter(isAddon) : [];
49
+ const suffixNodes = inputIndex >= 0 ? childArray.slice(inputIndex + 1).filter(isAddon) : [];
50
+ const inputProps = inputElement?.props ?? {};
51
+ const label = inputProps.label;
52
+ const helperText = inputProps.helperText;
53
+ const inputError = inputProps.error;
54
+ const hasError = Boolean(groupErrorProp) || Boolean(inputError);
55
+ const ctx = useMemo(
56
+ () => ({
57
+ inputId,
58
+ describeId,
59
+ setFocused,
60
+ hasError,
61
+ disabled,
62
+ inputRef,
63
+ focusInput
64
+ }),
65
+ [inputId, describeId, hasError, disabled, focusInput]
66
+ );
67
+ const borderColor = hasError ? colors.color.danger : focused ? colors.semantic.interactive.primary : colors.semantic.border.default;
68
+ const fieldStyle = [
69
+ FIELD_LAYOUT_BASE,
70
+ {
71
+ borderRadius: px(colors.radius.md),
72
+ backgroundColor: colors.semantic.background.elevated,
73
+ borderColor
74
+ },
75
+ disabled ? { opacity: 0.6 } : null
76
+ ];
77
+ const labelStyle = {
78
+ fontFamily: colors.fontFamily.body,
79
+ fontSize: px(colors.fontSize.sm),
80
+ fontWeight: colors.fontWeight.medium,
81
+ color: colors.semantic.text.default
82
+ };
83
+ const helperStyle = {
84
+ fontFamily: colors.fontFamily.body,
85
+ fontSize: px(colors.fontSize.sm),
86
+ color: colors.semantic.text.muted
87
+ };
88
+ const errorStyle = {
89
+ fontFamily: colors.fontFamily.body,
90
+ fontSize: px(colors.fontSize.sm),
91
+ color: colors.color.danger
92
+ };
93
+ const containerStyle = { ...CONTAINER_LAYOUT_BASE, gap: px(colors.spacing["1"]) };
94
+ return /* @__PURE__ */ jsxs(
95
+ View,
96
+ {
97
+ ...testID !== void 0 ? { testID } : {},
98
+ className: cn("flex flex-col gap-1", containerClassName),
99
+ style: containerStyle,
100
+ children: [
101
+ label !== void 0 ? (
102
+ // On web we render a real <label htmlFor> so clicking the
103
+ // label focuses the input the standard a11y way (and so
104
+ // jsdom-based tests can assert the label↔input
105
+ // association via the `for` attribute).
106
+ //
107
+ // On native, raw <label> is not a valid host component
108
+ // and RN crashes with "View config getter callback for
109
+ // component `label` must be a function". The native
110
+ // path renders an RNText instead — the underlying
111
+ // RNTextInput still carries accessibilityLabel for
112
+ // screen readers, so the visible text + the a11y name
113
+ // remain in sync. Same web-only `<label>` story as
114
+ // TextInput's earlier iteration; this branch is the
115
+ // explicit native-safe fallback.
116
+ Platform.OS === "web" ? /* @__PURE__ */ jsx(
117
+ "label",
118
+ {
119
+ htmlFor: inputId,
120
+ className: "text-sm font-medium text-semantic-text-default",
121
+ style: labelStyle,
122
+ children: label
123
+ }
124
+ ) : /* @__PURE__ */ jsx(
125
+ Text,
126
+ {
127
+ nativeID: `${inputId}-label`,
128
+ accessibilityRole: "text",
129
+ className: "text-sm font-medium text-semantic-text-default",
130
+ style: labelStyle,
131
+ children: label
132
+ }
133
+ )
134
+ ) : null,
135
+ /* @__PURE__ */ jsx(InputGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxs(
136
+ View,
137
+ {
138
+ className: cn(
139
+ "flex-row items-stretch overflow-hidden rounded-md border focus-within:border-semantic-interactive-primary",
140
+ hasError ? "border-semantic-interactive-destructive" : "border-semantic-border-default",
141
+ disabled ? "opacity-60" : void 0,
142
+ className
143
+ ),
144
+ style: fieldStyle,
145
+ children: [
146
+ prefixNodes.map((node, i) => {
147
+ const key = node.key ?? `prefix-${i}`;
148
+ return /* @__PURE__ */ jsx(AddonSlot, { side: "left", children: node }, key);
149
+ }),
150
+ inputElement,
151
+ suffixNodes.map((node, i) => {
152
+ const key = node.key ?? `suffix-${i}`;
153
+ return /* @__PURE__ */ jsx(AddonSlot, { side: "right", children: node }, key);
154
+ })
155
+ ]
156
+ }
157
+ ) }),
158
+ inputError ? /* @__PURE__ */ jsx(
159
+ Text,
160
+ {
161
+ nativeID: describeId,
162
+ className: "text-sm text-semantic-interactive-destructive",
163
+ style: errorStyle,
164
+ children: inputError
165
+ }
166
+ ) : helperText ? /* @__PURE__ */ jsx(Text, { nativeID: describeId, className: "text-sm text-semantic-text-muted", style: helperStyle, children: helperText }) : null
167
+ ]
168
+ }
169
+ );
170
+ }, "InputGroupRoot");
171
+ var AddonSlot = /* @__PURE__ */ __name(({ children, side }) => {
172
+ const colors = useThemeColors();
173
+ const ctx = useContext(InputGroupContext);
174
+ const dim = ctx?.disabled ? 0.85 : 1;
175
+ const baseStyle = {
176
+ backgroundColor: colors.semantic.background.subtle,
177
+ paddingHorizontal: px(colors.spacing["3"]),
178
+ flexDirection: "row",
179
+ alignItems: "center",
180
+ justifyContent: "center",
181
+ opacity: dim
182
+ };
183
+ const separatorStyle = side === "left" ? { borderRightWidth: 1, borderRightColor: colors.semantic.border.default } : { borderLeftWidth: 1, borderLeftColor: colors.semantic.border.default };
184
+ const handlePress = /* @__PURE__ */ __name(() => {
185
+ ctx?.focusInput();
186
+ }, "handlePress");
187
+ return /* @__PURE__ */ jsx(
188
+ Pressable,
189
+ {
190
+ onPress: handlePress,
191
+ role: "none",
192
+ focusable: false,
193
+ style: [baseStyle, separatorStyle],
194
+ className: cn(
195
+ "flex-row items-center justify-center px-3 bg-semantic-background-subtle",
196
+ side === "right" ? "border-l border-semantic-border-default" : "border-r border-semantic-border-default"
197
+ ),
198
+ children
199
+ }
200
+ );
201
+ }, "AddonSlot");
202
+ var InputGroupAddon = /* @__PURE__ */ __name(({ children, className, testID }) => {
203
+ const colors = useThemeColors();
204
+ const textStyle = {
205
+ color: colors.semantic.text.muted,
206
+ fontFamily: colors.fontFamily.body,
207
+ fontSize: px(colors.fontSize.sm)
208
+ };
209
+ if (typeof children === "string" || typeof children === "number") {
210
+ return /* @__PURE__ */ jsx(
211
+ Text,
212
+ {
213
+ ...testID !== void 0 ? { testID } : {},
214
+ className: cn("text-sm text-semantic-text-muted", className),
215
+ style: textStyle,
216
+ children
217
+ }
218
+ );
219
+ }
220
+ return /* @__PURE__ */ jsx(View, { ...testID !== void 0 ? { testID } : {}, ...className !== void 0 ? { className } : {}, children });
221
+ }, "InputGroupAddon");
222
+ InputGroupAddon.__noriType = ADDON_TYPE;
223
+ var INPUT_LAYOUT_BASE = {
224
+ flex: 1,
225
+ // RN web honours `outlineStyle: 'none'` to suppress the default browser
226
+ // focus ring — the group's own focus-within border replaces it.
227
+ outlineStyle: "none"
228
+ };
229
+ var InputGroupInput = /* @__PURE__ */ __name(({
230
+ label: _label,
231
+ helperText: _helperText,
232
+ error,
233
+ disabled,
234
+ onChangeText,
235
+ onFocus,
236
+ onBlur,
237
+ multiline,
238
+ numberOfLines,
239
+ leading: _leading,
240
+ trailing: _trailing,
241
+ containerClassName: _containerClassName,
242
+ className,
243
+ testID,
244
+ ...rest
245
+ }) => {
246
+ const colors = useThemeColors();
247
+ const ctx = useInputGroupContext("InputGroupInput");
248
+ const inputId = ctx.inputId;
249
+ const describeId = ctx.describeId;
250
+ const isDisabled = disabled || ctx.disabled;
251
+ const hasError = Boolean(error) || ctx.hasError;
252
+ const inputExtras = {};
253
+ if (testID !== void 0) {
254
+ inputExtras.testID = testID;
255
+ }
256
+ if (_label !== void 0) {
257
+ inputExtras.accessibilityLabel = _label;
258
+ }
259
+ if (hasError) {
260
+ inputExtras["aria-invalid"] = true;
261
+ }
262
+ if (error || _helperText) {
263
+ inputExtras["aria-describedby"] = describeId;
264
+ }
265
+ if (multiline !== void 0) {
266
+ inputExtras.multiline = multiline;
267
+ }
268
+ if (numberOfLines !== void 0) {
269
+ inputExtras.numberOfLines = numberOfLines;
270
+ }
271
+ if (onChangeText !== void 0) {
272
+ inputExtras.onChangeText = onChangeText;
273
+ }
274
+ const inputStyle = {
275
+ ...INPUT_LAYOUT_BASE,
276
+ paddingVertical: px(colors.spacing["2"]),
277
+ paddingHorizontal: px(colors.spacing["3"]),
278
+ fontFamily: colors.fontFamily.body,
279
+ fontSize: px(colors.fontSize.md),
280
+ color: colors.semantic.text.default
281
+ };
282
+ return /* @__PURE__ */ jsx(
283
+ TextInput,
284
+ {
285
+ ref: (node) => {
286
+ ctx.inputRef.current = node;
287
+ },
288
+ nativeID: inputId,
289
+ editable: !isDisabled,
290
+ className: cn("flex-1 py-2 px-3 text-md text-semantic-text-default outline-none bg-transparent", className),
291
+ placeholderTextColor: colors.semantic.text.muted,
292
+ onFocus: (e) => {
293
+ ctx.setFocused(true);
294
+ onFocus?.(e);
295
+ },
296
+ onBlur: (e) => {
297
+ ctx.setFocused(false);
298
+ onBlur?.(e);
299
+ },
300
+ ...inputExtras,
301
+ ...rest,
302
+ style: [inputStyle, rest.style]
303
+ }
304
+ );
305
+ }, "InputGroupInput");
306
+ InputGroupInput.__noriType = INPUT_TYPE;
307
+ var InputGroup = Object.assign(InputGroupRoot, {
308
+ Addon: InputGroupAddon,
309
+ Input: InputGroupInput
310
+ });
311
+
312
+ export { InputGroup };
313
+ //# sourceMappingURL=chunk-3F4TXKDY.js.map
314
+ //# sourceMappingURL=chunk-3F4TXKDY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/InputGroup/InputGroup.tsx"],"names":["RNText","RNTextInput"],"mappings":";;;;;;;;AAqCA,IAAM,iBAAA,GAAoB,cAA6C,IAAI,CAAA;AAE3E,IAAM,oBAAA,2BAAwB,KAAA,KAA0C;AACpE,EAAA,MAAM,GAAA,GAAM,WAAW,iBAAiB,CAAA;AACxC,EAAA,IAAI,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A,EAAO,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK;AAAA,GAChC;AAEA,EAAA,uBACI,GAAA;AAAA,IAACC,SAAA;AAAA,IAAA;AAAA,MACG,GAAA,EAAK,CAAC,IAAA,KAAS;AACX,QAAA,GAAA,CAAI,SAAS,OAAA,GAAU,IAAA;AAAA,MAC3B,CAAA;AAAA,MACA,QAAA,EAAU,OAAA;AAAA,MACV,UAAU,CAAC,UAAA;AAAA,MACX,SAAA,EAAW,EAAA,CAAG,iFAAA,EAAmF,SAAS,CAAA;AAAA,MAC1G,oBAAA,EAAsB,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,KAAA;AAAA,MAC3C,OAAA,EAAS,CAAC,CAAA,KAAM;AACZ,QAAA,GAAA,CAAI,WAAW,IAAI,CAAA;AACnB,QAAA,OAAA,GAAU,CAAC,CAAA;AAAA,MACf,CAAA;AAAA,MACA,MAAA,EAAQ,CAAC,CAAA,KAAM;AACX,QAAA,GAAA,CAAI,WAAW,KAAK,CAAA;AACpB,QAAA,MAAA,GAAS,CAAC,CAAA;AAAA,MACd,CAAA;AAAA,MACC,GAAG,WAAA;AAAA,MACH,GAAG,IAAA;AAAA,MACJ,KAAA,EAAO,CAAC,UAAA,EAAY,IAAA,CAAK,KAAK;AAAA;AAAA,GAClC;AAER,CAAA,EA9E+B,iBAAA,CAAA;AAgF9B,eAAA,CAAsD,UAAA,GAAa,UAAA;AAQ7D,IAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACpD,KAAA,EAAO,eAAA;AAAA,EACP,KAAA,EAAO;AACX,CAAC","file":"chunk-3F4TXKDY.js","sourcesContent":["'use client';\n\nimport {\n Children,\n createContext,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { TextInput as RNTextInputType, TextStyle, ViewStyle } from 'react-native';\nimport { Platform, Pressable, Text as RNText, TextInput as RNTextInput, View } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\nimport type { TextInputProps } from '../TextInput/TextInput';\n\n// ─── Internal context ─────────────────────────────────────────────────────\n//\n// Lets the addons + input share focus, error, and disabled state so the\n// WHOLE group's border lights up on focus and dimming cascades visually\n// without consumers having to duplicate props on every child.\ntype InputGroupContextValue = {\n inputId: string;\n describeId: string;\n setFocused: (next: boolean) => void;\n hasError: boolean;\n disabled: boolean;\n inputRef: React.MutableRefObject<RNTextInputType | null>;\n focusInput: () => void;\n};\n\nconst InputGroupContext = createContext<InputGroupContextValue | null>(null);\n\nconst useInputGroupContext = (label: string): InputGroupContextValue => {\n const ctx = useContext(InputGroupContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <InputGroup>.`);\n }\n return ctx;\n};\n\n// Marker symbols on the child component functions so we can split children\n// into [prefix, input, suffix] without forcing consumers to pass `position`\n// props or use named slots. Whatever sits before the InputGroupInput is a\n// prefix; whatever sits after is a suffix.\nconst ADDON_TYPE = Symbol.for('nori-ui.InputGroupAddon');\nconst INPUT_TYPE = Symbol.for('nori-ui.InputGroupInput');\n\nconst isAddon = (child: unknown): child is ReactElement =>\n isValidElement(child) && (child.type as { __noriType?: symbol })?.__noriType === ADDON_TYPE;\n\nconst isInput = (child: unknown): child is ReactElement<InputGroupInputProps> =>\n isValidElement(child) && (child.type as { __noriType?: symbol })?.__noriType === INPUT_TYPE;\n\n// ─── Container ────────────────────────────────────────────────────────────\n\n// Layout-only bases; theme-driven dimensions are merged inside the\n// component below.\nconst CONTAINER_LAYOUT_BASE: ViewStyle = { flexDirection: 'column' };\nconst FIELD_LAYOUT_BASE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'stretch',\n borderWidth: 1,\n overflow: 'hidden',\n};\n\nexport type InputGroupProps = {\n children: ReactNode;\n /** Mark the entire group as disabled — cascades visually to addons + input. */\n disabled?: boolean;\n /** Mark the entire group as errored — cascades visually to addons + input. */\n error?: boolean;\n className?: string;\n containerClassName?: string;\n testID?: string;\n};\n\n/**\n * Wrapper that visually fuses prefix and/or suffix addons with a TextInput\n * into a SINGLE rounded field — one border around the whole compound, not\n * three separate boxes. Inspired by Chakra's InputGroup and shadcn's input\n * addon pattern.\n *\n * @example\n * <InputGroup>\n * <InputGroupAddon>@</InputGroupAddon>\n * <InputGroupInput placeholder=\"username\" />\n * </InputGroup>\n *\n * @example with both prefix and suffix\n * <InputGroup>\n * <InputGroupAddon>https://</InputGroupAddon>\n * <InputGroupInput defaultValue=\"example\" />\n * <InputGroupAddon>.com</InputGroupAddon>\n * </InputGroup>\n */\nconst InputGroupRoot = ({\n children,\n disabled = false,\n error: groupErrorProp = false,\n className,\n containerClassName,\n testID,\n}: InputGroupProps) => {\n const colors = useThemeColors();\n const reactId = useId();\n const inputId = `nori-ui-input-${reactId}`;\n const describeId = `${inputId}-describe`;\n const [focused, setFocused] = useState(false);\n const inputRef = useRef<RNTextInputType | null>(null);\n\n // Stable identity (does not depend on render-cycle state) so the\n // useMemo below can leave it out of the dep array without lint noise.\n const focusInput = useCallback(() => {\n inputRef.current?.focus();\n }, []);\n\n // Walk children once, split into [prefix, input, suffix]. Anything that\n // isn't a recognised marker gets dropped — the API guarantees a single\n // integrated bar, not arbitrary slots.\n const childArray = Children.toArray(children);\n const inputIndex = childArray.findIndex(isInput);\n const inputElement = inputIndex >= 0 ? (childArray[inputIndex] as ReactElement<InputGroupInputProps>) : null;\n const prefixNodes = inputIndex >= 0 ? childArray.slice(0, inputIndex).filter(isAddon) : [];\n const suffixNodes = inputIndex >= 0 ? childArray.slice(inputIndex + 1).filter(isAddon) : [];\n\n // Lift label / helperText / error from the input element so the parent\n // can render them OUTSIDE the bordered field row (a normal field layout\n // wraps the box with label above and helper/error below).\n const inputProps = inputElement?.props ?? ({} as InputGroupInputProps);\n const label = inputProps.label;\n const helperText = inputProps.helperText;\n const inputError = inputProps.error;\n\n const hasError = Boolean(groupErrorProp) || Boolean(inputError);\n\n const ctx = useMemo<InputGroupContextValue>(\n () => ({\n inputId,\n describeId,\n setFocused,\n hasError,\n disabled,\n inputRef,\n focusInput,\n }),\n [inputId, describeId, hasError, disabled, focusInput]\n );\n\n const borderColor = hasError\n ? colors.color.danger\n : focused\n ? colors.semantic.interactive.primary\n : colors.semantic.border.default;\n\n const fieldStyle = [\n FIELD_LAYOUT_BASE,\n {\n borderRadius: px(colors.radius.md),\n backgroundColor: colors.semantic.background.elevated,\n borderColor,\n },\n disabled ? { opacity: 0.6 } : null,\n ];\n\n const labelStyle: TextStyle = {\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n color: colors.semantic.text.default,\n };\n const helperStyle: TextStyle = {\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n };\n const errorStyle: TextStyle = {\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.color.danger,\n };\n const containerStyle: ViewStyle = { ...CONTAINER_LAYOUT_BASE, gap: px(colors.spacing['1']) };\n\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex flex-col gap-1', containerClassName)}\n style={containerStyle}\n >\n {label !== undefined ? (\n // On web we render a real <label htmlFor> so clicking the\n // label focuses the input the standard a11y way (and so\n // jsdom-based tests can assert the label↔input\n // association via the `for` attribute).\n //\n // On native, raw <label> is not a valid host component\n // and RN crashes with \"View config getter callback for\n // component `label` must be a function\". The native\n // path renders an RNText instead — the underlying\n // RNTextInput still carries accessibilityLabel for\n // screen readers, so the visible text + the a11y name\n // remain in sync. Same web-only `<label>` story as\n // TextInput's earlier iteration; this branch is the\n // explicit native-safe fallback.\n Platform.OS === 'web' ? (\n <label\n htmlFor={inputId}\n className=\"text-sm font-medium text-semantic-text-default\"\n style={labelStyle as object}\n >\n {label}\n </label>\n ) : (\n <RNText\n nativeID={`${inputId}-label`}\n accessibilityRole=\"text\"\n className=\"text-sm font-medium text-semantic-text-default\"\n style={labelStyle}\n >\n {label}\n </RNText>\n )\n ) : null}\n <InputGroupContext.Provider value={ctx}>\n <View\n className={cn(\n 'flex-row items-stretch overflow-hidden rounded-md border focus-within:border-semantic-interactive-primary',\n hasError ? 'border-semantic-interactive-destructive' : 'border-semantic-border-default',\n disabled ? 'opacity-60' : undefined,\n className\n )}\n style={fieldStyle}\n >\n {prefixNodes.map((node, i) => {\n const key = (node as ReactElement & { key?: string | null }).key ?? `prefix-${i}`;\n return (\n <AddonSlot key={key} side=\"left\">\n {node}\n </AddonSlot>\n );\n })}\n {inputElement}\n {suffixNodes.map((node, i) => {\n const key = (node as ReactElement & { key?: string | null }).key ?? `suffix-${i}`;\n return (\n <AddonSlot key={key} side=\"right\">\n {node}\n </AddonSlot>\n );\n })}\n </View>\n </InputGroupContext.Provider>\n {inputError ? (\n <RNText\n nativeID={describeId}\n className=\"text-sm text-semantic-interactive-destructive\"\n style={errorStyle}\n >\n {inputError}\n </RNText>\n ) : helperText ? (\n <RNText nativeID={describeId} className=\"text-sm text-semantic-text-muted\" style={helperStyle}>\n {helperText}\n </RNText>\n ) : null}\n </View>\n );\n};\n\n// ─── Addon slot ───────────────────────────────────────────────────────────\n//\n// Internal wrapper that paints the muted background, draws the 1px vertical\n// separator on the input-facing side, and forwards a click to the input so\n// the addon reads as decorator, not as something interactive.\nconst AddonSlot = ({ children, side }: { children: ReactNode; side: 'left' | 'right' }) => {\n const colors = useThemeColors();\n const ctx = useContext(InputGroupContext);\n const dim = ctx?.disabled ? 0.85 : 1;\n\n const baseStyle: ViewStyle = {\n backgroundColor: colors.semantic.background.subtle,\n paddingHorizontal: px(colors.spacing['3']),\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n opacity: dim,\n };\n\n const separatorStyle: ViewStyle =\n side === 'left'\n ? { borderRightWidth: 1, borderRightColor: colors.semantic.border.default }\n : { borderLeftWidth: 1, borderLeftColor: colors.semantic.border.default };\n\n const handlePress = () => {\n ctx?.focusInput();\n };\n\n return (\n <Pressable\n // Pressing the addon focuses the input — addons are decorators,\n // never tab stops. RN's `accessibilityRole` doesn't accept \"presentation\"\n // (web-only), so we set the WAI-ARIA role via the web prop instead.\n onPress={handlePress}\n role=\"none\"\n // RN web maps `focusable={false}` to `tabIndex={-1}`.\n focusable={false}\n style={[baseStyle, separatorStyle]}\n className={cn(\n 'flex-row items-center justify-center px-3 bg-semantic-background-subtle',\n side === 'right' ? 'border-l border-semantic-border-default' : 'border-r border-semantic-border-default'\n )}\n >\n {children}\n </Pressable>\n );\n};\n\n// ─── Addon (public) ───────────────────────────────────────────────────────\n\nexport type InputGroupAddonProps = {\n children: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * Decorator slot inside an `<InputGroup>`. Renders a muted, non-interactive\n * box that visually fuses with the input. Place before `<InputGroupInput>`\n * for a prefix, after for a suffix. Accepts strings or `ReactNode` (icons).\n */\nexport const InputGroupAddon = ({ children, className, testID }: InputGroupAddonProps) => {\n const colors = useThemeColors();\n const textStyle: TextStyle = {\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n };\n\n // Wrap raw strings/numbers so consumers can pass `\"@\"` or `<MailIcon />`\n // and both render correctly without callers tripping over RN's \"text\n // outside of <Text>\" warning.\n if (typeof children === 'string' || typeof children === 'number') {\n return (\n <RNText\n {...(testID !== undefined ? { testID } : {})}\n className={cn('text-sm text-semantic-text-muted', className)}\n style={textStyle}\n >\n {children}\n </RNText>\n );\n }\n\n return (\n <View {...(testID !== undefined ? { testID } : {})} {...(className !== undefined ? { className } : {})}>\n {children}\n </View>\n );\n};\n\n// Brand the function so the parent can locate it via Children.toArray walk.\n(InputGroupAddon as unknown as { __noriType: symbol }).__noriType = ADDON_TYPE;\n\n// ─── Input (public) ───────────────────────────────────────────────────────\n\n// Layout-only base; theme-driven dimensions are merged inside InputGroupInput.\nconst INPUT_LAYOUT_BASE: TextStyle = {\n flex: 1,\n // RN web honours `outlineStyle: 'none'` to suppress the default browser\n // focus ring — the group's own focus-within border replaces it.\n outlineStyle: 'none' as unknown as TextStyle['outlineStyle'],\n};\n\nexport type InputGroupInputProps = TextInputProps;\n\n/**\n * The text field inside an `<InputGroup>`. Extends the full `TextInput` API\n * (label, helperText, error, disabled, etc.) so consumers don't lose any\n * functionality when reaching for the integrated layout.\n *\n * Implementation note: this renders a bare RN `TextInput` because the\n * surrounding `<InputGroup>` already paints the border + label + helper —\n * those bits are lifted to the parent so they render OUTSIDE the bordered\n * field row, the way a normal field's label/helper sits above/below the box.\n */\nexport const InputGroupInput = ({\n label: _label,\n helperText: _helperText,\n error,\n disabled,\n onChangeText,\n onFocus,\n onBlur,\n multiline,\n numberOfLines,\n leading: _leading,\n trailing: _trailing,\n containerClassName: _containerClassName,\n className,\n testID,\n ...rest\n}: InputGroupInputProps) => {\n const colors = useThemeColors();\n const ctx = useInputGroupContext('InputGroupInput');\n const inputId = ctx.inputId;\n const describeId = ctx.describeId;\n const isDisabled = disabled || ctx.disabled;\n const hasError = Boolean(error) || ctx.hasError;\n\n const inputExtras: Record<string, unknown> = {};\n if (testID !== undefined) {\n inputExtras.testID = testID;\n }\n if (_label !== undefined) {\n inputExtras.accessibilityLabel = _label;\n }\n if (hasError) {\n inputExtras['aria-invalid'] = true;\n }\n if (error || _helperText) {\n inputExtras['aria-describedby'] = describeId;\n }\n if (multiline !== undefined) {\n inputExtras.multiline = multiline;\n }\n if (numberOfLines !== undefined) {\n inputExtras.numberOfLines = numberOfLines;\n }\n if (onChangeText !== undefined) {\n inputExtras.onChangeText = onChangeText;\n }\n\n const inputStyle: TextStyle = {\n ...INPUT_LAYOUT_BASE,\n paddingVertical: px(colors.spacing['2']),\n paddingHorizontal: px(colors.spacing['3']),\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n color: colors.semantic.text.default,\n };\n\n return (\n <RNTextInput\n ref={(node) => {\n ctx.inputRef.current = node;\n }}\n nativeID={inputId}\n editable={!isDisabled}\n className={cn('flex-1 py-2 px-3 text-md text-semantic-text-default outline-none bg-transparent', className)}\n placeholderTextColor={colors.semantic.text.muted}\n onFocus={(e) => {\n ctx.setFocused(true);\n onFocus?.(e);\n }}\n onBlur={(e) => {\n ctx.setFocused(false);\n onBlur?.(e);\n }}\n {...inputExtras}\n {...rest}\n style={[inputStyle, rest.style]}\n />\n );\n};\n\n(InputGroupInput as unknown as { __noriType: symbol }).__noriType = INPUT_TYPE;\n\n/**\n * Public `InputGroup` value — the root function plus its `.Addon` and `.Input`\n * static members. `Object.assign` produces a value whose inferred type carries\n * the static properties, so `.d.ts` consumers can write `<InputGroup.Addon>`\n * without a separate import.\n */\nexport const InputGroup = Object.assign(InputGroupRoot, {\n Addon: InputGroupAddon,\n Input: InputGroupInput,\n});\n"]}
@@ -0,0 +1,15 @@
1
+ import { __name } from './chunk-WCQVDF3K.js';
2
+
3
+ // src/theme/px.ts
4
+ function px(value) {
5
+ if (typeof value === "number") {
6
+ return value;
7
+ }
8
+ const n = Number.parseFloat(value);
9
+ return Number.isFinite(n) ? n : 0;
10
+ }
11
+ __name(px, "px");
12
+
13
+ export { px };
14
+ //# sourceMappingURL=chunk-5A2QOOVN.js.map
15
+ //# sourceMappingURL=chunk-5A2QOOVN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/theme/px.ts"],"names":[],"mappings":";;;AAmBO,SAAS,GAAG,KAAA,EAAgC;AAC/C,EAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC3B,IAAA,OAAO,KAAA;AAAA,EACX;AACA,EAAA,MAAM,CAAA,GAAI,MAAA,CAAO,UAAA,CAAW,KAAK,CAAA;AACjC,EAAA,OAAO,MAAA,CAAO,QAAA,CAAS,CAAC,CAAA,GAAI,CAAA,GAAI,CAAA;AACpC;AANgB,MAAA,CAAA,EAAA,EAAA,IAAA,CAAA","file":"chunk-5A2QOOVN.js","sourcesContent":["/**\n * Strip the `px` suffix from a CSS-flavored token value and return a\n * number, the form React Native style props expect for properties like\n * `borderRadius`, `paddingHorizontal`, `fontSize`, etc.\n *\n * The tokens package emits all dimensional tokens as `${number}px`\n * strings (it's the lingua franca for both CSS and Style Dictionary\n * consumers); inside RN we need the unitless number. RN-Web tolerates\n * both, but native is strict.\n *\n * Falls through unchanged for tokens that already came in as numbers\n * (forward-compat).\n *\n * Examples:\n * px('6px') → 6\n * px('1.5px') → 1.5\n * px(6) → 6\n * px('foo') → 0 (defensive — bad input shouldn't crash render)\n */\nexport function px(value: string | number): number {\n if (typeof value === 'number') {\n return value;\n }\n const n = Number.parseFloat(value);\n return Number.isFinite(n) ? n : 0;\n}\n"]}
@@ -0,0 +1,208 @@
1
+ import { Spinner } from './chunk-ACLHDHX3.js';
2
+ import { Slot } from './chunk-ZIBNLXIV.js';
3
+ import { px } from './chunk-5A2QOOVN.js';
4
+ import { cn } from './chunk-CHXHRJNZ.js';
5
+ import { useThemeColors } from './chunk-R5JMDDCB.js';
6
+ import { __name } from './chunk-WCQVDF3K.js';
7
+ import { useState, useCallback } from 'react';
8
+ import { Pressable, Text } from 'react-native';
9
+ import { jsx, jsxs } from 'nativewind/jsx-runtime';
10
+
11
+ var VARIANT_CLASSES = {
12
+ primary: "bg-semantic-interactive-primary hover:bg-semantic-interactive-primaryHover active:bg-semantic-interactive-primaryPressed",
13
+ secondary: "bg-neutral-100 hover:bg-neutral-200 active:bg-neutral-300 dark:bg-neutral-800 dark:hover:bg-neutral-700 dark:active:bg-neutral-600",
14
+ ghost: "bg-transparent hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-800 dark:active:bg-neutral-700",
15
+ destructive: "bg-semantic-interactive-destructive hover:opacity-90 active:opacity-80"
16
+ };
17
+ var SIZE_CLASSES = {
18
+ sm: "h-8 px-3 text-sm",
19
+ md: "h-10 px-4 text-md",
20
+ lg: "h-12 px-5 text-lg"
21
+ };
22
+ var ICON_SIZE = { sm: 14, md: 16, lg: 20 };
23
+ var BASE_CLASSES = "inline-flex flex-row items-center justify-center gap-2 rounded-md select-none";
24
+ var HEIGHT_BY_SIZE = {
25
+ sm: 32,
26
+ md: 40,
27
+ lg: 48
28
+ };
29
+ var SIZE_KEYS = {
30
+ sm: { padX: "3", font: "sm" },
31
+ md: { padX: "4", font: "md" },
32
+ lg: { padX: "5", font: "lg" }
33
+ };
34
+ var BASE_STYLE = {
35
+ flexDirection: "row",
36
+ alignItems: "center",
37
+ justifyContent: "center"
38
+ };
39
+ var Button = /* @__PURE__ */ __name(({
40
+ children,
41
+ variant = "primary",
42
+ size = "md",
43
+ disabled,
44
+ loading,
45
+ leadingIcon: LeadingIcon,
46
+ trailingIcon: TrailingIcon,
47
+ asChild,
48
+ className,
49
+ onPress,
50
+ testID,
51
+ style,
52
+ ref,
53
+ ...rest
54
+ }) => {
55
+ const colors = useThemeColors();
56
+ const isInoperative = Boolean(disabled) || Boolean(loading);
57
+ const [hovered, setHovered] = useState(false);
58
+ const [pressed, setPressed] = useState(false);
59
+ const handleHoverIn = useCallback(() => setHovered(true), []);
60
+ const handleHoverOut = useCallback(() => {
61
+ setHovered(false);
62
+ setPressed(false);
63
+ }, []);
64
+ const handlePressIn = useCallback(() => setPressed(true), []);
65
+ const handlePressOut = useCallback(() => setPressed(false), []);
66
+ const variantClasses = isInoperative ? VARIANT_CLASSES[variant].split(" ").filter((cls) => !cls.startsWith("hover:") && !cls.startsWith("active:")).join(" ") : VARIANT_CLASSES[variant];
67
+ const classes = cn(
68
+ BASE_CLASSES,
69
+ variantClasses,
70
+ SIZE_CLASSES[size],
71
+ isInoperative ? "opacity-60 pointer-events-none cursor-not-allowed" : void 0,
72
+ className
73
+ );
74
+ const variantStateColors = {
75
+ primary: {
76
+ rest: colors.semantic.interactive.primary,
77
+ hover: colors.semantic.interactive.primaryHover,
78
+ pressed: colors.semantic.interactive.primaryPressed
79
+ },
80
+ secondary: {
81
+ rest: colors.semantic.background.subtle,
82
+ // hover / pressed must be theme-aware. The previous version
83
+ // pulled directly from `color.neutral.{200,300}`, which are
84
+ // raw tokens that DON'T flip per scheme — in dark mode the
85
+ // hovered state ended up light-gray on dark, ruining contrast.
86
+ // `border.default` / `border.strong` invert correctly: in
87
+ // light they read as light-gray washes (next step from
88
+ // `background.subtle`); in dark they read as the darker grays
89
+ // expected for hover/pressed on a dark surface.
90
+ hover: colors.semantic.border.default,
91
+ pressed: colors.semantic.border.strong
92
+ },
93
+ ghost: {
94
+ rest: "transparent",
95
+ hover: colors.semantic.background.subtle,
96
+ pressed: colors.semantic.border.default
97
+ },
98
+ destructive: {
99
+ rest: colors.semantic.interactive.destructive,
100
+ // No darker tone token for destructive yet — fall back to a 90% /
101
+ // 80% opacity wash by mixing through rgba. Matches the className
102
+ // hover:opacity-90 / active:opacity-80 fallback.
103
+ hover: colors.semantic.interactive.destructive,
104
+ pressed: colors.semantic.interactive.destructive
105
+ }
106
+ };
107
+ const variantTextColor = {
108
+ primary: colors.semantic.text.inverted,
109
+ secondary: colors.semantic.text.default,
110
+ ghost: colors.semantic.text.default,
111
+ destructive: colors.semantic.text.inverted
112
+ };
113
+ const stateColors = variantStateColors[variant];
114
+ const stateBg = isInoperative ? stateColors.rest : pressed ? stateColors.pressed : hovered ? stateColors.hover : stateColors.rest;
115
+ const stateInteractionOpacity = isInoperative || variant !== "destructive" ? 1 : pressed ? 0.8 : hovered ? 0.9 : 1;
116
+ const sizeKeys = SIZE_KEYS[size];
117
+ const sizeContainer = {
118
+ height: HEIGHT_BY_SIZE[size],
119
+ paddingHorizontal: px(colors.spacing[sizeKeys.padX]),
120
+ gap: px(colors.spacing["2"]),
121
+ borderRadius: px(colors.radius.md)
122
+ };
123
+ const sizeFontSize = px(colors.fontSize[sizeKeys.font]);
124
+ const inlineBase = [
125
+ BASE_STYLE,
126
+ { backgroundColor: stateBg },
127
+ sizeContainer,
128
+ { opacity: isInoperative ? 0.6 : stateInteractionOpacity }
129
+ ];
130
+ const consumerStyle = typeof style === "function" ? style({ pressed, ...{ hovered } }) : style;
131
+ const pressableStyle = [...inlineBase, consumerStyle];
132
+ const slotStyle = [...inlineBase, consumerStyle];
133
+ const textColor = variantTextColor[variant];
134
+ const textStyle = {
135
+ color: textColor,
136
+ fontFamily: colors.fontFamily.body,
137
+ fontSize: sizeFontSize,
138
+ fontWeight: colors.fontWeight.medium
139
+ };
140
+ const handlePress = /* @__PURE__ */ __name((ev) => {
141
+ if (isInoperative) {
142
+ return;
143
+ }
144
+ onPress?.(ev);
145
+ }, "handlePress");
146
+ if (asChild) {
147
+ const slotProps = {
148
+ ref,
149
+ className: classes,
150
+ style: slotStyle,
151
+ onClick: handlePress,
152
+ ...rest
153
+ };
154
+ if (isInoperative) {
155
+ slotProps["aria-disabled"] = true;
156
+ }
157
+ if (loading) {
158
+ slotProps["aria-busy"] = true;
159
+ }
160
+ if (testID !== void 0) {
161
+ slotProps["data-testid"] = testID;
162
+ }
163
+ return /* @__PURE__ */ jsx(Slot, { ...slotProps, children });
164
+ }
165
+ const pressableExtra = {};
166
+ if (isInoperative) {
167
+ pressableExtra["aria-disabled"] = true;
168
+ }
169
+ if (loading) {
170
+ pressableExtra["aria-busy"] = true;
171
+ }
172
+ return /* @__PURE__ */ jsxs(
173
+ Pressable,
174
+ {
175
+ ref,
176
+ ...testID !== void 0 ? { testID } : {},
177
+ role: "button",
178
+ accessibilityRole: "button",
179
+ accessibilityState: { disabled: isInoperative, busy: Boolean(loading) },
180
+ disabled: isInoperative,
181
+ onPress: handlePress,
182
+ onHoverIn: handleHoverIn,
183
+ onHoverOut: handleHoverOut,
184
+ onPressIn: handlePressIn,
185
+ onPressOut: handlePressOut,
186
+ className: classes,
187
+ style: pressableStyle,
188
+ ...pressableExtra,
189
+ ...rest,
190
+ children: [
191
+ loading ? /* @__PURE__ */ jsx(Spinner, { size: ICON_SIZE[size], label: "Loading", color: textColor }) : LeadingIcon ? /* @__PURE__ */ jsx(LeadingIcon, { size: ICON_SIZE[size], color: textColor }) : null,
192
+ /* @__PURE__ */ jsx(
193
+ Text,
194
+ {
195
+ className: cn("font-medium", SIZE_CLASSES[size].includes("text-") ? void 0 : "text-md"),
196
+ style: textStyle,
197
+ children
198
+ }
199
+ ),
200
+ TrailingIcon ? /* @__PURE__ */ jsx(TrailingIcon, { size: ICON_SIZE[size], color: textColor }) : null
201
+ ]
202
+ }
203
+ );
204
+ }, "Button");
205
+
206
+ export { Button };
207
+ //# sourceMappingURL=chunk-5XEGZFG5.js.map
208
+ //# sourceMappingURL=chunk-5XEGZFG5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Button/Button.tsx"],"names":["RNText"],"mappings":";;;;;;;;;;AA0CA,IAAM,eAAA,GAAiD;AAAA,EACnD,OAAA,EACI,0HAAA;AAAA,EACJ,SAAA,EACI,oIAAA;AAAA,EACJ,KAAA,EAAO,gHAAA;AAAA,EACP,WAAA,EAAa;AACjB,CAAA;AAEA,IAAM,YAAA,GAA2C;AAAA,EAC7C,EAAA,EAAI,kBAAA;AAAA,EACJ,EAAA,EAAI,mBAAA;AAAA,EACJ,EAAA,EAAI;AACR,CAAA;AAEA,IAAM,YAAwC,EAAE,EAAA,EAAI,IAAI,EAAA,EAAI,EAAA,EAAI,IAAI,EAAA,EAAG;AAEvE,IAAM,YAAA,GAAe,+EAAA;AAQrB,IAAM,cAAA,GAA6C;AAAA,EAC/C,EAAA,EAAI,EAAA;AAAA,EACJ,EAAA,EAAI,EAAA;AAAA,EACJ,EAAA,EAAI;AACR,CAAA;AAEA,IAAM,SAAA,GAA0C;AAAA,EAC5C,EAAA,EAAI,EAAE,IAAA,EAAM,GAAA,EAAK,MAAM,IAAA,EAAK;AAAA,EAC5B,EAAA,EAAI,EAAE,IAAA,EAAM,GAAA,EAAK,MAAM,IAAA,EAAK;AAAA,EAC5B,EAAA,EAAI,EAAE,IAAA,EAAM,GAAA,EAAK,MAAM,IAAA;AAC3B,CAAA;AAGA,IAAM,UAAA,GAAwB;AAAA,EAC1B,aAAA,EAAe,KAAA;AAAA,EACf,UAAA,EA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,EAAE,QAAA,CAAS,OAAO,CAAA,GAAI,MAAA,GAAY,SAAS,CAAA;AAAA,YACzF,KAAA,EAAO,SAAA;AAAA,YAEN;AAAA;AAAA,SACL;AAAA,QACC,YAAA,uBAAgB,YAAA,EAAA,EAAa,IAAA,EAAM,UAAU,IAAI,CAAA,EAAG,KAAA,EAAO,SAAA,EAAW,CAAA,GAAK;AAAA;AAAA;AAAA,GAChF;AAER,CAAA,EAnOsB,QAAA","file":"chunk-5XEGZFG5.js","sourcesContent":["'use client';\n\nimport type { Theme } from '@nori-ui/tokens';\nimport type { ComponentType, ReactNode, Ref } from 'react';\nimport { useCallback, useState } from 'react';\nimport type { PressableProps, StyleProp, View, ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText } from 'react-native';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\nimport { Spinner } from '../Spinner';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'destructive';\nexport type ButtonSize = 'sm' | 'md' | 'lg';\n\ntype IconSlot = ComponentType<{ size?: number; color?: string }>;\n\nexport type ButtonProps = Omit<PressableProps, 'disabled' | 'children'> & {\n children?: ReactNode;\n variant?: ButtonVariant;\n size?: ButtonSize;\n disabled?: boolean;\n loading?: boolean;\n leadingIcon?: IconSlot;\n trailingIcon?: IconSlot;\n /** If true, the single child becomes the interactive element (Slot pattern). */\n asChild?: boolean;\n className?: string;\n testID?: string;\n ref?: Ref<View>;\n};\n\n// NativeWind classes — the `dark:` variants flip colors when <html> carries\n// the `dark` class (or `data-theme=\"dark\"`); see the tokens Tailwind preset.\n//\n// These act as the no-NativeWind fallback (e.g. raw JSX in Expo Snack\n// without a compile step) and the dark-mode bridge. The dimensional\n// utilities (`rounded-md`, `h-10`, `px-4`, `gap-2`, `text-*`) are kept\n// because the inline `style` array always overrides them — so when a\n// `<ThemeProvider>` widens spacing/radius/fontSize, the inline values\n// win on CSS specificity and the Tailwind class is harmless.\nconst VARIANT_CLASSES: Record<ButtonVariant, string> = {\n primary:\n 'bg-semantic-interactive-primary hover:bg-semantic-interactive-primaryHover active:bg-semantic-interactive-primaryPressed',\n secondary:\n 'bg-neutral-100 hover:bg-neutral-200 active:bg-neutral-300 dark:bg-neutral-800 dark:hover:bg-neutral-700 dark:active:bg-neutral-600',\n ghost: 'bg-transparent hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-800 dark:active:bg-neutral-700',\n destructive: 'bg-semantic-interactive-destructive hover:opacity-90 active:opacity-80',\n};\n\nconst SIZE_CLASSES: Record<ButtonSize, string> = {\n sm: 'h-8 px-3 text-sm',\n md: 'h-10 px-4 text-md',\n lg: 'h-12 px-5 text-lg',\n};\n\nconst ICON_SIZE: Record<ButtonSize, number> = { sm: 14, md: 16, lg: 20 };\n\nconst BASE_CLASSES = 'inline-flex flex-row items-center justify-center gap-2 rounded-md select-none';\n\n// Heights are intentionally hardcoded — they're tightly coupled to the\n// button's overall density (a 48px target on lg, 32px on sm). Padding and\n// fontSize are pulled from the active theme so a custom theme that scales\n// the spacing/fontSize ramps also scales the button. If you want a\n// genuinely smaller / taller button, override `theme.spacing` /\n// `theme.fontSize` rather than reach for new size literals here.\nconst HEIGHT_BY_SIZE: Record<ButtonSize, number> = {\n sm: 32,\n md: 40,\n lg: 48,\n};\ntype SizeKeys = { padX: keyof Theme['spacing']; font: keyof Theme['fontSize'] };\nconst SIZE_KEYS: Record<ButtonSize, SizeKeys> = {\n sm: { padX: '3', font: 'sm' },\n md: { padX: '4', font: 'md' },\n lg: { padX: '5', font: 'lg' },\n};\n\n// gap and borderRadius come from the theme inside the component.\nconst BASE_STYLE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nexport const Button = ({\n children,\n variant = 'primary',\n size = 'md',\n disabled,\n loading,\n leadingIcon: LeadingIcon,\n trailingIcon: TrailingIcon,\n asChild,\n className,\n onPress,\n testID,\n style,\n ref,\n ...rest\n}: ButtonProps) => {\n const colors = useThemeColors();\n const isInoperative = Boolean(disabled) || Boolean(loading);\n // rn-web's `Pressable` does not reliably apply a `style` callback's\n // returned values to the rendered DOM (the static portions get\n // dropped). We track hover/press via state and pass `style` as a\n // plain array — that path produces an inline `style=\"…\"` attribute\n // on the button, which beats the dimensional Tailwind utilities on\n // CSS specificity and lets a custom `<ThemeProvider>` flow padding,\n // radius, fontSize, fontFamily, and fontWeight all the way through.\n const [hovered, setHovered] = useState(false);\n const [pressed, setPressed] = useState(false);\n const handleHoverIn = useCallback(() => setHovered(true), []);\n const handleHoverOut = useCallback(() => {\n setHovered(false);\n setPressed(false);\n }, []);\n const handlePressIn = useCallback(() => setPressed(true), []);\n const handlePressOut = useCallback(() => setPressed(false), []);\n // When disabled, drop the variant's hover/active class fragments and\n // append `pointer-events-none cursor-not-allowed` so the className\n // path matches the inline-style path: no hover tint, no press tint,\n // and the cursor signals the control is inert. We still keep the\n // base variant bg class so the resting color is right.\n const variantClasses = isInoperative\n ? VARIANT_CLASSES[variant]\n .split(' ')\n .filter((cls) => !cls.startsWith('hover:') && !cls.startsWith('active:'))\n .join(' ')\n : VARIANT_CLASSES[variant];\n const classes = cn(\n BASE_CLASSES,\n variantClasses,\n SIZE_CLASSES[size],\n isInoperative ? 'opacity-60 pointer-events-none cursor-not-allowed' : undefined,\n className\n );\n\n // Inline-style palette per (variant × interaction state). The hook is the\n // source of truth — dark mode and theme overrides flow through it.\n //\n // Why inline (not className): a class-based `:hover { background-color }`\n // can never beat an inline `style={{ backgroundColor }}` — inline wins\n // by CSS specificity. So if we want hover to actually flip the surface\n // color, hover has to be applied inline too. We use Pressable's `style`\n // callback (`{ hovered, pressed }`) which on web is wired up by\n // react-native-web and on native exposes only `pressed`. The className\n // path keeps the same Tailwind variants for the no-NativeWind fallback\n // case (Expo Snack rendering raw JSX without compilation).\n const variantStateColors: Record<ButtonVariant, { rest: string; hover: string; pressed: string }> = {\n primary: {\n rest: colors.semantic.interactive.primary,\n hover: colors.semantic.interactive.primaryHover,\n pressed: colors.semantic.interactive.primaryPressed,\n },\n secondary: {\n rest: colors.semantic.background.subtle,\n // hover / pressed must be theme-aware. The previous version\n // pulled directly from `color.neutral.{200,300}`, which are\n // raw tokens that DON'T flip per scheme — in dark mode the\n // hovered state ended up light-gray on dark, ruining contrast.\n // `border.default` / `border.strong` invert correctly: in\n // light they read as light-gray washes (next step from\n // `background.subtle`); in dark they read as the darker grays\n // expected for hover/pressed on a dark surface.\n hover: colors.semantic.border.default,\n pressed: colors.semantic.border.strong,\n },\n ghost: {\n rest: 'transparent',\n hover: colors.semantic.background.subtle,\n pressed: colors.semantic.border.default,\n },\n destructive: {\n rest: colors.semantic.interactive.destructive,\n // No darker tone token for destructive yet — fall back to a 90% /\n // 80% opacity wash by mixing through rgba. Matches the className\n // hover:opacity-90 / active:opacity-80 fallback.\n hover: colors.semantic.interactive.destructive,\n pressed: colors.semantic.interactive.destructive,\n },\n };\n const variantTextColor: Record<ButtonVariant, string> = {\n primary: colors.semantic.text.inverted,\n secondary: colors.semantic.text.default,\n ghost: colors.semantic.text.default,\n destructive: colors.semantic.text.inverted,\n };\n\n const stateColors = variantStateColors[variant];\n // When disabled (or loading), force the rest state — disabled means\n // disabled. The control should NOT visually respond to hover/press,\n // even though the OS still fires those events. Pressable also gets\n // `disabled={true}` on the Pressable below which blocks onPress, but\n // the visual treatment is owned here.\n const stateBg = isInoperative\n ? stateColors.rest\n : pressed\n ? stateColors.pressed\n : hovered\n ? stateColors.hover\n : stateColors.rest;\n // Destructive uses opacity dim instead of a separate color (matches\n // existing className behavior; keeps the red recognisable on press).\n // Same disabled rule as bg: hover/press dim is suppressed when\n // disabled — the static 0.6 opacity below handles the disabled look.\n const stateInteractionOpacity = isInoperative || variant !== 'destructive' ? 1 : pressed ? 0.8 : hovered ? 0.9 : 1;\n\n // Resolve all dimensional + typographic values from the active theme\n // so a custom theme that scales spacing / fontSize / radius / fontWeight\n // also reshapes every Button on the page.\n const sizeKeys = SIZE_KEYS[size];\n const sizeContainer: ViewStyle = {\n height: HEIGHT_BY_SIZE[size],\n paddingHorizontal: px(colors.spacing[sizeKeys.padX]),\n gap: px(colors.spacing['2']),\n borderRadius: px(colors.radius.md),\n };\n const sizeFontSize = px(colors.fontSize[sizeKeys.font]);\n\n const inlineBase: ViewStyle[] = [\n BASE_STYLE,\n { backgroundColor: stateBg },\n sizeContainer,\n { opacity: isInoperative ? 0.6 : stateInteractionOpacity },\n ];\n // Resolve the consumer's `style` against the same hover/press state\n // we just computed — this preserves the historical contract where a\n // callback `style` receives the live interaction flags. The RN\n // upstream type only declares `pressed`; rn-web also passes\n // `hovered`. Cast through `unknown` to ship both without a type\n // assertion battle.\n const consumerStyle: StyleProp<ViewStyle> =\n typeof style === 'function' ? style({ pressed, ...({ hovered } as Record<string, unknown>) } as never) : style;\n const pressableStyle: StyleProp<ViewStyle> = [...inlineBase, consumerStyle];\n const slotStyle: StyleProp<ViewStyle> = [...inlineBase, consumerStyle];\n\n const textColor = variantTextColor[variant];\n const textStyle = {\n color: textColor,\n fontFamily: colors.fontFamily.body,\n fontSize: sizeFontSize,\n fontWeight: colors.fontWeight.medium as '500',\n };\n\n const handlePress: NonNullable<PressableProps['onPress']> = (ev) => {\n if (isInoperative) {\n return;\n }\n onPress?.(ev);\n };\n\n if (asChild) {\n const slotProps: Record<string, unknown> = {\n ref,\n className: classes,\n style: slotStyle,\n onClick: handlePress as unknown as (...args: unknown[]) => unknown,\n ...rest,\n };\n if (isInoperative) {\n slotProps['aria-disabled'] = true;\n }\n if (loading) {\n slotProps['aria-busy'] = true;\n }\n if (testID !== undefined) {\n slotProps['data-testid'] = testID;\n }\n return <Slot {...slotProps}>{children}</Slot>;\n }\n\n const pressableExtra: Record<string, unknown> = {};\n if (isInoperative) {\n pressableExtra['aria-disabled'] = true;\n }\n if (loading) {\n pressableExtra['aria-busy'] = true;\n }\n\n return (\n <Pressable\n ref={ref}\n {...(testID !== undefined ? { testID } : {})}\n role=\"button\"\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: isInoperative, busy: Boolean(loading) }}\n disabled={isInoperative}\n onPress={handlePress}\n onHoverIn={handleHoverIn}\n onHoverOut={handleHoverOut}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n className={classes}\n style={pressableStyle}\n {...pressableExtra}\n {...rest}\n >\n {loading ? (\n <Spinner size={ICON_SIZE[size]} label=\"Loading\" color={textColor} />\n ) : LeadingIcon ? (\n <LeadingIcon size={ICON_SIZE[size]} color={textColor} />\n ) : null}\n <RNText\n className={cn('font-medium', SIZE_CLASSES[size].includes('text-') ? undefined : 'text-md')}\n style={textStyle}\n >\n {children}\n </RNText>\n {TrailingIcon ? <TrailingIcon size={ICON_SIZE[size]} color={textColor} /> : null}\n </Pressable>\n );\n};\n"]}