@kitconcept/volto-light-theme 6.0.0-alpha.8 → 6.0.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.
Files changed (101) hide show
  1. package/.changelog.draft +1 -5
  2. package/CHANGELOG.md +226 -0
  3. package/README.md +6 -5
  4. package/locales/de/LC_MESSAGES/volto.po +171 -38
  5. package/locales/en/LC_MESSAGES/volto.po +170 -37
  6. package/locales/es/LC_MESSAGES/volto.po +171 -38
  7. package/locales/eu/LC_MESSAGES/volto.po +171 -38
  8. package/locales/pt_BR/volto.po +171 -38
  9. package/locales/volto.pot +171 -38
  10. package/package.json +15 -6
  11. package/src/components/Blocks/EventMetadata/View.jsx +32 -26
  12. package/src/components/Blocks/Listing/DefaultTemplate.jsx +19 -14
  13. package/src/components/Blocks/Listing/GridTemplate.jsx +9 -12
  14. package/src/components/Blocks/Listing/SummaryTemplate.jsx +9 -7
  15. package/src/components/Blocks/Teaser/DefaultBody.jsx +93 -0
  16. package/src/components/Blocks/Teaser/schema.js +1 -7
  17. package/src/components/Footer/ColumnLinks.tsx +35 -0
  18. package/src/components/Footer/Footer.tsx +32 -0
  19. package/src/components/Footer/slots/Colophon.tsx +24 -0
  20. package/src/components/Footer/slots/Copyright.tsx +65 -0
  21. package/src/components/Footer/slots/CoreFooter.tsx +82 -0
  22. package/src/components/Footer/slots/FollowUsLogoAndLinks.tsx +80 -0
  23. package/src/components/Footer/slots/FooterLogos.tsx +44 -0
  24. package/src/components/Header/Header.tsx +257 -0
  25. package/src/components/Logo/Logo.tsx +85 -0
  26. package/src/components/{Footer/FooterLogos.tsx → LogosContainer/LogosContainer.tsx} +24 -25
  27. package/src/components/MobileNavigation/MobileNavigation.jsx +53 -18
  28. package/src/components/Navigation/Navigation.jsx +14 -3
  29. package/src/components/SearchWidget/IntranetSearchWidget.jsx +32 -5
  30. package/src/components/SearchWidget/SearchWidget.jsx +1 -1
  31. package/src/components/StickyMenu/StickyMenu.tsx +36 -0
  32. package/src/components/Summary/DefaultSummary.jsx +16 -0
  33. package/src/components/Summary/EventSummary.jsx +38 -0
  34. package/src/components/Summary/FileSummary.jsx +24 -0
  35. package/src/components/Summary/NewsItemSummary.jsx +40 -0
  36. package/src/components/Tags/Tags.jsx +46 -0
  37. package/src/components/Theme/EventView.jsx +19 -25
  38. package/src/components/Theme/NewsItemView.jsx +13 -9
  39. package/src/components/Theming/Theming.tsx +20 -17
  40. package/src/components/Widgets/{BlockAlignmentWidget.tsx → BlockAlignment.tsx} +9 -2
  41. package/src/components/Widgets/{BlockWidthWidget.tsx → BlockWidth.tsx} +10 -3
  42. package/src/components/Widgets/BlocksObject.tsx +353 -0
  43. package/src/components/Widgets/Buttons.tsx +117 -0
  44. package/src/components/Widgets/ColorContrastChecker.tsx +117 -0
  45. package/src/components/Widgets/ColorPicker.tsx +59 -0
  46. package/src/components/Widgets/{ColorPickerWidget.tsx → ColorSwatch.tsx} +5 -5
  47. package/src/components/Widgets/ObjectList.tsx +342 -0
  48. package/src/components/Widgets/{ThemingColorPicker.tsx → RACThemingColorPicker.tsx} +4 -0
  49. package/src/components/Widgets/Size.tsx +75 -0
  50. package/src/components/Widgets/ThemeColorSwatch.tsx +17 -0
  51. package/src/components/Widgets/schema/footerLinksSchema.ts +64 -0
  52. package/src/components/Widgets/schema/footerLogosSchema.ts +98 -0
  53. package/src/components/Widgets/schema/headerActionsSchema.ts +64 -0
  54. package/src/components/Widgets/schema/iconLinkListSchema.ts +98 -0
  55. package/src/config/blocks.tsx +39 -20
  56. package/src/config/settings.ts +54 -12
  57. package/src/config/slots.ts +36 -1
  58. package/src/config/summary.ts +24 -0
  59. package/src/config/widgets.ts +57 -20
  60. package/src/customizations/volto/components/manage/Blocks/Teaser/DefaultBody.jsx +8 -0
  61. package/src/customizations/volto/components/theme/Tags/Tags.jsx +11 -0
  62. package/src/customizations/volto/components/theme/View/RenderBlocks.jsx +2 -1
  63. package/src/helpers/DndSortableList.tsx +138 -0
  64. package/src/helpers/dates.js +22 -0
  65. package/src/helpers/doesNodeContainClick.js +64 -0
  66. package/src/helpers/useLiveData.ts +29 -0
  67. package/src/index.ts +33 -2
  68. package/src/primitives/IconLinkList.tsx +69 -0
  69. package/src/primitives/LinkList.tsx +35 -0
  70. package/src/theme/_bgcolor-blocks-layout.scss +50 -12
  71. package/src/theme/_container.scss +4 -0
  72. package/src/theme/_content.scss +6 -0
  73. package/src/theme/_footer.scss +295 -43
  74. package/src/theme/_header.scss +132 -19
  75. package/src/theme/_layout.scss +11 -1
  76. package/src/theme/_sitemap.scss +4 -0
  77. package/src/theme/_utils.scss +14 -1
  78. package/src/theme/_variables.scss +12 -3
  79. package/src/theme/_widgets.scss +102 -10
  80. package/src/theme/blocks/_eventMetadata.scss +5 -2
  81. package/src/theme/blocks/_grid.scss +3 -3
  82. package/src/theme/blocks/_highlight.scss +17 -44
  83. package/src/theme/blocks/_listing.scss +25 -16
  84. package/src/theme/blocks/_maps.scss +3 -3
  85. package/src/theme/blocks/_slider.scss +5 -1
  86. package/src/theme/main.scss +1 -0
  87. package/src/theme/sticky-menu.scss +50 -0
  88. package/src/types.d.ts +102 -0
  89. package/tsconfig.json +1 -1
  90. package/src/components/Footer/Footer.jsx +0 -115
  91. package/src/components/Footer/FooterLinks.tsx +0 -57
  92. package/src/components/Header/Header.jsx +0 -161
  93. package/src/components/Logo/Logo.jsx +0 -51
  94. package/src/components/Widgets/AlignWidget.jsx +0 -80
  95. package/src/components/Widgets/BackgroundColorWidget.tsx +0 -17
  96. package/src/components/Widgets/BlocksObjectWidget.tsx +0 -333
  97. package/src/components/Widgets/ButtonsWidget.tsx +0 -68
  98. package/src/components/Widgets/FooterLinksWidget.tsx +0 -106
  99. package/src/components/Widgets/FooterLogosWidget.tsx +0 -120
  100. package/src/static/container-query-polyfill.modern.js +0 -1
  101. package/src/types/index.d.ts +0 -1
