@bigbinary/neetoui-rn 0.0.269 → 0.0.271

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 (125) hide show
  1. package/lib/components/Accordion.js +1 -1
  2. package/lib/components/ActionIcon.js +1 -1
  3. package/lib/components/Alert.js +1 -1
  4. package/lib/components/AnimatedImage.js +1 -1
  5. package/lib/components/Avatar.js +1 -1
  6. package/lib/components/Badge.js +1 -1
  7. package/lib/components/BottomSheet.js +1 -1
  8. package/lib/components/BottomTabBar.js +1 -1
  9. package/lib/components/Button.js +1 -1
  10. package/lib/components/ButtonGroup.js +1 -1
  11. package/lib/components/Calendar.js +1 -1
  12. package/lib/components/Card.js +1 -1
  13. package/lib/components/Carousel.js +1 -1
  14. package/lib/components/ChatInput/AttachmentsView.js +1 -1
  15. package/lib/components/ChatInput/Badge.js +1 -1
  16. package/lib/components/ChatInput/ChatInput.js +1 -1
  17. package/lib/components/ChatInput/EmailFields.js +1 -1
  18. package/lib/components/ChatInput/IconButton.js +1 -1
  19. package/lib/components/ChatInput/MentionsInputWrapper.js +1 -1
  20. package/lib/components/CheckBox.js +1 -1
  21. package/lib/components/Chip.js +1 -1
  22. package/lib/components/Container.js +1 -1
  23. package/lib/components/Divider.js +1 -1
  24. package/lib/components/FAB.js +1 -1
  25. package/lib/components/FlashList.js +1 -1
  26. package/lib/components/FlatList.js +1 -1
  27. package/lib/components/Input.js +1 -1
  28. package/lib/components/InputEmailChip.js +1 -1
  29. package/lib/components/LineLoader.js +1 -1
  30. package/lib/components/ListItem.js +1 -1
  31. package/lib/components/Loader.js +1 -1
  32. package/lib/components/MultiSelect.js +1 -1
  33. package/lib/components/NotificationIcon.js +1 -1
  34. package/lib/components/NotificationPreferenceList.js +1 -1
  35. package/lib/components/OnBoarding.js +1 -1
  36. package/lib/components/OrganizationItem.js +1 -1
  37. package/lib/components/OtpInputs.js +1 -1
  38. package/lib/components/ParentView.js +1 -1
  39. package/lib/components/Popover.js +1 -1
  40. package/lib/components/RadioButton.js +1 -1
  41. package/lib/components/RichTextEditor.js +1 -1
  42. package/lib/components/Ripple.js +1 -1
  43. package/lib/components/ScrollView.js +1 -1
  44. package/lib/components/SearchBar.js +1 -1
  45. package/lib/components/SegmentedTopBar/Indicator.js +1 -1
  46. package/lib/components/SegmentedTopBar/Tab.js +1 -1
  47. package/lib/components/SegmentedTopBar/index.js +1 -1
  48. package/lib/components/SocialButton.js +1 -1
  49. package/lib/components/Toast.js +1 -1
  50. package/lib/components/ToggleSwitch.js +1 -1
  51. package/lib/components/TopBar.js +1 -1
  52. package/lib/components/Touchable.js +1 -1
  53. package/lib/components/TouchableWithoutFeedback.js +1 -1
  54. package/lib/components/Typography.js +1 -1
  55. package/lib/components/index.js +1 -1
  56. package/lib/config/toasterConfig.js +1 -1
  57. package/lib/contexts/index.js +1 -1
  58. package/lib/theme/index.js +1 -1
  59. package/lib/utils/utils.js +1 -1
  60. package/package.json +22 -15
  61. package/src/components/Accordion.jsx +0 -266
  62. package/src/components/ActionIcon.jsx +0 -76
  63. package/src/components/Alert.jsx +0 -262
  64. package/src/components/AnimatedImage.jsx +0 -140
  65. package/src/components/Avatar.jsx +0 -144
  66. package/src/components/Badge.jsx +0 -97
  67. package/src/components/BottomSheet.jsx +0 -487
  68. package/src/components/BottomTabBar.jsx +0 -232
  69. package/src/components/Button.jsx +0 -275
  70. package/src/components/ButtonGroup.jsx +0 -120
  71. package/src/components/Calendar.jsx +0 -128
  72. package/src/components/Card.jsx +0 -90
  73. package/src/components/Carousel.jsx +0 -116
  74. package/src/components/ChatInput/AttachmentsView.jsx +0 -51
  75. package/src/components/ChatInput/Badge.jsx +0 -24
  76. package/src/components/ChatInput/ChatInput.jsx +0 -564
  77. package/src/components/ChatInput/EmailFields.jsx +0 -122
  78. package/src/components/ChatInput/IconButton.jsx +0 -34
  79. package/src/components/ChatInput/MentionsInputWrapper.jsx +0 -155
  80. package/src/components/CheckBox.jsx +0 -150
  81. package/src/components/Chip.jsx +0 -180
  82. package/src/components/Container.jsx +0 -31
  83. package/src/components/Divider.jsx +0 -79
  84. package/src/components/FAB.jsx +0 -113
  85. package/src/components/FlashList.jsx +0 -189
  86. package/src/components/FlatList.js +0 -10
  87. package/src/components/Input.jsx +0 -357
  88. package/src/components/InputEmailChip.jsx +0 -246
  89. package/src/components/LineLoader.jsx +0 -46
  90. package/src/components/ListItem.jsx +0 -68
  91. package/src/components/Loader.jsx +0 -122
  92. package/src/components/MultiSelect.jsx +0 -631
  93. package/src/components/NotificationIcon.jsx +0 -38
  94. package/src/components/NotificationPreferenceList.jsx +0 -208
  95. package/src/components/OnBoarding.jsx +0 -134
  96. package/src/components/OrganizationItem.jsx +0 -110
  97. package/src/components/OtpInputs.jsx +0 -194
  98. package/src/components/ParentView.jsx +0 -139
  99. package/src/components/Popover.jsx +0 -221
  100. package/src/components/RadioButton.jsx +0 -155
  101. package/src/components/RichTextEditor.jsx +0 -163
  102. package/src/components/Ripple.jsx +0 -281
  103. package/src/components/ScrollView.js +0 -14
  104. package/src/components/SearchBar.jsx +0 -207
  105. package/src/components/SegmentedTopBar/Indicator.jsx +0 -77
  106. package/src/components/SegmentedTopBar/Tab.jsx +0 -37
  107. package/src/components/SegmentedTopBar/index.jsx +0 -128
  108. package/src/components/SocialButton.jsx +0 -106
  109. package/src/components/Toast.jsx +0 -195
  110. package/src/components/ToggleSwitch.jsx +0 -112
  111. package/src/components/TopBar.jsx +0 -147
  112. package/src/components/Touchable.jsx +0 -133
  113. package/src/components/TouchableWithoutFeedback.jsx +0 -51
  114. package/src/components/Typography.jsx +0 -93
  115. package/src/components/index.js +0 -45
  116. package/src/config/index.js +0 -1
  117. package/src/config/toasterConfig.jsx +0 -142
  118. package/src/contexts/index.js +0 -3
  119. package/src/hooks/index.js +0 -3
  120. package/src/hooks/useDebounce.js +0 -17
  121. package/src/hooks/useKeyboard.js +0 -33
  122. package/src/hooks/useRefreshByUser.js +0 -20
  123. package/src/index.js +0 -2
  124. package/src/theme/index.js +0 -181
  125. package/src/utils/utils.js +0 -56
