@eeacms/volto-eea-design-system 0.4.5 → 0.5.2

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Container, Input, Button, Icon } from 'semantic-ui-react';
2
+ import { Container, Input } from 'semantic-ui-react';
3
3
 
4
4
  import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
5
5
 
@@ -14,16 +14,16 @@ function HeaderSearchPopUp({ onClose, triggerRefs = [] }) {
14
14
  <div className="wrapper">
15
15
  <Input
16
16
  className="search"
17
- icon="search"
17
+ icon={{ className: 'ri-search-line', link: true }}
18
18
  placeholder="Search..."
19
19
  fluid
20
20
  />
21
- <div className="action">
21
+ {/* <div className="action">
22
22
  <Button icon labelPosition="left" className="search">
23
23
  <Icon name="search" />
24
24
  Advanced Search
25
25
  </Button>
26
- </div>
26
+ </div> */}
27
27
  </div>
28
28
  </Container>
29
29
  </div>
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ Hero.propTypes = {
5
+ image: PropTypes.bool,
6
+ fullWidth: PropTypes.bool,
7
+ fullHeight: PropTypes.bool,
8
+ alignContent: PropTypes.string,
9
+ textAlign: PropTypes.string,
10
+ metaAlign: PropTypes.string,
11
+ backgroundVariant: PropTypes.string,
12
+ quoted: PropTypes.bool,
13
+ textVariant: PropTypes.string,
14
+ };
15
+
16
+ function Hero({
17
+ image_url,
18
+ image,
19
+ fullWidth,
20
+ fullHeight,
21
+ alignContent,
22
+ backgroundVariant,
23
+ children,
24
+ }) {
25
+ return (
26
+ // full width prop
27
+ <div
28
+ className={`${
29
+ fullWidth ? 'eea hero-block full-width' : 'eea hero-block'
30
+ } ${fullHeight ? 'full-height' : ''} color-bg-${backgroundVariant}`}
31
+ >
32
+ <div
33
+ className="hero-block-image"
34
+ style={image ? { backgroundImage: `url(${image_url})` } : {}}
35
+ >
36
+ <div
37
+ className={`hero-block-inner-wrapper d-flex ui container flex-items-${alignContent}`}
38
+ >
39
+ <div className="hero-block-body">{children}</div>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ );
44
+ }
45
+
46
+ Hero.Text = ({ quoted, textVariant, textAlign, children }) => (
47
+ <div className={`hero-block-text color-fg-${textVariant} text-${textAlign}`}>
48
+ <h2 className={`${quoted ? 'quoted' : ''}`}>{children}</h2>
49
+ </div>
50
+ );
51
+ Hero.Meta = ({ metaAlign, children }) => (
52
+ <div className={`hero-block-meta text-${metaAlign}`}>{children}</div>
53
+ );
54
+
55
+ export default Hero;
@@ -0,0 +1,205 @@
1
+ import React from 'react';
2
+ import Hero from './Hero';
3
+ import { Button } from 'semantic-ui-react';
4
+ import imgUrl from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/forest.png';
5
+
6
+ export default {
7
+ title: 'Components/Hero',
8
+ component: Hero,
9
+ argTypes: {
10
+ image: {
11
+ description: 'Set or unset hero image',
12
+ table: {
13
+ defaultValue: { summary: '"true"' },
14
+ type: { summary: 'boolean' },
15
+ },
16
+ },
17
+ text: {
18
+ description: 'Hero text',
19
+ table: {
20
+ category: 'Content Text',
21
+ defaultValue: { summary: '""' },
22
+ type: { summary: 'string' },
23
+ },
24
+ },
25
+ buttonLabel: {
26
+ description: 'Meta button label',
27
+ table: {
28
+ category: 'Meta Action',
29
+ defaultValue: { summary: '""' },
30
+ type: { summary: 'string' },
31
+ },
32
+ },
33
+ buttonVariant: {
34
+ options: ['', 'primary', 'secondary'],
35
+ description: 'button variant options',
36
+ control: {
37
+ type: 'select',
38
+ labels: {
39
+ '': 'default',
40
+ },
41
+ },
42
+ defaultValue: 'primary',
43
+ table: {
44
+ category: 'Meta Action',
45
+ defaultValue: { summary: 'primary' },
46
+ type: { summary: 'string' },
47
+ },
48
+ },
49
+ inverted: {
50
+ description: 'inverted button option',
51
+ table: {
52
+ category: 'Meta Action',
53
+ defaultValue: { summary: '' },
54
+ type: { summary: 'boolean' },
55
+ },
56
+ },
57
+ },
58
+ };
59
+
60
+ const Metadata = (args) => (
61
+ <Button
62
+ className={args.buttonVariant}
63
+ inverted={args.inverted}
64
+ as="a"
65
+ href="/#"
66
+ target="_blank"
67
+ >
68
+ {args.buttonLabel}
69
+ </Button>
70
+ );
71
+
72
+ const Template = (args) => (
73
+ <Hero {...args} image_url={args.image ? imgUrl : null}>
74
+ <Hero.Text {...args}>{args.text}</Hero.Text>
75
+ <Hero.Meta {...args}>
76
+ <Metadata {...args} />
77
+ </Hero.Meta>
78
+ </Hero>
79
+ );
80
+ export const Default = Template.bind({});
81
+ Default.args = {
82
+ fullWidth: true,
83
+ fullHeight: true,
84
+ image: true,
85
+ quoted: true,
86
+ text:
87
+ 'Forests are a key part of the solution to combat climate change and biodiversity loss.',
88
+ textVariant: 'tertiary',
89
+ textAlign: 'left',
90
+ metaAlign: 'left',
91
+ buttonLabel: 'Button label',
92
+ buttonVariant: 'primary',
93
+ inverted: true,
94
+ alignContent: 'center',
95
+ backgroundVariant: 'grey',
96
+ };
97
+ Default.parameters = {
98
+ controls: {
99
+ exclude: [
100
+ 'fullWidth',
101
+ 'fullHeight',
102
+ 'quoted',
103
+ 'textVariant',
104
+ 'textAlign',
105
+ 'metaAlign',
106
+ 'alignContent',
107
+ 'backgroundVariant',
108
+ ],
109
+ },
110
+ };
111
+
112
+ export const Playground = Template.bind({});
113
+ Playground.args = {
114
+ fullWidth: true,
115
+ fullHeight: true,
116
+ image: true,
117
+ quoted: false,
118
+ text:
119
+ 'Forests are a key part of the solution to combat climate change and biodiversity loss.',
120
+ textVariant: 'tertiary',
121
+ textAlign: 'left',
122
+ metaAlign: 'left',
123
+ buttonLabel: 'Button label',
124
+ buttonVariant: 'primary',
125
+ inverted: true,
126
+ alignContent: 'center',
127
+ backgroundVariant: 'tertiary',
128
+ };
129
+ Playground.argTypes = {
130
+ fullWidth: {
131
+ description: 'Hero full width',
132
+ table: {
133
+ defaultValue: { summary: '"true"' },
134
+ type: { summary: 'boolean' },
135
+ },
136
+ },
137
+ fullHeight: {
138
+ description: 'Hero full height',
139
+ table: {
140
+ defaultValue: { summary: '"true"' },
141
+ type: { summary: 'boolean' },
142
+ },
143
+ },
144
+ quoted: {
145
+ description: 'Add quotes to hero text',
146
+ table: {
147
+ category: 'Content Text',
148
+ defaultValue: { summary: '"true"' },
149
+ type: { summary: 'boolean' },
150
+ },
151
+ },
152
+ textVariant: {
153
+ options: ['primary', 'secondary', 'tertiary', 'white'],
154
+ description: 'Updates the text color',
155
+ control: { type: 'select' },
156
+ defaultValue: 'tertiary',
157
+ table: {
158
+ category: 'Content Text',
159
+ defaultValue: { summary: 'tertiary' },
160
+ type: { summary: 'string' },
161
+ },
162
+ },
163
+ textAlign: {
164
+ options: ['left', 'center', 'right'],
165
+ description: 'Align content text',
166
+ control: { type: 'select' },
167
+ defaultValue: 'left',
168
+ table: {
169
+ category: 'Content Text',
170
+ defaultValue: { summary: 'left' },
171
+ type: { summary: 'string' },
172
+ },
173
+ },
174
+ metaAlign: {
175
+ options: ['left', 'center', 'right'],
176
+ description: 'Align content text',
177
+ control: { type: 'select' },
178
+ defaultValue: 'left',
179
+ table: {
180
+ category: 'Meta Action',
181
+ defaultValue: { summary: 'left' },
182
+ type: { summary: 'string' },
183
+ },
184
+ },
185
+ alignContent: {
186
+ options: ['start', 'center', 'end'],
187
+ description: 'Align content',
188
+ control: { type: 'select' },
189
+ defaultValue: 'center',
190
+ table: {
191
+ defaultValue: { summary: 'center' },
192
+ type: { summary: 'string' },
193
+ },
194
+ },
195
+ backgroundVariant: {
196
+ options: ['primary', 'secondary', 'tertiary', 'grey'],
197
+ description: 'Updates the background color',
198
+ control: { type: 'select' },
199
+ defaultValue: 'tertiary',
200
+ table: {
201
+ defaultValue: { summary: 'tertiary' },
202
+ type: { summary: 'string' },
203
+ },
204
+ },
205
+ };
@@ -13,14 +13,13 @@ import { Image } from 'semantic-ui-react';
13
13
  * @param {Object} intl Intl object
14
14
  * @returns {string} Markup of the component.
15
15
  */
16
- const Logo = ({ src, id, url, alt, title }) => {
16
+ const Logo = ({ src, invertedSrc, id, url, alt, title, inverted }) => {
17
17
  return (
18
18
  <Link to={url} title={title}>
19
19
  <Image
20
- src={src}
20
+ src={inverted ? invertedSrc : src}
21
21
  alt={alt}
22
22
  title={title}
23
- //height={64}
24
23
  className="eea-logo"
25
24
  id={id}
26
25
  />
package/src/ui/index.js CHANGED
@@ -35,3 +35,5 @@ export LabeledIconGroup from './LabeledIconGroup/LabeledIconGroup';
35
35
  export LanguageLabeledIcon from './LanguageLabeledIcon/LanguageLabeledIcon';
36
36
 
37
37
  export RelatedContent from './Card/RelatedContent/RelatedContent';
38
+
39
+ export Hero from './Hero/Hero';
@@ -106,6 +106,7 @@
106
106
  }
107
107
 
108
108
 
109
+
109
110
  /*--------------
110
111
  Content
111
112
  ---------------*/
@@ -130,7 +131,8 @@
130
131
  visibility: hidden;
131
132
  }
132
133
 
133
- .ui.items > .item > .image + .content {
134
+ .ui.items > .item > .image + .content,
135
+ .ui.items > .item > .icon + .content {
134
136
  min-width: 0;
135
137
  width: @contentWidth;
136
138
  display: @contentDisplay;
@@ -344,7 +346,8 @@
344
346
  .ui.items > .item > .image:not(.ui) {
345
347
  width: @tabletImageWidth;
346
348
  }
347
- .ui.items > .item > .image + .content {
349
+ .ui.items > .item > .image + .content,
350
+ .ui.items > .item > .icon + .content {
348
351
  display: block;
349
352
  padding: 0em 0em 0em @tabletContentImageDistance;
350
353
  }
@@ -368,7 +371,8 @@
368
371
  width: @mobileImageWidth !important;
369
372
  max-height: @mobileImageMaxHeight !important;
370
373
  }
371
- .ui.items:not(.unstackable) > .item > .image + .content {
374
+ .ui.items:not(.unstackable) > .item > .image + .content,
375
+ .ui.items:not(.unstackable) > .item > .icon + .content {
372
376
  display: block;
373
377
  padding: @mobileContentImageDistance 0em 0em;
374
378
  }
@@ -384,13 +388,16 @@
384
388
  Aligned
385
389
  --------------------*/
386
390
 
387
- .ui.items > .item > .image + [class*="top aligned"].content {
391
+ .ui.items > .item > .image + [class*="top aligned"].content,
392
+ .ui.items > .item > .icon + [class*="top aligned"].content {
388
393
  align-self: flex-start;
389
394
  }
390
- .ui.items > .item > .image + [class*="middle aligned"].content {
395
+ .ui.items > .item > .image + [class*="middle aligned"].content,
396
+ .ui.items > .item > .icon + [class*="middle aligned"].content {
391
397
  align-self: center;
392
398
  }
393
- .ui.items > .item > .image + [class*="bottom aligned"].content {
399
+ .ui.items > .item > .image + [class*="bottom aligned"].content,
400
+ .ui.items > .item > .icon + [class*="bottom aligned"].content {
394
401
  align-self: flex-end;
395
402
  }
396
403
 
@@ -9,11 +9,12 @@
9
9
  margin-right 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
10
10
  }
11
11
 
12
-
13
12
  // add padding to containers on edit section so that we display add and delete buttons
14
- .section-edit .container {
15
- padding: 0 3rem;
16
- width: auto !important;
13
+ .section-edit {
14
+ .container:not(.content-box-inner) {
15
+ width: auto !important;
16
+ padding: 0 3rem;
17
+ }
17
18
  }
18
19
 
19
20
  .contentWidth(@offset) {
@@ -1,3 +1,42 @@
1
1
  /*******************************
2
2
  Theme Overrides
3
3
  *******************************/
4
+
5
+ /*--------------
6
+ Sizes
7
+ ---------------*/
8
+
9
+ // This override on .block .ui.image is needed as it
10
+ // sets width: 100% by default
11
+
12
+ .block .ui.mini.image {
13
+ width: @miniWidth;
14
+ }
15
+
16
+ .block .ui.tiny.image {
17
+ width: @tinyWidth;
18
+ }
19
+
20
+ .block .ui.small.image {
21
+ width: @smallWidth;
22
+ }
23
+
24
+ .block .ui.medium.image {
25
+ width: @mediumWidth;
26
+ }
27
+
28
+ .block .ui.large.image {
29
+ width: @largeWidth;
30
+ }
31
+
32
+ .block .ui.big.image {
33
+ width: @bigWidth;
34
+ }
35
+
36
+ .block .ui.huge.image {
37
+ width: @hugeWidth;
38
+ }
39
+
40
+ .block .ui.massive.image {
41
+ width: @massiveWidth;
42
+ }
@@ -109,18 +109,17 @@ textarea.fluid {
109
109
  /* Search Input - to be updated */
110
110
  .ui.fluid.icon.input.search {
111
111
  input {
112
- height: 70px !important;
113
- padding: 18.5px;
114
- border: none !important;
115
- border-bottom: 2px solid !important;
112
+ padding: @rectangleMini;
113
+ border: none;
114
+ border-bottom: @2px solid;
116
115
  background: transparent;
117
- color: @white !important;
118
- font-size: 18px;
116
+ color: @white;
117
+ font-size: 16px;
119
118
  }
120
119
 
121
120
  i.icon {
122
121
  color: @white;
123
- font-size: 18px;
122
+ font-size: 16px;
124
123
  opacity: 1;
125
124
  }
126
125
  }
@@ -137,10 +136,24 @@ textarea.fluid {
137
136
  color: rgba(255, 255, 255, 0.25);
138
137
  }
139
138
 
139
+ @media only screen and (min-width: @tabletBreakpoint) {
140
+ .ui.fluid.icon.input.search {
141
+ input {
142
+ padding: @rectangleTiny;
143
+ font-size: 18px;
144
+ }
145
+
146
+ i.icon {
147
+ font-size: 18px;
148
+ }
149
+ }
150
+ }
151
+
140
152
  @media only screen and (min-width: @computerBreakpoint) {
141
153
  .ui.fluid.icon.input.search {
142
154
  input {
143
- border-bottom: 3px solid !important;
155
+ padding: @rectangleMedium;
156
+ border-bottom: 3px solid;
144
157
  font-size: 40px;
145
158
  }
146
159
 
@@ -0,0 +1,41 @@
1
+ @type: 'extra';
2
+ @element: 'contentBox';
3
+
4
+ @import (multiple) '../../theme.config';
5
+
6
+ /*-------------------
7
+ CONTENT BOX
8
+ --------------------*/
9
+
10
+ .content-box {
11
+ width: @contentBoxWidth;
12
+ background-color: @contentBoxBackgroundColor;
13
+ color: @contentBoxColorInverted;
14
+ margin-bottom: @mediumGap;
15
+
16
+ position: relative;
17
+ margin-right: -50vw;
18
+ margin-left: -50vw;
19
+ right: 50%;
20
+ left: 50%;
21
+
22
+ .ui.container {
23
+ padding-top: @contentBoxContainerMarginTop;
24
+ padding-bottom: @contentBoxContainerMarginBottom;
25
+ }
26
+
27
+ &.primary {
28
+ background-color: @contentBoxBackgroundColorPrimary;
29
+ color: @contentBoxColor;
30
+ }
31
+
32
+ &.secondary {
33
+ background-color: @contentBoxBackgroundColorSecondary;
34
+ color: @contentBoxColor;
35
+ }
36
+
37
+ &.tertiary {
38
+ background-color: @contentBoxBackgroundColorTertiary;
39
+ color: @contentBoxColor;
40
+ }
41
+ }
@@ -0,0 +1,19 @@
1
+ /*******************************
2
+ Content Box
3
+ *******************************/
4
+
5
+ /* Content Box */
6
+ @contentBoxWidth : 100vw;
7
+ @contentBoxColor : @white;
8
+ @contentBoxBackgroundColor: @grey-1;
9
+ @contentBoxColorInverted : @black;
10
+
11
+ /* Themes */
12
+ @contentBoxBackgroundColorPrimary: @primaryColor;
13
+ @contentBoxBackgroundColorSecondary: @secondaryColor;
14
+ @contentBoxBackgroundColorTertiary: @tertiaryColor;
15
+
16
+
17
+ /* Container */
18
+ @contentBoxContainerMarginTop : @bigGap;
19
+ @contentBoxContainerMarginBottom : @bigGap;
@@ -0,0 +1,4 @@
1
+ // hide stagingBanner on homepage
2
+ .homepage .stagingBanner {
3
+ display: none !important;
4
+ }