groundfloor-react-ui 1.0.18 → 1.0.21

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 (45) hide show
  1. package/components/Accordion/Accordion.js +83 -33
  2. package/components/Accordion/AccordionSB.js +50 -54
  3. package/components/Accordion/AccordionSBfooter.js +51 -55
  4. package/components/ArrowBar/ArrowBar.js +6 -23
  5. package/components/Avatar/Avatar.js +49 -45
  6. package/components/Avatar/AvatarSB.js +121 -92
  7. package/components/Avatar/AvatarSBfooter.js +113 -92
  8. package/components/Banner/Banner.js +40 -35
  9. package/components/Breadcrumb/Breadcrumb.js +178 -163
  10. package/components/Button/PrimaryButton.js +15 -8
  11. package/components/Button/SecondaryButton.js +11 -9
  12. package/components/Cards/Card.js +25 -30
  13. package/components/Cards/CardRef.js +41 -34
  14. package/components/Cards/DocumentCard.js +83 -89
  15. package/components/Divider/Divider.js +23 -30
  16. package/components/Drawer/Drawer.js +46 -55
  17. package/components/FilterChip/FilterChip.js +34 -32
  18. package/components/Form/HeaderComponent.js +57 -27
  19. package/components/GroupAvatars/GroupAvatars.js +12 -16
  20. package/components/GroupButtons/GroupButtonsPopup.js +3 -9
  21. package/components/Images/Image.js +16 -21
  22. package/components/Inputs/CheckBoxInput.js +71 -33
  23. package/components/Inputs/DateSelect.js +22 -17
  24. package/components/Inputs/DropdownSelect.js +86 -30
  25. package/components/Inputs/DropzoneInput.js +83 -68
  26. package/components/Inputs/NumericInput.js +66 -63
  27. package/components/Inputs/PasswordInput.js +36 -27
  28. package/components/Inputs/RadioInput.js +55 -29
  29. package/components/Inputs/Signature.js +88 -38
  30. package/components/Inputs/TextArea.js +24 -40
  31. package/components/Inputs/TextInput.js +43 -28
  32. package/components/Inputs/TimeInput.js +92 -107
  33. package/components/Inputs/ToggleSwitch.js +87 -59
  34. package/components/Modal/ModalComp.js +61 -37
  35. package/components/Pagination/Pagination.js +30 -54
  36. package/components/ProgressBar/ProgressBar.js +57 -40
  37. package/components/Rating/Rating.js +8 -14
  38. package/components/Sidebar/Navbar.js +196 -170
  39. package/components/Tables/Table.js +56 -34
  40. package/components/Tooltip/Tooltip.js +135 -141
  41. package/components/Typography/Typography.js +9 -10
  42. package/components/constants/defaultStyle.js +38 -41
  43. package/dist/index.es.js +675 -596
  44. package/dist/index.js +660 -581
  45. package/package.json +1 -1
@@ -1,83 +1,59 @@
1
- import React from 'react';
2
1
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
2
+ import React from 'react';
3
+ import styled, { useTheme } from 'styled-components';
4
4
  import defaultThemeColor from '../constants/defaultThemeColor';
5
5
 
6
6
  const StyledPagination = styled.div`
7
- display: flex;
8
- align-items: center;
9
- color: ${({ theme }) => theme.variant['neutral-2']};
7
+ display: flex;
8
+ align-items: center;
9
+ color: ${({ theme }) => theme.variant['neutral-2']};
10
10
  `;
11
11
 
12
- StyledPagination.defaultProps = {
13
- theme: defaultThemeColor,
14
- }
15
-
16
12
  export const Pagination = ({ ...props }) => {
13
+ const activeTheme = useTheme() || defaultThemeColor;
17
14
 
18
15
  return (
19
- <StyledPagination>
20
- {props.children}
21
- </ StyledPagination>
16
+ <StyledPagination theme={activeTheme}>{props.children}</StyledPagination>
22
17
  );
23
18
  };
24
19
 
25
- Pagination.propTypes = {
26
- /**
27
- * Theme props
28
- */
29
- theme: PropTypes.object,
30
- }
31
-
32
- Pagination.defaultProps = {
33
- theme: defaultThemeColor,
34
- }
35
-
36
20
  const Item = styled.div`
37
- font-size: 14px;
38
- color: ${({ selected, theme }) => selected ? theme.variant['primary-1'] : null};
39
-
40
- svg {
41
- width: 14px;
42
- height: 14px;
43
- path {
44
- fill: ${({ selected, theme }) => selected ? theme.variant['primary-1'] : theme.variant['neutral-2']};
45
- }
21
+ font-size: 14px;
22
+ color: ${({ selected, theme }) =>
23
+ selected ? theme.variant['primary-1'] : null};
24
+
25
+ svg {
26
+ width: 14px;
27
+ height: 14px;
28
+ path {
29
+ fill: ${({ selected, theme }) =>
30
+ selected ? theme.variant['primary-1'] : theme.variant['neutral-2']};
46
31
  }
32
+ }
47
33
 
48
- cursor: pointer;
49
- &:not(:first-child):not(:last-child) {
50
- margin: 0 22px;
51
- }
34
+ cursor: pointer;
35
+ &:not(:first-child):not(:last-child) {
36
+ margin: 0 22px;
37
+ }
52
38
  `;
