@oxyhq/bloom 0.16.2 → 0.18.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 (264) hide show
  1. package/README.md +54 -16
  2. package/lib/commonjs/admonition/index.js +24 -23
  3. package/lib/commonjs/admonition/index.js.map +1 -1
  4. package/lib/commonjs/combobox/Combobox.js +7 -7
  5. package/lib/commonjs/combobox/Combobox.js.map +1 -1
  6. package/lib/commonjs/context-menu/context.js +2 -2
  7. package/lib/commonjs/context-menu/context.js.map +1 -1
  8. package/lib/commonjs/context-menu/index.js +25 -25
  9. package/lib/commonjs/context-menu/index.js.map +1 -1
  10. package/lib/commonjs/context-menu/index.web.js +27 -27
  11. package/lib/commonjs/context-menu/index.web.js.map +1 -1
  12. package/lib/commonjs/dialog/SheetShell.js +1 -1
  13. package/lib/commonjs/index.js +134 -38
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/index.web.js +134 -38
  16. package/lib/commonjs/index.web.js.map +1 -1
  17. package/lib/commonjs/input-group/InputGroup.js +1 -1
  18. package/lib/commonjs/menu/context.js +2 -2
  19. package/lib/commonjs/menu/context.js.map +1 -1
  20. package/lib/commonjs/menu/index.js +17 -17
  21. package/lib/commonjs/menu/index.js.map +1 -1
  22. package/lib/commonjs/menu/index.web.js +16 -16
  23. package/lib/commonjs/menu/index.web.js.map +1 -1
  24. package/lib/commonjs/popover/context.js +1 -1
  25. package/lib/commonjs/popover/context.js.map +1 -1
  26. package/lib/commonjs/popover/index.js +6 -6
  27. package/lib/commonjs/popover/index.js.map +1 -1
  28. package/lib/commonjs/popover/index.web.js +6 -6
  29. package/lib/commonjs/popover/index.web.js.map +1 -1
  30. package/lib/commonjs/search-input/index.js +4 -5
  31. package/lib/commonjs/search-input/index.js.map +1 -1
  32. package/lib/commonjs/segmented-control/index.js +18 -18
  33. package/lib/commonjs/segmented-control/index.js.map +1 -1
  34. package/lib/commonjs/select/common.js +2 -2
  35. package/lib/commonjs/select/common.js.map +1 -1
  36. package/lib/commonjs/select/index.js +34 -38
  37. package/lib/commonjs/select/index.js.map +1 -1
  38. package/lib/commonjs/select/index.web.js +31 -35
  39. package/lib/commonjs/select/index.web.js.map +1 -1
  40. package/lib/commonjs/tabs/Tabs.js +7 -7
  41. package/lib/commonjs/tabs/Tabs.js.map +1 -1
  42. package/lib/commonjs/tabs/index.js +6 -6
  43. package/lib/commonjs/text-field/index.js +14 -14
  44. package/lib/commonjs/text-field/index.js.map +1 -1
  45. package/lib/commonjs/theme/color-scope/style-builder.js +6 -6
  46. package/lib/commonjs/theme/index.js +7 -0
  47. package/lib/commonjs/theme/index.js.map +1 -1
  48. package/lib/commonjs/theme/use-navigation-theme.js +54 -0
  49. package/lib/commonjs/theme/use-navigation-theme.js.map +1 -0
  50. package/lib/commonjs/tooltip/index.js +11 -11
  51. package/lib/commonjs/tooltip/index.js.map +1 -1
  52. package/lib/commonjs/tooltip/index.web.js +11 -11
  53. package/lib/commonjs/tooltip/index.web.js.map +1 -1
  54. package/lib/module/admonition/index.js +18 -17
  55. package/lib/module/admonition/index.js.map +1 -1
  56. package/lib/module/combobox/Combobox.js +7 -7
  57. package/lib/module/combobox/Combobox.js.map +1 -1
  58. package/lib/module/context-menu/context.js +2 -2
  59. package/lib/module/context-menu/context.js.map +1 -1
  60. package/lib/module/context-menu/index.js +17 -17
  61. package/lib/module/context-menu/index.js.map +1 -1
  62. package/lib/module/context-menu/index.web.js +19 -19
  63. package/lib/module/context-menu/index.web.js.map +1 -1
  64. package/lib/module/dialog/SheetShell.js +1 -1
  65. package/lib/module/index.js +11 -11
  66. package/lib/module/index.js.map +1 -1
  67. package/lib/module/index.web.js +11 -11
  68. package/lib/module/index.web.js.map +1 -1
  69. package/lib/module/input-group/InputGroup.js +1 -1
  70. package/lib/module/menu/context.js +2 -2
  71. package/lib/module/menu/context.js.map +1 -1
  72. package/lib/module/menu/index.js +9 -9
  73. package/lib/module/menu/index.js.map +1 -1
  74. package/lib/module/menu/index.web.js +8 -8
  75. package/lib/module/menu/index.web.js.map +1 -1
  76. package/lib/module/popover/context.js +1 -1
  77. package/lib/module/popover/context.js.map +1 -1
  78. package/lib/module/popover/index.js +3 -3
  79. package/lib/module/popover/index.js.map +1 -1
  80. package/lib/module/popover/index.web.js +3 -3
  81. package/lib/module/popover/index.web.js.map +1 -1
  82. package/lib/module/search-input/index.js +4 -4
  83. package/lib/module/search-input/index.js.map +1 -1
  84. package/lib/module/segmented-control/index.js +15 -15
  85. package/lib/module/segmented-control/index.js.map +1 -1
  86. package/lib/module/select/common.js +1 -1
  87. package/lib/module/select/common.js.map +1 -1
  88. package/lib/module/select/index.js +25 -29
  89. package/lib/module/select/index.js.map +1 -1
  90. package/lib/module/select/index.web.js +22 -26
  91. package/lib/module/select/index.web.js.map +1 -1
  92. package/lib/module/tabs/Tabs.js +6 -6
  93. package/lib/module/tabs/Tabs.js.map +1 -1
  94. package/lib/module/tabs/index.js +1 -1
  95. package/lib/module/tabs/index.js.map +1 -1
  96. package/lib/module/text-field/index.js +8 -8
  97. package/lib/module/text-field/index.js.map +1 -1
  98. package/lib/module/theme/color-scope/style-builder.js +6 -6
  99. package/lib/module/theme/index.js +1 -0
  100. package/lib/module/theme/index.js.map +1 -1
  101. package/lib/module/theme/use-navigation-theme.js +50 -0
  102. package/lib/module/theme/use-navigation-theme.js.map +1 -0
  103. package/lib/module/tooltip/index.js +6 -6
  104. package/lib/module/tooltip/index.js.map +1 -1
  105. package/lib/module/tooltip/index.web.js +6 -6
  106. package/lib/module/tooltip/index.web.js.map +1 -1
  107. package/lib/typescript/commonjs/admonition/index.d.ts +14 -13
  108. package/lib/typescript/commonjs/admonition/index.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/combobox/Combobox.d.ts +7 -7
  110. package/lib/typescript/commonjs/combobox/Combobox.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/context-menu/index.d.ts +9 -9
  112. package/lib/typescript/commonjs/context-menu/index.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/context-menu/index.web.d.ts +9 -9
  114. package/lib/typescript/commonjs/context-menu/index.web.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/context-menu/types.d.ts +6 -6
  116. package/lib/typescript/commonjs/context-menu/types.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/dialog/SheetShell.d.ts +1 -1
  118. package/lib/typescript/commonjs/index.d.ts +11 -11
  119. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/index.web.d.ts +11 -11
  121. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/input-group/types.d.ts +1 -1
  123. package/lib/typescript/commonjs/menu/index.d.ts +9 -9
  124. package/lib/typescript/commonjs/menu/index.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/menu/index.web.d.ts +9 -9
  126. package/lib/typescript/commonjs/menu/index.web.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/menu/types.d.ts +5 -5
  128. package/lib/typescript/commonjs/menu/types.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/popover/index.d.ts +5 -5
  130. package/lib/typescript/commonjs/popover/index.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/popover/index.web.d.ts +5 -5
  132. package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/popover/types.d.ts +1 -1
  134. package/lib/typescript/commonjs/popover/types.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/search-input/index.d.ts +3 -3
  136. package/lib/typescript/commonjs/search-input/index.d.ts.map +1 -1
  137. package/lib/typescript/commonjs/segmented-control/index.d.ts +13 -13
  138. package/lib/typescript/commonjs/segmented-control/index.d.ts.map +1 -1
  139. package/lib/typescript/commonjs/select/common.d.ts +1 -1
  140. package/lib/typescript/commonjs/select/common.d.ts.map +1 -1
  141. package/lib/typescript/commonjs/select/index.d.ts +12 -12
  142. package/lib/typescript/commonjs/select/index.d.ts.map +1 -1
  143. package/lib/typescript/commonjs/select/index.web.d.ts +12 -12
  144. package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
  145. package/lib/typescript/commonjs/select/types.d.ts +10 -10
  146. package/lib/typescript/commonjs/select/types.d.ts.map +1 -1
  147. package/lib/typescript/commonjs/tabs/Tabs.d.ts +4 -4
  148. package/lib/typescript/commonjs/tabs/Tabs.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/tabs/index.d.ts +2 -2
  150. package/lib/typescript/commonjs/tabs/index.d.ts.map +1 -1
  151. package/lib/typescript/commonjs/tabs/types.d.ts +3 -3
  152. package/lib/typescript/commonjs/tabs/types.d.ts.map +1 -1
  153. package/lib/typescript/commonjs/text-field/index.d.ts +8 -8
  154. package/lib/typescript/commonjs/text-field/index.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts +6 -6
  156. package/lib/typescript/commonjs/theme/index.d.ts +2 -0
  157. package/lib/typescript/commonjs/theme/index.d.ts.map +1 -1
  158. package/lib/typescript/commonjs/theme/use-navigation-theme.d.ts +31 -0
  159. package/lib/typescript/commonjs/theme/use-navigation-theme.d.ts.map +1 -0
  160. package/lib/typescript/commonjs/tooltip/index.d.ts +6 -6
  161. package/lib/typescript/commonjs/tooltip/index.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/tooltip/index.web.d.ts +6 -6
  163. package/lib/typescript/commonjs/tooltip/index.web.d.ts.map +1 -1
  164. package/lib/typescript/module/admonition/index.d.ts +14 -13
  165. package/lib/typescript/module/admonition/index.d.ts.map +1 -1
  166. package/lib/typescript/module/combobox/Combobox.d.ts +7 -7
  167. package/lib/typescript/module/combobox/Combobox.d.ts.map +1 -1
  168. package/lib/typescript/module/context-menu/index.d.ts +9 -9
  169. package/lib/typescript/module/context-menu/index.d.ts.map +1 -1
  170. package/lib/typescript/module/context-menu/index.web.d.ts +9 -9
  171. package/lib/typescript/module/context-menu/index.web.d.ts.map +1 -1
  172. package/lib/typescript/module/context-menu/types.d.ts +6 -6
  173. package/lib/typescript/module/context-menu/types.d.ts.map +1 -1
  174. package/lib/typescript/module/dialog/SheetShell.d.ts +1 -1
  175. package/lib/typescript/module/index.d.ts +11 -11
  176. package/lib/typescript/module/index.d.ts.map +1 -1
  177. package/lib/typescript/module/index.web.d.ts +11 -11
  178. package/lib/typescript/module/index.web.d.ts.map +1 -1
  179. package/lib/typescript/module/input-group/types.d.ts +1 -1
  180. package/lib/typescript/module/menu/index.d.ts +9 -9
  181. package/lib/typescript/module/menu/index.d.ts.map +1 -1
  182. package/lib/typescript/module/menu/index.web.d.ts +9 -9
  183. package/lib/typescript/module/menu/index.web.d.ts.map +1 -1
  184. package/lib/typescript/module/menu/types.d.ts +5 -5
  185. package/lib/typescript/module/menu/types.d.ts.map +1 -1
  186. package/lib/typescript/module/popover/index.d.ts +5 -5
  187. package/lib/typescript/module/popover/index.d.ts.map +1 -1
  188. package/lib/typescript/module/popover/index.web.d.ts +5 -5
  189. package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
  190. package/lib/typescript/module/popover/types.d.ts +1 -1
  191. package/lib/typescript/module/popover/types.d.ts.map +1 -1
  192. package/lib/typescript/module/search-input/index.d.ts +3 -3
  193. package/lib/typescript/module/search-input/index.d.ts.map +1 -1
  194. package/lib/typescript/module/segmented-control/index.d.ts +13 -13
  195. package/lib/typescript/module/segmented-control/index.d.ts.map +1 -1
  196. package/lib/typescript/module/select/common.d.ts +1 -1
  197. package/lib/typescript/module/select/common.d.ts.map +1 -1
  198. package/lib/typescript/module/select/index.d.ts +12 -12
  199. package/lib/typescript/module/select/index.d.ts.map +1 -1
  200. package/lib/typescript/module/select/index.web.d.ts +12 -12
  201. package/lib/typescript/module/select/index.web.d.ts.map +1 -1
  202. package/lib/typescript/module/select/types.d.ts +10 -10
  203. package/lib/typescript/module/select/types.d.ts.map +1 -1
  204. package/lib/typescript/module/tabs/Tabs.d.ts +4 -4
  205. package/lib/typescript/module/tabs/Tabs.d.ts.map +1 -1
  206. package/lib/typescript/module/tabs/index.d.ts +2 -2
  207. package/lib/typescript/module/tabs/index.d.ts.map +1 -1
  208. package/lib/typescript/module/tabs/types.d.ts +3 -3
  209. package/lib/typescript/module/tabs/types.d.ts.map +1 -1
  210. package/lib/typescript/module/text-field/index.d.ts +8 -8
  211. package/lib/typescript/module/text-field/index.d.ts.map +1 -1
  212. package/lib/typescript/module/theme/color-scope/style-builder.d.ts +6 -6
  213. package/lib/typescript/module/theme/index.d.ts +2 -0
  214. package/lib/typescript/module/theme/index.d.ts.map +1 -1
  215. package/lib/typescript/module/theme/use-navigation-theme.d.ts +31 -0
  216. package/lib/typescript/module/theme/use-navigation-theme.d.ts.map +1 -0
  217. package/lib/typescript/module/tooltip/index.d.ts +6 -6
  218. package/lib/typescript/module/tooltip/index.d.ts.map +1 -1
  219. package/lib/typescript/module/tooltip/index.web.d.ts +6 -6
  220. package/lib/typescript/module/tooltip/index.web.d.ts.map +1 -1
  221. package/package.json +1 -1
  222. package/src/__tests__/public-api-contract.test.ts +54 -0
  223. package/src/__tests__/useNavigationTheme.test.tsx +227 -0
  224. package/src/admonition/index.tsx +22 -21
  225. package/src/combobox/Combobox.tsx +14 -14
  226. package/src/context-menu/ContextMenu.stories.tsx +26 -18
  227. package/src/context-menu/context.ts +2 -2
  228. package/src/context-menu/index.tsx +24 -24
  229. package/src/context-menu/index.web.tsx +26 -26
  230. package/src/context-menu/types.ts +6 -6
  231. package/src/dialog/SheetShell.tsx +1 -1
  232. package/src/field/Field.stories.tsx +3 -3
  233. package/src/index.ts +11 -11
  234. package/src/index.web.ts +11 -11
  235. package/src/input-group/InputGroup.stories.tsx +4 -4
  236. package/src/input-group/InputGroup.tsx +1 -1
  237. package/src/input-group/types.ts +1 -1
  238. package/src/menu/Menu.stories.tsx +35 -35
  239. package/src/menu/context.ts +2 -2
  240. package/src/menu/index.tsx +15 -15
  241. package/src/menu/index.web.tsx +14 -14
  242. package/src/menu/types.ts +5 -5
  243. package/src/popover/Popover.stories.tsx +13 -13
  244. package/src/popover/context.ts +1 -1
  245. package/src/popover/index.tsx +5 -5
  246. package/src/popover/index.web.tsx +5 -5
  247. package/src/popover/types.ts +1 -1
  248. package/src/search-input/index.tsx +7 -7
  249. package/src/segmented-control/index.tsx +15 -15
  250. package/src/select/Select.stories.tsx +32 -23
  251. package/src/select/common.ts +1 -1
  252. package/src/select/index.tsx +39 -43
  253. package/src/select/index.web.tsx +33 -37
  254. package/src/select/types.ts +10 -10
  255. package/src/tabs/Tabs.tsx +9 -9
  256. package/src/tabs/index.ts +2 -2
  257. package/src/tabs/types.ts +3 -3
  258. package/src/text-field/TextField.stories.tsx +5 -5
  259. package/src/text-field/index.tsx +12 -12
  260. package/src/theme/color-scope/style-builder.ts +6 -6
  261. package/src/theme/index.ts +2 -0
  262. package/src/theme/use-navigation-theme.ts +59 -0
  263. package/src/tooltip/index.tsx +6 -6
  264. package/src/tooltip/index.web.tsx +6 -6
