@eeacms/volto-eea-design-system 0.2.1
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/.coverage.babel.config.js +13 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +50 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +50 -0
- package/.github/workflows/node.js.yml +59 -0
- package/.prettierignore +4 -0
- package/.project.eslintrc.js +45 -0
- package/.release-it.json +17 -0
- package/.storybook/manager.js +15 -0
- package/CHANGELOG.md +1025 -0
- package/DEVELOP.md +51 -0
- package/LICENSE.md +9 -0
- package/README.md +196 -0
- package/bootstrap +41 -0
- package/cypress.json +17 -0
- package/jest-addon.config.js +36 -0
- package/locales/volto.pot +0 -0
- package/mockups/README.md +1 -0
- package/package.json +49 -0
- package/razzle.extend.js +23 -0
- package/src/helpers/index.js +2 -0
- package/src/helpers/useClickOutside.js +30 -0
- package/src/helpers/usePrevious.js +9 -0
- package/src/i18n.js +180 -0
- package/src/index.js +6 -0
- package/src/semantic.less +262 -0
- package/src/ui/Avatar/Avatar.jsx +32 -0
- package/src/ui/Avatar/Avatar.stories.jsx +61 -0
- package/src/ui/AvatarGrid/AvatarGrid.jsx +49 -0
- package/src/ui/AvatarGrid/AvatarGrid.stories.jsx +66 -0
- package/src/ui/Banner/Banner.jsx +59 -0
- package/src/ui/Banner/Banner.stories.jsx +121 -0
- package/src/ui/Blockquote/Blockquote.jsx +16 -0
- package/src/ui/Blockquote/Blockquote.stories.jsx +48 -0
- package/src/ui/Breadcrumbs/Breadcrumb.stories.jsx +76 -0
- package/src/ui/Breadcrumbs/Breadcrumbs.jsx +67 -0
- package/src/ui/Breadcrumbs/Breadcrumbs.stories.jsx +30 -0
- package/src/ui/Button/Button.stories.jsx +169 -0
- package/src/ui/Divider/Divider.jsx +7 -0
- package/src/ui/Footer/Contact.jsx +28 -0
- package/src/ui/Footer/Footer.jsx +52 -0
- package/src/ui/Footer/FooterActions.jsx +22 -0
- package/src/ui/Footer/FooterHeader.jsx +10 -0
- package/src/ui/Footer/FooterSites.jsx +33 -0
- package/src/ui/Footer/Social.jsx +25 -0
- package/src/ui/Footer/SubFooter.jsx +9 -0
- package/src/ui/FormFieldWrapper/FormFieldWrapper.jsx +51 -0
- package/src/ui/Header/Header.jsx +224 -0
- package/src/ui/Header/HeaderMenuPopUp.js +79 -0
- package/src/ui/Header/HeaderSearchPopUp.js +33 -0
- package/src/ui/InpageNavigation/InpageNavigation.jsx +61 -0
- package/src/ui/InpageNavigation/InpageNavigation.stories.jsx +166 -0
- package/src/ui/KeyContent/KeyContent.jsx +22 -0
- package/src/ui/KeyContent/KeyContent.stories.jsx +62 -0
- package/src/ui/Loader/Loader.stories.jsx +45 -0
- package/src/ui/Logo/Logo.jsx +31 -0
- package/src/ui/Popup/Popup.stories.jsx +97 -0
- package/src/ui/PublicationCard/PublicationCard.jsx +27 -0
- package/src/ui/PublicationCard/PublicationCard.stories.jsx +69 -0
- package/src/ui/Pullquote/Pullquote.jsx +44 -0
- package/src/ui/Pullquote/Pullquote.stories.jsx +101 -0
- package/src/ui/RelatedContent/RelatedContent.jsx +90 -0
- package/src/ui/RelatedContent/RelatedContent.stories.jsx +80 -0
- package/src/ui/Segment/Segment.stories.jsx +163 -0
- package/src/ui/Tag/Tag.jsx +13 -0
- package/src/ui/Tag/Tag.stories.jsx +21 -0
- package/src/ui/TagList/TagList.jsx +23 -0
- package/src/ui/TagList/TagList.stories.jsx +63 -0
- package/src/ui/Testimonial/Testimonial.jsx +53 -0
- package/src/ui/Testimonial/Testimonial.stories.jsx +51 -0
- package/src/ui/Timeline/Timeline.jsx +44 -0
- package/src/ui/Timeline/Timeline.stories.jsx +322 -0
- package/src/ui/index.js +31 -0
- package/templates/eea.hbs +50 -0
- package/theme/theme.config +122 -0
- package/theme/theme.less +64 -0
- package/theme/themes/eea/assets/images/EEA_Logo_Vertical.png +0 -0
- package/theme/themes/eea/assets/images/Footer/EEALogo.png +0 -0
- package/theme/themes/eea/assets/images/Footer/EULogo.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Extras/Logo1.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Extras/Logo10.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Extras/Logo2.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Extras/Logo3.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Extras/Logo4.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Extras/Logo5.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Extras/Logo6.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Extras/Logo7.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Extras/Logo8.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Extras/Logo9.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Extras/abstract-visual.svg +32 -0
- package/theme/themes/eea/assets/images/Footer/Extras/footervisual.svg +1755 -0
- package/theme/themes/eea/assets/images/Footer/Vector1.png +0 -0
- package/theme/themes/eea/assets/images/Footer/Vector2.png +0 -0
- package/theme/themes/eea/assets/images/Header/EeaLogo.png +0 -0
- package/theme/themes/eea/assets/images/Header/Vector.png +0 -0
- package/theme/themes/eea/assets/images/Header/close-line.svg +1 -0
- package/theme/themes/eea/assets/images/Header/close.png +0 -0
- package/theme/themes/eea/assets/images/Header/down-arrow.png +0 -0
- package/theme/themes/eea/assets/images/Header/eea-logo.svg +14 -0
- package/theme/themes/eea/assets/images/Header/eea.png +0 -0
- package/theme/themes/eea/assets/images/Header/eeaIcon.png +0 -0
- package/theme/themes/eea/assets/images/Header/global-line.svg +1 -0
- package/theme/themes/eea/assets/images/Header/globeIcon.png +0 -0
- package/theme/themes/eea/assets/images/Header/hamburgerMenuIcon.png +0 -0
- package/theme/themes/eea/assets/images/Header/menu-left-arrow.svg +3 -0
- package/theme/themes/eea/assets/images/Header/menu-line.svg +1 -0
- package/theme/themes/eea/assets/images/Header/search-line.svg +1 -0
- package/theme/themes/eea/assets/images/Header/search.png +0 -0
- package/theme/themes/eea/assets/images/Header/searchIcon.png +0 -0
- package/theme/themes/eea/assets/images/arrow-down.svg +10 -0
- package/theme/themes/eea/assets/images/avatar.png +0 -0
- package/theme/themes/eea/assets/images/banner.png +0 -0
- package/theme/themes/eea/assets/images/eea-logo.png +0 -0
- package/theme/themes/eea/assets/images/eea_icon.png +0 -0
- package/theme/themes/eea/assets/images/europe-flag.svg +4 -0
- package/theme/themes/eea/assets/images/home-icon.svg +3 -0
- package/theme/themes/eea/assets/images/loaderImage.png +0 -0
- package/theme/themes/eea/assets/images/mega-menu-arrow.svg +3 -0
- package/theme/themes/eea/assets/logo/EEA-Logo-White-2.svg +9 -0
- package/theme/themes/eea/assets/logo/EEA-Logo-white.svg +9 -0
- package/theme/themes/eea/assets/logo/EIONETLogo.png +0 -0
- package/theme/themes/eea/assets/logo/bise.svg +47 -0
- package/theme/themes/eea/assets/logo/cca.svg +20 -0
- package/theme/themes/eea/assets/logo/copernicus.svg +62 -0
- package/theme/themes/eea/assets/logo/energy.svg +77 -0
- package/theme/themes/eea/assets/logo/fise.svg +37 -0
- package/theme/themes/eea/assets/logo/freshwater.svg +48 -0
- package/theme/themes/eea/assets/logo/industry.svg +40 -0
- package/theme/themes/eea/assets/logo/insitu.svg +43 -0
- package/theme/themes/eea/assets/logo/ipchem.svg +23 -0
- package/theme/themes/eea/assets/logo/marine.svg +63 -0
- package/theme/themes/eea/collections/breadcrumb.overrides +44 -0
- package/theme/themes/eea/collections/breadcrumb.variables +49 -0
- package/theme/themes/eea/collections/form.overrides +56 -0
- package/theme/themes/eea/collections/form.variables +211 -0
- package/theme/themes/eea/collections/grid.overrides +17 -0
- package/theme/themes/eea/collections/grid.variables +103 -0
- package/theme/themes/eea/collections/menu.overrides +84 -0
- package/theme/themes/eea/collections/menu.variables +471 -0
- package/theme/themes/eea/collections/message.overrides +34 -0
- package/theme/themes/eea/collections/message.variables +142 -0
- package/theme/themes/eea/collections/table.overrides +30 -0
- package/theme/themes/eea/collections/table.variables +249 -0
- package/theme/themes/eea/definitions/elements/icon.less +499 -0
- package/theme/themes/eea/elements/button.overrides +199 -0
- package/theme/themes/eea/elements/button.variables +405 -0
- package/theme/themes/eea/elements/container.overrides +98 -0
- package/theme/themes/eea/elements/container.variables +66 -0
- package/theme/themes/eea/elements/divider.overrides +17 -0
- package/theme/themes/eea/elements/divider.variables +53 -0
- package/theme/themes/eea/elements/flag.overrides +1235 -0
- package/theme/themes/eea/elements/flag.variables +13 -0
- package/theme/themes/eea/elements/header.overrides +205 -0
- package/theme/themes/eea/elements/header.variables +151 -0
- package/theme/themes/eea/elements/icon.overrides +5589 -0
- package/theme/themes/eea/elements/icon.variables +95 -0
- package/theme/themes/eea/elements/image.overrides +3 -0
- package/theme/themes/eea/elements/image.variables +44 -0
- package/theme/themes/eea/elements/input.overrides +83 -0
- package/theme/themes/eea/elements/input.variables +104 -0
- package/theme/themes/eea/elements/label.overrides +49 -0
- package/theme/themes/eea/elements/label.variables +267 -0
- package/theme/themes/eea/elements/list.overrides +28 -0
- package/theme/themes/eea/elements/list.variables +233 -0
- package/theme/themes/eea/elements/loader.overrides +3 -0
- package/theme/themes/eea/elements/loader.variables +73 -0
- package/theme/themes/eea/elements/placeholder.overrides +3 -0
- package/theme/themes/eea/elements/placeholder.variables +55 -0
- package/theme/themes/eea/elements/rail.overrides +3 -0
- package/theme/themes/eea/elements/rail.variables +34 -0
- package/theme/themes/eea/elements/reveal.overrides +3 -0
- package/theme/themes/eea/elements/reveal.variables +18 -0
- package/theme/themes/eea/elements/segment.overrides +8 -0
- package/theme/themes/eea/elements/segment.variables +154 -0
- package/theme/themes/eea/elements/step.overrides +18 -0
- package/theme/themes/eea/elements/step.variables +130 -0
- package/theme/themes/eea/extras/avatar.less +97 -0
- package/theme/themes/eea/extras/avatar.variables +34 -0
- package/theme/themes/eea/extras/avatarGrid.less +43 -0
- package/theme/themes/eea/extras/avatarGrid.variables +20 -0
- package/theme/themes/eea/extras/banner.less +213 -0
- package/theme/themes/eea/extras/banner.variables +77 -0
- package/theme/themes/eea/extras/blockquote.less +89 -0
- package/theme/themes/eea/extras/blockquote.variables +35 -0
- package/theme/themes/eea/extras/custom.overrides +0 -0
- package/theme/themes/eea/extras/custom.variables +0 -0
- package/theme/themes/eea/extras/divider.less +14 -0
- package/theme/themes/eea/extras/divider.variables +9 -0
- package/theme/themes/eea/extras/footer.less +273 -0
- package/theme/themes/eea/extras/footer.variables +109 -0
- package/theme/themes/eea/extras/header.less +691 -0
- package/theme/themes/eea/extras/header.variables +149 -0
- package/theme/themes/eea/extras/inpageNavigation.less +57 -0
- package/theme/themes/eea/extras/inpageNavigation.variables +30 -0
- package/theme/themes/eea/extras/keyContent.less +36 -0
- package/theme/themes/eea/extras/keyContent.variables +18 -0
- package/theme/themes/eea/extras/main.overrides +31 -0
- package/theme/themes/eea/extras/main.variables +33 -0
- package/theme/themes/eea/extras/publicationCard.less +62 -0
- package/theme/themes/eea/extras/publicationCard.variables +24 -0
- package/theme/themes/eea/extras/pullquote.less +76 -0
- package/theme/themes/eea/extras/pullquote.variables +34 -0
- package/theme/themes/eea/extras/select.overrides +0 -0
- package/theme/themes/eea/extras/select.variables +0 -0
- package/theme/themes/eea/extras/tag.less +37 -0
- package/theme/themes/eea/extras/tag.variables +22 -0
- package/theme/themes/eea/extras/tagList.less +50 -0
- package/theme/themes/eea/extras/tagList.variables +13 -0
- package/theme/themes/eea/extras/testimonial.less +28 -0
- package/theme/themes/eea/extras/testimonial.variables +13 -0
- package/theme/themes/eea/extras/timeline.less +114 -0
- package/theme/themes/eea/extras/timeline.variables +40 -0
- package/theme/themes/eea/globals/reset.overrides +454 -0
- package/theme/themes/eea/globals/reset.variables +6 -0
- package/theme/themes/eea/globals/site.overrides +27 -0
- package/theme/themes/eea/globals/site.variables +1135 -0
- package/theme/themes/eea/modules/accordion.overrides +83 -0
- package/theme/themes/eea/modules/accordion.variables +114 -0
- package/theme/themes/eea/modules/chatroom.overrides +3 -0
- package/theme/themes/eea/modules/chatroom.variables +3 -0
- package/theme/themes/eea/modules/checkbox.overrides +67 -0
- package/theme/themes/eea/modules/checkbox.variables +194 -0
- package/theme/themes/eea/modules/dimmer.overrides +3 -0
- package/theme/themes/eea/modules/dimmer.variables +58 -0
- package/theme/themes/eea/modules/dropdown.overrides +53 -0
- package/theme/themes/eea/modules/dropdown.variables +390 -0
- package/theme/themes/eea/modules/embed.overrides +3 -0
- package/theme/themes/eea/modules/embed.variables +53 -0
- package/theme/themes/eea/modules/modal.overrides +3 -0
- package/theme/themes/eea/modules/modal.variables +193 -0
- package/theme/themes/eea/modules/nag.overrides +3 -0
- package/theme/themes/eea/modules/nag.variables +74 -0
- package/theme/themes/eea/modules/popup.overrides +83 -0
- package/theme/themes/eea/modules/popup.variables +153 -0
- package/theme/themes/eea/modules/progress.overrides +3 -0
- package/theme/themes/eea/modules/progress.variables +113 -0
- package/theme/themes/eea/modules/rating.overrides +74 -0
- package/theme/themes/eea/modules/rating.variables +103 -0
- package/theme/themes/eea/modules/search.overrides +3 -0
- package/theme/themes/eea/modules/search.variables +163 -0
- package/theme/themes/eea/modules/shape.overrides +3 -0
- package/theme/themes/eea/modules/shape.variables +40 -0
- package/theme/themes/eea/modules/sidebar.overrides +3 -0
- package/theme/themes/eea/modules/sidebar.variables +45 -0
- package/theme/themes/eea/modules/sticky.overrides +3 -0
- package/theme/themes/eea/modules/sticky.variables +7 -0
- package/theme/themes/eea/modules/tab.overrides +13 -0
- package/theme/themes/eea/modules/tab.variables +17 -0
- package/theme/themes/eea/modules/transition.overrides +1087 -0
- package/theme/themes/eea/modules/transition.variables +10 -0
- package/theme/themes/eea/modules/video.overrides +3 -0
- package/theme/themes/eea/modules/video.variables +16 -0
- package/theme/themes/eea/views/ad.overrides +3 -0
- package/theme/themes/eea/views/ad.variables +13 -0
- package/theme/themes/eea/views/card.overrides +73 -0
- package/theme/themes/eea/views/card.variables +237 -0
- package/theme/themes/eea/views/comment.overrides +3 -0
- package/theme/themes/eea/views/comment.variables +98 -0
- package/theme/themes/eea/views/feed.overrides +3 -0
- package/theme/themes/eea/views/feed.variables +141 -0
- package/theme/themes/eea/views/item.overrides +8 -0
- package/theme/themes/eea/views/item.variables +157 -0
- package/theme/themes/eea/views/statistic.overrides +19 -0
- package/theme/themes/eea/views/statistic.variables +105 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Blockquote from './Blockquote';
|
|
3
|
+
|
|
4
|
+
const CITATION =
|
|
5
|
+
'An interconnected grid will help deliver the ultimate goal of the Energy Union, to make sure affordable, secure and sustainable energy, and also growth across the EU.';
|
|
6
|
+
const AUTHOR = 'President Juncker';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/Blockquote',
|
|
10
|
+
component: Blockquote,
|
|
11
|
+
argTypes: {
|
|
12
|
+
content: {
|
|
13
|
+
name: 'citation',
|
|
14
|
+
description: 'Blockquote content',
|
|
15
|
+
type: { name: 'string', required: true },
|
|
16
|
+
},
|
|
17
|
+
meta: {
|
|
18
|
+
name: 'meta',
|
|
19
|
+
description: 'Author of the content',
|
|
20
|
+
type: { name: 'string', required: true },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Default = (args) => (
|
|
26
|
+
<Blockquote>
|
|
27
|
+
<Blockquote.Content>{args.content}</Blockquote.Content>
|
|
28
|
+
<Blockquote.Meta>{args.meta}</Blockquote.Meta>
|
|
29
|
+
</Blockquote>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
Default.args = {
|
|
33
|
+
content: CITATION,
|
|
34
|
+
meta: AUTHOR,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Reversed = (args) => (
|
|
38
|
+
<Blockquote>
|
|
39
|
+
<Blockquote.Meta>{args.meta}</Blockquote.Meta>
|
|
40
|
+
<Blockquote.Content>{args.content}</Blockquote.Content>
|
|
41
|
+
</Blockquote>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
Reversed.args = {
|
|
45
|
+
content:
|
|
46
|
+
'The Ministry of Environment & Energy is responsible for environmental policy, the preparation of plans and programmes, and overseeing their implementation. The Ministry is also in charge of the transposition of EU environmental Directives into national law.',
|
|
47
|
+
meta: '22 December 1989',
|
|
48
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Breadcrumb, Container, Icon, Image } from 'semantic-ui-react';
|
|
3
|
+
import homeSVG from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/home-icon.svg';
|
|
4
|
+
import { Link } from 'react-router-dom';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Breadcrumb',
|
|
8
|
+
component: Breadcrumb,
|
|
9
|
+
parameters: {
|
|
10
|
+
actions: {
|
|
11
|
+
handles: ['click'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
root: {
|
|
16
|
+
description: 'home button url link',
|
|
17
|
+
table: {
|
|
18
|
+
type: {
|
|
19
|
+
summary: 'string',
|
|
20
|
+
},
|
|
21
|
+
defaultValue: {
|
|
22
|
+
summary: '',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
sections: {
|
|
27
|
+
description: 'breadcrumb tabs',
|
|
28
|
+
table: {
|
|
29
|
+
type: {
|
|
30
|
+
summary: 'Object',
|
|
31
|
+
},
|
|
32
|
+
defaultValue: {
|
|
33
|
+
summary: ' "" ',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//const Template = (args) => <Breadcrumb {...args}></Breadcrumb>;
|
|
41
|
+
|
|
42
|
+
const Template = (args) => (
|
|
43
|
+
<Container>
|
|
44
|
+
<Breadcrumb size="tiny">
|
|
45
|
+
<Breadcrumb.Section key="home" href={args.root}>
|
|
46
|
+
<Image src={homeSVG} alt="home" />
|
|
47
|
+
</Breadcrumb.Section>
|
|
48
|
+
{args.sections.map((section, index, sections) => [
|
|
49
|
+
index !== 0 && (
|
|
50
|
+
<Breadcrumb.Divider key={index}>
|
|
51
|
+
<Icon className="ri-arrow-right-s-line"></Icon>
|
|
52
|
+
</Breadcrumb.Divider>
|
|
53
|
+
),
|
|
54
|
+
index < sections.length - 1 ? (
|
|
55
|
+
<Link key={section.href} to={section.href} className="section">
|
|
56
|
+
{section.content}{' '}
|
|
57
|
+
</Link>
|
|
58
|
+
) : (
|
|
59
|
+
<Breadcrumb.Section key={section.key} active>
|
|
60
|
+
{section.content}{' '}
|
|
61
|
+
</Breadcrumb.Section>
|
|
62
|
+
),
|
|
63
|
+
])}
|
|
64
|
+
</Breadcrumb>
|
|
65
|
+
</Container>
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export const Default = Template.bind({});
|
|
69
|
+
Default.args = {
|
|
70
|
+
root: 'https://www.eea.europa.eu/',
|
|
71
|
+
sections: [
|
|
72
|
+
{ key: 'Section 1', content: 'Section 1', href: '/#' },
|
|
73
|
+
{ key: 'Section 2', content: 'Section 2', href: '/#' },
|
|
74
|
+
{ key: 'Section 3', content: 'Section 3', href: '/#' },
|
|
75
|
+
],
|
|
76
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Breadcrumbs components.
|
|
3
|
+
* @module components/theme/Breadcrumbs/Breadcrumbs
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { Link } from 'react-router-dom';
|
|
9
|
+
import { Breadcrumb, Container, Image, Icon, Segment } from 'semantic-ui-react';
|
|
10
|
+
|
|
11
|
+
import homeIcon from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/home-icon.svg';
|
|
12
|
+
|
|
13
|
+
const Breadcrumbs = ({
|
|
14
|
+
root,
|
|
15
|
+
sections = [],
|
|
16
|
+
icon = 'ri-arrow-right-s-line',
|
|
17
|
+
size = 'tiny',
|
|
18
|
+
}) => {
|
|
19
|
+
return sections.length > 0 ? (
|
|
20
|
+
<Segment
|
|
21
|
+
role="navigation"
|
|
22
|
+
aria-label={'breadcrumbs'}
|
|
23
|
+
className="breadcrumbs"
|
|
24
|
+
attached
|
|
25
|
+
>
|
|
26
|
+
<Container>
|
|
27
|
+
<Breadcrumb size={size}>
|
|
28
|
+
<Link to={root || '/'} className="section" title={'Home'}>
|
|
29
|
+
<Image src={homeIcon} alt="home" />
|
|
30
|
+
</Link>
|
|
31
|
+
{sections.map((item, index, items) => [
|
|
32
|
+
<Breadcrumb.Divider key={`divider-${item.href}`}>
|
|
33
|
+
<Icon className={icon}></Icon>
|
|
34
|
+
</Breadcrumb.Divider>,
|
|
35
|
+
index < items.length - 1 ? (
|
|
36
|
+
<Link key={item.key} to={item.href} className="section">
|
|
37
|
+
{item.title}
|
|
38
|
+
</Link>
|
|
39
|
+
) : (
|
|
40
|
+
<Breadcrumb.Section key={item.key} active>
|
|
41
|
+
{item.title}
|
|
42
|
+
</Breadcrumb.Section>
|
|
43
|
+
),
|
|
44
|
+
])}
|
|
45
|
+
</Breadcrumb>
|
|
46
|
+
</Container>
|
|
47
|
+
</Segment>
|
|
48
|
+
) : (
|
|
49
|
+
''
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
Breadcrumbs.propTypes = {
|
|
54
|
+
root: PropTypes.string,
|
|
55
|
+
sections: PropTypes.arrayOf(
|
|
56
|
+
PropTypes.shape({
|
|
57
|
+
title: PropTypes.string,
|
|
58
|
+
href: PropTypes.string,
|
|
59
|
+
key: PropTypes.string,
|
|
60
|
+
}),
|
|
61
|
+
).isRequired,
|
|
62
|
+
size: PropTypes.string,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const BreadcrumbsComponent = Breadcrumbs;
|
|
66
|
+
|
|
67
|
+
export default Breadcrumbs;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { injectIntl } from 'react-intl';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BreadcrumbsComponent } from './Breadcrumbs';
|
|
4
|
+
import Wrapper from '@plone/volto/storybook';
|
|
5
|
+
|
|
6
|
+
export const Breadcrumb = injectIntl(({ children, ...args }) => {
|
|
7
|
+
return (
|
|
8
|
+
<Wrapper location={{ pathname: '/folder2/folder21/doc212' }}>
|
|
9
|
+
<div className="ui segment form attached" style={{ width: '400px' }}>
|
|
10
|
+
<BreadcrumbsComponent
|
|
11
|
+
pathname=""
|
|
12
|
+
items={[
|
|
13
|
+
{
|
|
14
|
+
'@id': 'https://volto.kitconcept.com/api/Members',
|
|
15
|
+
title: 'Users',
|
|
16
|
+
},
|
|
17
|
+
]}
|
|
18
|
+
getBreadcrumbs={() => {}}
|
|
19
|
+
{...args}
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
</Wrapper>
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// export default {
|
|
27
|
+
// title: 'Components/Breadcrumb/Breadcrumb 1',
|
|
28
|
+
// component: Breadcrumb,
|
|
29
|
+
// argTypes: {},
|
|
30
|
+
// };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, Icon, Segment } from 'semantic-ui-react';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Button',
|
|
6
|
+
component: Button,
|
|
7
|
+
parameters: {
|
|
8
|
+
actions: {
|
|
9
|
+
handles: ['click'],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
label: { description: 'button label' },
|
|
14
|
+
disabled: {
|
|
15
|
+
description: 'button disabled',
|
|
16
|
+
table: {
|
|
17
|
+
defaultValue: {
|
|
18
|
+
summary: 'false',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
animated: {
|
|
23
|
+
options: [false, true, 'fade', 'vertical'],
|
|
24
|
+
control: { type: 'inline-radio' },
|
|
25
|
+
},
|
|
26
|
+
variant: {
|
|
27
|
+
options: ['default', 'eeaPrimaryButton', 'eeaSecondaryButton'],
|
|
28
|
+
control: { type: 'inline-radio' },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
//Primary button
|
|
34
|
+
export const Primary = (args) => {
|
|
35
|
+
return (
|
|
36
|
+
<Button primary disabled={args.disabled}>
|
|
37
|
+
{args.label}
|
|
38
|
+
</Button>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
Primary.args = {
|
|
42
|
+
label: 'Primary Button',
|
|
43
|
+
disabled: false,
|
|
44
|
+
};
|
|
45
|
+
Primary.parameters = {
|
|
46
|
+
controls: { exclude: ['animated', 'variant'] },
|
|
47
|
+
hideNoControlsWarning: true,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
//secondary Button
|
|
51
|
+
export const Secondary = (args) => {
|
|
52
|
+
return (
|
|
53
|
+
<Button secondary disabled={args.disabled}>
|
|
54
|
+
{args.label}
|
|
55
|
+
</Button>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
Secondary.args = {
|
|
59
|
+
label: 'Secondary Button',
|
|
60
|
+
disabled: false,
|
|
61
|
+
};
|
|
62
|
+
Secondary.parameters = {
|
|
63
|
+
controls: { exclude: ['animated', 'variant'] },
|
|
64
|
+
hideNoControlsWarning: true,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
//secondary Button Inverted
|
|
68
|
+
export const SecondaryInverted = (args) => {
|
|
69
|
+
return (
|
|
70
|
+
<Segment inverted compact>
|
|
71
|
+
<Button secondary inverted disabled={args.disabled}>
|
|
72
|
+
{args.label}
|
|
73
|
+
</Button>
|
|
74
|
+
</Segment>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
SecondaryInverted.args = {
|
|
78
|
+
label: 'Secondary Button',
|
|
79
|
+
disabled: false,
|
|
80
|
+
};
|
|
81
|
+
SecondaryInverted.parameters = {
|
|
82
|
+
controls: { exclude: ['animated', 'variant'] },
|
|
83
|
+
hideNoControlsWarning: true,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
//Call to action button
|
|
87
|
+
export const CallToAction = (args) => {
|
|
88
|
+
return (
|
|
89
|
+
<Button
|
|
90
|
+
icon
|
|
91
|
+
labelPosition="right"
|
|
92
|
+
className="action"
|
|
93
|
+
disabled={args.disabled}
|
|
94
|
+
>
|
|
95
|
+
{args.label}
|
|
96
|
+
<Icon name={args.icon} />
|
|
97
|
+
</Button>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
CallToAction.args = {
|
|
101
|
+
label: 'CALL TO ACTION BUTTON',
|
|
102
|
+
icon: 'chevron right',
|
|
103
|
+
disabled: false,
|
|
104
|
+
};
|
|
105
|
+
CallToAction.parameters = {
|
|
106
|
+
controls: { exclude: ['animated', 'variant'] },
|
|
107
|
+
hideNoControlsWarning: true,
|
|
108
|
+
};
|
|
109
|
+
CallToAction.argTypes = {
|
|
110
|
+
label: {
|
|
111
|
+
name: 'button label',
|
|
112
|
+
type: { name: 'string', required: true },
|
|
113
|
+
},
|
|
114
|
+
icon: {
|
|
115
|
+
name: 'button icon',
|
|
116
|
+
type: { name: 'string', required: false },
|
|
117
|
+
defaultValue: 'chevron right',
|
|
118
|
+
options: [
|
|
119
|
+
'chevron right',
|
|
120
|
+
'arrow right',
|
|
121
|
+
'sign-in',
|
|
122
|
+
'sign-out',
|
|
123
|
+
'play',
|
|
124
|
+
'stop',
|
|
125
|
+
'pause',
|
|
126
|
+
'download',
|
|
127
|
+
'upload',
|
|
128
|
+
'print',
|
|
129
|
+
'copy',
|
|
130
|
+
'edit',
|
|
131
|
+
'ellipsis',
|
|
132
|
+
],
|
|
133
|
+
control: { type: 'select' },
|
|
134
|
+
description: 'button icon',
|
|
135
|
+
table: {
|
|
136
|
+
defaultValue: { summary: 'chevron right' },
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
//Text Button - can also play with text class
|
|
142
|
+
export const Text = (args) => {
|
|
143
|
+
return (
|
|
144
|
+
<Button as="p" disabled={args.disabled}>
|
|
145
|
+
{args.label}
|
|
146
|
+
</Button>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
Text.args = {
|
|
150
|
+
label: 'Text Button',
|
|
151
|
+
disabled: false,
|
|
152
|
+
};
|
|
153
|
+
Text.parameters = {
|
|
154
|
+
controls: { exclude: ['animated', 'variant'] },
|
|
155
|
+
hideNoControlsWarning: true,
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
//Cancel Button
|
|
159
|
+
export const Cancel = (args) => {
|
|
160
|
+
return <Button disabled={args.disabled}>{args.label}</Button>;
|
|
161
|
+
};
|
|
162
|
+
Cancel.args = {
|
|
163
|
+
label: 'Cancel Button',
|
|
164
|
+
disabled: false,
|
|
165
|
+
};
|
|
166
|
+
Cancel.parameters = {
|
|
167
|
+
controls: { exclude: ['animated', 'variant'] },
|
|
168
|
+
hideNoControlsWarning: true,
|
|
169
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icon } from 'semantic-ui-react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { Link } from 'react-router-dom';
|
|
5
|
+
|
|
6
|
+
const Contact = ({ children, contacts, header, address }) =>
|
|
7
|
+
children?.length ? (
|
|
8
|
+
children
|
|
9
|
+
) : (
|
|
10
|
+
<>
|
|
11
|
+
<p className="header">{header}</p>
|
|
12
|
+
{contacts?.map((contact, index) => (
|
|
13
|
+
<div className="contact" key={index}>
|
|
14
|
+
<Icon name={contact.icon} size="big"></Icon>
|
|
15
|
+
<Link to={contact.link}>{contact.text}</Link>
|
|
16
|
+
</div>
|
|
17
|
+
))}
|
|
18
|
+
{address && <p className="address">{address}</p>}
|
|
19
|
+
</>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
Contact.propTypes = {
|
|
23
|
+
contacts: PropTypes.array,
|
|
24
|
+
header: PropTypes.string,
|
|
25
|
+
address: PropTypes.string,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default Contact;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Footer component.
|
|
3
|
+
* @module components/theme/Footer/Footer
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { Container } from 'semantic-ui-react';
|
|
8
|
+
|
|
9
|
+
import FooterSites from '@eeacms/volto-eea-design-system/ui/Footer/FooterSites';
|
|
10
|
+
import FooterActions from '@eeacms/volto-eea-design-system/ui/Footer/FooterActions';
|
|
11
|
+
import FooterHeader from '@eeacms/volto-eea-design-system/ui/Footer/FooterHeader';
|
|
12
|
+
import SubFooter from '@eeacms/volto-eea-design-system/ui/Footer/SubFooter';
|
|
13
|
+
import Social from '@eeacms/volto-eea-design-system/ui/Footer/Social';
|
|
14
|
+
import Contact from '@eeacms/volto-eea-design-system/ui/Footer/Contact';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Component to display the footer.
|
|
18
|
+
* @function Footer
|
|
19
|
+
* @param {Object} intl Intl object
|
|
20
|
+
* @returns {string} Markup of the component
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
const Footer = (props) => {
|
|
24
|
+
const { children } = props;
|
|
25
|
+
return (
|
|
26
|
+
<footer>
|
|
27
|
+
<div className="wrapper">
|
|
28
|
+
<Container>{children}</Container>
|
|
29
|
+
</div>
|
|
30
|
+
</footer>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
Footer.Actions = FooterActions;
|
|
35
|
+
Footer.Contact = Contact;
|
|
36
|
+
Footer.Header = FooterHeader;
|
|
37
|
+
Footer.Sites = FooterSites;
|
|
38
|
+
Footer.Social = Social;
|
|
39
|
+
Footer.SubFooter = SubFooter;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Property types.
|
|
43
|
+
* @property {Object} propTypes Property types.
|
|
44
|
+
* @static
|
|
45
|
+
*/
|
|
46
|
+
Footer.propTypes = {
|
|
47
|
+
/**
|
|
48
|
+
* i18n object
|
|
49
|
+
*/
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default Footer;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
const FooterActions = (props) => {
|
|
5
|
+
if (props.children) {
|
|
6
|
+
return <div>{props.children}</div>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div className="menu">
|
|
11
|
+
{props.actions &&
|
|
12
|
+
props.actions.map((action, index) => (
|
|
13
|
+
<Link to={action.link} key={index}>
|
|
14
|
+
{action.copy && <>©</>}
|
|
15
|
+
{action.title}
|
|
16
|
+
</Link>
|
|
17
|
+
))}
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default FooterActions;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Grid, Image } from 'semantic-ui-react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
const Sites = (props) => {
|
|
6
|
+
if (props.children) {
|
|
7
|
+
return <div>{props.children}</div>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//fallback to props
|
|
11
|
+
return (
|
|
12
|
+
<div className="theme-sites">
|
|
13
|
+
<div className="logos">
|
|
14
|
+
<Grid columns={5}>
|
|
15
|
+
{props.sites &&
|
|
16
|
+
props.sites.map((site, index) => (
|
|
17
|
+
<Grid.Column className="logo" key={index}>
|
|
18
|
+
<a href={site.link}>
|
|
19
|
+
<Image src={site.src} alt={site.alt}></Image>
|
|
20
|
+
</a>
|
|
21
|
+
</Grid.Column>
|
|
22
|
+
))}
|
|
23
|
+
</Grid>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
Sites.propTypes = {
|
|
30
|
+
sites: PropTypes.array,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default Sites;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icon } from 'semantic-ui-react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
const Social = (props) => {
|
|
6
|
+
if (props.children) {
|
|
7
|
+
return <div>{props.children}</div>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div className="social">
|
|
12
|
+
{props.social.map((item, index) => (
|
|
13
|
+
<a href={item.link} aria-label={`${item.name} link`} key={index}>
|
|
14
|
+
<Icon name={item.name}></Icon>
|
|
15
|
+
</a>
|
|
16
|
+
))}
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
Social.propTypes = {
|
|
22
|
+
social: PropTypes.array,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default Social;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Form, Grid, Label, Message } from 'semantic-ui-react';
|
|
3
|
+
|
|
4
|
+
function FormFieldWrapper({
|
|
5
|
+
children,
|
|
6
|
+
required = false,
|
|
7
|
+
error = false,
|
|
8
|
+
label = '',
|
|
9
|
+
columns = 0,
|
|
10
|
+
}) {
|
|
11
|
+
return (
|
|
12
|
+
<Form.Field
|
|
13
|
+
inline
|
|
14
|
+
error={error}
|
|
15
|
+
required={required}
|
|
16
|
+
className="eea field-wrapper"
|
|
17
|
+
>
|
|
18
|
+
<Grid>
|
|
19
|
+
<Grid.Row verticalAlign="top">
|
|
20
|
+
{columns === 1 && (
|
|
21
|
+
<Grid.Column computer="2" tablet="2" mobile="12">
|
|
22
|
+
{label.length > 0 && (
|
|
23
|
+
<Label>
|
|
24
|
+
{label}
|
|
25
|
+
<span className="requred-input">*</span>
|
|
26
|
+
</Label>
|
|
27
|
+
)}
|
|
28
|
+
</Grid.Column>
|
|
29
|
+
)}
|
|
30
|
+
<Grid.Column
|
|
31
|
+
computer={columns === 1 ? '10' : '12'}
|
|
32
|
+
tablet="10"
|
|
33
|
+
mobile="12"
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
{error && (
|
|
37
|
+
<Message
|
|
38
|
+
negative
|
|
39
|
+
content="This is a mandatory field"
|
|
40
|
+
size="mini"
|
|
41
|
+
icon="exclamation circle"
|
|
42
|
+
/>
|
|
43
|
+
)}
|
|
44
|
+
</Grid.Column>
|
|
45
|
+
</Grid.Row>
|
|
46
|
+
</Grid>
|
|
47
|
+
</Form.Field>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default FormFieldWrapper;
|