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.
Files changed (185) hide show
  1. package/README.md +20 -0
  2. package/assets/fonts/Averta/Averta-Black.woff2 +0 -0
  3. package/assets/fonts/Averta/Averta-BlackItalic.woff2 +0 -0
  4. package/assets/fonts/Averta/Averta-Bold.woff2 +0 -0
  5. package/assets/fonts/Averta/Averta-BoldItalic.woff2 +0 -0
  6. package/assets/fonts/Averta/Averta-ExtraBold.woff2 +0 -0
  7. package/assets/fonts/Averta/Averta-ExtraBoldItalic.woff2 +0 -0
  8. package/assets/fonts/Averta/Averta-ExtraThin.woff2 +0 -0
  9. package/assets/fonts/Averta/Averta-ExtraThinItalic.woff2 +0 -0
  10. package/assets/fonts/Averta/Averta-Light.woff2 +0 -0
  11. package/assets/fonts/Averta/Averta-LightItalic.woff2 +0 -0
  12. package/assets/fonts/Averta/Averta-Regular.woff2 +0 -0
  13. package/assets/fonts/Averta/Averta-RegularItalic.woff2 +0 -0
  14. package/assets/fonts/Averta/Averta-SemiBold.woff2 +0 -0
  15. package/assets/fonts/Averta/Averta-SemiBoldItalic.woff2 +0 -0
  16. package/assets/fonts/Averta/Averta-Thin.woff2 +0 -0
  17. package/assets/fonts/Averta/Averta-ThinItalic.woff2 +0 -0
  18. package/assets/fonts/Beauty/BeautyDemo.woff +0 -0
  19. package/assets/icons/app-logo.svg +3 -0
  20. package/assets/icons/arrow-down.svg +3 -0
  21. package/assets/icons/arrow-rotate.svg +1 -0
  22. package/assets/icons/arrow-up.svg +3 -0
  23. package/assets/icons/bell.svg +3 -0
  24. package/assets/icons/check.svg +3 -0
  25. package/assets/icons/checkmark.svg +3 -0
  26. package/assets/icons/chevron-down.svg +3 -0
  27. package/assets/icons/chevron-left.svg +3 -0
  28. package/assets/icons/chevron-right.svg +3 -0
  29. package/assets/icons/cloud-icon.svg +3 -0
  30. package/assets/icons/connection.svg +3 -0
  31. package/assets/icons/cross-icon.svg +3 -0
  32. package/assets/icons/door-internal-active.svg +1 -0
  33. package/assets/icons/edit-icon.svg +3 -0
  34. package/assets/icons/ellipses-horizontal.svg +3 -0
  35. package/assets/icons/ellipses.svg +3 -0
  36. package/assets/icons/email.svg +3 -0
  37. package/assets/icons/eye-hide-view.svg +1 -0
  38. package/assets/icons/eye-hide.svg +1 -0
  39. package/assets/icons/file-attach-white.svg +3 -0
  40. package/assets/icons/file-attach.svg +3 -0
  41. package/assets/icons/functional-equation-regular.svg +147 -0
  42. package/assets/icons/hamburger-menu.svg +3 -0
  43. package/assets/icons/heart.svg +18 -0
  44. package/assets/icons/image.svg +3 -0
  45. package/assets/icons/info.svg +3 -0
  46. package/assets/icons/jpg-icon.svg +3 -0
  47. package/assets/icons/magnifier.svg +3 -0
  48. package/assets/icons/menu-ellipse-two.svg +1 -0
  49. package/assets/icons/menu-ellipse.svg +53 -0
  50. package/assets/icons/pause-all.svg +1 -0
  51. package/assets/icons/pdf-icon.svg +3 -0
  52. package/assets/icons/pen-icon.svg +3 -0
  53. package/assets/icons/plus-outlined.svg +3 -0
  54. package/assets/icons/resume.svg +1 -0
  55. package/assets/icons/sign-icon.svg +3 -0
  56. package/assets/icons/star.svg +3 -0
  57. package/assets/icons/trash-icon.svg +59 -0
  58. package/assets/icons/triangle-down.svg +3 -0
  59. package/assets/icons/users.svg +11 -0
  60. package/assets/icons/view.svg +3 -0
  61. package/assets/icons/watcher.svg +3 -0
  62. package/assets/icons/zoom-in-white.svg +1 -0
  63. package/assets/styles/global.css +0 -0
  64. package/assets/styles/global.scss +0 -0
  65. package/components/Accordion/Accordion.js +114 -0
  66. package/components/Accordion/AccordionSB.js +168 -0
  67. package/components/Accordion/AccordionSBfooter.js +171 -0
  68. package/components/Accordion/index.js +4 -0
  69. package/components/ArrowBar/ArrowBar.js +293 -0
  70. package/components/ArrowBar/index.js +2 -0
  71. package/components/Avatar/Avatar.js +167 -0
  72. package/components/Avatar/AvatarSB.js +226 -0
  73. package/components/Avatar/AvatarSBfooter.js +226 -0
  74. package/components/Avatar/index.js +4 -0
  75. package/components/Banner/Banner.js +65 -0
  76. package/components/Banner/index.js +2 -0
  77. package/components/Breadcrumb/Breadcrumb.js +192 -0
  78. package/components/Breadcrumb/index.js +2 -0
  79. package/components/Button/PrimaryButton.js +125 -0
  80. package/components/Button/SecondaryButton.js +114 -0
  81. package/components/Button/TinyButton.js +94 -0
  82. package/components/Button/index.js +6 -0
  83. package/components/Cards/Card.js +48 -0
  84. package/components/Cards/CardRef.js +64 -0
  85. package/components/Cards/DocumentCard.js +221 -0
  86. package/components/Cards/index.js +5 -0
  87. package/components/Content/Content.js +51 -0
  88. package/components/Content/index.js +1 -0
  89. package/components/Divider/Divider.js +63 -0
  90. package/components/Divider/index.js +2 -0
  91. package/components/Drawer/Drawer.js +93 -0
  92. package/components/Drawer/index.js +2 -0
  93. package/components/ErrorBoundary/ErrorBoundary.js +44 -0
  94. package/components/ErrorBoundary/index.js +1 -0
  95. package/components/FilterChip/FilterChip.js +68 -0
  96. package/components/FilterChip/index.js +1 -0
  97. package/components/Footer/Footer.js +58 -0
  98. package/components/Footer/FooterContentLev3.js +96 -0
  99. package/components/Footer/index.js +2 -0
  100. package/components/Form/FormComponent.js +273 -0
  101. package/components/Form/HeaderComponent.js +39 -0
  102. package/components/Form/StyledComponent.js +323 -0
  103. package/components/Form/SubmitComponent.js +63 -0
  104. package/components/Form/index.js +4 -0
  105. package/components/GroupAvatars/GroupAvatars.js +143 -0
  106. package/components/GroupAvatars/index.js +1 -0
  107. package/components/GroupButtons/ButtonPopup.js +192 -0
  108. package/components/GroupButtons/GroupButtons.js +150 -0
  109. package/components/GroupButtons/GroupButtonsPopup.js +169 -0
  110. package/components/GroupButtons/index.js +3 -0
  111. package/components/GroupStatusCircle/GroupStatusCircle.js +135 -0
  112. package/components/GroupStatusCircle/index.js +1 -0
  113. package/components/Header/Header.js +58 -0
  114. package/components/Header/index.js +1 -0
  115. package/components/HyperLink/HyperLink.js +114 -0
  116. package/components/HyperLink/index.js +1 -0
  117. package/components/Icon/Icon.js +161 -0
  118. package/components/Icon/index.js +1 -0
  119. package/components/Images/Image.js +112 -0
  120. package/components/Images/index.js +2 -0
  121. package/components/Inputs/CheckBoxEditableInput.js +352 -0
  122. package/components/Inputs/CheckBoxInput.js +195 -0
  123. package/components/Inputs/CheckBoxInputMS.js +160 -0
  124. package/components/Inputs/DateSelect.js +411 -0
  125. package/components/Inputs/DropdownSelect.js +466 -0
  126. package/components/Inputs/DropzoneInput.js +335 -0
  127. package/components/Inputs/NumericInput.js +155 -0
  128. package/components/Inputs/RadioInput.js +205 -0
  129. package/components/Inputs/SearchInput.js +18 -0
  130. package/components/Inputs/Signature.js +278 -0
  131. package/components/Inputs/TextArea.js +196 -0
  132. package/components/Inputs/TextInput.js +182 -0
  133. package/components/Inputs/TextInputClicable.js +198 -0
  134. package/components/Inputs/TextInputClicableMS.js +255 -0
  135. package/components/Inputs/TimeInput.js +181 -0
  136. package/components/Inputs/ToggleSwitch.js +123 -0
  137. package/components/Inputs/index.js +13 -0
  138. package/components/Label/Label.js +48 -0
  139. package/components/Label/index.js +1 -0
  140. package/components/Loaders/Loader.js +179 -0
  141. package/components/Loaders/index.js +2 -0
  142. package/components/Modal/Modal.js +116 -0
  143. package/components/Modal/ModalComp.js +158 -0
  144. package/components/Modal/index.js +2 -0
  145. package/components/Overlay/Overlay.js +159 -0
  146. package/components/Overlay/index.js +1 -0
  147. package/components/Pagination/Pagination.js +83 -0
  148. package/components/Pagination/index.js +1 -0
  149. package/components/ProgressBar/ProgressBar.js +84 -0
  150. package/components/ProgressBar/index.js +1 -0
  151. package/components/ProgressSteps/ProgressSteps.js +121 -0
  152. package/components/ProgressSteps/index.js +1 -0
  153. package/components/Rating/Rating.js +264 -0
  154. package/components/Rating/index.js +1 -0
  155. package/components/SecondaryLink/DarkSecondaryLink.js +97 -0
  156. package/components/SecondaryLink/LightSecondaryLink.js +93 -0
  157. package/components/SecondaryLink/index.js +3 -0
  158. package/components/Sidebar/Navbar.js +328 -0
  159. package/components/Sidebar/Sidebar.js +180 -0
  160. package/components/Sidebar/index.js +3 -0
  161. package/components/StatusChip/PrimaryStatusChip.js +78 -0
  162. package/components/StatusChip/SecondaryStatusChip.js +78 -0
  163. package/components/StatusChip/SlimPrimaryStatusChip.js +92 -0
  164. package/components/StatusChip/SlimSecondaryStatusChip.js +93 -0
  165. package/components/StatusChip/index.js +6 -0
  166. package/components/StatusCircle/StatusCircle.js +64 -0
  167. package/components/StatusCircle/index.js +1 -0
  168. package/components/Tables/Table.js +156 -0
  169. package/components/Tables/index.js +1 -0
  170. package/components/Tooltip/Tooltip.js +479 -0
  171. package/components/Tooltip/index.js +1 -0
  172. package/components/Typography/Typography.js +78 -0
  173. package/components/Typography/index.js +2 -0
  174. package/components/constants/colors.js +33 -0
  175. package/components/constants/defaultStyle.js +781 -0
  176. package/components/constants/defaultThemeColor.js +15 -0
  177. package/components/constants/index.js +7 -0
  178. package/components/constants/utils.js +31 -0
  179. package/components/global/FontStyle.js +131 -0
  180. package/components/global/index.js +1 -0
  181. package/dist/index.es.js +2302 -0
  182. package/dist/index.js +2302 -0
  183. package/index.js +40 -0
  184. package/package.json +67 -0
  185. package/rollup.config.js +53 -0
