react-native-boxes 1.0.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.
Files changed (55) hide show
  1. package/README.md +1 -0
  2. package/dist/Bar.d.ts +26 -0
  3. package/dist/Bar.js +159 -0
  4. package/dist/Bar.js.map +1 -0
  5. package/dist/Box.d.ts +14 -0
  6. package/dist/Box.js +103 -0
  7. package/dist/Box.js.map +1 -0
  8. package/dist/Button.d.ts +20 -0
  9. package/dist/Button.js +220 -0
  10. package/dist/Button.js.map +1 -0
  11. package/dist/Image.d.ts +21 -0
  12. package/dist/Image.js +79 -0
  13. package/dist/Image.js.map +1 -0
  14. package/dist/Input.d.ts +27 -0
  15. package/dist/Input.js +190 -0
  16. package/dist/Input.js.map +1 -0
  17. package/dist/Message.d.ts +7 -0
  18. package/dist/Message.js +97 -0
  19. package/dist/Message.js.map +1 -0
  20. package/dist/Modal.d.ts +22 -0
  21. package/dist/Modal.js +247 -0
  22. package/dist/Modal.js.map +1 -0
  23. package/dist/Styles.d.ts +113 -0
  24. package/dist/Styles.js +105 -0
  25. package/dist/Styles.js.map +1 -0
  26. package/dist/Text.d.ts +5 -0
  27. package/dist/Text.js +49 -0
  28. package/dist/Text.js.map +1 -0
  29. package/dist/ThemeContext.d.ts +93 -0
  30. package/dist/ThemeContext.js +26 -0
  31. package/dist/ThemeContext.js.map +1 -0
  32. package/dist/demo.d.ts +5 -0
  33. package/dist/demo.js +301 -0
  34. package/dist/demo.js.map +1 -0
  35. package/dist/index.d.ts +8 -0
  36. package/dist/index.js +25 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/utils.d.ts +5 -0
  39. package/dist/utils.js +45 -0
  40. package/dist/utils.js.map +1 -0
  41. package/package.json +37 -0
  42. package/src/Bar.tsx +185 -0
  43. package/src/Box.tsx +106 -0
  44. package/src/Button.tsx +282 -0
  45. package/src/Image.tsx +107 -0
  46. package/src/Input.tsx +244 -0
  47. package/src/Message.tsx +90 -0
  48. package/src/Modal.tsx +306 -0
  49. package/src/Styles.tsx +117 -0
  50. package/src/Text.tsx +56 -0
  51. package/src/ThemeContext.ts +25 -0
  52. package/src/demo.tsx +383 -0
  53. package/src/index.tsx +8 -0
  54. package/src/utils.ts +49 -0
  55. package/tsconfig.json +25 -0