@@ -1,155 +0,0 @@
1
- import React, { forwardRef, useContext, useState } from "react";
2
- import { ScrollView, StyleSheet } from "react-native";
3
-
4
- import PropTypes from "prop-types";
5
- import { MentionInput } from "react-native-controlled-mentions";
6
- import { moderateScale } from "react-native-size-matters";
7
- import { ThemeContext } from "styled-components/native";
8
-
9
- import {
10
- Touchable,
11
- Avatar,
12
- Typography,
13
- Card,
14
- Divider,
15
- Container,
16
- } from "@components";
17
-
18
- export const MentionsInputWrapper = forwardRef(
19
- ({ suggestions, shouldShowSuggestions, ...rest }, ref) => {
20
- const [visibleMentionsCount, setVisibleMentionsCount] = useState(0);
21
- const theme = useContext(ThemeContext);
22
-
23
- const heightOfMention = moderateScale(50);
24
- const mentionsListHeight = visibleMentionsCount * heightOfMention;
25
-
26
- const renderSuggestions = ({ keyword, onSuggestionPress }) => {
27
- if (!shouldShowSuggestions) return null;
28
-
29
- if (keyword === null) {
30
- if (visibleMentionsCount !== 0) setVisibleMentionsCount(0);
31
-
32
- return null;
33
- }
34
-
35
- const filteredSuggestions = suggestions.filter(suggestion =>
36
- suggestion.name
37
- .toLocaleLowerCase()
38
- .includes(keyword?.toLocaleLowerCase())
39
- );
40
-
41
- setVisibleMentionsCount(
42
- filteredSuggestions.length > 4 ? 4 : filteredSuggestions.length
43
- );
44
-
45
- return (
46
- <Card elevation={4}>
47
- <ScrollView
48
- contentInset={{ bottom: moderateScale(20) }}
49
- keyboardShouldPersistTaps="always"
50
- contentContainerStyle={{
51
- ...(filteredSuggestions.length === 0
52
- ? { height: 0 }
53
- : {
54
- height: mentionsListHeight,
55
- justifyContent: "flex-end",
56
- borderRadius: moderateScale(10),
57
- backgroundColor: theme.colors.background.grey100,
58
- }),
59
- }}
60
- >
61
- {filteredSuggestions.map((suggestion, index) => {
62
- const { name, imageUrl } = suggestion;
63
-
64
- return (
65
- <Touchable
66
- bg="background.grey100"
67
- width="100%"
68
- {...(index === 0 && {
69
- borderTopLeftRadius: moderateScale(10),
70
- borderTopRightRadius: moderateScale(10),
71
- })}
72
- {...(index === filteredSuggestions.length - 1 && {
73
- borderBottomLeftRadius: moderateScale(10),
74
- borderBottomRightRadius: moderateScale(10),
75
- })}
76
- height={heightOfMention}
77
- key={index}
78
- px={moderateScale(10)}
79
- onPress={() => onSuggestionPress(suggestion)}
80
- >
81
- <Container alignItems="center" flex={1} flexDirection="row">
82
- <Avatar
83
- imageUrl={imageUrl}
84
- mr={moderateScale(8)}
85
- name={name}
86
- variant="extra-small"
87
- />
88
- <Typography
89
- color="font.primary"
90
- flex={1}
91
- fontFamily="sf400"
92
- fontSize="xs"
93
- >
94
- {name}
95
- </Typography>
96
- </Container>
97
- {index !== filteredSuggestions.length - 1 && (
98
- <Divider bg="border.primary" width="100%" />
99
- )}
100
- </Touchable>
101
- );
102
- })}
103
- </ScrollView>
104
- </Card>
105
- );
106
- };
107
-
108
- return (
109
- <MentionInput
110
- inputRef={ref}
111
- placeholderTextColor={theme.colors.font.grey400}
112
- style={{ color: theme.colors.font.grey800 }}
113
- suggestions={suggestions}
114
- containerStyle={[
115
- styles.mentionsTextInputStyle,
116
- {
117
- minHeight: moderateScale(60) + mentionsListHeight,
118
- },
119
- ]}
120
- partTypes={[
121
- {
122
- isInsertSpaceAfterMention: true,
123
- allowedSpacesCount: 0,
124
- trigger: "@",
125
- renderSuggestions,
126
- textStyle: {
127
- fontFamily: theme.fonts.sf700,
128
- color: theme.colors.font.base,
129
- },
130
- },
131
- ]}
132
- {...rest}
133
- />
134
- );
135
- }
136
- );
137
-
138
- MentionsInputWrapper.displayName = "MentionsInputWrapper";
139
- const styles = StyleSheet.create({
140
- mentionsTextInputStyle: {
141
- marginVertical: moderateScale(10),
142
- flex: 1,
143
- width: "100%",
144
- },
145
- });
146
-
147
- MentionsInputWrapper.propTypes = {
148
- shouldShowSuggestions: PropTypes.bool,
149
- suggestions: PropTypes.arrayOf(
150
- PropTypes.shape({
151
- name: PropTypes.string,
152
- imageUrl: PropTypes.string,
153
- })
154
- ),
155
- };
@@ -1,150 +0,0 @@
1
- import React, { useContext } from "react";
2
-
3
- import {
4
- Checkbox as CheckboxIcon,
5
- CheckboxInactive,
6
- } from "@bigbinary/neeto-icons-rn";
7
- import Proptypes from "prop-types";
8
- import { moderateScale } from "react-native-size-matters";
9
- import { ThemeContext } from "styled-components/native";
10
-
11
- import { Typography, Touchable } from "@components";
12
-
13
- /**
14
- *
15
- * <div class="screenshots">
16
- * <img src="screenshots/checkbox/checkbox.png" />
17
- * </div>
18
- *
19
- * This component supports below props categories from [styled-system ](/styled-system).
20
- * <ul>
21
- * <li>flexbox</li>
22
- * <li>space</li>
23
- * <li>border</li>
24
- * <li>layout</li>
25
- * <li>color</li>
26
- * <li>buttonStyle</li>
27
- * </ul>
28
- *
29
- * ## Usage
30
- * ```js
31
- * import * as React from "react";
32
- * import { moderateScale } from "react-native-size-matters";
33
- * import { Container, CheckBox } from "@bigbinary/neetoui-rn";
34
- *
35
- * export default function Main() {
36
- * const [checked, setChecked] = useState(true);
37
- *
38
- * return (
39
- * <Container>
40
- * <CheckBox
41
- * mt={moderateScale(2)}
42
- * checked={checked1}
43
- * onSelect={() => setChecked1(prev => !prev)}
44
- * label={`Checkbox marked as ${!checked1 ? "un" : ""}checked`}
45
- * />
46
- * <CheckBox
47
- * mt={moderateScale(3)}
48
- * checked={checked2}
49
- * onSelect={() => setChecked2(prev => !prev)}
50
- * label={`Checkbox marked as ${!checked2 ? "un" : ""}checked`}
51
- * />
52
- * <CheckBox mt={moderateScale(3)} disabled label="Disabled checkbox" />
53
- * </Container>
54
- * );
55
- * }
56
- * ```
57
- *
58
- */
59
-
60
- export const CheckBox = ({
61
- checked,
62
- onSelect,
63
- disabled,
64
- label,
65
- checkIconStyle,
66
- labelStyle,
67
- ...rest
68
- }) => {
69
- const theme = useContext(ThemeContext);
70
- const disabledProps = {
71
- labelProps: {
72
- color: theme.colors.font.grey400,
73
- },
74
- };
75
-
76
- const checkedProps = {
77
- labelProps: {
78
- fontFamily: theme.fonts.sf600,
79
- },
80
- };
81
-
82
- const unCheckedProps = {
83
- labelProps: {
84
- fontFamily: theme.fonts.sf400,
85
- },
86
- };
87
-
88
- const Icon = checked ? CheckboxIcon : CheckboxInactive;
89
-
90
- return (
91
- <Touchable
92
- alignItems="center"
93
- disabled={disabled}
94
- flexDirection="row"
95
- flexShrink={1}
96
- py={moderateScale(8)}
97
- onPress={onSelect}
98
- {...rest}
99
- >
100
- <Typography
101
- flex={1}
102
- fontSize="m"
103
- lineHeight={`${moderateScale(22)}px`}
104
- {...(checked && checkedProps.labelProps)}
105
- {...(!checked && unCheckedProps.labelProps)}
106
- {...(disabled && disabledProps.labelProps)}
107
- {...labelStyle}
108
- >
109
- {label}
110
- </Typography>
111
- <Icon
112
- color={theme.colors.font.primary}
113
- size={moderateScale(22)}
114
- {...checkIconStyle}
115
- />
116
- </Touchable>
117
- );
118
- };
119
-
120
- CheckBox.propTypes = {
121
- /**
122
- * Whether checkbox is checked or not.
123
- */
124
- checked: Proptypes.bool.isRequired,
125
- /**
126
- * Function to execute on press.
127
- */
128
- onSelect: Proptypes.func.isRequired,
129
- /**
130
- * To disable the component.
131
- */
132
- disabled: Proptypes.bool,
133
- /**
134
- * Text label to be shown with radio button.
135
- */
136
- label: Proptypes.string,
137
- /**
138
- * Customize check icon style.
139
- */
140
- checkIconStyle: Proptypes.object,
141
- /**
142
- * Customize label style.
143
- */
144
- labelStyle: Proptypes.object,
145
- };
146
-
147
- CheckBox.defaultProps = {
148
- checked: false,
149
- onSelect: () => {},
150
- };
@@ -1,180 +0,0 @@
1
- import React from "react";
2
-
3
- import { Close } from "@bigbinary/neeto-icons-rn";
4
- import PropTypes from "prop-types";
5
- import { moderateScale } from "react-native-size-matters";
6
-
7
- import { Typography, Touchable, Container } from "@components";
8
-
9
- const variantStyleObj = {
10
- solid: {
11
- bg: "background.grey200",
12
- },
13
- outlined: {
14
- bg: "background.white",
15
- border: "1px solid",
16
- borderColor: "border.grey200",
17
- },
18
- };
19
-
20
- /**
21
- *
22
- * Chips are compact elements that represent an input, attribute, or action.
23
- *
24
- * <div class="screenshots">
25
- * <img src="screenshots/chip/chip.png" />
26
- * </div>
27
- *
28
- * ## Usage
29
- * ```js
30
- * import * as React from 'react';
31
- * import { Chip, Container, Typography } from '@bigbinary/neetoui-rn';
32
- *
33
- * export default function Main(){
34
- * return (
35
- * <Container>
36
- * <Chip
37
- * label="Outlined Chip"
38
- * LeftIcon={() => <Typography>📣</Typography>}
39
- * variant="outlined"
40
- * onChipPress={() => {
41
- * alert("Chip pressed");
42
- * }}
43
- * onClose={() => {
44
- * alert("On Close clicked");
45
- * }}
46
- * />
47
- * </Container>
48
- * );
49
- * }
50
- * ```
51
- *
52
- */
53
-
54
- const commonContainerStyle = {
55
- alignItems: "center",
56
- borderRadius: moderateScale(20),
57
- flexDirection: "row",
58
- };
59
-
60
- export const Chip = ({
61
- label,
62
- LeftIcon,
63
- variant,
64
- labelColor,
65
- closeIconBackground,
66
- closeIconColor,
67
- onClose,
68
- onChipPress,
69
- isDisabled,
70
- closeIconSize,
71
- closeIcon: CloseIcon,
72
- closeIconProps,
73
- containerStyle,
74
- closeIconContainerStyle,
75
- }) => (
76
- <Container
77
- {...commonContainerStyle}
78
- {...(variant && variantStyleObj[variant])}
79
- {...(isDisabled && { opacity: 0.5 })}
80
- {...containerStyle}
81
- m={0}
82
- p={0}
83
- >
84
- <Touchable
85
- disabled={!onChipPress || isDisabled}
86
- overflow="hidden"
87
- px={moderateScale(4)}
88
- py={moderateScale(2)}
89
- onPress={onChipPress}
90
- {...commonContainerStyle}
91
- {...containerStyle}
92
- >
93
- {LeftIcon && <LeftIcon />}
94
- <Typography color={labelColor} fontFamily="sf400" mx={moderateScale(2)}>
95
- {label}
96
- </Typography>
97
- </Touchable>
98
- {onClose && (
99
- <Container
100
- bg={closeIconBackground}
101
- borderRadius={closeIconSize}
102
- m={moderateScale(3)}
103
- p={moderateScale(1)}
104
- {...closeIconContainerStyle}
105
- >
106
- <Touchable disabled={isDisabled} onPress={onClose}>
107
- <CloseIcon
108
- color={closeIconColor}
109
- size={closeIconSize}
110
- {...closeIconProps}
111
- />
112
- </Touchable>
113
- </Container>
114
- )}
115
- </Container>
116
- );
117
-
118
- Chip.defaultProps = {
119
- variant: "outlined",
120
- labelColor: "font.primary",
121
- closeIconBackground: "background.grey500",
122
- closeIconColor: "white",
123
- closeIconProps: { viewBox: "0 0 25 25" },
124
- isDisabled: false,
125
- closeIconSize: moderateScale(14),
126
- closeIcon: Close,
127
- };
128
-
129
- Chip.propTypes = {
130
- /**
131
- * Takes the text that needs to be displayed inside the chip.
132
- */
133
- label: PropTypes.string.isRequired,
134
- /**
135
- * Expects a component. Used to set left Icon or Avatar.
136
- */
137
- LeftIcon: PropTypes.elementType,
138
- /**
139
- * Supported variant: 'outlined' | 'solid'
140
- */
141
- variant: PropTypes.string,
142
- /**
143
- * Sets chip text color.
144
- */
145
- labelColor: PropTypes.string,
146
- /**
147
- * Sets close Icon background color.
148
- */
149
- closeIconBackground: PropTypes.string,
150
- /**
151
- * Sets close Icon color.
152
- */
153
- closeIconColor: PropTypes.string,
154
- /**
155
- * Expects a function to execute on close icon press. The close icon appears only when the onClose prop is specified.
156
- */
157
- onClose: PropTypes.func,
158
- /**
159
- * Used to set the size of the close icon.
160
- */
161
- closeIconSize: PropTypes.number,
162
- /**
163
- * Close icon can be specified if default one needs to changed. Only supports neeto-icons.
164
- */
165
- closeIcon: PropTypes.elementType,
166
- /**
167
- * Add additional customization to close icon.
168
- */
169
- closeIconProps: PropTypes.object,
170
- /**
171
- * Expects a function to execute on chip press.
172
- */
173
- onChipPress: PropTypes.func,
174
- /**
175
- * Whether the chip is disabled. A disabled chip has a overlay and onPress is not called on touch.
176
- */
177
- isDisabled: PropTypes.bool,
178
- containerStyle: PropTypes.object,
179
- closeIconContainerStyle: PropTypes.object,
180
- };
@@ -1,31 +0,0 @@
1
- import * as React from "react";
2
-
3
- import propTypes from "@styled-system/prop-types";
4
- import PropTypes from "prop-types";
5
- import styled from "styled-components/native";
6
- import { flexbox, space, border, color, layout } from "styled-system";
7
-
8
- const View = styled.View`
9
- ${flexbox}
10
- ${space}
11
- ${border}
12
- ${color}
13
- ${layout}
14
- `;
15
-
16
- export const Container = ({ children, ...rest }) => (
17
- <View {...rest}>{children}</View>
18
- );
19
-
20
- Container.defaultProps = {
21
- color: "background.primary",
22
- };
23
-
24
- Container.propTypes = {
25
- ...propTypes.flexbox,
26
- ...propTypes.space,
27
- ...propTypes.border,
28
- ...propTypes.color,
29
- ...propTypes.layout,
30
- children: PropTypes.node,
31
- };
@@ -1,79 +0,0 @@
1
- import * as React from "react";
2
-
3
- import propTypes from "@styled-system/prop-types";
4
- import PropTypes from "prop-types";
5
- import { moderateScale } from "react-native-size-matters";
6
- import styled from "styled-components/native";
7
- import { flexbox, space, color, layout } from "styled-system";
8
-
9
- /**
10
- *
11
- * Divider is a separator line that can be used between two different sections.
12
- *
13
- * <div class="screenshots">
14
- * <img src="screenshots/divider/divider.png" />
15
- * </div>
16
- *
17
- * ## Usage
18
- * ```js
19
- * import * as React from 'react';
20
- * import { Divider } from '@bigbinary/neetoui-rn';
21
- *
22
- * export default function Main(){
23
- * return (
24
- * <Container>
25
- * <Divider orientation="vertical" thickness={moderateScale(1)}/>
26
- * </Container>
27
- * );
28
- * }
29
- * ```
30
- *
31
- */
32
-
33
- const View = styled.View`
34
- ${flexbox}
35
- ${space}
36
- ${color}
37
- ${layout}
38
- `;
39
-
40
- export const Divider = ({ thickness, orientation, bg, ...rest }) => {
41
- const isHorizontal = orientation === "horizontal";
42
- const lineStyles = isHorizontal
43
- ? {
44
- ...rest,
45
- height: thickness,
46
- }
47
- : {
48
- ...rest,
49
- width: thickness,
50
- flex: 1,
51
- };
52
-
53
- return thickness > 0 && <View bg={bg} {...lineStyles} />;
54
- };
55
-
56
- Divider.defaultProps = {
57
- bg: "background.grey400",
58
- orientation: "horizontal",
59
- thickness: moderateScale(1),
60
- };
61
-
62
- Divider.propTypes = {
63
- ...propTypes.flexbox,
64
- ...propTypes.space,
65
- ...propTypes.color,
66
- ...propTypes.layout,
67
- /**
68
- * To specify whether the line needs to horizontal or vertical
69
- */
70
- orientation: PropTypes.oneOf(["horizontal", "vertical"]),
71
- /**
72
- * To specify the thickness of divider
73
- */
74
- thickness: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
75
- /**
76
- * To specify the color of divider
77
- */
78
- bg: PropTypes.string,
79
- };
@@ -1,113 +0,0 @@
1
- import * as React from "react";
2
-
3
- import propTypes from "@styled-system/prop-types";
4
- import PropTypes from "prop-types";
5
- import { moderateScale } from "react-native-size-matters";
6
-
7
- import { Touchable } from "@components";
8
- import { theme } from "@theme";
9
- /**
10
- * FAB component is a floating action button which represents the primary action in an application and is built on top of styled-system.
11
- *
12
- * This component supports below props categories from [styled-system ](/styled-system).
13
- *
14
- * <ul>
15
- * <li>space</li>
16
- * <li>layout</li>
17
- * <li>flexbox</li>
18
- * <li>color</li>
19
- * <li>textStyle</li>
20
- * <li>buttonStyle</li>
21
- * </ul>
22
- *
23
- * <div class="screenshots">
24
- * <img src="screenshots/fab/buttonstyles.png" />
25
- * </div>
26
- *
27
- * ## Usage
28
- * ```js
29
- * import * as React from 'react';
30
- * import { FAB, Container, Typography } from '@bigbinary/neetoui-rn';
31
- *
32
- * export default function Main() {
33
- * return (
34
- * <Container>
35
- * <FAB
36
- * Icon={() => {
37
- * return <Typography>🔔</Typography>;
38
- * }}
39
- * />
40
- * </Container>
41
- * );
42
- * }
43
- * ```
44
- *
45
- * @extends StyledSystems props /styled-system
46
- */
47
-
48
- // eslint-disable-next-line @bigbinary/neeto/no-dangling-constants
49
- export const FAB = ({ Icon, bg, disabled, variant, onPress, ...rest }) => {
50
- const shadowStyle = {
51
- shadowColor: theme.colors.background.grey800,
52
- shadowOffset: {
53
- width: 0,
54
- height: moderateScale(2),
55
- },
56
- shadowOpacity: 0.25,
57
- shadowRadius: moderateScale(3.84),
58
- elevation: 5,
59
- };
60
-
61
- let style = rest.style || {};
62
- if (disabled) {
63
- style = { ...style, opacity: 0.5 };
64
- }
65
-
66
- return (
67
- <Touchable
68
- {...(variant !== "inverse" ? { bg } : {})}
69
- disabled={disabled}
70
- style={[style, shadowStyle]}
71
- variant={variant}
72
- onPress={onPress}
73
- {...(variant !== "inverse" ? { borderColor: bg } : {})}
74
- {...rest}
75
- >
76
- <Icon />
77
- </Touchable>
78
- );
79
- };
80
-
81
- FAB.defaultProps = {
82
- variant: "solid",
83
- size: moderateScale(56),
84
- alignItems: "center",
85
- justifyContent: "center",
86
- borderRadius: moderateScale(28),
87
- };
88
-
89
- FAB.propTypes = {
90
- ...propTypes.flexbox,
91
- ...propTypes.position,
92
- ...propTypes.space,
93
- ...propTypes.border,
94
- ...propTypes.layout,
95
- ...propTypes.color,
96
- /**
97
- * Icon to display for the Button.
98
- */
99
- Icon: PropTypes.elementType.isRequired,
100
- /**
101
- * Function to execute on press.
102
- */
103
- onPress: PropTypes.func.isRequired,
104
- /**
105
- * String to set background color.
106
- */
107
- bg: PropTypes.string,
108
- /**
109
- * Boolean to disable button.
110
- */
111
- disabled: PropTypes.bool,
112
- variant: PropTypes.string,
113
- };