groundfloor-react-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/assets/fonts/Averta/Averta-Black.woff2 +0 -0
- package/assets/fonts/Averta/Averta-BlackItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Bold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-BoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraBold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraBoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraThin.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraThinItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Light.woff2 +0 -0
- package/assets/fonts/Averta/Averta-LightItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Regular.woff2 +0 -0
- package/assets/fonts/Averta/Averta-RegularItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-SemiBold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-SemiBoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Thin.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ThinItalic.woff2 +0 -0
- package/assets/fonts/Beauty/BeautyDemo.woff +0 -0
- package/assets/icons/app-logo.svg +3 -0
- package/assets/icons/arrow-down.svg +3 -0
- package/assets/icons/arrow-rotate.svg +1 -0
- package/assets/icons/arrow-up.svg +3 -0
- package/assets/icons/bell.svg +3 -0
- package/assets/icons/check.svg +3 -0
- package/assets/icons/checkmark.svg +3 -0
- package/assets/icons/chevron-down.svg +3 -0
- package/assets/icons/chevron-left.svg +3 -0
- package/assets/icons/chevron-right.svg +3 -0
- package/assets/icons/cloud-icon.svg +3 -0
- package/assets/icons/connection.svg +3 -0
- package/assets/icons/cross-icon.svg +3 -0
- package/assets/icons/door-internal-active.svg +1 -0
- package/assets/icons/edit-icon.svg +3 -0
- package/assets/icons/ellipses-horizontal.svg +3 -0
- package/assets/icons/ellipses.svg +3 -0
- package/assets/icons/email.svg +3 -0
- package/assets/icons/eye-hide-view.svg +1 -0
- package/assets/icons/eye-hide.svg +1 -0
- package/assets/icons/file-attach-white.svg +3 -0
- package/assets/icons/file-attach.svg +3 -0
- package/assets/icons/functional-equation-regular.svg +147 -0
- package/assets/icons/hamburger-menu.svg +3 -0
- package/assets/icons/heart.svg +18 -0
- package/assets/icons/image.svg +3 -0
- package/assets/icons/info.svg +3 -0
- package/assets/icons/jpg-icon.svg +3 -0
- package/assets/icons/magnifier.svg +3 -0
- package/assets/icons/menu-ellipse-two.svg +1 -0
- package/assets/icons/menu-ellipse.svg +53 -0
- package/assets/icons/pause-all.svg +1 -0
- package/assets/icons/pdf-icon.svg +3 -0
- package/assets/icons/pen-icon.svg +3 -0
- package/assets/icons/plus-outlined.svg +3 -0
- package/assets/icons/resume.svg +1 -0
- package/assets/icons/sign-icon.svg +3 -0
- package/assets/icons/star.svg +3 -0
- package/assets/icons/trash-icon.svg +59 -0
- package/assets/icons/triangle-down.svg +3 -0
- package/assets/icons/users.svg +11 -0
- package/assets/icons/view.svg +3 -0
- package/assets/icons/watcher.svg +3 -0
- package/assets/icons/zoom-in-white.svg +1 -0
- package/assets/styles/global.css +0 -0
- package/assets/styles/global.scss +0 -0
- package/components/Accordion/Accordion.js +114 -0
- package/components/Accordion/AccordionSB.js +168 -0
- package/components/Accordion/AccordionSBfooter.js +171 -0
- package/components/Accordion/index.js +4 -0
- package/components/ArrowBar/ArrowBar.js +293 -0
- package/components/ArrowBar/index.js +2 -0
- package/components/Avatar/Avatar.js +167 -0
- package/components/Avatar/AvatarSB.js +226 -0
- package/components/Avatar/AvatarSBfooter.js +226 -0
- package/components/Avatar/index.js +4 -0
- package/components/Banner/Banner.js +65 -0
- package/components/Banner/index.js +2 -0
- package/components/Breadcrumb/Breadcrumb.js +192 -0
- package/components/Breadcrumb/index.js +2 -0
- package/components/Button/PrimaryButton.js +125 -0
- package/components/Button/SecondaryButton.js +114 -0
- package/components/Button/TinyButton.js +94 -0
- package/components/Button/index.js +6 -0
- package/components/Cards/Card.js +48 -0
- package/components/Cards/CardRef.js +64 -0
- package/components/Cards/DocumentCard.js +221 -0
- package/components/Cards/index.js +5 -0
- package/components/Content/Content.js +51 -0
- package/components/Content/index.js +1 -0
- package/components/Divider/Divider.js +63 -0
- package/components/Divider/index.js +2 -0
- package/components/Drawer/Drawer.js +93 -0
- package/components/Drawer/index.js +2 -0
- package/components/ErrorBoundary/ErrorBoundary.js +44 -0
- package/components/ErrorBoundary/index.js +1 -0
- package/components/FilterChip/FilterChip.js +68 -0
- package/components/FilterChip/index.js +1 -0
- package/components/Footer/Footer.js +58 -0
- package/components/Footer/FooterContentLev3.js +96 -0
- package/components/Footer/index.js +2 -0
- package/components/Form/FormComponent.js +273 -0
- package/components/Form/HeaderComponent.js +39 -0
- package/components/Form/StyledComponent.js +323 -0
- package/components/Form/SubmitComponent.js +63 -0
- package/components/Form/index.js +4 -0
- package/components/GroupAvatars/GroupAvatars.js +143 -0
- package/components/GroupAvatars/index.js +1 -0
- package/components/GroupButtons/ButtonPopup.js +192 -0
- package/components/GroupButtons/GroupButtons.js +150 -0
- package/components/GroupButtons/GroupButtonsPopup.js +169 -0
- package/components/GroupButtons/index.js +3 -0
- package/components/GroupStatusCircle/GroupStatusCircle.js +135 -0
- package/components/GroupStatusCircle/index.js +1 -0
- package/components/Header/Header.js +58 -0
- package/components/Header/index.js +1 -0
- package/components/HyperLink/HyperLink.js +114 -0
- package/components/HyperLink/index.js +1 -0
- package/components/Icon/Icon.js +161 -0
- package/components/Icon/index.js +1 -0
- package/components/Images/Image.js +112 -0
- package/components/Images/index.js +2 -0
- package/components/Inputs/CheckBoxEditableInput.js +352 -0
- package/components/Inputs/CheckBoxInput.js +195 -0
- package/components/Inputs/CheckBoxInputMS.js +160 -0
- package/components/Inputs/DateSelect.js +411 -0
- package/components/Inputs/DropdownSelect.js +466 -0
- package/components/Inputs/DropzoneInput.js +335 -0
- package/components/Inputs/NumericInput.js +155 -0
- package/components/Inputs/RadioInput.js +205 -0
- package/components/Inputs/SearchInput.js +18 -0
- package/components/Inputs/Signature.js +278 -0
- package/components/Inputs/TextArea.js +196 -0
- package/components/Inputs/TextInput.js +182 -0
- package/components/Inputs/TextInputClicable.js +198 -0
- package/components/Inputs/TextInputClicableMS.js +255 -0
- package/components/Inputs/TimeInput.js +181 -0
- package/components/Inputs/ToggleSwitch.js +123 -0
- package/components/Inputs/index.js +13 -0
- package/components/Label/Label.js +48 -0
- package/components/Label/index.js +1 -0
- package/components/Loaders/Loader.js +179 -0
- package/components/Loaders/index.js +2 -0
- package/components/Modal/Modal.js +116 -0
- package/components/Modal/ModalComp.js +158 -0
- package/components/Modal/index.js +2 -0
- package/components/Overlay/Overlay.js +159 -0
- package/components/Overlay/index.js +1 -0
- package/components/Pagination/Pagination.js +83 -0
- package/components/Pagination/index.js +1 -0
- package/components/ProgressBar/ProgressBar.js +84 -0
- package/components/ProgressBar/index.js +1 -0
- package/components/ProgressSteps/ProgressSteps.js +121 -0
- package/components/ProgressSteps/index.js +1 -0
- package/components/Rating/Rating.js +264 -0
- package/components/Rating/index.js +1 -0
- package/components/SecondaryLink/DarkSecondaryLink.js +97 -0
- package/components/SecondaryLink/LightSecondaryLink.js +93 -0
- package/components/SecondaryLink/index.js +3 -0
- package/components/Sidebar/Navbar.js +328 -0
- package/components/Sidebar/Sidebar.js +180 -0
- package/components/Sidebar/index.js +3 -0
- package/components/StatusChip/PrimaryStatusChip.js +78 -0
- package/components/StatusChip/SecondaryStatusChip.js +78 -0
- package/components/StatusChip/SlimPrimaryStatusChip.js +92 -0
- package/components/StatusChip/SlimSecondaryStatusChip.js +93 -0
- package/components/StatusChip/index.js +6 -0
- package/components/StatusCircle/StatusCircle.js +64 -0
- package/components/StatusCircle/index.js +1 -0
- package/components/Tables/Table.js +156 -0
- package/components/Tables/index.js +1 -0
- package/components/Tooltip/Tooltip.js +479 -0
- package/components/Tooltip/index.js +1 -0
- package/components/Typography/Typography.js +78 -0
- package/components/Typography/index.js +2 -0
- package/components/constants/colors.js +33 -0
- package/components/constants/defaultStyle.js +781 -0
- package/components/constants/defaultThemeColor.js +15 -0
- package/components/constants/index.js +7 -0
- package/components/constants/utils.js +31 -0
- package/components/global/FontStyle.js +131 -0
- package/components/global/index.js +1 -0
- package/dist/index.es.js +2302 -0
- package/dist/index.js +2302 -0
- package/index.js +40 -0
- package/package.json +67 -0
- package/rollup.config.js +53 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/* eslint-disable no-unused-expressions */
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
|
|
4
|
+
export const PageContent = styled.div`
|
|
5
|
+
width: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
min-height: calc(100vh - 130px);
|
|
10
|
+
|
|
11
|
+
button:hover,
|
|
12
|
+
button:active,
|
|
13
|
+
button:focus {
|
|
14
|
+
outline: none;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export const StyledRowSearch = styled.div`
|
|
19
|
+
position: relative;
|
|
20
|
+
display: flex;
|
|
21
|
+
width: 100%;
|
|
22
|
+
padding: 25px;
|
|
23
|
+
column-gap: 18px;
|
|
24
|
+
align-items: flex-start;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
background: linear-gradient(
|
|
27
|
+
0deg,
|
|
28
|
+
hsla(0, 0%, 100%, 1) 20%,
|
|
29
|
+
hsla(0, 0%, 100%, 0.5) 100%
|
|
30
|
+
);
|
|
31
|
+
border-radius: 6px;
|
|
32
|
+
|
|
33
|
+
@media (max-width: 900px) {
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
height: fit-content;
|
|
36
|
+
padding-bottom: 25.5px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (max-width: 800px) {
|
|
40
|
+
flex-wrap: nowrap;
|
|
41
|
+
padding-bottom: 25.5px;
|
|
42
|
+
align-items: stretch;
|
|
43
|
+
|
|
44
|
+
& > div:nth-child(2) {
|
|
45
|
+
margin-top: 26px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
& > span {
|
|
49
|
+
margin-top: 26px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
& > * {
|
|
53
|
+
flex-basis: unset;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@media (max-width: 650px) {
|
|
58
|
+
padding-top: 35px;
|
|
59
|
+
padding-right: 39px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
& label {
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
// padding-bottom: 10px;
|
|
65
|
+
margin-bottom: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
& first-child {
|
|
69
|
+
&::placeholder {
|
|
70
|
+
color: #a9b1b8;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.single-select {
|
|
75
|
+
flex-basis: 177px;
|
|
76
|
+
|
|
77
|
+
@media (max-width: 800px) {
|
|
78
|
+
flex-basis: unset;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.selection-side {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
position: absolute;
|
|
86
|
+
right: 39px;
|
|
87
|
+
top: 25.5px;
|
|
88
|
+
|
|
89
|
+
svg {
|
|
90
|
+
fill: ${({ defaultThemeColor }) =>
|
|
91
|
+
defaultThemeColor.variant["primary-2"]};
|
|
92
|
+
|
|
93
|
+
path {
|
|
94
|
+
fill: ${({ defaultThemeColor }) =>
|
|
95
|
+
defaultThemeColor.variant["primary-2"]};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@media (max-width: 800px) {
|
|
100
|
+
margin-right: 0;
|
|
101
|
+
margin-top: 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
|
|
106
|
+
export const StyledClearSearch = styled.span`
|
|
107
|
+
color: #2e56f4;
|
|
108
|
+
font-style: normal;
|
|
109
|
+
font-weight: normal;
|
|
110
|
+
font-size: 14px;
|
|
111
|
+
line-height: 17px;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
margin-top: 37px;
|
|
114
|
+
margin-right: 65px;
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
export const StyledCentralBar = styled.div`
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
flex-grow: 1;
|
|
122
|
+
max-width: 1340px;
|
|
123
|
+
width: 100%;
|
|
124
|
+
align-items: center;
|
|
125
|
+
`;
|
|
126
|
+
export const StyledWarning = styled.div`
|
|
127
|
+
position: absolute;
|
|
128
|
+
font-size: 12px;
|
|
129
|
+
border-radius: 50%;
|
|
130
|
+
right: 0;
|
|
131
|
+
background-color: red;
|
|
132
|
+
min-width: 20px;
|
|
133
|
+
min-height: 20px;
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
justify-content: center;
|
|
137
|
+
width: 4ch;
|
|
138
|
+
height: 4ch;
|
|
139
|
+
padding: 0px;
|
|
140
|
+
transform: translate(30%, -30%);
|
|
141
|
+
color: white;
|
|
142
|
+
font-weight: 600;
|
|
143
|
+
`;
|
|
144
|
+
|
|
145
|
+
export const StyledCreateRow = styled.div`
|
|
146
|
+
width: 90%;
|
|
147
|
+
`;
|
|
148
|
+
|
|
149
|
+
export const StyledRow = styled.div`
|
|
150
|
+
background: linear-gradient(
|
|
151
|
+
0deg,
|
|
152
|
+
hsla(0, 0%, 100%, 1) 20%,
|
|
153
|
+
hsla(0, 0%, 100%, 0.5) 100%
|
|
154
|
+
);
|
|
155
|
+
width: 90%;
|
|
156
|
+
`;
|
|
157
|
+
|
|
158
|
+
export const StyledSearchRow = styled.div`
|
|
159
|
+
width: 90%;
|
|
160
|
+
`;
|
|
161
|
+
|
|
162
|
+
export const ActionContainer = styled.div`
|
|
163
|
+
display: flex;
|
|
164
|
+
margin-left: auto !important;
|
|
165
|
+
margin-right: auto !important;
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
`;
|
|
168
|
+
|
|
169
|
+
export const OverlayOptionContainer = styled.div`
|
|
170
|
+
display: flex;
|
|
171
|
+
flex-direction: column;
|
|
172
|
+
width: 180px;
|
|
173
|
+
background: #ffffff;
|
|
174
|
+
box-shadow: 0px 5px 37px rgba(56, 66, 100, 0.15);
|
|
175
|
+
border-radius: 6px;
|
|
176
|
+
margin-right: 0.5rem;
|
|
177
|
+
z-index: 999;
|
|
178
|
+
`;
|
|
179
|
+
|
|
180
|
+
export const OverlayOptionItemLabel = styled.div`
|
|
181
|
+
margin: 10.5px 13px;
|
|
182
|
+
padding: 0;
|
|
183
|
+
`;
|
|
184
|
+
|
|
185
|
+
export const ActionItem = styled.div`
|
|
186
|
+
color: #081348;
|
|
187
|
+
padding: 7.7px 6.5px 7.7px 24px;
|
|
188
|
+
margin: 2.5px 13px;
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
font-size: 12px;
|
|
191
|
+
line-height: 15px;
|
|
192
|
+
|
|
193
|
+
&:last-child {
|
|
194
|
+
margin-bottom: 1rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
position: relative;
|
|
198
|
+
|
|
199
|
+
&:hover {
|
|
200
|
+
background: #eaeefe;
|
|
201
|
+
border-radius: 5px;
|
|
202
|
+
}
|
|
203
|
+
`;
|
|
204
|
+
|
|
205
|
+
export const FormContainer = styled.div`
|
|
206
|
+
position: relative;
|
|
207
|
+
padding: 25px;
|
|
208
|
+
z-index: 2;
|
|
209
|
+
display: flex;
|
|
210
|
+
width: 100%;
|
|
211
|
+
column-gap: 18px;
|
|
212
|
+
align-items: center;
|
|
213
|
+
box-sizing: border-box;
|
|
214
|
+
background: linear-gradient(
|
|
215
|
+
0deg,
|
|
216
|
+
hsla(0, 0%, 100%, 1) 20%,
|
|
217
|
+
hsla(0, 0%, 100%, 0.5) 100%
|
|
218
|
+
);
|
|
219
|
+
border-radius: 6px;
|
|
220
|
+
// margin-bottom: 25px;
|
|
221
|
+
|
|
222
|
+
@media (max-width: 900px) {
|
|
223
|
+
flex-wrap: wrap;
|
|
224
|
+
height: fit-content;
|
|
225
|
+
padding-bottom: 25.5px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
@media (max-width: 800px) {
|
|
229
|
+
flex-direction: column;
|
|
230
|
+
flex-wrap: nowrap;
|
|
231
|
+
padding-bottom: 25.5px;
|
|
232
|
+
align-items: stretch;
|
|
233
|
+
|
|
234
|
+
& > div:nth-child(2) {
|
|
235
|
+
margin-top: 26px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
& > span {
|
|
239
|
+
margin-top: 26px;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
& > * {
|
|
243
|
+
flex-basis: unset;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@media (max-width: 650px) {
|
|
248
|
+
padding-top: 35px;
|
|
249
|
+
padding-right: 39px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
& label {
|
|
253
|
+
font-size: 14px;
|
|
254
|
+
// padding-bottom: 10px;
|
|
255
|
+
margin-bottom: 0;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
& first-child {
|
|
259
|
+
&::placeholder {
|
|
260
|
+
color: #a9b1b8;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.single-select {
|
|
265
|
+
flex-basis: 177px;
|
|
266
|
+
|
|
267
|
+
@media (max-width: 800px) {
|
|
268
|
+
flex-basis: unset;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.selection-side {
|
|
273
|
+
display: flex;
|
|
274
|
+
align-items: center;
|
|
275
|
+
position: absolute;
|
|
276
|
+
right: 39px;
|
|
277
|
+
top: 25.5px;
|
|
278
|
+
|
|
279
|
+
svg {
|
|
280
|
+
fill: ${({ defaultThemeColor }) =>
|
|
281
|
+
defaultThemeColor.variant["primary-2"]};
|
|
282
|
+
|
|
283
|
+
path {
|
|
284
|
+
fill: ${({ defaultThemeColor }) =>
|
|
285
|
+
defaultThemeColor.variant["primary-2"]};
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@media (max-width: 800px) {
|
|
290
|
+
margin-right: 0;
|
|
291
|
+
margin-top: 0;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
`;
|
|
295
|
+
|
|
296
|
+
export const FormWrapper = styled.form`
|
|
297
|
+
width: 100%;
|
|
298
|
+
display: flex;
|
|
299
|
+
justify-content: center;
|
|
300
|
+
flex-direction: column;
|
|
301
|
+
gap: 20px;
|
|
302
|
+
`;
|
|
303
|
+
|
|
304
|
+
export const SubmitButtonContainer = styled.div`
|
|
305
|
+
display: flex;
|
|
306
|
+
justify-content: center;
|
|
307
|
+
|
|
308
|
+
// custom styles
|
|
309
|
+
${({ style }) => style}
|
|
310
|
+
`;
|
|
311
|
+
|
|
312
|
+
export const MultiColumnWrapper = styled.div`
|
|
313
|
+
display: flex;
|
|
314
|
+
justify-content: center;
|
|
315
|
+
flex-direction: row;
|
|
316
|
+
{/*align-items: center;*/}
|
|
317
|
+
gap: 20px;
|
|
318
|
+
`;
|
|
319
|
+
|
|
320
|
+
export const MultiColumnDiv = styled.div`
|
|
321
|
+
width:50%;
|
|
322
|
+
width: ${({ cols }) => { Math.floor(100 / cols) + '%' }};
|
|
323
|
+
`;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { Fragment, useState } from 'react'
|
|
2
|
+
import { PrimaryButton, SecondaryButton } from '../Button';
|
|
3
|
+
import { SubmitButtonContainer } from './StyledComponent';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export const SubmitComponent = ({ formData, onSubmit, onReset, style, ...props }) => {
|
|
7
|
+
|
|
8
|
+
const SubmitInput = (item) => {
|
|
9
|
+
return (
|
|
10
|
+
<PrimaryButton
|
|
11
|
+
block={item.block}
|
|
12
|
+
style={item.style}
|
|
13
|
+
disabled={item.disabled}
|
|
14
|
+
type="submit"
|
|
15
|
+
children={item.children}
|
|
16
|
+
onClick={() => { item.onClick() }} />
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const ResetInput = (item) => {
|
|
21
|
+
return (
|
|
22
|
+
<SecondaryButton
|
|
23
|
+
block={item.block}
|
|
24
|
+
disabled={props.disabled}
|
|
25
|
+
children={item.children}
|
|
26
|
+
onClick={() => { item.onClick() }} />
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const CancelInput = (item) => {
|
|
31
|
+
return (
|
|
32
|
+
<SecondaryButton
|
|
33
|
+
block={item.block}
|
|
34
|
+
disabled={props.disabled}
|
|
35
|
+
children={item.children}
|
|
36
|
+
onClick={() => { item.onClick() }} />
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const submitComponent = (item) => {
|
|
41
|
+
switch (item.type) {
|
|
42
|
+
case 'submit':
|
|
43
|
+
return SubmitInput(item)
|
|
44
|
+
case 'reset':
|
|
45
|
+
return ResetInput(item)
|
|
46
|
+
case 'cancel':
|
|
47
|
+
return CancelInput(item)
|
|
48
|
+
default:
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return <Fragment>
|
|
53
|
+
<SubmitButtonContainer style={style}>
|
|
54
|
+
{formData && formData.map((row, i) => {
|
|
55
|
+
return row.map((item, i) => {
|
|
56
|
+
return submitComponent(item)
|
|
57
|
+
})
|
|
58
|
+
})}
|
|
59
|
+
</SubmitButtonContainer>
|
|
60
|
+
</Fragment>
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
import { Avatar } from '../Avatar'
|
|
6
|
+
/**
|
|
7
|
+
* Primary UI component for user interaction
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const StyledContainer = styled.span`
|
|
11
|
+
background: transparent;
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
|
|
16
|
+
&>span:not(:first-of-type){
|
|
17
|
+
margin-left: -13px;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
const StyledQty = styled.p`
|
|
22
|
+
color: ${({ theme, variantQty }) => theme.variant[variantQty]};
|
|
23
|
+
margin: 0;
|
|
24
|
+
margin-left: 7px;
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
export const GroupAvatars = ({ items, block, size, variantCircle, variantName, variantQty, flagName, user, colorCircle, colorBorderCircle, ...props }) => {
|
|
29
|
+
const theme = useTheme() || defaultThemeColor;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<StyledContainer block={block} {...props}>
|
|
33
|
+
{items?.map((user, i) => {
|
|
34
|
+
|
|
35
|
+
let customStylesCircle = {}
|
|
36
|
+
let customStylesImage = {}
|
|
37
|
+
|
|
38
|
+
if (colorCircle) {
|
|
39
|
+
customStylesCircle.backgroundColor = `${theme.variant[colorCircle]}`
|
|
40
|
+
} else {
|
|
41
|
+
customStylesCircle.backgroundColor = `${theme.variant[variantCircle]}`
|
|
42
|
+
}
|
|
43
|
+
if (i !== 0) {
|
|
44
|
+
customStylesCircle.border = colorBorderCircle ? `2px solid ${colorBorderCircle}` : `2px solid ${theme.variant[variantCircle]}`
|
|
45
|
+
customStylesImage.border = colorBorderCircle ? `2px solid ${colorBorderCircle}` : `2px solid ${theme.variant[variantCircle]}`
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
//If only one user display its avatar and the name
|
|
50
|
+
(items.length === 1) ? (
|
|
51
|
+
<Avatar
|
|
52
|
+
key={user.id}
|
|
53
|
+
// variantCircle={variantCircle}
|
|
54
|
+
customStylesContainer={{ width: 'auto' }}
|
|
55
|
+
customStylesName={{ color: `${theme.variant[{ variantName }]}` }}
|
|
56
|
+
// block={false}
|
|
57
|
+
size={size}
|
|
58
|
+
toggleName={true}
|
|
59
|
+
user={user}
|
|
60
|
+
customStylesCircle={customStylesCircle}
|
|
61
|
+
customStylesImage={customStylesImage}
|
|
62
|
+
// customStylesCircle={colorCircle ? {backgroundColor: `${theme.variant[colorCircle]}`} : {backgroundColor: `${theme.variant[variantCircle]}`}}
|
|
63
|
+
// colorBorderCircle={i !== 0 ? colorBorderCircle : colorCircle ? colorCircle : variantCircle}
|
|
64
|
+
/>) : (i <= 3) ? (
|
|
65
|
+
//else display just the avatar
|
|
66
|
+
<Avatar
|
|
67
|
+
key={user.id}
|
|
68
|
+
// variantCircle={variantCircle}
|
|
69
|
+
// variantName={variantName}
|
|
70
|
+
customStylesContainer={{ width: 'auto' }}
|
|
71
|
+
customStylesName={{ color: `${theme.variant[{ variantName }]}` }}
|
|
72
|
+
// block={false}
|
|
73
|
+
size={size}
|
|
74
|
+
toggleName={false}
|
|
75
|
+
user={user}
|
|
76
|
+
customStylesCircle={customStylesCircle}
|
|
77
|
+
customStylesImage={customStylesImage}
|
|
78
|
+
// colorCircle={colorCircle}
|
|
79
|
+
// colorBorderCircle={i !== 0 ? colorBorderCircle : colorCircle ? colorCircle : variantCircle}
|
|
80
|
+
/>
|
|
81
|
+
//display only 4 avatars if more than 4 users then just display the quantity
|
|
82
|
+
) : (null)
|
|
83
|
+
)
|
|
84
|
+
})}
|
|
85
|
+
{(items.length - 4) > 0 ? (<StyledQty variantQty={variantQty}>+{items.length - 4}</StyledQty>) : null}
|
|
86
|
+
</StyledContainer>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
GroupAvatars.propTypes = {
|
|
91
|
+
/**
|
|
92
|
+
* Background color of circle base on variant. primary-1, 2, error, etc.
|
|
93
|
+
*/
|
|
94
|
+
variantCircle: PropTypes.string,
|
|
95
|
+
/**
|
|
96
|
+
* Color of the text name base on variant. primary-1, 2, error, etc.
|
|
97
|
+
*/
|
|
98
|
+
variantName: PropTypes.string,
|
|
99
|
+
/**
|
|
100
|
+
* How large should the Avatar be?
|
|
101
|
+
*/
|
|
102
|
+
size: PropTypes.oneOf(['SM', 'MD', 'LG']),
|
|
103
|
+
/**
|
|
104
|
+
* Object with user information. To display the user's picture need a key "url". To display the name need a key "userName"
|
|
105
|
+
*/
|
|
106
|
+
user: PropTypes.object,
|
|
107
|
+
/**
|
|
108
|
+
* Theme object
|
|
109
|
+
*/
|
|
110
|
+
theme: PropTypes.object,
|
|
111
|
+
/**
|
|
112
|
+
* Optional Custom color of the circle
|
|
113
|
+
*/
|
|
114
|
+
colorCircle: PropTypes.string,
|
|
115
|
+
/**
|
|
116
|
+
* Optional Custom color of the border circle (if missing no border displayed)
|
|
117
|
+
*/
|
|
118
|
+
colorBorderCircle: PropTypes.string,
|
|
119
|
+
/**
|
|
120
|
+
* Optional variantQty color of the text for the quantity
|
|
121
|
+
*/
|
|
122
|
+
variantQty: PropTypes.string,
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
StyledQty.defaultProps = {
|
|
126
|
+
theme: defaultThemeColor,
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
GroupAvatars.defaultProps = {
|
|
130
|
+
theme: defaultThemeColor,
|
|
131
|
+
variantCircle: 'primary-1',
|
|
132
|
+
variantName: 'primary-2',
|
|
133
|
+
block: false,
|
|
134
|
+
size: 'MD',
|
|
135
|
+
flagName: false,
|
|
136
|
+
user: {
|
|
137
|
+
userName: "1",
|
|
138
|
+
},
|
|
139
|
+
colorCircle: null,
|
|
140
|
+
colorBorderCircle: "#FFFFFF",
|
|
141
|
+
variantQty: 'primary-1'
|
|
142
|
+
};
|
|
143
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GroupAvatars';
|