@janiscommerce/ui-native 1.8.1 → 1.10.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 (114) hide show
  1. package/dist/components/{BaseButton → atoms/BaseButton}/index.js +1 -1
  2. package/dist/components/atoms/BaseCardList/index.d.ts +8 -0
  3. package/dist/components/atoms/BaseCardList/index.js +29 -0
  4. package/dist/components/{BaseToast → atoms/BaseToast}/index.js +1 -1
  5. package/dist/components/{CheckBox → atoms/CheckBox}/icon/CheckedIcon.js +1 -1
  6. package/dist/components/{CheckBox → atoms/CheckBox}/index.js +2 -2
  7. package/dist/components/{Icon → atoms/Icon}/index.js +2 -2
  8. package/dist/components/{Input → atoms/Input}/index.js +1 -1
  9. package/dist/components/{Input → atoms/Input}/utils/index.d.ts +1 -1
  10. package/dist/components/{Input → atoms/Input}/utils/index.js +1 -1
  11. package/dist/components/{Loading → atoms/Loading}/LoadingSvg/index.js +1 -1
  12. package/dist/components/{Loading → atoms/Loading}/index.js +2 -2
  13. package/dist/components/{RadioButton → atoms/RadioButton}/index.js +2 -2
  14. package/dist/components/{StatusChip → atoms/StatusChip}/index.js +2 -2
  15. package/dist/components/{Svg → atoms/Svg}/index.d.ts +1 -1
  16. package/dist/components/{Svg → atoms/Svg}/index.js +2 -2
  17. package/dist/components/{Svg → atoms/Svg}/svgs/EmptyIllustration/index.d.ts +1 -1
  18. package/dist/components/{Svg → atoms/Svg}/svgs/EmptyListIllustration/index.d.ts +1 -1
  19. package/dist/components/{Svg → atoms/Svg}/svgs/JanisLogo/index.d.ts +1 -1
  20. package/dist/components/{Svg → atoms/Svg}/svgs/JanisLogoColor/index.d.ts +1 -1
  21. package/dist/components/{Svg → atoms/Svg}/svgs/LoginIllustration/index.d.ts +1 -1
  22. package/dist/components/{Svg → atoms/Svg}/svgs/NoNotifications/index.d.ts +1 -1
  23. package/dist/components/{Text → atoms/Text}/index.js +1 -1
  24. package/dist/components/{Avatar → molecules/Avatar}/index.js +3 -3
  25. package/dist/components/{Button → molecules/Button}/index.d.ts +2 -2
  26. package/dist/components/{Button → molecules/Button}/index.js +11 -8
  27. package/dist/components/{Button → molecules/Button}/utils/getButtonStyles/index.js +2 -2
  28. package/dist/components/{Button → molecules/Button}/utils/getButtonStyles/utils/styleConfigs/index.d.ts +2 -0
  29. package/dist/components/{Button → molecules/Button}/utils/getButtonStyles/utils/styleConfigs/index.js +4 -2
  30. package/dist/components/{Carousel → molecules/Carousel}/utils/index.d.ts +1 -1
  31. package/dist/components/molecules/ItemSelectionButton/index.d.ts +11 -0
  32. package/dist/components/molecules/ItemSelectionButton/index.js +66 -0
  33. package/dist/components/{LayoutWithBottomButtons → molecules/LayoutWithBottomButtons}/index.js +8 -7
  34. package/dist/components/{LayoutWithBottomButtons → molecules/LayoutWithBottomButtons}/utils/index.d.ts +18 -16
  35. package/dist/components/{LayoutWithBottomButtons → molecules/LayoutWithBottomButtons}/utils/index.js +21 -8
  36. package/dist/components/molecules/MainCardList/index.d.ts +14 -0
  37. package/dist/components/molecules/MainCardList/index.js +60 -0
  38. package/dist/components/{ProgressBar → molecules/ProgressBar}/index.js +2 -2
  39. package/dist/components/{ProgressBar → molecules/ProgressBar}/utils/index.js +1 -1
  40. package/dist/components/{Select → molecules/Select}/Components/Dropdown/index.d.ts +1 -1
  41. package/dist/components/{Select → molecules/Select}/Components/Modal/index.js +2 -2
  42. package/dist/components/{Select → molecules/Select}/Components/Options/index.d.ts +1 -1
  43. package/dist/components/{Select → molecules/Select}/Components/Options/index.js +1 -1
  44. package/dist/components/{Select → molecules/Select}/Components/SwitcherComponent/index.d.ts +1 -1
  45. package/dist/components/{Select → molecules/Select}/index.js +3 -3
  46. package/dist/components/{Select → molecules/Select}/utils/index.d.ts +1 -1
  47. package/dist/components/molecules/SwipeList/index.d.ts +11 -0
  48. package/dist/components/molecules/SwipeList/index.js +31 -0
  49. package/dist/components/molecules/Tabs/index.d.ts +23 -0
  50. package/dist/components/molecules/Tabs/index.js +112 -0
  51. package/dist/components/{Toast → molecules/Toast}/index.d.ts +1 -1
  52. package/dist/components/{Toast → molecules/Toast}/index.js +5 -5
  53. package/dist/components/{Toast → molecules/Toast}/utils/index.js +1 -1
  54. package/dist/components/{FullScreenMessage → organisms/FullScreenMessage}/index.js +4 -4
  55. package/dist/components/{LoadingFullScreen → organisms/LoadingFullScreen}/index.d.ts +1 -1
  56. package/dist/components/{LoadingFullScreen → organisms/LoadingFullScreen}/index.js +4 -4
  57. package/dist/components/organisms/SwipeItemSelectionList/index.d.ts +14 -0
  58. package/dist/components/organisms/SwipeItemSelectionList/index.js +37 -0
  59. package/dist/index.d.ts +28 -24
  60. package/dist/index.js +32 -24
  61. package/dist/utils/index.d.ts +1 -0
  62. package/dist/utils/index.js +1 -0
  63. package/package.json +11 -9
  64. /package/dist/components/{BaseButton → atoms/BaseButton}/index.d.ts +0 -0
  65. /package/dist/components/{BaseToast → atoms/BaseToast}/index.d.ts +0 -0
  66. /package/dist/components/{BaseToast → atoms/BaseToast}/utils/index.d.ts +0 -0
  67. /package/dist/components/{BaseToast → atoms/BaseToast}/utils/index.js +0 -0
  68. /package/dist/components/{CheckBox → atoms/CheckBox}/icon/CheckedIcon.d.ts +0 -0
  69. /package/dist/components/{CheckBox → atoms/CheckBox}/index.d.ts +0 -0
  70. /package/dist/components/{Icon → atoms/Icon}/assets/fonts/selection.json +0 -0
  71. /package/dist/components/{Icon → atoms/Icon}/index.d.ts +0 -0
  72. /package/dist/components/{Image → atoms/Image}/index.d.ts +0 -0
  73. /package/dist/components/{Image → atoms/Image}/index.js +0 -0
  74. /package/dist/components/{Input → atoms/Input}/index.d.ts +0 -0
  75. /package/dist/components/{List → atoms/List}/index.d.ts +0 -0
  76. /package/dist/components/{List → atoms/List}/index.js +0 -0
  77. /package/dist/components/{Loading → atoms/Loading}/LoadingSvg/index.d.ts +0 -0
  78. /package/dist/components/{Loading → atoms/Loading}/index.d.ts +0 -0
  79. /package/dist/components/{RadioButton → atoms/RadioButton}/index.d.ts +0 -0
  80. /package/dist/components/{StatusChip → atoms/StatusChip}/index.d.ts +0 -0
  81. /package/dist/components/{Svg → atoms/Svg}/svgs/EmptyIllustration/index.js +0 -0
  82. /package/dist/components/{Svg → atoms/Svg}/svgs/EmptyListIllustration/index.js +0 -0
  83. /package/dist/components/{Svg → atoms/Svg}/svgs/JanisLogo/index.js +0 -0
  84. /package/dist/components/{Svg → atoms/Svg}/svgs/JanisLogoColor/index.js +0 -0
  85. /package/dist/components/{Svg → atoms/Svg}/svgs/LoginIllustration/index.js +0 -0
  86. /package/dist/components/{Svg → atoms/Svg}/svgs/NoNotifications/index.js +0 -0
  87. /package/dist/components/{SwipeUp → atoms/SwipeUp}/childComponents/index.d.ts +0 -0
  88. /package/dist/components/{SwipeUp → atoms/SwipeUp}/childComponents/index.js +0 -0
  89. /package/dist/components/{SwipeUp → atoms/SwipeUp}/index.d.ts +0 -0
  90. /package/dist/components/{SwipeUp → atoms/SwipeUp}/index.js +0 -0
  91. /package/dist/components/{Text → atoms/Text}/index.d.ts +0 -0
  92. /package/dist/components/{Avatar → molecules/Avatar}/index.d.ts +0 -0
  93. /package/dist/components/{Avatar → molecules/Avatar}/utils/formatPlaceholder/index.d.ts +0 -0
  94. /package/dist/components/{Avatar → molecules/Avatar}/utils/formatPlaceholder/index.js +0 -0
  95. /package/dist/components/{Button → molecules/Button}/types/index.d.ts +0 -0
  96. /package/dist/components/{Button → molecules/Button}/types/index.js +0 -0
  97. /package/dist/components/{Button → molecules/Button}/utils/getButtonStyles/index.d.ts +0 -0
  98. /package/dist/components/{Button → molecules/Button}/utils/getButtonStyles/utils/constants/index.d.ts +0 -0
  99. /package/dist/components/{Button → molecules/Button}/utils/getButtonStyles/utils/constants/index.js +0 -0
  100. /package/dist/components/{Button → molecules/Button}/utils/getButtonStyles/utils/defaultValues/index.d.ts +0 -0
  101. /package/dist/components/{Button → molecules/Button}/utils/getButtonStyles/utils/defaultValues/index.js +0 -0
  102. /package/dist/components/{Carousel → molecules/Carousel}/index.d.ts +0 -0
  103. /package/dist/components/{Carousel → molecules/Carousel}/index.js +0 -0
  104. /package/dist/components/{Carousel → molecules/Carousel}/utils/index.js +0 -0
  105. /package/dist/components/{LayoutWithBottomButtons → molecules/LayoutWithBottomButtons}/index.d.ts +0 -0
  106. /package/dist/components/{ProgressBar → molecules/ProgressBar}/index.d.ts +0 -0
  107. /package/dist/components/{ProgressBar → molecules/ProgressBar}/utils/index.d.ts +0 -0
  108. /package/dist/components/{Select → molecules/Select}/Components/Dropdown/index.js +0 -0
  109. /package/dist/components/{Select → molecules/Select}/Components/Modal/index.d.ts +0 -0
  110. /package/dist/components/{Select → molecules/Select}/Components/SwitcherComponent/index.js +0 -0
  111. /package/dist/components/{Select → molecules/Select}/index.d.ts +0 -0
  112. /package/dist/components/{Select → molecules/Select}/utils/index.js +0 -0
  113. /package/dist/components/{Toast → molecules/Toast}/utils/index.d.ts +0 -0
  114. /package/dist/components/{FullScreenMessage → organisms/FullScreenMessage}/index.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Pressable, StyleSheet } from 'react-native';
