@prokodo/ui 0.0.49 → 0.0.50
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/dist/components/accordion/{Accordion.module.scss.js → Accordion.base.module.scss.js} +2 -8
- package/dist/components/accordion/Accordion.effects.client.js +16 -0
- package/dist/components/accordion/Accordion.effects.module.scss.js +8 -0
- package/dist/components/accordion/Accordion.view.js +84 -80
- package/dist/components/animated/Animated.module.scss.js +2 -8
- package/dist/components/avatar/Avatar.module.scss.js +2 -8
- package/dist/components/button/Button.module.scss.js +2 -8
- package/dist/components/calendly/Calendly.client.js +98 -22
- package/dist/components/calendly/Calendly.server.js +3 -2
- package/dist/components/calendly/Calendly.view.js +2 -1
- package/dist/components/card/{Card.module.scss.js → Card.base.module.scss.js} +2 -12
- package/dist/components/card/Card.effects.client.js +16 -0
- package/dist/components/card/Card.effects.module.scss.js +14 -0
- package/dist/components/card/Card.view.js +15 -4
- package/dist/components/carousel/Carousel.client.js +44 -20
- package/dist/components/carousel/Carousel.lazy.js +1 -1
- package/dist/components/carousel/Carousel.module.scss.js +2 -8
- package/dist/components/chip/Chip.module.scss.js +2 -8
- package/dist/components/datePicker/DatePicker.client.js +52 -51
- package/dist/components/datePicker/DatePicker.view.js +14 -3
- package/dist/components/dialog/Dialog.module.scss.js +2 -8
- package/dist/components/drawer/{Drawer.module.scss.js → Drawer.base.module.scss.js} +27 -32
- package/dist/components/drawer/Drawer.client.js +19 -2
- package/dist/components/drawer/Drawer.effects.client.js +16 -0
- package/dist/components/drawer/Drawer.effects.module.scss.js +29 -0
- package/dist/components/drawer/Drawer.server.js +0 -1
- package/dist/components/drawer/Drawer.view.js +44 -40
- package/dist/components/dynamic-list/DynamicList.module.scss.js +2 -8
- package/dist/components/form/Form.client.js +131 -54
- package/dist/components/form/Form.module.scss.js +2 -8
- package/dist/components/form/FormField.module.scss.js +2 -8
- package/dist/components/form/FormResponse.module.scss.js +2 -8
- package/dist/components/grid/Grid.module.scss.js +2 -8
- package/dist/components/grid/GridRow.module.scss.js +2 -8
- package/dist/components/headline/{Headline.module.scss.js → Headline.base.module.scss.js} +2 -15
- package/dist/components/headline/Headline.effects.client.js +14 -0
- package/dist/components/headline/Headline.effects.module.scss.js +13 -0
- package/dist/components/headline/Headline.js +28 -18
- package/dist/components/icon/Icon.module.scss.js +2 -8
- package/dist/components/image/Image.module.scss.js +2 -8
- package/dist/components/image-text/ImageText.module.scss.js +2 -8
- package/dist/components/input/Input.client.js +12 -1
- package/dist/components/input/Input.module.scss.js +3 -8
- package/dist/components/input/Input.view.js +10 -2
- package/dist/components/inputOTP/InputOTP.js +124 -41
- package/dist/components/inputOTP/InputOTP.module.scss.js +2 -8
- package/dist/components/label/Label.module.scss.js +2 -8
- package/dist/components/link/Link.module.scss.js +2 -8
- package/dist/components/list/List.module.scss.js +2 -8
- package/dist/components/loading/Loading.client.js +68 -0
- package/dist/components/loading/Loading.js +9 -55
- package/dist/components/loading/Loading.lazy.js +15 -0
- package/dist/components/loading/Loading.server.js +16 -0
- package/dist/components/loading/Loading.view.js +124 -0
- package/dist/components/lottie/Lottie.module.scss.js +2 -8
- package/dist/components/post-item/PostItem.module.scss.js +2 -8
- package/dist/components/post-item/PostItemAuthor.module.scss.js +2 -8
- package/dist/components/post-teaser/PostTeaser.module.scss.js +2 -8
- package/dist/components/post-widget/PostWidget.module.scss.js +2 -8
- package/dist/components/post-widget-carousel/PostWidgetCarousel.module.scss.js +2 -8
- package/dist/components/progressBar/ProgressBar.module.scss.js +1 -7
- package/dist/components/quote/Quote.module.scss.js +2 -8
- package/dist/components/rich-text/RichText.client.js +54 -23
- package/dist/components/rich-text/RichText.js +1 -1
- package/dist/components/rich-text/RichText.lazy.js +1 -1
- package/dist/components/rich-text/RichText.module.scss.js +4 -8
- package/dist/components/rich-text/RichText.server.js +2 -1
- package/dist/components/select/Select.module.scss.js +2 -8
- package/dist/components/sidenav/SideNav.module.scss.js +2 -8
- package/dist/components/skeleton/{Skeleton.module.scss.js → Skeleton.base.module.scss.js} +2 -8
- package/dist/components/skeleton/Skeleton.effects.client.js +16 -0
- package/dist/components/skeleton/Skeleton.effects.module.scss.js +7 -0
- package/dist/components/skeleton/Skeleton.js +21 -18
- package/dist/components/slider/Slider.client.js +70 -30
- package/dist/components/slider/Slider.module.scss.js +2 -8
- package/dist/components/snackbar/Snackbar.module.scss.js +2 -8
- package/dist/components/stepper/Stepper.module.scss.js +2 -8
- package/dist/components/switch/Switch.module.scss.js +2 -8
- package/dist/components/table/Table.module.scss.js +2 -8
- package/dist/components/table/TableCell.module.scss.js +2 -8
- package/dist/components/teaser/Teaser.module.scss.js +2 -8
- package/dist/constants/project.js +1 -1
- package/dist/hooks/useResponsiveValue.js +123 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/accordion/Accordion.effects.client.d.ts +5 -0
- package/dist/types/components/calendly/Calendly.server.d.ts +1 -1
- package/dist/types/components/calendly/Calendly.view.d.ts +1 -1
- package/dist/types/components/card/Card.effects.client.d.ts +7 -0
- package/dist/types/components/carousel/Carousel.d.ts +2 -0
- package/dist/types/components/carousel/Carousel.lazy.d.ts +2 -0
- package/dist/types/components/carousel/Carousel.model.d.ts +14 -0
- package/dist/types/components/datePicker/DatePicker.view.d.ts +3 -5
- package/dist/types/components/drawer/Drawer.effects.client.d.ts +5 -0
- package/dist/types/components/headline/Headline.effects.client.d.ts +1 -0
- package/dist/types/components/input/Input.client.d.ts +1 -1
- package/dist/types/components/input/Input.view.d.ts +1 -1
- package/dist/types/components/loading/Loading.client.d.ts +4 -0
- package/dist/types/components/loading/Loading.d.ts +4 -2
- package/dist/types/components/loading/Loading.lazy.d.ts +5 -0
- package/dist/types/components/loading/Loading.model.d.ts +16 -1
- package/dist/types/components/loading/Loading.server.d.ts +4 -0
- package/dist/types/components/loading/Loading.view.d.ts +6 -0
- package/dist/types/components/loading/index.d.ts +2 -2
- package/dist/types/components/rich-text/RichText.d.ts +1 -1
- package/dist/types/components/rich-text/RichText.lazy.d.ts +1 -1
- package/dist/types/components/rich-text/RichText.model.d.ts +3 -3
- package/dist/types/components/skeleton/Skeleton.effects.client.d.ts +5 -0
- package/dist/types/components/slider/Slider.model.d.ts +1 -0
- package/dist/types/hooks/useResponsiveValue.d.ts +21 -0
- package/dist/ui.css +1078 -1543
- package/package.json +1 -1
- package/dist/components/loading/Loading.module.scss.js +0 -22
package/dist/components/accordion/{Accordion.module.scss.js → Accordion.base.module.scss.js}
RENAMED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
const accordionBorderShift = "accordionBorderShift";
|
|
2
|
-
const gradientMove = "gradientMove";
|
|
3
|
-
const fadeInKeyframe = "fadeInKeyframe";
|
|
4
2
|
const styles = {
|
|
5
3
|
"prokodo-Accordion": "prokodo-Accordion",
|
|
6
4
|
"prokodo-Accordion__item": "prokodo-Accordion__item",
|
|
@@ -13,13 +11,9 @@ const styles = {
|
|
|
13
11
|
"prokodo-Accordion__icon--is-hidden": "prokodo-Accordion__icon--is-hidden",
|
|
14
12
|
"prokodo-Accordion__content": "prokodo-Accordion__content",
|
|
15
13
|
"prokodo-Accordion__content--is-expanded": "prokodo-Accordion__content--is-expanded",
|
|
16
|
-
"prokodo-Accordion__actions": "prokodo-Accordion__actions"
|
|
17
|
-
gradientMove,
|
|
18
|
-
fadeInKeyframe
|
|
14
|
+
"prokodo-Accordion__actions": "prokodo-Accordion__actions"
|
|
19
15
|
};
|
|
20
16
|
export {
|
|
21
17
|
accordionBorderShift,
|
|
22
|
-
styles as default
|
|
23
|
-
fadeInKeyframe,
|
|
24
|
-
gradientMove
|
|
18
|
+
styles as default
|
|
25
19
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
function AccordionEffectsLoader({ useBorderShift }) {
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (Boolean(useBorderShift)) {
|
|
8
|
+
void import("./Accordion.effects.module.scss.js");
|
|
9
|
+
}
|
|
10
|
+
}, [useBorderShift]);
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
__name(AccordionEffectsLoader, "AccordionEffectsLoader");
|
|
14
|
+
export {
|
|
15
|
+
AccordionEffectsLoader
|
|
16
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import {
|
|
3
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
4
|
import { create } from "../../helpers/bem.js";
|
|
5
5
|
import { isNull } from "../../helpers/validations.js";
|
|
6
|
-
import styles from "./Accordion.module.scss.js";
|
|
6
|
+
import styles from "./Accordion.base.module.scss.js";
|
|
7
|
+
import { AccordionEffectsLoader } from "./Accordion.effects.client.js";
|
|
7
8
|
import { Headline } from "../headline/Headline.js";
|
|
8
9
|
import { Animated } from "../animated/Animated.js";
|
|
9
10
|
import { Button } from "../button/Button.js";
|
|
@@ -20,84 +21,87 @@ function AccordionView({
|
|
|
20
21
|
iconProps,
|
|
21
22
|
...domRest
|
|
22
23
|
}) {
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", { ...domRest, className: bem(void 0, { [variant]: true }, className), children: [
|
|
25
|
+
/* @__PURE__ */ jsx(AccordionEffectsLoader, { useBorderShift: true }),
|
|
26
|
+
items.map((item, index) => {
|
|
27
|
+
const { title, renderHeader, renderContent, actions, className: itemCls } = item;
|
|
28
|
+
const accId = `${id}-${title}`;
|
|
29
|
+
const isExpanded = expandedIndex === index;
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: bem("item", { "is-expanded": isExpanded }, itemCls),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxs(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
"aria-controls": `${accId}-content`,
|
|
39
|
+
"aria-expanded": isExpanded,
|
|
40
|
+
className: bem("header", { "is-expanded": isExpanded }),
|
|
41
|
+
id: `${accId}-header`,
|
|
42
|
+
role: "button",
|
|
43
|
+
tabIndex: 0,
|
|
44
|
+
onClick: onToggle ? (e) => onToggle(index, e) : void 0,
|
|
45
|
+
onKeyDown: onToggle ? (e) => {
|
|
46
|
+
if (e.key === "Enter" || e.key === " ") onToggle(index, e);
|
|
47
|
+
} : void 0,
|
|
48
|
+
children: [
|
|
49
|
+
!isNull(renderHeader) ? renderHeader : /* @__PURE__ */ jsx(
|
|
50
|
+
Headline,
|
|
51
|
+
{
|
|
52
|
+
animated: true,
|
|
53
|
+
className: bem("title"),
|
|
54
|
+
highlight: isExpanded,
|
|
55
|
+
size: "xs",
|
|
56
|
+
type: "h3",
|
|
57
|
+
variant: isExpanded ? "primary" : "inherit",
|
|
58
|
+
...item.titleOptions ?? titleOptions,
|
|
59
|
+
children: title
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
Icon,
|
|
64
|
+
{
|
|
65
|
+
className: bem("icon", { "is-hidden": isExpanded }),
|
|
66
|
+
color: "inherit",
|
|
67
|
+
name: "PlusSignIcon",
|
|
68
|
+
size: "sm",
|
|
69
|
+
...iconProps
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
Icon,
|
|
74
|
+
{
|
|
75
|
+
className: bem("icon", { "is-hidden": !isExpanded }),
|
|
76
|
+
color: "inherit",
|
|
77
|
+
name: "MinusSignIcon",
|
|
78
|
+
size: "sm",
|
|
79
|
+
...iconProps
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ jsxs(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
"aria-labelledby": `${accId}-header`,
|
|
89
|
+
className: bem("content", { "is-expanded": isExpanded }),
|
|
90
|
+
hidden: !isExpanded,
|
|
91
|
+
id: `${accId}-content`,
|
|
92
|
+
role: "region",
|
|
93
|
+
children: [
|
|
94
|
+
!isNull(renderContent) && /* @__PURE__ */ jsx(Animated, { children: renderContent }),
|
|
95
|
+
actions !== void 0 && (actions == null ? void 0 : actions.length) ? /* @__PURE__ */ jsx("div", { className: bem("actions"), children: actions.map((action) => /* @__PURE__ */ jsx(Button, { ...action }, `${accId}-action-${action.id}`)) }) : null
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
accId
|
|
102
|
+
);
|
|
103
|
+
})
|
|
104
|
+
] });
|
|
101
105
|
}
|
|
102
106
|
__name(AccordionView, "AccordionView");
|
|
103
107
|
export {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
const gradientMove = "gradientMove";
|
|
2
|
-
const fadeInKeyframe = "fadeInKeyframe";
|
|
3
1
|
const styles = {
|
|
4
2
|
"prokodo-Animated": "prokodo-Animated",
|
|
5
3
|
"prokodo-Animated--animate-bottom-top": "prokodo-Animated--animate-bottom-top",
|
|
@@ -9,12 +7,8 @@ const styles = {
|
|
|
9
7
|
"prokodo-Animated--is-visible": "prokodo-Animated--is-visible",
|
|
10
8
|
"prokodo-Animated--is-disabled": "prokodo-Animated--is-disabled",
|
|
11
9
|
"prokodo-Animated--has-fast-speed": "prokodo-Animated--has-fast-speed",
|
|
12
|
-
"prokodo-Animated--has-slow-speed": "prokodo-Animated--has-slow-speed"
|
|
13
|
-
gradientMove,
|
|
14
|
-
fadeInKeyframe
|
|
10
|
+
"prokodo-Animated--has-slow-speed": "prokodo-Animated--has-slow-speed"
|
|
15
11
|
};
|
|
16
12
|
export {
|
|
17
|
-
styles as default
|
|
18
|
-
fadeInKeyframe,
|
|
19
|
-
gradientMove
|
|
13
|
+
styles as default
|
|
20
14
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
const gradientMove = "gradientMove";
|
|
2
|
-
const fadeInKeyframe = "fadeInKeyframe";
|
|
3
1
|
const styles = {
|
|
4
2
|
"prokodo-Avatar": "prokodo-Avatar",
|
|
5
3
|
"prokodo-Avatar--primary": "prokodo-Avatar--primary",
|
|
@@ -15,12 +13,8 @@ const styles = {
|
|
|
15
13
|
"prokodo-Avatar--has-size-lg": "prokodo-Avatar--has-size-lg",
|
|
16
14
|
"prokodo-Avatar--has-size-xl": "prokodo-Avatar--has-size-xl",
|
|
17
15
|
"prokodo-Avatar__image": "prokodo-Avatar__image",
|
|
18
|
-
"prokodo-Avatar__link": "prokodo-Avatar__link"
|
|
19
|
-
gradientMove,
|
|
20
|
-
fadeInKeyframe
|
|
16
|
+
"prokodo-Avatar__link": "prokodo-Avatar__link"
|
|
21
17
|
};
|
|
22
18
|
export {
|
|
23
|
-
styles as default
|
|
24
|
-
fadeInKeyframe,
|
|
25
|
-
gradientMove
|
|
19
|
+
styles as default
|
|
26
20
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
const gradientMove = "gradientMove";
|
|
2
|
-
const fadeInKeyframe = "fadeInKeyframe";
|
|
3
1
|
const styles = {
|
|
4
2
|
"prokodo-Button": "prokodo-Button",
|
|
5
3
|
"prokodo-Button--has-bg-primary": "prokodo-Button--has-bg-primary",
|
|
@@ -26,12 +24,8 @@ const styles = {
|
|
|
26
24
|
"prokodo-Button__link": "prokodo-Button__link",
|
|
27
25
|
"prokodo-Button__link--icon-only": "prokodo-Button__link--icon-only",
|
|
28
26
|
"prokodo-Button__content": "prokodo-Button__content",
|
|
29
|
-
"prokodo-Button__content--icon-only": "prokodo-Button__content--icon-only"
|
|
30
|
-
gradientMove,
|
|
31
|
-
fadeInKeyframe
|
|
27
|
+
"prokodo-Button__content--icon-only": "prokodo-Button__content--icon-only"
|
|
32
28
|
};
|
|
33
29
|
export {
|
|
34
|
-
styles as default
|
|
35
|
-
fadeInKeyframe,
|
|
36
|
-
gradientMove
|
|
30
|
+
styles as default
|
|
37
31
|
};
|
|
@@ -4,9 +4,11 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
4
4
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
5
5
|
import { useRef, useState, useCallback, useMemo, useEffect } from "react";
|
|
6
6
|
import { isString } from "../../helpers/validations.js";
|
|
7
|
-
import { Animated } from "../animated/Animated.js";
|
|
8
7
|
import { Loading } from "../loading/Loading.js";
|
|
8
|
+
import { Animated } from "../animated/Animated.js";
|
|
9
9
|
let scriptAlreadyLoaded = false;
|
|
10
|
+
let cssAlreadyLoaded = false;
|
|
11
|
+
let devWarnedTwice = false;
|
|
10
12
|
function CalendlyClient(props) {
|
|
11
13
|
const {
|
|
12
14
|
calendlyId,
|
|
@@ -24,8 +26,11 @@ function CalendlyClient(props) {
|
|
|
24
26
|
...rest
|
|
25
27
|
} = props;
|
|
26
28
|
const calendlyRef = useRef(null);
|
|
29
|
+
const visibleRef = useRef(false);
|
|
30
|
+
const didInitRef = useRef(false);
|
|
27
31
|
const [widgetInitialized, setWidgetInitialized] = useState(false);
|
|
28
32
|
const [scriptLoaded, setScriptLoaded] = useState(scriptAlreadyLoaded);
|
|
33
|
+
const [error, setError] = useState(null);
|
|
29
34
|
const format = /* @__PURE__ */ __name((c) => c == null ? void 0 : c.replaceAll("#", ""), "format");
|
|
30
35
|
const safePrefill = useCallback(() => {
|
|
31
36
|
const res = {};
|
|
@@ -45,7 +50,7 @@ function CalendlyClient(props) {
|
|
|
45
50
|
if (isString(colors.button)) p.set("primary_color", format(colors.button));
|
|
46
51
|
if (isString(data == null ? void 0 : data.utm_campaign)) p.set("utm_campaign", (data == null ? void 0 : data.utm_campaign) ?? "");
|
|
47
52
|
if (isString(data == null ? void 0 : data.utm_source)) p.set("utm_source", (data == null ? void 0 : data.utm_source) ?? "");
|
|
48
|
-
return `https://calendly.com/${calendlyId}?${p.toString()}
|
|
53
|
+
return calendlyId ? `https://calendly.com/${calendlyId}?${p.toString()}` : "";
|
|
49
54
|
}, [
|
|
50
55
|
calendlyId,
|
|
51
56
|
colors,
|
|
@@ -54,28 +59,68 @@ function CalendlyClient(props) {
|
|
|
54
59
|
hideEventTypeDetails,
|
|
55
60
|
hideCookieSettings
|
|
56
61
|
]);
|
|
62
|
+
const tryInit = useCallback((attempt = 0) => {
|
|
63
|
+
const host = calendlyRef.current;
|
|
64
|
+
if (!host) return;
|
|
65
|
+
if (didInitRef.current) return;
|
|
66
|
+
if (host.dataset.initialized === "1") return;
|
|
67
|
+
if (widgetInitialized) return;
|
|
68
|
+
if (!calendlyId) {
|
|
69
|
+
setError("Calendly ID missing.");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (!dataUrl) {
|
|
73
|
+
setError("Calendly URL could not be built.");
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (window.Calendly) {
|
|
77
|
+
try {
|
|
78
|
+
host.innerHTML = "";
|
|
79
|
+
} catch {
|
|
80
|
+
}
|
|
81
|
+
host.setAttribute("data-url", dataUrl);
|
|
82
|
+
window.Calendly.initInlineWidget({
|
|
83
|
+
url: dataUrl,
|
|
84
|
+
parentElement: host,
|
|
85
|
+
prefill: safePrefill()
|
|
86
|
+
});
|
|
87
|
+
setWidgetInitialized(true);
|
|
88
|
+
didInitRef.current = true;
|
|
89
|
+
host.dataset.initialized = "1";
|
|
90
|
+
setWidgetInitialized(true);
|
|
91
|
+
if (process.env.NODE_ENV !== "production" && !devWarnedTwice) {
|
|
92
|
+
devWarnedTwice = true;
|
|
93
|
+
console.debug("[Calendly] widget initialized");
|
|
94
|
+
}
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (attempt < 10) {
|
|
98
|
+
setTimeout(() => tryInit(attempt + 1), 100);
|
|
99
|
+
} else {
|
|
100
|
+
console.warn("Calendly widget failed to load.");
|
|
101
|
+
setError("Calendly widget failed to load.");
|
|
102
|
+
}
|
|
103
|
+
}, [dataUrl, safePrefill, widgetInitialized, calendlyId]);
|
|
57
104
|
const onAnimate = useCallback(
|
|
58
105
|
(visible) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (window.Calendly) {
|
|
63
|
-
(_a = calendlyRef.current) == null ? void 0 : _a.setAttribute("data-url", dataUrl);
|
|
64
|
-
window.Calendly.initInlineWidget({
|
|
65
|
-
url: dataUrl,
|
|
66
|
-
parentElement: calendlyRef.current,
|
|
67
|
-
prefill: safePrefill()
|
|
68
|
-
});
|
|
69
|
-
setWidgetInitialized(true);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (attempt < 10) setTimeout(() => tryInit(attempt + 1), 100);
|
|
73
|
-
else console.warn("Calendly widget failed to load.");
|
|
74
|
-
}, "tryInit");
|
|
75
|
-
tryInit();
|
|
106
|
+
visibleRef.current = visible;
|
|
107
|
+
if (!visible || widgetInitialized) return;
|
|
108
|
+
if (scriptLoaded) tryInit();
|
|
76
109
|
},
|
|
77
|
-
[scriptLoaded, widgetInitialized,
|
|
110
|
+
[scriptLoaded, widgetInitialized, tryInit]
|
|
78
111
|
);
|
|
112
|
+
useEffect(() => () => {
|
|
113
|
+
const host = calendlyRef.current;
|
|
114
|
+
if (host) {
|
|
115
|
+
try {
|
|
116
|
+
host.innerHTML = "";
|
|
117
|
+
delete host.dataset.initialized;
|
|
118
|
+
} catch {
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
didInitRef.current = false;
|
|
122
|
+
setWidgetInitialized(false);
|
|
123
|
+
}, []);
|
|
79
124
|
useEffect(() => {
|
|
80
125
|
if (scriptAlreadyLoaded || typeof document === "undefined") {
|
|
81
126
|
setScriptLoaded(true);
|
|
@@ -88,15 +133,46 @@ function CalendlyClient(props) {
|
|
|
88
133
|
scriptAlreadyLoaded = true;
|
|
89
134
|
setScriptLoaded(true);
|
|
90
135
|
};
|
|
136
|
+
s.onerror = () => {
|
|
137
|
+
setError("Calendly script blocked or failed to load.");
|
|
138
|
+
};
|
|
91
139
|
document.body.appendChild(s);
|
|
140
|
+
const watchdog = window.setTimeout(() => {
|
|
141
|
+
if (!scriptAlreadyLoaded) setError("Calendly script did not load (timeout).");
|
|
142
|
+
}, 8e3);
|
|
143
|
+
return () => clearTimeout(watchdog);
|
|
144
|
+
}, []);
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
if (cssAlreadyLoaded || typeof document === "undefined") return;
|
|
147
|
+
const link = document.createElement("link");
|
|
148
|
+
link.rel = "stylesheet";
|
|
149
|
+
link.href = "https://assets.calendly.com/assets/external/widget.css";
|
|
150
|
+
document.head.appendChild(link);
|
|
151
|
+
cssAlreadyLoaded = true;
|
|
92
152
|
}, []);
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
if (scriptLoaded && visibleRef.current && !widgetInitialized) {
|
|
155
|
+
tryInit();
|
|
156
|
+
}
|
|
157
|
+
}, [scriptLoaded, widgetInitialized, tryInit]);
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
if (scriptLoaded && !widgetInitialized) {
|
|
160
|
+
const id = setTimeout(() => tryInit(), 0);
|
|
161
|
+
return () => clearTimeout(id);
|
|
162
|
+
}
|
|
163
|
+
return;
|
|
164
|
+
}, [scriptLoaded, widgetInitialized, tryInit]);
|
|
93
165
|
const divStyle = {
|
|
94
|
-
display:
|
|
166
|
+
display: "block",
|
|
95
167
|
minWidth: 320,
|
|
96
168
|
height: 700
|
|
97
169
|
};
|
|
98
170
|
return /* @__PURE__ */ jsxs(Animated, { ...animationProps, onAnimate, children: [
|
|
99
|
-
!Boolean(hideLoading) && !widgetInitialized && /* @__PURE__ */ jsx(Loading, {}),
|
|
171
|
+
!Boolean(hideLoading) && !Boolean(widgetInitialized) && !isString(error) && /* @__PURE__ */ jsx(Loading, {}),
|
|
172
|
+
isString(error) && /* @__PURE__ */ jsxs("div", { role: "alert", style: { padding: 12 }, children: [
|
|
173
|
+
/* @__PURE__ */ jsx("p", { style: { margin: 0 }, children: error }),
|
|
174
|
+
dataUrl && /* @__PURE__ */ jsx("p", { style: { marginTop: 8 }, children: /* @__PURE__ */ jsx("a", { href: dataUrl, rel: "noreferrer", target: "_blank", children: "Open Calendly in a new tab" }) })
|
|
175
|
+
] }),
|
|
100
176
|
/* @__PURE__ */ jsx("div", { ref: calendlyRef, ...rest, style: divStyle })
|
|
101
177
|
] });
|
|
102
178
|
}
|
|
@@ -2,8 +2,9 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { CalendlyView } from "./Calendly.view.js";
|
|
5
|
-
function CalendlyServer(
|
|
6
|
-
|
|
5
|
+
function CalendlyServer({ ...rest }) {
|
|
6
|
+
rest == null ? true : delete rest.hideCookieSettings;
|
|
7
|
+
return /* @__PURE__ */ jsx(CalendlyView, { ...rest });
|
|
7
8
|
}
|
|
8
9
|
__name(CalendlyServer, "CalendlyServer");
|
|
9
10
|
export {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
const fadeInMask = "fadeInMask";
|
|
2
|
-
const fadeInKeyframe = "fadeInKeyframe";
|
|
3
|
-
const gradientMove = "gradientMove";
|
|
4
1
|
const styles = {
|
|
5
2
|
"prokodo-Card": "prokodo-Card",
|
|
6
3
|
"prokodo-Card--inherit": "prokodo-Card--inherit",
|
|
@@ -17,18 +14,11 @@ const styles = {
|
|
|
17
14
|
"prokodo-Card__gradiant--success": "prokodo-Card__gradiant--success",
|
|
18
15
|
"prokodo-Card__gradiant--warning": "prokodo-Card__gradiant--warning",
|
|
19
16
|
"prokodo-Card--has-highlight": "prokodo-Card--has-highlight",
|
|
20
|
-
fadeInMask,
|
|
21
17
|
"prokodo-Card--has-gradiant": "prokodo-Card--has-gradiant",
|
|
22
18
|
"prokodo-Card--has-background": "prokodo-Card--has-background",
|
|
23
19
|
"prokodo-Card--has-shadow": "prokodo-Card--has-shadow",
|
|
24
|
-
"prokodo-Card--
|
|
25
|
-
fadeInKeyframe,
|
|
26
|
-
"prokodo-Card--is-clickable": "prokodo-Card--is-clickable",
|
|
27
|
-
gradientMove
|
|
20
|
+
"prokodo-Card--is-clickable": "prokodo-Card--is-clickable"
|
|
28
21
|
};
|
|
29
22
|
export {
|
|
30
|
-
styles as default
|
|
31
|
-
fadeInKeyframe,
|
|
32
|
-
fadeInMask,
|
|
33
|
-
gradientMove
|
|
23
|
+
styles as default
|
|
34
24
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
function CardEffectsLoader({ useReveal, useHighlight, useGradient }) {
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (Boolean(useReveal) || Boolean(useHighlight) || Boolean(useGradient)) {
|
|
8
|
+
void import("./Card.effects.module.scss.js");
|
|
9
|
+
}
|
|
10
|
+
}, [useReveal, useHighlight, useGradient]);
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
__name(CardEffectsLoader, "CardEffectsLoader");
|
|
14
|
+
export {
|
|
15
|
+
CardEffectsLoader
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const Card_fadeInAnimation = "Card_fadeInAnimation";
|
|
2
|
+
const Card_fadeInMask = "Card_fadeInMask";
|
|
3
|
+
const Card_effects_module = {
|
|
4
|
+
"prokodo-Card": "prokodo-Card",
|
|
5
|
+
"prokodo-Card--has-animation": "prokodo-Card--has-animation",
|
|
6
|
+
Card_fadeInAnimation,
|
|
7
|
+
"prokodo-Card--has-highlight": "prokodo-Card--has-highlight",
|
|
8
|
+
Card_fadeInMask
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
Card_fadeInAnimation,
|
|
12
|
+
Card_fadeInMask,
|
|
13
|
+
Card_effects_module as default
|
|
14
|
+
};
|
|
@@ -4,7 +4,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import { Animated } from "../animated/Animated.js";
|
|
5
5
|
import { create } from "../../helpers/bem.js";
|
|
6
6
|
import { isString } from "../../helpers/validations.js";
|
|
7
|
-
import styles from "./Card.module.scss.js";
|
|
7
|
+
import styles from "./Card.base.module.scss.js";
|
|
8
|
+
import { CardEffectsLoader } from "./Card.effects.client.js";
|
|
8
9
|
import { Skeleton } from "../skeleton/Skeleton.js";
|
|
9
10
|
import { Image } from "../image/Image.js";
|
|
10
11
|
import { Link } from "../link/Link.js";
|
|
@@ -34,7 +35,7 @@ function CardView({
|
|
|
34
35
|
onMouseEnter,
|
|
35
36
|
onMouseLeave
|
|
36
37
|
}) {
|
|
37
|
-
const
|
|
38
|
+
const modifiers = {
|
|
38
39
|
[variant]: true,
|
|
39
40
|
"is-clickable": Boolean(isClickable),
|
|
40
41
|
"has-highlight": Boolean(highlight),
|
|
@@ -42,13 +43,22 @@ function CardView({
|
|
|
42
43
|
"has-background": Boolean(background),
|
|
43
44
|
"has-shadow": enableShadow !== false && (Boolean(isClickable) || Boolean(enableShadow)),
|
|
44
45
|
"has-animation": Boolean(animated)
|
|
46
|
+
// hook only; actual animation rules live in effects sheet
|
|
45
47
|
};
|
|
48
|
+
const effects = /* @__PURE__ */ jsx(
|
|
49
|
+
CardEffectsLoader,
|
|
50
|
+
{
|
|
51
|
+
useGradient: Boolean(gradiant),
|
|
52
|
+
useHighlight: Boolean(highlight),
|
|
53
|
+
useReveal: Boolean(animated)
|
|
54
|
+
}
|
|
55
|
+
);
|
|
46
56
|
const innerCard = (
|
|
47
57
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
48
58
|
/* @__PURE__ */ jsxs(
|
|
49
59
|
"div",
|
|
50
60
|
{
|
|
51
|
-
className: bem(void 0,
|
|
61
|
+
className: bem(void 0, modifiers, className),
|
|
52
62
|
role: !redirect && Boolean(isClickable) ? "button" : void 0,
|
|
53
63
|
tabIndex: !redirect && Boolean(isClickable) ? 0 : -1,
|
|
54
64
|
onClick: Boolean(isClickable) && !redirect ? onClick : void 0,
|
|
@@ -56,10 +66,11 @@ function CardView({
|
|
|
56
66
|
onMouseEnter,
|
|
57
67
|
onMouseLeave,
|
|
58
68
|
children: [
|
|
69
|
+
effects,
|
|
59
70
|
Boolean(loading) && /* @__PURE__ */ jsx(
|
|
60
71
|
Skeleton,
|
|
61
72
|
{
|
|
62
|
-
className: bem("skeleton",
|
|
73
|
+
className: bem("skeleton", modifiers),
|
|
63
74
|
variant: "rectangular",
|
|
64
75
|
...skeletonProps
|
|
65
76
|
}
|