@kitconcept/volto-light-theme 8.0.0-alpha.18 → 8.0.0-alpha.19

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.
Files changed (32) hide show
  1. package/.changelog.draft +8 -7
  2. package/CHANGELOG.md +14 -0
  3. package/package.json +1 -1
  4. package/src/components/Blocks/EventCalendar/Search/components/EventTemplate.tsx +1 -1
  5. package/src/components/Blocks/Listing/DefaultTemplate.jsx +5 -5
  6. package/src/components/Blocks/Listing/GridTemplate.jsx +9 -6
  7. package/src/components/Blocks/Listing/ListingBody.jsx +1 -1
  8. package/src/components/Blocks/Listing/SummaryTemplate.jsx +9 -6
  9. package/src/components/Blocks/Teaser/DefaultBody.tsx +0 -1
  10. package/src/components/Summary/DefaultSummary.tsx +10 -3
  11. package/src/components/Summary/EventSummary.tsx +10 -3
  12. package/src/components/Summary/FileSummary.tsx +10 -3
  13. package/src/components/Summary/NewsItemSummary.tsx +10 -3
  14. package/src/components/Summary/PersonSummary.tsx +10 -3
  15. package/src/components/Summary/Summary.stories.tsx +46 -30
  16. package/src/primitives/Card/Card.stories.tsx +4 -1
  17. package/src/primitives/Card/Card.test.tsx +11 -33
  18. package/src/primitives/Card/Card.tsx +33 -49
  19. package/src/theme/_bgcolor-blocks-layout.scss +27 -41
  20. package/src/theme/_footer.scss +27 -1
  21. package/src/theme/_header.scss +13 -1
  22. package/src/theme/_layout.scss +6 -10
  23. package/src/theme/_typo-custom.scss +4 -5
  24. package/src/theme/_variables.scss +10 -5
  25. package/src/theme/blocks/_accordion.scss +10 -4
  26. package/src/theme/blocks/_grid.scss +0 -78
  27. package/src/theme/blocks/_listing.scss +54 -130
  28. package/src/theme/blocks/_search.scss +3 -4
  29. package/src/theme/blocks/_table.scss +1 -0
  30. package/src/theme/blocks/_teaser.scss +7 -119
  31. package/src/theme/card.scss +107 -70
  32. package/src/theme/person.scss +7 -1