53
39
 
54
- Item.defaultProps = {
55
- theme: defaultThemeColor,
56
- }
57
-
58
40
  Pagination.PageItem = function PageItem({ selected, ...props }) {
41
+ const activeTheme = useTheme() || defaultThemeColor;
42
+
59
43
  return (
60
- <Item selected={selected} {...props}>
44
+ <Item selected={selected} theme={activeTheme} {...props}>
61
45
  {props.children}
62
46
  </Item>
63
- )
64
- }
47
+ );
48
+ };
65
49
 
66
50
  Pagination.PageItem.propTypes = {
67
- /**
68
- * Theme props
69
- */
70
- theme: PropTypes.object,
71
51
  /**
72
52
  * Is Page selected?
73
- */
53
+ */
74
54
  selected: PropTypes.bool,
75
- }
55
+ };
76
56
 
77
57
  Pagination.PageItem.defaultProps = {
78
- theme: defaultThemeColor,
79
58
  selected: false,
80
- }
81
-
82
-
83
-
59
+ };
@@ -1,47 +1,68 @@
1
- import React from "react";
2
1
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
2
+ import React from 'react';
3
+ import styled, { useTheme } from 'styled-components';
4
4
  import defaultStyles from '../constants/defaultStyle';
5
5
  import defaultThemeColor from '../constants/defaultThemeColor';
6
- import getDefaultStyles from '../constants/utils';
6
+ import { hexToRGB } from '../constants/utils';
7
7
  import { Label } from '../Label';
8
- import { hexToRGB } from "../constants/utils";
9
8
 
10
9
  const WrapperDiv = styled.div`
11
- //Set the styles from the default styles object
12
- ${ ({ theme, type }) => {
13
- return getDefaultStyles(theme, type);
14
- }}
15
- background-color: ${({ color }) => color?
16
- hexToRGB(color, 0.5) :
17
- defaultThemeColor.primary['primary-1']};
10
+ height: 10px;
11
+ border-radius: 10px;
12
+ margin-top: 13px;
13
+ margin-left: 13px;
14
+ margin-right: 13px;
15
+ width: inherit;
16
+ background-color: ${({ color, theme }) =>
17
+ color ? hexToRGB(color, 0.5) : hexToRGB(theme.primary['primary-1'], 0.5)};
18
18
  `;
19
19
 
20
20
  const Container = styled.div`
21
- //Set the styles from the default styles object
22
- ${ ({ theme, type }) => {
23
- return getDefaultStyles(theme, type);
24
- }}
25
-
26
- // custom styles
27
- ${({ progressBarStyle }) => progressBarStyle}
28
- width: ${({now }) => now+'%'};
29
- background-color: ${({ color }) => color ?color :defaultThemeColor.primary['primary-1']};
21
+ height: inherit;
22
+ width: inherit;
23
+ transition: width 1s ease-in-out;
24
+ border-radius: inherit;
25
+ text-align: right;
26
+
27
+ // custom styles
28
+ ${({ progressBarStyle }) => progressBarStyle}
29
+ width: ${({ now }) => now + '%'};
30
+ background-color: ${({ color, theme }) =>
31
+ color ? color : theme.primary['primary-1']};
30
32
  `;
31
33
 
