@oxy.so/bloom 7.20.0 → 7.22.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/accordion.mdx +5 -0
  2. package/docs/adoption-matrix.mdx +9 -8
  3. package/docs/bottom-sheet.mdx +15 -0
  4. package/docs/collapsible.mdx +72 -0
  5. package/docs/dialog.mdx +49 -0
  6. package/docs/migrating-to-1.0.mdx +1 -1
  7. package/docs/overlay.mdx +18 -0
  8. package/docs/radio.mdx +15 -0
  9. package/lib/commonjs/accordion/Accordion.js +18 -45
  10. package/lib/commonjs/accordion/Accordion.js.map +1 -1
  11. package/lib/commonjs/accordion/Accordion.web.js +16 -53
  12. package/lib/commonjs/accordion/Accordion.web.js.map +1 -1
  13. package/lib/commonjs/accordion/use-accordion.js +3 -30
  14. package/lib/commonjs/accordion/use-accordion.js.map +1 -1
  15. package/lib/commonjs/bottom-sheet/BottomSheetBase.js +27 -10
  16. package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
  17. package/lib/commonjs/collapsible/Collapsible.js +22 -0
  18. package/lib/commonjs/collapsible/Collapsible.js.map +1 -0
  19. package/lib/commonjs/collapsible/Collapsible.web.js +22 -0
  20. package/lib/commonjs/collapsible/Collapsible.web.js.map +1 -0
  21. package/lib/commonjs/collapsible/CollapsibleFrame.js +97 -0
  22. package/lib/commonjs/collapsible/CollapsibleFrame.js.map +1 -0
  23. package/lib/commonjs/collapsible/CollapsibleFrame.web.js +116 -0
  24. package/lib/commonjs/collapsible/CollapsibleFrame.web.js.map +1 -0
  25. package/lib/commonjs/collapsible/context.js +15 -0
  26. package/lib/commonjs/collapsible/context.js.map +1 -0
  27. package/lib/commonjs/collapsible/frame-types.js +6 -0
  28. package/lib/commonjs/collapsible/frame-types.js.map +1 -0
  29. package/lib/commonjs/collapsible/index.js +13 -0
  30. package/lib/commonjs/collapsible/index.js.map +1 -0
  31. package/lib/commonjs/collapsible/index.web.js +13 -0
  32. package/lib/commonjs/collapsible/index.web.js.map +1 -0
  33. package/lib/commonjs/collapsible/types.js +6 -0
  34. package/lib/commonjs/collapsible/types.js.map +1 -0
  35. package/lib/commonjs/collapsible/use-collapsible-motion.js +60 -0
  36. package/lib/commonjs/collapsible/use-collapsible-motion.js.map +1 -0
  37. package/lib/commonjs/dialog/Dialog.js +16 -5
  38. package/lib/commonjs/dialog/Dialog.js.map +1 -1
  39. package/lib/commonjs/dialog/Dialog.web.js +32 -15
  40. package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
  41. package/lib/commonjs/dialog/DialogBottomSheet.js +4 -0
  42. package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
  43. package/lib/commonjs/index.js +12 -0
  44. package/lib/commonjs/index.js.map +1 -1
  45. package/lib/commonjs/index.web.js +12 -0
  46. package/lib/commonjs/index.web.js.map +1 -1
  47. package/lib/commonjs/motion/surface-transition.js +18 -0
  48. package/lib/commonjs/motion/surface-transition.js.map +1 -0
  49. package/lib/commonjs/motion/use-surface-transition.js +24 -0
  50. package/lib/commonjs/motion/use-surface-transition.js.map +1 -0
  51. package/lib/commonjs/overlay/Overlay.js +11 -11
  52. package/lib/commonjs/overlay/Overlay.js.map +1 -1
  53. package/lib/commonjs/overlay/backdrop-paint.js +34 -0
  54. package/lib/commonjs/overlay/backdrop-paint.js.map +1 -0
  55. package/lib/commonjs/radio/Radio.js +54 -26
  56. package/lib/commonjs/radio/Radio.js.map +1 -1
  57. package/lib/commonjs/radio/RadioCard.js +8 -1
  58. package/lib/commonjs/radio/RadioCard.js.map +1 -1
  59. package/lib/commonjs/radio/use-radio-group-item.js +3 -1
  60. package/lib/commonjs/radio/use-radio-group-item.js.map +1 -1
  61. package/lib/commonjs/select/Select.js +10 -5
  62. package/lib/commonjs/select/Select.js.map +1 -1
  63. package/lib/commonjs/select/Select.web.js +11 -3
  64. package/lib/commonjs/select/Select.web.js.map +1 -1
  65. package/lib/module/accordion/Accordion.js +19 -46
  66. package/lib/module/accordion/Accordion.js.map +1 -1
  67. package/lib/module/accordion/Accordion.web.js +17 -54
  68. package/lib/module/accordion/Accordion.web.js.map +1 -1
  69. package/lib/module/accordion/use-accordion.js +4 -31
  70. package/lib/module/accordion/use-accordion.js.map +1 -1
  71. package/lib/module/bottom-sheet/BottomSheetBase.js +27 -10
  72. package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
  73. package/lib/module/collapsible/Collapsible.js +17 -0
  74. package/lib/module/collapsible/Collapsible.js.map +1 -0
  75. package/lib/module/collapsible/Collapsible.web.js +17 -0
  76. package/lib/module/collapsible/Collapsible.web.js.map +1 -0
  77. package/lib/module/collapsible/CollapsibleFrame.js +92 -0
  78. package/lib/module/collapsible/CollapsibleFrame.js.map +1 -0
  79. package/lib/module/collapsible/CollapsibleFrame.web.js +111 -0
  80. package/lib/module/collapsible/CollapsibleFrame.web.js.map +1 -0
  81. package/lib/module/collapsible/context.js +11 -0
  82. package/lib/module/collapsible/context.js.map +1 -0
  83. package/lib/module/collapsible/frame-types.js +4 -0
  84. package/lib/module/collapsible/frame-types.js.map +1 -0
  85. package/lib/module/collapsible/index.js +4 -0
  86. package/lib/module/collapsible/index.js.map +1 -0
  87. package/lib/module/collapsible/index.web.js +9 -0
  88. package/lib/module/collapsible/index.web.js.map +1 -0
  89. package/lib/module/collapsible/types.js +4 -0
  90. package/lib/module/collapsible/types.js.map +1 -0
  91. package/lib/module/collapsible/use-collapsible-motion.js +55 -0
  92. package/lib/module/collapsible/use-collapsible-motion.js.map +1 -0
  93. package/lib/module/dialog/Dialog.js +16 -5
  94. package/lib/module/dialog/Dialog.js.map +1 -1
  95. package/lib/module/dialog/Dialog.web.js +32 -15
  96. package/lib/module/dialog/Dialog.web.js.map +1 -1
  97. package/lib/module/dialog/DialogBottomSheet.js +4 -0
  98. package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
  99. package/lib/module/index.js +1 -0
  100. package/lib/module/index.js.map +1 -1
  101. package/lib/module/index.web.js +1 -0
  102. package/lib/module/index.web.js.map +1 -1
  103. package/lib/module/motion/surface-transition.js +14 -0
  104. package/lib/module/motion/surface-transition.js.map +1 -0
  105. package/lib/module/motion/use-surface-transition.js +20 -0
  106. package/lib/module/motion/use-surface-transition.js.map +1 -0
  107. package/lib/module/overlay/Overlay.js +11 -11
  108. package/lib/module/overlay/Overlay.js.map +1 -1
  109. package/lib/module/overlay/backdrop-paint.js +29 -0
  110. package/lib/module/overlay/backdrop-paint.js.map +1 -0
  111. package/lib/module/radio/Radio.js +54 -26
  112. package/lib/module/radio/Radio.js.map +1 -1
  113. package/lib/module/radio/RadioCard.js +8 -1
  114. package/lib/module/radio/RadioCard.js.map +1 -1
  115. package/lib/module/radio/use-radio-group-item.js +3 -1
  116. package/lib/module/radio/use-radio-group-item.js.map +1 -1
  117. package/lib/module/select/Select.js +7 -2
  118. package/lib/module/select/Select.js.map +1 -1
  119. package/lib/module/select/Select.web.js +11 -3
  120. package/lib/module/select/Select.web.js.map +1 -1
  121. package/lib/typescript/commonjs/accordion/Accordion.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/accordion/Accordion.web.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/accordion/use-accordion.d.ts +2 -3
  124. package/lib/typescript/commonjs/accordion/use-accordion.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/bottom-sheet/types.d.ts +6 -0
  127. package/lib/typescript/commonjs/bottom-sheet/types.d.ts.map +1 -1
  128. package/lib/typescript/commonjs/collapsible/Collapsible.d.ts +4 -0
  129. package/lib/typescript/commonjs/collapsible/Collapsible.d.ts.map +1 -0
  130. package/lib/typescript/commonjs/collapsible/Collapsible.web.d.ts +4 -0
  131. package/lib/typescript/commonjs/collapsible/Collapsible.web.d.ts.map +1 -0
  132. package/lib/typescript/commonjs/collapsible/CollapsibleFrame.d.ts +7 -0
  133. package/lib/typescript/commonjs/collapsible/CollapsibleFrame.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/collapsible/CollapsibleFrame.web.d.ts +3 -0
  135. package/lib/typescript/commonjs/collapsible/CollapsibleFrame.web.d.ts.map +1 -0
  136. package/lib/typescript/commonjs/collapsible/context.d.ts +4 -0
  137. package/lib/typescript/commonjs/collapsible/context.d.ts.map +1 -0
  138. package/lib/typescript/commonjs/collapsible/frame-types.d.ts +11 -0
  139. package/lib/typescript/commonjs/collapsible/frame-types.d.ts.map +1 -0
  140. package/lib/typescript/commonjs/collapsible/index.d.ts +3 -0
  141. package/lib/typescript/commonjs/collapsible/index.d.ts.map +1 -0
  142. package/lib/typescript/commonjs/collapsible/index.web.d.ts +3 -0
  143. package/lib/typescript/commonjs/collapsible/index.web.d.ts.map +1 -0
  144. package/lib/typescript/commonjs/collapsible/types.d.ts +24 -0
  145. package/lib/typescript/commonjs/collapsible/types.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/collapsible/use-collapsible-motion.d.ts +9 -0
  147. package/lib/typescript/commonjs/collapsible/use-collapsible-motion.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
  150. package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts +2 -2
  151. package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -1
  152. package/lib/typescript/commonjs/dialog/types.d.ts +6 -0
  153. package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
  154. package/lib/typescript/commonjs/index.d.ts +1 -0
  155. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  156. package/lib/typescript/commonjs/index.web.d.ts +1 -0
  157. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  158. package/lib/typescript/commonjs/motion/index.d.ts +1 -1
  159. package/lib/typescript/commonjs/motion/index.d.ts.map +1 -1
  160. package/lib/typescript/commonjs/motion/index.web.d.ts +1 -1
  161. package/lib/typescript/commonjs/motion/index.web.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/motion/surface-transition.d.ts +8 -0
  163. package/lib/typescript/commonjs/motion/surface-transition.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/motion/types.d.ts +7 -0
  165. package/lib/typescript/commonjs/motion/types.d.ts.map +1 -1
  166. package/lib/typescript/commonjs/motion/use-surface-transition.d.ts +9 -0
  167. package/lib/typescript/commonjs/motion/use-surface-transition.d.ts.map +1 -0
  168. package/lib/typescript/commonjs/overlay/Overlay.d.ts.map +1 -1
  169. package/lib/typescript/commonjs/overlay/backdrop-paint.d.ts +7 -0
  170. package/lib/typescript/commonjs/overlay/backdrop-paint.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/overlay/index.d.ts +1 -1
  172. package/lib/typescript/commonjs/overlay/index.d.ts.map +1 -1
  173. package/lib/typescript/commonjs/overlay/types.d.ts +23 -9
  174. package/lib/typescript/commonjs/overlay/types.d.ts.map +1 -1
  175. package/lib/typescript/commonjs/radio/Radio.d.ts.map +1 -1
  176. package/lib/typescript/commonjs/radio/RadioCard.d.ts +1 -1
  177. package/lib/typescript/commonjs/radio/RadioCard.d.ts.map +1 -1
  178. package/lib/typescript/commonjs/radio/index.d.ts +1 -1
  179. package/lib/typescript/commonjs/radio/index.d.ts.map +1 -1
  180. package/lib/typescript/commonjs/radio/types.d.ts +16 -2
  181. package/lib/typescript/commonjs/radio/types.d.ts.map +1 -1
  182. package/lib/typescript/commonjs/radio/use-radio-group-item.d.ts +17 -1
  183. package/lib/typescript/commonjs/radio/use-radio-group-item.d.ts.map +1 -1
  184. package/lib/typescript/commonjs/select/Select.d.ts.map +1 -1
  185. package/lib/typescript/commonjs/select/Select.web.d.ts.map +1 -1
  186. package/lib/typescript/module/accordion/Accordion.d.ts.map +1 -1
  187. package/lib/typescript/module/accordion/Accordion.web.d.ts.map +1 -1
  188. package/lib/typescript/module/accordion/use-accordion.d.ts +2 -3
  189. package/lib/typescript/module/accordion/use-accordion.d.ts.map +1 -1
  190. package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
  191. package/lib/typescript/module/bottom-sheet/types.d.ts +6 -0
  192. package/lib/typescript/module/bottom-sheet/types.d.ts.map +1 -1
  193. package/lib/typescript/module/collapsible/Collapsible.d.ts +4 -0
  194. package/lib/typescript/module/collapsible/Collapsible.d.ts.map +1 -0
  195. package/lib/typescript/module/collapsible/Collapsible.web.d.ts +4 -0
  196. package/lib/typescript/module/collapsible/Collapsible.web.d.ts.map +1 -0
  197. package/lib/typescript/module/collapsible/CollapsibleFrame.d.ts +7 -0
  198. package/lib/typescript/module/collapsible/CollapsibleFrame.d.ts.map +1 -0
  199. package/lib/typescript/module/collapsible/CollapsibleFrame.web.d.ts +3 -0
  200. package/lib/typescript/module/collapsible/CollapsibleFrame.web.d.ts.map +1 -0
  201. package/lib/typescript/module/collapsible/context.d.ts +4 -0
  202. package/lib/typescript/module/collapsible/context.d.ts.map +1 -0
  203. package/lib/typescript/module/collapsible/frame-types.d.ts +11 -0
  204. package/lib/typescript/module/collapsible/frame-types.d.ts.map +1 -0
  205. package/lib/typescript/module/collapsible/index.d.ts +3 -0
  206. package/lib/typescript/module/collapsible/index.d.ts.map +1 -0
  207. package/lib/typescript/module/collapsible/index.web.d.ts +3 -0
  208. package/lib/typescript/module/collapsible/index.web.d.ts.map +1 -0
  209. package/lib/typescript/module/collapsible/types.d.ts +24 -0
  210. package/lib/typescript/module/collapsible/types.d.ts.map +1 -0
  211. package/lib/typescript/module/collapsible/use-collapsible-motion.d.ts +9 -0
  212. package/lib/typescript/module/collapsible/use-collapsible-motion.d.ts.map +1 -0
  213. package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
  214. package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
  215. package/lib/typescript/module/dialog/DialogBottomSheet.d.ts +2 -2
  216. package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -1
  217. package/lib/typescript/module/dialog/types.d.ts +6 -0
  218. package/lib/typescript/module/dialog/types.d.ts.map +1 -1
  219. package/lib/typescript/module/index.d.ts +1 -0
  220. package/lib/typescript/module/index.d.ts.map +1 -1
  221. package/lib/typescript/module/index.web.d.ts +1 -0
  222. package/lib/typescript/module/index.web.d.ts.map +1 -1
  223. package/lib/typescript/module/motion/index.d.ts +1 -1
  224. package/lib/typescript/module/motion/index.d.ts.map +1 -1
  225. package/lib/typescript/module/motion/index.web.d.ts +1 -1
  226. package/lib/typescript/module/motion/index.web.d.ts.map +1 -1
  227. package/lib/typescript/module/motion/surface-transition.d.ts +8 -0
  228. package/lib/typescript/module/motion/surface-transition.d.ts.map +1 -0
  229. package/lib/typescript/module/motion/types.d.ts +7 -0
  230. package/lib/typescript/module/motion/types.d.ts.map +1 -1
  231. package/lib/typescript/module/motion/use-surface-transition.d.ts +9 -0
  232. package/lib/typescript/module/motion/use-surface-transition.d.ts.map +1 -0
  233. package/lib/typescript/module/overlay/Overlay.d.ts.map +1 -1
  234. package/lib/typescript/module/overlay/backdrop-paint.d.ts +7 -0
  235. package/lib/typescript/module/overlay/backdrop-paint.d.ts.map +1 -0
  236. package/lib/typescript/module/overlay/index.d.ts +1 -1
  237. package/lib/typescript/module/overlay/index.d.ts.map +1 -1
  238. package/lib/typescript/module/overlay/types.d.ts +23 -9
  239. package/lib/typescript/module/overlay/types.d.ts.map +1 -1
  240. package/lib/typescript/module/radio/Radio.d.ts.map +1 -1
  241. package/lib/typescript/module/radio/RadioCard.d.ts +1 -1
  242. package/lib/typescript/module/radio/RadioCard.d.ts.map +1 -1
  243. package/lib/typescript/module/radio/index.d.ts +1 -1
  244. package/lib/typescript/module/radio/index.d.ts.map +1 -1
  245. package/lib/typescript/module/radio/types.d.ts +16 -2
  246. package/lib/typescript/module/radio/types.d.ts.map +1 -1
  247. package/lib/typescript/module/radio/use-radio-group-item.d.ts +17 -1
  248. package/lib/typescript/module/radio/use-radio-group-item.d.ts.map +1 -1
  249. package/lib/typescript/module/select/Select.d.ts.map +1 -1
  250. package/lib/typescript/module/select/Select.web.d.ts.map +1 -1
  251. package/package.json +23 -1
  252. package/src/accordion/Accordion.tsx +7 -60
  253. package/src/accordion/Accordion.web.tsx +8 -32
  254. package/src/accordion/use-accordion.ts +4 -21
  255. package/src/bottom-sheet/BottomSheetBase.tsx +18 -8
  256. package/src/bottom-sheet/types.ts +6 -0
  257. package/src/collapsible/Collapsible.tsx +15 -0
  258. package/src/collapsible/Collapsible.web.tsx +15 -0
  259. package/src/collapsible/CollapsibleFrame.tsx +120 -0
  260. package/src/collapsible/CollapsibleFrame.web.tsx +131 -0
  261. package/src/collapsible/context.ts +8 -0
  262. package/src/collapsible/frame-types.ts +14 -0
  263. package/src/collapsible/index.ts +2 -0
  264. package/src/collapsible/index.web.ts +7 -0
  265. package/src/collapsible/types.ts +22 -0
  266. package/src/collapsible/use-collapsible-motion.ts +61 -0
  267. package/src/dialog/Dialog.tsx +17 -4
  268. package/src/dialog/Dialog.web.tsx +33 -12
  269. package/src/dialog/DialogBottomSheet.tsx +6 -0
  270. package/src/dialog/types.ts +6 -0
  271. package/src/index.ts +2 -0
  272. package/src/index.web.ts +2 -0
  273. package/src/motion/index.ts +1 -1
  274. package/src/motion/index.web.ts +1 -1
  275. package/src/motion/surface-transition.ts +15 -0
  276. package/src/motion/types.ts +8 -0
  277. package/src/motion/use-surface-transition.ts +14 -0
  278. package/src/overlay/Overlay.tsx +12 -8
  279. package/src/overlay/backdrop-paint.ts +25 -0
  280. package/src/overlay/index.ts +1 -1
  281. package/src/overlay/types.ts +22 -9
  282. package/src/radio/Radio.tsx +31 -12
  283. package/src/radio/RadioCard.tsx +3 -2
  284. package/src/radio/index.ts +1 -1
  285. package/src/radio/types.ts +17 -2
  286. package/src/radio/use-radio-group-item.ts +2 -2
  287. package/src/select/Select.tsx +5 -2
  288. package/src/select/Select.web.tsx +7 -3
