@eeacms/volto-eea-design-system 1.13.2 → 1.14.0

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.
@@ -21,6 +21,15 @@ export default {
21
21
  defaultValue: { summary: 'null' },
22
22
  },
23
23
  },
24
+ titleMaxLines: {
25
+ name: 'Title max lines',
26
+ options: ['none', '1', '2', '3', '4', '5'],
27
+ control: { type: 'select' },
28
+ table: {
29
+ category: 'Content',
30
+ defaultValue: { summary: '2' },
31
+ },
32
+ },
24
33
  inverted: {
25
34
  description: 'Inverted card',
26
35
  table: {
@@ -43,7 +52,11 @@ const Template = (args) => (
43
52
  <Card
44
53
  className={`icon text-center ${
45
54
  args.variant === 'default' ? '' : args.variant
46
- } ${args.inverted ? 'inverted' : ''}`}
55
+ } ${args.inverted ? 'inverted' : ''} ${
56
+ args.titleMaxLines === 'none'
57
+ ? 'title-max-0-lines'
58
+ : 'title-max-' + args.titleMaxLines + '-lines'
59
+ }`}
47
60
  >
48
61
  {args.hasLink ? (
49
62
  <a href={args.href} aria-label={args.title}>
@@ -70,6 +83,7 @@ const Template = (args) => (
70
83
  export const Default = Template.bind({});
71
84
  Default.args = {
72
85
  variant: 'default',
86
+ titleMaxLines: '2',
73
87
  inverted: false,
74
88
  title: 'Lorem Ipsum',
75
89
  icon: 'ri-leaf-line',
@@ -116,7 +130,11 @@ const GridTemplate = (args) => (
116
130
  <Card
117
131
  className={`icon text-center ${
118
132
  args.variant === 'default' ? '' : args.variant
119
- } ${args.inverted ? 'inverted' : ''}`}
133
+ } ${args.inverted ? 'inverted' : ''} ${
134
+ args.titleMaxLines === 'none'
135
+ ? 'title-max-0-lines'
136
+ : 'title-max-' + args.titleMaxLines + '-lines'
137
+ }`}
120
138
  >
121
139
  {args.hasLink ? (
122
140
  <a href={args.href} aria-label={card.title}>
@@ -146,6 +164,7 @@ const GridTemplate = (args) => (
146
164
  export const GridIconCard = GridTemplate.bind({});
147
165
  GridIconCard.args = {
148
166
  variant: 'default',
167
+ titleMaxLines: '2',
149
168
  inverted: false,
150
169
  hasLink: true,
151
170
  href: '/#',
@@ -186,6 +205,7 @@ GridIconCard.argTypes = {
186
205
  cards: {
187
206
  description: 'array with cards data',
188
207
  table: {
208
+ category: 'Content',
189
209
  type: {
190
210
  summary: 'Object',
191
211
  },
@@ -39,6 +39,14 @@ const TopItem = ({ children, className, id }) => (
39
39
  </div>
40
40
  );
41
41
 
42
+ const onKeyDownHandler = (event) => {
43
+ if (event.key === 'Enter') {
44
+ event.preventDefault();
45
+ event.target.click();
46
+ //event.target.focus();
47
+ }
48
+ };
49
+
42
50
  const TopDropdownMenu = ({
43
51
  children,
44
52
  className,
@@ -69,6 +77,8 @@ const TopDropdownMenu = ({
69
77
  closeOnChange={true}
70
78
  closeOnBlur={false}
71
79
  closeOnEscape={true}
80
+ openOnFocus={false}
81
+ onKeyDown={onKeyDownHandler}
72
82
  >
73
83
  <Dropdown.Menu role="option">{children}</Dropdown.Menu>
74
84
  </Dropdown>
@@ -85,6 +95,8 @@ const TopDropdownMenu = ({
85
95
  closeOnChange={true}
86
96
  closeOnBlur={false}
87
97
  closeOnEscape={true}
98
+ openOnFocus={false}
99
+ onKeyDown={onKeyDownHandler}
88
100
  >
89
101
  <Dropdown.Menu role="option">{children}</Dropdown.Menu>
90
102
  </Dropdown>
@@ -33,30 +33,34 @@
33
33
 
34
34
  /* Link */
35
35
  .ui.low.labels .label:hover,
36
- .ui.low.label:hover{
36
+ .ui.low.label:hover {
37
37
  background-color: @lowImportanceHoverBackground;
38
38
  border-color: @lowImportanceHoverBackground;
39
39
  }
40
40
 
41
41
  .ui.medium.labels .label:hover,
42
- .ui.medium.label:hover{
42
+ .ui.medium.label:hover {
43
43
  background-color: @mediumImportanceHoverBackground;
44
44
  border-color: @mediumImportanceHoverBackground;
45
45
  }
46
46
 
47
47
  .ui.high.labels .label:hover,
48
- .ui.high.label:hover{
48
+ .ui.high.label:hover {
49
49
  background-color: @highImportanceHoverBackground;
50
50
  border-color: @highImportanceHoverBackground;
51
51
  }
52
52
 
53
53
  .ui.highlight.labels .label:hover,
54
- .ui.highlight.label:hover{
54
+ .ui.highlight.label:hover {
55
55
  background-color: @highlightImportanceHoverBackground;
56
56
  border-color: @highlightImportanceHoverBackground;
57
57
  }
58
58
 
59
59
  /* Ribbon */
60
+ .ui.ribbon.label {
61
+ z-index: @ribbonLabelZindex;
62
+ }
63
+
60
64
  .ui.low.ribbon.label {
61
65
  border-color: @lowImportanceBackground;
62
66
  }
@@ -79,6 +83,7 @@
79
83
  color: @lowImportanceBasicTextColor;
80
84
  border-color: @lowImportanceBackground;
81
85
  }
86
+
82
87
  .ui.basic.low.labels a.label:hover,
83
88
  .ui.basic.low.label:hover {
84
89
  background-color: @white;
@@ -91,6 +96,7 @@
91
96
  color: @mediumImportanceBasicTextColor;
92
97
  border-color: @mediumImportanceBackground;
93
98
  }
99
+
94
100
  .ui.basic.medium.labels a.label:hover,
95
101
  .ui.basic.medium.label:hover {
96
102
  background-color: @white;
@@ -103,6 +109,7 @@
103
109
  color: @highImportanceBasicTextColor;
104
110
  border-color: @highImportanceBackground;
105
111
  }
112
+
106
113
  .ui.basic.high.labels a.label:hover,
107
114
  .ui.basic.high.label:hover {
108
115
  background-color: @white;
@@ -115,6 +122,7 @@
115
122
  color: @highlightImportanceBasicTextColor;
116
123
  border-color: @highlightImportanceBackground;
117
124
  }
125
+
118
126
  .ui.basic.highlight.labels a.label:hover,
119
127
  .ui.basic.highlight.label:hover {
120
128
  background-color: @white;
@@ -136,19 +136,21 @@
136
136
  @ribbonTriangleSize: 1.2em;
137
137
  @ribbonShadowColor: rgba(0, 0, 0, 0.15);
138
138
 
139
+ @ribbonLabelZindex: 1;
140
+
139
141
  @ribbonMargin: 1rem;
140
142
  @ribbonOffset: calc(-@ribbonMargin - @ribbonTriangleSize);
141
143
  @ribbonDistance: calc(@ribbonMargin + @ribbonTriangleSize);
142
- @rightRibbonOffset: calc(100% + @ribbonMargin + @ribbonTriangleSize);
144
+ @rightRibbonOffset: calc(100% + @ribbonMargin + @ribbonTriangleSize);
143
145
 
144
146
  @ribbonImageTopDistance: 1rem;
145
147
  @ribbonImageMargin: 0.05rem; /* Rounding Offset on Triangle */
146
148
  @ribbonImageOffset: calc(-@ribbonImageMargin - @ribbonTriangleSize);
147
- @rightRibbonImageOffset: calc(100% + @ribbonImageMargin + @ribbonTriangleSize);
149
+ @rightRibbonImageOffset: calc(100% + @ribbonImageMargin + @ribbonTriangleSize);
148
150
 
149
151
  @ribbonTableMargin: @relativeMini; /* Rounding Offset on Triangle */
150
152
  @ribbonTableOffset: calc(-@ribbonTableMargin - @ribbonTriangleSize);
151
- @rightRibbonTableOffset: calc(100% + @ribbonTableMargin + @ribbonTriangleSize);
153
+ @rightRibbonTableOffset: calc(100% + @ribbonTableMargin + @ribbonTriangleSize);
152
154
 
153
155
 
154
156
  /* Colors */
@@ -159,10 +161,10 @@
159
161
  @highlightImportanceBackground: @secondaryColor;
160
162
 
161
163
  /* Hover Colors */
162
- @lowImportanceHoverBackground: darken(@deepBlue,5);
163
- @mediumImportanceHoverBackground: darken(#346F83,5);
164
- @highImportanceHoverBackground: darken(#005293,5);
165
- @highlightImportanceHoverBackground: darken(@secondaryColor,5);
164
+ @lowImportanceHoverBackground: darken(@deepBlue, 5);
165
+ @mediumImportanceHoverBackground: darken(#346F83, 5);
166
+ @highImportanceHoverBackground: darken(#005293, 5);
167
+ @highlightImportanceHoverBackground: darken(@secondaryColor, 5);
166
168
 
167
169
  @importanceHoverTextColor: @white;
168
170
 
@@ -271,11 +273,11 @@
271
273
  --------------------*/
272
274
 
273
275
  /* Sizing */
274
- @mini : @9px;
275
- @tiny : @10px;
276
- @small : @11px;
277
- @medium : @12px;
278
- @large : @absoluteMedium;
279
- @big : @absoluteBig;
280
- @huge : @absoluteHuge;
281
- @massive : @absoluteMassive;
276
+ @mini: @9px;
277
+ @tiny: @10px;
278
+ @small: @11px;
279
+ @medium: @12px;
280
+ @large: @absoluteMedium;
281
+ @big: @absoluteBig;
282
+ @huge: @absoluteHuge;
283
+ @massive: @absoluteMassive;
@@ -16,6 +16,7 @@
16
16
  margin-right: -50vw;
17
17
  left: 50%;
18
18
  right: 50%;
19
+ z-index: @contentBoxBeforeZIndex;
19
20
  }
20
21
 
21
22
  .content-box {
@@ -28,7 +29,6 @@
28
29
  padding-top: @contentBoxContainerMarginTop;
29
30
  padding-bottom: @contentBoxContainerMarginBottom;
30
31
  position: relative;
31
- z-index: @contentBoxContainerZIndex;
32
32
  }
33
33
 
34
34
  &.primary {
@@ -8,6 +8,7 @@
8
8
  @contentBoxBackgroundColor: @grey-1;
9
9
  @contentBoxNoBackground: transparent;
10
10
  @contentBoxColorInverted : inherit;
11
+ @contentBoxBeforeZIndex: -1;
11
12
 
12
13
  /* Themes */
13
14
  @contentBoxBackgroundColorPrimary: @primaryColor;
@@ -345,7 +345,7 @@
345
345
  display: flex;
346
346
  overflow: auto;
347
347
  width: 100%;
348
- height: @mobilePopUpHeight;
348
+ min-height: @mobilePopUpHeight;
349
349
  align-items: @searchBoxAlignItems;
350
350
  background: @searchBoxBackgroundGradient;
351
351
 
@@ -582,7 +582,7 @@
582
582
 
583
583
  /* Search box */
584
584
  #search-box {
585
- height: @tabletPopUpHeight;
585
+ min-height: @tabletPopUpHeight;
586
586
 
587
587
  .wrapper {
588
588
  margin: @searchBoxTabletPopupMarginTop 0;
@@ -693,7 +693,7 @@
693
693
 
694
694
  /* Search box */
695
695
  #search-box {
696
- height: @computerPopUpHeight;
696
+ min-height: @computerPopUpHeight;
697
697
 
698
698
  .wrapper {
699
699
  margin: @searchBoxComputerPopupMarginTop 0;
@@ -241,9 +241,9 @@
241
241
  @searchBoxSuggestionsTextColor: @white;
242
242
  @searchBoxSuggestionsColumnGap: 2em;
243
243
  @searchBoxSuggestionsRowGap: 1em;
244
- @searchBoxMobilePopupMarginTop: 0.5em;
245
- @searchBoxTabletPopupMarginTop: 1em;
246
- @searchBoxComputerPopupMarginTop: 1.5em;
244
+ @searchBoxMobilePopupMarginTop: @em-space-8;
245
+ @searchBoxTabletPopupMarginTop: @em-space-8;
246
+ @searchBoxComputerPopupMarginTop: @em-space-8;
247
247
 
248
248
  /* Custom shadows for dropdowns */
249
249
  @shadow-topbar-dropdown: 2px 0 2px -5px hsla(@shadow-color, calc(@shadow-strength + 6%));
@@ -4,6 +4,10 @@
4
4
 
5
5
  @import '@eeacms/volto-eea-design-system/../theme/themes/eea/globals/utilities';
6
6
 
7
+ html, body {
8
+ font-size: @baseFontSize;
9
+ }
10
+
7
11
  // Accessibility outline on focus-visible for every component
8
12
  *:focus-visible {
9
13
  outline: @focusVisibleOutline;
@@ -11,6 +15,7 @@
11
15
 
12
16
  button:focus-visible,
13
17
  a.button:focus-visible,
18
+ .ui.dropdown:focus-visible,
14
19
  .ui.checkbox input[type="checkbox"]:focus-visible,
15
20
  .ui.checkbox input[type="radio"]:focus-visible {
16
21
  outline: @focusVisibleOutline !important;
@@ -132,25 +137,19 @@ a {
132
137
  color: @black;
133
138
  }
134
139
 
135
- /* Add colors for paragraphs styles options in StyeMenu */
140
+ /* Add colors for paragraphs styles options in StyleMenu */
136
141
  #style-menu.ui.dropdown .menu {
137
- span:nth-of-type(1) {
142
+ .block-style-primary {
138
143
  color: @primaryColor;
139
- span.text {
140
- color: @primaryColor;
141
- }
142
144
  }
143
- span:nth-of-type(2) {
145
+ .block-style-secondary {
144
146
  color: @secondaryColor;
145
- span.text {
146
- color: @secondaryColor;
147
- }
148
147
  }
149
- span:nth-of-type(3) {
148
+ .block-style-tertiary {
150
149
  color: @tertiaryColor;
151
- span.text {
152
- color: @tertiaryColor;
153
- }
150
+ }
151
+ .active {
152
+ background-color: @grey-2;
154
153
  }
155
154
  }
156
155
 
@@ -175,16 +174,16 @@ a {
175
174
  visibility: hidden;
176
175
  }
177
176
  .image {
178
- page-break-inside: avoid;
177
+ page-break-inside: avoid;
179
178
  }
180
179
  img {
181
- page-break-inside: avoid;
180
+ page-break-inside: avoid;
182
181
  }
183
- .card {
184
- page-break-inside: avoid;
182
+ .card {
183
+ page-break-inside: avoid;
185
184
 
186
185
  }
187
186
  .grid-block-teaser .card{
188
- page-break-inside: auto;
187
+ page-break-inside: auto;
189
188
  }
190
189
  }
@@ -38,6 +38,9 @@
38
38
  /* The size of page text */
39
39
  @fontSize : 16px;
40
40
 
41
+ /* Overrides html & body default font-size to enable scaling from browser settings */
42
+ @baseFontSize: 1rem;
43
+
41
44
 
42
45
  /*-------------------
43
46
  Border Radius
@@ -140,7 +140,7 @@
140
140
  --card-image-height: @roundedImageHeight;
141
141
  }
142
142
  .ui.card.rounded {
143
- padding-top: @iconCardPaddingTop;
143
+ padding: @roundedCardPadding;
144
144
  border: none;
145
145
 
146
146
  .image {
@@ -415,6 +415,7 @@
415
415
  border-top: none;
416
416
  .header {
417
417
  word-break: break-word;
418
+ font-size: @iconCardHeaderFontSize;
418
419
  }
419
420
  }
420
421
  .icon {
@@ -450,6 +451,12 @@
450
451
  padding: @headerPadding;
451
452
  }
452
453
 
454
+ // when title is on image the extra padding that displays the
455
+ // link outline reveals part of title from 3rd row
456
+ .ui.card .gradient .header {
457
+ padding: @headerOnImagePadding;
458
+ }
459
+
453
460
  .ui.card .header > a {
454
461
  .useTitleMaxLines();
455
462
  }
@@ -457,4 +464,13 @@
457
464
  // Meta align fix
458
465
  .ui.card.u-card .meta:after {
459
466
  content: none;
460
- }
467
+ }
468
+
469
+ /*******************************
470
+ Image Card items grid
471
+ *******************************/
472
+ .imageCard-items {
473
+ display: grid;
474
+ gap: @imageCardItemsGap;
475
+ grid-template-columns: repeat(auto-fit,minmax(@imageCardItemsGridMin, @imageCardItemsGridMax));
476
+ }
@@ -18,7 +18,7 @@
18
18
  @fontFamily: @pageFont;
19
19
  @display: flex;
20
20
  @borderRadius: @defaultBorderRadius;
21
- @margin: 1em 0em;
21
+ @margin: 0em;
22
22
  @minHeight: 0px;
23
23
  @padding: 0em;
24
24
  @width: 290px;
@@ -69,7 +69,7 @@
69
69
  @iconColor: @tertiaryColor;
70
70
 
71
71
  /* Content */
72
- @contentDivider: @borderWidth solid @internalBorderColor;
72
+ @contentDivider: 0;
73
73
  @contentMargin: 0em;
74
74
  @contentBackground: none;
75
75
  @contentPadding: 1em 1em;
@@ -84,11 +84,13 @@
84
84
  @headerMargin: -@em-space-2 -@em-space-1 -@em-space-1 -@em-space-1;
85
85
  @headerFontWeight: @bold;
86
86
  @headerFontSize: 1.125rem;
87
+ @iconCardHeaderFontSize: clamp(@font-size-1, @font-size-2, 18px);
87
88
 
88
89
  @headerColor: inherit;
89
90
  @headerLinkDisplay: block;
90
91
 
91
92
  @headerPadding: @em-space-1;
93
+ @headerOnImagePadding: 0;
92
94
  @headerLineHeightOffset: -(@headerPadding * 2);
93
95
 
94
96
  /* Metadata */
@@ -270,8 +272,8 @@
270
272
  Image with title
271
273
  *******************************/
272
274
  @imageTitleColor: @white;
273
- @imageTitleFontSize: @h2;
274
- @imageTitleMobileFontSize: @mobileH1;
275
+ @imageTitleFontSize: clamp(@font-size-3, @h2, 32px);
276
+ @imageTitleMobileFontSize: clamp(@font-size-2, @mobileH1, 30px);
275
277
  @imageTitleFontWeight: @font-weight-7;
276
278
  @imageTitleLineHeight: @font-lineheight-0;
277
279
  @imageTitlePadding: @rem-space-6;
@@ -281,6 +283,7 @@
281
283
  Rounded Card
282
284
  *******************************/
283
285
  /* Global */
286
+ @roundedCardPadding : @rem-space-4 0;
284
287
  @roundedImageBorderRadius : @circularRadius;
285
288
  @roundedContentTitleMarginBottom : @rem-space-2;
286
289
  @roundedContentTitleTextAlign : left;
@@ -341,7 +344,7 @@
341
344
  @carouselButtonIconFontSize: 3.125rem;
342
345
  @carouselButtonIconOpacity: 1;
343
346
  @carouselButtonDistance: -3.5rem;
344
- @carouselButtonPaddingTop: @rem-space-4;
347
+ @carouselButtonPaddingTop: 0;
345
348
 
346
349
  /* Dots */
347
350
  @carouselDotsFontSize: 0.75rem;
@@ -366,3 +369,10 @@
366
369
  @tabletTeaserCardPaddingInline: @rem-space-2;
367
370
  @tabletTeaserCardMinWidth: 100%;
368
371
 
372
+
373
+ /*******************************
374
+ Image Card items grid
375
+ *******************************/
376
+ @imageCardItemsGap: 1.5rem;
377
+ @imageCardItemsGridMin: 275px;
378
+ @imageCardItemsGridMax: auto;