@oxy.so/bloom 2.3.0 → 2.5.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 (248) hide show
  1. package/README.md +3 -3
  2. package/docs/avatar-group.mdx +10 -17
  3. package/docs/hover-card.mdx +125 -0
  4. package/docs/popover.mdx +73 -19
  5. package/docs/user-hover-card.mdx +29 -9
  6. package/lib/commonjs/avatar-group/AvatarGroup.web.js +55 -85
  7. package/lib/commonjs/avatar-group/AvatarGroup.web.js.map +1 -1
  8. package/lib/commonjs/calendar/CalendarViewInboxMenu.js +4 -13
  9. package/lib/commonjs/calendar/CalendarViewInboxMenu.js.map +1 -1
  10. package/lib/commonjs/calendar/CalendarViewMonthGrid.js +6 -10
  11. package/lib/commonjs/calendar/CalendarViewMonthGrid.js.map +1 -1
  12. package/lib/commonjs/dialog/DialogHeader.js +1 -7
  13. package/lib/commonjs/dialog/DialogHeader.js.map +1 -1
  14. package/lib/commonjs/floating/FloatingPanel.js +19 -22
  15. package/lib/commonjs/floating/FloatingPanel.js.map +1 -1
  16. package/lib/commonjs/floating/constants.js +12 -56
  17. package/lib/commonjs/floating/constants.js.map +1 -1
  18. package/lib/commonjs/floating/menu-sub-flyout.js +3 -3
  19. package/lib/commonjs/floating/use-anchor-rect.js +1 -0
  20. package/lib/commonjs/floating/use-anchor-rect.js.map +1 -1
  21. package/lib/commonjs/hover-card/HoverCard.js +104 -0
  22. package/lib/commonjs/hover-card/HoverCard.js.map +1 -0
  23. package/lib/commonjs/hover-card/HoverCard.web.js +155 -0
  24. package/lib/commonjs/hover-card/HoverCard.web.js.map +1 -0
  25. package/lib/commonjs/hover-card/HoverCardPanel.js +101 -0
  26. package/lib/commonjs/hover-card/HoverCardPanel.js.map +1 -0
  27. package/lib/commonjs/hover-card/constants.js +25 -0
  28. package/lib/commonjs/hover-card/constants.js.map +1 -0
  29. package/lib/commonjs/hover-card/context.js +37 -0
  30. package/lib/commonjs/hover-card/context.js.map +1 -0
  31. package/lib/commonjs/hover-card/index.js +44 -0
  32. package/lib/commonjs/hover-card/index.js.map +1 -0
  33. package/lib/commonjs/hover-card/index.web.js +44 -0
  34. package/lib/commonjs/hover-card/index.web.js.map +1 -0
  35. package/lib/commonjs/hover-card/types.js +6 -0
  36. package/lib/commonjs/hover-card/types.js.map +1 -0
  37. package/lib/commonjs/hover-card/use-hover-intent.js +49 -0
  38. package/lib/commonjs/hover-card/use-hover-intent.js.map +1 -0
  39. package/lib/commonjs/index.js +12 -0
  40. package/lib/commonjs/index.js.map +1 -1
  41. package/lib/commonjs/index.web.js +16 -4
  42. package/lib/commonjs/index.web.js.map +1 -1
  43. package/lib/commonjs/popover/Popover.js +23 -3
  44. package/lib/commonjs/popover/Popover.js.map +1 -1
  45. package/lib/commonjs/popover/Popover.web.js +21 -16
  46. package/lib/commonjs/popover/Popover.web.js.map +1 -1
  47. package/lib/commonjs/popover/index.js +31 -0
  48. package/lib/commonjs/popover/index.js.map +1 -1
  49. package/lib/commonjs/popover/index.web.js +31 -0
  50. package/lib/commonjs/popover/index.web.js.map +1 -1
  51. package/lib/commonjs/popover/parts.js +164 -0
  52. package/lib/commonjs/popover/parts.js.map +1 -0
  53. package/lib/commonjs/popover/surface.js +102 -0
  54. package/lib/commonjs/popover/surface.js.map +1 -0
  55. package/lib/commonjs/sidebar/parts.js +9 -11
  56. package/lib/commonjs/sidebar/parts.js.map +1 -1
  57. package/lib/commonjs/user-hover-card/UserHoverCard.js +16 -6
  58. package/lib/commonjs/user-hover-card/UserHoverCard.js.map +1 -1
  59. package/lib/commonjs/user-hover-card/constants.js +8 -2
  60. package/lib/commonjs/user-hover-card/constants.js.map +1 -1
  61. package/lib/module/avatar-group/AvatarGroup.web.js +55 -84
  62. package/lib/module/avatar-group/AvatarGroup.web.js.map +1 -1
  63. package/lib/module/calendar/CalendarViewInboxMenu.js +4 -13
  64. package/lib/module/calendar/CalendarViewInboxMenu.js.map +1 -1
  65. package/lib/module/calendar/CalendarViewMonthGrid.js +6 -10
  66. package/lib/module/calendar/CalendarViewMonthGrid.js.map +1 -1
  67. package/lib/module/dialog/DialogHeader.js +1 -7
  68. package/lib/module/dialog/DialogHeader.js.map +1 -1
  69. package/lib/module/floating/FloatingPanel.js +20 -23
  70. package/lib/module/floating/FloatingPanel.js.map +1 -1
  71. package/lib/module/floating/constants.js +11 -55
  72. package/lib/module/floating/constants.js.map +1 -1
  73. package/lib/module/floating/menu-sub-flyout.js +3 -3
  74. package/lib/module/floating/use-anchor-rect.js +1 -1
  75. package/lib/module/floating/use-anchor-rect.js.map +1 -1
  76. package/lib/module/hover-card/HoverCard.js +96 -0
  77. package/lib/module/hover-card/HoverCard.js.map +1 -0
  78. package/lib/module/hover-card/HoverCard.web.js +147 -0
  79. package/lib/module/hover-card/HoverCard.web.js.map +1 -0
  80. package/lib/module/hover-card/HoverCardPanel.js +95 -0
  81. package/lib/module/hover-card/HoverCardPanel.js.map +1 -0
  82. package/lib/module/hover-card/constants.js +21 -0
  83. package/lib/module/hover-card/constants.js.map +1 -0
  84. package/lib/module/hover-card/context.js +30 -0
  85. package/lib/module/hover-card/context.js.map +1 -0
  86. package/lib/module/hover-card/index.js +5 -0
  87. package/lib/module/hover-card/index.js.map +1 -0
  88. package/lib/module/hover-card/index.web.js +5 -0
  89. package/lib/module/hover-card/index.web.js.map +1 -0
  90. package/lib/module/hover-card/types.js +4 -0
  91. package/lib/module/hover-card/types.js.map +1 -0
  92. package/lib/module/hover-card/use-hover-intent.js +46 -0
  93. package/lib/module/hover-card/use-hover-intent.js.map +1 -0
  94. package/lib/module/index.js +1 -0
  95. package/lib/module/index.js.map +1 -1
  96. package/lib/module/index.web.js +1 -0
  97. package/lib/module/index.web.js.map +1 -1
  98. package/lib/module/popover/Popover.js +23 -3
  99. package/lib/module/popover/Popover.js.map +1 -1
  100. package/lib/module/popover/Popover.web.js +22 -17
  101. package/lib/module/popover/Popover.web.js.map +1 -1
  102. package/lib/module/popover/index.js +1 -0
  103. package/lib/module/popover/index.js.map +1 -1
  104. package/lib/module/popover/index.web.js +1 -0
  105. package/lib/module/popover/index.web.js.map +1 -1
  106. package/lib/module/popover/parts.js +154 -0
  107. package/lib/module/popover/parts.js.map +1 -0
  108. package/lib/module/popover/surface.js +96 -0
  109. package/lib/module/popover/surface.js.map +1 -0
  110. package/lib/module/sidebar/parts.js +9 -11
  111. package/lib/module/sidebar/parts.js.map +1 -1
  112. package/lib/module/user-hover-card/UserHoverCard.js +15 -5
  113. package/lib/module/user-hover-card/UserHoverCard.js.map +1 -1
  114. package/lib/module/user-hover-card/constants.js +9 -2
  115. package/lib/module/user-hover-card/constants.js.map +1 -1
  116. package/lib/typescript/commonjs/avatar-group/AvatarGroup.web.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/calendar/CalendarViewInboxMenu.d.ts.map +1 -1
  118. package/lib/typescript/commonjs/calendar/CalendarViewMonthGrid.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/dialog/DialogHeader.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/floating/FloatingPanel.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/floating/constants.d.ts +11 -50
  122. package/lib/typescript/commonjs/floating/constants.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/floating/types.d.ts +5 -4
  124. package/lib/typescript/commonjs/floating/types.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/floating/use-anchor-rect.d.ts +7 -0
  126. package/lib/typescript/commonjs/floating/use-anchor-rect.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/hover-card/HoverCard.d.ts +5 -0
  128. package/lib/typescript/commonjs/hover-card/HoverCard.d.ts.map +1 -0
  129. package/lib/typescript/commonjs/hover-card/HoverCard.web.d.ts +5 -0
  130. package/lib/typescript/commonjs/hover-card/HoverCard.web.d.ts.map +1 -0
  131. package/lib/typescript/commonjs/hover-card/HoverCardPanel.d.ts +45 -0
  132. package/lib/typescript/commonjs/hover-card/HoverCardPanel.d.ts.map +1 -0
  133. package/lib/typescript/commonjs/hover-card/constants.d.ts +16 -0
  134. package/lib/typescript/commonjs/hover-card/constants.d.ts.map +1 -0
  135. package/lib/typescript/commonjs/hover-card/context.d.ts +21 -0
  136. package/lib/typescript/commonjs/hover-card/context.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/hover-card/index.d.ts +4 -0
  138. package/lib/typescript/commonjs/hover-card/index.d.ts.map +1 -0
  139. package/lib/typescript/commonjs/hover-card/index.web.d.ts +4 -0
  140. package/lib/typescript/commonjs/hover-card/index.web.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/hover-card/types.d.ts +50 -0
  142. package/lib/typescript/commonjs/hover-card/types.d.ts.map +1 -0
  143. package/lib/typescript/commonjs/hover-card/use-hover-intent.d.ts +14 -0
  144. package/lib/typescript/commonjs/hover-card/use-hover-intent.d.ts.map +1 -0
  145. package/lib/typescript/commonjs/index.d.ts +1 -0
  146. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  147. package/lib/typescript/commonjs/index.web.d.ts +1 -0
  148. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/popover/Popover.d.ts +1 -1
  150. package/lib/typescript/commonjs/popover/Popover.d.ts.map +1 -1
  151. package/lib/typescript/commonjs/popover/Popover.web.d.ts.map +1 -1
  152. package/lib/typescript/commonjs/popover/index.d.ts +2 -1
  153. package/lib/typescript/commonjs/popover/index.d.ts.map +1 -1
  154. package/lib/typescript/commonjs/popover/index.web.d.ts +2 -1
  155. package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
  156. package/lib/typescript/commonjs/popover/parts.d.ts +7 -0
  157. package/lib/typescript/commonjs/popover/parts.d.ts.map +1 -0
  158. package/lib/typescript/commonjs/popover/surface.d.ts +58 -0
  159. package/lib/typescript/commonjs/popover/surface.d.ts.map +1 -0
  160. package/lib/typescript/commonjs/popover/types.d.ts +50 -0
  161. package/lib/typescript/commonjs/popover/types.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/sidebar/parts.d.ts +2 -2
  163. package/lib/typescript/commonjs/sidebar/parts.d.ts.map +1 -1
  164. package/lib/typescript/commonjs/user-hover-card/UserHoverCard.d.ts.map +1 -1
  165. package/lib/typescript/commonjs/user-hover-card/constants.d.ts +6 -1
  166. package/lib/typescript/commonjs/user-hover-card/constants.d.ts.map +1 -1
  167. package/lib/typescript/module/avatar-group/AvatarGroup.web.d.ts.map +1 -1
  168. package/lib/typescript/module/calendar/CalendarViewInboxMenu.d.ts.map +1 -1
  169. package/lib/typescript/module/calendar/CalendarViewMonthGrid.d.ts.map +1 -1
  170. package/lib/typescript/module/dialog/DialogHeader.d.ts.map +1 -1
  171. package/lib/typescript/module/floating/FloatingPanel.d.ts.map +1 -1
  172. package/lib/typescript/module/floating/constants.d.ts +11 -50
  173. package/lib/typescript/module/floating/constants.d.ts.map +1 -1
  174. package/lib/typescript/module/floating/types.d.ts +5 -4
  175. package/lib/typescript/module/floating/types.d.ts.map +1 -1
  176. package/lib/typescript/module/floating/use-anchor-rect.d.ts +7 -0
  177. package/lib/typescript/module/floating/use-anchor-rect.d.ts.map +1 -1
  178. package/lib/typescript/module/hover-card/HoverCard.d.ts +5 -0
  179. package/lib/typescript/module/hover-card/HoverCard.d.ts.map +1 -0
  180. package/lib/typescript/module/hover-card/HoverCard.web.d.ts +5 -0
  181. package/lib/typescript/module/hover-card/HoverCard.web.d.ts.map +1 -0
  182. package/lib/typescript/module/hover-card/HoverCardPanel.d.ts +45 -0
  183. package/lib/typescript/module/hover-card/HoverCardPanel.d.ts.map +1 -0
  184. package/lib/typescript/module/hover-card/constants.d.ts +16 -0
  185. package/lib/typescript/module/hover-card/constants.d.ts.map +1 -0
  186. package/lib/typescript/module/hover-card/context.d.ts +21 -0
  187. package/lib/typescript/module/hover-card/context.d.ts.map +1 -0
  188. package/lib/typescript/module/hover-card/index.d.ts +4 -0
  189. package/lib/typescript/module/hover-card/index.d.ts.map +1 -0
  190. package/lib/typescript/module/hover-card/index.web.d.ts +4 -0
  191. package/lib/typescript/module/hover-card/index.web.d.ts.map +1 -0
  192. package/lib/typescript/module/hover-card/types.d.ts +50 -0
  193. package/lib/typescript/module/hover-card/types.d.ts.map +1 -0
  194. package/lib/typescript/module/hover-card/use-hover-intent.d.ts +14 -0
  195. package/lib/typescript/module/hover-card/use-hover-intent.d.ts.map +1 -0
  196. package/lib/typescript/module/index.d.ts +1 -0
  197. package/lib/typescript/module/index.d.ts.map +1 -1
  198. package/lib/typescript/module/index.web.d.ts +1 -0
  199. package/lib/typescript/module/index.web.d.ts.map +1 -1
  200. package/lib/typescript/module/popover/Popover.d.ts +1 -1
  201. package/lib/typescript/module/popover/Popover.d.ts.map +1 -1
  202. package/lib/typescript/module/popover/Popover.web.d.ts.map +1 -1
  203. package/lib/typescript/module/popover/index.d.ts +2 -1
  204. package/lib/typescript/module/popover/index.d.ts.map +1 -1
  205. package/lib/typescript/module/popover/index.web.d.ts +2 -1
  206. package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
  207. package/lib/typescript/module/popover/parts.d.ts +7 -0
  208. package/lib/typescript/module/popover/parts.d.ts.map +1 -0
  209. package/lib/typescript/module/popover/surface.d.ts +58 -0
  210. package/lib/typescript/module/popover/surface.d.ts.map +1 -0
  211. package/lib/typescript/module/popover/types.d.ts +50 -0
  212. package/lib/typescript/module/popover/types.d.ts.map +1 -1
  213. package/lib/typescript/module/sidebar/parts.d.ts +2 -2
  214. package/lib/typescript/module/sidebar/parts.d.ts.map +1 -1
  215. package/lib/typescript/module/user-hover-card/UserHoverCard.d.ts.map +1 -1
  216. package/lib/typescript/module/user-hover-card/constants.d.ts +6 -1
  217. package/lib/typescript/module/user-hover-card/constants.d.ts.map +1 -1
  218. package/package.json +20 -1
  219. package/src/avatar-group/AvatarGroup.web.tsx +57 -126
  220. package/src/calendar/CalendarViewInboxMenu.tsx +3 -12
  221. package/src/calendar/CalendarViewMonthGrid.tsx +5 -9
  222. package/src/dialog/DialogHeader.tsx +1 -6
  223. package/src/floating/FloatingPanel.tsx +19 -27
  224. package/src/floating/constants.ts +11 -56
  225. package/src/floating/menu-sub-flyout.tsx +3 -3
  226. package/src/floating/types.ts +5 -4
  227. package/src/floating/use-anchor-rect.ts +1 -1
  228. package/src/hover-card/HoverCard.tsx +90 -0
  229. package/src/hover-card/HoverCard.web.tsx +160 -0
  230. package/src/hover-card/HoverCardPanel.tsx +112 -0
  231. package/src/hover-card/constants.ts +18 -0
  232. package/src/hover-card/context.ts +45 -0
  233. package/src/hover-card/index.ts +7 -0
  234. package/src/hover-card/index.web.ts +7 -0
  235. package/src/hover-card/types.ts +53 -0
  236. package/src/hover-card/use-hover-intent.ts +47 -0
  237. package/src/index.ts +1 -0
  238. package/src/index.web.ts +1 -0
  239. package/src/popover/Popover.tsx +32 -4
  240. package/src/popover/Popover.web.tsx +31 -17
  241. package/src/popover/index.ts +17 -1
  242. package/src/popover/index.web.ts +17 -1
  243. package/src/popover/parts.tsx +141 -0
  244. package/src/popover/surface.ts +119 -0
  245. package/src/popover/types.ts +56 -0
  246. package/src/sidebar/parts.tsx +8 -11
  247. package/src/user-hover-card/UserHoverCard.tsx +30 -18
  248. package/src/user-hover-card/constants.ts +9 -2
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The popover PANEL — Bloom's one floating surface, resolved to inline style.
3
+ *
4
+ * Every floating panel (`dropdown/menu-styles.ts`'s `MENU_POPOVER_SURFACE`, the
5
+ * dashboard team/user menus, the calendar inbox menu, the ai-chat menus) spells
6
+ * the same class string:
7
+ *
8
+ * w-[266px] max-w-[calc(100vw-32px)] overflow-y-auto
9
+ * rounded-2xl border border-border-button-default
10
+ * bg-background-primary-default p-2.5 shadow-dropdown
11
+ * transition duration-150 ease-out, entering/exiting opacity-0 scale-95 blur-[2px]
12
+ * origin at the placement side, offset 8 (4 on the select / date pickers)
13
+ *
14
+ * The motion is `FloatingPanel`'s; everything else is resolved here.
15
+ *
16
+ * ── WHY INLINE, AND HOW A CALLER'S `className` STILL WINS ────────────────────
17
+ *
18
+ * The colours are ramp stops (`menu-palette.ts`) that exist as no CSS variable,
19
+ * so they cannot be classes. The geometry is inline too, because a default CLASS
20
+ * competes with the caller's class by Tailwind's emission order, not by the order
21
+ * in the attribute — measured on this very family: `DialogHeader`'s
22
+ * `className="w-auto p-space-4"` rendered 16px of padding, because the old
23
+ * `p-space-16` default was emitted later and won.
24
+ *
25
+ * But an inline style beats ANY class on web, so a naive inline default would
26
+ * silently outrank every `className` a caller passes. {@link classChromeOverrides}
27
+ * closes that: it reads which chrome PROPERTIES the caller's utilities name
28
+ * (`w-*`, `p-*`, `rounded-*`, `bg-*`, …) and the matching inline default is left
29
+ * out, so the caller's class is the only rule for that property. A caller's
30
+ * `style` still comes last and overrides everything.
31
+ */
32
+ import type { MenuPalette } from '../floating/menu-palette';
33
+ import type { WebCssStyle } from '../styles/web-view-style';
34
+ /** `w-[266px]` — `MENU_POPOVER_WIDTH`. */
35
+ export declare const POPOVER_WIDTH = 266;
36
+ /** `rounded-2xl`. */
37
+ export declare const POPOVER_RADIUS = 16;
38
+ /** `p-2.5` — also what `PopoverSeparator` bleeds back through. */
39
+ export declare const POPOVER_PADDING = 10;
40
+ /** `max-w-[calc(100vw-32px)]`, as the 32px it subtracts. */
41
+ export declare const POPOVER_VIEWPORT_INSET = 32;
42
+ /** Popovers sit `offset={8}` from their trigger. */
43
+ export declare const POPOVER_SIDE_OFFSET = 8;
44
+ export type PopoverChromeKey = 'width' | 'maxWidth' | 'padding' | 'radius' | 'borderWidth' | 'borderColor' | 'background' | 'shadow' | 'overflow';
45
+ /**
46
+ * Which chrome properties a caller's utility classes set. Variants (`dark:`,
47
+ * `md:`, `hover:`), the important `!` and a negative `-` are stripped first, so
48
+ * `md:!p-0` counts as padding.
49
+ */
50
+ export declare function classChromeOverrides(className?: string): ReadonlySet<PopoverChromeKey>;
51
+ /**
52
+ * The panel's inline chrome, minus every property the caller's `className`
53
+ * names. `maxWidth` is only the default: a numeric `maxWidth` PROP is applied by
54
+ * `FloatingPanel` and must not be overwritten, so the caller passes
55
+ * `viewportWidth` only when no prop was given.
56
+ */
57
+ export declare function resolvePopoverSurfaceStyle(palette: MenuPalette, overridden: ReadonlySet<PopoverChromeKey>, viewportWidth?: number): WebCssStyle;
58
+ //# sourceMappingURL=surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../../src/popover/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,0CAA0C;AAC1C,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,qBAAqB;AACrB,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,kEAAkE;AAClE,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,4DAA4D;AAC5D,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,oDAAoD;AACpD,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,UAAU,GACV,SAAS,GACT,QAAQ,GACR,aAAa,GACb,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,UAAU,CAAC;AAIf;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAiBtF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,WAAW,CAAC,gBAAgB,CAAC,EACzC,aAAa,CAAC,EAAE,MAAM,GACrB,WAAW,CA0Bb"}
@@ -1,5 +1,55 @@
1
+ import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
1
2
  import type { OverlayOpenProps, OverlaySurfaceProps, OverlayTriggerProps } from '../floating/types';
