@oxyhq/bloom 0.1.37 → 0.2.1

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 (134) hide show
  1. package/lib/commonjs/accordion/Accordion.js +2 -1
  2. package/lib/commonjs/accordion/Accordion.js.map +1 -1
  3. package/lib/commonjs/checkbox/Checkbox.js +4 -3
  4. package/lib/commonjs/checkbox/Checkbox.js.map +1 -1
  5. package/lib/commonjs/collapsible/Collapsible.js +2 -1
  6. package/lib/commonjs/collapsible/Collapsible.js.map +1 -1
  7. package/lib/commonjs/context-menu/index.js +1 -1
  8. package/lib/commonjs/context-menu/index.web.js +2 -2
  9. package/lib/commonjs/context-menu/index.web.js.map +1 -1
  10. package/lib/commonjs/dialog/Dialog.web.js +2 -2
  11. package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
  12. package/lib/commonjs/dialog/index.web.js +56 -0
  13. package/lib/commonjs/dialog/index.web.js.map +1 -0
  14. package/lib/commonjs/hooks/usePressAnimation.js +3 -2
  15. package/lib/commonjs/hooks/usePressAnimation.js.map +1 -1
  16. package/lib/commonjs/index.js +67 -67
  17. package/lib/commonjs/index.js.map +1 -1
  18. package/lib/commonjs/index.web.js +386 -0
  19. package/lib/commonjs/index.web.js.map +1 -0
  20. package/lib/commonjs/menu/index.js +1 -1
  21. package/lib/commonjs/menu/index.web.js +2 -2
  22. package/lib/commonjs/menu/index.web.js.map +1 -1
  23. package/lib/commonjs/portal/index.web.js +71 -0
  24. package/lib/commonjs/portal/index.web.js.map +1 -0
  25. package/lib/commonjs/prompt/Prompt.js +1 -1
  26. package/lib/commonjs/prompt-input/PromptInput.js +2 -2
  27. package/lib/commonjs/prompt-input/PromptInput.js.map +1 -1
  28. package/lib/commonjs/select/index.js +3 -3
  29. package/lib/commonjs/select/index.js.map +1 -1
  30. package/lib/commonjs/select/index.web.js +2 -2
  31. package/lib/commonjs/select/index.web.js.map +1 -1
  32. package/lib/commonjs/skeleton/index.js +3 -2
  33. package/lib/commonjs/skeleton/index.js.map +1 -1
  34. package/lib/commonjs/styles/index.js +7 -0
  35. package/lib/commonjs/styles/index.js.map +1 -1
  36. package/lib/commonjs/styles/native-driver.js +23 -0
  37. package/lib/commonjs/styles/native-driver.js.map +1 -0
  38. package/lib/commonjs/theme/BloomThemeProvider.js +1 -1
  39. package/lib/commonjs/tooltip/index.js +2 -2
  40. package/lib/commonjs/tooltip/index.js.map +1 -1
  41. package/lib/module/accordion/Accordion.js +2 -1
  42. package/lib/module/accordion/Accordion.js.map +1 -1
  43. package/lib/module/checkbox/Checkbox.js +4 -3
  44. package/lib/module/checkbox/Checkbox.js.map +1 -1
  45. package/lib/module/collapsible/Collapsible.js +2 -1
  46. package/lib/module/collapsible/Collapsible.js.map +1 -1
  47. package/lib/module/context-menu/index.js +1 -1
  48. package/lib/module/context-menu/index.js.map +1 -1
  49. package/lib/module/context-menu/index.web.js +1 -1
  50. package/lib/module/context-menu/index.web.js.map +1 -1
  51. package/lib/module/dialog/Dialog.web.js +1 -1
  52. package/lib/module/dialog/Dialog.web.js.map +1 -1
  53. package/lib/module/dialog/index.web.js +16 -0
  54. package/lib/module/dialog/index.web.js.map +1 -0
  55. package/lib/module/hooks/usePressAnimation.js +3 -2
  56. package/lib/module/hooks/usePressAnimation.js.map +1 -1
  57. package/lib/module/index.js +2 -2
  58. package/lib/module/index.js.map +1 -1
  59. package/lib/module/index.web.js +74 -0
  60. package/lib/module/index.web.js.map +1 -0
  61. package/lib/module/menu/index.js +2 -2
  62. package/lib/module/menu/index.js.map +1 -1
  63. package/lib/module/menu/index.web.js +1 -1
  64. package/lib/module/menu/index.web.js.map +1 -1
  65. package/lib/module/portal/index.web.js +65 -0
  66. package/lib/module/portal/index.web.js.map +1 -0
  67. package/lib/module/prompt/Prompt.js +2 -2
  68. package/lib/module/prompt/Prompt.js.map +1 -1
  69. package/lib/module/prompt-input/PromptInput.js +1 -1
  70. package/lib/module/prompt-input/PromptInput.js.map +1 -1
  71. package/lib/module/select/index.js +1 -1
  72. package/lib/module/select/index.js.map +1 -1
  73. package/lib/module/select/index.web.js +1 -1
  74. package/lib/module/select/index.web.js.map +1 -1
  75. package/lib/module/skeleton/index.js +3 -2
  76. package/lib/module/skeleton/index.js.map +1 -1
  77. package/lib/module/styles/index.js +1 -0
  78. package/lib/module/styles/index.js.map +1 -1
  79. package/lib/module/styles/native-driver.js +18 -0
  80. package/lib/module/styles/native-driver.js.map +1 -0
  81. package/lib/module/theme/BloomThemeProvider.js +1 -1
  82. package/lib/module/theme/BloomThemeProvider.js.map +1 -1
  83. package/lib/module/tooltip/index.js +1 -1
  84. package/lib/module/tooltip/index.js.map +1 -1
  85. package/lib/typescript/commonjs/accordion/Accordion.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/checkbox/Checkbox.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/collapsible/Collapsible.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/dialog/index.web.d.ts +4 -0
  89. package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/hooks/usePressAnimation.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/index.web.d.ts +48 -0
  92. package/lib/typescript/commonjs/index.web.d.ts.map +1 -0
  93. package/lib/typescript/commonjs/portal/index.web.d.ts +20 -0
  94. package/lib/typescript/commonjs/portal/index.web.d.ts.map +1 -0
  95. package/lib/typescript/commonjs/skeleton/index.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/styles/index.d.ts +1 -0
  97. package/lib/typescript/commonjs/styles/index.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/styles/native-driver.d.ts +2 -0
  99. package/lib/typescript/commonjs/styles/native-driver.d.ts.map +1 -0
  100. package/lib/typescript/module/accordion/Accordion.d.ts.map +1 -1
  101. package/lib/typescript/module/checkbox/Checkbox.d.ts.map +1 -1
  102. package/lib/typescript/module/collapsible/Collapsible.d.ts.map +1 -1
  103. package/lib/typescript/module/dialog/index.web.d.ts +4 -0
  104. package/lib/typescript/module/dialog/index.web.d.ts.map +1 -0
  105. package/lib/typescript/module/hooks/usePressAnimation.d.ts.map +1 -1
  106. package/lib/typescript/module/index.web.d.ts +48 -0
  107. package/lib/typescript/module/index.web.d.ts.map +1 -0
  108. package/lib/typescript/module/portal/index.web.d.ts +20 -0
  109. package/lib/typescript/module/portal/index.web.d.ts.map +1 -0
  110. package/lib/typescript/module/skeleton/index.d.ts.map +1 -1
  111. package/lib/typescript/module/styles/index.d.ts +1 -0
  112. package/lib/typescript/module/styles/index.d.ts.map +1 -1
  113. package/lib/typescript/module/styles/native-driver.d.ts +2 -0
  114. package/lib/typescript/module/styles/native-driver.d.ts.map +1 -0
  115. package/package.json +49 -1
  116. package/src/accordion/Accordion.tsx +2 -1
  117. package/src/checkbox/Checkbox.tsx +4 -3
  118. package/src/collapsible/Collapsible.tsx +2 -1
  119. package/src/dialog/index.web.ts +14 -0
  120. package/src/hooks/usePressAnimation.ts +3 -2
  121. package/src/index.web.ts +75 -0
  122. package/src/portal/index.web.tsx +59 -0
  123. package/src/skeleton/index.tsx +3 -2
  124. package/src/styles/index.ts +1 -0
  125. package/src/styles/native-driver.ts +16 -0
  126. package/lib/commonjs/theme/adaptive-colors.web.js +0 -10
  127. package/lib/commonjs/theme/adaptive-colors.web.js.map +0 -1
  128. package/lib/module/theme/adaptive-colors.web.js +0 -6
  129. package/lib/module/theme/adaptive-colors.web.js.map +0 -1
  130. package/lib/typescript/commonjs/theme/adaptive-colors.web.d.ts +0 -3
  131. package/lib/typescript/commonjs/theme/adaptive-colors.web.d.ts.map +0 -1
  132. package/lib/typescript/module/theme/adaptive-colors.web.d.ts +0 -3
  133. package/lib/typescript/module/theme/adaptive-colors.web.d.ts.map +0 -1
  134. package/src/theme/adaptive-colors.web.ts +0 -5
