@rific/auto-paper 0.2.0 → 0.4.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 +117 -16
- package/dist/index.d.mts +130 -27
- package/dist/index.d.ts +130 -27
- package/dist/index.js +2197 -1886
- package/dist/index.mjs +1417 -1109
- package/package.json +6 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
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
|
|
3
|
+
import { StyleProp, ViewStyle, TextInput as TextInput$1, StatusBarProps } from 'react-native';
|
|
4
|
+
import * as react_native_paper from 'react-native-paper';
|
|
5
|
+
import { AppbarHeaderProps, MD3Theme, BottomNavigationRoute, BottomNavigationProps, BottomNavigation as BottomNavigation$1, ButtonProps, ChipProps as ChipProps$1, DialogProps as DialogProps$1, DialogTitleProps, DialogContentProps, DialogActionsProps, DialogScrollAreaProps, FABProps, IconButtonProps as IconButtonProps$1, MenuProps as MenuProps$1, MenuItemProps, TextInputProps } from 'react-native-paper';
|
|
6
|
+
export { AppbarHeaderProps, BottomNavigationProps, BottomNavigationRoute, ButtonProps, FABProps, ChipProps as PaperChipProps, DialogProps as PaperDialogProps, IconButtonProps as PaperIconButtonProps, MenuProps as PaperMenuProps, TextInputProps } from 'react-native-paper';
|
|
4
7
|
import * as react from 'react';
|
|
5
8
|
import react__default, { ReactNode } from 'react';
|
|
6
|
-
import
|
|
7
|
-
import { AppbarHeaderProps, BottomNavigationRoute, BottomNavigationProps, BottomNavigation as BottomNavigation$1, ButtonProps, ChipProps, FABProps, IconButtonProps, TextInputProps, MD3Theme } from 'react-native-paper';
|
|
8
|
-
export { AppbarHeaderProps, BottomNavigationProps, BottomNavigationRoute, ButtonProps, ChipProps, FABProps, IconButtonProps, TextInputProps } from 'react-native-paper';
|
|
9
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
|
+
import { BlurViewProps as BlurViewProps$1 } from 'expo-blur';
|
|
10
10
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
11
11
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
12
12
|
import * as redux from 'redux';
|
|
13
13
|
|
|
14
|
-
declare function
|
|
14
|
+
declare function useBlur(override?: boolean): boolean;
|
|
15
|
+
|
|
16
|
+
declare function Header({ style, ...props }: AppbarHeaderProps): react.JSX.Element;
|
|
15
17
|
declare const Appbar: {
|
|
16
18
|
Header: typeof Header;
|
|
17
19
|
Content: {
|
|
@@ -22,9 +24,34 @@ declare const Appbar: {
|
|
|
22
24
|
BackAction: react_native_paper_lib_typescript_utils_forwardRef.ForwardRefComponent<react_native.View, react_native_paper.AppbarBackActionProps>;
|
|
23
25
|
};
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
type ColorHarmony = 'triadic' | 'split-complementary' | 'analogous' | 'square' | 'complementary' | 'double-split';
|
|
28
|
+
type TriadicPalette = {
|
|
29
|
+
primary: string;
|
|
30
|
+
secondary: string;
|
|
31
|
+
tertiary: string;
|
|
32
|
+
};
|
|
33
|
+
declare function getTriadicPalette(primaryColor: string, harmony?: ColorHarmony): TriadicPalette;
|
|
34
|
+
|
|
35
|
+
type ThemeAppearance = 'system' | 'light' | 'dark';
|
|
36
|
+
declare function useComputedTheme(appearance: ThemeAppearance, color: string, harmony?: ColorHarmony): MD3Theme | null;
|
|
37
|
+
|
|
38
|
+
type Props$2 = {
|
|
39
|
+
value: ThemeAppearance;
|
|
40
|
+
onChange: (appearance: ThemeAppearance) => void;
|
|
41
|
+
};
|
|
42
|
+
declare const AppearancePicker: ({ value, onChange }: Props$2) => react.JSX.Element;
|
|
43
|
+
|
|
44
|
+
type BlurViewProps = BlurViewProps$1 & {
|
|
45
|
+
blur?: boolean;
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
elevation?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
48
|
+
style?: StyleProp<ViewStyle>;
|
|
49
|
+
};
|
|
50
|
+
declare const BlurView: ({ blur, children, elevation, style, ...props }: BlurViewProps) => react.JSX.Element;
|
|
51
|
+
|
|
52
|
+
declare function BottomNavigationComponent<Route extends BottomNavigationRoute>(props: BottomNavigationProps<Route>): react__default.JSX.Element;
|
|
26
53
|
declare namespace BottomNavigationComponent {
|
|
27
|
-
var Bar: (props: BarProps) =>
|
|
54
|
+
var Bar: (props: BarProps) => react__default.JSX.Element;
|
|
28
55
|
var SceneMap: <Route extends BottomNavigationRoute>(scenes: {
|
|
29
56
|
[key: string]: react__default.ComponentType<{
|
|
30
57
|
route: Route;
|
|
@@ -38,13 +65,58 @@ declare namespace BottomNavigationComponent {
|
|
|
38
65
|
type BarProps = react__default.ComponentProps<typeof BottomNavigation$1.Bar>;
|
|
39
66
|
declare const BottomNavigation: typeof BottomNavigationComponent;
|
|
40
67
|
|
|
41
|
-
declare function Button(props: ButtonProps):
|
|
68
|
+
declare function Button(props: ButtonProps): react.JSX.Element;
|
|
69
|
+
|
|
70
|
+
type ChipProps = ChipProps$1 & {
|
|
71
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'surface';
|
|
72
|
+
};
|
|
73
|
+
declare function Chip({ variant, style, selectedColor, ...props }: ChipProps): react.JSX.Element;
|
|
74
|
+
|
|
75
|
+
type SeedColor = {
|
|
76
|
+
label: string;
|
|
77
|
+
value: string;
|
|
78
|
+
};
|
|
79
|
+
declare const defaultColors: SeedColor[];
|
|
80
|
+
type Props$1 = {
|
|
81
|
+
value: string;
|
|
82
|
+
onChange: (color: string) => void;
|
|
83
|
+
colors?: SeedColor[];
|
|
84
|
+
blur?: boolean;
|
|
85
|
+
};
|
|
86
|
+
declare const ColorPicker: ({ value, onChange, colors, blur: blurProp }: Props$1) => react.JSX.Element;
|
|
42
87
|
|
|
43
|
-
|
|
88
|
+
type DialogProps = DialogProps$1 & {
|
|
89
|
+
blur?: boolean;
|
|
90
|
+
};
|
|
91
|
+
declare function DialogComponent({ blur: blurProp, visible, onDismiss, children, style, ...rest }: DialogProps): react__default.JSX.Element | null;
|
|
92
|
+
declare namespace DialogComponent {
|
|
93
|
+
var Title: react__default.FC<DialogTitleProps>;
|
|
94
|
+
var Content: react__default.FC<DialogContentProps>;
|
|
95
|
+
var Actions: react__default.FC<DialogActionsProps>;
|
|
96
|
+
var ScrollArea: react__default.FC<DialogScrollAreaProps>;
|
|
97
|
+
}
|
|
98
|
+
declare const Dialog: typeof DialogComponent;
|
|
44
99
|
|
|
45
|
-
declare function FAB(props: FABProps):
|
|
100
|
+
declare function FAB(props: FABProps): react.JSX.Element;
|
|
46
101
|
|
|
47
|
-
|
|
102
|
+
type Props = {
|
|
103
|
+
value: ColorHarmony;
|
|
104
|
+
onChange: (harmony: ColorHarmony) => void;
|
|
105
|
+
blur?: boolean;
|
|
106
|
+
};
|
|
107
|
+
declare const HarmonyPicker: ({ value, onChange, blur: blurProp }: Props) => react.JSX.Element;
|
|
108
|
+
|
|
109
|
+
type IconButtonProps = IconButtonProps$1 & {
|
|
110
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'surface';
|
|
111
|
+
};
|
|
112
|
+
declare function IconButton({ variant, iconColor, containerColor, ...props }: IconButtonProps): react.JSX.Element;
|
|
113
|
+
|
|
114
|
+
type MenuProps = MenuProps$1 & {
|
|
115
|
+
blur?: boolean;
|
|
116
|
+
};
|
|
117
|
+
declare const Menu: (({ blur: blurProp, children, ...props }: MenuProps) => react__default.JSX.Element) & {
|
|
118
|
+
Item: react__default.FC<MenuItemProps>;
|
|
119
|
+
};
|
|
48
120
|
|
|
49
121
|
declare const TextInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & react.RefAttributes<TextInput$1>>;
|
|
50
122
|
|
|
@@ -52,52 +124,90 @@ type PaperDefaults = {
|
|
|
52
124
|
AppbarHeader?: Partial<AppbarHeaderProps>;
|
|
53
125
|
BottomNavigation?: Partial<BottomNavigationProps<BottomNavigationRoute>>;
|
|
54
126
|
Button?: Partial<ButtonProps>;
|
|
55
|
-
Chip?: Partial<ChipProps>;
|
|
127
|
+
Chip?: Partial<ChipProps$1>;
|
|
56
128
|
FAB?: Partial<FABProps>;
|
|
57
|
-
IconButton?: Partial<IconButtonProps>;
|
|
129
|
+
IconButton?: Partial<IconButtonProps$1>;
|
|
58
130
|
TextInput?: Partial<TextInputProps>;
|
|
59
131
|
};
|
|
60
132
|
declare function usePaperDefaults(): PaperDefaults;
|
|
61
133
|
|
|
62
|
-
type ThemeAppearance = 'system' | 'light' | 'dark';
|
|
63
|
-
declare function useComputedTheme(appearance: ThemeAppearance, color: string): MD3Theme | null;
|
|
64
|
-
|
|
65
134
|
type ThemeState = {
|
|
66
135
|
appearance: ThemeAppearance;
|
|
136
|
+
blur: boolean;
|
|
67
137
|
color: string;
|
|
138
|
+
harmony: ColorHarmony;
|
|
68
139
|
};
|
|
69
140
|
declare function createThemeReducer(initialState?: Partial<ThemeState>): redux.Reducer<{
|
|
70
141
|
appearance: ThemeAppearance;
|
|
142
|
+
blur: boolean;
|
|
71
143
|
color: string;
|
|
144
|
+
harmony: ColorHarmony;
|
|
72
145
|
}>;
|
|
73
146
|
declare const themeActions: _reduxjs_toolkit.CaseReducerActions<{
|
|
74
147
|
initialize: (state: ThemeState, action: PayloadAction<Partial<ThemeState>>) => {
|
|
75
148
|
appearance: ThemeAppearance;
|
|
149
|
+
blur: boolean;
|
|
76
150
|
color: string;
|
|
151
|
+
harmony: ColorHarmony;
|
|
77
152
|
};
|
|
78
153
|
setAppearance: (state: ThemeState, action: PayloadAction<ThemeAppearance>) => {
|
|
79
154
|
appearance: ThemeAppearance;
|
|
155
|
+
blur: boolean;
|
|
80
156
|
color: string;
|
|
157
|
+
harmony: ColorHarmony;
|
|
158
|
+
};
|
|
159
|
+
setBlur: (state: ThemeState, action: PayloadAction<boolean>) => {
|
|
160
|
+
blur: boolean;
|
|
161
|
+
appearance: ThemeAppearance;
|
|
162
|
+
color: string;
|
|
163
|
+
harmony: ColorHarmony;
|
|
81
164
|
};
|
|
82
165
|
setColor: (state: ThemeState, action: PayloadAction<string>) => {
|
|
83
166
|
color: string;
|
|
84
167
|
appearance: ThemeAppearance;
|
|
168
|
+
blur: boolean;
|
|
169
|
+
harmony: ColorHarmony;
|
|
170
|
+
};
|
|
171
|
+
setHarmony: (state: ThemeState, action: PayloadAction<ColorHarmony>) => {
|
|
172
|
+
harmony: ColorHarmony;
|
|
173
|
+
appearance: ThemeAppearance;
|
|
174
|
+
blur: boolean;
|
|
175
|
+
color: string;
|
|
85
176
|
};
|
|
86
177
|
}, "theme">;
|
|
87
178
|
declare const themeReducer: redux.Reducer<ThemeState>;
|
|
88
179
|
declare const selectThemeAppearance: (state: ThemeState) => ThemeAppearance;
|
|
180
|
+
declare const selectThemeBlur: (state: ThemeState) => boolean;
|
|
89
181
|
declare const selectThemeColor: (state: ThemeState) => string;
|
|
182
|
+
declare const selectThemeHarmony: (state: ThemeState) => ColorHarmony;
|
|
90
183
|
|
|
91
|
-
type
|
|
184
|
+
type ThemeSettings = {
|
|
92
185
|
appearance: ThemeAppearance;
|
|
186
|
+
blur: boolean;
|
|
187
|
+
blurTint: number;
|
|
93
188
|
color: string;
|
|
189
|
+
harmony: ColorHarmony;
|
|
190
|
+
};
|
|
191
|
+
declare const defaultThemeSettings: ThemeSettings;
|
|
192
|
+
type ThemeSettingsContextType = {
|
|
193
|
+
settings: ThemeSettings;
|
|
194
|
+
set: (patch: Partial<ThemeSettings>) => void;
|
|
195
|
+
};
|
|
196
|
+
declare const ThemeSettingsContext: react.Context<ThemeSettingsContextType>;
|
|
197
|
+
|
|
198
|
+
type ProviderProps = {
|
|
199
|
+
initialValue?: Partial<ThemeSettings>;
|
|
200
|
+
onChange?: (settings: ThemeSettings) => void;
|
|
94
201
|
children: ReactNode;
|
|
95
202
|
defaults?: PaperDefaults;
|
|
203
|
+
onNavBarChange?: (color: string, dark: boolean) => void;
|
|
96
204
|
onReady?: () => void;
|
|
97
205
|
statusBarProps?: StatusBarProps;
|
|
98
206
|
style?: StyleProp<ViewStyle>;
|
|
99
207
|
};
|
|
100
|
-
declare function Provider({
|
|
208
|
+
declare function Provider({ initialValue, onChange, children, defaults, onNavBarChange, onReady, statusBarProps, style }: ProviderProps): react.JSX.Element | null;
|
|
209
|
+
|
|
210
|
+
declare const useThemeSettings: () => ThemeSettingsContextType;
|
|
101
211
|
|
|
102
212
|
declare const getBlendedColor: (foreground: string, background: string, alpha: number) => string;
|
|
103
213
|
|
|
@@ -111,13 +221,6 @@ type RGB = {
|
|
|
111
221
|
};
|
|
112
222
|
declare const getRgb: (value: string) => RGB | null;
|
|
113
223
|
|
|
114
|
-
type TriadicPalette = {
|
|
115
|
-
primary: string;
|
|
116
|
-
secondary: string;
|
|
117
|
-
tertiary: string;
|
|
118
|
-
};
|
|
119
|
-
declare function getTriadicPalette(primaryColor: string): TriadicPalette;
|
|
120
|
-
|
|
121
224
|
declare const isDarkColor: (value: string) => boolean;
|
|
122
225
|
|
|
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 };
|
|
226
|
+
export { Appbar, AppearancePicker, BlurView, type BlurViewProps, BottomNavigation, Button, Chip, type ChipProps, type ColorHarmony, ColorPicker, Dialog, type DialogProps, FAB, HarmonyPicker, IconButton, type IconButtonProps, 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 };
|