2
3
  export type PopoverProps = React.PropsWithChildren<OverlayOpenProps>;
3
4
  export type PopoverTriggerProps = OverlayTriggerProps;
4
5
  export type PopoverContentProps = OverlaySurfaceProps;
6
+ /** Shared by the panel's layout parts. */
7
+ interface PopoverPartProps {
8
+ children?: React.ReactNode;
9
+ /** Utility classes on the part's own node. */
10
+ className?: string;
11
+ style?: StyleProp<ViewStyle>;
12
+ testID?: string;
13
+ }
14
+ /**
15
+ * The panel's heading row — `flex items-center gap-2 px-2 pt-1`:
16
+ * an optional `leading` (avatar, icon) beside a column of
17
+ * `PopoverTitle` / `PopoverDescription`.
18
+ */
19
+ export interface PopoverHeaderProps extends PopoverPartProps {
20
+ leading?: React.ReactNode;
21
+ }
22
+ /** `text-body-medium text-text-primary`, or `text-secondary` for a group label. */
23
+ export interface PopoverTitleProps {
24
+ children?: React.ReactNode;
25
+ /**
26
+ * `'secondary'` is the group-label colour panels use above a list
27
+ * ("Users with access", "Local Folders"). Defaults to `'primary'`.
28
+ */
29
+ tone?: 'primary' | 'secondary';
30
+ numberOfLines?: number;
31
+ className?: string;
32
+ style?: StyleProp<TextStyle>;
33
+ testID?: string;
34
+ }
35
+ /** `text-body-regular text-text-secondary`. */
36
+ export interface PopoverDescriptionProps {
37
+ children?: React.ReactNode;
38
+ numberOfLines?: number;
39
+ className?: string;
40
+ style?: StyleProp<TextStyle>;
41
+ testID?: string;
42
+ }
43
+ /** The panel's closing row — `flex items-center gap-3 px-2 pb-2`. */
44
+ export type PopoverFooterProps = PopoverPartProps;
45
+ /**
46
+ * The full-bleed rule between a panel's sections —
47
+ * `-mx-2.5 my-2.5 h-px bg-border-button-default`.
48
+ */
49
+ export interface PopoverSeparatorProps {
50
+ className?: string;
51
+ style?: StyleProp<ViewStyle>;
52
+ testID?: string;
53
+ }
54
+ export {};
5
55
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/popover/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EA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AE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,+CAA+C;AAC/C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qEAAqE;AACrE,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -46,8 +46,8 @@ export declare function ChevronUpDownSmall({ color, size }: {
46
46
  color: string;
47
47
  size?: number;
48
48
  }): import("react/jsx-runtime").JSX.Element;
