groundfloor-react-ui 1.2.9 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +432 -422
- package/dist/index.js +459 -449
- package/package.json +15 -43
- package/rollup.config.js +6 -6
- package/assets/fonts/Averta/Averta-Black.woff2 +0 -0
- package/assets/fonts/Averta/Averta-BlackItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Bold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-BoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraBold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraBoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraThin.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraThinItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Light.woff2 +0 -0
- package/assets/fonts/Averta/Averta-LightItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Regular.woff2 +0 -0
- package/assets/fonts/Averta/Averta-RegularItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-SemiBold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-SemiBoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Thin.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ThinItalic.woff2 +0 -0
- package/assets/fonts/Beauty/BeautyDemo.woff +0 -0
- package/assets/icons/app-logo.svg +0 -3
- package/assets/icons/arrow-down.svg +0 -3
- package/assets/icons/arrow-rotate.svg +0 -1
- package/assets/icons/arrow-up.svg +0 -3
- package/assets/icons/bell.svg +0 -3
- package/assets/icons/check.svg +0 -3
- package/assets/icons/checkmark.svg +0 -3
- package/assets/icons/chevron-down.svg +0 -3
- package/assets/icons/chevron-left.svg +0 -3
- package/assets/icons/chevron-right.svg +0 -3
- package/assets/icons/cloud-icon.svg +0 -3
- package/assets/icons/connection.svg +0 -3
- package/assets/icons/cross-icon.svg +0 -3
- package/assets/icons/default.svg +0 -1
- package/assets/icons/door-internal-active.svg +0 -1
- package/assets/icons/edit-icon.svg +0 -3
- package/assets/icons/ellipses-horizontal.svg +0 -3
- package/assets/icons/ellipses.svg +0 -3
- package/assets/icons/email.svg +0 -3
- package/assets/icons/eye-hide-view.svg +0 -1
- package/assets/icons/eye-hide.svg +0 -1
- package/assets/icons/file-attach-white.svg +0 -3
- package/assets/icons/file-attach.svg +0 -3
- package/assets/icons/file-icon.svg +0 -1
- package/assets/icons/file-upload.svg +0 -3
- package/assets/icons/functional-equation-regular.svg +0 -147
- package/assets/icons/hamburger-menu.svg +0 -3
- package/assets/icons/heart.svg +0 -18
- package/assets/icons/image.svg +0 -3
- package/assets/icons/info.svg +0 -3
- package/assets/icons/jpg-icon.svg +0 -3
- package/assets/icons/magnifier.svg +0 -3
- package/assets/icons/menu-ellipse-two.svg +0 -1
- package/assets/icons/menu-ellipse.svg +0 -53
- package/assets/icons/pause-all.svg +0 -1
- package/assets/icons/pdf-icon.svg +0 -3
- package/assets/icons/pen-icon.svg +0 -3
- package/assets/icons/plus-outlined.svg +0 -3
- package/assets/icons/resume.svg +0 -1
- package/assets/icons/sign-icon.svg +0 -3
- package/assets/icons/star.svg +0 -3
- package/assets/icons/trash-icon.svg +0 -59
- package/assets/icons/triangle-down.svg +0 -3
- package/assets/icons/users.svg +0 -11
- package/assets/icons/view.svg +0 -3
- package/assets/icons/watcher.svg +0 -3
- package/assets/icons/zoom-in-white.svg +0 -1
- package/assets/styles/global.css +0 -0
- package/assets/styles/global.scss +0 -0
- package/components/Accordion/Accordion.js +0 -167
- package/components/Accordion/AccordionSB.js +0 -170
- package/components/Accordion/AccordionSBfooter.js +0 -171
- package/components/Accordion/index.js +0 -4
- package/components/ArrowBar/ArrowBar.js +0 -276
- package/components/ArrowBar/index.js +0 -2
- package/components/Avatar/Avatar.js +0 -171
- package/components/Avatar/AvatarSB.js +0 -255
- package/components/Avatar/AvatarSBfooter.js +0 -279
- package/components/Avatar/index.js +0 -4
- package/components/Banner/Banner.js +0 -70
- package/components/Banner/index.js +0 -2
- package/components/Breadcrumb/Breadcrumb.js +0 -225
- package/components/Breadcrumb/index.js +0 -2
- package/components/Button/PrimaryButton.js +0 -167
- package/components/Button/SecondaryButton.js +0 -156
- package/components/Button/TinyButton.js +0 -101
- package/components/Button/index.js +0 -6
- package/components/Cards/Card.js +0 -43
- package/components/Cards/CardRef.js +0 -71
- package/components/Cards/DocumentCard.js +0 -215
- package/components/Cards/index.js +0 -5
- package/components/Content/Content.js +0 -50
- package/components/Content/index.js +0 -1
- package/components/DesignComponent/StyledComponent/StyledComponent.js +0 -326
- package/components/DesignComponent/StyledComponent/index.js +0 -1
- package/components/DesignComponent/index.js +0 -1
- package/components/Divider/Divider.js +0 -56
- package/components/Divider/index.js +0 -2
- package/components/Drawer/Drawer.js +0 -84
- package/components/Drawer/index.js +0 -2
- package/components/ErrorBoundary/ErrorBoundary.js +0 -44
- package/components/ErrorBoundary/index.js +0 -1
- package/components/FilterChip/FilterChip.js +0 -70
- package/components/FilterChip/index.js +0 -1
- package/components/Footer/Footer.js +0 -57
- package/components/Footer/FooterContent.js +0 -98
- package/components/Footer/index.js +0 -3
- package/components/Form/FormComponent.js +0 -244
- package/components/Form/HeaderComponent.js +0 -64
- package/components/Form/SubmitComponent.js +0 -63
- package/components/Form/index.js +0 -5
- package/components/GroupAvatars/GroupAvatars.js +0 -139
- package/components/GroupAvatars/index.js +0 -1
- package/components/GroupButtons/ButtonPopup.js +0 -191
- package/components/GroupButtons/GroupButtons.js +0 -150
- package/components/GroupButtons/GroupButtonsPopup.js +0 -163
- package/components/GroupButtons/index.js +0 -3
- package/components/GroupStatusCircle/GroupStatusCircle.js +0 -135
- package/components/GroupStatusCircle/index.js +0 -1
- package/components/Header/Header.js +0 -58
- package/components/Header/index.js +0 -1
- package/components/HyperLink/HyperLink.js +0 -114
- package/components/HyperLink/index.js +0 -1
- package/components/Icon/Icon.js +0 -176
- package/components/Icon/index.js +0 -1
- package/components/Images/Image.js +0 -107
- package/components/Images/index.js +0 -2
- package/components/Inputs/CheckBoxInput.js +0 -341
- package/components/Inputs/ColorInput.js +0 -145
- package/components/Inputs/DateSelect.js +0 -461
- package/components/Inputs/DropdownSelect.js +0 -689
- package/components/Inputs/DropzoneInput.js +0 -450
- package/components/Inputs/NumericInput.js +0 -177
- package/components/Inputs/PasswordInput.js +0 -267
- package/components/Inputs/RadioInput.js +0 -292
- package/components/Inputs/SearchInput.js +0 -19
- package/components/Inputs/Signature.js +0 -369
- package/components/Inputs/TextArea.js +0 -214
- package/components/Inputs/TextInput.js +0 -251
- package/components/Inputs/TimeInput.js +0 -186
- package/components/Inputs/ToggleSwitch.js +0 -189
- package/components/Inputs/index.js +0 -15
- package/components/Label/Label.js +0 -48
- package/components/Label/index.js +0 -1
- package/components/Loaders/Loader.js +0 -179
- package/components/Loaders/index.js +0 -2
- package/components/Modal/ModalComp.js +0 -216
- package/components/Modal/index.js +0 -1
- package/components/Overlay/Overlay.js +0 -158
- package/components/Overlay/index.js +0 -1
- package/components/Pagination/Pagination.js +0 -59
- package/components/Pagination/index.js +0 -1
- package/components/ProgressBar/ProgressBar.js +0 -101
- package/components/ProgressBar/index.js +0 -1
- package/components/ProgressSteps/ProgressSteps.js +0 -121
- package/components/ProgressSteps/index.js +0 -1
- package/components/Rating/Rating.js +0 -258
- package/components/Rating/index.js +0 -1
- package/components/SecondaryLink/DarkSecondaryLink.js +0 -97
- package/components/SecondaryLink/LightSecondaryLink.js +0 -93
- package/components/SecondaryLink/index.js +0 -3
- package/components/Sidebar/Navbar.js +0 -306
- package/components/Sidebar/Sidebar.js +0 -207
- package/components/Sidebar/index.js +0 -3
- package/components/StatusChip/PrimaryStatusChip.js +0 -78
- package/components/StatusChip/SecondaryStatusChip.js +0 -78
- package/components/StatusChip/SlimPrimaryStatusChip.js +0 -92
- package/components/StatusChip/SlimSecondaryStatusChip.js +0 -93
- package/components/StatusChip/index.js +0 -6
- package/components/StatusCircle/StatusCircle.js +0 -64
- package/components/StatusCircle/index.js +0 -1
- package/components/Tables/Table.js +0 -178
- package/components/Tables/index.js +0 -1
- package/components/Tooltip/Tooltip.js +0 -581
- package/components/Tooltip/index.js +0 -1
- package/components/Typography/Typography.js +0 -77
- package/components/Typography/index.js +0 -2
- package/components/constants/colors.js +0 -33
- package/components/constants/defaultStyle.js +0 -804
- package/components/constants/defaultThemeColor.js +0 -16
- package/components/constants/index.js +0 -7
- package/components/constants/utils.js +0 -31
- package/components/global/FontStyle.js +0 -131
- package/components/global/index.js +0 -1
- package/index.js +0 -41
|
@@ -1,581 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { usePopperTooltip } from 'react-popper-tooltip';
|
|
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
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Primary UI component for user interaction
|
|
11
|
-
*/
|
|
12
|
-
const TooltipContainer = styled.div`
|
|
13
|
-
background-color: ${({ theme }) => theme.bgColor};
|
|
14
|
-
border: 1px solid ${({ theme }) => theme.bgColor};
|
|
15
|
-
color: ${({ theme }) => theme.black},
|
|
16
|
-
${({ inBuiltCss, type, customStylesTPContainer }) => {
|
|
17
|
-
if (inBuiltCss) {
|
|
18
|
-
let tempObj = {};
|
|
19
|
-
if (inBuiltCss['tooltip-container']) {
|
|
20
|
-
for (const property in inBuiltCss['common']) {
|
|
21
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
22
|
-
}
|
|
23
|
-
for (const property in inBuiltCss['tooltip-container']) {
|
|
24
|
-
tempObj[property] = inBuiltCss['tooltip-container'][property]
|
|
25
|
-
delete inBuiltCss.common[property]
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return { ...tempObj, ...customStylesTPContainer };
|
|
29
|
-
}
|
|
30
|
-
}}
|
|
31
|
-
|
|
32
|
-
&[data-popper-placement*='bottom'] .tooltip-arrow {
|
|
33
|
-
${({ inBuiltCss, type, customStylesTPAbottom }) => {
|
|
34
|
-
if (inBuiltCss) {
|
|
35
|
-
let tempObj = {};
|
|
36
|
-
if (inBuiltCss['tp-cont-bottom-arrow']) {
|
|
37
|
-
for (const property in inBuiltCss['common']) {
|
|
38
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
39
|
-
}
|
|
40
|
-
for (const property in inBuiltCss['tp-cont-bottom-arrow']) {
|
|
41
|
-
tempObj[property] = inBuiltCss['tp-cont-bottom-arrow'][property]
|
|
42
|
-
delete inBuiltCss.common[property]
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return { ...tempObj, ...customStylesTPAbottom };
|
|
46
|
-
}
|
|
47
|
-
}}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&[data-popper-placement*='bottom'] .tooltip-arrow::before {
|
|
51
|
-
border-color: transparent transparent ${({ theme }) => theme.bgColor} transparent;
|
|
52
|
-
${({ inBuiltCss, type, customStylesTPAbottomBefore, theme }) => {
|
|
53
|
-
if (inBuiltCss) {
|
|
54
|
-
let tempObj = {};
|
|
55
|
-
if (inBuiltCss['tp-cont-bottom-arrow-before']) {
|
|
56
|
-
for (const property in inBuiltCss['common']) {
|
|
57
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
58
|
-
}
|
|
59
|
-
for (const property in inBuiltCss['tp-cont-bottom-arrow-before']) {
|
|
60
|
-
tempObj[property] = inBuiltCss['tp-cont-bottom-arrow-before'][property]
|
|
61
|
-
delete inBuiltCss.common[property]
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
let customStyles = customStylesTPAbottomBefore ? customStylesTPAbottomBefore : {
|
|
65
|
-
borderColor: `transparent transparent ${theme.primary['primary-1']} transparent`,
|
|
66
|
-
}
|
|
67
|
-
return { ...tempObj, ...customStyles };
|
|
68
|
-
}
|
|
69
|
-
}}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&[data-popper-placement*='bottom'] .tooltip-arrow::after {
|
|
73
|
-
border-color: transparent transparent ${({ theme }) => theme.bgColor} transparent;
|
|
74
|
-
${({ inBuiltCss, type, customStylesTPAbottomAfter, theme }) => {
|
|
75
|
-
if (inBuiltCss) {
|
|
76
|
-
let tempObj = {};
|
|
77
|
-
if (inBuiltCss['tp-cont-bottom-arrow-before']) {
|
|
78
|
-
for (const property in inBuiltCss['common']) {
|
|
79
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
80
|
-
}
|
|
81
|
-
for (const property in inBuiltCss['tp-cont-bottom-arrow-after']) {
|
|
82
|
-
tempObj[property] = inBuiltCss['tp-cont-bottom-arrow-after'][property]
|
|
83
|
-
delete inBuiltCss.common[property]
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
let customStyles = customStylesTPAbottomAfter ? customStylesTPAbottomAfter : {
|
|
87
|
-
borderColor: `transparent transparent ${theme.primary['primary-1']} transparent`,
|
|
88
|
-
}
|
|
89
|
-
return { ...tempObj, ...customStyles };
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
}}
|
|
93
|
-
}
|
|
94
|
-
&[data-popper-placement*='top'] .tooltip-arrow {
|
|
95
|
-
${({ inBuiltCss, type, customStylesTPAtop }) => {
|
|
96
|
-
if (inBuiltCss) {
|
|
97
|
-
let tempObj = {};
|
|
98
|
-
if (inBuiltCss['tp-cont-top-arrow']) {
|
|
99
|
-
for (const property in inBuiltCss['common']) {
|
|
100
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
101
|
-
}
|
|
102
|
-
for (const property in inBuiltCss['tp-cont-top-arrow']) {
|
|
103
|
-
tempObj[property] = inBuiltCss['tp-cont-top-arrow'][property]
|
|
104
|
-
delete inBuiltCss.common[property]
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return { ...tempObj, ...customStylesTPAtop };
|
|
108
|
-
}
|
|
109
|
-
}}
|
|
110
|
-
}
|
|
111
|
-
&[data-popper-placement*='top'] .tooltip-arrow::before {
|
|
112
|
-
border-color: ${({ theme }) => theme.bgColor} transparent transparent transparent;
|
|
113
|
-
${({ inBuiltCss, type, customStylesTPAtopBefore, theme }) => {
|
|
114
|
-
if (inBuiltCss) {
|
|
115
|
-
let tempObj = {};
|
|
116
|
-
if (inBuiltCss['tp-cont-top-arrow-before']) {
|
|
117
|
-
for (const property in inBuiltCss['common']) {
|
|
118
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
119
|
-
}
|
|
120
|
-
for (const property in inBuiltCss['tp-cont-top-arrow-before']) {
|
|
121
|
-
tempObj[property] = inBuiltCss['tp-cont-top-arrow-before'][property]
|
|
122
|
-
delete inBuiltCss.common[property]
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
let customStyles = customStylesTPAtopBefore ? customStylesTPAtopBefore : {
|
|
126
|
-
borderColor: `${theme.primary['primary-1']} transparent transparent transparent`,
|
|
127
|
-
}
|
|
128
|
-
return { ...tempObj, ...customStyles };
|
|
129
|
-
}
|
|
130
|
-
}}
|
|
131
|
-
}
|
|
132
|
-
&[data-popper-placement*='top'] .tooltip-arrow::after {
|
|
133
|
-
border-color: ${({ theme }) => theme.bgColor} transparent transparent transparent;
|
|
134
|
-
${({ inBuiltCss, type, customStylesTPAtopAfter, theme }) => {
|
|
135
|
-
if (inBuiltCss) {
|
|
136
|
-
let tempObj = {};
|
|
137
|
-
if (inBuiltCss['tp-cont-top-arrow-before']) {
|
|
138
|
-
for (const property in inBuiltCss['common']) {
|
|
139
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
140
|
-
}
|
|
141
|
-
for (const property in inBuiltCss['tp-cont-top-arrow-after']) {
|
|
142
|
-
tempObj[property] = inBuiltCss['tp-cont-top-arrow-after'][property]
|
|
143
|
-
delete inBuiltCss.common[property]
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
let customStyles = customStylesTPAtopAfter ? customStylesTPAtopAfter : {
|
|
148
|
-
borderColor: `${theme.primary['primary-1']} transparent transparent transparent`,
|
|
149
|
-
}
|
|
150
|
-
return { ...tempObj, ...customStyles };
|
|
151
|
-
}
|
|
152
|
-
}}
|
|
153
|
-
}
|
|
154
|
-
&[data-popper-placement*='right'] .tooltip-arrow {
|
|
155
|
-
${({ inBuiltCss, type, customStylesTPAright }) => {
|
|
156
|
-
if (inBuiltCss) {
|
|
157
|
-
let tempObj = {};
|
|
158
|
-
if (inBuiltCss['tp-cont-right-arrow']) {
|
|
159
|
-
for (const property in inBuiltCss['common']) {
|
|
160
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
161
|
-
}
|
|
162
|
-
for (const property in inBuiltCss['tp-cont-right-arrow']) {
|
|
163
|
-
tempObj[property] = inBuiltCss['tp-cont-right-arrow'][property]
|
|
164
|
-
delete inBuiltCss.common[property]
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return { ...tempObj, ...customStylesTPAright };
|
|
168
|
-
}
|
|
169
|
-
}}
|
|
170
|
-
}
|
|
171
|
-
&[data-popper-placement*='right'] .tooltip-arrow::before {
|
|
172
|
-
border-color: transparent ${({ theme }) => theme.bgColor} transparent transparent;
|
|
173
|
-
${({ inBuiltCss, type, customStylesTPArightBefore, theme }) => {
|
|
174
|
-
if (inBuiltCss) {
|
|
175
|
-
let tempObj = {};
|
|
176
|
-
if (inBuiltCss['tp-cont-right-arrow-before']) {
|
|
177
|
-
for (const property in inBuiltCss['common']) {
|
|
178
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
179
|
-
}
|
|
180
|
-
for (const property in inBuiltCss['tp-cont-right-arrow-before']) {
|
|
181
|
-
tempObj[property] = inBuiltCss['tp-cont-right-arrow-before'][property]
|
|
182
|
-
delete inBuiltCss.common[property]
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
let customStyles = customStylesTPArightBefore ? customStylesTPArightBefore : {
|
|
186
|
-
borderColor: `transparent ${theme.primary['primary-1']} transparent transparent`,
|
|
187
|
-
}
|
|
188
|
-
return { ...tempObj, ...customStyles };
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
}}
|
|
192
|
-
}
|
|
193
|
-
&[data-popper-placement*='right'] .tooltip-arrow::after {
|
|
194
|
-
border-color: transparent ${({ theme }) => theme.bgColor} transparent transparent;
|
|
195
|
-
${({ inBuiltCss, type, customStylesTPArightAfter, theme }) => {
|
|
196
|
-
if (inBuiltCss) {
|
|
197
|
-
let tempObj = {};
|
|
198
|
-
if (inBuiltCss['tp-cont-right-arrow-before']) {
|
|
199
|
-
for (const property in inBuiltCss['common']) {
|
|
200
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
201
|
-
}
|
|
202
|
-
for (const property in inBuiltCss['tp-cont-right-arrow-after']) {
|
|
203
|
-
tempObj[property] = inBuiltCss['tp-cont-right-arrow-after'][property]
|
|
204
|
-
delete inBuiltCss.common[property]
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
let customStyles = customStylesTPArightAfter ? customStylesTPArightAfter : {
|
|
208
|
-
borderColor: `transparent ${theme.primary['primary-1']} transparent transparent`,
|
|
209
|
-
}
|
|
210
|
-
return { ...tempObj, ...customStyles };
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
}}
|
|
214
|
-
}
|
|
215
|
-
&[data-popper-placement*='left'] .tooltip-arrow {
|
|
216
|
-
${({ inBuiltCss, type, customStylesTPAleft }) => {
|
|
217
|
-
if (inBuiltCss) {
|
|
218
|
-
let tempObj = {};
|
|
219
|
-
if (inBuiltCss['tp-cont-left-arrow']) {
|
|
220
|
-
for (const property in inBuiltCss['common']) {
|
|
221
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
222
|
-
}
|
|
223
|
-
for (const property in inBuiltCss['tp-cont-left-arrow']) {
|
|
224
|
-
tempObj[property] = inBuiltCss['tp-cont-left-arrow'][property]
|
|
225
|
-
delete inBuiltCss.common[property]
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return { ...tempObj, ...customStylesTPAleft };
|
|
229
|
-
}
|
|
230
|
-
}}
|
|
231
|
-
}
|
|
232
|
-
&[data-popper-placement*='left'] .tooltip-arrow::before {
|
|
233
|
-
|
|
234
|
-
border-color: transparent transparent transparent ${({ theme }) => theme.bgColor};
|
|
235
|
-
${({ inBuiltCss, type, customStylesTPAleftBefore, theme }) => {
|
|
236
|
-
if (inBuiltCss) {
|
|
237
|
-
let tempObj = {};
|
|
238
|
-
if (inBuiltCss['tp-cont-left-arrow-before']) {
|
|
239
|
-
for (const property in inBuiltCss['common']) {
|
|
240
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
241
|
-
}
|
|
242
|
-
for (const property in inBuiltCss['tp-cont-left-arrow-before']) {
|
|
243
|
-
tempObj[property] = inBuiltCss['tp-cont-left-arrow-before'][property]
|
|
244
|
-
delete inBuiltCss.common[property]
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
let customStyles = customStylesTPAleftBefore ? customStylesTPAleftBefore : {
|
|
248
|
-
borderColor: `transparent transparent transparent ${theme.primary['primary-1']} `,
|
|
249
|
-
}
|
|
250
|
-
return { ...tempObj, ...customStyles };
|
|
251
|
-
}
|
|
252
|
-
}}
|
|
253
|
-
}
|
|
254
|
-
&[data-popper-placement*='left'] .tooltip-arrow::after {
|
|
255
|
-
border-color: transparent transparent transparent ${({ theme }) => theme.bgColor};
|
|
256
|
-
${({ inBuiltCss, type, customStylesTPAleftAfter, theme }) => {
|
|
257
|
-
if (inBuiltCss) {
|
|
258
|
-
let tempObj = {};
|
|
259
|
-
if (inBuiltCss['tp-cont-left-arrow-before']) {
|
|
260
|
-
for (const property in inBuiltCss['common']) {
|
|
261
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
262
|
-
}
|
|
263
|
-
for (const property in inBuiltCss['tp-cont-left-arrow-after']) {
|
|
264
|
-
tempObj[property] = inBuiltCss['tp-cont-left-arrow-after'][property]
|
|
265
|
-
delete inBuiltCss.common[property]
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
let customStyles = customStylesTPAleftAfter ? customStylesTPAleftAfter : {
|
|
269
|
-
borderColor: `transparent transparent transparent ${theme.primary['primary-1']} `,
|
|
270
|
-
}
|
|
271
|
-
return { ...tempObj, ...customStyles };
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
}}
|
|
275
|
-
}
|
|
276
|
-
`;
|
|
277
|
-
|
|
278
|
-
const TooltipArrow = styled.div`
|
|
279
|
-
|
|
280
|
-
${({ inBuiltCss, type, customStylesTPArrow }) => {
|
|
281
|
-
if (inBuiltCss) {
|
|
282
|
-
let tempObj = {};
|
|
283
|
-
if (inBuiltCss['tooltip-arrow']) {
|
|
284
|
-
for (const property in inBuiltCss['common']) {
|
|
285
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
286
|
-
}
|
|
287
|
-
for (const property in inBuiltCss['tooltip-arrow']) {
|
|
288
|
-
tempObj[property] = inBuiltCss['tooltip-arrow'][property]
|
|
289
|
-
delete inBuiltCss.common[property]
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
return { ...tempObj, ...customStylesTPArrow };
|
|
293
|
-
}
|
|
294
|
-
}}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
&::before{
|
|
298
|
-
${({ inBuiltCss, type, customStylesTPAbefore }) => {
|
|
299
|
-
if (inBuiltCss) {
|
|
300
|
-
let tempObj = {};
|
|
301
|
-
if (inBuiltCss['tooltip-arrow-before']) {
|
|
302
|
-
for (const property in inBuiltCss['common']) {
|
|
303
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
304
|
-
}
|
|
305
|
-
for (const property in inBuiltCss['tooltip-arrow-before']) {
|
|
306
|
-
tempObj[property] = inBuiltCss['tooltip-arrow-before'][property]
|
|
307
|
-
delete inBuiltCss.common[property]
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
return { ...tempObj, ...customStylesTPAbefore };
|
|
311
|
-
}
|
|
312
|
-
}}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
&::after{
|
|
316
|
-
${({ inBuiltCss, type, customStylesTPAafter }) => {
|
|
317
|
-
if (inBuiltCss) {
|
|
318
|
-
let tempObj = {};
|
|
319
|
-
if (inBuiltCss['tooltip-arrow-after']) {
|
|
320
|
-
for (const property in inBuiltCss['common']) {
|
|
321
|
-
tempObj[property] = inBuiltCss['common'][property]
|
|
322
|
-
}
|
|
323
|
-
for (const property in inBuiltCss['tooltip-arrow-after']) {
|
|
324
|
-
tempObj[property] = inBuiltCss['tooltip-arrow-after'][property]
|
|
325
|
-
delete inBuiltCss.common[property]
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
return { ...tempObj, ...customStylesTPAafter };
|
|
329
|
-
}
|
|
330
|
-
}}
|
|
331
|
-
}
|
|
332
|
-
`;
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
const TooltipContent = styled.div`
|
|
336
|
-
|
|
337
|
-
background-color: ${({ theme }) => theme.primary['primary-1']};
|
|
338
|
-
${({ inBuiltCss, defaultTooltipContentStyle }) => {
|
|
339
|
-
return getDefaultStyles(inBuiltCss, defaultTooltipContentStyle);
|
|
340
|
-
}}
|
|
341
|
-
// custom styles
|
|
342
|
-
${({ customContentStyle }) => customContentStyle}
|
|
343
|
-
`
|
|
344
|
-
|
|
345
|
-
const Header = styled.div`
|
|
346
|
-
${({ inBuiltCss, defaultTooltipHeaderStyle }) => {
|
|
347
|
-
return getDefaultStyles(inBuiltCss, defaultTooltipHeaderStyle);
|
|
348
|
-
}}
|
|
349
|
-
// custom styles
|
|
350
|
-
${({ customHeaderStyle }) => customHeaderStyle}
|
|
351
|
-
`
|
|
352
|
-
|
|
353
|
-
const Body = styled.div`
|
|
354
|
-
${({ inBuiltCss, defaultTooltipBodyStyle }) => {
|
|
355
|
-
return getDefaultStyles(inBuiltCss, defaultTooltipBodyStyle);
|
|
356
|
-
}}
|
|
357
|
-
// custom styles
|
|
358
|
-
${({ customBodyStyle }) => customBodyStyle}
|
|
359
|
-
`
|
|
360
|
-
|
|
361
|
-
const Footer = styled.div`
|
|
362
|
-
`
|
|
363
|
-
|
|
364
|
-
export const Tooltip = ({
|
|
365
|
-
inBuiltCss,
|
|
366
|
-
contentTrigger,
|
|
367
|
-
contentTooltip,
|
|
368
|
-
popperOptionsP,
|
|
369
|
-
settings,
|
|
370
|
-
customStylesTPContainer,
|
|
371
|
-
customStylesTPAbottom,
|
|
372
|
-
customStylesTPAbottomBefore,
|
|
373
|
-
customStylesTPAbottomAfter,
|
|
374
|
-
customStylesTPAtop,
|
|
375
|
-
customStylesTPAtopBefore,
|
|
376
|
-
customStylesTPAtopAfter,
|
|
377
|
-
customStylesTPAright,
|
|
378
|
-
customStylesTPArightBefore,
|
|
379
|
-
customStylesTPArightAfter,
|
|
380
|
-
customStylesTPAleft,
|
|
381
|
-
customStylesTPAleftBefore,
|
|
382
|
-
customStylesTPAleftAfter,
|
|
383
|
-
customStylesTPArrow,
|
|
384
|
-
customStylesTPAbefore,
|
|
385
|
-
customStylesTPAafter,
|
|
386
|
-
customTooltipContentStyle,
|
|
387
|
-
customContentStyle,
|
|
388
|
-
customHeaderStyle,
|
|
389
|
-
customBodyStyle,
|
|
390
|
-
headerTooltip,
|
|
391
|
-
footerTooltip,
|
|
392
|
-
...props
|
|
393
|
-
}) => {
|
|
394
|
-
|
|
395
|
-
const activeTheme = useTheme() || defaultThemeColor;
|
|
396
|
-
|
|
397
|
-
const popperOptions = {
|
|
398
|
-
modifiers: [
|
|
399
|
-
{
|
|
400
|
-
name: 'offset',
|
|
401
|
-
options: {
|
|
402
|
-
offset: [0, 23],
|
|
403
|
-
},
|
|
404
|
-
},
|
|
405
|
-
],
|
|
406
|
-
strategy: 'absolute'
|
|
407
|
-
, ...popperOptionsP
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
const {
|
|
411
|
-
getArrowProps,
|
|
412
|
-
getTooltipProps,
|
|
413
|
-
setTooltipRef,
|
|
414
|
-
setTriggerRef,
|
|
415
|
-
visible,
|
|
416
|
-
} = usePopperTooltip({
|
|
417
|
-
...settings
|
|
418
|
-
}, popperOptions);
|
|
419
|
-
|
|
420
|
-
return (
|
|
421
|
-
<>
|
|
422
|
-
<div ref={setTriggerRef}
|
|
423
|
-
style={{ width: 'fit-content', height: 'fit-content', display: 'inline-block' }}
|
|
424
|
-
>
|
|
425
|
-
{contentTrigger}
|
|
426
|
-
</div>
|
|
427
|
-
{visible && (
|
|
428
|
-
<TooltipContainer
|
|
429
|
-
inBuiltCss={defaultStyles}
|
|
430
|
-
theme={activeTheme}
|
|
431
|
-
ref={setTooltipRef}
|
|
432
|
-
{...getTooltipProps({ className: 'tooltip-container' })}
|
|
433
|
-
customStylesTPContainer={customStylesTPContainer}
|
|
434
|
-
customStylesTPAbottom={customStylesTPAbottom}
|
|
435
|
-
customStylesTPAbottomBefore={customStylesTPAbottomBefore}
|
|
436
|
-
customStylesTPAbottomAfter={customStylesTPAbottomAfter}
|
|
437
|
-
customStylesTPAtop={customStylesTPAtop}
|
|
438
|
-
customStylesTPAtopBefore={customStylesTPAtopBefore}
|
|
439
|
-
customStylesTPAtopAfter={customStylesTPAtopAfter}
|
|
440
|
-
customStylesTPAright={customStylesTPAright}
|
|
441
|
-
customStylesTPArightBefore={customStylesTPArightBefore}
|
|
442
|
-
customStylesTPArightAfter={customStylesTPArightAfter}
|
|
443
|
-
customStylesTPAleft={customStylesTPAleft}
|
|
444
|
-
customStylesTPAleftBefore={customStylesTPAleftBefore}
|
|
445
|
-
customStylesTPAleftAfter={customStylesTPAleftAfter}
|
|
446
|
-
>
|
|
447
|
-
<TooltipArrow
|
|
448
|
-
inBuiltCss={defaultStyles}
|
|
449
|
-
{...getArrowProps({ className: 'tooltip-arrow' })}
|
|
450
|
-
customStylesTPArrow={customStylesTPArrow}
|
|
451
|
-
customStylesTPAbefore={customStylesTPAbefore}
|
|
452
|
-
customStylesTPAafter={customStylesTPAafter}
|
|
453
|
-
/>
|
|
454
|
-
<TooltipContent defaultTooltipContentStyle={'popOver-Content'} theme={activeTheme} inBuiltCss={defaultStyles}
|
|
455
|
-
{...props} customContentStyle={customContentStyle}>
|
|
456
|
-
<Header defaultTooltipHeaderStyle={'popOver-header'} theme={activeTheme} inBuiltCss={defaultStyles}
|
|
457
|
-
{...props} customHeaderStyle={customHeaderStyle}>{headerTooltip}</Header>
|
|
458
|
-
<Body defaultTooltipBodyStyle={'popOver-body'} theme={activeTheme} inBuiltCss={defaultStyles}
|
|
459
|
-
{...props} customBodyStyle={customBodyStyle}>{contentTooltip}</Body>
|
|
460
|
-
<Footer >{footerTooltip}</Footer>
|
|
461
|
-
</TooltipContent>
|
|
462
|
-
</TooltipContainer>
|
|
463
|
-
)}
|
|
464
|
-
</>
|
|
465
|
-
);
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
Tooltip.propTypes = {
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* The element where to attach the tooltip
|
|
472
|
-
*/
|
|
473
|
-
contentTrigger: PropTypes.any,
|
|
474
|
-
/**
|
|
475
|
-
* The header element to put inside the tooltip
|
|
476
|
-
*/
|
|
477
|
-
headerTooltip: PropTypes.any,
|
|
478
|
-
/**
|
|
479
|
-
* The Body element to put inside the tooltip
|
|
480
|
-
*/
|
|
481
|
-
contentTooltip: PropTypes.any,
|
|
482
|
-
/**
|
|
483
|
-
* The footer element to put inside the tooltip
|
|
484
|
-
*/
|
|
485
|
-
footerTooltip: PropTypes.any,
|
|
486
|
-
/**
|
|
487
|
-
* Object to customize the behaviour of the tooltip
|
|
488
|
-
* For more reference see:
|
|
489
|
-
* https://github.com/mohsinulhaq/react-popper-tooltip#readme
|
|
490
|
-
* https://popper.js.org/docs/v2/tutorial/
|
|
491
|
-
*/
|
|
492
|
-
popperOptionsP: PropTypes.object,
|
|
493
|
-
/**
|
|
494
|
-
* Object to customize the settings of the tooltip
|
|
495
|
-
* For more reference see:
|
|
496
|
-
* https://github.com/mohsinulhaq/react-popper-tooltip#readme
|
|
497
|
-
* https://popper.js.org/docs/v2/tutorial/
|
|
498
|
-
*/
|
|
499
|
-
settings: PropTypes.object,
|
|
500
|
-
/**
|
|
501
|
-
* Object to pass custom style to the Tooltip container
|
|
502
|
-
*/
|
|
503
|
-
customHeaderStyle: PropTypes.object,
|
|
504
|
-
/**
|
|
505
|
-
* Object to pass custom style to the Tooltip container
|
|
506
|
-
*/
|
|
507
|
-
customBodyStyle: PropTypes.object,
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* Object to pass custom style to the Tooltip container
|
|
511
|
-
*/
|
|
512
|
-
customStylesTPContainer: PropTypes.object,
|
|
513
|
-
/**
|
|
514
|
-
* Object to pass custom style to the Tooltip arrow bottom
|
|
515
|
-
*/
|
|
516
|
-
customStylesTPAbottom: PropTypes.object,
|
|
517
|
-
/**
|
|
518
|
-
* Object to pass custom style to the Tooltip arrow bottom ::before
|
|
519
|
-
*/
|
|
520
|
-
customStylesTPAbottomBefore: PropTypes.object,
|
|
521
|
-
/**
|
|
522
|
-
* Object to pass custom style to the Tooltip arrow bottom ::after
|
|
523
|
-
*/
|
|
524
|
-
customStylesTPAbottomAfter: PropTypes.object,
|
|
525
|
-
/**
|
|
526
|
-
* Object to pass custom style to the Tooltip arrow top
|
|
527
|
-
*/
|
|
528
|
-
customStylesTPAtop: PropTypes.object,
|
|
529
|
-
/**
|
|
530
|
-
* Object to pass custom style to the Tooltip arrow top ::before
|
|
531
|
-
*/
|
|
532
|
-
customStylesTPAtopBefore: PropTypes.object,
|
|
533
|
-
/**
|
|
534
|
-
* Object to pass custom style to the Tooltip arrow top ::after
|
|
535
|
-
*/
|
|
536
|
-
customStylesTPAtopAfter: PropTypes.object,
|
|
537
|
-
/**
|
|
538
|
-
* Object to pass custom style to the Tooltip arrow right
|
|
539
|
-
*/
|
|
540
|
-
customStylesTPAright: PropTypes.object,
|
|
541
|
-
/**
|
|
542
|
-
* Object to pass custom style to the Tooltip arrow right ::before
|
|
543
|
-
*/
|
|
544
|
-
customStylesTPArightBefore: PropTypes.object,
|
|
545
|
-
/**
|
|
546
|
-
* Object to pass custom style to the Tooltip arrow right ::after
|
|
547
|
-
*/
|
|
548
|
-
customStylesTPArightAfter: PropTypes.object,
|
|
549
|
-
/**
|
|
550
|
-
* Object to pass custom style to the Tooltip arrow left
|
|
551
|
-
*/
|
|
552
|
-
customStylesTPAleft: PropTypes.object,
|
|
553
|
-
/**
|
|
554
|
-
* Object to pass custom style to the Tooltip arrow left ::before
|
|
555
|
-
*/
|
|
556
|
-
customStylesTPAleftBefore: PropTypes.object,
|
|
557
|
-
/**
|
|
558
|
-
* Object to pass custom style to the Tooltip arrow left ::after
|
|
559
|
-
*/
|
|
560
|
-
customStylesTPAleftAfter: PropTypes.object,
|
|
561
|
-
/**
|
|
562
|
-
* Object to pass custom style to the Tooltip arrow
|
|
563
|
-
*/
|
|
564
|
-
customStylesTPArrow: PropTypes.object,
|
|
565
|
-
/**
|
|
566
|
-
* Object to pass custom style to the Tooltip arrow ::before
|
|
567
|
-
*/
|
|
568
|
-
customStylesTPAbefore: PropTypes.object,
|
|
569
|
-
/**
|
|
570
|
-
* Object to pass custom style to the Tooltip arrow ::after
|
|
571
|
-
*/
|
|
572
|
-
customStylesTPAafter: PropTypes.object,
|
|
573
|
-
};
|
|
574
|
-
|
|
575
|
-
Tooltip.defaultProps = {
|
|
576
|
-
contentTrigger: <div>Trigger</div>,
|
|
577
|
-
headerTooltip: 'Lovely tooltip title',
|
|
578
|
-
contentTooltip: '',
|
|
579
|
-
footerTooltip: '',
|
|
580
|
-
customStylesTPContainer: { border: 'none' },
|
|
581
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Tooltip';
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled, { useTheme } from 'styled-components';
|
|
4
|
-
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
-
import FontStyles from '../global/FontStyle';
|
|
6
|
-
|
|
7
|
-
const sizes = {
|
|
8
|
-
xs: {
|
|
9
|
-
fontSize: '12px',
|
|
10
|
-
lineHeight: '120%'
|
|
11
|
-
},
|
|
12
|
-
sm: {
|
|
13
|
-
fontSize: '14px',
|
|
14
|
-
lineHeight: '120%'
|
|
15
|
-
},
|
|
16
|
-
md: {
|
|
17
|
-
fontSize: '16px',
|
|
18
|
-
lineHeight: '140%'
|
|
19
|
-
},
|
|
20
|
-
lg: {
|
|
21
|
-
fontSize: '18px',
|
|
22
|
-
lineHeight: '120%'
|
|
23
|
-
},
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const Box = styled.div`
|
|
27
|
-
color: ${({ theme, text }) => text ? theme.variant[text] : theme.textColor};
|
|
28
|
-
// background: ${({ theme, bg }) => bg ? theme.variant[bg] : theme.bgColor};
|
|
29
|
-
font-size: ${({ size }) => sizes[size].fontSize};
|
|
30
|
-
line-height: ${({ size }) => sizes[size].lineHeight};
|
|
31
|
-
`
|
|
32
|
-
|
|
33
|
-
export const Typography = ({ size, children, bg, text, ...props }) => {
|
|
34
|
-
const activeTheme = useTheme() || defaultThemeColor
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<Box
|
|
38
|
-
theme={activeTheme}
|
|
39
|
-
bg={bg}
|
|
40
|
-
text={text}
|
|
41
|
-
size={size}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
<FontStyles theme={activeTheme} />
|
|
45
|
-
{children}
|
|
46
|
-
</Box>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
Typography.propTypes = {
|
|
51
|
-
/**
|
|
52
|
-
* How large should the font be?
|
|
53
|
-
*/
|
|
54
|
-
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
|
|
55
|
-
/**
|
|
56
|
-
* Text Color variant. primary-1, 2, etc.
|
|
57
|
-
*/
|
|
58
|
-
text: PropTypes.string,
|
|
59
|
-
/**
|
|
60
|
-
* Background Color variant. primary-1, 2, etc.
|
|
61
|
-
*/
|
|
62
|
-
bg: PropTypes.string,
|
|
63
|
-
/**
|
|
64
|
-
* Typography contents
|
|
65
|
-
*/
|
|
66
|
-
children: PropTypes.any,
|
|
67
|
-
/**
|
|
68
|
-
* Theme object
|
|
69
|
-
*/
|
|
70
|
-
theme: PropTypes.object,
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Typography.defaultProps = {
|
|
76
|
-
size: 'md',
|
|
77
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export const primaryColor = {
|
|
3
|
-
"primary-1": "#2E56F4",
|
|
4
|
-
"primary-2": "#081348",
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const uiColor = {
|
|
8
|
-
"error": "#DD0000",
|
|
9
|
-
"success": "#00B904 ",
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const neutralColor = {
|
|
13
|
-
"neutral-1": "#39424D",
|
|
14
|
-
"neutral-2": "#929EAC",
|
|
15
|
-
"neutral-3": "#BBC4CF",
|
|
16
|
-
"neutral-4": "#E2E6F5",
|
|
17
|
-
"neutral-5": "#F0F3F8",
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const shadeColor = {
|
|
21
|
-
"insight-purple": "#F8F2FF",
|
|
22
|
-
"insight-yellow": "#FFFAF2",
|
|
23
|
-
"error-bg": "#FCF2F2",
|
|
24
|
-
"selection-bg": "#F2F4FE",
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const graphColor = {
|
|
28
|
-
"graph-1": "#2E56F4",
|
|
29
|
-
"graph-2": "#00D7F7",
|
|
30
|
-
"graph-3": "#8B2DFF",
|
|
31
|
-
"graph-4": "#FB9A00",
|
|
32
|
-
"graph-5": "#00B904",
|
|
33
|
-
}
|