@jescon-technologies/react-native-ui-kit 0.0.17 → 0.0.19

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/index.d.ts CHANGED
@@ -30,7 +30,3 @@ export * from './src/Navigation/useIsFocused';
30
30
  export * from './src/Navigation/useFocusEffect';
31
31
  export { default as CBackHandler } from './src/CustomComponents/CBackHandler';
32
32
  export * from './src/CommonStyle/ComponentFunctions';
33
- export * from './src/CommonStyle/commonStyle';
34
- export * from './src/CommonStyle/componentStyle';
35
- export * from './src/CommonStyle/optionListStyles';
36
- export * from './src/CommonStyle/PopupStyle';
package/index.js CHANGED
@@ -29,7 +29,3 @@ export * from './src/Navigation/useIsFocused';
29
29
  export * from './src/Navigation/useFocusEffect';
30
30
  export { default as CBackHandler } from './src/CustomComponents/CBackHandler';
31
31
  export * from './src/CommonStyle/ComponentFunctions';
32
- export * from './src/CommonStyle/commonStyle';
33
- export * from './src/CommonStyle/componentStyle';
34
- export * from './src/CommonStyle/optionListStyles';
35
- export * from './src/CommonStyle/PopupStyle';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jescon-technologies/react-native-ui-kit",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "A React Native module for Jescon Technologies that provides react-native-ui-kit",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -12,7 +12,7 @@ import { Global } from '../../../../../src/Common/Global';
12
12
  ;
13
13
  import HIcons from '../Hoc/HIcons';
14
14
  import { ValueCheck } from '../CommonStyle/ComponentFunctions';
15
- import { normalize } from '../CommonStyle/componentStyle';
15
+ import { normalize} from '../CommonStyle/ComponentFunctions';
16
16
  import CModalOverlay from '../CustomComponents/CModalOverlay';
17
17
 
