@oxyhq/bloom 0.27.0 → 0.29.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 +78 -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 +74 -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 +75 -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 +71 -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 +37 -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 +37 -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 +38 -0
- package/src/__tests__/PressableWithHover.test.tsx +48 -0
- package/src/__tests__/SubtleHover.test.tsx +50 -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 +92 -0
- package/src/pressable-scale/PressableScale.tsx +93 -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 +85 -0
- package/src/subtle-hover/SubtleHover.tsx +98 -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,98 @@
|
|
|
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). The CSS `group-hover`
|
|
8
|
+
* wash only makes sense with a hovering pointer, so it is suppressed on touch
|
|
9
|
+
* web to match 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
|
+
export interface SubtleHoverProps {
|
|
18
|
+
/**
|
|
19
|
+
* JS-driven visibility for a coordinated highlight — e.g. every post of one
|
|
20
|
+
* thread lighting up together. When omitted, the wash instead follows CSS
|
|
21
|
+
* `group-hover` on web with ZERO React state: the parent element must carry
|
|
22
|
+
* `className="group"`.
|
|
23
|
+
*/
|
|
24
|
+
active?: boolean;
|
|
25
|
+
/** Extra style merged last — e.g. `borderRadius` to match the parent. */
|
|
26
|
+
style?: StyleProp<ViewStyle>;
|
|
27
|
+
/**
|
|
28
|
+
* Render on native too (default `false`). Hover is a web pointer affordance,
|
|
29
|
+
* so the CSS `group-hover` mode is web-only; native only shows the wash in the
|
|
30
|
+
* JS `active` mode, and only when this is set.
|
|
31
|
+
*/
|
|
32
|
+
native?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An absolutely-positioned, non-interactive contrast wash. Two modes:
|
|
37
|
+
*
|
|
38
|
+
* - **CSS `group-hover`** (`active` omitted): the wash fades in on hover purely
|
|
39
|
+
* through NativeWind classes — no React state. The parent must carry
|
|
40
|
+
* `className="group"`. Web-only (native and touch-web have no hover).
|
|
41
|
+
* - **JS `active`**: the wash opacity follows the boolean, so several elements
|
|
42
|
+
* can light up together (e.g. every post of a thread). Web always; native
|
|
43
|
+
* only when `native` is set.
|
|
44
|
+
*
|
|
45
|
+
* The wash color comes from the theme's `contrast50` token so it tracks the
|
|
46
|
+
* active preset and light/dark mode. The web cross-fade is a NativeWind
|
|
47
|
+
* `transition-opacity` class — no manual `willChange` / web-style casts.
|
|
48
|
+
*/
|
|
49
|
+
export function SubtleHover({ active, style, native = false }: SubtleHoverProps) {
|
|
50
|
+
const theme = useTheme();
|
|
51
|
+
const isWeb = Platform.OS === 'web';
|
|
52
|
+
|
|
53
|
+
// Full literal class strings (never concatenated fragments) so NativeWind's
|
|
54
|
+
// compiler statically extracts every variant.
|
|
55
|
+
if (active === undefined) {
|
|
56
|
+
// CSS group-hover: a web pointer affordance. Native has no hover, and
|
|
57
|
+
// neither does touch web — render nothing there.
|
|
58
|
+
if (!isWeb || IS_WEB_TOUCH_DEVICE) return null;
|
|
59
|
+
return (
|
|
60
|
+
<View
|
|
61
|
+
{...({
|
|
62
|
+
className:
|
|
63
|
+
'opacity-0 group-hover:opacity-50 dark:group-hover:opacity-40 transition-opacity duration-150',
|
|
64
|
+
} as Record<string, string>)}
|
|
65
|
+
style={[styles.overlay, { backgroundColor: theme.colors.contrast50 }, style]}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// JS-driven coordinated mode: web always; native only when opted in.
|
|
71
|
+
if (!isWeb && !native) return null;
|
|
72
|
+
return (
|
|
73
|
+
<View
|
|
74
|
+
{...({ className: 'transition-opacity duration-150' } as Record<string, string>)}
|
|
75
|
+
style={[
|
|
76
|
+
styles.overlay,
|
|
77
|
+
{
|
|
78
|
+
backgroundColor: theme.colors.contrast50,
|
|
79
|
+
opacity: active ? (theme.isDark ? 0.4 : 0.5) : 0,
|
|
80
|
+
},
|
|
81
|
+
style,
|
|
82
|
+
]}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
SubtleHover.displayName = 'SubtleHover';
|
|
88
|
+
|
|
89
|
+
const styles = StyleSheet.create({
|
|
90
|
+
overlay: {
|
|
91
|
+
position: 'absolute',
|
|
92
|
+
top: 0,
|
|
93
|
+
left: 0,
|
|
94
|
+
right: 0,
|
|
95
|
+
bottom: 0,
|
|
96
|
+
pointerEvents: 'none',
|
|
97
|
+
},
|
|
98
|
+
});
|
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
|
}
|