@oxyhq/bloom 0.4.0 → 0.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 (186) hide show
  1. package/README.md +105 -90
  2. package/lib/commonjs/bottom-sheet/index.js +2 -2
  3. package/lib/commonjs/context-menu/index.js +18 -19
  4. package/lib/commonjs/context-menu/index.js.map +1 -1
  5. package/lib/commonjs/dialog/BloomDialogProvider.js +61 -0
  6. package/lib/commonjs/dialog/BloomDialogProvider.js.map +1 -0
  7. package/lib/commonjs/dialog/BloomDialogProvider.web.js +45 -0
  8. package/lib/commonjs/dialog/BloomDialogProvider.web.js.map +1 -0
  9. package/lib/commonjs/dialog/Dialog.js +197 -100
  10. package/lib/commonjs/dialog/Dialog.js.map +1 -1
  11. package/lib/commonjs/dialog/Dialog.web.js +194 -84
  12. package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
  13. package/lib/commonjs/dialog/SheetShell.js +149 -0
  14. package/lib/commonjs/dialog/SheetShell.js.map +1 -0
  15. package/lib/commonjs/dialog/alert-store.js +116 -0
  16. package/lib/commonjs/dialog/alert-store.js.map +1 -0
  17. package/lib/commonjs/dialog/alert.js +38 -0
  18. package/lib/commonjs/dialog/alert.js.map +1 -0
  19. package/lib/commonjs/dialog/context.js +10 -2
  20. package/lib/commonjs/dialog/context.js.map +1 -1
  21. package/lib/commonjs/dialog/index.js +8 -24
  22. package/lib/commonjs/dialog/index.js.map +1 -1
  23. package/lib/commonjs/dialog/index.web.js +10 -20
  24. package/lib/commonjs/dialog/index.web.js.map +1 -1
  25. package/lib/commonjs/index.js +101 -66
  26. package/lib/commonjs/index.js.map +1 -1
  27. package/lib/commonjs/index.web.js +101 -66
  28. package/lib/commonjs/index.web.js.map +1 -1
  29. package/lib/commonjs/menu/index.js +21 -23
  30. package/lib/commonjs/menu/index.js.map +1 -1
  31. package/lib/commonjs/select/index.js +26 -27
  32. package/lib/commonjs/select/index.js.map +1 -1
  33. package/lib/commonjs/toast/index.js +42 -13
  34. package/lib/commonjs/toast/index.js.map +1 -1
  35. package/lib/commonjs/toast/index.web.js +19 -15
  36. package/lib/commonjs/toast/index.web.js.map +1 -1
  37. package/lib/module/bottom-sheet/index.js +2 -2
  38. package/lib/module/context-menu/index.js +15 -16
  39. package/lib/module/context-menu/index.js.map +1 -1
  40. package/lib/module/dialog/BloomDialogProvider.js +57 -0
  41. package/lib/module/dialog/BloomDialogProvider.js.map +1 -0
  42. package/lib/module/dialog/BloomDialogProvider.web.js +41 -0
  43. package/lib/module/dialog/BloomDialogProvider.web.js.map +1 -0
  44. package/lib/module/dialog/Dialog.js +199 -87
  45. package/lib/module/dialog/Dialog.js.map +1 -1
  46. package/lib/module/dialog/Dialog.web.js +195 -70
  47. package/lib/module/dialog/Dialog.web.js.map +1 -1
  48. package/lib/module/dialog/SheetShell.js +143 -0
  49. package/lib/module/dialog/SheetShell.js.map +1 -0
  50. package/lib/module/dialog/alert-store.js +107 -0
  51. package/lib/module/dialog/alert-store.js.map +1 -0
  52. package/lib/module/dialog/alert.js +35 -0
  53. package/lib/module/dialog/alert.js.map +1 -0
  54. package/lib/module/dialog/context.js +10 -2
  55. package/lib/module/dialog/context.js.map +1 -1
  56. package/lib/module/dialog/index.js +3 -1
  57. package/lib/module/dialog/index.js.map +1 -1
  58. package/lib/module/dialog/index.web.js +9 -7
  59. package/lib/module/dialog/index.web.js.map +1 -1
  60. package/lib/module/index.js +2 -3
  61. package/lib/module/index.js.map +1 -1
  62. package/lib/module/index.web.js +2 -3
  63. package/lib/module/index.web.js.map +1 -1
  64. package/lib/module/menu/index.js +11 -13
  65. package/lib/module/menu/index.js.map +1 -1
  66. package/lib/module/select/index.js +27 -28
  67. package/lib/module/select/index.js.map +1 -1
  68. package/lib/module/toast/index.js +41 -11
  69. package/lib/module/toast/index.js.map +1 -1
  70. package/lib/module/toast/index.web.js +18 -13
  71. package/lib/module/toast/index.web.js.map +1 -1
  72. package/lib/typescript/commonjs/__tests__/Dialog.test.d.ts +2 -0
  73. package/lib/typescript/commonjs/__tests__/Dialog.test.d.ts.map +1 -0
  74. package/lib/typescript/commonjs/bottom-sheet/index.d.ts +1 -1
  75. package/lib/typescript/commonjs/context-menu/index.d.ts +4 -3
  76. package/lib/typescript/commonjs/context-menu/index.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/dialog/BloomDialogProvider.d.ts +27 -0
  78. package/lib/typescript/commonjs/dialog/BloomDialogProvider.d.ts.map +1 -0
  79. package/lib/typescript/commonjs/dialog/BloomDialogProvider.web.d.ts +15 -0
  80. package/lib/typescript/commonjs/dialog/BloomDialogProvider.web.d.ts.map +1 -0
  81. package/lib/typescript/commonjs/dialog/Dialog.d.ts +37 -10
  82. package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/dialog/Dialog.web.d.ts +26 -10
  84. package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/dialog/SheetShell.d.ts +31 -0
  86. package/lib/typescript/commonjs/dialog/SheetShell.d.ts.map +1 -0
  87. package/lib/typescript/commonjs/dialog/alert-store.d.ts +70 -0
  88. package/lib/typescript/commonjs/dialog/alert-store.d.ts.map +1 -0
  89. package/lib/typescript/commonjs/dialog/alert.d.ts +27 -0
  90. package/lib/typescript/commonjs/dialog/alert.d.ts.map +1 -0
  91. package/lib/typescript/commonjs/dialog/context.d.ts +7 -0
  92. package/lib/typescript/commonjs/dialog/context.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/dialog/index.d.ts +5 -2
  94. package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/dialog/index.web.d.ts +5 -2
  96. package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/dialog/types.d.ts +70 -15
  98. package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/index.d.ts +3 -3
  100. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/index.web.d.ts +3 -3
  102. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  103. package/lib/typescript/commonjs/menu/index.d.ts +4 -4
  104. package/lib/typescript/commonjs/menu/index.d.ts.map +1 -1
  105. package/lib/typescript/commonjs/select/index.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/toast/index.d.ts +32 -3
  107. package/lib/typescript/commonjs/toast/index.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/toast/index.web.d.ts +14 -7
  109. package/lib/typescript/commonjs/toast/index.web.d.ts.map +1 -1
  110. package/lib/typescript/module/__tests__/Dialog.test.d.ts +2 -0
  111. package/lib/typescript/module/__tests__/Dialog.test.d.ts.map +1 -0
  112. package/lib/typescript/module/bottom-sheet/index.d.ts +1 -1
  113. package/lib/typescript/module/context-menu/index.d.ts +4 -3
  114. package/lib/typescript/module/context-menu/index.d.ts.map +1 -1
  115. package/lib/typescript/module/dialog/BloomDialogProvider.d.ts +27 -0
  116. package/lib/typescript/module/dialog/BloomDialogProvider.d.ts.map +1 -0
  117. package/lib/typescript/module/dialog/BloomDialogProvider.web.d.ts +15 -0
  118. package/lib/typescript/module/dialog/BloomDialogProvider.web.d.ts.map +1 -0
  119. package/lib/typescript/module/dialog/Dialog.d.ts +37 -10
  120. package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
  121. package/lib/typescript/module/dialog/Dialog.web.d.ts +26 -10
  122. package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
  123. package/lib/typescript/module/dialog/SheetShell.d.ts +31 -0
  124. package/lib/typescript/module/dialog/SheetShell.d.ts.map +1 -0
  125. package/lib/typescript/module/dialog/alert-store.d.ts +70 -0
  126. package/lib/typescript/module/dialog/alert-store.d.ts.map +1 -0
  127. package/lib/typescript/module/dialog/alert.d.ts +27 -0
  128. package/lib/typescript/module/dialog/alert.d.ts.map +1 -0
  129. package/lib/typescript/module/dialog/context.d.ts +7 -0
  130. package/lib/typescript/module/dialog/context.d.ts.map +1 -1
  131. package/lib/typescript/module/dialog/index.d.ts +5 -2
  132. package/lib/typescript/module/dialog/index.d.ts.map +1 -1
  133. package/lib/typescript/module/dialog/index.web.d.ts +5 -2
  134. package/lib/typescript/module/dialog/index.web.d.ts.map +1 -1
  135. package/lib/typescript/module/dialog/types.d.ts +70 -15
  136. package/lib/typescript/module/dialog/types.d.ts.map +1 -1
  137. package/lib/typescript/module/index.d.ts +3 -3
  138. package/lib/typescript/module/index.d.ts.map +1 -1
  139. package/lib/typescript/module/index.web.d.ts +3 -3
  140. package/lib/typescript/module/index.web.d.ts.map +1 -1
  141. package/lib/typescript/module/menu/index.d.ts +4 -4
  142. package/lib/typescript/module/menu/index.d.ts.map +1 -1
  143. package/lib/typescript/module/select/index.d.ts.map +1 -1
  144. package/lib/typescript/module/toast/index.d.ts +32 -3
  145. package/lib/typescript/module/toast/index.d.ts.map +1 -1
  146. package/lib/typescript/module/toast/index.web.d.ts +14 -7
  147. package/lib/typescript/module/toast/index.web.d.ts.map +1 -1
  148. package/package.json +3 -14
  149. package/src/__tests__/Dialog.test.tsx +177 -0
  150. package/src/bottom-sheet/index.tsx +3 -3
  151. package/src/context-menu/index.tsx +12 -12
  152. package/src/dialog/BloomDialogProvider.tsx +61 -0
  153. package/src/dialog/BloomDialogProvider.web.tsx +46 -0
  154. package/src/dialog/Dialog.tsx +217 -64
  155. package/src/dialog/Dialog.web.tsx +240 -75
  156. package/src/dialog/SheetShell.tsx +154 -0
  157. package/src/dialog/alert-store.ts +126 -0
  158. package/src/dialog/alert.ts +42 -0
  159. package/src/dialog/context.ts +14 -3
  160. package/src/dialog/index.ts +14 -2
  161. package/src/dialog/index.web.ts +20 -8
  162. package/src/dialog/types.ts +73 -16
  163. package/src/index.ts +17 -3
  164. package/src/index.web.ts +17 -3
  165. package/src/menu/index.tsx +13 -17
  166. package/src/select/index.tsx +30 -30
  167. package/src/toast/index.tsx +55 -11
  168. package/src/toast/index.web.tsx +33 -13
  169. package/lib/commonjs/prompt/Prompt.js +0 -267
  170. package/lib/commonjs/prompt/Prompt.js.map +0 -1
  171. package/lib/commonjs/prompt/index.js +0 -61
  172. package/lib/commonjs/prompt/index.js.map +0 -1
  173. package/lib/module/prompt/Prompt.js +0 -250
  174. package/lib/module/prompt/Prompt.js.map +0 -1
  175. package/lib/module/prompt/index.js +0 -4
  176. package/lib/module/prompt/index.js.map +0 -1
  177. package/lib/typescript/commonjs/prompt/Prompt.d.ts +0 -42
  178. package/lib/typescript/commonjs/prompt/Prompt.d.ts.map +0 -1
  179. package/lib/typescript/commonjs/prompt/index.d.ts +0 -3
  180. package/lib/typescript/commonjs/prompt/index.d.ts.map +0 -1
  181. package/lib/typescript/module/prompt/Prompt.d.ts +0 -42
  182. package/lib/typescript/module/prompt/Prompt.d.ts.map +0 -1
  183. package/lib/typescript/module/prompt/index.d.ts +0 -3
  184. package/lib/typescript/module/prompt/index.d.ts.map +0 -1
  185. package/src/prompt/Prompt.tsx +0 -247
  186. package/src/prompt/index.ts +0 -13
