groundfloor-react-ui 1.2.8 → 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.
- package/dist/index.es.js +461 -430
- package/dist/index.js +469 -438
- 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 -339
- package/components/Inputs/ColorInput.js +0 -145
- package/components/Inputs/DateSelect.js +0 -461
- package/components/Inputs/DropdownSelect.js +0 -690
- package/components/Inputs/DropzoneInput.js +0 -450
- package/components/Inputs/NumericInput.js +0 -166
- package/components/Inputs/PasswordInput.js +0 -242
- 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 -235
- package/components/Inputs/TimeInput.js +0 -186
- package/components/Inputs/ToggleSwitch.js +0 -157
- 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 -801
- 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,179 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from "react";
|
|
3
|
-
import styled, { css, keyframes } from "styled-components";
|
|
4
|
-
import defaultStyles from '../constants/defaultStyle';
|
|
5
|
-
|
|
6
|
-
const ldsSpinner = keyframes`
|
|
7
|
-
0% {
|
|
8
|
-
opacity: 1;
|
|
9
|
-
}
|
|
10
|
-
100% {
|
|
11
|
-
opacity: 0;
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
const Spinner = styled.div`
|
|
16
|
-
${({ size, thickness, propellerHeight }) => {
|
|
17
|
-
return css`
|
|
18
|
-
display: inline-block;
|
|
19
|
-
position: relative;
|
|
20
|
-
width: ${size}px;
|
|
21
|
-
height: ${size}px;
|
|
22
|
-
|
|
23
|
-
div{
|
|
24
|
-
transform-origin: 0px ${size / 2}px;
|
|
25
|
-
animation: ${ldsSpinner} 1s linear infinite;
|
|
26
|
-
width: fit-content;
|
|
27
|
-
|
|
28
|
-
::after {
|
|
29
|
-
content: "";
|
|
30
|
-
display: block;
|
|
31
|
-
position: absolute;
|
|
32
|
-
top: 0px;
|
|
33
|
-
left: 0px;
|
|
34
|
-
width: ${thickness}px; //2px;
|
|
35
|
-
height: calc(${size}px*${propellerHeight}/100);
|
|
36
|
-
border-radius: 20%;
|
|
37
|
-
${({ theme, type, customStyles }) => {
|
|
38
|
-
if (theme) {
|
|
39
|
-
let tempArr = [];
|
|
40
|
-
if (theme[type]) {
|
|
41
|
-
for (const property in theme[type]) {
|
|
42
|
-
tempArr.push(`${property}:${theme[type][property]};`)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (customStyles) {
|
|
46
|
-
for (const property in customStyles) {
|
|
47
|
-
tempArr.push(`${property}:${customStyles[property]};`)
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return [...tempArr];
|
|
51
|
-
}
|
|
52
|
-
}}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
div:nth-child(1) {
|
|
57
|
-
transform: translate(${size / 2}px, 0px) rotate(0deg);
|
|
58
|
-
animation-delay: -0.875s;
|
|
59
|
-
::after{
|
|
60
|
-
transform: translate(-${thickness / 2}px, 0px) //-1
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
div:nth-child(2) {
|
|
65
|
-
transform: translate(${size / 2}px, 0px) rotate(45deg);
|
|
66
|
-
animation-delay: -0.75s;
|
|
67
|
-
::after{
|
|
68
|
-
transform: translate(-${thickness / 2}px, 0px) //-1
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
div:nth-child(3) {
|
|
73
|
-
transform: translate(${size / 2}px, 0px) rotate(90deg) ;
|
|
74
|
-
animation-delay: -0.625s;
|
|
75
|
-
::after{
|
|
76
|
-
transform: translate(-${thickness / 2}px, 0px) //-1
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
div:nth-child(4) {
|
|
81
|
-
transform: translate(${size / 2}px, 0px) rotate(135deg);
|
|
82
|
-
animation-delay: -0.5s;
|
|
83
|
-
::after{
|
|
84
|
-
transform: translate(-${thickness / 2}px, 0px) //-1
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
div:nth-child(5) {
|
|
89
|
-
transform: translate(${size / 2}px, 0px) rotate(180deg);
|
|
90
|
-
animation-delay: -0.375s;
|
|
91
|
-
::after{
|
|
92
|
-
transform: translate(-${thickness / 2}px, 0px) //-1
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
div:nth-child(6) {
|
|
97
|
-
transform: translate(${size / 2}px, 0px) rotate(225deg);
|
|
98
|
-
animation-delay: -0.25s;
|
|
99
|
-
::after{
|
|
100
|
-
transform: translate(-${thickness / 2}px, 0px) //-1
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
div:nth-child(7) {
|
|
105
|
-
transform: translate(${size / 2}px, 0px) rotate(270deg);
|
|
106
|
-
animation-delay: -0.125s;
|
|
107
|
-
::after{
|
|
108
|
-
transform: translate(-${thickness / 2}px, 0px)
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
div:nth-child(8) {
|
|
113
|
-
transform: translate(${size / 2}px, 0px) rotate(315deg);
|
|
114
|
-
animation-delay: 0s;
|
|
115
|
-
::after{
|
|
116
|
-
transform: translate(-${thickness / 2}px, 0px)
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
div:nth-child(9) {
|
|
121
|
-
transform: translate(${size / 2}px, 0px) rotate(0deg);
|
|
122
|
-
::after{
|
|
123
|
-
transform: translate(-${thickness / 2}px, 0px)
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
`
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
`
|
|
130
|
-
|
|
131
|
-
export const Loader = ({ size, thickness, propellerHeight, customStyles }) => {
|
|
132
|
-
const theme = defaultStyles;
|
|
133
|
-
|
|
134
|
-
return (
|
|
135
|
-
<Spinner theme={theme} size={size} thickness={thickness} propellerHeight={propellerHeight} customStyles={customStyles} type='spinner'>
|
|
136
|
-
<div></div>
|
|
137
|
-
<div></div>
|
|
138
|
-
<div></div>
|
|
139
|
-
<div></div>
|
|
140
|
-
<div></div>
|
|
141
|
-
<div></div>
|
|
142
|
-
<div></div>
|
|
143
|
-
<div></div>
|
|
144
|
-
<div></div>
|
|
145
|
-
</Spinner>
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
Spinner.defaultProps = {
|
|
150
|
-
theme: defaultStyles,
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
Loader.propTypes = {
|
|
154
|
-
/**
|
|
155
|
-
* Diameter of the spinner in px
|
|
156
|
-
*/
|
|
157
|
-
size: PropTypes.number,
|
|
158
|
-
/**
|
|
159
|
-
* Thickness of the propeller
|
|
160
|
-
*/
|
|
161
|
-
thickness: PropTypes.number,
|
|
162
|
-
/**
|
|
163
|
-
* Heightof the propeller in percentage of the size (eg 100 = size, 50 = size/2).
|
|
164
|
-
*/
|
|
165
|
-
propellerHeight: PropTypes.number,
|
|
166
|
-
/**
|
|
167
|
-
* CustomStyles is an object to apply custom style to the ::after pseudo element.
|
|
168
|
-
* But mainly only used to apply a custom background-color
|
|
169
|
-
*/
|
|
170
|
-
customStyles: PropTypes.object,
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
Loader.defaultProps = {
|
|
174
|
-
size: 20,
|
|
175
|
-
thickness: 2,
|
|
176
|
-
propellerHeight: 25,
|
|
177
|
-
customStyles: null,
|
|
178
|
-
}
|
|
179
|
-
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import Modal from 'react-modal';
|
|
4
|
-
import styled, { useTheme } from 'styled-components';
|
|
5
|
-
import defaultStyles from '../constants/defaultStyle';
|
|
6
|
-
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
7
|
-
import getDefaultStyles from '../constants/utils';
|
|
8
|
-
import { Icon } from '../Icon';
|
|
9
|
-
|
|
10
|
-
const ModalClose = styled.button`
|
|
11
|
-
//Set the styles from the default styles object
|
|
12
|
-
${({ theme, type }) => {
|
|
13
|
-
return getDefaultStyles(theme, type);
|
|
14
|
-
}}
|
|
15
|
-
// custom styles
|
|
16
|
-
${({ customModalCloseStyle }) => customModalCloseStyle}
|
|
17
|
-
//Set the styles from the default styles object
|
|
18
|
-
&:focus {
|
|
19
|
-
outline: none;
|
|
20
|
-
border: none;
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
const ModalHeader = styled.div`
|
|
25
|
-
margin-top: 10px;
|
|
26
|
-
|
|
27
|
-
// custom styles
|
|
28
|
-
${({ customModalHeaderStyle }) => customModalHeaderStyle}
|
|
29
|
-
`;
|
|
30
|
-
const ModalBody = styled.div`
|
|
31
|
-
//Set the styles from the default styles object
|
|
32
|
-
${({ theme, type }) => {
|
|
33
|
-
return getDefaultStyles(theme, type);
|
|
34
|
-
}}
|
|
35
|
-
// custom styles
|
|
36
|
-
${({ customModalBodyStyle }) => customModalBodyStyle}
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
|
-
const ContentWrapper = styled.div`
|
|
40
|
-
max-height: 60vh;
|
|
41
|
-
overflow-y: auto;
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
const ModalFooter = styled.div`
|
|
45
|
-
//Set the styles from the default styles object
|
|
46
|
-
${({ theme, type }) => {
|
|
47
|
-
return getDefaultStyles(theme, type);
|
|
48
|
-
}}
|
|
49
|
-
// custom styles
|
|
50
|
-
${({ customModalFooterStyle }) => customModalFooterStyle}
|
|
51
|
-
`;
|
|
52
|
-
|
|
53
|
-
const CommonDiv = styled.div`
|
|
54
|
-
padding: 0.5rem 3rem 0rem 3rem;
|
|
55
|
-
`;
|
|
56
|
-
|
|
57
|
-
const HeaderWrapper = styled.div`
|
|
58
|
-
position: sticky;
|
|
59
|
-
background-color: ${({ theme }) => theme.bgColor};
|
|
60
|
-
width: 100%;
|
|
61
|
-
top: 0px;
|
|
62
|
-
border-bottom: 1px solid ${({ theme }) => theme.border};
|
|
63
|
-
`;
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
Modal.setAppElement('#root');
|
|
67
|
-
} catch (error) {
|
|
68
|
-
Modal.setAppElement('#__next');
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export const ModalComp = ({
|
|
72
|
-
modalIsOpen,
|
|
73
|
-
toggleModal,
|
|
74
|
-
closeOnOutsideClick,
|
|
75
|
-
headerContent,
|
|
76
|
-
bodyContent,
|
|
77
|
-
footerContent,
|
|
78
|
-
customModalCloseStyle,
|
|
79
|
-
customModalHeaderStyle,
|
|
80
|
-
customModalBodyStyle,
|
|
81
|
-
customModalFooterStyle,
|
|
82
|
-
customWidth,
|
|
83
|
-
customMinWidth,
|
|
84
|
-
customMaxWidth,
|
|
85
|
-
...props
|
|
86
|
-
}) => {
|
|
87
|
-
const activeTheme = useTheme() || defaultThemeColor;
|
|
88
|
-
|
|
89
|
-
const customStyles = {
|
|
90
|
-
overlay: {
|
|
91
|
-
zIndex: '999999',
|
|
92
|
-
backgroundColor: 'rgb(0 0 0 / 30%)',
|
|
93
|
-
},
|
|
94
|
-
content: {
|
|
95
|
-
borderColor: defaultThemeColor.border,
|
|
96
|
-
top: '50%',
|
|
97
|
-
left: '50%',
|
|
98
|
-
right: 'auto',
|
|
99
|
-
bottom: 'auto',
|
|
100
|
-
marginRight: '-50%',
|
|
101
|
-
padding: '0px',
|
|
102
|
-
transform: 'translate(-50%, -50%)',
|
|
103
|
-
minWidth: customMinWidth,
|
|
104
|
-
maxHeight: '85vh',
|
|
105
|
-
overflow: 'hidden',
|
|
106
|
-
width: customWidth && customWidth,
|
|
107
|
-
maxWidth: customMaxWidth && customMaxWidth,
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
return (
|
|
112
|
-
<Modal
|
|
113
|
-
isOpen={modalIsOpen}
|
|
114
|
-
onRequestClose={closeOnOutsideClick ? toggleModal : undefined}
|
|
115
|
-
style={customStyles}
|
|
116
|
-
contentLabel='Modal'
|
|
117
|
-
{...props}
|
|
118
|
-
>
|
|
119
|
-
<HeaderWrapper theme={activeTheme}>
|
|
120
|
-
<ModalClose
|
|
121
|
-
theme={defaultStyles}
|
|
122
|
-
type={'modalComp-modal-close'}
|
|
123
|
-
style={customModalCloseStyle}
|
|
124
|
-
onClick={toggleModal}
|
|
125
|
-
>
|
|
126
|
-
<Icon
|
|
127
|
-
icon='cross-icon'
|
|
128
|
-
color={defaultThemeColor.neutral['neutral-2']}
|
|
129
|
-
size={15}
|
|
130
|
-
/>
|
|
131
|
-
</ModalClose>
|
|
132
|
-
|
|
133
|
-
<ModalHeader style={customModalHeaderStyle}>
|
|
134
|
-
<CommonDiv>{headerContent}</CommonDiv>
|
|
135
|
-
</ModalHeader>
|
|
136
|
-
</HeaderWrapper>
|
|
137
|
-
<ContentWrapper>
|
|
138
|
-
<ModalBody
|
|
139
|
-
theme={defaultStyles}
|
|
140
|
-
type={'modalComp-modal-body'}
|
|
141
|
-
style={customModalBodyStyle}
|
|
142
|
-
>
|
|
143
|
-
<CommonDiv> {bodyContent}</CommonDiv>
|
|
144
|
-
</ModalBody>
|
|
145
|
-
|
|
146
|
-
<ModalFooter
|
|
147
|
-
theme={defaultStyles}
|
|
148
|
-
type={'modalComp-modal-footer'}
|
|
149
|
-
style={customModalFooterStyle}
|
|
150
|
-
>
|
|
151
|
-
{footerContent}
|
|
152
|
-
</ModalFooter>
|
|
153
|
-
</ContentWrapper>
|
|
154
|
-
</Modal>
|
|
155
|
-
);
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
ModalComp.propTypes = {
|
|
159
|
-
/**
|
|
160
|
-
* Show modal
|
|
161
|
-
*/
|
|
162
|
-
modalIsOpen: PropTypes.bool,
|
|
163
|
-
/**
|
|
164
|
-
* Show modal function
|
|
165
|
-
*/
|
|
166
|
-
toggleModal: PropTypes.func,
|
|
167
|
-
/**
|
|
168
|
-
* Close modal on clicking outside
|
|
169
|
-
*/
|
|
170
|
-
closeOnOutsideClick: PropTypes.bool,
|
|
171
|
-
/**
|
|
172
|
-
* Modal Header Content
|
|
173
|
-
*/
|
|
174
|
-
headerContent: PropTypes.any,
|
|
175
|
-
/**
|
|
176
|
-
* Modal Body Content
|
|
177
|
-
*/
|
|
178
|
-
bodyContent: PropTypes.any,
|
|
179
|
-
/**
|
|
180
|
-
* Modal Footer Content
|
|
181
|
-
*/
|
|
182
|
-
footerContent: PropTypes.any,
|
|
183
|
-
/**
|
|
184
|
-
* Modal Close icon custom styles
|
|
185
|
-
*/
|
|
186
|
-
customModalCloseStyle: PropTypes.object,
|
|
187
|
-
/**
|
|
188
|
-
* Modal Header custom styles
|
|
189
|
-
*/
|
|
190
|
-
customModalHeaderStyle: PropTypes.object,
|
|
191
|
-
/**
|
|
192
|
-
* Modal Body custom styles
|
|
193
|
-
*/
|
|
194
|
-
customModalBodyStyle: PropTypes.object,
|
|
195
|
-
/**
|
|
196
|
-
* Modal Footer custom styles
|
|
197
|
-
*/
|
|
198
|
-
customModalFooterStyle: PropTypes.object,
|
|
199
|
-
customMinWidth: PropTypes.string,
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
ModalComp.defaultProps = {
|
|
203
|
-
modalIsOpen: false,
|
|
204
|
-
toggleModal: () => { },
|
|
205
|
-
closeOnOutsideClick: false,
|
|
206
|
-
headerContent: '',
|
|
207
|
-
bodyContent: '',
|
|
208
|
-
footerContent: '',
|
|
209
|
-
customModalCloseStyle: {},
|
|
210
|
-
customModalHeaderStyle: {},
|
|
211
|
-
customModalBodyStyle: {},
|
|
212
|
-
customModalFooterStyle: {},
|
|
213
|
-
customMinWidth: '40vw',
|
|
214
|
-
customWidth: '',
|
|
215
|
-
customMaxWidth: '',
|
|
216
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ModalComp';
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { usePopperTooltip } from 'react-popper-tooltip';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import defaultStyles from '../constants/defaultStyle';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Primary UI component for user interaction
|
|
9
|
-
*/
|
|
10
|
-
const OverlayContainer = styled.div`
|
|
11
|
-
${({ theme, type, customStyles }) => {
|
|
12
|
-
if (theme) {
|
|
13
|
-
let tempObj = {};
|
|
14
|
-
if (theme[type]) {
|
|
15
|
-
for (const property in theme['common']) {
|
|
16
|
-
tempObj[property] = theme['common'][property]
|
|
17
|
-
}
|
|
18
|
-
for (const property in theme[type]) {
|
|
19
|
-
tempObj[property] = theme[type][property]
|
|
20
|
-
delete theme.common[property]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return { ...tempObj, ...customStyles };
|
|
24
|
-
}
|
|
25
|
-
}}
|
|
26
|
-
}
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
export const Overlay = ({
|
|
30
|
-
theme,
|
|
31
|
-
toggleSimple,
|
|
32
|
-
contentTrigger,
|
|
33
|
-
contentOverlay,
|
|
34
|
-
popperOptionsP,
|
|
35
|
-
settingsP,
|
|
36
|
-
customStyles,
|
|
37
|
-
...props
|
|
38
|
-
}) => {
|
|
39
|
-
|
|
40
|
-
let popperOptions = {}
|
|
41
|
-
let settings = {}
|
|
42
|
-
|
|
43
|
-
if (toggleSimple) {
|
|
44
|
-
//Simple tooltip without arrow for text
|
|
45
|
-
popperOptions = {
|
|
46
|
-
...popperOptions,
|
|
47
|
-
modifiers: [
|
|
48
|
-
{
|
|
49
|
-
name: 'offset',
|
|
50
|
-
options: {
|
|
51
|
-
offset: [0, 5],
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
strategy: 'absolute'
|
|
56
|
-
}
|
|
57
|
-
settings = { ...settings }
|
|
58
|
-
} else {
|
|
59
|
-
//More styled overlay for other purpose
|
|
60
|
-
popperOptions = {
|
|
61
|
-
...popperOptions,
|
|
62
|
-
modifiers: [
|
|
63
|
-
{
|
|
64
|
-
name: 'offset',
|
|
65
|
-
options: {
|
|
66
|
-
offset: [0, 5],
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
strategy: 'absolute'
|
|
71
|
-
}
|
|
72
|
-
settings = {
|
|
73
|
-
...settings,
|
|
74
|
-
trigger: 'click',
|
|
75
|
-
closeOnOutsideClick: true,
|
|
76
|
-
interactive: true,
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
popperOptions = { ...popperOptions, ...popperOptionsP }
|
|
81
|
-
settings = { ...settings, ...settingsP }
|
|
82
|
-
|
|
83
|
-
const {
|
|
84
|
-
getArrowProps,
|
|
85
|
-
getTooltipProps,
|
|
86
|
-
setTooltipRef,
|
|
87
|
-
setTriggerRef,
|
|
88
|
-
visible,
|
|
89
|
-
} = usePopperTooltip({
|
|
90
|
-
...settings
|
|
91
|
-
}, popperOptions);
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<>
|
|
95
|
-
<div ref={setTriggerRef}
|
|
96
|
-
style={{ width: 'fit-content', height: 'fit-content' }}
|
|
97
|
-
>
|
|
98
|
-
{contentTrigger}
|
|
99
|
-
</div>
|
|
100
|
-
{visible && (
|
|
101
|
-
<OverlayContainer
|
|
102
|
-
type={toggleSimple ? 'simple-overlay' : 'overlay'}
|
|
103
|
-
theme={theme}
|
|
104
|
-
ref={setTooltipRef}
|
|
105
|
-
{...getTooltipProps({ className: 'tooltip-container' })}
|
|
106
|
-
customStyles={customStyles}
|
|
107
|
-
>
|
|
108
|
-
{contentOverlay}
|
|
109
|
-
</OverlayContainer>
|
|
110
|
-
)}
|
|
111
|
-
</>
|
|
112
|
-
);
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
Overlay.propTypes = {
|
|
116
|
-
/**
|
|
117
|
-
* Theme object
|
|
118
|
-
*/
|
|
119
|
-
theme: PropTypes.object,
|
|
120
|
-
/**
|
|
121
|
-
* The element where to attach the tooltip
|
|
122
|
-
*/
|
|
123
|
-
contentTrigger: PropTypes.any,
|
|
124
|
-
/**
|
|
125
|
-
* The element to put inside the overlay
|
|
126
|
-
*/
|
|
127
|
-
contentOverlay: PropTypes.any,
|
|
128
|
-
/**
|
|
129
|
-
* Object to customize the behaviour of the tooltip
|
|
130
|
-
* For more reference see:
|
|
131
|
-
* https://github.com/mohsinulhaq/react-popper-tooltip#readme
|
|
132
|
-
* https://popper.js.org/docs/v2/tutorial/
|
|
133
|
-
*/
|
|
134
|
-
popperOptionsP: PropTypes.object,
|
|
135
|
-
/**
|
|
136
|
-
* Object to customize the settings of the tooltip
|
|
137
|
-
* For more reference see:
|
|
138
|
-
* https://github.com/mohsinulhaq/react-popper-tooltip#readme
|
|
139
|
-
* https://popper.js.org/docs/v2/tutorial/
|
|
140
|
-
*/
|
|
141
|
-
settingsP: PropTypes.object,
|
|
142
|
-
/**
|
|
143
|
-
* Object to pass custom style to the Overlay container
|
|
144
|
-
*/
|
|
145
|
-
customStyles: PropTypes.object,
|
|
146
|
-
/**
|
|
147
|
-
* If true display a simple tooltip without arrow when hover the trigger
|
|
148
|
-
* If false when clicking on the trigger display a more styled overlay
|
|
149
|
-
*/
|
|
150
|
-
toggleSimple: PropTypes.bool,
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
Overlay.defaultProps = {
|
|
154
|
-
theme: defaultStyles,
|
|
155
|
-
contentTrigger: <div>Trigger</div>,
|
|
156
|
-
contentOverlay: <div>I am the Overlay</div>,
|
|
157
|
-
};
|
|
158
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Overlay';
|
|
@@ -1,59 +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 StyledPagination = styled.div`
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
color: ${({ theme }) => theme.variant['neutral-2']};
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
export const Pagination = ({ ...props }) => {
|
|
13
|
-
const activeTheme = useTheme() || defaultThemeColor;
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<StyledPagination theme={activeTheme}>{props.children}</StyledPagination>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const Item = styled.div`
|
|
21
|
-
font-size: 14px;
|
|
22
|
-
color: ${({ selected, theme }) =>
|
|
23
|
-
selected ? theme.variant['primary-1'] : null};
|
|
24
|
-
|
|
25
|
-
svg {
|
|
26
|
-
width: 14px;
|
|
27
|
-
height: 14px;
|
|
28
|
-
path {
|
|
29
|
-
fill: ${({ selected, theme }) =>
|
|
30
|
-
selected ? theme.variant['primary-1'] : theme.variant['neutral-2']};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
&:not(:first-child):not(:last-child) {
|
|
36
|
-
margin: 0 22px;
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
Pagination.PageItem = function PageItem({ selected, ...props }) {
|
|
41
|
-
const activeTheme = useTheme() || defaultThemeColor;
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<Item selected={selected} theme={activeTheme} {...props}>
|
|
45
|
-
{props.children}
|
|
46
|
-
</Item>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
Pagination.PageItem.propTypes = {
|
|
51
|
-
/**
|
|
52
|
-
* Is Page selected?
|
|
53
|
-
*/
|
|
54
|
-
selected: PropTypes.bool,
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
Pagination.PageItem.defaultProps = {
|
|
58
|
-
selected: false,
|
|
59
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Pagination';
|