@oxy.so/bloom 7.19.2 → 7.21.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 (288) hide show
  1. package/docs/adoption-matrix.mdx +10 -9
  2. package/docs/bottom-sheet.mdx +15 -0
  3. package/docs/dialog.mdx +51 -0
  4. package/docs/overlay.mdx +18 -0
  5. package/docs/rating.mdx +2 -0
  6. package/docs/stat-bar.mdx +10 -0
  7. package/docs/viewport.mdx +47 -0
  8. package/lib/commonjs/bottom-sheet/BottomSheetBase.js +27 -10
  9. package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
  10. package/lib/commonjs/dialog/Dialog.js +21 -8
  11. package/lib/commonjs/dialog/Dialog.js.map +1 -1
  12. package/lib/commonjs/dialog/Dialog.web.js +37 -18
  13. package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
  14. package/lib/commonjs/dialog/DialogBottomSheet.js +4 -0
  15. package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
  16. package/lib/commonjs/dialog/placement.js +8 -1
  17. package/lib/commonjs/dialog/placement.js.map +1 -1
  18. package/lib/commonjs/index.js +12 -0
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/commonjs/index.web.js +12 -0
  21. package/lib/commonjs/index.web.js.map +1 -1
  22. package/lib/commonjs/motion/surface-transition.js +18 -0
  23. package/lib/commonjs/motion/surface-transition.js.map +1 -0
  24. package/lib/commonjs/motion/use-surface-transition.js +24 -0
  25. package/lib/commonjs/motion/use-surface-transition.js.map +1 -0
  26. package/lib/commonjs/overlay/Overlay.js +11 -11
  27. package/lib/commonjs/overlay/Overlay.js.map +1 -1
  28. package/lib/commonjs/overlay/backdrop-paint.js +34 -0
  29. package/lib/commonjs/overlay/backdrop-paint.js.map +1 -0
  30. package/lib/commonjs/rating/RatingBar.js +2 -0
  31. package/lib/commonjs/rating/RatingBar.js.map +1 -1
  32. package/lib/commonjs/rating/RatingBar.web.js +2 -0
  33. package/lib/commonjs/rating/RatingBar.web.js.map +1 -1
  34. package/lib/commonjs/stat-bar/Meter.js +7 -4
  35. package/lib/commonjs/stat-bar/Meter.js.map +1 -1
  36. package/lib/commonjs/stat-bar/Meter.web.js +11 -4
  37. package/lib/commonjs/stat-bar/Meter.web.js.map +1 -1
  38. package/lib/commonjs/stat-bar/use-meter-reveal-policy.js +29 -0
  39. package/lib/commonjs/stat-bar/use-meter-reveal-policy.js.map +1 -0
  40. package/lib/commonjs/stat-bar/use-meter-reveal.js +39 -0
  41. package/lib/commonjs/stat-bar/use-meter-reveal.js.map +1 -0
  42. package/lib/commonjs/stat-bar/use-meter-reveal.web.js +38 -0
  43. package/lib/commonjs/stat-bar/use-meter-reveal.web.js.map +1 -0
  44. package/lib/commonjs/viewport/ViewportProvider.js +28 -0
  45. package/lib/commonjs/viewport/ViewportProvider.js.map +1 -0
  46. package/lib/commonjs/viewport/context.js +9 -0
  47. package/lib/commonjs/viewport/context.js.map +1 -0
  48. package/lib/commonjs/viewport/geometry.js +31 -0
  49. package/lib/commonjs/viewport/geometry.js.map +1 -0
  50. package/lib/commonjs/viewport/index.js +27 -0
  51. package/lib/commonjs/viewport/index.js.map +1 -0
  52. package/lib/commonjs/viewport/index.web.js +27 -0
  53. package/lib/commonjs/viewport/index.web.js.map +1 -0
  54. package/lib/commonjs/viewport/types.js +6 -0
  55. package/lib/commonjs/viewport/types.js.map +1 -0
  56. package/lib/commonjs/viewport/use-in-view.js +106 -0
  57. package/lib/commonjs/viewport/use-in-view.js.map +1 -0
  58. package/lib/commonjs/viewport/use-in-view.web.js +49 -0
  59. package/lib/commonjs/viewport/use-in-view.web.js.map +1 -0
  60. package/lib/commonjs/viewport/use-viewport-binding.js +55 -0
  61. package/lib/commonjs/viewport/use-viewport-binding.js.map +1 -0
  62. package/lib/module/bottom-sheet/BottomSheetBase.js +27 -10
  63. package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
  64. package/lib/module/dialog/Dialog.js +22 -9
  65. package/lib/module/dialog/Dialog.js.map +1 -1
  66. package/lib/module/dialog/Dialog.web.js +38 -19
  67. package/lib/module/dialog/Dialog.web.js.map +1 -1
  68. package/lib/module/dialog/DialogBottomSheet.js +4 -0
  69. package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
  70. package/lib/module/dialog/placement.js +7 -1
  71. package/lib/module/dialog/placement.js.map +1 -1
  72. package/lib/module/index.js +1 -0
  73. package/lib/module/index.js.map +1 -1
  74. package/lib/module/index.web.js +1 -0
  75. package/lib/module/index.web.js.map +1 -1
  76. package/lib/module/motion/surface-transition.js +14 -0
  77. package/lib/module/motion/surface-transition.js.map +1 -0
  78. package/lib/module/motion/use-surface-transition.js +20 -0
  79. package/lib/module/motion/use-surface-transition.js.map +1 -0
  80. package/lib/module/overlay/Overlay.js +11 -11
  81. package/lib/module/overlay/Overlay.js.map +1 -1
  82. package/lib/module/overlay/backdrop-paint.js +29 -0
  83. package/lib/module/overlay/backdrop-paint.js.map +1 -0
  84. package/lib/module/rating/RatingBar.js +2 -0
  85. package/lib/module/rating/RatingBar.js.map +1 -1
  86. package/lib/module/rating/RatingBar.web.js +2 -0
  87. package/lib/module/rating/RatingBar.web.js.map +1 -1
  88. package/lib/module/stat-bar/Meter.js +9 -4
  89. package/lib/module/stat-bar/Meter.js.map +1 -1
  90. package/lib/module/stat-bar/Meter.web.js +11 -4
  91. package/lib/module/stat-bar/Meter.web.js.map +1 -1
  92. package/lib/module/stat-bar/use-meter-reveal-policy.js +25 -0
  93. package/lib/module/stat-bar/use-meter-reveal-policy.js.map +1 -0
  94. package/lib/module/stat-bar/use-meter-reveal.js +35 -0
  95. package/lib/module/stat-bar/use-meter-reveal.js.map +1 -0
  96. package/lib/module/stat-bar/use-meter-reveal.web.js +34 -0
  97. package/lib/module/stat-bar/use-meter-reveal.web.js.map +1 -0
  98. package/lib/module/viewport/ViewportProvider.js +23 -0
  99. package/lib/module/viewport/ViewportProvider.js.map +1 -0
  100. package/lib/module/viewport/context.js +5 -0
  101. package/lib/module/viewport/context.js.map +1 -0
  102. package/lib/module/viewport/geometry.js +25 -0
  103. package/lib/module/viewport/geometry.js.map +1 -0
  104. package/lib/module/viewport/index.js +6 -0
  105. package/lib/module/viewport/index.js.map +1 -0
  106. package/lib/module/viewport/index.web.js +11 -0
  107. package/lib/module/viewport/index.web.js.map +1 -0
  108. package/lib/module/viewport/types.js +4 -0
  109. package/lib/module/viewport/types.js.map +1 -0
  110. package/lib/module/viewport/use-in-view.js +102 -0
  111. package/lib/module/viewport/use-in-view.js.map +1 -0
  112. package/lib/module/viewport/use-in-view.web.js +45 -0
  113. package/lib/module/viewport/use-in-view.web.js.map +1 -0
  114. package/lib/module/viewport/use-viewport-binding.js +51 -0
  115. package/lib/module/viewport/use-viewport-binding.js.map +1 -0
  116. package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/bottom-sheet/types.d.ts +6 -0
  118. package/lib/typescript/commonjs/bottom-sheet/types.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts +2 -2
  122. package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/dialog/placement.d.ts +3 -1
  124. package/lib/typescript/commonjs/dialog/placement.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/dialog/types.d.ts +8 -0
  126. package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/index.d.ts +1 -0
  128. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/index.web.d.ts +1 -0
  130. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/motion/index.d.ts +1 -1
  132. package/lib/typescript/commonjs/motion/index.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/motion/index.web.d.ts +1 -1
  134. package/lib/typescript/commonjs/motion/index.web.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/motion/surface-transition.d.ts +8 -0
  136. package/lib/typescript/commonjs/motion/surface-transition.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/motion/types.d.ts +7 -0
  138. package/lib/typescript/commonjs/motion/types.d.ts.map +1 -1
  139. package/lib/typescript/commonjs/motion/use-surface-transition.d.ts +9 -0
  140. package/lib/typescript/commonjs/motion/use-surface-transition.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/overlay/Overlay.d.ts.map +1 -1
  142. package/lib/typescript/commonjs/overlay/backdrop-paint.d.ts +7 -0
  143. package/lib/typescript/commonjs/overlay/backdrop-paint.d.ts.map +1 -0
  144. package/lib/typescript/commonjs/overlay/index.d.ts +1 -1
  145. package/lib/typescript/commonjs/overlay/index.d.ts.map +1 -1
  146. package/lib/typescript/commonjs/overlay/types.d.ts +23 -9
  147. package/lib/typescript/commonjs/overlay/types.d.ts.map +1 -1
  148. package/lib/typescript/commonjs/rating/RatingBar.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/rating/types.d.ts +3 -0
  150. package/lib/typescript/commonjs/rating/types.d.ts.map +1 -1
  151. package/lib/typescript/commonjs/stat-bar/Meter.d.ts.map +1 -1
  152. package/lib/typescript/commonjs/stat-bar/Meter.web.d.ts.map +1 -1
  153. package/lib/typescript/commonjs/stat-bar/index.d.ts +1 -0
  154. package/lib/typescript/commonjs/stat-bar/index.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/stat-bar/index.web.d.ts +1 -0
  156. package/lib/typescript/commonjs/stat-bar/index.web.d.ts.map +1 -1
  157. package/lib/typescript/commonjs/stat-bar/types.d.ts +14 -0
  158. package/lib/typescript/commonjs/stat-bar/types.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/stat-bar/use-meter-reveal-policy.d.ts +10 -0
  160. package/lib/typescript/commonjs/stat-bar/use-meter-reveal-policy.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/stat-bar/use-meter-reveal.d.ts +5 -0
  162. package/lib/typescript/commonjs/stat-bar/use-meter-reveal.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/stat-bar/use-meter-reveal.web.d.ts +9 -0
  164. package/lib/typescript/commonjs/stat-bar/use-meter-reveal.web.d.ts.map +1 -0
  165. package/lib/typescript/commonjs/viewport/ViewportProvider.d.ts +4 -0
  166. package/lib/typescript/commonjs/viewport/ViewportProvider.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/viewport/context.d.ts +8 -0
  168. package/lib/typescript/commonjs/viewport/context.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/viewport/geometry.d.ts +10 -0
  170. package/lib/typescript/commonjs/viewport/geometry.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/viewport/index.d.ts +5 -0
  172. package/lib/typescript/commonjs/viewport/index.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/viewport/index.web.d.ts +5 -0
  174. package/lib/typescript/commonjs/viewport/index.web.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/viewport/types.d.ts +25 -0
  176. package/lib/typescript/commonjs/viewport/types.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/viewport/use-in-view.d.ts +11 -0
  178. package/lib/typescript/commonjs/viewport/use-in-view.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/viewport/use-in-view.web.d.ts +10 -0
  180. package/lib/typescript/commonjs/viewport/use-in-view.web.d.ts.map +1 -0
  181. package/lib/typescript/commonjs/viewport/use-viewport-binding.d.ts +9 -0
  182. package/lib/typescript/commonjs/viewport/use-viewport-binding.d.ts.map +1 -0
  183. package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
  184. package/lib/typescript/module/bottom-sheet/types.d.ts +6 -0
  185. package/lib/typescript/module/bottom-sheet/types.d.ts.map +1 -1
  186. package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
  187. package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
  188. package/lib/typescript/module/dialog/DialogBottomSheet.d.ts +2 -2
  189. package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -1
  190. package/lib/typescript/module/dialog/placement.d.ts +3 -1
  191. package/lib/typescript/module/dialog/placement.d.ts.map +1 -1
  192. package/lib/typescript/module/dialog/types.d.ts +8 -0
  193. package/lib/typescript/module/dialog/types.d.ts.map +1 -1
  194. package/lib/typescript/module/index.d.ts +1 -0
  195. package/lib/typescript/module/index.d.ts.map +1 -1
  196. package/lib/typescript/module/index.web.d.ts +1 -0
  197. package/lib/typescript/module/index.web.d.ts.map +1 -1
  198. package/lib/typescript/module/motion/index.d.ts +1 -1
  199. package/lib/typescript/module/motion/index.d.ts.map +1 -1
  200. package/lib/typescript/module/motion/index.web.d.ts +1 -1
  201. package/lib/typescript/module/motion/index.web.d.ts.map +1 -1
  202. package/lib/typescript/module/motion/surface-transition.d.ts +8 -0
  203. package/lib/typescript/module/motion/surface-transition.d.ts.map +1 -0
  204. package/lib/typescript/module/motion/types.d.ts +7 -0
  205. package/lib/typescript/module/motion/types.d.ts.map +1 -1
  206. package/lib/typescript/module/motion/use-surface-transition.d.ts +9 -0
  207. package/lib/typescript/module/motion/use-surface-transition.d.ts.map +1 -0
  208. package/lib/typescript/module/overlay/Overlay.d.ts.map +1 -1
  209. package/lib/typescript/module/overlay/backdrop-paint.d.ts +7 -0
  210. package/lib/typescript/module/overlay/backdrop-paint.d.ts.map +1 -0
  211. package/lib/typescript/module/overlay/index.d.ts +1 -1
  212. package/lib/typescript/module/overlay/index.d.ts.map +1 -1
  213. package/lib/typescript/module/overlay/types.d.ts +23 -9
  214. package/lib/typescript/module/overlay/types.d.ts.map +1 -1
  215. package/lib/typescript/module/rating/RatingBar.d.ts.map +1 -1
  216. package/lib/typescript/module/rating/types.d.ts +3 -0
  217. package/lib/typescript/module/rating/types.d.ts.map +1 -1
  218. package/lib/typescript/module/stat-bar/Meter.d.ts.map +1 -1
  219. package/lib/typescript/module/stat-bar/Meter.web.d.ts.map +1 -1
  220. package/lib/typescript/module/stat-bar/index.d.ts +1 -0
  221. package/lib/typescript/module/stat-bar/index.d.ts.map +1 -1
  222. package/lib/typescript/module/stat-bar/index.web.d.ts +1 -0
  223. package/lib/typescript/module/stat-bar/index.web.d.ts.map +1 -1
  224. package/lib/typescript/module/stat-bar/types.d.ts +14 -0
  225. package/lib/typescript/module/stat-bar/types.d.ts.map +1 -1
  226. package/lib/typescript/module/stat-bar/use-meter-reveal-policy.d.ts +10 -0
  227. package/lib/typescript/module/stat-bar/use-meter-reveal-policy.d.ts.map +1 -0
  228. package/lib/typescript/module/stat-bar/use-meter-reveal.d.ts +5 -0
  229. package/lib/typescript/module/stat-bar/use-meter-reveal.d.ts.map +1 -0
  230. package/lib/typescript/module/stat-bar/use-meter-reveal.web.d.ts +9 -0
  231. package/lib/typescript/module/stat-bar/use-meter-reveal.web.d.ts.map +1 -0
  232. package/lib/typescript/module/viewport/ViewportProvider.d.ts +4 -0
  233. package/lib/typescript/module/viewport/ViewportProvider.d.ts.map +1 -0
  234. package/lib/typescript/module/viewport/context.d.ts +8 -0
  235. package/lib/typescript/module/viewport/context.d.ts.map +1 -0
  236. package/lib/typescript/module/viewport/geometry.d.ts +10 -0
  237. package/lib/typescript/module/viewport/geometry.d.ts.map +1 -0
  238. package/lib/typescript/module/viewport/index.d.ts +5 -0
  239. package/lib/typescript/module/viewport/index.d.ts.map +1 -0
  240. package/lib/typescript/module/viewport/index.web.d.ts +5 -0
  241. package/lib/typescript/module/viewport/index.web.d.ts.map +1 -0
  242. package/lib/typescript/module/viewport/types.d.ts +25 -0
  243. package/lib/typescript/module/viewport/types.d.ts.map +1 -0
  244. package/lib/typescript/module/viewport/use-in-view.d.ts +11 -0
  245. package/lib/typescript/module/viewport/use-in-view.d.ts.map +1 -0
  246. package/lib/typescript/module/viewport/use-in-view.web.d.ts +10 -0
  247. package/lib/typescript/module/viewport/use-in-view.web.d.ts.map +1 -0
  248. package/lib/typescript/module/viewport/use-viewport-binding.d.ts +9 -0
  249. package/lib/typescript/module/viewport/use-viewport-binding.d.ts.map +1 -0
  250. package/package.json +23 -1
  251. package/src/bottom-sheet/BottomSheetBase.tsx +18 -8
  252. package/src/bottom-sheet/types.ts +6 -0
  253. package/src/dialog/Dialog.tsx +24 -8
  254. package/src/dialog/Dialog.web.tsx +40 -16
  255. package/src/dialog/DialogBottomSheet.tsx +6 -0
  256. package/src/dialog/placement.ts +9 -1
  257. package/src/dialog/types.ts +8 -0
  258. package/src/index.ts +2 -0
  259. package/src/index.web.ts +2 -0
  260. package/src/motion/index.ts +1 -1
  261. package/src/motion/index.web.ts +1 -1
  262. package/src/motion/surface-transition.ts +15 -0
  263. package/src/motion/types.ts +8 -0
  264. package/src/motion/use-surface-transition.ts +14 -0
  265. package/src/overlay/Overlay.tsx +12 -8
  266. package/src/overlay/backdrop-paint.ts +25 -0
  267. package/src/overlay/index.ts +1 -1
  268. package/src/overlay/types.ts +22 -9
  269. package/src/rating/RatingBar.tsx +2 -1
  270. package/src/rating/RatingBar.web.tsx +2 -2
  271. package/src/rating/types.ts +3 -0
  272. package/src/stat-bar/Meter.tsx +7 -3
  273. package/src/stat-bar/Meter.web.tsx +7 -4
  274. package/src/stat-bar/index.ts +2 -0
  275. package/src/stat-bar/index.web.ts +2 -0
  276. package/src/stat-bar/types.ts +15 -0
  277. package/src/stat-bar/use-meter-reveal-policy.ts +19 -0
  278. package/src/stat-bar/use-meter-reveal.ts +21 -0
  279. package/src/stat-bar/use-meter-reveal.web.ts +24 -0
  280. package/src/viewport/ViewportProvider.tsx +11 -0
  281. package/src/viewport/context.ts +9 -0
  282. package/src/viewport/geometry.ts +18 -0
  283. package/src/viewport/index.ts +4 -0
  284. package/src/viewport/index.web.ts +9 -0
  285. package/src/viewport/types.ts +23 -0
  286. package/src/viewport/use-in-view.ts +69 -0
  287. package/src/viewport/use-in-view.web.ts +33 -0
  288. package/src/viewport/use-viewport-binding.ts +34 -0
