@conduction/components 2.2.22 → 2.2.24

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,8 +4,12 @@
4
4
 
5
5
  - **Version 2.2 (breaking changes from 2.1.x)**
6
6
 
7
+ - 2.2.24:
8
+ - Added DisplaySwitch component.
9
+ - Removed align hover state on card-header.
10
+ - 2.2.23: Added Logo component.
7
11
  - 2.2.22: Updated Jumbotron component to be more customizable.
8
- - 2.2.21:
12
+ - 2.2.21:
9
13
  - Removed warning from HorizontalOverflowWrapper.
10
14
  - Added Jumbotron component.
11
15
  - Updated card-header to align hover states.
@@ -24,16 +24,6 @@
24
24
  border-bottom-color: var(--conduction-card-header-hover-border-bottom-color);
25
25
  }
26
26
 
27
- .container:before {
28
- z-index: 1;
29
- content: "";
30
- position: absolute;
31
- top: 0;
32
- right: 0;
33
- bottom: 0;
34
- left: 0;
35
- }
36
-
37
27
  .title > * {
38
28
  color: var(--conduction-card-header-title-color) !important;
39
29
  }
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { IconPrefix, IconName } from "@fortawesome/fontawesome-svg-core";
3
+ interface DisplaySwitchProps {
4
+ buttons: DisplaySwitchButtonProps[];
5
+ layoutClassName?: string;
6
+ }
7
+ interface DisplaySwitchButtonProps {
8
+ label: string;
9
+ pressed: boolean;
10
+ handleClick: () => any;
11
+ icon?: {
12
+ name: IconName;
13
+ prefix: IconPrefix;
14
+ };
15
+ }
16
+ export declare type IDisplaySwitchButton = DisplaySwitchButtonProps;
17
+ declare const DisplaySwitch: React.FC<DisplaySwitchProps>;
18
+ export default DisplaySwitch;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as styles from "./DisplaySwitch.module.css";
3
+ import clsx from "clsx";
4
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
5
+ import { Button, ButtonGroup } from "@utrecht/component-library-react/dist/css-module";
6
+ const DisplaySwitch = ({ layoutClassName, buttons }) => {
7
+ return (_jsx(ButtonGroup, { className: clsx(styles.displaySwitchButtons, [layoutClassName] && layoutClassName), children: buttons.map((button, idx) => {
8
+ // TODO: Once the Rotterdam design system supports the "pressed" state,
9
+ // remove the `appereance` switch, and use the same appearance for each button.
10
+ return (_jsxs(Button, { pressed: button.pressed, appearance: button.pressed ? "secondary-action-button" : "subtle-button", onClick: button.handleClick, children: [button.icon && _jsx(FontAwesomeIcon, { icon: [button.icon.prefix, button.icon.name] }), _jsx("span", { children: button.label })] }, idx));
11
+ }) }));
12
+ };
13
+ export default DisplaySwitch;
@@ -0,0 +1,3 @@
1
+ .displaySwitchButtons {
2
+ align-items: center;
3
+ }
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  interface LogoProps {
3
- layoutClassName: string;
4
- href?: string;
3
+ variant?: "header" | "footer";
4
+ onClick?: () => any;
5
+ layoutClassName?: string;
5
6
  }
6
- export declare const AuthenticatedLogo: ({ layoutClassName, href }: LogoProps) => JSX.Element;
7
- export declare const UnauthenticatedLogo: ({ layoutClassName, href }: LogoProps) => JSX.Element;
7
+ export declare const Logo: React.FC<LogoProps>;
8
8
  export {};
@@ -1,10 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import { Link } from "gatsby";
4
2
  import * as styles from "./Logo.module.css";