@@ -104,3 +104,8 @@ measurable. If a controlled collapse hides the focused field, focus returns to
104
104
  its trigger. Native uses the corresponding hidden-descendant accessibility
105
105
  properties. Input values therefore survive a close/open cycle without leaving
106
106
  closed fields in keyboard navigation.
107
+
108
+ For a body controlled by an existing option rather than a disclosure button, use
109
+ [Collapsible](./collapsible.mdx). It shares the measured frame while avoiding a
110
+ fabricated trigger or missing `aria-labelledby` target. Accordion keeps its
111
+ spring defaults, linked region, trigger semantics and content padding.
@@ -32,7 +32,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
32
32
 
33
33
  ## Totals
34
34
 
35
- - **213 families** in `src/`, **211** published (a subpath, the root barrel, or both). **48** carry a web fork.
35
+ - **214 families** in `src/`, **212** published (a subpath, the root barrel, or both). **49** carry a web fork.
36
36
  - Docs, stories and suites are gated as a standard by `src/__tests__/family-coverage.test.ts`; the per-family counts are in the table below.
37
37
 
38
38
  | contract | applies to | reads | delegated | n/a¹ | adaptation |
@@ -156,6 +156,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
156
156
  | `checkout-summary` | `@oxy.so/bloom/checkout-summary` + barrel | universal | `checkout-summary.mdx` | yes | 2 | | | | |
