groundfloor-react-ui 1.2.9 → 1.2.11

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 (186) hide show
  1. package/dist/index.es.js +432 -422
  2. package/dist/index.js +459 -449
  3. package/package.json +15 -43
  4. package/rollup.config.js +6 -6
  5. package/assets/fonts/Averta/Averta-Black.woff2 +0 -0
  6. package/assets/fonts/Averta/Averta-BlackItalic.woff2 +0 -0
  7. package/assets/fonts/Averta/Averta-Bold.woff2 +0 -0
  8. package/assets/fonts/Averta/Averta-BoldItalic.woff2 +0 -0
  9. package/assets/fonts/Averta/Averta-ExtraBold.woff2 +0 -0
  10. package/assets/fonts/Averta/Averta-ExtraBoldItalic.woff2 +0 -0
  11. package/assets/fonts/Averta/Averta-ExtraThin.woff2 +0 -0
  12. package/assets/fonts/Averta/Averta-ExtraThinItalic.woff2 +0 -0
  13. package/assets/fonts/Averta/Averta-Light.woff2 +0 -0
  14. package/assets/fonts/Averta/Averta-LightItalic.woff2 +0 -0
  15. package/assets/fonts/Averta/Averta-Regular.woff2 +0 -0
  16. package/assets/fonts/Averta/Averta-RegularItalic.woff2 +0 -0
  17. package/assets/fonts/Averta/Averta-SemiBold.woff2 +0 -0
  18. package/assets/fonts/Averta/Averta-SemiBoldItalic.woff2 +0 -0
  19. package/assets/fonts/Averta/Averta-Thin.woff2 +0 -0
  20. package/assets/fonts/Averta/Averta-ThinItalic.woff2 +0 -0
  21. package/assets/fonts/Beauty/BeautyDemo.woff +0 -0
  22. package/assets/icons/app-logo.svg +0 -3
  23. package/assets/icons/arrow-down.svg +0 -3
  24. package/assets/icons/arrow-rotate.svg +0 -1
  25. package/assets/icons/arrow-up.svg +0 -3
  26. package/assets/icons/bell.svg +0 -3
  27. package/assets/icons/check.svg +0 -3
  28. package/assets/icons/checkmark.svg +0 -3
  29. package/assets/icons/chevron-down.svg +0 -3
  30. package/assets/icons/chevron-left.svg +0 -3
  31. package/assets/icons/chevron-right.svg +0 -3
  32. package/assets/icons/cloud-icon.svg +0 -3
  33. package/assets/icons/connection.svg +0 -3
  34. package/assets/icons/cross-icon.svg +0 -3
  35. package/assets/icons/default.svg +0 -1
  36. package/assets/icons/door-internal-active.svg +0 -1
  37. package/assets/icons/edit-icon.svg +0 -3
  38. package/assets/icons/ellipses-horizontal.svg +0 -3
  39. package/assets/icons/ellipses.svg +0 -3
  40. package/assets/icons/email.svg +0 -3
  41. package/assets/icons/eye-hide-view.svg +0 -1
  42. package/assets/icons/eye-hide.svg +0 -1
  43. package/assets/icons/file-attach-white.svg +0 -3
  44. package/assets/icons/file-attach.svg +0 -3
  45. package/assets/icons/file-icon.svg +0 -1
  46. package/assets/icons/file-upload.svg +0 -3
  47. package/assets/icons/functional-equation-regular.svg +0 -147
  48. package/assets/icons/hamburger-menu.svg +0 -3
  49. package/assets/icons/heart.svg +0 -18
  50. package/assets/icons/image.svg +0 -3
  51. package/assets/icons/info.svg +0 -3
  52. package/assets/icons/jpg-icon.svg +0 -3
  53. package/assets/icons/magnifier.svg +0 -3
  54. package/assets/icons/menu-ellipse-two.svg +0 -1
  55. package/assets/icons/menu-ellipse.svg +0 -53
  56. package/assets/icons/pause-all.svg +0 -1
  57. package/assets/icons/pdf-icon.svg +0 -3
  58. package/assets/icons/pen-icon.svg +0 -3
  59. package/assets/icons/plus-outlined.svg +0 -3
  60. package/assets/icons/resume.svg +0 -1
  61. package/assets/icons/sign-icon.svg +0 -3
  62. package/assets/icons/star.svg +0 -3
  63. package/assets/icons/trash-icon.svg +0 -59
  64. package/assets/icons/triangle-down.svg +0 -3
  65. package/assets/icons/users.svg +0 -11
  66. package/assets/icons/view.svg +0 -3
  67. package/assets/icons/watcher.svg +0 -3
  68. package/assets/icons/zoom-in-white.svg +0 -1
  69. package/assets/styles/global.css +0 -0
  70. package/assets/styles/global.scss +0 -0
  71. package/components/Accordion/Accordion.js +0 -167
  72. package/components/Accordion/AccordionSB.js +0 -170
  73. package/components/Accordion/AccordionSBfooter.js +0 -171
  74. package/components/Accordion/index.js +0 -4
  75. package/components/ArrowBar/ArrowBar.js +0 -276
  76. package/components/ArrowBar/index.js +0 -2
  77. package/components/Avatar/Avatar.js +0 -171
  78. package/components/Avatar/AvatarSB.js +0 -255
  79. package/components/Avatar/AvatarSBfooter.js +0 -279
  80. package/components/Avatar/index.js +0 -4
  81. package/components/Banner/Banner.js +0 -70
  82. package/components/Banner/index.js +0 -2
  83. package/components/Breadcrumb/Breadcrumb.js +0 -225
  84. package/components/Breadcrumb/index.js +0 -2
  85. package/components/Button/PrimaryButton.js +0 -167
  86. package/components/Button/SecondaryButton.js +0 -156
  87. package/components/Button/TinyButton.js +0 -101
  88. package/components/Button/index.js +0 -6
  89. package/components/Cards/Card.js +0 -43
  90. package/components/Cards/CardRef.js +0 -71
  91. package/components/Cards/DocumentCard.js +0 -215
  92. package/components/Cards/index.js +0 -5
  93. package/components/Content/Content.js +0 -50
  94. package/components/Content/index.js +0 -1
  95. package/components/DesignComponent/StyledComponent/StyledComponent.js +0 -326
  96. package/components/DesignComponent/StyledComponent/index.js +0 -1
  97. package/components/DesignComponent/index.js +0 -1
  98. package/components/Divider/Divider.js +0 -56
  99. package/components/Divider/index.js +0 -2
  100. package/components/Drawer/Drawer.js +0 -84
  101. package/components/Drawer/index.js +0 -2
  102. package/components/ErrorBoundary/ErrorBoundary.js +0 -44
  103. package/components/ErrorBoundary/index.js +0 -1
  104. package/components/FilterChip/FilterChip.js +0 -70
  105. package/components/FilterChip/index.js +0 -1
  106. package/components/Footer/Footer.js +0 -57
  107. package/components/Footer/FooterContent.js +0 -98
  108. package/components/Footer/index.js +0 -3
  109. package/components/Form/FormComponent.js +0 -244
  110. package/components/Form/HeaderComponent.js +0 -64
  111. package/components/Form/SubmitComponent.js +0 -63
  112. package/components/Form/index.js +0 -5
  113. package/components/GroupAvatars/GroupAvatars.js +0 -139
  114. package/components/GroupAvatars/index.js +0 -1
  115. package/components/GroupButtons/ButtonPopup.js +0 -191
  116. package/components/GroupButtons/GroupButtons.js +0 -150
  117. package/components/GroupButtons/GroupButtonsPopup.js +0 -163
  118. package/components/GroupButtons/index.js +0 -3
  119. package/components/GroupStatusCircle/GroupStatusCircle.js +0 -135
  120. package/components/GroupStatusCircle/index.js +0 -1
  121. package/components/Header/Header.js +0 -58
  122. package/components/Header/index.js +0 -1
  123. package/components/HyperLink/HyperLink.js +0 -114
  124. package/components/HyperLink/index.js +0 -1
  125. package/components/Icon/Icon.js +0 -176
  126. package/components/Icon/index.js +0 -1
  127. package/components/Images/Image.js +0 -107
  128. package/components/Images/index.js +0 -2
  129. package/components/Inputs/CheckBoxInput.js +0 -341
  130. package/components/Inputs/ColorInput.js +0 -145
  131. package/components/Inputs/DateSelect.js +0 -461
  132. package/components/Inputs/DropdownSelect.js +0 -689
  133. package/components/Inputs/DropzoneInput.js +0 -450
  134. package/components/Inputs/NumericInput.js +0 -177
  135. package/components/Inputs/PasswordInput.js +0 -267
  136. package/components/Inputs/RadioInput.js +0 -292
  137. package/components/Inputs/SearchInput.js +0 -19
  138. package/components/Inputs/Signature.js +0 -369
  139. package/components/Inputs/TextArea.js +0 -214
  140. package/components/Inputs/TextInput.js +0 -251
  141. package/components/Inputs/TimeInput.js +0 -186
  142. package/components/Inputs/ToggleSwitch.js +0 -189
  143. package/components/Inputs/index.js +0 -15
  144. package/components/Label/Label.js +0 -48
  145. package/components/Label/index.js +0 -1
  146. package/components/Loaders/Loader.js +0 -179
  147. package/components/Loaders/index.js +0 -2
  148. package/components/Modal/ModalComp.js +0 -216
  149. package/components/Modal/index.js +0 -1
  150. package/components/Overlay/Overlay.js +0 -158
  151. package/components/Overlay/index.js +0 -1
  152. package/components/Pagination/Pagination.js +0 -59
  153. package/components/Pagination/index.js +0 -1
  154. package/components/ProgressBar/ProgressBar.js +0 -101
  155. package/components/ProgressBar/index.js +0 -1
  156. package/components/ProgressSteps/ProgressSteps.js +0 -121
  157. package/components/ProgressSteps/index.js +0 -1
  158. package/components/Rating/Rating.js +0 -258
  159. package/components/Rating/index.js +0 -1
  160. package/components/SecondaryLink/DarkSecondaryLink.js +0 -97
  161. package/components/SecondaryLink/LightSecondaryLink.js +0 -93
  162. package/components/SecondaryLink/index.js +0 -3
  163. package/components/Sidebar/Navbar.js +0 -306
  164. package/components/Sidebar/Sidebar.js +0 -207
  165. package/components/Sidebar/index.js +0 -3
  166. package/components/StatusChip/PrimaryStatusChip.js +0 -78
  167. package/components/StatusChip/SecondaryStatusChip.js +0 -78
  168. package/components/StatusChip/SlimPrimaryStatusChip.js +0 -92
  169. package/components/StatusChip/SlimSecondaryStatusChip.js +0 -93
  170. package/components/StatusChip/index.js +0 -6
  171. package/components/StatusCircle/StatusCircle.js +0 -64
  172. package/components/StatusCircle/index.js +0 -1
  173. package/components/Tables/Table.js +0 -178
  174. package/components/Tables/index.js +0 -1
  175. package/components/Tooltip/Tooltip.js +0 -581
  176. package/components/Tooltip/index.js +0 -1
  177. package/components/Typography/Typography.js +0 -77
  178. package/components/Typography/index.js +0 -2
  179. package/components/constants/colors.js +0 -33
  180. package/components/constants/defaultStyle.js +0 -804
  181. package/components/constants/defaultThemeColor.js +0 -16
  182. package/components/constants/index.js +0 -7
  183. package/components/constants/utils.js +0 -31
  184. package/components/global/FontStyle.js +0 -131
  185. package/components/global/index.js +0 -1
  186. package/index.js +0 -41
