@oxy.so/bloom 7.14.3 → 7.16.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 (305) hide show
  1. package/docs/accordion.mdx +38 -1
  2. package/docs/adoption-matrix.mdx +7 -7
  3. package/docs/button.mdx +28 -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/button/Button.js +14 -2
  20. package/lib/commonjs/button/Button.js.map +1 -1
  21. package/lib/commonjs/button/Button.web.js +50 -12
  22. package/lib/commonjs/button/Button.web.js.map +1 -1
  23. package/lib/commonjs/carrier-quote/CarrierQuoteCard.js +11 -11
  24. package/lib/commonjs/carrier-quote/CarrierQuoteCard.js.map +1 -1
  25. package/lib/commonjs/cart-panel/CartPanel.js +5 -5
  26. package/lib/commonjs/cart-panel/CartPanel.js.map +1 -1
  27. package/lib/commonjs/creator-studio/TrackUploadRow.js +10 -10
  28. package/lib/commonjs/creator-studio/TrackUploadRow.js.map +1 -1
  29. package/lib/commonjs/index.js +839 -839
  30. package/lib/commonjs/index.js.map +1 -1
  31. package/lib/commonjs/index.web.js +906 -906
  32. package/lib/commonjs/index.web.js.map +1 -1
  33. package/lib/commonjs/lead-score/LeadScoreCard.js +10 -10
  34. package/lib/commonjs/lead-score/LeadScoreCard.js.map +1 -1
  35. package/lib/commonjs/listing-actions/ApplicationChecklist.js +7 -7
  36. package/lib/commonjs/listing-actions/ApplicationChecklist.js.map +1 -1
  37. package/lib/commonjs/listing-card/ListingCard.js +25 -25
  38. package/lib/commonjs/listing-card/ListingCard.js.map +1 -1
  39. package/lib/commonjs/listing-details/ListingHeader.js +8 -8
  40. package/lib/commonjs/listing-details/ListingHeader.js.map +1 -1
  41. package/lib/commonjs/listing-details/ReviewSummary.js +8 -8
  42. package/lib/commonjs/listing-details/ReviewSummary.js.map +1 -1
  43. package/lib/commonjs/listing-editor/ListingQualityMeter.js +10 -10
  44. package/lib/commonjs/listing-editor/ListingQualityMeter.js.map +1 -1
  45. package/lib/commonjs/map-marker/MapListingPreview.js +9 -9
  46. package/lib/commonjs/map-marker/MapListingPreview.js.map +1 -1
  47. package/lib/commonjs/media-card/parts.js +2 -2
  48. package/lib/commonjs/media-card/parts.js.map +1 -1
  49. package/lib/commonjs/media-header/AudiobookHeader.js +6 -6
  50. package/lib/commonjs/media-header/AudiobookHeader.js.map +1 -1
  51. package/lib/commonjs/media-header/PodcastShowHeader.js +8 -8
  52. package/lib/commonjs/media-header/PodcastShowHeader.js.map +1 -1
  53. package/lib/commonjs/media-header/parts.js +11 -11
  54. package/lib/commonjs/media-header/parts.js.map +1 -1
  55. package/lib/commonjs/order-status/OrderStatusBar.js +6 -6
  56. package/lib/commonjs/order-status/OrderStatusBar.js.map +1 -1
  57. package/lib/commonjs/outline-nav/OutlineNav.js +5 -5
  58. package/lib/commonjs/outline-nav/OutlineNav.js.map +1 -1
  59. package/lib/commonjs/place-card/PlaceCard.js +21 -21
  60. package/lib/commonjs/place-card/PlaceCard.js.map +1 -1
  61. package/lib/commonjs/place-details/PlaceHours.js +12 -12
  62. package/lib/commonjs/place-details/PlaceHours.js.map +1 -1
  63. package/lib/commonjs/place-reviews/PlaceReviewCard.js +9 -9
  64. package/lib/commonjs/place-reviews/PlaceReviewCard.js.map +1 -1
  65. package/lib/commonjs/property-insights/NeighbourhoodScores.js +10 -10
  66. package/lib/commonjs/property-insights/NeighbourhoodScores.js.map +1 -1
  67. package/lib/commonjs/property-insights/PricePerAreaComparison.js +5 -5
  68. package/lib/commonjs/property-insights/PricePerAreaComparison.js.map +1 -1
  69. package/lib/commonjs/rating/Rating.js +7 -4
  70. package/lib/commonjs/rating/Rating.js.map +1 -1
  71. package/lib/commonjs/rating/RatingBar.js +23 -12
  72. package/lib/commonjs/rating/RatingBar.js.map +1 -1
  73. package/lib/commonjs/rating/RatingBar.web.js +74 -0
  74. package/lib/commonjs/rating/RatingBar.web.js.map +1 -0
  75. package/lib/commonjs/rating/index.js +1 -1
  76. package/lib/commonjs/rating/index.web.js +27 -0
  77. package/lib/commonjs/rating/index.web.js.map +1 -0
  78. package/lib/commonjs/stat-bar/Meter.js +9 -2
  79. package/lib/commonjs/stat-bar/Meter.js.map +1 -1
  80. package/lib/commonjs/stat-bar/Meter.web.js +79 -0
  81. package/lib/commonjs/stat-bar/Meter.web.js.map +1 -0
  82. package/lib/commonjs/stat-bar/StatBar.js +1 -1
  83. package/lib/commonjs/stat-bar/index.js +1 -1
  84. package/lib/commonjs/stat-bar/index.web.js +46 -0
  85. package/lib/commonjs/stat-bar/index.web.js.map +1 -0
  86. package/lib/commonjs/styles/resolve-native-web-style.js +50 -0
  87. package/lib/commonjs/styles/resolve-native-web-style.js.map +1 -0
  88. package/lib/commonjs/tenancy/parts.js +5 -5
  89. package/lib/commonjs/tenancy/parts.js.map +1 -1
  90. package/lib/commonjs/track-list/EpisodeRow.js +9 -9
  91. package/lib/commonjs/track-list/EpisodeRow.js.map +1 -1
  92. package/lib/commonjs/vendor-card/VendorCard.js +11 -11
  93. package/lib/commonjs/vendor-card/VendorCard.js.map +1 -1
  94. package/lib/commonjs/wizard/WizardProgress.js +6 -6
  95. package/lib/commonjs/wizard/WizardProgress.js.map +1 -1
  96. package/lib/module/accordion/Accordion.js +58 -76
  97. package/lib/module/accordion/Accordion.js.map +1 -1
  98. package/lib/module/accordion/Accordion.web.js +188 -0
  99. package/lib/module/accordion/Accordion.web.js.map +1 -0
  100. package/lib/module/accordion/context.js +17 -0
  101. package/lib/module/accordion/context.js.map +1 -0
  102. package/lib/module/accordion/index.js +1 -1
  103. package/lib/module/accordion/index.js.map +1 -1
  104. package/lib/module/accordion/index.web.js +9 -0
  105. package/lib/module/accordion/index.web.js.map +1 -0
  106. package/lib/module/accordion/use-accordion.js +76 -0
  107. package/lib/module/accordion/use-accordion.js.map +1 -0
  108. package/lib/module/booking/BookingCard.js +1 -1
  109. package/lib/module/booking/BookingCard.js.map +1 -1
  110. package/lib/module/button/Button.js +14 -2
  111. package/lib/module/button/Button.js.map +1 -1
  112. package/lib/module/button/Button.web.js +50 -12
  113. package/lib/module/button/Button.web.js.map +1 -1
  114. package/lib/module/carrier-quote/CarrierQuoteCard.js +1 -1
  115. package/lib/module/carrier-quote/CarrierQuoteCard.js.map +1 -1
  116. package/lib/module/cart-panel/CartPanel.js +1 -1
  117. package/lib/module/cart-panel/CartPanel.js.map +1 -1
  118. package/lib/module/creator-studio/TrackUploadRow.js +1 -1
  119. package/lib/module/creator-studio/TrackUploadRow.js.map +1 -1
  120. package/lib/module/index.js +3 -3
  121. package/lib/module/index.js.map +1 -1
  122. package/lib/module/index.web.js +3 -3
  123. package/lib/module/index.web.js.map +1 -1
  124. package/lib/module/lead-score/LeadScoreCard.js +1 -1
  125. package/lib/module/lead-score/LeadScoreCard.js.map +1 -1
  126. package/lib/module/listing-actions/ApplicationChecklist.js +1 -1
  127. package/lib/module/listing-actions/ApplicationChecklist.js.map +1 -1
  128. package/lib/module/listing-card/ListingCard.js +1 -1
  129. package/lib/module/listing-card/ListingCard.js.map +1 -1
  130. package/lib/module/listing-details/ListingHeader.js +1 -1
  131. package/lib/module/listing-details/ListingHeader.js.map +1 -1
  132. package/lib/module/listing-details/ReviewSummary.js +1 -1
  133. package/lib/module/listing-details/ReviewSummary.js.map +1 -1
  134. package/lib/module/listing-editor/ListingQualityMeter.js +1 -1
  135. package/lib/module/listing-editor/ListingQualityMeter.js.map +1 -1
  136. package/lib/module/map-marker/MapListingPreview.js +1 -1
  137. package/lib/module/map-marker/MapListingPreview.js.map +1 -1
  138. package/lib/module/media-card/parts.js +1 -1
  139. package/lib/module/media-card/parts.js.map +1 -1
  140. package/lib/module/media-header/AudiobookHeader.js +1 -1
  141. package/lib/module/media-header/AudiobookHeader.js.map +1 -1
  142. package/lib/module/media-header/PodcastShowHeader.js +1 -1
  143. package/lib/module/media-header/PodcastShowHeader.js.map +1 -1
  144. package/lib/module/media-header/parts.js +1 -1
  145. package/lib/module/media-header/parts.js.map +1 -1
  146. package/lib/module/order-status/OrderStatusBar.js +1 -1
  147. package/lib/module/order-status/OrderStatusBar.js.map +1 -1
  148. package/lib/module/outline-nav/OutlineNav.js +1 -1
  149. package/lib/module/outline-nav/OutlineNav.js.map +1 -1
  150. package/lib/module/place-card/PlaceCard.js +1 -1
  151. package/lib/module/place-card/PlaceCard.js.map +1 -1
  152. package/lib/module/place-details/PlaceHours.js +1 -1
  153. package/lib/module/place-details/PlaceHours.js.map +1 -1
  154. package/lib/module/place-reviews/PlaceReviewCard.js +1 -1
  155. package/lib/module/place-reviews/PlaceReviewCard.js.map +1 -1
  156. package/lib/module/property-insights/NeighbourhoodScores.js +1 -1
  157. package/lib/module/property-insights/NeighbourhoodScores.js.map +1 -1
  158. package/lib/module/property-insights/PricePerAreaComparison.js +1 -1
  159. package/lib/module/property-insights/PricePerAreaComparison.js.map +1 -1
  160. package/lib/module/rating/Rating.js +7 -4
  161. package/lib/module/rating/Rating.js.map +1 -1
  162. package/lib/module/rating/RatingBar.js +19 -8
  163. package/lib/module/rating/RatingBar.js.map +1 -1
  164. package/lib/module/rating/RatingBar.web.js +69 -0
  165. package/lib/module/rating/RatingBar.web.js.map +1 -0
  166. package/lib/module/rating/index.js +1 -1
  167. package/lib/module/rating/index.js.map +1 -1
  168. package/lib/module/rating/index.web.js +11 -0
  169. package/lib/module/rating/index.web.js.map +1 -0
  170. package/lib/module/stat-bar/Meter.js +9 -2
  171. package/lib/module/stat-bar/Meter.js.map +1 -1
  172. package/lib/module/stat-bar/Meter.web.js +74 -0
  173. package/lib/module/stat-bar/Meter.web.js.map +1 -0
  174. package/lib/module/stat-bar/StatBar.js +1 -1
  175. package/lib/module/stat-bar/StatBar.js.map +1 -1
  176. package/lib/module/stat-bar/index.js +1 -1
  177. package/lib/module/stat-bar/index.js.map +1 -1
  178. package/lib/module/stat-bar/index.web.js +12 -0
  179. package/lib/module/stat-bar/index.web.js.map +1 -0
  180. package/lib/module/styles/resolve-native-web-style.js +47 -0
  181. package/lib/module/styles/resolve-native-web-style.js.map +1 -0
  182. package/lib/module/tenancy/parts.js +1 -1
  183. package/lib/module/tenancy/parts.js.map +1 -1
  184. package/lib/module/track-list/EpisodeRow.js +1 -1
  185. package/lib/module/track-list/EpisodeRow.js.map +1 -1
  186. package/lib/module/vendor-card/VendorCard.js +1 -1
  187. package/lib/module/vendor-card/VendorCard.js.map +1 -1
  188. package/lib/module/wizard/WizardProgress.js +1 -1
  189. package/lib/module/wizard/WizardProgress.js.map +1 -1
  190. package/lib/typescript/commonjs/accordion/Accordion.d.ts +15 -4
  191. package/lib/typescript/commonjs/accordion/Accordion.d.ts.map +1 -1
  192. package/lib/typescript/commonjs/accordion/Accordion.web.d.ts +7 -0
  193. package/lib/typescript/commonjs/accordion/Accordion.web.d.ts.map +1 -0
  194. package/lib/typescript/commonjs/accordion/context.d.ts +16 -0
  195. package/lib/typescript/commonjs/accordion/context.d.ts.map +1 -0
  196. package/lib/typescript/commonjs/accordion/index.d.ts +1 -1
  197. package/lib/typescript/commonjs/accordion/index.d.ts.map +1 -1
  198. package/lib/typescript/commonjs/accordion/index.web.d.ts +3 -0
  199. package/lib/typescript/commonjs/accordion/index.web.d.ts.map +1 -0
  200. package/lib/typescript/commonjs/accordion/types.d.ts +15 -0
  201. package/lib/typescript/commonjs/accordion/types.d.ts.map +1 -1
  202. package/lib/typescript/commonjs/accordion/use-accordion.d.ts +18 -0
  203. package/lib/typescript/commonjs/accordion/use-accordion.d.ts.map +1 -0
  204. package/lib/typescript/commonjs/button/Button.d.ts +1 -1
  205. package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
  206. package/lib/typescript/commonjs/button/Button.web.d.ts +1 -1
  207. package/lib/typescript/commonjs/button/Button.web.d.ts.map +1 -1
  208. package/lib/typescript/commonjs/button/index.d.ts +1 -1
  209. package/lib/typescript/commonjs/button/index.d.ts.map +1 -1
  210. package/lib/typescript/commonjs/button/index.web.d.ts +1 -1
  211. package/lib/typescript/commonjs/button/index.web.d.ts.map +1 -1
  212. package/lib/typescript/commonjs/button/types.d.ts +14 -1
  213. package/lib/typescript/commonjs/button/types.d.ts.map +1 -1
  214. package/lib/typescript/commonjs/index.web.d.ts +5 -5
  215. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  216. package/lib/typescript/commonjs/rating/Rating.d.ts +1 -1
  217. package/lib/typescript/commonjs/rating/Rating.d.ts.map +1 -1
  218. package/lib/typescript/commonjs/rating/RatingBar.d.ts +11 -3
  219. package/lib/typescript/commonjs/rating/RatingBar.d.ts.map +1 -1
  220. package/lib/typescript/commonjs/rating/RatingBar.web.d.ts +4 -0
  221. package/lib/typescript/commonjs/rating/RatingBar.web.d.ts.map +1 -0
  222. package/lib/typescript/commonjs/rating/index.web.d.ts +5 -0
  223. package/lib/typescript/commonjs/rating/index.web.d.ts.map +1 -0
  224. package/lib/typescript/commonjs/rating/types.d.ts +11 -0
  225. package/lib/typescript/commonjs/rating/types.d.ts.map +1 -1
  226. package/lib/typescript/commonjs/stat-bar/Meter.d.ts +7 -25
  227. package/lib/typescript/commonjs/stat-bar/Meter.d.ts.map +1 -1
  228. package/lib/typescript/commonjs/stat-bar/Meter.web.d.ts +4 -0
  229. package/lib/typescript/commonjs/stat-bar/Meter.web.d.ts.map +1 -0
  230. package/lib/typescript/commonjs/stat-bar/index.web.d.ts +7 -0
  231. package/lib/typescript/commonjs/stat-bar/index.web.d.ts.map +1 -0
  232. package/lib/typescript/commonjs/stat-bar/types.d.ts +4 -0
  233. package/lib/typescript/commonjs/stat-bar/types.d.ts.map +1 -1
  234. package/lib/typescript/commonjs/styles/resolve-native-web-style.d.ts +5 -0
  235. package/lib/typescript/commonjs/styles/resolve-native-web-style.d.ts.map +1 -0
  236. package/lib/typescript/module/accordion/Accordion.d.ts +15 -4
  237. package/lib/typescript/module/accordion/Accordion.d.ts.map +1 -1
  238. package/lib/typescript/module/accordion/Accordion.web.d.ts +7 -0
  239. package/lib/typescript/module/accordion/Accordion.web.d.ts.map +1 -0
  240. package/lib/typescript/module/accordion/context.d.ts +16 -0
  241. package/lib/typescript/module/accordion/context.d.ts.map +1 -0
  242. package/lib/typescript/module/accordion/index.d.ts +1 -1
  243. package/lib/typescript/module/accordion/index.d.ts.map +1 -1
  244. package/lib/typescript/module/accordion/index.web.d.ts +3 -0
  245. package/lib/typescript/module/accordion/index.web.d.ts.map +1 -0
  246. package/lib/typescript/module/accordion/types.d.ts +15 -0
  247. package/lib/typescript/module/accordion/types.d.ts.map +1 -1
  248. package/lib/typescript/module/accordion/use-accordion.d.ts +18 -0
  249. package/lib/typescript/module/accordion/use-accordion.d.ts.map +1 -0
  250. package/lib/typescript/module/button/Button.d.ts +1 -1
  251. package/lib/typescript/module/button/Button.d.ts.map +1 -1
  252. package/lib/typescript/module/button/Button.web.d.ts +1 -1
  253. package/lib/typescript/module/button/Button.web.d.ts.map +1 -1
  254. package/lib/typescript/module/button/index.d.ts +1 -1
  255. package/lib/typescript/module/button/index.d.ts.map +1 -1
  256. package/lib/typescript/module/button/index.web.d.ts +1 -1
  257. package/lib/typescript/module/button/index.web.d.ts.map +1 -1
  258. package/lib/typescript/module/button/types.d.ts +14 -1
  259. package/lib/typescript/module/button/types.d.ts.map +1 -1
  260. package/lib/typescript/module/index.web.d.ts +5 -5
  261. package/lib/typescript/module/index.web.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/button/Button.tsx +12 -2
  291. package/src/button/Button.web.tsx +48 -12
  292. package/src/button/index.ts +2 -0
  293. package/src/button/index.web.ts +2 -0
  294. package/src/button/types.ts +15 -1
  295. package/src/index.web.ts +5 -5
  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 type { BloomAppearance, BloomTone, BloomSize } from '../appearance/types';