5
- export const AuthenticatedLogo = ({ layoutClassName, href }) => {
6
- return (_jsx(Link, { className: styles.logoContainer, to: href ?? "#", children: _jsx("div", { className: clsx(styles.authenticatedLogo, styles.logo, layoutClassName) }) }));
7
- };
8
- export const UnauthenticatedLogo = ({ layoutClassName, href }) => {
9
- return (_jsx(Link, { className: styles.logoContainer, to: href ?? "#", children: _jsx("div", { className: clsx(styles.unauthenticatedLogo, styles.logo, layoutClassName) }) }));
3
+ import clsx from "clsx";
4
+ export const Logo = ({ onClick, layoutClassName, variant = "header" }) => {
5
+ return (_jsx("div", { className: clsx(styles.container, styles[variant], [
6
+ onClick && styles.clickable,
7
+ layoutClassName && layoutClassName,
8
+ ]), ...{ onClick } }));
10
9
  };
@@ -1,15 +1,31 @@
1
- .logoContainer {
2
- height: 100%;
3
- }
4
-
5
- .logo {
6
- background-size: 100% 100%;
7
- }
8
-
9
- .authenticatedLogo {
10
- background-image: var(--conduction-authenticated-logo-background);
11
- }
12
-
13
- .unauthenticatedLogo {
14
- background-image: var(--conduction-unauthenticated-logo-background);
15
- }
1
+ :root {
2
+ --conduction-logo-header-inline-size: 220px;
3
+ --conduction-logo-header-block-size: 40px;
4
+ --conduction-logo-header-background-image: url("https://conduction.nl/wp-content/uploads/2021/07/cropped-conductionlogo-1.png");
5
+
6
+ --conduction-logo-footer-inline-size: 330px;
7
+ --conduction-logo-footer-block-size: 60px;
8
+ --conduction-logo-footer-background-image: url("https://conduction.nl/wp-content/uploads/2021/07/cropped-conductionlogo-1.png");
9
+ }
10
+
11
+ .container {
12
+ background-size: contain;
13
+ background-position: center;
14
+ background-repeat: no-repeat;
15
+ }
16
+
17
+ .container.header {
18
+ inline-size: var(--conduction-logo-header-inline-size);
19
+ block-size: var(--conduction-logo-header-block-size);
20
+ background-image: var(--conduction-logo-header-background-image);
21
+ }
22
+
23
+ .container.footer {
24
+ inline-size: var(--conduction-logo-footer-inline-size);
25
+ block-size: var(--conduction-logo-footer-block-size);
26
+ background-image: var(--conduction-logo-footer-background-image);
27
+ }
28
+
29
+ .container.clickable:hover {
30
+ cursor: pointer;
31
+ }
package/lib/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { Container } from "./components/container/Container";
4
4
  import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
5
5
  import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, InputFile, SelectMultiple, SelectSingle } from "./components/formFields";
6
6
  import { ImageDivider } from "./components/imageDivider/ImageDivider";
7
- import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
7
+ import { Logo } from "./components/logo/Logo";
8
8
  import { MetaIcon } from "./components/metaIcon/MetaIcon";
9
9
  import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
10
10
  import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav";
@@ -25,4 +25,5 @@ import { Pagination } from "./components/Pagination/Pagination";
25
25
  import { Tabs, TabList, Tab, TabPanel } from "./components/tabs/Tabs";
26
26
  import { HorizontalOverflowWrapper } from "./components/horizontalOverflowWrapper/HorizontalOverflowWrapper";
27
27
  import { Jumbotron } from "./components/jumbotron/Jumbotron";
28
- export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, DetailsCard, InfoCard, Container, Breadcrumbs, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, CardWrapper, CardHeader, CardHeaderTitle, CardHeaderDate, Tabs, TabList, Tab, TabPanel, HorizontalOverflowWrapper, Jumbotron, };
28
+ import DisplaySwitch from "./components/displaySwitch/DisplaySwitch";
29
+ export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, DetailsCard, InfoCard, Container, Breadcrumbs, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, Logo, MetaIcon, PrivateRoute, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, CardWrapper, CardHeader, CardHeaderTitle, CardHeaderDate, Tabs, TabList, Tab, TabPanel, HorizontalOverflowWrapper, Jumbotron, DisplaySwitch };
package/lib/index.js CHANGED
@@ -3,7 +3,7 @@ import { Container } from "./components/container/Container";
3
3
  import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
4
4
  import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, InputFile, SelectMultiple, SelectSingle, } from "./components/formFields";
5
5
  import { ImageDivider } from "./components/imageDivider/ImageDivider";
6
- import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
6
+ import { Logo } from "./components/logo/Logo";
7
7
  import { MetaIcon } from "./components/metaIcon/MetaIcon";
8
8
  import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
9
9
  import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav";
