@oxyhq/bloom 0.6.24 → 0.7.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 (423) hide show
  1. package/lib/commonjs/alert-dialog/AlertDialog.js +109 -0
  2. package/lib/commonjs/alert-dialog/AlertDialog.js.map +1 -0
  3. package/lib/commonjs/alert-dialog/AlertDialogHost.js +50 -0
  4. package/lib/commonjs/alert-dialog/AlertDialogHost.js.map +1 -0
  5. package/lib/commonjs/alert-dialog/confirm-store.js +80 -0
  6. package/lib/commonjs/alert-dialog/confirm-store.js.map +1 -0
  7. package/lib/commonjs/alert-dialog/index.js +19 -0
  8. package/lib/commonjs/alert-dialog/index.js.map +1 -0
  9. package/lib/commonjs/alert-dialog/index.web.js +19 -0
  10. package/lib/commonjs/alert-dialog/index.web.js.map +1 -0
  11. package/lib/commonjs/alert-dialog/types.js +6 -0
  12. package/lib/commonjs/alert-dialog/types.js.map +1 -0
  13. package/lib/commonjs/combobox/Combobox.js +227 -0
  14. package/lib/commonjs/combobox/Combobox.js.map +1 -0
  15. package/lib/commonjs/combobox/index.js +11 -0
  16. package/lib/commonjs/combobox/index.js.map +1 -0
  17. package/lib/commonjs/combobox/index.web.js +11 -0
  18. package/lib/commonjs/combobox/index.web.js.map +1 -0
  19. package/lib/commonjs/combobox/types.js +6 -0
  20. package/lib/commonjs/combobox/types.js.map +1 -0
  21. package/lib/commonjs/command/Command.js +256 -0
  22. package/lib/commonjs/command/Command.js.map +1 -0
  23. package/lib/commonjs/command/index.js +10 -0
  24. package/lib/commonjs/command/index.js.map +1 -0
  25. package/lib/commonjs/command/index.web.js +10 -0
  26. package/lib/commonjs/command/index.web.js.map +1 -0
  27. package/lib/commonjs/command/types.js +6 -0
  28. package/lib/commonjs/command/types.js.map +1 -0
  29. package/lib/commonjs/field/Field.js +68 -0
  30. package/lib/commonjs/field/Field.js.map +1 -0
  31. package/lib/commonjs/field/index.js +13 -0
  32. package/lib/commonjs/field/index.js.map +1 -0
  33. package/lib/commonjs/field/types.js +6 -0
  34. package/lib/commonjs/field/types.js.map +1 -0
  35. package/lib/commonjs/index.js +117 -25
  36. package/lib/commonjs/index.js.map +1 -1
  37. package/lib/commonjs/index.web.js +117 -25
  38. package/lib/commonjs/index.web.js.map +1 -1
  39. package/lib/commonjs/input-group/InputGroup.js +172 -0
  40. package/lib/commonjs/input-group/InputGroup.js.map +1 -0
  41. package/lib/commonjs/input-group/index.js +19 -0
  42. package/lib/commonjs/input-group/index.js.map +1 -0
  43. package/lib/commonjs/input-group/types.js +6 -0
  44. package/lib/commonjs/input-group/types.js.map +1 -0
  45. package/lib/commonjs/item/Item.js +172 -0
  46. package/lib/commonjs/item/Item.js.map +1 -0
  47. package/lib/commonjs/item/index.js +13 -0
  48. package/lib/commonjs/item/index.js.map +1 -0
  49. package/lib/commonjs/item/types.js +6 -0
  50. package/lib/commonjs/item/types.js.map +1 -0
  51. package/lib/commonjs/kbd/Kbd.js +79 -0
  52. package/lib/commonjs/kbd/Kbd.js.map +1 -0
  53. package/lib/commonjs/kbd/index.js +13 -0
  54. package/lib/commonjs/kbd/index.js.map +1 -0
  55. package/lib/commonjs/kbd/types.js +6 -0
  56. package/lib/commonjs/kbd/types.js.map +1 -0
  57. package/lib/commonjs/label/Label.js +60 -0
  58. package/lib/commonjs/label/Label.js.map +1 -0
  59. package/lib/commonjs/label/index.js +13 -0
  60. package/lib/commonjs/label/index.js.map +1 -0
  61. package/lib/commonjs/label/types.js +6 -0
  62. package/lib/commonjs/label/types.js.map +1 -0
  63. package/lib/commonjs/popover/context.js +18 -0
  64. package/lib/commonjs/popover/context.js.map +1 -0
  65. package/lib/commonjs/popover/index.js +111 -0
  66. package/lib/commonjs/popover/index.js.map +1 -0
  67. package/lib/commonjs/popover/index.web.js +286 -0
  68. package/lib/commonjs/popover/index.web.js.map +1 -0
  69. package/lib/commonjs/popover/types.js +6 -0
  70. package/lib/commonjs/popover/types.js.map +1 -0
  71. package/lib/commonjs/react-native-css.d.js +2 -0
  72. package/lib/commonjs/react-native-css.d.js.map +1 -0
  73. package/lib/commonjs/slider/Slider.js +255 -0
  74. package/lib/commonjs/slider/Slider.js.map +1 -0
  75. package/lib/commonjs/slider/index.js +13 -0
  76. package/lib/commonjs/slider/index.js.map +1 -0
  77. package/lib/commonjs/slider/types.js +6 -0
  78. package/lib/commonjs/slider/types.js.map +1 -0
  79. package/lib/commonjs/theme/BloomThemeProvider.js +39 -7
  80. package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -1
  81. package/lib/commonjs/theme/color-presets.js +118 -118
  82. package/lib/commonjs/theme/color-presets.js.map +1 -1
  83. package/lib/commonjs/theme/color-scope/index.js +28 -6
  84. package/lib/commonjs/theme/color-scope/index.js.map +1 -1
  85. package/lib/commonjs/theme/color-scope/style-builder.js +35 -0
  86. package/lib/commonjs/theme/color-scope/style-builder.js.map +1 -1
  87. package/lib/commonjs/theme/native-root-vars.js +105 -0
  88. package/lib/commonjs/theme/native-root-vars.js.map +1 -0
  89. package/lib/commonjs/theme/native-root-vars.web.js +27 -0
  90. package/lib/commonjs/theme/native-root-vars.web.js.map +1 -0
  91. package/lib/commonjs/theme/preset-vars.js +4 -1
  92. package/lib/commonjs/theme/preset-vars.js.map +1 -1
  93. package/lib/module/alert-dialog/AlertDialog.js +104 -0
  94. package/lib/module/alert-dialog/AlertDialog.js.map +1 -0
  95. package/lib/module/alert-dialog/AlertDialogHost.js +45 -0
  96. package/lib/module/alert-dialog/AlertDialogHost.js.map +1 -0
  97. package/lib/module/alert-dialog/confirm-store.js +73 -0
  98. package/lib/module/alert-dialog/confirm-store.js.map +1 -0
  99. package/lib/module/alert-dialog/index.js +9 -0
  100. package/lib/module/alert-dialog/index.js.map +1 -0
  101. package/lib/module/alert-dialog/index.web.js +9 -0
  102. package/lib/module/alert-dialog/index.web.js.map +1 -0
  103. package/lib/module/alert-dialog/types.js +4 -0
  104. package/lib/module/alert-dialog/types.js.map +1 -0
  105. package/lib/module/combobox/Combobox.js +222 -0
  106. package/lib/module/combobox/Combobox.js.map +1 -0
  107. package/lib/module/combobox/index.js +6 -0
  108. package/lib/module/combobox/index.js.map +1 -0
  109. package/lib/module/combobox/index.web.js +6 -0
  110. package/lib/module/combobox/index.web.js.map +1 -0
  111. package/lib/module/combobox/types.js +4 -0
  112. package/lib/module/combobox/types.js.map +1 -0
  113. package/lib/module/command/Command.js +251 -0
  114. package/lib/module/command/Command.js.map +1 -0
  115. package/lib/module/command/index.js +6 -0
  116. package/lib/module/command/index.js.map +1 -0
  117. package/lib/module/command/index.web.js +6 -0
  118. package/lib/module/command/index.web.js.map +1 -0
  119. package/lib/module/command/types.js +4 -0
  120. package/lib/module/command/types.js.map +1 -0
  121. package/lib/module/field/Field.js +63 -0
  122. package/lib/module/field/Field.js.map +1 -0
  123. package/lib/module/field/index.js +4 -0
  124. package/lib/module/field/index.js.map +1 -0
  125. package/lib/module/field/types.js +4 -0
  126. package/lib/module/field/types.js.map +1 -0
  127. package/lib/module/index.js +10 -3
  128. package/lib/module/index.js.map +1 -1
  129. package/lib/module/index.web.js +10 -3
  130. package/lib/module/index.web.js.map +1 -1
  131. package/lib/module/input-group/InputGroup.js +167 -0
  132. package/lib/module/input-group/InputGroup.js.map +1 -0
  133. package/lib/module/input-group/index.js +4 -0
  134. package/lib/module/input-group/index.js.map +1 -0
  135. package/lib/module/input-group/types.js +4 -0
  136. package/lib/module/input-group/types.js.map +1 -0
  137. package/lib/module/item/Item.js +167 -0
  138. package/lib/module/item/Item.js.map +1 -0
  139. package/lib/module/item/index.js +4 -0
  140. package/lib/module/item/index.js.map +1 -0
  141. package/lib/module/item/types.js +4 -0
  142. package/lib/module/item/types.js.map +1 -0
  143. package/lib/module/kbd/Kbd.js +74 -0
  144. package/lib/module/kbd/Kbd.js.map +1 -0
  145. package/lib/module/kbd/index.js +4 -0
  146. package/lib/module/kbd/index.js.map +1 -0
  147. package/lib/module/kbd/types.js +4 -0
  148. package/lib/module/kbd/types.js.map +1 -0
  149. package/lib/module/label/Label.js +55 -0
  150. package/lib/module/label/Label.js.map +1 -0
  151. package/lib/module/label/index.js +4 -0
  152. package/lib/module/label/index.js.map +1 -0
  153. package/lib/module/label/types.js +4 -0
  154. package/lib/module/label/types.js.map +1 -0
  155. package/lib/module/popover/context.js +13 -0
  156. package/lib/module/popover/context.js.map +1 -0
  157. package/lib/module/popover/index.js +95 -0
  158. package/lib/module/popover/index.js.map +1 -0
  159. package/lib/module/popover/index.web.js +274 -0
  160. package/lib/module/popover/index.web.js.map +1 -0
  161. package/lib/module/popover/types.js +4 -0
  162. package/lib/module/popover/types.js.map +1 -0
  163. package/lib/module/react-native-css.d.js +2 -0
  164. package/lib/module/react-native-css.d.js.map +1 -0
  165. package/lib/module/slider/Slider.js +250 -0
  166. package/lib/module/slider/Slider.js.map +1 -0
  167. package/lib/module/slider/index.js +4 -0
  168. package/lib/module/slider/index.js.map +1 -0
  169. package/lib/module/slider/types.js +4 -0
  170. package/lib/module/slider/types.js.map +1 -0
  171. package/lib/module/theme/BloomThemeProvider.js +40 -8
  172. package/lib/module/theme/BloomThemeProvider.js.map +1 -1
  173. package/lib/module/theme/color-presets.js +118 -118
  174. package/lib/module/theme/color-presets.js.map +1 -1
  175. package/lib/module/theme/color-scope/index.js +29 -7
  176. package/lib/module/theme/color-scope/index.js.map +1 -1
  177. package/lib/module/theme/color-scope/style-builder.js +35 -0
  178. package/lib/module/theme/color-scope/style-builder.js.map +1 -1
  179. package/lib/module/theme/native-root-vars.js +101 -0
  180. package/lib/module/theme/native-root-vars.js.map +1 -0
  181. package/lib/module/theme/native-root-vars.web.js +23 -0
  182. package/lib/module/theme/native-root-vars.web.js.map +1 -0
  183. package/lib/module/theme/preset-vars.js +4 -1
  184. package/lib/module/theme/preset-vars.js.map +1 -1
  185. package/lib/typescript/commonjs/alert-dialog/AlertDialog.d.ts +21 -0
  186. package/lib/typescript/commonjs/alert-dialog/AlertDialog.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/alert-dialog/AlertDialogHost.d.ts +15 -0
  188. package/lib/typescript/commonjs/alert-dialog/AlertDialogHost.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/alert-dialog/confirm-store.d.ts +31 -0
  190. package/lib/typescript/commonjs/alert-dialog/confirm-store.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/alert-dialog/index.d.ts +8 -0
  192. package/lib/typescript/commonjs/alert-dialog/index.d.ts.map +1 -0
  193. package/lib/typescript/commonjs/alert-dialog/index.web.d.ts +8 -0
  194. package/lib/typescript/commonjs/alert-dialog/index.web.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/alert-dialog/types.d.ts +44 -0
  196. package/lib/typescript/commonjs/alert-dialog/types.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/combobox/Combobox.d.ts +33 -0
  198. package/lib/typescript/commonjs/combobox/Combobox.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/combobox/index.d.ts +6 -0
  200. package/lib/typescript/commonjs/combobox/index.d.ts.map +1 -0
  201. package/lib/typescript/commonjs/combobox/index.web.d.ts +6 -0
  202. package/lib/typescript/commonjs/combobox/index.web.d.ts.map +1 -0
  203. package/lib/typescript/commonjs/combobox/types.d.ts +40 -0
  204. package/lib/typescript/commonjs/combobox/types.d.ts.map +1 -0
  205. package/lib/typescript/commonjs/command/Command.d.ts +22 -0
  206. package/lib/typescript/commonjs/command/Command.d.ts.map +1 -0
  207. package/lib/typescript/commonjs/command/index.d.ts +6 -0
  208. package/lib/typescript/commonjs/command/index.d.ts.map +1 -0
  209. package/lib/typescript/commonjs/command/index.web.d.ts +6 -0
  210. package/lib/typescript/commonjs/command/index.web.d.ts.map +1 -0
  211. package/lib/typescript/commonjs/command/types.d.ts +46 -0
  212. package/lib/typescript/commonjs/command/types.d.ts.map +1 -0
  213. package/lib/typescript/commonjs/field/Field.d.ts +4 -0
  214. package/lib/typescript/commonjs/field/Field.d.ts.map +1 -0
  215. package/lib/typescript/commonjs/field/index.d.ts +3 -0
  216. package/lib/typescript/commonjs/field/index.d.ts.map +1 -0
  217. package/lib/typescript/commonjs/field/types.d.ts +26 -0
  218. package/lib/typescript/commonjs/field/types.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/icons/common.d.ts +8 -8
  220. package/lib/typescript/commonjs/index.d.ts +19 -0
  221. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  222. package/lib/typescript/commonjs/index.web.d.ts +19 -0
  223. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  224. package/lib/typescript/commonjs/input-group/InputGroup.d.ts +9 -0
  225. package/lib/typescript/commonjs/input-group/InputGroup.d.ts.map +1 -0
  226. package/lib/typescript/commonjs/input-group/index.d.ts +3 -0
  227. package/lib/typescript/commonjs/input-group/index.d.ts.map +1 -0
  228. package/lib/typescript/commonjs/input-group/types.d.ts +35 -0
  229. package/lib/typescript/commonjs/input-group/types.d.ts.map +1 -0
  230. package/lib/typescript/commonjs/item/Item.d.ts +4 -0
  231. package/lib/typescript/commonjs/item/Item.d.ts.map +1 -0
  232. package/lib/typescript/commonjs/item/index.d.ts +3 -0
  233. package/lib/typescript/commonjs/item/index.d.ts.map +1 -0
  234. package/lib/typescript/commonjs/item/types.d.ts +45 -0
  235. package/lib/typescript/commonjs/item/types.d.ts.map +1 -0
  236. package/lib/typescript/commonjs/kbd/Kbd.d.ts +4 -0
  237. package/lib/typescript/commonjs/kbd/Kbd.d.ts.map +1 -0
  238. package/lib/typescript/commonjs/kbd/index.d.ts +3 -0
  239. package/lib/typescript/commonjs/kbd/index.d.ts.map +1 -0
  240. package/lib/typescript/commonjs/kbd/types.d.ts +13 -0
  241. package/lib/typescript/commonjs/kbd/types.d.ts.map +1 -0
  242. package/lib/typescript/commonjs/label/Label.d.ts +4 -0
  243. package/lib/typescript/commonjs/label/Label.d.ts.map +1 -0
  244. package/lib/typescript/commonjs/label/index.d.ts +3 -0
  245. package/lib/typescript/commonjs/label/index.d.ts.map +1 -0
  246. package/lib/typescript/commonjs/label/types.d.ts +27 -0
  247. package/lib/typescript/commonjs/label/types.d.ts.map +1 -0
  248. package/lib/typescript/commonjs/popover/context.d.ts +15 -0
  249. package/lib/typescript/commonjs/popover/context.d.ts.map +1 -0
  250. package/lib/typescript/commonjs/popover/index.d.ts +14 -0
  251. package/lib/typescript/commonjs/popover/index.d.ts.map +1 -0
  252. package/lib/typescript/commonjs/popover/index.web.d.ts +14 -0
  253. package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -0
  254. package/lib/typescript/commonjs/popover/types.d.ts +54 -0
  255. package/lib/typescript/commonjs/popover/types.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/slider/Slider.d.ts +4 -0
  257. package/lib/typescript/commonjs/slider/Slider.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/slider/index.d.ts +3 -0
  259. package/lib/typescript/commonjs/slider/index.d.ts.map +1 -0
  260. package/lib/typescript/commonjs/slider/types.d.ts +30 -0
  261. package/lib/typescript/commonjs/slider/types.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts.map +1 -1
  263. package/lib/typescript/commonjs/theme/color-scope/index.d.ts +9 -2
  264. package/lib/typescript/commonjs/theme/color-scope/index.d.ts.map +1 -1
  265. package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts +32 -0
  266. package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts.map +1 -1
  267. package/lib/typescript/commonjs/theme/native-root-vars.d.ts +89 -0
  268. package/lib/typescript/commonjs/theme/native-root-vars.d.ts.map +1 -0
  269. package/lib/typescript/commonjs/theme/native-root-vars.web.d.ts +20 -0
  270. package/lib/typescript/commonjs/theme/native-root-vars.web.d.ts.map +1 -0
  271. package/lib/typescript/commonjs/theme/preset-vars.d.ts.map +1 -1
  272. package/lib/typescript/module/alert-dialog/AlertDialog.d.ts +21 -0
  273. package/lib/typescript/module/alert-dialog/AlertDialog.d.ts.map +1 -0
  274. package/lib/typescript/module/alert-dialog/AlertDialogHost.d.ts +15 -0
  275. package/lib/typescript/module/alert-dialog/AlertDialogHost.d.ts.map +1 -0
  276. package/lib/typescript/module/alert-dialog/confirm-store.d.ts +31 -0
  277. package/lib/typescript/module/alert-dialog/confirm-store.d.ts.map +1 -0
  278. package/lib/typescript/module/alert-dialog/index.d.ts +8 -0
  279. package/lib/typescript/module/alert-dialog/index.d.ts.map +1 -0
  280. package/lib/typescript/module/alert-dialog/index.web.d.ts +8 -0
  281. package/lib/typescript/module/alert-dialog/index.web.d.ts.map +1 -0
  282. package/lib/typescript/module/alert-dialog/types.d.ts +44 -0
  283. package/lib/typescript/module/alert-dialog/types.d.ts.map +1 -0
  284. package/lib/typescript/module/combobox/Combobox.d.ts +33 -0
  285. package/lib/typescript/module/combobox/Combobox.d.ts.map +1 -0
  286. package/lib/typescript/module/combobox/index.d.ts +6 -0
  287. package/lib/typescript/module/combobox/index.d.ts.map +1 -0
  288. package/lib/typescript/module/combobox/index.web.d.ts +6 -0
  289. package/lib/typescript/module/combobox/index.web.d.ts.map +1 -0
  290. package/lib/typescript/module/combobox/types.d.ts +40 -0
  291. package/lib/typescript/module/combobox/types.d.ts.map +1 -0
  292. package/lib/typescript/module/command/Command.d.ts +22 -0
  293. package/lib/typescript/module/command/Command.d.ts.map +1 -0
  294. package/lib/typescript/module/command/index.d.ts +6 -0
  295. package/lib/typescript/module/command/index.d.ts.map +1 -0
  296. package/lib/typescript/module/command/index.web.d.ts +6 -0
  297. package/lib/typescript/module/command/index.web.d.ts.map +1 -0
  298. package/lib/typescript/module/command/types.d.ts +46 -0
  299. package/lib/typescript/module/command/types.d.ts.map +1 -0
  300. package/lib/typescript/module/field/Field.d.ts +4 -0
  301. package/lib/typescript/module/field/Field.d.ts.map +1 -0
  302. package/lib/typescript/module/field/index.d.ts +3 -0
  303. package/lib/typescript/module/field/index.d.ts.map +1 -0
  304. package/lib/typescript/module/field/types.d.ts +26 -0
  305. package/lib/typescript/module/field/types.d.ts.map +1 -0
  306. package/lib/typescript/module/icons/common.d.ts +8 -8
  307. package/lib/typescript/module/index.d.ts +19 -0
  308. package/lib/typescript/module/index.d.ts.map +1 -1
  309. package/lib/typescript/module/index.web.d.ts +19 -0
  310. package/lib/typescript/module/index.web.d.ts.map +1 -1
  311. package/lib/typescript/module/input-group/InputGroup.d.ts +9 -0
  312. package/lib/typescript/module/input-group/InputGroup.d.ts.map +1 -0
  313. package/lib/typescript/module/input-group/index.d.ts +3 -0
  314. package/lib/typescript/module/input-group/index.d.ts.map +1 -0
  315. package/lib/typescript/module/input-group/types.d.ts +35 -0
  316. package/lib/typescript/module/input-group/types.d.ts.map +1 -0
  317. package/lib/typescript/module/item/Item.d.ts +4 -0
  318. package/lib/typescript/module/item/Item.d.ts.map +1 -0
  319. package/lib/typescript/module/item/index.d.ts +3 -0
  320. package/lib/typescript/module/item/index.d.ts.map +1 -0
  321. package/lib/typescript/module/item/types.d.ts +45 -0
  322. package/lib/typescript/module/item/types.d.ts.map +1 -0
  323. package/lib/typescript/module/kbd/Kbd.d.ts +4 -0
  324. package/lib/typescript/module/kbd/Kbd.d.ts.map +1 -0
  325. package/lib/typescript/module/kbd/index.d.ts +3 -0
  326. package/lib/typescript/module/kbd/index.d.ts.map +1 -0
  327. package/lib/typescript/module/kbd/types.d.ts +13 -0
  328. package/lib/typescript/module/kbd/types.d.ts.map +1 -0
  329. package/lib/typescript/module/label/Label.d.ts +4 -0
  330. package/lib/typescript/module/label/Label.d.ts.map +1 -0
  331. package/lib/typescript/module/label/index.d.ts +3 -0
  332. package/lib/typescript/module/label/index.d.ts.map +1 -0
  333. package/lib/typescript/module/label/types.d.ts +27 -0
  334. package/lib/typescript/module/label/types.d.ts.map +1 -0
  335. package/lib/typescript/module/popover/context.d.ts +15 -0
  336. package/lib/typescript/module/popover/context.d.ts.map +1 -0
  337. package/lib/typescript/module/popover/index.d.ts +14 -0
  338. package/lib/typescript/module/popover/index.d.ts.map +1 -0
  339. package/lib/typescript/module/popover/index.web.d.ts +14 -0
  340. package/lib/typescript/module/popover/index.web.d.ts.map +1 -0
  341. package/lib/typescript/module/popover/types.d.ts +54 -0
  342. package/lib/typescript/module/popover/types.d.ts.map +1 -0
  343. package/lib/typescript/module/slider/Slider.d.ts +4 -0
  344. package/lib/typescript/module/slider/Slider.d.ts.map +1 -0
  345. package/lib/typescript/module/slider/index.d.ts +3 -0
  346. package/lib/typescript/module/slider/index.d.ts.map +1 -0
  347. package/lib/typescript/module/slider/types.d.ts +30 -0
  348. package/lib/typescript/module/slider/types.d.ts.map +1 -0
  349. package/lib/typescript/module/theme/BloomThemeProvider.d.ts.map +1 -1
  350. package/lib/typescript/module/theme/color-scope/index.d.ts +9 -2
  351. package/lib/typescript/module/theme/color-scope/index.d.ts.map +1 -1
  352. package/lib/typescript/module/theme/color-scope/style-builder.d.ts +32 -0
  353. package/lib/typescript/module/theme/color-scope/style-builder.d.ts.map +1 -1
  354. package/lib/typescript/module/theme/native-root-vars.d.ts +89 -0
  355. package/lib/typescript/module/theme/native-root-vars.d.ts.map +1 -0
  356. package/lib/typescript/module/theme/native-root-vars.web.d.ts +20 -0
  357. package/lib/typescript/module/theme/native-root-vars.web.d.ts.map +1 -0
  358. package/lib/typescript/module/theme/preset-vars.d.ts.map +1 -1
  359. package/package.json +141 -1
  360. package/src/__tests__/Field.test.tsx +55 -0
  361. package/src/__tests__/InputGroup.test.tsx +44 -0
  362. package/src/__tests__/Item.test.tsx +73 -0
  363. package/src/__tests__/Kbd.test.tsx +27 -0
  364. package/src/__tests__/Label.test.tsx +30 -0
  365. package/src/__tests__/Slider.test.tsx +38 -0
  366. package/src/__tests__/confirm-store.test.ts +58 -0
  367. package/src/__tests__/native-root-vars.test.ts +125 -0
  368. package/src/alert-dialog/AlertDialog.stories.tsx +61 -0
  369. package/src/alert-dialog/AlertDialog.tsx +120 -0
  370. package/src/alert-dialog/AlertDialogHost.tsx +51 -0
  371. package/src/alert-dialog/confirm-store.ts +77 -0
  372. package/src/alert-dialog/index.ts +13 -0
  373. package/src/alert-dialog/index.web.ts +13 -0
  374. package/src/alert-dialog/types.ts +46 -0
  375. package/src/combobox/Combobox.stories.tsx +40 -0
  376. package/src/combobox/Combobox.tsx +274 -0
  377. package/src/combobox/index.ts +6 -0
  378. package/src/combobox/index.web.ts +6 -0
  379. package/src/combobox/types.ts +41 -0
  380. package/src/command/Command.stories.tsx +60 -0
  381. package/src/command/Command.tsx +276 -0
  382. package/src/command/index.ts +6 -0
  383. package/src/command/index.web.ts +6 -0
  384. package/src/command/types.ts +47 -0
  385. package/src/field/Field.stories.tsx +54 -0
  386. package/src/field/Field.tsx +77 -0
  387. package/src/field/index.ts +2 -0
  388. package/src/field/types.ts +26 -0
  389. package/src/index.ts +23 -0
  390. package/src/index.web.ts +23 -0
  391. package/src/input-group/InputGroup.stories.tsx +65 -0
  392. package/src/input-group/InputGroup.tsx +184 -0
  393. package/src/input-group/index.ts +2 -0
  394. package/src/input-group/types.ts +36 -0
  395. package/src/item/Item.stories.tsx +43 -0
  396. package/src/item/Item.tsx +180 -0
  397. package/src/item/index.ts +2 -0
  398. package/src/item/types.ts +45 -0
  399. package/src/kbd/Kbd.stories.tsx +36 -0
  400. package/src/kbd/Kbd.tsx +76 -0
  401. package/src/kbd/index.ts +2 -0
  402. package/src/kbd/types.ts +13 -0
  403. package/src/label/Label.stories.tsx +32 -0
  404. package/src/label/Label.tsx +64 -0
  405. package/src/label/index.ts +2 -0
  406. package/src/label/types.ts +27 -0
  407. package/src/popover/Popover.stories.tsx +61 -0
  408. package/src/popover/context.ts +26 -0
  409. package/src/popover/index.tsx +104 -0
  410. package/src/popover/index.web.tsx +325 -0
  411. package/src/popover/types.ts +60 -0
  412. package/src/react-native-css.d.ts +69 -0
  413. package/src/slider/Slider.stories.tsx +46 -0
  414. package/src/slider/Slider.tsx +275 -0
  415. package/src/slider/index.ts +2 -0
  416. package/src/slider/types.ts +30 -0
  417. package/src/theme/BloomThemeProvider.tsx +32 -6
  418. package/src/theme/color-presets.ts +118 -118
  419. package/src/theme/color-scope/index.tsx +30 -8
  420. package/src/theme/color-scope/style-builder.ts +40 -0
  421. package/src/theme/native-root-vars.ts +102 -0
  422. package/src/theme/native-root-vars.web.ts +22 -0
  423. package/src/theme/preset-vars.ts +4 -1