@@ -0,0 +1,64 @@
1
+ // Legacy code from Semantic UI React
2
+ import some from 'lodash/some';
3
+ import invoke from 'lodash/invoke';
4
+ import inRange from 'lodash/inRange';
5
+ import isNil from 'lodash/isNil';
6
+ import first from 'lodash/first';
7
+
8
+ /**
9
+ * Determines if a click's coordinates are within the bounds of a node.
10
+ *
11
+ * @see https://github.com/Semantic-Org/Semantic-UI-React/pull/2384
12
+ *
13
+ * @param {object} node - A DOM node.
14
+ * @param {object} e - A SyntheticEvent or DOM Event.
15
+ * @returns {boolean}
16
+ */
17
+ const doesNodeContainClick = (node, e) => {
18
+ if (some([e, node], isNil)) return false;
19
+
20
+ // if there is an e.target and it is in the document, use a simple node.contains() check
21
+ if (e.target) {
22
+ invoke(e.target, 'setAttribute', 'data-suir-click-target', true);
23
+
24
+ if (document.querySelector('[data-suir-click-target=true]')) {
25
+ invoke(e.target, 'removeAttribute', 'data-suir-click-target');
26
+ return node.contains(e.target);
27
+ }
28
+ }
29
+
30
+ // Below logic handles cases where the e.target is no longer in the document.
31
+ // The result of the click likely has removed the e.target node.
32
+ // Instead of node.contains(), we'll identify the click by X/Y position.
33
+
34
+ // return early if the event properties aren't available
35
+ // prevent measuring the node and repainting if we don't need to
36
+ const { clientX, clientY } = e;
37
+ if (some([clientX, clientY], isNil)) return false;
38
+
39
+ // false if the node is not visible
40
+ const clientRects = node.getClientRects();
41
+ // Heads Up!
42
+ // getClientRects returns a DOMRectList, not an array nor a plain object
43
+ // We explicitly avoid isEmpty and check .length to cover all possible shapes
44
+ if (
45
+ !node.offsetWidth ||
46
+ !node.offsetHeight ||
47
+ !clientRects ||
48
+ !clientRects.length
49
+ )
50
+ return false;
51
+
52
+ // false if the node doesn't have a valid bounding rect
53
+ const { top, bottom, left, right } = first(clientRects);
54
+ if (some([top, bottom, left, right], isNil)) return false;
55
+
56
+ // we add a small decimal to the upper bound just to make it inclusive
57
+ // don't add an whole pixel (1) as the event/node values may be decimal sensitive
58
+ return (
59
+ inRange(clientY, top, bottom + 0.001) &&
60
+ inRange(clientX, left, right + 0.001)
61
+ );
62
+ };
63
+
64
+ export default doesNodeContainClick;
@@ -0,0 +1,29 @@
1
+ import { useSelector } from 'react-redux';
2
+ import type { Content } from '@plone/types';
3
+
4
+ type FormState = {
5
+ content: {
6
+ data: Content;
7
+ };
8
+ form: {
9
+ global: Content;
10
+ };
11
+ };
12
+
13
+ export function useLiveData<T>(
14
+ content: Content,
15
+ behavior: string,
16
+ field: string,
17
+ ) {
18
+ const current = content?.['@components']?.inherit?.[behavior]?.data?.[
19
+ field
20
+ ] as T;
21
+
22
+ const formData = useSelector<FormState, T>(
23
+ (state) => state.form.global?.[field],
24
+ );
25
+
26
+ const data = formData ?? current;
27
+
28
+ return data;
29
+ }
package/src/index.ts CHANGED
@@ -12,9 +12,18 @@ import installBlocks from './config/blocks';
12
12
  import installClassExtenders from './config/classExtenders';
