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.
- package/components/Accordion/Accordion.js +83 -33
- package/components/Accordion/AccordionSB.js +50 -54
- package/components/Accordion/AccordionSBfooter.js +51 -55
- package/components/ArrowBar/ArrowBar.js +6 -23
- package/components/Avatar/Avatar.js +49 -45
- package/components/Avatar/AvatarSB.js +121 -92
- package/components/Avatar/AvatarSBfooter.js +113 -92
- package/components/Banner/Banner.js +40 -35
- package/components/Breadcrumb/Breadcrumb.js +178 -163
- package/components/Button/PrimaryButton.js +15 -8
- package/components/Button/SecondaryButton.js +11 -9
- package/components/Cards/Card.js +25 -30
- package/components/Cards/CardRef.js +41 -34
- package/components/Cards/DocumentCard.js +83 -89
- package/components/Divider/Divider.js +23 -30
- package/components/Drawer/Drawer.js +46 -55
- package/components/FilterChip/FilterChip.js +34 -32
- package/components/Form/HeaderComponent.js +57 -27
- package/components/GroupAvatars/GroupAvatars.js +12 -16
- package/components/GroupButtons/GroupButtonsPopup.js +3 -9
- package/components/Images/Image.js +16 -21
- package/components/Inputs/CheckBoxInput.js +71 -33
- package/components/Inputs/DateSelect.js +22 -17
- package/components/Inputs/DropdownSelect.js +86 -30
- package/components/Inputs/DropzoneInput.js +83 -68
- package/components/Inputs/NumericInput.js +66 -63
- package/components/Inputs/PasswordInput.js +36 -27
- package/components/Inputs/RadioInput.js +55 -29
- package/components/Inputs/Signature.js +88 -38
- package/components/Inputs/TextArea.js +24 -40
- package/components/Inputs/TextInput.js +43 -28
- package/components/Inputs/TimeInput.js +92 -107
- package/components/Inputs/ToggleSwitch.js +87 -59
- package/components/Modal/ModalComp.js +61 -37
- package/components/Pagination/Pagination.js +30 -54
- package/components/ProgressBar/ProgressBar.js +57 -40
- package/components/Rating/Rating.js +8 -14
- package/components/Sidebar/Navbar.js +196 -170
- package/components/Tables/Table.js +56 -34
- package/components/Tooltip/Tooltip.js +135 -141
- package/components/Typography/Typography.js +9 -10
- package/components/constants/defaultStyle.js +38 -41
- package/dist/index.es.js +675 -596
- package/dist/index.js +660 -581
- package/package.json +1 -1
|
@@ -1,83 +1,59 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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 = ({
|
|
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
|
-
|
|
47
|
+
inBuiltCss={defaultStyles}
|
|
37
48
|
customStyles={labelStyle}
|
|
38
49
|
type={'progressbarLabel'}
|
|
39
50
|
text={label}
|
|
40
|
-
{...props}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
73
|
+
* Custom style of the label of the progressBar
|
|
53
74
|
*/
|
|
54
75
|
labelStyle: PropTypes.object,
|
|
55
76
|
/**
|
|
56
|
-
* Custom style of the
|
|
77
|
+
* Custom style of the progressBar
|
|
57
78
|
*/
|
|
58
79
|
progressBarStyle: PropTypes.object,
|
|
59
|
-
|
|
80
|
+
|
|
60
81
|
/**
|
|
61
|
-
* Custom color(HEX format) of the
|
|
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
|
-
|
|
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
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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
|
|
184
|
+
<StyledContainer customStyles={customStylesContainer} type={type} size={size} {...props} className={'container'} >
|
|
186
185
|
{toggleStar ? stars :
|
|
187
|
-
<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
|
+
}
|