3
- import { moderateScale, scaledForDevice } from '../../scale';
3
+ import { moderateScale, scaledForDevice } from '../../../scale';
4
4
  const BaseButton = ({ borderRadius = 0, children = null, style, pressedStyle, ...props }) => {
5
5
  if (!children) {
6
6
  return null;
@@ -0,0 +1,8 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { ViewProps } from 'react-native';
3
+ export interface BaseCardListProps extends ViewProps {
4
+ children: ReactNode;
5
+ isSelected?: boolean;
6
+ }
7
+ declare const BaseCardList: FC<BaseCardListProps>;
8
+ export default BaseCardList;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { StyleSheet, View } from 'react-native';
3
+ import { palette } from '../../../theme/palette';
4
+ const BaseCardList = ({ children, isSelected = false, style, ...props }) => {
5
+ if (!children) {
6
+ return null;
7
+ }
8
+ const styles = StyleSheet.create({
9
+ container: {
10
+ backgroundColor: palette.base.white,
11
+ borderRadius: 20,
12
+ width: '100%',
13
+ padding: 16,
14
+ },
15
+ selectedContainer: {
16
+ borderWidth: 2,
17
+ borderColor: palette.primary.main,
18
+ },
19
+ });
20
+ const activeStyles = [
21
+ styles.container,
22
+ isSelected && styles.selectedContainer,
23
+ style && style,
24
+ ].filter(Boolean);
25
+ return (<View style={activeStyles} {...props}>
26
+ {children}
27
+ </View>);
28
+ };
29
+ export default BaseCardList;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
- import { black, palette } from '../../theme/palette';
3
+ import { black, palette } from '../../../theme/palette';
4
4
  import { parseType } from './utils';
5
5
  export var Types;
6
6
  (function (Types) {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { View } from 'react-native';
3
- import { base } from '../../../theme/palette';
3
+ import { base } from '../../../../theme/palette';
4
4
  import Svg, { Path } from 'react-native-svg';
5
5
  const CheckedIcon = ({ color, size }) => (<View>
6
6
  <Svg width={size} height={size} viewBox="0 0 16 16" fill="none">
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { View, TouchableOpacity, StyleSheet } from 'react-native';
3
- import { base, grey, primary } from '../../theme/palette';
4
- import { moderateScale, horizontalScale, scaledForDevice } from '../../scale';
3
+ import { base, grey, primary } from '../../../theme/palette';
4
+ import { moderateScale, horizontalScale, scaledForDevice } from '../../../scale';
5
5
  import Icon from './icon/CheckedIcon';
6
6
  const getCheckBoxScale = (size, divisor) => size / divisor;
7
7
  const CheckBox = ({ checked, customSize = 16, checkOnColor = primary.main, checkOffColor = grey[500], iconCheckColor = base.white, borderRadius, disabled = false, style, ...props }) => {
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
3
3
  import icoMoonConfig from './assets/fonts/selection.json';
4
- import { primary } from '../../theme/palette';
5
- import { moderateScale, scaledForDevice } from '../../scale';
4
+ import { primary } from '../../../theme/palette';
5
+ import { moderateScale, scaledForDevice } from '../../../scale';
6
6
  const IconComponent = createIconSetFromIcoMoon(icoMoonConfig, 'janis-font-icon', 'janis-font-icon.ttf');
7
7
  const Icon = ({ name, color = primary.main, size = 16, ...props }) => {
8
8
  if (!name) {
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { TextInput, StyleSheet, View, Text, } from 'react-native';
3
3
  import { getBorderColor, getInputInitialState, getLabelColor, getStatusMessageColor, raiseLabel, showStatusMessage, } from './utils';
4
- import { moderateScale, horizontalScale, scaledForDevice } from '../../scale';
4
+ import { moderateScale, horizontalScale, scaledForDevice } from '../../../scale';
5
5
  export var keyboardTypes;
6
6
  (function (keyboardTypes) {
7
7
  keyboardTypes["default"] = "default";
@@ -1,4 +1,4 @@
1
- import { palette } from '../../../theme/palette';
1
+ import { palette } from '../../../../theme/palette';
2
2
  export type Status = keyof typeof palette;
3
3
  interface getBorderColorProps {
4
4
  inputState: string;
@@ -1,4 +1,4 @@
1
- import { palette } from '../../../theme/palette';
1
+ import { palette } from '../../../../theme/palette';
2
2
  export const getInputInitialState = (value) => {
3
3
  if (!value) {
4
4
  return 'incomplete';
@@ -1,7 +1,7 @@
1
1
  import Svg, { Path } from 'react-native-svg';
2
2
  import React from 'react';
3
3
  import { Animated } from 'react-native';
4
- import { white } from '../../../theme/palette';
4
+ import { white } from '../../../../theme/palette';
5
5
  const LoadingSvg = ({ size, color, ...props }) => {
6
6
  return (<Animated.View {...props}>
7
7
  <Svg x="0px" y="0px" width={size} height={size} viewBox="0 0 163 163">
@@ -1,8 +1,8 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
2
  import { StyleSheet, View, Animated, Easing } from 'react-native';
3
3
  import LoadingSvg from './LoadingSvg';
4
- import { primary } from '../../theme/palette';
5
- import { horizontalScale, moderateScale, scaledForDevice } from '../../scale';
4
+ import { primary } from '../../../theme/palette';
5
+ import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
6
6
  const startRotationAnimation = ({ duration, rotationDegree, timingAnimation }) => Animated.loop(Animated.timing(rotationDegree, {
7
7
  duration,
8
8
  toValue: 360,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { View, TouchableOpacity, StyleSheet } from 'react-native';
3
3
  import Text from '../Text';
4
4
  import CheckBox from '../CheckBox';
5
- import { horizontalScale, moderateScale, scaledForDevice } from '../../scale';
5
+ import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
6
6
  const checkLocation = ['left', 'right'];
7
7
  const CheckSizeValues = {
8
8
  sm: 16,
@@ -21,7 +21,7 @@ const styles = StyleSheet.create({
21
21
  },
22
22
  row: {
23
23
  flexDirection: 'row',
24
- justifyContent: 'flex-start',
24
+ justifyContent: 'space-between',
25
25
  },
26
26
  reverseRow: {
27
27
  flexDirection: 'row-reverse',
@@ -1,8 +1,8 @@
1
1
  import React, { isValidElement } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
- import { base, grey, primary } from '../../theme/palette';
3
+ import { base, grey, primary } from '../../../theme/palette';
4
4
  import Text from '../Text';
5
- import { horizontalScale, moderateScale, scaledForDevice } from '../../scale';
5
+ import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
6
6
  const validHeight = scaledForDevice(24, moderateScale);
7
7
  const validPadding = scaledForDevice(12, horizontalScale);
8
8
  const validBorderRadius = scaledForDevice(12, moderateScale);
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { Isvg } from '../../ts/interfaces/svgs';
2
+ import { Isvg } from '../../../ts/interfaces/svgs';
3
3
  declare const Svg: ({ name, width, height, size, ...props }: Isvg) => React.JSX.Element | null;
4
4
  export default Svg;
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { View } from 'react-native';
3
- import { svgsNames } from '../../ts/interfaces/svgs';
3
+ import { svgsNames } from '../../../ts/interfaces/svgs';
4
4
  import EmptyIllustration from './svgs/EmptyIllustration';
5
5
  import EmptyListIllustration from './svgs/EmptyListIllustration';
6
6
  import JanisLogo from './svgs/JanisLogo';
7
7
  import JanisLogoColor from './svgs/JanisLogoColor';
8
8
  import LoginIllustration from './svgs/LoginIllustration';
9
9
  import NoNotifications from './svgs/NoNotifications';
10
- import { horizontalScale, moderateScale, scaledForDevice } from '../../scale';
10
+ import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
11
11
  const svgs = {
12
12
  'empty-illustration': EmptyIllustration,
13
13
  'empty-list-illustration': EmptyListIllustration,
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import type { Isvg } from '../../../../ts/interfaces/svgs';
2
+ import type { Isvg } from '../../../../../ts/interfaces/svgs';
3
3
  declare const EmptyIllustration: ({ ...props }: Isvg) => React.JSX.Element;
4
4
  export default EmptyIllustration;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import type { Isvg } from '../../../../ts/interfaces/svgs';
2
+ import type { Isvg } from '../../../../../ts/interfaces/svgs';
3
3
  declare const EmptyListIllustration: ({ ...props }: Isvg) => React.JSX.Element;
4
4
  export default EmptyListIllustration;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import type { Isvg } from '../../../../ts/interfaces/svgs';
2
+ import type { Isvg } from '../../../../../ts/interfaces/svgs';
3
3
  declare const JanisLogo: ({ ...props }: Isvg) => React.JSX.Element;
4
4
  export default JanisLogo;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import type { Isvg } from '../../../../ts/interfaces/svgs';
2
+ import type { Isvg } from '../../../../../ts/interfaces/svgs';
3
3
  declare const JanisLogoColor: ({ ...props }: Isvg) => React.JSX.Element;
4
4
  export default JanisLogoColor;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import type { Isvg } from '../../../../ts/interfaces/svgs';
2
+ import type { Isvg } from '../../../../../ts/interfaces/svgs';
3
3
  declare const LoginIllustration: ({ ...props }: Isvg) => React.JSX.Element;
4
4
  export default LoginIllustration;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import type { Isvg } from '../../../../ts/interfaces/svgs';
2
+ import type { Isvg } from '../../../../../ts/interfaces/svgs';
3
3
  declare const Notification: ({ ...props }: Isvg) => React.JSX.Element;
4
4
  export default Notification;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { StyleSheet, Text as TextComponent, } from 'react-native';
3
- import { moderateScale, scaledForDevice } from '../../scale';
3
+ import { moderateScale, scaledForDevice } from '../../../scale';
4
4
  const Text = ({ children, style, ...props }) => {
5
5
  if (!children) {
6
6
  return null;
@@ -1,9 +1,9 @@
1
1
  import React, { useState } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
- import Image from '../Image';
4
- import Text from '../Text';
3
+ import Image from '../../atoms/Image';
4
+ import Text from '../../atoms/Text';
5
5
  import { formatPlaceholder } from './utils/formatPlaceholder/index';
6
- import { horizontalScale, moderateScale, scaledForDevice } from '../../scale';
6
+ import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
7
7
  export const sizeValues = {
8
8
  sm: 24,
9
9
  md: 36,
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ViewStyle, TextStyle } from 'react-native';
3
- import { BaseButtonProps } from '../BaseButton';
3
+ import { BaseButtonProps } from '../../atoms/BaseButton';
4
4
  export declare const types: {
5
5
  main: string;
6
6
  secondary: string;
@@ -32,7 +32,7 @@ export type buttonColor = typeof color;
32
32
  export type keyColor = keyof buttonColor;
33
33
  export type buttonIconPosition = typeof iconPosition;
34
34
  export type keyIconPosition = keyof buttonIconPosition;
35
- interface ButtonProps extends BaseButtonProps {
35
+ export interface ButtonProps extends BaseButtonProps {
36
36
  type?: keyType;
37
37
  variant?: keyVariant;
38
38
  color?: keyColor;
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
- import BaseButton from '../BaseButton';
3
+ import BaseButton from '../../atoms/BaseButton';
4
4
  import getButtonStyles from './utils/getButtonStyles';
5
- import Loading from '../Loading';
6
- import Text from '../Text';
7
- import Icon from '../Icon';
5
+ import Loading from '../../atoms/Loading';
6
+ import Text from '../../atoms/Text';
7
+ import Icon from '../../atoms/Icon';
8
8
  export const types = {
9
9
  main: 'main',
10
10
  secondary: 'secondary',
@@ -28,7 +28,10 @@ export const iconPosition = {
28
28
  left: 'left',
29
29
  right: 'right',
30
30
  };
31
- const Button = ({ type = 'main', variant = 'contained', color = 'primary', iconPosition = 'left', isLoading = false, value = 'Button', icon = null, disabled = false, style, iconStyle, textStyle, ...props }) => {
31
+ const Button = ({ type = 'main', variant = 'contained', color = 'primary', iconPosition = 'left', isLoading = false, value = '', icon = null, disabled = false, style, iconStyle, textStyle, ...props }) => {
32
+ if (!value && !icon) {
33
+ return null;
34
+ }
32
35
  const validDisabled = disabled || isLoading;
33
36
  const hasIconAndText = !!icon && !!value;
34
37
  const borderRadius = variant === 'text' ? 6 : 50;
@@ -42,13 +45,13 @@ const Button = ({ type = 'main', variant = 'contained', color = 'primary', iconP
42
45
  hasIconAndText,
43
46
  });
44
47
  const styles = StyleSheet.create(buttonStyles);
45
- const LoadingCompontent = <Loading isLoading={isLoading} color={styles.loadingColor} size={24}/>;
48
+ const LoadingComponent = <Loading isLoading={isLoading} color={styles.loadingColor} size={24}/>;
46
49
  const WrapperComponent = (<View style={styles.direction}>
47
50
  {icon && <Icon name={icon} style={[styles.icon, iconStyle]} size={24}/>}
48
- {value && <Text style={[styles.text, textStyle]}>{value}</Text>}
51
+ {!!value && <Text style={[styles.text, textStyle]}>{value}</Text>}
49
52
  </View>);
50
53
  return (<BaseButton style={[styles.container, style]} pressedStyle={!validDisabled && styles.pressed} borderRadius={borderRadius} disabled={validDisabled} {...props}>
51
- {isLoading ? LoadingCompontent : WrapperComponent}
54
+ {isLoading ? LoadingComponent : WrapperComponent}
52
55
  </BaseButton>);
53
56
  };
54
57
  export default Button;
@@ -1,5 +1,5 @@
1
- import { moderateScale, scaledForDevice } from '../../../../scale';
2
- import { palette } from '../../../../theme/palette';
1
+ import { moderateScale, scaledForDevice } from '../../../../../scale';
2
+ import { palette } from '../../../../../theme/palette';
3
3
  import { colorConfig, styleConfig } from './utils/styleConfigs';
4
4
  import { validTypes, validVariants, validIconPositions, verticalHeights } from './utils/constants';
5
5
  import { defaultColor, defaultIconPosition, defaultType, defaultVariant, } from './utils/defaultValues';
@@ -102,6 +102,8 @@ export declare const styleConfig: {
102
102
  text: {
103
103
  fontWeight: string;
104
104
  textAlign: string;
105
+ fontFamily: string;
106
+ letterSpacing: number;
105
107
  };
106
108
  icon: {
107
109
  margin: {
@@ -1,5 +1,5 @@
1
- import { moderateScale, scaledForDevice } from '../../../../../../scale';
2
- import { base, black, grey, white } from '../../../../../../theme/palette';
1
+ import { moderateScale, scaledForDevice } from '../../../../../../../scale';
2
+ import { base, black, grey, white } from '../../../../../../../theme/palette';
3
3
  export const colorConfig = (selectedColor) => {
4
4
  return {
5
5
  main: {
@@ -105,6 +105,8 @@ export const styleConfig = {
105
105
  text: {
106
106
  fontWeight: '500',
107
107
  textAlign: 'center',
108
+ fontFamily: 'Roboto-Medium',
109
+ letterSpacing: 0,
108
110
  },
109
111
  icon: {
110
112
  margin: {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { NativeScrollEvent, NativeSyntheticEvent, ScrollView } from 'react-native';
3
- import { CarouselProps } from '..';
3
+ import { CarouselProps } from '../';
4
4
  declare const useCarouselControls: ({ pages, isLoop, autoplay, autoPlayReverse, intervalTime, customWidth, buttonsCallback, pagesCallback, }: CarouselProps) => {
5
5
  activePage: number;
6
6
  slider: import("react").MutableRefObject<ScrollView | null>;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export interface ItemSelectionButtonProps {
3
+ name: string;
4
+ selected?: boolean;
5
+ radioButton?: boolean;
6
+ leftSelection?: boolean;
7
+ rightSelection?: boolean;
8
+ onSelection?: () => {};
9
+ }
10
+ declare const ItemSelectionButton: React.FC<ItemSelectionButtonProps>;
11
+ export default ItemSelectionButton;
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import RadioButton from '../../atoms/RadioButton';
3
+ import CheckBox from '../../atoms/CheckBox';
4
+ import { StyleSheet, TouchableOpacity, View } from 'react-native';
5
+ import Text from '../../atoms/Text';
6
+ import { palette } from '../../../theme/palette';
7
+ import { horizontalScale, moderateScale, scaledForDevice, verticalScale } from '../../../scale';
8
+ const validPaddingHorizontal = scaledForDevice(16, horizontalScale);
9
+ const validMarginVertical = scaledForDevice(13, moderateScale);
10
+ const styles = StyleSheet.create({
11
+ container: {
12
+ justifyContent: 'center',
13
+ },
14
+ radioButtonContainer: {
15
+ display: 'flex',
16
+ height: verticalScale(48),
17
+ borderRadius: verticalScale(4),
18
+ },
19
+ checkBoxContainer: {
20
+ flexDirection: 'row',
21
+ justifyContent: 'space-between',
22
+ paddingHorizontal: validPaddingHorizontal,
23
+ marginVertical: validMarginVertical,
24
+ alignItems: 'center',
25
+ height: 'auto',
26
+ },
27
+ text: {
28
+ fontSize: 16,
29
+ fontWeight: '400',
30
+ color: palette.black.main,
31
+ textTransform: 'capitalize',
32
+ },
33
+ separator: {
34
+ alignSelf: 'center',
35
+ borderBottomColor: palette.grey[200],
36
+ borderBottomWidth: verticalScale(1),
37
+ width: '90%',
38
+ },
39
+ });
40
+ const ItemSelectionButton = ({ name, selected = false, radioButton = false, leftSelection = false, rightSelection = false, onSelection = () => { }, }) => {
41
+ if (!name) {
42
+ return null;
43
+ }
44
+ const checkPosition = rightSelection || (!rightSelection && !leftSelection) ? 'right' : 'left';
45
+ const renderSelectionComponent = () => {
46
+ if (!radioButton) {
47
+ return <CheckBox onPress={onSelection} checked={selected} customSize={24}/>;
48
+ }
49
+ return (<RadioButton onPress={onSelection} selected={selected} checkPosition={checkPosition} checkSize="md">
50
+ <Text style={styles.text}>{name}</Text>
51
+ </RadioButton>);
52
+ };
53
+ return (<View style={styles.container}>
54
+ <TouchableOpacity style={[
55
+ radioButton && styles.radioButtonContainer,
56
+ !radioButton && styles.checkBoxContainer,
57
+ ]} onPress={onSelection}>
58
+ {leftSelection && !rightSelection && renderSelectionComponent()}
59
+ {!radioButton && <Text style={styles.text}>{name}</Text>}
60
+ {((rightSelection && !leftSelection) || (!rightSelection && !leftSelection)) &&
61
+ renderSelectionComponent()}
62
+ </TouchableOpacity>
63
+ <View style={styles.separator}/>
64
+ </View>);
65
+ };
66
+ export default ItemSelectionButton;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
- import BaseButton from '../BaseButton';
4
- import { palette } from '../../theme/palette';
5
- import { moderateScale, scaledForDevice } from '../../scale';
3
+ import { palette } from '../../../theme/palette';
4
+ import { moderateScale, scaledForDevice } from '../../../scale';
6
5
  import { validVariants, parseButtonsStyles, buttonWrapperVariantStyles } from './utils';
6
+ import Button from '../Button';
7
7
  const LayoutWithBottomButtons = ({ children, buttons, variant = '', buttonBackgroundColor, ...props }) => {
8
8
  if (!children) {
9
9
  return null;
@@ -17,6 +17,7 @@ const LayoutWithBottomButtons = ({ children, buttons, variant = '', buttonBackgr
17
17
  if (!(parsedButtons instanceof Array) || !parsedButtons.length) {
18
18
  return null;
19
19
  }
20
+ const isRoundedOnTopVariant = selectedVariant === validVariants.roundedOnTop;
20
21
  const styles = StyleSheet.create({
21
22
  Container: {
22
23
  flex: 1,
@@ -36,7 +37,7 @@ const LayoutWithBottomButtons = ({ children, buttons, variant = '', buttonBackgr
36
37
  },
37
38
  ButtonsWrapper: {
38
39
  ...buttonWrapperVariantStyles(selectedVariant),
39
- flexDirection: 'row',
40
+ flexDirection: isRoundedOnTopVariant ? 'column' : 'row',
40
41
  justifyContent: 'space-between',
41
42
  backgroundColor: validBtnBgColor,
42
43
  marginTop: 'auto',
@@ -51,9 +52,9 @@ const LayoutWithBottomButtons = ({ children, buttons, variant = '', buttonBackgr
51
52
  return (<View style={[styles.Container]} {...props}>
52
53
  {children}
53
54
  <View style={[styles.FullButtonsRoundedWrapper]}>
54
- <BaseButton {...fullWidthButton}/>
55
+ <Button {...fullWidthButton}/>
55
56
  <View style={[styles.TwoButtonsWrapper]}>
56
- {newBtns.map(({ ...buttonData }, index) => (<BaseButton key={index.toString()} {...buttonData}/>))}
57
+ {newBtns.map(({ ...buttonData }, index) => (<Button key={index.toString()} {...buttonData}/>))}
57
58
  </View>
58
59
  </View>
59
60
  </View>);
@@ -64,7 +65,7 @@ const LayoutWithBottomButtons = ({ children, buttons, variant = '', buttonBackgr
64
65
  return (<View style={[styles.Container]} {...props}>
65
66
  {children}
66
67
  <View style={[styles.ButtonsWrapper]}>
67
- {parsedButtons.map(({ ...buttonData }, index) => (<BaseButton key={index.toString()} {...buttonData}/>))}
68
+ {parsedButtons.map(({ ...buttonData }, index) => (<Button key={index.toString()} {...buttonData}/>))}
68
69
  </View>
69
70
  </View>);
70
71
  };
@@ -1,12 +1,13 @@
1
1
  /// <reference types="react" />
2
+ import { keyColor } from '../../Button';
2
3
  import { PressableProps, ViewStyle, TextStyle } from 'react-native';
3
4
  export interface IlayoutButtons extends PressableProps {
4
- title?: string | null;
5
+ value?: string | null;
5
6
  icon?: string;
6
7
  iconRight?: boolean;
7
8
  disabled?: boolean;
8
9
  borderRadius?: number;
9
- color?: string;
10
+ color?: keyColor;
10
11
  pressedColor?: string;
11
12
  style?: ViewStyle;
12
13
  iconStyle?: ViewStyle;
@@ -18,6 +19,7 @@ interface IvalidVariants {
18
19
  [key: string]: string;
19
20
  squared: string;
20
21
  rounded: string;
22
+ roundedOnTop: string;
21
23
  default: string;
22
24
  }
23
25
  export declare const validVariants: IvalidVariants;
@@ -29,7 +31,7 @@ export declare const parseButtonsStyles: (buttons: Array<IlayoutButtons>, varian
29
31
  style: {
30
32
  borderRadius?: number | undefined;
31
33
  height?: string | number | undefined;
32
- backgroundColor: any;
34
+ backgroundColor: string;
33
35
  width: string | number;
34
36
  backfaceVisibility?: "visible" | "hidden" | undefined;
35
37
  borderBottomColor?: import("react-native").ColorValue | undefined;
@@ -58,7 +60,7 @@ export declare const parseButtonsStyles: (buttons: Array<IlayoutButtons>, varian
58
60
  elevation?: number | undefined;
59
61
  alignContent?: "center" | "flex-start" | "flex-end" | "stretch" | "space-between" | "space-around" | undefined;
60
62
  alignItems?: import("react-native").FlexAlignType | undefined;
61
- alignSelf?: "auto" | import("react-native").FlexAlignType | undefined;
63
+ alignSelf?: import("react-native").FlexAlignType | "auto" | undefined;
62
64
  aspectRatio?: number | undefined;
63
65
  borderEndWidth?: string | number | undefined;
64
66
  borderStartWidth?: string | number | undefined;
@@ -101,7 +103,7 @@ export declare const parseButtonsStyles: (buttons: Array<IlayoutButtons>, varian
101
103
  start?: string | number | undefined;
102
104
  top?: string | number | undefined;
103
105
  zIndex?: number | undefined;
104
- direction?: "ltr" | "rtl" | "inherit" | undefined;
106
+ direction?: "inherit" | "ltr" | "rtl" | undefined;
105
107
  shadowColor?: import("react-native").ColorValue | undefined;
106
108
  shadowOffset?: {
107
109
  width: number;
@@ -117,12 +119,12 @@ export declare const parseButtonsStyles: (buttons: Array<IlayoutButtons>, varian
117
119
  translateX?: number | undefined;
118
120
  translateY?: number | undefined;
119
121
  };
120
- title?: string | null | undefined;
122
+ value?: string | null | undefined;
121
123
  icon?: string | undefined;
122
124
  iconRight?: boolean | undefined;
123
125
  disabled?: boolean | undefined;
124
126
  borderRadius?: number | undefined;
125
- color?: string | undefined;
127
+ color?: "black" | "primary" | "success" | "error" | "warning" | "alert" | undefined;
126
128
  iconStyle?: ViewStyle | undefined;
127
129
  textStyle?: TextStyle | undefined;
128
130
  width?: string | number | undefined;
@@ -158,10 +160,10 @@ export declare const parseButtonsStyles: (buttons: Array<IlayoutButtons>, varian
158
160
  onMagicTap?: (() => void) | undefined;
159
161
  accessibilityIgnoresInvertColors?: boolean | undefined;
160
162
  onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined;
161
- testID?: string | undefined;
162
- nativeID?: string | undefined;
163
163
  pointerEvents?: "auto" | "none" | "box-none" | "box-only" | undefined;
164
164
  removeClippedSubviews?: boolean | undefined;
165
+ testID?: string | undefined;
166
+ nativeID?: string | undefined;
165
167
  collapsable?: boolean | undefined;
166
168
  needsOffscreenAlphaCompositing?: boolean | undefined;
167
169
  renderToHardwareTextureAndroid?: boolean | undefined;
@@ -197,7 +199,7 @@ export declare const parseButtonsStyles: (buttons: Array<IlayoutButtons>, varian
197
199
  style: {
198
200
  borderRadius?: number | undefined;
199
201
  height?: string | number | undefined;
200
- backgroundColor: any;
202
+ backgroundColor: string;
201
203
  backfaceVisibility?: "visible" | "hidden" | undefined;
202
204
  borderBottomColor?: import("react-native").ColorValue | undefined;
203
205
  borderBottomEndRadius?: number | undefined;
@@ -225,7 +227,7 @@ export declare const parseButtonsStyles: (buttons: Array<IlayoutButtons>, varian
225
227
  elevation?: number | undefined;
226
228
  alignContent?: "center" | "flex-start" | "flex-end" | "stretch" | "space-between" | "space-around" | undefined;
227
229
  alignItems?: import("react-native").FlexAlignType | undefined;
228
- alignSelf?: "auto" | import("react-native").FlexAlignType | undefined;
230
+ alignSelf?: import("react-native").FlexAlignType | "auto" | undefined;
229
231
  aspectRatio?: number | undefined;
230
232
  borderEndWidth?: string | number | undefined;
231
233
  borderStartWidth?: string | number | undefined;
@@ -269,7 +271,7 @@ export declare const parseButtonsStyles: (buttons: Array<IlayoutButtons>, varian
269
271
  top?: string | number | undefined;
270
272
  width?: string | number | undefined;
271
273
  zIndex?: number | undefined;
272
- direction?: "ltr" | "rtl" | "inherit" | undefined;
274
+ direction?: "inherit" | "ltr" | "rtl" | undefined;
273
275
  shadowColor?: import("react-native").ColorValue | undefined;
274
276
  shadowOffset?: {
275
277
  width: number;
@@ -285,12 +287,12 @@ export declare const parseButtonsStyles: (buttons: Array<IlayoutButtons>, varian
285
287
  translateX?: number | undefined;
286
288
  translateY?: number | undefined;
287
289
  };
288
- title?: string | null | undefined;
290
+ value?: string | null | undefined;
289
291
  icon?: string | undefined;
290
292
  iconRight?: boolean | undefined;
291
293
  disabled?: boolean | undefined;
292
294
  borderRadius?: number | undefined;
293
- color?: string | undefined;
295
+ color?: "black" | "primary" | "success" | "error" | "warning" | "alert" | undefined;
294
296
  iconStyle?: ViewStyle | undefined;
295
297
  textStyle?: TextStyle | undefined;
296
298
  width?: string | number | undefined;
@@ -325,10 +327,10 @@ export declare const parseButtonsStyles: (buttons: Array<IlayoutButtons>, varian
325
327
  onMagicTap?: (() => void) | undefined;
326
328
  accessibilityIgnoresInvertColors?: boolean | undefined;
327
329
  onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined;
328
- testID?: string | undefined;
329
- nativeID?: string | undefined;
330
330
  pointerEvents?: "auto" | "none" | "box-none" | "box-only" | undefined;
331
331
  removeClippedSubviews?: boolean | undefined;
332
+ testID?: string | undefined;
333
+ nativeID?: string | undefined;
332
334
  collapsable?: boolean | undefined;
333
335
  needsOffscreenAlphaCompositing?: boolean | undefined;
334
336
  renderToHardwareTextureAndroid?: boolean | undefined;