@@ -5,9 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.buildNativePresetStyle = buildNativePresetStyle;
7
7
  exports.buildScopeVars = buildScopeVars;
8
+ exports.getVariableContextProvider = getVariableContextProvider;
8
9
  var _reactNative = require("react-native");
9
10
  var _presetVars = require("../preset-vars.js");
10
11
  var _lazyRequire = require("../../utils/lazy-require.js");
12
+ /**
13
+ * Component that provides inline CSS variables to a subtree via NativeWind's
14
+ * (react-native-css's) real `VariableContext`. The runtime strips the leading
15
+ * `--` from each key internally, so we feed it the full `--name -> value`
16
+ * record produced by `buildScopeVars`.
17
+ */
18
+
11
19
  const getNativeWindVars = (0, _lazyRequire.lazyRequire)('nativewind');
12
20
 
13
21
  /**
@@ -21,11 +29,38 @@ function buildScopeVars(colorPreset, mode) {
21
29
  });
22
30
  }
23
31
 
32
+ /**
33
+ * Resolve NativeWind's `VariableContextProvider` — the canonical, non-deprecated
34
+ * react-native-css v3 API for providing inline CSS variables to a subtree. It
35
+ * reads the same `VariableContext` that interop className components consume, so
36
+ * descendants resolve `var(--primary)` etc. correctly. Returns `null` on web or
37
+ * when `nativewind` is not installed.
38
+ *
39
+ * This replaces the deprecated `vars()`-on-a-plain-`<View>`-style mechanism:
40
+ * under react-native-css@3, `vars()` returns an inline-vars marker that is only
41
+ * propagated to children when the host element matches className style rules
42
+ * (`usesVariables`/`variables`). A plain `<View>` with no `className` drops the
43
+ * vars silently, so the subtree renders without the preset palette.
44
+ */
45
+ function getVariableContextProvider() {
46
+ if (_reactNative.Platform.OS === 'web') return null;
47
+ const module = getNativeWindVars();
48
+ if (!module || typeof module.VariableContextProvider !== 'function') return null;
49
+ return module.VariableContextProvider;
50
+ }
51
+
24
52
  /**
25
53
  * Build a native style object carrying every CSS var of the preset, using
26
54
  * NativeWind's `vars()` when available. Returns `undefined` on web (where the
27
55
  * provider writes vars to `documentElement` instead) or when `nativewind` is
28
56
  * not installed.
57
+ *
58
+ * @deprecated Under react-native-css@3, `vars()` only propagates to a subtree
59
+ * when applied to an interop className component (the runtime gates propagation
60
+ * on matched className style rules). Applied to a plain `<View>` the vars are
61
+ * dropped silently. Prefer wrapping children in `getVariableContextProvider()`.
62
+ * Retained only as the escape-hatch contract of `useColorScopeStyle`, where the
63
+ * caller owns the host element and is expected to be a className component.
29
64
  */