18
18
  /**
@@ -11,7 +11,7 @@ import { Global } from '../../../../../src/Common/Global';
11
11
  ;
12
12
  import HIcons from '../Hoc/HIcons';
13
13
  import { ValueCheck } from '../CommonStyle/ComponentFunctions';
14
- import { normalize } from '../CommonStyle/componentStyle';
14
+ import { normalize} from '../CommonStyle/ComponentFunctions';
15
15
 
16
16
  /**
17
17
  * Types
@@ -1,7 +1,6 @@
1
1
  import React, { ErrorInfo, ReactNode } from 'react';
2
2
  import { Button, StyleSheet, Text, View, Image } from 'react-native';
3
- import { notifyMessage } from '../CommonStyle/ComponentFunctions';
4
- import { normalize } from '../CommonStyle/componentStyle';
3
+ import { notifyMessage, normalize } from '../CommonStyle/ComponentFunctions';
5
4
 
6
5
  interface Props {
7
6
  children: ReactNode;
@@ -1,5 +1,3 @@
1
- import ComponentStyles from '../CommonStyle/componentStyle';
2
- import { colors, fontWeight } from '../CommonStyle/commonStyle';
3
1
  import {
4
2
  ToastAndroid,
5
3
  Platform,
@@ -9,15 +7,12 @@ import {
9
7
  DeviceEventEmitter,
10
8
  PixelRatio,
11
9
  Dimensions,
12
- View,
13
- Image,
14
10
  ViewStyle,
15
11
  TextStyle,
16
12
  ImageStyle,
17
13
  } from 'react-native';
18
14
  import NetInfo from '@react-native-community/netinfo';
19
15
  import { Global } from '../../../../../src/Common/Global';
20
- ;
21
16
  import React from 'react';
22
17
 
23
18
  const {
@@ -26,6 +21,7 @@ const {
26
21
  } = Dimensions.get('window');
27
22
 
28
23
  const scale = SCREEN_WIDTH / 320;
24
+ const radio_height = 20;
29
25
 
30
26
  // Type definitions
31
27
  interface ShadowStyle {
@@ -50,6 +46,24 @@ interface NetInfoState {
50
46
  details?: any;
51
47
  }
52
48
 
49
+ // Utility Functions
50
+ export function normalize(size: number): number {
51
+ const newSize = scale < 1.5 ? size * scale : size * 1.6;
52
+ if (Platform.OS === 'ios') {
53
+ return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 2;
54
+ } else {
55
+ return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 2;
56
+ }
57
+ }
58
+
59
+ export function width(itemwidth: number): number {
60
+ return SCREEN_WIDTH * (itemwidth / 100);
61
+ }
62
+
63
+ export function height(itemheight: number): number {
64
+ return SCREEN_HEIGHT * (itemheight / 100);
65
+ }
66
+
53
67
  // Shadow Functions
54
68
  export function CButtonShadow(): ShadowStyle {
55
69
  const isAndroidBelow9 = Platform.OS === 'android' && Platform.Version < 28;
@@ -99,24 +113,12 @@ export function CShadowDynamic(
99
113
  };
100
114
  }
101
115
 
102
-
103
116
  export function Loader(): React.JSX.Element {
104
117
  return (
105
118
  <ActivityIndicator size={normalize(30)} style={{ marginTop: normalize(10) }} color="red" />
106
119
  );
107
120
  }
108
121
 
109
- // Utility Functions
110
- export function normalize(size: number): number {
111
- const newSize = scale < 1.5 ? size * scale : size * 1.6;
112
- if (Platform.OS === 'ios') {
113
- return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 2;
114
- } else {
115
- return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 2;
116
- }
117
- }
118
-
119
-
120
122
  // Value Check Functions
121
123
  export function isBNU(i: any): boolean {
122
124
  return (i && i != null && i != undefined ? true : false);
@@ -293,8 +295,12 @@ export function isConnected(): Promise<void> {
293
295
  // Footer Functions
294
296
  export function getFooterIcon(opacity: number): ViewStyle {
295
297
  return {
296
- ...ComponentStyles.footer_Icon,
297
- opacity: opacity,
298
+ height: 25,
299
+ width: 25,
300
+ alignItems: 'center',
301
+ alignSelf: 'center',
302
+ opacity: 0.9,
303
+ ...{ opacity: opacity },
298
304
  };
299
305
  }
300
306
 
@@ -307,7 +313,8 @@ export function notifyMessage(msg: string, type?: any): void {
307
313
 
308
314
  export function getFooterIconText(opacity: number, color: string): TextStyle {
309
315
  return {
310
- ...ComponentStyles.footer_Icon_Text,
316
+ textAlign: 'center',
317
+ fontSize: normalize(6),
311
318
  opacity: opacity,
312
319
  color: color,
313
320
  };
@@ -316,7 +323,9 @@ export function getFooterIconText(opacity: number, color: string): TextStyle {
316
323
  // Header Functions
317
324
  export function getHeaderBlockContainer(width: number): ViewStyle {
318
325
  return {
319
- ...ComponentStyles.header_section_conatiner_style,
326
+ backgroundColor: '#0E2F56',
327
+ justifyContent: 'flex-end',
328
+ padding: 10,
320
329
  width: width,
321
330
  paddingTop: '5%',
322
331
  };
@@ -340,16 +349,16 @@ export function getResultViewObservedvalueTextvalidate(
340
349
  case 'integer':
341
350
  case 'numeric':
342
351
  if (minvalue != null && minvalue != undefined && value < minvalue) {
343
- return colors.color_resulttext_low;
352
+ return '#283747';
344
353
  }
345
354
  else if (maxvalue != null && maxvalue != undefined && value > maxvalue) {
346
- return colors.color_resulttext_high;
355
+ return '#283747';
347
356
  }
348
357
  else {
349
- return colors.color_resulttext_normal;
358
+ return '#283747';
350
359
  }
351
360
  default:
352
- return colors.color_resulttext_normal;
361
+ return '#283747';
353
362
  }
354
363
  }
355
364
 
@@ -414,7 +423,7 @@ export function getProfileContentLogo2(): TextStyle {
414
423
  export function getProfilecardSubheadingTop(color: string): TextStyle {
415
424
  return {
416
425
  fontSize: normalize(10),
417
- fontWeight: fontWeight.fontWeight_700,
426
+ fontWeight: '700',
418
427
  color: color,
419
428
  paddingBottom: 0,
420
429
  paddingTop: 2,
@@ -424,7 +433,7 @@ export function getProfilecardSubheadingTop(color: string): TextStyle {
424
433
  export function getProfilecardSubheadingBottom(color: string, position: string): TextStyle {
425
434
  return {
426
435
  fontSize: normalize(10),
427
- fontWeight: fontWeight.fontWeight_100,
436
+ fontWeight: '100',
428
437
  color: color,
429
438
  paddingLeft: position == 'right' ? 5 : 0,
430
439
  paddingRight: position == 'left' ? 5 : 0,
@@ -434,7 +443,7 @@ export function getProfilecardSubheadingBottom(color: string, position: string):
434
443
  export function getProfilecardMobileNO(color: string, position: string): TextStyle {
435
444
  return {
436
445
  fontSize: normalize(12),
437
- fontWeight: fontWeight.fontWeight_Bold,
446
+ fontWeight: 'bold',
438
447
  color: color,
439
448
  paddingLeft: position == 'right' ? 5 : 0,
440
449
  paddingRight: position == 'left' ? 5 : 0,
@@ -464,14 +473,25 @@ export function getGroupButtonView(width: number): ViewStyle {
464
473
  // Media Functions
465
474
  export function getMediaoverlayContainerStyle(height: number): ViewStyle {
466
475
  return {
467
- ...ComponentStyles.mediaoverlay_containerstyle,
476
+ position: 'absolute',
477
+ left: 0,
478
+ right: 0,
479
+ elevation: 999,
480
+ alignItems: 'center',
481
+ zIndex: 10000,
482
+ backgroundColor: 'rgba(0, 0, 0, 0.50)',
483
+ justifyContent: 'flex-end',
484
+ flex: 1,
468
485
  height: height,
469
486
  };
470
487
  }
471
488
 
472
489
  export function getMediaViewContainer(width: number, height: number, itemwidth: number): ViewStyle {
473
490
  return {
474
- ...ComponentStyles.View_col_center,
491
+ justifyContent: 'center',
492
+ alignContent: 'center',
493
+ alignItems: 'center',
494
+ flexDirection: 'column',
475
495
  width: width * (itemwidth / 100),
476
496
  margin: height * 0.003,
477
497
  };
@@ -482,7 +502,7 @@ export function getMediaViewChildContainer(width: number, itemwidth: number): Vi
482
502
  borderWidth: 0.5,
483
503
  borderRadius: 2,
484
504
  width: width * (itemwidth / 100),
485
- borderColor: colors.color_componentBordercolor,
505
+ borderColor: '#606266',
486
506
  };
487
507
  }
488
508
 
@@ -507,7 +527,10 @@ export function getMediaoverlayChildrenwrapperStyle(
507
527
 
508
528
  export function getMediaoverlayTopLineContainer(width: number, height: number): ViewStyle {
509
529
  return {
510
- ...ComponentStyles.View_col_center,
530
+ justifyContent: 'center',
531
+ alignContent: 'center',
532
+ alignItems: 'center',
533
+ flexDirection: 'column',
511
534
  width: width * 0.15,
512
535
  height: height * 0.02,
513
536
  };
@@ -515,7 +538,10 @@ export function getMediaoverlayTopLineContainer(width: number, height: number):
515
538
 
516
539
  export function getMediaoverlayOptionRow(width: number, height: number): ViewStyle {
517
540
  return {
518
- ...ComponentStyles.View_row_spacearound,
541
+ flexDirection: 'row',
542
+ justifyContent: 'space-around',
543
+ alignContent: 'center',
544
+ alignItems: 'center',
519
545
  borderRadius: 14,
520
546
  marginTop: height * 0.02,
521
547
  width: width * 0.90,
@@ -524,7 +550,10 @@ export function getMediaoverlayOptionRow(width: number, height: number): ViewSty
524
550
 
525
551
  export function getMediaoverlayOptionContainer(width: number, height: number): ViewStyle {
526
552
  return {
527
- ...ComponentStyles.View_col_center,
553
+ justifyContent: 'center',
554
+ alignContent: 'center',
555
+ alignItems: 'center',
556
+ flexDirection: 'column',
528
557
  margin: 5,
529
558
  height: height * 0.1,
530
559
  width: width * 0.20,
@@ -534,7 +563,10 @@ export function getMediaoverlayOptionContainer(width: number, height: number): V
534
563
  export function getMediaoverlayMsgorLoaderView(height: number): ViewStyle {
535
564
  return {
536
565
  height: height,
537
- ...ComponentStyles.View_col_center,
566
+ justifyContent: 'center',
567
+ alignContent: 'center',
568
+ alignItems: 'center',
569
+ flexDirection: 'column',
538
570
  };
539
571
  }
540
572
 
@@ -553,7 +585,7 @@ export function getMediaGalleryDeleteView(width: number, height: number): ViewSt
553
585
  borderRadius: 2,
554
586
  height: height / 5,
555
587
  width: width * 0.90,
556
- borderColor: colors.color_componentBordercolor,
588
+ borderColor: '#606266',
557
589
  alignItems: 'center',
558
590
  justifyContent: 'center',
559
591
  };
@@ -14,13 +14,11 @@ import {
14
14
  ViewStyle,
15
15
  TextStyle,
16
16
  } from 'react-native';
17
- import { getListviewItem, getListviewItemText } from '../CommonStyle/PopupStyle';
18
17
  import { APIURL } from '../../../../../src/Common/apiConstants';
19
18
  import Loader from '../Custom/Loader';
20
19
  import { isBNU, isBNUL, isNU, normalize } from '../CommonStyle/ComponentFunctions';
21
20
  import NetworkServiceCall from '../Common/NetworkServiceCall';
22
21
  import HIcons from '../Hoc/HIcons';
23
- import { colors } from '../CommonStyle/commonStyle';
24
22
  import { Global } from '../../../../../src/Common/Global';
25
23
  import { Menu, MenuOptions, MenuTrigger } from 'react-native-popup-menu';
26
24
  // import SHelpDescription from './SHelpDescription';
@@ -117,6 +115,33 @@ interface NetworkResponse {
117
115
  };
118
116
  }
119
117
 
118
+ // ---------------------------------------------------------------------------
119
+ // Hardcoded helpers (originally from ../CommonStyle/PopupStyle)
120
+ // NOTE: ComponentStyles.select_TextStyle spread has been replaced by the
121
+ // concrete values it contributed where known. If your original
122
+ // ComponentStyles.select_TextStyle provided additional properties (padding,
123
+ // fontSize, etc.), merge them back in here.
124
+ // ---------------------------------------------------------------------------
125
+
126
+ function getListviewItem(selected?: boolean, borderbottomwidth?: boolean): ViewStyle {
127
+ return {
128
+ borderColor: '#DCDEDD',
129
+ borderWidth: borderbottomwidth ? 0 : 1,
130
+ borderBottomWidth: 1,
131
+ width: '100%',
132
+ borderRadius: 7,
133
+ backgroundColor: selected ? 'lightblue' : '#fff', // colors.color_DeselectBgCOlor
134
+ };
135
+ }
136
+
137
+ function getListviewItemText(selected?: boolean): TextStyle {
138
+ return {
139
+ // ...ComponentStyles.select_TextStyle, <-- hardcoded out; see note above
140
+ fontWeight: selected ? 'bold' : 'normal',
141
+ color: selected ? '#094485' : 'black',
142
+ };
143
+ }
144
+
120
145
  // ---------------------------------------------------------------------------
121
146
  // Module-scope scratch (matches original; NOT ideal but preserved for behavior)
122
147
  // ---------------------------------------------------------------------------
@@ -649,7 +674,7 @@ const SDropDown: React.FC<SDropDownNewProps> = (props) => {
649
674
  <View>
650
675
  <Text style={{
651
676
  fontSize: normalize(12),
652
- color: colors.color_componentText,
677
+ color: '#0C4F60', // colors.color_componentText
653
678
  fontWeight: '800', alignItems: 'center', justifyContent: 'center',
654
679
  }}>
655
680
  No Result Found
@@ -795,7 +820,7 @@ const layoutstyles = StyleSheet.create({
795
820
  fontSize: normalize(12),
796
821
  fontWeight: 'bold',
797
822
  paddingLeft: Dimensions.get('window').width * 0.02,
798
- color: colors.color_PopupHeadingText,
823
+ color: '#0C4F60', // colors.color_PopupHeadingText
799
824
  width: '100%',
800
825
  },
801
826
  overlay_screen_container: {
@@ -819,7 +844,7 @@ const layoutstyles = StyleSheet.create({
819
844
  searchTextbox_View: {
820
845
  flexDirection: 'row',
821
846
  borderWidth: 0,
822
- borderColor: colors.color_componentBordercolor,
847
+ borderColor: '#606266', // colors.color_componentBordercolor
823
848
  justifyContent: 'flex-start',
824
849
  alignItems: 'flex-start',
825
850
  borderRadius: 7,
@@ -853,7 +878,7 @@ const layoutstyles = StyleSheet.create({
853
878
  searchButtonText: {
854
879
  fontSize: normalize(10),
855
880
  fontWeight: 'bold',
856
- color: colors.color_buttonText,
881
+ color: '#fff', // colors.color_buttonText
857
882
  padding: 1,
858
883
  },
859
884
  });
@@ -8,8 +8,7 @@ import {
8
8
  Dimensions,
9
9
  Platform,
10
10
  } from 'react-native';
11
- import styles from '../CommonStyle/optionListStyles';
12
- import { normalize } from '../CommonStyle/componentStyle';
11
+ import { normalize} from '../CommonStyle/ComponentFunctions';
13
12
  import RNExitApp from 'react-native-exit-app';
14
13
  import { Global, GlobalUserData } from '../../../../../src/Common/Global';
15
14
  import { imageURL } from '../../../../../src/Common/apiConstants';
@@ -209,9 +208,21 @@ function CSliderMenu(props: CSliderMenuProps): React.ReactElement {
209
208
  }
210
209
 
211
210
  // ---------------------------------------------------------------------------
212
- // Styles
211
+ // Styles (inlined from optionListStyles.ts)
213
212
  // ---------------------------------------------------------------------------
214
213
 
214
+ const styles = StyleSheet.create({
215
+ usernameStyle: {
216
+ color: '#fff',
217
+ fontSize: 16,
218
+ fontWeight: 'bold',
219
+ },
220
+ departmeNameStyle: {
221
+ color: '#C1C6D0',
222
+ fontSize: 12,
223
+ },
224
+ });
225
+
215
226
  const layoutstyles = StyleSheet.create({
216
227
  option_text_container: {
217
228
  justifyContent: 'center',
@@ -12,7 +12,7 @@ import {
12
12
  StyleProp,
13
13
  TextStyle,
14
14
  } from 'react-native';
15
- import { normalize } from '../CommonStyle/componentStyle';
15
+ import { normalize} from '../CommonStyle/ComponentFunctions';
16
16
  import { APIURL } from '../../../../../src/Common/apiConstants';
17
17
 
18
18
  // ---------------------------------------------------------------------------
@@ -13,11 +13,11 @@ import {
13
13
  } from 'react-native';
14
14
  import { Global } from '../../../../../src/Common/Global';
15
15
  ;
16
- import { normalize } from '../CommonStyle/componentStyle';
16
+ import { normalize} from '../CommonStyle/ComponentFunctions';
17
17
  import { isPermitted, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
18
18
  import Barcode from '@kichiyaki/react-native-barcode-generator';
19
19
  import { useNavigation } from '../Navigation/useNavigation';
20
- import HIcons from '../HOC/HIcons';
20
+ import HIcons from '../Hoc/HIcons';
21
21
 
22
22
  // ---------------------------------------------------------------------------
23
23
  // Types
@@ -12,7 +12,7 @@ import {
12
12
  } from 'react-native';
13
13
  import { Global } from '../../../../../src/Common/Global';
14
14
  ;
15
- import { normalize } from '../CommonStyle/componentStyle';
15
+ import { normalize} from '../CommonStyle/ComponentFunctions';
16
16
  import Svg, { Rect, Defs, LinearGradient, Stop } from 'react-native-svg';
17
17
  import HIcons from '../Hoc/HIcons';
18
18
  import CModalOverlay from './CModalOverlay';
@@ -12,7 +12,7 @@ import {
12
12
  import { Global } from '../../../../../src/Common/Global';
13
13
  // import CSwipeCard from '../Components/CSwipeCard';
14
14
  import { normalize } from '../CommonStyle/ComponentFunctions';
15
- import { useNavigation } from '../Navigation/PageNavigation';
15
+ import { useNavigation } from '../Navigation/useNavigation';
16
16
  // ---------------------------------------------------------------------------
17
17
  // Types
18
18
  // ---------------------------------------------------------------------------
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { View, Text, StyleSheet } from 'react-native';
3
3
  import NetInfo, { NetInfoState, NetInfoStateType } from '@react-native-community/netinfo';
4
- import { normalize } from '../CommonStyle/componentStyle';
4
+ import { normalize} from '../CommonStyle/ComponentFunctions';
5
5
  import HIcons from '../Hoc/HIcons';
6
6
  import ABlink from '../Alerts/ABlink';
7
7
 
@@ -9,7 +9,7 @@ import {
9
9
  StyleProp,
10
10
  ViewStyle,
11
11
  } from 'react-native';
12
- import { normalize } from '../CommonStyle/componentStyle';
12
+ import { normalize} from '../CommonStyle/ComponentFunctions';
13
13
  import { Global } from '../../../../../src/Common/Global';
14
14
  ;
15
15
  import HIcons from '../Hoc/HIcons';
@@ -18,7 +18,7 @@ import {
18
18
  DimensionValue,
19
19
  } from 'react-native';
20
20
  import CSliderMenu from '../Custom/CSliderMenu';
21
- import { normalize } from '../CommonStyle/componentStyle';
21
+ import { normalize} from '../CommonStyle/ComponentFunctions';
22
22
  import { useNotifications } from '../Handlers/NotificationsContext';
23
23
  import moment from 'moment';
24
24
  import { ValueCheck } from '../CommonStyle/ComponentFunctions';
@@ -30,7 +30,7 @@ import NetworkServiceCall from '../Common/NetworkServiceCall';
30
30
  import { notifyMessage } from '../CommonStyle/ComponentFunctions';
31
31
  import HShadowButton from './HShadowButton';
32
32
  import HIcons from './HIcons';
33
- import { normalize } from '../CommonStyle/componentStyle';
33
+ import { normalize} from '../CommonStyle/ComponentFunctions';
34
34
  import { Global } from '../../../../../src/Common/Global';
35
35
  ;
36
36
  import SDateTimePicker from '../StaticComponents/SDateTimePicker';
@@ -13,7 +13,7 @@ import DateTimePicker, {
13
13
  } from '@react-native-community/datetimepicker';
14
14
  import HIcons from '../Hoc/HIcons';
15
15
  import moment from 'moment';
16
- import { normalize } from '../CommonStyle/componentStyle';
16
+ import { normalize} from '../CommonStyle/ComponentFunctions';
17
17
  import { isNU, ValueCheck } from '../CommonStyle/ComponentFunctions';
18
18
  import { Global } from '../../../../../src/Common/Global';
19
19
  ;
@@ -9,7 +9,8 @@ import {
9
9
  ViewStyle,
10
10
  Dimensions,
11
11
  } from 'react-native';
12
- import { normalize, ValueCheck } from '../CommonStyle/ComponentFunctions';
12
+ import { normalize} from '../CommonStyle/ComponentFunctions';
13
+ import { ValueCheck } from '../CommonStyle/ComponentFunctions';
13
14
 
14
15
  // ---------------------------------------------------------------------------
15
16
  // Types