groundfloor-react-ui 1.2.9 → 1.2.10

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 +444 -434
  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,84 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from "react";
3
- import styled 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
- ${({ inBuiltCss, type, drawerOpen, customStyles }) => {
30
- if (inBuiltCss) {
31
- let tempObj = {};
32
- if (inBuiltCss[type]) {
33
- for (const property in inBuiltCss['common']) {
34
- tempObj[property] = inBuiltCss['common'][property]
35
- }
36
- for (const property in inBuiltCss[type]) {
37
- delete inBuiltCss.common[property]
38
- tempObj[property] = inBuiltCss[type][property]
39
- }
40
- if (drawerOpen) {
41
- tempObj = { ...tempObj, ...inBuiltCss['drawer-open'] }
42
- } else {
43
- tempObj = { ...tempObj, ...inBuiltCss['drawer-close'] }
44
- }
45
- }
46
- return { ...tempObj, ...customStyles };
47
- }
48
- }}
49
- `;
50
-
51
- export const Drawer = ({
52
- customStyles,
53
- drawerOpen,
54
- children,
55
- ...props
56
- }) => {
57
-
58
-
59
- // return ReactDom.createPortal(
60
- return (
61
- <StyledContainer
62
- inBuiltCss={defaultStyles}
63
- customStyles={customStyles}
64
- type={'drawer'}
65
- drawerOpen={drawerOpen}
66
- {...props}
67
- >
68
- {children}
69
- </StyledContainer>
70
-
71
- );
72
- };
73
-
74
- Drawer.propTypes = {
75
-
76
- /**
77
- * Custom style object
78
- */
79
- customStyles: PropTypes.object,
80
- /**
81
- * Boolean value to to open and close the drawer
82
- */
83
- drawerOpen: PropTypes.bool,
84
- };
@@ -1,2 +0,0 @@
1
- export * from './Drawer';
2
-
@@ -1,44 +0,0 @@
1
- import PropTypes from "prop-types";
2
- import React, { Component, Fragment } from 'react';
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
- }
@@ -1 +0,0 @@
1
- export * from './ErrorBoundary';
@@ -1,70 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import styled, { css, useTheme } from 'styled-components';
4
- import { hexToRGB } from '../constants';
5
- import defaultThemeColor from '../constants/defaultThemeColor';
6
-
7
- // const border = `#F6F6F9;`;
8
-
9
- const selectedCss = css`
10
- color: ${({ theme }) => theme.variant['primary-1']};
11
- border: 1px solid ${({ theme }) => theme.variant['primary-1']};
12
- background: ${({ theme }) => hexToRGB(theme.primary['primary-1'], 0.04)};
13
- `;
14
-
15
- const StyledButton = styled.button`
16
- font-size: 14px;
17
- color: ${({ theme }) => theme.variant['primary-2']};
18
- background: ${({ theme }) => hexToRGB(theme.variant['neutral-5'], 0.7)};
19
- border: 1px solid ${({ theme }) => hexToRGB(theme.variant['neutral-5'], 0.7)};
20
- padding: 4px 24px;
21
- border-radius: 999px;
22
- outline: none;
23
- cursor: pointer;
24
-
25
- ${({ selected }) => (selected ? selectedCss : null)}
26
-
27
- &:not(:first-child) {
28
- margin-left: 8px;
29
- }
30
- `;
31
-
32
- export const FilterChip = ({ options, selected, onClick, ...props }) => {
33
- const activeTheme = useTheme() || defaultThemeColor;
34
-
35
- const list = options.map((option, index) => {
36
- return (
37
- <StyledButton
38
- theme={activeTheme}
39
- key={`${option.label}_${index}_${option.value}`}
40
- selected={selected === option.value}
41
- onClick={() => {
42
- onClick(option.value);
43
- }}
44
- >
45
- {option.label}
46
- </StyledButton>
47
- );
48
- });
49
- return <>{list}</>;
50
- };
51
-
52
- FilterChip.propTypes = {
53
- /**
54
- * Available tabs
55
- */
56
- options: PropTypes.array,
57
- /**
58
- * which option is selected?
59
- */
60
- selected: PropTypes.string,
61
- /**
62
- * click event
63
- */
64
- onClick: PropTypes.func,
65
- };
66
-
67
- FilterChip.defaultProps = {
68
- options: [],
69
- selected: '',
70
- };
@@ -1 +0,0 @@
1
- export * from './FilterChip';
@@ -1,57 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React, { forwardRef } from 'react';
3
- import styled from 'styled-components';
4
- import defaultStyles from '../constants/defaultStyle';
5
- import getDefaultStyles from '../constants/utils';
6
-
7
- /**
8
- * Primary UI component for user interaction
9
- */
10
- const StyledFooter = styled.footer`
11
- //Set the styles from the default styles object
12
- ${({ theme, type }) => {
13
- return getDefaultStyles(theme, type);
14
- }}
15
- // custom styles
16
- ${({ customStyles }) => customStyles}
17
- `;
18
-
19
- export const Footer = forwardRef(({ theme, customStyles, ...props }, ref) => {
20
-
21
- return (
22
- <StyledFooter
23
- ref={ref}
24
- theme={theme}
25
- type='footer'
26
- customStyles={customStyles}
27
- {...props}
28
- >
29
- {props.children}
30
- </StyledFooter>
31
- );
32
- });
33
-
34
- Footer.propTypes = {
35
- /**
36
- * Theme props
37
- */
38
- theme: PropTypes.object,
39
- /**
40
- * Custom style object
41
- */
42
- customStyles: PropTypes.object,
43
- /**
44
- * Type of the component which define the default style
45
- */
46
- type: PropTypes.string,
47
- };
48
-
49
- StyledFooter.defaultProps = {
50
- theme: PropTypes.object,
51
- }
52
-
53
- Footer.defaultProps = {
54
- theme: defaultStyles,
55
- customStyles: null,
56
- };
57
-
@@ -1,98 +0,0 @@
1
- import React from 'react';
2
- import styled, { css } from 'styled-components';
3
-
4
- const StyledOutsideContainer = styled.div`
5
- font-size: 14px;
6
- background-color: transparent;
7
- display: flex;
8
- left: 0;
9
- right: 0;
10
- justify-content: space-between;
11
- align-items: center;
12
- color: #929EAC;
13
- padding:28px 30.5px 28px 30.5px;
14
- font-family: 'Averta', sans-serif;
15
- cursor: default;
16
- width:inherit;
17
- ${({ footerWidth }) => {
18
- if (footerWidth < 650) {
19
- return css`
20
- flex-direction: column;
21
- `
22
- }
23
- }}
24
- `;
25
-
26
- const StyledInsideContainer = styled.div`
27
- display: flex;
28
- ${({ footerWidth }) => {
29
- if (footerWidth < 650) {
30
- return css`
31
- margin-bottom: 5px;
32
- `
33
- }
34
- }}
35
- ${({ footerWidth }) => {
36
- if (footerWidth < 350) {
37
- return css`
38
- flex-direction: column;
39
- align-items: center;
40
- margin-bottom: 0;
41
- `
42
- }
43
- }}
44
- `;
45
-
46
- const StyledText = styled.div`
47
- margin-top: inherit;
48
- margin-bottom: inherit;
49
- ${({ footerWidth }) => {
50
- if (footerWidth < 350) {
51
- return css`
52
- margin-bottom: 5px;
53
- `
54
- }
55
- }}
56
- `;
57
-
58
- const StyledSeparator = styled.div`
59
- margin: 0 10px;
60
- ${({ footerWidth }) => {
61
- if (footerWidth < 350) {
62
- return css`
63
- display: none;
64
- `
65
- }
66
- }}
67
- `;
68
- export const FooterContent = ({ variant, textColor, size, width, footerWidth, ...props }) => {
69
- // const footerWidth = useContext(FooterContext)
70
-
71
- return (
72
- <StyledOutsideContainer variant={variant} textColor={textColor} footerWidth={footerWidth} {...props}>
73
- <StyledInsideContainer footerWidth={footerWidth}>
74
- <StyledText footerWidth={footerWidth}>
75
- Premise HQ
76
- </StyledText>
77
- <StyledSeparator footerWidth={footerWidth}>
78
- |
79
- </StyledSeparator>
80
- <StyledText footerWidth={footerWidth}>
81
- All Rights Restricted 2020 ©
82
- </StyledText>
83
- </StyledInsideContainer>
84
- <StyledInsideContainer footerWidth={footerWidth}>
85
- <StyledText footerWidth={footerWidth}>
86
- Terms of use
87
- </StyledText>
88
- <StyledSeparator footerWidth={footerWidth}>
89
- |
90
- </StyledSeparator>
91
- <StyledText footerWidth={footerWidth}>
92
- Privacy Policy
93
- </StyledText>
94
- </StyledInsideContainer>
95
- </StyledOutsideContainer>
96
- );
97
- };
98
-
@@ -1,3 +0,0 @@
1
- export * from './Footer';
2
- export * from './FooterContent';
3
-
@@ -1,244 +0,0 @@
1
- import React, { Fragment } from 'react';
2
- import { PrimaryButton, SecondaryButton, TinyButton } from '../Button';
3
- import defaultThemeColor from '../constants/defaultThemeColor';
4
- import {
5
- FormContainer,
6
- FormWrapper,
7
- MultiColumnDiv,
8
- MultiColumnWrapper
9
- } from '../DesignComponent';
10
- import { Header } from '../Header';
11
- import {
12
- CheckBoxInput,
13
- DateSelect,
14
- DropdownSelect,
15
- DropzoneInput,
16
- NumericInput,
17
- PasswordInput,
18
- RadioInput,
19
- SearchInput,
20
- SignatureInput,
21
- TextArea,
22
- TextInput,
23
- ToggleSwitch
24
- } from '../Inputs';
25
- import { Label } from '../Label';
26
- import { Rating } from '../Rating';
27
- import { Table } from '../Tables';
28
- import { HeaderComponent } from './HeaderComponent';
29
-
30
-
31
- export const FormComponent = ({ formData, customStyles, ...props }) => {
32
- const header = (item) => {
33
- return (
34
- <Fragment>
35
- <Header {...item} {...props}>
36
- {item.children}
37
- </Header>
38
- {item}
39
- </Fragment>
40
- );
41
- };
42
-
43
- const labelWithJSon = (item) => {
44
- return (
45
- <Fragment>
46
- <MultiColumnWrapper>
47
- <MultiColumnDiv cols={1}>
48
- <Label
49
- customStyles={item.customStyles}
50
- text={item.text}
51
- {...props}
52
- style={{
53
- marginBottom: '7px',
54
- paddingBottom: '0',
55
- }}
56
- />
57
- </MultiColumnDiv>
58
- <MultiColumnDiv>
59
- <pre>{JSON.stringify(item, null, 4)}</pre>
60
- </MultiColumnDiv>
61
- </MultiColumnWrapper>
62
- </Fragment>
63
- );
64
- };
65
- const label = (item) => {
66
- return (
67
- <Label
68
- style={{ marginBottom: '7px', paddingBottom: '0' }}
69
- {...item}
70
- {...props}
71
- />
72
- );
73
- };
74
- const textInput = (item) => {
75
- return <TextInput {...item} {...props} />;
76
- };
77
-
78
- const textAreaInput = (item) => {
79
- return <TextArea {...item} {...props} />;
80
- };
81
-
82
- const NumberInput = (item) => {
83
- return <NumericInput {...item} {...props} />;
84
- };
85
-
86
- const radioInput = (item) => {
87
- return <RadioInput key={(Math.random() * 101) | 0} {...item} {...props} />;
88
- };
89
-
90
- const checkBoxInput = (item) => {
91
- return <CheckBoxInput {...item} {...props} />;
92
- };
93
-
94
- const SingleDropdownInput = (item) => {
95
- return (
96
- <DropdownSelect dropdownType={'singleSelect'} {...item} {...props} />
97
- );
98
- };
99
-
100
- const MultiDropdownInput = (item) => {
101
- return <DropdownSelect dropdownType={'multiSelect'} {...item} {...props} />;
102
- };
103
-
104
- const AsyncMultiDropdownInput = (item) => {
105
- return (
106
- <DropdownSelect dropdownType={'asyncMultiSelect'} {...item} {...props} />
107
- );
108
- };
109
-
110
- const AsyncSingleDropdownInput = (item) => {
111
- return (
112
- <DropdownSelect dropdownType={'asyncSingleSelect'} {...item} {...props} />
113
- );
114
- };
115
-
116
- const signatureInput = (item) => {
117
- return <SignatureInput {...item} {...props} />;
118
- };
119
-
120
- const fileUploadInput = (item) => {
121
- return <DropzoneInput {...item} {...props} />;
122
- };
123
-
124
- const dateInput = (item) => {
125
- return <DateSelect {...item} {...props} />;
126
- };
127
-
128
- const toggleSwitch = (item) => {
129
- return <ToggleSwitch {...item} {...props} />;
130
- };
131
-
132
- const ratingInput = (item) => {
133
- return <Rating {...item} {...props} />;
134
- };
135
-
136
- const primaryButton = (item) => {
137
- return <PrimaryButton {...item} {...props} />;
138
- };
139
-
140
- const secondaryButton = (item) => {
141
- return <SecondaryButton {...item} {...props} />;
142
- };
143
-
144
- const tinyButton = (item) => {
145
- return <TinyButton {...item} {...props} />;
146
- };
147
-
148
- const searchInput = (item) => {
149
- return <SearchInput {...item} {...props} />;
150
- };
151
-
152
- const tableInput = (item) => {
153
- return <Table {...item} {...props} />;
154
- };
155
-
156
- const passwordInput = (item) => {
157
- return <PasswordInput {...item} {...props} />;
158
- };
159
- const headerComponentInput = (item) => {
160
- return <HeaderComponent {...item} {...props} />;
161
- };
162
- const handleSubmit = () => {
163
- console.log('form submit');
164
- };
165
-
166
- const returnComponent = (item) => {
167
- switch (item.type) {
168
- case 'header':
169
- return header(item);
170
- case 'label':
171
- return label(item);
172
- case 'text':
173
- return textInput(item);
174
- case 'textArea':
175
- return textAreaInput(item);
176
- case 'number':
177
- return NumberInput(item);
178
- case 'radio':
179
- return radioInput(item);
180
- case 'checkBox':
181
- return checkBoxInput(item);
182
- case 'singleSelect':
183
- return SingleDropdownInput(item);
184
- case 'multiSelect':
185
- return MultiDropdownInput(item);
186
- case 'asyncSingleSelect':
187
- return AsyncSingleDropdownInput(item);
188
- case 'asyncMultiSelect':
189
- return AsyncMultiDropdownInput(item);
190
- case 'signature':
191
- return signatureInput(item);
192
- case 'fileUpload':
193
- return fileUploadInput(item);
194
- case 'date':
195
- return dateInput(item);
196
- case 'toggle':
197
- return toggleSwitch(item);
198
- case 'rating':
199
- return ratingInput(item);
200
- case 'buttonPrimary':
201
- return primaryButton(item);
202
- case 'buttonSecondary':
203
- return secondaryButton(item);
204
- case 'buttonTiny':
205
- return tinyButton(item);
206
- case 'search':
207
- return searchInput(item);
208
- case 'table':
209
- return tableInput(item);
210
- case 'passwordInput':
211
- return passwordInput(item);
212
- case 'headerComponent':
213
- return headerComponentInput(item);
214
- default:
215
- break;
216
- }
217
- };
218
-
219
- return (
220
- <Fragment>
221
- <FormContainer defaultThemeColor={defaultThemeColor}>
222
- <FormWrapper onSubmit={handleSubmit} customStyles={customStyles}>
223
- {formData.map((row, i) => {
224
- if (row.length > 1) {
225
- return (
226
- <MultiColumnWrapper>
227
- {row.map((item, j) => {
228
- return (
229
- <MultiColumnDiv cols={row.length}>
230
- {returnComponent(item)}
231
- </MultiColumnDiv>
232
- );
233
- })}
234
- </MultiColumnWrapper>
235
- );
236
- } else {
237
- return returnComponent(row[0]);
238
- }
239
- })}
240
- </FormWrapper>
241
- </FormContainer>
242
- </Fragment>
243
- );
244
- };
@@ -1,64 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import { useTheme } from 'styled-components';
4
- import defaultThemeColor from '../constants/defaultThemeColor';
5
- import { Icon } from '../Icon';
6
-
7
- export const HeaderComponent = ({
8
- title,
9
- subtitle,
10
- wrapperStyle,
11
- imgLink,
12
- imgStyle,
13
- iconSize,
14
- }) => {
15
- const activeTheme = useTheme() || defaultThemeColor;
16
-
17
- const titleStyle = {
18
- fontSize: '26px',
19
- fontWeight: 'bold',
20
- color: `${activeTheme.textColor}`,
21
- lineHeight: '36px',
22
- display: 'flex',
23
- gap: '14px',
24
- alignItems: 'flex-start',
25
- paddingLeft: '25px',
26
- };
27
-
28
- const subtitleStyle = {
29
- fontSize: '13px',
30
- color: `${activeTheme.neutral['neutral-2']}`,
31
- lineHeight: '24px',
32
- paddingLeft: '25px',
33
- };
34
-
35
- return (
36
- <div style={wrapperStyle}>
37
- <div style={titleStyle}>
38
- {imgLink ? (
39
- <img src={imgLink} alt='userIcon' srcset='' style={imgStyle} />
40
- ) : (
41
- <Icon
42
- icon='user-icon'
43
- size={iconSize}
44
- color={activeTheme.primary['primary-1']}
45
- />
46
- )}{' '}
47
- <h4>{title}</h4>
48
- </div>
49
- <div style={subtitleStyle}>
50
- <p>{subtitle}</p>
51
- </div>
52
- </div>
53
- );
54
- };
55
-
56
- HeaderComponent.propTypes = {
57
- /**
58
- * How large should the default icon be?
59
- */
60
- size: PropTypes.number,
61
- };
62
- HeaderComponent.defaultProps = {
63
- iconSize: 23,
64
- };