@oxyhq/bloom 0.13.0 → 0.15.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 (140) hide show
  1. package/lib/commonjs/dialog/CenteredDialog.js +2 -0
  2. package/lib/commonjs/dialog/CenteredDialog.js.map +1 -1
  3. package/lib/commonjs/dialog/CenteredDialog.web.js +2 -0
  4. package/lib/commonjs/dialog/CenteredDialog.web.js.map +1 -1
  5. package/lib/commonjs/dialog/Dialog.js +337 -43
  6. package/lib/commonjs/dialog/Dialog.js.map +1 -1
  7. package/lib/commonjs/dialog/Dialog.web.js +414 -63
  8. package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
  9. package/lib/commonjs/dialog/index.js +6 -0
  10. package/lib/commonjs/dialog/index.js.map +1 -1
  11. package/lib/commonjs/dialog/index.web.js +6 -0
  12. package/lib/commonjs/dialog/index.web.js.map +1 -1
  13. package/lib/commonjs/dialog/placement.js +104 -0
  14. package/lib/commonjs/dialog/placement.js.map +1 -0
  15. package/lib/commonjs/index.js +22 -0
  16. package/lib/commonjs/index.js.map +1 -1
  17. package/lib/commonjs/index.web.js +28 -6
  18. package/lib/commonjs/index.web.js.map +1 -1
  19. package/lib/commonjs/responsive-sheet/ResponsiveSheet.js +97 -0
  20. package/lib/commonjs/responsive-sheet/ResponsiveSheet.js.map +1 -0
  21. package/lib/commonjs/responsive-sheet/ResponsiveSheet.web.js +84 -0
  22. package/lib/commonjs/responsive-sheet/ResponsiveSheet.web.js.map +1 -0
  23. package/lib/commonjs/responsive-sheet/index.js +19 -0
  24. package/lib/commonjs/responsive-sheet/index.js.map +1 -0
  25. package/lib/commonjs/responsive-sheet/index.web.js +19 -0
  26. package/lib/commonjs/responsive-sheet/index.web.js.map +1 -0
  27. package/lib/commonjs/responsive-sheet/types.js +6 -0
  28. package/lib/commonjs/responsive-sheet/types.js.map +1 -0
  29. package/lib/module/dialog/CenteredDialog.js +2 -0
  30. package/lib/module/dialog/CenteredDialog.js.map +1 -1
  31. package/lib/module/dialog/CenteredDialog.web.js +2 -0
  32. package/lib/module/dialog/CenteredDialog.web.js.map +1 -1
  33. package/lib/module/dialog/Dialog.js +336 -46
  34. package/lib/module/dialog/Dialog.js.map +1 -1
  35. package/lib/module/dialog/Dialog.web.js +412 -65
  36. package/lib/module/dialog/Dialog.web.js.map +1 -1
  37. package/lib/module/dialog/index.js +1 -1
  38. package/lib/module/dialog/index.js.map +1 -1
  39. package/lib/module/dialog/index.web.js +1 -1
  40. package/lib/module/dialog/index.web.js.map +1 -1
  41. package/lib/module/dialog/placement.js +100 -0
  42. package/lib/module/dialog/placement.js.map +1 -0
  43. package/lib/module/index.js +3 -1
  44. package/lib/module/index.js.map +1 -1
  45. package/lib/module/index.web.js +3 -1
  46. package/lib/module/index.web.js.map +1 -1
  47. package/lib/module/responsive-sheet/ResponsiveSheet.js +90 -0
  48. package/lib/module/responsive-sheet/ResponsiveSheet.js.map +1 -0
  49. package/lib/module/responsive-sheet/ResponsiveSheet.web.js +77 -0
  50. package/lib/module/responsive-sheet/ResponsiveSheet.web.js.map +1 -0
  51. package/lib/module/responsive-sheet/index.js +4 -0
  52. package/lib/module/responsive-sheet/index.js.map +1 -0
  53. package/lib/module/responsive-sheet/index.web.js +12 -0
  54. package/lib/module/responsive-sheet/index.web.js.map +1 -0
  55. package/lib/module/responsive-sheet/types.js +4 -0
  56. package/lib/module/responsive-sheet/types.js.map +1 -0
  57. package/lib/typescript/commonjs/dialog/CenteredDialog.d.ts +2 -0
  58. package/lib/typescript/commonjs/dialog/CenteredDialog.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/dialog/CenteredDialog.web.d.ts +2 -0
  60. package/lib/typescript/commonjs/dialog/CenteredDialog.web.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/dialog/Dialog.d.ts +18 -15
  62. package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/dialog/Dialog.web.d.ts +18 -5
  64. package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/dialog/centered-dialog-types.d.ts +4 -0
  66. package/lib/typescript/commonjs/dialog/centered-dialog-types.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/dialog/index.d.ts +2 -2
  68. package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/dialog/index.web.d.ts +2 -2
  70. package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/dialog/placement.d.ts +71 -0
  72. package/lib/typescript/commonjs/dialog/placement.d.ts.map +1 -0
  73. package/lib/typescript/commonjs/dialog/types.d.ts +66 -3
  74. package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/index.d.ts +4 -2
  76. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/index.web.d.ts +4 -2
  78. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.d.ts +22 -0
  80. package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.d.ts.map +1 -0
  81. package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.web.d.ts +16 -0
  82. package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.web.d.ts.map +1 -0
  83. package/lib/typescript/commonjs/responsive-sheet/index.d.ts +3 -0
  84. package/lib/typescript/commonjs/responsive-sheet/index.d.ts.map +1 -0
  85. package/lib/typescript/commonjs/responsive-sheet/index.web.d.ts +3 -0
  86. package/lib/typescript/commonjs/responsive-sheet/index.web.d.ts.map +1 -0
  87. package/lib/typescript/commonjs/responsive-sheet/types.d.ts +58 -0
  88. package/lib/typescript/commonjs/responsive-sheet/types.d.ts.map +1 -0
  89. package/lib/typescript/module/dialog/CenteredDialog.d.ts +2 -0
  90. package/lib/typescript/module/dialog/CenteredDialog.d.ts.map +1 -1
  91. package/lib/typescript/module/dialog/CenteredDialog.web.d.ts +2 -0
  92. package/lib/typescript/module/dialog/CenteredDialog.web.d.ts.map +1 -1
  93. package/lib/typescript/module/dialog/Dialog.d.ts +18 -15
  94. package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
  95. package/lib/typescript/module/dialog/Dialog.web.d.ts +18 -5
  96. package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
  97. package/lib/typescript/module/dialog/centered-dialog-types.d.ts +4 -0
  98. package/lib/typescript/module/dialog/centered-dialog-types.d.ts.map +1 -1
  99. package/lib/typescript/module/dialog/index.d.ts +2 -2
  100. package/lib/typescript/module/dialog/index.d.ts.map +1 -1
  101. package/lib/typescript/module/dialog/index.web.d.ts +2 -2
  102. package/lib/typescript/module/dialog/index.web.d.ts.map +1 -1
  103. package/lib/typescript/module/dialog/placement.d.ts +71 -0
  104. package/lib/typescript/module/dialog/placement.d.ts.map +1 -0
  105. package/lib/typescript/module/dialog/types.d.ts +66 -3
  106. package/lib/typescript/module/dialog/types.d.ts.map +1 -1
  107. package/lib/typescript/module/index.d.ts +4 -2
  108. package/lib/typescript/module/index.d.ts.map +1 -1
  109. package/lib/typescript/module/index.web.d.ts +4 -2
  110. package/lib/typescript/module/index.web.d.ts.map +1 -1
  111. package/lib/typescript/module/responsive-sheet/ResponsiveSheet.d.ts +22 -0
  112. package/lib/typescript/module/responsive-sheet/ResponsiveSheet.d.ts.map +1 -0
  113. package/lib/typescript/module/responsive-sheet/ResponsiveSheet.web.d.ts +16 -0
  114. package/lib/typescript/module/responsive-sheet/ResponsiveSheet.web.d.ts.map +1 -0
  115. package/lib/typescript/module/responsive-sheet/index.d.ts +3 -0
  116. package/lib/typescript/module/responsive-sheet/index.d.ts.map +1 -0
  117. package/lib/typescript/module/responsive-sheet/index.web.d.ts +3 -0
  118. package/lib/typescript/module/responsive-sheet/index.web.d.ts.map +1 -0
  119. package/lib/typescript/module/responsive-sheet/types.d.ts +58 -0
  120. package/lib/typescript/module/responsive-sheet/types.d.ts.map +1 -0
  121. package/package.json +18 -1
  122. package/src/__tests__/DialogPlacement.test.tsx +144 -0
  123. package/src/__tests__/ResponsiveSheet.test.tsx +88 -0
  124. package/src/dialog/CenteredDialog.tsx +2 -0
  125. package/src/dialog/CenteredDialog.web.tsx +2 -0
  126. package/src/dialog/Dialog.tsx +407 -50
  127. package/src/dialog/Dialog.web.tsx +490 -75
  128. package/src/dialog/centered-dialog-types.ts +4 -0
  129. package/src/dialog/index.ts +4 -1
  130. package/src/dialog/index.web.ts +4 -1
  131. package/src/dialog/placement.ts +113 -0
  132. package/src/dialog/types.ts +69 -3
  133. package/src/index.ts +12 -0
  134. package/src/index.web.ts +12 -0
  135. package/src/responsive-sheet/ResponsiveSheet.stories.tsx +54 -0
  136. package/src/responsive-sheet/ResponsiveSheet.tsx +88 -0
  137. package/src/responsive-sheet/ResponsiveSheet.web.tsx +76 -0
  138. package/src/responsive-sheet/index.ts +6 -0
  139. package/src/responsive-sheet/index.web.ts +14 -0
  140. package/src/responsive-sheet/types.ts +60 -0
