@oxyhq/bloom 0.48.0 → 0.49.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 (88) hide show
  1. package/lib/commonjs/bottom-sheet/BottomSheetBase.js +3 -1
  2. package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
  3. package/lib/commonjs/dialog/Dialog.js +30 -4
  4. package/lib/commonjs/dialog/Dialog.js.map +1 -1
  5. package/lib/commonjs/dialog/Dialog.web.js +48 -14
  6. package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
  7. package/lib/commonjs/dialog/DialogBottomSheet.js +30 -5
  8. package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
  9. package/lib/commonjs/dialog/DialogHeader.js +12 -6
  10. package/lib/commonjs/dialog/DialogHeader.js.map +1 -1
  11. package/lib/commonjs/dialog/DialogMorph.js +458 -0
  12. package/lib/commonjs/dialog/DialogMorph.js.map +1 -0
  13. package/lib/commonjs/dialog/index.js +7 -0
  14. package/lib/commonjs/dialog/index.js.map +1 -1
  15. package/lib/commonjs/dialog/index.web.js +7 -0
  16. package/lib/commonjs/dialog/index.web.js.map +1 -1
  17. package/lib/commonjs/settings-list/SettingsList.js +1 -1
  18. package/lib/commonjs/surfaces/SurfaceHost.js +1 -0
  19. package/lib/commonjs/surfaces/SurfaceHost.js.map +1 -1
  20. package/lib/module/bottom-sheet/BottomSheetBase.js +3 -1
  21. package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
  22. package/lib/module/dialog/Dialog.js +30 -4
  23. package/lib/module/dialog/Dialog.js.map +1 -1
  24. package/lib/module/dialog/Dialog.web.js +48 -15
  25. package/lib/module/dialog/Dialog.web.js.map +1 -1
  26. package/lib/module/dialog/DialogBottomSheet.js +31 -6
  27. package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
  28. package/lib/module/dialog/DialogHeader.js +12 -6
  29. package/lib/module/dialog/DialogHeader.js.map +1 -1
  30. package/lib/module/dialog/DialogMorph.js +451 -0
  31. package/lib/module/dialog/DialogMorph.js.map +1 -0
  32. package/lib/module/dialog/index.js +1 -0
  33. package/lib/module/dialog/index.js.map +1 -1
  34. package/lib/module/dialog/index.web.js +1 -0
  35. package/lib/module/dialog/index.web.js.map +1 -1
  36. package/lib/module/settings-list/SettingsList.js +1 -1
  37. package/lib/module/surfaces/SurfaceHost.js +1 -0
  38. package/lib/module/surfaces/SurfaceHost.js.map +1 -1
  39. package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts +8 -1
  40. package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
  41. package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
  42. package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
  43. package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts +2 -2
  44. package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -1
  45. package/lib/typescript/commonjs/dialog/DialogHeader.d.ts.map +1 -1
  46. package/lib/typescript/commonjs/dialog/DialogMorph.d.ts +150 -0
  47. package/lib/typescript/commonjs/dialog/DialogMorph.d.ts.map +1 -0
  48. package/lib/typescript/commonjs/dialog/index.d.ts +2 -0
  49. package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/dialog/index.web.d.ts +2 -0
  51. package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/dialog/types.d.ts +30 -0
  53. package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/surfaces/SurfaceHost.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/surfaces/types.d.ts +9 -0
  56. package/lib/typescript/commonjs/surfaces/types.d.ts.map +1 -1
  57. package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts +8 -1
  58. package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
  59. package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
  60. package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
  61. package/lib/typescript/module/dialog/DialogBottomSheet.d.ts +2 -2
  62. package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -1
  63. package/lib/typescript/module/dialog/DialogHeader.d.ts.map +1 -1
  64. package/lib/typescript/module/dialog/DialogMorph.d.ts +150 -0
  65. package/lib/typescript/module/dialog/DialogMorph.d.ts.map +1 -0
  66. package/lib/typescript/module/dialog/index.d.ts +2 -0
  67. package/lib/typescript/module/dialog/index.d.ts.map +1 -1
  68. package/lib/typescript/module/dialog/index.web.d.ts +2 -0
  69. package/lib/typescript/module/dialog/index.web.d.ts.map +1 -1
  70. package/lib/typescript/module/dialog/types.d.ts +30 -0
  71. package/lib/typescript/module/dialog/types.d.ts.map +1 -1
  72. package/lib/typescript/module/surfaces/SurfaceHost.d.ts.map +1 -1
  73. package/lib/typescript/module/surfaces/types.d.ts +9 -0
  74. package/lib/typescript/module/surfaces/types.d.ts.map +1 -1
  75. package/package.json +1 -1
  76. package/src/__tests__/DialogMorph.test.tsx +230 -0
  77. package/src/bottom-sheet/BottomSheetBase.tsx +13 -1
  78. package/src/dialog/Dialog.tsx +38 -11
  79. package/src/dialog/Dialog.web.tsx +40 -10
  80. package/src/dialog/DialogBottomSheet.tsx +35 -5
  81. package/src/dialog/DialogHeader.tsx +14 -5
  82. package/src/dialog/DialogMorph.tsx +576 -0
  83. package/src/dialog/index.ts +2 -0
  84. package/src/dialog/index.web.ts +2 -0
  85. package/src/dialog/types.ts +30 -0
  86. package/src/settings-list/SettingsList.tsx +1 -1
  87. package/src/surfaces/SurfaceHost.tsx +1 -0
  88. package/src/surfaces/types.ts +9 -0
