@prokodo/ui 0.0.52 → 0.0.53
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/README.md +81 -81
- package/dist/components/accordion/Accordion.client.js +3 -1
- package/dist/components/accordion/Accordion.view.js +100 -81
- package/dist/components/animated/Animated.server.js +3 -1
- package/dist/components/animatedText/AnimatedText.client.js +1 -7
- package/dist/components/animatedText/AnimatedText.view.js +4 -1
- package/dist/components/avatar/Avatar.view.js +2 -2
- package/dist/components/base-link/BaseLink.view.js +1 -1
- package/dist/components/button/Button.server.js +1 -8
- package/dist/components/calendly/Calendly.client.js +63 -54
- package/dist/components/calendly/Calendly.server.js +3 -1
- package/dist/components/card/Card.client.js +2 -1
- package/dist/components/card/Card.effects.client.js +5 -1
- package/dist/components/card/Card.view.js +19 -2
- package/dist/components/carousel/Carousel.client.js +36 -12
- package/dist/components/chip/Chip.view.js +10 -6
- package/dist/components/datePicker/DatePicker.client.js +53 -37
- package/dist/components/datePicker/DatePicker.view.js +3 -1
- package/dist/components/dialog/Dialog.client.js +22 -14
- package/dist/components/dialog/Dialog.view.js +10 -2
- package/dist/components/drawer/Drawer.client.js +10 -2
- package/dist/components/drawer/Drawer.effects.client.js +7 -2
- package/dist/components/dynamic-list/DynamicList.client.js +8 -7
- package/dist/components/dynamic-list/DynamicList.server.js +10 -4
- package/dist/components/dynamic-list/DynamicList.view.js +1 -1
- package/dist/components/form/Form.client.js +16 -13
- package/dist/components/form/Form.view.js +8 -4
- package/dist/components/form/FormField.client.js +5 -5
- package/dist/components/form/FormField.server.js +3 -23
- package/dist/components/form/FormResponse.js +5 -1
- package/dist/components/grid/Grid.js +7 -2
- package/dist/components/grid/GridRow.js +12 -2
- package/dist/components/headline/Headline.js +3 -1
- package/dist/components/icon/Icon.js +8 -4
- package/dist/components/image-text/ImageText.js +5 -1
- package/dist/components/input/Input.client.js +52 -28
- package/dist/components/input/Input.view.js +92 -68
- package/dist/components/inputOTP/InputOTP.js +107 -90
- package/dist/components/label/Label.js +1 -8
- package/dist/components/link/Link.view.js +3 -1
- package/dist/components/list/List.js +94 -42
- package/dist/components/loading/Loading.client.js +15 -2
- package/dist/components/loading/Loading.server.js +8 -1
- package/dist/components/loading/Loading.view.js +30 -7
- package/dist/components/post-item/PostItem.client.js +18 -0
- package/dist/components/post-item/PostItem.js +7 -136
- package/dist/components/post-item/PostItem.lazy.js +14 -0
- package/dist/components/post-item/PostItem.module.scss.js +3 -1
- package/dist/components/post-item/PostItem.server.js +15 -0
- package/dist/components/post-item/PostItem.view.js +238 -0
- package/dist/components/post-item/PostItemAuthor.js +28 -22
- package/dist/components/post-teaser/PostTeaser.client.js +31 -0
- package/dist/components/post-teaser/PostTeaser.js +9 -169
- package/dist/components/post-teaser/PostTeaser.lazy.js +13 -0
- package/dist/components/post-teaser/PostTeaser.module.scss.js +3 -0
- package/dist/components/post-teaser/PostTeaser.server.js +23 -0
- package/dist/components/post-teaser/PostTeaser.view.js +252 -0
- package/dist/components/post-widget/PostWidget.client.js +9 -0
- package/dist/components/post-widget/PostWidget.js +11 -156
- package/dist/components/post-widget/PostWidget.lazy.js +13 -0
- package/dist/components/post-widget/PostWidget.module.scss.js +1 -0
- package/dist/components/post-widget/PostWidget.server.js +11 -0
- package/dist/components/post-widget/PostWidget.view.js +263 -0
- package/dist/components/post-widget-carousel/PostWidgetCarousel.client.js +9 -0
- package/dist/components/post-widget-carousel/PostWidgetCarousel.js +9 -160
- package/dist/components/post-widget-carousel/PostWidgetCarousel.lazy.js +13 -0
- package/dist/components/post-widget-carousel/PostWidgetCarousel.module.scss.js +3 -0
- package/dist/components/post-widget-carousel/PostWidgetCarousel.server.js +11 -0
- package/dist/components/post-widget-carousel/PostWidgetCarousel.view.js +244 -0
- package/dist/components/rich-text/RichText.client.js +7 -2
- package/dist/components/select/Select.view.js +132 -116
- package/dist/components/sidenav/SideNav.client.js +19 -18
- package/dist/components/sidenav/SideNav.server.js +8 -1
- package/dist/components/sidenav/SideNav.view.js +21 -3
- package/dist/components/skeleton/Skeleton.effects.client.js +3 -1
- package/dist/components/slider/Slider.client.js +56 -38
- package/dist/components/slider/Slider.view.js +1 -7
- package/dist/components/snackbar/SnackbarProvider.client.js +21 -22
- package/dist/components/stepper/Stepper.client.js +1 -8
- package/dist/components/switch/Switch.client.js +1 -6
- package/dist/components/switch/Switch.server.js +1 -3
- package/dist/components/table/Table.js +3 -1
- package/dist/components/table/TableCell.js +13 -1
- package/dist/components/teaser/Teaser.js +1 -5
- package/dist/constants/project.js +1 -1
- package/dist/helpers/createIsland.js +3 -1
- package/dist/helpers/createLazyWrapper.js +3 -1
- package/dist/helpers/date.js +21 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/accordion/Accordion.model.d.ts +1 -1
- package/dist/types/components/animated/Animated.client.d.ts +2 -2
- package/dist/types/components/animated/Animated.model.d.ts +1 -1
- package/dist/types/components/button/Button.client.d.ts +1 -1
- package/dist/types/components/button/Button.d.ts +1 -1
- package/dist/types/components/button/Button.lazy.d.ts +1 -1
- package/dist/types/components/button/Button.server.d.ts +1 -1
- package/dist/types/components/button/Button.view.d.ts +1 -1
- package/dist/types/components/card/Card.effects.client.d.ts +1 -1
- package/dist/types/components/card/index.d.ts +1 -1
- package/dist/types/components/carousel/Carousel.d.ts +3 -0
- package/dist/types/components/carousel/Carousel.lazy.d.ts +3 -0
- package/dist/types/components/carousel/Carousel.model.d.ts +4 -0
- package/dist/types/components/dialog/Dialog.client.d.ts +1 -1
- package/dist/types/components/dialog/Dialog.model.d.ts +4 -4
- package/dist/types/components/dialog/Dialog.view.d.ts +2 -2
- package/dist/types/components/drawer/Drawer.client.d.ts +1 -1
- package/dist/types/components/drawer/Drawer.d.ts +1 -1
- package/dist/types/components/drawer/Drawer.effects.client.d.ts +1 -1
- package/dist/types/components/drawer/Drawer.lazy.d.ts +1 -1
- package/dist/types/components/drawer/Drawer.model.d.ts +6 -6
- package/dist/types/components/drawer/Drawer.server.d.ts +1 -1
- package/dist/types/components/drawer/Drawer.view.d.ts +2 -2
- package/dist/types/components/drawer/index.d.ts +1 -1
- package/dist/types/components/icon/IconList.d.ts +1 -1
- package/dist/types/components/icon/index.d.ts +1 -1
- package/dist/types/components/image/Image.model.d.ts +2 -2
- package/dist/types/components/link/Link.d.ts +1 -1
- package/dist/types/components/link/Link.model.d.ts +1 -1
- package/dist/types/components/link/Link.server.d.ts +1 -1
- package/dist/types/components/loading/index.d.ts +1 -1
- package/dist/types/components/post-item/PostItem.client.d.ts +4 -0
- package/dist/types/components/post-item/PostItem.d.ts +3 -2
- package/dist/types/components/post-item/PostItem.lazy.d.ts +5 -0
- package/dist/types/components/post-item/PostItem.model.d.ts +46 -6
- package/dist/types/components/post-item/PostItem.server.d.ts +3 -0
- package/dist/types/components/post-item/PostItem.view.d.ts +3 -0
- package/dist/types/components/post-item/PostItemAuthor.model.d.ts +5 -8
- package/dist/types/components/post-item/index.d.ts +2 -2
- package/dist/types/components/post-teaser/PostTeaser.client.d.ts +4 -0
- package/dist/types/components/post-teaser/PostTeaser.d.ts +3 -2
- package/dist/types/components/post-teaser/PostTeaser.lazy.d.ts +5 -0
- package/dist/types/components/post-teaser/PostTeaser.model.d.ts +49 -3
- package/dist/types/components/post-teaser/PostTeaser.server.d.ts +3 -0
- package/dist/types/components/post-teaser/PostTeaser.view.d.ts +3 -0
- package/dist/types/components/post-teaser/index.d.ts +1 -1
- package/dist/types/components/post-widget/PostWidget.client.d.ts +4 -0
- package/dist/types/components/post-widget/PostWidget.d.ts +13 -3
- package/dist/types/components/post-widget/PostWidget.lazy.d.ts +14 -0
- package/dist/types/components/post-widget/PostWidget.model.d.ts +53 -3
- package/dist/types/components/post-widget/PostWidget.server.d.ts +3 -0
- package/dist/types/components/post-widget/PostWidget.view.d.ts +3 -0
- package/dist/types/components/post-widget/index.d.ts +1 -1
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.client.d.ts +3 -0
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.d.ts +11 -3
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.lazy.d.ts +12 -0
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.model.d.ts +39 -0
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.server.d.ts +3 -0
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.view.d.ts +3 -0
- package/dist/types/components/post-widget-carousel/index.d.ts +1 -1
- package/dist/types/components/sidenav/index.d.ts +1 -1
- package/dist/types/components/skeleton/Skeleton.effects.client.d.ts +2 -2
- package/dist/types/helpers/createIsland.d.ts +1 -1
- package/dist/types/helpers/createLazyWrapper.d.ts +1 -1
- package/dist/types/helpers/date.d.ts +5 -0
- package/dist/ui.css +116 -35
- package/package.json +3 -2
|
@@ -1,172 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { Image } from "../image/Image.js";
|
|
11
|
-
import { Headline } from "../headline/Headline.js";
|
|
12
|
-
import { RichText } from "../rich-text/RichText.js";
|
|
13
|
-
const bem = create(styles, "PostTeaser");
|
|
14
|
-
const PostTeaser = memo(
|
|
15
|
-
({
|
|
16
|
-
className,
|
|
17
|
-
image,
|
|
18
|
-
readCount,
|
|
19
|
-
title,
|
|
20
|
-
date,
|
|
21
|
-
metaDate,
|
|
22
|
-
hideCategory,
|
|
23
|
-
category,
|
|
24
|
-
content,
|
|
25
|
-
onClick,
|
|
26
|
-
redirect,
|
|
27
|
-
...props
|
|
28
|
-
}) => {
|
|
29
|
-
var _a;
|
|
30
|
-
const wordCount = calculateWordCount(content);
|
|
31
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
32
|
-
const handleMouseEnter = useCallback(() => {
|
|
33
|
-
setIsHovered(true);
|
|
34
|
-
}, []);
|
|
35
|
-
const handleMouseLeave = useCallback(() => {
|
|
36
|
-
setIsHovered(false);
|
|
37
|
-
}, []);
|
|
38
|
-
return /* @__PURE__ */ jsxs(
|
|
39
|
-
"article",
|
|
40
|
-
{
|
|
41
|
-
itemScope: true,
|
|
42
|
-
className: bem(void 0, void 0, className),
|
|
43
|
-
itemType: "http://schema.org/BlogPosting",
|
|
44
|
-
children: [
|
|
45
|
-
/* @__PURE__ */ jsxs(
|
|
46
|
-
Card,
|
|
47
|
-
{
|
|
48
|
-
variant: "white",
|
|
49
|
-
...props,
|
|
50
|
-
className: bem("card__container"),
|
|
51
|
-
contentClassName: bem("card"),
|
|
52
|
-
highlight: isHovered,
|
|
53
|
-
redirect,
|
|
54
|
-
onClick,
|
|
55
|
-
onMouseEnter: handleMouseEnter,
|
|
56
|
-
onMouseLeave: handleMouseLeave,
|
|
57
|
-
children: [
|
|
58
|
-
/* @__PURE__ */ jsxs("header", { children: [
|
|
59
|
-
isString(image == null ? void 0 : image.src) && /* @__PURE__ */ jsxs("div", { className: bem("image__wrapper"), children: [
|
|
60
|
-
/* @__PURE__ */ jsxs("div", { className: bem("meta"), children: [
|
|
61
|
-
isString(category) && hideCategory === false && /* @__PURE__ */ jsx(
|
|
62
|
-
Chip,
|
|
63
|
-
{
|
|
64
|
-
"aria-label": `Category ${category}`,
|
|
65
|
-
className: bem("meta__category"),
|
|
66
|
-
color: "primary",
|
|
67
|
-
label: category
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
readCount !== void 0 && /* @__PURE__ */ jsx(
|
|
71
|
-
Chip,
|
|
72
|
-
{
|
|
73
|
-
"aria-label": `Read ${readCount} times`,
|
|
74
|
-
color: "white",
|
|
75
|
-
icon: /* @__PURE__ */ jsx(Icon, { name: "EyeIcon", size: "sm" }),
|
|
76
|
-
label: /* @__PURE__ */ jsxs(
|
|
77
|
-
"p",
|
|
78
|
-
{
|
|
79
|
-
itemScope: true,
|
|
80
|
-
itemProp: "interactionStatistic",
|
|
81
|
-
itemType: "https://schema.org/InteractionCounter",
|
|
82
|
-
children: [
|
|
83
|
-
/* @__PURE__ */ jsx(
|
|
84
|
-
"meta",
|
|
85
|
-
{
|
|
86
|
-
content: "https://schema.org/ReadAction",
|
|
87
|
-
itemProp: "interactionType"
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
/* @__PURE__ */ jsx("span", { itemProp: "userInteractionCount", children: readCount })
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
)
|
|
96
|
-
] }),
|
|
97
|
-
/* @__PURE__ */ jsx(
|
|
98
|
-
Image,
|
|
99
|
-
{
|
|
100
|
-
...image,
|
|
101
|
-
captionClassName: bem("image__caption"),
|
|
102
|
-
className: bem("image"),
|
|
103
|
-
containerClassName: bem("image")
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
] }),
|
|
107
|
-
/* @__PURE__ */ jsx(
|
|
108
|
-
Headline,
|
|
109
|
-
{
|
|
110
|
-
highlight: true,
|
|
111
|
-
size: "md",
|
|
112
|
-
type: "h3",
|
|
113
|
-
...title,
|
|
114
|
-
className: bem("headline", title == null ? void 0 : title.className),
|
|
115
|
-
variant: (title == null ? void 0 : title.variant) ?? "secondary",
|
|
116
|
-
children: title == null ? void 0 : title.content
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
] }),
|
|
120
|
-
isString(content) && /* @__PURE__ */ jsx("div", { className: bem("card__content"), itemProp: "articleBody", children: /* @__PURE__ */ jsx(RichText, { className: bem("content"), children: content }) }),
|
|
121
|
-
/* @__PURE__ */ jsxs("div", { className: bem("card__footer"), children: [
|
|
122
|
-
isString(date) && /* @__PURE__ */ jsx(
|
|
123
|
-
"p",
|
|
124
|
-
{
|
|
125
|
-
"aria-label": `Published at ${date}`,
|
|
126
|
-
className: bem("date"),
|
|
127
|
-
itemProp: "datePublished",
|
|
128
|
-
children: /* @__PURE__ */ jsx("time", { dateTime: metaDate, itemProp: "datePublished", children: date })
|
|
129
|
-
}
|
|
130
|
-
),
|
|
131
|
-
(redirect == null ? void 0 : redirect.label) !== void 0 && isString(redirect == null ? void 0 : redirect.label) && /* @__PURE__ */ jsxs(
|
|
132
|
-
"span",
|
|
133
|
-
{
|
|
134
|
-
className: bem("link", {
|
|
135
|
-
"is-hovered": isHovered
|
|
136
|
-
}),
|
|
137
|
-
children: [
|
|
138
|
-
/* @__PURE__ */ jsx(
|
|
139
|
-
Icon,
|
|
140
|
-
{
|
|
141
|
-
name: "ArrowRight01Icon",
|
|
142
|
-
size: "xs",
|
|
143
|
-
...redirect == null ? void 0 : redirect.icon,
|
|
144
|
-
color: "primary",
|
|
145
|
-
className: bem(
|
|
146
|
-
"link__icon",
|
|
147
|
-
{
|
|
148
|
-
"is-hovered": isHovered
|
|
149
|
-
},
|
|
150
|
-
(_a = redirect == null ? void 0 : redirect.icon) == null ? void 0 : _a.className
|
|
151
|
-
)
|
|
152
|
-
}
|
|
153
|
-
),
|
|
154
|
-
redirect.label
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
)
|
|
158
|
-
] })
|
|
159
|
-
]
|
|
160
|
-
}
|
|
161
|
-
),
|
|
162
|
-
wordCount > 0 && /* @__PURE__ */ jsx("meta", { content: String(wordCount), itemProp: "wordCount" }),
|
|
163
|
-
isString(category) && /* @__PURE__ */ jsx("meta", { content: category, itemProp: "articleSection" })
|
|
164
|
-
]
|
|
165
|
-
}
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
PostTeaser.displayName = "PostTeaser";
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { createIsland } from "../../helpers/createIsland.js";
|
|
4
|
+
import PostTeaserServer from "./PostTeaser.server.js";
|
|
5
|
+
const PostTeaser = createIsland({
|
|
6
|
+
name: "PostTeaser",
|
|
7
|
+
Server: PostTeaserServer,
|
|
8
|
+
loadLazy: /* @__PURE__ */ __name(() => import("./PostTeaser.lazy.js"), "loadLazy")
|
|
9
|
+
});
|
|
170
10
|
export {
|
|
171
11
|
PostTeaser
|
|
172
12
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createLazyWrapper } from "../../helpers/createLazyWrapper.js";
|
|
3
|
+
import PostTeaserClient from "./PostTeaser.client.js";
|
|
4
|
+
import PostTeaserServer from "./PostTeaser.server.js";
|
|
5
|
+
const PostTeaser_lazy = createLazyWrapper({
|
|
6
|
+
name: "PostTeaser",
|
|
7
|
+
Client: PostTeaserClient,
|
|
8
|
+
Server: PostTeaserServer,
|
|
9
|
+
hydrateOnVisible: true
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
PostTeaser_lazy as default
|
|
13
|
+
};
|
|
@@ -5,8 +5,11 @@ const styles = {
|
|
|
5
5
|
"prokodo-PostTeaser__card__footer": "prokodo-PostTeaser__card__footer",
|
|
6
6
|
"prokodo-PostTeaser__meta": "prokodo-PostTeaser__meta",
|
|
7
7
|
"prokodo-PostTeaser__meta__category": "prokodo-PostTeaser__meta__category",
|
|
8
|
+
"prokodo-PostTeaser__meta__readcount": "prokodo-PostTeaser__meta__readcount",
|
|
9
|
+
"prokodo-PostTeaser__meta__readcount__wrapper": "prokodo-PostTeaser__meta__readcount__wrapper",
|
|
8
10
|
"prokodo-PostTeaser__image": "prokodo-PostTeaser__image",
|
|
9
11
|
"prokodo-PostTeaser__image__wrapper": "prokodo-PostTeaser__image__wrapper",
|
|
12
|
+
"prokodo-PostTeaser__image__container": "prokodo-PostTeaser__image__container",
|
|
10
13
|
"prokodo-PostTeaser__image__caption": "prokodo-PostTeaser__image__caption",
|
|
11
14
|
"prokodo-PostTeaser__date": "prokodo-PostTeaser__date",
|
|
12
15
|
"prokodo-PostTeaser__animation": "prokodo-PostTeaser__animation",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { calculateWordCount } from "../../helpers/calculation.js";
|
|
5
|
+
import { PostTeaserView } from "./PostTeaser.view.js";
|
|
6
|
+
function PostTeaserServer(p) {
|
|
7
|
+
const { content, readingWpm = 200 } = p;
|
|
8
|
+
const wordCount = calculateWordCount(content);
|
|
9
|
+
const readMinutes = wordCount > 0 ? Math.max(1, Math.ceil(wordCount / readingWpm)) : 0;
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
PostTeaserView,
|
|
12
|
+
{
|
|
13
|
+
...p,
|
|
14
|
+
isHovered: false,
|
|
15
|
+
readMinutes,
|
|
16
|
+
wordCount
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
__name(PostTeaserServer, "PostTeaserServer");
|
|
21
|
+
export {
|
|
22
|
+
PostTeaserServer as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
|
+
import { isValidElement } from "react";
|
|
5
|
+
import { create } from "../../helpers/bem.js";
|
|
6
|
+
import { localizeDate } from "../../helpers/date.js";
|
|
7
|
+
import { isString } from "../../helpers/validations.js";
|
|
8
|
+
import styles from "./PostTeaser.module.scss.js";
|
|
9
|
+
import { Chip } from "../chip/Chip.js";
|
|
10
|
+
import { Card } from "../card/Card.js";
|
|
11
|
+
import { Icon } from "../icon/Icon.js";
|
|
12
|
+
import { Image } from "../image/Image.js";
|
|
13
|
+
import { Headline } from "../headline/Headline.js";
|
|
14
|
+
import { RichText } from "../rich-text/RichText.js";
|
|
15
|
+
const bem = create(styles, "PostTeaser");
|
|
16
|
+
function PostTeaserView(props) {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const {
|
|
19
|
+
locale,
|
|
20
|
+
className,
|
|
21
|
+
classes,
|
|
22
|
+
componentsProps,
|
|
23
|
+
image,
|
|
24
|
+
readCount,
|
|
25
|
+
title,
|
|
26
|
+
date,
|
|
27
|
+
hideCategory,
|
|
28
|
+
category,
|
|
29
|
+
content,
|
|
30
|
+
onClick,
|
|
31
|
+
redirect,
|
|
32
|
+
structuredData = true,
|
|
33
|
+
// private
|
|
34
|
+
isHovered,
|
|
35
|
+
wordCount,
|
|
36
|
+
readMinutes,
|
|
37
|
+
// passthrough hover
|
|
38
|
+
onMouseEnter,
|
|
39
|
+
onMouseLeave,
|
|
40
|
+
...cardRest
|
|
41
|
+
} = props;
|
|
42
|
+
const cardMerged = {
|
|
43
|
+
...componentsProps == null ? void 0 : componentsProps.card,
|
|
44
|
+
...cardRest,
|
|
45
|
+
variant: ((_a = componentsProps == null ? void 0 : componentsProps.card) == null ? void 0 : _a.variant) ?? (cardRest == null ? void 0 : cardRest.variant) ?? "white"
|
|
46
|
+
};
|
|
47
|
+
const baseImg = image;
|
|
48
|
+
const imageMerged = baseImg ? {
|
|
49
|
+
...baseImg,
|
|
50
|
+
// classes
|
|
51
|
+
captionClassName: bem("image__caption"),
|
|
52
|
+
className: bem("image", void 0, classes == null ? void 0 : classes.image),
|
|
53
|
+
containerClassName: bem(
|
|
54
|
+
"image__container",
|
|
55
|
+
void 0,
|
|
56
|
+
classes == null ? void 0 : classes.imageContainer
|
|
57
|
+
),
|
|
58
|
+
// perf defaults
|
|
59
|
+
decoding: baseImg.decoding ?? "async",
|
|
60
|
+
loading: baseImg.loading ?? "lazy",
|
|
61
|
+
sizes: baseImg.sizes ?? "(max-width: 960px) 100vw, 33vw",
|
|
62
|
+
// IMPORTANT: do not explicitly set imageComponent if it's falsy
|
|
63
|
+
...isValidElement(baseImg.imageComponent) ? { imageComponent: baseImg.imageComponent } : {}
|
|
64
|
+
} : void 0;
|
|
65
|
+
let formattedDate;
|
|
66
|
+
if (isString(date)) {
|
|
67
|
+
formattedDate = localizeDate(locale ?? "en-GB", date);
|
|
68
|
+
}
|
|
69
|
+
return /* @__PURE__ */ jsxs(
|
|
70
|
+
"article",
|
|
71
|
+
{
|
|
72
|
+
itemScope: true,
|
|
73
|
+
itemType: "https://schema.org/BlogPosting",
|
|
74
|
+
className: bem(
|
|
75
|
+
void 0,
|
|
76
|
+
void 0,
|
|
77
|
+
[className, classes == null ? void 0 : classes.root].filter(Boolean).join(" ")
|
|
78
|
+
),
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsxs(
|
|
81
|
+
Card,
|
|
82
|
+
{
|
|
83
|
+
...cardMerged,
|
|
84
|
+
className: bem("card__container"),
|
|
85
|
+
contentClassName: bem("card"),
|
|
86
|
+
highlight: Boolean(isHovered),
|
|
87
|
+
redirect,
|
|
88
|
+
onClick,
|
|
89
|
+
onMouseEnter,
|
|
90
|
+
onMouseLeave,
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsxs("header", { className: classes == null ? void 0 : classes.header, children: [
|
|
93
|
+
isString(image == null ? void 0 : image.src) && /* @__PURE__ */ jsxs(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
className: bem(
|
|
97
|
+
"image__wrapper",
|
|
98
|
+
void 0,
|
|
99
|
+
classes == null ? void 0 : classes.imageWrapper
|
|
100
|
+
),
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ jsxs("div", { className: bem("meta", void 0, classes == null ? void 0 : classes.meta), children: [
|
|
103
|
+
isString(category) && hideCategory === false && /* @__PURE__ */ jsx(
|
|
104
|
+
Chip,
|
|
105
|
+
{
|
|
106
|
+
"aria-label": `Category ${category}`,
|
|
107
|
+
color: "primary",
|
|
108
|
+
label: category,
|
|
109
|
+
className: bem(
|
|
110
|
+
"meta__category",
|
|
111
|
+
void 0,
|
|
112
|
+
classes == null ? void 0 : classes.metaCategory
|
|
113
|
+
),
|
|
114
|
+
...componentsProps == null ? void 0 : componentsProps.categoryChip
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
typeof readCount === "number" && /* @__PURE__ */ jsx(
|
|
118
|
+
Chip,
|
|
119
|
+
{
|
|
120
|
+
"aria-label": `Read ${readCount} times`,
|
|
121
|
+
className: bem("meta__readcount__wrapper"),
|
|
122
|
+
color: "white",
|
|
123
|
+
icon: /* @__PURE__ */ jsx(Icon, { name: "EyeIcon", size: "sm" }),
|
|
124
|
+
label: /* @__PURE__ */ jsxs(
|
|
125
|
+
"p",
|
|
126
|
+
{
|
|
127
|
+
itemScope: true,
|
|
128
|
+
className: bem("meta__readcount"),
|
|
129
|
+
itemProp: "interactionStatistic",
|
|
130
|
+
itemType: "https://schema.org/InteractionCounter",
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
"meta",
|
|
134
|
+
{
|
|
135
|
+
content: "https://schema.org/ReadAction",
|
|
136
|
+
itemProp: "interactionType"
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ jsx("span", { itemProp: "userInteractionCount", children: readCount })
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
...componentsProps == null ? void 0 : componentsProps.readCountChip
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
] }),
|
|
147
|
+
/* @__PURE__ */ jsx(Image, { ...imageMerged })
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ jsx(
|
|
152
|
+
Headline,
|
|
153
|
+
{
|
|
154
|
+
highlight: true,
|
|
155
|
+
size: "sm",
|
|
156
|
+
type: "h3",
|
|
157
|
+
...{ ...title, ...(componentsProps == null ? void 0 : componentsProps.headline) ?? {} },
|
|
158
|
+
className: bem(
|
|
159
|
+
"headline",
|
|
160
|
+
void 0,
|
|
161
|
+
[title == null ? void 0 : title.className, classes == null ? void 0 : classes.headline].filter(Boolean).join(" ")
|
|
162
|
+
),
|
|
163
|
+
variant: (title == null ? void 0 : title.variant) ?? ((_b = componentsProps == null ? void 0 : componentsProps.headline) == null ? void 0 : _b.variant) ?? "secondary",
|
|
164
|
+
children: title == null ? void 0 : title.content
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] }),
|
|
168
|
+
isString(content) && /* @__PURE__ */ jsx(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
className: bem("card__content", void 0, classes == null ? void 0 : classes.cardContent),
|
|
172
|
+
itemProp: "articleBody",
|
|
173
|
+
children: /* @__PURE__ */ jsx(RichText, { className: bem("content", void 0, classes == null ? void 0 : classes.content), children: content })
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ jsxs("div", { className: bem("card__footer", void 0, classes == null ? void 0 : classes.cardFooter), children: [
|
|
177
|
+
isString(formattedDate == null ? void 0 : formattedDate.locale) && /* @__PURE__ */ jsxs(
|
|
178
|
+
"p",
|
|
179
|
+
{
|
|
180
|
+
"aria-label": `Published at ${date}`,
|
|
181
|
+
className: bem("date", void 0, classes == null ? void 0 : classes.date),
|
|
182
|
+
itemProp: "datePublished",
|
|
183
|
+
children: [
|
|
184
|
+
/* @__PURE__ */ jsx("time", { dateTime: formattedDate == null ? void 0 : formattedDate.meta, itemProp: "datePublished", children: formattedDate == null ? void 0 : formattedDate.locale }),
|
|
185
|
+
readMinutes > 0 ? ` · ${readMinutes} min read` : null
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
isString(redirect == null ? void 0 : redirect.label) && /* @__PURE__ */ jsxs(
|
|
190
|
+
"span",
|
|
191
|
+
{
|
|
192
|
+
className: bem(
|
|
193
|
+
"link",
|
|
194
|
+
{ "is-hovered": Boolean(isHovered) },
|
|
195
|
+
classes == null ? void 0 : classes.link
|
|
196
|
+
),
|
|
197
|
+
children: [
|
|
198
|
+
/* @__PURE__ */ jsx(
|
|
199
|
+
Icon,
|
|
200
|
+
{
|
|
201
|
+
color: "primary",
|
|
202
|
+
name: "ArrowRight01Icon",
|
|
203
|
+
size: "xs",
|
|
204
|
+
className: bem(
|
|
205
|
+
"link__icon",
|
|
206
|
+
{ "is-hovered": Boolean(isHovered) },
|
|
207
|
+
classes == null ? void 0 : classes.linkIcon
|
|
208
|
+
),
|
|
209
|
+
...componentsProps == null ? void 0 : componentsProps.linkIcon,
|
|
210
|
+
...redirect == null ? void 0 : redirect.icon
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
redirect == null ? void 0 : redirect.label
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
] })
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
wordCount > 0 && /* @__PURE__ */ jsx("meta", { content: String(wordCount), itemProp: "wordCount" }),
|
|
222
|
+
isString(category) && /* @__PURE__ */ jsx("meta", { content: category, itemProp: "articleSection" }),
|
|
223
|
+
structuredData && /* @__PURE__ */ jsx(
|
|
224
|
+
"script",
|
|
225
|
+
{
|
|
226
|
+
type: "application/ld+json",
|
|
227
|
+
dangerouslySetInnerHTML: {
|
|
228
|
+
__html: JSON.stringify({
|
|
229
|
+
"@context": "https://schema.org",
|
|
230
|
+
"@type": "BlogPosting",
|
|
231
|
+
headline: title == null ? void 0 : title.content,
|
|
232
|
+
datePublished: isString(formattedDate == null ? void 0 : formattedDate.meta) ? formattedDate == null ? void 0 : formattedDate.meta : void 0,
|
|
233
|
+
articleSection: category,
|
|
234
|
+
wordCount,
|
|
235
|
+
interactionStatistic: typeof readCount === "number" ? {
|
|
236
|
+
"@type": "InteractionCounter",
|
|
237
|
+
interactionType: { "@type": "ReadAction" },
|
|
238
|
+
userInteractionCount: readCount
|
|
239
|
+
} : void 0,
|
|
240
|
+
image: isString(image == null ? void 0 : image.src) ? [image.src] : void 0
|
|
241
|
+
})
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
__name(PostTeaserView, "PostTeaserView");
|
|
250
|
+
export {
|
|
251
|
+
PostTeaserView
|
|
252
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { PostWidgetView } from "./PostWidget.view.js";
|
|
5
|
+
const PostWidgetClient = memo((props) => /* @__PURE__ */ jsx(PostWidgetView, { ...props }));
|
|
6
|
+
PostWidgetClient.displayName = "PostWidgetClient";
|
|
7
|
+
export {
|
|
8
|
+
PostWidgetClient as default
|
|
9
|
+
};
|
|
@@ -1,159 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
({
|
|
13
|
-
fullWidth,
|
|
14
|
-
className,
|
|
15
|
-
title,
|
|
16
|
-
listClassName,
|
|
17
|
-
contentClassName,
|
|
18
|
-
items = [],
|
|
19
|
-
...props
|
|
20
|
-
}) => /* @__PURE__ */ jsx(
|
|
21
|
-
"section",
|
|
22
|
-
{
|
|
23
|
-
itemScope: true,
|
|
24
|
-
className: bem(void 0, void 0, className),
|
|
25
|
-
itemType: "https://schema.org/ItemList",
|
|
26
|
-
children: /* @__PURE__ */ jsxs(
|
|
27
|
-
Card,
|
|
28
|
-
{
|
|
29
|
-
animated: true,
|
|
30
|
-
enableShadow: true,
|
|
31
|
-
...props,
|
|
32
|
-
className: bem("card__container"),
|
|
33
|
-
contentClassName: bem("card", void 0, contentClassName),
|
|
34
|
-
children: [
|
|
35
|
-
title && /* @__PURE__ */ jsx(
|
|
36
|
-
Headline,
|
|
37
|
-
{
|
|
38
|
-
highlight: true,
|
|
39
|
-
size: "md",
|
|
40
|
-
type: "h2",
|
|
41
|
-
...title,
|
|
42
|
-
className: bem("title", title == null ? void 0 : title.className),
|
|
43
|
-
itemProp: "headline",
|
|
44
|
-
variant: "secondary",
|
|
45
|
-
children: title == null ? void 0 : title.content
|
|
46
|
-
}
|
|
47
|
-
),
|
|
48
|
-
/* @__PURE__ */ jsx(
|
|
49
|
-
"ul",
|
|
50
|
-
{
|
|
51
|
-
className: bem(
|
|
52
|
-
"list",
|
|
53
|
-
{
|
|
54
|
-
"has-fullWidth": Boolean(fullWidth)
|
|
55
|
-
},
|
|
56
|
-
listClassName
|
|
57
|
-
),
|
|
58
|
-
children: items.map((item, i) => {
|
|
59
|
-
var _a, _b, _c, _d;
|
|
60
|
-
return /* @__PURE__ */ jsx(
|
|
61
|
-
"li",
|
|
62
|
-
{
|
|
63
|
-
itemScope: true,
|
|
64
|
-
itemProp: "itemListElement",
|
|
65
|
-
itemType: "https://schema.org/ListItem",
|
|
66
|
-
className: bem("list__item", {
|
|
67
|
-
"has-fullWidth": Boolean(fullWidth)
|
|
68
|
-
}),
|
|
69
|
-
children: /* @__PURE__ */ jsxs(
|
|
70
|
-
"article",
|
|
71
|
-
{
|
|
72
|
-
itemScope: true,
|
|
73
|
-
className: bem("list__item__content"),
|
|
74
|
-
itemType: "https://schema.org/BlogPosting",
|
|
75
|
-
children: [
|
|
76
|
-
(item == null ? void 0 : item.image) && /* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx(
|
|
77
|
-
Link,
|
|
78
|
-
{
|
|
79
|
-
...item == null ? void 0 : item.redirect,
|
|
80
|
-
"aria-label": `Read more about ${item.title.content}`,
|
|
81
|
-
className: bem(
|
|
82
|
-
"image__link",
|
|
83
|
-
void 0,
|
|
84
|
-
(_a = item == null ? void 0 : item.redirect) == null ? void 0 : _a.className
|
|
85
|
-
),
|
|
86
|
-
children: /* @__PURE__ */ jsx(
|
|
87
|
-
Image,
|
|
88
|
-
{
|
|
89
|
-
...item == null ? void 0 : item.image,
|
|
90
|
-
itemProp: "image",
|
|
91
|
-
className: bem(
|
|
92
|
-
"image",
|
|
93
|
-
void 0,
|
|
94
|
-
(_b = item == null ? void 0 : item.image) == null ? void 0 : _b.className
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
) }),
|
|
100
|
-
/* @__PURE__ */ jsxs("div", { className: bem("content"), children: [
|
|
101
|
-
/* @__PURE__ */ jsx(
|
|
102
|
-
Link,
|
|
103
|
-
{
|
|
104
|
-
...item == null ? void 0 : item.redirect,
|
|
105
|
-
"aria-label": `Read more about ${item.title.content}`,
|
|
106
|
-
children: /* @__PURE__ */ jsx(
|
|
107
|
-
Headline,
|
|
108
|
-
{
|
|
109
|
-
size: "sm",
|
|
110
|
-
type: "h3",
|
|
111
|
-
...item.title,
|
|
112
|
-
className: bem("headline", (_c = item.title) == null ? void 0 : _c.className),
|
|
113
|
-
itemProp: "headline",
|
|
114
|
-
variant: "inherit",
|
|
115
|
-
children: (_d = item.title) == null ? void 0 : _d.content
|
|
116
|
-
}
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
isString(item == null ? void 0 : item.date) && (item == null ? void 0 : item.date) !== "LL" && /* @__PURE__ */ jsx(
|
|
121
|
-
"p",
|
|
122
|
-
{
|
|
123
|
-
"aria-label": `Published at ${item.date}`,
|
|
124
|
-
className: bem("date"),
|
|
125
|
-
itemProp: "datePublished",
|
|
126
|
-
children: /* @__PURE__ */ jsx(
|
|
127
|
-
"time",
|
|
128
|
-
{
|
|
129
|
-
"aria-label": `Published at ${item.date}`,
|
|
130
|
-
className: bem("date"),
|
|
131
|
-
itemProp: "datePublished",
|
|
132
|
-
...item == null ? void 0 : item.dateProps,
|
|
133
|
-
children: item.date
|
|
134
|
-
}
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
)
|
|
138
|
-
] }),
|
|
139
|
-
/* @__PURE__ */ jsx("meta", { content: (i + 1).toString(), itemProp: "position" }),
|
|
140
|
-
isString(item == null ? void 0 : item.category) && /* @__PURE__ */ jsx("meta", { content: item.category, itemProp: "articleSection" })
|
|
141
|
-
]
|
|
142
|
-
}
|
|
143
|
-
)
|
|
144
|
-
},
|
|
145
|
-
`post-widget-item-${item.title}`
|
|
146
|
-
);
|
|
147
|
-
})
|
|
148
|
-
}
|
|
149
|
-
)
|
|
150
|
-
]
|
|
151
|
-
}
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
)
|
|
155
|
-
);
|
|
156
|
-
PostWidget.displayName = "PostWidget";
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { createIsland } from "../../helpers/createIsland.js";
|
|
4
|
+
import PostWidgetServer from "./PostWidget.server.js";
|
|
5
|
+
const PostWidget = createIsland({
|
|
6
|
+
name: "PostWidget",
|
|
7
|
+
Server: PostWidgetServer,
|
|
8
|
+
loadLazy: /* @__PURE__ */ __name(() => import("./PostWidget.lazy.js"), "loadLazy"),
|
|
9
|
+
// Only hydrate if the top-level Card gets interactive handlers
|
|
10
|
+
isInteractive: /* @__PURE__ */ __name((p) => typeof p.onClick === "function", "isInteractive")
|
|
11
|
+
});
|
|
157
12
|
export {
|
|
158
13
|
PostWidget
|
|
159
14
|
};
|