@manuscripts/style-guide 3.6.1 → 3.6.3
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 +3 -3
- package/dist/cjs/components/Avatar.js +10 -10
- package/dist/cjs/components/Button.js +16 -16
- package/dist/cjs/components/Checkbox.js +2 -2
- package/dist/cjs/components/ContextMenu.js +1 -1
- package/dist/cjs/components/DateInput.js +3 -3
- package/dist/cjs/components/Dialog.js +1 -1
- package/dist/cjs/components/Drawer.js +2 -2
- package/dist/cjs/components/Dropdown.js +7 -5
- package/dist/cjs/components/ExpandableSection.js +5 -5
- package/dist/cjs/components/Form.js +4 -4
- package/dist/cjs/components/Menus/Menus.js +4 -4
- package/dist/cjs/components/Menus/Submenu.js +2 -2
- package/dist/cjs/components/MultiValueInput.js +6 -2
- package/dist/cjs/components/NavDropdown.js +8 -10
- package/dist/cjs/components/Resizer/ResizerButton.js +1 -1
- package/dist/cjs/components/Resizer/ResizerButtonInner.js +9 -9
- package/dist/cjs/components/SelectedItemsBox.js +3 -3
- package/dist/cjs/components/StyledModal.js +7 -7
- package/dist/cjs/components/SystemUserAvatar.js +5 -5
- package/dist/cjs/components/TextField.js +8 -8
- package/dist/cjs/components/ToggleSwitch.js +7 -7
- package/dist/es/components/Avatar.js +10 -10
- package/dist/es/components/Button.js +16 -16
- package/dist/es/components/Checkbox.js +2 -2
- package/dist/es/components/ContextMenu.js +1 -1
- package/dist/es/components/DateInput.js +3 -3
- package/dist/es/components/Dialog.js +1 -1
- package/dist/es/components/Drawer.js +2 -2
- package/dist/es/components/Dropdown.js +7 -5
- package/dist/es/components/ExpandableSection.js +5 -5
- package/dist/es/components/Form.js +4 -4
- package/dist/es/components/Menus/Menus.js +4 -4
- package/dist/es/components/Menus/Submenu.js +2 -2
- package/dist/es/components/MultiValueInput.js +7 -3
- package/dist/es/components/NavDropdown.js +8 -10
- package/dist/es/components/Resizer/ResizerButton.js +1 -1
- package/dist/es/components/Resizer/ResizerButtonInner.js +9 -9
- package/dist/es/components/SelectedItemsBox.js +3 -3
- package/dist/es/components/StyledModal.js +7 -7
- package/dist/es/components/SystemUserAvatar.js +5 -5
- package/dist/es/components/TextField.js +8 -8
- package/dist/es/components/ToggleSwitch.js +7 -7
- package/dist/types/components/Button.d.ts +36 -47
- package/dist/types/components/Checkbox.d.ts +1 -1
- package/dist/types/components/DateInput.d.ts +2 -2
- package/dist/types/components/Dropdown.d.ts +5 -7
- package/dist/types/components/Form.d.ts +3 -3
- package/dist/types/components/NavDropdown.d.ts +9 -12
- package/dist/types/components/Resizer/ResizerButtonInner.d.ts +2 -2
- package/dist/types/components/StyledModal.d.ts +8 -9
- package/dist/types/components/TextField.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@ React components for Manuscripts applications.
|
|
|
9
9
|
import { PrimaryButton } from '@manuscripts/style-guide'
|
|
10
10
|
|
|
11
11
|
const Example: React.FunctionComponent<{
|
|
12
|
-
handleClick: React.MouseEventHandler<HTMLButtonElement>
|
|
12
|
+
handleClick: React.MouseEventHandler<HTMLButtonElement>
|
|
13
13
|
}> = ({ handleClick }) => (
|
|
14
|
-
<div>
|
|
14
|
+
<div>
|
|
15
15
|
<PrimaryButton onClick={handleClick}>Done</PrimaryButton>
|
|
16
16
|
</div>
|
|
17
17
|
)
|
|
@@ -19,7 +19,7 @@ const Example: React.FunctionComponent<{
|
|
|
19
19
|
|
|
20
20
|
## Development
|
|
21
21
|
|
|
22
|
-
Run `yarn build` to build the `dist` folder for distribution.
|
|
22
|
+
Run `yarn build` to build the `dist` folder for distribution.
|
|
23
23
|
|
|
24
24
|
Run `yarn dev` to automatically rebuild when a file is changed.
|
|
25
25
|
|
|
@@ -30,32 +30,32 @@ const AvatarContainer = styled_components_1.default.div `
|
|
|
30
30
|
align-items: center;
|
|
31
31
|
justify-content: center;
|
|
32
32
|
position: relative;
|
|
33
|
-
opacity: ${(props) => props
|
|
33
|
+
opacity: ${(props) => props.$opacity};
|
|
34
34
|
`;
|
|
35
35
|
const RoundedImage = styled_components_1.default.img `
|
|
36
|
-
width: ${(props) => props
|
|
37
|
-
height: ${(props) => props
|
|
36
|
+
width: ${(props) => props.$size}px;
|
|
37
|
+
height: ${(props) => props.$size}px;
|
|
38
38
|
border-radius: 50%;
|
|
39
39
|
align-items: center;
|
|
40
40
|
justify-content: center;
|
|
41
41
|
`;
|
|
42
42
|
const StyledAvatar = (0, styled_components_1.default)(icons_1.ProfileIcon) `
|
|
43
43
|
path {
|
|
44
|
-
fill: ${(props) => props
|
|
44
|
+
fill: ${(props) => props.$color || props.theme.colors.text.secondary};
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
&:hover path {
|
|
48
|
-
fill: ${(props) => props
|
|
48
|
+
fill: ${(props) => props.$color || props.theme.colors.text.info};
|
|
49
49
|
}
|
|
50
50
|
`;
|
|
51
51
|
const InitialsCircle = styled_components_1.default.div `
|
|
52
|
-
width: ${(props) => props
|
|
53
|
-
height: ${(props) => props
|
|
52
|
+
width: ${(props) => props.$size}px;
|
|
53
|
+
height: ${(props) => props.$size}px;
|
|
54
54
|
border-radius: 50%;
|
|
55
|
-
background: ${(props) => props
|
|
55
|
+
background: ${(props) => props.$bg};
|
|
56
56
|
color: #ffffff;
|
|
57
57
|
font-weight: bold;
|
|
58
|
-
font-size: ${(props) => Math.round(props
|
|
58
|
+
font-size: ${(props) => Math.round(props.$size * 0.4)}px;
|
|
59
59
|
display: flex;
|
|
60
60
|
align-items: center;
|
|
61
61
|
justify-content: center;
|
|
@@ -68,6 +68,6 @@ const Avatar = (props) => {
|
|
|
68
68
|
setSrcError(true);
|
|
69
69
|
}, []);
|
|
70
70
|
const showInitials = (!props.src || srcError) && !!props.name;
|
|
71
|
-
return ((0, jsx_runtime_1.jsx)(AvatarContainer, { opacity: props.opacity || 1, children: props.src && !srcError ? ((0, jsx_runtime_1.jsx)(RoundedImage, { src: props.src, size: props.size, onError: handleSrcError })) : showInitials ? ((0, jsx_runtime_1.jsx)(InitialsCircle, { size: props.size, bg: INITIALS_PALETTE[props.name.charCodeAt(0) % INITIALS_PALETTE.length], children: getInitials(props.name) })) : ((0, jsx_runtime_1.jsx)(StyledAvatar, { height: props.size, width: props.size, color: props.color })) }));
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(AvatarContainer, { "$opacity": props.opacity || 1, children: props.src && !srcError ? ((0, jsx_runtime_1.jsx)(RoundedImage, { src: props.src, "$size": props.size, onError: handleSrcError })) : showInitials ? ((0, jsx_runtime_1.jsx)(InitialsCircle, { "$size": props.size, "$bg": INITIALS_PALETTE[props.name.charCodeAt(0) % INITIALS_PALETTE.length], children: getInitials(props.name) })) : ((0, jsx_runtime_1.jsx)(StyledAvatar, { height: props.size, width: props.size, "$color": props.color })) }));
|
|
72
72
|
};
|
|
73
73
|
exports.Avatar = Avatar;
|
|
@@ -104,10 +104,10 @@ const btnStyles = (0, styled_components_1.css) `
|
|
|
104
104
|
margin-left: ${(props) => props.theme.grid.unit}px;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
${(props) => props
|
|
108
|
-
${(props) => props
|
|
107
|
+
${(props) => props.$danger && dangerBtnStyles}
|
|
108
|
+
${(props) => props.$mini && miniBtnStyles}
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
&:disabled {
|
|
111
111
|
${disabledBtnStyles}
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -177,8 +177,8 @@ exports.IconTextButton = (0, styled_components_1.default)(ButtonTemplate) `
|
|
|
177
177
|
`;
|
|
178
178
|
exports.ToggleButton = (0, styled_components_1.default)(ButtonTemplate) `
|
|
179
179
|
color: ${(props) => props.theme.colors.text.primary};
|
|
180
|
-
background-color: ${(props) => props
|
|
181
|
-
border-color: ${(props) => props
|
|
180
|
+
background-color: ${(props) => props.$selected ? props.theme.colors.background.fifth : 'transparent'};
|
|
181
|
+
border-color: ${(props) => props.$selected
|
|
182
182
|
? props.theme.colors.border.primary
|
|
183
183
|
: props.theme.colors.border.secondary};
|
|
184
184
|
|
|
@@ -200,14 +200,14 @@ exports.ToggleButton = (0, styled_components_1.default)(ButtonTemplate) `
|
|
|
200
200
|
|
|
201
201
|
svg {
|
|
202
202
|
path[stroke] {
|
|
203
|
-
stroke: ${(props) => props
|
|
203
|
+
stroke: ${(props) => props.$selected
|
|
204
204
|
? props.theme.colors.brand.medium
|
|
205
205
|
: props.theme.colors.text.primary};
|
|
206
206
|
}
|
|
207
207
|
text[fill],
|
|
208
208
|
rect[fill],
|
|
209
209
|
path[fill] {
|
|
210
|
-
fill: ${(props) => props
|
|
210
|
+
fill: ${(props) => props.$selected
|
|
211
211
|
? props.theme.colors.brand.medium
|
|
212
212
|
: props.theme.colors.text.primary};
|
|
213
213
|
}
|
|
@@ -219,7 +219,7 @@ exports.ToggleButtonAlt = (0, styled_components_1.default)(ButtonTemplate) `
|
|
|
219
219
|
border: none;
|
|
220
220
|
border-bottom: 1px solid transparent;
|
|
221
221
|
border-radius: 0;
|
|
222
|
-
${(props) => props
|
|
222
|
+
${(props) => props.$selected && 'border-color: ' + props.theme.colors.border.info};
|
|
223
223
|
|
|
224
224
|
font-size: ${(props) => props.theme.font.size.normal};
|
|
225
225
|
padding: 0 ${(props) => props.theme.grid.unit}px;
|
|
@@ -241,21 +241,21 @@ const svgColors = (0, styled_components_1.css) `
|
|
|
241
241
|
|
|
242
242
|
svg {
|
|
243
243
|
path[stroke] {
|
|
244
|
-
stroke: ${(props) => props
|
|
244
|
+
stroke: ${(props) => props.$iconColor || 'currentColor'};
|
|
245
245
|
}
|
|
246
246
|
text[fill],
|
|
247
247
|
rect[fill],
|
|
248
248
|
path[fill] {
|
|
249
|
-
fill: ${(props) => props
|
|
249
|
+
fill: ${(props) => props.$iconColor || 'currentColor'};
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
`;
|
|
253
253
|
const IconButtonTemplate = (0, styled_components_1.default)(ButtonTemplate) `
|
|
254
254
|
padding: 0;
|
|
255
|
-
height: ${(props) => props
|
|
256
|
-
width: ${(props) => props
|
|
255
|
+
height: ${(props) => props.$size || 40}px;
|
|
256
|
+
width: ${(props) => props.$size || 40}px;
|
|
257
257
|
|
|
258
|
-
${(props) => !props
|
|
258
|
+
${(props) => !props.$defaultColor && svgColors}
|
|
259
259
|
`;
|
|
260
260
|
exports.IconButton = (0, styled_components_1.default)(IconButtonTemplate) `
|
|
261
261
|
${(props) => btnColors(props.theme.colors.text.primary, props.theme.colors.button.default.background.default, props.theme.colors.button.default.border.default, false)}
|
|
@@ -269,7 +269,7 @@ exports.IconButton = (0, styled_components_1.default)(IconButtonTemplate) `
|
|
|
269
269
|
}
|
|
270
270
|
`;
|
|
271
271
|
exports.RoundIconButton = (0, styled_components_1.default)(exports.IconButton).attrs((props) => ({
|
|
272
|
-
defaultColor: true,
|
|
272
|
+
$defaultColor: true,
|
|
273
273
|
})) `
|
|
274
274
|
background: ${(props) => props.theme.colors.background.primary};
|
|
275
275
|
border: 5px solid ${(props) => props.theme.colors.background.primary} !important;
|
|
@@ -316,8 +316,8 @@ exports.IconButtonGroup = styled_components_1.default.div `
|
|
|
316
316
|
justify-content: flex-start;
|
|
317
317
|
align-items: center;
|
|
318
318
|
button {
|
|
319
|
-
width: ${(props) => props
|
|
320
|
-
height: ${(props) => props
|
|
319
|
+
width: ${(props) => props.$size || 28}px;
|
|
320
|
+
height: ${(props) => props.$size || 28}px;
|
|
321
321
|
}
|
|
322
322
|
`;
|
|
323
323
|
exports.TextButton = (0, styled_components_1.default)(exports.IconTextButton) `
|
|
@@ -40,14 +40,14 @@ exports.CheckboxLabel = styled_components_1.default.label `
|
|
|
40
40
|
font-family: ${(props) => props.theme.font.family.sans};
|
|
41
41
|
font-size: ${(props) => props.theme.font.size.normal};
|
|
42
42
|
font-weight: ${(props) => props.theme.font.weight.normal};
|
|
43
|
-
color: ${(props) => props
|
|
43
|
+
color: ${(props) => props.$disabled
|
|
44
44
|
? props.theme.colors.text.muted
|
|
45
45
|
: props.theme.colors.text.primary};
|
|
46
46
|
display: flex;
|
|
47
47
|
flex-wrap: nowrap;
|
|
48
48
|
line-height: 20px;
|
|
49
49
|
margin: 8px 0;
|
|
50
|
-
cursor: ${(props) => (props
|
|
50
|
+
cursor: ${(props) => (props.$disabled ? 'not-allowed' : 'pointer')};
|
|
51
51
|
|
|
52
52
|
&::before {
|
|
53
53
|
content: '';
|
|
@@ -102,7 +102,7 @@ const ContextMenu = ({ actions }) => {
|
|
|
102
102
|
container.removeEventListener('keydown', handleKeyDown);
|
|
103
103
|
};
|
|
104
104
|
}, [actions]);
|
|
105
|
-
return ((0, jsx_runtime_1.jsx)(Button_1.IconButtonGroup, { size: 32, ref: containerRef, children: actions.map((action) => {
|
|
105
|
+
return ((0, jsx_runtime_1.jsx)(Button_1.IconButtonGroup, { "$size": 32, ref: containerRef, children: actions.map((action) => {
|
|
106
106
|
const Icon = icons[action.icon];
|
|
107
107
|
return ((0, jsx_runtime_1.jsx)(ContextMenuIconButton, { "data-tooltip-content": action.label, onClick: action.disabled === true ? () => null : action.action, className: action.selected ? 'selected' : '', disabled: !!action.disabled, children: (0, jsx_runtime_1.jsx)(Icon, { width: 18, height: 18 }) }, action.icon));
|
|
108
108
|
}) }));
|
|
@@ -40,10 +40,10 @@ const icons_1 = require("./icons");
|
|
|
40
40
|
const inputStyles = (0, styled_components_1.css) `
|
|
41
41
|
box-sizing: border-box;
|
|
42
42
|
width: 100%;
|
|
43
|
-
min-height: ${(props) => (props
|
|
43
|
+
min-height: ${(props) => (props.$variant === 'small' ? '32px' : '40px')};
|
|
44
44
|
padding: 0 36px 0 12px;
|
|
45
45
|
border: 1px solid
|
|
46
|
-
${(props) => props
|
|
46
|
+
${(props) => props.$error
|
|
47
47
|
? props.theme.colors.border.error
|
|
48
48
|
: props.theme.colors.border.field.default};
|
|
49
49
|
border-radius: 3px;
|
|
@@ -77,7 +77,7 @@ const inputStyles = (0, styled_components_1.css) `
|
|
|
77
77
|
|
|
78
78
|
&:focus:not(:disabled) {
|
|
79
79
|
border: 2px solid
|
|
80
|
-
${(props) => props
|
|
80
|
+
${(props) => props.$error
|
|
81
81
|
? props.theme.colors.border.error
|
|
82
82
|
: props.theme.colors.brand.default};
|
|
83
83
|
background-color: #f2fbfc;
|
|
@@ -99,7 +99,7 @@ const SecondaryTextDanger = styled_components_1.default.button.attrs({ type: 'bu
|
|
|
99
99
|
opacity: 0.5;
|
|
100
100
|
}
|
|
101
101
|
`;
|
|
102
|
-
const PrimaryAction = (props) => props.isDestructive ? (props.hasForm ? ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { danger: true, disabled: props.disabled, form: "formDialog", type: "submit", children: props.title })) : ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { danger: true, disabled: props.disabled, onClick: props.action, autoFocus: true, children: props.title }))) : props.hasForm ? ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { disabled: props.disabled, form: "formDialog", type: "submit", children: props.title })) : ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { disabled: props.disabled, onClick: props.action, autoFocus: true, children: props.title }));
|
|
102
|
+
const PrimaryAction = (props) => props.isDestructive ? (props.hasForm ? ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { "$danger": true, disabled: props.disabled, form: "formDialog", type: "submit", children: props.title })) : ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { "$danger": true, disabled: props.disabled, onClick: props.action, autoFocus: true, children: props.title }))) : props.hasForm ? ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { disabled: props.disabled, form: "formDialog", type: "submit", children: props.title })) : ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { disabled: props.disabled, onClick: props.action, autoFocus: true, children: props.title }));
|
|
103
103
|
const SecondaryAction = (props) => props.variant === 'textDanger' ? ((0, jsx_runtime_1.jsx)(SecondaryTextDanger, { disabled: props.disabled, onClick: props.action, children: props.title })) : ((0, jsx_runtime_1.jsx)(Button_1.SecondaryButton, { disabled: props.disabled, onClick: props.action, children: props.title }));
|
|
104
104
|
class Dialog extends react_1.default.Component {
|
|
105
105
|
constructor() {
|
|
@@ -47,7 +47,7 @@ const slideIn = (0, styled_components_1.keyframes) `
|
|
|
47
47
|
}
|
|
48
48
|
`;
|
|
49
49
|
const DrawerContainer = (0, List_1.withFocusTrap)(styled_components_1.default.div `
|
|
50
|
-
width: ${(props) => props
|
|
50
|
+
width: ${(props) => props.$width || '300px'};
|
|
51
51
|
background: ${(props) => props.theme.colors.background.primary};
|
|
52
52
|
height: 100%;
|
|
53
53
|
display: flex;
|
|
@@ -132,6 +132,6 @@ exports.DrawerItemMeta = styled_components_1.default.span `
|
|
|
132
132
|
color: ${(props) => props.theme.colors.text.secondary};
|
|
133
133
|
`;
|
|
134
134
|
const Drawer = ({ title, onBack, width, children, }) => {
|
|
135
|
-
return ((0, jsx_runtime_1.jsxs)(DrawerContainer, { "data-cy": "drawer", width: width, children: [(0, jsx_runtime_1.jsxs)(DrawerBackButton, { onClick: onBack, children: [(0, jsx_runtime_1.jsx)("span", { children: "\u2190" }), "Back"] }), (0, jsx_runtime_1.jsx)(DrawerTitle, { children: title }), children] }));
|
|
135
|
+
return ((0, jsx_runtime_1.jsxs)(DrawerContainer, { "data-cy": "drawer", "$width": width, children: [(0, jsx_runtime_1.jsxs)(DrawerBackButton, { onClick: onBack, children: [(0, jsx_runtime_1.jsx)("span", { children: "\u2190" }), "Back"] }), (0, jsx_runtime_1.jsx)(DrawerTitle, { children: title }), children] }));
|
|
136
136
|
};
|
|
137
137
|
exports.Drawer = Drawer;
|
|
@@ -5,7 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DropdownButton = exports.DropdownContainer = exports.DropdownList = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
exports.DropdownList = styled_components_1.default.div.attrs({
|
|
8
|
+
exports.DropdownList = styled_components_1.default.div.attrs({
|
|
9
|
+
'data-cy': 'dropdown',
|
|
10
|
+
}) `
|
|
9
11
|
display: flex;
|
|
10
12
|
flex-direction: column;
|
|
11
13
|
border: 1px solid ${(props) => props.theme.colors.border.secondary};
|
|
@@ -13,10 +15,10 @@ exports.DropdownList = styled_components_1.default.div.attrs({ 'data-cy': 'dropd
|
|
|
13
15
|
border-radius: 4px;
|
|
14
16
|
box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
|
|
15
17
|
background: ${(props) => props.theme.colors.background.primary};
|
|
16
|
-
width: ${(props) => (props
|
|
17
|
-
${(props) => props
|
|
18
|
-
${(props) => (props
|
|
19
|
-
top: ${(props) => props.theme.grid.unit * (props
|
|
18
|
+
width: ${(props) => (props.$width ? props.$width + 'px' : 'auto')};
|
|
19
|
+
${(props) => props.$height && `max-height: ${props.$height}px`};
|
|
20
|
+
${(props) => (props.$direction === 'right' ? ' right: 0' : 'left : 0')};
|
|
21
|
+
top: ${(props) => props.theme.grid.unit * (props.$top || 3)}px;
|
|
20
22
|
position: absolute;
|
|
21
23
|
z-index: 10;
|
|
22
24
|
justify-content: space-evenly;
|
|
@@ -16,7 +16,7 @@ const ExpandableSection = ({ title, children, defaultOpen = true, bordered = fal
|
|
|
16
16
|
setOpen((prev) => !prev);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)(Container, { bordered: bordered, children: [(0, jsx_runtime_1.jsxs)(Header, { onClick: () => setOpen((prev) => !prev), onKeyDown: handleKeyDown, tabIndex: 0, role: "button", "aria-expanded": open, children: [(0, jsx_runtime_1.jsx)(Title, { children: title }), (0, jsx_runtime_1.jsx)(ArrowIcon, { open: open })] }), (0, jsx_runtime_1.jsx)(ContentOuter, { open: open, inert: !open || undefined, children: (0, jsx_runtime_1.jsx)(ContentInner, { children: (0, jsx_runtime_1.jsx)("div", { children: children }) }) })] }));
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(Container, { bordered: bordered, children: [(0, jsx_runtime_1.jsxs)(Header, { onClick: () => setOpen((prev) => !prev), onKeyDown: handleKeyDown, tabIndex: 0, role: "button", "aria-expanded": open, children: [(0, jsx_runtime_1.jsx)(Title, { children: title }), (0, jsx_runtime_1.jsx)(ArrowIcon, { "$open": open })] }), (0, jsx_runtime_1.jsx)(ContentOuter, { "$open": open, inert: !open || undefined, children: (0, jsx_runtime_1.jsx)(ContentInner, { children: (0, jsx_runtime_1.jsx)("div", { children: children }) }) })] }));
|
|
20
20
|
};
|
|
21
21
|
exports.ExpandableSection = ExpandableSection;
|
|
22
22
|
const Container = styled_components_1.default.div `
|
|
@@ -40,15 +40,15 @@ const Title = styled_components_1.default.span `
|
|
|
40
40
|
`;
|
|
41
41
|
const ArrowIcon = (0, styled_components_1.default)(icons_1.ArrowDownCircleIcon) `
|
|
42
42
|
transition: transform 0.25s ease;
|
|
43
|
-
transform: rotate(${(props) => (props
|
|
43
|
+
transform: rotate(${(props) => (props.$open ? '180deg' : '0deg')});
|
|
44
44
|
`;
|
|
45
45
|
const ContentOuter = styled_components_1.default.div `
|
|
46
46
|
display: grid;
|
|
47
|
-
grid-template-rows: ${(props) => (props
|
|
48
|
-
overflow: ${(props) => (props
|
|
47
|
+
grid-template-rows: ${(props) => (props.$open ? '1fr' : '0fr')};
|
|
48
|
+
overflow: ${(props) => (props.$open ? 'visible' : 'hidden')};
|
|
49
49
|
transition:
|
|
50
50
|
grid-template-rows 0.25s ease,
|
|
51
|
-
overflow 0s ${(props) => (props
|
|
51
|
+
overflow 0s ${(props) => (props.$open ? '0.25s' : '0s')} allow-discrete;
|
|
52
52
|
`;
|
|
53
53
|
const ContentInner = styled_components_1.default.div `
|
|
54
54
|
overflow: visible;
|
|
@@ -64,12 +64,12 @@ exports.FormField = styled_components_1.default.div `
|
|
|
64
64
|
`;
|
|
65
65
|
exports.FormRow = styled_components_1.default.div `
|
|
66
66
|
display: flex;
|
|
67
|
-
flex-direction: ${(props) => props
|
|
67
|
+
flex-direction: ${(props) => props.$direction ?? 'column'};
|
|
68
68
|
gap: ${(props) => props.theme.grid.unit * 2}px;
|
|
69
69
|
margin-bottom: ${(props) => props.theme.grid.unit * 4}px;
|
|
70
|
-
justify-content: ${(props) => props
|
|
71
|
-
align-items: ${(props) => props
|
|
72
|
-
flex-wrap: ${(props) => (props
|
|
70
|
+
justify-content: ${(props) => props.$justify ?? 'flex-start'};
|
|
71
|
+
align-items: ${(props) => props.$align ?? (props.$direction === 'row' ? 'center' : 'stretch')};
|
|
72
|
+
flex-wrap: ${(props) => (props.$direction === 'row' ? 'wrap' : 'nowrap')};
|
|
73
73
|
`;
|
|
74
74
|
exports.FormLabel = styled_components_1.default.legend `
|
|
75
75
|
&:not(:first-child) {
|
|
@@ -27,10 +27,10 @@ const MenuContainer = styled_components_1.default.div `
|
|
|
27
27
|
& ${MenuHeading} {
|
|
28
28
|
background-color: ${(props) => props.theme.colors.background.secondary};
|
|
29
29
|
line-height: 24px;
|
|
30
|
-
color: ${(props) => (props
|
|
30
|
+
color: ${(props) => (props.$isEnabled ? '#353535' : '#e2e2e2')};
|
|
31
31
|
|
|
32
32
|
&:hover {
|
|
33
|
-
background-color: ${(props) => (props
|
|
33
|
+
background-color: ${(props) => (props.$isEnabled ? '#f2fbfc' : '#fff')};
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
`;
|
|
@@ -90,12 +90,12 @@ const Menus = ({ menus, innerRef, handleClick, close, }) => {
|
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
return ((0, jsx_runtime_1.jsx)(MenusContainer, { ref: innerRef, "data-cy": 'manuscript-menus', onKeyDown: handleKeyDown, children: menus.map((menu, index) => {
|
|
93
|
-
return ((0, jsx_runtime_1.jsxs)(MenuContainer, { "data-cy": 'menu', isEnabled: menu.isEnabled, children: [(0, jsx_runtime_1.jsx)(MenuHeading, { ref: (el) => {
|
|
93
|
+
return ((0, jsx_runtime_1.jsxs)(MenuContainer, { "data-cy": 'menu', "$isEnabled": menu.isEnabled, children: [(0, jsx_runtime_1.jsx)(MenuHeading, { ref: (el) => {
|
|
94
94
|
menuHeadingsRef.current[index] = el;
|
|
95
95
|
}, onMouseDown: (e) => {
|
|
96
96
|
e.preventDefault();
|
|
97
97
|
handleClick([index]);
|
|
98
|
-
}, isOpen: menu.isOpen, children: (0, jsx_runtime_1.jsx)(Submenu_1.Text, { children: menu.label }) }), menu.isEnabled && menu.isOpen && menu.submenu && ((0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainerWrapper, { children: (0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainer, { "data-submenu-container": true, tabIndex: -1, children: menu.submenu.map((submenu, sindex) => {
|
|
98
|
+
}, "$isOpen": menu.isOpen, children: (0, jsx_runtime_1.jsx)(Submenu_1.Text, { children: menu.label }) }), menu.isEnabled && menu.isOpen && menu.submenu && ((0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainerWrapper, { children: (0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainer, { "data-submenu-container": true, tabIndex: -1, children: menu.submenu.map((submenu, sindex) => {
|
|
99
99
|
return ((0, jsx_runtime_1.jsx)(Submenu_1.Submenu, { menu: submenu, handleClick: (i) => handleClick([index, sindex, ...i]), close: close }, `${index}-${sindex}`));
|
|
100
100
|
}) }) }))] }, `menu-${index}`));
|
|
101
101
|
}) }));
|
|
@@ -71,7 +71,7 @@ const Container = styled_components_1.default.div `
|
|
|
71
71
|
cursor: pointer;
|
|
72
72
|
padding: 8px 16px 8px 4px;
|
|
73
73
|
outline: none;
|
|
74
|
-
${(props) => props
|
|
74
|
+
${(props) => props.$isOpen && 'background: #f2fbfc;'}
|
|
75
75
|
|
|
76
76
|
&:hover, &:focus {
|
|
77
77
|
background: #f2fbfc;
|
|
@@ -158,7 +158,7 @@ const SubmenuLabel = ({ menu, handleClick, close, }) => {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
|
-
return ((0, jsx_runtime_1.jsxs)(Container, { isOpen: menu.isOpen, "data-cy": 'submenu', "data-submenu-item": true, className: menu.isEnabled ? '' : 'disabled', tabIndex: -1, onMouseDown: (e) => {
|
|
161
|
+
return ((0, jsx_runtime_1.jsxs)(Container, { "$isOpen": menu.isOpen, "data-cy": 'submenu', "data-submenu-item": true, className: menu.isEnabled ? '' : 'disabled', tabIndex: -1, onMouseDown: (e) => {
|
|
162
162
|
e.preventDefault();
|
|
163
163
|
handleClick([]);
|
|
164
164
|
}, onKeyDown: handleKeyDown, children: [(0, jsx_runtime_1.jsx)(Active, { children: activeContent(menu) }), (0, jsx_runtime_1.jsx)(exports.Text, { children: menu.label }), menu.submenu && (0, jsx_runtime_1.jsx)(Arrow, {}), menu.shortcut && (0, jsx_runtime_1.jsx)(Shortcut_1.Shortcut, { shortcut: menu.shortcut })] }));
|
|
@@ -84,9 +84,13 @@ const Input = styled_components_1.default.input `
|
|
|
84
84
|
|
|
85
85
|
&::-moz-appearance: textfield;
|
|
86
86
|
`;
|
|
87
|
-
const MultiValueInput = ({ id, inputType, placeholder = '', initialValues
|
|
88
|
-
const [values, setValues] = (0, react_1.useState)(initialValues);
|
|
87
|
+
const MultiValueInput = ({ id, inputType, placeholder = '', initialValues, onChange, }) => {
|
|
88
|
+
const [values, setValues] = (0, react_1.useState)(initialValues ?? []);
|
|
89
89
|
const [currentValue, setCurrentValue] = (0, react_1.useState)('');
|
|
90
|
+
(0, react_1.useEffect)(() => {
|
|
91
|
+
setValues(initialValues ?? []);
|
|
92
|
+
setCurrentValue('');
|
|
93
|
+
}, [initialValues]);
|
|
90
94
|
const handleAddValue = (value) => {
|
|
91
95
|
if (value.trim() && !values.includes(value.trim())) {
|
|
92
96
|
const updatedValues = [...values, value.trim()];
|
|
@@ -56,9 +56,9 @@ exports.NavDropdown = styled_components_1.default.div `
|
|
|
56
56
|
font-weight: ${(props) => props.theme.font.weight.normal};
|
|
57
57
|
max-height: 80vh;
|
|
58
58
|
max-width: 300px;
|
|
59
|
-
${(props) => props
|
|
60
|
-
${(props) => (props
|
|
61
|
-
top: ${(props) => (props
|
|
59
|
+
${(props) => props.$minWidth && 'min-width: ' + props.$minWidth + 'px;'}
|
|
60
|
+
${(props) => (props.$direction === 'right' ? ' right: 0' : 'left : 0')};
|
|
61
|
+
top: ${(props) => (props.$top ? props.$top : props.theme.grid.unit * 10)}px;
|
|
62
62
|
position: absolute;
|
|
63
63
|
z-index: 10;
|
|
64
64
|
`;
|
|
@@ -79,10 +79,10 @@ const commonStyles = (0, styled_components_1.css) `
|
|
|
79
79
|
align-items: center;
|
|
80
80
|
text-decoration: none;
|
|
81
81
|
white-space: nowrap;
|
|
82
|
-
color: ${(props) => props
|
|
82
|
+
color: ${(props) => props.$disabled
|
|
83
83
|
? props.theme.colors.text.secondary
|
|
84
84
|
: props.theme.colors.text.primary};
|
|
85
|
-
pointer-events: ${(props) => (props
|
|
85
|
+
pointer-events: ${(props) => (props.$disabled ? 'none' : 'unset')};
|
|
86
86
|
|
|
87
87
|
&:hover {
|
|
88
88
|
background: ${(props) => props.theme.colors.background.fifth};
|
|
@@ -120,7 +120,7 @@ exports.NavDropdownToggle = (0, styled_components_1.default)(icons_1.ArrowUpIcon
|
|
|
120
120
|
}
|
|
121
121
|
`;
|
|
122
122
|
exports.NotificationsBadge = styled_components_1.default.div `
|
|
123
|
-
background-color: ${(props) => props
|
|
123
|
+
background-color: ${(props) => props.$isOpen
|
|
124
124
|
? props.theme.colors.background.success
|
|
125
125
|
: props.theme.colors.brand.default};
|
|
126
126
|
color: ${(props) => props.theme.colors.text.onDark};
|
|
@@ -136,13 +136,11 @@ exports.NotificationsBadge = styled_components_1.default.div `
|
|
|
136
136
|
padding: 2px;
|
|
137
137
|
border-radius: 50px;
|
|
138
138
|
`;
|
|
139
|
-
exports.NavDropdownButtonContainer = (0, styled_components_1.default)(Button_1.SecondaryButton)
|
|
140
|
-
selected: props.isOpen,
|
|
141
|
-
})) `
|
|
139
|
+
exports.NavDropdownButtonContainer = (0, styled_components_1.default)(Button_1.SecondaryButton) `
|
|
142
140
|
.inheritColors path {
|
|
143
141
|
fill: currentColor;
|
|
144
142
|
stroke: currentColor;
|
|
145
143
|
}
|
|
146
144
|
`;
|
|
147
|
-
const NavDropdownButton = ({ as, children, disabled, isOpen, notificationsCount, onClick, removeChevron, buttonRef, }) => ((0, jsx_runtime_1.jsxs)(exports.NavDropdownButtonContainer, { ref: buttonRef, as: as, disabled: disabled, onClick: onClick, isOpen: isOpen, className: 'dropdown-toggle', tabIndex: 0, children: [(0, jsx_runtime_1.jsx)(exports.NavDropdownButtonText, { children: children }), !!notificationsCount && ((0, jsx_runtime_1.jsx)(exports.NotificationsBadge, { isOpen: isOpen, children: notificationsCount })), !removeChevron && (0, jsx_runtime_1.jsx)(exports.NavDropdownToggle, { className: isOpen ? 'open' : '' })] }));
|
|
145
|
+
const NavDropdownButton = ({ as, children, disabled, isOpen, notificationsCount, onClick, removeChevron, buttonRef, }) => ((0, jsx_runtime_1.jsxs)(exports.NavDropdownButtonContainer, { ref: buttonRef, as: as, disabled: disabled, onClick: onClick, "$isOpen": isOpen, className: 'dropdown-toggle', tabIndex: 0, children: [(0, jsx_runtime_1.jsx)(exports.NavDropdownButtonText, { children: children }), !!notificationsCount && ((0, jsx_runtime_1.jsx)(exports.NotificationsBadge, { "$isOpen": isOpen, children: notificationsCount })), !removeChevron && (0, jsx_runtime_1.jsx)(exports.NavDropdownToggle, { className: isOpen ? 'open' : '' })] }));
|
|
148
146
|
exports.NavDropdownButton = NavDropdownButton;
|
|
@@ -50,6 +50,6 @@ const inners = {
|
|
|
50
50
|
exports.ResizerButton = react_1.default.memo(({ buttonInner, direction, side, isCollapsed = false, isVisible = false, onClick, }) => {
|
|
51
51
|
const preventMouseDown = (0, react_1.useCallback)((event) => event.preventDefault(), []);
|
|
52
52
|
const ResizerButtonInner = buttonInner || inners[direction][side];
|
|
53
|
-
return ((0, jsx_runtime_1.jsx)(ResizerButtonInner, { "aria-expanded": !isCollapsed, isCollapsed: isCollapsed, isVisible: isVisible, onClick: onClick, onMouseDown: preventMouseDown, tabIndex: 0 }));
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)(ResizerButtonInner, { "aria-expanded": !isCollapsed, "$isCollapsed": isCollapsed, "$isVisible": isVisible, onClick: onClick, onMouseDown: preventMouseDown, tabIndex: 0 }));
|
|
54
54
|
});
|
|
55
55
|
exports.ResizerButton.displayName = 'ResizerButton';
|
|
@@ -31,7 +31,7 @@ const ResizerButtonInner = styled_components_1.default.button `
|
|
|
31
31
|
background-color: #ddd;
|
|
32
32
|
border-radius: ${toggleArrowDepth}px;
|
|
33
33
|
position: absolute;
|
|
34
|
-
opacity: ${(props) => (props
|
|
34
|
+
opacity: ${(props) => (props.$isVisible ? 1 : 0.5)};
|
|
35
35
|
transition: ${transformTransition}, ${opacityTransition};
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -84,10 +84,10 @@ exports.HorizontalEndResizerButtonInner = (0, styled_components_1.default)(Horiz
|
|
|
84
84
|
&:hover,
|
|
85
85
|
&:focus {
|
|
86
86
|
&::before {
|
|
87
|
-
transform: rotate(${(props) => (props
|
|
87
|
+
transform: rotate(${(props) => (props.$isCollapsed ? '-40deg' : '40deg')});
|
|
88
88
|
}
|
|
89
89
|
&::after {
|
|
90
|
-
transform: rotate(${(props) => (props
|
|
90
|
+
transform: rotate(${(props) => (props.$isCollapsed ? '40deg' : '-40deg')});
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
`;
|
|
@@ -102,10 +102,10 @@ exports.HorizontalStartResizerButtonInner = (0, styled_components_1.default)(Hor
|
|
|
102
102
|
&:hover,
|
|
103
103
|
&:focus {
|
|
104
104
|
&::before {
|
|
105
|
-
transform: rotate(${(props) => (props
|
|
105
|
+
transform: rotate(${(props) => (props.$isCollapsed ? '40deg' : '-40deg')});
|
|
106
106
|
}
|
|
107
107
|
&::after {
|
|
108
|
-
transform: rotate(${(props) => (props
|
|
108
|
+
transform: rotate(${(props) => (props.$isCollapsed ? '-40deg' : '40deg')});
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
`;
|
|
@@ -140,10 +140,10 @@ exports.VerticalEndResizerButtonInner = (0, styled_components_1.default)(Vertica
|
|
|
140
140
|
&:hover,
|
|
141
141
|
&:focus {
|
|
142
142
|
&::before {
|
|
143
|
-
transform: rotate(${(props) => (props
|
|
143
|
+
transform: rotate(${(props) => (props.$isCollapsed ? '40deg' : '-40deg')});
|
|
144
144
|
}
|
|
145
145
|
&::after {
|
|
146
|
-
transform: rotate(${(props) => (props
|
|
146
|
+
transform: rotate(${(props) => (props.$isCollapsed ? '-40deg' : '40deg')});
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
`;
|
|
@@ -160,10 +160,10 @@ exports.VerticalStartResizerButtonInner = (0, styled_components_1.default)(Verti
|
|
|
160
160
|
&:hover,
|
|
161
161
|
&:focus {
|
|
162
162
|
&::before {
|
|
163
|
-
transform: rotate(${(props) => (props
|
|
163
|
+
transform: rotate(${(props) => (props.$isCollapsed ? '-40deg' : '40deg')});
|
|
164
164
|
}
|
|
165
165
|
&::after {
|
|
166
|
-
transform: rotate(${(props) => (props
|
|
166
|
+
transform: rotate(${(props) => (props.$isCollapsed ? '40deg' : '-40deg')});
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
`;
|
|
@@ -42,10 +42,10 @@ const Item = styled_components_1.default.div `
|
|
|
42
42
|
display: flex;
|
|
43
43
|
align-items: center;
|
|
44
44
|
gap: 4px;
|
|
45
|
-
background: ${(props) => (props
|
|
45
|
+
background: ${(props) => (props.$disabled ? '#dddcdc' : '#f2f2f2')};
|
|
46
46
|
border-radius: 6px;
|
|
47
47
|
padding: 4px;
|
|
48
|
-
color: ${(props) => props
|
|
48
|
+
color: ${(props) => props.$disabled ? '#707070' : props.theme.colors.text.primary};
|
|
49
49
|
font: ${(props) => props.theme.font.weight.normal}
|
|
50
50
|
${(props) => props.theme.font.size.small}
|
|
51
51
|
${(props) => props.theme.font.family.sans};
|
|
@@ -71,7 +71,7 @@ const RemoveButton = styled_components_1.default.button `
|
|
|
71
71
|
}
|
|
72
72
|
`;
|
|
73
73
|
const SelectedItemsBox = ({ items, onRemove, placeholder = 'No items selected', ...props }) => {
|
|
74
|
-
return ((0, jsx_runtime_1.jsx)(BoxContainer, { ...props, children: items.length > 0 ? ((0, jsx_runtime_1.jsx)(ItemsList, { children: items.map((item) => ((0, jsx_runtime_1.jsxs)(Item, { "data-cy": "item", disabled: !!props.disabled, children: [item.label, !props.disabled && ((0, jsx_runtime_1.jsx)(RemoveButton, { onClick: () => onRemove(item.id), "aria-label": `Remove ${item.label}`, children: "x" }))] }, item.id))) })) : ((0, jsx_runtime_1.jsx)(EmptyContainer, { children: (0, jsx_runtime_1.jsx)(Placeholder, { children: placeholder }) })) }));
|
|
74
|
+
return ((0, jsx_runtime_1.jsx)(BoxContainer, { ...props, children: items.length > 0 ? ((0, jsx_runtime_1.jsx)(ItemsList, { children: items.map((item) => ((0, jsx_runtime_1.jsxs)(Item, { "data-cy": "item", "$disabled": !!props.disabled, children: [item.label, !props.disabled && ((0, jsx_runtime_1.jsx)(RemoveButton, { onClick: () => onRemove(item.id), "aria-label": `Remove ${item.label}`, children: "x" }))] }, item.id))) })) : ((0, jsx_runtime_1.jsx)(EmptyContainer, { children: (0, jsx_runtime_1.jsx)(Placeholder, { children: placeholder }) })) }));
|
|
75
75
|
};
|
|
76
76
|
exports.SelectedItemsBox = SelectedItemsBox;
|
|
77
77
|
exports.default = exports.SelectedItemsBox;
|
|
@@ -179,8 +179,8 @@ exports.CloseButton = (0, styled_components_1.default)(Button_1.RoundIconButton)
|
|
|
179
179
|
text-indent: -99999px;
|
|
180
180
|
z-index: 2;
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
&::before,
|
|
183
|
+
&::after {
|
|
184
184
|
background-color: ${(props) => props.theme.colors.text.secondary};
|
|
185
185
|
border-radius: 2px;
|
|
186
186
|
content: ' ';
|
|
@@ -192,7 +192,7 @@ exports.CloseButton = (0, styled_components_1.default)(Button_1.RoundIconButton)
|
|
|
192
192
|
top: calc(50% - 7px);
|
|
193
193
|
left: calc(50% - 1px);
|
|
194
194
|
}
|
|
195
|
-
|
|
195
|
+
&::after {
|
|
196
196
|
transform: rotate(45deg);
|
|
197
197
|
}
|
|
198
198
|
`;
|
|
@@ -242,10 +242,10 @@ exports.ModalCardBody = styled_components_1.default.div `
|
|
|
242
242
|
box-sizing: border-box;
|
|
243
243
|
padding: ${(props) => 6 * props.theme.grid.unit}px;
|
|
244
244
|
background-color: ${(props) => props.theme.colors.background.primary};
|
|
245
|
-
width: ${(props) => props
|
|
246
|
-
? typeof props
|
|
247
|
-
? `${props
|
|
248
|
-
: props
|
|
245
|
+
width: ${(props) => props.$width
|
|
246
|
+
? typeof props.$width === 'number'
|
|
247
|
+
? `${props.$width}px`
|
|
248
|
+
: props.$width
|
|
249
249
|
: '640px'};
|
|
250
250
|
max-width: 60vw;
|
|
251
251
|
max-height: 80vh;
|
|
@@ -15,19 +15,19 @@ const SystemUserAvatarContainer = styled_components_1.default.div `
|
|
|
15
15
|
position: relative;
|
|
16
16
|
`;
|
|
17
17
|
const RoundedImage = styled_components_1.default.img `
|
|
18
|
-
width: ${(props) => props
|
|
19
|
-
height: ${(props) => props
|
|
18
|
+
width: ${(props) => props.$size}px;
|
|
19
|
+
height: ${(props) => props.$size}px;
|
|
20
20
|
border-radius: 50%;
|
|
21
21
|
align-items: center;
|
|
22
22
|
justify-content: center;
|
|
23
23
|
`;
|
|
24
24
|
const StyledAvatar = (0, styled_components_1.default)(icons_1.SystemUserAvatarIcon) `
|
|
25
25
|
path {
|
|
26
|
-
fill: ${(props) => props
|
|
26
|
+
fill: ${(props) => props.$color || props.theme.colors.text.secondary};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
&:hover path {
|
|
30
|
-
fill: ${(props) => props
|
|
30
|
+
fill: ${(props) => props.$color || props.theme.colors.text.info};
|
|
31
31
|
}
|
|
32
32
|
`;
|
|
33
33
|
const Avatar = (props) => {
|
|
@@ -35,6 +35,6 @@ const Avatar = (props) => {
|
|
|
35
35
|
const handleSrcError = (0, react_1.useCallback)(() => {
|
|
36
36
|
setSrcError(true);
|
|
37
37
|
}, []);
|
|
38
|
-
return ((0, jsx_runtime_1.jsx)(SystemUserAvatarContainer, { children: props.src && !srcError ? ((0, jsx_runtime_1.jsx)(RoundedImage, { src: props.src, size: props.size, onError: handleSrcError })) : ((0, jsx_runtime_1.jsx)(StyledAvatar, { height: props.size, width: props.size, color: props.color })) }));
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(SystemUserAvatarContainer, { children: props.src && !srcError ? ((0, jsx_runtime_1.jsx)(RoundedImage, { src: props.src, "$size": props.size, onError: handleSrcError })) : ((0, jsx_runtime_1.jsx)(StyledAvatar, { height: props.size, width: props.size, "$color": props.color })) }));
|
|
39
39
|
};
|
|
40
40
|
exports.Avatar = Avatar;
|