@@ -0,0 +1,48 @@
1
+ export * from './theme';
2
+ export { atoms, flatten } from './styles';
3
+ export type { ViewStyleProp, TextStyleProp } from './styles';
4
+ export * as tokens from './styles/tokens';
5
+ export { web, native, ios, android, platform, select } from './styles/platform';
6
+ export { useInteractionState } from './hooks/useInteractionState';
7
+ export { useDelayedLoading } from './hooks/useDelayedLoading';
8
+ export { useThrottledValue } from './hooks/useThrottledValue';
9
+ export * as Icons from './icons';
10
+ export { type Props as IconProps, sizes as iconSizes, useCommonSVGProps } from './icons/common';
11
+ export * from './portal/index.web';
12
+ export * as Dialog from './dialog/index.web';
13
+ export * as Prompt from './prompt';
14
+ export * from './button';
15
+ export * from './grouped-buttons';
16
+ export * from './divider';
17
+ export * from './radio-indicator';
18
+ export * from './collapsible';
19
+ export { ErrorBoundary } from './error-boundary';
20
+ export type { ErrorBoundaryProps } from './error-boundary';
21
+ export * from './avatar';
22
+ export * from './loading';
23
+ export * as PromptInput from './prompt-input';
24
+ export * from './switch';
25
+ export * as Toast from './toast/index.web';
26
+ export * as Typography from './typography';
27
+ export * as Skeleton from './skeleton';
28
+ export * as Grid from './grid';
29
+ export { Fill } from './fill';
30
+ export { IconCircle } from './icon-circle';
31
+ export * as TextField from './text-field';
32
+ export * as SegmentedControl from './segmented-control';
33
+ export { SearchInput } from './search-input';
34
+ export { BottomSheet } from './bottom-sheet';
35
+ export type { BottomSheetRef, BottomSheetProps } from './bottom-sheet';
36
+ export * from './card';
37
+ export * from './badge';
38
+ export * from './chip';
39
+ export * as Tabs from './tabs';
40
+ export * from './checkbox';
41
+ export * as Accordion from './accordion';
42
+ export * from './settings-list';
43
+ export * as Admonition from './admonition';
44
+ export * as Menu from './menu/index.web';
45
+ export * as Tooltip from './tooltip/index.web';
46
+ export * as Select from './select/index.web';
47
+ export * as ContextMenu from './context-menu/index.web';
48
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +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,EA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U,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,kBAAkB,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Web variant of the Portal API.
3
+ *
4
+ * On native we keep the context-based portal group (the consumer mounts a
5
+ * `<Provider />` near the root and an `<Outlet />` to render portaled
6
+ * components inside the native view hierarchy). On web there's a stable
7
+ * `document.body`, so we portal directly there via `react-dom`'s native
8
+ * `createPortal` — no provider, no outlet, no setup. This matches how
9
+ * mature web component libraries (Radix, Mantine, Tamagui) ship their
10
+ * portals.
11
+ *
12
+ * The native and web APIs are kept identical: `Provider` and `Outlet` are
13
+ * still exported on web — they just become harmless no-op fragments so
14
+ * consumers that *do* mount them keep compiling.
15
+ */
16
+ import React from 'react';
17
+ export declare function Portal({ children }: React.PropsWithChildren<object>): React.ReactPortal | null;
18
+ export declare function Provider(props: React.PropsWithChildren<object>): import("react/jsx-runtime").JSX.Element;
19
+ export declare const Outlet: React.NamedExoticComponent<object>;
20
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/portal/index.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAoD,MAAM,OAAO,CAAC;AAyBzE,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,4BAOnE;AAKD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,2CAE9D;AAED,eAAO,MAAM,MAAM,oCAEjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/skeleton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAkB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAc,MAAM,cAAc,CAAC;AAiC1F,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,KAAK,GACN,EAAE;IACD,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,2CA0BA;yBAhCe,IAAI;;;AAmCpB,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CACjC,2CAmBA;yBA7Be,MAAM;;;AAgCtB,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,KAAK,EACL,KAAK,GACN,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IAC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AAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CACjC,2CAkBA;yBA1Be,IAAI;;;AA6BpB,wBAAgB,GAAG,CAAC,EAClB,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CACjC,2CAEA;yBARe,GAAG;;;AAWnB,wBAAgB,GAAG,CAAC,EAClB,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CACjC,2CAEA;yBARe,GAAG"}
@@ -2,4 +2,5 @@ export { atoms, flatten } from './atoms';
2
2
  export type { ViewStyleProp, TextStyleProp } from './atoms';