157
157
  | `chip` | `@oxy.so/bloom/chip` + barrel | universal | `chip.mdx` | yes | 7 | | reads | | |
158
158
  | `code` | `@oxy.so/bloom/code` + barrel | universal | `code.mdx` | yes | 4 | | | | |
159
+ | `collapsible` | `@oxy.so/bloom/collapsible` + barrel | web fork | `collapsible.mdx` | yes | 4 | | | | |
159
160
  | `command` | `@oxy.so/bloom/command` + barrel | web fork | `command.mdx` | yes | 2 | n/a¹ | | | reads |
160
161
  | `composer-loader` | `@oxy.so/bloom/composer-loader` + barrel | web fork | `composer-loader.mdx` | yes | 1 | | | | |
161
162
  | `composer-panel` | `@oxy.so/bloom/composer-panel` + barrel | web fork | `composer-panel.mdx` | yes | 6 | n/a¹ | | | reads |
@@ -171,7 +172,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
171
172
  | `date-picker` | `@oxy.so/bloom/date-picker` + barrel | universal | `date-picker.mdx` | yes | 5 | reads | reads | | reads |
172
173
  | `delivery-slot` | `@oxy.so/bloom/delivery-slot` + barrel | universal | `delivery-slot.mdx` | yes | 2 | reads | | | |
173
174
  | `design-tokens` | `@oxy.so/bloom/design-tokens` + barrel | universal | `design-tokens.mdx` | yes | 6 | | | | |
174
- | `dialog` | `@oxy.so/bloom/dialog` + barrel | web fork | `dialog.mdx` | yes | 25 | | | | |
175
+ | `dialog` | `@oxy.so/bloom/dialog` + barrel | web fork | `dialog.mdx` | yes | 27 | | | | |
175
176
  | `directions` | `@oxy.so/bloom/directions` + barrel | universal | `directions.mdx` | yes | 3 | | | | |
176
177
  | `divider` | `@oxy.so/bloom/divider` + barrel | universal | `divider.mdx` | yes | 1 | | | | |
177
178
  | `dropdown-menu` | `@oxy.so/bloom/dropdown-menu` + barrel | web fork | `dropdown-menu.mdx` | yes | 5 | | | reads | reads |
@@ -189,7 +190,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
189
190
  | `glass` | internal | universal | `glass.mdx` | — | 2 | | | | |
190
191
  | `grid` | `@oxy.so/bloom/grid` + barrel | universal | `grid.mdx` | yes | 1 | | | | |
191
192
  | `home-search` | `@oxy.so/bloom/home-search` + barrel | universal | `home-search.mdx` | yes | 2 | n/a¹ | | | |
