@rific/auto-paper 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -6
- package/dist/index.d.mts +121 -23
- package/dist/index.d.ts +121 -23
- package/dist/index.js +1293 -988
- package/dist/index.mjs +1275 -973
- package/package.json +3 -7
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @rific/auto-paper
|
|
2
2
|
|
|
3
|
-
Adaptive theming for [`react-native-paper`](https://callstack.github.io/react-native-paper/). Give it one color and an appearance setting — it generates
|
|
3
|
+
Adaptive theming for [`react-native-paper`](https://callstack.github.io/react-native-paper/). Give it one color and an appearance setting — it generates an MD3 palette and handles light/dark/system mode automatically.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- Color harmony palette from a single seed color (primary → secondary → tertiary) — 6 harmony modes available, defaulting to `split-complementary`
|
|
8
8
|
- System/light/dark appearance with live updates via `Appearance` API
|
|
9
9
|
- Tinted surface, surfaceVariant, outline, and elevation levels derived from the seed
|
|
10
10
|
- Optional Redux slice for wiring appearance and color into your store
|
|
@@ -56,6 +56,23 @@ export default function App() {
|
|
|
56
56
|
</AutoPaperProvider>
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
### Choosing a color harmony
|
|
60
|
+
|
|
61
|
+
The `harmony` prop controls how secondary and tertiary colors are derived from your seed. The default is `split-complementary`, which works well for most apps — it keeps secondary and tertiary close together in hue so they feel like a family of accents rather than three competing dominant colors.
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
<AutoPaperProvider appearance={appearance} color={color} harmony="split-complementary">
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
| Harmony | Offsets | Character |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| `split-complementary` *(default)* | 0°, +150°, +210° | Harmonious contrast — flanks the complement by ±30° |
|
|
70
|
+
| `triadic` | 0°, +120°, +240° | Equilateral — maximum variety, three equal-weight colors |
|
|
71
|
+
| `analogous` | 0°, +30°, +60° | Cohesive, natural — neighboring hues |
|
|
72
|
+
| `square` | 0°, +90°, +270° | Balanced, structured — right-angle symmetry |
|
|
73
|
+
| `complementary` | 0°, +90°, +180° | Bold — accent at 90° plus true opposite |
|
|
74
|
+
| `double-split` | 0°, +30°, +330° | Tight — flanks the primary by ±30° |
|
|
75
|
+
|
|
59
76
|
### With component defaults
|
|
60
77
|
|
|
61
78
|
Pass a `defaults` object to `Provider` to set prop defaults for any of the included wrapper components. Each component merges defaults under its own props, so per-instance props always win:
|
|
@@ -163,18 +180,20 @@ export default function App() {
|
|
|
163
180
|
|---|---|---|
|
|
164
181
|
| `appearance` | `'system' \| 'light' \| 'dark'` | Appearance mode |
|
|
165
182
|
| `color` | `string` | Seed color (hex, rgb, or CSS name) |
|
|
183
|
+
| `harmony` | `ColorHarmony` | Color harmony mode (default: `'split-complementary'`) |
|
|
166
184
|
| `children` | `ReactNode` | |
|
|
167
185
|
| `defaults` | `PaperDefaults` | Prop defaults for wrapper components (see below) |
|
|
168
186
|
| `onReady` | `() => void` | Called once when the theme first resolves |
|
|
169
187
|
| `statusBarProps` | `StatusBarProps` | Spread over the auto-derived `StatusBar` defaults |
|
|
170
188
|
| `style` | `StyleProp<ViewStyle>` | Applied to the wrapper `View` |
|
|
171
189
|
|
|
172
|
-
### `useComputedTheme(appearance, color)`
|
|
190
|
+
### `useComputedTheme(appearance, color, harmony?)`
|
|
173
191
|
|
|
174
192
|
Returns `MD3Theme | null`. `null` on the first render while the theme computes.
|
|
175
193
|
|
|
176
194
|
```ts
|
|
177
195
|
const theme = useComputedTheme('system', '#6750a4')
|
|
196
|
+
const theme = useComputedTheme('system', '#6750a4', 'triadic')
|
|
178
197
|
```
|
|
179
198
|
|
|
180
199
|
### `Appbar`
|
|
@@ -264,9 +283,14 @@ const appearance = useSelector((state: RootState) => selectThemeAppearance(state
|
|
|
264
283
|
|
|
265
284
|
```ts
|
|
266
285
|
import { getTriadicPalette, getBlendedColor, isDarkColor, getRgb, getHex } from '@rific/auto-paper'
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
286
|
+
import type { ColorHarmony } from '@rific/auto-paper'
|
|
287
|
+
|
|
288
|
+
getTriadicPalette('#6750a4') // split-complementary (default)
|
|
289
|
+
getTriadicPalette('#6750a4', 'triadic') // → { primary, secondary, tertiary }
|
|
290
|
+
getTriadicPalette('#6750a4', 'analogous')
|
|
291
|
+
getTriadicPalette('#6750a4', 'square')
|
|
292
|
+
getTriadicPalette('#6750a4', 'complementary')
|
|
293
|
+
getTriadicPalette('#6750a4', 'double-split')
|
|
270
294
|
|
|
271
295
|
getBlendedColor('#ff0000', '#0000ff', 0.5) // → '#800080'
|
|
272
296
|
isDarkColor('#6750a4') // → true
|
package/dist/index.d.mts
CHANGED
|
@@ -1,52 +1,119 @@
|
|
|
1
1
|
import * as react_native_paper_lib_typescript_utils_forwardRef from 'react-native-paper/lib/typescript/utils/forwardRef';
|
|
2
2
|
import * as react_native from 'react-native';
|
|
3
|
-
import { TextInput as TextInput$1, StatusBarProps
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
3
|
+
import { StyleProp, ViewStyle, TextInput as TextInput$1, StatusBarProps } from 'react-native';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import React__default, { ReactNode } from 'react';
|
|
6
6
|
import * as react_native_paper from 'react-native-paper';
|
|
7
|
-
import { AppbarHeaderProps, BottomNavigationRoute, BottomNavigationProps, BottomNavigation as BottomNavigation$1, ButtonProps, ChipProps, FABProps, IconButtonProps,
|
|
8
|
-
export { AppbarHeaderProps, BottomNavigationProps, BottomNavigationRoute, ButtonProps, ChipProps, FABProps, IconButtonProps, TextInputProps } from 'react-native-paper';
|
|
7
|
+
import { AppbarHeaderProps, MD3Theme, BottomNavigationRoute, BottomNavigationProps, BottomNavigation as BottomNavigation$1, ButtonProps, ChipProps, DialogProps as DialogProps$1, DialogTitleProps, DialogContentProps, DialogActionsProps, DialogScrollAreaProps, FABProps, IconButtonProps, MenuProps as MenuProps$1, MenuItemProps, TextInputProps } from 'react-native-paper';
|
|
8
|
+
export { AppbarHeaderProps, BottomNavigationProps, BottomNavigationRoute, ButtonProps, ChipProps, FABProps, IconButtonProps, DialogProps as PaperDialogProps, MenuProps as PaperMenuProps, TextInputProps } from 'react-native-paper';
|
|
9
9
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
10
|
+
import { BlurViewProps as BlurViewProps$1 } from 'expo-blur';
|
|
10
11
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
11
12
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
12
13
|
import * as redux from 'redux';
|
|
13
14
|
|
|
15
|
+
declare function useBlur(override?: boolean): boolean;
|
|
16
|
+
|
|
14
17
|
declare function Header({ style, ...props }: AppbarHeaderProps): react_jsx_runtime.JSX.Element;
|
|
15
18
|
declare const Appbar: {
|
|
16
19
|
Header: typeof Header;
|
|
17
20
|
Content: {
|
|
18
|
-
({ color: titleColor, subtitle, subtitleStyle, onPress, disabled, style, titleRef, titleStyle, title, titleMaxFontSizeMultiplier, mode, theme: themeOverrides, testID, ...rest }: react_native_paper.Props):
|
|
21
|
+
({ color: titleColor, subtitle, subtitleStyle, onPress, disabled, style, titleRef, titleStyle, title, titleMaxFontSizeMultiplier, mode, theme: themeOverrides, testID, ...rest }: react_native_paper.Props): React.JSX.Element;
|
|
19
22
|
displayName: string;
|
|
20
23
|
};
|
|
21
24
|
Action: react_native_paper_lib_typescript_utils_forwardRef.ForwardRefComponent<react_native.View, react_native_paper.AppbarActionProps>;
|
|
22
25
|
BackAction: react_native_paper_lib_typescript_utils_forwardRef.ForwardRefComponent<react_native.View, react_native_paper.AppbarBackActionProps>;
|
|
23
26
|
};
|
|
24
27
|
|
|
28
|
+
type ColorHarmony = 'triadic' | 'split-complementary' | 'analogous' | 'square' | 'complementary' | 'double-split';
|
|
29
|
+
type TriadicPalette = {
|
|
30
|
+
primary: string;
|
|
31
|
+
secondary: string;
|
|
32
|
+
tertiary: string;
|
|
33
|
+
};
|
|
34
|
+
declare function getTriadicPalette(primaryColor: string, harmony?: ColorHarmony): TriadicPalette;
|
|
35
|
+
|
|
36
|
+
type ThemeAppearance = 'system' | 'light' | 'dark';
|
|
37
|
+
declare function useComputedTheme(appearance: ThemeAppearance, color: string, harmony?: ColorHarmony): MD3Theme | null;
|
|
38
|
+
|
|
39
|
+
type Props$2 = {
|
|
40
|
+
value: ThemeAppearance;
|
|
41
|
+
onChange: (appearance: ThemeAppearance) => void;
|
|
42
|
+
};
|
|
43
|
+
declare const AppearancePicker: ({ value, onChange }: Props$2) => react_jsx_runtime.JSX.Element;
|
|
44
|
+
|
|
45
|
+
type BlurViewProps = BlurViewProps$1 & {
|
|
46
|
+
blur?: boolean;
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
elevation?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
49
|
+
style?: StyleProp<ViewStyle>;
|
|
50
|
+
};
|
|
51
|
+
declare const BlurView: ({ blur, children, elevation, style, ...props }: BlurViewProps) => react_jsx_runtime.JSX.Element;
|
|
52
|
+
|
|
25
53
|
declare function BottomNavigationComponent<Route extends BottomNavigationRoute>(props: BottomNavigationProps<Route>): react_jsx_runtime.JSX.Element;
|
|
26
54
|
declare namespace BottomNavigationComponent {
|
|
27
55
|
var Bar: (props: BarProps) => react_jsx_runtime.JSX.Element;
|
|
28
56
|
var SceneMap: <Route extends BottomNavigationRoute>(scenes: {
|
|
29
|
-
[key: string]:
|
|
57
|
+
[key: string]: React__default.ComponentType<{
|
|
30
58
|
route: Route;
|
|
31
59
|
jumpTo: (key: string) => void;
|
|
32
60
|
}>;
|
|
33
61
|
}) => ({ route, jumpTo, }: {
|
|
34
62
|
route: Route;
|
|
35
63
|
jumpTo: (key: string) => void;
|
|
36
|
-
}) =>
|
|
64
|
+
}) => React__default.JSX.Element;
|
|
37
65
|
}
|
|
38
|
-
type BarProps =
|
|
66
|
+
type BarProps = React__default.ComponentProps<typeof BottomNavigation$1.Bar>;
|
|
39
67
|
declare const BottomNavigation: typeof BottomNavigationComponent;
|
|
40
68
|
|
|
41
69
|
declare function Button(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
42
70
|
|
|
43
71
|
declare function Chip(props: ChipProps): react_jsx_runtime.JSX.Element;
|
|
44
72
|
|
|
73
|
+
type SeedColor = {
|
|
74
|
+
label: string;
|
|
75
|
+
value: string;
|
|
76
|
+
};
|
|
77
|
+
declare const defaultColors: SeedColor[];
|
|
78
|
+
type Props$1 = {
|
|
79
|
+
value: string;
|
|
80
|
+
onChange: (color: string) => void;
|
|
81
|
+
colors?: SeedColor[];
|
|
82
|
+
blur?: boolean;
|
|
83
|
+
};
|
|
84
|
+
declare const ColorPicker: ({ value, onChange, colors, blur: blurProp }: Props$1) => react_jsx_runtime.JSX.Element;
|
|
85
|
+
|
|
86
|
+
type DialogProps = DialogProps$1 & {
|
|
87
|
+
blur?: boolean;
|
|
88
|
+
};
|
|
89
|
+
declare function DialogComponent({ blur: blurProp, visible, onDismiss, children, style, ...rest }: DialogProps): react_jsx_runtime.JSX.Element | null;
|
|
90
|
+
declare namespace DialogComponent {
|
|
91
|
+
var Title: React__default.FC<DialogTitleProps>;
|
|
92
|
+
var Content: React__default.FC<DialogContentProps>;
|
|
93
|
+
var Actions: React__default.FC<DialogActionsProps>;
|
|
94
|
+
var ScrollArea: React__default.FC<DialogScrollAreaProps>;
|
|
95
|
+
}
|
|
96
|
+
declare const Dialog: typeof DialogComponent;
|
|
97
|
+
|
|
45
98
|
declare function FAB(props: FABProps): react_jsx_runtime.JSX.Element;
|
|
46
99
|
|
|
100
|
+
type Props = {
|
|
101
|
+
value: ColorHarmony;
|
|
102
|
+
onChange: (harmony: ColorHarmony) => void;
|
|
103
|
+
blur?: boolean;
|
|
104
|
+
};
|
|
105
|
+
declare const HarmonyPicker: ({ value, onChange, blur: blurProp }: Props) => react_jsx_runtime.JSX.Element;
|
|
106
|
+
|
|
47
107
|
declare function IconButton(props: IconButtonProps): react_jsx_runtime.JSX.Element;
|
|
48
108
|
|
|
49
|
-
|
|
109
|
+
type MenuProps = MenuProps$1 & {
|
|
110
|
+
blur?: boolean;
|
|
111
|
+
};
|
|
112
|
+
declare const Menu: (({ blur: blurProp, children, ...props }: MenuProps) => react_jsx_runtime.JSX.Element) & {
|
|
113
|
+
Item: React__default.FC<MenuItemProps>;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
declare const TextInput: React.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & React.RefAttributes<TextInput$1>>;
|
|
50
117
|
|
|
51
118
|
type PaperDefaults = {
|
|
52
119
|
AppbarHeader?: Partial<AppbarHeaderProps>;
|
|
@@ -59,45 +126,83 @@ type PaperDefaults = {
|
|
|
59
126
|
};
|
|
60
127
|
declare function usePaperDefaults(): PaperDefaults;
|
|
61
128
|
|
|
62
|
-
type ThemeAppearance = 'system' | 'light' | 'dark';
|
|
63
|
-
declare function useComputedTheme(appearance: ThemeAppearance, color: string): MD3Theme | null;
|
|
64
|
-
|
|
65
129
|
type ThemeState = {
|
|
66
130
|
appearance: ThemeAppearance;
|
|
131
|
+
blur: boolean;
|
|
67
132
|
color: string;
|
|
133
|
+
harmony: ColorHarmony;
|
|
68
134
|
};
|
|
69
135
|
declare function createThemeReducer(initialState?: Partial<ThemeState>): redux.Reducer<{
|
|
70
136
|
appearance: ThemeAppearance;
|
|
137
|
+
blur: boolean;
|
|
71
138
|
color: string;
|
|
139
|
+
harmony: ColorHarmony;
|
|
72
140
|
}>;
|
|
73
141
|
declare const themeActions: _reduxjs_toolkit.CaseReducerActions<{
|
|
74
142
|
initialize: (state: ThemeState, action: PayloadAction<Partial<ThemeState>>) => {
|
|
75
143
|
appearance: ThemeAppearance;
|
|
144
|
+
blur: boolean;
|
|
76
145
|
color: string;
|
|
146
|
+
harmony: ColorHarmony;
|
|
77
147
|
};
|
|
78
148
|
setAppearance: (state: ThemeState, action: PayloadAction<ThemeAppearance>) => {
|
|
79
149
|
appearance: ThemeAppearance;
|
|
150
|
+
blur: boolean;
|
|
80
151
|
color: string;
|
|
152
|
+
harmony: ColorHarmony;
|
|
153
|
+
};
|
|
154
|
+
setBlur: (state: ThemeState, action: PayloadAction<boolean>) => {
|
|
155
|
+
blur: boolean;
|
|
156
|
+
appearance: ThemeAppearance;
|
|
157
|
+
color: string;
|
|
158
|
+
harmony: ColorHarmony;
|
|
81
159
|
};
|
|
82
160
|
setColor: (state: ThemeState, action: PayloadAction<string>) => {
|
|
83
161
|
color: string;
|
|
84
162
|
appearance: ThemeAppearance;
|
|
163
|
+
blur: boolean;
|
|
164
|
+
harmony: ColorHarmony;
|
|
165
|
+
};
|
|
166
|
+
setHarmony: (state: ThemeState, action: PayloadAction<ColorHarmony>) => {
|
|
167
|
+
harmony: ColorHarmony;
|
|
168
|
+
appearance: ThemeAppearance;
|
|
169
|
+
blur: boolean;
|
|
170
|
+
color: string;
|
|
85
171
|
};
|
|
86
172
|
}, "theme">;
|
|
87
173
|
declare const themeReducer: redux.Reducer<ThemeState>;
|
|
88
174
|
declare const selectThemeAppearance: (state: ThemeState) => ThemeAppearance;
|
|
175
|
+
declare const selectThemeBlur: (state: ThemeState) => boolean;
|
|
89
176
|
declare const selectThemeColor: (state: ThemeState) => string;
|
|
177
|
+
declare const selectThemeHarmony: (state: ThemeState) => ColorHarmony;
|
|
90
178
|
|
|
91
|
-
type
|
|
179
|
+
type ThemeSettings = {
|
|
92
180
|
appearance: ThemeAppearance;
|
|
181
|
+
blur: boolean;
|
|
182
|
+
blurTint: number;
|
|
93
183
|
color: string;
|
|
184
|
+
harmony: ColorHarmony;
|
|
185
|
+
};
|
|
186
|
+
declare const defaultThemeSettings: ThemeSettings;
|
|
187
|
+
type ThemeSettingsContextType = {
|
|
188
|
+
settings: ThemeSettings;
|
|
189
|
+
set: (patch: Partial<ThemeSettings>) => void;
|
|
190
|
+
};
|
|
191
|
+
declare const ThemeSettingsContext: React.Context<ThemeSettingsContextType>;
|
|
192
|
+
|
|
193
|
+
type ProviderProps = {
|
|
194
|
+
overrides?: Partial<ThemeSettings>;
|
|
195
|
+
onChange?: (settings: ThemeSettings) => void;
|
|
94
196
|
children: ReactNode;
|
|
95
197
|
defaults?: PaperDefaults;
|
|
198
|
+
onNavBarChange?: (color: string, dark: boolean) => void;
|
|
96
199
|
onReady?: () => void;
|
|
97
200
|
statusBarProps?: StatusBarProps;
|
|
98
201
|
style?: StyleProp<ViewStyle>;
|
|
99
202
|
};
|
|
100
|
-
declare function Provider({
|
|
203
|
+
declare function Provider({ overrides, onChange, children, defaults, onNavBarChange, onReady, statusBarProps, style }: ProviderProps): react_jsx_runtime.JSX.Element | null;
|
|
204
|
+
|
|
205
|
+
declare const useThemeSettings: () => ThemeSettingsContextType;
|
|
101
206
|
|
|
102
207
|
declare const getBlendedColor: (foreground: string, background: string, alpha: number) => string;
|
|
103
208
|
|
|
@@ -111,13 +216,6 @@ type RGB = {
|
|
|
111
216
|
};
|
|
112
217
|
declare const getRgb: (value: string) => RGB | null;
|
|
113
218
|
|
|
114
|
-
type TriadicPalette = {
|
|
115
|
-
primary: string;
|
|
116
|
-
secondary: string;
|
|
117
|
-
tertiary: string;
|
|
118
|
-
};
|
|
119
|
-
declare function getTriadicPalette(primaryColor: string): TriadicPalette;
|
|
120
|
-
|
|
121
219
|
declare const isDarkColor: (value: string) => boolean;
|
|
122
220
|
|
|
123
|
-
export { Appbar, BottomNavigation, Button, Chip, FAB, IconButton, type PaperDefaults, Provider, type ProviderProps, type RGB, TextInput, type ThemeAppearance, type ThemeState, type TriadicPalette, createThemeReducer, getBlendedColor, getHex, getRgb, getTriadicPalette, isDarkColor, selectThemeAppearance, selectThemeColor, themeActions, themeReducer, useComputedTheme, usePaperDefaults };
|
|
221
|
+
export { Appbar, AppearancePicker, BlurView, type BlurViewProps, BottomNavigation, Button, Chip, type ColorHarmony, ColorPicker, Dialog, type DialogProps, FAB, HarmonyPicker, IconButton, Menu, type MenuProps, type PaperDefaults, Provider, type ProviderProps, type RGB, type SeedColor, TextInput, type ThemeAppearance, type ThemeSettings, ThemeSettingsContext, type ThemeSettingsContextType, type ThemeState, type TriadicPalette, createThemeReducer, defaultColors, defaultThemeSettings, getBlendedColor, getHex, getRgb, getTriadicPalette, isDarkColor, selectThemeAppearance, selectThemeBlur, selectThemeColor, selectThemeHarmony, themeActions, themeReducer, useBlur, useComputedTheme, usePaperDefaults, useThemeSettings };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,52 +1,119 @@
|
|
|
1
1
|
import * as react_native_paper_lib_typescript_utils_forwardRef from 'react-native-paper/lib/typescript/utils/forwardRef';
|
|
2
2
|
import * as react_native from 'react-native';
|
|
3
|
-
import { TextInput as TextInput$1, StatusBarProps
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
3
|
+
import { StyleProp, ViewStyle, TextInput as TextInput$1, StatusBarProps } from 'react-native';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import React__default, { ReactNode } from 'react';
|
|
6
6
|
import * as react_native_paper from 'react-native-paper';
|
|
7
|
-
import { AppbarHeaderProps, BottomNavigationRoute, BottomNavigationProps, BottomNavigation as BottomNavigation$1, ButtonProps, ChipProps, FABProps, IconButtonProps,
|
|
8
|
-
export { AppbarHeaderProps, BottomNavigationProps, BottomNavigationRoute, ButtonProps, ChipProps, FABProps, IconButtonProps, TextInputProps } from 'react-native-paper';
|
|
7
|
+
import { AppbarHeaderProps, MD3Theme, BottomNavigationRoute, BottomNavigationProps, BottomNavigation as BottomNavigation$1, ButtonProps, ChipProps, DialogProps as DialogProps$1, DialogTitleProps, DialogContentProps, DialogActionsProps, DialogScrollAreaProps, FABProps, IconButtonProps, MenuProps as MenuProps$1, MenuItemProps, TextInputProps } from 'react-native-paper';
|
|
8
|
+
export { AppbarHeaderProps, BottomNavigationProps, BottomNavigationRoute, ButtonProps, ChipProps, FABProps, IconButtonProps, DialogProps as PaperDialogProps, MenuProps as PaperMenuProps, TextInputProps } from 'react-native-paper';
|
|
9
9
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
10
|
+
import { BlurViewProps as BlurViewProps$1 } from 'expo-blur';
|
|
10
11
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
11
12
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
12
13
|
import * as redux from 'redux';
|
|
13
14
|
|
|
15
|
+
declare function useBlur(override?: boolean): boolean;
|
|
16
|
+
|
|
14
17
|
declare function Header({ style, ...props }: AppbarHeaderProps): react_jsx_runtime.JSX.Element;
|
|
15
18
|
declare const Appbar: {
|
|
16
19
|
Header: typeof Header;
|
|
17
20
|
Content: {
|
|
18
|
-
({ color: titleColor, subtitle, subtitleStyle, onPress, disabled, style, titleRef, titleStyle, title, titleMaxFontSizeMultiplier, mode, theme: themeOverrides, testID, ...rest }: react_native_paper.Props):
|
|
21
|
+
({ color: titleColor, subtitle, subtitleStyle, onPress, disabled, style, titleRef, titleStyle, title, titleMaxFontSizeMultiplier, mode, theme: themeOverrides, testID, ...rest }: react_native_paper.Props): React.JSX.Element;
|
|
19
22
|
displayName: string;
|
|
20
23
|
};
|
|
21
24
|
Action: react_native_paper_lib_typescript_utils_forwardRef.ForwardRefComponent<react_native.View, react_native_paper.AppbarActionProps>;
|
|
22
25
|
BackAction: react_native_paper_lib_typescript_utils_forwardRef.ForwardRefComponent<react_native.View, react_native_paper.AppbarBackActionProps>;
|
|
23
26
|
};
|
|
24
27
|
|
|
28
|
+
type ColorHarmony = 'triadic' | 'split-complementary' | 'analogous' | 'square' | 'complementary' | 'double-split';
|
|
29
|
+
type TriadicPalette = {
|
|
30
|
+
primary: string;
|
|
31
|
+
secondary: string;
|
|
32
|
+
tertiary: string;
|
|
33
|
+
};
|
|
34
|
+
declare function getTriadicPalette(primaryColor: string, harmony?: ColorHarmony): TriadicPalette;
|
|
35
|
+
|
|
36
|
+
type ThemeAppearance = 'system' | 'light' | 'dark';
|
|
37
|
+
declare function useComputedTheme(appearance: ThemeAppearance, color: string, harmony?: ColorHarmony): MD3Theme | null;
|
|
38
|
+
|
|
39
|
+
type Props$2 = {
|
|
40
|
+
value: ThemeAppearance;
|
|
41
|
+
onChange: (appearance: ThemeAppearance) => void;
|
|
42
|
+
};
|
|
43
|
+
declare const AppearancePicker: ({ value, onChange }: Props$2) => react_jsx_runtime.JSX.Element;
|
|
44
|
+
|
|
45
|
+
type BlurViewProps = BlurViewProps$1 & {
|
|
46
|
+
blur?: boolean;
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
elevation?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
49
|
+
style?: StyleProp<ViewStyle>;
|
|
50
|
+
};
|
|
51
|
+
declare const BlurView: ({ blur, children, elevation, style, ...props }: BlurViewProps) => react_jsx_runtime.JSX.Element;
|
|
52
|
+
|
|
25
53
|
declare function BottomNavigationComponent<Route extends BottomNavigationRoute>(props: BottomNavigationProps<Route>): react_jsx_runtime.JSX.Element;
|
|
26
54
|
declare namespace BottomNavigationComponent {
|
|
27
55
|
var Bar: (props: BarProps) => react_jsx_runtime.JSX.Element;
|
|
28
56
|
var SceneMap: <Route extends BottomNavigationRoute>(scenes: {
|
|
29
|
-
[key: string]:
|
|
57
|
+
[key: string]: React__default.ComponentType<{
|
|
30
58
|
route: Route;
|
|
31
59
|
jumpTo: (key: string) => void;
|
|
32
60
|
}>;
|
|
33
61
|
}) => ({ route, jumpTo, }: {
|
|
34
62
|
route: Route;
|
|
35
63
|
jumpTo: (key: string) => void;
|
|
36
|
-
}) =>
|
|
64
|
+
}) => React__default.JSX.Element;
|
|
37
65
|
}
|
|
38
|
-
type BarProps =
|
|
66
|
+
type BarProps = React__default.ComponentProps<typeof BottomNavigation$1.Bar>;
|
|
39
67
|
declare const BottomNavigation: typeof BottomNavigationComponent;
|
|
40
68
|
|
|
41
69
|
declare function Button(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
42
70
|
|
|
43
71
|
declare function Chip(props: ChipProps): react_jsx_runtime.JSX.Element;
|
|
44
72
|
|
|
73
|
+
type SeedColor = {
|
|
74
|
+
label: string;
|
|
75
|
+
value: string;
|
|
76
|
+
};
|
|
77
|
+
declare const defaultColors: SeedColor[];
|
|
78
|
+
type Props$1 = {
|
|
79
|
+
value: string;
|
|
80
|
+
onChange: (color: string) => void;
|
|
81
|
+
colors?: SeedColor[];
|
|
82
|
+
blur?: boolean;
|
|
83
|
+
};
|
|
84
|
+
declare const ColorPicker: ({ value, onChange, colors, blur: blurProp }: Props$1) => react_jsx_runtime.JSX.Element;
|
|
85
|
+
|
|
86
|
+
type DialogProps = DialogProps$1 & {
|
|
87
|
+
blur?: boolean;
|
|
88
|
+
};
|
|
89
|
+
declare function DialogComponent({ blur: blurProp, visible, onDismiss, children, style, ...rest }: DialogProps): react_jsx_runtime.JSX.Element | null;
|
|
90
|
+
declare namespace DialogComponent {
|
|
91
|
+
var Title: React__default.FC<DialogTitleProps>;
|
|
92
|
+
var Content: React__default.FC<DialogContentProps>;
|
|
93
|
+
var Actions: React__default.FC<DialogActionsProps>;
|
|
94
|
+
var ScrollArea: React__default.FC<DialogScrollAreaProps>;
|
|
95
|
+
}
|
|
96
|
+
declare const Dialog: typeof DialogComponent;
|
|
97
|
+
|
|
45
98
|
declare function FAB(props: FABProps): react_jsx_runtime.JSX.Element;
|
|
46
99
|
|
|
100
|
+
type Props = {
|
|
101
|
+
value: ColorHarmony;
|
|
102
|
+
onChange: (harmony: ColorHarmony) => void;
|
|
103
|
+
blur?: boolean;
|
|
104
|
+
};
|
|
105
|
+
declare const HarmonyPicker: ({ value, onChange, blur: blurProp }: Props) => react_jsx_runtime.JSX.Element;
|
|
106
|
+
|
|
47
107
|
declare function IconButton(props: IconButtonProps): react_jsx_runtime.JSX.Element;
|
|
48
108
|
|
|
49
|
-
|
|
109
|
+
type MenuProps = MenuProps$1 & {
|
|
110
|
+
blur?: boolean;
|
|
111
|
+
};
|
|
112
|
+
declare const Menu: (({ blur: blurProp, children, ...props }: MenuProps) => react_jsx_runtime.JSX.Element) & {
|
|
113
|
+
Item: React__default.FC<MenuItemProps>;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
declare const TextInput: React.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & React.RefAttributes<TextInput$1>>;
|
|
50
117
|
|
|
51
118
|
type PaperDefaults = {
|
|
52
119
|
AppbarHeader?: Partial<AppbarHeaderProps>;
|
|
@@ -59,45 +126,83 @@ type PaperDefaults = {
|
|
|
59
126
|
};
|
|
60
127
|
declare function usePaperDefaults(): PaperDefaults;
|
|
61
128
|
|
|
62
|
-
type ThemeAppearance = 'system' | 'light' | 'dark';
|
|
63
|
-
declare function useComputedTheme(appearance: ThemeAppearance, color: string): MD3Theme | null;
|
|
64
|
-
|
|
65
129
|
type ThemeState = {
|
|
66
130
|
appearance: ThemeAppearance;
|
|
131
|
+
blur: boolean;
|
|
67
132
|
color: string;
|
|
133
|
+
harmony: ColorHarmony;
|
|
68
134
|
};
|
|
69
135
|
declare function createThemeReducer(initialState?: Partial<ThemeState>): redux.Reducer<{
|
|
70
136
|
appearance: ThemeAppearance;
|
|
137
|
+
blur: boolean;
|
|
71
138
|
color: string;
|
|
139
|
+
harmony: ColorHarmony;
|
|
72
140
|
}>;
|
|
73
141
|
declare const themeActions: _reduxjs_toolkit.CaseReducerActions<{
|
|
74
142
|
initialize: (state: ThemeState, action: PayloadAction<Partial<ThemeState>>) => {
|
|
75
143
|
appearance: ThemeAppearance;
|
|
144
|
+
blur: boolean;
|
|
76
145
|
color: string;
|
|
146
|
+
harmony: ColorHarmony;
|
|
77
147
|
};
|
|
78
148
|
setAppearance: (state: ThemeState, action: PayloadAction<ThemeAppearance>) => {
|
|
79
149
|
appearance: ThemeAppearance;
|
|
150
|
+
blur: boolean;
|
|
80
151
|
color: string;
|
|
152
|
+
harmony: ColorHarmony;
|
|
153
|
+
};
|
|
154
|
+
setBlur: (state: ThemeState, action: PayloadAction<boolean>) => {
|
|
155
|
+
blur: boolean;
|
|
156
|
+
appearance: ThemeAppearance;
|
|
157
|
+
color: string;
|
|
158
|
+
harmony: ColorHarmony;
|
|
81
159
|
};
|
|
82
160
|
setColor: (state: ThemeState, action: PayloadAction<string>) => {
|
|
83
161
|
color: string;
|
|
84
162
|
appearance: ThemeAppearance;
|
|
163
|
+
blur: boolean;
|
|
164
|
+
harmony: ColorHarmony;
|
|
165
|
+
};
|
|
166
|
+
setHarmony: (state: ThemeState, action: PayloadAction<ColorHarmony>) => {
|
|
167
|
+
harmony: ColorHarmony;
|
|
168
|
+
appearance: ThemeAppearance;
|
|
169
|
+
blur: boolean;
|
|
170
|
+
color: string;
|
|
85
171
|
};
|
|
86
172
|
}, "theme">;
|
|
87
173
|
declare const themeReducer: redux.Reducer<ThemeState>;
|
|
88
174
|
declare const selectThemeAppearance: (state: ThemeState) => ThemeAppearance;
|
|
175
|
+
declare const selectThemeBlur: (state: ThemeState) => boolean;
|
|
89
176
|
declare const selectThemeColor: (state: ThemeState) => string;
|
|
177
|
+
declare const selectThemeHarmony: (state: ThemeState) => ColorHarmony;
|
|
90
178
|
|
|
91
|
-
type
|
|
179
|
+
type ThemeSettings = {
|
|
92
180
|
appearance: ThemeAppearance;
|
|
181
|
+
blur: boolean;
|
|
182
|
+
blurTint: number;
|
|
93
183
|
color: string;
|
|
184
|
+
harmony: ColorHarmony;
|
|
185
|
+
};
|
|
186
|
+
declare const defaultThemeSettings: ThemeSettings;
|
|
187
|
+
type ThemeSettingsContextType = {
|
|
188
|
+
settings: ThemeSettings;
|
|
189
|
+
set: (patch: Partial<ThemeSettings>) => void;
|
|
190
|
+
};
|
|
191
|
+
declare const ThemeSettingsContext: React.Context<ThemeSettingsContextType>;
|
|
192
|
+
|
|
193
|
+
type ProviderProps = {
|
|
194
|
+
overrides?: Partial<ThemeSettings>;
|
|
195
|
+
onChange?: (settings: ThemeSettings) => void;
|
|
94
196
|
children: ReactNode;
|
|
95
197
|
defaults?: PaperDefaults;
|
|
198
|
+
onNavBarChange?: (color: string, dark: boolean) => void;
|
|
96
199
|
onReady?: () => void;
|
|
97
200
|
statusBarProps?: StatusBarProps;
|
|
98
201
|
style?: StyleProp<ViewStyle>;
|
|
99
202
|
};
|
|
100
|
-
declare function Provider({
|
|
203
|
+
declare function Provider({ overrides, onChange, children, defaults, onNavBarChange, onReady, statusBarProps, style }: ProviderProps): react_jsx_runtime.JSX.Element | null;
|
|
204
|
+
|
|
205
|
+
declare const useThemeSettings: () => ThemeSettingsContextType;
|
|
101
206
|
|
|
102
207
|
declare const getBlendedColor: (foreground: string, background: string, alpha: number) => string;
|
|
103
208
|
|
|
@@ -111,13 +216,6 @@ type RGB = {
|
|
|
111
216
|
};
|
|
112
217
|
declare const getRgb: (value: string) => RGB | null;
|
|
113
218
|
|
|
114
|
-
type TriadicPalette = {
|
|
115
|
-
primary: string;
|
|
116
|
-
secondary: string;
|
|
117
|
-
tertiary: string;
|
|
118
|
-
};
|
|
119
|
-
declare function getTriadicPalette(primaryColor: string): TriadicPalette;
|
|
120
|
-
|
|
121
219
|
declare const isDarkColor: (value: string) => boolean;
|
|
122
220
|
|
|
123
|
-
export { Appbar, BottomNavigation, Button, Chip, FAB, IconButton, type PaperDefaults, Provider, type ProviderProps, type RGB, TextInput, type ThemeAppearance, type ThemeState, type TriadicPalette, createThemeReducer, getBlendedColor, getHex, getRgb, getTriadicPalette, isDarkColor, selectThemeAppearance, selectThemeColor, themeActions, themeReducer, useComputedTheme, usePaperDefaults };
|
|
221
|
+
export { Appbar, AppearancePicker, BlurView, type BlurViewProps, BottomNavigation, Button, Chip, type ColorHarmony, ColorPicker, Dialog, type DialogProps, FAB, HarmonyPicker, IconButton, Menu, type MenuProps, type PaperDefaults, Provider, type ProviderProps, type RGB, type SeedColor, TextInput, type ThemeAppearance, type ThemeSettings, ThemeSettingsContext, type ThemeSettingsContextType, type ThemeState, type TriadicPalette, createThemeReducer, defaultColors, defaultThemeSettings, getBlendedColor, getHex, getRgb, getTriadicPalette, isDarkColor, selectThemeAppearance, selectThemeBlur, selectThemeColor, selectThemeHarmony, themeActions, themeReducer, useBlur, useComputedTheme, usePaperDefaults, useThemeSettings };
|