@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 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`.
@@ -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.zestOrange = exports.peppermintGreen = exports.springGreen = exports.killarneyGreen = 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;
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.zestOrange = '#fe8f1f';
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 = exports.AlertMessageType = exports.TextButton = void 0;
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 = __importStar(require("styled-components"));
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 buttonStyles = (0, styled_components_1.css) `
46
- color: inherit;
47
- margin-left: ${(props) => props.theme.grid.unit * 4}px;
48
-
49
- g[fill] {
50
- fill: currentColor;
51
- }
52
-
53
- &:not([disabled]):focus,
54
- &:not([disabled]):hover {
55
- color: inherit;
56
- filter: brightness(80%);
57
- }
58
- `;
59
- exports.TextButton = (0, styled_components_1.default)(Button_1.IconTextButton) `
60
- ${buttonStyles}
61
- `;
62
- const CloseIconButton = (0, styled_components_1.default)(Button_1.IconButton).attrs({
63
- defaultColor: true,
64
- size: 16,
65
- }) `
66
- ${buttonStyles}
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 InformativeIcon = styled_components_1.default.div `
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-items: center;
47
+ align-self: ${(props) => (props.$hasTitle ? 'flex-start' : 'center')};
73
48
  `;
74
- const InnerContainer = styled_components_1.default.div `
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 BaseAlertContainer = styled_components_1.default.div `
80
- align-items: center;
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 SuccessAlertContainer = (0, styled_components_1.default)(BaseAlertContainer) `
92
- background-color: ${(props) => props.theme.colors.background.success};
93
- border: solid 1px ${(props) => props.theme.colors.border.success};
94
- color: ${(props) => props.theme.colors.text.success};
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 ErrorAlertContainer = (0, styled_components_1.default)(BaseAlertContainer) `
97
- background-color: ${(props) => props.theme.colors.background.error};
98
- border: solid 1px ${(props) => props.theme.colors.border.error};
99
- color: ${(props) => props.theme.colors.text.error};
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 InfoAlertContainer = (0, styled_components_1.default)(BaseAlertContainer) `
102
- background-color: ${(props) => props.theme.colors.background.info};
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 WarningAlertContainer = (0, styled_components_1.default)(BaseAlertContainer) `
107
- background-color: ${(props) => props.theme.colors.background.warning};
108
- border: solid 1px ${(props) => props.theme.colors.border.warning};
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 TextContainer = styled_components_1.default.div `
112
- flex: 1 1 auto;
79
+ const CloseAction = styled_components_1.default.div `
113
80
  display: flex;
114
81
  align-items: center;
