groundfloor-react-ui 1.0.21 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/components/Accordion/Accordion.js +4 -1
  2. package/components/Accordion/AccordionSB.js +4 -0
  3. package/components/Accordion/AccordionSBfooter.js +4 -0
  4. package/components/ArrowBar/ArrowBar.js +1 -1
  5. package/components/Avatar/AvatarSBfooter.js +40 -6
  6. package/components/Breadcrumb/Breadcrumb.js +18 -0
  7. package/components/Button/PrimaryButton.js +8 -0
  8. package/components/Button/SecondaryButton.js +7 -0
  9. package/components/Button/TinyButton.js +8 -2
  10. package/components/DesignComponent/StyledComponent/StyledComponent.js +21 -7
  11. package/components/Form/FormComponent.js +9 -11
  12. package/components/Inputs/CheckBoxInput.js +1 -0
  13. package/components/Inputs/ColorInput.js +144 -0
  14. package/components/Inputs/DropdownSelect.js +57 -13
  15. package/components/Inputs/DropzoneInput.js +7 -0
  16. package/components/Inputs/NumericInput.js +7 -0
  17. package/components/Inputs/PasswordInput.js +21 -5
  18. package/components/Inputs/RadioInput.js +22 -3
  19. package/components/Inputs/SearchInput.js +2 -1
  20. package/components/Inputs/Signature.js +8 -0
  21. package/components/Inputs/TextArea.js +7 -0
  22. package/components/Inputs/TextInput.js +10 -3
  23. package/components/Inputs/TimeInput.js +7 -1
  24. package/components/Inputs/ToggleSwitch.js +6 -0
  25. package/components/Inputs/index.js +10 -9
  26. package/components/Modal/ModalComp.js +1 -1
  27. package/components/Tooltip/Tooltip.js +394 -285
  28. package/components/constants/defaultStyle.js +32 -0
  29. package/dist/index.es.js +1377 -1307
  30. package/dist/index.js +1389 -1319
  31. package/index.js +39 -39
  32. package/package.json +1 -1
@@ -1,292 +1,365 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from "react";
3
3
  import { usePopperTooltip } from 'react-popper-tooltip';
4
- import styled from 'styled-components';
4
+ import styled, { useTheme } from 'styled-components';
5
5
  import defaultStyles from '../constants/defaultStyle';
6
+ import defaultThemeColor from '../constants/defaultThemeColor';
7
+ import getDefaultStyles from '../constants/utils';
6
8
 
7
9
  /**
8
10
  * Primary UI component for user interaction
9
11
  */
