groundfloor-react-ui 1.0.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.
- package/README.md +20 -0
- 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 +3 -0
- package/assets/icons/arrow-down.svg +3 -0
- package/assets/icons/arrow-rotate.svg +1 -0
- package/assets/icons/arrow-up.svg +3 -0
- package/assets/icons/bell.svg +3 -0
- package/assets/icons/check.svg +3 -0
- package/assets/icons/checkmark.svg +3 -0
- package/assets/icons/chevron-down.svg +3 -0
- package/assets/icons/chevron-left.svg +3 -0
- package/assets/icons/chevron-right.svg +3 -0
- package/assets/icons/cloud-icon.svg +3 -0
- package/assets/icons/connection.svg +3 -0
- package/assets/icons/cross-icon.svg +3 -0
- package/assets/icons/door-internal-active.svg +1 -0
- package/assets/icons/edit-icon.svg +3 -0
- package/assets/icons/ellipses-horizontal.svg +3 -0
- package/assets/icons/ellipses.svg +3 -0
- package/assets/icons/email.svg +3 -0
- package/assets/icons/eye-hide-view.svg +1 -0
- package/assets/icons/eye-hide.svg +1 -0
- package/assets/icons/file-attach-white.svg +3 -0
- package/assets/icons/file-attach.svg +3 -0
- package/assets/icons/functional-equation-regular.svg +147 -0
- package/assets/icons/hamburger-menu.svg +3 -0
- package/assets/icons/heart.svg +18 -0
- package/assets/icons/image.svg +3 -0
- package/assets/icons/info.svg +3 -0
- package/assets/icons/jpg-icon.svg +3 -0
- package/assets/icons/magnifier.svg +3 -0
- package/assets/icons/menu-ellipse-two.svg +1 -0
- package/assets/icons/menu-ellipse.svg +53 -0
- package/assets/icons/pause-all.svg +1 -0
- package/assets/icons/pdf-icon.svg +3 -0
- package/assets/icons/pen-icon.svg +3 -0
- package/assets/icons/plus-outlined.svg +3 -0
- package/assets/icons/resume.svg +1 -0
- package/assets/icons/sign-icon.svg +3 -0
- package/assets/icons/star.svg +3 -0
- package/assets/icons/trash-icon.svg +59 -0
- package/assets/icons/triangle-down.svg +3 -0
- package/assets/icons/users.svg +11 -0
- package/assets/icons/view.svg +3 -0
- package/assets/icons/watcher.svg +3 -0
- package/assets/icons/zoom-in-white.svg +1 -0
- package/assets/styles/global.css +0 -0
- package/assets/styles/global.scss +0 -0
- package/components/Accordion/Accordion.js +114 -0
- package/components/Accordion/AccordionSB.js +168 -0
- package/components/Accordion/AccordionSBfooter.js +171 -0
- package/components/Accordion/index.js +4 -0
- package/components/ArrowBar/ArrowBar.js +293 -0
- package/components/ArrowBar/index.js +2 -0
- package/components/Avatar/Avatar.js +167 -0
- package/components/Avatar/AvatarSB.js +226 -0
- package/components/Avatar/AvatarSBfooter.js +226 -0
- package/components/Avatar/index.js +4 -0
- package/components/Banner/Banner.js +65 -0
- package/components/Banner/index.js +2 -0
- package/components/Breadcrumb/Breadcrumb.js +192 -0
- package/components/Breadcrumb/index.js +2 -0
- package/components/Button/PrimaryButton.js +125 -0
- package/components/Button/SecondaryButton.js +114 -0
- package/components/Button/TinyButton.js +94 -0
- package/components/Button/index.js +6 -0
- package/components/Cards/Card.js +48 -0
- package/components/Cards/CardRef.js +64 -0
- package/components/Cards/DocumentCard.js +221 -0
- package/components/Cards/index.js +5 -0
- package/components/Content/Content.js +51 -0
- package/components/Content/index.js +1 -0
- package/components/Divider/Divider.js +63 -0
- package/components/Divider/index.js +2 -0
- package/components/Drawer/Drawer.js +93 -0
- package/components/Drawer/index.js +2 -0
- package/components/ErrorBoundary/ErrorBoundary.js +44 -0
- package/components/ErrorBoundary/index.js +1 -0
- package/components/FilterChip/FilterChip.js +68 -0
- package/components/FilterChip/index.js +1 -0
- package/components/Footer/Footer.js +58 -0
- package/components/Footer/FooterContentLev3.js +96 -0
- package/components/Footer/index.js +2 -0
- package/components/Form/FormComponent.js +273 -0
- package/components/Form/HeaderComponent.js +39 -0
- package/components/Form/StyledComponent.js +323 -0
- package/components/Form/SubmitComponent.js +63 -0
- package/components/Form/index.js +4 -0
- package/components/GroupAvatars/GroupAvatars.js +143 -0
- package/components/GroupAvatars/index.js +1 -0
- package/components/GroupButtons/ButtonPopup.js +192 -0
- package/components/GroupButtons/GroupButtons.js +150 -0
- package/components/GroupButtons/GroupButtonsPopup.js +169 -0
- package/components/GroupButtons/index.js +3 -0
- package/components/GroupStatusCircle/GroupStatusCircle.js +135 -0
- package/components/GroupStatusCircle/index.js +1 -0
- package/components/Header/Header.js +58 -0
- package/components/Header/index.js +1 -0
- package/components/HyperLink/HyperLink.js +114 -0
- package/components/HyperLink/index.js +1 -0
- package/components/Icon/Icon.js +161 -0
- package/components/Icon/index.js +1 -0
- package/components/Images/Image.js +112 -0
- package/components/Images/index.js +2 -0
- package/components/Inputs/CheckBoxEditableInput.js +352 -0
- package/components/Inputs/CheckBoxInput.js +195 -0
- package/components/Inputs/CheckBoxInputMS.js +160 -0
- package/components/Inputs/DateSelect.js +411 -0
- package/components/Inputs/DropdownSelect.js +466 -0
- package/components/Inputs/DropzoneInput.js +335 -0
- package/components/Inputs/NumericInput.js +155 -0
- package/components/Inputs/RadioInput.js +205 -0
- package/components/Inputs/SearchInput.js +18 -0
- package/components/Inputs/Signature.js +278 -0
- package/components/Inputs/TextArea.js +196 -0
- package/components/Inputs/TextInput.js +182 -0
- package/components/Inputs/TextInputClicable.js +198 -0
- package/components/Inputs/TextInputClicableMS.js +255 -0
- package/components/Inputs/TimeInput.js +181 -0
- package/components/Inputs/ToggleSwitch.js +123 -0
- package/components/Inputs/index.js +13 -0
- package/components/Label/Label.js +48 -0
- package/components/Label/index.js +1 -0
- package/components/Loaders/Loader.js +179 -0
- package/components/Loaders/index.js +2 -0
- package/components/Modal/Modal.js +116 -0
- package/components/Modal/ModalComp.js +158 -0
- package/components/Modal/index.js +2 -0
- package/components/Overlay/Overlay.js +159 -0
- package/components/Overlay/index.js +1 -0
- package/components/Pagination/Pagination.js +83 -0
- package/components/Pagination/index.js +1 -0
- package/components/ProgressBar/ProgressBar.js +84 -0
- package/components/ProgressBar/index.js +1 -0
- package/components/ProgressSteps/ProgressSteps.js +121 -0
- package/components/ProgressSteps/index.js +1 -0
- package/components/Rating/Rating.js +264 -0
- package/components/Rating/index.js +1 -0
- package/components/SecondaryLink/DarkSecondaryLink.js +97 -0
- package/components/SecondaryLink/LightSecondaryLink.js +93 -0
- package/components/SecondaryLink/index.js +3 -0
- package/components/Sidebar/Navbar.js +328 -0
- package/components/Sidebar/Sidebar.js +180 -0
- package/components/Sidebar/index.js +3 -0
- package/components/StatusChip/PrimaryStatusChip.js +78 -0
- package/components/StatusChip/SecondaryStatusChip.js +78 -0
- package/components/StatusChip/SlimPrimaryStatusChip.js +92 -0
- package/components/StatusChip/SlimSecondaryStatusChip.js +93 -0
- package/components/StatusChip/index.js +6 -0
- package/components/StatusCircle/StatusCircle.js +64 -0
- package/components/StatusCircle/index.js +1 -0
- package/components/Tables/Table.js +156 -0
- package/components/Tables/index.js +1 -0
- package/components/Tooltip/Tooltip.js +479 -0
- package/components/Tooltip/index.js +1 -0
- package/components/Typography/Typography.js +78 -0
- package/components/Typography/index.js +2 -0
- package/components/constants/colors.js +33 -0
- package/components/constants/defaultStyle.js +781 -0
- package/components/constants/defaultThemeColor.js +15 -0
- package/components/constants/index.js +7 -0
- package/components/constants/utils.js +31 -0
- package/components/global/FontStyle.js +131 -0
- package/components/global/index.js +1 -0
- package/dist/index.es.js +2302 -0
- package/dist/index.js +2302 -0
- package/index.js +40 -0
- package/package.json +67 -0
- package/rollup.config.js +53 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
import getDefaultStyles from '../constants/utils';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Secondary UI component for user interaction
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const sizes = {
|
|
12
|
+
sm: {
|
|
13
|
+
fontSize: '14px',
|
|
14
|
+
padding: '5px 15px'
|
|
15
|
+
},
|
|
16
|
+
md: {
|
|
17
|
+
fontSize: '16px',
|
|
18
|
+
padding: '6px 15px'
|
|
19
|
+
},
|
|
20
|
+
lg: {
|
|
21
|
+
fontSize: '18px',
|
|
22
|
+
padding: '8px 20px'
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const buttonDisabledBg = '#BBC4CF';
|
|
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
|
+
width: ${({ block }) => block ? '100%' : 'auto'};
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
|
|
40
|
+
&:disabled {
|
|
41
|
+
color: #929EAC;
|
|
42
|
+
border: 1px solid ${buttonDisabledBg};
|
|
43
|
+
cursor: not-allowed;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//Set the styles from the default styles object
|
|
47
|
+
${({ theme, defaultStyle }) => {
|
|
48
|
+
return getDefaultStyles(theme, defaultStyle);
|
|
49
|
+
}}
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
export const SecondaryButton = ({ block, size, style, variant, disabled,type, ...props }) => {
|
|
53
|
+
const theme = useTheme() || defaultThemeColor;
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<StyledButton
|
|
57
|
+
block={block}
|
|
58
|
+
variant={variant}
|
|
59
|
+
defaultStyle="button"
|
|
60
|
+
style={style}
|
|
61
|
+
size={size}
|
|
62
|
+
disabled={disabled}
|
|
63
|
+
type={type}
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
{props.children}
|
|
67
|
+
</StyledButton>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
SecondaryButton.propTypes = {
|
|
72
|
+
/**
|
|
73
|
+
* Type of Button. primary-1, 2, error, etc.
|
|
74
|
+
*/
|
|
75
|
+
variant: PropTypes.string,
|
|
76
|
+
/**
|
|
77
|
+
* Is the button disabled?
|
|
78
|
+
*/
|
|
79
|
+
disabled: PropTypes.bool,
|
|
80
|
+
/**
|
|
81
|
+
* How large should the button be?
|
|
82
|
+
*/
|
|
83
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
84
|
+
/**
|
|
85
|
+
* Optional click handler
|
|
86
|
+
*/
|
|
87
|
+
block: PropTypes.bool,
|
|
88
|
+
/**
|
|
89
|
+
* Optional click handler
|
|
90
|
+
*/
|
|
91
|
+
onClick: PropTypes.func,
|
|
92
|
+
/**
|
|
93
|
+
* Theme object
|
|
94
|
+
*/
|
|
95
|
+
theme: PropTypes.object,
|
|
96
|
+
/**
|
|
97
|
+
* Type of the btn i.e: button or submit etc.
|
|
98
|
+
*/
|
|
99
|
+
type: PropTypes.string,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
StyledButton.defaultProps = {
|
|
103
|
+
theme: defaultThemeColor,
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
SecondaryButton.defaultProps = {
|
|
107
|
+
theme: defaultThemeColor,
|
|
108
|
+
variant: 'primary-1',
|
|
109
|
+
block: false,
|
|
110
|
+
disabled: false,
|
|
111
|
+
size: 'md',
|
|
112
|
+
onClick: undefined,
|
|
113
|
+
};
|
|
114
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
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
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
width: ${({ block }) => block ? '100%' : 'auto'};
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
|
|
26
|
+
&:disabled {
|
|
27
|
+
color: #929EAC;
|
|
28
|
+
background: ${buttonDisabledBg};
|
|
29
|
+
border: 1px solid ${buttonDisabledBg};
|
|
30
|
+
cursor: not-allowed;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//Set the styles from the default styles object
|
|
34
|
+
${({ theme, defaultStyle }) => {
|
|
35
|
+
return getDefaultStyles(theme, defaultStyle);
|
|
36
|
+
}}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
export const TinyButton = ({ block, style, variant, disabled, type, ...props }) => {
|
|
40
|
+
const theme = useTheme() || defaultThemeColor;
|
|
41
|
+
return (
|
|
42
|
+
<StyledButton
|
|
43
|
+
block={block}
|
|
44
|
+
variant={variant}
|
|
45
|
+
defaultStyle="button"
|
|
46
|
+
type={type}
|
|
47
|
+
style={style}
|
|
48
|
+
disabled={disabled}
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
{props.children}
|
|
52
|
+
</StyledButton>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
TinyButton.propTypes = {
|
|
57
|
+
/**
|
|
58
|
+
* Type of Button. primary-1, 2, error, etc.
|
|
59
|
+
*/
|
|
60
|
+
variant: PropTypes.string,
|
|
61
|
+
/**
|
|
62
|
+
* Is the button disabled?
|
|
63
|
+
*/
|
|
64
|
+
disabled: PropTypes.bool,
|
|
65
|
+
/**
|
|
66
|
+
* Optional click handler
|
|
67
|
+
*/
|
|
68
|
+
block: PropTypes.bool,
|
|
69
|
+
/**
|
|
70
|
+
* Optional click handler
|
|
71
|
+
*/
|
|
72
|
+
onClick: PropTypes.func,
|
|
73
|
+
/**
|
|
74
|
+
* Theme object
|
|
75
|
+
*/
|
|
76
|
+
theme: PropTypes.object,
|
|
77
|
+
/**
|
|
78
|
+
* Type of the btn i.e: button or submit etc.
|
|
79
|
+
*/
|
|
80
|
+
type: PropTypes.string,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
StyledButton.defaultProps = {
|
|
84
|
+
theme: defaultThemeColor,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
TinyButton.defaultProps = {
|
|
88
|
+
theme: defaultThemeColor,
|
|
89
|
+
variant: 'primary-1',
|
|
90
|
+
block: false,
|
|
91
|
+
disabled: false,
|
|
92
|
+
onClick: undefined,
|
|
93
|
+
};
|
|
94
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import defaultStyles from '../constants/defaultStyle';
|
|
5
|
+
import getDefaultStyles from '../constants/utils';
|
|
6
|
+
|
|
7
|
+
const CardWrapper = styled.div`
|
|
8
|
+
//Set the styles from the default styles object
|
|
9
|
+
${ ({ theme, type }) => {
|
|
10
|
+
return getDefaultStyles(theme, type);
|
|
11
|
+
}}
|
|
12
|
+
|
|
13
|
+
// custom styles
|
|
14
|
+
${({ customStyles }) => customStyles}
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
CardWrapper.defaultProps = {
|
|
18
|
+
theme: defaultStyles
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Card = ({type,header,content,...props}) => {
|
|
22
|
+
return (
|
|
23
|
+
<CardWrapper theme={defaultStyles} type={'card'} {...props}>
|
|
24
|
+
{header}
|
|
25
|
+
{content}
|
|
26
|
+
</CardWrapper>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Card.propTypes = {
|
|
31
|
+
/**
|
|
32
|
+
* the type of the element
|
|
33
|
+
*/
|
|
34
|
+
type: PropTypes.string,
|
|
35
|
+
/**
|
|
36
|
+
* header of the card
|
|
37
|
+
*/
|
|
38
|
+
header: PropTypes.any,
|
|
39
|
+
/**
|
|
40
|
+
* the content of the card
|
|
41
|
+
*/
|
|
42
|
+
content: PropTypes.any,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Card.defaultProps = {
|
|
46
|
+
type: 'card',
|
|
47
|
+
}
|
|
48
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import defaultStyles from '../constants/defaultStyle';
|
|
5
|
+
|
|
6
|
+
const CardWrapper = styled.div`
|
|
7
|
+
//Set the styles from the default styles object
|
|
8
|
+
${({ theme, type }) => {
|
|
9
|
+
if (theme) {
|
|
10
|
+
let tempObj = {};
|
|
11
|
+
if (theme[type]) {
|
|
12
|
+
for (const property in theme[type]) {
|
|
13
|
+
tempObj[property] = theme[type][property]
|
|
14
|
+
delete theme.common[property]
|
|
15
|
+
}
|
|
16
|
+
for (const property in theme['common']) {
|
|
17
|
+
tempObj[property] = theme['common'][property]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return tempObj;
|
|
21
|
+
}
|
|
22
|
+
}}
|
|
23
|
+
|
|
24
|
+
// custom styles
|
|
25
|
+
${({ customStyles }) => customStyles}
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
CardWrapper.defaultProps = {
|
|
29
|
+
theme: defaultStyles
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const CardRef = forwardRef(({ type, theme, header, content, ...props }, ref) => {
|
|
33
|
+
return (
|
|
34
|
+
<CardWrapper theme={defaultStyles} type={'card'} {...props} ref={ref}>
|
|
35
|
+
{header}
|
|
36
|
+
{content}
|
|
37
|
+
</CardWrapper>
|
|
38
|
+
)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
CardRef.propTypes = {
|
|
42
|
+
/**
|
|
43
|
+
* theme Object
|
|
44
|
+
*/
|
|
45
|
+
theme: PropTypes.object,
|
|
46
|
+
/**
|
|
47
|
+
* the type of the element
|
|
48
|
+
*/
|
|
49
|
+
type: PropTypes.string,
|
|
50
|
+
/**
|
|
51
|
+
* header of the card
|
|
52
|
+
*/
|
|
53
|
+
header: PropTypes.any,
|
|
54
|
+
/**
|
|
55
|
+
* the content of the card
|
|
56
|
+
*/
|
|
57
|
+
content: PropTypes.any,
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
CardRef.defaultProps = {
|
|
61
|
+
theme: defaultStyles,
|
|
62
|
+
type: 'card',
|
|
63
|
+
}
|
|
64
|
+
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { useTheme, css } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Primary UI component for user interaction
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const sizes = {
|
|
11
|
+
sm: {
|
|
12
|
+
cardWidth: '178px',
|
|
13
|
+
cardMinHeight: '88px',
|
|
14
|
+
borderRadius: '4px',
|
|
15
|
+
border: '0.7px',
|
|
16
|
+
bodyHeight: '55px',
|
|
17
|
+
footerFontSize: '10px',
|
|
18
|
+
footerMinHeight: '31px',
|
|
19
|
+
footerPadding: '10.5px 16px',
|
|
20
|
+
footerLineHeight: '16px',
|
|
21
|
+
lineHeight: '12px'
|
|
22
|
+
},
|
|
23
|
+
md: {
|
|
24
|
+
cardWidth: '215px',
|
|
25
|
+
cardMinHeight: '123px',
|
|
26
|
+
borderRadius: '6px',
|
|
27
|
+
border: '1px',
|
|
28
|
+
bodyHeight: '67px',
|
|
29
|
+
footerFontSize: '14px',
|
|
30
|
+
footerMinHeight: '54px',
|
|
31
|
+
footerPadding: '18px 19px',
|
|
32
|
+
footerLineHeight: '12px',
|
|
33
|
+
lineHeight: '16px'
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const StyledDocumentCard = styled.div`
|
|
38
|
+
${({ trimFileName }) => {
|
|
39
|
+
if (trimFileName) {
|
|
40
|
+
return (css`height: ${({ size }) => sizes[size].cardMinHeight};`)
|
|
41
|
+
} else {
|
|
42
|
+
return (css`min-height: ${({ size }) => sizes[size].cardMinHeight};`)
|
|
43
|
+
}
|
|
44
|
+
}}
|
|
45
|
+
width: ${({ size }) => sizes[size].cardWidth};
|
|
46
|
+
border-radius: ${({ size }) => sizes[size].borderRadius};
|
|
47
|
+
border: ${({ size }) => sizes[size].border} solid ${({ theme, variantBorder }) => theme.variant[variantBorder]};
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
border: ${({ size }) => sizes[size].border} solid ${({ theme, variantBorderHover }) => theme.variant[variantBorderHover]};
|
|
52
|
+
button {
|
|
53
|
+
&:hover {
|
|
54
|
+
opacity: 0.8;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`
|
|
59
|
+
|
|
60
|
+
const StyledCardBody = styled.div`
|
|
61
|
+
display: flex;
|
|
62
|
+
justify-content: ${({ buttons }) => buttons !== '11' ? 'center' : 'space-between'};
|
|
63
|
+
align-items: center;
|
|
64
|
+
height: ${({ size }) => sizes[size].bodyHeight};
|
|
65
|
+
margin: 0;
|
|
66
|
+
padding: ${({ size }) => sizes[size].bodyPadding};
|
|
67
|
+
border: none;
|
|
68
|
+
border-top-left-radius: ${({ size }) => sizes[size].borderRadius};
|
|
69
|
+
border-top-right-radius: ${({ size }) => sizes[size].borderRadius};
|
|
70
|
+
background-color: ${({ theme, variantBgBody }) => theme.variant[variantBgBody]};
|
|
71
|
+
background: linear-gradient(0deg, rgba(226, 230, 245, 0.5), rgba(226, 230, 245, 0.5)) ${({ bgUrl }) => bgUrl ? `, url('/images/documentCardBG.png')` : null};
|
|
72
|
+
background-size: cover;
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
`
|
|
75
|
+
|
|
76
|
+
const StyledCardFooter = styled.div`
|
|
77
|
+
${({ trimFileName }) => {
|
|
78
|
+
if (trimFileName) {
|
|
79
|
+
return (
|
|
80
|
+
css`
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
text-overflow: ellipsis;
|
|
84
|
+
height: ${({ size }) => sizes[size].footerMinHeight};
|
|
85
|
+
`
|
|
86
|
+
)
|
|
87
|
+
} else {
|
|
88
|
+
return (
|
|
89
|
+
css`
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
min-height: ${({ size }) => sizes[size].footerMinHeight};
|
|
93
|
+
overflow-wrap: anywhere;
|
|
94
|
+
hyphens: auto;
|
|
95
|
+
`
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
}}
|
|
99
|
+
font-size: ${({ size }) => sizes[size].footerFontSize};
|
|
100
|
+
padding: ${({ size }) => sizes[size].footerPadding};
|
|
101
|
+
color: ${({ theme, variant }) => theme.variant[variant]};
|
|
102
|
+
background-color: ${({ theme, variantBgFooter }) => variantBgFooter ? theme.variant[variantBgFooter] : theme['bgColor']};
|
|
103
|
+
box-sizing: border-box;
|
|
104
|
+
line-height: ${({ size }) => sizes[size].lineHeight};
|
|
105
|
+
border-bottom-left-radius: inherit;
|
|
106
|
+
border-bottom-right-radius: inherit;
|
|
107
|
+
`
|
|
108
|
+
|
|
109
|
+
export const DocumentCard = ({
|
|
110
|
+
variant,
|
|
111
|
+
variantBorder,
|
|
112
|
+
variantBorderHover,
|
|
113
|
+
variantBgBody,
|
|
114
|
+
variantBgFooter,
|
|
115
|
+
fileName,
|
|
116
|
+
bgUrl,
|
|
117
|
+
size,
|
|
118
|
+
trimFileName,
|
|
119
|
+
bodyContent,
|
|
120
|
+
...props }) => {
|
|
121
|
+
|
|
122
|
+
const theme = useTheme() || defaultThemeColor;
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<StyledDocumentCard
|
|
126
|
+
variantBorder={variantBorder}
|
|
127
|
+
variantBorderHover={variantBorderHover}
|
|
128
|
+
variantBgBody={variantBgBody}
|
|
129
|
+
size={size}
|
|
130
|
+
trimFileName={trimFileName}
|
|
131
|
+
{...props}
|
|
132
|
+
>
|
|
133
|
+
<StyledCardBody bgUrl={bgUrl} size={size} >
|
|
134
|
+
{bodyContent}
|
|
135
|
+
</StyledCardBody>
|
|
136
|
+
<StyledCardFooter
|
|
137
|
+
title={fileName}
|
|
138
|
+
variant={variant}
|
|
139
|
+
variantBgFooter={variantBgFooter}
|
|
140
|
+
trimFileName={trimFileName}
|
|
141
|
+
size={size}
|
|
142
|
+
>
|
|
143
|
+
{fileName}
|
|
144
|
+
</StyledCardFooter>
|
|
145
|
+
</StyledDocumentCard>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
DocumentCard.propTypes = {
|
|
150
|
+
/**
|
|
151
|
+
* Color of Footer text. primary-1, 2, error, etc.
|
|
152
|
+
*/
|
|
153
|
+
variant: PropTypes.string,
|
|
154
|
+
/**
|
|
155
|
+
* Color of DocumentCard border. primary-1, 2, error, etc.
|
|
156
|
+
*/
|
|
157
|
+
variantBorder: PropTypes.string,
|
|
158
|
+
/**
|
|
159
|
+
* Color of DocumentCard border on hover. primary-1, 2, error, etc.
|
|
160
|
+
*/
|
|
161
|
+
variantBorderHover: PropTypes.string,
|
|
162
|
+
/**
|
|
163
|
+
* Color of Body background. primary-1, 2, error, etc.
|
|
164
|
+
*/
|
|
165
|
+
variantBgBody: PropTypes.string,
|
|
166
|
+
/**
|
|
167
|
+
* Color of Footer background. primary-1, 2, error, etc.
|
|
168
|
+
*/
|
|
169
|
+
variantBgFooter: PropTypes.string,
|
|
170
|
+
/**
|
|
171
|
+
* String to display in the footer
|
|
172
|
+
*/
|
|
173
|
+
fileName: PropTypes.string,
|
|
174
|
+
/**
|
|
175
|
+
* Url of the picture to display as card body background
|
|
176
|
+
*/
|
|
177
|
+
bgUrl: PropTypes.string,
|
|
178
|
+
/**
|
|
179
|
+
* Size of the card small or medium
|
|
180
|
+
*/
|
|
181
|
+
size: PropTypes.oneOf(['sm', 'md']),
|
|
182
|
+
/**
|
|
183
|
+
* If true if the fimeName is longer than the width is trimmed. If false the fileName is wrapped and the footer expands vertically
|
|
184
|
+
*/
|
|
185
|
+
trimFileName: PropTypes.bool,
|
|
186
|
+
/**
|
|
187
|
+
* Theme object
|
|
188
|
+
*/
|
|
189
|
+
theme: PropTypes.object,
|
|
190
|
+
/**
|
|
191
|
+
* Children component of the Card Body
|
|
192
|
+
*/
|
|
193
|
+
bodyContent: PropTypes.element,
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
StyledDocumentCard.defaultProps = {
|
|
197
|
+
theme: defaultThemeColor,
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
StyledCardBody.defaultProps = {
|
|
201
|
+
theme: defaultThemeColor,
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
StyledCardFooter.defaultProps = {
|
|
205
|
+
theme: defaultThemeColor,
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
DocumentCard.defaultProps = {
|
|
209
|
+
theme: defaultThemeColor,
|
|
210
|
+
variant: 'black',
|
|
211
|
+
variantBorder: 'neutral-5',
|
|
212
|
+
variantBorderHover: 'primary-1',
|
|
213
|
+
variantBgBody: 'neutral-4',
|
|
214
|
+
variantBgFooter: null,
|
|
215
|
+
fileName: '',
|
|
216
|
+
bgUrl: null,
|
|
217
|
+
size: 'md',
|
|
218
|
+
trimFileName: true,
|
|
219
|
+
bodyContent: null
|
|
220
|
+
};
|
|
221
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import defaultStyles from '../constants/defaultStyle';
|
|
5
|
+
import getDefaultStyles from '../constants/utils';
|
|
6
|
+
// import './../../../App.css'
|
|
7
|
+
|
|
8
|
+
const ContentLayout = styled.div`
|
|
9
|
+
//Set the styles from the default styles object
|
|
10
|
+
${({ theme, type }) => {
|
|
11
|
+
return getDefaultStyles(theme, type);
|
|
12
|
+
}}
|
|
13
|
+
@media (max-width: 980px) {
|
|
14
|
+
margin-left: 0px;
|
|
15
|
+
}
|
|
16
|
+
// custom styles
|
|
17
|
+
${({ customStyles }) => customStyles}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export const Content = ({ theme, type, customStyles, ...props }) => {
|
|
21
|
+
return (
|
|
22
|
+
<ContentLayout theme={theme} customStyles={customStyles} type={type} {...props}>
|
|
23
|
+
{props.children}
|
|
24
|
+
</ContentLayout>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
Content.propTypes = {
|
|
31
|
+
/**
|
|
32
|
+
* Theme props
|
|
33
|
+
*/
|
|
34
|
+
theme: PropTypes.object,
|
|
35
|
+
/**
|
|
36
|
+
* Custom style object
|
|
37
|
+
*/
|
|
38
|
+
customStyles: PropTypes.object,
|
|
39
|
+
/**
|
|
40
|
+
* type Content
|
|
41
|
+
*/
|
|
42
|
+
type: PropTypes.string,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Content.defaultProps = {
|
|
46
|
+
theme: defaultStyles,
|
|
47
|
+
customStyles: null,
|
|
48
|
+
type: 'content'
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Content';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Primary UI component for user interaction
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const StyledDivider = styled.div`
|
|
11
|
+
display: ${({ vertical }) => vertical ? 'inline-block' : 'block'};
|
|
12
|
+
background: ${({ theme, variant, borderColor }) => borderColor ? borderColor : theme.variant[variant]};
|
|
13
|
+
content: '';
|
|
14
|
+
height: ${({ vertical, thickness, height }) => vertical ? height : thickness};
|
|
15
|
+
width: ${({ vertical, thickness }) => vertical ? thickness : null};
|
|
16
|
+
`
|
|
17
|
+
|
|
18
|
+
export const Divider = ({ vertical, borderColor, thickness, height, ...props }) => {
|
|
19
|
+
const theme = useTheme() || defaultThemeColor;
|
|
20
|
+
return (
|
|
21
|
+
<StyledDivider borderColor={borderColor} thickness={thickness} vertical={vertical} height={height} {...props} />
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
Divider.propTypes = {
|
|
26
|
+
/**
|
|
27
|
+
* Optional: Color of Divider
|
|
28
|
+
*/
|
|
29
|
+
variant: PropTypes.string,
|
|
30
|
+
/**
|
|
31
|
+
* Optional: How thick should be the divider in px
|
|
32
|
+
*/
|
|
33
|
+
thickness: PropTypes.string,
|
|
34
|
+
/**
|
|
35
|
+
* Theme object
|
|
36
|
+
*/
|
|
37
|
+
theme: PropTypes.object,
|
|
38
|
+
/**
|
|
39
|
+
* Optional custom border color
|
|
40
|
+
*/
|
|
41
|
+
borderColor: PropTypes.string,
|
|
42
|
+
/**
|
|
43
|
+
* Optional flag for vertical direction
|
|
44
|
+
*/
|
|
45
|
+
vertical: PropTypes.bool,
|
|
46
|
+
/**
|
|
47
|
+
* Optional: How hight should be the divider in px (apply only when vertical is TRUE)
|
|
48
|
+
*/
|
|
49
|
+
height: PropTypes.string,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
StyledDivider.defaultProps = {
|
|
53
|
+
theme: defaultThemeColor,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Divider.defaultProps = {
|
|
57
|
+
theme: defaultThemeColor,
|
|
58
|
+
variant: 'neutral-5',
|
|
59
|
+
thickness: '2px',
|
|
60
|
+
vertical: false,
|
|
61
|
+
height: '10px'
|
|
62
|
+
};
|
|
63
|
+
|