@@ -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 * as Dialog from './dialog';
13
- export * as Prompt from './prompt';
12
+ export { Dialog, BloomDialogProvider, alert, useDialogContext, useDialogControl, } from './dialog';
13
+ export type { AlertButton, AlertButtonStyle, DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogProps, } from './dialog';
14
14
  export * from './button';
15
15
  export * from './grouped-buttons';
16
16
  export * from './divider';
@@ -22,7 +22,7 @@ export * from './avatar';
22
22
  export * from './loading';
23
23
  export * as PromptInput from './prompt-input';
24
24
  export * from './switch';
25
- export * as Toast from './toast';
25
+ export { toast, type Toast } from './toast';
26
26
  export * as Typography from './typography';
27
27
  export * as Skeleton from './skeleton';
28
28
  export * as Grid from './grid';
@@ -1 +1 @@
1
- {"version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IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,gBAAgB,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvE,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,cAAc,iBAAiB,CAAC;AAGhC,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;AAG9C,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 * as Dialog from './dialog/index.web';
13
- export * as Prompt from './prompt';
12
+ export { Dialog, BloomDialogProvider, alert, useDialogContext, useDialogControl, } from './dialog/index.web';
13
+ export type { AlertButton, AlertButtonStyle, DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogProps, } from './dialog/index.web';
14
14
  export * from './button';
15
15
  export * from './grouped-buttons';
16
16
  export * from './divider';
@@ -22,7 +22,7 @@ export * from './avatar';
22
22
  export * from './loading';
23
23
  export * as PromptInput from './prompt-input';
24
24
  export * from './switch';
25
- export * as Toast from './toast/index.web';
25
+ export { toast, type Toast } from './toast/index.web';
26
26
  export * as Typography from './typography';
27
27
  export * as Skeleton from './skeleton';
28
28
  export * as Grid from './grid';
@@ -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,MAAM,UAAU,CAAC;AAC1C,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,oBAAoB,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,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3
- import * as Dialog from '../dialog';
3
+ import type { DialogControlProps } from '../dialog/types';
4
4
  import { useMenuContext } from './context';
5
5
  import type { GroupProps, ItemIconProps, ItemProps, ItemTextProps, TriggerProps } from './types';
6
- export type { DialogControlProps as MenuControlProps } from '../dialog';
7
- export { useDialogControl as useMenuControl } from '../dialog';
6
+ export type { DialogControlProps as MenuControlProps } from '../dialog/types';
7
+ export { useDialogControl as useMenuControl } from '../dialog/context';
8
8
  export { useMenuContext };
9
9
  export declare function Root({ children, control, }: React.PropsWithChildren<{
10
- control?: Dialog.DialogControlProps;
10
+ control?: DialogControlProps;
11
11
  }>): import("react/jsx-runtime").JSX.Element;
12
12
  export declare function Trigger({ children, label, role, hint, }: TriggerProps): React.ReactNode;
13
13
  export declare function Outer({ children, showCancel, }: React.PropsWithChildren<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/menu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiF,MAAM,OAAO,CAAC;AACtG,OAAO,EAA+B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAK3F,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,EAGL,cAAc,EAEf,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAEV,UAAU,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACb,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,kBAAkB,IAAI,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,gBAAgB,IAAI,cAAc,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,OAAO,GACR,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,kBAAkB,CAAC;CACrC,CAAC,2CAcD;AAED,wBAAgB,OAAO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wBAAgB,SAAS,CAAC,EACxB,WAAW,EACX,QAAQ,EAAE,YAAkC,EAC5C,KAAK,GACN,EAAE,cAAc,2CAkBhB;AAaD,wBAAgB,IAAI,CAAC,MAAM,EAAE,SAAS,2CAGrC;AAMD,wBAAgB,OAAO,CAAC,CAAC,EAAE,EACzB,KAAK,EACL,cAA0C,EAC1C,GAAG,KAAK,EACT,EAAE,YAAY,CAAC,CAAC,CAAC,2CAwBjB;AAkED,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,SAAS,2CA2ChE;AAMD,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,aAAa,2CAc1D;AAMD,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,kBAAkB,2CAYxE;AAMD,wBAAgB,SAAS,4CAWxB"}
@@ -9,7 +9,8 @@ export type { ToastType, BaseToastOptions } from './types';
9
9
  */
10
10
  export declare function ToastOutlet(): import("react/jsx-runtime").JSX.Element;
11
11
  /**
12
- * Access the full Sonner API
12
+ * Direct access to the Sonner API. Use sparingly — `toast()` covers the
13
+ * common case and keeps the surface tied to bloom's themed look.
13
14
  */
14
15
  export declare const api: ((message: string, data?: Omit<import("sonner-native").ToastProps, "title" | "id" | "type" | "variant" | "jsx" | "promise"> & {
15
16
  id?: string | number;
@@ -49,7 +50,35 @@ export declare const api: ((message: string, data?: Omit<import("sonner-native")
49
50
  /**
50
51
  * Show a toast notification.
51
52
  *
52
- * Pass a string for a simple text toast, or a React element for a custom toast.
53
+ * Pass a string for a simple text toast, or a React element for a custom
54
+ * toast. The optional `options` argument accepts the standard Sonner
55
+ * options plus a bloom `type` (defaults to `'default'`).
56
+ *
57
+ * ```ts
58
+ * toast('Saved');
59
+ * toast.success('Profile updated');
60
+ * toast.error('Network error', { duration: 5000 });
61
+ * toast.dismiss(id);
62
+ * ```
63
+ *
64
+ * Pre-typed variants (`toast.success`, `toast.error`, `toast.warning`,
65
+ * `toast.info`) are aliases for the corresponding `type`.
66
+ */
67
+ export interface ToastFn {
68
+ (content: React.ReactNode, options?: BaseToastOptions): void;
69
+ success: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
70
+ error: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
71
+ warning: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
72
+ info: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
73
+ dismiss: (id?: string | number) => void;
74
+ }
75
+ export declare const toast: ToastFn;
76
+ /**
77
+ * Alias of `toast` kept for compatibility with the original 0.4.x surface
78
+ * where `show()` was the documented entry point. New code should prefer
79
+ * `toast()` directly.
53
80
  */
54
- export declare function show(content: React.ReactNode, { type, ...options }?: BaseToastOptions): void;
81
+ export declare const show: ToastFn;
82
+ /** Re-export the Toast function type so callers can refer to it. */
83
+ export type Toast = ToastFn;
55
84
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/toast/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAY9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACzE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,WAAW,4CAE1B;AAUD;;GAEG;AACH,eAAO,MAAM,GAAG;;;mCAmDwuE,CAAC;;;gCAAqE,CAAC;;;iCAAsE,CAAC;;;mCAAwE,CAAC;;;0CAA+E,CAAC;;;;;;;;;mBAlE/gF,CAAA;mBACF,CA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,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACpF,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACtF,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACnF,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;CACzC;AAYD,eAAO,MAAM,KAAK,EAAE,OAAmB,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,OAAmB,CAAC;AAEvC,oEAAoE;AACpE,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC"}
@@ -9,14 +9,21 @@ export type { ToastType, BaseToastOptions } from './types';
9
9
  * component tree.
10
10
  */
11
11
  export declare function ToastOutlet(): import("react/jsx-runtime").JSX.Element;
12
- /**
13
- * Access the full Sonner API
14
- */
12
+ /** Direct access to the underlying Sonner API. Use sparingly. */
15
13
  export declare const api: typeof sonner;
16
14
  /**
17
- * Show a toast notification.
18
- *
19
- * Pass a string for a simple text toast, or a React element for a custom toast.
15
+ * Show a toast notification. Identical API to the native variant — see
16
+ * `./index.tsx` for the full usage docs.
20
17
  */
21
- export declare function show(content: React.ReactNode, { type, ...options }?: BaseToastOptions): void;
18
+ export interface ToastFn {
19
+ (content: React.ReactNode, options?: BaseToastOptions): void;
20
+ success: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
21
+ error: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
22
+ warning: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
23
+ info: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
24
+ dismiss: (id?: string | number) => void;
25
+ }
26
+ export declare const toast: ToastFn;
27
+ export declare const show: ToastFn;
28
+ export type Toast = ToastFn;
22
29
  //# sourceMappingURL=index.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/toast/index.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,KAAK,IAAI,MAAM,EAAW,MAAM,QAAQ,CAAC;AASlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACzE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,WAAW,4CAS1B;AAED;;GAEG;AACH,eAAO,MAAM,GAAG,EAAE,OAAO,MAAe,CAAC;AAEzC;;;;GAIG;AACH,wBAAgB,IAAI,CAClB,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,EAAE,IAAgB,EAAE,GAAG,OAAO,EAAE,GAAE,gBAAqB,QAoCxD"}
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/toast/index.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,KAAK,IAAI,MAAM,EAAW,MAAM,QAAQ,CAAC;AASlD,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACzE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,WAAW,4CAS1B;AAED,iEAAiE;AACjE,eAAO,MAAM,GAAG,EAAE,OAAO,MAAe,CAAC;AA0CzC;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACtF,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACpF,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACtF,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACnF,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;CACzC;AAYD,eAAO,MAAM,KAAK,EAAE,OAAmB,CAAC;AACxC,eAAO,MAAM,IAAI,EAAE,OAAmB,CAAC;AACvC,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/bloom",
3
- "version": "0.4.0",
3
+ "version": "0.5.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",
@@ -93,17 +93,6 @@
93
93
  "default": "./lib/commonjs/dialog/index.js"
94
94
  }
95
95
  },
96
- "./prompt": {
97
- "react-native": "./src/prompt/index.ts",
98
- "import": {
99
- "types": "./lib/typescript/module/prompt/index.d.ts",
100
- "default": "./lib/module/prompt/index.js"
101
- },
102
- "require": {
103
- "types": "./lib/typescript/commonjs/prompt/index.d.ts",
104
- "default": "./lib/commonjs/prompt/index.js"
105
- }
106
- },
107
96
  "./button": {
108
97
  "react-native": "./src/button/index.ts",
109
98
  "import": {
@@ -553,7 +542,8 @@
553
542
  "ui",
554
543
  "components",
555
544
  "dialog",
556
- "prompt",
545
+ "alert",
546
+ "toast",
557
547
  "button",
558
548
  "theme",
559
549
  "avatar",
@@ -562,7 +552,6 @@
562
552
  "collapsible",
563
553
  "error-boundary",
564
554
  "prompt-input",
565
- "toast",
566
555
  "icons",
567
556
  "typography",
568
557
  "skeleton",
@@ -0,0 +1,177 @@
1
+ import React from 'react';
2
+ import { Text } from 'react-native';
3
+ import { act, fireEvent, render } from '@testing-library/react-native';
4
+
5
+ import {
6
+ alert,
7
+ BloomDialogProvider,
8
+ Dialog,
9
+ useDialogControl,
10
+ } from '../dialog';
11
+ import { dismissAlert, getAlertQueue } from '../dialog/alert-store';
12
+ import { BloomThemeProvider } from '../theme/BloomThemeProvider';
13
+
14
+ function renderWithTheme(ui: React.ReactElement) {
15
+ return render(
16
+ <BloomThemeProvider mode="light" colorPreset="teal">
17
+ {ui}
18
+ </BloomThemeProvider>,
19
+ );
20
+ }
21
+
22
+ function Harness({
23
+ children,
24
+ onControl,
25
+ }: {
26
+ children?: (control: ReturnType<typeof useDialogControl>) => React.ReactNode;
27
+ onControl?: (control: ReturnType<typeof useDialogControl>) => void;
28
+ }) {
29
+ const control = useDialogControl();
30
+ React.useEffect(() => {
31
+ onControl?.(control);
32
+ }, [control, onControl]);
33
+ return <>{children?.(control)}</>;
34
+ }
35
+
36
+ describe('Dialog (unified API)', () => {
37
+ it('does not render content until control.open() is called', () => {
38
+ const { queryByText } = renderWithTheme(
39
+ <Harness>
40
+ {(control) => (
41
+ <Dialog control={control} title="Hidden until opened">
42
+ <Text>Body</Text>
43
+ </Dialog>
44
+ )}
45
+ </Harness>,
46
+ );
47
+ expect(queryByText('Hidden until opened')).toBeNull();
48
+ expect(queryByText('Body')).toBeNull();
49
+ });
50
+
51
+ it('renders declarative title + description + actions when opened', () => {
52
+ let control: ReturnType<typeof useDialogControl> | undefined;
53
+ const onDelete = jest.fn();
54
+ const { getByText } = renderWithTheme(
55
+ <Harness onControl={(c) => { control = c; }}>
56
+ {(c) => (
57
+ <Dialog
58
+ control={c}
59
+ title="Delete item?"
60
+ description="This action cannot be undone."
61
+ actions={[
62
+ { label: 'Delete', color: 'destructive', onPress: onDelete },
63
+ { label: 'Cancel', color: 'cancel' },
64
+ ]}
65
+ />
66
+ )}
67
+ </Harness>,
68
+ );
69
+ act(() => { control?.open(); });
70
+ expect(getByText('Delete item?')).toBeTruthy();
71
+ expect(getByText('This action cannot be undone.')).toBeTruthy();
72
+ expect(getByText('Delete')).toBeTruthy();
73
+ expect(getByText('Cancel')).toBeTruthy();
74
+ });
75
+
76
+ it('renders custom children alongside the declarative header', () => {
77
+ let control: ReturnType<typeof useDialogControl> | undefined;
78
+ const { getByText } = renderWithTheme(
79
+ <Harness onControl={(c) => { control = c; }}>
80
+ {(c) => (
81
+ <Dialog control={c} title="Pick a tag">
82
+ <Text>Custom body content</Text>
83
+ </Dialog>
84
+ )}
85
+ </Harness>,
86
+ );
87
+ act(() => { control?.open(); });
88
+ expect(getByText('Pick a tag')).toBeTruthy();
89
+ expect(getByText('Custom body content')).toBeTruthy();
90
+ });
91
+
92
+ it('fires the action onPress after the dialog finishes closing', () => {
93
+ let control: ReturnType<typeof useDialogControl> | undefined;
94
+ const onConfirm = jest.fn();
95
+ const { getByText } = renderWithTheme(
96
+ <Harness onControl={(c) => { control = c; }}>
97
+ {(c) => (
98
+ <Dialog
99
+ control={c}
100
+ title="Confirm?"
101
+ actions={[
102
+ { label: 'Confirm', onPress: onConfirm },
103
+ ]}
104
+ />
105
+ )}
106
+ </Harness>,
107
+ );
108
+ act(() => { control?.open(); });
109
+ act(() => {
110
+ fireEvent.press(getByText('Confirm'));
111
+ });
112
+ expect(onConfirm).toHaveBeenCalledTimes(1);
113
+ });
114
+ });
115
+
116
+ describe('alert() helper', () => {
117
+ // The alert store is module-scope; ensure no cross-test contamination by
118
+ // draining anything left over from prior tests before each new run.
119
+ beforeEach(() => {
120
+ while (getAlertQueue().length > 0) {
121
+ const head = getAlertQueue()[0];
122
+ if (head) dismissAlert(head.id);
123
+ }
124
+ });
125
+
126
+ it('queues alerts before any provider mounts and drains them on subscribe', () => {
127
+ // Call alert() *before* the provider mounts — entry should sit in the
128
+ // queue until a subscriber attaches, at which point the head is
129
+ // rendered.
130
+ alert('Pending', 'Was queued before provider', [
131
+ { text: 'OK' },
132
+ ]);
133
+ expect(getAlertQueue().length).toBe(1);
134
+
135
+ const { getByText } = renderWithTheme(
136
+ <BloomDialogProvider>
137
+ <Text>app body</Text>
138
+ </BloomDialogProvider>,
139
+ );
140
+ // The queued entry now renders inside the provider.
141
+ expect(getByText('Pending')).toBeTruthy();
142
+ expect(getByText('Was queued before provider')).toBeTruthy();
143
+ expect(getByText('OK')).toBeTruthy();
144
+ });
145
+
146
+ it('defaults to a single OK button when no buttons are passed', () => {
147
+ const { getByText } = renderWithTheme(
148
+ <BloomDialogProvider>
149
+ <Text>app</Text>
150
+ </BloomDialogProvider>,
151
+ );
152
+ act(() => {
153
+ alert('Hello');
154
+ });
155
+ expect(getByText('Hello')).toBeTruthy();
156
+ expect(getByText('OK')).toBeTruthy();
157
+ });
158
+
159
+ it('invokes the button onPress when tapped', () => {
160
+ const onPress = jest.fn();
161
+ const { getByText } = renderWithTheme(
162
+ <BloomDialogProvider>
163
+ <Text>app</Text>
164
+ </BloomDialogProvider>,
165
+ );
166
+ act(() => {
167
+ alert('Sign out?', undefined, [
168
+ { text: 'Cancel', style: 'cancel' },
169
+ { text: 'Sign out', style: 'destructive', onPress },
170
+ ]);
171
+ });
172
+ act(() => {
173
+ fireEvent.press(getByText('Sign out'));
174
+ });
175
+ expect(onPress).toHaveBeenCalledTimes(1);
176
+ });
177
+ });
@@ -89,7 +89,7 @@ export interface BottomSheetProps {
89
89
  /**
90
90
  * Opacity of the dimming backdrop behind the sheet (0–1). Defaults to `0.5`.
91
91
  * Set to a higher value (e.g. `0.7`) when the sheet is presented over another
92
- * bottom sheet (Dialog/Prompt cases) so the underlying handle/content does not
92
+ * bottom sheet (Dialog cases) so the underlying handle/content does not
93
93
  * bleed through.
94
94
  */
95
95
  backdropOpacity?: number;
@@ -300,8 +300,8 @@ const BottomSheet = forwardRef((props: BottomSheetProps, ref: React.ForwardedRef
300
300
 
301
301
  // On unmount: ensure pending close callbacks (e.g. consumer's `onDismiss`)
302
302
  // still fire if the BS is yanked mid-animation by a parent re-render.
303
- // Without this, `Dialog.Outer.handleDismiss` never runs and queued
304
- // callbacks like `Prompt.Action`'s post-close handler are silently lost.
303
+ // Without this, `Dialog`'s `handleDismiss` never runs and queued
304
+ // callbacks (post-close handlers) are silently lost.
305
305
  // Only fires when the sheet was actually rendered (open or closing) to
306
306
  // avoid spuriously calling onDismiss on bare unmount of a never-opened
307
307
  // sheet. Refs are read inside the cleanup, so latest values are captured.
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * ContextMenu — Native implementation
3
3
  *
4
- * Opens a bottom-sheet menu via Bloom's Dialog when the user long-presses
5
- * the trigger. The menu body is rendered through Bloom's Menu component
6
- * pattern using Dialog.Outer / Dialog.ScrollableInner.
4
+ * Opens a bottom-sheet menu when the user long-presses the trigger. The
5
+ * menu body uses bloom's internal `SheetShell` (a `BottomSheet`
6
+ * presentation primitive with the same drag-handle + close-on-tap
7
+ * semantics shared by `Menu` and `Select`).
7
8
  */
8
9
  import React, {
9
10
  createContext,
@@ -15,7 +16,9 @@ import { Pressable, StyleSheet, View } from 'react-native';
15
16
 
16
17
  import { useTheme } from '../theme/use-theme';
17
18
  import { Text } from '../typography';
18
- import * as Dialog from '../dialog';
19
+ import { useDialogControl } from '../dialog/context';
20
+ import { SheetShell } from '../dialog/SheetShell';
21
+ import type { DialogControlProps } from '../dialog/types';
19
22
  import { useInteractionState } from '../hooks/useInteractionState';
20
23
  import { ItemCtx, useItemContext } from './context';
21
24
  import type {
@@ -34,7 +37,7 @@ import type {
34
37
  // ---------------------------------------------------------------------------
35
38
 
36
39
  type NativeContextMenuContextValue = ContextMenuContextValue & {
37
- control: Dialog.DialogControlProps;
40
+ control: DialogControlProps;
38
41
  };
39
42
 
40
43
  const NativeContextMenuContext = createContext<NativeContextMenuContextValue | null>(null);
@@ -55,7 +58,7 @@ function useNativeContextMenuContext(): NativeContextMenuContextValue {
55
58
  // ---------------------------------------------------------------------------
56
59
 
57
60
  export function Root({ children }: { children: React.ReactNode }) {
58
- const control = Dialog.useDialogControl();
61
+ const control = useDialogControl();
59
62
 
60
63
  const ctx = useMemo(
61
64
  () => ({
@@ -112,8 +115,7 @@ export function Outer({ children, style }: OuterProps) {
112
115
  const { control } = useNativeContextMenuContext();
113
116
 
114
117
  return (
115
- <Dialog.Outer control={control} preventExpansion>
116
- <Dialog.Handle />
118
+ <SheetShell control={control} label="Context menu">
117
119
  <NativeContextMenuContext.Provider
118
120
  value={{
119
121
  isOpen: true,
@@ -122,11 +124,9 @@ export function Outer({ children, style }: OuterProps) {
122
124
  control,
123
125
  }}
124
126
  >
125
- <Dialog.ScrollableInner label="Context menu">
126
- <View style={[styles.outerContent, style]}>{children}</View>
127
- </Dialog.ScrollableInner>
127
+ <View style={[styles.outerContent, style]}>{children}</View>
128
128
  </NativeContextMenuContext.Provider>
129
- </Dialog.Outer>
129
+ </SheetShell>
130
130
  );
131
131
  }
132
132
 
@@ -0,0 +1,61 @@
1
+ import React, { useEffect, useState } from 'react';
2
+
3
+ import { AutoMountedDialog } from './Dialog';
4
+ import {
5
+ buttonToAction,
6
+ dismissAlert,
7
+ subscribeAlerts,
8
+ type AlertEntry,
9
+ } from './alert-store';
10
+
11
+ /**
12
+ * Mounts the imperative `alert()` host inside your app.
13
+ *
14
+ * Wrap your app root once (after `BloomThemeProvider`, so the dialog's
15
+ * colours come from the active theme) and you can call `alert()` from
16
+ * anywhere — including from code that runs before the provider mounts
17
+ * (alerts are queued and drained on subscribe).
18
+ *
19
+ * ```tsx
20
+ * import { BloomDialogProvider } from '@oxyhq/bloom';
21
+ *
22
+ * <BloomThemeProvider mode="system" colorPreset="oxy">
23
+ * <BloomDialogProvider>
24
+ * <App />
25
+ * </BloomDialogProvider>
26
+ * </BloomThemeProvider>
27
+ * ```
28
+ *
29
+ * Alerts are presented one at a time. While one is on screen, subsequent
30
+ * `alert()` calls enqueue and present in FIFO order once their predecessor
31
+ * has finished closing.
32
+ */
33
+ export function BloomDialogProvider({ children }: { children: React.ReactNode }) {
34
+ const [queue, setQueue] = useState<readonly AlertEntry[]>([]);
35
+
36
+ useEffect(() => subscribeAlerts(setQueue), []);
37
+
38
+ // Only the head of the queue is presented; this keeps the bottom-sheet
39
+ // exit/enter animations clean and matches the platform `Alert.alert`
40
+ // behaviour our consumers expect.
41
+ const head = queue[0];
42
+
43
+ return (
44
+ <>
45
+ {children}
46
+ {head ? <AlertHost key={head.id} entry={head} /> : null}
47
+ </>
48
+ );
49
+ }
50
+
51
+ function AlertHost({ entry }: { entry: AlertEntry }) {
52
+ const actions = entry.buttons.map(buttonToAction);
53
+ return (
54
+ <AutoMountedDialog
55
+ title={entry.title}
56
+ description={entry.message}
57
+ actions={actions}
58
+ onResolve={() => dismissAlert(entry.id)}
59
+ />
60
+ );
61
+ }
@@ -0,0 +1,46 @@
1
+ import React, { useEffect, useState } from 'react';
2
+
3
+ import { AutoMountedDialog } from './Dialog.web';
4
+ import {
5
+ buttonToAction,
6
+ dismissAlert,
7
+ subscribeAlerts,
8
+ type AlertEntry,
9
+ } from './alert-store';
10
+
11
+ /**
12
+ * Web variant of `BloomDialogProvider`. Identical surface area to the
13
+ * native version — it just uses the web-fork `Dialog` (`Dialog.web.tsx`)
14
+ * underneath instead of the bottom-sheet variant.
15
+ *
16
+ * See the native file (`./BloomDialogProvider.tsx`) for the full design
17
+ * notes; this fork exists purely so the bundler's `browser` condition can
18
+ * resolve to a `Dialog` that doesn't pull in the native gesture-handler /
19
+ * reanimated stack.
20
+ */
21
+ export function BloomDialogProvider({ children }: { children: React.ReactNode }) {
22
+ const [queue, setQueue] = useState<readonly AlertEntry[]>([]);
23
+
24
+ useEffect(() => subscribeAlerts(setQueue), []);
25
+
26
+ const head = queue[0];
27
+
28
+ return (
29
+ <>
30
+ {children}
31
+ {head ? <AlertHost key={head.id} entry={head} /> : null}
32
+ </>
33
+ );
34
+ }
35
+
36
+ function AlertHost({ entry }: { entry: AlertEntry }) {
37
+ const actions = entry.buttons.map(buttonToAction);
38
+ return (
39
+ <AutoMountedDialog
40
+ title={entry.title}
41
+ description={entry.message}
42
+ actions={actions}
43
+ onResolve={() => dismissAlert(entry.id)}
44
+ />
45
+ );
46
+ }