10
- const TooltipContainer = styled.div`
11
- ${({ inBuiltCss, type, customStylesTPContainer }) => {
12
- if (inBuiltCss) {
13
- let tempObj = {};
14
- if (inBuiltCss['tooltip-container']) {
15
- for (const property in inBuiltCss['common']) {
16
- tempObj[property] = inBuiltCss['common'][property]
17
- }
18
- for (const property in inBuiltCss['tooltip-container']) {
19
- tempObj[property] = inBuiltCss['tooltip-container'][property]
20
- delete inBuiltCss.common[property]
21
- }
22
- }
23
- return { ...tempObj, ...customStylesTPContainer };
24
- }
25
- }}
26
-
27
- &[data-popper-placement*='bottom'] .tooltip-arrow {
28
- ${({ inBuiltCss, type, customStylesTPAbottom }) => {
29
- if (inBuiltCss) {
30
- let tempObj = {};
31
- if (inBuiltCss['tp-cont-bottom-arrow']) {
32
- for (const property in inBuiltCss['common']) {
33
- tempObj[property] = inBuiltCss['common'][property]
34
- }
35
- for (const property in inBuiltCss['tp-cont-bottom-arrow']) {
36
- tempObj[property] = inBuiltCss['tp-cont-bottom-arrow'][property]
37
- delete inBuiltCss.common[property]
38
- }
39
- }
40
- return { ...tempObj, ...customStylesTPAbottom };
41
- }
42
- }}
43
- }
44
-
45
- &[data-popper-placement*='bottom'] .tooltip-arrow::before {
46
- ${({ inBuiltCss, type, customStylesTPAbottomBefore }) => {
47
- if (inBuiltCss) {
48
- let tempObj = {};
49
- if (inBuiltCss['tp-cont-bottom-arrow-before']) {
50
- for (const property in inBuiltCss['common']) {
51
- tempObj[property] = inBuiltCss['common'][property]
52
- }
53
- for (const property in inBuiltCss['tp-cont-bottom-arrow-before']) {
54
- tempObj[property] = inBuiltCss['tp-cont-bottom-arrow-before'][property]
55
- delete inBuiltCss.common[property]
56
- }
57
- }
58
- return { ...tempObj, ...customStylesTPAbottomBefore };
59
- }
60
- }}
61
- }
62
-
63
- &[data-popper-placement*='bottom'] .tooltip-arrow::after {
64
- ${({ inBuiltCss, type, customStylesTPAbottomAfter }) => {
65
- if (inBuiltCss) {
66
- let tempObj = {};
67
- if (inBuiltCss['tp-cont-bottom-arrow-before']) {
68
- for (const property in inBuiltCss['common']) {
69
- tempObj[property] = inBuiltCss['common'][property]
70
- }
71
- for (const property in inBuiltCss['tp-cont-bottom-arrow-after']) {
72
- tempObj[property] = inBuiltCss['tp-cont-bottom-arrow-after'][property]
73
- delete inBuiltCss.common[property]
74
- }
75
- }
76
- return { ...tempObj, ...customStylesTPAbottomAfter };
77
- }
78
- }}
79
- }
80
- &[data-popper-placement*='top'] .tooltip-arrow {
81
- ${({ inBuiltCss, type, customStylesTPAtop }) => {
82
- if (inBuiltCss) {
83
- let tempObj = {};
84
- if (inBuiltCss['tp-cont-top-arrow']) {
85
- for (const property in inBuiltCss['common']) {
86
- tempObj[property] = inBuiltCss['common'][property]
87
- }
88
- for (const property in inBuiltCss['tp-cont-top-arrow']) {
89
- tempObj[property] = inBuiltCss['tp-cont-top-arrow'][property]
90
- delete inBuiltCss.common[property]
91
- }
92
- }
93
- return { ...tempObj, ...customStylesTPAtop };
94
- }
95
- }}
96
- }
97
- &[data-popper-placement*='top'] .tooltip-arrow::before {
98
- ${({ inBuiltCss, type, customStylesTPAtopBefore }) => {
99
- if (inBuiltCss) {
100
- let tempObj = {};
101
- if (inBuiltCss['tp-cont-top-arrow-before']) {
102
- for (const property in inBuiltCss['common']) {
103
- tempObj[property] = inBuiltCss['common'][property]
104
- }
105
- for (const property in inBuiltCss['tp-cont-top-arrow-before']) {
106
- tempObj[property] = inBuiltCss['tp-cont-top-arrow-before'][property]
107
- delete inBuiltCss.common[property]
108
- }
109
- }
110
- return { ...tempObj, ...customStylesTPAtopBefore };
111
- }
112
- }}
113
- }
114
- &[data-popper-placement*='top'] .tooltip-arrow::after {
115
- ${({ inBuiltCss, type, customStylesTPAtopAfter }) => {
116
- if (inBuiltCss) {
117
- let tempObj = {};
118
- if (inBuiltCss['tp-cont-top-arrow-before']) {
119
- for (const property in inBuiltCss['common']) {
120
- tempObj[property] = inBuiltCss['common'][property]
121
- }
122
- for (const property in inBuiltCss['tp-cont-top-arrow-after']) {
123
- tempObj[property] = inBuiltCss['tp-cont-top-arrow-after'][property]
124
- delete inBuiltCss.common[property]
125
- }
126
- }
127
- return { ...tempObj, ...customStylesTPAtopAfter };
128
- }
129
- }}
130
- }
131
- &[data-popper-placement*='right'] .tooltip-arrow {
132
- ${({ inBuiltCss, type, customStylesTPAright }) => {
133
- if (inBuiltCss) {
134
- let tempObj = {};
135
- if (inBuiltCss['tp-cont-right-arrow']) {
136
- for (const property in inBuiltCss['common']) {
137
- tempObj[property] = inBuiltCss['common'][property]
138
- }
139
- for (const property in inBuiltCss['tp-cont-right-arrow']) {
140
- tempObj[property] = inBuiltCss['tp-cont-right-arrow'][property]
141
- delete inBuiltCss.common[property]
142
- }
143
- }
144
- return { ...tempObj, ...customStylesTPAright };
145
- }
146
- }}
147
- }
148
- &[data-popper-placement*='right'] .tooltip-arrow::before {
149
- ${({ inBuiltCss, type, customStylesTPArightBefore }) => {
150
- if (inBuiltCss) {
151
- let tempObj = {};
152
- if (inBuiltCss['tp-cont-right-arrow-before']) {
153
- for (const property in inBuiltCss['common']) {
154
- tempObj[property] = inBuiltCss['common'][property]
155
- }
156
- for (const property in inBuiltCss['tp-cont-right-arrow-before']) {
157
- tempObj[property] = inBuiltCss['tp-cont-right-arrow-before'][property]
158
- delete inBuiltCss.common[property]
159
- }
160
- }
161
- return { ...tempObj, ...customStylesTPArightBefore };
162
- }
163
- }}
164
- }
165
- &[data-popper-placement*='right'] .tooltip-arrow::after {
166
- ${({ inBuiltCss, type, customStylesTPArightAfter }) => {
167
- if (inBuiltCss) {
168
- let tempObj = {};
169
- if (inBuiltCss['tp-cont-right-arrow-before']) {
170
- for (const property in inBuiltCss['common']) {
171
- tempObj[property] = inBuiltCss['common'][property]
172
- }
173
- for (const property in inBuiltCss['tp-cont-right-arrow-after']) {
174
- tempObj[property] = inBuiltCss['tp-cont-right-arrow-after'][property]
175
- delete inBuiltCss.common[property]
176
- }
177
- }
178
- return { ...tempObj, ...customStylesTPArightAfter };
179
- }
180
- }}
181
- }
182
- &[data-popper-placement*='left'] .tooltip-arrow {
183
- ${({ inBuiltCss, type, customStylesTPAleft }) => {
184
- if (inBuiltCss) {
185
- let tempObj = {};
186
- if (inBuiltCss['tp-cont-left-arrow']) {
187
- for (const property in inBuiltCss['common']) {
188
- tempObj[property] = inBuiltCss['common'][property]
189
- }
190
- for (const property in inBuiltCss['tp-cont-left-arrow']) {
191
- tempObj[property] = inBuiltCss['tp-cont-left-arrow'][property]
192
- delete inBuiltCss.common[property]
193
- }
194
- }
195
- return { ...tempObj, ...customStylesTPAleft };
196
- }
197
- }}
198
- }
199
- &[data-popper-placement*='left'] .tooltip-arrow::before {
200
- ${({ inBuiltCss, type, customStylesTPAleftBefore }) => {
201
- if (inBuiltCss) {
202
- let tempObj = {};
203
- if (inBuiltCss['tp-cont-left-arrow-before']) {
204
- for (const property in inBuiltCss['common']) {
205
- tempObj[property] = inBuiltCss['common'][property]
206
- }
207
- for (const property in inBuiltCss['tp-cont-left-arrow-before']) {
208
- tempObj[property] = inBuiltCss['tp-cont-left-arrow-before'][property]
209
- delete inBuiltCss.common[property]
210
- }
211
- }
212
- return { ...tempObj, ...customStylesTPAleftBefore };
213
- }
214
- }}
215
- }
216
- &[data-popper-placement*='left'] .tooltip-arrow::after {
217
- ${({ inBuiltCss, type, customStylesTPAleftAfter }) => {
218
- if (inBuiltCss) {
219
- let tempObj = {};
220
- if (inBuiltCss['tp-cont-left-arrow-before']) {
221
- for (const property in inBuiltCss['common']) {
222
- tempObj[property] = inBuiltCss['common'][property]
223
- }
224
- for (const property in inBuiltCss['tp-cont-left-arrow-after']) {
225
- tempObj[property] = inBuiltCss['tp-cont-left-arrow-after'][property]
226
- delete inBuiltCss.common[property]
227
- }
228
- }
229
- return { ...tempObj, ...customStylesTPAleftAfter };
230
- }
231
- }}
232
- }
233
- `;
234
-
235
- const TooltipArrow = styled.div`
236
-
237
- ${({ inBuiltCss, type, customStylesTPArrow }) => {
238
- if (inBuiltCss) {
239
- let tempObj = {};
240
- if (inBuiltCss['tooltip-arrow']) {
241
- for (const property in inBuiltCss['common']) {
242
- tempObj[property] = inBuiltCss['common'][property]
243
- }
244
- for (const property in inBuiltCss['tooltip-arrow']) {
245
- tempObj[property] = inBuiltCss['tooltip-arrow'][property]
246
- delete inBuiltCss.common[property]
247
- }
248
- }
249
- return { ...tempObj, ...customStylesTPArrow };
250
- }
251
- }}
252
-
253
-
254
- &::before{
255
- ${({ inBuiltCss, type, customStylesTPAbefore }) => {
256
- if (inBuiltCss) {
257
- let tempObj = {};
258
- if (inBuiltCss['tooltip-arrow-before']) {
259
- for (const property in inBuiltCss['common']) {
260
- tempObj[property] = inBuiltCss['common'][property]
261
- }
262
- for (const property in inBuiltCss['tooltip-arrow-before']) {
263
- tempObj[property] = inBuiltCss['tooltip-arrow-before'][property]
264
- delete inBuiltCss.common[property]
265
- }
266
- }
267
- return { ...tempObj, ...customStylesTPAbefore };
268
- }
269
- }}
270
- }
271
-
272
- &::after{
273
- ${({ inBuiltCss, type, customStylesTPAafter }) => {
274
- if (inBuiltCss) {
275
- let tempObj = {};
276
- if (inBuiltCss['tooltip-arrow-after']) {
277
- for (const property in inBuiltCss['common']) {
278
- tempObj[property] = inBuiltCss['common'][property]
279
- }
280
- for (const property in inBuiltCss['tooltip-arrow-after']) {
281
- tempObj[property] = inBuiltCss['tooltip-arrow-after'][property]
282
- delete inBuiltCss.common[property]
283
- }
284
- }
285
- return { ...tempObj, ...customStylesTPAafter };
286
- }
287
- }}
288
- }
289
- `;
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
+ `
290
363
 
291
364
  export const Tooltip = ({
292
365
  inBuiltCss,
@@ -310,9 +383,17 @@ export const Tooltip = ({
310
383
  customStylesTPArrow,
311
384
  customStylesTPAbefore,
312
385
  customStylesTPAafter,
386
+ customTooltipContentStyle,
387
+ customContentStyle,
388
+ customHeaderStyle,
389
+ customBodyStyle,
390
+ headerTooltip,
391
+ footerTooltip,
313
392
  ...props
314
393
  }) => {
315
394
 
395
+ const activeTheme = useTheme() || defaultThemeColor;
396
+
316
397
  const popperOptions = {
317
398
  modifiers: [
318
399
  {
@@ -346,6 +427,7 @@ export const Tooltip = ({
346
427
  {visible && (
347
428
  <TooltipContainer
348
429
  inBuiltCss={defaultStyles}
430
+ theme={activeTheme}
349
431
  ref={setTooltipRef}
350
432
  {...getTooltipProps({ className: 'tooltip-container' })}
351
433
  customStylesTPContainer={customStylesTPContainer}
@@ -369,7 +451,14 @@ export const Tooltip = ({
369
451
  customStylesTPAbefore={customStylesTPAbefore}
370
452
  customStylesTPAafter={customStylesTPAafter}
371
453
  />
372
- {contentTooltip}
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>
373
462
  </TooltipContainer>
374
463
  )}
375
464
  </>
@@ -383,9 +472,17 @@ Tooltip.propTypes = {
383
472
  */
384
473
  contentTrigger: PropTypes.any,
385
474
  /**
386
- * The element to put inside the tooltip
475
+ * The header element to put inside the tooltip
387
476
  */
388
- contentTooltip: PropTypes.any,
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,
389
486
  /**
390
487
  * Object to customize the behaviour of the tooltip
391
488
  * For more reference see:
@@ -400,6 +497,15 @@ Tooltip.propTypes = {
400
497
  * https://popper.js.org/docs/v2/tutorial/
401
498
  */
402
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
+
403
509
  /**
404
510
  * Object to pass custom style to the Tooltip container
405
511
  */
@@ -468,5 +574,8 @@ Tooltip.propTypes = {
468
574
 
469
575
  Tooltip.defaultProps = {
470
576
  contentTrigger: <div>Trigger</div>,
471
- contentTooltip: <div>I am the tooltip</div>,
577
+ headerTooltip: 'Lovely tooltip title',
578
+ contentTooltip: '',
579
+ footerTooltip: '',
580
+ customStylesTPContainer:{border: 'none'},
472
581
  };