@kitconcept/volto-light-theme 8.0.0-alpha.2 → 8.0.0-alpha.21

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 +3 -4
  2. package/CHANGELOG.md +232 -0
  3. package/locales/de/LC_MESSAGES/volto.po +30 -115
  4. package/locales/en/LC_MESSAGES/volto.po +30 -115
  5. package/locales/es/LC_MESSAGES/volto.po +31 -116
  6. package/locales/eu/LC_MESSAGES/volto.po +58 -124
  7. package/locales/pt_BR/LC_MESSAGES/volto.po +38 -123
  8. package/locales/volto.pot +31 -116
  9. package/package.json +7 -4
  10. package/src/__mocks__/semantic-ui-react.ts +31 -0
  11. package/src/components/Blocks/Block/Edit.jsx +14 -6
  12. package/src/components/Blocks/Block/EditBlockWrapper.jsx +9 -3
  13. package/src/components/Blocks/Block/ErrorBoundary.test.tsx +55 -0
  14. package/src/components/Blocks/Block/ErrorBoundary.tsx +92 -0
  15. package/src/components/Blocks/Block/ErrorBoundaryMessage.tsx +66 -0
  16. package/src/components/Blocks/EventCalendar/Search/components/EventTemplate.tsx +1 -1
  17. package/src/components/Blocks/Image/Edit.jsx +1 -0
  18. package/src/components/Blocks/Listing/DefaultTemplate.jsx +12 -6
  19. package/src/components/Blocks/Listing/GridTemplate.jsx +16 -7
  20. package/src/components/Blocks/Listing/ListingBody.jsx +4 -1
  21. package/src/components/Blocks/Listing/SummaryTemplate.jsx +16 -7
  22. package/src/components/Blocks/Teaser/DefaultBody.tsx +25 -5
  23. package/src/components/Blocks/schema.ts +69 -0
  24. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +128 -0
  25. package/src/components/Breadcrumbs/Breadcrumbs.tsx +117 -0
  26. package/src/components/Caption/Caption.test.tsx +31 -0
  27. package/src/components/Caption/{Caption.jsx → Caption.tsx} +14 -21
  28. package/src/components/Footer/ColumnLinks.tsx +2 -2
  29. package/src/components/Footer/slots/Colophon.tsx +13 -1
  30. package/src/components/Footer/slots/CoreFooter.tsx +4 -2
  31. package/src/components/Header/Header.tsx +3 -3
  32. package/src/components/LanguageSelector/LanguageSelector.tsx +91 -0
  33. package/src/components/MobileNavigation/MobileNavigation.jsx +11 -9
  34. package/src/components/Navigation/Navigation.test.tsx +176 -0
  35. package/src/components/Navigation/{Navigation.jsx → Navigation.tsx} +77 -37
  36. package/src/components/StickyMenu/MobileCarouselArrowButton.tsx +81 -0
  37. package/src/components/StickyMenu/MobileStickyMenu.tsx +76 -0
  38. package/src/components/Summary/DefaultSummary.tsx +10 -3
  39. package/src/components/Summary/EventSummary.tsx +10 -3
  40. package/src/components/Summary/FileSummary.tsx +10 -3
  41. package/src/components/Summary/NewsItemSummary.tsx +10 -3
  42. package/src/components/Summary/PersonSummary.tsx +10 -3
  43. package/src/components/Summary/Summary.stories.tsx +46 -30
  44. package/src/components/Tags/Tags.test.tsx +71 -0
  45. package/src/components/Tags/{Tags.jsx → Tags.tsx} +9 -25
  46. package/src/components/Theme/EventView.jsx +4 -4
  47. package/src/components/Theme/NewsItemView.jsx +4 -4
  48. package/src/components/Theme/RenderBlocks.jsx +45 -37
  49. package/src/components/Theme/RenderBlocksV2.jsx +51 -20
  50. package/src/components/Widgets/ColorSwatch.stories.tsx +197 -0
  51. package/src/components/Widgets/ColorSwatch.test.tsx +188 -0
  52. package/src/components/Widgets/ColorSwatch.tsx +77 -39
  53. package/src/components/Widgets/SoftTextWidget.tsx +129 -0
  54. package/src/components/Widgets/SoftTextareaWidget.tsx +118 -0
  55. package/src/components/Widgets/ThemeColorSwatch.tsx +5 -9
  56. package/src/config/blocks.tsx +21 -29
  57. package/src/config/slots.ts +7 -0
  58. package/src/config/widgets.ts +5 -9
  59. package/src/customizations/volto/components/manage/DragDropList/DragDropList.jsx +263 -0
  60. package/src/customizations/volto/components/theme/LanguageSelector/LanguageSelector.tsx +10 -0
  61. package/src/helpers/styleDefinitions.test.tsx +30 -0
  62. package/src/helpers/styleDefinitions.ts +49 -0
  63. package/src/internalChecks.test.ts +94 -0
  64. package/src/primitives/Card/Card.stories.tsx +4 -1
  65. package/src/primitives/Card/Card.test.tsx +11 -33
  66. package/src/primitives/Card/Card.tsx +33 -43
  67. package/src/primitives/IconLinkList.tsx +53 -52
  68. package/src/theme/_bgcolor-blocks-layout.scss +43 -45
  69. package/src/theme/_content.scss +12 -13
  70. package/src/theme/_export_import.scss +94 -0
  71. package/src/theme/_footer.scss +64 -19
  72. package/src/theme/_header.scss +21 -4
  73. package/src/theme/_insets.scss +1 -1
  74. package/src/theme/_layout.scss +34 -15
  75. package/src/theme/_mobile-sticky-menu.scss +92 -0
  76. package/src/theme/_search-page.scss +249 -0
  77. package/src/theme/_typo-custom.scss +16 -5
  78. package/src/theme/_variables.scss +19 -4
  79. package/src/theme/_widgets.scss +15 -27
  80. package/src/theme/blocks/_accordion.scss +11 -4
  81. package/src/theme/blocks/_grid.scss +9 -77
  82. package/src/theme/blocks/_listing.scss +60 -126
  83. package/src/theme/blocks/_search.scss +3 -4
  84. package/src/theme/blocks/_table.scss +1 -0
  85. package/src/theme/blocks/_teaser.scss +7 -117
  86. package/src/theme/blocks/error-boundary.scss +11 -0
  87. package/src/theme/card.scss +107 -70
  88. package/src/theme/main.scss +5 -0
  89. package/src/theme/notfound.scss +27 -0
  90. package/src/theme/person.scss +28 -12
  91. package/src/theme/sticky-menu.scss +7 -5
  92. package/src/types.d.ts +1 -0
  93. package/vitest.config.mjs +4 -0
  94. package/razzle.extend.js +0 -38
  95. package/src/components/Blocks/schema.js +0 -44
  96. package/src/components/Breadcrumbs/Breadcrumbs.jsx +0 -118
  97. package/src/components/Widgets/AlignWidget.tsx +0 -84
  98. package/src/components/Widgets/BlockAlignment.tsx +0 -88
  99. package/src/components/Widgets/BlockWidth.tsx +0 -101
  100. package/src/components/Widgets/Buttons.tsx +0 -144
  101. package/src/components/Widgets/Size.tsx +0 -78
