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.
- package/dist/index.es.js +432 -422
- package/dist/index.js +459 -449
- package/package.json +15 -43
- package/rollup.config.js +6 -6
- package/assets/fonts/Averta/Averta-Black.woff2 +0 -0
- package/assets/fonts/Averta/Averta-BlackItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Bold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-BoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraBold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraBoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraThin.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraThinItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Light.woff2 +0 -0
- package/assets/fonts/Averta/Averta-LightItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Regular.woff2 +0 -0
- package/assets/fonts/Averta/Averta-RegularItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-SemiBold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-SemiBoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Thin.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ThinItalic.woff2 +0 -0
- package/assets/fonts/Beauty/BeautyDemo.woff +0 -0
- package/assets/icons/app-logo.svg +0 -3
- package/assets/icons/arrow-down.svg +0 -3
- package/assets/icons/arrow-rotate.svg +0 -1
- package/assets/icons/arrow-up.svg +0 -3
- package/assets/icons/bell.svg +0 -3
- package/assets/icons/check.svg +0 -3
- package/assets/icons/checkmark.svg +0 -3
- package/assets/icons/chevron-down.svg +0 -3
- package/assets/icons/chevron-left.svg +0 -3
- package/assets/icons/chevron-right.svg +0 -3
- package/assets/icons/cloud-icon.svg +0 -3
- package/assets/icons/connection.svg +0 -3
- package/assets/icons/cross-icon.svg +0 -3
- package/assets/icons/default.svg +0 -1
- package/assets/icons/door-internal-active.svg +0 -1
- package/assets/icons/edit-icon.svg +0 -3
- package/assets/icons/ellipses-horizontal.svg +0 -3
- package/assets/icons/ellipses.svg +0 -3
- package/assets/icons/email.svg +0 -3
- package/assets/icons/eye-hide-view.svg +0 -1
- package/assets/icons/eye-hide.svg +0 -1
- package/assets/icons/file-attach-white.svg +0 -3
- package/assets/icons/file-attach.svg +0 -3
- package/assets/icons/file-icon.svg +0 -1
- package/assets/icons/file-upload.svg +0 -3
- package/assets/icons/functional-equation-regular.svg +0 -147
- package/assets/icons/hamburger-menu.svg +0 -3
- package/assets/icons/heart.svg +0 -18
- package/assets/icons/image.svg +0 -3
- package/assets/icons/info.svg +0 -3
- package/assets/icons/jpg-icon.svg +0 -3
- package/assets/icons/magnifier.svg +0 -3
- package/assets/icons/menu-ellipse-two.svg +0 -1
- package/assets/icons/menu-ellipse.svg +0 -53
- package/assets/icons/pause-all.svg +0 -1
- package/assets/icons/pdf-icon.svg +0 -3
- package/assets/icons/pen-icon.svg +0 -3
- package/assets/icons/plus-outlined.svg +0 -3
- package/assets/icons/resume.svg +0 -1
- package/assets/icons/sign-icon.svg +0 -3
- package/assets/icons/star.svg +0 -3
- package/assets/icons/trash-icon.svg +0 -59
- package/assets/icons/triangle-down.svg +0 -3
- package/assets/icons/users.svg +0 -11
- package/assets/icons/view.svg +0 -3
- package/assets/icons/watcher.svg +0 -3
- package/assets/icons/zoom-in-white.svg +0 -1
- package/assets/styles/global.css +0 -0
- package/assets/styles/global.scss +0 -0
- package/components/Accordion/Accordion.js +0 -167
- package/components/Accordion/AccordionSB.js +0 -170
- package/components/Accordion/AccordionSBfooter.js +0 -171
- package/components/Accordion/index.js +0 -4
- package/components/ArrowBar/ArrowBar.js +0 -276
- package/components/ArrowBar/index.js +0 -2
- package/components/Avatar/Avatar.js +0 -171
- package/components/Avatar/AvatarSB.js +0 -255
- package/components/Avatar/AvatarSBfooter.js +0 -279
- package/components/Avatar/index.js +0 -4
- package/components/Banner/Banner.js +0 -70
- package/components/Banner/index.js +0 -2
- package/components/Breadcrumb/Breadcrumb.js +0 -225
- package/components/Breadcrumb/index.js +0 -2
- package/components/Button/PrimaryButton.js +0 -167
- package/components/Button/SecondaryButton.js +0 -156
- package/components/Button/TinyButton.js +0 -101
- package/components/Button/index.js +0 -6
- package/components/Cards/Card.js +0 -43
- package/components/Cards/CardRef.js +0 -71
- package/components/Cards/DocumentCard.js +0 -215
- package/components/Cards/index.js +0 -5
- package/components/Content/Content.js +0 -50
- package/components/Content/index.js +0 -1
- package/components/DesignComponent/StyledComponent/StyledComponent.js +0 -326
- package/components/DesignComponent/StyledComponent/index.js +0 -1
- package/components/DesignComponent/index.js +0 -1
- package/components/Divider/Divider.js +0 -56
- package/components/Divider/index.js +0 -2
- package/components/Drawer/Drawer.js +0 -84
- package/components/Drawer/index.js +0 -2
- package/components/ErrorBoundary/ErrorBoundary.js +0 -44
- package/components/ErrorBoundary/index.js +0 -1
- package/components/FilterChip/FilterChip.js +0 -70
- package/components/FilterChip/index.js +0 -1
- package/components/Footer/Footer.js +0 -57
- package/components/Footer/FooterContent.js +0 -98
- package/components/Footer/index.js +0 -3
- package/components/Form/FormComponent.js +0 -244
- package/components/Form/HeaderComponent.js +0 -64
- package/components/Form/SubmitComponent.js +0 -63
- package/components/Form/index.js +0 -5
- package/components/GroupAvatars/GroupAvatars.js +0 -139
- package/components/GroupAvatars/index.js +0 -1
- package/components/GroupButtons/ButtonPopup.js +0 -191
- package/components/GroupButtons/GroupButtons.js +0 -150
- package/components/GroupButtons/GroupButtonsPopup.js +0 -163
- package/components/GroupButtons/index.js +0 -3
- package/components/GroupStatusCircle/GroupStatusCircle.js +0 -135
- package/components/GroupStatusCircle/index.js +0 -1
- package/components/Header/Header.js +0 -58
- package/components/Header/index.js +0 -1
- package/components/HyperLink/HyperLink.js +0 -114
- package/components/HyperLink/index.js +0 -1
- package/components/Icon/Icon.js +0 -176
- package/components/Icon/index.js +0 -1
- package/components/Images/Image.js +0 -107
- package/components/Images/index.js +0 -2
- package/components/Inputs/CheckBoxInput.js +0 -341
- package/components/Inputs/ColorInput.js +0 -145
- package/components/Inputs/DateSelect.js +0 -461
- package/components/Inputs/DropdownSelect.js +0 -689
- package/components/Inputs/DropzoneInput.js +0 -450
- package/components/Inputs/NumericInput.js +0 -177
- package/components/Inputs/PasswordInput.js +0 -267
- package/components/Inputs/RadioInput.js +0 -292
- package/components/Inputs/SearchInput.js +0 -19
- package/components/Inputs/Signature.js +0 -369
- package/components/Inputs/TextArea.js +0 -214
- package/components/Inputs/TextInput.js +0 -251
- package/components/Inputs/TimeInput.js +0 -186
- package/components/Inputs/ToggleSwitch.js +0 -189
- package/components/Inputs/index.js +0 -15
- package/components/Label/Label.js +0 -48
- package/components/Label/index.js +0 -1
- package/components/Loaders/Loader.js +0 -179
- package/components/Loaders/index.js +0 -2
- package/components/Modal/ModalComp.js +0 -216
- package/components/Modal/index.js +0 -1
- package/components/Overlay/Overlay.js +0 -158
- package/components/Overlay/index.js +0 -1
- package/components/Pagination/Pagination.js +0 -59
- package/components/Pagination/index.js +0 -1
- package/components/ProgressBar/ProgressBar.js +0 -101
- package/components/ProgressBar/index.js +0 -1
- package/components/ProgressSteps/ProgressSteps.js +0 -121
- package/components/ProgressSteps/index.js +0 -1
- package/components/Rating/Rating.js +0 -258
- package/components/Rating/index.js +0 -1
- package/components/SecondaryLink/DarkSecondaryLink.js +0 -97
- package/components/SecondaryLink/LightSecondaryLink.js +0 -93
- package/components/SecondaryLink/index.js +0 -3
- package/components/Sidebar/Navbar.js +0 -306
- package/components/Sidebar/Sidebar.js +0 -207
- package/components/Sidebar/index.js +0 -3
- package/components/StatusChip/PrimaryStatusChip.js +0 -78
- package/components/StatusChip/SecondaryStatusChip.js +0 -78
- package/components/StatusChip/SlimPrimaryStatusChip.js +0 -92
- package/components/StatusChip/SlimSecondaryStatusChip.js +0 -93
- package/components/StatusChip/index.js +0 -6
- package/components/StatusCircle/StatusCircle.js +0 -64
- package/components/StatusCircle/index.js +0 -1
- package/components/Tables/Table.js +0 -178
- package/components/Tables/index.js +0 -1
- package/components/Tooltip/Tooltip.js +0 -581
- package/components/Tooltip/index.js +0 -1
- package/components/Typography/Typography.js +0 -77
- package/components/Typography/index.js +0 -2
- package/components/constants/colors.js +0 -33
- package/components/constants/defaultStyle.js +0 -804
- package/components/constants/defaultThemeColor.js +0 -16
- package/components/constants/index.js +0 -7
- package/components/constants/utils.js +0 -31
- package/components/global/FontStyle.js +0 -131
- package/components/global/index.js +0 -1
- 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
|
-
|
package/components/Cards/Card.js
DELETED
|
@@ -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
|
-
};
|