@prokodo/ui 0.1.1 → 0.1.3
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 +1 -0
- package/dist/components/accordion/Accordion.base.module.scss.js +6 -1
- package/dist/components/accordion/Accordion.view.js +73 -48
- package/dist/components/card/Card.view.js +0 -1
- package/dist/components/dialog/Dialog.view.js +76 -62
- package/dist/components/form/Form.view.js +78 -67
- package/dist/components/form/FormField.client.js +18 -1
- package/dist/components/image/Image.client.js +2 -2
- package/dist/components/image/Image.js +1 -1
- package/dist/components/image/Image.lazy.js +1 -1
- package/dist/components/image/Image.server.js +7 -9
- package/dist/components/post-teaser/PostTeaser.view.js +9 -5
- package/dist/components/post-widget/PostWidget.view.js +1 -3
- package/dist/components/post-widget-carousel/PostWidgetCarousel.view.js +1 -3
- package/dist/components/rating/Rating.client.js +162 -0
- package/dist/components/rating/Rating.js +12 -0
- package/dist/components/rating/Rating.lazy.js +12 -0
- package/dist/components/rating/Rating.module.scss.js +22 -0
- package/dist/components/rating/Rating.server.js +11 -0
- package/dist/components/rating/Rating.validation.js +18 -0
- package/dist/components/rating/Rating.view.js +165 -0
- package/dist/components/rating/index.js +4 -0
- package/dist/components/snackbar/Snackbar.module.scss.js +2 -3
- package/dist/components/snackbar/Snackbar.view.js +20 -4
- package/dist/constants/project.js +1 -1
- package/dist/helpers/createIsland.js +17 -9
- package/dist/helpers/createLazyWrapper.js +9 -8
- package/dist/index.js +2 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/accordion/Accordion.model.d.ts +1 -0
- package/dist/types/components/card/Card.model.d.ts +2 -3
- package/dist/types/components/dialog/Dialog.model.d.ts +1 -0
- package/dist/types/components/dialog/Dialog.view.d.ts +1 -1
- package/dist/types/components/form/Form.model.d.ts +7 -3
- package/dist/types/components/image/Image.d.ts +26 -2
- package/dist/types/components/image/Image.lazy.d.ts +26 -2
- package/dist/types/components/image/Image.model.d.ts +2 -7
- package/dist/types/components/post-teaser/PostTeaser.view.d.ts +1 -1
- package/dist/types/components/post-widget/PostWidget.view.d.ts +1 -1
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.view.d.ts +1 -1
- package/dist/types/components/rating/Rating.client.d.ts +5 -0
- package/dist/types/components/rating/Rating.d.ts +4 -0
- package/dist/types/components/rating/Rating.lazy.d.ts +5 -0
- package/dist/types/components/rating/Rating.model.d.ts +52 -0
- package/dist/types/components/rating/Rating.server.d.ts +3 -0
- package/dist/types/components/rating/Rating.validation.d.ts +2 -0
- package/dist/types/components/rating/Rating.view.d.ts +3 -0
- package/dist/types/components/rating/index.d.ts +2 -0
- package/dist/types/components/snackbar/Snackbar.model.d.ts +4 -1
- package/dist/types/components/snackbar/Snackbar.view.d.ts +1 -1
- package/dist/types/components/snackbar/SnackbarProvider.model.d.ts +3 -13
- package/dist/types/helpers/runtime.client.d.ts +3 -5
- package/dist/types/index.d.ts +1 -0
- package/dist/ui.css +298 -26
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -4,8 +4,13 @@ const styles = {
|
|
|
4
4
|
"prokodo-Accordion__item": "prokodo-Accordion__item",
|
|
5
5
|
"prokodo-Accordion__item--is-expanded": "prokodo-Accordion__item--is-expanded",
|
|
6
6
|
"prokodo-Accordion__header": "prokodo-Accordion__header",
|
|
7
|
+
"prokodo-Accordion__header__toggle": "prokodo-Accordion__header__toggle",
|
|
8
|
+
"prokodo-Accordion__header__actions": "prokodo-Accordion__header__actions",
|
|
9
|
+
"prokodo-Accordion__header__actions__wrapper": "prokodo-Accordion__header__actions__wrapper",
|
|
10
|
+
"prokodo-Accordion__header__icons": "prokodo-Accordion__header__icons",
|
|
11
|
+
"prokodo-Accordion__header__wrapper": "prokodo-Accordion__header__wrapper",
|
|
7
12
|
accordionBorderShift,
|
|
8
|
-
"prokodo-
|
|
13
|
+
"prokodo-Accordion__header__wrapper--is-expanded": "prokodo-Accordion__header__wrapper--is-expanded",
|
|
9
14
|
"prokodo-Accordion__title": "prokodo-Accordion__title",
|
|
10
15
|
"prokodo-Accordion__icon": "prokodo-Accordion__icon",
|
|
11
16
|
"prokodo-Accordion__icon--is-hidden": "prokodo-Accordion__icon--is-hidden",
|
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
4
|
import { create } from "../../helpers/bem.js";
|
|
5
|
-
import { isNull } from "../../helpers/validations.js";
|
|
5
|
+
import { isNull, isArray } from "../../helpers/validations.js";
|
|
6
6
|
import styles from "./Accordion.base.module.scss.js";
|
|
7
7
|
import { AccordionEffectsLoader } from "./Accordion.effects.client.js";
|
|
8
8
|
import { Headline } from "../headline/Headline.js";
|
|
@@ -32,65 +32,90 @@ function AccordionView({
|
|
|
32
32
|
const {
|
|
33
33
|
title,
|
|
34
34
|
renderHeader,
|
|
35
|
+
renderHeaderActions,
|
|
35
36
|
renderContent,
|
|
36
37
|
actions,
|
|
37
38
|
className: itemCls
|
|
38
39
|
} = item;
|
|
39
40
|
const accId = `${id}-${title}`;
|
|
40
41
|
const isExpanded = expandedIndex === index;
|
|
42
|
+
const accHeaderProps = {
|
|
43
|
+
"aria-controls": `${accId}-content`,
|
|
44
|
+
"aria-expanded": isExpanded,
|
|
45
|
+
role: "button",
|
|
46
|
+
tabIndex: 0,
|
|
47
|
+
onClick: onToggle ? (e) => onToggle(index, e) : void 0,
|
|
48
|
+
onKeyDown: onToggle ? (e) => {
|
|
49
|
+
if (e.key === "Enter" || e.key === " ") onToggle(index, e);
|
|
50
|
+
} : void 0
|
|
51
|
+
};
|
|
41
52
|
return /* @__PURE__ */ jsxs(
|
|
42
53
|
"div",
|
|
43
54
|
{
|
|
44
55
|
className: bem("item", { "is-expanded": isExpanded }, itemCls),
|
|
45
56
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
47
58
|
"div",
|
|
48
59
|
{
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
children:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
60
|
+
className: bem("header__wrapper", { "is-expanded": isExpanded }),
|
|
61
|
+
children: /* @__PURE__ */ jsxs(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
...accHeaderProps,
|
|
65
|
+
className: bem("header__toggle", { "is-expanded": isExpanded }),
|
|
66
|
+
id: `${accId}-header`,
|
|
67
|
+
children: [
|
|
68
|
+
!isNull(renderHeader) ? renderHeader : /* @__PURE__ */ jsx(
|
|
69
|
+
Headline,
|
|
70
|
+
{
|
|
71
|
+
animated: true,
|
|
72
|
+
className: bem("title"),
|
|
73
|
+
highlight: isExpanded,
|
|
74
|
+
size: "xs",
|
|
75
|
+
type: "h3",
|
|
76
|
+
variant: isExpanded ? "primary" : "inherit",
|
|
77
|
+
...item.titleOptions ?? titleOptions,
|
|
78
|
+
children: title
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsxs("div", { className: bem("header__actions__wrapper"), children: [
|
|
82
|
+
!isNull(renderHeaderActions) && // eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
className: bem("header__actions"),
|
|
87
|
+
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
88
|
+
onMouseDown: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onMouseDown"),
|
|
89
|
+
onKeyDown: /* @__PURE__ */ __name((e) => e.key === "Enter" ? e.stopPropagation() : void 0, "onKeyDown"),
|
|
90
|
+
children: renderHeaderActions
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ jsxs("div", { className: bem("header__icons"), children: [
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
Icon,
|
|
96
|
+
{
|
|
97
|
+
className: bem("icon", { "is-hidden": isExpanded }),
|
|
98
|
+
color: "inherit",
|
|
99
|
+
name: "PlusSignIcon",
|
|
100
|
+
size: "sm",
|
|
101
|
+
...iconProps
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
Icon,
|
|
106
|
+
{
|
|
107
|
+
className: bem("icon", { "is-hidden": !isExpanded }),
|
|
108
|
+
color: "inherit",
|
|
109
|
+
name: "MinusSignIcon",
|
|
110
|
+
size: "sm",
|
|
111
|
+
...iconProps
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] })
|
|
115
|
+
] })
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
)
|
|
94
119
|
}
|
|
95
120
|
),
|
|
96
121
|
/* @__PURE__ */ jsxs(
|
|
@@ -103,7 +128,7 @@ function AccordionView({
|
|
|
103
128
|
role: "region",
|
|
104
129
|
children: [
|
|
105
130
|
!isNull(renderContent) && /* @__PURE__ */ jsx(Animated, { children: renderContent }),
|
|
106
|
-
|
|
131
|
+
isArray(actions) ? /* @__PURE__ */ jsx("div", { className: bem("actions"), children: actions.map((action) => /* @__PURE__ */ jsx(
|
|
107
132
|
Button,
|
|
108
133
|
{
|
|
109
134
|
...action
|
|
@@ -101,7 +101,6 @@ function CardView({
|
|
|
101
101
|
{
|
|
102
102
|
alt: "card background",
|
|
103
103
|
className: bem("background", void 0, backgroundProps == null ? void 0 : backgroundProps.className),
|
|
104
|
-
imageComponent: (backgroundProps == null ? void 0 : backgroundProps.imageComponent) ?? "img",
|
|
105
104
|
src: background,
|
|
106
105
|
...backgroundProps
|
|
107
106
|
}
|
|
@@ -2,6 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
4
|
import { create } from "../../helpers/bem.js";
|
|
5
|
+
import { isNumber } from "../../helpers/validations.js";
|
|
5
6
|
import styles from "./Dialog.module.scss.js";
|
|
6
7
|
import { Button } from "../button/Button.js";
|
|
7
8
|
import { Headline } from "../headline/Headline.js";
|
|
@@ -21,6 +22,7 @@ function DialogView({
|
|
|
21
22
|
containerChildren,
|
|
22
23
|
className,
|
|
23
24
|
classNameHeader,
|
|
25
|
+
height,
|
|
24
26
|
scroll = "paper",
|
|
25
27
|
fullScreen = false,
|
|
26
28
|
titleProps = {},
|
|
@@ -41,6 +43,9 @@ function DialogView({
|
|
|
41
43
|
fullScreen,
|
|
42
44
|
"is-visible": Boolean(open)
|
|
43
45
|
};
|
|
46
|
+
const styleModifier = isNumber(height) ? {
|
|
47
|
+
maxHeight: `${height}px`
|
|
48
|
+
} : void 0;
|
|
44
49
|
const renderDialog = /* @__PURE__ */ __name(() => {
|
|
45
50
|
var _a;
|
|
46
51
|
return /* @__PURE__ */ jsxs(
|
|
@@ -52,74 +57,83 @@ function DialogView({
|
|
|
52
57
|
role: "dialog",
|
|
53
58
|
...rest,
|
|
54
59
|
className: bem(void 0, wrapperMods, className),
|
|
60
|
+
style: styleModifier,
|
|
55
61
|
children: [
|
|
56
|
-
/* @__PURE__ */ jsxs(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
children: title
|
|
66
|
-
}
|
|
67
|
-
),
|
|
68
|
-
renderHeader == null ? void 0 : renderHeader()
|
|
69
|
-
] }),
|
|
70
|
-
!Boolean(hideCloseButton) && /* @__PURE__ */ jsxs(
|
|
71
|
-
"button",
|
|
72
|
-
{
|
|
73
|
-
...closeButtonProps,
|
|
74
|
-
ref: closeButtonRef,
|
|
75
|
-
"aria-label": (closeButtonProps == null ? void 0 : closeButtonProps["aria-label"]) ?? (translations == null ? void 0 : translations.close),
|
|
76
|
-
className: bem(
|
|
77
|
-
"header__button",
|
|
78
|
-
void 0,
|
|
79
|
-
closeButtonProps == null ? void 0 : closeButtonProps.className
|
|
80
|
-
),
|
|
81
|
-
onClick: onClose,
|
|
82
|
-
onKeyDown: onCloseKeyDown,
|
|
83
|
-
children: [
|
|
62
|
+
/* @__PURE__ */ jsxs(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
ref: containerRef,
|
|
66
|
+
className: bem("container", containerMods),
|
|
67
|
+
style: styleModifier,
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsxs("div", { className: bem("header", void 0, classNameHeader), children: [
|
|
70
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
84
71
|
/* @__PURE__ */ jsx(
|
|
85
|
-
|
|
72
|
+
Headline,
|
|
86
73
|
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"header__button__icon",
|
|
92
|
-
void 0,
|
|
93
|
-
(_a = closeButtonProps == null ? void 0 : closeButtonProps.iconProps) == null ? void 0 : _a.className
|
|
94
|
-
)
|
|
74
|
+
...titleProps,
|
|
75
|
+
className: bem("title", { "is-hidden": hideTitle }),
|
|
76
|
+
id: "dialog-title",
|
|
77
|
+
children: title
|
|
95
78
|
}
|
|
96
79
|
),
|
|
97
|
-
|
|
98
|
-
]
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
80
|
+
renderHeader == null ? void 0 : renderHeader()
|
|
81
|
+
] }),
|
|
82
|
+
!Boolean(hideCloseButton) && /* @__PURE__ */ jsxs(
|
|
83
|
+
"button",
|
|
84
|
+
{
|
|
85
|
+
...closeButtonProps,
|
|
86
|
+
ref: closeButtonRef,
|
|
87
|
+
"aria-label": (closeButtonProps == null ? void 0 : closeButtonProps["aria-label"]) ?? (translations == null ? void 0 : translations.close),
|
|
88
|
+
className: bem(
|
|
89
|
+
"header__button",
|
|
90
|
+
void 0,
|
|
91
|
+
closeButtonProps == null ? void 0 : closeButtonProps.className
|
|
92
|
+
),
|
|
93
|
+
onClick: onClose,
|
|
94
|
+
onKeyDown: onCloseKeyDown,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
Icon,
|
|
98
|
+
{
|
|
99
|
+
name: "Cancel01Icon",
|
|
100
|
+
size: "xs",
|
|
101
|
+
...closeButtonProps == null ? void 0 : closeButtonProps.iconProps,
|
|
102
|
+
className: bem(
|
|
103
|
+
"header__button__icon",
|
|
104
|
+
void 0,
|
|
105
|
+
(_a = closeButtonProps == null ? void 0 : closeButtonProps.iconProps) == null ? void 0 : _a.className
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
(closeButtonProps == null ? void 0 : closeButtonProps.title) ?? (translations == null ? void 0 : translations.close) ?? "Close"
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", tabIndex: 0 }),
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
...contentProps,
|
|
119
|
+
ref: contentRef,
|
|
120
|
+
id: "dialog-content",
|
|
121
|
+
className: bem(
|
|
122
|
+
"content",
|
|
123
|
+
{ [`scroll-${scroll}`]: true },
|
|
124
|
+
contentProps.className
|
|
125
|
+
),
|
|
126
|
+
children
|
|
127
|
+
}
|
|
113
128
|
),
|
|
114
|
-
children
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
] }),
|
|
129
|
+
actions.length > 0 && /* @__PURE__ */ jsxs("div", { className: bem("actions"), children: [
|
|
130
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", tabIndex: 0 }),
|
|
131
|
+
actions.map((action) => /* @__PURE__ */ jsx(Button, { ...action, title: (action == null ? void 0 : action.title) ?? "" }, action.id)),
|
|
132
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", tabIndex: 0 })
|
|
133
|
+
] })
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
),
|
|
123
137
|
containerChildren
|
|
124
138
|
]
|
|
125
139
|
}
|
|
@@ -36,76 +36,87 @@ const FormView = /* @__PURE__ */ __name(({
|
|
|
36
36
|
defaultFields: _defaultFields,
|
|
37
37
|
messages: _messages,
|
|
38
38
|
...htmlProps
|
|
39
|
-
}) =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
"is-hidden": Boolean(hideHeadline)
|
|
60
|
-
},
|
|
61
|
-
headlineProps == null ? void 0 : headlineProps.className
|
|
62
|
-
),
|
|
63
|
-
children: label
|
|
64
|
-
}
|
|
65
|
-
),
|
|
66
|
-
/* @__PURE__ */ jsxs(Grid, { className: bem("grid"), spacing: 2, children: [
|
|
67
|
-
isArray(formState) && formState.map((field) => /* @__PURE__ */ createElement(
|
|
68
|
-
FormField,
|
|
69
|
-
{
|
|
70
|
-
...field,
|
|
71
|
-
key: field.name,
|
|
72
|
-
disabled: disabled !== void 0 ? disabled : field == null ? void 0 : field.disabled,
|
|
73
|
-
messagesFields,
|
|
74
|
-
variant,
|
|
75
|
-
...fieldProps
|
|
76
|
-
}
|
|
77
|
-
)),
|
|
78
|
-
children,
|
|
39
|
+
}) => {
|
|
40
|
+
const {
|
|
41
|
+
value: hpValue,
|
|
42
|
+
onChange: hpOnChange,
|
|
43
|
+
readOnly: hpReadOnly,
|
|
44
|
+
...honeypotRest
|
|
45
|
+
} = honeypot;
|
|
46
|
+
const honeypotReadOnly = hpReadOnly !== void 0 ? hpReadOnly : hpValue !== void 0 && hpOnChange == null;
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
"form",
|
|
49
|
+
{
|
|
50
|
+
...htmlProps,
|
|
51
|
+
noValidate: true,
|
|
52
|
+
action,
|
|
53
|
+
"aria-labelledby": `${id}-heading`,
|
|
54
|
+
className: bem(void 0, void 0, className),
|
|
55
|
+
id,
|
|
56
|
+
onSubmit: typeof action === "function" || typeof action === "string" ? void 0 : onFormSubmit,
|
|
57
|
+
children: [
|
|
79
58
|
/* @__PURE__ */ jsx(
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
"aria-hidden": "true",
|
|
83
|
-
className: bem("hp"),
|
|
84
|
-
id: "hp",
|
|
85
|
-
name: "hp",
|
|
86
|
-
type: "text",
|
|
87
|
-
...honeypot
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
] }),
|
|
91
|
-
/* @__PURE__ */ jsxs("div", { className: bem("footer"), children: [
|
|
92
|
-
(hideResponse === false || hideResponse === void 0) && /* @__PURE__ */ jsx(FormResponse, { messages: formMessages }),
|
|
93
|
-
!isNull(button) && Boolean(isHoneypotEmpty) && /* @__PURE__ */ jsx(
|
|
94
|
-
Button,
|
|
59
|
+
Headline,
|
|
95
60
|
{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
61
|
+
type: "h2",
|
|
62
|
+
...headlineProps,
|
|
63
|
+
id: `${id}-heading`,
|
|
64
|
+
className: bem(
|
|
65
|
+
"label",
|
|
66
|
+
{
|
|
67
|
+
"is-hidden": Boolean(hideHeadline)
|
|
68
|
+
},
|
|
69
|
+
headlineProps == null ? void 0 : headlineProps.className
|
|
70
|
+
),
|
|
71
|
+
children: label
|
|
103
72
|
}
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ jsxs(Grid, { className: bem("grid"), spacing: 2, children: [
|
|
75
|
+
isArray(formState) && formState.map((field) => /* @__PURE__ */ createElement(
|
|
76
|
+
FormField,
|
|
77
|
+
{
|
|
78
|
+
...field,
|
|
79
|
+
key: field.name,
|
|
80
|
+
disabled: disabled !== void 0 ? disabled : field == null ? void 0 : field.disabled,
|
|
81
|
+
messagesFields,
|
|
82
|
+
variant,
|
|
83
|
+
...fieldProps
|
|
84
|
+
}
|
|
85
|
+
)),
|
|
86
|
+
children,
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
"input",
|
|
89
|
+
{
|
|
90
|
+
"aria-hidden": "true",
|
|
91
|
+
className: bem("hp"),
|
|
92
|
+
id: "hp",
|
|
93
|
+
name: "hp",
|
|
94
|
+
type: "text",
|
|
95
|
+
...honeypotRest,
|
|
96
|
+
readOnly: honeypotReadOnly,
|
|
97
|
+
value: hpValue
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ jsxs("div", { className: bem("footer"), children: [
|
|
102
|
+
(hideResponse === false || hideResponse === void 0) && /* @__PURE__ */ jsx(FormResponse, { messages: formMessages }),
|
|
103
|
+
!isNull(button) && Boolean(isHoneypotEmpty) && /* @__PURE__ */ jsx(
|
|
104
|
+
Button,
|
|
105
|
+
{
|
|
106
|
+
"aria-label": "Submit form",
|
|
107
|
+
title: "Submit",
|
|
108
|
+
type: "submit",
|
|
109
|
+
...button,
|
|
110
|
+
className: bem("footer__submit", void 0, button == null ? void 0 : button.className),
|
|
111
|
+
color: (button == null ? void 0 : button.color) ?? variant,
|
|
112
|
+
disabled: Boolean(formMessages == null ? void 0 : formMessages.errors) || !isFormValid
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] })
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}, "FormView");
|
|
109
120
|
export {
|
|
110
121
|
FormView
|
|
111
122
|
};
|
|
@@ -5,6 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { useCallback } from "react";
|
|
6
6
|
import { create } from "../../helpers/bem.js";
|
|
7
7
|
import styles from "./FormField.module.scss.js";
|
|
8
|
+
import { Rating } from "../rating/Rating.js";
|
|
8
9
|
import { DynamicList } from "../dynamic-list/DynamicList.js";
|
|
9
10
|
import { GridRow } from "../grid/GridRow.js";
|
|
10
11
|
import { DatePicker } from "../datePicker/DatePicker.js";
|
|
@@ -22,7 +23,7 @@ function FormFieldClient({
|
|
|
22
23
|
onValidate,
|
|
23
24
|
...props
|
|
24
25
|
}) {
|
|
25
|
-
var _a, _b, _c;
|
|
26
|
+
var _a, _b, _c, _d;
|
|
26
27
|
const renderFieldContainer = useCallback(
|
|
27
28
|
(children) => /* @__PURE__ */ jsx(GridRow, { className: bem(), xs: 12, children }),
|
|
28
29
|
[]
|
|
@@ -110,6 +111,22 @@ function FormFieldClient({
|
|
|
110
111
|
}
|
|
111
112
|
)
|
|
112
113
|
);
|
|
114
|
+
case "rating":
|
|
115
|
+
return renderFieldContainer(
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
Rating,
|
|
118
|
+
{
|
|
119
|
+
priority: true,
|
|
120
|
+
...props,
|
|
121
|
+
errorTranslations: (_d = messagesFields == null ? void 0 : messagesFields.errors) == null ? void 0 : _d.input,
|
|
122
|
+
onValidate: /* @__PURE__ */ __name((_, err) => onValidate == null ? void 0 : onValidate(props, err), "onValidate"),
|
|
123
|
+
onChange: /* @__PURE__ */ __name((e) => {
|
|
124
|
+
var _a2;
|
|
125
|
+
return onChange == null ? void 0 : onChange(props, (_a2 = e == null ? void 0 : e.value) == null ? void 0 : _a2.toString());
|
|
126
|
+
}, "onChange")
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
);
|
|
113
130
|
default:
|
|
114
131
|
return null;
|
|
115
132
|
}
|
|
@@ -13,11 +13,11 @@ const ImageClient = /* @__PURE__ */ __name(({
|
|
|
13
13
|
containerClassName,
|
|
14
14
|
captionClassName,
|
|
15
15
|
className,
|
|
16
|
-
imageComponent,
|
|
17
16
|
...props
|
|
18
17
|
}) => {
|
|
18
|
+
console.log(props);
|
|
19
19
|
const { imageComponent: ctxImage } = useUIRuntime();
|
|
20
|
-
const CustomImage =
|
|
20
|
+
const CustomImage = ctxImage ?? "img";
|
|
21
21
|
const renderImage = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsx(
|
|
22
22
|
CustomImage,
|
|
23
23
|
{
|
|
@@ -6,7 +6,7 @@ const Image = createIsland({
|
|
|
6
6
|
name: "Image",
|
|
7
7
|
Server: ImageServer,
|
|
8
8
|
loadLazy: /* @__PURE__ */ __name(() => import("./Image.lazy.js"), "loadLazy"),
|
|
9
|
-
isInteractive: /* @__PURE__ */ __name((
|
|
9
|
+
isInteractive: /* @__PURE__ */ __name(() => true, "isInteractive")
|
|
10
10
|
});
|
|
11
11
|
export {
|
|
12
12
|
Image
|
|
@@ -9,7 +9,7 @@ const Image_lazy = createLazyWrapper({
|
|
|
9
9
|
Client: ImageClient,
|
|
10
10
|
Server: ImageServer,
|
|
11
11
|
// treat as interactive if a custom image component is a function (e.g. NextImage)
|
|
12
|
-
isInteractive: /* @__PURE__ */ __name((
|
|
12
|
+
isInteractive: /* @__PURE__ */ __name(() => true, "isInteractive")
|
|
13
13
|
});
|
|
14
14
|
export {
|
|
15
15
|
Image_lazy as default
|
|
@@ -14,11 +14,12 @@ function toImgOnlyProps(p) {
|
|
|
14
14
|
_placeholder,
|
|
15
15
|
_blurDataURL,
|
|
16
16
|
_priority,
|
|
17
|
+
// internal next/image flag – ignorieren
|
|
18
|
+
// unsere öffentliche API: <Image priority /> → auf <img> mappen
|
|
19
|
+
priority,
|
|
17
20
|
_quality,
|
|
18
21
|
// Note: sizes *is* valid on <img> when it's a string, so we won't strip it
|
|
19
22
|
_onLoadingComplete,
|
|
20
|
-
// our runtime wiring we never want on <img>
|
|
21
|
-
_imageComponent,
|
|
22
23
|
...rest
|
|
23
24
|
} = p;
|
|
24
25
|
let src;
|
|
@@ -42,6 +43,10 @@ function toImgOnlyProps(p) {
|
|
|
42
43
|
width,
|
|
43
44
|
height
|
|
44
45
|
};
|
|
46
|
+
if (Boolean(priority)) {
|
|
47
|
+
imgProps.loading = "eager";
|
|
48
|
+
imgProps.fetchPriority = "high";
|
|
49
|
+
}
|
|
45
50
|
return imgProps;
|
|
46
51
|
}
|
|
47
52
|
__name(toImgOnlyProps, "toImgOnlyProps");
|
|
@@ -53,14 +58,7 @@ const ImageServer = /* @__PURE__ */ __name(({
|
|
|
53
58
|
className,
|
|
54
59
|
...rawProps
|
|
55
60
|
}) => {
|
|
56
|
-
if (process.env.NODE_ENV !== "production" && typeof rawProps.imageComponent === "function") {
|
|
57
|
-
console.error(
|
|
58
|
-
"[UI] Do not pass function props (imageComponent) to <Image> on the server. Use UIRuntimeProvider in the parent app instead.",
|
|
59
|
-
rawProps
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
61
|
const {
|
|
63
|
-
imageComponent: _dropImageComponent,
|
|
64
62
|
onClick: _dropClick,
|
|
65
63
|
onKeyDown: _dropKey,
|
|
66
64
|
...rest
|