@@ -0,0 +1,328 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import ReactDom from 'react-dom'
3
+ import PropTypes from 'prop-types';
4
+ import styled, { css } from 'styled-components';
5
+ import defaultStyles from '../constants/defaultStyle';
6
+ import { AvatarSB, AvatarSBfooter } from '../Avatar'
7
+ import { AccordionSB, AccordionSBfooter } from '../Accordion'
8
+ import { Icon } from '../Icon'
9
+
10
+
11
+ const StyledHeader = styled.div`
12
+ min-height: 51px;
13
+ display: flex;
14
+ background-color: #193096;
15
+ align-items: center;
16
+ padding-left: 24.5px;
17
+
18
+ &::hover{
19
+ &>.chevron-navbar{
20
+ background-color: white;
21
+ color: blue;
22
+ cursor: pointer;
23
+ }
24
+ }
25
+ `
26
+
27
+ const StyledBody = styled.div`
28
+ display: flex;
29
+ background-color: transparent;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ width: 100%;
33
+ `
34
+
35
+ const ListElement = styled.div`
36
+ display: flex;
37
+ align-items: center;
38
+ cursor: pointer;
39
+
40
+ &:hover{
41
+ p{
42
+ text-decoration: underline
43
+ }
44
+ }
45
+
46
+ span{
47
+ width: 7px;
48
+ height: 7px;
49
+ border-radius: 50%;
50
+ background-color: white;
51
+ margin-right: 31px;
52
+ }
53
+
54
+ p{
55
+ margin: 8.25px 0;
56
+ }
57
+ `
58
+
59
+ const StyledFooter = styled.div`
60
+ display: flex;
61
+ background-color: transparent;
62
+ flex-direction: column;
63
+ align-items: center;
64
+ width: 100%;
65
+ margin-top: auto;
66
+ `
67
+
68
+ const ListElementFooter = styled.div`
69
+ display: flex;
70
+ align-items: center;
71
+ cursor: pointer;
72
+
73
+ &:hover{
74
+ p{
75
+ text-decoration: underline
76
+ }
77
+ }
78
+
79
+ span{
80
+ width: 7px;
81
+ height: 7px;
82
+ border-radius: 50%;
83
+ background-color: white;
84
+ margin-right: 31px;
85
+ }
86
+
87
+ p{
88
+ margin: 8.25px 0;
89
+ }
90
+ `
91
+
92
+ export const Navbar = ({
93
+ theme,
94
+ headerContent,
95
+ bodyContent,
96
+ footerContent,
97
+ selectedApp,
98
+ setApp,
99
+ toggleSideBarOpen,
100
+ ...props
101
+ }) => {
102
+
103
+ const [accordionOpen, setAccordionOpen] = useState(null);
104
+ const [accordionFooterOpen, setAccordionFooterOpen] = useState(null);
105
+
106
+ function handleClick(index) {
107
+ setAccordionFooterOpen(null)
108
+ setAccordionOpen(index)
109
+ }
110
+
111
+ function handleClickFooter(index) {
112
+ setAccordionOpen(null)
113
+ setAccordionFooterOpen(index)
114
+ }
115
+
116
+ return (
117
+ <div
118
+ onMouseLeave={
119
+ () => {
120
+ setAccordionOpen(null)
121
+ setAccordionFooterOpen(null)
122
+ }
123
+ }
124
+ style={{
125
+ display: 'flex',
126
+ flexDirection: 'column',
127
+ height: '100vh',
128
+ }}
129
+ className={'NavbarDiv'}
130
+ >
131
+ <StyledHeader>
132
+ {headerContent}
133
+ </StyledHeader>
134
+ <StyledBody>
135
+ {bodyContent?.map((app, i) => {
136
+ return (<AccordionSB
137
+ key={app.id}
138
+ index={i}
139
+ handleClick={(index) => { handleClick(index) }}
140
+ isAccordionOpen={i === accordionOpen}
141
+ isSelected={app.userName === selectedApp.lev1}
142
+ customStylesAccordionContainer={{
143
+ padding: '0',
144
+ 'box-shadow': 'none',
145
+ 'border-radius': '0px',
146
+ 'background-color': 'transparent',
147
+ }}
148
+ customStylesAccordionTogggle={{
149
+ padding: '0',
150
+ 'box-shadow': 'none',
151
+ 'border-radius': '0px',
152
+ 'background-color': 'transparent',
153
+ 'padding-left': '16px',
154
+ 'padding-top': '7.5px',
155
+ 'padding-bottom': '7.5px',
156
+ cursor: 'pointer',
157
+ }}
158
+ customStylesAccordionContent={{
159
+ transition: 'height ease 0.2s', //transform ease 95ms',
160
+ overflow: 'hidden',
161
+ padding: '0',
162
+ 'background-color': 'transparent',
163
+ color: 'white',
164
+ position: 'relative',
165
+ 'box-shadow': 'none',
166
+ }}
167
+ contentToggle={
168
+ <AvatarSB
169
+ toggleName={toggleSideBarOpen}//isOpen} //true}
170
+ customStylesName={{
171
+ 'white-space': 'nowrap',
172
+ 'overflow': 'hidden',
173
+ 'text-overflow': 'ellipsis',
174
+ 'color': 'white',
175
+ 'font-weight': app.userName === selectedApp.lev1 ? '600' : '400',
176
+ }}
177
+ customStylesNameHover={{
178
+ 'text-decoration': 'underline',
179
+ }}
180
+ size={'LG'}
181
+ user={app}
182
+ isSelected={app.userName === selectedApp.lev1}
183
+ />
184
+ }
185
+ content={
186
+ <div style={{ margin: '0', padding: '0', paddingLeft: '32px', marginBottom: '18.25px' }}>
187
+ {app.subdirectory?.map((sub, i) => {
188
+ return (
189
+ <ListElement
190
+ key={app.id + sub}
191
+ onClick={() => {
192
+ console.log("Click: ", app.fullName, sub)
193
+ setApp({ lev1: `${app.userName}`, lev2: `${sub}` })
194
+ }}>
195
+ <span style={{ visibility: selectedApp.lev2 === sub ? 'visible' : 'hidden' }}></span>
196
+ <p style={{ marginTop: i === 0 && '0px' }}>{sub}</p>
197
+ </ListElement>
198
+ )
199
+ })}
200
+ </div>
201
+ }
202
+ />)
203
+ })}
204
+ </StyledBody>
205
+ <StyledFooter>
206
+ <AccordionSBfooter
207
+ index={0}
208
+ handleClick={(index) => { handleClickFooter(index) }}
209
+ isAccordionOpen={0 === accordionFooterOpen}
210
+ customStylesAccordionContainer={{
211
+ padding: '0',
212
+ 'box-shadow': 'none',
213
+ 'border-radius': '0px',
214
+ 'background-color': 'transparent',
215
+ }}
216
+ customStylesAccordionTogggle={{
217
+ padding: '0',
218
+ 'box-shadow': 'none',
219
+ 'border-radius': '0px',
220
+ 'background-color': 'transparent',
221
+ 'padding-left': '16px',
222
+ 'padding-top': '7.5px',
223
+ 'padding-bottom': '7.5px',
224
+ cursor: 'pointer',
225
+ }}
226
+ customStylesAccordionContent={{
227
+ transition: 'height ease 0.2s', //transform ease 95ms',
228
+ overflow: 'hidden',
229
+ padding: '0',
230
+ 'background-color': 'transparent',
231
+ color: 'white',
232
+ position: 'relative',
233
+ 'box-shadow': 'none',
234
+ }}
235
+ contentToggle={
236
+ <AvatarSB
237
+ toggleName={toggleSideBarOpen}//isOpen}//} //true}
238
+ customStylesName={{
239
+ 'white-space': 'nowrap',
240
+ 'overflow': 'hidden',
241
+ 'text-overflow': 'ellipsis',
242
+ 'color': 'white',
243
+ 'font-weight': '400',
244
+ }}
245
+ customStylesNameHover={{
246
+ 'text-decoration': 'underline',
247
+ }}
248
+ size={'LG'}
249
+ user={
250
+ {
251
+ fullName: 'My Account',
252
+ userName: 'My Account',
253
+ url: "https://picsum.photos/30"
254
+ }
255
+ }
256
+ />
257
+ }
258
+ content={
259
+ <div style={{ margin: '0', padding: '0', paddingLeft: '32px', marginBottom: '18.25px' }}>
260
+ <ListElementFooter
261
+ onClick={() => {
262
+ }}>
263
+ <p>Change Password</p>
264
+ </ListElementFooter>
265
+ <ListElementFooter
266
+ onClick={() => { }}>
267
+ <p>Sign Out</p>
268
+ </ListElementFooter>
269
+ </div>
270
+ }
271
+ />
272
+ <AccordionSBfooter
273
+ handleClick={() => { }}
274
+ customStylesAccordionContainer={{
275
+ padding: '0',
276
+ 'box-shadow': 'none',
277
+ 'border-radius': '0px',
278
+ 'background-color': 'transparent',
279
+ }}
280
+ customStylesAccordionTogggle={{
281
+ padding: '0',
282
+ 'box-shadow': 'none',
283
+ 'border-radius': '0px',
284
+ 'background-color': 'transparent',
285
+ 'padding-left': '16px',
286
+ 'padding-top': '7.5px',
287
+ 'padding-bottom': '7.5px',
288
+ cursor: 'pointer',
289
+ }}
290
+ customStylesAccordionContent={{
291
+ transition: 'height ease 0.2s', //transform ease 95ms',
292
+ overflow: 'hidden',
293
+ padding: '0',
294
+ 'background-color': 'transparent',
295
+ color: 'white',
296
+ position: 'relative',
297
+ 'box-shadow': 'none',
298
+ }}
299
+ contentToggle={
300
+ <AvatarSBfooter
301
+ toggleName={toggleSideBarOpen}//isOpen} //true}
302
+ customStylesName={{
303
+ 'white-space': 'nowrap',
304
+ 'overflow': 'hidden',
305
+ 'text-overflow': 'ellipsis',
306
+ 'color': 'white',
307
+ 'font-weight': '400',
308
+ }}
309
+ customStylesNameHover={{
310
+ 'text-decoration': 'underline',
311
+ }}
312
+ size={'LG'}
313
+ user={
314
+ {
315
+ fullName: 'Users',
316
+ userName: 'Users',
317
+ }
318
+ }
319
+ value={'+' + footerContent.length}
320
+ />
321
+ }
322
+ disable={true}
323
+ />
324
+ </StyledFooter>
325
+ </div>
326
+ )
327
+ }
328
+
@@ -0,0 +1,180 @@
1
+ import React from "react";
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+ import defaultStyles from '../constants/defaultStyle';
5
+ import getDefaultStyles from '../constants/utils';
6
+
7
+ /**
8
+ * Primary UI component for user interaction
9
+ */
10
+
11
+ const StyledContainer = styled.div`
12
+ ${({ theme, type }) => {
13
+ return getDefaultStyles(theme, 'sidebar-container');
14
+ }}
15
+ ${({ customStylesContainer }) => customStylesContainer}
16
+
17
+ ${({ isOpen, forceOpen, theme, type, customStylesContainerOpen, customStylesContainerClose }) => {
18
+ if (isOpen || forceOpen) {
19
+ return { ...getDefaultStyles(theme, 'sidebar-container-open'), ...customStylesContainerOpen };
20
+ } else {
21
+ return { ...getDefaultStyles(theme, 'sidebar-container-close'), ...customStylesContainerClose };
22
+ }
23
+ }}
24
+
25
+ @media (max-width: 980px) {
26
+ ${({ isOpen, theme, type, customStylesContainerMobileOpen, customStylesContainerMobileClose }) => {
27
+ if (isOpen) {
28
+ return { ...getDefaultStyles(theme, 'sidebar-container-mobile-open'), ...customStylesContainerMobileOpen };
29
+ } else {
30
+ return { ...getDefaultStyles(theme, 'sidebar-container-mobile-close'), ...customStylesContainerMobileClose };
31
+ }
32
+ }}
33
+ }
34
+ `;
35
+
36
+ const StyledPusher = styled.div`
37
+ ${({ theme, type }) => {
38
+ return getDefaultStyles(theme, 'sidebar-pusher');
39
+ }}
40
+ ${({ customStylesPusher }) => customStylesPusher}
41
+
42
+ ${({ forceOpen, theme, type, customStylesPusherOpen, customStylesPusherClose }) => {
43
+ if (forceOpen) {
44
+ return { ...getDefaultStyles(theme, 'sidebar-pusher-open'), ...customStylesPusherOpen };
45
+ } else {
46
+ return { ...getDefaultStyles(theme, 'sidebar-pusher-close'), ...customStylesPusherClose };
47
+ }
48
+ }}
49
+
50
+ @media (max-width: 980px) {
51
+ ${({ theme, type, customStylesPusherMobile }) => {
52
+ return { ...getDefaultStyles(theme, 'sidebar-pusher-mobile'), ...customStylesPusherMobile };
53
+ }
54
+ }}
55
+ }
56
+ `;
57
+
58
+ export const Sidebar = ({
59
+ theme,
60
+ customStylesContainer,
61
+ customStylesContainerOpen,
62
+ customStylesContainerClose,
63
+ customStylesContainerMobileOpen,
64
+ customStylesContainerMobileClose,
65
+ customStylesPusher,
66
+ customStylesPusherOpen,
67
+ customStylesPusherClose,
68
+ customStylesPusherMobile,
69
+ forceOpen,
70
+ forceClose,
71
+ handleSidebar,
72
+ toggleSideBarOpen,
73
+ pinner,
74
+ ...props
75
+ }) => {
76
+
77
+ function handleMouse(flag) {
78
+ // console.log("handleMouse")
79
+ handleSidebar(flag)
80
+ }
81
+
82
+ return (
83
+ <>
84
+ <StyledContainer
85
+ theme={theme}
86
+ customStyles={customStylesContainer}
87
+ type={'sidebarContainer'}
88
+ onMouseEnter={
89
+ () => {
90
+ if (forceOpen) {
91
+ } else {
92
+ handleMouse(true);
93
+ // console.log("onMouseEnter")
94
+ }
95
+ }
96
+ }
97
+ onMouseLeave={
98
+ () => {
99
+ handleMouse(false);
100
+ // console.log("onMouseLeave")
101
+ forceClose();
102
+ }
103
+ }
104
+ forceOpen={forceOpen}
105
+ isOpen={toggleSideBarOpen} //true}
106
+ {...props}>
107
+ <StyledPusher />
108
+ {props.children}
109
+ {pinner}
110
+ </StyledContainer>
111
+ </>
112
+ );
113
+ };
114
+
115
+ Sidebar.propTypes = {
116
+ /**
117
+ * Theme object
118
+ */
119
+ theme: PropTypes.object,
120
+ /**
121
+ * Custom style of container
122
+ */
123
+ customStylesContainer: PropTypes.object,
124
+ /**
125
+ * Custom style of container when open
126
+ */
127
+ customStylesContainerOpen: PropTypes.object,
128
+ /**
129
+ * Custom style of container when close
130
+ */
131
+ customStylesContainerClose: PropTypes.object,
132
+ /**
133
+ * Custom style of container when open in small screen
134
+ */
135
+ customStylesContainerMobileOpen: PropTypes.object,
136
+ /**
137
+ * Custom style of container when close in small screen
138
+ */
139
+ customStylesContainerMobileClose: PropTypes.object,
140
+ /**
141
+ * Custom style of pusher
142
+ */
143
+ customStylesPusher: PropTypes.object,
144
+ /**
145
+ * Custom style of pusher when open
146
+ */
147
+ customStylesPusherOpen: PropTypes.object,
148
+ /**
149
+ * Custom style of pusher when close
150
+ */
151
+ customStylesPusherClose: PropTypes.object,
152
+ /**
153
+ * Custom style of pusher in small screen
154
+ */
155
+ customStylesPusherMobile: PropTypes.object,
156
+ /**
157
+ * Boolean to open the sidebar
158
+ */
159
+ forceOpen: PropTypes.bool,
160
+ /**
161
+ * Function to close the sidebar
162
+ */
163
+ forceClose: PropTypes.func,
164
+ /**
165
+ * Function to toggle the sidebar
166
+ */
167
+ handleSidebar: PropTypes.func,
168
+ /**
169
+ * Boolean to know the sidebar status
170
+ */
171
+ toggleSideBarOpen: PropTypes.bool,
172
+ /**
173
+ * Component to pin the sidebar on large screen
174
+ */
175
+ pinner: PropTypes.any,
176
+ };
177
+
178
+ Sidebar.defaultProps = {
179
+ theme: defaultStyles,
180
+ };
@@ -0,0 +1,3 @@
1
+ export * from './Sidebar';
2
+ export * from './Navbar';
3
+
@@ -0,0 +1,78 @@
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
+
6
+ /**
7
+ * Primary UI component for user interaction
8
+ */
9
+
10
+ const sizes = {
11
+ sm: {
12
+ fontSize: '14px',
13
+ padding: '11px 36px'
14
+ },
15
+ md: {
16
+ fontSize: '16px',
17
+ padding: '10px 24px'
18
+ },
19
+ lg: {
20
+ fontSize: '22px',
21
+ padding: '6px 29px'
22
+ },
23
+ }
24
+
25
+ const StyledStatusChip = styled.div`
26
+ background: ${({ theme, variant }) => theme.variant[variant]};
27
+ color: ${({ theme }) => theme.bgColor};
28
+ padding: ${({ size }) => sizes[size].padding};
29
+ border: 1px solid ${({ theme, variant }) => theme.variant[variant]};
30
+ border-radius: 42px;
31
+ font-size: ${({ size }) => sizes[size].fontSize};
32
+ font-weight: 600;
33
+ display: flex;
34
+ align-items: center;
35
+ width: ${({ block }) => block ? 'auto' : 'fit-content'};
36
+ box-sizing: border-box;
37
+
38
+ `;
39
+
40
+ export const PrimaryStatusChip = ({ block, style, variant, ...props }) => {
41
+ const theme = useTheme() || defaultThemeColor;
42
+ return (
43
+ <StyledStatusChip
44
+ block={block}
45
+ variant={variant}
46
+ style={style}
47
+ {...props}
48
+ >
49
+ {props.children}
50
+ </StyledStatusChip>
51
+ );
52
+ };
53
+
54
+ PrimaryStatusChip.propTypes = {
55
+ /**
56
+ * Color of StatusChip. primary-1, 2, error, etc.
57
+ */
58
+ variant: PropTypes.string,
59
+ /**
60
+ * Width of StatusChip
61
+ */
62
+ block: PropTypes.bool,
63
+ /**
64
+ * Theme object
65
+ */
66
+ theme: PropTypes.object,
67
+ };
68
+
69
+ StyledStatusChip.defaultProps = {
70
+ theme: defaultThemeColor,
71
+ }
72
+
73
+ PrimaryStatusChip.defaultProps = {
74
+ theme: defaultThemeColor,
75
+ variant: 'primary-1',
76
+ block: false,
77
+ };
78
+
@@ -0,0 +1,78 @@
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
+
6
+ /**
7
+ * Primary UI component for user interaction
8
+ */
9
+
10
+ const sizes = {
11
+ sm: {
12
+ fontSize: '14px',
13
+ padding: '11px 36px'
14
+ },
15
+ md: {
16
+ fontSize: '16px',
17
+ padding: '10px 24px'
18
+ },
19
+ lg: {
20
+ fontSize: '22px',
21
+ padding: '6px 29px'
22
+ },
23
+ }
24
+
25
+ const StyledStatusChip = styled.div`
26
+ color: ${({ theme, variant }) => theme.variant[variant]};
27
+ background: ${({ theme }) => theme.bgColor};
28
+ padding: ${({ size }) => sizes[size].padding};
29
+ border: 1px solid ${({ theme, variant }) => theme.variant[variant]};
30
+ border-radius: 42px;
31
+ font-size: ${({ size }) => sizes[size].fontSize};
32
+ font-weight: 600;
33
+ display: flex;
34
+ align-items: center;
35
+ width: ${({ block }) => block ? 'auto' : 'fit-content'};
36
+ box-sizing: border-box;
37
+
38
+ `;
39
+
40
+ export const SecondaryStatusChip = ({ block, style, variant, ...props }) => {
41
+ const theme = useTheme() || defaultThemeColor;
42
+ return (
43
+ <StyledStatusChip
44
+ block={block}
45
+ variant={variant}
46
+ style={style}
47
+ {...props}
48
+ >
49
+ {props.children}
50
+ </StyledStatusChip>
51
+ );
52
+ };
53
+
54
+ SecondaryStatusChip.propTypes = {
55
+ /**
56
+ * Color of StatusChip. primary-1, 2, error, etc.
57
+ */
58
+ variant: PropTypes.string,
59
+ /**
60
+ * Width of StatusChip
61
+ */
62
+ block: PropTypes.bool,
63
+ /**
64
+ * Theme object
65
+ */
66
+ theme: PropTypes.object,
67
+ };
68
+
69
+ StyledStatusChip.defaultProps = {
70
+ theme: defaultThemeColor,
71
+ }
72
+
73
+ SecondaryStatusChip.defaultProps = {
74
+ theme: defaultThemeColor,
75
+ variant: 'primary-1',
76
+ block: false,
77
+ };
78
+