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,93 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import defaultStyles from '../constants/defaultStyle';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Primary UI component for user interaction
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// const StyledContainer = styled.div`
|
|
11
|
+
// min-height: 100%;
|
|
12
|
+
// overflow: hidden;
|
|
13
|
+
// position: fixed;
|
|
14
|
+
// width: 360px;
|
|
15
|
+
// transition: transform ease 400ms;
|
|
16
|
+
// display: flex;
|
|
17
|
+
// flex-direction: column;
|
|
18
|
+
// background: #FFFFFF;
|
|
19
|
+
// box-sizing: border-box;
|
|
20
|
+
// box-shadow: -20px 5px 37px rgba(56, 66, 100, 0.0880136);
|
|
21
|
+
// top: 51px;
|
|
22
|
+
// right: 0px;
|
|
23
|
+
// z-index: 1001;
|
|
24
|
+
// transform: translateX(${({ drawerOpen }) => drawerOpen ? '0px' : '360px'});
|
|
25
|
+
// `;
|
|
26
|
+
|
|
27
|
+
const StyledContainer = styled.div`
|
|
28
|
+
//Set the styles from the default styles object
|
|
29
|
+
${({ theme, type, drawerOpen, customStyles }) => {
|
|
30
|
+
if (theme) {
|
|
31
|
+
let tempObj = {};
|
|
32
|
+
if (theme[type]) {
|
|
33
|
+
for (const property in theme['common']) {
|
|
34
|
+
tempObj[property] = theme['common'][property]
|
|
35
|
+
}
|
|
36
|
+
for (const property in theme[type]) {
|
|
37
|
+
delete theme.common[property]
|
|
38
|
+
tempObj[property] = theme[type][property]
|
|
39
|
+
}
|
|
40
|
+
if (drawerOpen) {
|
|
41
|
+
tempObj = { ...tempObj, ...theme['drawer-open'] }
|
|
42
|
+
} else {
|
|
43
|
+
tempObj = { ...tempObj, ...theme['drawer-close'] }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return { ...tempObj, ...customStyles };
|
|
47
|
+
}
|
|
48
|
+
}}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
export const Drawer = ({
|
|
52
|
+
theme,
|
|
53
|
+
customStyles,
|
|
54
|
+
drawerOpen,
|
|
55
|
+
children,
|
|
56
|
+
...props
|
|
57
|
+
}) => {
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// return ReactDom.createPortal(
|
|
61
|
+
return (
|
|
62
|
+
<StyledContainer
|
|
63
|
+
theme={theme}
|
|
64
|
+
customStyles={customStyles}
|
|
65
|
+
type={'drawer'}
|
|
66
|
+
drawerOpen={drawerOpen}
|
|
67
|
+
{...props}
|
|
68
|
+
>
|
|
69
|
+
{children}
|
|
70
|
+
</StyledContainer>
|
|
71
|
+
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
Drawer.propTypes = {
|
|
76
|
+
/**
|
|
77
|
+
* Theme object
|
|
78
|
+
*/
|
|
79
|
+
theme: PropTypes.object,
|
|
80
|
+
/**
|
|
81
|
+
* Custom style object
|
|
82
|
+
*/
|
|
83
|
+
customStyles: PropTypes.object,
|
|
84
|
+
/**
|
|
85
|
+
* Boolean value to to open and close the drawer
|
|
86
|
+
*/
|
|
87
|
+
drawerOpen: PropTypes.bool,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
Drawer.defaultProps = {
|
|
91
|
+
theme: defaultStyles,
|
|
92
|
+
};
|
|
93
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { PrimaryButton } from '../Button';
|
|
4
|
+
|
|
5
|
+
export class ErrorBoundary extends Component {
|
|
6
|
+
constructor(props) {
|
|
7
|
+
super(props);
|
|
8
|
+
this.state = {
|
|
9
|
+
hasError: false,
|
|
10
|
+
}
|
|
11
|
+
this.refreshPage = this.refreshPage.bind(this);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
componentDidCatch(error, info) {
|
|
15
|
+
this.setState({ hasError: true });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
refreshPage() {
|
|
19
|
+
window.location.reload();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
render() {
|
|
23
|
+
const { hasError } = this.state;
|
|
24
|
+
var errMsg = (
|
|
25
|
+
<Fragment>
|
|
26
|
+
<h3>
|
|
27
|
+
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" width="1.12em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1856 1664"><path d="M1056 1375v-190q0-14-9.5-23.5t-22.5-9.5H832q-13 0-22.5 9.5T800 1185v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19q-13-11-24-11H818q-11 0-24 11q-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126q-17 29-46.5 46t-63.5 17H160q-34 0-63.5-17T50 1601q-37-63-2-126L816 67q17-31 47-49t65-18t65 18t47 49z" fill="currentColor" /></svg>
|
|
28
|
+
We have experienced an issue. We generated a support ticket on our end to investigate this issue We are sorry about the inconvenience.</h3>
|
|
29
|
+
<PrimaryButton onClick={() => this.refreshPage()}>
|
|
30
|
+
Click to refresh
|
|
31
|
+
</PrimaryButton>
|
|
32
|
+
</Fragment>
|
|
33
|
+
);
|
|
34
|
+
var display = hasError ? errMsg : this.props.children;
|
|
35
|
+
return display;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
ErrorBoundary.propTypes = {
|
|
40
|
+
/**
|
|
41
|
+
* Component that will be rendered if no error occurs
|
|
42
|
+
*/
|
|
43
|
+
children: PropTypes.any
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ErrorBoundary';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { css, useTheme } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
|
|
6
|
+
const border = `#F6F6F9;`;
|
|
7
|
+
|
|
8
|
+
const selectedCss = css`
|
|
9
|
+
color: ${({ theme }) => theme.variant['primary-1']};
|
|
10
|
+
border: 1px solid ${({ theme }) => theme.variant['primary-1']};
|
|
11
|
+
background: #F3F5FF;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
const StyledButton = styled.button`
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
color: ${({ theme }) => theme.variant['primary-2']};
|
|
17
|
+
background: ${border};
|
|
18
|
+
border: 1px solid ${border};
|
|
19
|
+
padding: 4px 24px;
|
|
20
|
+
border-radius: 999px;
|
|
21
|
+
outline: none;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
|
|
24
|
+
${({ selected }) => selected ? selectedCss : null}
|
|
25
|
+
|
|
26
|
+
&:not(:first-child) {
|
|
27
|
+
margin-left: 8px;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
StyledButton.defaultProps = {
|
|
31
|
+
theme: defaultThemeColor,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const FilterChip = ({ options, selected, onClick, ...props }) => {
|
|
35
|
+
const list = options.map((option, index) => {
|
|
36
|
+
return (
|
|
37
|
+
<StyledButton key={`${option.label}_${index}_${option.value}`} selected={selected === option.value} onClick={() => { onClick(option.value) }}>
|
|
38
|
+
{option.label}
|
|
39
|
+
</StyledButton>
|
|
40
|
+
)
|
|
41
|
+
})
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
{list}
|
|
45
|
+
</>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
FilterChip.propTypes = {
|
|
50
|
+
/**
|
|
51
|
+
* Available tabs
|
|
52
|
+
*/
|
|
53
|
+
options: PropTypes.array,
|
|
54
|
+
/**
|
|
55
|
+
* which option is selected?
|
|
56
|
+
*/
|
|
57
|
+
selected: PropTypes.string,
|
|
58
|
+
/**
|
|
59
|
+
* click event
|
|
60
|
+
*/
|
|
61
|
+
onClick: PropTypes.func,
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
FilterChip.defaultProps = {
|
|
65
|
+
options: [],
|
|
66
|
+
selected: '',
|
|
67
|
+
}
|
|
68
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FilterChip';
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
import getDefaultStyles from '../constants/utils';
|
|
6
|
+
// import { FooterContext } from '../../../routes/Level2';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Primary UI component for user interaction
|
|
10
|
+
*/
|
|
11
|
+
const StyledFooter = styled.footer`
|
|
12
|
+
//Set the styles from the default styles object
|
|
13
|
+
${({ theme, type }) => {
|
|
14
|
+
return getDefaultStyles(theme, type);
|
|
15
|
+
}}
|
|
16
|
+
// custom styles
|
|
17
|
+
${({ customStyles }) => customStyles}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export const Footer = forwardRef(({ theme, customStyles, ...props }, ref) => {
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<StyledFooter
|
|
24
|
+
ref={ref}
|
|
25
|
+
theme={theme}
|
|
26
|
+
type='footer'
|
|
27
|
+
customStyles={customStyles}
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
{props.children}
|
|
31
|
+
</StyledFooter>
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
Footer.propTypes = {
|
|
36
|
+
/**
|
|
37
|
+
* Theme props
|
|
38
|
+
*/
|
|
39
|
+
theme: PropTypes.object,
|
|
40
|
+
/**
|
|
41
|
+
* Custom style object
|
|
42
|
+
*/
|
|
43
|
+
customStyles: PropTypes.object,
|
|
44
|
+
/**
|
|
45
|
+
* Type of the component which define the default style
|
|
46
|
+
*/
|
|
47
|
+
type: PropTypes.string,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
StyledFooter.defaultProps = {
|
|
51
|
+
theme: PropTypes.object,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
Footer.defaultProps = {
|
|
55
|
+
theme: defaultStyles,
|
|
56
|
+
customStyles: null,
|
|
57
|
+
};
|
|
58
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
// import { FooterContext } from '../../../routes/Level2'
|
|
4
|
+
|
|
5
|
+
const StyledOutsideContainer = styled.div`
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
background-color: transparent;
|
|
8
|
+
display: flex;
|
|
9
|
+
left: 0;
|
|
10
|
+
right: 0;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
align-items: center;
|
|
13
|
+
color: red;
|
|
14
|
+
cursor: default;
|
|
15
|
+
${({ footerWidth }) => {
|
|
16
|
+
if (footerWidth < 650) {
|
|
17
|
+
return css`
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
`
|
|
20
|
+
}
|
|
21
|
+
}}
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
const StyledInsideContainer = styled.div`
|
|
25
|
+
display: flex;
|
|
26
|
+
${({ footerWidth }) => {
|
|
27
|
+
if (footerWidth < 650) {
|
|
28
|
+
return css`
|
|
29
|
+
margin-bottom: 5px;
|
|
30
|
+
`
|
|
31
|
+
}
|
|
32
|
+
}}
|
|
33
|
+
${({ footerWidth }) => {
|
|
34
|
+
if (footerWidth < 350) {
|
|
35
|
+
return css`
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
align-items: center;
|
|
38
|
+
margin-bottom: 0;
|
|
39
|
+
`
|
|
40
|
+
}
|
|
41
|
+
}}
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
const StyledText = styled.div`
|
|
45
|
+
margin-top: inherit;
|
|
46
|
+
margin-bottom: inherit;
|
|
47
|
+
${({ footerWidth }) => {
|
|
48
|
+
if (footerWidth < 350) {
|
|
49
|
+
return css`
|
|
50
|
+
margin-bottom: 5px;
|
|
51
|
+
`
|
|
52
|
+
}
|
|
53
|
+
}}
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
const StyledSeparator = styled.div`
|
|
57
|
+
margin: 0 10px;
|
|
58
|
+
${({ footerWidth }) => {
|
|
59
|
+
if (footerWidth < 350) {
|
|
60
|
+
return css`
|
|
61
|
+
display: none;
|
|
62
|
+
`
|
|
63
|
+
}
|
|
64
|
+
}}
|
|
65
|
+
`;
|
|
66
|
+
export const FooterContentLev3 = ({ variant, textColor, size, width, footerWidth, ...props }) => {
|
|
67
|
+
// const footerWidth = useContext(FooterContext)
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<StyledOutsideContainer variant={variant} textColor={textColor} footerWidth={footerWidth} {...props}>
|
|
71
|
+
<StyledInsideContainer footerWidth={footerWidth}>
|
|
72
|
+
<StyledText footerWidth={footerWidth}>
|
|
73
|
+
Premise HQ
|
|
74
|
+
</StyledText>
|
|
75
|
+
<StyledSeparator footerWidth={footerWidth}>
|
|
76
|
+
|
|
|
77
|
+
</StyledSeparator>
|
|
78
|
+
<StyledText footerWidth={footerWidth}>
|
|
79
|
+
All Rights Restricted 2020 ©
|
|
80
|
+
</StyledText>
|
|
81
|
+
</StyledInsideContainer>
|
|
82
|
+
<StyledInsideContainer footerWidth={footerWidth}>
|
|
83
|
+
<StyledText footerWidth={footerWidth}>
|
|
84
|
+
Terms of use
|
|
85
|
+
</StyledText>
|
|
86
|
+
<StyledSeparator footerWidth={footerWidth}>
|
|
87
|
+
|
|
|
88
|
+
</StyledSeparator>
|
|
89
|
+
<StyledText footerWidth={footerWidth}>
|
|
90
|
+
Privacy Policy
|
|
91
|
+
</StyledText>
|
|
92
|
+
</StyledInsideContainer>
|
|
93
|
+
</StyledOutsideContainer>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import React, { Fragment } from 'react'
|
|
2
|
+
import { FormContainer, FormWrapper, MultiColumnWrapper, MultiColumnDiv, SubmitButtonContainer } from './StyledComponent';
|
|
3
|
+
import defaultThemeColor from '../constants/defaultThemeColor'
|
|
4
|
+
import { Header } from '../Header';
|
|
5
|
+
import { Label } from '../Label';
|
|
6
|
+
import { CheckBoxInput, DateSelect, DropdownSelect, DropzoneInput, NumericInput, RadioInput, SearchInput, SignatureInput, TextArea, TextInput, ToggleSwitch } from '../Inputs';
|
|
7
|
+
import { Rating } from '../Rating';
|
|
8
|
+
import { PrimaryButton, SecondaryButton, TinyButton } from '../Button';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export const FormComponent = ({ formData, ...props }) => {
|
|
13
|
+
|
|
14
|
+
const header = (item) => {
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Fragment>
|
|
18
|
+
<Header {...item} {...props}>
|
|
19
|
+
{item.children}
|
|
20
|
+
</Header>
|
|
21
|
+
{item}
|
|
22
|
+
</Fragment>
|
|
23
|
+
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const labelWithJSon = (item) => {
|
|
28
|
+
return (
|
|
29
|
+
<Fragment>
|
|
30
|
+
<MultiColumnWrapper>
|
|
31
|
+
<MultiColumnDiv cols={1}>
|
|
32
|
+
<Label
|
|
33
|
+
customStyles={item.customStyles}
|
|
34
|
+
text={item.text}
|
|
35
|
+
{...props} />
|
|
36
|
+
</MultiColumnDiv>
|
|
37
|
+
<MultiColumnDiv>
|
|
38
|
+
<pre>
|
|
39
|
+
{JSON.stringify(item, null, 4)}
|
|
40
|
+
</pre>
|
|
41
|
+
</MultiColumnDiv>
|
|
42
|
+
</MultiColumnWrapper>
|
|
43
|
+
</Fragment>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
const label = (item) => {
|
|
47
|
+
return (
|
|
48
|
+
<Label
|
|
49
|
+
{...item}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
const textInput = (item) => {
|
|
55
|
+
return (
|
|
56
|
+
<TextInput
|
|
57
|
+
{...item}
|
|
58
|
+
{...props}
|
|
59
|
+
/>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const textAreaInput = (item) => {
|
|
64
|
+
return (
|
|
65
|
+
<TextArea
|
|
66
|
+
{...item}
|
|
67
|
+
{...props}
|
|
68
|
+
/>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const NumberInput = (item) => {
|
|
73
|
+
return (
|
|
74
|
+
<NumericInput
|
|
75
|
+
{...item}
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const radioInput = (item) => {
|
|
82
|
+
return (
|
|
83
|
+
<RadioInput
|
|
84
|
+
key={Math.random() * 101 | 0}
|
|
85
|
+
{...item}
|
|
86
|
+
{...props}
|
|
87
|
+
/>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const checkBoxInput = (item) => {
|
|
92
|
+
return (
|
|
93
|
+
<CheckBoxInput
|
|
94
|
+
{...item}
|
|
95
|
+
{...props}
|
|
96
|
+
/>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const SingleDropdownInput = (item) => {
|
|
101
|
+
return (
|
|
102
|
+
<DropdownSelect
|
|
103
|
+
dropdownType={'singleSelect'}
|
|
104
|
+
{...item}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const MultiDropdownInput = (item) => {
|
|
111
|
+
return (
|
|
112
|
+
<DropdownSelect
|
|
113
|
+
{...item}
|
|
114
|
+
{...props}
|
|
115
|
+
/>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const signatureInput = (item) => {
|
|
120
|
+
return (
|
|
121
|
+
<SignatureInput
|
|
122
|
+
{...item}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const fileUploadInput = (item) => {
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<DropzoneInput
|
|
132
|
+
{...item}
|
|
133
|
+
{...props} />
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const dateInput = (item) => {
|
|
138
|
+
return (
|
|
139
|
+
<DateSelect
|
|
140
|
+
{...item}
|
|
141
|
+
{...props} />
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const toggleSwitch = (item) => {
|
|
146
|
+
return (
|
|
147
|
+
<ToggleSwitch
|
|
148
|
+
{...item}
|
|
149
|
+
{...props}
|
|
150
|
+
/>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const ratingInput = (item) => {
|
|
155
|
+
return (
|
|
156
|
+
<Rating
|
|
157
|
+
{...item}
|
|
158
|
+
{...props}
|
|
159
|
+
/>
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const primaryButton = (item) => {
|
|
164
|
+
return (
|
|
165
|
+
<PrimaryButton
|
|
166
|
+
{...item}
|
|
167
|
+
{...props}
|
|
168
|
+
/>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const secondaryButton = (item) => {
|
|
173
|
+
return (
|
|
174
|
+
<SecondaryButton
|
|
175
|
+
{...item}
|
|
176
|
+
{...props}
|
|
177
|
+
/>
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const tinyButton = (item) => {
|
|
182
|
+
return (
|
|
183
|
+
<TinyButton
|
|
184
|
+
{...item}
|
|
185
|
+
{...props}
|
|
186
|
+
/>
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const searchInput = (item) => {
|
|
191
|
+
return (
|
|
192
|
+
<SearchInput
|
|
193
|
+
{...item}
|
|
194
|
+
{...props}
|
|
195
|
+
/>
|
|
196
|
+
)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
const handleSubmit = () => {
|
|
202
|
+
console.log("form submit");
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const returnComponent = (item) => {
|
|
206
|
+
switch (item.type) {
|
|
207
|
+
case "header":
|
|
208
|
+
return header(item)
|
|
209
|
+
case "label":
|
|
210
|
+
return label(item)
|
|
211
|
+
case "text":
|
|
212
|
+
return textInput(item)
|
|
213
|
+
case "textArea":
|
|
214
|
+
return textAreaInput(item)
|
|
215
|
+
case "number":
|
|
216
|
+
return NumberInput(item)
|
|
217
|
+
case "radio":
|
|
218
|
+
return radioInput(item)
|
|
219
|
+
case "checkBox":
|
|
220
|
+
return checkBoxInput(item)
|
|
221
|
+
case "singleSelect":
|
|
222
|
+
return SingleDropdownInput(item)
|
|
223
|
+
case "multiSelect":
|
|
224
|
+
return MultiDropdownInput(item)
|
|
225
|
+
case "signature":
|
|
226
|
+
return signatureInput(item)
|
|
227
|
+
case "fileUpload":
|
|
228
|
+
return fileUploadInput(item)
|
|
229
|
+
case "date":
|
|
230
|
+
return dateInput(item)
|
|
231
|
+
case "toggle":
|
|
232
|
+
return toggleSwitch(item)
|
|
233
|
+
case "rating":
|
|
234
|
+
return ratingInput(item)
|
|
235
|
+
case "buttonPrimary":
|
|
236
|
+
return primaryButton(item)
|
|
237
|
+
case "buttonSecondary":
|
|
238
|
+
return secondaryButton(item)
|
|
239
|
+
case "buttonTiny":
|
|
240
|
+
return tinyButton(item)
|
|
241
|
+
case "search":
|
|
242
|
+
return searchInput(item)
|
|
243
|
+
default:
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
return (
|
|
251
|
+
<Fragment>
|
|
252
|
+
<FormContainer defaultThemeColor={defaultThemeColor}>
|
|
253
|
+
<FormWrapper onSubmit={handleSubmit}>
|
|
254
|
+
{formData.map((row, i) => {
|
|
255
|
+
if (row.length > 1) {
|
|
256
|
+
return <MultiColumnWrapper>
|
|
257
|
+
{row.map((item, j) => {
|
|
258
|
+
return <MultiColumnDiv cols={row.length}>
|
|
259
|
+
{returnComponent(item)}
|
|
260
|
+
</MultiColumnDiv>
|
|
261
|
+
})}
|
|
262
|
+
</MultiColumnWrapper>
|
|
263
|
+
} else {
|
|
264
|
+
return returnComponent(row[0]);
|
|
265
|
+
}
|
|
266
|
+
})}
|
|
267
|
+
|
|
268
|
+
</FormWrapper>
|
|
269
|
+
</FormContainer>
|
|
270
|
+
</Fragment>
|
|
271
|
+
)
|
|
272
|
+
}
|
|
273
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { Fragment, useState } from 'react'
|
|
2
|
+
import { Label } from '../..';
|
|
3
|
+
import { SubmitButtonContainer } from './StyledComponent';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor'
|
|
5
|
+
import userIcon from "../../assets/icons/users.svg";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export const HeaderComponent = ({ title, subtitle, wrapperstyle }) => {
|
|
11
|
+
|
|
12
|
+
const titleStyle = {
|
|
13
|
+
'fontSize': '26px',
|
|
14
|
+
'fontWeight': 'bold',
|
|
15
|
+
'color': `${defaultThemeColor.textColor}`,
|
|
16
|
+
'lineHeight': '36px',
|
|
17
|
+
'display': 'flex',
|
|
18
|
+
'gap': '14px',
|
|
19
|
+
'alignItems': 'flex-start',
|
|
20
|
+
'paddingLeft': '25px'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const subtitleStyle = {
|
|
24
|
+
'fontSize': '13px',
|
|
25
|
+
'color': `${defaultThemeColor.neutral['neutral-2']}`,
|
|
26
|
+
'lineHeight': '24px',
|
|
27
|
+
'paddingLeft': '25px'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return <div style={wrapperstyle}>
|
|
31
|
+
<div style={titleStyle}>
|
|
32
|
+
<img src={userIcon} alt="userIcon" srcset="" />
|
|
33
|
+
<h4>{title}</h4>
|
|
34
|
+
</div>
|
|
35
|
+
<div style={subtitleStyle}>
|
|
36
|
+
<p>{subtitle}</p>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
}
|