@@ -0,0 +1,10 @@
1
+ import type { InViewOptions } from './types';
2
+ /** The browser owns ancestor clipping, scrolling and resize observation. */
3
+ export declare function useInView({ threshold: requestedThreshold, once }?: InViewOptions): {
4
+ inView: boolean;
5
+ targetProps: {
6
+ ref: (value: unknown) => void;
7
+ onLayout: () => void;
8
+ };
9
+ };
10
+ //# sourceMappingURL=use-in-view.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-in-view.web.d.ts","sourceRoot":"","sources":["../../../../src/viewport/use-in-view.web.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,IAAY,EAAE,GAAE,aAAkB;;;qBAK3D,OAAO;;;EAsBxC"}
@@ -0,0 +1,9 @@
1
+ import type { ViewportBindingOptions } from './types';
2
+ /** Compose with restoration/metrics callbacks; no React renders on scroll. */
3
+ export declare function useViewportBinding({ viewportRef, onScroll, onLayout, onContentSizeChange }: ViewportBindingOptions): {
4
+ onScroll: (event: import("react-native").NativeSyntheticEvent<import("react-native").NativeScrollEvent>) => void;
5
+ onLayout: (event: import("react-native").LayoutChangeEvent) => void;
6
+ onContentSizeChange: (contentWidth: number, contentHeight: number) => void;
7
+ scrollEventThrottle: number;
8
+ };
9
+ //# sourceMappingURL=use-viewport-binding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-viewport-binding.d.ts","sourceRoot":"","sources":["../../../../src/viewport/use-viewport-binding.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,EAAE,EAAE,sBAAsB;;;;;EA2BlH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/bloom",
3
- "version": "7.19.2",
3
+ "version": "7.21.0",
4
4
  "packageManager": "bun@1.3.14",