package/src/tabs/types.ts CHANGED
@@ -9,13 +9,13 @@ export interface TabsProps {
9
9
  onValueChange: (value: string) => void;
10
10
  /** Visual variant for the tab bar. */
11
11
  variant?: TabsVariant;
12
- /** The tab items. Must be Tab components. */
12
+ /** The tab items. Must be TabsTrigger components. */
13
13
  children: React.ReactNode;
14
14
  style?: StyleProp<ViewStyle>;
15
15
  testID?: string;
16
16
  }
17
17
 
18
- export interface TabProps {
18
+ export interface TabsTriggerProps {
19
19
  /** Unique value identifying this tab. */
20
20
  value: string;
21
21
  /** Tab label text. */
@@ -28,7 +28,7 @@ export interface TabProps {
28
28
  textStyle?: StyleProp<TextStyle>;
29
29
  }
30
30
 
31
- export interface TabPanelProps {
31
+ export interface TabsContentProps {
32
32
  /** The tab value this panel corresponds to. */
33
33
  value: string;
34
34
  /** Panel content. */
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
2
2
  import { View } from 'react-native';
3
3
  import type { Meta, StoryObj } from '@storybook/react-vite';
4
4
 
5
- import * as TextField from './index';
5
+ import { TextField, TextFieldInput, TextFieldLabel } from './index';
6
6
 
7
7
  const meta: Meta = {
8
8
  title: 'Components/TextField',
@@ -28,9 +28,9 @@ function ControlledField({
28
28
  const [value, setValue] = useState(initial);
29
29
  return (
30
30
  <View style={{ width: 320 }}>
31
- <TextField.LabelText>{label}</TextField.LabelText>
32
- <TextField.Root isInvalid={isInvalid}>
33
- <TextField.Input
31
+ <TextFieldLabel>{label}</TextFieldLabel>
32
+ <TextField isInvalid={isInvalid}>
33
+ <TextFieldInput
34
34
  label={label}
35
35
  placeholder={placeholder}
36
36
  value={value}
@@ -38,7 +38,7 @@ function ControlledField({
38
38
  editable={editable}
39
39
  isInvalid={isInvalid}
40
40
  />
41
- </TextField.Root>
41
+ </TextField>
42
42
  </View>
43
43
  );
44
44
  }
@@ -46,11 +46,11 @@ const Context = createContext<{
46
46
  });
47
47
  Context.displayName = 'TextFieldContext';
48
48
 
49
- export type RootProps = React.PropsWithChildren<
49
+ export type TextFieldProps = React.PropsWithChildren<
50
50
  { isInvalid?: boolean } & ViewStyleProp
51
51
  >;
52
52
 
53
- export function Root({ children, isInvalid = false, style }: RootProps) {
53
+ export function TextField({ children, isInvalid = false, style }: TextFieldProps) {
54
54
  const inputRef = useRef<TextInput>(null);
55
55
  const {
56
56
  state: hovered,
@@ -122,7 +122,7 @@ export function useSharedInputStyles() {
122
122
  }, [theme]);
123
123
  }
124
124
 
125
- export type InputProps = Omit<
125
+ export type TextFieldInputProps = Omit<
126
126
  TextInputProps,
127
127
  'value' | 'onChangeText' | 'placeholder'
128
128
  > & {
@@ -134,7 +134,7 @@ export type InputProps = Omit<
134
134
  placeholder?: string | null | undefined;
135
135
  };
136
136
 
137
- export function Input({
137
+ export function TextFieldInput({
138
138
  label,
139
139
  placeholder,
140
140
  value,
@@ -145,7 +145,7 @@ export function Input({
145
145
  inputRef,
146
146
  style,
147
147
  ...rest
148
- }: InputProps) {
148
+ }: TextFieldInputProps) {
149
149
  const theme = useTheme();
150
150
  const ctx = useContext(Context);
151
151
  const withinRoot = Boolean(ctx.inputRef);
@@ -155,8 +155,8 @@ export function Input({
155
155
 
156
156
  if (!withinRoot) {
157
157
  return (
158
- <Root isInvalid={isInvalid}>
159
- <Input
158
+ <TextField isInvalid={isInvalid}>
159
+ <TextFieldInput
160
160
  label={label}
161
161
  placeholder={placeholder}
162
162
  value={value}
@@ -164,7 +164,7 @@ export function Input({
164
164
  isInvalid={isInvalid}
165
165
  {...rest}
166
166
  />
167
- </Root>
167
+ </TextField>
168
168
  );
169
169
  }
170
170
 
@@ -246,7 +246,7 @@ export function Input({
246
246
  );
247
247
  }
248
248
 
249
- export function LabelText({
249
+ export function TextFieldLabel({
250
250
  nativeID,
251
251
  children,
252
252
  }: React.PropsWithChildren<{ nativeID?: string }>) {
@@ -265,7 +265,7 @@ export function LabelText({
265
265
  );
266
266
  }
267
267
 
268
- export function Icon({ icon: Comp }: { icon: React.ComponentType<SVGIconProps> }) {
268
+ export function TextFieldIcon({ icon: Comp }: { icon: React.ComponentType<SVGIconProps> }) {
269
269
  const theme = useTheme();
270
270
  const ctx = useContext(Context);
271
271
 
@@ -297,7 +297,7 @@ export function Icon({ icon: Comp }: { icon: React.ComponentType<SVGIconProps> }
297
297
  );
298
298
  }
299
299
 
300
- export function SuffixText({
300
+ export function TextFieldSuffix({
301
301
  children,
302
302
  label,
303
303
  accessibilityHint,
@@ -330,7 +330,7 @@ export function SuffixText({
330
330
  );
331
331
  }
332
332
 
333
- export function GhostText({
333
+ export function TextFieldGhost({
334
334
  children,
335
335
  value,
336
336
  }: {
@@ -76,12 +76,12 @@ export function getVariableContextProvider(): VariableContextProviderComponent |
76
76
  * provider writes vars to `documentElement` instead) or when `nativewind` is
77
77
  * not installed.
78
78
  *
79
- * @deprecated Under react-native-css@3, `vars()` only propagates to a subtree
80
- * when applied to an interop className component (the runtime gates propagation
81
- * on matched className style rules). Applied to a plain `<View>` the vars are
82
- * dropped silently. Prefer wrapping children in `getVariableContextProvider()`.
83
- * Retained only as the escape-hatch contract of `useColorScopeStyle`, where the
84
- * caller owns the host element and is expected to be a className component.
79
+ * Caveat prefer `getVariableContextProvider()`: under react-native-css@3,
80
+ * `vars()` only propagates to a subtree when applied to an interop className
81
+ * component (the runtime gates propagation on matched className style rules).
82
+ * Applied to a plain `<View>` the vars are dropped silently. This is retained
83
+ * as the escape-hatch contract of `useColorScopeStyle`, where the caller owns
84
+ * the host element and is expected to be a className component.
85
85
  */
86
86
  export function buildNativePresetStyle(
87
87
  colorPreset: AppColorName,
@@ -7,6 +7,8 @@ export { BloomColorScope, useColorScopeStyle } from './color-scope';
7
7
  export type { BloomColorScopeProps } from './color-scope';
8
8
  export { buildTheme, STATUS_COLORS } from './build-theme';
9
9
  export { useTheme, useThemeColor, useBloomTheme } from './use-theme';
10
+ export { useNavigationTheme } from './use-navigation-theme';
11
+ export type { NavigationTheme, NavigationThemeFont } from './use-navigation-theme';
10
12
  export type { Theme, ThemeColors, ThemeMode } from './types';
11
13
  export type { AppColorName, AppColorPreset, PresetTokens } from './color-presets';
12
14
  export {
@@ -0,0 +1,59 @@
1
+ import { useMemo } from 'react';
2
+ import { useTheme } from './use-theme';
3
+
4
+ export interface NavigationThemeFont {
5
+ fontFamily: string;
6
+ fontWeight: '400' | '500' | '700' | '900';
7
+ }
8
+
9
+ export interface NavigationTheme {
10
+ dark: boolean;
11
+ colors: {
12
+ primary: string;
13
+ background: string;
14
+ card: string;
15
+ text: string;
16
+ border: string;
17
+ notification: string;
18
+ };
19
+ fonts: {
20
+ regular: NavigationThemeFont;
21
+ medium: NavigationThemeFont;
22
+ bold: NavigationThemeFont;
23
+ heavy: NavigationThemeFont;
24
+ };
25
+ }
26
+
27
+ const NAV_FONTS: NavigationTheme['fonts'] = {
28
+ regular: { fontFamily: 'System', fontWeight: '400' },
29
+ medium: { fontFamily: 'System', fontWeight: '500' },
30
+ bold: { fontFamily: 'System', fontWeight: '700' },
31
+ heavy: { fontFamily: 'System', fontWeight: '900' },
32
+ };
33
+
34
+ /**
35
+ * Projects Bloom's resolved theme into a react-navigation `Theme` POJO for
36
+ * expo-router's <ThemeProvider>. Keeps Bloom the single source of truth for
37
+ * navigator chrome (Stack headers, screen backgrounds, modal) so it tracks
38
+ * the active color preset. Returns a structural object — no react-navigation
39
+ * import — so Bloom stays decoupled. Replaces the per-app copies in
40
+ * test-app-expo / inbox / accounts.
41
+ */
42
+ export function useNavigationTheme(): NavigationTheme {
43
+ const { mode, colors } = useTheme();
44
+ return useMemo(
45
+ () => ({
46
+ dark: mode === 'dark',
47
+ colors: {
48
+ primary: colors.primary,
49
+ background: colors.background,
50
+ card: colors.card,
51
+ text: colors.text,
52
+ border: colors.border,
53
+ notification: colors.error,
54
+ },
55
+ fonts: NAV_FONTS,
56
+ }),
57
+ [mode, colors],
58
+ );
59
+ }
@@ -72,16 +72,16 @@ TargetContext.displayName = 'TargetContext';
72
72
  *
73
73
  * Only really necessary on iOS but can work on Android.
74
74
  */
75
- export function SheetCompatProvider({
75
+ export function TooltipSheetCompatProvider({
76
76
  children,
77
77
  }: {
78
78
  children: React.ReactNode;
79
79
  }) {
80
80
  return <>{children}</>;
81
81
  }
82
- SheetCompatProvider.displayName = 'TooltipSheetCompatProvider';
82
+ TooltipSheetCompatProvider.displayName = 'TooltipSheetCompatProvider';
83
83
 
84
- export function Outer({
84
+ export function Tooltip({
85
85
  children,
86
86
  position = 'bottom',
87
87
  visible: requestVisible,
@@ -131,7 +131,7 @@ export function Outer({
131
131
  );
132
132
  }
133
133
 
134
- export function Target({ children }: { children: React.ReactNode }) {
134
+ export function TooltipTrigger({ children }: { children: React.ReactNode }) {
135
135
  const { shouldMeasure, setTargetMeasurements } = useContext(TargetContext);
136
136
  const [hasLayedOut, setHasLayedOut] = useState(false);
137
137
  const targetRef = useRef<View>(null);
@@ -156,7 +156,7 @@ export function Target({ children }: { children: React.ReactNode }) {
156
156
  );
157
157
  }
158
158
 
159
- export function Content({
159
+ export function TooltipContent({
160
160
  children,
161
161
  label,
162
162
  }: {
@@ -390,4 +390,4 @@ function opposite(position: 'top' | 'bottom'): string {
390
390
  }
391
391
  }
392
392
 
393
- export const TextBubble = createTextBubble(Content);
393
+ export const TooltipTextBubble = createTextBubble(TooltipContent);
@@ -27,16 +27,16 @@ TooltipContext.displayName = 'TooltipContext';
27
27
  /**
28
28
  * No-op on web. Portal Provider is only needed on native.
29
29
  */
30
- export function SheetCompatProvider({
30
+ export function TooltipSheetCompatProvider({
31
31
  children,
32
32
  }: {
33
33
  children: React.ReactNode;
34
34
  }) {
35
35
  return <>{children}</>;
36
36
  }
37
- SheetCompatProvider.displayName = 'TooltipSheetCompatProvider';
37
+ TooltipSheetCompatProvider.displayName = 'TooltipSheetCompatProvider';
38
38
 
39
- export function Outer({
39
+ export function Tooltip({
40
40
  children,
41
41
  position = 'bottom',
42
42
  visible,
@@ -66,7 +66,7 @@ export function Outer({
66
66
  );
67
67
  }
68
68
 
69
- export function Target({ children }: { children: React.ReactNode }) {
69
+ export function TooltipTrigger({ children }: { children: React.ReactNode }) {
70
70
  return (
71
71
  <View collapsable={false} style={a.relative}>
72
72
  {children}
@@ -74,7 +74,7 @@ export function Target({ children }: { children: React.ReactNode }) {
74
74
  );
75
75
  }
76
76
 
77
- export function Content({
77
+ export function TooltipContent({
78
78
  children,
79
79
  label,
80
80
  }: {
@@ -146,7 +146,7 @@ export function Content({
146
146
  );
147
147
  }
148
148
 
149
- export const TextBubble = createTextBubble(Content);
149
+ export const TooltipTextBubble = createTextBubble(TooltipContent);
150
150
 
151
151
  const webStyles = StyleSheet.create({
152
152
  backdrop: {