@@ -1,167 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import styled, { useTheme } from 'styled-components';
4
- import defaultThemeColor from '../constants/defaultThemeColor';
5
- import getDefaultStyles, { hexToRGB } from '../constants/utils';
6
- import { Loader } from '../Loaders';
7
-
8
- /**
9
- * Primary UI component for user interaction
10
- */
11
-
12
- const sizes = {
13
- sm: {
14
- fontSize: '14px',
15
- padding: '5px 15px',
16
- },
17
- md: {
18
- fontSize: '16px',
19
- padding: '5.5px 15px',
20
- },
21
- lg: {
22
- fontSize: '18px',
23
- padding: '8px 20px',
24
- },
25
- };
26
-
27
- const buttonDisabledBg = ({ theme, variant }) =>
28
- hexToRGB(theme.variant[variant], 0.6);
29
-
30
- const StyledButton = styled.button`
31
- background: ${({ theme, variant }) => theme.variant[variant]};
32
- color: ${({ theme }) => theme.bgColor};
33
- padding: ${({ size }) => sizes[size].padding};
34
- border: 1px solid ${({ theme, variant }) => theme.variant[variant]};
35
- border-radius: 5px;
36
- font-size: ${({ size }) => sizes[size].fontSize};
37
- display: flex;
38
- align-items: center;
39
- width: ${({ block }) => (block ? '100%' : 'auto')};
40
- cursor: pointer;
41
- line-height: 18px;
42
- outline: none;
43
- &:disabled {
44
- color: ${({ theme }) => theme.bgColor};
45
- background: ${buttonDisabledBg};
46
- border: 1px solid ${buttonDisabledBg};
47
- cursor: not-allowed;
48
- }
49
-
50
- //Set the styles from the default styles object
51
- ${({ theme, defaultStyle }) => {
52
- return getDefaultStyles(theme, defaultStyle);
53
- }}
54
-
55
- // custom styles
56
- ${({ btnStyle }) => btnStyle}
57
- `;
58
-
59
-
60
- export const PrimaryButton = ({
61
- btnStyle,
62
- block,
63
- size,
64
- style,
65
- variant,
66
- disabled,
67
- isLoading,
68
- type,
69
- theme,
70
- id,
71
- ...props
72
- }) => {
73
- const activeTheme = useTheme() || defaultThemeColor
74
-
75
- return (
76
- <StyledButton
77
- id={id}
78
- block={block}
79
- variant={variant}
80
- defaultStyle='button'
81
- type={type}
82
- style={style}
83
- size={size}
84
- theme={theme}
85
- disabled={disabled}
86
- btnStyle={btnStyle}
87
- {...props}
88
- >
89
- {isLoading && (
90
- <div
91
- style={{
92
- paddingRight: '10px',
93
- display: 'flex',
94
- justifyContent: 'center',
95
- alignItems: 'center',
96
- }}
97
- >
98
- <Loader
99
- customStyles={{ 'background-color': activeTheme.bgColor }}
100
- size={16}
101
- />
102
- </div>
103
- )}
104
- {props.children}
105
- </StyledButton>
106
- );
107
- };
108
-
109
- PrimaryButton.propTypes = {
110
- /**
111
- * Type of Button. primary-1, 2, error, etc.
112
- */
113
- variant: PropTypes.string,
114
- /**
115
- * Is the button disabled?
116
- */
117
- disabled: PropTypes.bool,
118
- /**
119
- * How large should the button be?
120
- */
121
- size: PropTypes.oneOf(['sm', 'md', 'lg']),
122
- /**
123
- * Optional click handler
124
- */
125
- block: PropTypes.bool,
126
- /**
127
- * Optional loading handler
128
- */
129
- isLoading: PropTypes.bool,
130
- /**
131
- * Optional click handler
132
- */
133
- onClick: PropTypes.func,
134
- /**
135
- * Theme object
136
- */
137
- theme: PropTypes.object,
138
- /**
139
- * Type of the btn i.e: button or submit etc.
140
- */
141
- type: PropTypes.string,
142
- /**
143
- * custom style of button
144
- */
145
- btnStyle: PropTypes.object,
146
- /**
147
- * id of the primaryBtn
148
- */
149
- id: PropTypes.string,
150
-
151
- };
152
-
153
- StyledButton.defaultProps = {
154
- theme: defaultThemeColor,
155
- };
156
-
157
- PrimaryButton.defaultProps = {
158
- theme: defaultThemeColor,
159
- variant: 'primary-1',
160
- block: false,
161
- isLoading: false,
162
- disabled: false,
163
- size: 'md',
164
- onClick: undefined,
165
- btnStyle: {},
166
- id: ''
167
- };
@@ -1,156 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import styled, { useTheme } from 'styled-components';
4
- import defaultThemeColor from '../constants/defaultThemeColor';
5
- import getDefaultStyles from '../constants/utils';
6
- import { Loader } from '../Loaders';
7
-
8
- /**
9
- * Secondary UI component for user interaction
10
- */
11
-
12
- const sizes = {
13
- sm: {
14
- fontSize: '14',
15
- padding: '5px 15px',
16
- },
17
- md: {
18
- fontSize: '16',
19
- padding: '5.5px 15px',
20
- },
21
- lg: {
22
- fontSize: '18',
23
- padding: '8px 20px',
24
- },
25
- };
26
-
27
-
28
- const StyledButton = styled.button`
29
- color: ${({ theme, variant }) => theme.variant[variant]};
30
- background: ${({ theme }) => theme.bgColor};
31
- padding: ${({ size }) => sizes[size].padding};
32
- border: 1px solid ${({ theme, variant }) => theme.variant[variant]};
33
- font-size: ${({ size }) => sizes[size].fontSize};
34
- border-radius: 5px;
35
- display: flex;
36
- align-items: center;
37
- outline: none;
38
- width: ${({ block }) => (block ? '100%' : 'auto')};
39
- cursor: pointer;
40
- line-height: 18px;
41
- &:disabled {
42
- color: #929eac;
43
- border: 1px solid ${({ theme }) => theme.neutral['neutral-3']};
44
- cursor: not-allowed;
45
- }
46
-
47
- //Set the styles from the default styles object
48
- ${({ theme, defaultStyle }) => {
49
- return getDefaultStyles(theme, defaultStyle);
50
- }}
51
- // custom styles
52
- ${({ btnStyle }) => btnStyle}
53
- `;
54
-
55
- export const SecondaryButton = ({
56
- btnStyle,
57
- isLoading,
58
- block,
59
- size,
60
- style,
61
- variant,
62
- disabled,
63
- type,
64
- theme,
65
- id,
66
- ...props
67
- }) => {
68
- const activeTheme = useTheme() || defaultThemeColor
69
- return (
70
- <StyledButton
71
- id={id}
72
- block={block}
73
- variant={variant}
74
- defaultStyle='button'
75
- style={style}
76
- size={size}
77
- disabled={disabled}
78
- type={type}
79
- btnStyle={btnStyle}
80
- isLoading={isLoading}
81
- theme={theme}
82
- {...props}
83
- >
84
- {isLoading && (
85
- <div
86
- style={{
87
- paddingRight: '10px',
88
- display: 'flex',
89
- justifyContent: 'center',
90
- alignItems: 'center',
91
- }}
92
- >
93
- <Loader
94
- theme={theme}
95
- customStyles={{ 'background-color': activeTheme.variant[variant] }}
96
- size={16}
97
- /> </div>
98
- )}
99
- {props.children}{' '}
100
- </StyledButton>
101
- );
102
- };
103
-
104
- SecondaryButton.propTypes = {
105
- /**
106
- * Type of Button. primary-1, 2, error, etc.
107
- */
108
- variant: PropTypes.string,
109
- /**
110
- * Is the button disabled?
111
- */
112
- disabled: PropTypes.bool,
113
- /**
114
- * How large should the button be?
115
- */
116
- size: PropTypes.oneOf(['sm', 'md', 'lg']),
117
- /**
118
- * Optional click handler
119
- */
120
- block: PropTypes.bool,
121
- /**
122
- * Optional click handler
123
- */
124
- onClick: PropTypes.func,
125
- /**
126
- * Theme object
127
- */
128
- theme: PropTypes.object,
129
- /**
130
- * Type of the btn i.e: button or submit etc.
131
- */
132
- type: PropTypes.string,
133
- /**
134
- * custome style of button
135
- */
136
- btnStyle: PropTypes.object,
137
- /**
138
- * id of the secondaryBtn
139
- */
140
- id: PropTypes.string,
141
- };
142
-
143
- StyledButton.defaultProps = {
144
- theme: defaultThemeColor,
145
- };
146
-
147
- SecondaryButton.defaultProps = {
148
- theme: defaultThemeColor,
149
- variant: 'primary-1',
150
- block: false,
151
- disabled: false,
152
- size: 'md',
153
- onClick: undefined,
154
- btnStyle: {},
155
- id: ''
156
- };
@@ -1,101 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import styled, { useTheme } from 'styled-components';
4
- import defaultThemeColor from '../constants/defaultThemeColor';
5
- import getDefaultStyles from '../constants/utils';
6
-
7
- /**
8
- * Primary UI component for user interaction
9
- */
10
-
11
- const buttonDisabledBg = '#BBC4CF';
12
-
13
- const StyledButton = styled.button`
14
- background: ${({ disabled, theme, variant }) => disabled ? buttonDisabledBg : theme.variant[variant]};
15
- color: ${({ theme }) => theme.bgColor};
16
- padding: 3px 14px;
17
- border: 1px solid ${({ theme, variant }) => theme.variant[variant]};
18
- border-radius: 10.5px;
19
- font-size: 14px;
20
- line-height: 17px;
21
- outline: none;
22
- display: flex;
23
- align-items: center;
24
- width: ${({ block }) => block ? '100%' : 'auto'};
25
- cursor: pointer;
26
-
27
- &:disabled {
28
- color: #929EAC;
29
- background: ${buttonDisabledBg};
30
- border: 1px solid ${buttonDisabledBg};
31
- cursor: not-allowed;
32
- }
33
-
34
- //Set the styles from the default styles object
35
- ${({ theme, defaultStyle }) => {
36
- return getDefaultStyles(theme, defaultStyle);
37
- }}
38
- `;
39
-
40
- export const TinyButton = ({ block, style, variant, disabled, type, id, ...props }) => {
41
- const theme = useTheme() || defaultThemeColor;
42
- return (
43
- <StyledButton
44
- id={id}
45
- block={block}
46
- variant={variant}
47
- defaultStyle="button"
48
- type={type}
49
- style={style}
50
- disabled={disabled}
51
- {...props}
52
- >
53
- {props.children}
54
- </StyledButton>
55
- );
56
- };
57
-
58
- TinyButton.propTypes = {
59
- /**
60
- * Type of Button. primary-1, 2, error, etc.
61
- */
62
- variant: PropTypes.string,
63
- /**
64
- * Is the button disabled?
65
- */
66
- disabled: PropTypes.bool,
67
- /**
68
- * Optional click handler
69
- */
70
- block: PropTypes.bool,
71
- /**
72
- * Optional click handler
73
- */
74
- onClick: PropTypes.func,
75
- /**
76
- * Theme object
77
- */
78
- theme: PropTypes.object,
79
- /**
80
- * Type of the btn i.e: button or submit etc.
81
- */
82
- type: PropTypes.string,
83
- /**
84
- * id of the tinybtn
85
- */
86
- id: PropTypes.string,
87
- };
88
-
89
- StyledButton.defaultProps = {
90
- theme: defaultThemeColor,
91
- }
92
-
93
- TinyButton.defaultProps = {
94
- theme: defaultThemeColor,
95
- variant: 'primary-1',
96
- block: false,
97
- disabled: false,
98
- onClick: undefined,
99
- id: ''
100
- };
101
-
@@ -1,6 +0,0 @@
1
- export * from './PrimaryButton';
2
- export * from './SecondaryButton';
3
- export * from './TinyButton';
4
-
5
-
6
-
@@ -1,43 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import styled, { useTheme } from 'styled-components';
4
- import defaultThemeColor from '../constants/defaultThemeColor';
5
-
6
- const CardWrapper = styled.div`
7
- color: ${({ activeTheme }) => activeTheme.textColor};
8
- padding-top: 25px;
9
- padding-bottom: 25px;
10
- padding-left: 32px;
11
- padding-right: 32px;
12
- background-color: ${({ activeTheme }) => activeTheme.bgColor};
13
- width: inherit;
14
- height: inherit;
15
- border-radius: 5px;
16
- box-shadow: 0px 5px 37px rgba(56, 66, 100, 0.0880136);
17
- border-color: ${({ activeTheme }) => activeTheme.border};
18
-
19
- // custom styles
20
- ${({ customStyles }) => customStyles}
21
- `;
22
-
23
- export const Card = ({ type, header, content, ...props }) => {
24
- const activeTheme = useTheme() || defaultThemeColor;
25
-
26
- return (
27
- <CardWrapper activeTheme={activeTheme} {...props}>
28
- {header}
29
- {content}
30
- </CardWrapper>
31
- );
32
- };
33
-
34
- Card.propTypes = {
35
- /**
36
- * header of the card
37
- */
38
- header: PropTypes.any,
39
- /**
40
- * the content of the card
41
- */
42
- content: PropTypes.any,
43
- };
@@ -1,71 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React, { forwardRef } from 'react';
3
- import styled, { useTheme } from 'styled-components';
4
- import defaultStyles from '../constants/defaultStyle';
5
- import defaultThemeColor from '../constants/defaultThemeColor';
6
-
7
- const CardWrapper = styled.div`
8
-
9
- color: ${({ activeTheme }) => activeTheme.textColor};
10
- padding-top: 25px;
11
- padding-bottom: 25px;
12
- padding-left: 32px;
13
- padding-right: 32px;
14
- background-color: ${({ activeTheme }) => activeTheme.bgColor};
15
- width: inherit;
16
- border-radius: 5px;
17
- box-shadow: 0px 5px 37px rgba(56, 66, 100, 0.0880136);
18
- border-color: ${({ activeTheme }) => activeTheme.border};
19
- transition: all .5s ease .95ms !important;
20
-
21
- //Set the styles from the default styles object
22
- ${({ inBuiltCss, type }) => {
23
- if (inBuiltCss) {
24
- let tempObj = {};
25
- if (inBuiltCss[type]) {
26
- for (const property in inBuiltCss[type]) {
27
- tempObj[property] = inBuiltCss[type][property];
28
- delete inBuiltCss.common[property];
29
- }
30
- for (const property in inBuiltCss['common']) {
31
- tempObj[property] = inBuiltCss['common'][property];
32
- }
33
- }
34
- return tempObj;
35
- }
36
- }}
37
-
38
- // custom styles
39
- ${({ customStyles }) => customStyles}
40
- `;
41
-
42
- export const CardRef = forwardRef(({ type, header, content, ...props }, ref) => {
43
- const activeTheme = useTheme() || defaultThemeColor;
44
-
45
- return (
46
- <CardWrapper
47
- inBuiltCss={defaultStyles}
48
- activeTheme={activeTheme}
49
- {...props}
50
- ref={ref}
51
- >
52
- {header}
53
- {content}
54
- </CardWrapper>
55
- );
56
- });
57
-
58
- CardRef.propTypes = {
59
- /**
60
- * the type of the element
61
- */
62
- type: PropTypes.string,
63
- /**
64
- * header of the card
65
- */
66
- header: PropTypes.any,
67
- /**
68
- * the content of the card
69
- */
70
- content: PropTypes.any,
71
- };