192
- | `hooks` | `@oxy.so/bloom/hooks` + barrel | universal | `hooks.mdx` | yes | 15 | | | | reads |
193
+ | `hooks` | `@oxy.so/bloom/hooks` + barrel | universal | `hooks.mdx` | yes | 19 | | | | reads |
193
194
  | `hover-card` | `@oxy.so/bloom/hover-card` + barrel | web fork | `hover-card.mdx` | yes | 4 | | | reads | reads |
194
195
  | `icon-circle` | `@oxy.so/bloom/icon-circle` + barrel | universal | `icon-circle.mdx` | yes | 1 | | | | |
195
196
  | `icons` | `@oxy.so/bloom/icons` + barrel | universal | `icons.mdx` | yes | 62 | | | | |
@@ -231,7 +232,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
231
232
  | `menubar` | `@oxy.so/bloom/menubar` + barrel | web fork | `menubar.mdx` | yes | 5 | | | reads | reads |
232
233
  | `message-bubble` | `@oxy.so/bloom/message-bubble` + barrel | universal | `message-bubble.mdx` | yes | 2 | | | | |
233
234
  | `message-media` | `@oxy.so/bloom/message-media` + barrel | universal | `message-media.mdx` | yes | 3 | n/a¹ | | | |
234
- | `motion` | `@oxy.so/bloom/motion` + barrel | web fork | `motion.mdx` | yes | 4 | | | | |
235
+ | `motion` | `@oxy.so/bloom/motion` + barrel | web fork | `motion.mdx` | yes | 5 | | | | |
235
236
  | `multi-agent-chat` | `@oxy.so/bloom/multi-agent-chat` + barrel | web fork | `multi-agent-chat.mdx` | yes | 4 | | | | |
236
237
  | `music-library` | `@oxy.so/bloom/music-library` + barrel | universal | `music-library.mdx` | yes | 4 | n/a¹ | | | |
237
238
  | `navigation-banner` | `@oxy.so/bloom/navigation-banner` + barrel | universal | `navigation-banner.mdx` | yes | 2 | | | | |
@@ -243,7 +244,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
243
244
  | `order-confirmation` | `@oxy.so/bloom/order-confirmation` + barrel | universal | `order-confirmation.mdx` | yes | 1 | | | | |
244
245
  | `order-status` | `@oxy.so/bloom/order-status` + barrel | universal | `order-status.mdx` | yes | 1 | | | | |
245
246
  | `outline-nav` | `@oxy.so/bloom/outline-nav` + barrel | universal | `outline-nav.mdx` | yes | 2 | | | | |
246
- | `overlay` | `@oxy.so/bloom/overlay` + barrel | universal | `overlay.mdx` | yes | 21 | | | | |
247
+ | `overlay` | `@oxy.so/bloom/overlay` + barrel | universal | `overlay.mdx` | yes | 22 | | | | |
247
248
  | `page-footer` | `@oxy.so/bloom/page-footer` + barrel | universal | `page-footer.mdx` | yes | 3 | | | | |
248
249
  | `page-header` | `@oxy.so/bloom/page-header` + barrel | universal | `page-header.mdx` | yes | 8 | | | | |
249
250
  | `pagination` | `@oxy.so/bloom/pagination` + barrel | universal | `pagination.mdx` | yes | 2 | | | | |
@@ -257,7 +258,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
257
258
  | `place-list` | `@oxy.so/bloom/place-list` + barrel | universal | `place-list.mdx` | yes | 2 | | | | |
258
259
  | `place-reviews` | `@oxy.so/bloom/place-reviews` + barrel | universal | `place-reviews.mdx` | yes | 2 | | | | reads |
259
260
  | `popover` | `@oxy.so/bloom/popover` + barrel | web fork | `popover.mdx` | yes | 10 | | | reads | reads |
260
- | `portal` | `@oxy.so/bloom/portal` + barrel | web fork | `portal.mdx` | yes | 24 | | | | |
261
+ | `portal` | `@oxy.so/bloom/portal` + barrel | web fork | `portal.mdx` | yes | 25 | | | | |
261
262
  | `pressable-scale` | `@oxy.so/bloom/pressable-scale` + barrel | universal | `pressable-scale.mdx` | yes | 1 | | | | |
262
263
  | `price-breakdown` | `@oxy.so/bloom/price-breakdown` + barrel | universal | `price-breakdown.mdx` | yes | 3 | | | | reads |
263
264
  | `progressive-blur` | `@oxy.so/bloom/progressive-blur` + barrel | web fork | `progressive-blur.mdx` | yes | 1 | | | | |
@@ -277,7 +278,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
277
278
  | `scroll` | `@oxy.so/bloom/scroll` + barrel | web fork | `scroll.mdx` | yes | 5 | | | | |
278
279
  | `search` | `@oxy.so/bloom/search` + barrel | universal | `search.mdx` | yes | 6 | reads | | | |
279
280
  | `segmented-control` | `@oxy.so/bloom/segmented-control` + barrel | universal | `segmented-control.mdx` | yes | 4 | reads | reads | | |
280
- | `select` | `@oxy.so/bloom/select` + barrel | web fork | `select.mdx` | yes | 11 | reads | reads | reads | reads |
281
+ | `select` | `@oxy.so/bloom/select` + barrel | web fork | `select.mdx` | yes | 12 | reads | reads | reads | reads |
281
282
  | `settings-list` | `@oxy.so/bloom/settings-list` + barrel | universal | `settings-list.mdx` | yes | 5 | | | | |
282
283
  | `settings-modal` | `@oxy.so/bloom/settings-modal` + barrel | universal | `settings-modal.mdx` | yes | 11 | | | | reads |
283
284
  | `shapes` | `@oxy.so/bloom/shapes` + barrel | universal | `shapes.mdx` | yes | 4 | | | | |
@@ -308,7 +309,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
308
309
  | `tenancy` | `@oxy.so/bloom/tenancy` + barrel | universal | `tenancy.mdx` | yes | 5 | | reads | | |
309
310
  | `text-field` | `@oxy.so/bloom/text-field` + barrel | universal | `text-field.mdx` | yes | 17 | reads | reads | | |
310
311
  | `textarea` | `@oxy.so/bloom/textarea` + barrel | universal | `textarea.mdx` | yes | 4 | reads | reads | | n/a¹ |
311
- | `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes | 374 | | | n/a¹ | reads |
312
+ | `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes | 376 | | | n/a¹ | reads |
312
313
  | `theme-toggle` | `@oxy.so/bloom/theme-toggle` + barrel | universal | `theme-toggle.mdx` | yes | 2 | n/a¹ | | | |
313
314
  | `toast` | `@oxy.so/bloom/toast` + barrel | universal | `toast.mdx` | yes | 17 | | | | |
314
315
  | `tooltip` | `@oxy.so/bloom/tooltip` + barrel | web fork | `tooltip.mdx` | yes | 1 | | | | |
@@ -120,3 +120,18 @@ The sheet panel exposes `role="dialog"` and `aria-modal="true"` and contains bot
120
120
  its scrolling content and header overlay. Set `accessibilityLabel`, or associate
121
121
  an existing heading using `aria-labelledby`; `aria-describedby` associates
122
122
  supporting text. These attributes name the same panel that owns keyboard focus.