@@ -20,6 +20,15 @@ export type { DialogPlacement, ResponsiveDialogPlacement } from './placement';
20
20
  export interface DialogHeaderConfig {
21
21
  /** Collapsing title — rendered large in-content and small in the nav bar. */
22
22
  title?: string;
23
+ /**
24
+ * A branded node rendered centered in the nav bar INSTEAD of the collapsing
25
+ * text title — e.g. a product wordmark. Always visible (it never collapses),
26
+ * and it suppresses the large in-content title/subtitle entirely, so the
27
+ * surface starts flush under the bar. `title`/`subtitle` are ignored while
28
+ * this is set. Must be referentially stable (memoize it) so the header does
29
+ * not thrash.
30
+ */
31
+ titleContent?: ReactNode;
23
32
  /** Supporting copy under the large title (and, optionally, in the bar). */
24
33
  subtitle?: string;
25
34
  /**
@@ -224,6 +233,27 @@ export type DialogProps = React.PropsWithChildren<{
224
233
  contentPadding?: number;
225
234
  /** Whether tapping the backdrop dismisses the dialog. Defaults to `true`. */
226
235
  dismissOnBackdrop?: boolean;
236
+ /**
237
+ * Whether the panel MORPHS across an in-place content swap. Defaults to
238
+ * `true`.
239
+ *
240
+ * When the content inside an OPEN dialog is replaced (a nav-within drill-in,
241
+ * as opposed to presenting a new surface on top), the panel animates from the
242
+ * outgoing content's size to the incoming one's while the incoming content
243
+ * fades in, instead of hard-cutting. The swap is signalled by the content
244
+ * itself through `useDialogFrame` — a dialog whose content never declares a
245
+ * frame is unaffected either way.
246
+ *
247
+ * The centered card morphs its height (about its centre) and its `maxWidth`;
248
+ * the bottom sheet morphs its height from its anchored edge; side sheets have
249
+ * fixed geometry and never morph. Morphing also requires the Dialog to own the
250
+ * scroll container: a `scrollable={false}` surface owns its own size, so its
251
+ * content only cross-fades.
252
+ *
253
+ * Set `false` for content that must never be resized into — e.g. a full-bleed
254
+ * picker that always fills the surface.
255
+ */
256
+ morph?: boolean;
227
257
  /**
228
258
  * Style overrides applied to the inner content container on native (the
229
259
  * floating bottom-sheet card) and to the modal panel on web.
@@ -207,7 +207,7 @@ const styles = StyleSheet.create({
207
207
  itemContainer: {
208
208
  flexDirection: 'row',
209
209
  alignItems: 'center',
210
- paddingHorizontal: 16,
210
+ paddingHorizontal: 12,
211
211
  paddingVertical: 10,
212
212
  minHeight: 44,
213
213
  gap: 12,
@@ -40,6 +40,7 @@ function placementFor(p: SurfacePresentation): Partial<DialogProps> {
40
40
  contentPadding: p.contentPadding,
41
41
  header: p.header,
42
42
  scrollable: p.scrollable,
43
+ morph: p.morph,
43
44
  style: p.style,
44
45
  panelStyle: p.panelStyle,
45
46
  panelClassName: p.panelClassName,
@@ -55,6 +55,15 @@ export interface SurfacePresentation {
55
55
  * to `Dialog`.
56
56
  */
57
57
  scrollable?: boolean;
58
+ /**
59
+ * Whether the surface MORPHS its panel when its content is swapped in place —
60
+ * navigation WITHIN this surface, as opposed to presenting a new surface on
61
+ * top. Defaults to `true`. The content signals the swap through
62
+ * `useDialogFrame`; a surface whose content never declares a frame is
63
+ * unaffected. Set `false` for content that must never be resized into (a
64
+ * full-bleed picker). Forwarded to `Dialog`.
65
+ */
66
+ morph?: boolean;
58
67
  /** Style overrides applied to the inner content container. */
59
68
  style?: StyleProp<ViewStyle>;
60
69
  /** Style overrides for the side/bottom placement panel surface. */