@@ -52,55 +52,32 @@ const Card = (props: CardProps) => {
52
52
  const { className, openLinkInNewTab } = props;
53
53
 
54
54
  const a11yLabelId = React.useId();
55
- const linkRef = React.useRef<HTMLAnchorElement>(null);
56
-
57
- const triggerNavigation = () => {
58
- // Only navigate if there is *no* text selection
59
- const hasSelection = !!window.getSelection()?.toString();
60
- if (!hasSelection) {
61
- linkRef.current?.click();
62
- }
63
- };
64
-
65
55
  const isInteractive = !!props.href || !!props.item;
66
56
 
67
- const onClick: React.MouseEventHandler<HTMLDivElement> = (e) => {
68
- if (!isInteractive) return;
69
- if (e.defaultPrevented) return;
70
- if (e.target instanceof Element) {
71
- const anchor = e.target.closest('a');
72
- if (anchor && anchor !== linkRef.current) return;
73
- }
74
- triggerNavigation();
75
- };
76
-
77
- const onKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (e) => {
78
- if (!isInteractive) return;
79
- if (e.key === 'Enter' || e.key === ' ') {
80
- e.preventDefault();
81
- triggerNavigation();
82
- }
83
- };
57
+ const LinkToItem = React.useCallback(
58
+ ({ children }: { children: React.ReactNode }) => {
59
+ return (
60
+ <ConditionalLink
61
+ className="card-primary-link"
62
+ condition={isInteractive}
63
+ href={href}
64
+ item={item}
65
+ openLinkInNewTab={openLinkInNewTab}
66
+ >
67
+ {children}
68
+ </ConditionalLink>
69
+ );
70
+ },
71
+ [href, item, isInteractive, openLinkInNewTab],
72
+ );
84
73
 
85
74
  return (
86
- <div
87
- className={cx('card', className)}
88
- onClick={isInteractive ? onClick : undefined}
89
- onKeyDown={isInteractive ? onKeyDown : undefined}
90
- role={isInteractive ? 'link' : undefined}
91
- tabIndex={isInteractive ? 0 : undefined}
92
- >
93
- {/* @ts-expect-error since this has no children, should fail */}
94
- <ConditionalLink
95
- aria-labelledby={a11yLabelId}
96
- condition={isInteractive}
97
- href={href}
98
- item={item}
99
- openLinkInNewTab={openLinkInNewTab}
100
- ref={linkRef}
101
- />
75
+ <div className={cx('card', className)}>
102
76
  <div className="card-inner">
103
- {childrenWithProps(props.children, { a11yLabelId })}
77
+ {childrenWithProps(props.children, {
78
+ a11yLabelId,
79
+ LinkToItem,
80
+ })}
104
81
  </div>
105
82
  </div>
106
83
  );
@@ -150,14 +127,21 @@ const CardImage = (props: CardImageProps) => {
150
127
  type CardSummaryProps = {
151
128
  /** The ID of the element that labels the card. */
152
129
  a11yLabelId?: string;
130
+ LinkToItem?: React.ElementType;
153
131
  children?: React.ReactNode;
154
132
  };
155
133
 
156
- const CardSummary = (props: CardSummaryProps) => (
157
- <div className="card-summary">
158
- {childrenWithProps(props.children, { a11yLabelId: props.a11yLabelId })}
159
- </div>
160
- );
134
+ const CardSummary = (props: CardSummaryProps) => {
135
+ const { a11yLabelId, LinkToItem } = props;
136
+ return (
137
+ <div className="card-summary">
138
+ {childrenWithProps(props.children, {
139
+ a11yLabelId,
140
+ LinkToItem,
141
+ })}
142
+ </div>
143
+ );
144
+ };
161
145
 
162
146
  const CardActions = (props: any) => (
163
147
  <div className="actions-wrapper">{props.children}</div>
@@ -17,7 +17,7 @@
17
17
  & > strong,
18
18
  & > em,
19
19
  & > figcaption,
20
- & > a:not(.item),
20
+ & > a,
21
21
  & > blockquote,
22
22
  & > h2,
23
23
  & > h3,
@@ -25,16 +25,6 @@
25
25
  color: var(--theme-foreground-color);
26
26
  }
27
27
 
28
- :not(.teaser-item)
29
- > a:not(.item):not(
30
- :has(> .teaser-item),
31
- :has(> .listing-body),
32
- :has(> .card-container)
33
- ) {
34
- color: var(--link-foreground-color, --theme-foreground-color);
35
- text-decoration: underline;
36
- }
37
-
38
28
  &:first-child:has(> .documentFirstHeading) {
39
29
  padding-top: 0;
40
30
  }
@@ -503,7 +493,8 @@
503
493
  &.listing,
504
494
  &.search,
505
495
  &.rssBlock {
506
- h2.headline {
496
+ h2.headline,
497
+ h2.block-title {
507
498
  color: var(--theme-foreground-color);
508
499
  }
509
500
 
@@ -514,40 +505,26 @@
514
505
  .listing-item {
515
506
  border-bottom-color: var(--theme-foreground-color) !important;
516
507
 
517
- a > .listing-body {
518
- .headline,
519
- h3,
520
- h2,
521
- a,
522
- p,
523
- span {
524
- color: var(--theme-foreground-color);
525
- }
508
+ .headline,
509
+ h3,
510
+ h2,
511
+ a,
512
+ p,
513
+ span {
514
+ color: var(--theme-foreground-color);
526
515
  }
527
516
 
528
517
  .head-title span,
529
518
  .head-title {
530
519
  color: var(--theme-foreground-color);
531
520
  }
532
-
533
- .card-container {
534
- background-color: var(--theme-high-contrast-color);
535
-
536
- .content,
537
- .content p {
538
- color: var(--theme-foreground-color);
539
- }
540
- }
541
521
  }
542
- /* I have removed the .card-container className that's why I have to write this css
543
- * I will remove all the .card-container className from repo.
544
- */
545
522
  &.grid .card,
546
523
  & .grid-variation .card {
547
524
  background-color: var(--theme-high-contrast-color);
548
525
 
549
- .content,
550
- .content p {
526
+ .card-summary,
527
+ .card-summary p {
551
528
  color: var(--theme-foreground-color);
552
529
  }
553
530
  }
@@ -1131,19 +1108,28 @@
1131
1108
  }
1132
1109
  }
1133
1110
 
1134
- table.ui.table.slate-table-block {
1135
- border-color: var(--theme-low-contrast-foreground-color);
1111
+ table.ui.celled.table.slate-table-block {
1112
+ border-color: color-mix(
1113
+ in srgb,
1114
+ var(--theme-color) 75%,
1115
+ var(--theme-foreground-color)
1116
+ );
1136
1117
 
1137
1118
  tr td,
1138
1119
  th {
1139
- border-color: var(--theme-low-contrast-foreground-color);
1120
+ border-color: color-mix(
1121
+ in srgb,
1122
+ var(--theme-color) 75%,
1123
+ var(--theme-foreground-color)
1124
+ );
1140
1125
  }
1141
1126
 
1142
1127
  th {
1143
1128
  background-color: var(--theme-high-contrast-color) !important;
1129
+ color: var(--theme-low-contrast-foreground-color);
1144
1130
 
1145
- p {
1146
- color: var(--theme-low-contrast-foreground-color) !important;
1131
+ * {
1132
+ color: inherit;
1147
1133
  }
1148
1134
  }
1149
1135
 
@@ -1286,7 +1272,7 @@
1286
1272
  // Navigation
1287
1273
  nav.navigation {
1288
1274
  .item {
1289
- color: var(--header-foreground);
1275
+ color: var(--header-foreground, var(--primary-foreground-color));
1290
1276
  }
1291
1277
  .submenu-wrapper {
1292
1278
  .submenu.active {
@@ -293,6 +293,7 @@
293
293
  @include add(size, xs);
294
294
  @include add(height, s);
295
295
  color: var(--footer-foreground);
296
+ text-decoration: underline;
296
297
  }
297
298
  }
298
299
  }
@@ -320,13 +321,35 @@
320
321
  @include add(size, xs);
321
322
  @include add(height, s);
322
323
 
323
- a {
324
+ .slate.widget {
325
+ width: fit-content;
326
+ margin-right: auto;
327
+ margin-left: auto;
324
328
  @include add(size, xs);
325
329
  @include add(height, s);
330
+ ul,
331
+ ol,
332
+ li,
333
+ p,
334
+ a {
335
+ margin-bottom: 0;
336
+ font: inherit;
337
+ line-height: inherit;
338
+ }
339
+ }
340
+
341
+ a {
326
342
  color: var(--footer-foreground);
343
+ font: inherit;
327
344
  text-decoration: underline;
328
345
  }
329
346
 
347
+ p {
348
+ @include add(size, xs);
349
+ @include add(height, s);
350
+ margin-bottom: 0;
351
+ }
352
+
330
353
  img {
331
354
  margin-top: 25px;
332
355
  }
@@ -338,6 +361,9 @@
338
361
  content: '';
339
362
  @include default-container-width();
340
363
  }
364
+ &:has(.slate p:only-child:empty) {
365
+ display: none;
366
+ }
341
367
  }
342
368
 
343
369
  .main-footer + .post-footer {
@@ -371,7 +371,7 @@
371
371
  flex: 3.5 1 0;
372
372
  align-self: center;
373
373
  justify-content: center;
374
- margin-bottom: 40px;
374
+ margin-bottom: 11px;
375
375
 
376
376
  @media only screen and (max-width: $largest-mobile-screen) {
377
377
  display: none;
@@ -411,6 +411,18 @@
411
411
  }
412
412
  }
413
413
  }
414
+ .desktop-menu {
415
+ .item {
416
+ padding-top: 15px;
417
+ &:hover::before,
418
+ &.active::before {
419
+ bottom: -20px;
420
+ }
421
+ }
422
+ .submenu-wrapper {
423
+ margin-top: 11px;
424
+ }
425
+ }
414
426
  }
415
427
 
416
428
  .complementary-logo {
@@ -158,8 +158,7 @@ footer {
158
158
  .content-area .ui.container,
159
159
  .content-area .q.container,
160
160
  .content-area .a.container {
161
- a.external:after,
162
- a.external:after {
161
+ a.external:not(.card-primary-link):after {
163
162
  @include external-link-icon();
164
163
  margin-top: -25px;
165
164
  margin-left: 3px;
@@ -173,8 +172,7 @@ footer {
173
172
  .content-area #page-edit .ui.container,
174
173
  .content-area .q.container,
175
174
  .content-area .a.container {
176
- a.external:after,
177
- a.external:after {
175
+ a.external:not(.card-primary-link):after {
178
176
  @include external-link-icon();
179
177
  margin-top: -25px;
180
178
  margin-left: 3px;
@@ -196,8 +194,7 @@ External & Mail link removal for all the blocks.
196
194
  .block.listing,
197
195
  .block.image,
198
196
  .block.teaser {
199
- a.external:after,
200
- a.external:after {
197
+ a.external:not(.card-primary-link):after {
201
198
  display: none;
202
199
  }
203
200
  p a[href^='mailto:']:after {
@@ -260,11 +257,11 @@ External & Mail link removal for all the blocks.
260
257
  & > .block.search.grid,
261
258
  & > .block.rssBlock,
262
259
  & > .block.search .searchBlock-container,
263
- &> .block.eventsearch .search-block-event,
260
+ & > .block.eventsearch .search-block-event,
261
+ & > .block h2.block-title,
264
262
  & > .block h2.headline,
265
263
  & > .block.heading .heading-wrapper,
266
- & > .block.teaser .teaser-item.default,
267
- & > .block.teaser .card-inner, // deprecate when category is in place
264
+ & > .block.teaser,
268
265
  & > .block.highlight .teaser-description-title,
269
266
  & > table,
270
267
  & > .table-of-contents,
@@ -275,7 +272,6 @@ External & Mail link removal for all the blocks.
275
272
  @include adjustMarginsToContainer($default-container-width);
276
273
  }
277
274
 
278
- & > .block.teaser,
279
275
  & > .block.image.align.full,
280
276
  & > .block.video.align.full,
281
277
  & > .block.maps.align.full {
@@ -33,10 +33,8 @@ header .navigation .item {
33
33
 
34
34
  .content-area,
35
35
  .breadcrumbs {
36
- p > a,
37
- li > a,
38
- .breadcrumb a {
39
- color: $blue-for-grey-contrast;
36
+ a:not(.card-primary-link, .label) {
37
+ color: var(--link-foreground-color, var(--theme-foreground-color));
40
38
  text-decoration: underline;
41
39
  }
42
40
  }
@@ -95,7 +93,8 @@ h1.documentFirstHeading:last-child {
95
93
  }
96
94
 
97
95
  // Block Title
98
- .block h2.headline {
96
+ .block h2.headline,
97
+ .block h2.block-title {
99
98
  @include block-title();
100
99
  @include vertical-space-block-title();
101
100
  }
@@ -126,7 +126,6 @@ $secondary-grey: #ececec !default;
126
126
 
127
127
  // Header
128
128
  --header-background: var(--primary-color);
129
- --header-foreground: var(--primary-foreground-color);
130
129
 
131
130
  //Footer
132
131
  --footer-background: var(--secondary-color);
@@ -146,8 +145,8 @@ $secondary-grey: #ececec !default;
146
145
 
147
146
  // Link color
148
147
  --link-color: #0070a2;
149
- // Comment out following line to turn <a> links the same color as the text
150
- --link-foreground-color: var(--link-color);
148
+ // Uncomment following line to turn <a> links into a different color than the theme foreground color
149
+ // --link-foreground-color: var(--link-color);
151
150
 
152
151
  // It is possible to set an aspect ratio for all images, using the folowing CSS custom property:
153
152
  // --image-aspect-ratio: calc(16 / 9);
@@ -433,7 +432,10 @@ $line-heights: (
433
432
  display: inline-block;
434
433
  width: 11px;
435
434
  height: 11px;
436
- background-color: var(--link-foreground-color, #0070a2);
435
+ background-color: var(
436
+ --theme-foreground-color,
437
+ var(--link-foreground-color, #0070a2)
438
+ );
437
439
  content: '';
438
440
  mask: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-prefix='fas' data-icon='external-link-alt' class='svg-inline--fa fa-external-link-alt fa-w-16' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z'/%3E%3C/svg%3E")
439
441
  no-repeat center;
@@ -443,7 +445,10 @@ $line-heights: (
443
445
  display: inline-block;
444
446
  width: 11px;
445
447
  height: 11px;
446
- background-color: var(--link-foreground-color, #0070a2);
448
+ background-color: var(
449
+ --theme-foreground-color,
450
+ var(--link-foreground-color, #0070a2)
451
+ );
447
452
  content: '';
448
453
  mask: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-prefix='fas' data-icon='envelope' class='svg-inline--fa fa-envelope fa-w-16' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z'%3E%3C/path%3E%3C/svg%3E")
449
454
  no-repeat center;
@@ -68,6 +68,7 @@
68
68
 
69
69
  .block.image {
70
70
  figure {
71
+ margin-top: 0;
71
72
  &.right {
72
73
  margin-left: 20px;
73
74
  }
@@ -92,13 +93,18 @@
92
93
  }
93
94
  }
94
95
 
95
- .block.teaser {
96
+ .block.teaser,
97
+ .block.listing {
96
98
  .card-inner .card-summary {
97
- h2.title {
98
- padding: 0px;
99
- margin-bottom: 20px !important;
99
+ .title {
100
+ padding: 0;
100
101
  background: none;
101
102
  text-transform: none;
103
+ @include text-heading-h2();
104
+
105
+ @container (max-width: #{$largest-mobile-screen}) {
106
+ @include text-heading-h3();
107
+ }
102
108
  }
103
109
  }
104
110
  }
@@ -37,14 +37,6 @@
37
37
  padding-top: 0;
38
38
  margin-bottom: 0;
39
39
 
40
- // External link icon
41
- a.external + .card-inner {
42
- .card-summary h2:after {
43
- @include external-link-icon();
44
- margin-left: 3px;
45
- }
46
- }
47
-
48
40
  a {
49
41
  text-decoration: none;
50
42
  }
@@ -56,39 +48,6 @@
56
48
  ) !important;
57
49
  }
58
50
  }
59
-
60
- .teaser-item {
61
- height: 100%;
62
-
63
- .image-wrapper {
64
- margin-bottom: $spacing-medium;
65
-
66
- img {
67
- position: relative;
68
- }
69
- }
70
- .content {
71
- padding: 0 $spacing-small $spacing-small $spacing-small;
72
- @include body-text();
73
-
74
- .headline {
75
- margin-bottom: $spacing-small;
76
- letter-spacing: 1px;
77
- text-transform: uppercase;
78
- @include headtitle1();
79
- }
80
-
81
- h2 {
82
- padding: 0;
83
- margin-bottom: $spacing-small !important;
84
- @include text-heading-h3();
85
- }
86
-
87
- p {
88
- margin-bottom: $spacing-small;
89
- }
90
- }
91
- }
92
51
  }
93
52
 
94
53
  .block-editor-teaser {
@@ -304,11 +263,6 @@
304
263
  #page-add .block-editor-gridBlock .block.gridBlock {
305
264
  @media only screen and (min-width: $largest-mobile-screen) {
306
265
  .one {
307
- .block.teaser .teaser-item .content h2 {
308
- margin-bottom: $spacing-medium !important;
309
- @include text-heading-h2();
310
- }
311
-
312
266
  .slate {
313
267
  h2 {
314
268
  margin-bottom: $spacing-medium !important;
@@ -331,14 +285,6 @@
331
285
 
332
286
  .two,
333
287
  .three {
334
- .teaser {
335
- .teaser-item .content {
336
- h2 {
337
- margin-bottom: $spacing-small !important;
338
- @include text-heading-h3();
339
- }
340
- }
341
- }
342
288
  .image {
343
289
  figcaption {
344
290
  .title {
@@ -365,26 +311,6 @@
365
311
  }
366
312
 
367
313
  .four {
368
- .teaser {
369
- .teaser-item {
370
- .image-wrapper {
371
- margin-bottom: $spacing-small !important;
372
- }
373
- .content {
374
- .headline {
375
- @include headtitle2();
376
- }
377
- h2 {
378
- margin-bottom: $spacing-small !important;
379
- @include text-heading-h4();
380
- }
381
- p {
382
- margin-bottom: 0;
383
- }
384
- }
385
- }
386
- }
387
-
388
314
  .image {
389
315
  figcaption {
390
316
  .title {
@@ -425,10 +351,6 @@
425
351
  margin-bottom: 0;
426
352
  }
427
353
 
428
- .block.gridBlock h2.title {
429
- margin-bottom: $spacing-small !important;
430
- }
431
-
432
354
  // Watch out for the following rule, it is used to override the default
433
355
  // behavior of the block editor when selecting a block but it stopped working
434
356
  // if the z-index is still -1 (from 6.0.0-alpha.0)