5
5
  "description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
6
6
  "main": "lib/commonjs/index.js",
@@ -371,6 +371,25 @@
371
371
  "default": "./lib/commonjs/layout/index.js"
372
372
  }
373
373
  },
374
+ "./viewport": {
375
+ "react-native": {
376
+ "types": "./lib/typescript/module/viewport/index.d.ts",
377
+ "default": "./src/viewport/index.ts"
378
+ },
379
+ "browser": {
380
+ "types": "./lib/typescript/module/viewport/index.web.d.ts",
381
+ "import": "./lib/module/viewport/index.web.js",
382
+ "require": "./lib/commonjs/viewport/index.web.js"
383
+ },
384
+ "import": {
385
+ "types": "./lib/typescript/module/viewport/index.d.ts",
386
+ "default": "./lib/module/viewport/index.js"
387
+ },
388
+ "require": {
389
+ "types": "./lib/typescript/commonjs/viewport/index.d.ts",
390
+ "default": "./lib/commonjs/viewport/index.js"
391
+ }
392
+ },
374
393
  "./fab": {
375
394
  "react-native": {
376
395
  "types": "./lib/typescript/module/fab/index.d.ts",
@@ -3725,6 +3744,9 @@
3725
3744
  "layout": [
3726
3745
  "./lib/typescript/module/layout/index.d.ts"
3727
3746
  ],
3747
+ "viewport": [
3748
+ "./lib/typescript/module/viewport/index.d.ts"
3749
+ ],
3728
3750
  "fab": [
3729
3751
  "./lib/typescript/module/fab/index.d.ts"
3730
3752
  ],
@@ -1,3 +1,4 @@
1
+ import { useSurfaceTransition } from '../motion/use-surface-transition';
1
2
  import { MOTION_RECIPES } from '../motion/recipes';
2
3
  import { surfaceStyle } from '../shapes/surface-style';
3
4
  import { SURFACE_SHAPES } from '../design-tokens/shapes';
@@ -56,6 +57,8 @@ export const BottomSheetBase = forwardRef((props: BottomSheetBaseProps, ref: Rea
56
57
  backgroundComponent,
57
58
  backgroundFill,
58
59
  backdropComponent,
60
+ backdrop,
61
+ transition,
59
62
  style,
60
63
  enableHandlePanningGesture = true,
61
64
  onDismissAttempt,
@@ -72,6 +75,9 @@ export const BottomSheetBase = forwardRef((props: BottomSheetBaseProps, ref: Rea
72
75
  onLayout,
73
76
  } = props;
74
77
 
78
+ const motion = useSurfaceTransition(transition);
79
+ const timed = transition !== undefined;
80
+ const timedConfig = useMemo(() => ({ ...MOTION_RECIPES.present, duration: motion.duration ?? 250, easing: motion.easing }), [motion.duration, motion.easing]);
75
81
  const insets = useSafeAreaInsets();
76
82
  const theme = useTheme();
77
83
  const { colors } = theme;
@@ -192,19 +198,19 @@ export const BottomSheetBase = forwardRef((props: BottomSheetBaseProps, ref: Rea
192
198
  // it eventually fires, because its captured generation is stale.
193
199
  closeGenerationRef.current += 1;
194
200
  closeGeneration.value = closeGenerationRef.current;
195
- opacity.value = withTiming(1, { ...MOTION_RECIPES.present, duration: 250 });
196
- translateY.value = withSpring(0, SPRING_CONFIG);
201
+ opacity.value = withTiming(1, timed ? timedConfig : { ...MOTION_RECIPES.present, duration: motion.duration ?? 250 });
202
+ translateY.value = motion.reducedMotion ? 0 : timed ? withTiming(0, timedConfig) : withSpring(0, SPRING_CONFIG);
197
203
  } else if (rendered) {
198
204
  // Capture the generation for THIS close cycle so the animation
199
205
  // callback (running on the UI thread, scheduled back to JS) and
200
206
  // the fallback timer agree on which cycle they belong to.
201
207
  const generation = closeGenerationRef.current;
202
- opacity.value = withTiming(0, { ...MOTION_RECIPES.dismiss, duration: 250 }, (finished) => {
208
+ opacity.value = withTiming(0, timed ? timedConfig : { ...MOTION_RECIPES.dismiss, duration: motion.duration ?? 250 }, (finished) => {
203
209
  if (finished) {
204
210
  runOnJS(finishClose)(generation);
205
211
  }
206
212
  });
207
- translateY.value = withSpring(screenHeight, { ...SPRING_CONFIG, stiffness: 250 });
213
+ translateY.value = motion.reducedMotion ? screenHeight : timed ? withTiming(screenHeight, timedConfig) : withSpring(screenHeight, { ...SPRING_CONFIG, stiffness: 250 });
208
214
 
209
215
  // Fallback timer to ensure close completes (especially on web
210
216
  // where reanimated callbacks occasionally drop on tab blur).
@@ -214,9 +220,9 @@ export const BottomSheetBase = forwardRef((props: BottomSheetBaseProps, ref: Rea
214
220
  closeTimeoutRef.current = setTimeout(() => {
215
221
  finishClose(generation);
216
222
  closeTimeoutRef.current = null;
217
- }, 300);
223
+ }, motion.reducedMotion ? 0 : timed ? timedConfig.duration + 50 : 300);
218
224
  }
219
- }, [visible, rendered, finishClose, screenHeight, closeGeneration, opacity, translateY]);
225
+ }, [visible, rendered, finishClose, screenHeight, closeGeneration, opacity, translateY, timed, timedConfig, motion.duration, motion.reducedMotion]);
220
226
 
221
227
  // On unmount: ensure pending close callbacks (e.g. consumer's `onDismiss`)
222
228
  // still fire if the BS is yanked mid-animation by a parent re-render while a
@@ -260,11 +266,14 @@ export const BottomSheetBase = forwardRef((props: BottomSheetBaseProps, ref: Rea
260
266
  translateY.value = withSpring(0, { ...SPRING_CONFIG, velocity });
261
267
  return;
262
268
  }
269
+ // The timed presentation shares the imperative close lifecycle, so a live
270
+ // reduced-motion change can also settle a gesture-initiated dismissal.
271
+ if (timed || motion.reducedMotion) { setVisible(false); return; }
263
272
  translateY.value = withSpring(screenHeightSV.value, { ...SPRING_CONFIG, velocity });
264
273
  opacity.value = withTiming(0, { ...MOTION_RECIPES.dismiss, duration: 250 }, (finished) => {
265
274
  if (finished) runOnJS(finishClose)(generation);
266
275
  });
267
- }, [onDismissAttempt, translateY, screenHeightSV, opacity, finishClose]);
276
+ }, [onDismissAttempt, translateY, screenHeightSV, opacity, finishClose, timed, timedConfig, motion.duration, motion.reducedMotion]);
268
277
 
269
278
  const present = useCallback(() => {
270
279
  setRendered(true);
@@ -709,6 +718,7 @@ export const BottomSheetBase = forwardRef((props: BottomSheetBaseProps, ref: Rea
709
718
  // `backdropOpacity`, so the shared component's own dim is
710
719
  // switched off here to keep a single source of dimming.
711
720
  <Backdrop
721
+ {...backdrop}
712
722
  onPress={handleBackdropPress}
713
723
  // `progress` is the FADE (0 → 1, folding the drag);
714
724
  // how dark the backdrop gets is `backdropOpacity`,
@@ -717,7 +727,7 @@ export const BottomSheetBase = forwardRef((props: BottomSheetBaseProps, ref: Rea
717
727
  // `progress` rather than an animated style because an
718
728
  // opacity on the root would sit above the blur layer
719
729
  // and neutralise it.
720
- dimOpacity={backdropOpacity}
730
+ dimOpacity={backdrop?.dimOpacity ?? backdropOpacity}
721
731
  progress={backdropProgress}
722
732
  style={styles.backdrop}
723
733
  />
@@ -1,3 +1,5 @@
1
+ import type { BackdropAppearance } from '../overlay/types';
2
+ import type { SurfaceTransition } from '../motion/types';
1
3
  import type React from 'react';
2
4
  import { View, Platform, type LayoutChangeEvent, type ViewStyle, type StyleProp } from 'react-native';
3
5
  import Animated, { type AnimatedStyle, type SharedValue } from 'react-native-reanimated';
@@ -14,6 +16,10 @@ export interface BottomSheetRef {
14
16
  export interface BottomSheetProps {
15
17
  /** Standard optical surface, or the unmodified backing fill. Default surface. */
16
18
  material?: 'surface' | 'flat';
19
+ /** Backdrop paint; the surface continues to own dismissal and layering. */
20
+ backdrop?: BackdropAppearance;
21
+ /** Opt-in timing for panel and backdrop. Live reduced motion settles immediately. */
22
+ transition?: SurfaceTransition;
17
23
  children: React.ReactNode;
18
24
  /** Accessible name for the modal sheet panel on web. */
19
25
  accessibilityLabel?: string;
@@ -1,3 +1,4 @@
1
+ import { useSurfaceTransition } from '../motion/use-surface-transition';
1
2
  import { MOTION_RECIPES } from '../motion/recipes';
2
3
  import { surfaceStyle } from '../shapes/surface-style';
3
4
  import { SURFACE_SHAPES } from '../design-tokens/shapes';
@@ -47,7 +48,7 @@ import {
47
48
  DEFAULT_DIALOG_CONTENT_PADDING,
48
49
  DEFAULT_SIDE_WIDTH,
49
50
  DIALOG_SHEET_BACKDROP_TESTID,
50
- SIDE_SHEET_MIN_GUTTER,
51
+ resolveSideSheetWidth,
51
52
  useResolvedPlacement,
52
53
  physicalDialogSide,
53
54
  type DialogSidePlacement,
@@ -113,6 +114,8 @@ export function Dialog({
113
114
  */
114
115
  function CenteredOrSideDialog({
115
116
  material: surfaceMaterial = 'surface',
117
+ backdrop,
118
+ transition,
116
119
  control,
117
120
  open: controlledOpen,
118
121
  startOpen,
@@ -128,6 +131,7 @@ function CenteredOrSideDialog({
128
131
  morph,
129
132
  placement,
130
133
  width = DEFAULT_SIDE_WIDTH,
134
+ minSideGutter,
131
135
  inset,
132
136
  dismissOnBackdrop = true,
133
137
  contentPadding = DEFAULT_DIALOG_CONTENT_PADDING,
@@ -303,6 +307,8 @@ function CenteredOrSideDialog({
303
307
  return (
304
308
  <Context.Provider value={context}>
305
309
  <SideSheet
310
+ backdrop={backdrop}
311
+ transition={transition}
306
312
  material={surfaceMaterial}
307
313
  presentation={presentation}
308
314
  exitDuration={exitDuration}
@@ -310,6 +316,7 @@ function CenteredOrSideDialog({
310
316
  open={sideOpen}
311
317
  onDismiss={handleDismiss}
312
318
  side={placement}
319
+ minSideGutter={minSideGutter}
313
320
  width={width}
314
321
  inset={inset}
315
322
  dismissOnBackdrop={dismissOnBackdrop}
@@ -337,6 +344,8 @@ function CenteredOrSideDialog({
337
344
 
338
345
  return (
339
346
  <BottomSheet
347
+ backdrop={backdrop}
348
+ transition={transition}
340
349
  material={surfaceMaterial}
341
350
  backgroundFill={surfaceMaterial === 'flat' ? String(StyleSheet.flatten([style, panelStyle])?.backgroundColor ?? theme.colors.background) : undefined}
342
351
  ref={ref}
@@ -408,6 +417,8 @@ function CenteredOrSideDialog({
408
417
  */
409
418
  function SideSheet({
410
419
  material: surfaceMaterial = 'surface',
420
+ backdrop,
421
+ transition,
411
422
  scrollable,
412
423
  presentation,
413
424
  exitDuration,
@@ -415,6 +426,7 @@ function SideSheet({
415
426
  onDismiss,
416
427
  side,
417
428
  width,
429
+ minSideGutter,
418
430
  inset,
419
431
  dismissOnBackdrop,
420
432
  contentPadding,
@@ -435,6 +447,8 @@ function SideSheet({
435
447
  children,
436
448
  }: {
437
449
  material?: DialogProps['material'];
450
+ backdrop?: DialogProps['backdrop'];
451
+ transition?: DialogProps['transition'];
438
452
  scrollable: boolean;
439
453
  presentation?: DialogProps['presentation'];
440
454
  exitDuration?: number;
@@ -442,6 +456,7 @@ function SideSheet({
442
456
  onDismiss: () => void;
443
457
  side: DialogSidePlacement;
444
458
  width: number;
459
+ minSideGutter?: number;
445
460
  inset?: DialogInset;
446
461
  dismissOnBackdrop: boolean;
447
462
  contentPadding: number;
@@ -461,6 +476,7 @@ function SideSheet({
461
476
  style?: StyleProp<ViewStyle>;
462
477
  children: React.ReactNode;
463
478
  }) {
479
+ const motion = useSurfaceTransition(transition);
464
480
  const dialogMessages = useMessages(DIALOG_MESSAGES).messages;
465
481
  const theme = useTheme();
466
482
  const { width: viewportWidth } = useWindowDimensions();
@@ -484,9 +500,8 @@ function SideSheet({
484
500
  const oppositeInset = edge === 'left' ? insetRight : insetLeft;
485
501
 
486
502
  const sideWidth = useMemo(() => {
487
- const available = viewportWidth - anchorInset - oppositeInset - SIDE_SHEET_MIN_GUTTER;
488
- return Math.max(0, Math.min(width, available));
489
- }, [viewportWidth, anchorInset, oppositeInset, width]);
503
+ return resolveSideSheetWidth(viewportWidth, width, anchorInset, oppositeInset, minSideGutter);
504
+ }, [viewportWidth, anchorInset, oppositeInset, width, minSideGutter]);
490
505
 
491
506
  // Travel distance for the hidden state: the panel's measured width, with the
492
507
  // geometry target as the pre-measurement fallback.
@@ -502,7 +517,7 @@ function SideSheet({
502
517
 
503
518
  useEffect(() => {
504
519
  cancelAnimation(progress);
505
- const timing = { ...MOTION_RECIPES[open ? 'present' : 'dismiss'], duration: presentation === 'custom' ? exitDuration ?? 0 : ANIMATION_DURATION, easing: Easing.out(Easing.cubic) };
520
+ const timing = { ...MOTION_RECIPES[open ? 'present' : 'dismiss'], duration: presentation === 'custom' ? exitDuration ?? 0 : motion.duration ?? ANIMATION_DURATION, easing: transition ? motion.easing : Easing.out(Easing.cubic) };
506
521
  if (open) {
507
522
  setMounted(true);
508
523
  progress.value = withTiming(1, timing);
@@ -512,7 +527,7 @@ function SideSheet({
512
527
  progress.value = withTiming(0, timing, (finished) => {
513
528
  if (finished) runOnJS(finishClose)();
514
529
  });
515
- }, [open, mounted, progress, finishClose, presentation, exitDuration]);
530
+ }, [open, mounted, progress, finishClose, presentation, exitDuration, motion.duration, motion.easing, !!transition]);
516
531
 
517
532
  const handleBackdropPress = useCallback(() => {
518
533
  if (dismissOnBackdrop) onHeaderDismiss();
@@ -573,13 +588,14 @@ function SideSheet({
573
588
  modal
574
589
  >
575
590
  <Backdrop
591
+ {...backdrop}
576
592
  testID={testID ? `${testID}-backdrop` : DIALOG_SHEET_BACKDROP_TESTID}
577
593
  accessibilityLabel={label ? dialogMessages.dismissNamed(label) : dialogMessages.dismissDialog}
578
594
  onPress={handleBackdropPress}
579
595
  disabled={!dismissOnBackdrop}
580
596
  progress={progress}
581
- dimOpacity={presentation === 'custom' ? 0 : undefined}
582
- blurIntensity={presentation === 'custom' ? 0 : undefined}
597
+ dimOpacity={presentation === 'custom' ? 0 : backdrop?.dimOpacity}
598
+ blurIntensity={presentation === 'custom' ? 0 : backdrop?.blurIntensity}
583
599
  style={sideStyles.backdrop}
584
600
  />
585
601
 
@@ -1,3 +1,4 @@
1
+ import { useSurfaceTransition } from '../motion/use-surface-transition';
1
2
  import { MOTION_RECIPES } from '../motion/recipes';
2
3
  import { surfaceStyle } from '../shapes/surface-style';
3
4
  import { SURFACE_SHAPES } from '../design-tokens/shapes';
@@ -66,7 +67,7 @@ import {
66
67
  DEFAULT_SIDE_WIDTH,
67
68
  DIALOG_SHEET_BACKDROP_TESTID,
68
69
  EASE_OUT,
69
- SIDE_SHEET_MIN_GUTTER,
70
+ resolveSideSheetWidth,
70
71
  useResolvedPlacement,
71
72
  physicalDialogSide,
72
73
  type DialogSidePlacement,
@@ -176,6 +177,8 @@ export function Dialog({ placement, ...rest }: DialogProps) {
176
177
  */
177
178
  function CenterOrSideDialog({
178
179
  material: surfaceMaterial = 'surface',
180
+ backdrop,
181
+ transition,
179
182
  control,
180
183
  open: controlledOpen,
181
184
  startOpen,
@@ -189,6 +192,7 @@ function CenterOrSideDialog({
189
192
  header,
190
193
  placement,
191
194
  width = DEFAULT_SIDE_WIDTH,
195
+ minSideGutter,
192
196
  maxWidth = DEFAULT_CENTER_MAX_WIDTH,
193
197
  inset,
194
198
  dismissOnBackdrop = true,
@@ -212,6 +216,7 @@ function CenterOrSideDialog({
212
216
  const dialogMessages = useMessages(DIALOG_MESSAGES).messages;
213
217
  // Controlled mode is opt-in: when `open` is a boolean the host owns the
214
218
  // visible state; otherwise the legacy imperative `control` path drives it.
219
+ const motion = useSurfaceTransition(transition);
215
220
  const isControlled = controlledOpen !== undefined;
216
221
  const resolvedPlacement = placement;
217
222
 
@@ -270,7 +275,7 @@ function CenterOrSideDialog({
270
275
  }, [isControlled, controlledOpen]);
271
276
 
272
277
  const exitDuration =
273
- presentation === 'custom' ? customExitDuration ?? 0 : resolvedPlacement === 'center' ? FADE_OUT_DURATION : ANIMATION_DURATION;
278
+ presentation === 'custom' ? customExitDuration ?? 0 : motion.duration ?? (resolvedPlacement === 'center' ? FADE_OUT_DURATION : ANIMATION_DURATION);
274
279
 
275
280
  useEffect(() => {
276
281
  if (!isClosing) return;
@@ -315,9 +320,9 @@ function CenterOrSideDialog({
315
320
  return;
316
321
  }
317
322
  backdropFade.value = isClosing
318
- ? withTiming(0, { ...MOTION_RECIPES.dismiss, duration: FADE_OUT_DURATION, easing: Easing.in(Easing.ease) })
319
- : withTiming(1, { ...MOTION_RECIPES.present, duration: BACKDROP_FADE_IN_DURATION, easing: Easing.out(Easing.ease) });
320
- }, [backdropFade, isOpen, isClosing]);
323
+ ? withTiming(0, { ...MOTION_RECIPES.dismiss, duration: motion.duration ?? FADE_OUT_DURATION, easing: transition ? motion.easing : Easing.in(Easing.ease) })
324
+ : withTiming(1, { ...MOTION_RECIPES.present, duration: motion.duration ?? BACKDROP_FADE_IN_DURATION, easing: transition ? motion.easing : Easing.out(Easing.ease) });
325
+ }, [backdropFade, isOpen, isClosing, motion.duration, motion.easing, !!transition]);
321
326
 
322
327
  useImperativeHandle(
323
328
  control?.ref,
@@ -365,8 +370,9 @@ function CenterOrSideDialog({
365
370
  // opacity animation on the blur's ancestor composites the group in
366
371
  // isolation and leaves `backdrop-filter` nothing to sample.
367
372
  progress={backdropFade}
368
- dimOpacity={presentation === 'custom' ? 0 : undefined}
369
- blurIntensity={presentation === 'custom' ? 0 : undefined}
373
+ {...backdrop}
374
+ dimOpacity={presentation === 'custom' ? 0 : backdrop?.dimOpacity}
375
+ blurIntensity={presentation === 'custom' ? 0 : backdrop?.blurIntensity}
370
376
  style={[{
371
377
  position: WEB_POSITION_FIXED,
372
378
  alignItems: 'center',
@@ -375,6 +381,7 @@ function CenterOrSideDialog({
375
381
  }, containerStyle]}
376
382
  >
377
383
  <DialogPanel
384
+ transition={transition}
378
385
  material={surfaceMaterial}
379
386
  presentation={presentation}
380
387
  panelRef={panelRef}
@@ -408,6 +415,8 @@ function CenterOrSideDialog({
408
415
  <ClosingContext.Provider value={isClosing}>
409
416
  <RemoveScrollBar />
410
417
  <SheetSurface
418
+ backdrop={backdrop}
419
+ transition={transition}
411
420
  material={surfaceMaterial}
412
421
  panelRef={panelRef}
413
422
  testID={testID}
@@ -419,6 +428,7 @@ function CenterOrSideDialog({
419
428
  scrollable={scrollable}
420
429
  placement={resolvedPlacement}
421
430
  shown={!isClosing}
431
+ minSideGutter={minSideGutter}
422
432
  width={width}
423
433
  inset={inset}
424
434
  dismissOnBackdrop={dismissOnBackdrop}
@@ -440,6 +450,7 @@ function CenterOrSideDialog({
440
450
 
441
451
  function DialogPanel({
442
452
  material: surfaceMaterial = 'surface',
453
+ transition,
443
454
  presentation,
444
455
  panelRef,
445
456
  testID,
@@ -458,6 +469,7 @@ function DialogPanel({
458
469
  children,
459
470
  }: {
460
471
  material?: DialogProps['material'];
472
+ transition?: DialogProps['transition'];
461
473
  presentation?: DialogProps['presentation'];
462
474
  panelRef: React.RefObject<View | null>;
463
475
  testID?: string;
@@ -475,6 +487,10 @@ function DialogPanel({
475
487
  isClosing: boolean;
476
488
  children?: React.ReactNode;
477
489
  }) {
490
+ const motion = useSurfaceTransition(transition);
491
+ const panelMotion: WebCssStyle | undefined = motion.duration === undefined ? undefined : {
492
+ animation: `${isClosing ? 'bloomDialogZoomFadeOut' : 'bloomDialogZoomFadeIn'} ${motion.cssEasing} ${motion.duration}ms${isClosing ? ' forwards' : ''}`,
493
+ };
478
494
  const theme = useTheme();
479
495
  const { close } = useDialogContext();
480
496
  const titleId = useId();
@@ -558,6 +574,7 @@ function DialogPanel({
558
574
  zIndex: Z_INDEX.raised,
559
575
  },
560
576
  presentation === 'custom' ? undefined : isClosing ? ZOOM_FADE_OUT : ZOOM_FADE_IN,
577
+ presentation === 'custom' ? undefined : panelMotion,
561
578
  // Drives `height` (and `maxWidth`) only while a morph is in flight; at
562
579
  // rest it resolves to `height: 'auto'` — the natural sizing above. Placed
563
580
  // before `style` so a consumer's explicit size still wins.
@@ -641,6 +658,8 @@ function DialogPanel({
641
658
  */
642
659
  function SheetSurface({
643
660
  material: surfaceMaterial = 'surface',
661
+ backdrop,
662
+ transition,
644
663
  panelRef,
645
664
  testID,
646
665
  label,
@@ -652,6 +671,7 @@ function SheetSurface({
652
671
  placement,
653
672
  shown,
654
673
  width,
674
+ minSideGutter,
655
675
  inset,
656
676
  dismissOnBackdrop,
657
677
  contentPadding,
@@ -664,6 +684,8 @@ function SheetSurface({
664
684
  children,
665
685
  }: {
666
686
  material?: DialogProps['material'];
687
+ backdrop?: DialogProps['backdrop'];
688
+ transition?: DialogProps['transition'];
667
689
  panelRef: React.RefObject<View | null>;
668
690
  testID?: string;
669
691
  label?: string;
@@ -675,6 +697,7 @@ function SheetSurface({
675
697
  placement: DialogSidePlacement;
676
698
  shown: boolean;
677
699
  width: number;
700
+ minSideGutter?: number;
678
701
  inset?: DialogInset;
679
702
  dismissOnBackdrop: boolean;
680
703
  contentPadding: number;
@@ -686,6 +709,7 @@ function SheetSurface({
686
709
  style?: StyleProp<ViewStyle>;
687
710
  children?: React.ReactNode;
688
711
  }) {
712
+ const motion = useSurfaceTransition(transition);
689
713
  const dialogMessages = useMessages(DIALOG_MESSAGES).messages;
690
714
  const theme = useTheme();
691
715
  const titleId = useId();
@@ -714,19 +738,19 @@ function SheetSurface({
714
738
  const panelTransition = useMemo<WebCssStyle>(
715
739
  () => ({
716
740
  transitionProperty: 'transform, opacity',
717
- transitionDuration: `${ANIMATION_DURATION}ms`,
718
- transitionTimingFunction: EASE_OUT,
741
+ transitionDuration: `${motion.duration ?? ANIMATION_DURATION}ms`,
742
+ transitionTimingFunction: transition ? motion.cssEasing : EASE_OUT,
719
743
  }),
720
- [],
744
+ [motion.duration, motion.cssEasing, !!transition],
721
745
  );
722
746
 
723
747
  const backdropTransition = useMemo<WebCssStyle>(
724
748
  () => ({
725
749
  transitionProperty: 'opacity',
726
- transitionDuration: `${ANIMATION_DURATION}ms`,
727
- transitionTimingFunction: EASE_OUT,
750
+ transitionDuration: `${motion.duration ?? ANIMATION_DURATION}ms`,
751
+ transitionTimingFunction: transition ? motion.cssEasing : EASE_OUT,
728
752
  }),
729
- [],
753
+ [motion.duration, motion.cssEasing, !!transition],
730
754
  );
731
755
 
732
756
  const panelGeometry = useMemo<ViewStyle>(() => {
@@ -740,8 +764,7 @@ function SheetSurface({
740
764
  const edge = physicalDialogSide(placement, rtl);
741
765
  const anchorInset = edge === 'left' ? insetLeft : insetRight;
742
766
  const oppositeInset = edge === 'left' ? insetRight : insetLeft;
743
- const available = viewportWidth - anchorInset - oppositeInset - SIDE_SHEET_MIN_GUTTER;
744
- const cappedWidth = Math.max(0, Math.min(width, available));
767
+ const cappedWidth = resolveSideSheetWidth(viewportWidth, width, anchorInset, oppositeInset, minSideGutter);
745
768
  const hiddenSign = edge === 'left' ? '-100%' : '100%';
746
769
 
747
770
  return {
@@ -753,7 +776,7 @@ function SheetSurface({
753
776
  transform: [{ translateX: visible ? 0 : hiddenSign }],
754
777
  opacity: visible ? 1 : 0,
755
778
  };
756
- }, [visible, placement, rtl, width, inset, viewportWidth]);
779
+ }, [visible, placement, rtl, width, inset, viewportWidth, minSideGutter]);
757
780
 
758
781
  const handleBackdropPress = useCallback(() => {
759
782
  if (dismissOnBackdrop) onDismiss();
@@ -773,6 +796,7 @@ function SheetSurface({
773
796
  <OverlayRoot style={[sheetStyles.root, containerStyle]} className={containerClassName} modal>
774
797
  <ModalKeyboard panelRef={panelRef} closing={!shown} dismissible={dismissOnBackdrop} dismiss={onDismiss} />
775
798
  <Backdrop
799
+ {...backdrop}
776
800
  testID={testID ? `${testID}-backdrop` : DIALOG_SHEET_BACKDROP_TESTID}
777
801
  accessibilityLabel={label ? dialogMessages.dismissNamed(label) : dialogMessages.dismissDialog}
778
802
  onPress={handleBackdropPress}
@@ -59,6 +59,8 @@ import type { DialogControlProps, DialogProps } from './types';
59
59
  * - `title` / `description` / `actions` / `children` → declarative body
60
60
  */
61
61
  export function DialogBottomSheet({
62
+ backdrop,
63
+ transition,
62
64
  control,
63
65
  open: controlledOpen,
64
66
  startOpen,
@@ -255,6 +257,8 @@ export function DialogBottomSheet({
255
257
 
256
258
  return (
257
259
  <BottomSheet
260
+ backdrop={backdrop}
261
+ transition={transition}
258
262
  material={surfaceMaterial}
259
263
  accessibilityLabel={label ?? header?.title}
260
264
  aria-labelledby={!header && title ? titleId : undefined}
@@ -386,6 +390,8 @@ const FILL_BOUNDED = { flex: 1, minHeight: 0 } as const;
386
390
  */
387
391
  export type DialogBottomSheetProps = Pick<
388
392
  DialogProps,
393
+ | 'backdrop'
394
+ | 'transition'
389
395
  | 'control'
390
396
  | 'open'
391
397
  | 'startOpen'
@@ -110,10 +110,18 @@ export const HANDLE_RADIUS = 3;
110
110
 
111
111
  /**
112
112
  * Minimum gutter kept between a wide side-sheet and the opposite viewport edge
113
- * when capping its width, so the panel never spans the full screen.
113
+ * when capping its width by default. Callers can opt into a zero gutter.
114
114
  */
115
115
  export const SIDE_SHEET_MIN_GUTTER = 24;
116
116
 
117
+ /** Shared native/web width cap; the gutter is separate from edge insets. */
118
+ export function resolveSideSheetWidth(viewportWidth: number, width: number, anchorInset: number,
119
+ oppositeInset: number, minSideGutter = SIDE_SHEET_MIN_GUTTER): number {
120
+ const gutter = Number.isFinite(minSideGutter) ? Math.max(0, minSideGutter) : SIDE_SHEET_MIN_GUTTER;
121
+ return Math.max(0, Math.min(width, viewportWidth - anchorInset - oppositeInset - gutter));
122
+ }
123
+
124
+
117
125
  /**
118
126
  * Resolve a (possibly responsive) `placement` to a concrete `DialogPlacement`
119
127
  * for the current viewport width.
@@ -1,3 +1,5 @@
1
+ import type { BackdropAppearance } from '../overlay/types';
2
+ import type { SurfaceTransition } from '../motion/types';
1
3
  import type { ReactNode } from 'react';
2
4
  import type { ButtonIconComponent } from '../button/types';
3
5
  import type { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native';
@@ -233,6 +235,10 @@ export type DialogAction = {
233
235
  export type DialogProps = React.PropsWithChildren<{
234
236
  /** Standard optical surface, or a plain fill without refraction/sheen. Default surface. */
235
237
  material?: 'surface' | 'flat';
238
+ /** Backdrop paint; the surface continues to own dismissal and layering. */
239
+ backdrop?: BackdropAppearance;
240
+ /** Opt-in timing for panel and backdrop. Live reduced motion settles immediately. */
241
+ transition?: SurfaceTransition;
236
242
  /** Content owns paint and motion; shared overlay, focus and dismissal remain. */
237
243
  presentation?: 'default' | 'custom';
238
244
  /** Custom presentation exit lifetime, in milliseconds. */
@@ -272,6 +278,8 @@ export type DialogProps = React.PropsWithChildren<{
272
278
  placement?: ResponsiveDialogPlacement;
273
279
  /** Side-sheet width (px) on wide screens. Defaults to `460`. */
274
280
  width?: number;
281
+ /** Minimum space beyond a side sheet and its insets. Defaults to 24; zero permits full viewport width. */
282
+ minSideGutter?: number;
275
283
  /** Centered-card max width (px). Defaults to `480`. */
276
284
  maxWidth?: number;
277
285
  /** Bottom-sheet max height as a fraction of the viewport height. Defaults to `0.9`. */
package/src/index.ts CHANGED
@@ -2142,3 +2142,5 @@ export * from './agent-avatar';
2142
2142
  export * from './agent-creator';
2143
2143
  export * from './project-board';
2144
2144
  export * from './multi-agent-chat';
2145
+
2146
+ export * from './viewport';
package/src/index.web.ts CHANGED
@@ -2147,3 +2147,5 @@ export * from './agent-avatar';
2147
2147
  export * from './agent-creator/index.web';
2148
2148
  export * from './project-board/index.web';
2149
2149
  export * from './multi-agent-chat/index.web';
2150
+
2151
+ export * from './viewport/index.web';
@@ -1,5 +1,5 @@
1
1
  export { ScaleAndFadeIn, ScaleAndFadeOut, ShrinkAndPop } from './motion';
2
2
  export { ScreenTransition } from './ScreenTransition';
3
- export type { ScreenTransitionProps, ScreenTransitionDirection } from './types';
3
+ export type { ScreenTransitionProps, ScreenTransitionDirection, SurfaceTransition } from './types';
4
4
  export { MOTION_RECIPES, animateMotion } from './recipes';
5
5
  export type { MotionIntent } from './recipes';
@@ -5,6 +5,6 @@
5
5
 
6
6
  export { ScaleAndFadeIn, ScaleAndFadeOut, ShrinkAndPop } from './motion.web';
7
7
  export { ScreenTransition } from './ScreenTransition';
8
- export type { ScreenTransitionProps, ScreenTransitionDirection } from './types';
8
+ export type { ScreenTransitionProps, ScreenTransitionDirection, SurfaceTransition } from './types';
9
9
  export { MOTION_RECIPES, animateMotion } from './recipes';
10
10
  export type { MotionIntent } from './recipes';
@@ -0,0 +1,15 @@
1
+ import type { SurfaceTransition } from './types';
2
+
3
+ const DEFAULT_EASING = [0.25, 0.1, 0.25, 1] as const;
4
+ /** Keeps identical CSS/Reanimated timing; invalid values preserve safe defaults. */
5
+ export function resolveSurfaceTransition(transition: SurfaceTransition | undefined) {
6
+ const candidate = transition?.easing;
7
+ const easing = candidate?.length === 4 && candidate.every(Number.isFinite)
8
+ && candidate[0] >= 0 && candidate[0] <= 1 && candidate[2] >= 0 && candidate[2] <= 1
9
+ ? candidate : DEFAULT_EASING;
10
+ return {
11
+ duration: Number.isFinite(transition?.duration) ? Math.max(0, transition!.duration) : 300,
12
+ easing,
13
+ cssEasing: `cubic-bezier(${easing.join(', ')})`,
14
+ };
15
+ }