49
- /** Popover chrome for both sidebar menus: `w-[265px] rounded-2xl border p-2.5 shadow-dropdown`. */
50
- export declare function menuPanelStyle(palette: SidebarPalette): ViewStyle;
49
+ /** The width both sidebar menus give their popover: `w-[265px]`. */
50
+ export declare function menuPanelStyle(_palette?: SidebarPalette): ViewStyle;
51
51
  /** Full-bleed menu divider: `-mx-2.5 h-px bg-border-button-default`. */
52
52
  export declare function MenuDivider({ palette, spacing }: {
53
53
  palette: SidebarPalette;
@@ -1 +1 @@
1
- {"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../../../src/sidebar/parts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAsD,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAClH,OAAiB,EAAoC,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAA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ourceRoot":"","sources":["../../../../src/user-hover-card/UserHoverCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AA0B1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAI5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA6ClD,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,KAAK,GAAG,gBAAgB,CAe1E;AAwYD,eAAO,MAAM,aAAa,gDAA+B,CAAC"}
1
+ {"version":3,"file":"UserHoverCard.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/UserHoverCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AA2B1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAQ5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA6ClD,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,KAAK,GAAG,gBAAgB,CAe1E;AA+YD,eAAO,MAAM,aAAa,gDAA+B,CAAC"}
@@ -22,7 +22,12 @@
22
22
  * — a number chosen to be sized against, not nudged to fit one consumer.
23
23
  */
24
24
  export declare const USER_HOVER_CARD_CONTENT_WIDTH = 256;
25
- /** Padding on all four sides (15px — the card's own inset, not a spacing-scale rung). */
25
+ /**
26
+ * Padding on all four sides (15px — the card's own inset, not a spacing-scale
27
+ * rung). The SAME number as the floating hover-card panel's inset, by reference:
28
+ * inside that panel the card draws no padding of its own and its full-bleed
29
+ * cover reaches the panel edge by pulling out exactly this far.
30
+ */
26
31
  export declare const USER_HOVER_CARD_INSET = 15;
27
32
  /**
28
33
  * Total card width — derived, never the other way round. Anything positioning
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,yFAAyF;AACzF,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QACyB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/constants.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,KAAmB,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QACyB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/bloom",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "packageManager": "bun@1.3.14",
5
5
  "description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
6
6
  "main": "lib/commonjs/index.js",
@@ -1538,6 +1538,25 @@
1538
1538
  "default": "./lib/commonjs/popover/index.js"
1539
1539
  }
1540
1540
  },
1541
+ "./hover-card": {
1542
+ "react-native": {
1543
+ "types": "./lib/typescript/module/hover-card/index.d.ts",
1544
+ "default": "./src/hover-card/index.ts"
1545
+ },
1546
+ "browser": {
1547
+ "types": "./lib/typescript/module/hover-card/index.web.d.ts",
1548
+ "import": "./lib/module/hover-card/index.web.js",
1549
+ "require": "./lib/commonjs/hover-card/index.web.js"
1550
+ },
1551
+ "import": {
1552
+ "types": "./lib/typescript/module/hover-card/index.d.ts",
1553
+ "default": "./lib/module/hover-card/index.js"
1554
+ },
1555
+ "require": {
1556
+ "types": "./lib/typescript/commonjs/hover-card/index.d.ts",
1557
+ "default": "./lib/commonjs/hover-card/index.js"
1558
+ }
1559
+ },
1541
1560
  "./aspect-ratio": {
1542
1561
  "react-native": {
1543
1562
  "types": "./lib/typescript/module/aspect-ratio/index.d.ts",
@@ -1,16 +1,12 @@
1
1
  import React, { memo, useCallback, useMemo, useRef, useState } from 'react';
2
- import { StyleSheet, View } from 'react-native';
2
+ import type { View } from 'react-native';
3
3
 
4
- import { OverlayRoot } from '../overlay';
5
- // `../portal/index.web`, not `../portal`: export conditions do not apply to
6
- // relative specifiers, so the bare name resolves to the NATIVE barrel in any
7
- // bundler that does not add web extensions to its resolution order. The native
8
- // Portal renders into a `PortalOutlet`, which a web app never mounts — both are
9
- // no-ops in the web fork — so the hover card would render nothing at all.
10
- // `Dialog.web.tsx` and `BottomSheet.web.tsx` already name it this way.
11
- import { Portal } from '../portal/index.web';
12
- import { WEB_POSITION_FIXED } from '../styles/web-view-style';
13
- import { USER_HOVER_CARD_WIDTH, UserHoverCard } from '../user-hover-card';
4
+ import type { FloatingAnchor } from '../floating/types';
5
+ import { rectOf } from '../floating/use-anchor-rect';
6
+ import { HOVER_CARD_CLOSE_DELAY } from '../hover-card/constants';
7
+ import { HoverCardPanel } from '../hover-card/HoverCardPanel';
8
+ import { useHoverIntent } from '../hover-card/use-hover-intent';
9
+ import { UserHoverCard } from '../user-hover-card';
14
10
  import {
15
11
  AvatarGroupBase,
16
12
  getItemName,
@@ -18,46 +14,33 @@ import {
18
14
  } from './AvatarGroupBase';
19
15
  import type { AvatarGroupItem, AvatarGroupProps } from './types';
20
16
 
21
- /** Delay before dismissing the card so the cursor can travel into it. */
22
- const CLOSE_DELAY_MS = 120;
23
- /** Gap between the anchored avatar and the floating card. */
24
- const CARD_GAP = 8;
25
- // The card's own width, never a second copy of it: this file CENTRES the card
26
- // on its anchor, so a private constant would mis-place it the first time
27
- // either number moved, and nothing would error.
28
- const CARD_WIDTH = USER_HOVER_CARD_WIDTH;
29
-
30
- interface HoverState {
17
+ interface HoverTarget {
31
18
  item: AvatarGroupItem;
32
19
  index: number;
33
- top: number;
34
- left: number;
20
+ anchor: FloatingAnchor;
35
21
  }
36
22
 
37
23
  /**
38
24
  * Web `AvatarGroup`. Identical layout rendering to native (stack / row /
39
25
  * cluster) via {@link AvatarGroupBase}, plus an optional hover card: when
40
26
  * `hoverCard` is enabled, hovering an avatar reveals a {@link UserHoverCard}
41
- * positioned beneath it. The card receives the per-item `renderItemAction` slot
42
- * so the app can drop its SDK FollowButton inside.
27
+ * beneath it. The card receives the per-item `renderItemAction` slot so the app
28
+ * can drop its SDK FollowButton inside.
29
+ *
30
+ * The card floats in `HoverCardPanel`, the same surface `HoverCardContent`
31
+ * renders — placement (flip and clamp), motion, Escape and outside-press
32
+ * dismissal, and the pointer bridge all come from there. What stays here is the
33
+ * one thing a single `HoverCard` cannot do: ONE card serving every face, which
34
+ * re-anchors as the cursor moves along the pile instead of closing and
35
+ * reopening per avatar. It opens with no delay for the same reason — the
36
+ * pointer is already on a row of people, and the card is what it came for.
43
37
  */
44
38
  const AvatarGroupWebComponent: React.FC<AvatarGroupProps> = (props) => {
45
39
  const { hoverCard, renderItemAction, onPressItem } = props;
46
- const [hover, setHover] = useState<HoverState | null>(null);
40
+ const [target, setTarget] = useState<HoverTarget | null>(null);
41
+ const [open, setOpen] = useState(false);
47
42
  const cellRefs = useRef<Map<number, View>>(new Map());
48
- const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
49
-
50
- const cancelClose = useCallback(() => {
51
- if (closeTimer.current) {
52
- clearTimeout(closeTimer.current);
53
- closeTimer.current = null;
54
- }
55
- }, []);
56
-
57
- const scheduleClose = useCallback(() => {
58
- cancelClose();
59
- closeTimer.current = setTimeout(() => setHover(null), CLOSE_DELAY_MS);
60
- }, [cancelClose]);
43
+ const { show, hide, hold } = useHoverIntent(open, setOpen, 0, HOVER_CARD_CLOSE_DELAY);
61
44
 
62
45
  const registerCellRef = useCallback((index: number, node: View | null) => {
63
46
  if (node) cellRefs.current.set(index, node);
@@ -66,109 +49,57 @@ const AvatarGroupWebComponent: React.FC<AvatarGroupProps> = (props) => {
66
49
 
67
50
  const handleHoverIn = useCallback(
68
51
  (item: AvatarGroupItem, index: number) => {
69
- cancelClose();
70
- const node = cellRefs.current.get(index);
71
- if (!node) return;
72
- node.measureInWindow((x, y, width, height) => {
73
- // Center the card under the avatar, clamped to the viewport.
74
- const viewportWidth =
75
- typeof window !== 'undefined' ? window.innerWidth : CARD_WIDTH;
76
- let left = x + width / 2 - CARD_WIDTH / 2;
77
- left = Math.max(
78
- CARD_GAP,
79
- Math.min(left, viewportWidth - CARD_WIDTH - CARD_GAP),
80
- );
81
- setHover({
82
- item,
83
- index,
84
- top: y + height + CARD_GAP,
85
- left,
86
- });
87
- });
52
+ const anchor = rectOf(cellRefs.current.get(index) ?? null);
53
+ if (!anchor) return;
54
+ setTarget({ item, index, anchor });
55
+ show();
88
56
  },
89
- [cancelClose],
57
+ [show],
90
58
  );
91
59
 
60
+ const dismiss = useCallback(() => {
61
+ hold();
62
+ setOpen(false);
63
+ }, [hold]);
64
+
92
65
  const hoverHandlers = useMemo<AvatarGroupCellHoverHandlers | undefined>(() => {
93
66
  if (!hoverCard) return undefined;
94
67
  return {
95
68
  onHoverIn: handleHoverIn,
96
- onHoverOut: scheduleClose,
69
+ onHoverOut: hide,
97
70
  registerCellRef,
98
71
  };
99
- }, [hoverCard, handleHoverIn, scheduleClose, registerCellRef]);
72
+ }, [hoverCard, handleHoverIn, hide, registerCellRef]);
100
73
 
101
74
  return (
102
75
  <>
103
76
  <AvatarGroupBase {...props} hoverHandlers={hoverHandlers} />
104
- {hoverCard && hover && (
105
- <Portal>
106
- {/* The hover card stacks by when it opened, like every other Bloom
107
- overlay (`src/overlay/stack.ts`). `box-none` keeps the area
108
- around it click-through. */}
109
- <OverlayRoot>
110
- {/*
111
- The hover-bridge keeps the card open while the cursor is over it.
112
- It is a `View` with the W3C pointer events (in React Native's own
113
- `ViewProps`, forwarded to the DOM by react-native-web — so no
114
- web-only type suppression) and NOT a `Pressable`, which is what it
115
- used to be.
116
-
117
- A `Pressable` bridge closes the card the moment the cursor reaches
118
- anything pressable INSIDE it — the identity area, or a FollowButton
119
- in the `action` slot. react-native-web's `Pressable` calls
120
- `useHover` with `contain: true`, which dispatches a BUBBLING
121
- `react-gui:hover:lock` event on itself; an ancestor `Pressable`
122
- that is currently hovered ends its own hover for any lock whose
123
- target is not itself. So a descendant `Pressable` fired this
124
- bridge's `onHoverOut` and the card dismissed ~120ms later, with
125
- nothing in the console. Measured in Chrome; jest cannot see it.
126
-
127
- `pointerenter`/`pointerleave` do not bubble and do not fire when
128
- the cursor moves between descendants, which is exactly the
129
- containment the bridge needs.
130
- */}
131
- <View
132
- onPointerEnter={cancelClose}
133
- onPointerLeave={scheduleClose}
134
- pointerEvents="auto"
135
- style={[
136
- webStyles.floating,
137
- { top: hover.top, left: hover.left, width: CARD_WIDTH },
138
- ]}
139
- >
140
- <UserHoverCard
141
- avatar={hover.item.uri ?? undefined}
142
- // `UserHoverCardProps.displayName` is contractually an
143
- // already-resolved string, and resolving it is precisely this
144
- // component's job. `''` is the honest terminal case: no field on
145
- // the item named the person at all, so there is nothing to show.
146
- displayName={getItemName(hover.item) ?? ''}
147
- username={hover.item.username}
148
- onPressProfile={
149
- onPressItem
150
- ? () => onPressItem(hover.item, hover.index)
151
- : undefined
152
- }
153
- action={renderItemAction?.(hover.item, hover.index)}
154
- style={webStyles.card}
155
- />
156
- </View>
157
- </OverlayRoot>
158
- </Portal>
159
- )}
77
+ {hoverCard && target ? (
78
+ <HoverCardPanel
79
+ open={open}
80
+ anchor={open ? target.anchor : null}
81
+ onDismiss={dismiss}
82
+ onPointerEnter={hold}
83
+ onPointerLeave={hide}
84
+ label={getItemName(target.item) ?? 'Profile'}>
85
+ <UserHoverCard
86
+ avatar={target.item.uri ?? undefined}
87
+ // `UserHoverCardProps.displayName` is contractually an
88
+ // already-resolved string, and resolving it is precisely this
89
+ // component's job. `''` is the honest terminal case: no field on the
90
+ // item named the person at all, so there is nothing to show.
91
+ displayName={getItemName(target.item) ?? ''}
92
+ username={target.item.username}
93
+ onPressProfile={
94
+ onPressItem ? () => onPressItem(target.item, target.index) : undefined
95
+ }
96
+ action={renderItemAction?.(target.item, target.index)}
97
+ />
98
+ </HoverCardPanel>
99
+ ) : null}
160
100
  </>
161
101
  );
162
102
  };
163
103
 
164
- const webStyles = StyleSheet.create({
165
- floating: {
166
- position: WEB_POSITION_FIXED,
167
- },
168
- card: {
169
- width: CARD_WIDTH,
170
- },
171
- });
172
-
173
104
  export const AvatarGroup = memo(AvatarGroupWebComponent);
174
105
  AvatarGroup.displayName = 'AvatarGroup';
@@ -188,23 +188,14 @@ export function CalendarViewInboxMenu({
188
188
  if (IS_WEB) adoptStyleSheet(CSS_ID, FEED_CSS);
189
189
  }, []);
190
190
 
191
- // Web: the panel chrome, inline so it wins over the popover's default
192
- // card. Native: the sheet is the chrome.
191
+ // Web: the popover's own panel IS this menu's chrome (266 wide, `rounded-2xl`,
192
+ // border, surface, `p-2.5`, `shadow-dropdown`); only the height bound is the
193
+ // menu's. Native: the sheet is the chrome.
193
194
  const panelStyle: WebCssStyle | undefined = Platform.select<WebCssStyle | undefined>({
194
195
  web: {
195
196
  width: PANEL_WIDTH,
196
197
  maxWidth: viewport.width - 32,
197
198
  maxHeight: viewport.height - 32,
198
- overflow: 'hidden',
199
- borderRadius: 16,
200
- borderWidth: 1,
201
- borderColor: palette.panelBorder,
202
- backgroundColor: palette.panel,
203
- boxShadow: palette.shadowDropdown,
204
- paddingTop: 10,
205
- paddingBottom: 10,
206
- paddingLeft: 10,
207
- paddingRight: 10,
208
199
  },
209
200
  default: undefined,
210
201
  });
@@ -67,8 +67,8 @@ import type { CalendarViewEvent, CalendarViewMonthGridProps } from './types';
67
67
  * state next to the near-black card), out-of-month days on tertiary at `sm`+.
68
68
  * The lattice is `separator-border-strong` (dark: `separator-border`).
69
69
  *
70
- * OVERFLOW (from the one Figma cell that shows it): more than 3 events shows the
71
- * LAST 4, bottom-anchored, under a "+N more" label.
70
+ * OVERFLOW: more than 3 events shows the LAST 4, bottom-anchored, under a
71
+ * "+N more" label.
72
72
  *
73
73
  * Pressing a chip opens `CalendarViewEventDetails` beside its DAY (web: right
74
74
  * of the card, 6px away, flipping left when it does not fit; native: the bottom
@@ -424,17 +424,13 @@ export function CalendarViewMonthGrid({
424
424
 
425
425
  const detailsStyle: WebCssStyle | undefined = Platform.select<WebCssStyle | undefined>({
426
426
  web: {
427
+ // The event-details surface is the popover panel with its own
428
+ // width, a 20px corner and a deeper shadow; border, surface and
429
+ // `p-2.5` are the popover's defaults.
427
430
  width: 302,
428
431
  overflow: 'visible',
429
432
  borderRadius: 20,
430
- borderWidth: 1,
431
- borderColor: palette.panelBorder,
432
- backgroundColor: palette.panel,
433
433
  boxShadow: palette.shadowDetails,
434
- paddingTop: 10,
435
- paddingBottom: 10,
436
- paddingLeft: 10,
437
- paddingRight: 10,
438
434
  },
439
435
  default: undefined,
440
436
  });
@@ -331,12 +331,7 @@ function HeaderOverflowMenu({
331
331
  </PopoverTrigger>
332
332
  <PopoverContent
333
333
  label="More actions"
334
- align="end"
335
- // A row list, not a prose card: it opts out of the popover's `w-72 p-4`
336
- // as any row-list popover does, and shadcn would build this
337
- // surface out of a `DropdownMenu` rather than a `Popover` at all. A
338
- // CLASS, because that is what the popover's own chrome is now.
339
- className="w-auto p-space-4">
334
+ align="end">
340
335
  {items.map((action) => (
341
336
  <Item
342
337
  key={action.accessibilityLabel}
@@ -18,10 +18,12 @@
18
18
  * `pointer-events: none` and the property inherits.
19
19
  * - Placement goes through `overlay/dropdown-placement`, which fits, flips and
20
20
  * clamps on the axis `side` names and aligns-then-clamps on the other one.
21
- * - The chrome — radius, border, background, inset, elevation — is a class
22
- * string (`PANEL_CLASS`), so a consumer can restyle a surface with utilities.
23
- * Only what is COMPUTED stays inline: the resolved position, the caller's
24
- * numeric `minWidth`/`maxWidth`, the transform origin and the motion.
21
+ * - The menu surfaces' geometry — radius, border width, inset — is a class
22
+ * string (`MENU_PANEL_CLASS`, `LISTBOX_PANEL_CLASS`) and their colours are
23
+ * inline from `menu-palette.ts`. The `popover` surface carries NO chrome of
24
+ * its own here: `popover/surface.ts` resolves the whole panel inline and
25
+ * hands it over as `style`, so a caller's `className` can still override
26
+ * any one piece of it (see that module).
25
27
  *
26
28
  * `alignOffset` is applied by SHIFTING THE ANCHOR before resolving, not by
27
29
  * nudging the result: the resolver's own clamp then still owns the align axis,
@@ -32,12 +34,9 @@
32
34
  *
33
35
  * ── MOTION ───────────────────────────────────────────────────────────────────
34
36
  *
35
- * Fade + `zoom-95` + an 8px slide from the side it landed on, 200ms on
36
- * `--ease-out-quint`, scaling from the corner nearest the trigger — the target's
37
- * own enter, and the same shape reversed on the way out. That is the `popover`
38
- * surface; the `menu` and `listbox` surfaces run a separate menu motion instead
39
- * (150ms `ease-out`, fade + `scale-95` + 2px blur, no slide) and wear matching
40
- * chrome, coloured inline from `menu-palette.ts`.
37
+ * The one popover motion, on every surface: 150ms `ease-out`, fade +
38
+ * `scale-95` + 2px blur, no slide, scaling from the corner nearest the trigger
39
+ * — and the same shape reversed on the way out.
41
40
  *
42
41
  * Driven IMPERATIVELY from one shared value, which is the only mechanism
43
42
  * available here and is what both platform rules point at:
@@ -86,11 +85,6 @@ import {
86
85
  MENU_MOTION_EASING,
87
86
  MENU_MOTION_SCALE_FROM,
88
87
  MENU_PANEL_CLASS,
89
- PANEL_CLASS,
90
- PANEL_MOTION_DURATION,
91
- PANEL_MOTION_EASING,
92
- PANEL_MOTION_SCALE_FROM,
93
- PANEL_MOTION_SLIDE,
94
88
  VIEWPORT_GUTTER,
95
89
  } from './constants';
96
90
  import { useMenuPalette } from './menu-palette';
@@ -105,25 +99,23 @@ import type { FloatingPanelProps, FloatingSide } from './types';
105
99
  */
106
100
  const AnimatedPanel = Animated.createAnimatedComponent(StyledView);
107
101
 
108
- /** `cubic-bezier(0.22, 1, 0.36, 1)`, the target's `--ease-out-quint`. */
109
- const EASING = Easing.bezier(...PANEL_MOTION_EASING);
110
-
111
102
  /** Tailwind v4 `ease-out`, the menu curve. */
112
103
  const MENU_EASING = Easing.bezier(...MENU_MOTION_EASING);
113
104
 
114
105
  /**
115
- * The per-surface chrome and motion. `popover` is the original Radix-derived
116
- * panel; `menu` and `listbox` use the menu recipe (`menu-styles.ts`), whose
117
- * colours come from `menu-palette.ts`.
106
+ * The per-surface chrome and motion. All three share the one popover motion;
107
+ * `menu` and `listbox` use the menu recipe (`menu-styles.ts`) with colours from
108
+ * `menu-palette.ts`, while `popover` leaves the whole panel to its caller's
109
+ * resolved `style` (`popover/surface.ts`).
118
110
  */
119
111
  const SURFACE = {
120
112
  popover: {
121
- className: PANEL_CLASS,
122
- duration: PANEL_MOTION_DURATION,
123
- easing: EASING,
124
- scaleFrom: PANEL_MOTION_SCALE_FROM,
125
- slide: PANEL_MOTION_SLIDE,
126
- blur: 0,
113
+ className: '',
114
+ duration: MENU_MOTION_DURATION,
115
+ easing: MENU_EASING,
116
+ scaleFrom: MENU_MOTION_SCALE_FROM,
117
+ slide: 0,
118
+ blur: MENU_MOTION_BLUR,
127
119
  },
128
120
  menu: {
129
121
  className: MENU_PANEL_CLASS,