@conduction/components 1.0.3 → 1.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.
- package/.github/workflows/npm-publish.yml +39 -0
- package/lib/components/card/detailsCard/DetailsCard.d.ts +14 -0
- package/lib/components/card/detailsCard/DetailsCard.js +10 -0
- package/lib/components/card/detailsCard/DetailsCard.module.css +48 -0
- package/lib/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.d.ts +0 -0
- package/lib/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.js +0 -0
- package/lib/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.module.css +0 -0
- package/lib/components/card/index.d.ts +4 -3
- package/lib/components/card/index.js +4 -3
- package/lib/components/card/{RichContentCard → richContentCard}/RichContentCard.d.ts +0 -0
- package/{src/components/card/RichContentCard → lib/components/card/richContentCard}/RichContentCard.js +2 -4
- package/lib/components/card/{RichContentCard → richContentCard}/RichContentCard.module.css +0 -11
- package/lib/components/formFields/checkbox.d.ts +5 -1
- package/lib/components/formFields/input.d.ts +6 -1
- package/lib/components/formFields/textarea.d.ts +6 -1
- package/lib/components/formFields/types.d.ts +0 -14
- package/lib/components/tag/Tag.d.ts +6 -0
- package/lib/components/tag/Tag.js +3 -0
- package/lib/components/tag/Tag.module.css +9 -0
- package/lib/index.d.ts +3 -2
- package/lib/index.js +3 -2
- package/package.json +1 -1
- package/src/components/card/detailsCard/DetailsCard.module.css +48 -0
- package/src/components/card/detailsCard/DetailsCard.tsx +56 -0
- package/src/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.js +0 -0
- package/src/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.module.css +0 -0
- package/src/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.tsx +0 -0
- package/src/components/card/index.tsx +4 -3
- package/{lib/components/card/RichContentCard → src/components/card/richContentCard}/RichContentCard.js +0 -0
- package/src/components/card/{RichContentCard → richContentCard}/RichContentCard.module.css +0 -11
- package/src/components/card/{RichContentCard → richContentCard}/RichContentCard.tsx +3 -10
- package/src/components/tag/Tag.module.css +9 -0
- package/src/components/tag/Tag.tsx +8 -0
- package/src/index.ts +10 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Node.js Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- development
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v3
|
|
16
|
+
- uses: actions/setup-node@v3
|
|
17
|
+
with:
|
|
18
|
+
node-version: 16
|
|
19
|
+
|
|
20
|
+
publish-npm:
|
|
21
|
+
needs: build
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v3
|
|
25
|
+
- uses: actions/setup-node@v3
|
|
26
|
+
with:
|
|
27
|
+
node-version: 16
|
|
28
|
+
registry-url: https://registry.npmjs.org/
|
|
29
|
+
- run: |
|
|
30
|
+
git --version
|
|
31
|
+
git config user.name "GitHub Version patch"
|
|
32
|
+
git config user.email "<>"
|
|
33
|
+
git checkout development
|
|
34
|
+
git clean -f -n
|
|
35
|
+
- run: npm install
|
|
36
|
+
- run: npm version patch
|
|
37
|
+
- run: npm publish
|
|
38
|
+
env:
|
|
39
|
+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface DetailsCardProps {
|
|
3
|
+
title: string;
|
|
4
|
+
introduction: string;
|
|
5
|
+
link: {
|
|
6
|
+
href: string;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
tags?: string[];
|
|
10
|
+
subHeader?: string;
|
|
11
|
+
layoutClassName?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const DetailsCard: React.FC<DetailsCardProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as styles from "./DetailsCard.module.css";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { Link } from "@gemeente-denhaag/components-react";
|
|
5
|
+
import { navigate } from "gatsby";
|
|
6
|
+
import { ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
7
|
+
import { Tag } from "../../tag/Tag";
|
|
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 }) })] }) }));
|
|
10
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
border-radius: var(--nlportal-document-border-radius);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.content {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
padding-inline-start: var(--nlportal-space-inline-lg);
|
|
11
|
+
padding-inline-end: var(--nlportal-space-inline-lg);
|
|
12
|
+
padding-block-start: var(--nlportal-space-block-lg);
|
|
13
|
+
padding-block-end: var(--nlportal-space-block-lg);
|
|
14
|
+
border: var(--nlportal-document-border, 1px solid);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.content > *:not(:last-child) {
|
|
18
|
+
margin-block-end: var(--nlportal-space-block-md);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.title {
|
|
22
|
+
font-size: var(--denhaag-typography-scale-xl-font-size);
|
|
23
|
+
font-weight: var(--conduction-image-and-details-card-title-font-weight);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.subHeader {
|
|
27
|
+
color: var(--denhaag-color-grey-3);
|
|
28
|
+
font-size: var(--denhaag-typography-scale-s-font-size);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.tags > *:not(:last-child) {
|
|
32
|
+
margin-inline-end: var(--nlportal-space-inline-md);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.introduction {
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
text-overflow: ellipsis;
|
|
38
|
+
display: -webkit-box;
|
|
39
|
+
-webkit-line-clamp: var(
|
|
40
|
+
--conduction-image-and-details-card-introduction-lines-clamp
|
|
41
|
+
);
|
|
42
|
+
-webkit-box-orient: vertical;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.link {
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: flex-end;
|
|
48
|
+
}
|
package/lib/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.d.ts
RENAMED
|
File without changes
|
package/lib/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.js
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DownloadCard } from "./downloadCard/DownloadCard";
|
|
2
|
-
import { HorizontalImageCard } from "./
|
|
2
|
+
import { HorizontalImageCard } from "./horizontalImageCard/HorizontalImageCard";
|
|
3
3
|
import { ImageAndDetailsCard } from "./imageAndDetailsCard/ImageAndDetailsCard";
|
|
4
|
-
import { RichContentCard } from "./
|
|
5
|
-
|
|
4
|
+
import { RichContentCard } from "./richContentCard/RichContentCard";
|
|
5
|
+
import { DetailsCard } from "./detailsCard/DetailsCard";
|
|
6
|
+
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DownloadCard } from "./downloadCard/DownloadCard";
|
|
2
|
-
import { HorizontalImageCard } from "./
|
|
2
|
+
import { HorizontalImageCard } from "./horizontalImageCard/HorizontalImageCard";
|
|
3
3
|
import { ImageAndDetailsCard } from "./imageAndDetailsCard/ImageAndDetailsCard";
|
|
4
|
-
import { RichContentCard } from "./
|
|
5
|
-
|
|
4
|
+
import { RichContentCard } from "./richContentCard/RichContentCard";
|
|
5
|
+
import { DetailsCard } from "./detailsCard/DetailsCard";
|
|
6
|
+
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard };
|
|
File without changes
|
|
@@ -3,15 +3,13 @@ import { Divider, Link } from "@gemeente-denhaag/components-react";
|
|
|
3
3
|
import { navigate } from "gatsby";
|
|
4
4
|
import * as styles from "./RichContentCard.module.css";
|
|
5
5
|
import { ExternalLinkIcon, ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
6
|
+
import { Tag } from "../../tag/Tag";
|
|
6
7
|
export const RichContentCard = ({ link, labelsWithIcon, tags, contentLinks, linkIsExternal, }) => {
|
|
7
|
-
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 }) => (_jsx(LabelWithIcon, { ...{ label, icon } }))) }), _jsx("div", { className: styles.tags, children: tags.map((tag) => (_jsx(Tag, { ...{ tag } }))) }), contentLinks && (_jsxs("div", { className: styles.contentLinks, children: [_jsx(Divider, {}), contentLinks.map(({ title, subTitle, href }) => (_jsx(ContentLink, { ...{ title, subTitle, href } })))] }))] }));
|
|
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 }) => (_jsx(LabelWithIcon, { ...{ label, icon } }))) }), _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 }) => (_jsx(ContentLink, { ...{ title, subTitle, href } })))] }))] }));
|
|
8
9
|
};
|
|
9
10
|
const LabelWithIcon = ({ label, icon }) => {
|
|
10
11
|
return (_jsxs("div", { className: styles.labelWithIcon, children: [_jsx("span", { className: styles.labelWithIcon_icon, children: icon }), _jsx("span", { className: styles.labelWithIcon_label, children: label })] }));
|
|
11
12
|
};
|
|
12
|
-
const Tag = ({ tag }) => {
|
|
13
|
-
return _jsx("span", { className: styles.tag, children: tag });
|
|
14
|
-
};
|
|
15
13
|
const ContentLink = ({ title, subTitle, href }) => {
|
|
16
14
|
return (_jsxs(Link, { className: styles.contentLink, children: [_jsxs("div", { className: styles.contentLink_content, children: [_jsx("span", { className: styles.contentLink_title, children: title }), _jsx("span", { className: styles.contentLink_subTitle, children: subTitle })] }), _jsx("div", { children: _jsx(ArrowRightIcon, {}) })] }));
|
|
17
15
|
};
|
|
@@ -56,17 +56,6 @@
|
|
|
56
56
|
font-size: var(--conduction-rich-card-label-with-icon-label-size);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/* Component: Tag */
|
|
60
|
-
.tag {
|
|
61
|
-
font-size: var(--conduction-tag-font-size);
|
|
62
|
-
background-color: var(--denhaag-color-grey-1);
|
|
63
|
-
border-radius: var(--nlportal-document-border-radius);
|
|
64
|
-
padding-inline-start: var(--nlportal-space-inline-xs);
|
|
65
|
-
padding-inline-end: var(--nlportal-space-inline-xs);
|
|
66
|
-
padding-block-start: var(--nlportal-space-block-xs);
|
|
67
|
-
padding-block-end: var(--nlportal-space-block-xs);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
59
|
/* Content Link */
|
|
71
60
|
.contentLink {
|
|
72
61
|
display: flex;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { IReactHookFormProps } from "./types";
|
|
3
|
+
export interface ICheckboxProps {
|
|
4
|
+
label: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
3
7
|
export declare const InputCheckbox: React.FC<ICheckboxProps & IReactHookFormProps>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { IReactHookFormProps } from "./types";
|
|
3
|
+
export interface IInputProps {
|
|
4
|
+
name: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
}
|
|
3
8
|
export declare const InputPassword: React.FC<IInputProps & IReactHookFormProps>;
|
|
4
9
|
export declare const InputText: React.FC<IInputProps & IReactHookFormProps>;
|
|
5
10
|
export declare const InputEmail: React.FC<IInputProps & IReactHookFormProps>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { IReactHookFormProps } from "./types";
|
|
3
|
+
export interface ITextAreaProps {
|
|
4
|
+
name: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
}
|
|
3
8
|
export declare const Textarea: React.FC<ITextAreaProps & IReactHookFormProps>;
|
|
@@ -4,17 +4,3 @@ export interface IReactHookFormProps {
|
|
|
4
4
|
errors: FieldErrors;
|
|
5
5
|
validation?: Omit<RegisterOptions<FieldValues, any>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
6
6
|
}
|
|
7
|
-
export interface IInputProps {
|
|
8
|
-
name: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
defaultValue?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface ITextAreaProps {
|
|
13
|
-
name: string;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
defaultValue?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface ICheckboxProps {
|
|
18
|
-
label: string;
|
|
19
|
-
name: string;
|
|
20
|
-
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
.tag {
|
|
2
|
+
font-size: var(--conduction-tag-font-size);
|
|
3
|
+
background-color: var(--denhaag-color-grey-1);
|
|
4
|
+
border-radius: var(--nlportal-document-border-radius);
|
|
5
|
+
padding-inline-start: var(--nlportal-space-inline-xs);
|
|
6
|
+
padding-inline-end: var(--nlportal-space-inline-xs);
|
|
7
|
+
padding-block-start: var(--nlportal-space-block-xs);
|
|
8
|
+
padding-block-end: var(--nlportal-space-block-xs);
|
|
9
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard } from "./components/card";
|
|
1
|
+
import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard } from "./components/card";
|
|
2
2
|
import { Container } from "./components/container/Container";
|
|
3
3
|
import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
|
|
4
4
|
import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
|
|
@@ -9,4 +9,5 @@ import { MetaIcon } from "./components/metaIcon/MetaIcon";
|
|
|
9
9
|
import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
|
|
10
10
|
import { StatusSteps } from "./components/statusSteps/StatusSteps";
|
|
11
11
|
import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
|
|
12
|
-
|
|
12
|
+
import { Tag } from "./components/tag/Tag";
|
|
13
|
+
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, };
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard } from "./components/card";
|
|
1
|
+
import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, } from "./components/card";
|
|
2
2
|
import { Container } from "./components/container/Container";
|
|
3
3
|
import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
|
|
4
4
|
import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
|
|
@@ -9,4 +9,5 @@ import { MetaIcon } from "./components/metaIcon/MetaIcon";
|
|
|
9
9
|
import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
|
|
10
10
|
import { StatusSteps } from "./components/statusSteps/StatusSteps";
|
|
11
11
|
import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
|
|
12
|
-
|
|
12
|
+
import { Tag } from "./components/tag/Tag";
|
|
13
|
+
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, };
|
package/package.json
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
border-radius: var(--nlportal-document-border-radius);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.content {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
padding-inline-start: var(--nlportal-space-inline-lg);
|
|
11
|
+
padding-inline-end: var(--nlportal-space-inline-lg);
|
|
12
|
+
padding-block-start: var(--nlportal-space-block-lg);
|
|
13
|
+
padding-block-end: var(--nlportal-space-block-lg);
|
|
14
|
+
border: var(--nlportal-document-border, 1px solid);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.content > *:not(:last-child) {
|
|
18
|
+
margin-block-end: var(--nlportal-space-block-md);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.title {
|
|
22
|
+
font-size: var(--denhaag-typography-scale-xl-font-size);
|
|
23
|
+
font-weight: var(--conduction-image-and-details-card-title-font-weight);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.subHeader {
|
|
27
|
+
color: var(--denhaag-color-grey-3);
|
|
28
|
+
font-size: var(--denhaag-typography-scale-s-font-size);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.tags > *:not(:last-child) {
|
|
32
|
+
margin-inline-end: var(--nlportal-space-inline-md);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.introduction {
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
text-overflow: ellipsis;
|
|
38
|
+
display: -webkit-box;
|
|
39
|
+
-webkit-line-clamp: var(
|
|
40
|
+
--conduction-image-and-details-card-introduction-lines-clamp
|
|
41
|
+
);
|
|
42
|
+
-webkit-box-orient: vertical;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.link {
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: flex-end;
|
|
48
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as styles from "./DetailsCard.module.css";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { Link } from "@gemeente-denhaag/components-react";
|
|
5
|
+
import { navigate } from "gatsby";
|
|
6
|
+
import { ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
7
|
+
import { Tag } from "../../tag/Tag";
|
|
8
|
+
|
|
9
|
+
interface DetailsCardProps {
|
|
10
|
+
title: string;
|
|
11
|
+
introduction: string;
|
|
12
|
+
link: {
|
|
13
|
+
href: string;
|
|
14
|
+
label: string;
|
|
15
|
+
};
|
|
16
|
+
tags?: string[];
|
|
17
|
+
subHeader?: string;
|
|
18
|
+
layoutClassName?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const DetailsCard: React.FC<DetailsCardProps> = ({
|
|
22
|
+
title,
|
|
23
|
+
subHeader,
|
|
24
|
+
introduction,
|
|
25
|
+
link,
|
|
26
|
+
tags,
|
|
27
|
+
layoutClassName,
|
|
28
|
+
}) => {
|
|
29
|
+
return (
|
|
30
|
+
<div className={clsx(styles.container, [layoutClassName && layoutClassName])} onClick={() => navigate(link.href)}>
|
|
31
|
+
<div className={styles.content}>
|
|
32
|
+
<div>
|
|
33
|
+
<div className={styles.title}>{title}</div>
|
|
34
|
+
|
|
35
|
+
<span className={styles.subHeader}>{subHeader}</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
{tags && (
|
|
39
|
+
<div className={styles.tags}>
|
|
40
|
+
{tags.map((tag, idx) => (
|
|
41
|
+
<Tag key={idx} {...{ tag }} />
|
|
42
|
+
))}
|
|
43
|
+
</div>
|
|
44
|
+
)}
|
|
45
|
+
|
|
46
|
+
<div className={styles.introduction}>{introduction}</div>
|
|
47
|
+
|
|
48
|
+
<div className={styles.link}>
|
|
49
|
+
<Link icon={<ArrowRightIcon />} iconAlign="start">
|
|
50
|
+
{link.label}
|
|
51
|
+
</Link>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
};
|
package/src/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.js
RENAMED
|
File without changes
|
|
File without changes
|
package/src/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.tsx
RENAMED
|
File without changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DownloadCard } from "./downloadCard/DownloadCard";
|
|
2
|
-
import { HorizontalImageCard } from "./
|
|
2
|
+
import { HorizontalImageCard } from "./horizontalImageCard/HorizontalImageCard";
|
|
3
3
|
import { ImageAndDetailsCard } from "./imageAndDetailsCard/ImageAndDetailsCard";
|
|
4
|
-
import { RichContentCard } from "./
|
|
4
|
+
import { RichContentCard } from "./richContentCard/RichContentCard";
|
|
5
|
+
import { DetailsCard } from "./detailsCard/DetailsCard";
|
|
5
6
|
|
|
6
|
-
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard };
|
|
7
|
+
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard };
|
|
File without changes
|
|
@@ -56,17 +56,6 @@
|
|
|
56
56
|
font-size: var(--conduction-rich-card-label-with-icon-label-size);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/* Component: Tag */
|
|
60
|
-
.tag {
|
|
61
|
-
font-size: var(--conduction-tag-font-size);
|
|
62
|
-
background-color: var(--denhaag-color-grey-1);
|
|
63
|
-
border-radius: var(--nlportal-document-border-radius);
|
|
64
|
-
padding-inline-start: var(--nlportal-space-inline-xs);
|
|
65
|
-
padding-inline-end: var(--nlportal-space-inline-xs);
|
|
66
|
-
padding-block-start: var(--nlportal-space-block-xs);
|
|
67
|
-
padding-block-end: var(--nlportal-space-block-xs);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
59
|
/* Content Link */
|
|
71
60
|
.contentLink {
|
|
72
61
|
display: flex;
|
|
@@ -3,6 +3,7 @@ import { navigate } from "gatsby";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as styles from "./RichContentCard.module.css";
|
|
5
5
|
import { ExternalLinkIcon, ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
6
|
+
import { Tag } from "../../tag/Tag";
|
|
6
7
|
|
|
7
8
|
export interface RichContentCardProps {
|
|
8
9
|
link: {
|
|
@@ -44,8 +45,8 @@ export const RichContentCard: React.FC<RichContentCardProps> = ({
|
|
|
44
45
|
</div>
|
|
45
46
|
|
|
46
47
|
<div className={styles.tags}>
|
|
47
|
-
{tags.map((tag) => (
|
|
48
|
-
<Tag {...{ tag }} />
|
|
48
|
+
{tags.map((tag, idx) => (
|
|
49
|
+
<Tag key={idx} {...{ tag }} />
|
|
49
50
|
))}
|
|
50
51
|
</div>
|
|
51
52
|
|
|
@@ -75,14 +76,6 @@ const LabelWithIcon: React.FC<LabelWithIconProps> = ({ label, icon }) => {
|
|
|
75
76
|
);
|
|
76
77
|
};
|
|
77
78
|
|
|
78
|
-
interface TagProps {
|
|
79
|
-
tag: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const Tag: React.FC<TagProps> = ({ tag }) => {
|
|
83
|
-
return <span className={styles.tag}>{tag}</span>;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
79
|
interface ContentLinkProps {
|
|
87
80
|
title: string;
|
|
88
81
|
subTitle: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
.tag {
|
|
2
|
+
font-size: var(--conduction-tag-font-size);
|
|
3
|
+
background-color: var(--denhaag-color-grey-1);
|
|
4
|
+
border-radius: var(--nlportal-document-border-radius);
|
|
5
|
+
padding-inline-start: var(--nlportal-space-inline-xs);
|
|
6
|
+
padding-inline-end: var(--nlportal-space-inline-xs);
|
|
7
|
+
padding-block-start: var(--nlportal-space-block-xs);
|
|
8
|
+
padding-block-end: var(--nlportal-space-block-xs);
|
|
9
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DownloadCard,
|
|
3
|
+
HorizontalImageCard,
|
|
4
|
+
ImageAndDetailsCard,
|
|
5
|
+
RichContentCard,
|
|
6
|
+
DetailsCard,
|
|
7
|
+
} from "./components/card";
|
|
2
8
|
import { Container } from "./components/container/Container";
|
|
3
9
|
import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
|
|
4
10
|
import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
|
|
@@ -17,12 +23,14 @@ import { MetaIcon } from "./components/metaIcon/MetaIcon";
|
|
|
17
23
|
import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
|
|
18
24
|
import { StatusSteps } from "./components/statusSteps/StatusSteps";
|
|
19
25
|
import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
|
|
26
|
+
import { Tag } from "./components/tag/Tag";
|
|
20
27
|
|
|
21
28
|
export {
|
|
22
29
|
DownloadCard,
|
|
23
30
|
HorizontalImageCard,
|
|
24
31
|
ImageAndDetailsCard,
|
|
25
32
|
RichContentCard,
|
|
33
|
+
DetailsCard,
|
|
26
34
|
Container,
|
|
27
35
|
Breadcrumbs,
|
|
28
36
|
EditableTableRow,
|
|
@@ -41,4 +49,5 @@ export {
|
|
|
41
49
|
StatusSteps,
|
|
42
50
|
PrimaryTopNav,
|
|
43
51
|
SecondaryTopNav,
|
|
52
|
+
Tag,
|
|
44
53
|
};
|