blend-native 0.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (555) hide show
  1. package/README.md +404 -0
  2. package/lib/commonjs/a11y/announcement.js +42 -0
  3. package/lib/commonjs/a11y/announcement.js.map +1 -0
  4. package/lib/commonjs/a11y/useLiveRegion.js +37 -0
  5. package/lib/commonjs/a11y/useLiveRegion.js.map +1 -0
  6. package/lib/commonjs/adapters/cssStringAdapter.js +363 -0
  7. package/lib/commonjs/adapters/cssStringAdapter.js.map +1 -0
  8. package/lib/commonjs/adapters/optionalGradient.js +33 -0
  9. package/lib/commonjs/adapters/optionalGradient.js.map +1 -0
  10. package/lib/commonjs/adapters/surfaceStyle.js +159 -0
  11. package/lib/commonjs/adapters/surfaceStyle.js.map +1 -0
  12. package/lib/commonjs/components/Alert/Alert.js +130 -0
  13. package/lib/commonjs/components/Alert/Alert.js.map +1 -0
  14. package/lib/commonjs/components/Alert/AlertActions.js +74 -0
  15. package/lib/commonjs/components/Alert/AlertActions.js.map +1 -0
  16. package/lib/commonjs/components/Alert/AlertClose.js +48 -0
  17. package/lib/commonjs/components/Alert/AlertClose.js.map +1 -0
  18. package/lib/commonjs/components/Alert/AlertText.js +49 -0
  19. package/lib/commonjs/components/Alert/AlertText.js.map +1 -0
  20. package/lib/commonjs/components/Alert/alert.tokens.js +6 -0
  21. package/lib/commonjs/components/Alert/alert.tokens.js.map +1 -0
  22. package/lib/commonjs/components/Alert/alert.types.js +6 -0
  23. package/lib/commonjs/components/Alert/alert.types.js.map +1 -0
  24. package/lib/commonjs/components/Alert/alert.utils.js +80 -0
  25. package/lib/commonjs/components/Alert/alert.utils.js.map +1 -0
  26. package/lib/commonjs/components/Alert/index.js +51 -0
  27. package/lib/commonjs/components/Alert/index.js.map +1 -0
  28. package/lib/commonjs/components/Button/Button.js +125 -0
  29. package/lib/commonjs/components/Button/Button.js.map +1 -0
  30. package/lib/commonjs/components/Button/button.types.js +6 -0
  31. package/lib/commonjs/components/Button/button.types.js.map +1 -0
  32. package/lib/commonjs/components/Button/button.utils.js +129 -0
  33. package/lib/commonjs/components/Button/button.utils.js.map +1 -0
  34. package/lib/commonjs/components/Button/index.js +57 -0
  35. package/lib/commonjs/components/Button/index.js.map +1 -0
  36. package/lib/commonjs/components/Skeleton/Skeleton.js +154 -0
  37. package/lib/commonjs/components/Skeleton/Skeleton.js.map +1 -0
  38. package/lib/commonjs/components/Skeleton/index.js +20 -0
  39. package/lib/commonjs/components/Skeleton/index.js.map +1 -0
  40. package/lib/commonjs/components/Skeleton/skeleton.types.js +6 -0
  41. package/lib/commonjs/components/Skeleton/skeleton.types.js.map +1 -0
  42. package/lib/commonjs/components/Skeleton/skeleton.utils.js +45 -0
  43. package/lib/commonjs/components/Skeleton/skeleton.utils.js.map +1 -0
  44. package/lib/commonjs/components/Tag/Tag.js +161 -0
  45. package/lib/commonjs/components/Tag/Tag.js.map +1 -0
  46. package/lib/commonjs/components/Tag/index.js +33 -0
  47. package/lib/commonjs/components/Tag/index.js.map +1 -0
  48. package/lib/commonjs/components/Tag/tag.types.js +6 -0
  49. package/lib/commonjs/components/Tag/tag.types.js.map +1 -0
  50. package/lib/commonjs/components/Tag/tag.utils.js +69 -0
  51. package/lib/commonjs/components/Tag/tag.utils.js.map +1 -0
  52. package/lib/commonjs/components/TextInput/TextInput.js +138 -0
  53. package/lib/commonjs/components/TextInput/TextInput.js.map +1 -0
  54. package/lib/commonjs/components/TextInput/index.js +14 -0
  55. package/lib/commonjs/components/TextInput/index.js.map +1 -0
  56. package/lib/commonjs/components/TextInput/textInput.types.js +6 -0
  57. package/lib/commonjs/components/TextInput/textInput.types.js.map +1 -0
  58. package/lib/commonjs/components/TextInput/textInput.utils.js +40 -0
  59. package/lib/commonjs/components/TextInput/textInput.utils.js.map +1 -0
  60. package/lib/commonjs/components/shared/field/FieldFooter.js +51 -0
  61. package/lib/commonjs/components/shared/field/FieldFooter.js.map +1 -0
  62. package/lib/commonjs/components/shared/field/FieldLabels.js +67 -0
  63. package/lib/commonjs/components/shared/field/FieldLabels.js.map +1 -0
  64. package/lib/commonjs/components/shared/field/fieldState.js +37 -0
  65. package/lib/commonjs/components/shared/field/fieldState.js.map +1 -0
  66. package/lib/commonjs/components/shared/group.js +73 -0
  67. package/lib/commonjs/components/shared/group.js.map +1 -0
  68. package/lib/commonjs/index.js +256 -0
  69. package/lib/commonjs/index.js.map +1 -0
  70. package/lib/commonjs/motion/motion.js +128 -0
  71. package/lib/commonjs/motion/motion.js.map +1 -0
  72. package/lib/commonjs/motion/useReduceMotion.js +37 -0
  73. package/lib/commonjs/motion/useReduceMotion.js.map +1 -0
  74. package/lib/commonjs/overlay/portal.js +110 -0
  75. package/lib/commonjs/overlay/portal.js.map +1 -0
  76. package/lib/commonjs/overlay/positioning.js +122 -0
  77. package/lib/commonjs/overlay/positioning.js.map +1 -0
  78. package/lib/commonjs/overlay/safeAreaInsets.js +30 -0
  79. package/lib/commonjs/overlay/safeAreaInsets.js.map +1 -0
  80. package/lib/commonjs/overlay/sheet/BottomSheet.js +196 -0
  81. package/lib/commonjs/overlay/sheet/BottomSheet.js.map +1 -0
  82. package/lib/commonjs/overlay/sheet/sheetMath.js +60 -0
  83. package/lib/commonjs/overlay/sheet/sheetMath.js.map +1 -0
  84. package/lib/commonjs/overlay/toast/ToastOutlet.js +106 -0
  85. package/lib/commonjs/overlay/toast/ToastOutlet.js.map +1 -0
  86. package/lib/commonjs/overlay/toast/toastStore.js +76 -0
  87. package/lib/commonjs/overlay/toast/toastStore.js.map +1 -0
  88. package/lib/commonjs/overlay/useAnchoredPosition.js +85 -0
  89. package/lib/commonjs/overlay/useAnchoredPosition.js.map +1 -0
  90. package/lib/commonjs/package.json +1 -0
  91. package/lib/commonjs/primitives/Block.js +112 -0
  92. package/lib/commonjs/primitives/Block.js.map +1 -0
  93. package/lib/commonjs/primitives/Pressable.js +348 -0
  94. package/lib/commonjs/primitives/Pressable.js.map +1 -0
  95. package/lib/commonjs/primitives/PrimitiveInput.js +66 -0
  96. package/lib/commonjs/primitives/PrimitiveInput.js.map +1 -0
  97. package/lib/commonjs/primitives/Separator.js +55 -0
  98. package/lib/commonjs/primitives/Separator.js.map +1 -0
  99. package/lib/commonjs/primitives/Slot.js +78 -0
  100. package/lib/commonjs/primitives/Slot.js.map +1 -0
  101. package/lib/commonjs/primitives/Text.js +73 -0
  102. package/lib/commonjs/primitives/Text.js.map +1 -0
  103. package/lib/commonjs/primitives/pressFeedback.js +53 -0
  104. package/lib/commonjs/primitives/pressFeedback.js.map +1 -0
  105. package/lib/commonjs/primitives/textStyle.js +27 -0
  106. package/lib/commonjs/primitives/textStyle.js.map +1 -0
  107. package/lib/commonjs/primitives/tintSlot.js +45 -0
  108. package/lib/commonjs/primitives/tintSlot.js.map +1 -0
  109. package/lib/commonjs/primitives/touchTarget.js +64 -0
  110. package/lib/commonjs/primitives/touchTarget.js.map +1 -0
  111. package/lib/commonjs/theme/BlendNativeProvider.js +90 -0
  112. package/lib/commonjs/theme/BlendNativeProvider.js.map +1 -0
  113. package/lib/commonjs/theme/breakpoint.js +36 -0
  114. package/lib/commonjs/theme/breakpoint.js.map +1 -0
  115. package/lib/commonjs/theme/fonts.js +58 -0
  116. package/lib/commonjs/theme/fonts.js.map +1 -0
  117. package/lib/commonjs/theme/nativeTokenRegistry.js +44 -0
  118. package/lib/commonjs/theme/nativeTokenRegistry.js.map +1 -0
  119. package/lib/commonjs/theme/systemTheme.js +35 -0
  120. package/lib/commonjs/theme/systemTheme.js.map +1 -0
  121. package/lib/commonjs/theme/useNativeBreakpoint.js +33 -0
  122. package/lib/commonjs/theme/useNativeBreakpoint.js.map +1 -0
  123. package/lib/commonjs/theme/useNativeTokens.js +71 -0
  124. package/lib/commonjs/theme/useNativeTokens.js.map +1 -0
  125. package/lib/module/a11y/announcement.js +38 -0
  126. package/lib/module/a11y/announcement.js.map +1 -0
  127. package/lib/module/a11y/useLiveRegion.js +33 -0
  128. package/lib/module/a11y/useLiveRegion.js.map +1 -0
  129. package/lib/module/adapters/cssStringAdapter.js +352 -0
  130. package/lib/module/adapters/cssStringAdapter.js.map +1 -0
  131. package/lib/module/adapters/optionalGradient.js +29 -0
  132. package/lib/module/adapters/optionalGradient.js.map +1 -0
  133. package/lib/module/adapters/surfaceStyle.js +155 -0
  134. package/lib/module/adapters/surfaceStyle.js.map +1 -0
  135. package/lib/module/components/Alert/Alert.js +126 -0
  136. package/lib/module/components/Alert/Alert.js.map +1 -0
  137. package/lib/module/components/Alert/AlertActions.js +70 -0
  138. package/lib/module/components/Alert/AlertActions.js.map +1 -0
  139. package/lib/module/components/Alert/AlertClose.js +44 -0
  140. package/lib/module/components/Alert/AlertClose.js.map +1 -0
  141. package/lib/module/components/Alert/AlertText.js +45 -0
  142. package/lib/module/components/Alert/AlertText.js.map +1 -0
  143. package/lib/module/components/Alert/alert.tokens.js +4 -0
  144. package/lib/module/components/Alert/alert.tokens.js.map +1 -0
  145. package/lib/module/components/Alert/alert.types.js +4 -0
  146. package/lib/module/components/Alert/alert.types.js.map +1 -0
  147. package/lib/module/components/Alert/alert.utils.js +72 -0
  148. package/lib/module/components/Alert/alert.utils.js.map +1 -0
  149. package/lib/module/components/Alert/index.js +6 -0
  150. package/lib/module/components/Alert/index.js.map +1 -0
  151. package/lib/module/components/Button/Button.js +121 -0
  152. package/lib/module/components/Button/Button.js.map +1 -0
  153. package/lib/module/components/Button/button.types.js +4 -0
  154. package/lib/module/components/Button/button.types.js.map +1 -0
  155. package/lib/module/components/Button/button.utils.js +120 -0
  156. package/lib/module/components/Button/button.utils.js.map +1 -0
  157. package/lib/module/components/Button/index.js +5 -0
  158. package/lib/module/components/Button/index.js.map +1 -0
  159. package/lib/module/components/Skeleton/Skeleton.js +149 -0
  160. package/lib/module/components/Skeleton/Skeleton.js.map +1 -0
  161. package/lib/module/components/Skeleton/index.js +4 -0
  162. package/lib/module/components/Skeleton/index.js.map +1 -0
  163. package/lib/module/components/Skeleton/skeleton.types.js +4 -0
  164. package/lib/module/components/Skeleton/skeleton.types.js.map +1 -0
  165. package/lib/module/components/Skeleton/skeleton.utils.js +40 -0
  166. package/lib/module/components/Skeleton/skeleton.utils.js.map +1 -0
  167. package/lib/module/components/Tag/Tag.js +157 -0
  168. package/lib/module/components/Tag/Tag.js.map +1 -0
  169. package/lib/module/components/Tag/index.js +5 -0
  170. package/lib/module/components/Tag/index.js.map +1 -0
  171. package/lib/module/components/Tag/tag.types.js +4 -0
  172. package/lib/module/components/Tag/tag.types.js.map +1 -0
  173. package/lib/module/components/Tag/tag.utils.js +64 -0
  174. package/lib/module/components/Tag/tag.utils.js.map +1 -0
  175. package/lib/module/components/TextInput/TextInput.js +134 -0
  176. package/lib/module/components/TextInput/TextInput.js.map +1 -0
  177. package/lib/module/components/TextInput/index.js +4 -0
  178. package/lib/module/components/TextInput/index.js.map +1 -0
  179. package/lib/module/components/TextInput/textInput.types.js +4 -0
  180. package/lib/module/components/TextInput/textInput.types.js.map +1 -0
  181. package/lib/module/components/TextInput/textInput.utils.js +36 -0
  182. package/lib/module/components/TextInput/textInput.utils.js.map +1 -0
  183. package/lib/module/components/shared/field/FieldFooter.js +47 -0
  184. package/lib/module/components/shared/field/FieldFooter.js.map +1 -0
  185. package/lib/module/components/shared/field/FieldLabels.js +63 -0
  186. package/lib/module/components/shared/field/FieldLabels.js.map +1 -0
  187. package/lib/module/components/shared/field/fieldState.js +33 -0
  188. package/lib/module/components/shared/field/fieldState.js.map +1 -0
  189. package/lib/module/components/shared/group.js +68 -0
  190. package/lib/module/components/shared/group.js.map +1 -0
  191. package/lib/module/index.js +80 -0
  192. package/lib/module/index.js.map +1 -0
  193. package/lib/module/motion/motion.js +123 -0
  194. package/lib/module/motion/motion.js.map +1 -0
  195. package/lib/module/motion/useReduceMotion.js +33 -0
  196. package/lib/module/motion/useReduceMotion.js.map +1 -0
  197. package/lib/module/overlay/portal.js +104 -0
  198. package/lib/module/overlay/portal.js.map +1 -0
  199. package/lib/module/overlay/positioning.js +118 -0
  200. package/lib/module/overlay/positioning.js.map +1 -0
  201. package/lib/module/overlay/safeAreaInsets.js +27 -0
  202. package/lib/module/overlay/safeAreaInsets.js.map +1 -0
  203. package/lib/module/overlay/sheet/BottomSheet.js +190 -0
  204. package/lib/module/overlay/sheet/BottomSheet.js.map +1 -0
  205. package/lib/module/overlay/sheet/sheetMath.js +53 -0
  206. package/lib/module/overlay/sheet/sheetMath.js.map +1 -0
  207. package/lib/module/overlay/toast/ToastOutlet.js +101 -0
  208. package/lib/module/overlay/toast/ToastOutlet.js.map +1 -0
  209. package/lib/module/overlay/toast/toastStore.js +66 -0
  210. package/lib/module/overlay/toast/toastStore.js.map +1 -0
  211. package/lib/module/overlay/useAnchoredPosition.js +82 -0
  212. package/lib/module/overlay/useAnchoredPosition.js.map +1 -0
  213. package/lib/module/package.json +1 -0
  214. package/lib/module/primitives/Block.js +107 -0
  215. package/lib/module/primitives/Block.js.map +1 -0
  216. package/lib/module/primitives/Pressable.js +339 -0
  217. package/lib/module/primitives/Pressable.js.map +1 -0
  218. package/lib/module/primitives/PrimitiveInput.js +62 -0
  219. package/lib/module/primitives/PrimitiveInput.js.map +1 -0
  220. package/lib/module/primitives/Separator.js +50 -0
  221. package/lib/module/primitives/Separator.js.map +1 -0
  222. package/lib/module/primitives/Slot.js +69 -0
  223. package/lib/module/primitives/Slot.js.map +1 -0
  224. package/lib/module/primitives/Text.js +68 -0
  225. package/lib/module/primitives/Text.js.map +1 -0
  226. package/lib/module/primitives/pressFeedback.js +48 -0
  227. package/lib/module/primitives/pressFeedback.js.map +1 -0
  228. package/lib/module/primitives/textStyle.js +23 -0
  229. package/lib/module/primitives/textStyle.js.map +1 -0
  230. package/lib/module/primitives/tintSlot.js +42 -0
  231. package/lib/module/primitives/tintSlot.js.map +1 -0
  232. package/lib/module/primitives/touchTarget.js +58 -0
  233. package/lib/module/primitives/touchTarget.js.map +1 -0
  234. package/lib/module/theme/BlendNativeProvider.js +78 -0
  235. package/lib/module/theme/BlendNativeProvider.js.map +1 -0
  236. package/lib/module/theme/breakpoint.js +33 -0
  237. package/lib/module/theme/breakpoint.js.map +1 -0
  238. package/lib/module/theme/fonts.js +55 -0
  239. package/lib/module/theme/fonts.js.map +1 -0
  240. package/lib/module/theme/nativeTokenRegistry.js +40 -0
  241. package/lib/module/theme/nativeTokenRegistry.js.map +1 -0
  242. package/lib/module/theme/systemTheme.js +31 -0
  243. package/lib/module/theme/systemTheme.js.map +1 -0
  244. package/lib/module/theme/useNativeBreakpoint.js +24 -0
  245. package/lib/module/theme/useNativeBreakpoint.js.map +1 -0
  246. package/lib/module/theme/useNativeTokens.js +67 -0
  247. package/lib/module/theme/useNativeTokens.js.map +1 -0
  248. package/lib/typescript/commonjs/a11y/announcement.d.ts +26 -0
  249. package/lib/typescript/commonjs/a11y/announcement.d.ts.map +1 -0
  250. package/lib/typescript/commonjs/a11y/useLiveRegion.d.ts +17 -0
  251. package/lib/typescript/commonjs/a11y/useLiveRegion.d.ts.map +1 -0
  252. package/lib/typescript/commonjs/adapters/cssStringAdapter.d.ts +119 -0
  253. package/lib/typescript/commonjs/adapters/cssStringAdapter.d.ts.map +1 -0
  254. package/lib/typescript/commonjs/adapters/optionalGradient.d.ts +32 -0
  255. package/lib/typescript/commonjs/adapters/optionalGradient.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/adapters/surfaceStyle.d.ts +75 -0
  257. package/lib/typescript/commonjs/adapters/surfaceStyle.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/components/Alert/Alert.d.ts +14 -0
  259. package/lib/typescript/commonjs/components/Alert/Alert.d.ts.map +1 -0
  260. package/lib/typescript/commonjs/components/Alert/AlertActions.d.ts +13 -0
  261. package/lib/typescript/commonjs/components/Alert/AlertActions.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/components/Alert/AlertClose.d.ts +22 -0
  263. package/lib/typescript/commonjs/components/Alert/AlertClose.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/components/Alert/AlertText.d.ts +19 -0
  265. package/lib/typescript/commonjs/components/Alert/AlertText.d.ts.map +1 -0
  266. package/lib/typescript/commonjs/components/Alert/alert.tokens.d.ts +17 -0
  267. package/lib/typescript/commonjs/components/Alert/alert.tokens.d.ts.map +1 -0
  268. package/lib/typescript/commonjs/components/Alert/alert.types.d.ts +70 -0
  269. package/lib/typescript/commonjs/components/Alert/alert.types.d.ts.map +1 -0
  270. package/lib/typescript/commonjs/components/Alert/alert.utils.d.ts +58 -0
  271. package/lib/typescript/commonjs/components/Alert/alert.utils.d.ts.map +1 -0
  272. package/lib/typescript/commonjs/components/Alert/index.d.ts +7 -0
  273. package/lib/typescript/commonjs/components/Alert/index.d.ts.map +1 -0
  274. package/lib/typescript/commonjs/components/Button/Button.d.ts +22 -0
  275. package/lib/typescript/commonjs/components/Button/Button.d.ts.map +1 -0
  276. package/lib/typescript/commonjs/components/Button/button.types.d.ts +37 -0
  277. package/lib/typescript/commonjs/components/Button/button.types.d.ts.map +1 -0
  278. package/lib/typescript/commonjs/components/Button/button.utils.d.ts +98 -0
  279. package/lib/typescript/commonjs/components/Button/button.utils.d.ts.map +1 -0
  280. package/lib/typescript/commonjs/components/Button/index.d.ts +5 -0
  281. package/lib/typescript/commonjs/components/Button/index.d.ts.map +1 -0
  282. package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts +7 -0
  283. package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts.map +1 -0
  284. package/lib/typescript/commonjs/components/Skeleton/index.d.ts +3 -0
  285. package/lib/typescript/commonjs/components/Skeleton/index.d.ts.map +1 -0
  286. package/lib/typescript/commonjs/components/Skeleton/skeleton.types.d.ts +25 -0
  287. package/lib/typescript/commonjs/components/Skeleton/skeleton.types.d.ts.map +1 -0
  288. package/lib/typescript/commonjs/components/Skeleton/skeleton.utils.d.ts +21 -0
  289. package/lib/typescript/commonjs/components/Skeleton/skeleton.utils.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/components/Tag/Tag.d.ts +21 -0
  291. package/lib/typescript/commonjs/components/Tag/Tag.d.ts.map +1 -0
  292. package/lib/typescript/commonjs/components/Tag/index.d.ts +4 -0
  293. package/lib/typescript/commonjs/components/Tag/index.d.ts.map +1 -0
  294. package/lib/typescript/commonjs/components/Tag/tag.types.d.ts +56 -0
  295. package/lib/typescript/commonjs/components/Tag/tag.types.d.ts.map +1 -0
  296. package/lib/typescript/commonjs/components/Tag/tag.utils.d.ts +41 -0
  297. package/lib/typescript/commonjs/components/Tag/tag.utils.d.ts.map +1 -0
  298. package/lib/typescript/commonjs/components/TextInput/TextInput.d.ts +33 -0
  299. package/lib/typescript/commonjs/components/TextInput/TextInput.d.ts.map +1 -0
  300. package/lib/typescript/commonjs/components/TextInput/index.d.ts +3 -0
  301. package/lib/typescript/commonjs/components/TextInput/index.d.ts.map +1 -0
  302. package/lib/typescript/commonjs/components/TextInput/textInput.types.d.ts +45 -0
  303. package/lib/typescript/commonjs/components/TextInput/textInput.types.d.ts.map +1 -0
  304. package/lib/typescript/commonjs/components/TextInput/textInput.utils.d.ts +35 -0
  305. package/lib/typescript/commonjs/components/TextInput/textInput.utils.d.ts.map +1 -0
  306. package/lib/typescript/commonjs/components/shared/field/FieldFooter.d.ts +22 -0
  307. package/lib/typescript/commonjs/components/shared/field/FieldFooter.d.ts.map +1 -0
  308. package/lib/typescript/commonjs/components/shared/field/FieldLabels.d.ts +27 -0
  309. package/lib/typescript/commonjs/components/shared/field/FieldLabels.d.ts.map +1 -0
  310. package/lib/typescript/commonjs/components/shared/field/fieldState.d.ts +23 -0
  311. package/lib/typescript/commonjs/components/shared/field/fieldState.d.ts.map +1 -0
  312. package/lib/typescript/commonjs/components/shared/group.d.ts +50 -0
  313. package/lib/typescript/commonjs/components/shared/group.d.ts.map +1 -0
  314. package/lib/typescript/commonjs/index.d.ts +74 -0
  315. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  316. package/lib/typescript/commonjs/motion/motion.d.ts +121 -0
  317. package/lib/typescript/commonjs/motion/motion.d.ts.map +1 -0
  318. package/lib/typescript/commonjs/motion/useReduceMotion.d.ts +14 -0
  319. package/lib/typescript/commonjs/motion/useReduceMotion.d.ts.map +1 -0
  320. package/lib/typescript/commonjs/overlay/portal.d.ts +20 -0
  321. package/lib/typescript/commonjs/overlay/portal.d.ts.map +1 -0
  322. package/lib/typescript/commonjs/overlay/positioning.d.ts +65 -0
  323. package/lib/typescript/commonjs/overlay/positioning.d.ts.map +1 -0
  324. package/lib/typescript/commonjs/overlay/safeAreaInsets.d.ts +19 -0
  325. package/lib/typescript/commonjs/overlay/safeAreaInsets.d.ts.map +1 -0
  326. package/lib/typescript/commonjs/overlay/sheet/BottomSheet.d.ts +56 -0
  327. package/lib/typescript/commonjs/overlay/sheet/BottomSheet.d.ts.map +1 -0
  328. package/lib/typescript/commonjs/overlay/sheet/sheetMath.d.ts +32 -0
  329. package/lib/typescript/commonjs/overlay/sheet/sheetMath.d.ts.map +1 -0
  330. package/lib/typescript/commonjs/overlay/toast/ToastOutlet.d.ts +17 -0
  331. package/lib/typescript/commonjs/overlay/toast/ToastOutlet.d.ts.map +1 -0
  332. package/lib/typescript/commonjs/overlay/toast/toastStore.d.ts +45 -0
  333. package/lib/typescript/commonjs/overlay/toast/toastStore.d.ts.map +1 -0
  334. package/lib/typescript/commonjs/overlay/useAnchoredPosition.d.ts +40 -0
  335. package/lib/typescript/commonjs/overlay/useAnchoredPosition.d.ts.map +1 -0
  336. package/lib/typescript/commonjs/package.json +1 -0
  337. package/lib/typescript/commonjs/primitives/Block.d.ts +37 -0
  338. package/lib/typescript/commonjs/primitives/Block.d.ts.map +1 -0
  339. package/lib/typescript/commonjs/primitives/Pressable.d.ts +135 -0
  340. package/lib/typescript/commonjs/primitives/Pressable.d.ts.map +1 -0
  341. package/lib/typescript/commonjs/primitives/PrimitiveInput.d.ts +42 -0
  342. package/lib/typescript/commonjs/primitives/PrimitiveInput.d.ts.map +1 -0
  343. package/lib/typescript/commonjs/primitives/Separator.d.ts +28 -0
  344. package/lib/typescript/commonjs/primitives/Separator.d.ts.map +1 -0
  345. package/lib/typescript/commonjs/primitives/Slot.d.ts +48 -0
  346. package/lib/typescript/commonjs/primitives/Slot.d.ts.map +1 -0
  347. package/lib/typescript/commonjs/primitives/Text.d.ts +50 -0
  348. package/lib/typescript/commonjs/primitives/Text.d.ts.map +1 -0
  349. package/lib/typescript/commonjs/primitives/pressFeedback.d.ts +39 -0
  350. package/lib/typescript/commonjs/primitives/pressFeedback.d.ts.map +1 -0
  351. package/lib/typescript/commonjs/primitives/textStyle.d.ts +13 -0
  352. package/lib/typescript/commonjs/primitives/textStyle.d.ts.map +1 -0
  353. package/lib/typescript/commonjs/primitives/tintSlot.d.ts +10 -0
  354. package/lib/typescript/commonjs/primitives/tintSlot.d.ts.map +1 -0
  355. package/lib/typescript/commonjs/primitives/touchTarget.d.ts +43 -0
  356. package/lib/typescript/commonjs/primitives/touchTarget.d.ts.map +1 -0
  357. package/lib/typescript/commonjs/theme/BlendNativeProvider.d.ts +69 -0
  358. package/lib/typescript/commonjs/theme/BlendNativeProvider.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/theme/breakpoint.d.ts +27 -0
  360. package/lib/typescript/commonjs/theme/breakpoint.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/theme/fonts.d.ts +34 -0
  362. package/lib/typescript/commonjs/theme/fonts.d.ts.map +1 -0
  363. package/lib/typescript/commonjs/theme/nativeTokenRegistry.d.ts +34 -0
  364. package/lib/typescript/commonjs/theme/nativeTokenRegistry.d.ts.map +1 -0
  365. package/lib/typescript/commonjs/theme/systemTheme.d.ts +25 -0
  366. package/lib/typescript/commonjs/theme/systemTheme.d.ts.map +1 -0
  367. package/lib/typescript/commonjs/theme/useNativeBreakpoint.d.ts +17 -0
  368. package/lib/typescript/commonjs/theme/useNativeBreakpoint.d.ts.map +1 -0
  369. package/lib/typescript/commonjs/theme/useNativeTokens.d.ts +4 -0
  370. package/lib/typescript/commonjs/theme/useNativeTokens.d.ts.map +1 -0
  371. package/lib/typescript/module/a11y/announcement.d.ts +26 -0
  372. package/lib/typescript/module/a11y/announcement.d.ts.map +1 -0
  373. package/lib/typescript/module/a11y/useLiveRegion.d.ts +17 -0
  374. package/lib/typescript/module/a11y/useLiveRegion.d.ts.map +1 -0
  375. package/lib/typescript/module/adapters/cssStringAdapter.d.ts +119 -0
  376. package/lib/typescript/module/adapters/cssStringAdapter.d.ts.map +1 -0
  377. package/lib/typescript/module/adapters/optionalGradient.d.ts +32 -0
  378. package/lib/typescript/module/adapters/optionalGradient.d.ts.map +1 -0
  379. package/lib/typescript/module/adapters/surfaceStyle.d.ts +75 -0
  380. package/lib/typescript/module/adapters/surfaceStyle.d.ts.map +1 -0
  381. package/lib/typescript/module/components/Alert/Alert.d.ts +14 -0
  382. package/lib/typescript/module/components/Alert/Alert.d.ts.map +1 -0
  383. package/lib/typescript/module/components/Alert/AlertActions.d.ts +13 -0
  384. package/lib/typescript/module/components/Alert/AlertActions.d.ts.map +1 -0
  385. package/lib/typescript/module/components/Alert/AlertClose.d.ts +22 -0
  386. package/lib/typescript/module/components/Alert/AlertClose.d.ts.map +1 -0
  387. package/lib/typescript/module/components/Alert/AlertText.d.ts +19 -0
  388. package/lib/typescript/module/components/Alert/AlertText.d.ts.map +1 -0
  389. package/lib/typescript/module/components/Alert/alert.tokens.d.ts +17 -0
  390. package/lib/typescript/module/components/Alert/alert.tokens.d.ts.map +1 -0
  391. package/lib/typescript/module/components/Alert/alert.types.d.ts +70 -0
  392. package/lib/typescript/module/components/Alert/alert.types.d.ts.map +1 -0
  393. package/lib/typescript/module/components/Alert/alert.utils.d.ts +58 -0
  394. package/lib/typescript/module/components/Alert/alert.utils.d.ts.map +1 -0
  395. package/lib/typescript/module/components/Alert/index.d.ts +7 -0
  396. package/lib/typescript/module/components/Alert/index.d.ts.map +1 -0
  397. package/lib/typescript/module/components/Button/Button.d.ts +22 -0
  398. package/lib/typescript/module/components/Button/Button.d.ts.map +1 -0
  399. package/lib/typescript/module/components/Button/button.types.d.ts +37 -0
  400. package/lib/typescript/module/components/Button/button.types.d.ts.map +1 -0
  401. package/lib/typescript/module/components/Button/button.utils.d.ts +98 -0
  402. package/lib/typescript/module/components/Button/button.utils.d.ts.map +1 -0
  403. package/lib/typescript/module/components/Button/index.d.ts +5 -0
  404. package/lib/typescript/module/components/Button/index.d.ts.map +1 -0
  405. package/lib/typescript/module/components/Skeleton/Skeleton.d.ts +7 -0
  406. package/lib/typescript/module/components/Skeleton/Skeleton.d.ts.map +1 -0
  407. package/lib/typescript/module/components/Skeleton/index.d.ts +3 -0
  408. package/lib/typescript/module/components/Skeleton/index.d.ts.map +1 -0
  409. package/lib/typescript/module/components/Skeleton/skeleton.types.d.ts +25 -0
  410. package/lib/typescript/module/components/Skeleton/skeleton.types.d.ts.map +1 -0
  411. package/lib/typescript/module/components/Skeleton/skeleton.utils.d.ts +21 -0
  412. package/lib/typescript/module/components/Skeleton/skeleton.utils.d.ts.map +1 -0
  413. package/lib/typescript/module/components/Tag/Tag.d.ts +21 -0
  414. package/lib/typescript/module/components/Tag/Tag.d.ts.map +1 -0
  415. package/lib/typescript/module/components/Tag/index.d.ts +4 -0
  416. package/lib/typescript/module/components/Tag/index.d.ts.map +1 -0
  417. package/lib/typescript/module/components/Tag/tag.types.d.ts +56 -0
  418. package/lib/typescript/module/components/Tag/tag.types.d.ts.map +1 -0
  419. package/lib/typescript/module/components/Tag/tag.utils.d.ts +41 -0
  420. package/lib/typescript/module/components/Tag/tag.utils.d.ts.map +1 -0
  421. package/lib/typescript/module/components/TextInput/TextInput.d.ts +33 -0
  422. package/lib/typescript/module/components/TextInput/TextInput.d.ts.map +1 -0
  423. package/lib/typescript/module/components/TextInput/index.d.ts +3 -0
  424. package/lib/typescript/module/components/TextInput/index.d.ts.map +1 -0
  425. package/lib/typescript/module/components/TextInput/textInput.types.d.ts +45 -0
  426. package/lib/typescript/module/components/TextInput/textInput.types.d.ts.map +1 -0
  427. package/lib/typescript/module/components/TextInput/textInput.utils.d.ts +35 -0
  428. package/lib/typescript/module/components/TextInput/textInput.utils.d.ts.map +1 -0
  429. package/lib/typescript/module/components/shared/field/FieldFooter.d.ts +22 -0
  430. package/lib/typescript/module/components/shared/field/FieldFooter.d.ts.map +1 -0
  431. package/lib/typescript/module/components/shared/field/FieldLabels.d.ts +27 -0
  432. package/lib/typescript/module/components/shared/field/FieldLabels.d.ts.map +1 -0
  433. package/lib/typescript/module/components/shared/field/fieldState.d.ts +23 -0
  434. package/lib/typescript/module/components/shared/field/fieldState.d.ts.map +1 -0
  435. package/lib/typescript/module/components/shared/group.d.ts +50 -0
  436. package/lib/typescript/module/components/shared/group.d.ts.map +1 -0
  437. package/lib/typescript/module/index.d.ts +74 -0
  438. package/lib/typescript/module/index.d.ts.map +1 -0
  439. package/lib/typescript/module/motion/motion.d.ts +121 -0
  440. package/lib/typescript/module/motion/motion.d.ts.map +1 -0
  441. package/lib/typescript/module/motion/useReduceMotion.d.ts +14 -0
  442. package/lib/typescript/module/motion/useReduceMotion.d.ts.map +1 -0
  443. package/lib/typescript/module/overlay/portal.d.ts +20 -0
  444. package/lib/typescript/module/overlay/portal.d.ts.map +1 -0
  445. package/lib/typescript/module/overlay/positioning.d.ts +65 -0
  446. package/lib/typescript/module/overlay/positioning.d.ts.map +1 -0
  447. package/lib/typescript/module/overlay/safeAreaInsets.d.ts +19 -0
  448. package/lib/typescript/module/overlay/safeAreaInsets.d.ts.map +1 -0
  449. package/lib/typescript/module/overlay/sheet/BottomSheet.d.ts +56 -0
  450. package/lib/typescript/module/overlay/sheet/BottomSheet.d.ts.map +1 -0
  451. package/lib/typescript/module/overlay/sheet/sheetMath.d.ts +32 -0
  452. package/lib/typescript/module/overlay/sheet/sheetMath.d.ts.map +1 -0
  453. package/lib/typescript/module/overlay/toast/ToastOutlet.d.ts +17 -0
  454. package/lib/typescript/module/overlay/toast/ToastOutlet.d.ts.map +1 -0
  455. package/lib/typescript/module/overlay/toast/toastStore.d.ts +45 -0
  456. package/lib/typescript/module/overlay/toast/toastStore.d.ts.map +1 -0
  457. package/lib/typescript/module/overlay/useAnchoredPosition.d.ts +40 -0
  458. package/lib/typescript/module/overlay/useAnchoredPosition.d.ts.map +1 -0
  459. package/lib/typescript/module/package.json +1 -0
  460. package/lib/typescript/module/primitives/Block.d.ts +37 -0
  461. package/lib/typescript/module/primitives/Block.d.ts.map +1 -0
  462. package/lib/typescript/module/primitives/Pressable.d.ts +135 -0
  463. package/lib/typescript/module/primitives/Pressable.d.ts.map +1 -0
  464. package/lib/typescript/module/primitives/PrimitiveInput.d.ts +42 -0
  465. package/lib/typescript/module/primitives/PrimitiveInput.d.ts.map +1 -0
  466. package/lib/typescript/module/primitives/Separator.d.ts +28 -0
  467. package/lib/typescript/module/primitives/Separator.d.ts.map +1 -0
  468. package/lib/typescript/module/primitives/Slot.d.ts +48 -0
  469. package/lib/typescript/module/primitives/Slot.d.ts.map +1 -0
  470. package/lib/typescript/module/primitives/Text.d.ts +50 -0
  471. package/lib/typescript/module/primitives/Text.d.ts.map +1 -0
  472. package/lib/typescript/module/primitives/pressFeedback.d.ts +39 -0
  473. package/lib/typescript/module/primitives/pressFeedback.d.ts.map +1 -0
  474. package/lib/typescript/module/primitives/textStyle.d.ts +13 -0
  475. package/lib/typescript/module/primitives/textStyle.d.ts.map +1 -0
  476. package/lib/typescript/module/primitives/tintSlot.d.ts +10 -0
  477. package/lib/typescript/module/primitives/tintSlot.d.ts.map +1 -0
  478. package/lib/typescript/module/primitives/touchTarget.d.ts +43 -0
  479. package/lib/typescript/module/primitives/touchTarget.d.ts.map +1 -0
  480. package/lib/typescript/module/theme/BlendNativeProvider.d.ts +69 -0
  481. package/lib/typescript/module/theme/BlendNativeProvider.d.ts.map +1 -0
  482. package/lib/typescript/module/theme/breakpoint.d.ts +27 -0
  483. package/lib/typescript/module/theme/breakpoint.d.ts.map +1 -0
  484. package/lib/typescript/module/theme/fonts.d.ts +34 -0
  485. package/lib/typescript/module/theme/fonts.d.ts.map +1 -0
  486. package/lib/typescript/module/theme/nativeTokenRegistry.d.ts +34 -0
  487. package/lib/typescript/module/theme/nativeTokenRegistry.d.ts.map +1 -0
  488. package/lib/typescript/module/theme/systemTheme.d.ts +25 -0
  489. package/lib/typescript/module/theme/systemTheme.d.ts.map +1 -0
  490. package/lib/typescript/module/theme/useNativeBreakpoint.d.ts +17 -0
  491. package/lib/typescript/module/theme/useNativeBreakpoint.d.ts.map +1 -0
  492. package/lib/typescript/module/theme/useNativeTokens.d.ts +4 -0
  493. package/lib/typescript/module/theme/useNativeTokens.d.ts.map +1 -0
  494. package/package.json +137 -0
  495. package/src/a11y/announcement.ts +41 -0
  496. package/src/a11y/useLiveRegion.ts +36 -0
  497. package/src/adapters/cssStringAdapter.ts +403 -0
  498. package/src/adapters/optionalGradient.ts +39 -0
  499. package/src/adapters/surfaceStyle.ts +209 -0
  500. package/src/components/Alert/Alert.tsx +167 -0
  501. package/src/components/Alert/AlertActions.tsx +98 -0
  502. package/src/components/Alert/AlertClose.tsx +53 -0
  503. package/src/components/Alert/AlertText.tsx +58 -0
  504. package/src/components/Alert/alert.tokens.ts +24 -0
  505. package/src/components/Alert/alert.types.ts +81 -0
  506. package/src/components/Alert/alert.utils.ts +94 -0
  507. package/src/components/Alert/index.ts +21 -0
  508. package/src/components/Button/Button.tsx +180 -0
  509. package/src/components/Button/button.types.ts +44 -0
  510. package/src/components/Button/button.utils.ts +213 -0
  511. package/src/components/Button/index.ts +12 -0
  512. package/src/components/Skeleton/Skeleton.tsx +196 -0
  513. package/src/components/Skeleton/index.ts +2 -0
  514. package/src/components/Skeleton/skeleton.types.ts +28 -0
  515. package/src/components/Skeleton/skeleton.utils.ts +56 -0
  516. package/src/components/Tag/Tag.tsx +204 -0
  517. package/src/components/Tag/index.ts +7 -0
  518. package/src/components/Tag/tag.types.ts +63 -0
  519. package/src/components/Tag/tag.utils.ts +82 -0
  520. package/src/components/TextInput/TextInput.tsx +165 -0
  521. package/src/components/TextInput/index.ts +2 -0
  522. package/src/components/TextInput/textInput.types.ts +54 -0
  523. package/src/components/TextInput/textInput.utils.ts +68 -0
  524. package/src/components/shared/field/FieldFooter.tsx +66 -0
  525. package/src/components/shared/field/FieldLabels.tsx +86 -0
  526. package/src/components/shared/field/fieldState.ts +39 -0
  527. package/src/components/shared/group.ts +72 -0
  528. package/src/index.ts +144 -0
  529. package/src/motion/motion.ts +115 -0
  530. package/src/motion/useReduceMotion.ts +36 -0
  531. package/src/overlay/portal.tsx +122 -0
  532. package/src/overlay/positioning.ts +196 -0
  533. package/src/overlay/safeAreaInsets.ts +36 -0
  534. package/src/overlay/sheet/BottomSheet.tsx +276 -0
  535. package/src/overlay/sheet/sheetMath.ts +58 -0
  536. package/src/overlay/toast/ToastOutlet.tsx +127 -0
  537. package/src/overlay/toast/toastStore.ts +96 -0
  538. package/src/overlay/useAnchoredPosition.ts +92 -0
  539. package/src/primitives/Block.tsx +129 -0
  540. package/src/primitives/Pressable.tsx +528 -0
  541. package/src/primitives/PrimitiveInput.tsx +87 -0
  542. package/src/primitives/Separator.tsx +65 -0
  543. package/src/primitives/Slot.tsx +94 -0
  544. package/src/primitives/Text.tsx +98 -0
  545. package/src/primitives/pressFeedback.ts +78 -0
  546. package/src/primitives/textStyle.ts +24 -0
  547. package/src/primitives/tintSlot.ts +44 -0
  548. package/src/primitives/touchTarget.ts +72 -0
  549. package/src/theme/BlendNativeProvider.tsx +147 -0
  550. package/src/theme/breakpoint.ts +38 -0
  551. package/src/theme/fonts.ts +63 -0
  552. package/src/theme/nativeTokenRegistry.ts +57 -0
  553. package/src/theme/systemTheme.ts +34 -0
  554. package/src/theme/useNativeBreakpoint.ts +27 -0
  555. package/src/theme/useNativeTokens.ts +99 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["opposite","top","bottom","left","right","spaceOn","side","anchor","viewport","offset","padding","y","height","x","width","clamp","value","min","max","Math","computeAnchoredPosition","input","content","placement","preferred","alignment","viewportPadding","preferredSpace","isVertical","needed","other","alignAlong","anchorStart","anchorLength","contentLength","available","maxHeight","maxWidth"],"sourceRoot":"../../../src","sources":["overlay/positioning.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;;AAGA;;AAgCA,MAAMA,QAAsC,GAAG;EAC3CC,GAAG,EAAE,QAAQ;EACbC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE;AACX,CAAC;;AAED;AACA,SAASC,OAAOA,CACZC,IAAe,EACfC,MAAY,EACZC,QAAc,EACdC,MAAc,EACdC,OAAe,EACT;EACN,QAAQJ,IAAI;IACR,KAAK,KAAK;MACN,OAAOC,MAAM,CAACI,CAAC,GAAGF,MAAM,GAAGC,OAAO;IACtC,KAAK,QAAQ;MACT,OACIF,QAAQ,CAACI,MAAM,IAAIL,MAAM,CAACI,CAAC,GAAGJ,MAAM,CAACK,MAAM,CAAC,GAAGH,MAAM,GAAGC,OAAO;IAEvE,KAAK,MAAM;MACP,OAAOH,MAAM,CAACM,CAAC,GAAGJ,MAAM,GAAGC,OAAO;IACtC,KAAK,OAAO;MACR,OAAOF,QAAQ,CAACM,KAAK,IAAIP,MAAM,CAACM,CAAC,GAAGN,MAAM,CAACO,KAAK,CAAC,GAAGL,MAAM,GAAGC,OAAO;EAC5E;AACJ;AAEA,MAAMK,KAAK,GAAGA,CAACC,KAAa,EAAEC,GAAW,EAAEC,GAAW;AAClD;AACA;AACAC,IAAI,CAACD,GAAG,CAACD,GAAG,EAAEE,IAAI,CAACF,GAAG,CAACD,KAAK,EAAEG,IAAI,CAACD,GAAG,CAACD,GAAG,EAAEC,GAAG,CAAC,CAAC,CAAC;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,uBAAuBA,CACnCC,KAA4B,EACZ;EAChB,MAAM;IACFd,MAAM;IACNe,OAAO;IACPd,QAAQ;IACRe,SAAS,EAAEC,SAAS,GAAG,QAAQ;IAC/BC,SAAS,GAA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V,QAAQ,CAACM,KAAK,GAAG,CAAC,GAAGY,eAAe,CAAC;EAE3D,OAAO;IAAEb,CAAC;IAAEF,CAAC;IAAEY,SAAS;IAAEa,SAAS;IAAEC;EAAS,CAAC;AACnD","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SafeAreaInsetsContext = void 0;
7
+ var _react = require("react");
8
+ /**
9
+ * Optional `react-native-safe-area-context` integration, shared by every
10
+ * overlay that must respect the home indicator or notch (BottomSheet, the
11
+ * toast outlet).
12
+ *
13
+ * `useContext` needs *a* context unconditionally, so when the optional peer
14
+ * is absent — or its provider is not mounted — a null-valued fallback
15
+ * stands in and insets resolve to zero. Same probe pattern as
16
+ * expo-linear-gradient.
17
+ */
18
+
19
+ const FallbackInsetsContext = /*#__PURE__*/(0, _react.createContext)(null);
20
+ let SafeAreaInsetsContext = exports.SafeAreaInsetsContext = FallbackInsetsContext;
21
+ try {
22
+ if (typeof require === 'function') {
23
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
24
+ const safeArea = require('react-native-safe-area-context');
25
+ exports.SafeAreaInsetsContext = SafeAreaInsetsContext = safeArea.SafeAreaInsetsContext ?? FallbackInsetsContext;
26
+ }
27
+ } catch {
28
+ exports.SafeAreaInsetsContext = SafeAreaInsetsContext = FallbackInsetsContext;
29
+ }
30
+ //# sourceMappingURL=safeAreaInsets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","FallbackInsetsContext","createContext","SafeAreaInsetsContext","exports","safeArea"],"sourceRoot":"../../../src","sources":["overlay/safeAreaInsets.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,MAAMC,qBAAqB,gBAAG,IAAAC,oBAAa,EAAoB,IAAI,CAAC;AAE7D,IAAIC,qBAAuD,GAAAC,OAAA,CAAAD,qBAAA,GAC9DF,qBAAqB;AACzB,IAAI;EACA,IAAI,OAAOD,OAAO,KAAK,UAAU,EAAE;IAC/B;IACA,MAAMK,QAAQ,GAAGL,OAAO,CAAC,gCAAgC,CAExD;IACDI,OAAA,CAAAD,qBAAA,GAAAA,qBAAqB,GACjBE,QAAQ,CAACF,qBAAqB,IAAIF,qBAAqB;EAC/D;AACJ,CAAC,CAAC,MAAM;EACJG,OAAA,CAAAD,qBAAA,GAAAA,qBAAqB,GAAGF,qBAAqB;AACjD","ignoreList":[]}
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BottomSheet = BottomSheet;
7
+ exports.default = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _reactNative = require("react-native");
10
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
11
+ var _reactNativeGestureHandler = require("react-native-gesture-handler");
12
+ var _portal = require("../portal.js");
13
+ var _safeAreaInsets = require("../safeAreaInsets.js");
14
+ var _motion = require("../../motion/motion.js");
15
+ var _useReduceMotion = require("../../motion/useReduceMotion.js");
16
+ var _sheetMath = require("./sheetMath.js");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
+ /**
20
+ * BottomSheet — the gesture-driven sheet foundation.
21
+ *
22
+ * The native replacement for `vaul` and the phone presentation web already
23
+ * prescribes in its Mobile* variants (mobileModalV2, MobileSingleSelectV2,
24
+ * MobilePopoverV2): DrawerV2 and the phone modes of Select/Menu/Modal
25
+ * compose this primitive and pass their token values in — the sheet itself
26
+ * carries structure and physics, not design decisions, which is why its
27
+ * colour props have plain defaults instead of token lookups.
28
+ *
29
+ * Controlled: `open` drives it; every dismiss route (drag, backdrop, the
30
+ * Android back button) calls `onClose` and the owner flips `open` — the
31
+ * exit animation runs, then the sheet unmounts from the portal layer.
32
+ *
33
+ * Requirements: `react-native-reanimated` and `react-native-gesture-handler`
34
+ * (required peers), and a `GestureHandlerRootView` at the app root — apps
35
+ * using react-navigation already have one. `react-native-safe-area-context`
36
+ * is optional: with it (and its provider) mounted, the sheet pads itself
37
+ * past the home indicator; without it the bottom inset is 0.
38
+ *
39
+ * Reduce-motion: the slide collapses to a fade (`useReduceMotion`).
40
+ */
41
+
42
+ const ENTER = {
43
+ duration: _motion.MOTION_DURATION.slow,
44
+ easing: _reactNativeReanimated.Easing.bezier(..._motion.MOTION_EASING.decelerate)
45
+ };
46
+ const EXIT = {
47
+ duration: _motion.MOTION_DURATION.normal,
48
+ easing: _reactNativeReanimated.Easing.bezier(..._motion.MOTION_EASING.accelerate)
49
+ };
50
+ function BottomSheet({
51
+ open,
52
+ onClose,
53
+ children,
54
+ maxHeightFraction = _sheetMath.SHEET_MAX_HEIGHT_FRACTION,
55
+ backdropColor = 'rgba(0, 0, 0, 0.5)',
56
+ backgroundColor = '#FFFFFF',
57
+ topRadius = 16,
58
+ showHandle = true,
59
+ handleColor = 'rgba(0, 0, 0, 0.2)',
60
+ dragToDismiss = true,
61
+ dismissOnBackdropPress = true,
62
+ accessibilityLabel,
63
+ testID,
64
+ style
65
+ }) {
66
+ // Mounted outlives `open` by one exit animation.
67
+ const [mounted, setMounted] = (0, _react.useState)(open);
68
+ const progress = (0, _reactNativeReanimated.useSharedValue)(0);
69
+ const dragY = (0, _reactNativeReanimated.useSharedValue)(0);
70
+ const sheetHeight = (0, _reactNativeReanimated.useSharedValue)(0);
71
+ const window = (0, _reactNative.useWindowDimensions)();
72
+ const insets = (0, _react.useContext)(_safeAreaInsets.SafeAreaInsetsContext);
73
+ const reduceMotion = (0, _useReduceMotion.useReduceMotion)();
74
+ const unmount = (0, _react.useCallback)(() => setMounted(false), []);
75
+ (0, _react.useEffect)(() => {
76
+ if (open) {
77
+ setMounted(true);
78
+ progress.value = (0, _reactNativeReanimated.withTiming)(1, ENTER);
79
+ } else {
80
+ // Drag offset folds into the exit so a gesture-dismissed sheet
81
+ // continues downward from wherever the finger left it.
82
+ dragY.value = (0, _reactNativeReanimated.withTiming)(0, EXIT);
83
+ progress.value = (0, _reactNativeReanimated.withTiming)(0, EXIT, finished => {
84
+ if (finished) (0, _reactNativeReanimated.runOnJS)(unmount)();
85
+ });
86
+ }
87
+ }, [open, progress, dragY, unmount]);
88
+
89
+ // Android hardware back closes the sheet instead of the screen.
90
+ (0, _react.useEffect)(() => {
91
+ if (!open) return;
92
+ const subscription = _reactNative.BackHandler.addEventListener('hardwareBackPress', () => {
93
+ onClose();
94
+ return true;
95
+ });
96
+ return () => subscription.remove();
97
+ }, [open, onClose]);
98
+ const onSheetLayout = (0, _react.useCallback)(event => {
99
+ sheetHeight.value = event.nativeEvent.layout.height;
100
+ }, [sheetHeight]);
101
+ const pan = _reactNativeGestureHandler.Gesture.Pan().enabled(dragToDismiss).onChange(event => {
102
+ dragY.value = (0, _sheetMath.clampSheetDrag)(event.translationY);
103
+ }).onEnd(event => {
104
+ if ((0, _sheetMath.shouldDismissSheet)(event.translationY, event.velocityY, sheetHeight.value)) {
105
+ (0, _reactNativeReanimated.runOnJS)(onClose)();
106
+ } else {
107
+ dragY.value = (0, _reactNativeReanimated.withSpring)(0, {
108
+ damping: 22,
109
+ stiffness: 320
110
+ });
111
+ }
112
+ });
113
+ const windowHeight = window.height;
114
+ const sheetStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
115
+ if (reduceMotion) {
116
+ return {
117
+ opacity: progress.value,
118
+ transform: [{
119
+ translateY: dragY.value
120
+ }]
121
+ };
122
+ }
123
+ // Until the first layout lands, the full window height keeps the
124
+ // sheet parked off-screen instead of flashing in place.
125
+ const height = sheetHeight.value || windowHeight;
126
+ return {
127
+ opacity: 1,
128
+ transform: [{
129
+ translateY: (1 - progress.value) * height + dragY.value
130
+ }]
131
+ };
132
+ }, [reduceMotion, windowHeight]);
133
+ const backdropStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
134
+ opacity: progress.value
135
+ }));
136
+ if (!mounted) return null;
137
+ const maxHeight = (0, _sheetMath.resolveSheetMaxHeight)(windowHeight, insets?.top ?? 0, maxHeightFraction);
138
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_portal.Portal, {
139
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
140
+ style: [_reactNative.StyleSheet.absoluteFill, {
141
+ backgroundColor: backdropColor
142
+ }, backdropStyle],
143
+ testID: testID ? `${testID}-backdrop` : undefined
144
+ // The sheet is the modal surface; VoiceOver skips the
145
+ // backdrop (it could not reach it past
146
+ // accessibilityViewIsModal anyway).
147
+ ,
148
+ accessible: false,
149
+ importantForAccessibility: "no-hide-descendants",
150
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
151
+ style: _reactNative.StyleSheet.absoluteFill,
152
+ onPress: dismissOnBackdropPress ? onClose : undefined
153
+ })
154
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.GestureDetector, {
155
+ gesture: pan,
156
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
157
+ onLayout: onSheetLayout,
158
+ accessibilityViewIsModal: true,
159
+ accessibilityLabel: accessibilityLabel,
160
+ testID: testID,
161
+ style: [styles.sheet, {
162
+ maxHeight,
163
+ backgroundColor,
164
+ borderTopLeftRadius: topRadius,
165
+ borderTopRightRadius: topRadius,
166
+ paddingBottom: insets?.bottom ?? 0
167
+ }, sheetStyle, style],
168
+ children: [showHandle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
169
+ style: [styles.handle, {
170
+ backgroundColor: handleColor
171
+ }]
172
+ }) : null, children]
173
+ })
174
+ })]
175
+ });
176
+ }
177
+ BottomSheet.displayName = 'BottomSheet';
178
+ const styles = _reactNative.StyleSheet.create({
179
+ sheet: {
180
+ position: 'absolute',
181
+ left: 0,
182
+ right: 0,
183
+ bottom: 0,
184
+ overflow: 'hidden'
185
+ },
186
+ handle: {
187
+ alignSelf: 'center',
188
+ width: 36,
189
+ height: 4,
190
+ borderRadius: 2,
191
+ marginTop: 8,
192
+ marginBottom: 4
193
+ }
194
+ });
195
+ var _default = exports.default = BottomSheet;
196
+ //# sourceMappingURL=BottomSheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_reactNativeGestureHandler","_portal","_safeAreaInsets","_motion","_useReduceMotion","_sheetMath","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ENTER","duration","MOTION_DURATION","slow","easing","Easing","bezier","MOTION_EASING","decelerate","EXIT","normal","accelerate","BottomSheet","open","onClose","children","maxHeightFraction","SHEET_MAX_HEIGHT_FRACTION","backdropColor","backgroundColor","topRadius","showHandle","handleColor","dragToDismiss","dismissOnBackdropPress","accessibilityLabel","testID","style","mounted","setMounted","useState","progress","useSharedValue","dragY","sheetHeight","window","useWindowDimensions","insets","useContext","SafeAreaInsetsContext","reduceMotion","useReduceMotion","unmount","useCallback","useEffect","value","withTiming","finished","runOnJS","subscription","BackHandler","addEventListener","remove","onSheetLayout","event","nativeEvent","layout","height","pan","Gesture","Pan","enabled","onChange","clampSheetDrag","translationY","onEnd","shouldDismissSheet","velocityY","withSpring","damping","stiffness","windowHeight","sheetStyle","useAnimatedStyle","opacity","transform","translateY","backdropStyle","maxHeight","resolveSheetMaxHeight","top","jsxs","Portal","jsx","View","StyleSheet","absoluteFill","undefined","accessible","importantForAccessibility","Pressable","onPress","GestureDetector","gesture","onLayout","accessibilityViewIsModal","styles","sheet","borderTopLeftRadius","borderTopRightRadius","paddingBottom","bottom","handle","displayName","create","position","left","right","overflow","alignSelf","width","borderRadius","marginTop","marginBottom","_default","exports"],"sourceRoot":"../../../../src","sources":["overlay/sheet/BottomSheet.tsx"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAQA,IAAAG,0BAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAKoB,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAD,wBAAAW,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAW,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CA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QACxB0C,wBAAwB;QACxBtE,kBAAkB,EAAEA,kBAAmB;QACvCC,MAAM,EAAEA,MAAO;QACfC,KAAK,EAAE,CACHqE,MAAM,CAACC,KAAK,EACZ;UACInB,SAAS;UACT3D,eAAe;UACf+E,mBAAmB,EAAE9E,SAAS;UAC9B+E,oBAAoB,EAAE/E,SAAS;UAC/BgF,aAAa,EAAE/D,MAAM,EAAEgE,MAAM,IAAI;QACrC,CAAC,EACD7B,UAAU,EACV7C,KAAK,CACP;QAAAZ,QAAA,GAEDM,UAAU,gBACP,IAAAzC,WAAA,CAAAuG,GAAA,EAAC/G,YAAA,CAAAgH,IAAI;UACDzD,KAAK,EAAE,CACHqE,MAAM,CAACM,MAAM,EACb;YAAEnF,eAAe,EAAEG;UAAY,CAAC;QAClC,CACL,CAAC,GACF,IAAI,EACPP,QAAQ;MAAA,CACE;IAAC,CACH,CAAC;EAAA,CACd,CAAC;AAEjB;AAEAH,WAAW,CAAC2F,WAAW,GAAG,aAAa;AAEvC,MAAMP,MAAM,GAAGX,uBAAU,CAACmB,MAAM,CAAC;EAC7BP,KAAK,EAAE;IACHQ,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRN,MAAM,EAAE,CAAC;IACTO,QAAQ,EAAE;EACd,CAAC;EACDN,MAAM,EAAE;IACJO,SAAS,EAAE,QAAQ;IACnBC,KAAK,EAAE,EAAE;IACTrD,MAAM,EAAE,CAAC;IACTsD,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE,CAAC;IACZC,YAAY,EAAE;EAClB;AACJ,CAAC,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAA5H,OAAA,GAEaqB,WAAW","ignoreList":[]}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SHEET_MAX_HEIGHT_FRACTION = exports.SHEET_DISMISS_VELOCITY = exports.SHEET_DISMISS_FRACTION = void 0;
7
+ exports.clampSheetDrag = clampSheetDrag;
8
+ exports.resolveSheetMaxHeight = resolveSheetMaxHeight;
9
+ exports.shouldDismissSheet = shouldDismissSheet;
10
+ /**
11
+ * Bottom-sheet gesture arithmetic.
12
+ *
13
+ * Pure and RN-free (the `theme/breakpoint.ts` pattern) so the dismiss
14
+ * decision — the part of a sheet that feels wrong when it is wrong — is
15
+ * unit-testable under vitest. `BottomSheet` wires these into the pan
16
+ * gesture; they also run as Reanimated worklets, so nothing here may close
17
+ * over module state.
18
+ */
19
+
20
+ /** Dragging past this fraction of the sheet's height dismisses on release. */
21
+ const SHEET_DISMISS_FRACTION = exports.SHEET_DISMISS_FRACTION = 0.25;
22
+
23
+ /** A downward fling at or above this velocity (pt/s) dismisses regardless. */
24
+ const SHEET_DISMISS_VELOCITY = exports.SHEET_DISMISS_VELOCITY = 800;
25
+
26
+ /** Default cap: a sheet covers at most this fraction of the window. */
27
+ const SHEET_MAX_HEIGHT_FRACTION = exports.SHEET_MAX_HEIGHT_FRACTION = 0.9;
28
+
29
+ /**
30
+ * The sheet follows the finger downward only — upward drag is pinned so the
31
+ * sheet feels anchored rather than lifting off its resting position.
32
+ */
33
+ function clampSheetDrag(translationY) {
34
+ 'worklet';
35
+
36
+ return Math.max(0, translationY);
37
+ }
38
+
39
+ /**
40
+ * Whether a released drag should dismiss the sheet: past the distance
41
+ * threshold, or a genuine downward fling. An upward fling never dismisses,
42
+ * whatever distance was covered first.
43
+ */
44
+ function shouldDismissSheet(translationY, velocityY, sheetHeight) {
45
+ 'worklet';
46
+
47
+ if (velocityY <= -SHEET_DISMISS_VELOCITY) return false;
48
+ if (velocityY >= SHEET_DISMISS_VELOCITY) return translationY > 0;
49
+ return sheetHeight > 0 && translationY >= sheetHeight * SHEET_DISMISS_FRACTION;
50
+ }
51
+
52
+ /**
53
+ * The tallest a sheet may grow: the capped fraction of the window, minus
54
+ * whatever top inset (status bar / notch) must stay visible above it.
55
+ */
56
+ function resolveSheetMaxHeight(windowHeight, topInset = 0, maxHeightFraction = SHEET_MAX_HEIGHT_FRACTION) {
57
+ const capped = windowHeight * maxHeightFraction;
58
+ return Math.max(0, Math.min(capped, windowHeight - topInset));
59
+ }
60
+ //# sourceMappingURL=sheetMath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SHEET_DISMISS_FRACTION","exports","SHEET_DISMISS_VELOCITY","SHEET_MAX_HEIGHT_FRACTION","clampSheetDrag","translationY","Math","max","shouldDismissSheet","velocityY","sheetHeight","resolveSheetMaxHeight","windowHeight","topInset","maxHeightFraction","capped","min"],"sourceRoot":"../../../../src","sources":["overlay/sheet/sheetMath.ts"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,MAAMA,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,IAAI;;AAE1C;AACO,MAAME,sBAAsB,GAAAD,OAAA,CAAAC,sBAAA,GAAG,GAAG;;AAEzC;AACO,MAAMC,yBAAyB,GAAAF,OAAA,CAAAE,yBAAA,GAAG,GAAG;;AAE5C;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAACC,YAAoB,EAAU;EACzD,SAAS;;EACT,OAAOC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEF,YAAY,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASG,kBAAkBA,CAC9BH,YAAoB,EACpBI,SAAiB,EACjBC,WAAmB,EACZ;EACP,SAAS;;EACT,IAAID,SAAS,IAAI,CAACP,sBAAsB,EAAE,OAAO,KAAK;EACtD,IAAIO,SAAS,IAAIP,sBAAsB,EAAE,OAAOG,YAAY,GAAG,CAAC;EAChE,OACIK,WAAW,GAAG,CAAC,IAAIL,YAAY,IAAIK,WAAW,GAAGV,sBAAsB;AAE/E;;AAEA;AACA;AACA;AACA;AACO,SAASW,qBAAqBA,CACjCC,YAAoB,EACpBC,QAAgB,GAAG,CAAC,EACpBC,iBAAyB,GAAGX,yBAAyB,EAC/C;EACN,MAAMY,MAAM,GAAGH,YAAY,GAAGE,iBAAiB;EAC/C,OAAOR,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACU,GAAG,CAACD,MAAM,EAAEH,YAAY,GAAGC,QAAQ,CAAC,CAAC;AACjE","ignoreList":[]}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TOAST_EXIT_DURATION = void 0;
7
+ exports.ToastOutlet = ToastOutlet;
8
+ var _react = require("react");
9
+ var _reactNative = require("react-native");
10
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
11
+ var _portal = require("../portal.js");
12
+ var _safeAreaInsets = require("../safeAreaInsets.js");
13
+ var _motion = require("../../motion/motion.js");
14
+ var _useReduceMotion = require("../../motion/useReduceMotion.js");
15
+ var _useLiveRegion = require("../../a11y/useLiveRegion.js");
16
+ var _toastStore = require("./toastStore.js");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
+ /**
20
+ * The toast rendering surface, mounted once by `BlendNativeProvider`.
21
+ *
22
+ * Subscribes to the store and renders the newest `MAX_VISIBLE_TOASTS`
23
+ * bottom-stacked above everything through a `Portal`. Each toast slides up
24
+ * on entry (a fade under reduce-motion), owns its auto-dismiss timer, and
25
+ * announces itself to assistive tech when asked.
26
+ */
27
+ function ToastOutlet() {
28
+ const toasts = (0, _react.useSyncExternalStore)(_toastStore.subscribeToasts, _toastStore.getToasts, _toastStore.getToasts);
29
+ const insets = (0, _react.useContext)(_safeAreaInsets.SafeAreaInsetsContext);
30
+ const visible = (0, _toastStore.getVisibleToasts)(toasts);
31
+ if (visible.length === 0) return null;
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_portal.Portal, {
33
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
34
+ style: [styles.stack, {
35
+ paddingBottom: (insets?.bottom ?? 0) + 16
36
+ }],
37
+ pointerEvents: "box-none",
38
+ testID: "blend-toast-outlet",
39
+ children: visible.map(toast => /*#__PURE__*/(0, _jsxRuntime.jsx)(ToastItem, {
40
+ toast: toast
41
+ }, toast.id))
42
+ })
43
+ });
44
+ }
45
+ ToastOutlet.displayName = 'ToastOutlet';
46
+ function ToastItem({
47
+ toast
48
+ }) {
49
+ const reduceMotion = (0, _useReduceMotion.useReduceMotion)();
50
+ const progress = (0, _reactNativeReanimated.useSharedValue)(0);
51
+ const dismiss = (0, _react.useCallback)(() => (0, _toastStore.dismissToast)(toast.id), [toast.id]);
52
+
53
+ // Enter animation once per toast id.
54
+ (0, _react.useEffect)(() => {
55
+ progress.value = (0, _reactNativeReanimated.withTiming)(1, {
56
+ duration: _motion.MOTION_PRESETS.slideUp.duration,
57
+ easing: _reactNativeReanimated.Easing.bezier(..._motion.MOTION_EASING.decelerate)
58
+ });
59
+ }, [progress]);
60
+
61
+ // Auto-dismiss owns its timer; content replacement (same id) restarts it.
62
+ (0, _react.useEffect)(() => {
63
+ if (toast.duration === null) return;
64
+ const timer = setTimeout(dismiss, toast.duration);
65
+ return () => clearTimeout(timer);
66
+ }, [toast.id, toast.duration, toast.content, dismiss]);
67
+ (0, _useLiveRegion.useLiveRegionAnnounce)(toast.announcement, Boolean(toast.announcement));
68
+ const animatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
69
+ if (reduceMotion) {
70
+ return {
71
+ opacity: progress.value,
72
+ transform: [{
73
+ translateY: 0
74
+ }]
75
+ };
76
+ }
77
+ return {
78
+ opacity: progress.value,
79
+ transform: [{
80
+ translateY: (1 - progress.value) * (_motion.MOTION_PRESETS.slideUp.from.translateY ?? 16)
81
+ }]
82
+ };
83
+ }, [reduceMotion]);
84
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
85
+ style: animatedStyle,
86
+ accessibilityLiveRegion: toast.announcement ? 'polite' : 'none',
87
+ children: typeof toast.content === 'function' ? toast.content(dismiss) : toast.content
88
+ });
89
+ }
90
+
91
+ /** Exit duration is not modelled yet — dismissal unmounts immediately;
92
+ * SnackbarV2 will own richer exit choreography when it lands. Kept simple
93
+ * so the host stays predictable under the synchronous test mock. */
94
+ const TOAST_EXIT_DURATION = exports.TOAST_EXIT_DURATION = _motion.MOTION_DURATION.fast;
95
+ const styles = _reactNative.StyleSheet.create({
96
+ stack: {
97
+ position: 'absolute',
98
+ left: 0,
99
+ right: 0,
100
+ bottom: 0,
101
+ alignItems: 'center',
102
+ gap: 8,
103
+ paddingHorizontal: 16
104
+ }
105
+ });
106
+ //# sourceMappingURL=ToastOutlet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_interopRequireWildcard","_portal","_safeAreaInsets","_motion","_useReduceMotion","_useLiveRegion","_toastStore","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ToastOutlet","toasts","useSyncExternalStore","subscribeToasts","getToasts","insets","useContext","SafeAreaInsetsContext","visible","getVisibleToasts","length","jsx","Portal","children","View","style","styles","stack","paddingBottom","bottom","pointerEvents","testID","map","toast","ToastItem","id","displayName","reduceMotion","useReduceMotion","progress","useSharedValue","dismiss","useCallback","dismissToast","useEffect","value","withTiming","duration","MOTION_PRESETS","slideUp","easing","Easing","bezier","MOTION_EASING","decelerate","timer","setTimeout","clearTimeout","content","useLiveRegionAnnounce","announcement","Boolean","animatedStyle","useAnimatedStyle","opacity","transform","translateY","from","accessibilityLiveRegion","TOAST_EXIT_DURATION","exports","MOTION_DURATION","fast","StyleSheet","create","position","left","right","alignItems","gap","paddingHorizontal"],"sourceRoot":"../../../../src","sources":["overlay/toast/ToastOutlet.tsx"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAC,uBAAA,CAAAH,OAAA;AAMA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAMqB,IAAAU,WAAA,GAAAV,OAAA;AAAA,SAAAG,wBAAAQ,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAQ,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAA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EAAEzB,QAAQ,CAACM,KAAK;MACvBoB,SAAS,EAAE,CACP;QACIC,UAAU,EACN,CAAC,CAAC,GAAG3B,QAAQ,CAACM,KAAK,KAClBG,sBAAc,CAACC,OAAO,CAACkB,IAAI,CAACD,UAAU,IAAI,EAAE;MACrD,CAAC;IAET,CAAC;EACL,CAAC,EAAE,CAAC7B,YAAY,CAAC,CAAC;EAElB,oBACI,IAAA/C,WAAA,CAAA+B,GAAA,EAACvC,sBAAA,CAAAmB,OAAQ,CAACuB,IAAI;IACVC,KAAK,EAAEqC,aAAc;IACrBM,uBAAuB,EAAEnC,KAAK,CAAC2B,YAAY,GAAG,QAAQ,GAAG,MAAO;IAAArC,QAAA,EAE/D,OAAOU,KAAK,CAACyB,OAAO,KAAK,UAAU,GAC9BzB,KAAK,CAACyB,OAAO,CAACjB,OAAO,CAAC,GACtBR,KAAK,CAACyB;EAAO,CACR,CAAC;AAExB;;AAEA;AACA;AACA;AACO,MAAMW,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,uBAAe,CAACC,IAAI;AAEvD,MAAM9C,MAAM,GAAG+C,uBAAU,CAACC,MAAM,CAAC;EAC7B/C,KAAK,EAAE;IACHgD,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRhD,MAAM,EAAE,CAAC;IACTiD,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE,CAAC;IACNC,iBAAiB,EAAE;EACvB;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MAX_VISIBLE_TOASTS = exports.DEFAULT_TOAST_DURATION = void 0;
7
+ exports.dismissToast = dismissToast;
8
+ exports.getToasts = getToasts;
9
+ exports.getVisibleToasts = getVisibleToasts;
10
+ exports.resetToasts = resetToasts;
11
+ exports.showToast = showToast;
12
+ exports.subscribeToasts = subscribeToasts;
13
+ /**
14
+ * Toast queue — the sonner role, minus the styling.
15
+ *
16
+ * A module-level store with an imperative `showToast`/`dismissToast` API,
17
+ * so any code (not just components) can raise a toast; the outlet the
18
+ * provider mounts subscribes and renders. SnackbarV2 will layer its token
19
+ * styling on top of this host; the host itself owns only queueing,
20
+ * stacking, timing, and announcements.
21
+ *
22
+ * RN-free (a `React.ReactNode` type is the only React surface) so queue
23
+ * semantics unit-test under vitest.
24
+ */
25
+
26
+ /** How many toasts render at once; older ones wait in the queue. */
27
+ const MAX_VISIBLE_TOASTS = exports.MAX_VISIBLE_TOASTS = 3;
28
+
29
+ /** Default auto-dismiss delay, matching sonner's. */
30
+ const DEFAULT_TOAST_DURATION = exports.DEFAULT_TOAST_DURATION = 4000;
31
+ let toasts = [];
32
+ const listeners = new Set();
33
+ let counter = 0;
34
+ function emit() {
35
+ for (const listener of listeners) listener(toasts);
36
+ }
37
+
38
+ /** Raise a toast; returns its id. */
39
+ function showToast(options) {
40
+ const id = options.id ?? `blend-toast-${++counter}`;
41
+ const entry = {
42
+ id,
43
+ content: options.content,
44
+ duration: options.duration === null ? null : options.duration ?? DEFAULT_TOAST_DURATION,
45
+ announcement: options.announcement
46
+ };
47
+ const existing = toasts.findIndex(t => t.id === id);
48
+ toasts = existing === -1 ? [...toasts, entry] : toasts.map((t, i) => i === existing ? entry : t);
49
+ emit();
50
+ return id;
51
+ }
52
+
53
+ /** Dismiss one toast, or every toast when no id is given. */
54
+ function dismissToast(id) {
55
+ toasts = id === undefined ? [] : toasts.filter(t => t.id !== id);
56
+ emit();
57
+ }
58
+ function getToasts() {
59
+ return toasts;
60
+ }
61
+
62
+ /** The slice the outlet renders: the newest MAX_VISIBLE. */
63
+ function getVisibleToasts(all = toasts) {
64
+ return all.slice(-MAX_VISIBLE_TOASTS);
65
+ }
66
+ function subscribeToasts(listener) {
67
+ listeners.add(listener);
68
+ return () => listeners.delete(listener);
69
+ }
70
+
71
+ /** Test hook — clears the queue without notifying. */
72
+ function resetToasts() {
73
+ toasts = [];
74
+ counter = 0;
75
+ }
76
+ //# sourceMappingURL=toastStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MAX_VISIBLE_TOASTS","exports","DEFAULT_TOAST_DURATION","toasts","listeners","Set","counter","emit","listener","showToast","options","id","entry","content","duration","announcement","existing","findIndex","t","map","i","dismissToast","undefined","filter","getToasts","getVisibleToasts","all","slice","subscribeToasts","add","delete","resetToasts"],"sourceRoot":"../../../../src","sources":["overlay/toast/toastStore.ts"],"mappings":";;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACO,MAAMA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,CAAC;;AAEnC;AACO,MAAME,sBAAsB,GAAAD,OAAA,CAAAC,sBAAA,GAAG,IAAI;AAI1C,IAAIC,MAAoB,GAAG,EAAE;AAC7B,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;AACrC,IAAIC,OAAO,GAAG,CAAC;AAEf,SAASC,IAAIA,CAAA,EAAG;EACZ,KAAK,MAAMC,QAAQ,IAAIJ,SAAS,EAAEI,QAAQ,CAACL,MAAM,CAAC;AACtD;;AAEA;AACO,SAASM,SAASA,CAACC,OAAqB,EAAU;EACrD,MAAMC,EAAE,GAAGD,OAAO,CAACC,EAAE,IAAI,eAAe,EAAEL,OAAO,EAAE;EACnD,MAAMM,KAAiB,GAAG;IACtBD,EAAE;IACFE,OAAO,EAAEH,OAAO,CAACG,OAAO;IACxBC,QAAQ,EACJJ,OAAO,CAACI,QAAQ,KAAK,IAAI,GACnB,IAAI,GACHJ,OAAO,CAACI,QAAQ,IAAIZ,sBAAuB;IACtDa,YAAY,EAAEL,OAAO,CAACK;EAC1B,CAAC;EACD,MAAMC,QAAQ,GAAGb,MAAM,CAACc,SAAS,CAAEC,CAAC,IAAKA,CAAC,CAACP,EAAE,KAAKA,EAAE,CAAC;EACrDR,MAAM,GACFa,QAAQ,KAAK,CAAC,CAAC,GACT,CAAC,GAAGb,MAAM,EAAES,KAAK,CAAC,GAClBT,MAAM,CAACgB,GAAG,CAAC,CAACD,CAAC,EAAEE,CAAC,KAAMA,CAAC,KAAKJ,QAAQ,GAAGJ,KAAK,GAAGM,CAAE,CAAC;EAC5DX,IAAI,CAAC,CAAC;EACN,OAAOI,EAAE;AACb;;AAEA;AACO,SAASU,YAAYA,CAACV,EAAW,EAAQ;EAC5CR,MAAM,GAAGQ,EAAE,KAAKW,SAAS,GAAG,EAAE,GAAGnB,MAAM,CAACoB,MAAM,CAAEL,CAAC,IAAKA,CAAC,CAACP,EAAE,KAAKA,EAAE,CAAC;EAClEJ,IAAI,CAAC,CAAC;AACV;AAEO,SAASiB,SAASA,CAAA,EAA0B;EAC/C,OAAOrB,MAAM;AACjB;;AAEA;AACO,SAASsB,gBAAgBA,CAC5BC,GAA0B,GAAGvB,MAAM,EACd;EACrB,OAAOuB,GAAG,CAACC,KAAK,CAAC,CAAC3B,kBAAkB,CAAC;AACzC;AAEO,SAAS4B,eAAeA,CAACpB,QAAkB,EAAc;EAC5DJ,SAAS,CAACyB,GAAG,CAACrB,QAAQ,CAAC;EACvB,OAAO,MAAMJ,SAAS,CAAC0B,MAAM,CAACtB,QAAQ,CAAC;AAC3C;;AAEA;AACO,SAASuB,WAAWA,CAAA,EAAS;EAChC5B,MAAM,GAAG,EAAE;EACXG,OAAO,GAAG,CAAC;AACf","ignoreList":[]}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useAnchoredPosition = useAnchoredPosition;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _positioning = require("./positioning.js");
10
+ /**
11
+ * Measurement plumbing for `computeAnchoredPosition`.
12
+ *
13
+ * Wires the three inputs the pure engine needs: the anchor's window rect
14
+ * (`measureInWindow`, taken when the overlay opens), the floating content's
15
+ * size (its `onLayout`), and the window size (re-renders on rotation).
16
+ *
17
+ * ```tsx
18
+ * const { anchorRef, measureAnchor, onContentLayout, position } =
19
+ * useAnchoredPosition({ placement: 'bottom' })
20
+ *
21
+ * <Pressable ref={anchorRef} onPress={() => { measureAnchor(); open() }} />
22
+ * <Portal>
23
+ * <View
24
+ * onLayout={onContentLayout}
25
+ * style={position && {
26
+ * position: 'absolute', left: position.x, top: position.y,
27
+ * maxHeight: position.maxHeight, opacity: 1,
28
+ * }}
29
+ * />
30
+ * </Portal>
31
+ * ```
32
+ *
33
+ * `position` is `null` until both measurements land — render the content
34
+ * transparent (not unmounted, or `onLayout` never fires) until then.
35
+ */
36
+ function useAnchoredPosition(options) {
37
+ const anchorRef = (0, _react.useRef)(null);
38
+ const [anchorRect, setAnchorRect] = (0, _react.useState)(null);
39
+ const [contentSize, setContentSize] = (0, _react.useState)(null);
40
+ const viewport = (0, _reactNative.useWindowDimensions)();
41
+
42
+ /** Call when opening (and after anything that moves the anchor). */
43
+ const measureAnchor = (0, _react.useCallback)(() => {
44
+ anchorRef.current?.measureInWindow((x, y, width, height) => {
45
+ setAnchorRect({
46
+ x,
47
+ y,
48
+ width,
49
+ height
50
+ });
51
+ });
52
+ }, []);
53
+ const onContentLayout = (0, _react.useCallback)(event => {
54
+ const {
55
+ width,
56
+ height
57
+ } = event.nativeEvent.layout;
58
+ setContentSize(previous => previous?.width === width && previous?.height === height ? previous : {
59
+ width,
60
+ height
61
+ });
62
+ }, []);
63
+ const position = (0, _react.useMemo)(() => {
64
+ if (!anchorRect || !contentSize) return null;
65
+ return (0, _positioning.computeAnchoredPosition)({
66
+ anchor: anchorRect,
67
+ content: contentSize,
68
+ viewport: {
69
+ width: viewport.width,
70
+ height: viewport.height
71
+ },
72
+ placement: options?.placement,
73
+ alignment: options?.alignment,
74
+ offset: options?.offset,
75
+ viewportPadding: options?.viewportPadding
76
+ });
77
+ }, [anchorRect, contentSize, viewport.width, viewport.height, options?.placement, options?.alignment, options?.offset, options?.viewportPadding]);
78
+ return {
79
+ anchorRef,
80
+ measureAnchor,
81
+ onContentLayout,
82
+ position
83
+ };
84
+ }
85
+ //# sourceMappingURL=useAnchoredPosition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_positioning","useAnchoredPosition","options","anchorRef","useRef","anchorRect","setAnchorRect","useState","contentSize","setContentSize","viewport","useWindowDimensions","measureAnchor","useCallback","current","measureInWindow","x","y","width","height","onContentLayout","event","nativeEvent","layout","previous","position","useMemo","computeAnchoredPosition","anchor","content","placement","alignment","offset","viewportPadding"],"sourceRoot":"../../../src","sources":["overlay/useAnchoredPosition.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,YAAA,GAAAF,OAAA;AASA;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;AACO,SAASG,mBAAmBA,CAACC,OAKnC,EAAE;EACC,MAAMC,SAAS,GAAG,IAAAC,aAAM,EAAO,IAAI,CAAC;EACpC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAAc,IAAI,CAAC;EAC/D,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAG,IAAAF,eAAQ,EAAc,IAAI,CAAC;EACjE,MAAMG,QAAQ,GAAG,IAAAC,gCAAmB,EAAC,CAAC;;EAEtC;EACA,MAAMC,aAAa,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACpCV,SAAS,CAACW,OAAO,EAAEC,eAAe,CAAC,CAACC,CAAC,EAAEC,CAAC,EAAEC,KAAK,EAAEC,MAAM,KAAK;MACxDb,aAAa,CAAC;QAAEU,CAAC;QAAEC,CAAC;QAAEC,KAAK;QAAEC;MAAO,CAAC,CAAC;IAC1C,CAAC,CAAC;EACN,CAAC,EAAE,EAAE,CAAC;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