@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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createLazyWrapper } from "../../helpers/createLazyWrapper.js";
|
|
3
|
+
import PostWidgetClient from "./PostWidget.client.js";
|
|
4
|
+
import PostWidgetServer from "./PostWidget.server.js";
|
|
5
|
+
const PostWidget_lazy = createLazyWrapper({
|
|
6
|
+
name: "PostWidget",
|
|
7
|
+
Client: PostWidgetClient,
|
|
8
|
+
Server: PostWidgetServer,
|
|
9
|
+
hydrateOnVisible: true
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
PostWidget_lazy as default
|
|
13
|
+
};
|
|
@@ -6,6 +6,7 @@ const styles = {
|
|
|
6
6
|
"prokodo-PostWidget__list__item__content": "prokodo-PostWidget__list__item__content",
|
|
7
7
|
"prokodo-PostWidget__image": "prokodo-PostWidget__image",
|
|
8
8
|
"prokodo-PostWidget__image__link": "prokodo-PostWidget__image__link",
|
|
9
|
+
"prokodo-PostWidget__image__container": "prokodo-PostWidget__image__container",
|
|
9
10
|
"prokodo-PostWidget__content": "prokodo-PostWidget__content",
|
|
10
11
|
"prokodo-PostWidget__headline": "prokodo-PostWidget__headline",
|
|
11
12
|
"prokodo-PostWidget__date": "prokodo-PostWidget__date"
|
|
@@ -0,0 +1,11 @@
|
|
|
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 { PostWidgetView } from "./PostWidget.view.js";
|
|
5
|
+
function PostWidgetServer(p) {
|
|
6
|
+
return /* @__PURE__ */ jsx(PostWidgetView, { ...p });
|
|
7
|
+
}
|
|
8
|
+
__name(PostWidgetServer, "PostWidgetServer");
|
|
9
|
+
export {
|
|
10
|
+
PostWidgetServer as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,263 @@
|
|
|
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 "./PostWidget.module.scss.js";
|
|
9
|
+
import { Card } from "../card/Card.js";
|
|
10
|
+
import { Headline } from "../headline/Headline.js";
|
|
11
|
+
import { Link } from "../link/Link.js";
|
|
12
|
+
import { Image } from "../image/Image.js";
|
|
13
|
+
const bem = create(styles, "PostWidget");
|
|
14
|
+
function PostWidgetView({
|
|
15
|
+
fullWidth,
|
|
16
|
+
className,
|
|
17
|
+
title,
|
|
18
|
+
listClassName,
|
|
19
|
+
// legacy
|
|
20
|
+
contentClassName,
|
|
21
|
+
// legacy
|
|
22
|
+
items = [],
|
|
23
|
+
classes,
|
|
24
|
+
componentsProps,
|
|
25
|
+
structuredData = true,
|
|
26
|
+
...rest
|
|
27
|
+
}) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
const cardMerged = {
|
|
30
|
+
animated: true,
|
|
31
|
+
enableShadow: true,
|
|
32
|
+
...componentsProps == null ? void 0 : componentsProps.card,
|
|
33
|
+
...rest,
|
|
34
|
+
variant: ((_a = componentsProps == null ? void 0 : componentsProps.card) == null ? void 0 : _a.variant) ?? (rest == null ? void 0 : rest.variant) ?? void 0
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
37
|
+
"section",
|
|
38
|
+
{
|
|
39
|
+
itemScope: true,
|
|
40
|
+
className: bem(
|
|
41
|
+
void 0,
|
|
42
|
+
void 0,
|
|
43
|
+
[className, classes == null ? void 0 : classes.root].filter(Boolean).join(" ")
|
|
44
|
+
),
|
|
45
|
+
itemType: "https://schema.org/ItemList\n",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsxs(
|
|
48
|
+
Card,
|
|
49
|
+
{
|
|
50
|
+
...cardMerged,
|
|
51
|
+
className: bem("card__container", void 0, classes == null ? void 0 : classes.cardContainer),
|
|
52
|
+
contentClassName: bem(
|
|
53
|
+
"card",
|
|
54
|
+
void 0,
|
|
55
|
+
[contentClassName, classes == null ? void 0 : classes.card].filter(Boolean).join(" ")
|
|
56
|
+
),
|
|
57
|
+
children: [
|
|
58
|
+
title && /* @__PURE__ */ jsx(
|
|
59
|
+
Headline,
|
|
60
|
+
{
|
|
61
|
+
highlight: true,
|
|
62
|
+
size: "md",
|
|
63
|
+
type: "h2",
|
|
64
|
+
...{ ...title, ...(componentsProps == null ? void 0 : componentsProps.title) ?? {} },
|
|
65
|
+
itemProp: "headline",
|
|
66
|
+
className: bem(
|
|
67
|
+
"title",
|
|
68
|
+
void 0,
|
|
69
|
+
[title == null ? void 0 : title.className, classes == null ? void 0 : classes.title].filter(Boolean).join(" ")
|
|
70
|
+
),
|
|
71
|
+
variant: (title == null ? void 0 : title.variant) ?? ((_b = componentsProps == null ? void 0 : componentsProps.title) == null ? void 0 : _b.variant) ?? "secondary",
|
|
72
|
+
children: title == null ? void 0 : title.content
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsx(
|
|
76
|
+
"ul",
|
|
77
|
+
{
|
|
78
|
+
className: bem(
|
|
79
|
+
"list",
|
|
80
|
+
{ "has-fullWidth": Boolean(fullWidth) },
|
|
81
|
+
[listClassName, classes == null ? void 0 : classes.list].filter(Boolean).join(" ")
|
|
82
|
+
),
|
|
83
|
+
children: items.map((item, i) => {
|
|
84
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
85
|
+
const imgBase = item.image;
|
|
86
|
+
const imgMerged = imgBase ? {
|
|
87
|
+
...imgBase,
|
|
88
|
+
...(componentsProps == null ? void 0 : componentsProps.image) ?? {},
|
|
89
|
+
...((_a2 = item.componentsProps) == null ? void 0 : _a2.image) ?? {},
|
|
90
|
+
className: bem(
|
|
91
|
+
"image",
|
|
92
|
+
void 0,
|
|
93
|
+
[imgBase.className, classes == null ? void 0 : classes.image, (_b2 = item.classes) == null ? void 0 : _b2.image].filter(Boolean).join(" ")
|
|
94
|
+
),
|
|
95
|
+
containerClassName: bem(
|
|
96
|
+
"image__container",
|
|
97
|
+
void 0,
|
|
98
|
+
classes == null ? void 0 : classes.imageContainer
|
|
99
|
+
),
|
|
100
|
+
decoding: ((_d = (_c = item.componentsProps) == null ? void 0 : _c.image) == null ? void 0 : _d.decoding) ?? ((_e = componentsProps == null ? void 0 : componentsProps.image) == null ? void 0 : _e.decoding) ?? imgBase.decoding ?? "async",
|
|
101
|
+
loading: ((_g = (_f = item.componentsProps) == null ? void 0 : _f.image) == null ? void 0 : _g.loading) ?? ((_h = componentsProps == null ? void 0 : componentsProps.image) == null ? void 0 : _h.loading) ?? imgBase.loading ?? "lazy",
|
|
102
|
+
sizes: ((_j = (_i = item.componentsProps) == null ? void 0 : _i.image) == null ? void 0 : _j.sizes) ?? ((_k = componentsProps == null ? void 0 : componentsProps.image) == null ? void 0 : _k.sizes) ?? imgBase.sizes ?? "(max-width: 960px) 100vw, 20vw",
|
|
103
|
+
...isValidElement(imgBase == null ? void 0 : imgBase.imageComponent) ? { imageComponent: imgBase.imageComponent } : {}
|
|
104
|
+
} : void 0;
|
|
105
|
+
const linkMerged = {
|
|
106
|
+
...(componentsProps == null ? void 0 : componentsProps.link) ?? {},
|
|
107
|
+
...((_l = item.componentsProps) == null ? void 0 : _l.link) ?? {},
|
|
108
|
+
...item.redirect,
|
|
109
|
+
className: bem(
|
|
110
|
+
"image__link",
|
|
111
|
+
void 0,
|
|
112
|
+
[
|
|
113
|
+
(_m = item.redirect) == null ? void 0 : _m.className,
|
|
114
|
+
classes == null ? void 0 : classes.imageLink,
|
|
115
|
+
(_n = item.classes) == null ? void 0 : _n.imageLink
|
|
116
|
+
].filter(Boolean).join(" ")
|
|
117
|
+
),
|
|
118
|
+
"aria-label": `Read more about ${item.title.content}`
|
|
119
|
+
};
|
|
120
|
+
const headlineMerged = {
|
|
121
|
+
size: "sm",
|
|
122
|
+
type: "h3",
|
|
123
|
+
variant: "inherit",
|
|
124
|
+
...item.title ?? {},
|
|
125
|
+
...(componentsProps == null ? void 0 : componentsProps.title) ?? {},
|
|
126
|
+
...((_o = item.componentsProps) == null ? void 0 : _o.headline) ?? {},
|
|
127
|
+
className: bem(
|
|
128
|
+
"headline",
|
|
129
|
+
void 0,
|
|
130
|
+
[
|
|
131
|
+
(_p = item.title) == null ? void 0 : _p.className,
|
|
132
|
+
classes == null ? void 0 : classes.headline,
|
|
133
|
+
(_q = item.classes) == null ? void 0 : _q.headline
|
|
134
|
+
].filter(Boolean).join(" ")
|
|
135
|
+
)
|
|
136
|
+
};
|
|
137
|
+
let formattedDate;
|
|
138
|
+
if (isString(item == null ? void 0 : item.date)) {
|
|
139
|
+
formattedDate = localizeDate((item == null ? void 0 : item.locale) ?? "en-GB", item == null ? void 0 : item.date);
|
|
140
|
+
}
|
|
141
|
+
return /* @__PURE__ */ jsx(
|
|
142
|
+
"li",
|
|
143
|
+
{
|
|
144
|
+
itemScope: true,
|
|
145
|
+
itemProp: "itemListElement",
|
|
146
|
+
itemType: "https://schema.org/ListItem",
|
|
147
|
+
className: bem(
|
|
148
|
+
"list__item",
|
|
149
|
+
{ "has-fullWidth": Boolean(fullWidth) },
|
|
150
|
+
[classes == null ? void 0 : classes.listItem, (_r = item.classes) == null ? void 0 : _r.li].filter(Boolean).join(" ")
|
|
151
|
+
),
|
|
152
|
+
children: /* @__PURE__ */ jsxs(
|
|
153
|
+
"article",
|
|
154
|
+
{
|
|
155
|
+
itemScope: true,
|
|
156
|
+
itemType: "https://schema.org/BlogPosting",
|
|
157
|
+
className: bem(
|
|
158
|
+
"list__item__content",
|
|
159
|
+
void 0,
|
|
160
|
+
((_s = item.classes) == null ? void 0 : _s.article) ?? (classes == null ? void 0 : classes.listItemContent)
|
|
161
|
+
),
|
|
162
|
+
children: [
|
|
163
|
+
imgMerged && /* @__PURE__ */ jsx("header", { className: (_t = item.classes) == null ? void 0 : _t.header, children: /* @__PURE__ */ jsx(Link, { ...linkMerged, children: /* @__PURE__ */ jsx(Image, { ...imgMerged, itemProp: "image" }) }) }),
|
|
164
|
+
/* @__PURE__ */ jsxs(
|
|
165
|
+
"div",
|
|
166
|
+
{
|
|
167
|
+
className: bem(
|
|
168
|
+
"content",
|
|
169
|
+
void 0,
|
|
170
|
+
[classes == null ? void 0 : classes.content, (_u = item.classes) == null ? void 0 : _u.content].filter(Boolean).join(" ")
|
|
171
|
+
),
|
|
172
|
+
children: [
|
|
173
|
+
/* @__PURE__ */ jsx(
|
|
174
|
+
Link,
|
|
175
|
+
{
|
|
176
|
+
...(componentsProps == null ? void 0 : componentsProps.link) ?? {},
|
|
177
|
+
...((_v = item.componentsProps) == null ? void 0 : _v.link) ?? {},
|
|
178
|
+
...item.redirect,
|
|
179
|
+
"aria-label": `Read more about ${item.title.content}`,
|
|
180
|
+
children: /* @__PURE__ */ jsx(Headline, { ...headlineMerged, itemProp: "headline", children: (_w = item.title) == null ? void 0 : _w.content })
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
isString(formattedDate == null ? void 0 : formattedDate.locale) && /* @__PURE__ */ jsx(
|
|
184
|
+
"p",
|
|
185
|
+
{
|
|
186
|
+
"aria-label": `Published at ${formattedDate == null ? void 0 : formattedDate.locale}`,
|
|
187
|
+
className: bem(
|
|
188
|
+
"date",
|
|
189
|
+
void 0,
|
|
190
|
+
[classes == null ? void 0 : classes.date, (_x = item.classes) == null ? void 0 : _x.date].filter(Boolean).join(" ")
|
|
191
|
+
),
|
|
192
|
+
children: /* @__PURE__ */ jsx(
|
|
193
|
+
"time",
|
|
194
|
+
{
|
|
195
|
+
"aria-label": `Published at ${formattedDate == null ? void 0 : formattedDate.locale}`,
|
|
196
|
+
className: bem("date"),
|
|
197
|
+
itemProp: "datePublished",
|
|
198
|
+
...item == null ? void 0 : item.dateProps,
|
|
199
|
+
children: formattedDate == null ? void 0 : formattedDate.meta
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
}
|
|
203
|
+
)
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
/* @__PURE__ */ jsx("meta", { content: (i + 1).toString(), itemProp: "position" }),
|
|
208
|
+
isString(item == null ? void 0 : item.category) && /* @__PURE__ */ jsx("meta", { content: item.category, itemProp: "articleSection" })
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
},
|
|
213
|
+
`post-widget-item-${((_y = item.title) == null ? void 0 : _y.content) ?? i}`
|
|
214
|
+
);
|
|
215
|
+
})
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
structuredData && /* @__PURE__ */ jsx(
|
|
222
|
+
"script",
|
|
223
|
+
{
|
|
224
|
+
type: "application/ld+json",
|
|
225
|
+
dangerouslySetInnerHTML: {
|
|
226
|
+
__html: JSON.stringify({
|
|
227
|
+
"@context": "https://schema.org",
|
|
228
|
+
"@type": "ItemList",
|
|
229
|
+
itemListElement: items.map((item, index) => {
|
|
230
|
+
var _a2, _b2;
|
|
231
|
+
let formattedDate;
|
|
232
|
+
if (isString(item == null ? void 0 : item.date)) {
|
|
233
|
+
formattedDate = localizeDate(
|
|
234
|
+
(item == null ? void 0 : item.locale) ?? "en-GB",
|
|
235
|
+
item == null ? void 0 : item.date
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
"@type": "ListItem",
|
|
240
|
+
position: index + 1,
|
|
241
|
+
item: {
|
|
242
|
+
"@type": "BlogPosting",
|
|
243
|
+
headline: (_a2 = item.title) == null ? void 0 : _a2.content,
|
|
244
|
+
datePublished: isString(formattedDate == null ? void 0 : formattedDate.meta) ? formattedDate == null ? void 0 : formattedDate.meta : void 0,
|
|
245
|
+
articleSection: item.category,
|
|
246
|
+
image: isString(
|
|
247
|
+
(_b2 = item.image) == null ? void 0 : _b2.src
|
|
248
|
+
) ? [item.image.src] : void 0
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
})
|
|
252
|
+
})
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
__name(PostWidgetView, "PostWidgetView");
|
|
261
|
+
export {
|
|
262
|
+
PostWidgetView
|
|
263
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { PostWidgetCarouselView } from "./PostWidgetCarousel.view.js";
|
|
5
|
+
const PostWidgetCarouselClient = memo((props) => /* @__PURE__ */ jsx(PostWidgetCarouselView, { ...props }));
|
|
6
|
+
PostWidgetCarouselClient.displayName = "PostWidgetCarouselClient";
|
|
7
|
+
export {
|
|
8
|
+
PostWidgetCarouselClient as default
|
|
9
|
+
};
|
|
@@ -1,165 +1,14 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { Image } from "../image/Image.js";
|
|
13
|
-
const bem = create(styles, "PostWidgetCarousel");
|
|
14
|
-
const PostWidgetCarousel = memo(
|
|
15
|
-
({ autoplay, className, title, items = [], ...props }) => {
|
|
16
|
-
const ref = useRef(null);
|
|
17
|
-
const [carouselWidth, setCarouselWidth] = useState(0);
|
|
18
|
-
useLayoutEffect(() => {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
const containerWidth = ((_b = (_a = ref == null ? void 0 : ref.current) == null ? void 0 : _a.carouselContainer) == null ? void 0 : _b.offsetWidth) ?? 0;
|
|
21
|
-
setCarouselWidth(containerWidth);
|
|
22
|
-
const handleResize = /* @__PURE__ */ __name(() => {
|
|
23
|
-
setCarouselWidth(containerWidth);
|
|
24
|
-
}, "handleResize");
|
|
25
|
-
window.addEventListener("resize", handleResize);
|
|
26
|
-
return () => {
|
|
27
|
-
window.removeEventListener("resize", handleResize);
|
|
28
|
-
};
|
|
29
|
-
}, [ref]);
|
|
30
|
-
return /* @__PURE__ */ jsx(
|
|
31
|
-
"section",
|
|
32
|
-
{
|
|
33
|
-
itemScope: true,
|
|
34
|
-
className: bem(void 0, void 0, className),
|
|
35
|
-
itemType: "https://schema.org/ItemList",
|
|
36
|
-
children: /* @__PURE__ */ jsxs(
|
|
37
|
-
Card,
|
|
38
|
-
{
|
|
39
|
-
animated: true,
|
|
40
|
-
enableShadow: true,
|
|
41
|
-
...props,
|
|
42
|
-
className: bem("card__container"),
|
|
43
|
-
contentClassName: bem("card"),
|
|
44
|
-
variant: "white",
|
|
45
|
-
children: [
|
|
46
|
-
title && /* @__PURE__ */ jsx(
|
|
47
|
-
Headline,
|
|
48
|
-
{
|
|
49
|
-
highlight: true,
|
|
50
|
-
size: "md",
|
|
51
|
-
type: "h2",
|
|
52
|
-
...title,
|
|
53
|
-
className: bem("title", title == null ? void 0 : title.className),
|
|
54
|
-
itemProp: "headline",
|
|
55
|
-
variant: "secondary",
|
|
56
|
-
children: title == null ? void 0 : title.content
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
items.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
-
/* @__PURE__ */ jsx(
|
|
61
|
-
Carousel,
|
|
62
|
-
{
|
|
63
|
-
ref,
|
|
64
|
-
autoplay,
|
|
65
|
-
className: bem("carousel"),
|
|
66
|
-
classNameDots: bem("carousel__dots"),
|
|
67
|
-
classNameItem: bem("carousel__item"),
|
|
68
|
-
itemsToShow: 1,
|
|
69
|
-
children: items.map((item) => {
|
|
70
|
-
var _a, _b, _c;
|
|
71
|
-
const key = `carousel-item-${item.title}`;
|
|
72
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73
|
-
(item == null ? void 0 : item.image) && /* @__PURE__ */ jsx(
|
|
74
|
-
Link,
|
|
75
|
-
{
|
|
76
|
-
"aria-label": `Read more about ${item.title.content}`,
|
|
77
|
-
...item == null ? void 0 : item.redirect,
|
|
78
|
-
className: bem(
|
|
79
|
-
"carousel__item__image__link",
|
|
80
|
-
void 0,
|
|
81
|
-
(_a = item == null ? void 0 : item.redirect) == null ? void 0 : _a.className
|
|
82
|
-
),
|
|
83
|
-
style: {
|
|
84
|
-
width: carouselWidth
|
|
85
|
-
},
|
|
86
|
-
children: /* @__PURE__ */ jsx(
|
|
87
|
-
Image,
|
|
88
|
-
{
|
|
89
|
-
className: bem("carousel__item__image"),
|
|
90
|
-
...item.image
|
|
91
|
-
},
|
|
92
|
-
key
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
),
|
|
96
|
-
/* @__PURE__ */ jsx(
|
|
97
|
-
Link,
|
|
98
|
-
{
|
|
99
|
-
...item == null ? void 0 : item.redirect,
|
|
100
|
-
"aria-label": `Read more about ${item.title.content}`,
|
|
101
|
-
className: bem("carousel__item__link"),
|
|
102
|
-
children: /* @__PURE__ */ jsx(
|
|
103
|
-
Headline,
|
|
104
|
-
{
|
|
105
|
-
size: "md",
|
|
106
|
-
type: "h3",
|
|
107
|
-
...item.title,
|
|
108
|
-
className: bem("headline", (_b = item.title) == null ? void 0 : _b.className),
|
|
109
|
-
itemProp: "headline",
|
|
110
|
-
variant: "inherit",
|
|
111
|
-
children: (_c = item.title) == null ? void 0 : _c.content
|
|
112
|
-
}
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
)
|
|
116
|
-
] }, key);
|
|
117
|
-
})
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
/* @__PURE__ */ jsxs("div", { className: bem("carousel__buttons"), children: [
|
|
121
|
-
/* @__PURE__ */ jsx(
|
|
122
|
-
Button,
|
|
123
|
-
{
|
|
124
|
-
"aria-label": "Last category",
|
|
125
|
-
className: bem("carousel__button"),
|
|
126
|
-
color: "primary",
|
|
127
|
-
iconProps: {
|
|
128
|
-
name: "ArrowLeft01Icon",
|
|
129
|
-
size: "sm"
|
|
130
|
-
},
|
|
131
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
132
|
-
var _a;
|
|
133
|
-
return (_a = ref.current) == null ? void 0 : _a.slidePrev();
|
|
134
|
-
}, "onClick")
|
|
135
|
-
}
|
|
136
|
-
),
|
|
137
|
-
/* @__PURE__ */ jsx(
|
|
138
|
-
Button,
|
|
139
|
-
{
|
|
140
|
-
"aria-label": "Next category",
|
|
141
|
-
className: bem("carousel__button"),
|
|
142
|
-
color: "primary",
|
|
143
|
-
iconProps: {
|
|
144
|
-
name: "ArrowRight01Icon",
|
|
145
|
-
size: "sm"
|
|
146
|
-
},
|
|
147
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
148
|
-
var _a;
|
|
149
|
-
return (_a = ref.current) == null ? void 0 : _a.slideNext();
|
|
150
|
-
}, "onClick")
|
|
151
|
-
}
|
|
152
|
-
)
|
|
153
|
-
] })
|
|
154
|
-
] })
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
PostWidgetCarousel.displayName = "PostWidgetCarousel";
|
|
3
|
+
import { createIsland } from "../../helpers/createIsland.js";
|
|
4
|
+
import PostWidgetCarouselServer from "./PostWidgetCarousel.server.js";
|
|
5
|
+
const PostWidgetCarousel = createIsland({
|
|
6
|
+
name: "PostWidgetCarousel",
|
|
7
|
+
Server: PostWidgetCarouselServer,
|
|
8
|
+
loadLazy: /* @__PURE__ */ __name(() => import("./PostWidgetCarousel.lazy.js"), "loadLazy"),
|
|
9
|
+
// Carousel is interactive; render server first then hydrate when visible
|
|
10
|
+
isInteractive: /* @__PURE__ */ __name(() => true, "isInteractive")
|
|
11
|
+
});
|
|
163
12
|
export {
|
|
164
13
|
PostWidgetCarousel
|
|
165
14
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createLazyWrapper } from "../../helpers/createLazyWrapper.js";
|
|
3
|
+
import PostWidgetCarouselClient from "./PostWidgetCarousel.client.js";
|
|
4
|
+
import PostWidgetCarouselServer from "./PostWidgetCarousel.server.js";
|
|
5
|
+
const PostWidgetCarousel_lazy = createLazyWrapper({
|
|
6
|
+
name: "PostWidgetCarousel",
|
|
7
|
+
Client: PostWidgetCarouselClient,
|
|
8
|
+
Server: PostWidgetCarouselServer,
|
|
9
|
+
hydrateOnVisible: true
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
PostWidgetCarousel_lazy as default
|
|
13
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
const styles = {
|
|
2
|
+
"prokodo-PostWidgetCarousel__card": "prokodo-PostWidgetCarousel__card",
|
|
2
3
|
"prokodo-PostWidgetCarousel__carousel": "prokodo-PostWidgetCarousel__carousel",
|
|
4
|
+
"prokodo-PostWidgetCarousel__carousel__wrapper": "prokodo-PostWidgetCarousel__carousel__wrapper",
|
|
3
5
|
"prokodo-PostWidgetCarousel__carousel__item__image__link": "prokodo-PostWidgetCarousel__carousel__item__image__link",
|
|
4
6
|
"prokodo-PostWidgetCarousel__carousel__item__image": "prokodo-PostWidgetCarousel__carousel__item__image",
|
|
7
|
+
"prokodo-PostWidgetCarousel__carousel__item__image__container": "prokodo-PostWidgetCarousel__carousel__item__image__container",
|
|
5
8
|
"prokodo-PostWidgetCarousel__carousel__item__link": "prokodo-PostWidgetCarousel__carousel__item__link",
|
|
6
9
|
"prokodo-PostWidgetCarousel__carousel__dots": "prokodo-PostWidgetCarousel__carousel__dots",
|
|
7
10
|
"prokodo-PostWidgetCarousel__carousel__buttons": "prokodo-PostWidgetCarousel__carousel__buttons",
|
|
@@ -0,0 +1,11 @@
|
|
|
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 { PostWidgetCarouselView } from "./PostWidgetCarousel.view.js";
|
|
5
|
+
function PostWidgetCarouselServer(p) {
|
|
6
|
+
return /* @__PURE__ */ jsx(PostWidgetCarouselView, { ...p });
|
|
7
|
+
}
|
|
8
|
+
__name(PostWidgetCarouselServer, "PostWidgetCarouselServer");
|
|
9
|
+
export {
|
|
10
|
+
PostWidgetCarouselServer as default
|
|
11
|
+
};
|