react-native-boxes 1.0.18 → 1.0.20

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/dist/Modal.js ADDED
@@ -0,0 +1,245 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Expand = exports.BottomSheet = void 0;
27
+ const React = __importStar(require("react"));
28
+ const react_1 = require("react");
29
+ const react_native_1 = require("react-native");
30
+ const Image_1 = require("./Image");
31
+ const utils_1 = require("./utils");
32
+ const ThemeContext_1 = require("./ThemeContext");
33
+ const Box_1 = require("./Box");
34
+ const Text_1 = require("./Text");
35
+ const BottomSheet = (props) => {
36
+ const [modalVisible, setModalVisible] = (0, react_1.useState)(false);
37
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
38
+ let cancellable = props.cancellable != undefined ?
39
+ props.cancellable : true;
40
+ (0, react_1.useEffect)(() => {
41
+ setModalVisible(props.visible);
42
+ }, [props.visible]);
43
+ function cancel() {
44
+ setModalVisible(false);
45
+ if (props.onDismiss) {
46
+ props.onDismiss();
47
+ }
48
+ }
49
+ return (<react_native_1.View style={styles.container}>
50
+ <react_native_1.Modal onDismiss={() => {
51
+ }} animationType="fade" transparent={true} visible={modalVisible} onRequestClose={() => {
52
+ cancel();
53
+ }}>
54
+ <react_native_1.TouchableHighlight onPress={() => {
55
+ cancel();
56
+ }} style={{
57
+ flex: 1,
58
+ backgroundColor: 'rgba(0, 0, 0, 0.5)'
59
+ }}>
60
+ <react_native_1.View />
61
+ </react_native_1.TouchableHighlight>
62
+
63
+ </react_native_1.Modal>
64
+
65
+ <react_native_1.Modal onDismiss={() => {
66
+ cancel();
67
+ }} style={{
68
+ flex: 1
69
+ }} animationType="slide" transparent={true} visible={modalVisible} onRequestClose={() => cancel()}>
70
+ <react_native_1.View style={[styles.modalContainer, {
71
+ backgroundColor: theme.colors.forground
72
+ }]}>
73
+ <react_native_1.View style={[{
74
+ paddingTop: theme.dimens.space.md,
75
+ paddingStart: theme.dimens.space.lg,
76
+ paddingEnd: theme.dimens.space.lg,
77
+ }]}>
78
+ <Box_1.HBox style={{
79
+ justifyContent: 'space-between',
80
+ width: '100%'
81
+ }}>
82
+ <react_native_1.View style={{ width: theme.dimens.icon.md }}/>
83
+ {typeof props.title == 'string' ? (<Text_1.Subtitle style={{
84
+ fontFamily: theme.fonts.Bold
85
+ }}>{props.title.toString()}</Text_1.Subtitle>) : <>{props.title}</>}
86
+ {cancellable ? (<react_native_1.TouchableOpacity style={{
87
+ padding: theme.dimens.space.sm
88
+ }} onPress={() => {
89
+ cancel();
90
+ }}>
91
+ <Image_1.Icon color={theme.colors.caption} name="close"/>
92
+ </react_native_1.TouchableOpacity>) : (<react_native_1.View style={{ width: theme.dimens.icon.md }}/>)}
93
+ </Box_1.HBox>
94
+ <Box_1.VBox style={{
95
+ width: '100%'
96
+ }}>
97
+ <react_native_1.ScrollView nestedScrollEnabled={true} showsVerticalScrollIndicator={false} style={{
98
+ flex: 1,
99
+ maxHeight: 500,
100
+ }}>
101
+ {props.children}
102
+ </react_native_1.ScrollView>
103
+ </Box_1.VBox>
104
+ </react_native_1.View>
105
+ </react_native_1.View>
106
+ </react_native_1.Modal>
107
+ </react_native_1.View>);
108
+ };
109
+ exports.BottomSheet = BottomSheet;
110
+ const styles = react_native_1.StyleSheet.create({
111
+ container: {
112
+ flex: 1,
113
+ justifyContent: 'center',
114
+ alignItems: 'center',
115
+ },
116
+ modalContainer: (0, utils_1.isDesktop)() ? {
117
+ marginLeft: '20%',
118
+ marginRight: '20%',
119
+ marginBottom: '1%',
120
+ width: '60%',
121
+ overflow: 'hidden',
122
+ borderBottomRightRadius: 20,
123
+ borderBottomLeftRadius: 20,
124
+ borderTopLeftRadius: 20,
125
+ borderTopRightRadius: 20,
126
+ position: 'absolute',
127
+ left: 0,
128
+ right: 0,
129
+ bottom: 0,
130
+ } : {
131
+ position: 'absolute',
132
+ left: 0,
133
+ right: 0,
134
+ bottom: 0,
135
+ borderTopLeftRadius: 20,
136
+ borderTopRightRadius: 20,
137
+ }
138
+ });
139
+ function Expand(props) {
140
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
141
+ const [expanded, setExpanded] = (0, react_1.useState)(props.initialExpand != undefined ? props.initialExpand : false);
142
+ const [contentHeight, setContentHeight] = (0, react_1.useState)(null);
143
+ const spinValue = (0, react_1.useRef)(new react_native_1.Animated.Value(expanded ? 1 : 0)).current;
144
+ const [initDone, setInitDone] = (0, react_1.useState)(false);
145
+ const [fadeAnim] = (0, react_1.useState)(new react_native_1.Animated.Value(0));
146
+ (0, react_1.useEffect)(() => {
147
+ react_native_1.Animated.timing(spinValue, {
148
+ toValue: expanded ? 1 : 0,
149
+ duration: props.duration || 200,
150
+ easing: react_native_1.Easing.ease,
151
+ useNativeDriver: false
152
+ }).start();
153
+ react_native_1.Animated.timing(fadeAnim, {
154
+ toValue: expanded ? 0 : -20,
155
+ duration: props.duration || 200, // Animation duration in milliseconds
156
+ useNativeDriver: true // Add this line for better performance
157
+ }).start();
158
+ }, [expanded]);
159
+ (0, react_1.useEffect)(() => {
160
+ setInitDone(true);
161
+ }, []);
162
+ const toggleExpand = () => {
163
+ if (props.onChange) {
164
+ props.onChange(!expanded);
165
+ }
166
+ setExpanded(!expanded);
167
+ };
168
+ var onLayoutContent = (event) => {
169
+ if (!contentHeight) {
170
+ setContentHeight(event.nativeEvent.layout.height);
171
+ }
172
+ };
173
+ if (react_native_1.Platform.OS == "web") {
174
+ const [initalLayoutWait, setinitalLayoutWait] = (0, react_1.useState)(false);
175
+ (0, react_1.useEffect)(() => {
176
+ setTimeout(() => {
177
+ setinitalLayoutWait(true);
178
+ }, 2000);
179
+ }, []);
180
+ onLayoutContent = (event) => {
181
+ if (!contentHeight && initalLayoutWait) {
182
+ setContentHeight(event.nativeEvent.layout.height);
183
+ }
184
+ };
185
+ }
186
+ const spinInterpolated = spinValue.interpolate({
187
+ easing: react_native_1.Easing.ease,
188
+ inputRange: [0, 1],
189
+ outputRange: ['0deg', '90deg']
190
+ });
191
+ const ExpandIcon = () => {
192
+ return (<react_native_1.Pressable style={[{
193
+ borderRadius: theme.dimens.space.md,
194
+ padding: theme.dimens.space.md,
195
+ }, {
196
+ backgroundColor: props.titleBackgroundColor
197
+ }]} onPress={toggleExpand}>
198
+ <Box_1.Center style={props.iconPosition == 'right' ? {
199
+ paddingLeft: theme.dimens.space.sm,
200
+ justifyContent: 'space-between',
201
+ flexDirection: 'row-reverse',
202
+ } : {
203
+ justifyContent: 'flex-start',
204
+ flexDirection: 'row',
205
+ }}>
206
+ <react_native_1.Animated.View style={{
207
+ transform: [{ rotate: spinInterpolated }],
208
+ }}>
209
+ <Image_1.Icon color={theme.colors.text} {...props.iconStyle} name={props.iconName || 'chevron-right'}/>
210
+ </react_native_1.Animated.View>
211
+ <Box_1.HBox style={{
212
+ width: theme.dimens.space.sm
213
+ }}/>
214
+ <Text_1.Title style={[{
215
+ padding: 0,
216
+ paddingLeft: props.iconPosition == 'right' ? 0 :
217
+ theme.dimens.space.sm,
218
+ margin: 0,
219
+ fontSize: theme.dimens.font.md
220
+ }, props.titleStyle]}>{props.title}</Text_1.Title>
221
+ </Box_1.Center>
222
+ </react_native_1.Pressable>);
223
+ };
224
+ return (<Box_1.VBox style={[{
225
+ padding: 0,
226
+ borderRadius: theme.dimens.space.md,
227
+ margin: theme.dimens.space.sm
228
+ }, {
229
+ justifyContent: (props.iconPosition) == 'right' ? 'space-between' : 'flex-start'
230
+ }, props.style]}>
231
+ <ExpandIcon />
232
+ <react_native_1.Animated.View style={{
233
+ zIndex: -1,
234
+ transform: [{ translateY: fadeAnim }],
235
+ height: expanded ? 'auto' : 0,
236
+ overflow: 'hidden'
237
+ }} onLayout={onLayoutContent}>
238
+ {(expanded || initDone) && (<Box_1.VBox onLayout={onLayoutContent}>
239
+ {props.children}
240
+ </Box_1.VBox>)}
241
+ </react_native_1.Animated.View>
242
+ </Box_1.VBox>);
243
+ }
244
+ exports.Expand = Expand;
245
+ //# sourceMappingURL=Modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../src/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,iCAAgE;AAChE,+CAAoM;AACpM,mCAA0C;AAC1C,mCAAoC;AACpC,iDAA8C;AAC9C,+BAA2C;AAC3C,iCAAyC;AASlC,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IACnD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAA;IACtC,IAAI,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,SAAS,CAAC,CAAC;QAC9C,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAA;IAE5B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ACV,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;YACrC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC7B,QAAQ,EAAE,QAAQ;SACrB,CAAC,CACF,QAAQ,CAAC,CAAC,eAAe,CAAC,CAC1B;gBAAA,CACI,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,CACtB,CAAC,UAAI,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,CAC5B;4BAAA,CAAC,KAAK,CAAC,QAAQ,CACnB;wBAAA,EAAE,UAAI,CAAC,CAEf,CACJ;YAAA,EAAE,uBAAQ,CAAC,IAAI,CACnB;QAAA,EAAE,UAAI,CAAC,CACV,CAAC;AACN,CAAC;AAhJD,wBAgJC"}
@@ -0,0 +1,119 @@
1
+ export declare const Dimens: {
2
+ space: {
3
+ xs: number;
4
+ sm: number;
5
+ md: number;
6
+ lg: number;
7
+ xl: number;
8
+ };
9
+ font: {
10
+ sm: number;
11
+ md: number;
12
+ lg: number;
13
+ xl: number;
14
+ };
15
+ icon: {
16
+ sm: number;
17
+ md: number;
18
+ lg: number;
19
+ xl: number;
20
+ xxl: number;
21
+ };
22
+ };
23
+ export declare const Fonts: {
24
+ Regular: string;
25
+ Bold: string;
26
+ Styled: string;
27
+ };
28
+ export declare const Colors: {
29
+ accent: string;
30
+ accentLight: string;
31
+ text: string;
32
+ caption: string;
33
+ heading: string;
34
+ background: string;
35
+ forground: string;
36
+ transparent: string;
37
+ semitransparent: string;
38
+ info: string;
39
+ success: string;
40
+ warning: string;
41
+ critical: string;
42
+ invert: {
43
+ text: string;
44
+ caption: string;
45
+ heading: string;
46
+ background: string;
47
+ };
48
+ };
49
+ export declare const LightColors: {
50
+ accent: string;
51
+ accentLight: string;
52
+ text: string;
53
+ caption: string;
54
+ heading: string;
55
+ background: string;
56
+ forground: string;
57
+ transparent: string;
58
+ semitransparent: string;
59
+ info: string;
60
+ success: string;
61
+ warning: string;
62
+ critical: string;
63
+ invert: {
64
+ text: string;
65
+ caption: string;
66
+ heading: string;
67
+ background: string;
68
+ };
69
+ };
70
+ export declare const DarkColors: {
71
+ accent: string;
72
+ accentLight: string;
73
+ text: string;
74
+ caption: string;
75
+ heading: string;
76
+ background: string;
77
+ forground: string;
78
+ transparent: string;
79
+ semitransparent: string;
80
+ info: string;
81
+ success: string;
82
+ warning: string;
83
+ critical: string;
84
+ invert: {
85
+ text: string;
86
+ caption: string;
87
+ heading: string;
88
+ background: string;
89
+ };
90
+ };
91
+ export declare function extendValues(dimens: typeof Dimens, colors: typeof Colors, fonts: typeof Fonts): {
92
+ dimens: typeof Dimens;
93
+ colors: typeof Colors;
94
+ fonts: typeof Fonts;
95
+ };
96
+ export declare function createStyle(dimens: typeof Dimens, colors: typeof Colors, fonts: typeof Fonts): {
97
+ safeAreaInset: {
98
+ top: number;
99
+ left: number;
100
+ right: number;
101
+ bottom: number;
102
+ };
103
+ container: {
104
+ marginTop: number;
105
+ backgroundColor: string;
106
+ };
107
+ center: {
108
+ alignContent: "center";
109
+ justifyContent: "center";
110
+ };
111
+ textHead: {
112
+ color: string;
113
+ fontSize: number;
114
+ };
115
+ text: {
116
+ fontFamily: string;
117
+ fontSize: number;
118
+ };
119
+ };
package/dist/Styles.js ADDED
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createStyle = exports.extendValues = exports.DarkColors = exports.LightColors = exports.Colors = exports.Fonts = exports.Dimens = void 0;
4
+ const react_native_1 = require("react-native");
5
+ exports.Dimens = {
6
+ space: {
7
+ xs: 1,
8
+ sm: 5,
9
+ md: 10,
10
+ lg: 20,
11
+ xl: 50,
12
+ },
13
+ font: {
14
+ sm: 12,
15
+ md: 14,
16
+ lg: 16,
17
+ xl: 24,
18
+ },
19
+ icon: {
20
+ sm: 12,
21
+ md: 20,
22
+ lg: 30,
23
+ xl: 50,
24
+ xxl: 80,
25
+ }
26
+ };
27
+ exports.Fonts = {
28
+ Regular: 'Regular',
29
+ Bold: 'Bold',
30
+ Styled: 'Styled',
31
+ };
32
+ exports.Colors = {
33
+ accent: '#1976D2',
34
+ accentLight: '#2196F3',
35
+ text: '#444444',
36
+ caption: '#A9A9A9',
37
+ heading: '#222222',
38
+ background: '#E6E6E6',
39
+ forground: '#fff',
40
+ transparent: 'transparent',
41
+ semitransparent: '#111a1a1c',
42
+ info: '#2196F3',
43
+ success: '#4CAF50',
44
+ warning: '#FFA726',
45
+ critical: '#F44336',
46
+ invert: {
47
+ text: '#fff',
48
+ caption: '#fff',
49
+ heading: '#fff',
50
+ background: '#1a1a1c'
51
+ }
52
+ };
53
+ exports.LightColors = exports.Colors;
54
+ exports.DarkColors = {
55
+ accent: '#1976D2',
56
+ accentLight: '#2196F3',
57
+ text: '#f2f2f2',
58
+ caption: '#565656',
59
+ heading: '#dddddd',
60
+ background: '#212121',
61
+ forground: '#191919',
62
+ transparent: 'transparent',
63
+ semitransparent: '#111a1a1c',
64
+ info: '#2196F3',
65
+ success: '#4CAF50',
66
+ warning: '#FFA726',
67
+ critical: '#F44336',
68
+ invert: {
69
+ text: '#fff',
70
+ caption: '#fff',
71
+ heading: '#fff',
72
+ background: '#E6E6E6'
73
+ }
74
+ };
75
+ function extendValues(dimens, colors, fonts) {
76
+ return {
77
+ dimens: Object.assign(dimens || {}, exports.Dimens),
78
+ colors: Object.assign(colors || {}, exports.Colors),
79
+ fonts: Object.assign(fonts || {}, exports.Fonts),
80
+ };
81
+ }
82
+ exports.extendValues = extendValues;
83
+ function createStyle(dimens, colors, fonts) {
84
+ const Styles = react_native_1.StyleSheet.create({
85
+ safeAreaInset: {
86
+ top: dimens.space.md,
87
+ left: 0,
88
+ right: 0,
89
+ bottom: dimens.space.md,
90
+ },
91
+ container: {
92
+ marginTop: dimens.space.xl,
93
+ backgroundColor: colors.background,
94
+ },
95
+ center: {
96
+ alignContent: 'center',
97
+ justifyContent: 'center'
98
+ },
99
+ textHead: {
100
+ color: colors.text,
101
+ fontSize: dimens.font.xl,
102
+ },
103
+ text: {
104
+ fontFamily: fonts.Regular,
105
+ fontSize: dimens.font.md,
106
+ }
107
+ });
108
+ return Styles;
109
+ }
110
+ exports.createStyle = createStyle;
111
+ //# sourceMappingURL=Styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Styles.js","sourceRoot":"","sources":["../src/Styles.tsx"],"names":[],"mappings":";;;AAAA,+CAA0C;AAE7B,QAAA,MAAM,GAAG;IAClB,KAAK,EAAE;QACH,EAAE,EAAE,CAAC;QACL,EAAE,EAAE,CAAC;QACL,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;KACT;IACD,IAAI,EAAE;QACF,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;KACT;IACD,IAAI,EAAE;QACF,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;QACN,GAAG,EAAE,EAAE;KACV;CACJ,CAAA;AAEY,QAAA,KAAK,GAAG;IACjB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACnB,CAAA;AAEY,QAAA,MAAM,GAAG;IAClB,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE,SAAS;IACtB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,aAAa;IAC1B,eAAe,EAAE,WAAW;IAC5B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,MAAM;QACf,OA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,CAAC,EAAE;YAC1B,eAAe,EAAE,MAAM,CAAC,UAAU;SACrC;QACD,MAAM,EAAE;YACJ,YAAY,EAAE,QAAQ;YACtB,cAAc,EAAE,QAAQ;SAC3B;QACD,QAAQ,EAAE;YACN,KAAK,EAAE,MAAM,CAAC,IAAI;YAClB,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;SAC3B;QACD,IAAI,EAAE;YACF,UAAU,EAAE,KAAK,CAAC,OAAO;YACzB,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;SAC3B;KACJ,CAAC,CAAC;IACH,OAAO,MAAM,CAAA;AACjB,CAAC;AA9BD,kCA8BC"}
package/dist/Text.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { TextProps } from "react-native";
2
+ export declare function TextView(props: TextProps & {
3
+ skipI18n?: boolean;
4
+ }): import("react").JSX.Element;
5
+ export declare function Subtitle(props: TextProps): import("react").JSX.Element;
6
+ export declare function Title(props: TextProps): import("react").JSX.Element;
7
+ export declare function Caption(props: TextProps): import("react").JSX.Element;
package/dist/Text.js ADDED
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Caption = exports.Title = exports.Subtitle = exports.TextView = void 0;
4
+ const react_1 = require("react");
5
+ const react_native_1 = require("react-native");
6
+ const ThemeContext_1 = require("./ThemeContext");
7
+ function TextView(props) {
8
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
9
+ let children = props.children;
10
+ if (theme.i18n && !props.skipI18n) {
11
+ if (children && typeof children == 'string') {
12
+ children = theme.i18n.t(children);
13
+ }
14
+ }
15
+ return (<react_native_1.Text {...props} style={[{
16
+ flexWrap: 'wrap',
17
+ color: theme.colors.text,
18
+ padding: theme.dimens.space.sm
19
+ }, theme.styles.text, props.style]}>
20
+ {children}
21
+ </react_native_1.Text>);
22
+ }
23
+ exports.TextView = TextView;
24
+ function Subtitle(props) {
25
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
26
+ return (<TextView {...props} style={[
27
+ {
28
+ fontSize: theme.dimens.font.lg,
29
+ color: theme.colors.text
30
+ },
31
+ props.style
32
+ ]}/>);
33
+ }
34
+ exports.Subtitle = Subtitle;
35
+ function Title(props) {
36
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
37
+ return (<TextView {...props} style={[
38
+ {
39
+ fontSize: theme.dimens.font.xl,
40
+ color: theme.colors.heading
41
+ },
42
+ props.style
43
+ ]}/>);
44
+ }
45
+ exports.Title = Title;
46
+ function Caption(props) {
47
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
48
+ return (<TextView {...props} style={[
49
+ {
50
+ fontSize: theme.dimens.font.sm,
51
+ color: theme.colors.caption
52
+ },
53
+ props.style
54
+ ]}/>);
55
+ }
56
+ exports.Caption = Caption;
57
+ //# sourceMappingURL=Text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.js","sourceRoot":"","sources":["../src/Text.tsx"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,+CAA+C;AAC/C,iDAA8C;AAE9C,SAAgB,QAAQ,CAAC,KAExB;IACG,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAA;IACtC,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAA;IAC7B,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QAChC,IAAI,QAAQ,IAAI,OAAO,QAAQ,IAAI,QAAQ,EAAE,CAAC;YAC1C,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;QACrC,CAAC;IACL,CAAC;IACD,OAAO,CACH,CAAC,mBAAI,CAAC,IAAI,KAAK,CAAC,CACZ,KAAK,CAAC,CAAC,CAAC;gBACJ,QAAQ,EAAE,MAAM;gBAChB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;g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AAE,KAAK,CAAC,MAAM,CAAC,OAAO;aAC9B;YACD,KAAK,CAAC,KAAK;SACd,CAAC,EAAG,CACR,CAAA;AACL,CAAC;AAXD,0BAWC"}
@@ -0,0 +1,110 @@
1
+ import { Colors, Dimens, Fonts } from "./Styles";
2
+ import { randomColor } from "./utils";
3
+ import { I18n } from "./I18n";
4
+ import { EdgeInsets } from "react-native-safe-area-context";
5
+ declare const DEFAULT_STYLE: {
6
+ safeAreaInset: {
7
+ top: number;
8
+ left: number;
9
+ right: number;
10
+ bottom: number;
11
+ };
12
+ container: {
13
+ marginTop: number;
14
+ backgroundColor: string;
15
+ };
16
+ center: {
17
+ alignContent: "center";
18
+ justifyContent: "center";
19
+ };
20
+ textHead: {
21
+ color: string;
22
+ fontSize: number;
23
+ };
24
+ text: {
25
+ fontFamily: string;
26
+ fontSize: number;
27
+ };
28
+ };
29
+ export declare class Theme {
30
+ appname: string;
31
+ styles: typeof DEFAULT_STYLE;
32
+ dimens: typeof Dimens;
33
+ colors: typeof Colors;
34
+ fonts: typeof Fonts;
35
+ i18n: I18n;
36
+ insets?: EdgeInsets;
37
+ randomColor: typeof randomColor;
38
+ constructor(appname?: string, colors?: {
39
+ accent: string;
40
+ accentLight: string;
41
+ text: string;
42
+ caption: string;
43
+ heading: string;
44
+ background: string;
45
+ forground: string;
46
+ transparent: string;
47
+ semitransparent: string;
48
+ info: string;
49
+ success: string;
50
+ warning: string;
51
+ critical: string;
52
+ invert: {
53
+ text: string;
54
+ caption: string;
55
+ heading: string;
56
+ background: string;
57
+ };
58
+ }, dimens?: {
59
+ space: {
60
+ xs: number;
61
+ sm: number;
62
+ md: number;
63
+ lg: number;
64
+ xl: number;
65
+ };
66
+ font: {
67
+ sm: number;
68
+ md: number;
69
+ lg: number;
70
+ xl: number;
71
+ };
72
+ icon: {
73
+ sm: number;
74
+ md: number;
75
+ lg: number;
76
+ xl: number;
77
+ xxl: number;
78
+ };
79
+ }, fonts?: {
80
+ Regular: string;
81
+ Bold: string;
82
+ Styled: string;
83
+ }, styles?: {
84
+ safeAreaInset: {
85
+ top: number;
86
+ left: number;
87
+ right: number;
88
+ bottom: number;
89
+ };
90
+ container: {
91
+ marginTop: number;
92
+ backgroundColor: string;
93
+ };
94
+ center: {
95
+ alignContent: "center";
96
+ justifyContent: "center";
97
+ };
98
+ textHead: {
99
+ color: string;
100
+ fontSize: number;
101
+ };
102
+ text: {
103
+ fontFamily: string;
104
+ fontSize: number;
105
+ };
106
+ }, i18n?: I18n);
107
+ setInsets(insets: EdgeInsets): void;
108
+ }
109
+ export declare const ThemeContext: import("react").Context<Theme>;
110
+ export {};