@conduction/components 2.0.5 → 2.0.7

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.
Files changed (30) hide show
  1. package/README.md +9 -0
  2. package/lib/components/badgeCounter/BadgeCounter.d.ts +8 -0
  3. package/lib/components/badgeCounter/BadgeCounter.js +4 -0
  4. package/lib/components/badgeCounter/BadgeCounter.module.css +27 -0
  5. package/lib/components/card/detailsCard/DetailsCard.js +1 -1
  6. package/lib/components/card/downloadCard/DownloadCard.d.ts +1 -0
  7. package/lib/components/card/downloadCard/DownloadCard.js +2 -2
  8. package/lib/components/card/richContentCard/RichContentCard.js +1 -1
  9. package/lib/components/codeBlock/CodeBlock.d.ts +6 -0
  10. package/lib/components/codeBlock/CodeBlock.js +3 -0
  11. package/lib/components/codeBlock/CodeBlock.module.css +6 -0
  12. package/lib/components/notificationPopUp/NotificationPopUp.d.ts +2 -0
  13. package/lib/components/notificationPopUp/NotificationPopUp.js +1 -1
  14. package/lib/components/tag/Tag.d.ts +4 -1
  15. package/lib/components/tag/Tag.js +3 -2
  16. package/lib/components/tag/Tag.module.css +11 -2
  17. package/lib/index.d.ts +3 -1
  18. package/lib/index.js +3 -1
  19. package/package.json +1 -1
  20. package/src/components/badgeCounter/BadgeCounter.module.css +27 -0
  21. package/src/components/badgeCounter/BadgeCounter.tsx +16 -0
  22. package/src/components/card/detailsCard/DetailsCard.tsx +1 -1
  23. package/src/components/card/downloadCard/DownloadCard.tsx +14 -5
  24. package/src/components/card/richContentCard/RichContentCard.tsx +1 -1
  25. package/src/components/codeBlock/CodeBlock.module.css +6 -0
  26. package/src/components/codeBlock/CodeBlock.tsx +8 -0
  27. package/src/components/notificationPopUp/NotificationPopUp.tsx +7 -2
  28. package/src/components/tag/Tag.module.css +11 -2
  29. package/src/components/tag/Tag.tsx +11 -2
  30. package/src/index.ts +4 -0
package/README.md CHANGED
@@ -4,6 +4,15 @@
4
4
 
5
5
  - **Version 2**
6
6
 
7
+ - 2.0.7:
8
+ - Added new BadgeCounter component.
9
+ - Added CodeBlock component.
10
+ - 2.0.6:
11
+ - Added optional icon with default icon to the primary and secondary button in NotificationPopUp
12
+ - Added a handleClick function to the DownloadCard;
13
+ - Added clickFunction, layoutClassName and renamed tag to label in the Tag component;
14
+ - Edited DetailsCard to accommodate changes made to Tag component;
15
+ - Edited RichContentCard to accommodate changes made to Tag component;
7
16
  - 2.0.5: wrong camelcase in npm publish/build fix;
8
17
  - 2.0.4: added layoutClassName to InfoCard;
9
18
  - 2.0.3: Bugfix: --conduction-container typo removed;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ interface BadgeCounterProps {
3
+ number: string;
4
+ children: React.ReactNode;
5
+ layoutClassName?: string;
6
+ }
7
+ export declare const BadgeCounter: React.FC<BadgeCounterProps>;
8
+ export {};
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as styles from "./BadgeCounter.module.css";
3
+ import clsx from "clsx";
4
+ export const BadgeCounter = ({ number, children, layoutClassName }) => (_jsxs("div", { className: styles.content, children: [children, _jsx("span", { className: clsx([layoutClassName && layoutClassName], styles.badge), children: number })] }));
@@ -0,0 +1,27 @@
1
+ :root {
2
+ --conduction-badge-counter-color: hsl(0 0% 0%);
3
+ --conduction-badge-counter-background-color: var(--skeleton-color-grey-1);
4
+ --conduction-badge-counter-height: var(--skeleton-size-md);
5
+ --conduction-badge-counter-width: var(--skeleton-size-md);
6
+ --conduction-badge-counter-font-size: var(--skeleton-font-size-xs);
7
+ --conduction-badge-counter-max-number-font-size: var(--skeleton-font-size-2xs);
8
+ }
9
+
10
+ .content {
11
+ display: flex;
12
+ }
13
+
14
+ .badge {
15
+ height: var(--conduction-badge-counter-height);
16
+ width: var(--conduction-badge-counter-width);
17
+ border-radius: 50%;
18
+ font-size: var(--conduction-badge-counter-font-size);
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: space-around;
22
+ background-color: var(--conduction-badge-counter-background-color);
23
+ color: var(--conduction-badge-counter-color);
24
+ }
25
+ .maxNumber {
26
+ font-size: var(--conduction-badge-counter-max-number-font-size);
27
+ }
@@ -6,5 +6,5 @@ import { navigate } from "gatsby";
6
6
  import { ArrowRightIcon } from "@gemeente-denhaag/icons";