package/dist/Modal.js ADDED
@@ -0,0 +1,247 @@
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 react_native_safe_area_context_1 = require("react-native-safe-area-context");
36
+ const BottomSheet = (props) => {
37
+ const [modalVisible, setModalVisible] = (0, react_1.useState)(false);
38
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
39
+ let cancellable = props.cancellable != undefined ?
40
+ props.cancellable : true;
41
+ (0, react_1.useEffect)(() => {
42
+ setModalVisible(props.visible);
43
+ }, [props.visible]);
44
+ function cancel() {
45
+ setModalVisible(false);
46
+ if (props.onDismiss) {
47
+ props.onDismiss();
48
+ }
49
+ }
50
+ return (<react_native_1.View style={styles.container}>
51
+ <react_native_1.Modal onDismiss={() => {
52
+ }} animationType="fade" transparent={true} visible={modalVisible} onRequestClose={() => {
53
+ cancel();
54
+ }}>
55
+ <react_native_1.TouchableHighlight onPress={() => {
56
+ cancel();
57
+ }} style={{
58
+ flex: 1,
59
+ backgroundColor: 'rgba(0, 0, 0, 0.5)'
60
+ }}>
61
+ <react_native_1.View />
62
+ </react_native_1.TouchableHighlight>
63
+
64
+ </react_native_1.Modal>
65
+
66
+ <react_native_1.Modal onDismiss={() => {
67
+ cancel();
68
+ }} style={{
69
+ flex: 1
70
+ }} animationType="slide" transparent={true} visible={modalVisible} onRequestClose={() => cancel()}>
71
+ <react_native_1.View style={[styles.modalContainer, {
72
+ backgroundColor: theme.colors.forground
73
+ }]}>
74
+ <react_native_1.View style={[{
75
+ paddingTop: theme.dimens.space.md,
76
+ paddingStart: theme.dimens.space.lg,
77
+ paddingEnd: theme.dimens.space.lg,
78
+ }]}>
79
+ <Box_1.HBox style={{
80
+ justifyContent: 'space-between',
81
+ width: '100%'
82
+ }}>
83
+ <react_native_1.View style={{ width: theme.dimens.icon.md }}/>
84
+ {typeof props.title == 'string' ? (<Text_1.Subtitle style={{
85
+ fontFamily: theme.fonts.Bold
86
+ }}>{props.title.toString()}</Text_1.Subtitle>) : <>{props.title}</>}
87
+ {cancellable ? (<react_native_1.TouchableOpacity style={{
88
+ padding: theme.dimens.space.sm
89
+ }} onPress={() => {
90
+ cancel();
91
+ }}>
92
+ <Image_1.Icon color={theme.colors.caption} name="close"/>
93
+ </react_native_1.TouchableOpacity>) : (<react_native_1.View style={{ width: theme.dimens.icon.md }}/>)}
94
+ </Box_1.HBox>
95
+ <Box_1.VBox style={{
96
+ width: '100%'
97
+ }}>
98
+ <react_native_1.ScrollView nestedScrollEnabled={true} showsVerticalScrollIndicator={false} style={{
99
+ flex: 1,
100
+ maxHeight: 500,
101
+ }}>
102
+ {props.children}
103
+ </react_native_1.ScrollView>
104
+ </Box_1.VBox>
105
+ </react_native_1.View>
106
+ </react_native_1.View>
107
+ </react_native_1.Modal>
108
+ </react_native_1.View>);
109
+ };
110
+ exports.BottomSheet = BottomSheet;
111
+ const styles = react_native_1.StyleSheet.create({
112
+ container: {
113
+ flex: 1,
114
+ justifyContent: 'center',
115
+ alignItems: 'center',
116
+ },
117
+ modalContainer: (0, utils_1.isDesktop)() ? {
118
+ marginLeft: '20%',
119
+ marginRight: '20%',
120
+ marginBottom: '1%',
121
+ width: '60%',
122
+ overflow: 'hidden',
123
+ borderBottomRightRadius: 20,
124
+ borderBottomLeftRadius: 20,
125
+ borderTopLeftRadius: 20,
126
+ borderTopRightRadius: 20,
127
+ position: 'absolute',
128
+ left: 0,
129
+ right: 0,
130
+ bottom: 0,
131
+ } : {
132
+ position: 'absolute',
133
+ left: 0,
134
+ right: 0,
135
+ bottom: 0,
136
+ borderTopLeftRadius: 20,
137
+ borderTopRightRadius: 20,
138
+ }
139
+ });
140
+ function Expand(props) {
141
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
142
+ const [expanded, setExpanded] = (0, react_1.useState)(props.initialExpand != undefined ? props.initialExpand : false);
143
+ const [contentHeight, setContentHeight] = (0, react_1.useState)(null);
144
+ const spinValue = (0, react_1.useRef)(new react_native_1.Animated.Value(expanded ? 1 : 0)).current;
145
+ const [initDone, setInitDone] = (0, react_1.useState)(false);
146
+ const [fadeAnim] = (0, react_1.useState)(new react_native_1.Animated.Value(0));
147
+ (0, react_1.useEffect)(() => {
148
+ react_native_1.Animated.timing(spinValue, {
149
+ toValue: expanded ? 1 : 0,
150
+ duration: props.duration || 200,
151
+ easing: react_native_1.Easing.ease,
152
+ useNativeDriver: false
153
+ }).start();
154
+ react_native_1.Animated.timing(fadeAnim, {
155
+ toValue: expanded ? 0 : -20,
156
+ duration: props.duration || 200, // Animation duration in milliseconds
157
+ useNativeDriver: true // Add this line for better performance
158
+ }).start();
159
+ }, [expanded]);
160
+ (0, react_1.useEffect)(() => {
161
+ setInitDone(true);
162
+ }, []);
163
+ const toggleExpand = () => {
164
+ if (props.onChange) {
165
+ props.onChange(!expanded);
166
+ }
167
+ setExpanded(!expanded);
168
+ };
169
+ var onLayoutContent = (event) => {
170
+ if (!contentHeight) {
171
+ setContentHeight(event.nativeEvent.layout.height);
172
+ }
173
+ };
174
+ if (react_native_1.Platform.OS == "web") {
175
+ const [initalLayoutWait, setinitalLayoutWait] = (0, react_1.useState)(false);
176
+ (0, react_1.useEffect)(() => {
177
+ setTimeout(() => {
178
+ setinitalLayoutWait(true);
179
+ }, 2000);
180
+ }, []);
181
+ onLayoutContent = (event) => {
182
+ if (!contentHeight && initalLayoutWait) {
183
+ setContentHeight(event.nativeEvent.layout.height);
184
+ }
185
+ };
186
+ }
187
+ const spinInterpolated = spinValue.interpolate({
188
+ easing: react_native_1.Easing.ease,
189
+ inputRange: [0, 1],
190
+ outputRange: ['0deg', '90deg']
191
+ });
192
+ const ExpandIcon = () => {
193
+ const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
194
+ return (<react_native_1.Pressable style={[{
195
+ borderRadius: theme.dimens.space.md,
196
+ padding: theme.dimens.space.md,
197
+ }, {
198
+ backgroundColor: props.titleBackgroundColor
199
+ }]} onPress={toggleExpand}>
200
+ <Box_1.Center style={props.iconPosition == 'right' ? {
201
+ paddingLeft: theme.dimens.space.sm,
202
+ justifyContent: 'space-between',
203
+ flexDirection: 'row-reverse',
204
+ } : {
205
+ justifyContent: 'flex-start',
206
+ flexDirection: 'row',
207
+ }}>
208
+ <react_native_1.Animated.View style={{
209
+ transform: [{ rotate: spinInterpolated }],
210
+ }}>
211
+ <Image_1.Icon color={theme.colors.text} {...props.iconStyle} name={props.iconName || 'chevron-right'}/>
212
+ </react_native_1.Animated.View>
213
+ <Box_1.HBox style={{
214
+ width: theme.dimens.space.sm
215
+ }}/>
216
+ <Text_1.Title style={[{
217
+ padding: 0,
218
+ paddingLeft: props.iconPosition == 'right' ? 0 :
219
+ theme.dimens.space.sm,
220
+ margin: 0,
221
+ fontSize: theme.dimens.font.md
222
+ }, props.titleStyle]}>{props.title}</Text_1.Title>
223
+ </Box_1.Center>
224
+ </react_native_1.Pressable>);
225
+ };
226
+ return (<Box_1.VBox style={[{
227
+ padding: 0,
228
+ borderRadius: theme.dimens.space.md,
229
+ margin: theme.dimens.space.sm
230
+ }, {
231
+ justifyContent: (props.iconPosition) == 'right' ? 'space-between' : 'flex-start'
232
+ }, props.style]}>
233
+ <ExpandIcon />
234
+ <react_native_1.Animated.View style={{
235
+ zIndex: -1,
236
+ transform: [{ translateY: fadeAnim }],
237
+ height: expanded ? 'auto' : 0,
238
+ overflow: 'hidden'
239
+ }} onLayout={onLayoutContent}>
240
+ {(expanded || initDone) && (<Box_1.VBox onLayout={onLayoutContent}>
241
+ {props.children}
242
+ </Box_1.VBox>)}
243
+ </react_native_1.Animated.View>
244
+ </Box_1.VBox>);
245
+ }
246
+ exports.Expand = Expand;
247
+ //# 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;AACzC,mFAAmE;AAS5D,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IACnD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IACxD,MAAM,KAAK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,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY;aACnF,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAChB;YAAA,CAAC,UAAU,CAAC,AAAD,EACX;YAAA,CAAC,uBAAQ,CAAC,IAAI,CACV,KAAK,CAAC,CAAC;YACH,MAAM,EAAE,CAAC,CAAC;YACV,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;AAjJD,wBAiJC"}
@@ -0,0 +1,113 @@
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
+ container: {
98
+ marginTop: number;
99
+ backgroundColor: string;
100
+ };
101
+ center: {
102
+ alignContent: "center";
103
+ justifyContent: "center";
104
+ };
105
+ textHead: {
106
+ color: string;
107
+ fontSize: number;
108
+ };
109
+ text: {
110
+ fontFamily: string;
111
+ fontSize: number;
112
+ };
113
+ };
package/dist/Styles.js ADDED
@@ -0,0 +1,105 @@
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
+ container: {
86
+ marginTop: dimens.space.xl,
87
+ backgroundColor: colors.background,
88
+ },
89
+ center: {
90
+ alignContent: 'center',
91
+ justifyContent: 'center'
92
+ },
93
+ textHead: {
94
+ color: colors.text,
95
+ fontSize: dimens.font.xl,
96
+ },
97
+ text: {
98
+ fontFamily: fonts.Regular,
99
+ fontSize: dimens.font.md,
100
+ }
101
+ });
102
+ return Styles;
103
+ }
104
+ exports.createStyle = createStyle;
105
+ //# 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,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;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;AAxBD,kCAwBC"}
package/dist/Text.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { TextProps } from "react-native";
2
+ export declare function TextView(props: TextProps): import("react").JSX.Element;
3
+ export declare function Subtitle(props: TextProps): import("react").JSX.Element;
4
+ export declare function Title(props: TextProps): import("react").JSX.Element;
5
+ export declare function Caption(props: TextProps): import("react").JSX.Element;
package/dist/Text.js ADDED
@@ -0,0 +1,49 @@
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
+ return (<react_native_1.Text {...props} style={[{
10
+ flexWrap: 'wrap',
11
+ color: theme.colors.text,
12
+ padding: theme.dimens.space.sm
13
+ }, theme.styles.text, props.style]}/>);
14
+ }
15
+ exports.TextView = TextView;
16
+ function Subtitle(props) {
17
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
18
+ return (<TextView {...props} style={[
19
+ {
20
+ fontSize: theme.dimens.font.lg,
21
+ color: theme.colors.text
22
+ },
23
+ props.style
24
+ ]}/>);
25
+ }
26
+ exports.Subtitle = Subtitle;
27
+ function Title(props) {
28
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
29
+ return (<TextView {...props} style={[
30
+ {
31
+ fontSize: theme.dimens.font.xl,
32
+ color: theme.colors.heading
33
+ },
34
+ props.style
35
+ ]}/>);
36
+ }
37
+ exports.Title = Title;
38
+ function Caption(props) {
39
+ const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
40
+ return (<TextView {...props} style={[
41
+ {
42
+ fontSize: theme.dimens.font.sm,
43
+ color: theme.colors.caption
44
+ },
45
+ props.style
46
+ ]}/>);
47
+ }
48
+ exports.Caption = Caption;
49
+ //# 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,KAAgB;IACrC,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAA;IACtC,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;gBACxB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;aACjC,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAG,CAC7C,CAAA;AACL,CAAC;AAVD,4BAUC;AAGD,SAAgB,QAAQ,CAAC,KAAgB;IACrC,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAA;IACtC,OAAO,CACH,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;YACxB;gBACI,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBAC9B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;aAC3B;YACD,KAAK,CAAC,KAAK;SACd,CAAC,EAAG,CACR,CAAA;AACL,CAAC;AAXD,4BAWC;AAGD,SAAgB,KAAK,CAAC,KAAgB;IAClC,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAA;IACtC,OAAO,CACH,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;YACxB;gBACI,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBAC9B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;aAC9B;YACD,KAAK,CAAC,KAAK;SACd,CAAC,EAAG,CACR,CAAA;AACL,CAAC;AAXD,sBAWC;AAED,SAAgB,OAAO,CAAC,KAAgB;IACpC,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAA;IACtC,OAAO,CACH,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;YACxB;gBACI,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBAC9B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;aAC9B;YACD,KAAK,CAAC,KAAK;SACd,CAAC,EAAG,CACR,CAAA;AACL,CAAC;AAXD,0BAWC"}
@@ -0,0 +1,93 @@
1
+ import { Colors, Dimens, Fonts } from "./Styles";
2
+ import { randomColor } from "./utils";
3
+ declare const DEFAULT_STYLE: {
4
+ container: {
5
+ marginTop: number;
6
+ backgroundColor: string;
7
+ };
8
+ center: {
9
+ alignContent: "center";
10
+ justifyContent: "center";
11
+ };
12
+ textHead: {
13
+ color: string;
14
+ fontSize: number;
15
+ };
16
+ text: {
17
+ fontFamily: string;
18
+ fontSize: number;
19
+ };
20
+ };
21
+ export declare class Theme {
22
+ appname: string;
23
+ styles: typeof DEFAULT_STYLE;
24
+ dimens: typeof Dimens;
25
+ colors: typeof Colors;
26
+ fonts: typeof Fonts;
27
+ randomColor: typeof randomColor;
28
+ constructor(appname?: string, 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
+ }, dimens?: {
49
+ space: {
50
+ xs: number;
51
+ sm: number;
52
+ md: number;
53
+ lg: number;
54
+ xl: number;
55
+ };
56
+ font: {
57
+ sm: number;
58
+ md: number;
59
+ lg: number;
60
+ xl: number;
61
+ };
62
+ icon: {
63
+ sm: number;
64
+ md: number;
65
+ lg: number;
66
+ xl: number;
67
+ xxl: number;
68
+ };
69
+ }, fonts?: {
70
+ Regular: string;
71
+ Bold: string;
72
+ Styled: string;
73
+ }, styles?: {
74
+ container: {
75
+ marginTop: number;
76
+ backgroundColor: string;
77
+ };
78
+ center: {
79
+ alignContent: "center";
80
+ justifyContent: "center";
81
+ };
82
+ textHead: {
83
+ color: string;
84
+ fontSize: number;
85
+ };
86
+ text: {
87
+ fontFamily: string;
88
+ fontSize: number;
89
+ };
90
+ });
91
+ }
92
+ export declare const ThemeContext: import("react").Context<Theme>;
93
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThemeContext = exports.Theme = void 0;
4
+ const react_1 = require("react");
5
+ const Styles_1 = require("./Styles");
6
+ const utils_1 = require("./utils");
7
+ const DEFAULT_STYLE = (0, Styles_1.createStyle)(Styles_1.Dimens, Styles_1.Colors, Styles_1.Fonts);
8
+ class Theme {
9
+ appname = '';
10
+ styles;
11
+ dimens;
12
+ colors;
13
+ fonts;
14
+ randomColor = utils_1.randomColor;
15
+ constructor(appname = '', colors = Styles_1.Colors, dimens = Styles_1.Dimens, fonts = Styles_1.Fonts, styles = DEFAULT_STYLE) {
16
+ this.appname = appname;
17
+ this.fonts = fonts ?? Styles_1.Fonts;
18
+ this.colors = colors ?? Styles_1.Colors;
19
+ this.dimens = dimens ?? Styles_1.Dimens;
20
+ this.fonts = fonts ?? Styles_1.Fonts;
21
+ this.styles = styles ?? (0, Styles_1.createStyle)(this.dimens, this.colors, this.fonts);
22
+ }
23
+ }
24
+ exports.Theme = Theme;
25
+ exports.ThemeContext = (0, react_1.createContext)(new Theme());
26
+ //# sourceMappingURL=ThemeContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../src/ThemeContext.ts"],"names":[],"mappings":";;;AAAA,iCAAqC;AACrC,qCAAsF;AACtF,mCAAqC;AACrC,MAAM,aAAa,GAAG,IAAA,oBAAW,EAAC,eAAM,EAAE,eAAM,EAAE,cAAK,CAAC,CAAA;AACxD,MAAa,KAAK;IACd,OAAO,GAAW,EAAE,CAAA;IACpB,MAAM,CAAsB;IAC5B,MAAM,CAAe;IACrB,MAAM,CAAe;IACrB,KAAK,CAAc;IACnB,WAAW,GAAG,mBAAW,CAAA;IACzB,YAAY,OAAO,GAAG,EAAE,EACpB,MAAM,GAAG,eAAM,EACf,MAAM,GAAG,eAAM,EACf,KAAK,GAAG,cAAK,EACb,MAAM,GAAG,aAAa;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,cAAK,CAAA;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,eAAM,CAAA;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,eAAM,CAAA;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,cAAK,CAAA;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,IAAA,oBAAW,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IAC7E,CAAC;CACJ;AAnBD,sBAmBC;AACY,QAAA,YAAY,GAAG,IAAA,qBAAa,EAAC,IAAI,KAAK,EAAE,CAAC,CAAA"}
package/dist/demo.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface DemoScreenProps {
3
+ navigation?: any;
4
+ }
5
+ export declare function DemoScreen({ navigation }: DemoScreenProps): React.JSX.Element;