30
65
  function buildNativePresetStyle(colorPreset, mode) {
31
66
  if (_reactNative.Platform.OS === 'web') return undefined;
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_presetVars","_lazyRequire","getNativeWindVars","lazyRequire","buildScopeVars","colorPreset","mode","getPresetVars","includeResolvedColorVars","buildNativePresetStyle","Platform","OS","undefined","module","vars"],"sourceRoot":"../../../../src","sources":["theme/color-scope/style-builder.ts"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AAMA,MAAMG,iBAAiB,GAAG,IAAAC,wBAAW,EAAuB,YAAY,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAC5BC,WAAyB,EACzBC,IAAsB,EACE;EACxB,OAAO,IAAAC,yBAAa,EAACF,WAAW,EAAEC,IAAI,EAAE;IAAEE,wBAAwB,EAAE;EAAK,CAAC,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,sBAAsBA,CACpCJ,WAAyB,EACzBC,IAAsB,EACA;EACtB,IAAII,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE,OAAOC,SAAS;EAC3C,MAAMC,MAAM,GAAGX,iBAAiB,CAAC,CAAC;EAClC,IAAI,CAACW,MAAM,IAAI,OAAOA,MAAM,CAACC,IAAI,KAAK,UAAU,EAAE,OAAOF,SAAS;EAClE,OAAOC,MAAM,CAACC,IAAI,CAACV,cAAc,CAACC,WAAW,EAAEC,IAAI,CAAC,CAAC;AACvD","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_presetVars","_lazyRequire","getNativeWindVars","lazyRequire","buildScopeVars","colorPreset","mode","getPresetVars","includeResolvedColorVars","getVariableContextProvider","Platform","OS","module","VariableContextProvider","buildNativePresetStyle","undefined","vars"],"sourceRoot":"../../../../src","sources":["theme/color-scope/style-builder.ts"],"mappings":";;;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;;AAWA,MAAMG,iBAAiB,GAAG,IAAAC,wBAAW,EAAuB,YAAY,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAC5BC,WAAyB,EACzBC,IAAsB,EACE;EACxB,OAAO,IAAAC,yBAAa,EAACF,WAAW,EAAEC,IAAI,EAAE;IAAEE,wBAAwB,EAAE;EAAK,CAAC,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,0BAA0BA,CAAA,EAA4C;EACpF,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE,OAAO,IAAI;EACtC,MAAMC,MAAM,GAAGV,iBAAiB,CAAC,CAAC;EAClC,IAAI,CAACU,MAAM,IAAI,OAAOA,MAAM,CAACC,uBAAuB,KAAK,UAAU,EAAE,OAAO,IAAI;EAChF,OAAOD,MAAM,CAACC,uBAAuB;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,sBAAsBA,CACpCT,WAAyB,EACzBC,IAAsB,EACA;EACtB,IAAII,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE,OAAOI,SAAS;EAC3C,MAAMH,MAAM,GAAGV,iBAAiB,CAAC,CAAC;EAClC,IAAI,CAACU,MAAM,IAAI,OAAOA,MAAM,CAACI,IAAI,KAAK,UAAU,EAAE,OAAOD,SAAS;EAClE,OAAOH,MAAM,CAACI,IAAI,CAACZ,cAAc,CAACC,WAAW,EAAEC,IAAI,CAAC,CAAC;AACvD","ignoreList":[]}
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.applyNativeRootVars = applyNativeRootVars;
7
+ var _nativeInternal = require("react-native-css/native-internal");
8
+ var _styleBuilder = require("./color-scope/style-builder.js");
9
+ /**
10
+ * Publish the active color preset's CSS custom properties into react-native-css's
11
+ * GLOBAL root-variable family so they reach the ENTIRE native app tree — including
12
+ * content rendered outside the React subtree of `BloomThemeProvider`: expo-router
13
+ * navigator screens, `Portal`s, `Dialog`/`BottomSheet` overlays, and any other host
14
+ * that paints through a separate React root.
15
+ *
16
+ * Why a global write is required (native only)
17
+ * --------------------------------------------
18
+ * react-native-css resolves a `var(--x)` reference (its `varResolver`) in this order:
19
+ * 1. `name in inheritedVariables` — the React-context-inherited vars. This is what
20
+ * `VariableContextProvider` populates, but it is React-context-scoped, so it only
21
+ * reaches *direct descendants* of the provider in the React tree.
22
+ * 2. `inlineVariables[name]` — same-component inline vars.
23
+ * 3. `variables[name]` — resolved inherited vars.
24
+ * 4. `universalVariables(name)` — a GLOBAL observable family.
25
+ * 5. `rootVariables(name)` — a GLOBAL observable family.
26
+ * 6. the declared fallback.
27
+ *
28
+ * `BloomThemeProvider`'s `VariableContextProvider` only feeds path #1, so the navigator
29
+ * host and every portal/modal — which render outside that subtree — never see the
30
+ * preset vars and fall through to `rootVariables`/`universalVariables`. By default those
31
+ * families hold only react-native-css's own `__rn-css-rem`/`__rn-css-color` entries
32
+ * (Bloom's `global.css` defines the `hsl(var(--primary))` indirection but not the HSL
33
+ * triples themselves — those are injected at runtime), so the whole tree below the
34
+ * navigator renders monochrome. Writing the triples into `rootVariables` here is the
35
+ * exact same mechanism react-native-css uses for compiled `:root {}` / `@theme` vars
36
+ * (`StyleCollection.inject` does `rootVariables(name).set(valueArray)`), so portaled
37
+ * content resolves the palette identically regardless of React-tree position.
38
+ *
39
+ * Why a STATIC `import`, not a runtime `require` (critical)
40
+ * ---------------------------------------------------------
41
+ * react-native-css@3.0.7 ships both a `dist/commonjs` and a `dist/module` build, and
42
+ * Metro bundles BOTH. In `native-internal/root.js` the variable families are plain
43
+ * module-local consts — NOT `globalThis`-guarded the way `StyleCollection` is — so the
44
+ * commonjs `root.js` and the module `root.js` each instantiate their OWN separate
45
+ * `rootVariables` family. The react-native-css renderer (`react-native-css/src/components/View.tsx`
46
+ * → `varResolver`) imports its `root.js` via ESM `import`, i.e. the MODULE build. A
47
+ * runtime `require('react-native-css/native-internal')` resolves the package's `require`
48
+ * export condition → the COMMONJS build → a DIFFERENT family the renderer never
49
+ * subscribes to, so the writes are a silent no-op on device. A static top-level
50
+ * `import` resolves the `import` condition → the MODULE build → the renderer's instance.
51
+ *
52
+ * This plain file is the NATIVE/default variant (Metro selects it on iOS/Android,
53
+ * which have no `.native` override here); the web variant lives in the sibling
54
+ * `native-root-vars.web.ts` no-op, which web bundlers pick over this one. So the
55
+ * static `react-native-css/native-internal` import below is never pulled into a web
56
+ * bundle — only into native. This mirrors Bloom's existing platform-split convention
57
+ * (`color-scope/index.tsx` + `color-scope/index.web.tsx`, `FontLoader.native.tsx`).
58
+ *
59
+ * Keying contract (verified against react-native-css@3.0.7)
60
+ * ---------------------------------------------------------
61
+ * The `rootVariables` family is keyed by the BARE variable name, WITHOUT the leading
62
+ * `--`. The compiler strips it uniformly: a `:root { --primary: ... }` declaration is
63
+ * stored via `rule.v.push([property.slice(2), value])` then routed into
64
+ * `shared.rootVariables[name]`, and `@property --x` goes through
65
+ * `name.startsWith("--") ? name.slice(2) : name`. The lookup side matches: a `var(--x)`
66
+ * reference compiles to `[{}, "var", ident.slice(2)]`, so `varResolver` looks up the
67
+ * bare name. `buildScopeVars` returns keys WITH the `--` prefix, so we strip it before
68
+ * writing each entry.
69
+ *
70
+ * Value shape
71
+ * -----------
72
+ * Each entry is a `VariableValue[]` — an array of `[value, mediaCondition?]` tuples.
73
+ * Bloom's preset vars are unconditional, so each is a single-element `[[value]]`, e.g.
74
+ * `rootVariables('primary').set([['205 87% 53%']])`. This is the same shape the compiler
75
+ * emits for unconditional `:root` vars.
76
+ *
77
+ * This is native-only and additive: the `VariableContextProvider` wrapper stays (it is
78
+ * the correct, scoped mechanism for `BloomColorScope` subtree overrides and harmlessly
79
+ * covers direct descendants). The web fork (`native-root-vars.web.ts`) no-ops — web
80
+ * writes the same vars to `document.documentElement` via `applyColorPresetVars`.
81
+ */
82
+
83
+ /**
84
+ * Write the preset's CSS vars to react-native-css's global `rootVariables` family
85
+ * so the whole native tree (navigator screens + portals/modals/bottom-sheets)
86
+ * resolves the active palette.
87
+ *
88
+ * Each `.set` notifies its own observers synchronously (react-native-css only
89
+ * batches notifications inside its own `StyleCollection.inject`; outside it,
90
+ * `observableBatch.current` is unset so every `.set` runs observers immediately),
91
+ * so sequential writes correctly trigger a re-render when the preset/mode changes.
92
+ *
93
+ * Defensive guard: if a host ships a react-native-css build that doesn't expose
94
+ * `rootVariables` as a callable (it always does on @3), we bail rather than throw.
95
+ */
96
+ function applyNativeRootVars(colorPreset, mode) {
97
+ if (typeof _nativeInternal.rootVariables !== 'function') return;
98
+ const vars = (0, _styleBuilder.buildScopeVars)(colorPreset, mode);
99
+ for (const [key, value] of Object.entries(vars)) {
100
+ // The family is keyed by the bare name; `buildScopeVars` keys include `--`.
101
+ const name = key.startsWith('--') ? key.slice(2) : key;
102
+ (0, _nativeInternal.rootVariables)(name).set([[value]]);
103
+ }
104
+ }
105
+ //# sourceMappingURL=native-root-vars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_nativeInternal","require","_styleBuilder","applyNativeRootVars","colorPreset","mode","rootVariables","vars","buildScopeVars","key","value","Object","entries","name","startsWith","slice","set"],"sourceRoot":"../../../src","sources":["theme/native-root-vars.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,mBAAmBA,CAACC,WAAyB,EAAEC,IAAsB,EAAQ;EAC3F,IAAI,OAAOC,6BAAa,KAAK,UAAU,EAAE;EAEzC,MAAMC,IAAI,GAAG,IAAAC,4BAAc,EAACJ,WAAW,EAAEC,IAAI,CAAC;EAC9C,KAAK,MAAM,CAACI,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,IAAI,CAAC,EAAE;IAC/C;IACA,MAAMM,IAAI,GAAGJ,GAAG,CAACK,UAAU,CAAC,IAAI,CAAC,GAAGL,GAAG,CAACM,KAAK,CAAC,CAAC,CAAC,GAAGN,GAAG;IACtD,IAAAH,6BAAa,EAACO,IAAI,CAAC,CAACG,GAAG,CAAC,CAAC,CAACN,KAAK,CAAC,CAAC,CAAC;EACpC;AACF","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.applyNativeRootVars = applyNativeRootVars;
7
+ /**
8
+ * Web fork of `applyNativeRootVars` — a no-op.
9
+ *
10
+ * On web, `BloomThemeProvider` already writes the active preset's CSS vars to
11
+ * `document.documentElement` via `applyColorPresetVars`, which the browser /
12
+ * react-native-web resolve natively. The native/default variant — the plain
13
+ * sibling `native-root-vars.ts` — instead publishes those vars into
14
+ * react-native-css's GLOBAL `rootVariables` family.
15
+ *
16
+ * Keeping the native variant's `react-native-css/native-internal` import out of
17
+ * the web bundle is the whole reason this is a platform-split module: web (and
18
+ * any non-NativeWind host) picks this `.web` fork over the plain file and so
19
+ * never statically pulls react-native-css internals.
20
+ *
21
+ * The signature is intentionally identical to the plain variant so the import
22
+ * site in `BloomThemeProvider` is platform-agnostic.
23
+ */
24
+ function applyNativeRootVars(_colorPreset, _mode) {
25
+ // Intentionally empty — web applies preset vars to `document.documentElement`.
26
+ }
27
+ //# sourceMappingURL=native-root-vars.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["applyNativeRootVars","_colorPreset","_mode"],"sourceRoot":"../../../src","sources":["theme/native-root-vars.web.ts"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,mBAAmBA,CAACC,YAA0B,EAAEC,KAAuB,EAAQ;EAC7F;AAAA","ignoreList":[]}
@@ -54,7 +54,10 @@ function getPresetVars(colorName, mode, options = {}) {
54
54
  const isDark = mode === 'dark';
55
55
  const extended = {
56
56
  ...base,
57
- '--card': isDark ? `${hue} 30% 10%` : '0 0% 100%',
57
+ // Light cards carry the same faint preset tint as `--popover` (H 12% 99%)
58
+ // so they read as part of the preset family rather than a pure-white slab —
59
+ // mirroring how dark cards (H 30% 10%) carry the accent hue into near-black.
60
+ '--card': isDark ? `${hue} 30% 10%` : `${hue} 12% 99%`,
58
61
  '--card-foreground': foreground,
59
62
  '--chart-1': `${hue} ${sat}% 85%`,
60
63
  '--chart-2': `${hue} ${sat}% 75%`,
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_colorPresets","extractHue","hslVar","parseInt","split","extractSat","RESOLVED_COLOR_MAP","getPresetVars","colorName","mode","options","preset","APP_COLOR_PRESETS","base","light","dark","get","key","primary","foreground","hue","sat","Math","min","isDark","extended","includeResolvedColorVars","resolved","rawKey","colorKey","Object","entries","value","applyPresetVarsToDocument","Platform","OS","document","vars","root","documentElement","style","setProperty"],"sourceRoot":"../../../src","sources":["theme/preset-vars.ts"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,SAASE,UAAUA,CAACC,MAAc,EAAU;EAC1C,OAAOC,QAAQ,CAACD,MAAM,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC;AAClD;AAEA,SAASC,UAAUA,CAACH,MAAc,EAAU;EAC1C,OAAOC,QAAQ,CAACD,MAAM,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC;AAClD;AAEA,MAAME,kBAA0C,GAAG;EACjD,cAAc,EAAE,oBAAoB;EACpC,cAAc,EAAE,oBAAoB;EACpC,WAAW,EAAE,iBAAiB;EAC9B,sBAAsB,EAAE,4BAA4B;EACpD,aAAa,EAAE,mBAAmB;EAClC,wBAAwB,EAAE,8BAA8B;EACxD,SAAS,EAAE,eAAe;EAC1B,oBAAoB,EAAE,0BAA0B;EAChD,UAAU,EAAE,gBAAgB;EAC5B,qBAAqB,EAAE,2BAA2B;EAClD,eAAe,EAAE,qBAAqB;EACtC,UAAU,EAAE,gBAAgB;EAC5B,SAAS,EAAE,eAAe;EAC1B,QAAQ,EAAE,cAAc;EACxB,WAAW,EAAE,iBAAiB;EAC9B,sBAAsB,EAAE,4BAA4B;EACpD,WAAW,EAAE,iBAAiB;EAC9B,sBAAsB,EAAE,4BAA4B;EACpD,QAAQ,EAAE,cAAc;EACxB,mBAAmB,EAAE;AACvB,CAAC;AAaD;AACA;AACA;A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"names":["_reactNative","require","_colorPresets","extractHue","hslVar","parseInt","split","extractSat","RESOLVED_COLOR_MAP","getPresetVars","colorName","mode","options","preset","APP_COLOR_PRESETS","base","light","dark","get","key","primary","foreground","hue","sat","Math","min","isDark","extended","includeResolvedColorVars","resolved","rawKey","colorKey","Object","entries","value","applyPresetVarsToDocument","Platform","OS","document","vars","root","documentElement","style","setProperty"],"sourceRoot":"../../../src","sources":["theme/preset-vars.ts"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,SAASE,UAAUA,CAACC,MAAc,EAAU;EAC1C,OAAOC,QAAQ,CAACD,MAAM,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC;AAClD;AAEA,SAASC,UAAUA,CAACH,MAAc,EAAU;EAC1C,OAAOC,QAAQ,CAACD,MAAM,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC;AAClD;AAEA,MAAME,kBAA0C,GAAG;EACjD,cAAc,EAAE,oBAAoB;EACpC,cAAc,EAAE,oBAAoB;EACpC,WAAW,EAAE,iBAAiB;EAC9B,sBAAsB,EAAE,4BAA4B;EACpD,aAAa,EAAE,mBAAmB;EAClC,wBAAwB,EAAE,8BAA8B;EACxD,SAAS,EAAE,eAAe;EAC1B,oBAAoB,EAAE,0BAA0B;EAChD,UAAU,EAAE,gBAAgB;EAC5B,qBAAqB,EAAE,2BAA2B;EAClD,eAAe,EAAE,qBAAqB;EACtC,UAAU,EAAE,gBAAgB;EAC5B,SAAS,EAAE,eAAe;EAC1B,QAAQ,EAAE,cAAc;EACxB,WAAW,EAAE,iBAAiB;EAC9B,sBAAsB,EAAE,4BAA4B;EACpD,WAAW,EAAE,iBAAiB;EAC9B,sBAAsB,EAAE,4BAA4B;EACpD,QAAQ,EAAE,cAAc;EACxB,mBAAmB,EAAE;A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EAAEe,KAAK,CAAC;EAC9B;AACF","ignoreList":[]}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ import React, { memo, useCallback } from 'react';
4
+ import { StyleSheet, View } from 'react-native';
5
+ import { Button } from "../button/index.js";
6
+ import { useTheme } from "../theme/use-theme.js";
7
+ import { Text } from "../typography/index.js";
8
+ import { fontSize, space } from "../styles/tokens.js";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ /**
11
+ * Build the `AlertDialog` component bound to a platform `CenteredDialog`.
12
+ *
13
+ * `CenteredDialog` is platform-forked (native RN `Modal` vs pure-DOM web
14
+ * overlay), and this repo never relies on implicit `.web` resolution — the
15
+ * platform entry files (`index.ts` / `index.web.ts`) inject the correct
16
+ * `CenteredDialog` here. The body below is single-source, no duplication.
17
+ *
18
+ * `AlertDialog` is a thin wrapper over `CenteredDialog` that lays out a title,
19
+ * description and a confirm/cancel action row. Reach for the imperative
20
+ * `confirm()` helper + `<AlertDialogHost />` to trigger a confirm from an
21
+ * event handler without owning visible state.
22
+ */
23
+ export function createAlertDialog(CenteredDialog) {
24
+ const AlertDialogComponent = function AlertDialog({
25
+ visible,
26
+ onClose,
27
+ title,
28
+ description,
29
+ confirmLabel = 'Confirm',
30
+ cancelLabel = 'Cancel',
31
+ onConfirm,
32
+ onCancel,
33
+ destructive = false,
34
+ hideCancel = false,
35
+ dismissible = false,
36
+ cardStyle,
37
+ testID
38
+ }) {
39
+ const theme = useTheme();
40
+ const handleCancel = useCallback(() => {
41
+ onCancel?.();
42
+ onClose();
43
+ }, [onCancel, onClose]);
44
+ const handleConfirm = useCallback(() => {
45
+ onConfirm?.();
46
+ onClose();
47
+ }, [onConfirm, onClose]);
48
+ return /*#__PURE__*/_jsx(CenteredDialog, {
49
+ visible: visible,
50
+ onClose: dismissible ? onClose : () => {},
51
+ dismissible: dismissible,
52
+ title: title,
53
+ showClose: false,
54
+ accessibilityLabel: title,
55
+ cardStyle: cardStyle,
56
+ testID: testID,
57
+ footer: /*#__PURE__*/_jsxs(View, {
58
+ style: styles.actions,
59
+ children: [!hideCancel ? /*#__PURE__*/_jsx(Button, {
60
+ variant: "secondary",
61
+ size: "medium",
62
+ onPress: handleCancel,
63
+ style: styles.action,
64
+ accessibilityLabel: cancelLabel,
65
+ children: cancelLabel
66
+ }) : null, /*#__PURE__*/_jsx(Button, {
67
+ variant: "primary",
68
+ size: "medium",
69
+ onPress: handleConfirm,
70
+ style: [styles.action, destructive && {
71
+ backgroundColor: theme.colors.negative
72
+ }],
73
+ textStyle: destructive ? {
74
+ color: theme.colors.negativeForeground
75
+ } : undefined,
76
+ accessibilityLabel: confirmLabel,
77
+ children: confirmLabel
78
+ })]
79
+ }),
80
+ children: description ? /*#__PURE__*/_jsx(Text, {
81
+ style: {
82
+ fontSize: fontSize.md,
83
+ lineHeight: fontSize.md * 1.4,
84
+ color: theme.colors.textSecondary
85
+ },
86
+ children: description
87
+ }) : null
88
+ });
89
+ };
90
+ const AlertDialog = /*#__PURE__*/memo(AlertDialogComponent);
91
+ AlertDialog.displayName = 'AlertDialog';
92
+ return AlertDialog;
93
+ }
94
+ const styles = StyleSheet.create({
95
+ actions: {
96
+ flexDirection: 'row',
97
+ justifyContent: 'flex-end',
98
+ gap: space.sm
99
+ },
100
+ action: {
101
+ minWidth: 96
102
+ }
103
+ });
104
+ //# sourceMappingURL=AlertDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","memo","useCallback","StyleSheet","View","Button","useTheme","Text","fontSize","space","jsx","_jsx","jsxs","_jsxs","createAlertDialog","CenteredDialog","AlertDialogComponent","AlertDialog","visible","onClose","title","description","confirmLabel","cancelLabel","onConfirm","onCancel","destructive","hideCancel","dismissible","cardStyle","testID","theme","handleCancel","handleConfirm","showClose","accessibilityLabel","footer","style","styles","actions","children","variant","size","onPress","action","backgroundColor","colors","negative","textStyle","color","negativeForeground","undefined","md","lineHeight","textSecondary","displayName","create","flexDirection","justifyContent","gap","sm","minWidth"],"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,gBAAGhB,IAAI,CAACe,oBAAoB,CAAC;EAC9CC,WAAW,CAACsC,WAAW,GAAG,aAAa;EACvC,OAAOtC,WAAW;AACpB;AAIA,MAAMqB,MAAM,GAAGnC,UAAU,CAACqD,MAAM,CAAC;EAC/BjB,OAAO,EAAE;IACPkB,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,UAAU;IAC1BC,GAAG,EAAElD,KAAK,CAACmD;EACb,CAAC;EACDhB,MAAM,EAAE;IACNiB,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ import React, { useEffect, useState } from 'react';
4
+ import { resolveConfirm, subscribeConfirms } from "./confirm-store.js";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ /**
7
+ * Build the `<AlertDialogHost />` bound to a platform `AlertDialog`. The
8
+ * platform entry files (`index.ts` / `index.web.ts`) inject the correct one.
9
+ *
10
+ * The host mounts the imperative `confirm()` UI. Wrap your app root once
11
+ * (after `BloomThemeProvider`) and you can call `confirm()` from anywhere —
12
+ * including before the host mounts (entries are queued and drained on
13
+ * subscribe). Confirms present one at a time in FIFO order.
14
+ */
15
+ export function createAlertDialogHost(AlertDialog) {
16
+ function ConfirmHost({
17
+ entry
18
+ }) {
19
+ return /*#__PURE__*/_jsx(AlertDialog, {
20
+ visible: true,
21
+ title: entry.title,
22
+ description: entry.description,
23
+ confirmLabel: entry.confirmLabel,
24
+ cancelLabel: entry.cancelLabel,
25
+ destructive: entry.destructive,
26
+ hideCancel: entry.hideCancel,
27
+ dismissible: entry.dismissible,
28
+ onConfirm: () => resolveConfirm(entry.id, true),
29
+ onCancel: () => resolveConfirm(entry.id, false),
30
+ onClose: () => resolveConfirm(entry.id, false)
31
+ });
32
+ }
33
+ function AlertDialogHost() {
34
+ const [queue, setQueue] = useState([]);
35
+ useEffect(() => subscribeConfirms(setQueue), []);
36
+ const head = queue[0];
37
+ if (!head) return null;
38
+ return /*#__PURE__*/_jsx(ConfirmHost, {
39
+ entry: head
40
+ }, head.id);
41
+ }
42
+ AlertDialogHost.displayName = 'AlertDialogHost';
43
+ return AlertDialogHost;
44
+ }
45
+ //# sourceMappingURL=AlertDialogHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useEffect","useState","resolveConfirm","subscribeConfirms","jsx","_jsx","createAlertDialogHost","AlertDialog","ConfirmHost","entry","visible","title","description","confirmLabel","cancelLabel","destructive","hideCancel","dismissible","onConfirm","id","onCancel","onClose","AlertDialogHost","queue","setQueue","head","displayName"],"sourceRoot":"../../../src","sources":["alert-dialog/AlertDialogHost.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAElD,SACEC,cAAc,EACdC,iBAAiB,QAEZ,oBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACC,WAA4B,EAAE;EAClE,SAASC,WAAWA,CAAC;IAAEC;EAA+B,CAAC,EAAE;IACvD,oBACEJ,IAAA,CAACE,WAAW;MACVG,OAAO;MACPC,KAAK,EAAEF,KAAK,CAACE,KAAM;MACnBC,WAAW,EAAEH,KAAK,CAACG,WAAY;MAC/BC,YAAY,EAAEJ,KAAK,CAACI,YAAa;MACjCC,WAAW,EAAEL,KAAK,CAACK,WAAY;MAC/BC,WAAW,EAAEN,KAAK,CAACM,WAAY;MAC/BC,UAAU,EAAEP,KAAK,CAACO,UAAW;MAC7BC,WAAW,EAAER,KAAK,CAACQ,WAAY;MAC/BC,SAAS,EAAEA,CAAA,KAAMhB,cAAc,CAACO,KAAK,CAACU,EAAE,EAAE,IAAI,CAAE;MAChDC,QAAQ,EAAEA,CAAA,KAAMlB,cAAc,CAACO,KAAK,CAACU,EAAE,EAAE,KAAK,CAAE;MAChDE,OAAO,EAAEA,CAAA,KAAMnB,cAAc,CAACO,KAAK,CAACU,EAAE,EAAE,KAAK;IAAE,CAChD,CAAC;EAEN;EAEA,SAASG,eAAeA,CAAA,EAAG;IACzB,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGvB,QAAQ,CAA0B,EAAE,CAAC;IAE/DD,SAAS,CAAC,MAAMG,iBAAiB,CAACqB,QAAQ,CAAC,EAAE,EAAE,CAAC;IAEhD,MAAMC,IAAI,GAAGF,KAAK,CAAC,CAAC,CAAC;IACrB,IAAI,CAACE,IAAI,EAAE,OAAO,IAAI;IAEtB,oBAAOpB,IAAA,CAACG,WAAW;MAAeC,KAAK,EAAEgB;IAAK,GAArBA,IAAI,CAACN,EAAkB,CAAC;EACnD;EACAG,eAAe,CAACI,WAAW,GAAG,iBAAiB;EAE/C,OAAOJ,eAAe;AACxB","ignoreList":[]}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Imperative confirm store.
5
+ *
6
+ * Mirrors the `dialog/alert-store` pattern: a module-scope queue + a single
7
+ * subscriber (the `<AlertDialogHost />` mounted in the app tree). `confirm()`
8
+ * enqueues an entry and resolves a promise with the user's choice. Entries
9
+ * enqueued before the host mounts drain on subscribe — no lost confirms.
10
+ */
11
+
12
+ let idCounter = 0;
13
+ function genId() {
14
+ idCounter += 1;
15
+ return `bloom-confirm-${idCounter}`;
16
+ }
17
+ let queue = [];
18
+ let listener = null;
19
+ function emit() {
20
+ if (listener) listener(queue);
21
+ }
22
+
23
+ /**
24
+ * Show a Bloom confirm dialog and resolve with the user's choice.
25
+ *
26
+ * ```ts
27
+ * const ok = await confirm({
28
+ * title: 'Delete app?',
29
+ * description: 'This cannot be undone.',
30
+ * confirmLabel: 'Delete',
31
+ * destructive: true,
32
+ * });
33
+ * if (ok) await doDelete();
34
+ * ```
35
+ */
36
+ export function confirm(options) {
37
+ return new Promise(resolve => {
38
+ const id = genId();
39
+ queue = [...queue, {
40
+ ...options,
41
+ id,
42
+ resolve
43
+ }];
44
+ emit();
45
+ });
46
+ }
47
+
48
+ /** Resolve and remove an entry. Called by the host on confirm/cancel/dismiss. */
49
+ export function resolveConfirm(id, confirmed) {
50
+ const entry = queue.find(e => e.id === id);
51
+ if (!entry) return;
52
+ queue = queue.filter(e => e.id !== id);
53
+ entry.resolve(confirmed);
54
+ emit();
55
+ }
56
+
57
+ /**
58
+ * Subscribe to queue changes (single-subscriber model; latest wins). Delivers
59
+ * the current queue synchronously so a freshly mounted host catches up.
60
+ */
61
+ export function subscribeConfirms(fn) {
62
+ listener = fn;
63
+ fn(queue);
64
+ return () => {
65
+ if (listener === fn) listener = null;
66
+ };
67
+ }
68
+
69
+ /** Inspect the current queue. Used by tests. */
70
+ export function getConfirmQueue() {
71
+ return queue;
72
+ }
73
+ //# sourceMappingURL=confirm-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["idCounter","genId","queue","listener","emit","confirm","options","Promise","resolve","id","resolveConfirm","confirmed","entry","find","e","filter","subscribeConfirms","fn","getConfirmQueue"],"sourceRoot":"../../../src","sources":["alert-dialog/confirm-store.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAIA,SAAS,GAAG,CAAC;AACjB,SAASC,KAAKA,CAAA,EAAW;EACvBD,SAAS,IAAI,CAAC;EACd,OAAO,iBAAiBA,SAAS,EAAE;AACrC;AASA,IAAIE,KAAqB,GAAG,EAAE;AAC9B,IAAIC,QAAyB,GAAG,IAAI;AAEpC,SAASC,IAAIA,CAAA,EAAS;EACpB,IAAID,QAAQ,EAAEA,QAAQ,CAACD,KAAK,CAAC;AAC/B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,OAAOA,CAACC,OAAuB,EAAoB;EACjE,OAAO,IAAIC,OAAO,CAAWC,OAAO,IAAK;IACvC,MAAMC,EAAE,GAAGR,KAAK,CAAC,CAAC;IAClBC,KAAK,GAAG,CAAC,GAAGA,KAAK,EAAE;MAAE,GAAGI,OAAO;MAAEG,EAAE;MAAED;IAAQ,CAAC,CAAC;IAC/CJ,IAAI,CAAC,CAAC;EACR,CAAC,CAAC;AACJ;;AAEA;AACA,OAAO,SAASM,cAAcA,CAACD,EAAU,EAAEE,SAAkB,EAAQ;EACnE,MAAMC,KAAK,GAAGV,KAAK,CAACW,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACL,EAAE,KAAKA,EAAE,CAAC;EAC5C,IAAI,CAACG,KAAK,EAAE;EACZV,KAAK,GAAGA,KAAK,CAACa,MAAM,CAAED,CAAC,IAAKA,CAAC,CAACL,EAAE,KAAKA,EAAE,CAAC;EACxCG,KAAK,CAACJ,OAAO,CAACG,SAAS,CAAC;EACxBP,IAAI,CAAC,CAAC;AACR;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASY,iBAAiBA,CAACC,EAAY,EAAc;EAC1Dd,QAAQ,GAAGc,EAAE;EACbA,EAAE,CAACf,KAAK,CAAC;EACT,OAAO,MAAM;IACX,IAAIC,QAAQ,KAAKc,EAAE,EAAEd,QAAQ,GAAG,IAAI;EACtC,CAAC;AACH;;AAEA;AACA,OAAO,SAASe,eAAeA,CAAA,EAA4B;EACzD,OAAOhB,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ import { CenteredDialog } from '../dialog/index';
4
+ import { createAlertDialog } from "./AlertDialog.js";
5
+ import { createAlertDialogHost } from "./AlertDialogHost.js";
6
+ export const AlertDialog = createAlertDialog(CenteredDialog);
7
+ export const AlertDialogHost = createAlertDialogHost(AlertDialog);
8
+ export { confirm } from "./confirm-store.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CenteredDialog","createAlertDialog","createAlertDialogHost","AlertDialog","AlertDialogHost","confirm"],"sourceRoot":"../../../src","sources":["alert-dialog/index.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,iBAAiB;AAChD,SAASC,iBAAiB,QAAQ,kBAAe;AACjD,SAASC,qBAAqB,QAAQ,sBAAmB;AAEzD,OAAO,MAAMC,WAAW,GAAGF,iBAAiB,CAACD,cAAc,CAAC;AAC5D,OAAO,MAAMI,eAAe,GAAGF,qBAAqB,CAACC,WAAW,CAAC;AAEjE,SAASE,OAAO,QAAQ,oBAAiB","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ import { CenteredDialog } from "../dialog/index.web.js";
4
+ import { createAlertDialog } from "./AlertDialog.js";
5
+ import { createAlertDialogHost } from "./AlertDialogHost.js";
6
+ export const AlertDialog = createAlertDialog(CenteredDialog);
7
+ export const AlertDialogHost = createAlertDialogHost(AlertDialog);
8
+ export { confirm } from "./confirm-store.js";
9
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CenteredDialog","createAlertDialog","createAlertDialogHost","AlertDialog","AlertDialogHost","confirm"],"sourceRoot":"../../../src","sources":["alert-dialog/index.web.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,wBAAqB;AACpD,SAASC,iBAAiB,QAAQ,kBAAe;AACjD,SAASC,qBAAqB,QAAQ,sBAAmB;AAEzD,OAAO,MAAMC,WAAW,GAAGF,iBAAiB,CAACD,cAAc,CAAC;AAC5D,OAAO,MAAMI,eAAe,GAAGF,qBAAqB,CAACC,WAAW,CAAC;AAEjE,SAASE,OAAO,QAAQ,oBAAiB","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["alert-dialog/types.ts"],"mappings":"","ignoreList":[]}