123
+
124
+ ### Paint and timed presentation
125
+
126
+ `backdrop?: BackdropAppearance` forwards paint to the shared Backdrop, including
127
+ logical gradients and optional zero blur. `backdrop.dimOpacity`, when supplied,
128
+ takes precedence over the legacy `backdropOpacity`; omitting it preserves that
129
+ prop. A custom `backdropComponent` still owns its rendering instead.
130
+
131
+ `transition?: SurfaceTransition` (`duration` in milliseconds, optional
132
+ `easing: [x1,y1,x2,y2]`) replaces the panel's presentation/dismissal spring and
133
+ backdrop fade with the same timed curve. Drag tracking and cancelled-drag
134
+ springs remain unchanged. Reduced motion, including live OS changes, settles
135
+ presentation or dismissal immediately. Omitting `transition` retains existing
136
+ spring/timing defaults. See [Dialog](./dialog.mdx#backdrop-paint-and-timed-presentation)
137
+ for normalization rules and a full example.
@@ -0,0 +1,72 @@
1
+ ---
2
+ title: Collapsible
3
+ description: A controlled measured reveal with no fabricated disclosure trigger.
4
+ order: 29
5
+ ---
6
+
7
+ # Collapsible
8
+
9
+ Use `Collapsible` when an existing control owns whether a body is shown, such as
10
+ an option in a radio group. Use `Accordion` for labelled disclosure sections with
11
+ their own toggle buttons. Both share the same measured frame and motion owner.
12
+
13
+ ```tsx
14
+ import { RadioGroup } from '@oxy.so/bloom/radio';
15
+ import { Collapsible } from '@oxy.so/bloom/collapsible';
16
+
17
+ <RadioGroup
18
+ label="Delivery plan"
19
+ value={plan}
20
+ onValueChange={setPlan}
21
+ options={[
22
+ { value: 'once', label: 'One delivery' },
23
+ { value: 'repeat', label: 'Repeat delivery' },
24
+ ]}
25
+ renderOption={(option, control, { checked, controlRef }) => (
26
+ <View>
27
+ {control}
28
+ {option.value === 'repeat' && (
29
+ <Collapsible open={checked} returnFocusRef={controlRef}>
30
+ <FrequencySelect />
31
+ <TextInput accessibilityLabel="Delivery note" />
32
+ </Collapsible>
33
+ )}
34
+ </View>
35
+ )}
36
+ />
37
+ ```
38
+
39
+ Render the owned radio once, unchanged. The body and its interactive controls are
40
+ siblings of the radio, never children of its decorative label.
41
+
42
+ | Prop | Ownership |
43
+ | --- | --- |
44
+ | `open` | Required controlled visibility; no internal toggle or default state. |
45
+ | `transition` | `{ duration, easing? }`, milliseconds and cubic-bezier coordinates. Defaults to 300ms and `[.42, 0, .58, 1]`. Duration is clamped non-negative; invalid values use the standard motion defaults. |
46
+ | `returnFocusRef` | DOM or native focusable host to receive focus only when closing content owned it. Accepts `RadioOptionState.controlRef` directly. |
47
+ | `className`, `style` | Outer frame, the node its parent lays out. Height clipping and opacity are animated by Bloom. |
48
+ | `contentClassName`, `contentStyle` | Measured body; place padding/gaps and content decoration here. |
49
+ | `nativeID`, `testID` | Outer host identity. No role or labelled-by relationship is invented. |
50
+
51
+ The inner body's natural height is measured again when content or width changes;
52
+ there is no fixed maximum height. Children stay mounted so edits and selections
53
+ survive closure. Web uses `inert` and `aria-hidden` immediately. Native disables
54
+ pointer interaction and removes descendants from accessibility immediately, then
55
+ removes the body from layout when the exit finishes. Live reduced motion cancels
56
+ active animation and settles the body immediately. No global `LayoutAnimation`
57
+ configuration is changed.
58
+
59
+ Focus return never overrides deliberate focus outside. On web it includes
60
+ logical descendants through React portals and can fall back to the outside
61
+ focus captured when opening. Native observes hardware/control focus and the
62
+ public currently focused TextInput API; supply `returnFocusRef` there. React
63
+ Native does not expose the current VoiceOver/TalkBack cursor, so cursor-only
64
+ focus cannot be detected without stealing unrelated accessibility focus.
65
+
66
+ A nested Bloom `Select` closes its portaled popup when its body becomes hidden;
67
+ its selected value survives and its popup stays closed on reopening. A custom
68
+ portaled control must likewise coordinate its own open state with visibility.
69
+
70
+ The old pre-1.0 `Collapsible` implementation was removed for a module-scope
71
+ Android layout-animation side effect. The controlled API introduced in 7.22 is
72
+ a new implementation and does not restore that behavior or the old props.
package/docs/dialog.mdx CHANGED
@@ -368,3 +368,52 @@ Standalone `BottomSheet` exposes the same material option with `backgroundFill`;
368
368
  an explicit `backgroundComponent` remains authoritative.
369
369
 
370
370
  `minSideGutter` controls the minimum opposite-edge space when capping a side sheet’s width (default 24px). Pass `0` with a viewport-sized `width` for a full-width side sheet. Insets are still subtracted; negative gutters clamp to zero and non-finite gutters use the default. This applies to both physical and logical side placements on web and native; center/bottom geometry is unchanged.
371
+
372
+ ## Backdrop paint and timed presentation
373
+
374
+ `backdrop?: BackdropAppearance` configures only the shared backdrop's paint. It
375
+ accepts `blurIntensity` (zero disables blur), `blurTint`, `dimColor`, `dimOpacity`
376
+ and `dimGradient`. A gradient replaces the uniform dim color; opacity still
377
+ multiplies it. Geometry, layering, dismissal and focus remain Dialog-owned.
378
+
379
+ ```tsx
380
+ <Dialog
381
+ control={control}
382
+ placement="end"
383
+ backdrop={{
384
+ blurIntensity: 0,
385
+ dimOpacity: 1,
386
+ dimGradient: {
387
+ direction: 'start-to-end',
388
+ stops: [
389
+ { offset: 0, color: 'transparent' },
390
+ { offset: 0.7, color: 'rgba(0,0,0,0.35)' },
391
+ { offset: 1, color: 'rgba(0,0,0,0.35)' },
392
+ ],
393
+ },
394
+ }}
395
+ transition={{ duration: 300, easing: [0, 0, 0.58, 1] }}
396
+ >
397
+ {children}
398
+ </Dialog>
399
+ ```
400
+
401
+ `transition?: SurfaceTransition` opts into one duration/easing for panel and
402
+ backdrop entry/exit on web and native, including centered and bottom placements.
403
+ The exit lifecycle waits for that duration before dismissing; live OS reduced
404
+ motion settles immediately. Drag-following remains direct and a cancelled drag
405
+ keeps the default spring; a completed dismissal uses the requested timing.
406
+ Omitting the prop preserves each renderer's existing timings/springs.
407
+ `presentation="custom"` continues to own its motion via `exitDuration`; these
408
+ options do not replace that separate contract. Content morphing retains its own
409
+ configuration.
410
+
411
+ Durations clamp to zero; non-finite durations use 300ms. Easing is a CSS
412
+ cubic-bezier tuple, with finite coordinates and x coordinates in 0..1; invalid
413
+ curves use CSS `ease`. Gradient directions are logical horizontally
414
+ (`start-to-end` / `end-to-start`) and physical vertically (`top-to-bottom` /
415
+ `bottom-to-top`). RTL reverses horizontal direction. Stops clamp to 0..1 and
416
+ cannot move backwards relative to the preceding stop; fewer than two stops,
417
+ non-finite offsets, empty colors or invalid directions fall back to `dimColor`.
418
+ Blur intensity clamps to 0..100 and dim opacity to 0..1; non-finite values retain
419
+ the default. Both options also exist on the underlying `BottomSheet`.
@@ -189,7 +189,7 @@ failure, not a type error.
189
189
  | Removed | Replacement | Why |
190
190
  | --- | --- | --- |
191
191
  | `@oxy.so/bloom/menu` | `@oxy.so/bloom/dropdown-menu` | The family was ported to shadcn/react-native-reusables' public API. Every `Menu*` export is `DropdownMenu*`. |
192
- | `@oxy.so/bloom/collapsible` | `@oxy.so/bloom/accordion` | `Collapsible` called `UIManager.setLayoutAnimationEnabledExperimental(true)` at module scope and reached the root barrel through `export *`, so that side effect ran for every barrel consumer on Android old-arch whether or not the component was used. |
192
+ | Pre-1.0 `@oxy.so/bloom/collapsible` (a new controlled implementation ships in 7.22; see [Collapsible](./collapsible.mdx)) | `@oxy.so/bloom/accordion` | `Collapsible` called `UIManager.setLayoutAnimationEnabledExperimental(true)` at module scope and reached the root barrel through `export *`, so that side effect ran for every barrel consumer on Android old-arch whether or not the component was used. |
193
193
  | `@oxy.so/bloom/grouped-buttons` | `@oxy.so/bloom/settings-list` + `@oxy.so/bloom/item` | The only one of the three row renderers with no `accessibilityRole`, no `accessibilityLabel` and no `aria-disabled`, built on `TouchableOpacity`/`activeOpacity` instead of `useInteractionState`. |
194
194
  | `@oxy.so/bloom/pressable-with-hover` | none — inline it | One internal user. It now lives inside `zoomable-media-gallery` as `NavArrow`, the package's only hover-styled control. |
195
195
 
package/docs/overlay.mdx CHANGED
@@ -151,3 +151,21 @@ begins; an attempted focus before removal is ignored by the browser. Restoration
151
151
  observes the boundary lifecycle rather than assuming an animation duration,
152
152
  works when the host unmounts the dialog, uses `preventScroll`, and yields to a
153
153
  destination the host deliberately focused while closing.
154
+
155
+ ## Backdrop appearance
156
+
157
+ `BackdropAppearance` is the paint-only contract shared by `Backdrop` and the
158
+ `backdrop` prop on `Dialog` / `BottomSheet`. It contains `blurIntensity`,
159
+ `blurTint`, `dimColor`, `dimOpacity` and optional `dimGradient`.
160
+
161
+ A `BackdropGradient` uses `direction` (`start-to-end`, `end-to-start`,
162
+ `top-to-bottom`, `bottom-to-top`) and at least two `{ offset, color }` stops.
163
+ Horizontal directions mirror with RTL. Stops are normalized into ordered 0..1
164
+ positions; invalid stop lists fall back to the uniform dim. The gradient
165
+ replaces the solid dim fill, rather than painting over it. `dimOpacity` still
166
+ multiplies its alpha. Both animated and static paths paint on the dim layer,
167
+ leaving the press target, accessibility and surface stack unchanged. Web uses a
168
+ CSS background image; native uses React Native's gradient background support.
169
+
170
+ Blur clamps to 0..100, opacity to 0..1, and non-finite values use the shared
171
+ backdrop defaults. `blurIntensity={0}` mounts no blur layer.
package/docs/radio.mdx CHANGED
@@ -156,3 +156,18 @@ Home/End reach the first/last enabled option. Disabled options are skipped, and
156
156
  a disabled group has no tab stop. Controlled values remain caller-owned.
157
157
  Space and Enter activate the focused option once. Native retains its platform
158
158
  accessibility focus behavior rather than applying DOM keyboard semantics.
159
+
160
+ ## Composing option bodies
161
+
162
+ Options accept `labelContent` for decorative layout, with `label` or
163
+ `accessibilityLabel` supplying the control's name. `renderOption(option, control,
164
+ state)` can wrap the owned radio with sibling content. Render `control` exactly
165
+ once, unchanged; `state.checked` and `state.disabled` report group-owned state,
166
+ and `state.controlRef` references the actual focusable host on web and native.
167
+ The group retains selection, disabled behavior and its one keyboard tab stop.
168
+ Interactive siblings keep their own keyboard behavior and do not select a radio.
169
+
170
+ Use [Collapsible](./collapsible.mdx) with `open={state.checked}` and
171
+ `returnFocusRef={state.controlRef}` for a revealed form. Never place inputs,
172
+ selects or buttons inside `labelContent`. `optionStyle` still styles each owned
173
+ radio, including logical row composition such as `flexDirection: 'row-reverse'`.
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.AccordionTrigger = exports.AccordionItem = exports.AccordionContent = exports.Accordion = void 0;
7
+ var _CollapsibleFrame = require("../collapsible/CollapsibleFrame");
8
+ var _useCollapsibleMotion = require("../collapsible/use-collapsible-motion.js");
7
9
  var _react = _interopRequireWildcard(require("react"));
8
10
  var _reactNative = require("react-native");
9
11
  var _RiArrowDownSLine = require("../icons/remix/RiArrowDownSLine.js");
@@ -174,52 +176,23 @@ const AccordionContentComponent = ({
174
176
  contentId,
175
177
  triggerId
176
178
  } = (0, _react.useContext)(_context.AccordionItemContext);
177
- const heightAnim = (0, _useAccordion.useAccordionMotion)(isExpanded, 'content', false);
178
- // The content's own height, measured. The reveal used to interpolate to a
179
- // hardcoded 500 ("reasonable max"), which is not a max at all: `overflow:
180
- // hidden` above it meant anything taller was CLIPPED, silently, with no error
181
- // and no scrollbar — an accordion holding a form or a paragraph of prose just
182
- // lost its bottom. The content still lays out at its natural height inside the
183
- // clip, so `onLayout` reports the real one whether the item is open or shut.
184
- const [contentHeight, setContentHeight] = (0, _react.useState)(0);
185
- const handleContentLayout = (0, _react.useCallback)(event => {
186
- const next = event.nativeEvent.layout.height;
187
- // Sub-pixel churn would re-render on every frame of the spring.
188
- setContentHeight(prev => Math.abs(prev - next) > 0.5 ? next : prev);
189
- }, []);
190
- const opacity = heightAnim.interpolate({
191
- inputRange: [0, 1],
192
- outputRange: [0, 1]
193
- });
194
- const maxHeight = heightAnim.interpolate({
195
- inputRange: [0, 1],
196
- outputRange: [0, contentHeight]
197
- });
198
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
179
+ const {
180
+ transition
181
+ } = (0, _react.useContext)(_context.AccordionContext);
182
+ const motion = (0, _useCollapsibleMotion.useCollapsibleMotion)(isExpanded, transition);
183
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CollapsibleFrame.CollapsibleFrame, {
184
+ open: isExpanded,
185
+ ...motion,
199
186
  nativeID: contentId,
200
- 'aria-labelledby': triggerId,
201
- "aria-hidden": !isExpanded,
202
- pointerEvents: isExpanded ? 'auto' : 'none',
203
- accessibilityElementsHidden: !isExpanded,
204
- importantForAccessibility: isExpanded ? 'auto' : 'no-hide-descendants',
205
- style: [{
206
- overflow: 'hidden',
207
- opacity,
208
- // Before the first measurement an OPEN item must not be clipped to
209
- // zero, and a SHUT one must not flash open — so the unmeasured frame
210
- // takes the answer its state already implies, and every frame after
211
- // that is driven by the real height.
212
- maxHeight: contentHeight === 0 && isExpanded ? undefined : maxHeight
213
- }, style],
214
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
215
- onLayout: handleContentLayout,
216
- style: [{
217
- paddingBottom: _tokens.space.md,
218
- paddingLeft: _tokens.space.xs,
219
- paddingRight: _tokens.space.xs
220
- }, contentStyle],
221
- children: children
222
- })
187
+ labelledBy: triggerId,
188
+ returnFocusId: triggerId,
189
+ style: style,
190
+ contentStyle: [{
191
+ paddingBottom: _tokens.space.md,
192
+ paddingLeft: _tokens.space.xs,
193
+ paddingRight: _tokens.space.xs
194
+ }, contentStyle],
195
+ children: children
223
196
  });