7
7
  import { Tag } from "../../tag/Tag";
8
8
  export const DetailsCard = ({ title, subHeader, introduction, link, tags, layoutClassName, }) => {
9
- return (_jsx("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), onClick: () => navigate(link.href), children: _jsxs("div", { className: styles.content, children: [_jsxs("div", { children: [_jsx("div", { className: styles.title, children: title }), _jsx("span", { className: styles.subHeader, children: subHeader })] }), tags && (_jsx("div", { className: styles.tags, children: tags.map((tag, idx) => (_jsx(Tag, { ...{ tag } }, idx))) })), _jsx("div", { className: styles.introduction, children: introduction }), _jsx("div", { className: styles.link, children: _jsx(Link, { icon: _jsx(ArrowRightIcon, {}), iconAlign: "start", children: link.label }) })] }) }));
9
+ return (_jsx("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), onClick: () => navigate(link.href), children: _jsxs("div", { className: styles.content, children: [_jsxs("div", { children: [_jsx("div", { className: styles.title, children: title }), _jsx("span", { className: styles.subHeader, children: subHeader })] }), tags && (_jsx("div", { className: styles.tags, children: tags.map((tag, idx) => (_jsx(Tag, { label: tag }, idx))) })), _jsx("div", { className: styles.introduction, children: introduction }), _jsx("div", { className: styles.link, children: _jsx(Link, { icon: _jsx(ArrowRightIcon, {}), iconAlign: "start", children: link.label }) })] }) }));
10
10
  };
@@ -5,6 +5,7 @@ interface DownloadCardProps {
5
5
  sizeKb: string;
6
6
  downloadLabel: string;
7
7
  layoutClassName?: string;
8
+ handleClick: () => any;
8
9
  }
9
10
  export declare const DownloadCard: React.FC<DownloadCardProps>;
10
11
  export {};
@@ -3,6 +3,6 @@ import * as styles from "./DownloadCard.module.css";
3
3
  import { DownloadIcon } from "@gemeente-denhaag/icons";
4
4
  import { Link } from "@gemeente-denhaag/components-react";
5
5
  import clsx from "clsx";
6
- export const DownloadCard = ({ icon, label, sizeKb, layoutClassName, downloadLabel }) => {
7
- return (_jsxs("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), children: [_jsxs("div", { className: styles.content, children: [_jsx("div", { className: styles.icon, children: icon }), _jsxs("div", { children: [label, " (", sizeKb, "kb)"] })] }), _jsx(Link, { icon: _jsx(DownloadIcon, {}), iconAlign: "start", children: downloadLabel })] }));
6
+ export const DownloadCard = ({ icon, label, sizeKb, layoutClassName, downloadLabel, handleClick, }) => {
7
+ return (_jsxs("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), children: [_jsxs("div", { className: styles.content, children: [_jsx("div", { className: styles.icon, children: icon }), _jsxs("div", { children: [label, " (", sizeKb, "kb)"] })] }), _jsx("div", { onClick: handleClick, children: _jsx(Link, { icon: _jsx(DownloadIcon, {}), iconAlign: "start", children: downloadLabel }) })] }));
8
8
  };
@@ -5,7 +5,7 @@ import * as styles from "./RichContentCard.module.css";
5
5
  import { ExternalLinkIcon, ArrowRightIcon } from "@gemeente-denhaag/icons";
6
6
  import { Tag } from "../../tag/Tag";
7
7
  export const RichContentCard = ({ link, labelsWithIcon, tags, contentLinks, linkIsExternal, }) => {
8
- return (_jsxs("div", { className: styles.container, children: [_jsx("div", { className: styles.link, onClick: () => navigate(link.href), children: _jsx(Link, { icon: linkIsExternal ? _jsx(ExternalLinkIcon, {}) : _jsx(ArrowRightIcon, {}), iconAlign: "start", children: link.label }) }), _jsx("div", { className: styles.labelsWithIcon, children: labelsWithIcon.map(({ label, icon }, idx) => (_jsx(LabelWithIcon, { ...{ label, icon } }, idx))) }), _jsx("div", { className: styles.tags, children: tags.map((tag, idx) => (_jsx(Tag, { ...{ tag } }, idx))) }), contentLinks && (_jsxs("div", { className: styles.contentLinks, children: [_jsx(Divider, {}), contentLinks.map(({ title, subTitle, href }, idx) => (_jsx(ContentLink, { ...{ title, subTitle, href } }, idx)))] }))] }));
8
+ return (_jsxs("div", { className: styles.container, children: [_jsx("div", { className: styles.link, onClick: () => navigate(link.href), children: _jsx(Link, { icon: linkIsExternal ? _jsx(ExternalLinkIcon, {}) : _jsx(ArrowRightIcon, {}), iconAlign: "start", children: link.label }) }), _jsx("div", { className: styles.labelsWithIcon, children: labelsWithIcon.map(({ label, icon }, idx) => (_jsx(LabelWithIcon, { ...{ label, icon } }, idx))) }), _jsx("div", { className: styles.tags, children: tags.map((tag, idx) => (_jsx(Tag, { label: tag }, idx))) }), contentLinks && (_jsxs("div", { className: styles.contentLinks, children: [_jsx(Divider, {}), contentLinks.map(({ title, subTitle, href }, idx) => (_jsx(ContentLink, { ...{ title, subTitle, href } }, idx)))] }))] }));
9
9
  };
10
10
  const LabelWithIcon = ({ label, icon }) => {
11
11
  return (_jsxs("div", { className: styles.labelWithIcon, children: [_jsx("span", { className: styles.labelWithIcon_icon, children: icon }), _jsx("span", { className: styles.labelWithIcon_label, children: label })] }));
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ interface CodeBlockProps {
3
+ codeBlock: string | JSX.Element;
4
+ }
5
+ export declare const CodeBlock: React.FC<CodeBlockProps>;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as styles from "./CodeBlock.module.css";
3
+ export const CodeBlock = ({ codeBlock }) => _jsx("div", { className: styles.code, children: codeBlock });
@@ -0,0 +1,6 @@
1
+ .code {
2
+ margin-block: var(--skeleton-size-sm);
3
+ background-color: var(--skeleton-color-grey-1);
4
+ border-radius: var(--skeleton-size-2xs);
5
+ padding: var(--skeleton-size-lg);
6
+ }
@@ -6,10 +6,12 @@ export interface NotificationPopUpProps {
6
6
  hide: () => void;
7
7
  primaryButton: {
8
8
  label: string;
9
+ icon?: JSX.Element;
9
10
  handleClick: () => any;
10
11
  };
11
12
  secondaryButton?: {
12
13
  label: string;
14
+ icon?: JSX.Element;
13
15
  handleClick: () => any;
14
16
  };
15
17
  layoutClassName?: string;
@@ -16,7 +16,7 @@ export const NotificationPopUp = ({ title, description, isVisible, hide, primary
16
16
  setAnimationVisible(true);
17
17
  }, animationDuration);
18
18
  };
19
- const modal = (_jsx(StylesProvider, { children: _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), children: _jsx(Link, { icon: _jsx(CloseIcon, {}), iconAlign: "start", children: secondaryButton.label }) })), _jsx(Button, { icon: _jsx(ArrowRightIcon, {}), onClick: () => handleClick(primaryButton.handleClick), children: primaryButton.label })] })] }) }));
19
+ const modal = (_jsx(StylesProvider, { children: _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), children: _jsx(Link, { icon: secondaryButton.icon ?? _jsx(CloseIcon, {}), iconAlign: "start", children: secondaryButton.label }) })), _jsx(Button, { icon: primaryButton.icon ?? _jsx(ArrowRightIcon, {}), onClick: () => handleClick(primaryButton.handleClick), children: primaryButton.label })] })] }) }));
20
20
  return isVisible ? ReactDOM.createPortal(modal, document.body) : null;