115
- word-break: break-word;
82
+ flex-shrink: 0;
83
+ margin-left: auto;
116
84
  `;
117
- const SuccessIcon = (0, styled_components_1.default)(icons_1.AttentionGreenIcon) `
118
- transform: scale(0.75, 0.75);
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.isOpen
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.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("g", { clipPath: "url(#clip0_62_49)", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.201 17.799 1.5 12 1.5C6.201 1.5 1.5 6.201 1.5 12C1.5 17.799 6.2 22.5 12 22.5ZM12 24C18.627 24 24 18.627 24 12C24 5.373 18.627 0 12 0C5.373 0 0 5.373 0 12C0 18.627 5.372 24 12 24ZM12 8C11.7348 8 11.4804 7.89464 11.2929 7.70711C11.1054 7.51957 11 7.26522 11 7C11 6.73478 11.1054 6.48043 11.2929 6.29289C11.4804 6.10536 11.7348 6 12 6C12.2652 6 12.5196 6.10536 12.7071 6.29289C12.8946 6.48043 13 6.73478 13 7C13 7.26522 12.8946 7.51957 12.7071 7.70711C12.5196 7.89464 12.2652 8 12 8ZM12.02 18.2C11.7813 18.2 11.5524 18.1052 11.3836 17.9364C11.2148 17.7676 11.12 17.5387 11.12 17.3V10.1C11.12 9.86131 11.2148 9.63239 11.3836 9.4636C11.5524 9.29482 11.7813 9.2 12.02 9.2C12.2587 9.2 12.4876 9.29482 12.6564 9.4636C12.8252 9.63239 12.92 9.86131 12.92 10.1V17.3C12.92 17.5387 12.8252 17.7676 12.6564 17.9364C12.4876 18.1052 12.2587 18.2 12.02 18.2Z", fill: "#1A9BC7" }) }), (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: "clip0_62_49", children: (0, jsx_runtime_1.jsx)("rect", { width: "24", height: "24", fill: "white" }) }) })] }));
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.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("path", { d: "M11.9998 0C5.38278 0 0 5.3832 0 12C0 18.6168 5.38278 24 11.9998 24C18.6167 24 24 18.6168 24 12C24 5.3832 18.6167 0 11.9998 0ZM11.9998 22.4262C6.2508 22.4262 1.5738 17.749 1.5738 12C1.5738 6.25098 6.25074 1.57386 11.9998 1.57386C17.7488 1.57386 22.426 6.25104 22.426 12C22.4261 17.749 17.7487 22.4262 11.9998 22.4262Z", fill: "#36B260" }), (0, jsx_runtime_1.jsx)("path", { d: "M16.3444 8.07156L10.1565 14.2591L7.65515 11.7583C7.34777 11.4513 6.84983 11.4511 6.54245 11.7585C6.23495 12.066 6.23495 12.564 6.54245 12.8714L9.60023 15.9287C9.75389 16.0822 9.95519 16.159 10.1565 16.159C10.3578 16.159 10.5596 16.0822 10.7132 15.9284L10.7149 15.9263L17.457 9.18426C17.7645 8.87706 17.7645 8.3787 17.457 8.0715C17.1497 7.76412 16.6514 7.76412 16.3444 8.07156Z", fill: "#36B260" })] }));
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.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsxs)("g", { clipPath: "url(#clip0_62_51)", children: [(0, jsx_runtime_1.jsx)("path", { d: "M12 19.7C12.5523 19.7 13 19.2523 13 18.7C13 18.1477 12.5523 17.7 12 17.7C11.4477 17.7 11 18.1477 11 18.7C11 19.2523 11.4477 19.7 12 19.7Z", fill: "#FE8F1F" }), (0, jsx_runtime_1.jsx)("path", { d: "M12.92 8.4C12.92 7.90294 12.5171 7.5 12.02 7.5C11.5229 7.5 11.12 7.90294 11.12 8.4V15.6C11.12 16.0971 11.5229 16.5 12.02 16.5C12.5171 16.5 12.92 16.0971 12.92 15.6V8.4Z", fill: "#FE8F1F" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.901 1.98001L22.311 21.567C22.3842 21.7193 22.4176 21.8877 22.408 22.0565C22.3985 22.2252 22.3463 22.3888 22.2564 22.5319C22.1666 22.675 22.0419 22.793 21.894 22.8748C21.7462 22.9567 21.58 22.9998 21.411 23H2.59C2.42092 22.9999 2.25461 22.957 2.10663 22.8752C1.95865 22.7934 1.83382 22.6754 1.74383 22.5323C1.65383 22.3891 1.60159 22.2255 1.592 22.0567C1.58241 21.8879 1.61579 21.7194 1.689 21.567L11.099 1.98101C11.1807 1.8114 11.3085 1.66828 11.4679 1.56812C11.6273 1.46796 11.8118 1.41483 12 1.41483C12.1882 1.41483 12.3727 1.46796 12.5321 1.56812C12.6915 1.66828 12.8193 1.8114 12.901 1.98101V1.98001Z", stroke: "#FE8F1F", strokeWidth: "1.5" })] }), (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: "clip0_62_51", children: (0, jsx_runtime_1.jsx)("rect", { width: "24", height: "24", fill: "white" }) }) })] }));
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.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("g", { clipPath: "url(#clip0_62_44)", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 1.5C17.799 1.5 22.5 6.201 22.5 12C22.5 17.799 17.799 22.5 12 22.5C6.201 22.5 1.5 17.799 1.5 12C1.5 6.201 6.2 1.5 12 1.5ZM12 0C18.627 0 24 5.373 24 12C24 18.627 18.627 24 12 24C5.373 24 0 18.627 0 12C0 5.373 5.372 0 12 0ZM12 16.2C11.7348 16.2 11.4804 16.3054 11.2929 16.4929C11.1054 16.6804 11 16.9348 11 17.2C11 17.4652 11.1054 17.7196 11.2929 17.9071C11.4804 18.0946 11.7348 18.2 12 18.2C12.2652 18.2 12.5196 18.0946 12.7071 17.9071C12.8946 17.7196 13 17.4652 13 17.2C13 16.9348 12.8946 16.6804 12.7071 16.4929C12.5196 16.3054 12.2652 16.2 12 16.2ZM12.02 6C11.7813 6 11.5524 6.09482 11.3836 6.2636C11.2148 6.43239 11.12 6.66131 11.12 6.9V14.1C11.12 14.3387 11.2148 14.5676 11.3836 14.7364C11.5524 14.9052 11.7813 15 12.02 15C12.2587 15 12.4876 14.9052 12.6564 14.7364C12.8252 14.5676 12.92 14.3387 12.92 14.1V6.9C12.92 6.66131 12.8252 6.43239 12.6564 6.2636C12.4876 6.09482 12.2587 6 12.02 6Z", fill: "#F35143" }) }), (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: "clip0_62_44", children: (0, jsx_runtime_1.jsx)("rect", { width: "24", height: "24", fill: "white" }) }) })] }));
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", { "fill-rule": "evenodd", "clip-rule": "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", { "fill-rule": "evenodd", "clip-rule": "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" })] }));
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.jsxs)("svg", { width: 30, height: 30, viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.34921 12.4923C3.01447 12.1576 3.01447 11.6187 3.34921 11.2839L12.7654 \n 1.86772C13.1001 1.53298 13.639 1.53298 13.9738 1.86772C14.3085 2.20246 \n 14.3085 2.74135 13.9738 3.07609L4.55758 12.4923C4.22284 12.8271 3.68395 \n 12.8271 3.34921 12.4923Z" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.34921 1.86667C3.01447 2.20141 3.01447 2.74029 3.34921 3.07503L12.7654 \n 12.4913C13.1001 12.826 13.639 12.826 13.9738 12.4913C14.3085 12.1565 \n 14.3085 11.6176 13.9738 11.2829L4.55758 1.86667C4.22284 1.53193 3.68395 \n 1.53193 3.34921 1.86667Z" })] }));
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;
@@ -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.mandysRed,
64
- info: colors.manuscriptsXLight2,
65
- success: colors.peppermintGreen,
66
- warning: colors.wheatYellow,
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.mandysRed,
77
- info: colors.manuscriptsBlue,
78
- success: colors.springGreen,
79
- warning: colors.wheatYellow,
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.zestOrange,
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 zestOrange = '#fe8f1f';
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, { css } from 'styled-components';
3
+ import styled from 'styled-components';
4
4
  import { IconButton, IconTextButton } from './Button';
5
- import { AttentionBlueIcon, AttentionGreenIcon, AttentionOrangeIcon, AttentionRedIcon, } from './icons';
6
- const buttonStyles = css `
7
- color: inherit;
8
- margin-left: ${(props) => props.theme.grid.unit * 4}px;
9
-
10
- g[fill] {
11
- fill: currentColor;
12
- }
13
-
14
- &:not([disabled]):focus,
15
- &:not([disabled]):hover {
16
- color: inherit;
17
- filter: brightness(80%);
18
- }
19
- `;
20
- export const TextButton = styled(IconTextButton) `
21
- ${buttonStyles}
22
- `;
23
- const CloseIconButton = styled(IconButton).attrs({
24
- defaultColor: true,
25
- size: 16,
26
- }) `
27
- ${buttonStyles}
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 InformativeIcon = styled.div `
30
- height: 24px;
31
- margin-right: ${(props) => props.theme.grid.unit * 3}px;
38
+ const IconWrapper = styled.div `
32
39
  display: flex;
33
- align-items: center;
40
+ align-self: ${(props) => (props.$hasTitle ? 'flex-start' : 'center')};
34
41
  `;
35
- const InnerContainer = styled.div `
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 BaseAlertContainer = styled.div `
41
- align-items: center;
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 SuccessAlertContainer = styled(BaseAlertContainer) `
53
- background-color: ${(props) => props.theme.colors.background.success};
54
- border: solid 1px ${(props) => props.theme.colors.border.success};
55
- color: ${(props) => props.theme.colors.text.success};
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 ErrorAlertContainer = styled(BaseAlertContainer) `
58
- background-color: ${(props) => props.theme.colors.background.error};
59
- border: solid 1px ${(props) => props.theme.colors.border.error};
60
- color: ${(props) => props.theme.colors.text.error};
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 InfoAlertContainer = styled(BaseAlertContainer) `
63
- background-color: ${(props) => props.theme.colors.background.info};
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 WarningAlertContainer = styled(BaseAlertContainer) `
68
- background-color: ${(props) => props.theme.colors.background.warning};
69
- border: solid 1px ${(props) => props.theme.colors.border.warning};
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 TextContainer = styled.div `
73
- flex: 1 1 auto;
72
+ const CloseAction = styled.div `
74
73
  display: flex;
75
74
  align-items: center;
76
- word-break: break-word;
75
+ flex-shrink: 0;
76
+ margin-left: auto;
77
77
  `;
78
- const SuccessIcon = styled(AttentionGreenIcon) `
79
- transform: scale(0.75, 0.75);
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.isOpen
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, jsxs as _jsxs } from "react/jsx-runtime";
2
- const AttentionBlueIcon = (props) => (_jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("g", { clipPath: "url(#clip0_62_49)", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.201 17.799 1.5 12 1.5C6.201 1.5 1.5 6.201 1.5 12C1.5 17.799 6.2 22.5 12 22.5ZM12 24C18.627 24 24 18.627 24 12C24 5.373 18.627 0 12 0C5.373 0 0 5.373 0 12C0 18.627 5.372 24 12 24ZM12 8C11.7348 8 11.4804 7.89464 11.2929 7.70711C11.1054 7.51957 11 7.26522 11 7C11 6.73478 11.1054 6.48043 11.2929 6.29289C11.4804 6.10536 11.7348 6 12 6C12.2652 6 12.5196 6.10536 12.7071 6.29289C12.8946 6.48043 13 6.73478 13 7C13 7.26522 12.8946 7.51957 12.7071 7.70711C12.5196 7.89464 12.2652 8 12 8ZM12.02 18.2C11.7813 18.2 11.5524 18.1052 11.3836 17.9364C11.2148 17.7676 11.12 17.5387 11.12 17.3V10.1C11.12 9.86131 11.2148 9.63239 11.3836 9.4636C11.5524 9.29482 11.7813 9.2 12.02 9.2C12.2587 9.2 12.4876 9.29482 12.6564 9.4636C12.8252 9.63239 12.92 9.86131 12.92 10.1V17.3C12.92 17.5387 12.8252 17.7676 12.6564 17.9364C12.4876 18.1052 12.2587 18.2 12.02 18.2Z", fill: "#1A9BC7" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_62_49", children: _jsx("rect", { width: "24", height: "24", fill: "white" }) }) })] }));
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, jsxs as _jsxs } from "react/jsx-runtime";
2
- const AttentionGreenIcon = (props) => (_jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { d: "M11.9998 0C5.38278 0 0 5.3832 0 12C0 18.6168 5.38278 24 11.9998 24C18.6167 24 24 18.6168 24 12C24 5.3832 18.6167 0 11.9998 0ZM11.9998 22.4262C6.2508 22.4262 1.5738 17.749 1.5738 12C1.5738 6.25098 6.25074 1.57386 11.9998 1.57386C17.7488 1.57386 22.426 6.25104 22.426 12C22.4261 17.749 17.7487 22.4262 11.9998 22.4262Z", fill: "#36B260" }), _jsx("path", { d: "M16.3444 8.07156L10.1565 14.2591L7.65515 11.7583C7.34777 11.4513 6.84983 11.4511 6.54245 11.7585C6.23495 12.066 6.23495 12.564 6.54245 12.8714L9.60023 15.9287C9.75389 16.0822 9.95519 16.159 10.1565 16.159C10.3578 16.159 10.5596 16.0822 10.7132 15.9284L10.7149 15.9263L17.457 9.18426C17.7645 8.87706 17.7645 8.3787 17.457 8.0715C17.1497 7.76412 16.6514 7.76412 16.3444 8.07156Z", fill: "#36B260" })] }));
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, jsxs as _jsxs } from "react/jsx-runtime";
2
- const AttentionOrangeIcon = (props) => (_jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsxs("g", { clipPath: "url(#clip0_62_51)", children: [_jsx("path", { d: "M12 19.7C12.5523 19.7 13 19.2523 13 18.7C13 18.1477 12.5523 17.7 12 17.7C11.4477 17.7 11 18.1477 11 18.7C11 19.2523 11.4477 19.7 12 19.7Z", fill: "#FE8F1F" }), _jsx("path", { d: "M12.92 8.4C12.92 7.90294 12.5171 7.5 12.02 7.5C11.5229 7.5 11.12 7.90294 11.12 8.4V15.6C11.12 16.0971 11.5229 16.5 12.02 16.5C12.5171 16.5 12.92 16.0971 12.92 15.6V8.4Z", fill: "#FE8F1F" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.901 1.98001L22.311 21.567C22.3842 21.7193 22.4176 21.8877 22.408 22.0565C22.3985 22.2252 22.3463 22.3888 22.2564 22.5319C22.1666 22.675 22.0419 22.793 21.894 22.8748C21.7462 22.9567 21.58 22.9998 21.411 23H2.59C2.42092 22.9999 2.25461 22.957 2.10663 22.8752C1.95865 22.7934 1.83382 22.6754 1.74383 22.5323C1.65383 22.3891 1.60159 22.2255 1.592 22.0567C1.58241 21.8879 1.61579 21.7194 1.689 21.567L11.099 1.98101C11.1807 1.8114 11.3085 1.66828 11.4679 1.56812C11.6273 1.46796 11.8118 1.41483 12 1.41483C12.1882 1.41483 12.3727 1.46796 12.5321 1.56812C12.6915 1.66828 12.8193 1.8114 12.901 1.98101V1.98001Z", stroke: "#FE8F1F", strokeWidth: "1.5" })] }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_62_51", children: _jsx("rect", { width: "24", height: "24", fill: "white" }) }) })] }));
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, jsxs as _jsxs } from "react/jsx-runtime";
2
- const AttentionRedIcon = (props) => (_jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("g", { clipPath: "url(#clip0_62_44)", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 1.5C17.799 1.5 22.5 6.201 22.5 12C22.5 17.799 17.799 22.5 12 22.5C6.201 22.5 1.5 17.799 1.5 12C1.5 6.201 6.2 1.5 12 1.5ZM12 0C18.627 0 24 5.373 24 12C24 18.627 18.627 24 12 24C5.373 24 0 18.627 0 12C0 5.373 5.372 0 12 0ZM12 16.2C11.7348 16.2 11.4804 16.3054 11.2929 16.4929C11.1054 16.6804 11 16.9348 11 17.2C11 17.4652 11.1054 17.7196 11.2929 17.9071C11.4804 18.0946 11.7348 18.2 12 18.2C12.2652 18.2 12.5196 18.0946 12.7071 17.9071C12.8946 17.7196 13 17.4652 13 17.2C13 16.9348 12.8946 16.6804 12.7071 16.4929C12.5196 16.3054 12.2652 16.2 12 16.2ZM12.02 6C11.7813 6 11.5524 6.09482 11.3836 6.2636C11.2148 6.43239 11.12 6.66131 11.12 6.9V14.1C11.12 14.3387 11.2148 14.5676 11.3836 14.7364C11.5524 14.9052 11.7813 15 12.02 15C12.2587 15 12.4876 14.9052 12.6564 14.7364C12.8252 14.5676 12.92 14.3387 12.92 14.1V6.9C12.92 6.66131 12.8252 6.43239 12.6564 6.2636C12.4876 6.09482 12.2587 6 12.02 6Z", fill: "#F35143" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_62_44", children: _jsx("rect", { width: "24", height: "24", fill: "white" }) }) })] }));
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", { "fill-rule": "evenodd", "clip-rule": "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", { "fill-rule": "evenodd", "clip-rule": "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" })] }));
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, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const XIcon = (props) => (_jsxs("svg", { width: 30, height: 30, viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.34921 12.4923C3.01447 12.1576 3.01447 11.6187 3.34921 11.2839L12.7654 \n 1.86772C13.1001 1.53298 13.639 1.53298 13.9738 1.86772C14.3085 2.20246 \n 14.3085 2.74135 13.9738 3.07609L4.55758 12.4923C4.22284 12.8271 3.68395 \n 12.8271 3.34921 12.4923Z" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.34921 1.86667C3.01447 2.20141 3.01447 2.74029 3.34921 3.07503L12.7654 \n 12.4913C13.1001 12.826 13.639 12.826 13.9738 12.4913C14.3085 12.1565 \n 14.3085 11.6176 13.9738 11.2829L4.55758 1.86667C4.22284 1.53193 3.68395 \n 1.53193 3.34921 1.86667Z" })] }));
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;
@@ -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.mandysRed,
28
- info: colors.manuscriptsXLight2,
29
- success: colors.peppermintGreen,
30
- warning: colors.wheatYellow,
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.mandysRed,
41
- info: colors.manuscriptsBlue,
42
- success: colors.springGreen,
43
- warning: colors.wheatYellow,
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.zestOrange,
147
+ warning: colors.contrastOrange
148
148
  },
149
149
  outline: {
150
150
  focus: colors.focusBlue,
@@ -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 zestOrange = "#fe8f1f";
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
- * © 2019 Atypon Systems LLC
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 declare const TextButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
18
- type: "button" | "submit" | "reset";
19
- } & {
20
- danger?: boolean;
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 Dismiss {
28
- text: string;
29
- action?: () => void;
30
- }
31
- export declare enum AlertMessageType {
32
- success = "success",
33
- error = "error",
34
- warning = "warning",
35
- info = "info"
36
- }
37
- interface Props {
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.7",
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",