@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.
- package/README.md +54 -16
- package/lib/commonjs/admonition/index.js +24 -23
- package/lib/commonjs/admonition/index.js.map +1 -1
- package/lib/commonjs/combobox/Combobox.js +7 -7
- package/lib/commonjs/combobox/Combobox.js.map +1 -1
- package/lib/commonjs/context-menu/context.js +2 -2
- package/lib/commonjs/context-menu/context.js.map +1 -1
- package/lib/commonjs/context-menu/index.js +25 -25
- package/lib/commonjs/context-menu/index.js.map +1 -1
- package/lib/commonjs/context-menu/index.web.js +27 -27
- package/lib/commonjs/context-menu/index.web.js.map +1 -1
- package/lib/commonjs/dialog/SheetShell.js +1 -1
- package/lib/commonjs/index.js +134 -38
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +134 -38
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/input-group/InputGroup.js +1 -1
- package/lib/commonjs/menu/context.js +2 -2
- package/lib/commonjs/menu/context.js.map +1 -1
- package/lib/commonjs/menu/index.js +17 -17
- package/lib/commonjs/menu/index.js.map +1 -1
- package/lib/commonjs/menu/index.web.js +16 -16
- package/lib/commonjs/menu/index.web.js.map +1 -1
- package/lib/commonjs/popover/context.js +1 -1
- package/lib/commonjs/popover/context.js.map +1 -1
- package/lib/commonjs/popover/index.js +6 -6
- package/lib/commonjs/popover/index.js.map +1 -1
- package/lib/commonjs/popover/index.web.js +6 -6
- package/lib/commonjs/popover/index.web.js.map +1 -1
- package/lib/commonjs/search-input/index.js +4 -5
- package/lib/commonjs/search-input/index.js.map +1 -1
- package/lib/commonjs/segmented-control/index.js +18 -18
- package/lib/commonjs/segmented-control/index.js.map +1 -1
- package/lib/commonjs/select/common.js +2 -2
- package/lib/commonjs/select/common.js.map +1 -1
- package/lib/commonjs/select/index.js +34 -38
- package/lib/commonjs/select/index.js.map +1 -1
- package/lib/commonjs/select/index.web.js +31 -35
- package/lib/commonjs/select/index.web.js.map +1 -1
- package/lib/commonjs/tabs/Tabs.js +7 -7
- package/lib/commonjs/tabs/Tabs.js.map +1 -1
- package/lib/commonjs/tabs/index.js +6 -6
- package/lib/commonjs/text-field/index.js +14 -14
- package/lib/commonjs/text-field/index.js.map +1 -1
- package/lib/commonjs/theme/color-scope/style-builder.js +6 -6
- package/lib/commonjs/theme/index.js +7 -0
- package/lib/commonjs/theme/index.js.map +1 -1
- package/lib/commonjs/theme/use-navigation-theme.js +54 -0
- package/lib/commonjs/theme/use-navigation-theme.js.map +1 -0
- package/lib/commonjs/tooltip/index.js +11 -11
- package/lib/commonjs/tooltip/index.js.map +1 -1
- package/lib/commonjs/tooltip/index.web.js +11 -11
- package/lib/commonjs/tooltip/index.web.js.map +1 -1
- package/lib/module/admonition/index.js +18 -17
- package/lib/module/admonition/index.js.map +1 -1
- package/lib/module/combobox/Combobox.js +7 -7
- package/lib/module/combobox/Combobox.js.map +1 -1
- package/lib/module/context-menu/context.js +2 -2
- package/lib/module/context-menu/context.js.map +1 -1
- package/lib/module/context-menu/index.js +17 -17
- package/lib/module/context-menu/index.js.map +1 -1
- package/lib/module/context-menu/index.web.js +19 -19
- package/lib/module/context-menu/index.web.js.map +1 -1
- package/lib/module/dialog/SheetShell.js +1 -1
- package/lib/module/index.js +11 -11
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +11 -11
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/input-group/InputGroup.js +1 -1
- package/lib/module/menu/context.js +2 -2
- package/lib/module/menu/context.js.map +1 -1
- package/lib/module/menu/index.js +9 -9
- package/lib/module/menu/index.js.map +1 -1
- package/lib/module/menu/index.web.js +8 -8
- package/lib/module/menu/index.web.js.map +1 -1
- package/lib/module/popover/context.js +1 -1
- package/lib/module/popover/context.js.map +1 -1
- package/lib/module/popover/index.js +3 -3
- package/lib/module/popover/index.js.map +1 -1
- package/lib/module/popover/index.web.js +3 -3
- package/lib/module/popover/index.web.js.map +1 -1
- package/lib/module/search-input/index.js +4 -4
- package/lib/module/search-input/index.js.map +1 -1
- package/lib/module/segmented-control/index.js +15 -15
- package/lib/module/segmented-control/index.js.map +1 -1
- package/lib/module/select/common.js +1 -1
- package/lib/module/select/common.js.map +1 -1
- package/lib/module/select/index.js +25 -29
- package/lib/module/select/index.js.map +1 -1
- package/lib/module/select/index.web.js +22 -26
- package/lib/module/select/index.web.js.map +1 -1
- package/lib/module/tabs/Tabs.js +6 -6
- package/lib/module/tabs/Tabs.js.map +1 -1
- package/lib/module/tabs/index.js +1 -1
- package/lib/module/tabs/index.js.map +1 -1
- package/lib/module/text-field/index.js +8 -8
- package/lib/module/text-field/index.js.map +1 -1
- package/lib/module/theme/color-scope/style-builder.js +6 -6
- package/lib/module/theme/index.js +1 -0
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/use-navigation-theme.js +50 -0
- package/lib/module/theme/use-navigation-theme.js.map +1 -0
- package/lib/module/tooltip/index.js +6 -6
- package/lib/module/tooltip/index.js.map +1 -1
- package/lib/module/tooltip/index.web.js +6 -6
- package/lib/module/tooltip/index.web.js.map +1 -1
- package/lib/typescript/commonjs/admonition/index.d.ts +14 -13
- package/lib/typescript/commonjs/admonition/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/combobox/Combobox.d.ts +7 -7
- package/lib/typescript/commonjs/combobox/Combobox.d.ts.map +1 -1
- package/lib/typescript/commonjs/context-menu/index.d.ts +9 -9
- package/lib/typescript/commonjs/context-menu/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/context-menu/index.web.d.ts +9 -9
- package/lib/typescript/commonjs/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/context-menu/types.d.ts +6 -6
- package/lib/typescript/commonjs/context-menu/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/SheetShell.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts +11 -11
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +11 -11
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/input-group/types.d.ts +1 -1
- package/lib/typescript/commonjs/menu/index.d.ts +9 -9
- package/lib/typescript/commonjs/menu/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/menu/index.web.d.ts +9 -9
- package/lib/typescript/commonjs/menu/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/menu/types.d.ts +5 -5
- package/lib/typescript/commonjs/menu/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/popover/index.d.ts +5 -5
- package/lib/typescript/commonjs/popover/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/popover/index.web.d.ts +5 -5
- package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/popover/types.d.ts +1 -1
- package/lib/typescript/commonjs/popover/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/search-input/index.d.ts +3 -3
- package/lib/typescript/commonjs/search-input/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/segmented-control/index.d.ts +13 -13
- package/lib/typescript/commonjs/segmented-control/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/common.d.ts +1 -1
- package/lib/typescript/commonjs/select/common.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/index.d.ts +12 -12
- package/lib/typescript/commonjs/select/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/index.web.d.ts +12 -12
- package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/types.d.ts +10 -10
- package/lib/typescript/commonjs/select/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/tabs/Tabs.d.ts +4 -4
- package/lib/typescript/commonjs/tabs/Tabs.d.ts.map +1 -1
- package/lib/typescript/commonjs/tabs/index.d.ts +2 -2
- package/lib/typescript/commonjs/tabs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/tabs/types.d.ts +3 -3
- package/lib/typescript/commonjs/tabs/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/text-field/index.d.ts +8 -8
- package/lib/typescript/commonjs/text-field/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts +6 -6
- package/lib/typescript/commonjs/theme/index.d.ts +2 -0
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/use-navigation-theme.d.ts +31 -0
- package/lib/typescript/commonjs/theme/use-navigation-theme.d.ts.map +1 -0
- package/lib/typescript/commonjs/tooltip/index.d.ts +6 -6
- package/lib/typescript/commonjs/tooltip/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/tooltip/index.web.d.ts +6 -6
- package/lib/typescript/commonjs/tooltip/index.web.d.ts.map +1 -1
- package/lib/typescript/module/admonition/index.d.ts +14 -13
- package/lib/typescript/module/admonition/index.d.ts.map +1 -1
- package/lib/typescript/module/combobox/Combobox.d.ts +7 -7
- package/lib/typescript/module/combobox/Combobox.d.ts.map +1 -1
- package/lib/typescript/module/context-menu/index.d.ts +9 -9
- package/lib/typescript/module/context-menu/index.d.ts.map +1 -1
- package/lib/typescript/module/context-menu/index.web.d.ts +9 -9
- package/lib/typescript/module/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/module/context-menu/types.d.ts +6 -6
- package/lib/typescript/module/context-menu/types.d.ts.map +1 -1
- package/lib/typescript/module/dialog/SheetShell.d.ts +1 -1
- package/lib/typescript/module/index.d.ts +11 -11
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +11 -11
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/input-group/types.d.ts +1 -1
- package/lib/typescript/module/menu/index.d.ts +9 -9
- package/lib/typescript/module/menu/index.d.ts.map +1 -1
- package/lib/typescript/module/menu/index.web.d.ts +9 -9
- package/lib/typescript/module/menu/index.web.d.ts.map +1 -1
- package/lib/typescript/module/menu/types.d.ts +5 -5
- package/lib/typescript/module/menu/types.d.ts.map +1 -1
- package/lib/typescript/module/popover/index.d.ts +5 -5
- package/lib/typescript/module/popover/index.d.ts.map +1 -1
- package/lib/typescript/module/popover/index.web.d.ts +5 -5
- package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/module/popover/types.d.ts +1 -1
- package/lib/typescript/module/popover/types.d.ts.map +1 -1
- package/lib/typescript/module/search-input/index.d.ts +3 -3
- package/lib/typescript/module/search-input/index.d.ts.map +1 -1
- package/lib/typescript/module/segmented-control/index.d.ts +13 -13
- package/lib/typescript/module/segmented-control/index.d.ts.map +1 -1
- package/lib/typescript/module/select/common.d.ts +1 -1
- package/lib/typescript/module/select/common.d.ts.map +1 -1
- package/lib/typescript/module/select/index.d.ts +12 -12
- package/lib/typescript/module/select/index.d.ts.map +1 -1
- package/lib/typescript/module/select/index.web.d.ts +12 -12
- package/lib/typescript/module/select/index.web.d.ts.map +1 -1
- package/lib/typescript/module/select/types.d.ts +10 -10
- package/lib/typescript/module/select/types.d.ts.map +1 -1
- package/lib/typescript/module/tabs/Tabs.d.ts +4 -4
- package/lib/typescript/module/tabs/Tabs.d.ts.map +1 -1
- package/lib/typescript/module/tabs/index.d.ts +2 -2
- package/lib/typescript/module/tabs/index.d.ts.map +1 -1
- package/lib/typescript/module/tabs/types.d.ts +3 -3
- package/lib/typescript/module/tabs/types.d.ts.map +1 -1
- package/lib/typescript/module/text-field/index.d.ts +8 -8
- package/lib/typescript/module/text-field/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/style-builder.d.ts +6 -6
- package/lib/typescript/module/theme/index.d.ts +2 -0
- package/lib/typescript/module/theme/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/use-navigation-theme.d.ts +31 -0
- package/lib/typescript/module/theme/use-navigation-theme.d.ts.map +1 -0
- package/lib/typescript/module/tooltip/index.d.ts +6 -6
- package/lib/typescript/module/tooltip/index.d.ts.map +1 -1
- package/lib/typescript/module/tooltip/index.web.d.ts +6 -6
- package/lib/typescript/module/tooltip/index.web.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/public-api-contract.test.ts +54 -0
- package/src/__tests__/useNavigationTheme.test.tsx +227 -0
- package/src/admonition/index.tsx +22 -21
- package/src/combobox/Combobox.tsx +14 -14
- package/src/context-menu/ContextMenu.stories.tsx +26 -18
- package/src/context-menu/context.ts +2 -2
- package/src/context-menu/index.tsx +24 -24
- package/src/context-menu/index.web.tsx +26 -26
- package/src/context-menu/types.ts +6 -6
- package/src/dialog/SheetShell.tsx +1 -1
- package/src/field/Field.stories.tsx +3 -3
- package/src/index.ts +11 -11
- package/src/index.web.ts +11 -11
- package/src/input-group/InputGroup.stories.tsx +4 -4
- package/src/input-group/InputGroup.tsx +1 -1
- package/src/input-group/types.ts +1 -1
- package/src/menu/Menu.stories.tsx +35 -35
- package/src/menu/context.ts +2 -2
- package/src/menu/index.tsx +15 -15
- package/src/menu/index.web.tsx +14 -14
- package/src/menu/types.ts +5 -5
- package/src/popover/Popover.stories.tsx +13 -13
- package/src/popover/context.ts +1 -1
- package/src/popover/index.tsx +5 -5
- package/src/popover/index.web.tsx +5 -5
- package/src/popover/types.ts +1 -1
- package/src/search-input/index.tsx +7 -7
- package/src/segmented-control/index.tsx +15 -15
- package/src/select/Select.stories.tsx +32 -23
- package/src/select/common.ts +1 -1
- package/src/select/index.tsx +39 -43
- package/src/select/index.web.tsx +33 -37
- package/src/select/types.ts +10 -10
- package/src/tabs/Tabs.tsx +9 -9
- package/src/tabs/index.ts +2 -2
- package/src/tabs/types.ts +3 -3
- package/src/text-field/TextField.stories.tsx +5 -5
- package/src/text-field/index.tsx +12 -12
- package/src/theme/color-scope/style-builder.ts +6 -6
- package/src/theme/index.ts +2 -0
- package/src/theme/use-navigation-theme.ts +59 -0
- package/src/tooltip/index.tsx +6 -6
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
<
|
|
32
|
-
<TextField
|
|
33
|
-
<
|
|
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
|
|
41
|
+
</TextField>
|
|
42
42
|
</View>
|
|
43
43
|
);
|
|
44
44
|
}
|
package/src/text-field/index.tsx
CHANGED
|
@@ -46,11 +46,11 @@ const Context = createContext<{
|
|
|
46
46
|
});
|
|
47
47
|
Context.displayName = 'TextFieldContext';
|
|
48
48
|
|
|
49
|
-
export type
|
|
49
|
+
export type TextFieldProps = React.PropsWithChildren<
|
|
50
50
|
{ isInvalid?: boolean } & ViewStyleProp
|
|
51
51
|
>;
|
|
52
52
|
|
|
53
|
-
export function
|
|
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
|
|
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
|
|
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
|
-
}:
|
|
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
|
-
<
|
|
159
|
-
<
|
|
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
|
-
</
|
|
167
|
+
</TextField>
|
|
168
168
|
);
|
|
169
169
|
}
|
|
170
170
|
|
|
@@ -246,7 +246,7 @@ export function Input({
|
|
|
246
246
|
);
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
export function
|
|
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
|
|
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
|
|
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
|
|
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
|
-
*
|
|
80
|
-
* when applied to an interop className
|
|
81
|
-
* on matched className style rules).
|
|
82
|
-
* dropped silently.
|
|
83
|
-
*
|
|
84
|
-
*
|
|
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,
|
package/src/theme/index.ts
CHANGED
|
@@ -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
|
+
}
|
package/src/tooltip/index.tsx
CHANGED
|
@@ -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
|
|
75
|
+
export function TooltipSheetCompatProvider({
|
|
76
76
|
children,
|
|
77
77
|
}: {
|
|
78
78
|
children: React.ReactNode;
|
|
79
79
|
}) {
|
|
80
80
|
return <>{children}</>;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
TooltipSheetCompatProvider.displayName = 'TooltipSheetCompatProvider';
|
|
83
83
|
|
|
84
|
-
export function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
30
|
+
export function TooltipSheetCompatProvider({
|
|
31
31
|
children,
|
|
32
32
|
}: {
|
|
33
33
|
children: React.ReactNode;
|
|
34
34
|
}) {
|
|
35
35
|
return <>{children}</>;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
TooltipSheetCompatProvider.displayName = 'TooltipSheetCompatProvider';
|
|
38
38
|
|
|
39
|
-
export function
|
|
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
|
|
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
|
|
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
|
|
149
|
+
export const TooltipTextBubble = createTextBubble(TooltipContent);
|
|
150
150
|
|
|
151
151
|
const webStyles = StyleSheet.create({
|
|
152
152
|
backdrop: {
|