@@ -1,144 +0,0 @@
1
- import React from 'react';
2
- import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
3
- import Icon from '@plone/volto/components/theme/Icon/Icon';
4
- import { Button } from '@plone/components';
5
- import isEqual from 'lodash/isEqual';
6
- import type { StyleDefinition } from '@plone/types';
7
-
8
- /**
9
- * A tuple that has an icon in the first element and a i18n string in the second.
10
- */
11
- export type ActionInfo = [React.ReactElement<any>, string] | [string, string];
12
-
13
- type ActionValue = string | Record<`--${string}`, string>;
14
-
15
- export type ButtonsWidgetProps = {
16
- /**
17
- * Unique identifier for the widget.
18
- */
19
- id: string;
20
-
21
- /**
22
- * Callback function to handle changes.
23
- */
24
- onChange: (id: string, value: ActionValue) => void;
25
-
26
- /**
27
- * List of actions available for the widget.
28
- */
29
- actions?: Array<StyleDefinition | string>;
30
-
31
- /**
32
- * Map containing additional the information (icon and i18n string) for each action.
33
- */
34
- actionsInfoMap?: Record<string, ActionInfo>;
35
-
36
- /**
37
- * List of actions to be filtered out. In case that we don't want the default ones
38
- * we can filter them out.
39
- */
40
- filterActions?: string[];
41
-
42
- /**
43
- * Current value of the widget.
44
- */
45
- value?: ActionValue;
46
-
47
- /**
48
- * Default value of the widget.
49
- */
50
- default?: ActionValue;
51
-
52
- /**
53
- * Indicates if the widget is disabled.
54
- */
55
- disabled?: boolean;
56
-
57
- /**
58
- * Indicates if the widget is disabled (alternative flag for compatibility reasons).
59
- */
60
- isDisabled?: boolean;
61
- [key: string]: any;
62
- };
63
-
64
- type NormalizedAction = {
65
- name: string;
66
- value: ActionValue;
67
- };
68
-
69
- const ButtonsWidget = (props: ButtonsWidgetProps) => {
70
- const {
71
- disabled,
72
- id,
73
- onChange,
74
- actions = [],
75
- actionsInfoMap,
76
- value,
77
- isDisabled,
78
- default: defaultValue,
79
- } = props;
80
- const normalizedActions = React.useMemo<NormalizedAction[]>(
81
- () =>
82
- actions.map((action) =>
83
- typeof action === 'string'
84
- ? { name: action, value: action }
85
- : {
86
- name: action.name,
87
- value: action.style ?? action.name,
88
- },
89
- ),
90
- [actions],
91
- );
92
-
93
- React.useEffect(() => {
94
- if (!value && defaultValue) {
95
- const nextValue =
96
- typeof defaultValue === 'string'
97
- ? normalizedActions.find(({ name }) => name === defaultValue)
98
- ?.value ?? defaultValue
99
- : defaultValue;
100
-
101
- onChange(id, nextValue);
102
- }
103
- }, [defaultValue, id, normalizedActions, onChange, value]);
104
-
105
- return (
106
- <FormFieldWrapper {...props} className="widget">
107
- <div className="buttons buttons-widget">
108
- {normalizedActions.map((action) => {
109
- const actionInfo = actionsInfoMap?.[action.name];
110
- const [iconOrText, ariaLabel] = actionInfo ?? [
111
- action.name,
112
- action.name,
113
- ];
114
-
115
- return (
116
- <Button
117
- key={action.name}
118
- aria-label={ariaLabel}
119
- onPress={() => onChange(id, action.value)}
120
- className={
121
- isEqual(value, action.value)
122
- ? 'react-aria-Button active'
123
- : 'react-aria-Button'
124
- }
125
- isDisabled={disabled || isDisabled}
126
- >
127
- {typeof iconOrText === 'string' ? (
128
- <div className="image-sizes-text">{iconOrText}</div>
129
- ) : (
130
- <Icon
131
- name={iconOrText}
132
- title={ariaLabel || action.name}
133
- size="24px"
134
- />
135
- )}
136
- </Button>
137
- );
138
- })}
139
- </div>
140
- </FormFieldWrapper>
141
- );
142
- };
143
-
144
- export default ButtonsWidget;
@@ -1,78 +0,0 @@
1
- import { defineMessages, useIntl } from 'react-intl';
2
- import ButtonsWidget, {
3
- type ActionInfo,
4
- type ButtonsWidgetProps,
5
- } from './Buttons';
6
- import type { IntlShape } from 'react-intl';
7
- import type { StyleDefinition } from '@plone/types';
8
-
9
- const messages = defineMessages({
10
- s: {
11
- id: 'Small',
12
- defaultMessage: 'Small',
13
- },
14
- m: {
15
- id: 'Medium',
16
- defaultMessage: 'Medium',
17
- },
18
- l: {
19
- id: 'Large',
20
- defaultMessage: 'Large',
21
- },
22
- });
23
-
24
- export const defaultActionsInfo = ({
25
- intl,
26
- }: {
27
- intl: IntlShape;
28
- }): Record<string, ActionInfo> => ({
29
- s: ['S', intl.formatMessage(messages.s)],
30
- m: ['M', intl.formatMessage(messages.m)],
31
- l: ['L', intl.formatMessage(messages.l)],
32
- });
33
-
34
- const DEFAULT_ACTIONS: StyleDefinition[] = [
35
- {
36
- name: 's',
37
- label: 'Small',
38
- style: undefined,
39
- },
40
- {
41
- name: 'm',
42
- label: 'Medium',
43
- style: undefined,
44
- },
45
- {
46
- name: 'l',
47
- label: 'Large',
48
- style: undefined,
49
- },
50
- ];
51
-
52
- const SizeWidget = (props: ButtonsWidgetProps) => {
53
- const intl = useIntl();
54
-
55
- const { actions = DEFAULT_ACTIONS, actionsInfoMap, filterActions } = props;
56
- const filteredActions =
57
- filterActions && filterActions.length > 0
58
- ? actions.filter((action) => {
59
- const actionName = typeof action === 'string' ? action : action.name;
60
- return filterActions.includes(actionName);
61
- })
62
- : actions;
63
-
64
- const actionsInfo = {
65
- ...defaultActionsInfo({ intl }),
66
- ...actionsInfoMap,
67
- };
68
-
69
- return (
70
- <ButtonsWidget
71
- {...props}
72
- actions={filteredActions}
73
- actionsInfoMap={actionsInfo}
74
- />
75
- );
76
- };
77
-
78
- export default SizeWidget;