@oxy.so/bloom 7.15.0 → 7.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/docs/accordion.mdx +38 -1
  2. package/docs/adoption-matrix.mdx +8 -8
  3. package/docs/dialog.mdx +15 -0
  4. package/docs/rating.mdx +18 -0
  5. package/docs/stat-bar.mdx +1 -0
  6. package/lib/commonjs/accordion/Accordion.js +60 -78
  7. package/lib/commonjs/accordion/Accordion.js.map +1 -1
  8. package/lib/commonjs/accordion/Accordion.web.js +193 -0
  9. package/lib/commonjs/accordion/Accordion.web.js.map +1 -0
  10. package/lib/commonjs/accordion/context.js +21 -0
  11. package/lib/commonjs/accordion/context.js.map +1 -0
  12. package/lib/commonjs/accordion/index.js +1 -1
  13. package/lib/commonjs/accordion/index.web.js +31 -0
  14. package/lib/commonjs/accordion/index.web.js.map +1 -0
  15. package/lib/commonjs/accordion/use-accordion.js +82 -0
  16. package/lib/commonjs/accordion/use-accordion.js.map +1 -0
  17. package/lib/commonjs/booking/BookingCard.js +2 -2
  18. package/lib/commonjs/booking/BookingCard.js.map +1 -1
  19. package/lib/commonjs/carrier-quote/CarrierQuoteCard.js +11 -11
  20. package/lib/commonjs/carrier-quote/CarrierQuoteCard.js.map +1 -1
  21. package/lib/commonjs/cart-panel/CartPanel.js +5 -5
  22. package/lib/commonjs/cart-panel/CartPanel.js.map +1 -1
  23. package/lib/commonjs/creator-studio/TrackUploadRow.js +10 -10
  24. package/lib/commonjs/creator-studio/TrackUploadRow.js.map +1 -1
  25. package/lib/commonjs/dialog/Dialog.js +12 -2
  26. package/lib/commonjs/dialog/Dialog.js.map +1 -1
  27. package/lib/commonjs/dialog/Dialog.web.js +26 -4
  28. package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
  29. package/lib/commonjs/dialog/DialogMorph.js +4 -4
  30. package/lib/commonjs/index.js +839 -839
  31. package/lib/commonjs/index.js.map +1 -1
  32. package/lib/commonjs/index.web.js +906 -906
  33. package/lib/commonjs/index.web.js.map +1 -1
  34. package/lib/commonjs/lead-score/LeadScoreCard.js +10 -10
  35. package/lib/commonjs/lead-score/LeadScoreCard.js.map +1 -1
  36. package/lib/commonjs/listing-actions/ApplicationChecklist.js +7 -7
  37. package/lib/commonjs/listing-actions/ApplicationChecklist.js.map +1 -1
  38. package/lib/commonjs/listing-card/ListingCard.js +25 -25
  39. package/lib/commonjs/listing-card/ListingCard.js.map +1 -1
  40. package/lib/commonjs/listing-details/ListingHeader.js +8 -8
  41. package/lib/commonjs/listing-details/ListingHeader.js.map +1 -1
  42. package/lib/commonjs/listing-details/ReviewSummary.js +8 -8
  43. package/lib/commonjs/listing-details/ReviewSummary.js.map +1 -1
  44. package/lib/commonjs/listing-editor/ListingQualityMeter.js +10 -10
  45. package/lib/commonjs/listing-editor/ListingQualityMeter.js.map +1 -1
  46. package/lib/commonjs/map-marker/MapListingPreview.js +9 -9
  47. package/lib/commonjs/map-marker/MapListingPreview.js.map +1 -1
  48. package/lib/commonjs/media-card/parts.js +2 -2
  49. package/lib/commonjs/media-card/parts.js.map +1 -1
  50. package/lib/commonjs/media-header/AudiobookHeader.js +6 -6
  51. package/lib/commonjs/media-header/AudiobookHeader.js.map +1 -1
  52. package/lib/commonjs/media-header/PodcastShowHeader.js +8 -8
  53. package/lib/commonjs/media-header/PodcastShowHeader.js.map +1 -1
  54. package/lib/commonjs/media-header/parts.js +11 -11
  55. package/lib/commonjs/media-header/parts.js.map +1 -1
  56. package/lib/commonjs/order-status/OrderStatusBar.js +6 -6
  57. package/lib/commonjs/order-status/OrderStatusBar.js.map +1 -1
  58. package/lib/commonjs/outline-nav/OutlineNav.js +5 -5
  59. package/lib/commonjs/outline-nav/OutlineNav.js.map +1 -1
  60. package/lib/commonjs/overlay/ModalKeyboard.js +7 -3
  61. package/lib/commonjs/overlay/ModalKeyboard.js.map +1 -1
  62. package/lib/commonjs/overlay/modal-keyboard.js +10 -0
  63. package/lib/commonjs/overlay/modal-keyboard.js.map +1 -1
  64. package/lib/commonjs/place-card/PlaceCard.js +21 -21
  65. package/lib/commonjs/place-card/PlaceCard.js.map +1 -1
  66. package/lib/commonjs/place-details/PlaceHours.js +12 -12
  67. package/lib/commonjs/place-details/PlaceHours.js.map +1 -1
  68. package/lib/commonjs/place-reviews/PlaceReviewCard.js +9 -9
  69. package/lib/commonjs/place-reviews/PlaceReviewCard.js.map +1 -1
  70. package/lib/commonjs/property-insights/NeighbourhoodScores.js +10 -10
  71. package/lib/commonjs/property-insights/NeighbourhoodScores.js.map +1 -1
  72. package/lib/commonjs/property-insights/PricePerAreaComparison.js +5 -5
  73. package/lib/commonjs/property-insights/PricePerAreaComparison.js.map +1 -1
  74. package/lib/commonjs/rating/Rating.js +7 -4
  75. package/lib/commonjs/rating/Rating.js.map +1 -1
  76. package/lib/commonjs/rating/RatingBar.js +23 -12
  77. package/lib/commonjs/rating/RatingBar.js.map +1 -1
  78. package/lib/commonjs/rating/RatingBar.web.js +74 -0
  79. package/lib/commonjs/rating/RatingBar.web.js.map +1 -0
  80. package/lib/commonjs/rating/index.js +1 -1
  81. package/lib/commonjs/rating/index.web.js +27 -0
  82. package/lib/commonjs/rating/index.web.js.map +1 -0
  83. package/lib/commonjs/stat-bar/Meter.js +9 -2
  84. package/lib/commonjs/stat-bar/Meter.js.map +1 -1
  85. package/lib/commonjs/stat-bar/Meter.web.js +79 -0
  86. package/lib/commonjs/stat-bar/Meter.web.js.map +1 -0
  87. package/lib/commonjs/stat-bar/StatBar.js +1 -1
  88. package/lib/commonjs/stat-bar/index.js +1 -1
  89. package/lib/commonjs/stat-bar/index.web.js +46 -0
  90. package/lib/commonjs/stat-bar/index.web.js.map +1 -0
  91. package/lib/commonjs/styles/resolve-native-web-style.js +50 -0
  92. package/lib/commonjs/styles/resolve-native-web-style.js.map +1 -0
  93. package/lib/commonjs/tenancy/parts.js +5 -5
  94. package/lib/commonjs/tenancy/parts.js.map +1 -1
  95. package/lib/commonjs/track-list/EpisodeRow.js +9 -9
  96. package/lib/commonjs/track-list/EpisodeRow.js.map +1 -1
  97. package/lib/commonjs/vendor-card/VendorCard.js +11 -11
  98. package/lib/commonjs/vendor-card/VendorCard.js.map +1 -1
  99. package/lib/commonjs/wizard/WizardProgress.js +6 -6
  100. package/lib/commonjs/wizard/WizardProgress.js.map +1 -1
  101. package/lib/module/accordion/Accordion.js +58 -76
  102. package/lib/module/accordion/Accordion.js.map +1 -1
  103. package/lib/module/accordion/Accordion.web.js +188 -0
  104. package/lib/module/accordion/Accordion.web.js.map +1 -0
  105. package/lib/module/accordion/context.js +17 -0
  106. package/lib/module/accordion/context.js.map +1 -0
  107. package/lib/module/accordion/index.js +1 -1
  108. package/lib/module/accordion/index.js.map +1 -1
  109. package/lib/module/accordion/index.web.js +9 -0
  110. package/lib/module/accordion/index.web.js.map +1 -0
  111. package/lib/module/accordion/use-accordion.js +76 -0
  112. package/lib/module/accordion/use-accordion.js.map +1 -0
  113. package/lib/module/booking/BookingCard.js +1 -1
  114. package/lib/module/booking/BookingCard.js.map +1 -1
  115. package/lib/module/carrier-quote/CarrierQuoteCard.js +1 -1
  116. package/lib/module/carrier-quote/CarrierQuoteCard.js.map +1 -1
  117. package/lib/module/cart-panel/CartPanel.js +1 -1
  118. package/lib/module/cart-panel/CartPanel.js.map +1 -1
  119. package/lib/module/creator-studio/TrackUploadRow.js +1 -1
  120. package/lib/module/creator-studio/TrackUploadRow.js.map +1 -1
  121. package/lib/module/dialog/Dialog.js +12 -2
  122. package/lib/module/dialog/Dialog.js.map +1 -1
  123. package/lib/module/dialog/Dialog.web.js +26 -4
  124. package/lib/module/dialog/Dialog.web.js.map +1 -1
  125. package/lib/module/dialog/DialogMorph.js +4 -4
  126. package/lib/module/index.js +3 -3
  127. package/lib/module/index.js.map +1 -1
  128. package/lib/module/index.web.js +3 -3
  129. package/lib/module/index.web.js.map +1 -1
  130. package/lib/module/lead-score/LeadScoreCard.js +1 -1
  131. package/lib/module/lead-score/LeadScoreCard.js.map +1 -1
  132. package/lib/module/listing-actions/ApplicationChecklist.js +1 -1
  133. package/lib/module/listing-actions/ApplicationChecklist.js.map +1 -1
  134. package/lib/module/listing-card/ListingCard.js +1 -1
  135. package/lib/module/listing-card/ListingCard.js.map +1 -1
  136. package/lib/module/listing-details/ListingHeader.js +1 -1
  137. package/lib/module/listing-details/ListingHeader.js.map +1 -1
  138. package/lib/module/listing-details/ReviewSummary.js +1 -1
  139. package/lib/module/listing-details/ReviewSummary.js.map +1 -1
  140. package/lib/module/listing-editor/ListingQualityMeter.js +1 -1
  141. package/lib/module/listing-editor/ListingQualityMeter.js.map +1 -1
  142. package/lib/module/map-marker/MapListingPreview.js +1 -1
  143. package/lib/module/map-marker/MapListingPreview.js.map +1 -1
  144. package/lib/module/media-card/parts.js +1 -1
  145. package/lib/module/media-card/parts.js.map +1 -1
  146. package/lib/module/media-header/AudiobookHeader.js +1 -1
  147. package/lib/module/media-header/AudiobookHeader.js.map +1 -1
  148. package/lib/module/media-header/PodcastShowHeader.js +1 -1
  149. package/lib/module/media-header/PodcastShowHeader.js.map +1 -1
  150. package/lib/module/media-header/parts.js +1 -1
  151. package/lib/module/media-header/parts.js.map +1 -1
  152. package/lib/module/order-status/OrderStatusBar.js +1 -1
  153. package/lib/module/order-status/OrderStatusBar.js.map +1 -1
  154. package/lib/module/outline-nav/OutlineNav.js +1 -1
  155. package/lib/module/outline-nav/OutlineNav.js.map +1 -1
  156. package/lib/module/overlay/ModalKeyboard.js +8 -4
  157. package/lib/module/overlay/ModalKeyboard.js.map +1 -1
  158. package/lib/module/overlay/modal-keyboard.js +9 -0
  159. package/lib/module/overlay/modal-keyboard.js.map +1 -1
  160. package/lib/module/place-card/PlaceCard.js +1 -1
  161. package/lib/module/place-card/PlaceCard.js.map +1 -1
  162. package/lib/module/place-details/PlaceHours.js +1 -1
  163. package/lib/module/place-details/PlaceHours.js.map +1 -1
  164. package/lib/module/place-reviews/PlaceReviewCard.js +1 -1
  165. package/lib/module/place-reviews/PlaceReviewCard.js.map +1 -1
  166. package/lib/module/property-insights/NeighbourhoodScores.js +1 -1
  167. package/lib/module/property-insights/NeighbourhoodScores.js.map +1 -1
  168. package/lib/module/property-insights/PricePerAreaComparison.js +1 -1
  169. package/lib/module/property-insights/PricePerAreaComparison.js.map +1 -1
  170. package/lib/module/rating/Rating.js +7 -4
  171. package/lib/module/rating/Rating.js.map +1 -1
  172. package/lib/module/rating/RatingBar.js +19 -8
  173. package/lib/module/rating/RatingBar.js.map +1 -1
  174. package/lib/module/rating/RatingBar.web.js +69 -0
  175. package/lib/module/rating/RatingBar.web.js.map +1 -0
  176. package/lib/module/rating/index.js +1 -1
  177. package/lib/module/rating/index.js.map +1 -1
  178. package/lib/module/rating/index.web.js +11 -0
  179. package/lib/module/rating/index.web.js.map +1 -0
  180. package/lib/module/stat-bar/Meter.js +9 -2
  181. package/lib/module/stat-bar/Meter.js.map +1 -1
  182. package/lib/module/stat-bar/Meter.web.js +74 -0
  183. package/lib/module/stat-bar/Meter.web.js.map +1 -0
  184. package/lib/module/stat-bar/StatBar.js +1 -1
  185. package/lib/module/stat-bar/StatBar.js.map +1 -1
  186. package/lib/module/stat-bar/index.js +1 -1
  187. package/lib/module/stat-bar/index.js.map +1 -1
  188. package/lib/module/stat-bar/index.web.js +12 -0
  189. package/lib/module/stat-bar/index.web.js.map +1 -0
  190. package/lib/module/styles/resolve-native-web-style.js +47 -0
  191. package/lib/module/styles/resolve-native-web-style.js.map +1 -0
  192. package/lib/module/tenancy/parts.js +1 -1
  193. package/lib/module/tenancy/parts.js.map +1 -1
  194. package/lib/module/track-list/EpisodeRow.js +1 -1
  195. package/lib/module/track-list/EpisodeRow.js.map +1 -1
  196. package/lib/module/vendor-card/VendorCard.js +1 -1
  197. package/lib/module/vendor-card/VendorCard.js.map +1 -1
  198. package/lib/module/wizard/WizardProgress.js +1 -1
  199. package/lib/module/wizard/WizardProgress.js.map +1 -1
  200. package/lib/typescript/commonjs/accordion/Accordion.d.ts +15 -4
  201. package/lib/typescript/commonjs/accordion/Accordion.d.ts.map +1 -1
  202. package/lib/typescript/commonjs/accordion/Accordion.web.d.ts +7 -0
  203. package/lib/typescript/commonjs/accordion/Accordion.web.d.ts.map +1 -0
  204. package/lib/typescript/commonjs/accordion/context.d.ts +16 -0
  205. package/lib/typescript/commonjs/accordion/context.d.ts.map +1 -0
  206. package/lib/typescript/commonjs/accordion/index.d.ts +1 -1
  207. package/lib/typescript/commonjs/accordion/index.d.ts.map +1 -1
  208. package/lib/typescript/commonjs/accordion/index.web.d.ts +3 -0
  209. package/lib/typescript/commonjs/accordion/index.web.d.ts.map +1 -0
  210. package/lib/typescript/commonjs/accordion/types.d.ts +15 -0
  211. package/lib/typescript/commonjs/accordion/types.d.ts.map +1 -1
  212. package/lib/typescript/commonjs/accordion/use-accordion.d.ts +18 -0
  213. package/lib/typescript/commonjs/accordion/use-accordion.d.ts.map +1 -0
  214. package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
  215. package/lib/typescript/commonjs/dialog/DialogMorph.d.ts +4 -4
  216. package/lib/typescript/commonjs/index.web.d.ts +5 -5
  217. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  218. package/lib/typescript/commonjs/overlay/ModalKeyboard.d.ts +1 -1
  219. package/lib/typescript/commonjs/overlay/modal-keyboard.d.ts +2 -0
  220. package/lib/typescript/commonjs/overlay/modal-keyboard.d.ts.map +1 -1
  221. package/lib/typescript/commonjs/rating/Rating.d.ts +1 -1
  222. package/lib/typescript/commonjs/rating/Rating.d.ts.map +1 -1
  223. package/lib/typescript/commonjs/rating/RatingBar.d.ts +11 -3
  224. package/lib/typescript/commonjs/rating/RatingBar.d.ts.map +1 -1
  225. package/lib/typescript/commonjs/rating/RatingBar.web.d.ts +4 -0
  226. package/lib/typescript/commonjs/rating/RatingBar.web.d.ts.map +1 -0
  227. package/lib/typescript/commonjs/rating/index.web.d.ts +5 -0
  228. package/lib/typescript/commonjs/rating/index.web.d.ts.map +1 -0
  229. package/lib/typescript/commonjs/rating/types.d.ts +11 -0
  230. package/lib/typescript/commonjs/rating/types.d.ts.map +1 -1
  231. package/lib/typescript/commonjs/stat-bar/Meter.d.ts +7 -25
  232. package/lib/typescript/commonjs/stat-bar/Meter.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/stat-bar/Meter.web.d.ts +4 -0
  234. package/lib/typescript/commonjs/stat-bar/Meter.web.d.ts.map +1 -0
  235. package/lib/typescript/commonjs/stat-bar/index.web.d.ts +7 -0
  236. package/lib/typescript/commonjs/stat-bar/index.web.d.ts.map +1 -0
  237. package/lib/typescript/commonjs/stat-bar/types.d.ts +4 -0
  238. package/lib/typescript/commonjs/stat-bar/types.d.ts.map +1 -1
  239. package/lib/typescript/commonjs/styles/resolve-native-web-style.d.ts +5 -0
  240. package/lib/typescript/commonjs/styles/resolve-native-web-style.d.ts.map +1 -0
  241. package/lib/typescript/module/accordion/Accordion.d.ts +15 -4
  242. package/lib/typescript/module/accordion/Accordion.d.ts.map +1 -1
  243. package/lib/typescript/module/accordion/Accordion.web.d.ts +7 -0
  244. package/lib/typescript/module/accordion/Accordion.web.d.ts.map +1 -0
  245. package/lib/typescript/module/accordion/context.d.ts +16 -0
  246. package/lib/typescript/module/accordion/context.d.ts.map +1 -0
  247. package/lib/typescript/module/accordion/index.d.ts +1 -1
  248. package/lib/typescript/module/accordion/index.d.ts.map +1 -1
  249. package/lib/typescript/module/accordion/index.web.d.ts +3 -0
  250. package/lib/typescript/module/accordion/index.web.d.ts.map +1 -0
  251. package/lib/typescript/module/accordion/types.d.ts +15 -0
  252. package/lib/typescript/module/accordion/types.d.ts.map +1 -1
  253. package/lib/typescript/module/accordion/use-accordion.d.ts +18 -0
  254. package/lib/typescript/module/accordion/use-accordion.d.ts.map +1 -0
  255. package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
  256. package/lib/typescript/module/dialog/DialogMorph.d.ts +4 -4
  257. package/lib/typescript/module/index.web.d.ts +5 -5
  258. package/lib/typescript/module/index.web.d.ts.map +1 -1
  259. package/lib/typescript/module/overlay/ModalKeyboard.d.ts +1 -1
  260. package/lib/typescript/module/overlay/modal-keyboard.d.ts +2 -0
  261. package/lib/typescript/module/overlay/modal-keyboard.d.ts.map +1 -1
  262. package/lib/typescript/module/rating/Rating.d.ts +1 -1
  263. package/lib/typescript/module/rating/Rating.d.ts.map +1 -1
  264. package/lib/typescript/module/rating/RatingBar.d.ts +11 -3
  265. package/lib/typescript/module/rating/RatingBar.d.ts.map +1 -1
  266. package/lib/typescript/module/rating/RatingBar.web.d.ts +4 -0
  267. package/lib/typescript/module/rating/RatingBar.web.d.ts.map +1 -0
  268. package/lib/typescript/module/rating/index.web.d.ts +5 -0
  269. package/lib/typescript/module/rating/index.web.d.ts.map +1 -0
  270. package/lib/typescript/module/rating/types.d.ts +11 -0
  271. package/lib/typescript/module/rating/types.d.ts.map +1 -1
  272. package/lib/typescript/module/stat-bar/Meter.d.ts +7 -25
  273. package/lib/typescript/module/stat-bar/Meter.d.ts.map +1 -1
  274. package/lib/typescript/module/stat-bar/Meter.web.d.ts +4 -0
  275. package/lib/typescript/module/stat-bar/Meter.web.d.ts.map +1 -0
  276. package/lib/typescript/module/stat-bar/index.web.d.ts +7 -0
  277. package/lib/typescript/module/stat-bar/index.web.d.ts.map +1 -0
  278. package/lib/typescript/module/stat-bar/types.d.ts +4 -0
  279. package/lib/typescript/module/stat-bar/types.d.ts.map +1 -1
  280. package/lib/typescript/module/styles/resolve-native-web-style.d.ts +5 -0
  281. package/lib/typescript/module/styles/resolve-native-web-style.d.ts.map +1 -0
  282. package/package.json +16 -1
  283. package/src/accordion/Accordion.tsx +34 -94
  284. package/src/accordion/Accordion.web.tsx +91 -0
  285. package/src/accordion/context.ts +15 -0
  286. package/src/accordion/index.ts +1 -0
  287. package/src/accordion/index.web.ts +14 -0
  288. package/src/accordion/types.ts +15 -0
  289. package/src/accordion/use-accordion.ts +47 -0
  290. package/src/dialog/Dialog.tsx +8 -3
  291. package/src/dialog/Dialog.web.tsx +39 -23
  292. package/src/dialog/DialogMorph.tsx +4 -4
  293. package/src/index.web.ts +5 -5
  294. package/src/overlay/ModalKeyboard.tsx +4 -4
  295. package/src/overlay/modal-keyboard.ts +9 -0
  296. package/src/rating/Rating.tsx +7 -4
  297. package/src/rating/RatingBar.tsx +10 -5
  298. package/src/rating/RatingBar.web.tsx +29 -0
  299. package/src/rating/index.web.ts +17 -0
  300. package/src/rating/types.ts +11 -0
  301. package/src/stat-bar/Meter.tsx +6 -4
  302. package/src/stat-bar/Meter.web.tsx +32 -0
  303. package/src/stat-bar/index.web.ts +20 -0
  304. package/src/stat-bar/types.ts +4 -0
  305. package/src/styles/resolve-native-web-style.ts +41 -0
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback, useEffect, useRef } from 'react';
2
2
  import type { View } from 'react-native';
