groundfloor-react-ui 1.0.19 → 1.0.20
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 +12 -6
- package/components/Cards/Card.js +25 -30
- package/components/Cards/DocumentCard.js +83 -89
- package/components/Divider/Divider.js +23 -30
- 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/Inputs/CheckBoxInput.js +48 -26
- package/components/Inputs/DropdownSelect.js +55 -10
- package/components/Inputs/DropzoneInput.js +83 -68
- package/components/Inputs/RadioInput.js +55 -29
- package/components/Inputs/Signature.js +88 -38
- package/components/Inputs/TextArea.js +24 -40
- package/components/Inputs/TimeInput.js +9 -25
- 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/Tables/Table.js +56 -34
- package/components/Tooltip/Tooltip.js +135 -141
- package/components/constants/defaultStyle.js +28 -37
- package/dist/index.es.js +413 -374
- package/dist/index.js +406 -367
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React, { useState, useRef } from "react";
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
2
|
+
import React, { useRef, useState } from "react";
|
|
4
3
|
import { Card, CardRef } from "../Cards";
|
|
4
|
+
import defaultStyles from '../constants/defaultStyle';
|
|
5
|
+
import { Icon } from '../Icon';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Primary UI component for user interaction
|
|
@@ -45,7 +46,12 @@ export const Accordion = ({
|
|
|
45
46
|
{ transform: 'rotate(0deg)', transition: 'transform ease 95ms', background: 'transparent' }
|
|
46
47
|
}
|
|
47
48
|
>
|
|
48
|
-
{icon
|
|
49
|
+
{icon ? icon : <Icon
|
|
50
|
+
icon='chevron-down'
|
|
51
|
+
size={11}
|
|
52
|
+
transform={'translate(0px,-1px)'}
|
|
53
|
+
color='#A9B1B8'
|
|
54
|
+
/>}
|
|
49
55
|
</div>}
|
|
50
56
|
/>
|
|
51
57
|
}
|
|
@@ -108,7 +114,7 @@ Accordion.propTypes = {
|
|
|
108
114
|
Accordion.defaultProps = {
|
|
109
115
|
theme: defaultStyles,
|
|
110
116
|
contentToggle: 'Toggle',
|
|
111
|
-
content: 'Content'
|
|
112
|
-
|
|
113
|
-
};
|
|
117
|
+
content: 'Content',
|
|
118
|
+
toggleIconAnimation: true,
|
|
114
119
|
|
|
120
|
+
};
|
package/components/Cards/Card.js
CHANGED
|
@@ -1,48 +1,43 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
6
5
|
|
|
7
6
|
const CardWrapper = styled.div`
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
color: ${({ activeTheme }) => activeTheme.textColor};
|
|
8
|
+
padding-top: 25px;
|
|
9
|
+
padding-bottom: 25px;
|
|
10
|
+
padding-left: 32px;
|
|
11
|
+
padding-right: 32px;
|
|
12
|
+
background-color: ${({ activeTheme }) => activeTheme.bgColor};
|
|
13
|
+
width: inherit;
|
|
14
|
+
height: inherit;
|
|
15
|
+
border-radius: 5px;
|
|
16
|
+
box-shadow: 0px 5px 37px rgba(56, 66, 100, 0.0880136);
|
|
17
|
+
border-color: ${({ activeTheme }) => activeTheme.border};
|
|
18
|
+
|
|
19
|
+
// custom styles
|
|
20
|
+
${({ customStyles }) => customStyles}
|
|
15
21
|
`;
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
23
|
+
export const Card = ({ type, header, content, ...props }) => {
|
|
24
|
+
const activeTheme = useTheme() || defaultThemeColor;
|
|
20
25
|
|
|
21
|
-
export const Card = ({type,header,content,...props}) => {
|
|
22
26
|
return (
|
|
23
|
-
<CardWrapper
|
|
27
|
+
<CardWrapper activeTheme={activeTheme} {...props}>
|
|
24
28
|
{header}
|
|
25
29
|
{content}
|
|
26
30
|
</CardWrapper>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
31
|
+
);
|
|
32
|
+
};
|
|
29
33
|
|
|
30
34
|
Card.propTypes = {
|
|
31
35
|
/**
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
type: PropTypes.string,
|
|
35
|
-
/**
|
|
36
|
-
* header of the card
|
|
36
|
+
* header of the card
|
|
37
37
|
*/
|
|
38
38
|
header: PropTypes.any,
|
|
39
39
|
/**
|
|
40
40
|
* the content of the card
|
|
41
|
-
|
|
41
|
+
*/
|
|
42
42
|
content: PropTypes.any,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
Card.defaultProps = {
|
|
46
|
-
type: 'card',
|
|
47
|
-
}
|
|
48
|
-
|
|
43
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled, { css, useTheme } from 'styled-components';
|
|
4
4
|
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Primary UI component for user interaction
|
|
8
|
-
*/
|
|
8
|
+
*/
|
|
9
9
|
|
|
10
10
|
const sizes = {
|
|
11
11
|
sm: {
|
|
@@ -18,7 +18,7 @@ const sizes = {
|
|
|
18
18
|
footerMinHeight: '31px',
|
|
19
19
|
footerPadding: '10.5px 16px',
|
|
20
20
|
footerLineHeight: '16px',
|
|
21
|
-
lineHeight: '12px'
|
|
21
|
+
lineHeight: '12px',
|
|
22
22
|
},
|
|
23
23
|
md: {
|
|
24
24
|
cardWidth: '215px',
|
|
@@ -30,82 +30,91 @@ const sizes = {
|
|
|
30
30
|
footerMinHeight: '54px',
|
|
31
31
|
footerPadding: '18px 19px',
|
|
32
32
|
footerLineHeight: '12px',
|
|
33
|
-
lineHeight: '16px'
|
|
33
|
+
lineHeight: '16px',
|
|
34
34
|
},
|
|
35
|
-
}
|
|
35
|
+
};
|
|
36
36
|
|
|
37
37
|
const StyledDocumentCard = styled.div`
|
|
38
|
-
|
|
38
|
+
${({ trimFileName }) => {
|
|
39
39
|
if (trimFileName) {
|
|
40
|
-
return
|
|
40
|
+
return css`
|
|
41
|
+
height: ${({ size }) => sizes[size].cardMinHeight};
|
|
42
|
+
`;
|
|
41
43
|
} else {
|
|
42
|
-
return
|
|
44
|
+
return css`
|
|
45
|
+
min-height: ${({ size }) => sizes[size].cardMinHeight};
|
|
46
|
+
`;
|
|
43
47
|
}
|
|
44
48
|
}}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
width: ${({ size }) => sizes[size].cardWidth};
|
|
50
|
+
border-radius: ${({ size }) => sizes[size].borderRadius};
|
|
51
|
+
border: ${({ size }) => sizes[size].border} solid
|
|
52
|
+
${({ theme, variantBorder }) => theme.variant[variantBorder]};
|
|
53
|
+
box-sizing: border-box;
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
&:hover {
|
|
56
|
+
border: ${({ size }) => sizes[size].border} solid
|
|
57
|
+
${({ theme, variantBorderHover }) => theme.variant[variantBorderHover]};
|
|
58
|
+
button {
|
|
59
|
+
&:hover {
|
|
60
|
+
opacity: 0.8;
|
|
61
|
+
}
|
|
57
62
|
}
|
|
58
|
-
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
59
65
|
|
|
60
66
|
const StyledCardBody = styled.div`
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
display: flex;
|
|
68
|
+
justify-content: ${({ buttons }) =>
|
|
69
|
+
buttons !== '11' ? 'center' : 'space-between'};
|
|
70
|
+
align-items: center;
|
|
71
|
+
height: ${({ size }) => sizes[size].bodyHeight};
|
|
72
|
+
margin: 0;
|
|
73
|
+
padding: ${({ size }) => sizes[size].bodyPadding};
|
|
74
|
+
border: none;
|
|
75
|
+
border-top-left-radius: ${({ size }) => sizes[size].borderRadius};
|
|
76
|
+
border-top-right-radius: ${({ size }) => sizes[size].borderRadius};
|
|
77
|
+
background-color: ${({ theme, variantBgBody }) =>
|
|
78
|
+
theme.variant[variantBgBody]};
|
|
79
|
+
background: linear-gradient(
|
|
80
|
+
0deg,
|
|
81
|
+
rgba(226, 230, 245, 0.5),
|
|
82
|
+
rgba(226, 230, 245, 0.5)
|
|
83
|
+
)
|
|
84
|
+
${({ bgUrl }) => (bgUrl ? `, url('/images/documentCardBG.png')` : null)};
|
|
85
|
+
background-size: cover;
|
|
86
|
+
box-sizing: border-box;
|
|
87
|
+
`;
|
|
75
88
|
|
|
76
89
|
const StyledCardFooter = styled.div`
|
|
77
|
-
|
|
90
|
+
${({ trimFileName }) => {
|
|
78
91
|
if (trimFileName) {
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
`
|
|
86
|
-
)
|
|
92
|
+
return css`
|
|
93
|
+
white-space: nowrap;
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
text-overflow: ellipsis;
|
|
96
|
+
height: ${({ size }) => sizes[size].footerMinHeight};
|
|
97
|
+
`;
|
|
87
98
|
} else {
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
`
|
|
96
|
-
)
|
|
99
|
+
return css`
|
|
100
|
+
display: flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
min-height: ${({ size }) => sizes[size].footerMinHeight};
|
|
103
|
+
overflow-wrap: anywhere;
|
|
104
|
+
hyphens: auto;
|
|
105
|
+
`;
|
|
97
106
|
}
|
|
98
107
|
}}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
font-size: ${({ size }) => sizes[size].footerFontSize};
|
|
109
|
+
padding: ${({ size }) => sizes[size].footerPadding};
|
|
110
|
+
color: ${({ theme, variant }) => theme.variant[variant]};
|
|
111
|
+
background-color: ${({ theme, variantBgFooter }) =>
|
|
112
|
+
variantBgFooter ? theme.variant[variantBgFooter] : theme['bgColor']};
|
|
113
|
+
box-sizing: border-box;
|
|
114
|
+
line-height: ${({ size }) => sizes[size].lineHeight};
|
|
115
|
+
border-bottom-left-radius: inherit;
|
|
116
|
+
border-bottom-right-radius: inherit;
|
|
117
|
+
`;
|
|
109
118
|
export const DocumentCard = ({
|
|
110
119
|
variant,
|
|
111
120
|
variantBorder,
|
|
@@ -117,9 +126,9 @@ export const DocumentCard = ({
|
|
|
117
126
|
size,
|
|
118
127
|
trimFileName,
|
|
119
128
|
bodyContent,
|
|
120
|
-
...props
|
|
121
|
-
|
|
122
|
-
const
|
|
129
|
+
...props
|
|
130
|
+
}) => {
|
|
131
|
+
const activeTheme = useTheme() || defaultThemeColor;
|
|
123
132
|
|
|
124
133
|
return (
|
|
125
134
|
<StyledDocumentCard
|
|
@@ -128,12 +137,14 @@ export const DocumentCard = ({
|
|
|
128
137
|
variantBgBody={variantBgBody}
|
|
129
138
|
size={size}
|
|
130
139
|
trimFileName={trimFileName}
|
|
140
|
+
theme={activeTheme}
|
|
131
141
|
{...props}
|
|
132
142
|
>
|
|
133
|
-
<StyledCardBody bgUrl={bgUrl} size={size} >
|
|
143
|
+
<StyledCardBody bgUrl={bgUrl} size={size} theme={activeTheme}>
|
|
134
144
|
{bodyContent}
|
|
135
145
|
</StyledCardBody>
|
|
136
146
|
<StyledCardFooter
|
|
147
|
+
theme={activeTheme}
|
|
137
148
|
title={fileName}
|
|
138
149
|
variant={variant}
|
|
139
150
|
variantBgFooter={variantBgFooter}
|
|
@@ -143,8 +154,8 @@ export const DocumentCard = ({
|
|
|
143
154
|
{fileName}
|
|
144
155
|
</StyledCardFooter>
|
|
145
156
|
</StyledDocumentCard>
|
|
146
|
-
)
|
|
147
|
-
}
|
|
157
|
+
);
|
|
158
|
+
};
|
|
148
159
|
|
|
149
160
|
DocumentCard.propTypes = {
|
|
150
161
|
/**
|
|
@@ -183,30 +194,14 @@ DocumentCard.propTypes = {
|
|
|
183
194
|
* If true if the fimeName is longer than the width is trimmed. If false the fileName is wrapped and the footer expands vertically
|
|
184
195
|
*/
|
|
185
196
|
trimFileName: PropTypes.bool,
|
|
186
|
-
|
|
187
|
-
* Theme object
|
|
188
|
-
*/
|
|
189
|
-
theme: PropTypes.object,
|
|
197
|
+
|
|
190
198
|
/**
|
|
191
199
|
* Children component of the Card Body
|
|
192
200
|
*/
|
|
193
201
|
bodyContent: PropTypes.element,
|
|
194
202
|
};
|
|
195
203
|
|
|
196
|
-
StyledDocumentCard.defaultProps = {
|
|
197
|
-
theme: defaultThemeColor,
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
StyledCardBody.defaultProps = {
|
|
201
|
-
theme: defaultThemeColor,
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
StyledCardFooter.defaultProps = {
|
|
205
|
-
theme: defaultThemeColor,
|
|
206
|
-
}
|
|
207
|
-
|
|
208
204
|
DocumentCard.defaultProps = {
|
|
209
|
-
theme: defaultThemeColor,
|
|
210
205
|
variant: 'black',
|
|
211
206
|
variantBorder: 'neutral-5',
|
|
212
207
|
variantBorderHover: 'primary-1',
|
|
@@ -216,6 +211,5 @@ DocumentCard.defaultProps = {
|
|
|
216
211
|
bgUrl: null,
|
|
217
212
|
size: 'md',
|
|
218
213
|
trimFileName: true,
|
|
219
|
-
bodyContent: null
|
|
220
|
-
};
|
|
221
|
-
|
|
214
|
+
bodyContent: null,
|
|
215
|
+
};
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import styled, { useTheme } from 'styled-components';
|
|
4
4
|
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Primary UI component for user interaction
|
|
8
|
-
*/
|
|
8
|
+
*/
|
|
9
9
|
|
|
10
10
|
const StyledDivider = styled.div`
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
display: ${({ vertical }) => (vertical ? 'inline-block' : 'block')};
|
|
12
|
+
background: ${({ theme, borderColor }) =>
|
|
13
|
+
borderColor ? borderColor : theme.neutral['neutral-5']};
|
|
14
|
+
content: '';
|
|
15
|
+
height: ${({ vertical, thickness, height }) =>
|
|
16
|
+
vertical ? height : thickness};
|
|
17
|
+
width: ${({ vertical, thickness }) => (vertical ? thickness : null)};
|
|
18
|
+
`;
|
|
18
19
|
export const Divider = ({ vertical, borderColor, thickness, height, ...props }) => {
|
|
19
|
-
const
|
|
20
|
+
const activeTheme = useTheme() || defaultThemeColor;
|
|
20
21
|
return (
|
|
21
|
-
<StyledDivider
|
|
22
|
-
|
|
23
|
-
}
|
|
22
|
+
<StyledDivider
|
|
23
|
+
theme={activeTheme}
|
|
24
|
+
borderColor={borderColor}
|
|
25
|
+
thickness={thickness}
|
|
26
|
+
vertical={vertical}
|
|
27
|
+
height={height}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
24
32
|
|
|
25
33
|
Divider.propTypes = {
|
|
26
|
-
/**
|
|
27
|
-
* Optional: Color of Divider
|
|
28
|
-
*/
|
|
29
|
-
variant: PropTypes.string,
|
|
30
34
|
/**
|
|
31
35
|
* Optional: How thick should be the divider in px
|
|
32
36
|
*/
|
|
33
37
|
thickness: PropTypes.string,
|
|
34
|
-
/**
|
|
35
|
-
* Theme object
|
|
36
|
-
*/
|
|
37
|
-
theme: PropTypes.object,
|
|
38
38
|
/**
|
|
39
39
|
* Optional custom border color
|
|
40
40
|
*/
|
|
@@ -49,15 +49,8 @@ Divider.propTypes = {
|
|
|
49
49
|
height: PropTypes.string,
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
StyledDivider.defaultProps = {
|
|
53
|
-
theme: defaultThemeColor,
|
|
54
|
-
}
|
|
55
|
-
|
|
56
52
|
Divider.defaultProps = {
|
|
57
|
-
theme: defaultThemeColor,
|
|
58
|
-
variant: 'neutral-5',
|
|
59
53
|
thickness: '2px',
|
|
60
54
|
vertical: false,
|
|
61
|
-
height: '10px'
|
|
62
|
-
};
|
|
63
|
-
|
|
55
|
+
height: '10px',
|
|
56
|
+
};
|
|
@@ -1,50 +1,53 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import styled, { css, useTheme } from 'styled-components';
|
|
4
|
+
import { hexToRGB } from '../constants';
|
|
4
5
|
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
6
|
|
|
6
|
-
const border = `#F6F6F9;`;
|
|
7
|
+
// const border = `#F6F6F9;`;
|
|
7
8
|
|
|
8
9
|
const selectedCss = css`
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
color: ${({ theme }) => theme.variant['primary-1']};
|
|
11
|
+
border: 1px solid ${({ theme }) => theme.variant['primary-1']};
|
|
12
|
+
background: ${({ theme }) => hexToRGB(theme.primary['primary-1'], 0.04)};
|
|
12
13
|
`;
|
|
13
14
|
|
|
14
15
|
const StyledButton = styled.button`
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
color: ${({ theme }) => theme.variant['primary-2']};
|
|
18
|
+
background: ${({ theme }) => hexToRGB(theme.variant['neutral-5'], 0.7)};
|
|
19
|
+
border: 1px solid ${({ theme }) => hexToRGB(theme.variant['neutral-5'], 0.7)};
|
|
20
|
+
padding: 4px 24px;
|
|
21
|
+
border-radius: 999px;
|
|
22
|
+
outline: none;
|
|
23
|
+
cursor: pointer;
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
${({ selected }) => (selected ? selectedCss : null)}
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
&:not(:first-child) {
|
|
28
|
+
margin-left: 8px;
|
|
29
|
+
}
|
|
29
30
|
`;
|
|
30
|
-
StyledButton.defaultProps = {
|
|
31
|
-
theme: defaultThemeColor,
|
|
32
|
-
}
|
|
33
31
|
|
|
34
32
|
export const FilterChip = ({ options, selected, onClick, ...props }) => {
|
|
33
|
+
const activeTheme = useTheme() || defaultThemeColor;
|
|
34
|
+
|
|
35
35
|
const list = options.map((option, index) => {
|
|
36
36
|
return (
|
|
37
|
-
<StyledButton
|
|
37
|
+
<StyledButton
|
|
38
|
+
theme={activeTheme}
|
|
39
|
+
key={`${option.label}_${index}_${option.value}`}
|
|
40
|
+
selected={selected === option.value}
|
|
41
|
+
onClick={() => {
|
|
42
|
+
onClick(option.value);
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
38
45
|
{option.label}
|
|
39
46
|
</StyledButton>
|
|
40
|
-
)
|
|
41
|
-
})
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
{list}
|
|
45
|
-
</>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
return <>{list}</>;
|
|
50
|
+
};
|
|
48
51
|
|
|
49
52
|
FilterChip.propTypes = {
|
|
50
53
|
/**
|
|
@@ -59,10 +62,9 @@ FilterChip.propTypes = {
|
|
|
59
62
|
* click event
|
|
60
63
|
*/
|
|
61
64
|
onClick: PropTypes.func,
|
|
62
|
-
}
|
|
65
|
+
};
|
|
63
66
|
|
|
64
67
|
FilterChip.defaultProps = {
|
|
65
68
|
options: [],
|
|
66
69
|
selected: '',
|
|
67
|
-
}
|
|
68
|
-
|
|
70
|
+
};
|
|
@@ -1,34 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTheme } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
import { Icon } from '../Icon';
|
|
4
6
|
|
|
5
|
-
export const HeaderComponent = ({
|
|
7
|
+
export const HeaderComponent = ({
|
|
8
|
+
title,
|
|
9
|
+
subtitle,
|
|
10
|
+
wrapperStyle,
|
|
11
|
+
imgLink,
|
|
12
|
+
imgStyle,
|
|
13
|
+
iconSize,
|
|
14
|
+
}) => {
|
|
15
|
+
const activeTheme = useTheme() || defaultThemeColor;
|
|
6
16
|
|
|
7
17
|
const titleStyle = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
18
|
+
fontSize: '26px',
|
|
19
|
+
fontWeight: 'bold',
|
|
20
|
+
color: `${activeTheme.textColor}`,
|
|
21
|
+
lineHeight: '36px',
|
|
22
|
+
display: 'flex',
|
|
23
|
+
gap: '14px',
|
|
24
|
+
alignItems: 'flex-start',
|
|
25
|
+
paddingLeft: '25px',
|
|
26
|
+
};
|
|
17
27
|
|
|
18
28
|
const subtitleStyle = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
29
|
+
fontSize: '13px',
|
|
30
|
+
color: `${activeTheme.neutral['neutral-2']}`,
|
|
31
|
+
lineHeight: '24px',
|
|
32
|
+
paddingLeft: '25px',
|
|
33
|
+
};
|
|
24
34
|
|
|
25
|
-
return
|
|
26
|
-
<div style={
|
|
27
|
-
<
|
|
28
|
-
|
|
35
|
+
return (
|
|
36
|
+
<div style={wrapperStyle}>
|
|
37
|
+
<div style={titleStyle}>
|
|
38
|
+
{imgLink ? (
|
|
39
|
+
<img src={imgLink} alt='userIcon' srcset='' style={imgStyle} />
|
|
40
|
+
) : (
|
|
41
|
+
<Icon
|
|
42
|
+
icon='user-icon'
|
|
43
|
+
size={iconSize}
|
|
44
|
+
color={activeTheme.primary['primary-1']}
|
|
45
|
+
/>
|
|
46
|
+
)}{' '}
|
|
47
|
+
<h4>{title}</h4>
|
|
48
|
+
</div>
|
|
49
|
+
<div style={subtitleStyle}>
|
|
50
|
+
<p>{subtitle}</p>
|
|
51
|
+
</div>
|
|
29
52
|
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
HeaderComponent.propTypes = {
|
|
57
|
+
/**
|
|
58
|
+
* How large should the default icon be?
|
|
59
|
+
*/
|
|
60
|
+
size: PropTypes.number,
|
|
61
|
+
};
|
|
62
|
+
HeaderComponent.defaultProps = {
|
|
63
|
+
iconSize: 23,
|
|
64
|
+
};
|