@kitconcept/volto-light-theme 6.0.0 → 7.0.0-alpha.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.
- package/.changelog.draft +10 -1
- package/CHANGELOG.md +17 -0
- package/package.json +2 -1
- package/src/components/Blocks/Teaser/DefaultBody.jsx +26 -39
- package/src/components/Card/Card.stories.tsx +251 -0
- package/src/components/Card/Card.tsx +143 -0
- package/src/components/Summary/DefaultSummary.tsx +24 -0
- package/src/components/Summary/{EventSummary.jsx → EventSummary.tsx} +5 -5
- package/src/components/Summary/{FileSummary.jsx → FileSummary.tsx} +4 -5
- package/src/components/Summary/{NewsItemSummary.jsx → NewsItemSummary.tsx} +5 -5
- package/src/components/Summary/Summary.stories.tsx +121 -0
- package/src/components/Widgets/ObjectList.tsx +2 -1
- package/src/stories/BlockWrapper.tsx +25 -0
- package/src/stories/grid.teaser.stories.tsx +156 -0
- package/src/stories/mocks.ts +504 -0
- package/src/stories/static/black-starry-night.jpg +0 -0
- package/src/stories/static/image-light.jpg +0 -0
- package/src/stories/teaser.stories.tsx +74 -0
- package/src/theme/_bgcolor-blocks-layout.scss +1 -1
- package/src/theme/_footer.scss +0 -1
- package/src/theme/_insets.scss +25 -0
- package/src/theme/_layout.scss +30 -1
- package/src/theme/blocks/_grid.scss +14 -1
- package/src/theme/blocks/_teaser.scss +15 -2
- package/src/theme/card.scss +168 -0
- package/src/theme/main.scss +2 -0
- package/src/components/Summary/DefaultSummary.jsx +0 -16
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import DefaultSummary from './DefaultSummary';
|
|
3
|
+
import { default as NewsItemSummaryComponent } from './NewsItemSummary';
|
|
4
|
+
import { default as EventSummaryComponent } from './EventSummary';
|
|
5
|
+
import { default as FileSummaryComponent } from './FileSummary';
|
|
6
|
+
|
|
7
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
8
|
+
import Wrapper from '@plone/volto/storybook';
|
|
9
|
+
|
|
10
|
+
const meta = {
|
|
11
|
+
title: 'Primitives/Summary',
|
|
12
|
+
component: DefaultSummary,
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: 'centered',
|
|
15
|
+
// backgrounds: { disable: true },
|
|
16
|
+
},
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
} satisfies Meta<typeof DefaultSummary>;
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
|
|
23
|
+
export const Summary: Story = {
|
|
24
|
+
render: (args) => (
|
|
25
|
+
<div style={{ width: '300px' }}>
|
|
26
|
+
<Wrapper>
|
|
27
|
+
<DefaultSummary {...args} />
|
|
28
|
+
</Wrapper>
|
|
29
|
+
</div>
|
|
30
|
+
),
|
|
31
|
+
args: {
|
|
32
|
+
item: {
|
|
33
|
+
title: 'Simple Card with strings',
|
|
34
|
+
description:
|
|
35
|
+
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea.',
|
|
36
|
+
head_title: 'Simple Card',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const SummaryHideDescription: Story = {
|
|
42
|
+
render: (args) => (
|
|
43
|
+
<div style={{ width: '300px' }}>
|
|
44
|
+
<Wrapper>
|
|
45
|
+
<DefaultSummary {...args} />
|
|
46
|
+
</Wrapper>
|
|
47
|
+
</div>
|
|
48
|
+
),
|
|
49
|
+
args: {
|
|
50
|
+
item: {
|
|
51
|
+
title: 'Simple Card with strings',
|
|
52
|
+
description:
|
|
53
|
+
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea.',
|
|
54
|
+
head_title: 'Simple Card',
|
|
55
|
+
},
|
|
56
|
+
hide_description: true,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const NewsItemSummary: Story = {
|
|
61
|
+
render: (args) => (
|
|
62
|
+
<div style={{ width: '300px' }}>
|
|
63
|
+
<Wrapper>
|
|
64
|
+
<NewsItemSummaryComponent {...args} />
|
|
65
|
+
</Wrapper>
|
|
66
|
+
</div>
|
|
67
|
+
),
|
|
68
|
+
args: {
|
|
69
|
+
item: {
|
|
70
|
+
title: 'Simple Card with strings',
|
|
71
|
+
description:
|
|
72
|
+
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea.',
|
|
73
|
+
head_title: 'Simple Card',
|
|
74
|
+
start: '2023-01-01T11:00:00+00:00',
|
|
75
|
+
end: '2023-12-31T12:00:00+00:00',
|
|
76
|
+
effective: '2023-07-06T18:35:00+00:00',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const EventSummary: Story = {
|
|
82
|
+
render: (args) => (
|
|
83
|
+
<div style={{ width: '300px' }}>
|
|
84
|
+
<Wrapper>
|
|
85
|
+
<EventSummaryComponent {...args} />
|
|
86
|
+
</Wrapper>
|
|
87
|
+
</div>
|
|
88
|
+
),
|
|
89
|
+
args: {
|
|
90
|
+
item: {
|
|
91
|
+
title: 'Simple Card with strings',
|
|
92
|
+
description:
|
|
93
|
+
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea.',
|
|
94
|
+
head_title: 'Simple Card',
|
|
95
|
+
start: '2023-01-01T11:00:00+00:00',
|
|
96
|
+
end: '2023-12-31T12:00:00+00:00',
|
|
97
|
+
effective: '2023-07-06T18:35:00+00:00',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const FileSummary: Story = {
|
|
103
|
+
render: (args) => (
|
|
104
|
+
<div style={{ width: '300px' }}>
|
|
105
|
+
<Wrapper>
|
|
106
|
+
<FileSummaryComponent {...args} />
|
|
107
|
+
</Wrapper>
|
|
108
|
+
</div>
|
|
109
|
+
),
|
|
110
|
+
args: {
|
|
111
|
+
item: {
|
|
112
|
+
title: 'Simple Card with strings',
|
|
113
|
+
description:
|
|
114
|
+
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea.',
|
|
115
|
+
head_title: 'Simple Card',
|
|
116
|
+
start: '2023-01-01T11:00:00+00:00',
|
|
117
|
+
end: '2023-12-31T12:00:00+00:00',
|
|
118
|
+
effective: '2023-07-06T18:35:00+00:00',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
};
|
|
@@ -176,7 +176,8 @@ const ObjectListWidget = (props: ObjectListWidgetProps) => {
|
|
|
176
176
|
setActiveObject(newIndex);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
const objectSchema =
|
|
179
|
+
const objectSchema =
|
|
180
|
+
typeof schema === 'function' ? schema({ ...props, activeObject }) : schema;
|
|
180
181
|
|
|
181
182
|
function handleDragEnd(event) {
|
|
182
183
|
const { active, over } = event;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import StyleWrapper from '@plone/volto/components/manage/Blocks/Block/StyleWrapper';
|
|
2
|
+
|
|
3
|
+
const BlockWrapper = (props) => {
|
|
4
|
+
const { block, data, isContainer } = props;
|
|
5
|
+
const content = props.content || {
|
|
6
|
+
blocks: {},
|
|
7
|
+
blocks_layout: {
|
|
8
|
+
items: [],
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<StyleWrapper
|
|
14
|
+
content={content}
|
|
15
|
+
id={block || 'block-1'}
|
|
16
|
+
block={block || 'block-1'}
|
|
17
|
+
data={data}
|
|
18
|
+
isContainer={isContainer}
|
|
19
|
+
>
|
|
20
|
+
{props.children}
|
|
21
|
+
</StyleWrapper>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default BlockWrapper;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import GridBlockView from '@plone/volto/components/manage/Blocks/Grid/View';
|
|
3
|
+
import {
|
|
4
|
+
gridBlockOne,
|
|
5
|
+
gridBlockTwo,
|
|
6
|
+
gridBlockThree,
|
|
7
|
+
gridBlockFour,
|
|
8
|
+
} from './mocks';
|
|
9
|
+
import Wrapper from '@plone/volto/storybook';
|
|
10
|
+
import BlockWrapper from './BlockWrapper';
|
|
11
|
+
|
|
12
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
13
|
+
|
|
14
|
+
const meta = {
|
|
15
|
+
title: 'Blocks/Grid Teaser',
|
|
16
|
+
component: GridBlockView,
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: 'centered',
|
|
19
|
+
},
|
|
20
|
+
tags: ['autodocs'],
|
|
21
|
+
} satisfies Meta<typeof GridBlockView>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
|
|
26
|
+
export const One: Story = {
|
|
27
|
+
render: (args) => (
|
|
28
|
+
<Wrapper>
|
|
29
|
+
<div style={{ width: 'var(--default-container-width)' }}>
|
|
30
|
+
<BlockWrapper {...args}>
|
|
31
|
+
<GridBlockView {...args} />
|
|
32
|
+
</BlockWrapper>
|
|
33
|
+
</div>
|
|
34
|
+
</Wrapper>
|
|
35
|
+
),
|
|
36
|
+
args: {
|
|
37
|
+
data: gridBlockOne,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Two: Story = {
|
|
42
|
+
render: (args) => (
|
|
43
|
+
<Wrapper>
|
|
44
|
+
<div style={{ width: 'var(--default-container-width)' }}>
|
|
45
|
+
<BlockWrapper {...args}>
|
|
46
|
+
<GridBlockView {...args} />
|
|
47
|
+
</BlockWrapper>
|
|
48
|
+
</div>
|
|
49
|
+
</Wrapper>
|
|
50
|
+
),
|
|
51
|
+
args: {
|
|
52
|
+
data: gridBlockTwo,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Three: Story = {
|
|
57
|
+
render: (args) => (
|
|
58
|
+
<Wrapper>
|
|
59
|
+
<div style={{ width: 'var(--default-container-width)' }}>
|
|
60
|
+
<BlockWrapper {...args}>
|
|
61
|
+
<GridBlockView {...args} />
|
|
62
|
+
</BlockWrapper>
|
|
63
|
+
</div>
|
|
64
|
+
</Wrapper>
|
|
65
|
+
),
|
|
66
|
+
args: {
|
|
67
|
+
data: gridBlockThree,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const Four: Story = {
|
|
72
|
+
render: (args) => (
|
|
73
|
+
<Wrapper>
|
|
74
|
+
<div style={{ width: 'var(--default-container-width)' }}>
|
|
75
|
+
<BlockWrapper {...args}>
|
|
76
|
+
<GridBlockView {...args} />
|
|
77
|
+
</BlockWrapper>
|
|
78
|
+
</div>
|
|
79
|
+
</Wrapper>
|
|
80
|
+
),
|
|
81
|
+
args: {
|
|
82
|
+
data: gridBlockFour,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const OneInversed: Story = {
|
|
87
|
+
parameters: {
|
|
88
|
+
layout: 'fullscreen',
|
|
89
|
+
},
|
|
90
|
+
render: (args) => (
|
|
91
|
+
<Wrapper>
|
|
92
|
+
<div style={{ padding: '40px', backgroundColor: '#ecebeb' }}>
|
|
93
|
+
<BlockWrapper {...args}>
|
|
94
|
+
<GridBlockView {...args} />
|
|
95
|
+
</BlockWrapper>
|
|
96
|
+
</div>
|
|
97
|
+
</Wrapper>
|
|
98
|
+
),
|
|
99
|
+
args: {
|
|
100
|
+
data: { ...gridBlockOne, theme: 'grey' },
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const TwoInversed: Story = {
|
|
105
|
+
parameters: {
|
|
106
|
+
layout: 'fullscreen',
|
|
107
|
+
},
|
|
108
|
+
render: (args) => (
|
|
109
|
+
<Wrapper>
|
|
110
|
+
<div style={{ padding: '40px', backgroundColor: '#ecebeb' }}>
|
|
111
|
+
<BlockWrapper {...args}>
|
|
112
|
+
<GridBlockView {...args} />
|
|
113
|
+
</BlockWrapper>
|
|
114
|
+
</div>
|
|
115
|
+
</Wrapper>
|
|
116
|
+
),
|
|
117
|
+
args: {
|
|
118
|
+
data: { ...gridBlockTwo, theme: 'grey' },
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const ThreeInversed: Story = {
|
|
123
|
+
parameters: {
|
|
124
|
+
layout: 'fullscreen',
|
|
125
|
+
},
|
|
126
|
+
render: (args) => (
|
|
127
|
+
<Wrapper>
|
|
128
|
+
<div style={{ padding: '40px', backgroundColor: '#ecebeb' }}>
|
|
129
|
+
<BlockWrapper {...args}>
|
|
130
|
+
<GridBlockView {...args} />
|
|
131
|
+
</BlockWrapper>
|
|
132
|
+
</div>
|
|
133
|
+
</Wrapper>
|
|
134
|
+
),
|
|
135
|
+
args: {
|
|
136
|
+
data: { ...gridBlockThree, theme: 'grey' },
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const FourInversed: Story = {
|
|
141
|
+
parameters: {
|
|
142
|
+
layout: 'fullscreen',
|
|
143
|
+
},
|
|
144
|
+
render: (args) => (
|
|
145
|
+
<Wrapper>
|
|
146
|
+
<div style={{ padding: '40px', backgroundColor: '#ecebeb' }}>
|
|
147
|
+
<BlockWrapper {...args}>
|
|
148
|
+
<GridBlockView {...args} />
|
|
149
|
+
</BlockWrapper>
|
|
150
|
+
</div>
|
|
151
|
+
</Wrapper>
|
|
152
|
+
),
|
|
153
|
+
args: {
|
|
154
|
+
data: { ...gridBlockFour, theme: 'grey' },
|
|
155
|
+
},
|
|
156
|
+
};
|