13
13
  import installWidgets from './config/widgets';
14
14
  import installSlots from './config/slots';
15
+ import installSummary from './config/summary';
15
16
 
16
17
  import '@plone/components/dist/basic.css';
17
- import type { BlocksData } from '@plone/types';
18
+
19
+ import type {
20
+ CustomInheritBehavior,
21
+ SiteHeaderSettings,
22
+ SiteThemeSettings,
23
+ SiteFooterSettings,
24
+ StickyMenuSettings,
25
+ PloneGobrSocialMediaSettings,
26
+ } from './types';
18
27
 
19
28
  defineMessages({
20
29
  Press: {
@@ -25,11 +34,32 @@ defineMessages({
25
34
  id: 'Sitemap',
26
35
  defaultMessage: 'Sitemap',
27
36
  },
37
+ List: {
38
+ id: 'List',
39
+ defaultMessage: 'List',
40
+ },
41
+ listWithImages: {
42
+ id: 'List with images',
43
+ defaultMessage: 'List with images',
44
+ },
28
45
  });
29
46
 
30
47
  declare module '@plone/types' {
31
48
  export interface Content {
32
- footer_logos: BlocksData;
49
+ footer_logos_container_width: string;
50
+ footer_logos_size: string;
51
+ footer_logo_link: string;
52
+ }
53
+
54
+ export interface Expanders {
55
+ inherit: {
56
+ 'voltolighttheme.header': CustomInheritBehavior<SiteHeaderSettings>;
57
+ 'voltolighttheme.theme': CustomInheritBehavior<SiteThemeSettings>;
58
+ 'voltolighttheme.footer': CustomInheritBehavior<SiteFooterSettings>;
59
+ 'kitconcept.sticky_menu': CustomInheritBehavior<StickyMenuSettings>;
60
+ 'kitconcept.footer': CustomInheritBehavior<SiteFooterSettings>;
61
+ 'plonegovbr.socialmedia.settings': CustomInheritBehavior<PloneGobrSocialMediaSettings>;
62
+ };
33
63
  }
34
64
  }
35
65
 
@@ -39,6 +69,7 @@ const applyConfig = (config: ConfigType) => {
39
69
  installClassExtenders(config);
40
70
  installWidgets(config);
41
71
  installSlots(config);
72
+ installSummary(config);
42
73
 
43
74
  // Register a custom Container component from @plone/components
44
75
  config.registerComponent({
@@ -0,0 +1,69 @@
1
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
2
+ import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink';
3
+ import type { iconLink } from '../types';
4
+
5
+ type IconLinkListProps = {
6
+ iconLinks: Array<iconLink>;
7
+ };
8
+
9
+ const IconLinkList = (props: IconLinkListProps) => {
10
+ const { iconLinks } = props;
11
+
12
+ return (
13
+ <ul>
14
+ {iconLinks && Array.isArray(iconLinks)
15
+ ? iconLinks.map((item) => {
16
+ const itemInfo: {
17
+ title: string;
18
+ hrefTitle: string;
19
+ href: string;
20
+ itemHref: string;
21
+ src: string;
22
+ srcAlt: string;
23
+ } = {
24
+ title: '',
25
+ hrefTitle: '',
26
+ href: '',
27
+ itemHref: '',
28
+ src: '',
29
+ srcAlt: '',
30
+ };
31
+ if (item?.href?.length > 0) {
32
+ itemInfo.title = item.title || item.href[0]['title'];
33
+ itemInfo.href = flattenToAppURL(item.href[0]['@id']);
34
+ }
35
+ if (item?.icon && item.icon[0]?.image_scales) {
36
+ itemInfo.itemHref = item.icon[0]['@id'];
37
+ itemInfo.srcAlt = item['alt'];
38
+ itemInfo.src = `${flattenToAppURL(itemInfo.itemHref)}/${item.icon[0].image_scales[item.icon[0].image_field][0].download}`;
39
+ } else if (item?.icon && item.icon[0]) {
40
+ itemInfo.itemHref = item.icon[0]['@id'];
41
+ itemInfo.srcAlt = item['alt'];
42
+ itemInfo.src = `${flattenToAppURL(itemInfo.itemHref)}/@@images/image`;
43
+ }
44
+
45
+ if (!itemInfo.src) return null;
46
+
47
+ return (
48
+ <li className="item" key={item['@id']}>
49
+ {/* @ts-ignore */}
50
+ <ConditionalLink
51
+ condition={itemInfo.href}
52
+ to={itemInfo.href}
53
+ title={itemInfo.hrefTitle || itemInfo.srcAlt}
54
+ openLinkInNewTab={item.openInNewTab}
55
+ >
56
+ <div className="image-wrapper">
57
+ <img src={itemInfo.src} alt={itemInfo.srcAlt} />
58
+ </div>
59
+ <span>{itemInfo.title}</span>
60
+ </ConditionalLink>
61
+ </li>
62
+ );
63
+ })
64
+ : null}
65
+ </ul>
66
+ );
67
+ };
68
+
69
+ export default IconLinkList;
@@ -0,0 +1,35 @@
1
+ import isEmpty from 'lodash/isEmpty';
2
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
3
+ import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
4
+ import type { Link } from '../types';
5
+
6
+ type LinksProps = { links: Array<Link> };
7
+
8
+ const LinkList = (props: LinksProps) => {
9
+ const { links } = props;
10
+
11
+ return (
12
+ <ul>
13
+ {links && Array.isArray(links)
14
+ ? links.map((link) => {
15
+ if (isEmpty(link) || !link.href) return null;
16
+
17
+ const title = link.title || link.href[0]['title'];
18
+ const href = flattenToAppURL(link.href[0]?.['@id']);
19
+
20
+ if (!href) return null;
21
+
22
+ return (
23
+ <li className="item" key={href}>
24
+ <UniversalLink href={href} openLinkInNewTab={link.openInNewTab}>
25
+ {title}
26
+ </UniversalLink>
27
+ </li>
28
+ );
29
+ })
30
+ : null}
31
+ </ul>
32
+ );
33
+ };
34
+
35
+ export default LinkList;
@@ -23,7 +23,8 @@
23
23
  color: var(--theme-foreground-color);
24
24
  }
25
25
 
26
- a:not(.item):not(
26
+ :not(.teaser-item)
27
+ > a:not(.item):not(
27
28
  :has(> .teaser-item),
28
29
  :has(> .listing-body),
29
30
  :has(> .card-container)
@@ -81,6 +82,9 @@
81
82
 
82
83
  // Color map
83
84
  @mixin use-theme-colors() {
85
+ #page-document {
86
+ background: var(--primary-color);
87
+ }
84
88
  // Page title
85
89
  h1.documentFirstHeading {
86
90
  color: var(--theme-foreground-color);
@@ -95,6 +99,11 @@
95
99
  h2 {
96
100
  color: var(--theme-foreground-color);
97
101
  }
102
+ .ui.bulleted.list li {
103
+ &::before {
104
+ color: var(--link-foreground-color) !important;
105
+ }
106
+ }
98
107
  }
99
108
 
100
109
  // Blocks
@@ -168,6 +177,7 @@
168
177
  border-bottom-color: var(--theme-foreground-color) !important;
169
178
 
170
179
  a > .listing-body {
180
+ .headline,
171
181
  h3,
172
182
  h2,
173
183
  a,
@@ -651,15 +661,6 @@
651
661
  }
652
662
  }
653
663
 
654
- // Use values assigned to the parent Grid block
655
- .block {
656
- --theme-high-contrast-color: inherit !important;
657
- --theme-color: inherit !important;
658
- --theme-high-contrast-color: inherit !important;
659
- --theme-foreground-color: inherit !important;
660
- --theme-low-contrast-foreground-color: inherit !important;
661
- }
662
-
663
664
  .block.teaser {
664
665
  padding-top: 0;
665
666
  background: var(--theme-high-contrast-color);
@@ -734,6 +735,12 @@
734
735
  }
735
736
  }
736
737
 
738
+ &.eventMetadata {
739
+ .details-container {
740
+ color: var(--theme-foreground-color);
741
+ }
742
+ }
743
+
737
744
  .cookie-consent-buttons {
738
745
  button.button {
739
746
  color: black;
@@ -845,8 +852,11 @@
845
852
  }
846
853
 
847
854
  [class^='block-editor-'] {
848
- a.slate-editor-link {
849
- color: var(--theme-foreground-color);
855
+ a.slate-editor-link span[data-slate-string='true'] {
856
+ color: var(
857
+ --link-foreground-color,
858
+ --theme-foreground-color
859
+ ) !important;
850
860
  }
851
861
 
852
862
  .block {
@@ -914,6 +924,14 @@
914
924
  }
915
925
  }
916
926
  }
927
+
928
+ .eventMetadata {
929
+ color: var(--theme-foreground-color);
930
+
931
+ a {
932
+ color: var(--link-foreground-color, --theme-foreground-color);
933
+ }
934
+ }
917
935
  }
918
936
  }
919
937
  }
@@ -1140,6 +1158,26 @@
1140
1158
  & > span,
1141
1159
  & > div {
1142
1160
  color: var(--primary-foreground-color);
1161
+
1162
+ .ui.pagination.menu {
1163
+ background: var(--primary-color);
1164
+
1165
+ a.item {
1166
+ color: var(--primary-foreground-color);
1167
+
1168
+ &:not([aria-current='true']) {
1169
+ color: var(--link-foreground-color);
1170
+ }
1171
+
1172
+ &.disabled {
1173
+ color: var(--primary-foreground-color) !important;
1174
+ opacity: 0.8;
1175
+ }
1176
+ }
1177
+ a.item:not([aria-current='true']) {
1178
+ color: var(--link-foreground-color);
1179
+ }
1180
+ }
1143
1181
  }
1144
1182
 
1145
1183
  #content-core {
@@ -6,6 +6,10 @@
6
6
  @include layout-container-width;
7
7
  }
8
8
 
9
+ &.default {
10
+ @include default-container-width;
11
+ }
12
+
9
13
  &.narrow {
10
14
  @include narrow-container-width;
11
15
  }
@@ -4,6 +4,7 @@
4
4
  // the required vertical spacing
5
5
  padding: 0;
6
6
  margin-top: 0;
7
+ margin-bottom: 0;
7
8
  }
8
9
 
9
10
  .contenttype-news-item {
@@ -18,6 +19,7 @@
18
19
  @include adjustMarginsToContainer($default-container-width);
19
20
  margin-top: $spacing-medium;
20
21
  margin-bottom: $spacing-medium;
22
+ color: var(--primary-foreground-color);
21
23
  .day {
22
24
  @include body-text-bold();
23
25
  letter-spacing: 1px;
@@ -79,6 +81,7 @@
79
81
  .dates {
80
82
  margin-top: $spacing-medium;
81
83
  margin-bottom: $spacing-medium;
84
+ color: var(--primary-foreground-color);
82
85
  @container (max-width: #{$largest-mobile-screen} ) {
83
86
  margin-bottom: $spacing-small;
84
87
  }
@@ -88,6 +91,9 @@
88
91
  letter-spacing: 1px;
89
92
  text-transform: uppercase;
90
93
  }
94
+ .day + .head-title::before {
95
+ content: '|';
96
+ }
91
97
  }
92
98
 
93
99
  .details-container {