@@ -18,4 +18,5 @@ import { Pagination } from "./components/Pagination/Pagination";
18
18
  import { Tabs, TabList, Tab, TabPanel } from "./components/tabs/Tabs";
19
19
  import { HorizontalOverflowWrapper } from "./components/horizontalOverflowWrapper/HorizontalOverflowWrapper";
20
20
  import { Jumbotron } from "./components/jumbotron/Jumbotron";
21
- export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, DetailsCard, InfoCard, Container, Breadcrumbs, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, CardWrapper, CardHeader, CardHeaderTitle, CardHeaderDate, Tabs, TabList, Tab, TabPanel, HorizontalOverflowWrapper, Jumbotron, };
21
+ import DisplaySwitch from "./components/displaySwitch/DisplaySwitch";
22
+ export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, DetailsCard, InfoCard, Container, Breadcrumbs, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, Logo, MetaIcon, PrivateRoute, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, CardWrapper, CardHeader, CardHeaderTitle, CardHeaderDate, Tabs, TabList, Tab, TabPanel, HorizontalOverflowWrapper, Jumbotron, DisplaySwitch };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.2.22",
3
+ "version": "2.2.24",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -24,16 +24,6 @@
24
24
  border-bottom-color: var(--conduction-card-header-hover-border-bottom-color);
25
25
  }
26
26
 
27
- .container:before {
28
- z-index: 1;
29
- content: "";
30
- position: absolute;
31
- top: 0;
32
- right: 0;
33
- bottom: 0;
34
- left: 0;
35
- }
36
-
37
27
  .title > * {
38
28
  color: var(--conduction-card-header-title-color) !important;
39
29
  }
@@ -0,0 +1,3 @@
1
+ .displaySwitchButtons {
2
+ align-items: center;
3
+ }
@@ -0,0 +1,48 @@
1
+ import * as React from "react";
2
+ import * as styles from "./DisplaySwitch.module.css";
3
+ import _ from "lodash";
4
+ import clsx from "clsx";
5
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
6
+ import { IconPrefix, IconName } from "@fortawesome/fontawesome-svg-core";
7
+ import { Button, ButtonGroup } from "@utrecht/component-library-react/dist/css-module";
8
+
9
+ interface DisplaySwitchProps {
10
+ buttons: DisplaySwitchButtonProps[];
11
+ layoutClassName?: string;
12
+ }
13
+
14
+ interface DisplaySwitchButtonProps {
15
+ label: string;
16
+ pressed: boolean;
17
+ handleClick: () => any;
18
+ icon?: {
19
+ name: IconName;
20
+ prefix: IconPrefix;
21
+ };
22
+ }
23
+
24
+ export declare type IDisplaySwitchButton = DisplaySwitchButtonProps;
25
+
26
+ const DisplaySwitch: React.FC<DisplaySwitchProps> = ({ layoutClassName, buttons }) => {
27
+ return (
28
+ <ButtonGroup className={clsx(styles.displaySwitchButtons, [layoutClassName] && layoutClassName)}>
29
+ {buttons.map((button, idx: number) => {
30
+ // TODO: Once the Rotterdam design system supports the "pressed" state,
31
+ // remove the `appereance` switch, and use the same appearance for each button.
32
+ return (
33
+ <Button
34
+ key={idx}
35
+ pressed={button.pressed}
36
+ appearance={button.pressed ? "secondary-action-button" : "subtle-button"}
37
+ onClick={button.handleClick}
38
+ >
39
+ {button.icon && <FontAwesomeIcon icon={[button.icon.prefix, button.icon.name]} />}
40
+ <span>{button.label}</span>
41
+ </Button>
42
+ );
43
+ })}
44
+ </ButtonGroup>
45
+ );
46
+ };
47
+
48
+ export default DisplaySwitch;
@@ -1,15 +1,31 @@
1
- .logoContainer {
2
- height: 100%;
3
- }
4
-
5
- .logo {
6
- background-size: 100% 100%;
7
- }
8
-
9
- .authenticatedLogo {
10
- background-image: var(--conduction-authenticated-logo-background);
11
- }
12
-
13
- .unauthenticatedLogo {
14
- background-image: var(--conduction-unauthenticated-logo-background);
15
- }
1
+ :root {
2
+ --conduction-logo-header-inline-size: 220px;
3
+ --conduction-logo-header-block-size: 40px;
4
+ --conduction-logo-header-background-image: url("https://conduction.nl/wp-content/uploads/2021/07/cropped-conductionlogo-1.png");
5
+
6
+ --conduction-logo-footer-inline-size: 330px;
7
+ --conduction-logo-footer-block-size: 60px;
8
+ --conduction-logo-footer-background-image: url("https://conduction.nl/wp-content/uploads/2021/07/cropped-conductionlogo-1.png");
9
+ }
10
+
11
+ .container {
12
+ background-size: contain;
13
+ background-position: center;
14
+ background-repeat: no-repeat;
15
+ }
16
+
17
+ .container.header {
18
+ inline-size: var(--conduction-logo-header-inline-size);
19
+ block-size: var(--conduction-logo-header-block-size);
20
+ background-image: var(--conduction-logo-header-background-image);
21
+ }
22
+
23
+ .container.footer {
24
+ inline-size: var(--conduction-logo-footer-inline-size);
25
+ block-size: var(--conduction-logo-footer-block-size);
26
+ background-image: var(--conduction-logo-footer-background-image);
27
+ }
28
+
29
+ .container.clickable:hover {
30
+ cursor: pointer;
31
+ }
@@ -1,25 +1,21 @@
1
- import clsx from "clsx";
2
- import { Link } from "gatsby";
3
1
  import * as React from "react";
