@oxyhq/bloom 0.27.0 → 0.28.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/lib/commonjs/animated-check/AnimatedCheck.js +162 -0
- package/lib/commonjs/animated-check/AnimatedCheck.js.map +1 -0
- package/lib/commonjs/animated-check/index.js +13 -0
- package/lib/commonjs/animated-check/index.js.map +1 -0
- package/lib/commonjs/dialog/placement.js +9 -7
- package/lib/commonjs/dialog/placement.js.map +1 -1
- package/lib/commonjs/fill/index.js.map +1 -1
- package/lib/commonjs/hooks/index.js +20 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useGutters.js +106 -0
- package/lib/commonjs/hooks/useGutters.js.map +1 -0
- package/lib/commonjs/hooks/useHaptics.js +69 -0
- package/lib/commonjs/hooks/useHaptics.js.map +1 -0
- package/lib/commonjs/hooks/useInteractionState.js +8 -2
- package/lib/commonjs/hooks/useInteractionState.js.map +1 -1
- package/lib/commonjs/index.js +155 -63
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +155 -63
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/media-inset-border/MediaInsetBorder.js +50 -0
- package/lib/commonjs/media-inset-border/MediaInsetBorder.js.map +1 -0
- package/lib/commonjs/media-inset-border/index.js +13 -0
- package/lib/commonjs/media-inset-border/index.js.map +1 -0
- package/lib/commonjs/motion/ScreenTransition.js +46 -0
- package/lib/commonjs/motion/ScreenTransition.js.map +1 -0
- package/lib/commonjs/motion/index.js +32 -0
- package/lib/commonjs/motion/index.js.map +1 -0
- package/lib/commonjs/motion/motion.js +93 -0
- package/lib/commonjs/motion/motion.js.map +1 -0
- package/lib/commonjs/pressable-scale/PressableScale.js +75 -0
- package/lib/commonjs/pressable-scale/PressableScale.js.map +1 -0
- package/lib/commonjs/pressable-scale/index.js +13 -0
- package/lib/commonjs/pressable-scale/index.js.map +1 -0
- package/lib/commonjs/pressable-with-hover/PressableWithHover.js +36 -0
- package/lib/commonjs/pressable-with-hover/PressableWithHover.js.map +1 -0
- package/lib/commonjs/pressable-with-hover/index.js +13 -0
- package/lib/commonjs/pressable-with-hover/index.js.map +1 -0
- package/lib/commonjs/styles/breakpoints.js +24 -0
- package/lib/commonjs/styles/breakpoints.js.map +1 -0
- package/lib/commonjs/styles/index.js +7 -0
- package/lib/commonjs/styles/index.js.map +1 -1
- package/lib/commonjs/subtle-hover/SubtleHover.js +69 -0
- package/lib/commonjs/subtle-hover/SubtleHover.js.map +1 -0
- package/lib/commonjs/subtle-hover/index.js +13 -0
- package/lib/commonjs/subtle-hover/index.js.map +1 -0
- package/lib/commonjs/theme/build-theme.js +2 -0
- package/lib/commonjs/theme/build-theme.js.map +1 -1
- package/lib/commonjs/theme/gradients.js +39 -0
- package/lib/commonjs/theme/gradients.js.map +1 -0
- package/lib/commonjs/theme/index.js +7 -0
- package/lib/commonjs/theme/index.js.map +1 -1
- package/lib/module/animated-check/AnimatedCheck.js +157 -0
- package/lib/module/animated-check/AnimatedCheck.js.map +1 -0
- package/lib/module/animated-check/index.js +4 -0
- package/lib/module/animated-check/index.js.map +1 -0
- package/lib/module/dialog/placement.js +9 -7
- package/lib/module/dialog/placement.js.map +1 -1
- package/lib/module/fill/index.js.map +1 -1
- package/lib/module/hooks/index.js +2 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useGutters.js +103 -0
- package/lib/module/hooks/useGutters.js.map +1 -0
- package/lib/module/hooks/useHaptics.js +65 -0
- package/lib/module/hooks/useHaptics.js.map +1 -0
- package/lib/module/hooks/useInteractionState.js +10 -3
- package/lib/module/hooks/useInteractionState.js.map +1 -1
- package/lib/module/index.js +10 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +10 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/media-inset-border/MediaInsetBorder.js +47 -0
- package/lib/module/media-inset-border/MediaInsetBorder.js.map +1 -0
- package/lib/module/media-inset-border/index.js +4 -0
- package/lib/module/media-inset-border/index.js.map +1 -0
- package/lib/module/motion/ScreenTransition.js +40 -0
- package/lib/module/motion/ScreenTransition.js.map +1 -0
- package/lib/module/motion/index.js +5 -0
- package/lib/module/motion/index.js.map +1 -0
- package/lib/module/motion/motion.js +87 -0
- package/lib/module/motion/motion.js.map +1 -0
- package/lib/module/pressable-scale/PressableScale.js +72 -0
- package/lib/module/pressable-scale/PressableScale.js.map +1 -0
- package/lib/module/pressable-scale/index.js +4 -0
- package/lib/module/pressable-scale/index.js.map +1 -0
- package/lib/module/pressable-with-hover/PressableWithHover.js +31 -0
- package/lib/module/pressable-with-hover/PressableWithHover.js.map +1 -0
- package/lib/module/pressable-with-hover/index.js +4 -0
- package/lib/module/pressable-with-hover/index.js.map +1 -0
- package/lib/module/styles/breakpoints.js +20 -0
- package/lib/module/styles/breakpoints.js.map +1 -0
- package/lib/module/styles/index.js +1 -0
- package/lib/module/styles/index.js.map +1 -1
- package/lib/module/subtle-hover/SubtleHover.js +66 -0
- package/lib/module/subtle-hover/SubtleHover.js.map +1 -0
- package/lib/module/subtle-hover/index.js +4 -0
- package/lib/module/subtle-hover/index.js.map +1 -0
- package/lib/module/theme/build-theme.js +2 -0
- package/lib/module/theme/build-theme.js.map +1 -1
- package/lib/module/theme/gradients.js +35 -0
- package/lib/module/theme/gradients.js.map +1 -0
- package/lib/module/theme/index.js +1 -0
- package/lib/module/theme/index.js.map +1 -1
- package/lib/typescript/commonjs/animated-check/AnimatedCheck.d.ts +18 -0
- package/lib/typescript/commonjs/animated-check/AnimatedCheck.d.ts.map +1 -0
- package/lib/typescript/commonjs/animated-check/index.d.ts +3 -0
- package/lib/typescript/commonjs/animated-check/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/placement.d.ts +8 -7
- package/lib/typescript/commonjs/dialog/placement.d.ts.map +1 -1
- package/lib/typescript/commonjs/fill/index.d.ts +2 -2
- package/lib/typescript/commonjs/fill/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/index.d.ts +4 -0
- package/lib/typescript/commonjs/hooks/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/useGutters.d.ts +32 -0
- package/lib/typescript/commonjs/hooks/useGutters.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/useHaptics.d.ts +28 -0
- package/lib/typescript/commonjs/hooks/useHaptics.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/useInteractionState.d.ts +6 -0
- package/lib/typescript/commonjs/hooks/useInteractionState.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +16 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +16 -0
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-inset-border/MediaInsetBorder.d.ts +26 -0
- package/lib/typescript/commonjs/media-inset-border/MediaInsetBorder.d.ts.map +1 -0
- package/lib/typescript/commonjs/media-inset-border/index.d.ts +3 -0
- package/lib/typescript/commonjs/media-inset-border/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/ScreenTransition.d.ts +33 -0
- package/lib/typescript/commonjs/motion/ScreenTransition.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/index.d.ts +4 -0
- package/lib/typescript/commonjs/motion/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/motion.d.ts +24 -0
- package/lib/typescript/commonjs/motion/motion.d.ts.map +1 -0
- package/lib/typescript/commonjs/pressable-scale/PressableScale.d.ts +21 -0
- package/lib/typescript/commonjs/pressable-scale/PressableScale.d.ts.map +1 -0
- package/lib/typescript/commonjs/pressable-scale/index.d.ts +3 -0
- package/lib/typescript/commonjs/pressable-scale/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/pressable-with-hover/PressableWithHover.d.ts +18 -0
- package/lib/typescript/commonjs/pressable-with-hover/PressableWithHover.d.ts.map +1 -0
- package/lib/typescript/commonjs/pressable-with-hover/index.d.ts +3 -0
- package/lib/typescript/commonjs/pressable-with-hover/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/styles/breakpoints.d.ts +18 -0
- package/lib/typescript/commonjs/styles/breakpoints.d.ts.map +1 -0
- package/lib/typescript/commonjs/styles/index.d.ts +2 -0
- package/lib/typescript/commonjs/styles/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/subtle-hover/SubtleHover.d.ts +32 -0
- package/lib/typescript/commonjs/subtle-hover/SubtleHover.d.ts.map +1 -0
- package/lib/typescript/commonjs/subtle-hover/index.d.ts +3 -0
- package/lib/typescript/commonjs/subtle-hover/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/build-theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/gradients.d.ts +12 -0
- package/lib/typescript/commonjs/theme/gradients.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/index.d.ts +2 -1
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/types.d.ts +11 -0
- package/lib/typescript/commonjs/theme/types.d.ts.map +1 -1
- package/lib/typescript/module/animated-check/AnimatedCheck.d.ts +18 -0
- package/lib/typescript/module/animated-check/AnimatedCheck.d.ts.map +1 -0
- package/lib/typescript/module/animated-check/index.d.ts +3 -0
- package/lib/typescript/module/animated-check/index.d.ts.map +1 -0
- package/lib/typescript/module/dialog/placement.d.ts +8 -7
- package/lib/typescript/module/dialog/placement.d.ts.map +1 -1
- package/lib/typescript/module/fill/index.d.ts +2 -2
- package/lib/typescript/module/fill/index.d.ts.map +1 -1
- package/lib/typescript/module/hooks/index.d.ts +4 -0
- package/lib/typescript/module/hooks/index.d.ts.map +1 -1
- package/lib/typescript/module/hooks/useGutters.d.ts +32 -0
- package/lib/typescript/module/hooks/useGutters.d.ts.map +1 -0
- package/lib/typescript/module/hooks/useHaptics.d.ts +28 -0
- package/lib/typescript/module/hooks/useHaptics.d.ts.map +1 -0
- package/lib/typescript/module/hooks/useInteractionState.d.ts +6 -0
- package/lib/typescript/module/hooks/useInteractionState.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +16 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +16 -0
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/media-inset-border/MediaInsetBorder.d.ts +26 -0
- package/lib/typescript/module/media-inset-border/MediaInsetBorder.d.ts.map +1 -0
- package/lib/typescript/module/media-inset-border/index.d.ts +3 -0
- package/lib/typescript/module/media-inset-border/index.d.ts.map +1 -0
- package/lib/typescript/module/motion/ScreenTransition.d.ts +33 -0
- package/lib/typescript/module/motion/ScreenTransition.d.ts.map +1 -0
- package/lib/typescript/module/motion/index.d.ts +4 -0
- package/lib/typescript/module/motion/index.d.ts.map +1 -0
- package/lib/typescript/module/motion/motion.d.ts +24 -0
- package/lib/typescript/module/motion/motion.d.ts.map +1 -0
- package/lib/typescript/module/pressable-scale/PressableScale.d.ts +21 -0
- package/lib/typescript/module/pressable-scale/PressableScale.d.ts.map +1 -0
- package/lib/typescript/module/pressable-scale/index.d.ts +3 -0
- package/lib/typescript/module/pressable-scale/index.d.ts.map +1 -0
- package/lib/typescript/module/pressable-with-hover/PressableWithHover.d.ts +18 -0
- package/lib/typescript/module/pressable-with-hover/PressableWithHover.d.ts.map +1 -0
- package/lib/typescript/module/pressable-with-hover/index.d.ts +3 -0
- package/lib/typescript/module/pressable-with-hover/index.d.ts.map +1 -0
- package/lib/typescript/module/styles/breakpoints.d.ts +18 -0
- package/lib/typescript/module/styles/breakpoints.d.ts.map +1 -0
- package/lib/typescript/module/styles/index.d.ts +2 -0
- package/lib/typescript/module/styles/index.d.ts.map +1 -1
- package/lib/typescript/module/subtle-hover/SubtleHover.d.ts +32 -0
- package/lib/typescript/module/subtle-hover/SubtleHover.d.ts.map +1 -0
- package/lib/typescript/module/subtle-hover/index.d.ts +3 -0
- package/lib/typescript/module/subtle-hover/index.d.ts.map +1 -0
- package/lib/typescript/module/theme/build-theme.d.ts.map +1 -1
- package/lib/typescript/module/theme/gradients.d.ts +12 -0
- package/lib/typescript/module/theme/gradients.d.ts.map +1 -0
- package/lib/typescript/module/theme/index.d.ts +2 -1
- package/lib/typescript/module/theme/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/types.d.ts +11 -0
- package/lib/typescript/module/theme/types.d.ts.map +1 -1
- package/package.json +72 -1
- package/src/__tests__/AnimatedCheck.test.tsx +31 -0
- package/src/__tests__/MediaInsetBorder.test.tsx +36 -0
- package/src/__tests__/Motion.test.tsx +58 -0
- package/src/__tests__/PressableScale.test.tsx +29 -0
- package/src/__tests__/PressableWithHover.test.tsx +48 -0
- package/src/__tests__/SubtleHover.test.tsx +42 -0
- package/src/__tests__/theme-gradients.test.ts +31 -0
- package/src/__tests__/theme.test.ts +3 -0
- package/src/__tests__/useGutters.test.ts +58 -0
- package/src/__tests__/useHaptics.test.tsx +58 -0
- package/src/__tests__/useInteractionState.test.ts +27 -0
- package/src/animated-check/AnimatedCheck.stories.tsx +60 -0
- package/src/animated-check/AnimatedCheck.tsx +173 -0
- package/src/animated-check/index.ts +2 -0
- package/src/dialog/placement.ts +10 -7
- package/src/fill/index.tsx +2 -2
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useGutters.ts +99 -0
- package/src/hooks/useHaptics.tsx +69 -0
- package/src/hooks/useInteractionState.ts +8 -2
- package/src/index.ts +20 -0
- package/src/index.web.ts +20 -0
- package/src/media-inset-border/MediaInsetBorder.stories.tsx +60 -0
- package/src/media-inset-border/MediaInsetBorder.tsx +72 -0
- package/src/media-inset-border/index.ts +2 -0
- package/src/motion/Motion.stories.tsx +99 -0
- package/src/motion/ScreenTransition.tsx +71 -0
- package/src/motion/index.ts +3 -0
- package/src/motion/motion.ts +75 -0
- package/src/pressable-scale/PressableScale.stories.tsx +71 -0
- package/src/pressable-scale/PressableScale.tsx +103 -0
- package/src/pressable-scale/index.ts +2 -0
- package/src/pressable-with-hover/PressableWithHover.stories.tsx +43 -0
- package/src/pressable-with-hover/PressableWithHover.tsx +43 -0
- package/src/pressable-with-hover/index.ts +2 -0
- package/src/styles/breakpoints.ts +18 -0
- package/src/styles/index.ts +2 -0
- package/src/subtle-hover/SubtleHover.stories.tsx +72 -0
- package/src/subtle-hover/SubtleHover.tsx +90 -0
- package/src/subtle-hover/index.ts +2 -0
- package/src/theme/build-theme.ts +2 -0
- package/src/theme/gradients.ts +61 -0
- package/src/theme/index.ts +2 -1
- package/src/theme/types.ts +13 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useTheme } from '../theme';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* True on touch-capable web browsers (coarse pointer). A hover wash only makes
|
|
8
|
+
* sense with a hovering pointer, so it is suppressed on touch web to match
|
|
9
|
+
* native (which has no hover at all).
|
|
10
|
+
*/
|
|
11
|
+
const IS_WEB_TOUCH_DEVICE =
|
|
12
|
+
Platform.OS === 'web' &&
|
|
13
|
+
typeof window !== 'undefined' &&
|
|
14
|
+
typeof window.matchMedia === 'function' &&
|
|
15
|
+
window.matchMedia('(pointer: coarse)').matches;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Web-only style that (a) cross-fades the overlay opacity and (b) promotes it to
|
|
19
|
+
* its own GPU layer so Safari doesn't nudge the layout by a subpixel when the
|
|
20
|
+
* overlay composites on hover. Cast because RN's `ViewStyle` has no `willChange`
|
|
21
|
+
* / `transition*` keys; react-native-web forwards them to the DOM node.
|
|
22
|
+
*/
|
|
23
|
+
const WEB_TRANSITION = {
|
|
24
|
+
transitionProperty: 'opacity',
|
|
25
|
+
transitionDuration: '0.1s',
|
|
26
|
+
transitionTimingFunction: 'ease',
|
|
27
|
+
willChange: 'opacity',
|
|
28
|
+
} as ViewStyle;
|
|
29
|
+
|
|
30
|
+
export interface SubtleHoverProps {
|
|
31
|
+
/** Whether the parent is currently hovered. Drives the overlay opacity. */
|
|
32
|
+
hover: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Overlay opacity when hovered. Defaults to a mode-tuned value (0.4 dark /
|
|
35
|
+
* 0.5 light) that reads as a gentle contrast wash.
|
|
36
|
+
*/
|
|
37
|
+
opacity?: number;
|
|
38
|
+
/** Extra style merged last — e.g. `borderRadius` to match the parent. */
|
|
39
|
+
style?: StyleProp<ViewStyle>;
|
|
40
|
+
/**
|
|
41
|
+
* Opt in to rendering on native. Off by default: hover is a pointer
|
|
42
|
+
* affordance, so this is a web-only overlay unless a native surface wants the
|
|
43
|
+
* same wash driven by another interaction (e.g. press).
|
|
44
|
+
*/
|
|
45
|
+
native?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* An absolutely-positioned, non-interactive contrast wash that fades in while
|
|
50
|
+
* its parent is hovered. Ported from Bluesky's `SubtleHover`. Pairs naturally
|
|
51
|
+
* with {@link useInteractionState} — pass its `state` as `hover`.
|
|
52
|
+
*
|
|
53
|
+
* Renders nothing on touch-web (no hovering pointer) and on native unless
|
|
54
|
+
* `native` is set. Color comes from the theme's `contrast50` token so the wash
|
|
55
|
+
* tracks the active preset and light/dark mode.
|
|
56
|
+
*/
|
|
57
|
+
export function SubtleHover({ hover, opacity, style, native = false }: SubtleHoverProps) {
|
|
58
|
+
const theme = useTheme();
|
|
59
|
+
|
|
60
|
+
const isWeb = Platform.OS === 'web';
|
|
61
|
+
if (isWeb ? IS_WEB_TOUCH_DEVICE : !native) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const targetOpacity = opacity ?? (theme.isDark ? 0.4 : 0.5);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<View
|
|
69
|
+
style={[
|
|
70
|
+
styles.overlay,
|
|
71
|
+
{ backgroundColor: theme.colors.contrast50, opacity: hover ? targetOpacity : 0 },
|
|
72
|
+
isWeb ? WEB_TRANSITION : null,
|
|
73
|
+
style,
|
|
74
|
+
]}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
SubtleHover.displayName = 'SubtleHover';
|
|
80
|
+
|
|
81
|
+
const styles = StyleSheet.create({
|
|
82
|
+
overlay: {
|
|
83
|
+
position: 'absolute',
|
|
84
|
+
top: 0,
|
|
85
|
+
left: 0,
|
|
86
|
+
right: 0,
|
|
87
|
+
bottom: 0,
|
|
88
|
+
pointerEvents: 'none',
|
|
89
|
+
},
|
|
90
|
+
});
|
package/src/theme/build-theme.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Platform } from 'react-native';
|
|
|
2
2
|
import { APP_COLOR_PRESETS, type AppColorName } from './color-presets';
|
|
3
3
|
import { getAdaptiveColors } from './adaptive-colors';
|
|
4
4
|
import { getResolvedTokens, hslToSrgb } from './token-registry';
|
|
5
|
+
import { THEME_GRADIENTS } from './gradients';
|
|
5
6
|
import type { Theme, ThemeColors } from './types';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -119,6 +120,7 @@ export function buildTheme(
|
|
|
119
120
|
return {
|
|
120
121
|
mode: resolved,
|
|
121
122
|
colors,
|
|
123
|
+
gradients: THEME_GRADIENTS,
|
|
122
124
|
isDark: resolved === 'dark',
|
|
123
125
|
isLight: resolved === 'light',
|
|
124
126
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ThemeGradients } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Brand-neutral named linear-gradient palettes shared across the design system —
|
|
5
|
+
* decorative avatar rings, hero surfaces, empty-state art, and similar accents.
|
|
6
|
+
*
|
|
7
|
+
* Each entry lists ordered `[offset, color]` stops where `offset` is a `0–1`
|
|
8
|
+
* position along the gradient axis. These are intentionally theme-agnostic (the
|
|
9
|
+
* same values are exposed in light and dark mode) and not tied to any single
|
|
10
|
+
* app's brand, so components can reference them by a stable, descriptive name.
|
|
11
|
+
*/
|
|
12
|
+
export const THEME_GRADIENTS: ThemeGradients = {
|
|
13
|
+
sky: {
|
|
14
|
+
values: [
|
|
15
|
+
[0, '#0A7AFF'],
|
|
16
|
+
[1, '#59B9FF'],
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
midnight: {
|
|
20
|
+
values: [
|
|
21
|
+
[0, '#022C5E'],
|
|
22
|
+
[1, '#4079BC'],
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
sunrise: {
|
|
26
|
+
values: [
|
|
27
|
+
[0, '#4E90AE'],
|
|
28
|
+
[0.4, '#AEA3AB'],
|
|
29
|
+
[0.8, '#E6A98F'],
|
|
30
|
+
[1, '#F3A84C'],
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
sunset: {
|
|
34
|
+
values: [
|
|
35
|
+
[0, '#6772AF'],
|
|
36
|
+
[0.6, '#B88BB6'],
|
|
37
|
+
[1, '#FFA6AC'],
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
summer: {
|
|
41
|
+
values: [
|
|
42
|
+
[0, '#FF6A56'],
|
|
43
|
+
[0.3, '#FF9156'],
|
|
44
|
+
[1, '#FFDD87'],
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
nordic: {
|
|
48
|
+
values: [
|
|
49
|
+
[0, '#083367'],
|
|
50
|
+
[1, '#9EE8C1'],
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
bonfire: {
|
|
54
|
+
values: [
|
|
55
|
+
[0, '#203E4E'],
|
|
56
|
+
[0.4, '#755B62'],
|
|
57
|
+
[0.8, '#CD7765'],
|
|
58
|
+
[1, '#EF956E'],
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
};
|
package/src/theme/index.ts
CHANGED
|
@@ -6,10 +6,11 @@ export type {
|
|
|
6
6
|
export { BloomColorScope, useColorScopeStyle } from './color-scope';
|
|
7
7
|
export type { BloomColorScopeProps } from './color-scope';
|
|
8
8
|
export { buildTheme, STATUS_COLORS } from './build-theme';
|
|
9
|
+
export { THEME_GRADIENTS } from './gradients';
|
|
9
10
|
export { useTheme, useThemeColor, useBloomTheme } from './use-theme';
|
|
10
11
|
export { useNavigationTheme } from './use-navigation-theme';
|
|
11
12
|
export type { NavigationTheme, NavigationThemeFont } from './use-navigation-theme';
|
|
12
|
-
export type { Theme, ThemeColors, ThemeMode } from './types';
|
|
13
|
+
export type { Theme, ThemeColors, ThemeMode, ThemeGradient, ThemeGradients } from './types';
|
|
13
14
|
export type { AppColorName, AppColorPreset, PresetTokens } from './color-presets';
|
|
14
15
|
export {
|
|
15
16
|
APP_COLOR_NAMES,
|
package/src/theme/types.ts
CHANGED
|
@@ -44,9 +44,22 @@ export interface ThemeColors {
|
|
|
44
44
|
overlay: string;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* A single named gradient: an ordered list of `[offset, color]` stops where
|
|
49
|
+
* `offset` runs 0–1 along the gradient axis and `color` is any RN/CSS color.
|
|
50
|
+
*/
|
|
51
|
+
export interface ThemeGradient {
|
|
52
|
+
values: Array<[number, string]>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Map of named gradients exposed on the theme (`theme.gradients`). */
|
|
56
|
+
export type ThemeGradients = Record<string, ThemeGradient>;
|
|
57
|
+
|
|
47
58
|
export interface Theme {
|
|
48
59
|
mode: 'light' | 'dark';
|
|
49
60
|
colors: ThemeColors;
|
|
61
|
+
/** Brand-neutral named linear-gradient palettes. Theme-agnostic (same in light/dark). */
|
|
62
|
+
gradients: ThemeGradients;
|
|
50
63
|
isDark: boolean;
|
|
51
64
|
isLight: boolean;
|
|
52
65
|
}
|