2
2
  import type { BloomIconRenderer } from '../icons/render-icon';
3
3
  import type { ReactNode } from 'react';
4
- import type { GestureResponderEvent, LayoutChangeEvent, ViewProps, StyleProp, ViewStyle, TextStyle } from 'react-native';
4
+ import type { GestureResponderEvent, FocusEvent as NativeFocusEvent, MouseEvent as NativeMouseEvent, LayoutChangeEvent, ViewProps, StyleProp, ViewStyle, TextStyle } from 'react-native';
5
5
  import type { WebAriaProps } from '../styles/styled-primitives';
6
6
  import type { BloomIconComponent } from '../icons/icon-component';
7
7
  import type { TypeScaleVariant } from '../typography/scale';
@@ -9,7 +9,18 @@ import type { TypeScaleVariant } from '../typography/scale';
9
9
  /** Shared control size; square geometry is expressed with iconOnly. */
10
10
  export type ButtonSize = BloomSize;
11
11
 
12
+ /** The original platform focus event, without a synthetic cross-platform adapter. */
13
+ export type ButtonFocusEvent = NativeFocusEvent | React.FocusEvent<HTMLElement>;
14
+ /** Native Pressable hover event or the original non-touch web pointer event. */
15
+ export type ButtonHoverEvent = NativeMouseEvent | React.PointerEvent<HTMLElement>;
16
+
12
17
  export interface ButtonProps {
18
+ /** Focus lifecycle on the interactive host; does not activate the button. */
19
+ onFocus?: (event: ButtonFocusEvent) => void;
20
+ onBlur?: (event: ButtonFocusEvent) => void;
21
+ /** Pointer preview lifecycle. Touch gestures do not synthesize web hover. */
22
+ onHoverIn?: (event: ButtonHoverEvent) => void;
23
+ onHoverOut?: (event: ButtonHoverEvent) => void;
13
24
  onLayout?: (event: LayoutChangeEvent) => void;
14
25
  'aria-hidden'?: boolean;
15
26
  accessibilityElementsHidden?: boolean;
@@ -166,6 +177,9 @@ export interface ButtonProps {
166
177
  * and `'reset'` to reset a form.
167
178
  */
168
179
  type?: 'button' | 'submit' | 'reset';
180
+ /** Original DOM keyboard event (web only). preventDefault cancels native key behavior. */
181
+ onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
182
+ onKeyUp?: React.KeyboardEventHandler<HTMLElement>;
169
183
  /**
170
184
  * Web click handler. Aliased to the same logical action as `onPress` — either
171
185
  * (or both) may be provided; both fire on click. `onPress` is kept for
package/src/index.web.ts CHANGED
@@ -339,7 +339,7 @@ export type { BottomSheetRef, BottomSheetProps } from './bottom-sheet/index.web'
339
339
  // Data display
340
340
  export * from './card';
341
341
  export * from './badge';
342
- export { Rating, RatingBar, RatingInput } from './rating';
342
+ export { Rating, RatingBar, RatingInput } from './rating/index.web';
343
343
  export type {
344
344
  RatingBarProps,
345
345
  RatingCountStyle,
@@ -347,7 +347,7 @@ export type {
347
347
  RatingInputSize,
348
348
  RatingProps,
349
349
  RatingSize,
350
- } from './rating';
350
+ } from './rating/index.web';
351
351
  export {
352
352
  ExplicitBadge,
353
353
  formatDuration,
@@ -1974,14 +1974,14 @@ export * from './aspect-ratio';
1974
1974
  export * from './tabs';
1975
1975
  export * from './checkbox';
1976
1976
  export * from './radio';
1977
- export * from './accordion';
1977
+ export * from './accordion/index.web';
1978
1978
  export { LinkPreviewCard } from './link-preview';
1979
1979
  export type { LinkPreviewCardProps } from './link-preview';
1980
1980
 
1981
1981
  // Stat / profile widgets
1982
1982
  export { CompositionBar } from './composition-bar';
1983
1983
  export type { CompositionBarProps, CompositionCategory } from './composition-bar';
1984
- export { Meter, MeterRing, StatBar, meterFraction, meterValue, resolveMeterColors } from './stat-bar';
1984
+ export { Meter, MeterRing, StatBar, meterFraction, meterValue, resolveMeterColors } from './stat-bar/index.web';
1985
1985
  export type {
1986
1986
  AnyMeterProps,
1987
1987
  MeterColors,
@@ -1992,7 +1992,7 @@ export type {
1992
1992
  StatBarProgressProps,
1993
1993
  StatBarSplitProps,
1994
1994
  StatBarVariant,
1995
- } from './stat-bar';
1995
+ } from './stat-bar/index.web';
1996
1996
  export { ActivityHeatmap, bucketByDay } from './activity-heatmap';
1997
1997
  export type { ActivityHeatmapProps, ActivityHeatmapDay } from './activity-heatmap';
1998
1998
 
@@ -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
+ }