32
- export const ProgressBar = ({ labelStyle,progressBarStyle,label,now,color,...props}) => {
34
+ export const ProgressBar = ({
35
+ labelStyle,
36
+ progressBarStyle,
37
+ label,
38
+ now,
39
+ color,
40
+ ...props
41
+ }) => {
42
+ const activeTheme = useTheme() || defaultThemeColor;
43
+
33
44
  return (
34
45
  <div>
35
46
  <Label
36
- theme={defaultStyles}
47
+ inBuiltCss={defaultStyles}
37
48
  customStyles={labelStyle}
38
49
  type={'progressbarLabel'}
39
50
  text={label}
40
- {...props} />
41
- <WrapperDiv progressBarStyle={progressBarStyle} theme={defaultStyles}
42
- type={'progressWrapper'} color={color} {...props}>
43
- <Container progressBarStyle={progressBarStyle} now={now} theme={defaultStyles}
44
- type={'containerWrapper'} color={color} {...props}/>
51
+ {...props}
52
+ />
53
+ <WrapperDiv
54
+ progressBarStyle={progressBarStyle}
55
+ theme={activeTheme}
56
+ color={color}
57
+ {...props}
58
+ >
59
+ <Container
60
+ progressBarStyle={progressBarStyle}
61
+ now={now}
62
+ theme={activeTheme}
63
+ color={color}
64
+ {...props}
65
+ />
45
66
  </WrapperDiv>
46
67
  </div>
47
68
  );
@@ -49,19 +70,19 @@ export const ProgressBar = ({ labelStyle,progressBarStyle,label,now,color,...pro
49
70
 
50
71
  ProgressBar.propTypes = {
51
72
  /**
52
- * Custom style of the lable of the progressbar
73
+ * Custom style of the label of the progressBar
53
74
  */
54
75
  labelStyle: PropTypes.object,
55
76
  /**
56
- * Custom style of the progressbar
77
+ * Custom style of the progressBar
57
78
  */
58
79
  progressBarStyle: PropTypes.object,
59
-
80
+
60
81
  /**
61
- * Custom color(HEX format) of the progressbar
82
+ * Custom color(HEX format) of the progressBar
62
83
  */
63
84
  color: PropTypes.string,
64
-
85
+
65
86
  /**
66
87
  * label props
67
88
  */
@@ -73,12 +94,8 @@ ProgressBar.propTypes = {
73
94
  };
74
95
 
75
96
  ProgressBar.defaultProps = {
76
- labelStyle:{},
97
+ labelStyle: {},
77
98
  progressBarStyle: {},
78
- label:'',
79
- now:0,
80
- color: "#2E56F4"
81
- };
82
-
83
-
84
-
99
+ label: '',
100
+ now: 0,
101
+ };
@@ -1,8 +1,7 @@
1
- import React, { useEffect, useState } from 'react';
2
1
  import PropTypes from 'prop-types';
3
- import styled, { css } from 'styled-components';
4
- import defaultStyles from '../constants/defaultStyle';
5
- import getDefaultStyles from '../constants/utils';
2
+ import React, { useEffect, useState } from 'react';
3
+ import styled, { css, useTheme } from 'styled-components';
4
+ import defaultThemeColor from '../constants/defaultThemeColor';
6
5
 
7
6
  const StyledContainer = styled.div`
8
7
  box-sizing: border-box;
@@ -112,7 +111,6 @@ function getPercentage(value, maxRange) {
112
111
  }
113
112
 
114
113
  export const Rating = ({
115
- theme,
116
114
  type,
117
115
  customStylesContainer,
118
116
  customStylesStar,
@@ -127,6 +125,7 @@ export const Rating = ({
127
125
  toggleSet,
128
126
  identifier,
129
127
  ...props }) => {
128
+ const activeTheme = useTheme() || defaultThemeColor;
130
129
 
131
130
  const [starArr, setStarArr] = useState(undefined);
132
131
  const [starVal, setStarVal] = useState(undefined);
@@ -182,18 +181,15 @@ export const Rating = ({
182
181
  </>
183
182
 
184
183
  return (
185
- <StyledContainer theme={theme} customStyles={customStylesContainer} type={type} size={size} {...props} className={'container'} >
184
+ <StyledContainer customStyles={customStylesContainer} type={type} size={size} {...props} className={'container'} >
186
185
  {toggleStar ? stars :
187
- <StyledPercentage theme={theme} type={type} customStyles={customStylesPercentage}>{percentage}%</StyledPercentage>}
186
+ <StyledPercentage type={type} customStyles={customStylesPercentage}>{percentage}%</StyledPercentage>}
188
187
  </StyledContainer>
189
188
  )
190
189
  }
191
190
 
192
191
  Rating.propTypes = {
193
- /**
194
- * Theme props
195
- */
196
- theme: PropTypes.object,
192
+
197
193
  /**
198
194
  * Custom style object for container
199
195
  */
@@ -249,7 +245,6 @@ Rating.propTypes = {
249
245
  }
250
246
 
251
247
  Rating.defaultProps = {
252
- theme: defaultStyles,
253
248
  customStylesContainer: null,
254
249
  customStylesStar: null,
255
250
  customStylesPercentage: null,
@@ -260,5 +255,4 @@ Rating.defaultProps = {
260
255
  toggleStar: true,
261
256
  toggleSet: false,
262
257
  color: '#F7B001'
263
- }
264
-
258
+ }