4
2
  import * as styles from "./Logo.module.css";
3
+ import clsx from "clsx";
5
4
 
6
5
  interface LogoProps {
7
- layoutClassName: string;
8
- href?: string;
6
+ variant?: "header" | "footer";
7
+ onClick?: () => any;
8
+ layoutClassName?: string;
9
9
  }
10
10
 
11
- export const AuthenticatedLogo = ({ layoutClassName, href }: LogoProps): JSX.Element => {
12
- return (
13
- <Link className={styles.logoContainer} to={href ?? "#"}>
14
- <div className={clsx(styles.authenticatedLogo, styles.logo, layoutClassName)} />
15
- </Link>
16
- );
17
- };
18
-
19
- export const UnauthenticatedLogo = ({ layoutClassName, href }: LogoProps): JSX.Element => {
11
+ export const Logo: React.FC<LogoProps> = ({ onClick, layoutClassName, variant = "header" }) => {
20
12
  return (
21
- <Link className={styles.logoContainer} to={href ?? "#"}>
22
- <div className={clsx(styles.unauthenticatedLogo, styles.logo, layoutClassName)} />
23
- </Link>
13
+ <div
14
+ className={clsx(styles.container, styles[variant], [
15
+ onClick && styles.clickable,
16
+ layoutClassName && layoutClassName,
17
+ ])}
18
+ {...{ onClick }}
19
+ />
24
20
  );
25
21
  };
package/src/index.ts CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  SelectSingle,
25
25
  } from "./components/formFields";
26
26
  import { ImageDivider } from "./components/imageDivider/ImageDivider";
27
- import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
27
+ import { Logo } from "./components/logo/Logo";
28
28
  import { MetaIcon } from "./components/metaIcon/MetaIcon";
29
29
  import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
30
30
  import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav";
@@ -42,6 +42,7 @@ import { Pagination } from "./components/Pagination/Pagination";
42
42
  import { Tabs, TabList, Tab, TabPanel } from "./components/tabs/Tabs";
43
43
  import { HorizontalOverflowWrapper } from "./components/horizontalOverflowWrapper/HorizontalOverflowWrapper";
44
44
  import { Jumbotron } from "./components/jumbotron/Jumbotron";
45
+ import DisplaySwitch from "./components/displaySwitch/DisplaySwitch";
45
46
 
46
47
  export {
47
48
  DownloadCard,
@@ -62,8 +63,7 @@ export {
62
63
  SelectMultiple,
63
64
  SelectSingle,
64
65
  ImageDivider,
65
- AuthenticatedLogo,
66
- UnauthenticatedLogo,
66
+ Logo,
67
67
  MetaIcon,
68
68
  PrivateRoute,
69
69
  PrimaryTopNav,
@@ -85,4 +85,5 @@ export {
85
85
  TabPanel,
86
86
  HorizontalOverflowWrapper,
87
87
  Jumbotron,
88
+ DisplaySwitch
88
89
  };