@manuscripts/style-guide 3.5.7 → 3.5.9
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 +2 -2
- package/dist/cjs/colors.js +7 -2
- package/dist/cjs/components/AlertMessage.js +64 -133
- package/dist/cjs/components/Button.js +15 -1
- package/dist/cjs/components/NavDropdown.js +1 -3
- package/dist/cjs/components/StyledModal.js +1 -1
- package/dist/cjs/components/icons/attention-blue.js +1 -1
- package/dist/cjs/components/icons/attention-green.js +1 -1
- package/dist/cjs/components/icons/attention-orange.js +1 -1
- package/dist/cjs/components/icons/attention-red.js +1 -1
- package/dist/cjs/components/icons/orcid.js +1 -1
- package/dist/cjs/components/icons/x.js +1 -1
- package/dist/cjs/defaultTheme.js +9 -9
- package/dist/es/colors.js +6 -1
- package/dist/es/components/AlertMessage.js +63 -99
- package/dist/es/components/Button.js +14 -0
- package/dist/es/components/NavDropdown.js +1 -3
- package/dist/es/components/StyledModal.js +1 -1
- package/dist/es/components/icons/attention-blue.js +2 -2
- package/dist/es/components/icons/attention-green.js +2 -2
- package/dist/es/components/icons/attention-orange.js +2 -2
- package/dist/es/components/icons/attention-red.js +2 -2
- package/dist/es/components/icons/orcid.js +1 -1
- package/dist/es/components/icons/x.js +2 -2
- package/dist/es/defaultTheme.js +9 -9
- package/dist/types/colors.d.ts +6 -1
- package/dist/types/components/AlertMessage.d.ts +17 -30
- package/dist/types/components/Button.d.ts +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,10 +16,10 @@ const Example: React.FunctionComponent<{
|
|
|
16
16
|
)
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
## Development
|
|
19
|
+
## Development
|
|
20
20
|
|
|
21
21
|
Run `yarn build` to build the `dist` folder for distribution.
|
|
22
22
|
|
|
23
|
-
Run `yarn dev` to automatically rebuild when a file is changed.
|
|
23
|
+
Run `yarn dev` to automatically rebuild when a file is changed.
|
|
24
24
|
|
|
25
25
|
If a component needs new theme properties, add the types to `src/theme.ts` and add the corresponding values to `.storybook/theme.ts`.
|
package/dist/cjs/colors.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.butteryYellow = exports.wheatYellow = exports.
|
|
18
|
+
exports.zestOrange = exports.veryLightYellow = exports.contrastOrange = exports.butteryYellow = exports.wheatYellow = exports.contrastGreen = exports.veryLightGreen = exports.peppermintGreen = exports.springGreen = exports.killarneyGreen = exports.contrastRed = exports.darkRed = exports.chablisRed = exports.mandysRed = exports.punchRed = exports.veryLightBlue = exports.graphBlue1 = exports.focusBlue = exports.powderBlue = exports.aliceBlue = exports.jellyBeanBlue = exports.white = exports.alabasterGrey = exports.seashellGrey = exports.mercuryGrey = exports.greyLight = exports.greyMutedText = exports.greyMuted = exports.greyDark = exports.black = exports.manuscriptsSecondary = exports.manuscriptsXLight2 = exports.manuscriptsXLight = exports.manuscriptsLight = exports.manuscriptsIcons = exports.manuscriptsBlue = exports.manuscriptsBlueDark = void 0;
|
|
19
19
|
exports.manuscriptsBlueDark = '#0b6bb8';
|
|
20
20
|
exports.manuscriptsBlue = '#0d79d0';
|
|
21
21
|
exports.manuscriptsIcons = '#1a9bc7';
|
|
@@ -42,9 +42,14 @@ exports.punchRed = '#f35143';
|
|
|
42
42
|
exports.mandysRed = '#f5c1b7';
|
|
43
43
|
exports.chablisRed = '#fff1f0';
|
|
44
44
|
exports.darkRed = '#c74237';
|
|
45
|
+
exports.contrastRed = '#cf1322';
|
|
45
46
|
exports.killarneyGreen = '#36b260';
|
|
46
47
|
exports.springGreen = '#b2c0ac';
|
|
47
48
|
exports.peppermintGreen = '#dff0d7';
|
|
48
|
-
exports.
|
|
49
|
+
exports.veryLightGreen = '#eefbe9';
|
|
50
|
+
exports.contrastGreen = '#31a056';
|
|
49
51
|
exports.wheatYellow = '#ffe0b2';
|
|
50
52
|
exports.butteryYellow = '#fffcdb';
|
|
53
|
+
exports.contrastOrange = '#fa5700';
|
|
54
|
+
exports.veryLightYellow = '#fff9e5';
|
|
55
|
+
exports.zestOrange = '#fe8f1f';
|
|
@@ -1,157 +1,88 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.AlertMessage =
|
|
6
|
+
exports.AlertMessage = void 0;
|
|
40
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
8
|
const react_1 = __importDefault(require("react"));
|
|
42
|
-
const styled_components_1 =
|
|
9
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
43
10
|
const Button_1 = require("./Button");
|
|
44
11
|
const icons_1 = require("./icons");
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
12
|
+
const variantIcons = {
|
|
13
|
+
success: icons_1.AttentionGreenIcon,
|
|
14
|
+
error: icons_1.AttentionRedIcon,
|
|
15
|
+
info: icons_1.AttentionBlueIcon,
|
|
16
|
+
warning: icons_1.AttentionOrangeIcon,
|
|
17
|
+
};
|
|
18
|
+
const AlertCloseAction = ({ closeConfig, onClose, }) => ((0, jsx_runtime_1.jsx)(CloseAction, { children: closeConfig.variant === 'icon' ? ((0, jsx_runtime_1.jsx)(CloseIconButton, { onClick: onClose, children: (0, jsx_runtime_1.jsx)(icons_1.XIcon, {}) })) : ((0, jsx_runtime_1.jsx)(DismissButton, { onClick: onClose, children: closeConfig.label })) }));
|
|
19
|
+
const AlertMessage = ({ title, message, variant, link, closeConfig, className, }) => {
|
|
20
|
+
const [isOpen, setIsOpen] = react_1.default.useState(true);
|
|
21
|
+
const AlertIcon = variantIcons[variant];
|
|
22
|
+
const handleClose = () => {
|
|
23
|
+
setIsOpen(false);
|
|
24
|
+
closeConfig?.onClick?.();
|
|
25
|
+
};
|
|
26
|
+
if (!isOpen) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)(Alert, { "$variant": variant, className: className, children: [(0, jsx_runtime_1.jsx)(IconWrapper, { "$hasTitle": !!title, children: (0, jsx_runtime_1.jsx)(AlertIcon, {}) }), (0, jsx_runtime_1.jsxs)(Content, { children: [title && (0, jsx_runtime_1.jsx)(Title, { children: title }), (0, jsx_runtime_1.jsxs)(MessageRow, { children: [(0, jsx_runtime_1.jsx)(Message, { children: message }), link && ((0, jsx_runtime_1.jsx)(ActionLink, { type: "button", onClick: link.onClick, children: link.label }))] })] }), closeConfig && ((0, jsx_runtime_1.jsx)(AlertCloseAction, { closeConfig: closeConfig, onClose: handleClose }))] }));
|
|
30
|
+
};
|
|
31
|
+
exports.AlertMessage = AlertMessage;
|
|
32
|
+
const Alert = styled_components_1.default.div `
|
|
33
|
+
align-items: center;
|
|
34
|
+
background-color: ${(props) => props.theme.colors.background[props.$variant]};
|
|
35
|
+
border: 1px solid ${(props) => props.theme.colors.border[props.$variant]};
|
|
36
|
+
border-radius: ${(props) => props.theme.grid.radius.small};
|
|
37
|
+
color: ${(props) => props.theme.colors.text.primary};
|
|
38
|
+
display: flex;
|
|
39
|
+
font: ${(props) => props.theme.font.weight.normal}
|
|
40
|
+
${(props) => props.theme.font.size.normal} / 1
|
|
41
|
+
${(props) => props.theme.font.family.Lato};
|
|
42
|
+
gap: ${(props) => props.theme.grid.unit * 3}px;
|
|
43
|
+
padding: ${(props) => props.theme.grid.unit * 3}px;
|
|
67
44
|
`;
|
|
68
|
-
const
|
|
69
|
-
height: 24px;
|
|
70
|
-
margin-right: ${(props) => props.theme.grid.unit * 3}px;
|
|
45
|
+
const IconWrapper = styled_components_1.default.div `
|
|
71
46
|
display: flex;
|
|
72
|
-
align-
|
|
47
|
+
align-self: ${(props) => (props.$hasTitle ? 'flex-start' : 'center')};
|
|
73
48
|
`;
|
|
74
|
-
const
|
|
75
|
-
align-items: center;
|
|
49
|
+
const Content = styled_components_1.default.div `
|
|
76
50
|
display: flex;
|
|
77
51
|
flex: 1;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
gap: ${(props) => props.theme.grid.unit}px;
|
|
78
54
|
`;
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
border-radius: ${(props) => props.theme.grid.radius.small};
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-shrink: 0;
|
|
84
|
-
font: ${(props) => props.theme.font.weight.normal}
|
|
85
|
-
${(props) => props.theme.font.size.medium} / 1
|
|
86
|
-
${(props) => props.theme.font.family.sans};
|
|
87
|
-
justify-content: space-between;
|
|
88
|
-
padding: ${(props) => props.theme.grid.unit * 3}px;
|
|
89
|
-
white-space: normal;
|
|
55
|
+
const Title = styled_components_1.default.span `
|
|
56
|
+
font-weight: ${(props) => props.theme.font.weight.semibold};
|
|
90
57
|
`;
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
58
|
+
const MessageRow = styled_components_1.default.div `
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: baseline;
|
|
61
|
+
gap: ${(props) => props.theme.grid.unit * 2}px;
|
|
95
62
|
`;
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
63
|
+
const ActionLink = styled_components_1.default.button `
|
|
64
|
+
font-size: ${(props) => props.theme.font.size.normal};
|
|
65
|
+
color: inherit;
|
|
66
|
+
text-decoration: underline;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
background: none;
|
|
69
|
+
border: none;
|
|
70
|
+
padding: 0;
|
|
100
71
|
`;
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
border: solid 1px ${(props) => props.theme.colors.border.info};
|
|
104
|
-
color: ${(props) => props.theme.colors.text.info};
|
|
72
|
+
const Message = styled_components_1.default.div `
|
|
73
|
+
font-size: ${(props) => props.theme.font.size.normal};
|
|
105
74
|
`;
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
color: ${(props) => props.theme.colors.text.warning};
|
|
75
|
+
const CloseIconButton = (0, styled_components_1.default)(Button_1.IconButton) `
|
|
76
|
+
width: ${(props) => props.theme.grid.unit * 6}px;
|
|
77
|
+
height: ${(props) => props.theme.grid.unit * 6}px;
|
|
110
78
|
`;
|
|
111
|
-
const
|
|
112
|
-
flex: 1 1 auto;
|
|
79
|
+
const CloseAction = styled_components_1.default.div `
|
|
113
80
|
display: flex;
|
|
114
81
|
align-items: center;
|
|
115
|
-
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
margin-left: auto;
|
|
116
84
|
`;
|
|
117
|
-
const
|
|
118
|
-
|
|
85
|
+
const DismissButton = (0, styled_components_1.default)(Button_1.IconTextButton) `
|
|
86
|
+
font-size: ${(props) => props.theme.font.size.normal};
|
|
87
|
+
color: inherit;
|
|
119
88
|
`;
|
|
120
|
-
var AlertMessageType;
|
|
121
|
-
(function (AlertMessageType) {
|
|
122
|
-
AlertMessageType["success"] = "success";
|
|
123
|
-
AlertMessageType["error"] = "error";
|
|
124
|
-
AlertMessageType["warning"] = "warning";
|
|
125
|
-
AlertMessageType["info"] = "info";
|
|
126
|
-
})(AlertMessageType || (exports.AlertMessageType = AlertMessageType = {}));
|
|
127
|
-
const alertIcons = {
|
|
128
|
-
success: SuccessIcon,
|
|
129
|
-
error: icons_1.AttentionRedIcon,
|
|
130
|
-
info: icons_1.AttentionBlueIcon,
|
|
131
|
-
warning: icons_1.AttentionOrangeIcon,
|
|
132
|
-
};
|
|
133
|
-
const alertContainers = {
|
|
134
|
-
success: SuccessAlertContainer,
|
|
135
|
-
error: ErrorAlertContainer,
|
|
136
|
-
info: InfoAlertContainer,
|
|
137
|
-
warning: WarningAlertContainer,
|
|
138
|
-
};
|
|
139
|
-
class AlertMessage extends react_1.default.Component {
|
|
140
|
-
constructor() {
|
|
141
|
-
super(...arguments);
|
|
142
|
-
this.state = {
|
|
143
|
-
isOpen: true,
|
|
144
|
-
};
|
|
145
|
-
this.handleClose = () => {
|
|
146
|
-
this.setState({ isOpen: false });
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
render() {
|
|
150
|
-
const { hideCloseButton, dismissButton, children, type } = this.props;
|
|
151
|
-
const { isOpen } = this.state;
|
|
152
|
-
const AlertContainer = alertContainers[type];
|
|
153
|
-
const AlertIcon = alertIcons[type];
|
|
154
|
-
return (isOpen && ((0, jsx_runtime_1.jsx)(AlertContainer, { className: 'alert-message', children: (0, jsx_runtime_1.jsxs)(InnerContainer, { children: [(0, jsx_runtime_1.jsx)(InformativeIcon, { children: (0, jsx_runtime_1.jsx)(AlertIcon, {}) }), (0, jsx_runtime_1.jsx)(TextContainer, { children: children }), dismissButton && ((0, jsx_runtime_1.jsx)(exports.TextButton, { onClick: dismissButton.action ? dismissButton.action : this.handleClose, children: dismissButton.text }))] }) })));
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
exports.AlertMessage = AlertMessage;
|
|
@@ -48,7 +48,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
48
48
|
};
|
|
49
49
|
})();
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.IconButtonGroup = exports.ButtonGroup = exports.SecondaryIconButton = exports.RoundIconButton = exports.IconButton = exports.ToggleButtonAlt = exports.ToggleButton = exports.IconTextButton = exports.TertiaryButton = exports.LoginButton = exports.PrimaryButton = exports.SecondaryButton = exports.outlineStyle = void 0;
|
|
51
|
+
exports.TextButton = exports.IconButtonGroup = exports.ButtonGroup = exports.SecondaryIconButton = exports.RoundIconButton = exports.IconButton = exports.ToggleButtonAlt = exports.ToggleButton = exports.IconTextButton = exports.TertiaryButton = exports.LoginButton = exports.PrimaryButton = exports.SecondaryButton = exports.outlineStyle = void 0;
|
|
52
52
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
53
53
|
const dangerBtnStyles = (0, styled_components_1.css) `
|
|
54
54
|
${(props) => btnColors(props.theme.colors.button.error.color.default, props.theme.colors.button.error.background.default, props.theme.colors.button.error.border.default, true)}
|
|
@@ -320,3 +320,17 @@ exports.IconButtonGroup = styled_components_1.default.div `
|
|
|
320
320
|
height: ${(props) => props.size || 28}px;
|
|
321
321
|
}
|
|
322
322
|
`;
|
|
323
|
+
exports.TextButton = (0, styled_components_1.default)(exports.IconTextButton) `
|
|
324
|
+
color: inherit;
|
|
325
|
+
margin-left: ${(props) => props.theme.grid.unit * 4}px;
|
|
326
|
+
|
|
327
|
+
g[fill] {
|
|
328
|
+
fill: currentColor;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
&:not([disabled]):focus,
|
|
332
|
+
&:not([disabled]):hover {
|
|
333
|
+
color: inherit;
|
|
334
|
+
filter: brightness(80%);
|
|
335
|
+
}
|
|
336
|
+
`;
|
|
@@ -124,9 +124,7 @@ exports.NotificationsBadge = (0, styled_components_1.default)(Badge_1.Badge) `
|
|
|
124
124
|
background-color: ${(props) => props.isOpen
|
|
125
125
|
? props.theme.colors.background.success
|
|
126
126
|
: props.theme.colors.brand.default};
|
|
127
|
-
color: ${(props) => props.
|
|
128
|
-
? props.theme.colors.text.success
|
|
129
|
-
: props.theme.colors.text.onDark};
|
|
127
|
+
color: ${(props) => props.theme.colors.text.onDark};
|
|
130
128
|
font-family: ${(props) => props.theme.font.family.sans};
|
|
131
129
|
font-size: 9px;
|
|
132
130
|
margin-left: 4px;
|
|
@@ -87,7 +87,7 @@ const StyledModal = ({ isOpen, onRequestClose, shouldCloseOnOverlayClick = true,
|
|
|
87
87
|
onRequestClose?.();
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(Dialog, { ref: dialogRef, onClick: handleBackdropClick, "$hideOverlay": hideOverlay, "$pointerEventsOnBackdrop": pointerEventsOnBackdrop, className: className, style: style?.content, children: children }), document.body);
|
|
90
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(Dialog, { ref: dialogRef, onClick: handleBackdropClick, "$hideOverlay": hideOverlay, "$pointerEventsOnBackdrop": pointerEventsOnBackdrop, className: className ? `Modal ${className}` : 'Modal', style: style?.content, children: children }), document.body);
|
|
91
91
|
};
|
|
92
92
|
exports.StyledModal = StyledModal;
|
|
93
93
|
const Dialog = styled_components_1.default.dialog `
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const AttentionBlueIcon = (props) => ((0, jsx_runtime_1.
|
|
4
|
+
const AttentionBlueIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M9 15H11V9H9V15ZM10 0C4.475 0 0 4.475 0 10C0 15.525 4.475 20 10 20C15.525 20 20 15.525 20 10C20 4.475 15.525 0 10 0ZM10 18C5.59 18 2 14.41 2 10C2 5.59 5.59 2 10 2C14.41 2 18 5.59 18 10C18 14.41 14.41 18 10 18ZM9 7H11V5H9V7Z", fill: "#1A9BC7" }) }));
|
|
5
5
|
exports.default = AttentionBlueIcon;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const AttentionGreenIcon = (props) => ((0, jsx_runtime_1.
|
|
4
|
+
const AttentionGreenIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M20 3.18L8.59 14.6L4.35 10.36L5.76 8.95L8.59 11.78L18.59 1.78L20 3.18ZM17.79 8.22C17.92 8.79 18 9.39 18 10C18 14.42 14.42 18 10 18C5.58 18 2 14.42 2 10C2 5.58 5.58 2 10 2C11.58 2 13.04 2.46 14.28 3.25L15.72 1.81C14.1 0.67 12.13 0 10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 8.81 19.78 7.67 19.4 6.61L17.79 8.22Z", fill: "#31A056" }) }));
|
|
5
5
|
exports.default = AttentionGreenIcon;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const AttentionOrangeIcon = (props) => ((0, jsx_runtime_1.
|
|
4
|
+
const AttentionOrangeIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { width: "22", height: "19", viewBox: "0 0 22 19", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M11 3.99L18.53 17H3.47L11 3.99ZM11 0L0 19H22L11 0ZM12 14H10V16H12V14ZM12 8H10V12H12V8Z", fill: "#FA5700" }) }));
|
|
5
5
|
exports.default = AttentionOrangeIcon;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const AttentionRedIcon = (props) => ((0, jsx_runtime_1.
|
|
4
|
+
const AttentionRedIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M9 13H11V15H9V13ZM9 5H11V11H9V5ZM9.995 0C4.47 0 0 4.475 0 10C0 15.525 4.47 20 9.995 20C15.52 20 20 15.525 20 10C20 4.475 15.52 0 9.995 0ZM10 18C5.58 18 2 14.42 2 10C2 5.58 5.58 2 10 2C14.42 2 18 5.58 18 10C18 14.42 14.42 18 10 18Z", fill: "#CF1322" }) }));
|
|
5
5
|
exports.default = AttentionRedIcon;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const ORCIDIcon = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("path", {
|
|
4
|
+
const ORCIDIcon = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M32 16c0 8.837-7.163 16-16 16-8.838 0-16-7.163-16-16C0 7.162 7.162 0 16 0c8.837 0 16 7.162 16 16Z", fill: "#A6CE39" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.813 9.637h-5.45v13.9h5.474c4.555 0 7.35-3.378 7.35-6.95 0-1.635-.562-3.372-1.77-4.704-1.215-1.336-3.065-2.246-5.605-2.246ZM18.6 21.3h-2.813v-9.425H18.5c1.823 0 3.12.552 3.96 1.4.842.849 1.252 2.021 1.252 3.312 0 .784-.239 1.967-.993 2.948-.745.969-2.01 1.765-4.119 1.765Zm5.311-4.026c-.251 1.74-1.494 4.276-5.311 4.276h-3.063H18.6c3.817 0 5.06-2.536 5.311-4.276Zm1.812-2.405c-.657-2.601-2.85-4.982-6.91-4.982h-5.2 5.2c4.06 0 6.253 2.38 6.91 4.982Zm.215 1.718ZM8.363 9.675v13.887h2.425V9.675H8.363Zm2.175 13.637H8.612h1.925ZM9.575 8.65c.84 0 1.513-.689 1.513-1.513 0-.823-.673-1.512-1.513-1.512-.838 0-1.512.674-1.512 1.513 0 .823.672 1.512 1.512 1.512Z", fill: "#fff" })] }));
|
|
5
5
|
exports.default = ORCIDIcon;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.XIcon = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const XIcon = (props) => ((0, jsx_runtime_1.
|
|
5
|
+
const XIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M14 1.415L12.585 0L7 5.585L1.415 0L0 1.415L5.585 7L0 12.585L1.415 14L7 8.415L12.585 14L14 12.585L8.415 7L14 1.415Z", fill: props.fill || '#353535' }) }));
|
|
6
6
|
exports.XIcon = XIcon;
|
|
7
7
|
exports.default = exports.XIcon;
|
package/dist/cjs/defaultTheme.js
CHANGED
|
@@ -60,10 +60,10 @@ exports.defaultTheme = {
|
|
|
60
60
|
tertiary: colors.mercuryGrey,
|
|
61
61
|
fifth: colors.manuscriptsXLight2,
|
|
62
62
|
dark: 'rgba(0,0,0,0.5)',
|
|
63
|
-
error: colors.
|
|
64
|
-
info: colors.
|
|
65
|
-
success: colors.
|
|
66
|
-
warning: colors.
|
|
63
|
+
error: colors.chablisRed,
|
|
64
|
+
info: colors.aliceBlue,
|
|
65
|
+
success: colors.veryLightGreen,
|
|
66
|
+
warning: colors.veryLightYellow,
|
|
67
67
|
selected: colors.aliceBlue,
|
|
68
68
|
muted: colors.greyMuted,
|
|
69
69
|
tracked: {
|
|
@@ -73,10 +73,10 @@ exports.defaultTheme = {
|
|
|
73
73
|
},
|
|
74
74
|
},
|
|
75
75
|
border: {
|
|
76
|
-
error: colors.
|
|
77
|
-
info: colors.
|
|
78
|
-
success: colors.
|
|
79
|
-
warning: colors.
|
|
76
|
+
error: colors.contrastRed,
|
|
77
|
+
info: colors.jellyBeanBlue,
|
|
78
|
+
success: colors.contrastGreen,
|
|
79
|
+
warning: colors.contrastOrange,
|
|
80
80
|
primary: colors.manuscriptsLight,
|
|
81
81
|
secondary: colors.mercuryGrey,
|
|
82
82
|
tertiary: colors.seashellGrey,
|
|
@@ -180,7 +180,7 @@ exports.defaultTheme = {
|
|
|
180
180
|
error: colors.punchRed,
|
|
181
181
|
info: colors.jellyBeanBlue,
|
|
182
182
|
success: colors.killarneyGreen,
|
|
183
|
-
warning: colors.
|
|
183
|
+
warning: colors.contrastOrange
|
|
184
184
|
},
|
|
185
185
|
outline: {
|
|
186
186
|
focus: colors.focusBlue,
|
package/dist/es/colors.js
CHANGED
|
@@ -39,9 +39,14 @@ export const punchRed = '#f35143';
|
|
|
39
39
|
export const mandysRed = '#f5c1b7';
|
|
40
40
|
export const chablisRed = '#fff1f0';
|
|
41
41
|
export const darkRed = '#c74237';
|
|
42
|
+
export const contrastRed = '#cf1322';
|
|
42
43
|
export const killarneyGreen = '#36b260';
|
|
43
44
|
export const springGreen = '#b2c0ac';
|
|
44
45
|
export const peppermintGreen = '#dff0d7';
|
|
45
|
-
export const
|
|
46
|
+
export const veryLightGreen = '#eefbe9';
|
|
47
|
+
export const contrastGreen = '#31a056';
|
|
46
48
|
export const wheatYellow = '#ffe0b2';
|
|
47
49
|
export const butteryYellow = '#fffcdb';
|
|
50
|
+
export const contrastOrange = '#fa5700';
|
|
51
|
+
export const veryLightYellow = '#fff9e5';
|
|
52
|
+
export const zestOrange = '#fe8f1f';
|
|
@@ -1,117 +1,81 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import styled
|
|
3
|
+
import styled from 'styled-components';
|
|
4
4
|
import { IconButton, IconTextButton } from './Button';
|
|
5
|
-
import { AttentionBlueIcon, AttentionGreenIcon, AttentionOrangeIcon, AttentionRedIcon, } from './icons';
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
${
|
|
5
|
+
import { AttentionBlueIcon, AttentionGreenIcon, AttentionOrangeIcon, AttentionRedIcon, XIcon, } from './icons';
|
|
6
|
+
const variantIcons = {
|
|
7
|
+
success: AttentionGreenIcon,
|
|
8
|
+
error: AttentionRedIcon,
|
|
9
|
+
info: AttentionBlueIcon,
|
|
10
|
+
warning: AttentionOrangeIcon,
|
|
11
|
+
};
|
|
12
|
+
const AlertCloseAction = ({ closeConfig, onClose, }) => (_jsx(CloseAction, { children: closeConfig.variant === 'icon' ? (_jsx(CloseIconButton, { onClick: onClose, children: _jsx(XIcon, {}) })) : (_jsx(DismissButton, { onClick: onClose, children: closeConfig.label })) }));
|
|
13
|
+
export const AlertMessage = ({ title, message, variant, link, closeConfig, className, }) => {
|
|
14
|
+
const [isOpen, setIsOpen] = React.useState(true);
|
|
15
|
+
const AlertIcon = variantIcons[variant];
|
|
16
|
+
const handleClose = () => {
|
|
17
|
+
setIsOpen(false);
|
|
18
|
+
closeConfig?.onClick?.();
|
|
19
|
+
};
|
|
20
|
+
if (!isOpen) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return (_jsxs(Alert, { "$variant": variant, className: className, children: [_jsx(IconWrapper, { "$hasTitle": !!title, children: _jsx(AlertIcon, {}) }), _jsxs(Content, { children: [title && _jsx(Title, { children: title }), _jsxs(MessageRow, { children: [_jsx(Message, { children: message }), link && (_jsx(ActionLink, { type: "button", onClick: link.onClick, children: link.label }))] })] }), closeConfig && (_jsx(AlertCloseAction, { closeConfig: closeConfig, onClose: handleClose }))] }));
|
|
24
|
+
};
|
|
25
|
+
const Alert = styled.div `
|
|
26
|
+
align-items: center;
|
|
27
|
+
background-color: ${(props) => props.theme.colors.background[props.$variant]};
|
|
28
|
+
border: 1px solid ${(props) => props.theme.colors.border[props.$variant]};
|
|
29
|
+
border-radius: ${(props) => props.theme.grid.radius.small};
|
|
30
|
+
color: ${(props) => props.theme.colors.text.primary};
|
|
31
|
+
display: flex;
|
|
32
|
+
font: ${(props) => props.theme.font.weight.normal}
|
|
33
|
+
${(props) => props.theme.font.size.normal} / 1
|
|
34
|
+
${(props) => props.theme.font.family.Lato};
|
|
35
|
+
gap: ${(props) => props.theme.grid.unit * 3}px;
|
|
36
|
+
padding: ${(props) => props.theme.grid.unit * 3}px;
|
|
28
37
|
`;
|
|
29
|
-
const
|
|
30
|
-
height: 24px;
|
|
31
|
-
margin-right: ${(props) => props.theme.grid.unit * 3}px;
|
|
38
|
+
const IconWrapper = styled.div `
|
|
32
39
|
display: flex;
|
|
33
|
-
align-
|
|
40
|
+
align-self: ${(props) => (props.$hasTitle ? 'flex-start' : 'center')};
|
|
34
41
|
`;
|
|
35
|
-
const
|
|
36
|
-
align-items: center;
|
|
42
|
+
const Content = styled.div `
|
|
37
43
|
display: flex;
|
|
38
44
|
flex: 1;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
gap: ${(props) => props.theme.grid.unit}px;
|
|
39
47
|
`;
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
border-radius: ${(props) => props.theme.grid.radius.small};
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-shrink: 0;
|
|
45
|
-
font: ${(props) => props.theme.font.weight.normal}
|
|
46
|
-
${(props) => props.theme.font.size.medium} / 1
|
|
47
|
-
${(props) => props.theme.font.family.sans};
|
|
48
|
-
justify-content: space-between;
|
|
49
|
-
padding: ${(props) => props.theme.grid.unit * 3}px;
|
|
50
|
-
white-space: normal;
|
|
48
|
+
const Title = styled.span `
|
|
49
|
+
font-weight: ${(props) => props.theme.font.weight.semibold};
|
|
51
50
|
`;
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
const MessageRow = styled.div `
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: baseline;
|
|
54
|
+
gap: ${(props) => props.theme.grid.unit * 2}px;
|
|
56
55
|
`;
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
const ActionLink = styled.button `
|
|
57
|
+
font-size: ${(props) => props.theme.font.size.normal};
|
|
58
|
+
color: inherit;
|
|
59
|
+
text-decoration: underline;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
background: none;
|
|
62
|
+
border: none;
|
|
63
|
+
padding: 0;
|
|
61
64
|
`;
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
border: solid 1px ${(props) => props.theme.colors.border.info};
|
|
65
|
-
color: ${(props) => props.theme.colors.text.info};
|
|
65
|
+
const Message = styled.div `
|
|
66
|
+
font-size: ${(props) => props.theme.font.size.normal};
|
|
66
67
|
`;
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
color: ${(props) => props.theme.colors.text.warning};
|
|
68
|
+
const CloseIconButton = styled(IconButton) `
|
|
69
|
+
width: ${(props) => props.theme.grid.unit * 6}px;
|
|
70
|
+
height: ${(props) => props.theme.grid.unit * 6}px;
|
|
71
71
|
`;
|
|
72
|
-
const
|
|
73
|
-
flex: 1 1 auto;
|
|
72
|
+
const CloseAction = styled.div `
|
|
74
73
|
display: flex;
|
|
75
74
|
align-items: center;
|
|
76
|
-
|
|
75
|
+
flex-shrink: 0;
|
|
76
|
+
margin-left: auto;
|
|
77
77
|
`;
|
|
78
|
-
const
|
|
79
|
-
|
|
78
|
+
const DismissButton = styled(IconTextButton) `
|
|
79
|
+
font-size: ${(props) => props.theme.font.size.normal};
|
|
80
|
+
color: inherit;
|
|
80
81
|
`;
|
|
81
|
-
export var AlertMessageType;
|
|
82
|
-
(function (AlertMessageType) {
|
|
83
|
-
AlertMessageType["success"] = "success";
|
|
84
|
-
AlertMessageType["error"] = "error";
|
|
85
|
-
AlertMessageType["warning"] = "warning";
|
|
86
|
-
AlertMessageType["info"] = "info";
|
|
87
|
-
})(AlertMessageType || (AlertMessageType = {}));
|
|
88
|
-
const alertIcons = {
|
|
89
|
-
success: SuccessIcon,
|
|
90
|
-
error: AttentionRedIcon,
|
|
91
|
-
info: AttentionBlueIcon,
|
|
92
|
-
warning: AttentionOrangeIcon,
|
|
93
|
-
};
|
|
94
|
-
const alertContainers = {
|
|
95
|
-
success: SuccessAlertContainer,
|
|
96
|
-
error: ErrorAlertContainer,
|
|
97
|
-
info: InfoAlertContainer,
|
|
98
|
-
warning: WarningAlertContainer,
|
|
99
|
-
};
|
|
100
|
-
export class AlertMessage extends React.Component {
|
|
101
|
-
constructor() {
|
|
102
|
-
super(...arguments);
|
|
103
|
-
this.state = {
|
|
104
|
-
isOpen: true,
|
|
105
|
-
};
|
|
106
|
-
this.handleClose = () => {
|
|
107
|
-
this.setState({ isOpen: false });
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
render() {
|
|
111
|
-
const { hideCloseButton, dismissButton, children, type } = this.props;
|
|
112
|
-
const { isOpen } = this.state;
|
|
113
|
-
const AlertContainer = alertContainers[type];
|
|
114
|
-
const AlertIcon = alertIcons[type];
|
|
115
|
-
return (isOpen && (_jsx(AlertContainer, { className: 'alert-message', children: _jsxs(InnerContainer, { children: [_jsx(InformativeIcon, { children: _jsx(AlertIcon, {}) }), _jsx(TextContainer, { children: children }), dismissButton && (_jsx(TextButton, { onClick: dismissButton.action ? dismissButton.action : this.handleClose, children: dismissButton.text }))] }) })));
|
|
116
|
-
}
|
|
117
|
-
}
|
|
@@ -284,3 +284,17 @@ export const IconButtonGroup = styled.div `
|
|
|
284
284
|
height: ${(props) => props.size || 28}px;
|
|
285
285
|
}
|
|
286
286
|
`;
|
|
287
|
+
export const TextButton = styled(IconTextButton) `
|
|
288
|
+
color: inherit;
|
|
289
|
+
margin-left: ${(props) => props.theme.grid.unit * 4}px;
|
|
290
|
+
|
|
291
|
+
g[fill] {
|
|
292
|
+
fill: currentColor;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&:not([disabled]):focus,
|
|
296
|
+
&:not([disabled]):hover {
|
|
297
|
+
color: inherit;
|
|
298
|
+
filter: brightness(80%);
|
|
299
|
+
}
|
|
300
|
+
`;
|
|
@@ -88,9 +88,7 @@ export const NotificationsBadge = styled(Badge) `
|
|
|
88
88
|
background-color: ${(props) => props.isOpen
|
|
89
89
|
? props.theme.colors.background.success
|
|
90
90
|
: props.theme.colors.brand.default};
|
|
91
|
-
color: ${(props) => props.
|
|
92
|
-
? props.theme.colors.text.success
|
|
93
|
-
: props.theme.colors.text.onDark};
|
|
91
|
+
color: ${(props) => props.theme.colors.text.onDark};
|
|
94
92
|
font-family: ${(props) => props.theme.font.family.sans};
|
|
95
93
|
font-size: 9px;
|
|
96
94
|
margin-left: 4px;
|
|
@@ -51,7 +51,7 @@ export const StyledModal = ({ isOpen, onRequestClose, shouldCloseOnOverlayClick
|
|
|
51
51
|
onRequestClose?.();
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
return createPortal(_jsx(Dialog, { ref: dialogRef, onClick: handleBackdropClick, "$hideOverlay": hideOverlay, "$pointerEventsOnBackdrop": pointerEventsOnBackdrop, className: className, style: style?.content, children: children }), document.body);
|
|
54
|
+
return createPortal(_jsx(Dialog, { ref: dialogRef, onClick: handleBackdropClick, "$hideOverlay": hideOverlay, "$pointerEventsOnBackdrop": pointerEventsOnBackdrop, className: className ? `Modal ${className}` : 'Modal', style: style?.content, children: children }), document.body);
|
|
55
55
|
};
|
|
56
56
|
const Dialog = styled.dialog `
|
|
57
57
|
background: transparent;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
const AttentionBlueIcon = (props) => (
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const AttentionBlueIcon = (props) => (_jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: _jsx("path", { d: "M9 15H11V9H9V15ZM10 0C4.475 0 0 4.475 0 10C0 15.525 4.475 20 10 20C15.525 20 20 15.525 20 10C20 4.475 15.525 0 10 0ZM10 18C5.59 18 2 14.41 2 10C2 5.59 5.59 2 10 2C14.41 2 18 5.59 18 10C18 14.41 14.41 18 10 18ZM9 7H11V5H9V7Z", fill: "#1A9BC7" }) }));
|
|
3
3
|
export default AttentionBlueIcon;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
const AttentionGreenIcon = (props) => (
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const AttentionGreenIcon = (props) => (_jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: _jsx("path", { d: "M20 3.18L8.59 14.6L4.35 10.36L5.76 8.95L8.59 11.78L18.59 1.78L20 3.18ZM17.79 8.22C17.92 8.79 18 9.39 18 10C18 14.42 14.42 18 10 18C5.58 18 2 14.42 2 10C2 5.58 5.58 2 10 2C11.58 2 13.04 2.46 14.28 3.25L15.72 1.81C14.1 0.67 12.13 0 10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 8.81 19.78 7.67 19.4 6.61L17.79 8.22Z", fill: "#31A056" }) }));
|
|
3
3
|
export default AttentionGreenIcon;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
const AttentionOrangeIcon = (props) => (
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const AttentionOrangeIcon = (props) => (_jsx("svg", { width: "22", height: "19", viewBox: "0 0 22 19", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: _jsx("path", { d: "M11 3.99L18.53 17H3.47L11 3.99ZM11 0L0 19H22L11 0ZM12 14H10V16H12V14ZM12 8H10V12H12V8Z", fill: "#FA5700" }) }));
|
|
3
3
|
export default AttentionOrangeIcon;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
const AttentionRedIcon = (props) => (
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const AttentionRedIcon = (props) => (_jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: _jsx("path", { d: "M9 13H11V15H9V13ZM9 5H11V11H9V5ZM9.995 0C4.47 0 0 4.475 0 10C0 15.525 4.47 20 9.995 20C15.52 20 20 15.525 20 10C20 4.475 15.52 0 9.995 0ZM10 18C5.58 18 2 14.42 2 10C2 5.58 5.58 2 10 2C14.42 2 18 5.58 18 10C18 14.42 14.42 18 10 18Z", fill: "#CF1322" }) }));
|
|
3
3
|
export default AttentionRedIcon;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
const ORCIDIcon = (props) => (_jsxs("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", {
|
|
2
|
+
const ORCIDIcon = (props) => (_jsxs("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M32 16c0 8.837-7.163 16-16 16-8.838 0-16-7.163-16-16C0 7.162 7.162 0 16 0c8.837 0 16 7.162 16 16Z", fill: "#A6CE39" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.813 9.637h-5.45v13.9h5.474c4.555 0 7.35-3.378 7.35-6.95 0-1.635-.562-3.372-1.77-4.704-1.215-1.336-3.065-2.246-5.605-2.246ZM18.6 21.3h-2.813v-9.425H18.5c1.823 0 3.12.552 3.96 1.4.842.849 1.252 2.021 1.252 3.312 0 .784-.239 1.967-.993 2.948-.745.969-2.01 1.765-4.119 1.765Zm5.311-4.026c-.251 1.74-1.494 4.276-5.311 4.276h-3.063H18.6c3.817 0 5.06-2.536 5.311-4.276Zm1.812-2.405c-.657-2.601-2.85-4.982-6.91-4.982h-5.2 5.2c4.06 0 6.253 2.38 6.91 4.982Zm.215 1.718ZM8.363 9.675v13.887h2.425V9.675H8.363Zm2.175 13.637H8.612h1.925ZM9.575 8.65c.84 0 1.513-.689 1.513-1.513 0-.823-.673-1.512-1.513-1.512-.838 0-1.512.674-1.512 1.513 0 .823.672 1.512 1.512 1.512Z", fill: "#fff" })] }));
|
|
3
3
|
export default ORCIDIcon;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
export const XIcon = (props) => (
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const XIcon = (props) => (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: _jsx("path", { d: "M14 1.415L12.585 0L7 5.585L1.415 0L0 1.415L5.585 7L0 12.585L1.415 14L7 8.415L12.585 14L14 12.585L8.415 7L14 1.415Z", fill: props.fill || '#353535' }) }));
|
|
3
3
|
export default XIcon;
|
package/dist/es/defaultTheme.js
CHANGED
|
@@ -24,10 +24,10 @@ export const defaultTheme = {
|
|
|
24
24
|
tertiary: colors.mercuryGrey,
|
|
25
25
|
fifth: colors.manuscriptsXLight2,
|
|
26
26
|
dark: 'rgba(0,0,0,0.5)',
|
|
27
|
-
error: colors.
|
|
28
|
-
info: colors.
|
|
29
|
-
success: colors.
|
|
30
|
-
warning: colors.
|
|
27
|
+
error: colors.chablisRed,
|
|
28
|
+
info: colors.aliceBlue,
|
|
29
|
+
success: colors.veryLightGreen,
|
|
30
|
+
warning: colors.veryLightYellow,
|
|
31
31
|
selected: colors.aliceBlue,
|
|
32
32
|
muted: colors.greyMuted,
|
|
33
33
|
tracked: {
|
|
@@ -37,10 +37,10 @@ export const defaultTheme = {
|
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
border: {
|
|
40
|
-
error: colors.
|
|
41
|
-
info: colors.
|
|
42
|
-
success: colors.
|
|
43
|
-
warning: colors.
|
|
40
|
+
error: colors.contrastRed,
|
|
41
|
+
info: colors.jellyBeanBlue,
|
|
42
|
+
success: colors.contrastGreen,
|
|
43
|
+
warning: colors.contrastOrange,
|
|
44
44
|
primary: colors.manuscriptsLight,
|
|
45
45
|
secondary: colors.mercuryGrey,
|
|
46
46
|
tertiary: colors.seashellGrey,
|
|
@@ -144,7 +144,7 @@ export const defaultTheme = {
|
|
|
144
144
|
error: colors.punchRed,
|
|
145
145
|
info: colors.jellyBeanBlue,
|
|
146
146
|
success: colors.killarneyGreen,
|
|
147
|
-
warning: colors.
|
|
147
|
+
warning: colors.contrastOrange
|
|
148
148
|
},
|
|
149
149
|
outline: {
|
|
150
150
|
focus: colors.focusBlue,
|
package/dist/types/colors.d.ts
CHANGED
|
@@ -39,9 +39,14 @@ export declare const punchRed = "#f35143";
|
|
|
39
39
|
export declare const mandysRed = "#f5c1b7";
|
|
40
40
|
export declare const chablisRed = "#fff1f0";
|
|
41
41
|
export declare const darkRed = "#c74237";
|
|
42
|
+
export declare const contrastRed = "#cf1322";
|
|
42
43
|
export declare const killarneyGreen = "#36b260";
|
|
43
44
|
export declare const springGreen = "#b2c0ac";
|
|
44
45
|
export declare const peppermintGreen = "#dff0d7";
|
|
45
|
-
export declare const
|
|
46
|
+
export declare const veryLightGreen = "#eefbe9";
|
|
47
|
+
export declare const contrastGreen = "#31a056";
|
|
46
48
|
export declare const wheatYellow = "#ffe0b2";
|
|
47
49
|
export declare const butteryYellow = "#fffcdb";
|
|
50
|
+
export declare const contrastOrange = "#fa5700";
|
|
51
|
+
export declare const veryLightYellow = "#fff9e5";
|
|
52
|
+
export declare const zestOrange = "#fe8f1f";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ©
|
|
2
|
+
* © 2026 Atypon Systems LLC
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -14,35 +14,22 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import React from 'react';
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
mini?: boolean;
|
|
23
|
-
}, "type">;
|
|
24
|
-
interface State {
|
|
25
|
-
isOpen: boolean;
|
|
17
|
+
export type AlertVariant = 'success' | 'error' | 'info' | 'warning';
|
|
18
|
+
interface AlertLink {
|
|
19
|
+
label: string;
|
|
20
|
+
onClick: () => void;
|
|
26
21
|
}
|
|
27
|
-
interface
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
type: AlertMessageType;
|
|
39
|
-
dismissButton?: Dismiss;
|
|
40
|
-
hideCloseButton?: boolean;
|
|
41
|
-
children: React.ReactNode;
|
|
42
|
-
}
|
|
43
|
-
export declare class AlertMessage extends React.Component<Props, State> {
|
|
44
|
-
state: State;
|
|
45
|
-
render(): false | import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
private handleClose;
|
|
22
|
+
export interface AlertMessageProps {
|
|
23
|
+
title?: string;
|
|
24
|
+
message: string;
|
|
25
|
+
variant: 'success' | 'error' | 'info' | 'warning';
|
|
26
|
+
link?: AlertLink;
|
|
27
|
+
closeConfig?: {
|
|
28
|
+
onClick?: () => void;
|
|
29
|
+
variant?: 'icon' | 'text';
|
|
30
|
+
label?: string;
|
|
31
|
+
};
|
|
32
|
+
className?: string;
|
|
47
33
|
}
|
|
34
|
+
export declare const AlertMessage: React.FC<AlertMessageProps>;
|
|
48
35
|
export {};
|
|
@@ -106,3 +106,10 @@ export declare const ButtonGroup: import("styled-components").StyledComponent<"d
|
|
|
106
106
|
export declare const IconButtonGroup: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
107
107
|
size?: number;
|
|
108
108
|
}, never>;
|
|
109
|
+
export declare const TextButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
110
|
+
type: "button" | "submit" | "reset";
|
|
111
|
+
} & {
|
|
112
|
+
danger?: boolean;
|
|
113
|
+
disabled?: boolean;
|
|
114
|
+
mini?: boolean;
|
|
115
|
+
}, "type">;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/style-guide",
|
|
3
3
|
"description": "Shared components for Manuscripts applications",
|
|
4
|
-
"version": "3.5.
|
|
4
|
+
"version": "3.5.9",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|