@@ -1,9 +1,9 @@
1
- export { Dialog, BLOOM_DIALOG_CSS } from './Dialog.web';
1
+ export { Dialog, BLOOM_DIALOG_CSS, DIALOG_SHEET_BACKDROP_TESTID } from './Dialog.web';
2
2
  export { CenteredDialog, BLOOM_CENTERED_DIALOG_CSS, CENTERED_DIALOG_BACKDROP_TESTID, } from './CenteredDialog.web';
3
3
  export { BloomDialogProvider } from './BloomDialogProvider.web';
4
4
  export { alert } from './alert';
5
5
  export { useDialogContext, useDialogControl } from './context';
6
6
  export type { AlertButton, AlertButtonStyle, } from './alert-store';
7
- export type { DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogProps, } from './types';
7
+ export type { DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogInset, DialogPlacement, DialogProps, ResponsiveDialogPlacement, } from './types';
8
8
  export type { CenteredDialogProps } from './centered-dialog-types';
9
9
  //# sourceMappingURL=index.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/dialog/index.web.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC/D,YAAY,EACV,WAAW,EACX,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/dialog/index.web.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC/D,YAAY,EACV,WAAW,EACX,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,WAAW,EACX,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Anchor a `<Dialog>` can render against.
3
+ *
4
+ * - `'center'` — the default centered modal card (current behavior).
5
+ * - `'left'` / `'right'` — an anchored side-sheet / drawer.
6
+ * - `'bottom'` — a bottom-sheet (drag handle, slide-up).
7
+ */
8
+ export type DialogPlacement = 'center' | 'left' | 'right' | 'bottom';
9
+ /**
10
+ * A `<Dialog>` placement that may vary by viewport width.
11
+ *
12
+ * Either a single `DialogPlacement` (applied at every width) or a responsive
13
+ * map whose `base` applies below the first breakpoint and whose `sm`/`md`/`lg`/
14
+ * `xl` keys override it at and above the matching Tailwind breakpoint.
15
+ *
16
+ * The common store-drawer case is `{ base: 'bottom', md: 'left' }`; the common
17
+ * dialog-to-sheet case is `{ base: 'bottom', md: 'center' }`.
18
+ */
19
+ export type ResponsiveDialogPlacement = DialogPlacement | {
20
+ base: DialogPlacement;
21
+ sm?: DialogPlacement;
22
+ md?: DialogPlacement;
23
+ lg?: DialogPlacement;
24
+ xl?: DialogPlacement;
25
+ };
26
+ /**
27
+ * Tailwind-default breakpoints (px). A responsive `placement` map resolves to
28
+ * the value for the largest key whose min-width is `<=` the current viewport
29
+ * width, falling back to `base`.
30
+ */
31
+ export declare const BREAKPOINT_SM = 640;
32
+ export declare const BREAKPOINT_MD = 768;
33
+ export declare const BREAKPOINT_LG = 1024;
34
+ export declare const BREAKPOINT_XL = 1280;
35
+ /** Default side-sheet width (px) on wide screens. */
36
+ export declare const DEFAULT_SIDE_WIDTH = 460;
37
+ /** Default centered-card max width (px). Matches the legacy `maxWidth: 480`. */
38
+ export declare const DEFAULT_CENTER_MAX_WIDTH = 480;
39
+ /** Default bottom-sheet max height as a fraction of the viewport height. */
40
+ export declare const DEFAULT_MAX_HEIGHT_RATIO = 0.9;
41
+ /** Corner radius shared by the side-sheet panel and the bottom-sheet top. */
42
+ export declare const PANEL_RADIUS = 20;
43
+ /** Open/close transition duration (ms). ~280ms ease-out reads smooth. */
44
+ export declare const ANIMATION_DURATION = 280;
45
+ /** Centered-card fade-out duration (ms) — preserves the legacy timing. */
46
+ export declare const CENTER_FADE_OUT_DURATION = 150;
47
+ /** CSS approximation of reanimated's `Easing.out(Easing.cubic)`. */
48
+ export declare const EASE_OUT = "cubic-bezier(0.33, 1, 0.68, 1)";
49
+ /** Backdrop dim opacity once fully shown (matches `bg-black/40`). */
50
+ export declare const SHEET_BACKDROP_OPACITY = 0.4;
51
+ /** Stable testID for the dimmed backdrop of a side/bottom placement dialog. */
52
+ export declare const DIALOG_SHEET_BACKDROP_TESTID = "bloom-dialog-sheet-backdrop";
53
+ /** Drag-handle pill geometry for the bottom-sheet. */
54
+ export declare const HANDLE_WIDTH = 36;
55
+ export declare const HANDLE_HEIGHT = 5;
56
+ export declare const HANDLE_RADIUS = 3;
57
+ /**
58
+ * Minimum gutter kept between a wide side-sheet and the opposite viewport edge
59
+ * when capping its width, so the panel never spans the full screen.
60
+ */
61
+ export declare const SIDE_SHEET_MIN_GUTTER = 24;
62
+ /**
63
+ * Resolve a (possibly responsive) `placement` to a concrete `DialogPlacement`
64
+ * for the current viewport width.
65
+ *
66
+ * A plain string placement resolves to itself. A responsive map picks the
67
+ * value for the largest breakpoint key whose min-width is `<=` the viewport
68
+ * width, falling back to `base` below the first breakpoint.
69
+ */
70
+ export declare function useResolvedPlacement(placement: ResponsiveDialogPlacement | undefined): DialogPlacement;
71
+ //# sourceMappingURL=placement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placement.d.ts","sourceRoot":"","sources":["../../../../src/dialog/placement.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErE;;;;;;;;;GASG;AACH,MAAM,MAAM,yBAAyB,GACjC,eAAe,GACf;IACE,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,EAAE,CAAC,EAAE,eAAe,CAAC;CACtB,CAAC;AAEN;;;;GAIG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,eAAO,MAAM,aAAa,OAAO,CAAC;AAUlC,qDAAqD;AACrD,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,6EAA6E;AAC7E,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,oEAAoE;AACpE,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AAEzD,qEAAqE;AACrE,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,gCAAgC,CAAC;AAE1E,sDAAsD;AACtD,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B;;;GAGG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,yBAAyB,GAAG,SAAS,GAC/C,eAAe,CAcjB"}
@@ -1,4 +1,17 @@
1
1
  import type { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native';
2
+ import type { ResponsiveDialogPlacement } from './placement';
3
+ export type { DialogPlacement, ResponsiveDialogPlacement } from './placement';
4
+ /**
5
+ * Side-sheet inset (px) from the root overlay's edges. Lets a host place a
6
+ * `left`/`right` placement "inside its own shell" — e.g. offset from the top
7
+ * by a header, or from the anchored edge by a nav rail.
8
+ */
9
+ export type DialogInset = {
10
+ top?: number;
11
+ bottom?: number;
12
+ left?: number;
13
+ right?: number;
14
+ };
2
15
  /**
3
16
  * Imperative open/close handle returned by `useDialogControl`.
4
17
  *
@@ -45,7 +58,14 @@ export type DialogAction = {
45
58
  /**
46
59
  * Props accepted by the unified `<Dialog>` component.
47
60
  *
48
- * Three usage modes pick whichever fits the call site:
61
+ * Open/close is driven by EITHER of two mutually-exclusive modes:
62
+ *
63
+ * - **Imperative `control`** (`useDialogControl()` + `control.open()` /
64
+ * `control.close()`). The legacy default; unchanged.
65
+ * - **Controlled `open`** (an `open` boolean + `onClose`). When `open` is
66
+ * provided it wins and `control` is ignored.
67
+ *
68
+ * Rendering modes (orthogonal to open/close mode) — pick whichever fits:
49
69
  *
50
70
  * 1. **Declarative (`title` / `description` / `actions`).** Most common
51
71
  * confirm/cancel surface. Bloom renders the title, description and
@@ -57,10 +77,26 @@ export type DialogAction = {
57
77
  *
58
78
  * 3. **Imperative `alert()`.** Bypass the JSX layer entirely — see the
59
79
  * module-level `alert()` helper.
80
+ *
81
+ * `placement` controls the surface anchor — centered modal (default), an
82
+ * anchored side-sheet (`left`/`right`), or a bottom-sheet (`bottom`) — and may
83
+ * be a responsive map that collapses to a bottom-sheet on narrow viewports.
60
84
  */
61
85
  export type DialogProps = React.PropsWithChildren<{
62
- control: DialogControlProps;
63
- /** Fires after the dialog has finished closing. */
86
+ /**
87
+ * Imperative open/close handle from `useDialogControl()`. Optional omit it
88
+ * when driving the dialog with the controlled `open` prop instead.
89
+ */
90
+ control?: DialogControlProps;
91
+ /**
92
+ * Controlled open state (opt-in). When provided, the dialog is driven by
93
+ * this boolean and `onClose`, and `control` is ignored.
94
+ */
95
+ open?: boolean;
96
+ /**
97
+ * Fires after the dialog has finished closing. In controlled mode it is the
98
+ * close request the host must answer by flipping `open` to `false`.
99
+ */
64
100
  onClose?: () => void;
65
101
  testID?: string;
66
102
  /** Optional dialog header text. Rendered above `description` / `children`. */
@@ -72,11 +108,38 @@ export type DialogProps = React.PropsWithChildren<{
72
108
  * confirm/cancel/destructive buttons for you. Order is preserved.
73
109
  */
74
110
  actions?: DialogAction[];
111
+ /**
112
+ * Surface anchor. Defaults to `'center'` (the centered modal — current
113
+ * behavior). `'left'`/`'right'` render an anchored side-sheet, `'bottom'` a
114
+ * bottom-sheet. A responsive map resolves by viewport width, e.g.
115
+ * `{ base: 'bottom', md: 'left' }` (drawer on wide, sheet on narrow).
116
+ */
117
+ placement?: ResponsiveDialogPlacement;
118
+ /** Side-sheet width (px) on wide screens. Defaults to `460`. */
119
+ width?: number;
120
+ /** Centered-card max width (px). Defaults to `480`. */
121
+ maxWidth?: number;
122
+ /** Bottom-sheet max height as a fraction of the viewport height. Defaults to `0.9`. */
123
+ maxHeightRatio?: number;
124
+ /** Side-sheet inset (px) from the root overlay's edges. */
125
+ inset?: DialogInset;
126
+ /** Whether to render the drag handle in bottom-sheet mode. Defaults to `true`. */
127
+ showHandle?: boolean;
128
+ /** Whether tapping the backdrop dismisses the dialog. Defaults to `true`. */
129
+ dismissOnBackdrop?: boolean;
75
130
  /**
76
131
  * Style overrides applied to the inner content container on native (the
77
132
  * floating bottom-sheet card) and to the modal panel on web.
78
133
  */
79
134
  style?: StyleProp<ViewStyle>;
135
+ /** Style overrides for the side/bottom placement panel surface. */
136
+ panelStyle?: StyleProp<ViewStyle>;
137
+ /** NativeWind classes for the side/bottom placement panel surface. */
138
+ panelClassName?: string;
139
+ /** Style for the root overlay (theme-var scope, rail offset, etc.). */
140
+ containerStyle?: StyleProp<ViewStyle>;
141
+ /** NativeWind classes for the root overlay (e.g. `"md:left-[4.75rem]"`). */
142
+ containerClassName?: string;
80
143
  /** Accessibility label, applied to the dialog role on web. */
81
144
  label?: string;
82
145
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../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AC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,mEAAmE;IACnE,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,4EAA4E;IAC5E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}
@@ -9,8 +9,8 @@ export { useThrottledValue } from './hooks/useThrottledValue';
9
9
  export * as Icons from './icons';
10
10
  export { type Props as IconProps, sizes as iconSizes, useCommonSVGProps } from './icons/common';
11
11
  export * from './portal';
12
- export { Dialog, CenteredDialog, CENTERED_DIALOG_BACKDROP_TESTID, BloomDialogProvider, alert, useDialogContext, useDialogControl, } from './dialog';
13
- export type { AlertButton, AlertButtonStyle, CenteredDialogProps, DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogProps, } from './dialog';
12
+ export { Dialog, DIALOG_SHEET_BACKDROP_TESTID, CenteredDialog, CENTERED_DIALOG_BACKDROP_TESTID, BloomDialogProvider, alert, useDialogContext, useDialogControl, } from './dialog';
13
+ export type { AlertButton, AlertButtonStyle, CenteredDialogProps, DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogInset, DialogPlacement, DialogProps, ResponsiveDialogPlacement, } from './dialog';
14
14
  export * from './button';
15
15
  export { Fab } from './fab';
16
16
  export type { FabProps, FabVariant, FabSize, FabPlacement } from './fab';
@@ -49,6 +49,8 @@ export { Combobox } from './combobox';
49
49
  export type { ComboboxProps, ComboboxOption } from './combobox';
50
50
  export { BottomSheet } from './bottom-sheet';
51
51
  export type { BottomSheetRef, BottomSheetProps } from './bottom-sheet';
52
+ export { ResponsiveSheet, RESPONSIVE_SHEET_BACKDROP_TESTID } from './responsive-sheet';
53
+ export type { ResponsiveSheetProps, ResponsiveSheetSide, ResponsiveSheetInset, } from './responsive-sheet';
52
54
  export * from './card';
53
55
  export * from './badge';
54
56
  export * from './chip';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,KAAK,KAAK,IAAI,SAAS,EAAE,KAAK,IAAI,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGhG,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,MAAM,EACN,cAAc,EACd,+BAA+B,EAC/B,mBAAmB,EACnB,KAAK,EACL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW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C;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACvE,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG3D,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAG/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
@@ -9,8 +9,8 @@ export { useThrottledValue } from './hooks/useThrottledValue';
9
9
  export * as Icons from './icons';
10
10
  export { type Props as IconProps, sizes as iconSizes, useCommonSVGProps } from './icons/common';
11
11
  export * from './portal/index.web';
12
- export { Dialog, CenteredDialog, CENTERED_DIALOG_BACKDROP_TESTID, BloomDialogProvider, alert, useDialogContext, useDialogControl, } from './dialog/index.web';
13
- export type { AlertButton, AlertButtonStyle, CenteredDialogProps, DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogProps, } from './dialog/index.web';
12
+ export { Dialog, DIALOG_SHEET_BACKDROP_TESTID, CenteredDialog, CENTERED_DIALOG_BACKDROP_TESTID, BloomDialogProvider, alert, useDialogContext, useDialogControl, } from './dialog/index.web';
13
+ export type { AlertButton, AlertButtonStyle, CenteredDialogProps, DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogInset, DialogPlacement, DialogProps, ResponsiveDialogPlacement, } from './dialog/index.web';
14
14
  export * from './button/index.web';
15
15
  export { Fab } from './fab/index.web';
16
16
  export type { FabProps, FabVariant, FabSize, FabPlacement } from './fab/index.web';
@@ -49,6 +49,8 @@ export { Combobox } from './combobox/index.web';
49
49
  export type { ComboboxProps, ComboboxOption } from './combobox/index.web';
50
50
  export { BottomSheet } from './bottom-sheet';
51
51
  export type { BottomSheetRef, BottomSheetProps } from './bottom-sheet';
52
+ export { ResponsiveSheet, RESPONSIVE_SHEET_BACKDROP_TESTID } from './responsive-sheet/index.web';
53
+ export type { ResponsiveSheetProps, ResponsiveSheetSide, ResponsiveSheetInset, } from './responsive-sheet/index.web';
52
54
  export * from './card';
53
55
  export * from './badge';
54
56
  export * from './chip';
@@ -1 +1 @@
1
- {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAMA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,KAAK,KAAK,IAAI,SAAS,EAAE,KA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3
+ * @deprecated Use `<Dialog placement={{ base: 'bottom', md: 'left' }}>` instead.
4
+ *
5
+ * `ResponsiveSheet` is now a thin wrapper that configures the canonical
6
+ * `<Dialog>` — an anchored side-sheet on wide screens collapsing to a
7
+ * bottom-sheet below the breakpoint. It holds ZERO motion/layout logic of its
8
+ * own; it maps its props onto a responsive `Dialog` `placement`. The
9
+ * `@oxyhq/bloom/responsive-sheet` subpath is retained for the migration window.
10
+ *
11
+ * This file is BOTH the package default entry (resolved by downstream `tsc`
12
+ * and non-Metro web bundlers via the `browser` condition through `index.web`)
13
+ * AND a clean delegation, so it carries no platform-specific imports.
14
+ */
15
+ export declare function ResponsiveSheet({ open, onClose, side, breakpoint, width, maxHeightRatio, inset, showHandle, dismissOnBackdrop, panelStyle, panelClassName, containerStyle, containerClassName, label, children, }: ResponsiveSheetProps): import("react/jsx-runtime").JSX.Element;
16
+ /**
17
+ * @deprecated Stable testID for the dimmed backdrop dismiss button — now
18
+ * provided by the underlying `<Dialog>`'s side/bottom backdrop.
19
+ */
20
+ export declare const RESPONSIVE_SHEET_BACKDROP_TESTID = "bloom-dialog-sheet-backdrop";
21
+ export default ResponsiveSheet;
22
+ //# sourceMappingURL=ResponsiveSheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponsiveSheet.d.ts","sourceRoot":"","sources":["../../../../src/responsive-sheet/ResponsiveSheet.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,OAAO,EACP,IAAa,EACb,UAA0B,EAC1B,KAAK,EACL,cAAc,EACd,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAoBtB;AAmBD;;;GAGG;AACH,eAAO,MAAM,gCAAgC,gCAA+B,CAAC;AAE7E,eAAe,eAAe,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { ResponsiveSheetProps } from './types';
2
+ /**
3
+ * @deprecated Use `<Dialog placement={{ base: 'bottom', md: 'left' }}>` instead.
4
+ *
5
+ * Web fork of the deprecated `ResponsiveSheet` wrapper. Identical delegation to
6
+ * the default fork, but imports the web `Dialog` explicitly so non-Metro web
7
+ * bundlers never follow the native (reanimated) `Dialog` sibling.
8
+ */
9
+ export declare function ResponsiveSheet({ open, onClose, side, breakpoint, width, maxHeightRatio, inset, showHandle, dismissOnBackdrop, panelStyle, panelClassName, containerStyle, containerClassName, label, children, }: ResponsiveSheetProps): import("react/jsx-runtime").JSX.Element;
10
+ /**
11
+ * @deprecated Stable testID for the dimmed backdrop dismiss button — now
12
+ * provided by the underlying `<Dialog>`'s side/bottom backdrop.
13
+ */
14
+ export declare const RESPONSIVE_SHEET_BACKDROP_TESTID = "bloom-dialog-sheet-backdrop";
15
+ export default ResponsiveSheet;
16
+ //# sourceMappingURL=ResponsiveSheet.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponsiveSheet.web.d.ts","sourceRoot":"","sources":["../../../../src/responsive-sheet/ResponsiveSheet.web.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,OAAO,EACP,IAAa,EACb,UAA0B,EAC1B,KAAK,EACL,cAAc,EACd,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAoBtB;AAaD;;;GAGG;AACH,eAAO,MAAM,gCAAgC,gCAA+B,CAAC;AAE7E,eAAe,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { ResponsiveSheet, RESPONSIVE_SHEET_BACKDROP_TESTID } from './ResponsiveSheet';
2
+ export type { ResponsiveSheetProps, ResponsiveSheetSide, ResponsiveSheetInset, } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/responsive-sheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AACtF,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { ResponsiveSheet, RESPONSIVE_SHEET_BACKDROP_TESTID } from './ResponsiveSheet.web';
2
+ export type { ResponsiveSheetProps, ResponsiveSheetSide, ResponsiveSheetInset, } from './types';
3
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/responsive-sheet/index.web.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AAC1F,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,58 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
3
+ /** Edge a wide-screen side-sheet anchors to. */
4
+ export type ResponsiveSheetSide = 'left' | 'right';
5
+ /**
6
+ * Inset (px) of the wide-screen side-sheet from its container edges. Lets a
7
+ * host place the sheet "inside its own shell" — e.g. offset from the top by a
8
+ * header, or from the left by a nav rail — with margins on every side.
9
+ */
10
+ export interface ResponsiveSheetInset {
11
+ top?: number;
12
+ bottom?: number;
13
+ left?: number;
14
+ right?: number;
15
+ }
16
+ /**
17
+ * @deprecated Use `<Dialog placement={{ base: 'bottom', md: 'left' }}>` from
18
+ * `@oxyhq/bloom/dialog` instead. `ResponsiveSheet` is now a thin wrapper over
19
+ * `<Dialog>` retained for the migration window.
20
+ *
21
+ * A responsive overlay sheet: an anchored side-sheet on wide screens and a
22
+ * bottom-sheet (with drag handle) on small screens, switching by viewport
23
+ * width. It is a plain controlled component — the host drives `open`/`onClose`
24
+ * from its own state.
25
+ */
26
+ export interface ResponsiveSheetProps {
27
+ /** Whether the sheet is open. Controlled by the host. */
28
+ open: boolean;
29
+ /** Fired when the sheet requests to close (backdrop tap, Escape on web). */
30
+ onClose: () => void;
31
+ /** Anchor edge on wide screens. Defaults to `'left'`. */
32
+ side?: ResponsiveSheetSide;
33
+ /** Viewport width (px) below which the sheet renders as a bottom-sheet. Defaults to `768`. */
34
+ breakpoint?: number;
35
+ /** Side-sheet width (px) on wide screens. Capped to fit. Defaults to `460`. */
36
+ width?: number;
37
+ /** Bottom-sheet max height as a fraction of the viewport height. Defaults to `0.9`. */
38
+ maxHeightRatio?: number;
39
+ /** Side-sheet inset (px) from the container edges. Defaults to `0` on all sides. */
40
+ inset?: ResponsiveSheetInset;
41
+ /** Whether to render the drag handle in bottom-sheet mode. Defaults to `true`. */
42
+ showHandle?: boolean;
43
+ /** Whether tapping the backdrop closes the sheet. Defaults to `true`. */
44
+ dismissOnBackdrop?: boolean;
45
+ /** Style for the panel surface (e.g. brand color). Composed after defaults. */
46
+ panelStyle?: StyleProp<ViewStyle>;
47
+ /** NativeWind classes for the panel surface. */
48
+ panelClassName?: string;
49
+ /** Style for the root overlay (theme-var scope, rail offset, etc.). */
50
+ containerStyle?: StyleProp<ViewStyle>;
51
+ /** NativeWind classes for the root overlay (e.g. `"md:left-[4.75rem]"`). */
52
+ containerClassName?: string;
53
+ /** Accessibility label for the sheet panel and the backdrop dismiss button. */
54
+ label?: string;
55
+ /** Sheet content. */
56
+ children: ReactNode;
57
+ }
58
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/responsive-sheet/types.ts"],"names":[],"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C;CACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/bloom",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -463,6 +463,22 @@
463
463
  "default": "./lib/commonjs/bottom-sheet/index.js"
464
464
  }
465
465
  },
466
+ "./responsive-sheet": {
467
+ "react-native": "./src/responsive-sheet/index.ts",
468
+ "browser": {
469
+ "types": "./lib/typescript/module/responsive-sheet/index.web.d.ts",
470
+ "import": "./lib/module/responsive-sheet/index.web.js",
471
+ "require": "./lib/commonjs/responsive-sheet/index.web.js"
472
+ },
473
+ "import": {
474
+ "types": "./lib/typescript/module/responsive-sheet/index.d.ts",
475
+ "default": "./lib/module/responsive-sheet/index.js"
476
+ },
477
+ "require": {
478
+ "types": "./lib/typescript/commonjs/responsive-sheet/index.d.ts",
479
+ "default": "./lib/commonjs/responsive-sheet/index.js"
480
+ }
481
+ },
466
482
  "./context-menu": {
467
483
  "react-native": "./src/context-menu/index.tsx",
468
484
  "browser": {
@@ -766,6 +782,7 @@
766
782
  "select",
767
783
  "context-menu",
768
784
  "bottom-sheet",
785
+ "responsive-sheet",
769
786
  "card",
770
787
  "badge",
771
788
  "chip",
@@ -0,0 +1,144 @@
1
+ import React from 'react';
2
+ import { Text } from 'react-native';
3
+ import { act, fireEvent, render } from '@testing-library/react-native';
4
+
5
+ import { Dialog } from '../dialog';
6
+ import {
7
+ BREAKPOINT_MD,
8
+ useResolvedPlacement,
9
+ type DialogPlacement,
10
+ type ResponsiveDialogPlacement,
11
+ } from '../dialog/placement';
12
+ import { BloomThemeProvider } from '../theme/BloomThemeProvider';
13
+
14
+ // The RN test mock reports a 375px-wide viewport (below every breakpoint), so a
15
+ // responsive `placement` map resolves to its `base`.
16
+ const MOCK_VIEWPORT_WIDTH = 375;
17
+
18
+ function renderWithTheme(ui: React.ReactElement) {
19
+ return render(
20
+ <BloomThemeProvider mode="light" colorPreset="teal">
21
+ {ui}
22
+ </BloomThemeProvider>,
23
+ );
24
+ }
25
+
26
+ /** Capture `useResolvedPlacement`'s output for a given input. */
27
+ function ResolveProbe({
28
+ placement,
29
+ onResolve,
30
+ }: {
31
+ placement: ResponsiveDialogPlacement | undefined;
32
+ onResolve: (p: DialogPlacement) => void;
33
+ }) {
34
+ const resolved = useResolvedPlacement(placement);
35
+ onResolve(resolved);
36
+ return null;
37
+ }
38
+
39
+ function resolve(placement: ResponsiveDialogPlacement | undefined): DialogPlacement {
40
+ let captured: DialogPlacement = 'center';
41
+ renderWithTheme(
42
+ <ResolveProbe placement={placement} onResolve={(p) => { captured = p; }} />,
43
+ );
44
+ return captured;
45
+ }
46
+
47
+ describe('useResolvedPlacement', () => {
48
+ it('defaults to center when placement is undefined', () => {
49
+ expect(resolve(undefined)).toBe('center');
50
+ });
51
+
52
+ it('returns a plain string placement unchanged', () => {
53
+ expect(resolve('left')).toBe('left');
54
+ expect(resolve('right')).toBe('right');
55
+ expect(resolve('bottom')).toBe('bottom');
56
+ expect(resolve('center')).toBe('center');
57
+ });
58
+
59
+ it('resolves a responsive map to base below the first breakpoint', () => {
60
+ // Sanity: the mock viewport is narrower than md, so md/lg/xl never apply.
61
+ expect(MOCK_VIEWPORT_WIDTH).toBeLessThan(BREAKPOINT_MD);
62
+ expect(resolve({ base: 'bottom', md: 'left' })).toBe('bottom');
63
+ expect(resolve({ base: 'bottom', md: 'center' })).toBe('bottom');
64
+ expect(resolve({ base: 'bottom', sm: 'right', lg: 'center' })).toBe('bottom');
65
+ });
66
+
67
+ it('ignores higher breakpoint keys that exceed the viewport width', () => {
68
+ // Only `base` applies at 375px wide; the `xl` override does not engage.
69
+ expect(resolve({ base: 'right', xl: 'left' })).toBe('right');
70
+ });
71
+ });
72
+
73
+ describe('Dialog controlled open mode', () => {
74
+ it('does not render content while open is false', () => {
75
+ const { queryByText } = renderWithTheme(
76
+ <Dialog open={false} onClose={() => {}} title="Controlled">
77
+ <Text>Controlled body</Text>
78
+ </Dialog>,
79
+ );
80
+ expect(queryByText('Controlled body')).toBeNull();
81
+ });
82
+
83
+ it('renders content when open flips to true (no control needed)', () => {
84
+ const { getByText, rerender } = renderWithTheme(
85
+ <Dialog open={false} onClose={() => {}} title="Controlled">
86
+ <Text>Controlled body</Text>
87
+ </Dialog>,
88
+ );
89
+ rerender(
90
+ <BloomThemeProvider mode="light" colorPreset="teal">
91
+ <Dialog open onClose={() => {}} title="Controlled">
92
+ <Text>Controlled body</Text>
93
+ </Dialog>
94
+ </BloomThemeProvider>,
95
+ );
96
+ expect(getByText('Controlled body')).toBeTruthy();
97
+ expect(getByText('Controlled')).toBeTruthy();
98
+ });
99
+
100
+ it('unmounts after open flips back to false and the close settles', () => {
101
+ jest.useFakeTimers();
102
+ try {
103
+ const { getByText, queryByText, rerender } = renderWithTheme(
104
+ <Dialog open onClose={() => {}} title="Controlled">
105
+ <Text>Controlled body</Text>
106
+ </Dialog>,
107
+ );
108
+ expect(getByText('Controlled body')).toBeTruthy();
109
+
110
+ rerender(
111
+ <BloomThemeProvider mode="light" colorPreset="teal">
112
+ <Dialog open={false} onClose={() => {}} title="Controlled">
113
+ <Text>Controlled body</Text>
114
+ </Dialog>
115
+ </BloomThemeProvider>,
116
+ );
117
+ act(() => {
118
+ jest.advanceTimersByTime(500);
119
+ });
120
+ expect(queryByText('Controlled body')).toBeNull();
121
+ } finally {
122
+ jest.useRealTimers();
123
+ }
124
+ });
125
+
126
+ it('requests close via onClose exactly once when an action is pressed (no double-fire)', () => {
127
+ const onClose = jest.fn();
128
+ const { getByText } = renderWithTheme(
129
+ <Dialog
130
+ open
131
+ onClose={onClose}
132
+ title="Controlled"
133
+ actions={[{ label: 'Done' }]}
134
+ />,
135
+ );
136
+ act(() => {
137
+ fireEvent.press(getByText('Done'));
138
+ });
139
+ // In controlled mode the action's close() requests dismissal via onClose
140
+ // once; the host (not the dialog) then flips `open`. It must not fire the
141
+ // close-completion onClose a second time.
142
+ expect(onClose).toHaveBeenCalledTimes(1);
143
+ });
144
+ });