3
3
 
4
- import { listenForEscape, tabbablesWithin, wrapTab } from './modal-keyboard';
4
+ import { initialFocusWithin, listenForEscape, wrapTab } from './modal-keyboard';
5
5
  import { useOverlayLayerContext } from './Overlay';
6
6
  import { isTopmostOverlayLayer } from './stack';
7
7
 
@@ -22,7 +22,7 @@ export interface ModalKeyboardProps {
22
22
  * and the web `BottomSheet`.
23
23
  *
24
24
  * - Focus moves INTO the panel when it opens — to whatever the content
25
- * focused itself (an `autoFocus` field), else the first tabbable, else the
25
+ * focused itself (an `autoFocus` field), else the first visible tabbable, else the
26
26
  * panel — and goes BACK to the element that had it once the surface starts
27
27
  * closing (or unmounts), unless the host has already put it somewhere else.
28
28
  * - Tab and Shift+Tab wrap at the panel's edges.
@@ -48,7 +48,7 @@ export function ModalKeyboard({ panelRef, closing = false, dismissible, dismiss
48
48
  const active = document.activeElement;
49
49
  // Only focus the surface still holds (or lost with its nodes): a host that
50
50
  // moved focus on purpose while closing keeps its choice.
51
- if (!active || active === document.body || panel?.contains(active)) target.focus();
51
+ if (!active || active === document.body || panel?.contains(active)) target.focus({ preventScroll: true });
52
52
  }, [panelRef]);
53
53
 
54
54
  useEffect(() => {
@@ -60,7 +60,7 @@ export function ModalKeyboard({ panelRef, closing = false, dismissible, dismiss
60
60
  const frame = requestAnimationFrame(() => {
61
61
  const node = panel();
62
62
  if (!node || node.contains(document.activeElement) || !isTopmostOverlayLayer(layer)) return;
63
- (tabbablesWithin(node)[0] ?? node).focus();
63
+ initialFocusWithin(node).focus({ preventScroll: true });
64
64
  });
65
65
  const onTab = (event: KeyboardEvent) => {
66
66
  if (event.defaultPrevented || !isTopmostOverlayLayer(layer)) return;
@@ -59,6 +59,15 @@ export function tabbablesWithin(node: HTMLElement | null): HTMLElement[] {
59
59
  );
60
60
  }
61
61
 
62
+ /** Initial focus must not scroll long content to an offscreen action. Tab still reaches every control. */
63
+ export function initialFocusWithin(node: HTMLElement): HTMLElement {
64
+ const panel = node.getBoundingClientRect();
65
+ return tabbablesWithin(node).find(element => {
66
+ const rect = element.getBoundingClientRect();
67
+ return rect.top >= panel.top && rect.bottom <= panel.bottom && rect.left >= panel.left && rect.right <= panel.right;
68
+ }) ?? node;
69
+ }
70
+
62
71
  /**
63
72
  * Keep Tab inside `node`: from the last tabbable (or from outside) forward to
64
73
  * the first, from the first (or from outside) backward to the last. Returns
@@ -145,6 +145,8 @@ function RatingComponent({
145
145
  newLabel: newLabelProp,
146
146
  size = 'medium',
147
147
  variant = 'compact',
148
+ showValue = true,
149
+ starSize,
148
150
  color,
149
151
  starColor,
150
152
  countColor,
@@ -162,6 +164,7 @@ function RatingComponent({
162
164
  const starPaint = starColor ?? textColor;
163
165
  const countPaint = countColor ?? color ?? theme.colors.textSecondary;
164
166
  const config = SIZE_CONFIG[size];
167
+ const glyphSize = typeof starSize === 'number' && Number.isFinite(starSize) && starSize > 0 ? starSize : config.star;
165
168
  const rated = value != null && value !== '';
166
169
  const shownValue = rated ? formatRatingValue(value) : newLabel;
167
170
  const hasCount = rated && count != null && count !== '';
@@ -196,17 +199,17 @@ function RatingComponent({
196
199
  {variant === 'stars' && rated ? (
197
200
  <StarRow
198
201
  rating={clampRating(fillValue ?? parseRatingValue(value))}
199
- size={config.star}
202
+ size={glyphSize}
200
203
  fill={starPaint}
201
204
  empty={emptyStarColor ?? theme.colors.border}
202
205
  testID={testID ? `${testID}-stars` : undefined}
203
206
  />
204
207
  ) : variant === 'stars' ? null : (
205
- <RiStarFill width={config.star} height={config.star} fill={starPaint} />
208
+ <RiStarFill width={glyphSize} height={glyphSize} fill={starPaint} />
206
209
  )}
207
- <Text variant={config.value} style={{ color: textColor, fontVariant: ['tabular-nums'] }}>
210
+ {(showValue || !rated) && <Text variant={config.value} style={{ color: textColor, fontVariant: ['tabular-nums'] }}>
208
211
  {shownValue}
209
- </Text>
212
+ </Text>}
210
213
  {countText != null && (
211
214
  <Text variant={config.count} style={{ color: countPaint }}>
212
215
  {countText}
@@ -1,5 +1,6 @@
1
1
  import React, { memo } from 'react';
2
- import { View } from 'react-native';
2
+ import { styled } from 'react-native-css';
3
+ import { View, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
3
4
 
4
5
  import { Meter } from '../stat-bar';
5
6
  import { useTheme } from '../theme/use-theme';
@@ -28,7 +29,9 @@ import type { RatingBarProps } from './types';
28
29
 
29
30
  const BAR_WIDTH = 96;
30
31
 
31
- function RatingBarComponent({ label, value, max = 5, display, labelWidth, style, testID }: RatingBarProps) {
32
+ function RatingBarComponent({ label, value, max = 5, display, labelWidth, style, testID, labelStyle, displayStyle, trackStyle, fillClassName }: RatingBarProps & {
33
+ labelStyle?: StyleProp<TextStyle>; displayStyle?: StyleProp<TextStyle>; trackStyle?: StyleProp<ViewStyle>;
34
+ }) {
32
35
  const theme = useTheme();
33
36
  const safeMax = max > 0 ? max : 1;
34
37
 
@@ -45,6 +48,7 @@ function RatingBarComponent({ label, value, max = 5, display, labelWidth, style,
45
48
  style={[
46
49
  { color: theme.colors.text },
47
50
  labelWidth === undefined ? { flex: 1, minWidth: 0 } : { width: labelWidth },
51
+ labelStyle,
48
52
  ]}
49
53
  >
50
54
  {label}
@@ -57,14 +61,15 @@ function RatingBarComponent({ label, value, max = 5, display, labelWidth, style,
57
61
  valueText={display}
58
62
  testID={testID ? `${testID}-bar` : undefined}
59
63
  fillTestID={testID ? `${testID}-fill` : undefined}
60
- style={labelWidth === undefined ? { width: BAR_WIDTH } : { flex: 1, minWidth: 0 }}
64
+ fillClassName={fillClassName}
65
+ style={[labelWidth === undefined ? { width: BAR_WIDTH } : { flex: 1, minWidth: 0 }, trackStyle]}
61
66
  />
62
67
  {display != null && (
63
68
  <Text
64
69
  variant="body-semibold"
65
70
  importantForAccessibility="no"
66
71
  accessibilityElementsHidden
67
- style={{ color: theme.colors.text, minWidth: 28, textAlign: 'right', fontVariant: ['tabular-nums'] }}
72
+ style={[{ color: theme.colors.text, minWidth: 28, textAlign: 'right', fontVariant: ['tabular-nums'] }, displayStyle]}
68
73
  >
69
74
  {display}
70
75
  </Text>
@@ -73,5 +78,5 @@ function RatingBarComponent({ label, value, max = 5, display, labelWidth, style,
73
78
  );
74
79
  }
75
80
 
76
- export const RatingBar = memo(RatingBarComponent);
81
+ export const RatingBar = memo(styled(RatingBarComponent, { className: 'style', labelClassName: 'labelStyle', displayClassName: 'displayStyle', trackClassName: 'trackStyle' }));
77
82
  RatingBar.displayName = 'RatingBar';
@@ -0,0 +1,29 @@
1
+ import React, { memo } from 'react';
2
+ import { Meter } from '../stat-bar/index.web';
3
+ import { resolveNativeWebStyle } from '../styles/resolve-native-web-style';
4
+ import { useInteractiveWebCss } from '../styles/interactive-web-css';
5
+ import { useTheme } from '../theme/use-theme';
6
+ import { TYPE_SCALE } from '../typography/scale';
7
+ import type { RatingBarProps } from './types';
8
+ const regular = TYPE_SCALE['body-regular'];
9
+ const semibold = TYPE_SCALE['body-semibold'];
10
+ const CSS = `@layer base {
11
+ .bloom-rating-bar { box-sizing:border-box; flex-shrink:0; display:flex; flex-direction:row; align-items:center; gap:12px; min-width:0; color:var(--bloom-rating-text); }
12
+ .bloom-rating-label { display:block; flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-family:var(--bloom-font-sans); font-size:${regular.fontSize}px; line-height:${regular.lineHeight}px; font-weight:${regular.fontWeight}; letter-spacing:${regular.letterSpacing}px; }
13
+ .bloom-rating-label[data-fixed] { flex:none; width:var(--bloom-rating-label-width); }
14
+ .bloom-rating-track-flex { flex:1; min-width:0; }
15
+ .bloom-rating-display { min-width:28px; text-align:right; font-family:var(--bloom-font-sans); font-size:${semibold.fontSize}px; line-height:${semibold.lineHeight}px; font-weight:${semibold.fontWeight}; font-variant-numeric:tabular-nums; }
16
+ }`;
17
+ export const RatingBar = memo(function RatingBar({ label, value, max = 5, display, labelWidth, style, testID,
18
+ className, labelClassName, displayClassName, trackClassName, fillClassName }: RatingBarProps) {
19
+ useInteractiveWebCss('bloom-rating-bar', CSS);
20
+ const theme = useTheme();
21
+ const vars = { '--bloom-rating-text': theme.colors.text, '--bloom-rating-label-width': `${labelWidth ?? 0}px` } as React.CSSProperties;
22
+ return <div className={['bloom-rating-bar', className].filter(Boolean).join(' ')} style={{ ...vars, ...resolveNativeWebStyle(style) }} data-testid={testID}>
23
+ <span className={['bloom-rating-label', labelClassName].filter(Boolean).join(' ')} data-fixed={labelWidth !== undefined ? '' : undefined} aria-hidden>{label}</span>
24
+ <Meter value={value} max={max > 0 ? max : 1} height={4} width={labelWidth === undefined ? 96 : undefined} accessibilityLabel={label} valueText={display}
25
+ testID={testID ? `${testID}-bar` : undefined} fillTestID={testID ? `${testID}-fill` : undefined}
26
+ className={['bloom-rating-track', labelWidth !== undefined ? 'bloom-rating-track-flex' : '', trackClassName].filter(Boolean).join(' ')} fillClassName={fillClassName} />
27
+ {display != null && <span className={['bloom-rating-display', displayClassName].filter(Boolean).join(' ')} aria-hidden>{display}</span>}
28
+ </div>;
29
+ });
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED by scripts/generate-platform-exports.mjs — DO NOT EDIT.
2
+ // Source of truth: src/rating/index.ts.
3
+ // Re-run `bun run generate:exports` (or any `bun run build`) after
4
+ // changing that barrel or the set of web-forked subpaths.
5
+
6
+ export { Rating } from './Rating';
7
+ export { RatingBar } from './RatingBar.web';
8
+ export { RatingInput } from './RatingInput';
9
+ export type {
10
+ RatingBarProps,
11
+ RatingCountStyle,
12
+ RatingInputProps,
13
+ RatingInputSize,
14
+ RatingProps,
15
+ RatingSize,
16
+ RatingVariant,
17
+ } from './types';
@@ -32,6 +32,10 @@ export interface RatingProps {
32
32
  size?: RatingSize;
33
33
  /** Default `compact` — one star. `stars` draws a row of five, filled fractionally. */
34
34
  variant?: RatingVariant;
35
+ /** Hide the visible numeric value while retaining its accessible name. Default true. */
36
+ showValue?: boolean;
37
+ /** Star dimensions, independent of the label type size. Defaults to the size scale. */
38
+ starSize?: number;
35
39
  /**
36
40
  * Paints the star(s) and the value — and the count, unless `countColor` is
37
41
  * given — e.g. white over a brand-coloured hero, where text-primary and
@@ -99,6 +103,13 @@ export interface RatingInputProps {
99
103
  }
100
104
 
101
105
  export interface RatingBarProps {
106
+ className?: string;
107
+ labelClassName?: string;
108
+ displayClassName?: string;
109
+ /** Classes on the underlying Meter track (geometry and paint). */
110
+ trackClassName?: string;
111
+ /** Classes on the underlying Meter fill; its measured fraction stays data-owned. */
112
+ fillClassName?: string;
102
113
  /** What the row measures ("Cleanliness", "5 stars"). Also the bar's accessible name. */
103
114
  label: string;
104
115
  /** Position on the scale, `0..max`; clamped. */
@@ -1,5 +1,6 @@
1
1
  import React, { memo, useEffect, useMemo } from 'react';
2
- import { Platform, View } from 'react-native';
2
+ import { styled } from 'react-native-css';
3
+ import { Platform, View, type StyleProp, type ViewStyle } from 'react-native';
3
4
 
4
5
  import { webDataSet } from '../styles/web-data';
5
6
  import type { WebCssStyle } from '../styles/web-view-style';
@@ -35,7 +36,7 @@ import type { AnyMeterProps } from './types';
35
36
  * A bar that is one SEGMENT of a larger progressbar passes `decorative` and
36
37
  * gets no role at all — two nested progressbars announce the measurement twice.
37
38
  */
38
- function MeterComponent(props: AnyMeterProps) {
39
+ function MeterComponent(props: AnyMeterProps & { fillStyle?: StyleProp<ViewStyle> }) {
39
40
  const theme = useTheme();
40
41
  const defaults = useMemo(() => resolveMeterColors(theme), [theme]);
41
42
  const {
@@ -49,6 +50,7 @@ function MeterComponent(props: AnyMeterProps) {
49
50
  transitionMs = 0,
50
51
  style,
51
52
  testID,
53
+ fillStyle: callerFillStyle,
52
54
  fillTestID = testID ? `${testID}-fill` : undefined,
53
55
  } = props;
54
56
 
@@ -70,7 +72,7 @@ function MeterComponent(props: AnyMeterProps) {
70
72
  <View
71
73
  {...(transitionMs > 0 ? webDataSet({ bloomMeterFill: '' }) : null)}
72
74
  testID={fillTestID}
73
- style={fillStyle}
75
+ style={[fillStyle, callerFillStyle, { width: fillStyle.width }]}
74
76
  />
75
77
  );
76
78
 
@@ -112,5 +114,5 @@ function MeterComponent(props: AnyMeterProps) {
112
114
  );
113
115
  }
114
116
 
115
- export const Meter = memo(MeterComponent);
117
+ export const Meter = memo(styled(MeterComponent, { className: 'style', fillClassName: 'fillStyle' }));
116
118
  Meter.displayName = 'Meter';
@@ -0,0 +1,32 @@
1
+ import React, { memo } from 'react';
2
+ import { resolveNativeWebStyle } from '../styles/resolve-native-web-style';
3
+ import { useInteractiveWebCss } from '../styles/interactive-web-css';
4
+ import { useTheme } from '../theme/use-theme';
5
+ import { meterFraction, meterValue, resolveMeterColors } from './shared';
6
+ import type { AnyMeterProps } from './types';
7
+
8
+ const CSS = `@layer base {
9
+ .bloom-meter-track { display:block; flex-shrink:0; box-sizing:border-box; width:var(--bloom-meter-width,100%); height:var(--bloom-meter-height); border-radius:var(--bloom-meter-radius); background:var(--bloom-meter-track); overflow:hidden; }
10
+ .bloom-meter-fill { display:block; box-sizing:border-box; height:100%; border-radius:var(--bloom-meter-radius); background:var(--bloom-meter-fill); }
11
+ .bloom-meter-fill[data-transition] { transition:width var(--bloom-meter-ms,0ms) ease-out; }
12
+ @media(prefers-reduced-motion:reduce) { .bloom-meter-fill[data-transition] { transition:none; } }
13
+ }`;
14
+
15
+ export const Meter = memo(function Meter(props: AnyMeterProps) {
16
+ useInteractiveWebCss('bloom-meter-classes', CSS);
17
+ const theme = useTheme();
18
+ const colors = resolveMeterColors(theme);
19
+ const { value, max = 1, height = 6, radius = height / 2, width, fill = colors.fill, track = colors.track,
20
+ transitionMs = 0, style, testID, fillTestID = testID ? `${testID}-fill` : undefined, className, fillClassName } = props;
21
+ const vars = {
22
+ '--bloom-meter-width': width == null ? '100%' : `${width}px`,
23
+ '--bloom-meter-height': `${height}px`, '--bloom-meter-radius': `${radius}px`,
24
+ '--bloom-meter-track': track, '--bloom-meter-fill': fill, '--bloom-meter-ms': `${transitionMs}ms`,
25
+ } as React.CSSProperties;
26
+ const contents = <div className={['bloom-meter-fill', fillClassName].filter(Boolean).join(' ')}
27
+ data-transition={transitionMs > 0 ? '' : undefined} data-testid={fillTestID} style={{ width: `${meterFraction(value, max) * 100}%` }} />;
28
+ const root = { className: ['bloom-meter-track', className].filter(Boolean).join(' '), style: { ...vars, ...resolveNativeWebStyle(style) }, 'data-testid': testID };
29
+ if (props.decorative) return <div {...root} aria-hidden>{contents}</div>;
30
+ return <div {...root} role="progressbar" aria-label={props.accessibilityLabel} aria-valuemin={0} aria-valuemax={max}
31
+ aria-valuenow={meterValue(value, max)} aria-valuetext={props.valueText}>{contents}</div>;
32
+ });
@@ -0,0 +1,20 @@
1
+ // AUTO-GENERATED by scripts/generate-platform-exports.mjs — DO NOT EDIT.
2
+ // Source of truth: src/stat-bar/index.ts.
3
+ // Re-run `bun run generate:exports` (or any `bun run build`) after
4
+ // changing that barrel or the set of web-forked subpaths.
5
+
6
+ export { Meter } from './Meter.web';
7
+ export { MeterRing } from './MeterRing';
8
+ export { StatBar } from './StatBar';
9
+ export { meterFraction, meterValue, resolveMeterColors } from './shared';
10
+ export type { MeterColors } from './shared';
11
+ export type {
12
+ AnyMeterProps,
13
+ MeterDecorativeProps,
14
+ MeterProps,
15
+ MeterRingProps,
16
+ StatBarProps,
17
+ StatBarProgressProps,
18
+ StatBarSplitProps,
19
+ StatBarVariant,
20
+ } from './types';
@@ -69,6 +69,10 @@ export type StatBarProps = StatBarProgressProps | StatBarSplitProps;
69
69
  // ---------------------------------------------------------------------------
70
70
 
71
71
  interface MeterGeometryProps {
72
+ /** Classes on the track. Unclaimed properties retain the normal Meter defaults. */
73
+ className?: string;
74
+ /** Classes on the fill. Width continues to represent value/max. */
75
+ fillClassName?: string;
72
76
  /** Current value. Clamped into `[0, max]`; `NaN` reads as empty. */
73
77
  value: number;
74
78
  /**
@@ -0,0 +1,41 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
3
+ import { flattenWebStyle } from './flatten-web-style';
4
+
5
+ /** Preserve RN-style overrides when a family moves from RNW hosts to DOM hosts. */
6
+ export function resolveNativeWebStyle(style: StyleProp<ViewStyle | TextStyle>): CSSProperties {
7
+ const input = flattenWebStyle(style) as Record<string, unknown>;
8
+ const output: Record<string, unknown> = { ...input };
9
+ for (const property of ['padding', 'margin'] as const) {
10
+ for (const [axis, sides] of [['Horizontal', ['Left', 'Right']], ['Vertical', ['Top', 'Bottom']]] as const) {
11
+ const key = `${property}${axis}`;
12
+ if (input[key] !== undefined) {
13
+ for (const side of sides) {
14
+ const longhand = `${property}${side}`;
15
+ if (input[longhand] === undefined) output[longhand] = input[key];
16
+ }
17
+ }
18
+ delete output[key];
19
+ }
20
+ }
21
+ for (const [native, css] of Object.entries({
22
+ paddingStart: 'paddingInlineStart', paddingEnd: 'paddingInlineEnd',
23
+ marginStart: 'marginInlineStart', marginEnd: 'marginInlineEnd',
24
+ start: 'insetInlineStart', end: 'insetInlineEnd',
25
+ borderStartWidth: 'borderInlineStartWidth', borderEndWidth: 'borderInlineEndWidth',
26
+ borderStartColor: 'borderInlineStartColor', borderEndColor: 'borderInlineEndColor',
27
+ })) {
28
+ if (input[native] !== undefined) output[css] = input[native];
29
+ delete output[native];
30
+ }
31
+ if (typeof input.lineHeight === 'number') output.lineHeight = `${input.lineHeight}px`;
32
+ if (Array.isArray(input.fontVariant)) output.fontVariant = input.fontVariant.join(' ');
33
+ if (Array.isArray(input.transform)) output.transform = input.transform.flatMap(entry =>
34
+ Object.entries(entry).map(([name, value]) => {
35
+ if (name === 'matrix') return `${(value as number[]).length === 6 ? 'matrix' : 'matrix3d'}(${(value as number[]).join(',')})`;
36
+ const unit = typeof value === 'number' && (name.startsWith('translate') || name === 'perspective') ? 'px' : '';
37
+ return `${name}(${value}${unit})`;
38
+ }),
39
+ ).join(' ');
40
+ return output as CSSProperties;
41
+ }