21
21
  };
22
22
  export const NotificationPopUpController = () => {
@@ -1,6 +1,9 @@
1
1
  import * as React from "react";
2
2
  interface TagProps {
3
- tag: string;
3
+ label: string;
4
+ icon?: JSX.Element;
5
+ onClick?: () => any;
6
+ layoutClassName?: string;
4
7
  }
5
8
  export declare const Tag: React.FC<TagProps>;
6
9
  export {};
@@ -1,3 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as styles from "./Tag.module.css";
3
- export const Tag = ({ tag }) => _jsx("span", { className: styles.tag, children: tag });
3
+ import clsx from "clsx";
4
+ export const Tag = ({ label, icon, onClick, layoutClassName }) => (_jsxs("div", { className: clsx(styles.tag, [layoutClassName && layoutClassName], onClick && styles.clickable), ...{ onClick }, children: [icon && _jsx("span", { children: icon }), _jsx("span", { children: label })] }));
@@ -1,9 +1,10 @@
1
1
  :root {
2
2
  --conduction-tag-font-size: var(--skeleton-font-size-sm);
3
3
  --conduction-tag-color: var(--skeleton-black);
4
- --conduction-tag-backgrond-color: var(--skeleton-color-grey-1);
4
+ --conduction-tag-background-color: var(--skeleton-color-grey-1);
5
5
  --conduction-tag-border-radius: var(--skeleton-border-radius-md);
6
6
  --conduction-tag-padding: var(--skeleton-size-xs);
7
+ --conduction-tag-child-margin-inline: var(--skeleton-size-2xs);
7
8
  }
8
9
 
9
10
  .tag {
@@ -11,10 +12,18 @@
11
12
  width: fit-content;
12
13
  font-size: var(--conduction-tag-font-size);
13
14
  color: var(--conduction-tag-color);
14
- background-color: var(--conduction-tag-backgrond-color);
15
+ background-color: var(--conduction-tag-background-color);
15
16
  border-radius: var(--conduction-tag-border-radius);
16
17
  padding-inline-start: var(--conduction-tag-padding);
17
18
  padding-inline-end: var(--conduction-tag-padding);
18
19
  padding-block-start: var(--conduction-tag-padding);
19
20
  padding-block-end: var(--conduction-tag-padding);
20
21
  }
22
+
23
+ .tag > *:not(:last-child) {
24
+ margin-inline-end: var(--conduction-tag-child-margin-inline);
25
+ }
26
+
27
+ .clickable :hover {
28
+ cursor: pointer;
29
+ }
package/lib/index.d.ts CHANGED
@@ -21,4 +21,6 @@ declare const NotificationPopUp: {
21
21
  };
22
22
  import { QuoteWrapper } from "./components/quoteWrapper/QuoteWrapper";
23
23
  import { Pagination } from "./components/denhaag-wrappers/pagination/Pagination";
24
- export { InputRadio, DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, InfoCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, };
24
+ import { BadgeCounter } from "./components/badgeCounter/BadgeCounter";
25
+ import { CodeBlock } from "./components/codeBlock/CodeBlock";
26
+ export { InputRadio, DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, InfoCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, };
package/lib/index.js CHANGED
@@ -14,4 +14,6 @@ import { NotificationPopUpController, NotificationPopUp as _NotificationPopUp, }
14
14
  const NotificationPopUp = { controller: NotificationPopUpController, NotificationPopUp: _NotificationPopUp };
15
15
  import { QuoteWrapper } from "./components/quoteWrapper/QuoteWrapper";
16
16
  import { Pagination } from "./components/denhaag-wrappers/pagination/Pagination";
17
- export { InputRadio, DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, InfoCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, };
17
+ import { BadgeCounter } from "./components/badgeCounter/BadgeCounter";
18
+ import { CodeBlock } from "./components/codeBlock/CodeBlock";
19
+ export { InputRadio, DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, InfoCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -0,0 +1,27 @@
1
+ :root {
2
+ --conduction-badge-counter-color: hsl(0 0% 0%);
3
+ --conduction-badge-counter-background-color: var(--skeleton-color-grey-1);
4
+ --conduction-badge-counter-height: var(--skeleton-size-md);
5
+ --conduction-badge-counter-width: var(--skeleton-size-md);
6
+ --conduction-badge-counter-font-size: var(--skeleton-font-size-xs);
7
+ --conduction-badge-counter-max-number-font-size: var(--skeleton-font-size-2xs);
8
+ }
9
+
10
+ .content {
11
+ display: flex;
12
+ }
13
+
14
+ .badge {
15
+ height: var(--conduction-badge-counter-height);
16
+ width: var(--conduction-badge-counter-width);
17
+ border-radius: 50%;
18
+ font-size: var(--conduction-badge-counter-font-size);
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: space-around;
22
+ background-color: var(--conduction-badge-counter-background-color);
23
+ color: var(--conduction-badge-counter-color);
24
+ }
25
+ .maxNumber {
26
+ font-size: var(--conduction-badge-counter-max-number-font-size);
27
+ }
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import * as styles from "./BadgeCounter.module.css";
3
+ import clsx from "clsx";
4
+
5
+ interface BadgeCounterProps {
6
+ number: string;
7
+ children: React.ReactNode;
8
+ layoutClassName?: string;
9
+ }
10
+
11
+ export const BadgeCounter: React.FC<BadgeCounterProps> = ({ number, children, layoutClassName }) => (
12
+ <div className={styles.content}>
13
+ {children}
14
+ <span className={clsx([layoutClassName && layoutClassName], styles.badge)}>{number}</span>
15
+ </div>
16
+ );
@@ -38,7 +38,7 @@ export const DetailsCard: React.FC<DetailsCardProps> = ({
38
38
  {tags && (
39
39
  <div className={styles.tags}>
40
40
  {tags.map((tag, idx) => (
41
- <Tag key={idx} {...{ tag }} />
41
+ <Tag key={idx} label={tag} />
42
42
  ))}
43
43
  </div>
44
44
  )}
@@ -10,9 +10,17 @@ interface DownloadCardProps {
10
10
  sizeKb: string;
11
11
  downloadLabel: string;
12
12
  layoutClassName?: string;
13
+ handleClick: () => any;
13
14
  }
14
15
 
15
- export const DownloadCard: React.FC<DownloadCardProps> = ({ icon, label, sizeKb, layoutClassName, downloadLabel }) => {
16
+ export const DownloadCard: React.FC<DownloadCardProps> = ({
17
+ icon,
18
+ label,
19
+ sizeKb,
20
+ layoutClassName,
21
+ downloadLabel,
22
+ handleClick,
23
+ }) => {
16
24
  return (
17
25
  <div className={clsx(styles.container, [layoutClassName && layoutClassName])}>
18
26
  <div className={styles.content}>
@@ -22,10 +30,11 @@ export const DownloadCard: React.FC<DownloadCardProps> = ({ icon, label, sizeKb,
22
30
  {label} ({sizeKb}kb)
23
31
  </div>
24
32
  </div>
25
-
26
- <Link icon={<DownloadIcon />} iconAlign="start">
27
- {downloadLabel}
28
- </Link>
33
+ <div onClick={handleClick}>
34
+ <Link icon={<DownloadIcon />} iconAlign="start">
35
+ {downloadLabel}
36
+ </Link>
37
+ </div>
29
38
  </div>
30
39
  );
31
40
  };
@@ -46,7 +46,7 @@ export const RichContentCard: React.FC<RichContentCardProps> = ({
46
46
 
47
47
  <div className={styles.tags}>
48
48
  {tags.map((tag, idx) => (
49
- <Tag key={idx} {...{ tag }} />
49
+ <Tag key={idx} label={tag} />
50
50
  ))}
51
51
  </div>
52
52
 
@@ -0,0 +1,6 @@
1
+ .code {
2
+ margin-block: var(--skeleton-size-sm);
3
+ background-color: var(--skeleton-color-grey-1);
4
+ border-radius: var(--skeleton-size-2xs);
5
+ padding: var(--skeleton-size-lg);
6
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import * as styles from "./CodeBlock.module.css";
3
+
4
+ interface CodeBlockProps {
5
+ codeBlock: string | JSX.Element;
6
+ }
7
+
8
+ export const CodeBlock: React.FC<CodeBlockProps> = ({ codeBlock }) => <div className={styles.code}>{codeBlock}</div>;
@@ -12,10 +12,12 @@ export interface NotificationPopUpProps {
12
12
  hide: () => void;
13
13
  primaryButton: {
14
14
  label: string;
15
+ icon?: JSX.Element;
15
16
  handleClick: () => any;
16
17
  };
17
18
  secondaryButton?: {
18
19
  label: string;
20
+ icon?: JSX.Element;
19
21
  handleClick: () => any;
20
22
  };
21
23
  layoutClassName?: string;
@@ -54,12 +56,15 @@ export const NotificationPopUp: React.FC<NotificationPopUpProps> = ({
54
56
  <div className={styles.buttons}>
55
57
  {secondaryButton && (
56
58
  <div onClick={() => handleClick(secondaryButton.handleClick)}>
57
- <Link icon={<CloseIcon />} iconAlign="start">
59
+ <Link icon={secondaryButton.icon ?? <CloseIcon />} iconAlign="start">
58
60
  {secondaryButton.label}
59
61
  </Link>
60
62
  </div>
61
63
  )}
62
- <Button icon={<ArrowRightIcon />} onClick={() => handleClick(primaryButton.handleClick)}>
64
+ <Button
65
+ icon={primaryButton.icon ?? <ArrowRightIcon />}
66
+ onClick={() => handleClick(primaryButton.handleClick)}
67
+ >
63
68
  {primaryButton.label}
64
69
  </Button>
65
70
  </div>
@@ -1,9 +1,10 @@
1
1
  :root {
2
2
  --conduction-tag-font-size: var(--skeleton-font-size-sm);
3
3
  --conduction-tag-color: var(--skeleton-black);
4
- --conduction-tag-backgrond-color: var(--skeleton-color-grey-1);
4
+ --conduction-tag-background-color: var(--skeleton-color-grey-1);
5
5
  --conduction-tag-border-radius: var(--skeleton-border-radius-md);
6
6
  --conduction-tag-padding: var(--skeleton-size-xs);
7
+ --conduction-tag-child-margin-inline: var(--skeleton-size-2xs);
7
8
  }
8
9
 
9
10
  .tag {
@@ -11,10 +12,18 @@
11
12
  width: fit-content;
12
13
  font-size: var(--conduction-tag-font-size);
13
14
  color: var(--conduction-tag-color);
14
- background-color: var(--conduction-tag-backgrond-color);
15
+ background-color: var(--conduction-tag-background-color);
15
16
  border-radius: var(--conduction-tag-border-radius);
16
17
  padding-inline-start: var(--conduction-tag-padding);
17
18
  padding-inline-end: var(--conduction-tag-padding);
18
19
  padding-block-start: var(--conduction-tag-padding);
19
20
  padding-block-end: var(--conduction-tag-padding);
20
21
  }
22
+
23
+ .tag > *:not(:last-child) {
24
+ margin-inline-end: var(--conduction-tag-child-margin-inline);
25
+ }
26
+
27
+ .clickable :hover {
28
+ cursor: pointer;
29
+ }
@@ -1,8 +1,17 @@
1
1
  import * as React from "react";
2
2
  import * as styles from "./Tag.module.css";
3
+ import clsx from "clsx";
3
4
 
4
5
  interface TagProps {
5
- tag: string;
6
+ label: string;
7
+ icon?: JSX.Element;
8
+ onClick?: () => any;
9
+ layoutClassName?: string;
6
10
  }
7
11
 
8
- export const Tag: React.FC<TagProps> = ({ tag }) => <span className={styles.tag}>{tag}</span>;
12
+ export const Tag: React.FC<TagProps> = ({ label, icon, onClick, layoutClassName }) => (
13
+ <div className={clsx(styles.tag, [layoutClassName && layoutClassName], onClick && styles.clickable)} {...{ onClick }}>
14
+ {icon && <span>{icon}</span>}
15
+ <span>{label}</span>
16
+ </div>
17
+ );
package/src/index.ts CHANGED
@@ -36,6 +36,8 @@ import {
36
36
  const NotificationPopUp = { controller: NotificationPopUpController, NotificationPopUp: _NotificationPopUp };
37
37
  import { QuoteWrapper } from "./components/quoteWrapper/QuoteWrapper";
38
38
  import { Pagination } from "./components/denhaag-wrappers/pagination/Pagination";
39
+ import { BadgeCounter } from "./components/badgeCounter/BadgeCounter";
40
+ import { CodeBlock } from "./components/codeBlock/CodeBlock";
39
41
 
40
42
  export {
41
43
  InputRadio,
@@ -70,4 +72,6 @@ export {
70
72
  NotificationPopUp,
71
73
  QuoteWrapper,
72
74
  Pagination,
75
+ BadgeCounter,
76
+ CodeBlock,
73
77
  };