@conduction/components 2.2.25 → 2.2.26

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
@@ -4,6 +4,7 @@
4
4
 
5
5
  - **Version 2.2 (breaking changes from 2.1.x)**
6
6
 
7
+ - 2.2.26: Updated NotificationPopUp secondary button to have hover and href.
7
8
  - 2.2.25:
8
9
  - Added box-shadow to CardWrapper.
9
10
  - Added item border-radius to PrimaryTopNav.
@@ -6,14 +6,15 @@ export interface NotificationPopUpProps {
6
6
  hide: () => void;
7
7
  primaryButton: {
8
8
  label: string;
9
- icon?: JSX.Element;
10
9
  handleClick: () => any;
10
+ icon?: JSX.Element;
11
11
  layoutClassName?: string;
12
12
  };
13
13
  secondaryButton?: {
14
14
  label: string;
15
- icon?: JSX.Element;
16
15
  handleClick: () => any;
16
+ href: string;
17
+ icon?: JSX.Element;
17
18
  layoutClassName?: string;
18
19
  };
19
20
  layoutClassName?: string;
@@ -17,7 +17,9 @@ export const NotificationPopUp = ({ title, description, isVisible, hide, primary
17
17
  setAnimationVisible(true);
18
18
  }, animationDuration);
19
19
  };
20
- const modal = (_jsxs("div", { style: { animationDuration: `${animationDuration}ms` }, className: clsx(styles.modal, animationVisible && styles.visible, layoutClassName), children: [_jsx(Heading3, { children: title }), _jsx(Paragraph, { children: description }), _jsxs("div", { className: styles.buttons, children: [secondaryButton && (_jsx("div", { onClick: () => handleClick(secondaryButton.handleClick), className: secondaryButton.layoutClassName, children: _jsxs(Link, { className: styles.link, children: [secondaryButton.icon ?? _jsx(FontAwesomeIcon, { icon: faClose }), secondaryButton.label] }) })), _jsxs(Button, { onClick: () => handleClick(primaryButton.handleClick), className: clsx(styles.button, primaryButton.layoutClassName), children: [primaryButton.icon ?? _jsx(FontAwesomeIcon, { icon: faArrowRight }), primaryButton.label] })] })] }));
20
+ const modal = (_jsxs("div", { style: { animationDuration: `${animationDuration}ms` }, className: clsx(styles.modal, animationVisible && styles.visible, layoutClassName), children: [_jsx(Heading3, { children: title }), _jsx(Paragraph, { children: description }), _jsxs("div", { className: styles.buttons, children: [secondaryButton && (_jsx("div", { className: secondaryButton.layoutClassName, children: _jsxs(Link, { onClick: (e) => {
21
+ e.preventDefault(), handleClick(secondaryButton.handleClick);
22
+ }, className: styles.link, href: secondaryButton.href, children: [secondaryButton.icon ?? _jsx(FontAwesomeIcon, { icon: faClose }), secondaryButton.label] }) })), _jsxs(Button, { onClick: () => handleClick(primaryButton.handleClick), className: clsx(styles.button, primaryButton.layoutClassName), children: [primaryButton.icon ?? _jsx(FontAwesomeIcon, { icon: faArrowRight }), primaryButton.label] })] })] }));
21
23
  return isVisible ? ReactDOM.createPortal(modal, document.body) : null;
22
24
  };
23
25
  export const NotificationPopUpController = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.2.25",
3
+ "version": "2.2.26",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  "@fortawesome/fontawesome-svg-core": "^6.2.0",
24
24
  "@fortawesome/free-solid-svg-icons": "^6.2.0",
25
25
  "@fortawesome/react-fontawesome": "^0.2.0",
26
- "@utrecht/component-library-react": "^1.0.0-alpha.319",
26
+ "@utrecht/component-library-react": "1.0.0-alpha.394",
27
27
  "clsx": "^1.1.1",
28
28
  "gatsby": "^4.11.1",
29
29
  "react": "^18.2.0",
@@ -13,14 +13,15 @@ export interface NotificationPopUpProps {
13
13
  hide: () => void;
14
14
  primaryButton: {
15
15
  label: string;
16
- icon?: JSX.Element;
17
16
  handleClick: () => any;
17
+ icon?: JSX.Element;
18
18
  layoutClassName?: string;
19
19
  };
20
20
  secondaryButton?: {
21
21
  label: string;
22
- icon?: JSX.Element;
23
22
  handleClick: () => any;
23
+ href: string;
24
+ icon?: JSX.Element;
24
25
  layoutClassName?: string;
25
26
  };
26
27
  layoutClassName?: string;
@@ -59,8 +60,14 @@ export const NotificationPopUp = ({
59
60
 
60
61
  <div className={styles.buttons}>
61
62
  {secondaryButton && (
62
- <div onClick={() => handleClick(secondaryButton.handleClick)} className={secondaryButton.layoutClassName}>
63
- <Link className={styles.link}>
63
+ <div className={secondaryButton.layoutClassName}>
64
+ <Link
65
+ onClick={(e) => {
66
+ e.preventDefault(), handleClick(secondaryButton.handleClick);
67
+ }}
68
+ className={styles.link}
69
+ href={secondaryButton.href}
70
+ >
64
71
  {secondaryButton.icon ?? <FontAwesomeIcon icon={faClose} />}
65
72
  {secondaryButton.label}
66
73
  </Link>