3
3
  export * as tokens from './tokens';
4
4
  export { web, native, ios, android, platform, select } from './platform';
5
+ export { SUPPORTS_NATIVE_DRIVER } from './native-driver';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/styles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/styles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const SUPPORTS_NATIVE_DRIVER: boolean;
2
+ //# sourceMappingURL=native-driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-driver.d.ts","sourceRoot":"","sources":["../../../../src/styles/native-driver.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,sBAAsB,SAAwB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/bloom",
3
- "version": "0.1.37",
3
+ "version": "0.2.1",
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",
@@ -14,6 +14,11 @@
14
14
  "exports": {
15
15
  ".": {
16
16
  "react-native": "./src/index.ts",
17
+ "browser": {
18
+ "types": "./lib/typescript/module/index.web.d.ts",
19
+ "import": "./lib/module/index.web.js",
20
+ "require": "./lib/commonjs/index.web.js"
21
+ },
17
22
  "import": {
18
23
  "types": "./lib/typescript/module/index.d.ts",
19
24
  "default": "./lib/module/index.js"
@@ -58,6 +63,11 @@
58
63
  },
59
64
  "./portal": {
60
65
  "react-native": "./src/portal/index.tsx",
66
+ "browser": {
67
+ "types": "./lib/typescript/module/portal/index.web.d.ts",
68
+ "import": "./lib/module/portal/index.web.js",
69
+ "require": "./lib/commonjs/portal/index.web.js"
70
+ },
61
71
  "import": {
62
72
  "types": "./lib/typescript/module/portal/index.d.ts",
63
73
  "default": "./lib/module/portal/index.js"
@@ -69,6 +79,11 @@
69
79
  },
70
80
  "./dialog": {
71
81
  "react-native": "./src/dialog/index.ts",
82
+ "browser": {
83
+ "types": "./lib/typescript/module/dialog/index.web.d.ts",
84
+ "import": "./lib/module/dialog/index.web.js",
85
+ "require": "./lib/commonjs/dialog/index.web.js"
86
+ },
72
87
  "import": {
73
88
  "types": "./lib/typescript/module/dialog/index.d.ts",
74
89
  "default": "./lib/module/dialog/index.js"
@@ -201,6 +216,11 @@
201
216
  },
202
217
  "./toast": {
203
218
  "react-native": "./src/toast/index.tsx",
219
+ "browser": {
220
+ "types": "./lib/typescript/module/toast/index.web.d.ts",
221
+ "import": "./lib/module/toast/index.web.js",
222
+ "require": "./lib/commonjs/toast/index.web.js"
223
+ },
204
224
  "import": {
205
225
  "types": "./lib/typescript/module/toast/index.d.ts",
206
226
  "default": "./lib/module/toast/index.js"
@@ -344,6 +364,11 @@
344
364
  },
345
365
  "./menu": {
346
366
  "react-native": "./src/menu/index.tsx",
367
+ "browser": {
368
+ "types": "./lib/typescript/module/menu/index.web.d.ts",
369
+ "import": "./lib/module/menu/index.web.js",
370
+ "require": "./lib/commonjs/menu/index.web.js"
371
+ },
347
372
  "import": {
348
373
  "types": "./lib/typescript/module/menu/index.d.ts",
349
374
  "default": "./lib/module/menu/index.js"
@@ -355,6 +380,11 @@
355
380
  },
356
381
  "./tooltip": {
357
382
  "react-native": "./src/tooltip/index.tsx",
383
+ "browser": {
384
+ "types": "./lib/typescript/module/tooltip/index.web.d.ts",
385
+ "import": "./lib/module/tooltip/index.web.js",
386
+ "require": "./lib/commonjs/tooltip/index.web.js"
387
+ },
358
388
  "import": {
359
389
  "types": "./lib/typescript/module/tooltip/index.d.ts",
360
390
  "default": "./lib/module/tooltip/index.js"
@@ -366,6 +396,11 @@
366
396
  },
367
397
  "./select": {
368
398
  "react-native": "./src/select/index.tsx",
399
+ "browser": {
400
+ "types": "./lib/typescript/module/select/index.web.d.ts",
401
+ "import": "./lib/module/select/index.web.js",
402
+ "require": "./lib/commonjs/select/index.web.js"
403
+ },
369
404
  "import": {
370
405
  "types": "./lib/typescript/module/select/index.d.ts",
371
406
  "default": "./lib/module/select/index.js"
@@ -388,6 +423,11 @@
388
423
  },
389
424
  "./context-menu": {
390
425
  "react-native": "./src/context-menu/index.tsx",
426
+ "browser": {
427
+ "types": "./lib/typescript/module/context-menu/index.web.d.ts",
428
+ "import": "./lib/module/context-menu/index.web.js",
429
+ "require": "./lib/commonjs/context-menu/index.web.js"
430
+ },
391
431
  "import": {
392
432
  "types": "./lib/typescript/module/context-menu/index.d.ts",
393
433
  "default": "./lib/module/context-menu/index.js"
@@ -523,6 +563,8 @@
523
563
  },
524
564
  "license": "MIT",
525
565
  "scripts": {
566
+ "generate:exports": "node scripts/generate-platform-exports.mjs",
567
+ "prebuild": "node scripts/generate-platform-exports.mjs",
526
568
  "build": "bob build",
527
569
  "test": "jest",
528
570
  "typescript": "tsc --noEmit",
@@ -535,9 +577,11 @@
535
577
  "@testing-library/react-native": "^13.3.3",
536
578
  "@types/jest": "^30.0.0",
537
579
  "@types/react": "~19.1.0",
580
+ "@types/react-dom": "^19.2.3",
538
581
  "@types/react-native": "*",
539
582
  "jest": "^30.3.0",
540
583
  "react": "19.2.0",
584
+ "react-dom": "19.2.0",
541
585
  "react-native": "0.83.2",
542
586
  "react-native-builder-bob": "^0.40.16",
543
587
  "react-native-gesture-handler": "^2.30.0",
@@ -554,6 +598,7 @@
554
598
  "peerDependencies": {
555
599
  "@gorhom/bottom-sheet": ">=5.0.0",
556
600
  "react": ">=18.0.0",
601
+ "react-dom": ">=18.0.0",
557
602
  "react-native": ">=0.73.0",
558
603
  "react-native-gesture-handler": ">=2.0.0",
559
604
  "react-native-reanimated": ">=3.0.0",
@@ -566,6 +611,9 @@
566
611
  "@gorhom/bottom-sheet": {
567
612
  "optional": true
568
613
  },
614
+ "react-dom": {
615
+ "optional": true
616
+ },
569
617
  "react-native-reanimated": {
570
618
  "optional": true
571
619
  },
@@ -3,6 +3,7 @@ import { View, Text, Pressable, Animated, type ViewStyle } from 'react-native';
3
3
 
4
4
  import { useTheme } from '../theme/use-theme';
5
5
  import { animation, borderRadius, space } from '../styles/tokens';
6
+ import { SUPPORTS_NATIVE_DRIVER } from '../styles/native-driver';
6
7
  import type {
7
8
  AccordionProps,
8
9
  AccordionItemProps,
@@ -135,7 +136,7 @@ const AccordionTriggerComponent: React.FC<AccordionTriggerProps> = ({
135
136
  useEffect(() => {
136
137
  Animated.spring(rotateAnim, {
137
138
  toValue: isExpanded ? 1 : 0,
138
- useNativeDriver: true,
139
+ useNativeDriver: SUPPORTS_NATIVE_DRIVER,
139
140
  ...animation.spring.snappy,
140
141
  }).start();
141
142
  }, [isExpanded, rotateAnim]);
@@ -3,6 +3,7 @@ import { View, Text, Pressable, Animated, type ViewStyle } from 'react-native';
3
3
 
4
4
  import { useTheme } from '../theme/use-theme';
5
5
  import { animation, borderRadius, space } from '../styles/tokens';
6
+ import { SUPPORTS_NATIVE_DRIVER } from '../styles/native-driver';
6
7
  import type { CheckboxProps } from './types';
7
8
 
8
9
  const SIZE_CONFIG = {
@@ -34,7 +35,7 @@ const CheckboxComponent: React.FC<CheckboxProps> = ({
34
35
  useEffect(() => {
35
36
  Animated.spring(scaleAnim, {
36
37
  toValue: checked || indeterminate ? 1 : 0,
37
- useNativeDriver: true,
38
+ useNativeDriver: SUPPORTS_NATIVE_DRIVER,
38
39
  ...animation.spring.snappy,
39
40
  }).start();
40
41
  }, [checked, indeterminate, scaleAnim]);
@@ -48,7 +49,7 @@ const CheckboxComponent: React.FC<CheckboxProps> = ({
48
49
  const onPressIn = useCallback(() => {
49
50
  Animated.spring(pressAnim, {
50
51
  toValue: 0.9,
51
- useNativeDriver: true,
52
+ useNativeDriver: SUPPORTS_NATIVE_DRIVER,
52
53
  ...animation.spring.snappy,
53
54
  }).start();
54
55
  }, [pressAnim]);
@@ -56,7 +57,7 @@ const CheckboxComponent: React.FC<CheckboxProps> = ({
56
57
  const onPressOut = useCallback(() => {
57
58
  Animated.spring(pressAnim, {
58
59
  toValue: 1,
59
- useNativeDriver: true,
60
+ useNativeDriver: SUPPORTS_NATIVE_DRIVER,
60
61
  ...animation.spring.gentle,
61
62
  }).start();
62
63
  }, [pressAnim]);
@@ -3,6 +3,7 @@ import { View, Text, TouchableOpacity, Animated, LayoutAnimation, Platform, UIMa
3
3
 
4
4
  import { useTheme } from '../theme/use-theme';
5
5
  import { animation } from '../styles/tokens';
6
+ import { SUPPORTS_NATIVE_DRIVER } from '../styles/native-driver';
6
7
  import type { CollapsibleProps } from './types';
7
8
 
8
9
  if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
@@ -31,7 +32,7 @@ const CollapsibleComponent: React.FC<CollapsibleProps> = ({
31
32
  // Animate chevron rotation in the event handler, not via useEffect
32
33
  Animated.spring(chevronAnim, {
33
34
  toValue: nextOpen ? 1 : 0,
34
- useNativeDriver: true,
35
+ useNativeDriver: SUPPORTS_NATIVE_DRIVER,
35
36
  ...animation.spring.gentle,
36
37
  }).start();
37
38
 
@@ -0,0 +1,14 @@
1
+ // Web variant of the `./dialog` barrel.
2
+ //
3
+ // The default barrel (`./index.ts`) re-exports from `./Dialog`, which on
4
+ // native uses `react-native-safe-area-context` and pulls in
5
+ // `@gorhom/bottom-sheet` via `lazyRequire`. The web fork (`./Dialog.web`)
6
+ // is a pure-DOM modal overlay that depends only on `react-remove-scroll-bar`
7
+ // and the in-package `Portal`.
8
+ //
9
+ // Web bundlers select this file via the `"browser"` condition in
10
+ // `package.json`'s `exports['./dialog']`; native bundlers fall through to
11
+ // the React Native build.
12
+ export { Outer, Inner, ScrollableInner, Handle, Close, Backdrop } from './Dialog.web';
13
+ export { useDialogContext, useDialogControl } from './context';
14
+ export type { DialogControlProps, DialogOuterProps, DialogInnerProps, DialogContextProps } from './types';
@@ -2,6 +2,7 @@ import { useCallback, useRef } from 'react';
2
2
  import { Animated } from 'react-native';
3
3
 
4
4
  import { animation } from '../styles/tokens';
5
+ import { SUPPORTS_NATIVE_DRIVER } from '../styles/native-driver';
5
6
 
6
7
  /**
7
8
  * Hook that provides press-scale animation feedback.
@@ -19,7 +20,7 @@ export function usePressAnimation(pressScale: number | undefined = 0.97) {
19
20
  if (!enabled) return;
20
21
  Animated.spring(scaleAnim, {
21
22
  toValue: pressScale!,
22
- useNativeDriver: true,
23
+ useNativeDriver: SUPPORTS_NATIVE_DRIVER,
23
24
  ...animation.spring.snappy,
24
25
  }).start();
25
26
  }, [scaleAnim, enabled, pressScale]);
@@ -28,7 +29,7 @@ export function usePressAnimation(pressScale: number | undefined = 0.97) {
28
29
  if (!enabled) return;
29
30
  Animated.spring(scaleAnim, {
30
31
  toValue: 1,
31
- useNativeDriver: true,
32
+ useNativeDriver: SUPPORTS_NATIVE_DRIVER,
32
33
  ...animation.spring.gentle,
33
34
  }).start();
34
35
  }, [scaleAnim, enabled]);
@@ -0,0 +1,75 @@
1
+ // AUTO-GENERATED by scripts/generate-platform-exports.mjs — DO NOT EDIT.
2
+ // Source of truth: src/index.ts.
3
+ // Re-run `bun run generate:exports` (or any `bun run build`) after
4
+ // changing the root barrel or the set of web-forked subpaths.
5
+
6
+ // Theme
7
+ export * from './theme';
8
+
9
+ // Styles & Utilities
10
+ export { atoms, flatten } from './styles';
11
+ export type { ViewStyleProp, TextStyleProp } from './styles';
12
+ export * as tokens from './styles/tokens';
13
+ export { web, native, ios, android, platform, select } from './styles/platform';
14
+
15
+ // Hooks
16
+ export { useInteractionState } from './hooks/useInteractionState';
17
+ export { useDelayedLoading } from './hooks/useDelayedLoading';
18
+ export { useThrottledValue } from './hooks/useThrottledValue';
19
+
20
+ // Icons
21
+ export * as Icons from './icons';
22
+ export { type Props as IconProps, sizes as iconSizes, useCommonSVGProps } from './icons/common';
23
+
24
+ // Core components
25
+ export * from './portal/index.web';
26
+ export * as Dialog from './dialog/index.web';
27
+ export * as Prompt from './prompt';
28
+ export * from './button';
29
+ export * from './grouped-buttons';
30
+ export * from './divider';
31
+ export * from './radio-indicator';
32
+ export * from './collapsible';
33
+ export { ErrorBoundary } from './error-boundary';
34
+ export type { ErrorBoundaryProps } from './error-boundary';
35
+ export * from './avatar';
36
+ export * from './loading';
37
+ export * as PromptInput from './prompt-input';
38
+ export * from './switch';
39
+ export * as Toast from './toast/index.web';
40
+
41
+ // Typography
42
+ export * as Typography from './typography';
43
+
44
+ // Layout primitives
45
+ export * as Skeleton from './skeleton';
46
+ export * as Grid from './grid';
47
+ export { Fill } from './fill';
48
+ export { IconCircle } from './icon-circle';
49
+
50
+ // Form components
51
+ export * as TextField from './text-field';
52
+ export * as SegmentedControl from './segmented-control';
53
+ export { SearchInput } from './search-input';
54
+
55
+ // Bottom sheet
56
+ export { BottomSheet } from './bottom-sheet';
57
+ export type { BottomSheetRef, BottomSheetProps } from './bottom-sheet';
58
+
59
+ // Data display
60
+ export * from './card';
61
+ export * from './badge';
62
+ export * from './chip';
63
+ export * as Tabs from './tabs';
64
+ export * from './checkbox';
65
+ export * as Accordion from './accordion';
66
+
67
+ // Settings / Grouped list
68
+ export * from './settings-list';
69
+
70
+ // Overlay components
71
+ export * as Admonition from './admonition';
72
+ export * as Menu from './menu/index.web';
73
+ export * as Tooltip from './tooltip/index.web';
74
+ export * as Select from './select/index.web';
75
+ export * as ContextMenu from './context-menu/index.web';
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Web variant of the Portal API.
3
+ *
4
+ * On native we keep the context-based portal group (the consumer mounts a
5
+ * `<Provider />` near the root and an `<Outlet />` to render portaled
6
+ * components inside the native view hierarchy). On web there's a stable
7
+ * `document.body`, so we portal directly there via `react-dom`'s native
8
+ * `createPortal` — no provider, no outlet, no setup. This matches how
9
+ * mature web component libraries (Radix, Mantine, Tamagui) ship their
10
+ * portals.
11
+ *
12
+ * The native and web APIs are kept identical: `Provider` and `Outlet` are
13
+ * still exported on web — they just become harmless no-op fragments so
14
+ * consumers that *do* mount them keep compiling.
15
+ */
16
+ import React, { Fragment, memo, useLayoutEffect, useState } from 'react';
17
+ import { createPortal } from 'react-dom';
18
+
19
+ /**
20
+ * Render children into a stable container at the end of `document.body`.
21
+ *
22
+ * Lazy-creates the container on first mount so SSR (where `document` does
23
+ * not exist) doesn't crash — the portal simply renders nothing on the
24
+ * server and snaps in on hydration.
25
+ */
26
+ function getPortalRoot(): HTMLElement | null {
27
+ if (typeof document === 'undefined') return null;
28
+ let root = document.getElementById('bloom-portal-root');
29
+ if (!root) {
30
+ root = document.createElement('div');
31
+ root.id = 'bloom-portal-root';
32
+ // Sits above the document flow; individual portaled components can use
33
+ // their own z-index for stacking among themselves.
34
+ root.style.position = 'relative';
35
+ root.style.zIndex = '999999';
36
+ document.body.appendChild(root);
37
+ }
38
+ return root;
39
+ }
40
+
41
+ export function Portal({ children }: React.PropsWithChildren<object>) {
42
+ const [root, setRoot] = useState<HTMLElement | null>(null);
43
+ useLayoutEffect(() => {
44
+ setRoot(getPortalRoot());
45
+ }, []);
46
+ if (!root) return null;
47
+ return createPortal(children, root);
48
+ }
49
+
50
+ // Native API parity — on web these are inert. Provider mounts its children
51
+ // inline; Outlet renders nothing. Consumers that mount them on web keep
52
+ // compiling without behaviour change.
53
+ export function Provider(props: React.PropsWithChildren<object>) {
54
+ return <Fragment>{props.children}</Fragment>;
55
+ }
56
+
57
+ export const Outlet = memo(function Outlet() {
58
+ return null;
59
+ });
@@ -2,6 +2,7 @@ import React, { useEffect, useRef } from 'react';
2
2
  import { Animated, View, type ViewStyle, type TextStyle, StyleSheet } from 'react-native';
3
3
 
4
4
  import { useTheme } from '../theme/use-theme';
5
+ import { SUPPORTS_NATIVE_DRIVER } from '../styles/native-driver';
5
6
 
6
7
  const SHIMMER_DURATION = 1500;
7
8
  const SHIMMER_MIN_OPACITY = 0.4;
@@ -16,12 +17,12 @@ function useShimmer() {
16
17
  Animated.timing(opacity, {
17
18
  toValue: SHIMMER_MIN_OPACITY,
18
19
  duration: SHIMMER_DURATION / 2,
19
- useNativeDriver: true,
20
+ useNativeDriver: SUPPORTS_NATIVE_DRIVER,
20
21
  }),
21
22
  Animated.timing(opacity, {
22
23
  toValue: SHIMMER_MAX_OPACITY,
23
24
  duration: SHIMMER_DURATION / 2,
24
- useNativeDriver: true,
25
+ useNativeDriver: SUPPORTS_NATIVE_DRIVER,
25
26
  }),
26
27
  ]),
27
28
  );
@@ -2,3 +2,4 @@ export { atoms, flatten } from './atoms';
2
2
  export type { ViewStyleProp, TextStyleProp } from './atoms';
3
3
  export * as tokens from './tokens';
4
4
  export { web, native, ios, android, platform, select } from './platform';
5
+ export { SUPPORTS_NATIVE_DRIVER } from './native-driver';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Whether the running React Native target supports `Animated`'s native
3
+ * driver. On real native (`Platform.OS === 'ios' | 'android'`) it does,
4
+ * and animations can run on the UI thread off the JS thread. On
5
+ * `react-native-web` there is no native driver — opting in logs a
6
+ * runtime warning every time, with no performance benefit.
7
+ *
8
+ * Use this constant instead of hardcoding `useNativeDriver: true` so
9
+ * Bloom components animate smoothly on every platform and stay silent in
10
+ * web consoles.
11
+ *
12
+ * Resolved once at module load.
13
+ */
14
+ import { Platform } from 'react-native';
15
+
16
+ export const SUPPORTS_NATIVE_DRIVER = Platform.OS !== 'web';
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getAdaptiveColors = getAdaptiveColors;
7
- function getAdaptiveColors() {
8
- return null;
9
- }
10
- //# sourceMappingURL=adaptive-colors.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getAdaptiveColors"],"sourceRoot":"../../../src","sources":["theme/adaptive-colors.web.ts"],"mappings":";;;;;;AAEO,SAASA,iBAAiBA,CAAA,EAAuB;EACtD,OAAO,IAAI;AACb","ignoreList":[]}
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- export function getAdaptiveColors() {
4
- return null;
5
- }
6
- //# sourceMappingURL=adaptive-colors.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getAdaptiveColors"],"sourceRoot":"../../../src","sources":["theme/adaptive-colors.web.ts"],"mappings":";;AAEA,OAAO,SAASA,iBAAiBA,CAAA,EAAuB;EACtD,OAAO,IAAI;AACb","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { ThemeColors } from './types';
2
- export declare function getAdaptiveColors(): ThemeColors | null;
3
- //# sourceMappingURL=adaptive-colors.web.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adaptive-colors.web.d.ts","sourceRoot":"","sources":["../../../../src/theme/adaptive-colors.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,iBAAiB,IAAI,WAAW,GAAG,IAAI,CAEtD"}
@@ -1,3 +0,0 @@
1
- import type { ThemeColors } from './types';
2
- export declare function getAdaptiveColors(): ThemeColors | null;
3
- //# sourceMappingURL=adaptive-colors.web.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adaptive-colors.web.d.ts","sourceRoot":"","sources":["../../../../src/theme/adaptive-colors.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,iBAAiB,IAAI,WAAW,GAAG,IAAI,CAEtD"}
@@ -1,5 +0,0 @@
1
- import type { ThemeColors } from './types';
2
-
3
- export function getAdaptiveColors(): ThemeColors | null {
4
- return null;
5
- }