224
197
  };
225
198
  const Accordion = exports.Accordion = /*#__PURE__*/(0, _react.memo)((0, _reactNativeCss.styled)(AccordionComponent, {
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_RiArrowDownSLine","_useTheme","_useInteractionState","_tokens","_nativeDriver","_reactNativeCss","_context","_useAccordion","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AccordionComponent","value","onValueChange","type","transition","children","style","testID","contextValue","useAccordionState","jsx","AccordionContext","Provider","View","AccordionItemComponent","disabled","itemContext","useAccordionItem","theme","useTheme","AccordionItemContext","borderBottomWidth","borderBottomColor","colors","borderLight","TRIGGER_LABEL_STYLE","flexGrow","flexShrink","AccordionTriggerComponent","icon","textStyle","toggle","useContext","isExpanded","triggerId","contentId","rotateAnim","useAccordionMotion","SUPPORTS_NATIVE_DRIVER","resolved","StyleSheet","flatten","callerText","key","undefined","assign","state","pressed","onIn","onPressIn","onOut","onPressOut","useInteractionState","handlePress","useCallback","rotation","interpolate","inputRange","outputRange","jsxs","Pressable","nativeID","flexDirection","alignItems","paddingVertical","space","md","paddingHorizontal","xs","gap","sm","opacity","DISABLED_OPACITY","onPress","accessibilityRole","Text","fontSize","fontWeight","color","text","Animated","transform","rotate","RiArrowDownSLine","size","fill","textSecondary","AccordionContentComponent","contentStyle","heightAnim","contentHeight","setContentHeight","useState","handleContentLayout","event","next","nativeEvent","layout","height","prev","Math","abs","maxHeight","pointerEvents","accessibilityElementsHidden","importantForAccessibility","overflow","onLayout","paddingBottom","paddingLeft","paddingRight","Accordion","exports","memo","styled","className","displayName","AccordionItem","AccordionTrigger","AccordionContent","contentClassName"],"sourceRoot":"../../../src","sources":["accordion/Accordion.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAA0F,IAAAU,WAAA,GAAAV,OAAA;AAAA,SAAAD,wBAAAY,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,CAAAY,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,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,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AAW,EAAE5C,aAAK,CAACG,EAAE;QAAE0C,YAAY,EAAE7C,aAAK,CAACG;MAAG,CAAC,EAAEoB,YAAY,CAAE;MAAAnF,QAAA,EAEjGA;IAAQ,CACL;EAAC,CACM,CAAC;AAEpB,CAAC;AAEM,MAAM0G,SAAS,GAAAC,OAAA,CAAAD,SAAA,gBAAG,IAAAE,WAAI,EAAC,IAAAC,sBAAM,EAAClH,kBAAkB,EAAE;EAAEmH,SAAS,EAAE;AAAQ,CAAC,CAAC,CAAC;AACjFJ,SAAS,CAACK,WAAW,GAAG,WAAW;AAE5B,MAAMC,aAAa,GAAAL,OAAA,CAAAK,aAAA,gBAAG,IAAAJ,WAAI,EAAC,IAAAC,sBAAM,EAACpG,sBAAsB,EAAE;EAAEqG,SAAS,EAAE;AAAQ,CAAC,CAAC,CAAC;AACzFE,aAAa,CAACD,WAAW,GAAG,eAAe;AAEpC,MAAME,gBAAgB,GAAAN,OAAA,CAAAM,gBAAA,gBAAG,IAAAL,WAAI,EAAC,IAAAC,sBAAM,EAACtF,yBAAyB,EAAE;EAAEuF,SAAS,EAAE;AAAQ,CAAC,CAAC,CAAC;AAC/FG,gBAAgB,CAACF,WAAW,GAAG,kBAAkB;AAE1C,MAAMG,gBAAgB,GAAAP,OAAA,CAAAO,gBAAA,gBAAG,IAAAN,WAAI,EAAC,IAAAC,sBAAM,EAAC3B,yBAAyB,EAAE;EAAE4B,SAAS,EAAE,OAAO;EAAEK,gBAAgB,EAAE;AAAe,CAAC,CAAC,CAAC;AACjID,gBAAgB,CAACH,WAAW,GAAG,kBAAkB","ignoreList":[]}
1
+ {"version":3,"names":["_CollapsibleFrame","require","_useCollapsibleMotion","_react","_interopRequireWildcard","_reactNative","_RiArrowDownSLine","_useTheme","_useInteractionState","_tokens","_nativeDriver","_reactNativeCss","_context","_useAccordion","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AccordionComponent","value","onValueChange","type","transition","children","style","testID","contextValue","useAccordionState","jsx","AccordionContext","Provider","View","AccordionItemComponent","disabled","itemContext","useAccordionItem","theme","useTheme","AccordionItemContext","borderBottomWidth","borderBottomColor","colors","borderLight","TRIGGER_LABEL_STYLE","flexGrow","flexShrink","AccordionTriggerComponent","icon","textStyle","toggle","useContext","isExpanded","triggerId","contentId","rotateAnim","useAccordionMotion","SUPPORTS_NATIVE_DRIVER","resolved","StyleSheet","flatten","callerText","key","undefined","assign","state","pressed","onIn","onPressIn","onOut","onPressOut","useInteractionState","handlePress","useCallback","rotation","interpolate","inputRange","outputRange","jsxs","Pressable","nativeID","flexDirection","alignItems","paddingVertical","space","md","paddingHorizontal","xs","gap","sm","opacity","DISABLED_OPACITY","onPress","accessibilityRole","Text","fontSize","fontWeight","color","text","Animated","transform","rotate","RiArrowDownSLine","size","fill","textSecondary","AccordionContentComponent","contentStyle","motion","useCollapsibleMotion","CollapsibleFrame","open","labelledBy","returnFocusId","paddingBottom","paddingLeft","paddingRight","Accordion","exports","memo","styled","className","displayName","AccordionItem","AccordionTrigger","AccordionContent","contentClassName"],"sourceRoot":"../../../src","sources":["accordion/Accordion.tsx"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AAKA,IAAAI,YAAA,GAAAJ,OAAA;AASA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,eAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AAA0F,IAAAa,WAAA,GAAAb,OAAA;AAAA,SAAAG,wBAAAW,CAAA,EAAAC,CAAA,6BAAA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AI,EAAC,IAAAC,sBAAM,EAACvF,sBAAsB,EAAE;EAAEwF,SAAS,EAAE;AAAQ,CAAC,CAAC,CAAC;AACzFE,aAAa,CAACD,WAAW,GAAG,eAAe;AAEpC,MAAME,gBAAgB,GAAAN,OAAA,CAAAM,gBAAA,gBAAG,IAAAL,WAAI,EAAC,IAAAC,sBAAM,EAACzE,yBAAyB,EAAE;EAAE0E,SAAS,EAAE;AAAQ,CAAC,CAAC,CAAC;AAC/FG,gBAAgB,CAACF,WAAW,GAAG,kBAAkB;AAE1C,MAAMG,gBAAgB,GAAAP,OAAA,CAAAO,gBAAA,gBAAG,IAAAN,WAAI,EAAC,IAAAC,sBAAM,EAACd,yBAAyB,EAAE;EAAEe,SAAS,EAAE,OAAO;EAAEK,gBAAgB,EAAE;AAAe,CAAC,CAAC,CAAC;AACjID,gBAAgB,CAACH,WAAW,GAAG,kBAAkB","ignoreList":[]}
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.AccordionTrigger = exports.AccordionItem = exports.AccordionContent = exports.Accordion = void 0;
7
+ var _CollapsibleFrameWeb = require("../collapsible/CollapsibleFrame.web.js");
8
+ var _useCollapsibleMotion = require("../collapsible/use-collapsible-motion.js");
7
9
  var _react = _interopRequireWildcard(require("react"));
8
10
  var _reactNative = require("react-native");
9
11
  var _RiArrowDownSLine = require("../icons/remix/RiArrowDownSLine.js");
@@ -27,20 +29,6 @@ const CSS = `@layer base {
27
29
  function useStyles() {
28
30
  (0, _interactiveWebCss.useInteractiveWebCss)('bloom-accordion', CSS);
29
31
  }
30
-
31
- /** RN Animated resolves numeric layout/opacity before this DOM host receives them. */
32
- const PanelHost = /*#__PURE__*/(0, _react.forwardRef)(function PanelHost({
33
- style,
34
- collapsable: _collapsable,
35
- ...props
36
- }, ref) {
37
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
38
- ...props,
39
- ref: ref,
40
- style: (0, _resolveNativeWebStyle.resolveNativeWebStyle)(style)
41
- });
42
- });
43
- const AnimatedPanel = _reactNative.Animated.createAnimatedComponent(PanelHost);
44
32
  const Accordion = exports.Accordion = /*#__PURE__*/(0, _react.memo)(function Accordion(props) {
45
33
  useStyles();
46
34
  const state = (0, _useAccordion.useAccordionState)(props);
@@ -149,46 +137,21 @@ const AccordionContent = exports.AccordionContent = /*#__PURE__*/(0, _react.memo
149
137
  triggerId,
150
138
  contentId
151
139
  } = (0, _react.useContext)(_context.AccordionItemContext);
152
- const progress = (0, _useAccordion.useAccordionMotion)(isExpanded, 'content', false);
153
- const body = (0, _react.useRef)(null);
154
- const panel = (0, _react.useRef)(null);
155
- const [height, setHeight] = (0, _react.useState)(0);
156
- (0, _react.useLayoutEffect)(() => {
157
- const node = body.current;
158
- if (!node) return;
159
- const measure = () => {
160
- const next = node.getBoundingClientRect().height;
161
- setHeight(previous => Math.abs(previous - next) > .5 ? next : previous);
162
- };
163
- measure();
164
- const observer = new ResizeObserver(measure);
165
- observer.observe(node);
166
- return () => observer.disconnect();
167
- }, []);
168
- (0, _react.useLayoutEffect)(() => {
169
- if (!isExpanded && panel.current?.contains(document.activeElement)) document.getElementById(triggerId)?.focus();
170
- }, [isExpanded, triggerId]);
171
- const maxHeight = progress.interpolate({
172
- inputRange: [0, 1],
173
- outputRange: [0, height]
174
- });
175
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedPanel, {
176
- ref: panel,
177
- id: contentId,
178
- role: "region",
179
- "aria-labelledby": triggerId,
180
- "aria-hidden": !isExpanded,
181
- inert: !isExpanded,
140
+ const {
141
+ transition
142
+ } = (0, _react.useContext)(_context.AccordionContext);
143
+ const motion = (0, _useCollapsibleMotion.useCollapsibleMotion)(isExpanded, transition);
144
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CollapsibleFrameWeb.CollapsibleFrame, {
145
+ open: isExpanded,
146
+ ...motion,
147
+ nativeID: contentId,
148
+ region: true,
149
+ labelledBy: triggerId,
150
+ returnFocusId: triggerId,
182
151
  className: ['bloom-accordion-panel', className].filter(Boolean).join(' '),
183
- style: [{
184
- opacity: progress,
185
- maxHeight: height === 0 && isExpanded ? undefined : maxHeight
186
- }, style],
187
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
188
- ref: body,
189
- className: ['bloom-accordion-body', contentClassName].filter(Boolean).join(' '),
190
- children: children
191
- })
152
+ contentClassName: ['bloom-accordion-body', contentClassName].filter(Boolean).join(' '),
153
+ style: style,
154
+ children: children
192
155
  });
193
156
  });
194
157
  //# sourceMappingURL=Accordion.web.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_RiArrowDownSLine","_resolveNativeWebStyle","_interactiveWebCss","_useTheme","_context","_useAccordion","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CSS","useStyles","useInteractiveWebCss","PanelHost","forwardRef","style","collapsable","_collapsable","props","ref","jsx","resolveNativeWebStyle","AnimatedPanel","Animated","createAnimatedComponent","Accordion","exports","memo","state","useAccordionState","AccordionContext","Provider","value","children","className","filter","Boolean","join","testID","AccordionItem","disabled","useAccordionItem","theme","useTheme","vars","colors","borderLight","AccordionItemContext","AccordionTrigger","icon","textStyle","toggle","useContext","isExpanded","triggerId","contentId","progress","useAccordionMotion","rotation","interpolate","inputRange","outputRange","text","jsxs","type","id","onClick","View","transform","rotate","RiArrowDownSLine","size","fill","textSecondary","AccordionContent","contentClassName","body","useRef","panel","height","setHeight","useState","useLayoutEffect","node","current","measure","next","getBoundingClientRect","previous","Math","abs","observer","ResizeObserver","observe","disconnect","contains","document","activeElement","getElementById","focus","maxHeight","role","inert","opacity","undefined"],"sourceRoot":"../../../src","sources":["accordion/Accordion.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,iBA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;EAAC,CACpG,CAAC;AAClB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_CollapsibleFrameWeb","require","_useCollapsibleMotion","_react","_interopRequireWildcard","_reactNative","_RiArrowDownSLine","_resolveNativeWebStyle","_interactiveWebCss","_useTheme","_context","_useAccordion","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CSS","useStyles","useInteractiveWebCss","Accordion","exports","memo","props","state","useAccordionState","jsx","AccordionContext","Provider","value","children","className","filter","Boolean","join","style","resolveNativeWebStyle","testID","AccordionItem","disabled","useAccordionItem","theme","useTheme","vars","colors","borderLight","AccordionItemContext","AccordionTrigger","icon","textStyle","toggle","useContext","isExpanded","triggerId","contentId","progress","useAccordionMotion","rotation","interpolate","inputRange","outputRange","text","jsxs","type","id","onClick","Animated","View","transform","rotate","RiArrowDownSLine","size","fill","textSecondary","AccordionContent","contentClassName","transition","motion","useCollapsibleMotion","CollapsibleFrame","open","nativeID","region","labelledBy","returnFocusId"],"sourceRoot":"../../../src","sources":["accordion/Accordion.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AAA0F,IAAAW,WAAA,GAAAX,OAAA;AAAA,SAAAG,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,C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;IAAC4B,MAAM;IAACC,UAAU,EAAE9B,SAAU;IAAC+B,aAAa,EAAE/B,SAAU;IACjItB,SAAS,EAAE,CAAC,uBAAuB,EAACA,SAAS,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAE;IAACyC,gBAAgB,EAAE,CAAC,sBAAsB,EAACA,gBAAgB,CAAC,CAAC3C,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAE;IAACC,KAAK,EAAEA,KAAM;IAAAL,QAAA,EAAEA;EAAQ,CAAmB,CAAC;AAChN,CAAC,CAAC","ignoreList":[]}
@@ -7,9 +7,7 @@ exports.useAccordionItem = useAccordionItem;
7
7
  exports.useAccordionMotion = useAccordionMotion;
8
8
  exports.useAccordionState = useAccordionState;
9
9
  var _react = require("react");
10
- var _reactNative = require("react-native");
11
- var _usePrefersReducedMotion = require("../hooks/use-prefers-reduced-motion.js");
12
- var _tokens = require("../styles/tokens.js");
10
+ var _useCollapsibleMotion = require("../collapsible/use-collapsible-motion.js");
13
11
  var _context = require("./context.js");
14
12
  function useAccordionState({
15
13
  value,
@@ -47,36 +45,11 @@ function useAccordionItem(value, disabled) {
47
45
  }), [value, disabled, isExpanded, id]);
48
46
  }
49
47
 
50
- /** One motion policy for both forks, including a live OS preference change. */
48
+ /** Preserve accordion's spring defaults while sharing reveal cancellation. */
51
49
  function useAccordionMotion(expanded, kind, useNativeDriver) {
52
50
  const {
53
51
  transition
54
52
  } = (0, _react.useContext)(_context.AccordionContext);
55
- const reduced = (0, _usePrefersReducedMotion.usePrefersReducedMotion)();
56
- const progress = (0, _react.useRef)(new _reactNative.Animated.Value(expanded ? 1 : 0)).current;
57
- const duration = transition === 'spring' ? undefined : transition.duration;
58
- const [x1, y1, x2, y2] = transition === 'spring' || !transition.easing ? [.25, .1, .25, 1] : transition.easing;
59
- const easing = (0, _react.useMemo)(() => _reactNative.Easing.bezier(x1, y1, x2, y2), [x1, y1, x2, y2]);
60
- (0, _react.useLayoutEffect)(() => {
61
- progress.stopAnimation();
62
- const toValue = expanded ? 1 : 0;
63
- if (reduced || duration === 0) {
64
- progress.setValue(toValue);
65
- return;
66
- }
67
- const motion = duration === undefined ? _reactNative.Animated.spring(progress, {
68
- toValue,
69
- useNativeDriver,
70
- ..._tokens.animation.spring[kind === 'trigger' ? 'snappy' : 'gentle']
71
- }) : _reactNative.Animated.timing(progress, {
72
- toValue,
73
- useNativeDriver,
74
- duration: Math.max(0, duration),
75
- easing
76
- });
77
- motion.start();
78
- return () => motion.stop();
79
- }, [expanded, progress, reduced, duration, easing, kind, useNativeDriver]);
80
- return progress;
53
+ return (0, _useCollapsibleMotion.useCollapsibleMotion)(expanded, transition, kind, useNativeDriver).progress;
81
54
  }
82
55
  //# sourceMappingURL=use-accordion.js.map