@eeacms/volto-eea-design-system 0.2.2 → 0.2.3

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/CHANGELOG.md CHANGED
@@ -4,8 +4,28 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [0.2.3](https://github.com/eea/volto-eea-design-system/compare/0.2.2...0.2.3)
8
+
9
+ - [R2] Button [`#154`](https://github.com/eea/volto-eea-design-system/pull/154)
10
+ - [R2] Tab [`#155`](https://github.com/eea/volto-eea-design-system/pull/155)
11
+ - Autobuild of docusaurus docs [`4418144`](https://github.com/eea/volto-eea-design-system/commit/4418144c194c49cdeaf6928eabd781e01d0a391e)
12
+ - change(banner): added icon class to share icons [`48e866e`](https://github.com/eea/volto-eea-design-system/commit/48e866e4251dd517c0477cd5a42cec1a98e2f16d)
13
+ - Autobuild of docusaurus docs [`a51745e`](https://github.com/eea/volto-eea-design-system/commit/a51745e8ec045c583f9b0bfdb93b3a0eaec67110)
14
+ - refactor(tab): update vertical tab columns and content [`b473fab`](https://github.com/eea/volto-eea-design-system/commit/b473fabee196a3ec420e29160448d2be3d1685cc)
15
+ - docs(button): import call to action stories [`e4eed44`](https://github.com/eea/volto-eea-design-system/commit/e4eed44e3519ae3dba7d16e252271a964fcb7a4b)
16
+ - refactor(button): update inverted button colors [`c822021`](https://github.com/eea/volto-eea-design-system/commit/c822021ab37939632416ce74c0cc88a64b98a3c1)
17
+ - refactor(button): add container to stories [`6c02c19`](https://github.com/eea/volto-eea-design-system/commit/6c02c1953e102f2d90ab23023d6b4dfc738ced2e)
18
+ - refactor(call to action):render call to action with Button as="a" [`e7dfabf`](https://github.com/eea/volto-eea-design-system/commit/e7dfabfc2f006505b0f1c802dc6fb48611518bcb)
19
+ - feat(CallToAction):add feat call to action [`ab53642`](https://github.com/eea/volto-eea-design-system/commit/ab53642f27c996f929ff871d0794add39bab6c23)
20
+ - refactor(Button): move button to forms folder [`94996fc`](https://github.com/eea/volto-eea-design-system/commit/94996fcdf1ea7e55c63dd44e10edf1b44b9bdef5)
21
+ - refactor(Tab):scrollbar change in mobile & vertical tab fix [`0e34cbf`](https://github.com/eea/volto-eea-design-system/commit/0e34cbf459e67b6910217f30a44a1e81f33df622)
22
+ - refactor(Tab):minor change in secondary pointing menu variables [`280b6c4`](https://github.com/eea/volto-eea-design-system/commit/280b6c41a2107bccb38500f54eb5663ef62c7ae3)
23
+
7
24
  #### [0.2.2](https://github.com/eea/volto-eea-design-system/compare/0.2.1...0.2.2)
8
25
 
26
+ > 22 April 2022
27
+
28
+ - Release [`#153`](https://github.com/eea/volto-eea-design-system/pull/153)
9
29
  - fix(volto): various fixes for issues presented in ticket #147629 [`#150`](https://github.com/eea/volto-eea-design-system/pull/150)
10
30
  - [R2] Card [updated for R3] [`#152`](https://github.com/eea/volto-eea-design-system/pull/152)
11
31
  - [R2] Ordered list [`#144`](https://github.com/eea/volto-eea-design-system/pull/144)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-design-system",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "@eeacms/volto-eea-design-system: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -25,7 +25,7 @@ function Banner({ image_url, image, children }) {
25
25
  Banner.Action = function ({ id, title, icon, onClick, className, color }) {
26
26
  return (
27
27
  <div className="action">
28
- <Button className={className} basic inverted onClick={onClick}>
28
+ <Button className={className} basic icon inverted onClick={onClick}>
29
29
  <Icon className={icon} color={color}></Icon>
30
30
  <span className="mobile hidden">{title}</span>
31
31
  </Button>
@@ -0,0 +1,239 @@
1
+ import React from 'react';
2
+ import { Button, Icon, Container, Segment } from 'semantic-ui-react';
3
+
4
+ export default {
5
+ title: 'Components/Call To Action',
6
+ component: Button,
7
+ argTypes: {
8
+ label: {
9
+ description: 'link label',
10
+ table: {
11
+ defaultValue: {
12
+ summary: '',
13
+ },
14
+ type: {
15
+ summary: 'string',
16
+ },
17
+ },
18
+ },
19
+ href: {
20
+ description: "link's destination url",
21
+ table: {
22
+ defaultValue: {
23
+ summary: '',
24
+ },
25
+ type: { summary: 'string' },
26
+ },
27
+ },
28
+ disabled: {
29
+ description: 'link disabled',
30
+ table: {
31
+ defaultValue: { summary: 'false' },
32
+ type: { summary: 'boolean' },
33
+ },
34
+ },
35
+ },
36
+ };
37
+
38
+ //Default Call To Action
39
+ export const Default = (args) => {
40
+ return (
41
+ <Container>
42
+ <Button as="a" disabled={args.disabled} href={args.href} target="_blank">
43
+ {args.label}
44
+ </Button>
45
+ </Container>
46
+ );
47
+ };
48
+ Default.args = {
49
+ label: 'Default Call To Action',
50
+ href: '/#',
51
+ disabled: false,
52
+ };
53
+
54
+ //Primary Call To Action
55
+ export const Primary = (args) => {
56
+ return (
57
+ <Container>
58
+ <Button
59
+ primary
60
+ as="a"
61
+ disabled={args.disabled}
62
+ href={args.href}
63
+ target="_blank"
64
+ >
65
+ {args.label}
66
+ </Button>
67
+ </Container>
68
+ );
69
+ };
70
+ Primary.args = {
71
+ label: 'Primary Call To Action',
72
+ href: '/#',
73
+ disabled: false,
74
+ };
75
+
76
+ //Secondary Call To Action
77
+ export const Secondary = (args) => {
78
+ return (
79
+ <Container>
80
+ <Button
81
+ secondary
82
+ as="a"
83
+ disabled={args.disabled}
84
+ href={args.href}
85
+ target="_blank"
86
+ >
87
+ {args.label}
88
+ </Button>
89
+ </Container>
90
+ );
91
+ };
92
+ Secondary.args = {
93
+ label: 'Secondary Call To Action',
94
+ href: '/#',
95
+ disabled: false,
96
+ };
97
+
98
+ //Inverted Call To Action
99
+ export const Inverted = (args) => {
100
+ return (
101
+ <Container>
102
+ <Segment compact>
103
+ <Button
104
+ primary
105
+ inverted
106
+ as="a"
107
+ disabled={args.disabled}
108
+ href={args.href1}
109
+ target="_blank"
110
+ >
111
+ {args.button1}
112
+ </Button>
113
+ </Segment>
114
+ <Segment compact>
115
+ <Button
116
+ secondary
117
+ inverted
118
+ as="a"
119
+ disabled={args.disabled}
120
+ href={args.href2}
121
+ target="_blank"
122
+ >
123
+ {args.button2}
124
+ </Button>
125
+ </Segment>
126
+ <Segment inverted compact>
127
+ <Button
128
+ inverted
129
+ as="a"
130
+ disabled={args.disabled}
131
+ href={args.href3}
132
+ target="_blank"
133
+ >
134
+ {args.button3}
135
+ </Button>
136
+ </Segment>
137
+ </Container>
138
+ );
139
+ };
140
+ Inverted.args = {
141
+ button1: 'Primary Call To Action',
142
+ button2: 'Secondary Call To Action',
143
+ button3: 'Default Call To Action',
144
+ href1: '/#',
145
+ href2: '/#',
146
+ href3: '/#',
147
+ disabled: false,
148
+ };
149
+ Inverted.parameters = {
150
+ controls: { exclude: ['label', 'href'] },
151
+ hideNoControlsWarning: true,
152
+ };
153
+
154
+ //Labeled Call To Action
155
+ export const Labeled = (args) => {
156
+ return (
157
+ <Container>
158
+ <Button
159
+ className={args.variant + ' icon ' + args.icon_position + ' labeled'}
160
+ as="a"
161
+ disabled={args.disabled}
162
+ href={args.href}
163
+ target="_blank"
164
+ >
165
+ {args.label}
166
+ <Icon name={args.icon} />
167
+ </Button>
168
+ </Container>
169
+ );
170
+ };
171
+ Labeled.args = {
172
+ label: 'Labeled Call To Action',
173
+ icon: 'chevron right',
174
+ href: '/#',
175
+ disabled: false,
176
+ };
177
+ Labeled.argTypes = {
178
+ variant: {
179
+ options: ['primary', 'secondary', 'default'],
180
+ description: 'call to action class',
181
+ control: { type: 'radio' },
182
+ defaultValue: 'secondary',
183
+ table: {
184
+ defaultValue: { summary: 'secondary' },
185
+ type: { summary: 'string' },
186
+ },
187
+ },
188
+ icon: {
189
+ name: 'icon',
190
+ defaultValue: 'chevron right',
191
+ options: [
192
+ 'chevron right',
193
+ 'arrow right',
194
+ 'sign-in',
195
+ 'sign-out',
196
+ 'play',
197
+ 'stop',
198
+ 'pause',
199
+ 'download',
200
+ 'upload',
201
+ 'print',
202
+ 'copy',
203
+ 'edit',
204
+ 'ellipsis',
205
+ ],
206
+ control: { type: 'select' },
207
+ description: 'call to action icon',
208
+ table: {
209
+ defaultValue: { summary: 'chevron right' },
210
+ type: { summary: 'string' },
211
+ },
212
+ },
213
+ icon_position: {
214
+ options: ['left', 'right'],
215
+ control: { type: 'radio' },
216
+ defaultValue: 'left',
217
+ description: 'icon left or right position',
218
+ table: {
219
+ defaultValue: { summary: 'left' },
220
+ type: { summary: 'string' },
221
+ },
222
+ },
223
+ };
224
+
225
+ //Text Button - can also play with text class
226
+ export const Link = (args) => {
227
+ return (
228
+ <Container>
229
+ <a href={args.href}>{args.label}</a>
230
+ </Container>
231
+ );
232
+ };
233
+ Link.args = {
234
+ label: 'Link label',
235
+ href: '/#',
236
+ };
237
+ Link.parameters = {
238
+ hideNoControlsWarning: true,
239
+ };
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { Button, Icon, Segment } from 'semantic-ui-react';
2
+ import { Button, Icon, Container, Segment } from 'semantic-ui-react';
3
3
 
4
4
  export default {
5
- title: 'Components/Button',
5
+ title: 'Components/Forms/Button',
6
6
  component: Button,
7
7
  parameters: {
8
8
  actions: {
@@ -32,7 +32,11 @@ export default {
32
32
 
33
33
  //Default Button
34
34
  export const Default = (args) => {
35
- return <Button disabled={args.disabled}>{args.label}</Button>;
35
+ return (
36
+ <Container>
37
+ <Button disabled={args.disabled}>{args.label}</Button>
38
+ </Container>
39
+ );
36
40
  };
37
41
  Default.args = {
38
42
  label: 'Default Button',
@@ -46,9 +50,11 @@ Default.parameters = {
46
50
  //Primary button
47
51
  export const Primary = (args) => {
48
52
  return (
49
- <Button primary disabled={args.disabled}>
50
- {args.label}
51
- </Button>
53
+ <Container>
54
+ <Button primary disabled={args.disabled}>
55
+ {args.label}
56
+ </Button>
57
+ </Container>
52
58
  );
53
59
  };
54
60
  Primary.args = {
@@ -63,9 +69,11 @@ Primary.parameters = {
63
69
  //secondary Button
64
70
  export const Secondary = (args) => {
65
71
  return (
66
- <Button secondary disabled={args.disabled}>
67
- {args.label}
68
- </Button>
72
+ <Container>
73
+ <Button secondary disabled={args.disabled}>
74
+ {args.label}
75
+ </Button>
76
+ </Container>
69
77
  );
70
78
  };
71
79
  Secondary.args = {
@@ -80,17 +88,23 @@ Secondary.parameters = {
80
88
  //secondary Button Inverted
81
89
  export const Inverted = (args) => {
82
90
  return (
83
- <Segment inverted compact>
84
- <Button primary inverted disabled={args.disabled}>
85
- {args.button1}
86
- </Button>
87
- <Button secondary inverted disabled={args.disabled}>
88
- {args.button2}
89
- </Button>
90
- <Button inverted disabled={args.disabled}>
91
- {args.button3}
92
- </Button>
93
- </Segment>
91
+ <Container>
92
+ <Segment compact>
93
+ <Button primary inverted disabled={args.disabled}>
94
+ {args.button1}
95
+ </Button>
96
+ </Segment>
97
+ <Segment compact>
98
+ <Button secondary inverted disabled={args.disabled}>
99
+ {args.button2}
100
+ </Button>
101
+ </Segment>
102
+ <Segment inverted compact>
103
+ <Button inverted disabled={args.disabled}>
104
+ {args.button3}
105
+ </Button>
106
+ </Segment>
107
+ </Container>
94
108
  );
95
109
  };
96
110
  Inverted.args = {
@@ -107,15 +121,15 @@ Inverted.parameters = {
107
121
  //Call to action button
108
122
  export const Labeled = (args) => {
109
123
  return (
110
- <div className="eea">
124
+ <Container>
111
125
  <Button
112
126
  className={args.variant + ' icon ' + args.icon_position + ' labeled'}
113
127
  disabled={args.disabled}
114
128
  >
115
129
  {args.label}
116
- <Icon name={args.icon + args.icon_position} />
130
+ <Icon name={args.icon} />
117
131
  </Button>
118
- </div>
132
+ </Container>
119
133
  );
120
134
  };
121
135
  Labeled.args = {
@@ -171,12 +185,14 @@ Labeled.argTypes = {
171
185
  },
172
186
  };
173
187
 
174
- //Text Button - can also play with text class
188
+ //Text Button
175
189
  export const Text = (args) => {
176
190
  return (
177
- <Button as="p" disabled={args.disabled}>
178
- {args.label}
179
- </Button>
191
+ <Container>
192
+ <Button as="p" disabled={args.disabled}>
193
+ {args.label}
194
+ </Button>
195
+ </Container>
180
196
  );
181
197
  };
182
198
  Text.args = {
@@ -177,3 +177,73 @@ p.ui.button {
177
177
  font-size: @searchButtonFontSize;
178
178
  opacity: @searchButtonIconOpacity;
179
179
  }
180
+
181
+
182
+ /************* Inverted Buttons *************/
183
+ // Override the light colors with the defaults
184
+
185
+ /* Primary - button.less - L:3128 */
186
+ .ui.inverted.primary.buttons .button,
187
+ .ui.inverted.primary.button {
188
+ box-shadow: 0px 0px 0px @invertedBorderSize @primaryColor inset !important;
189
+ color: @primaryColor;
190
+ }
191
+ .ui.inverted.primary.buttons .button:hover,
192
+ .ui.inverted.primary.button:hover,
193
+ .ui.inverted.primary.buttons .button:focus,
194
+ .ui.inverted.primary.button:focus,
195
+ .ui.inverted.primary.buttons .button.active,
196
+ .ui.inverted.primary.button.active,
197
+ .ui.inverted.primary.buttons .button:active,
198
+ .ui.inverted.primary.button:active {
199
+ color: @invertedHoveredTextColor;
200
+ }
201
+ .ui.inverted.primary.buttons .button:hover,
202
+ .ui.inverted.primary.button:hover {
203
+ background-color: @primaryColorHover;
204
+ }
205
+ .ui.inverted.primary.buttons .button:focus,
206
+ .ui.inverted.primary.button:focus {
207
+ background-color: @primaryColorFocus;
208
+ }
209
+ .ui.inverted.primary.buttons .active.button,
210
+ .ui.inverted.primary.active.button {
211
+ background-color: @primaryColorActive;
212
+ }
213
+ .ui.inverted.primary.buttons .button:active,
214
+ .ui.inverted.primary.button:active {
215
+ background-color: @primaryColorDown;
216
+ }
217
+
218
+ /* Secondary - button.less - L:3128 */
219
+ .ui.inverted.secondary.buttons .button,
220
+ .ui.inverted.secondary.button {
221
+ box-shadow: 0px 0px 0px @invertedBorderSize @secondaryColor inset !important;
222
+ color: @secondaryColor;
223
+ }
224
+ .ui.inverted.secondary.buttons .button:hover,
225
+ .ui.inverted.secondary.button:hover,
226
+ .ui.inverted.secondary.buttons .button:focus,
227
+ .ui.inverted.secondary.button:focus,
228
+ .ui.inverted.secondary.buttons .button.active,
229
+ .ui.inverted.secondary.button.active,
230
+ .ui.inverted.secondary.buttons .button:active,
231
+ .ui.inverted.secondary.button:active {
232
+ color: @invertedHoveredTextColor;
233
+ }
234
+ .ui.inverted.secondary.buttons .button:hover,
235
+ .ui.inverted.secondary.button:hover {
236
+ background-color: @secondaryColorHover;
237
+ }
238
+ .ui.inverted.secondary.buttons .button:focus,
239
+ .ui.inverted.secondary.button:focus {
240
+ background-color: @secondaryColorFocus;
241
+ }
242
+ .ui.inverted.secondary.buttons .active.button,
243
+ .ui.inverted.secondary.active.button {
244
+ background-color: @secondaryColorActive;
245
+ }
246
+ .ui.inverted.secondary.buttons .button:active,
247
+ .ui.inverted.secondary.button:active {
248
+ background-color: @secondaryColorDown;
249
+ }
@@ -4,7 +4,7 @@
4
4
 
5
5
  .ui.pointing.secondary.menu {
6
6
  a.item {
7
- font-size: @mobileHeaderSize;
7
+ font-size: @headerSize;
8
8
  }
9
9
 
10
10
  a.item:hover {
@@ -12,10 +12,26 @@
12
12
  }
13
13
  }
14
14
 
15
+ // Contain images inside vertical tab content
16
+ .stretched.wide.column > .tab img {
17
+ max-width: @verticalTabPaneImageMaxWidth;
18
+ }
19
+
20
+ .ui.pointing.secondary.menu::-webkit-scrollbar {
21
+ height: @mobileTabScrollbarHeight;
22
+ }
23
+
15
24
  @media only screen and (min-width: @tabletBreakpoint) {
16
- .ui.pointing.secondary.menu {
17
- a.item {
18
- font-size: @tabletHeaderSize;
25
+ .ui.pointing.secondary.menu::-webkit-scrollbar {
26
+ height: @tabletTabScrollbarHeight;
27
+ }
28
+ }
29
+
30
+ @media only screen and (max-width: @largestMobileScreen) {
31
+ .ui.pointing.secondary.vertical.menu {
32
+ .item {
33
+ padding: @mobileItemPadding;
34
+ font-size: @mobileItemFontSize;
19
35
  }
20
36
  }
21
37
  }
@@ -4,8 +4,10 @@
4
4
 
5
5
  @tabActiveItemHoverColor: @secondaryColor;
6
6
 
7
- @mobileHeaderSize: 1.125rem;
8
- @tabletHeaderSize: @h4;
7
+ @mobileItemFontSize: 1rem;
8
+ @mobileItemPadding: 1rem 0.25rem;
9
+
10
+ @headerSize: @h4;
9
11
  @headerSizeResponsive: @fontSize;
10
12
  @contentSize: @fontSize;
11
13
 
@@ -15,4 +17,11 @@
15
17
  @loadingContentOffset: -10000px;
16
18
 
17
19
  @loaderDistanceFromTop: 100px;
18
- @loaderSize: 2.5em;
20
+ @loaderSize: 2.5em;
21
+
22
+ /* Scrollbar */
23
+ @mobileTabScrollbarHeight: 0;
24
+ @tabletTabScrollbarHeight: 0.3rem;
25
+
26
+ /* Images */
27
+ @verticalTabPaneImageMaxWidth: 100%;