@prokodo/ui 0.1.13 → 0.1.15
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 +2 -0
- package/dist/components/RTE/RTE.client.js +0 -1
- package/dist/components/RTE/RTE.js +4 -1
- package/dist/components/accordion/Accordion.js +8 -2
- package/dist/components/accordion/Accordion.view.js +1 -1
- package/dist/components/animated/Animated.client.js +13 -5
- package/dist/components/animated/Animated.js +8 -2
- package/dist/components/animatedText/AnimatedText.client.js +10 -2
- package/dist/components/animatedText/AnimatedText.js +8 -2
- package/dist/components/autocomplete/Autocomplete.client.js +5 -1
- package/dist/components/autocomplete/Autocomplete.js +4 -1
- package/dist/components/autocomplete/Autocomplete.view.js +13 -4
- package/dist/components/avatar/Avatar.js +4 -1
- package/dist/components/avatar/Avatar.view.js +19 -12
- package/dist/components/base-link/BaseLink.js +4 -1
- package/dist/components/base-link/BaseLink.view.js +3 -0
- package/dist/components/button/Button.css +114 -6
- package/dist/components/button/Button.js +4 -1
- package/dist/components/button/Button.module.css +114 -6
- package/dist/components/button/Button.module.scss.js +10 -2
- package/dist/components/button/Button.view.js +4 -1
- package/dist/components/calendly/Calendly.js +8 -2
- package/dist/components/card/Card.js +11 -5
- package/dist/components/card/Card.view.js +22 -5
- package/dist/components/carousel/Carousel.client.js +140 -129
- package/dist/components/carousel/Carousel.js +8 -2
- package/dist/components/carousel/Carousel.view.js +10 -0
- package/dist/components/checkbox/Checkbox.client.js +42 -0
- package/dist/components/checkbox/Checkbox.css +312 -0
- package/dist/components/checkbox/Checkbox.js +15 -0
- package/dist/components/checkbox/Checkbox.lazy.js +12 -0
- package/dist/components/checkbox/Checkbox.module.css +312 -0
- package/dist/components/checkbox/Checkbox.module.scss.js +20 -0
- package/dist/components/checkbox/Checkbox.server.js +20 -0
- package/dist/components/checkbox/Checkbox.view.js +89 -0
- package/dist/components/checkbox/index.js +4 -0
- package/dist/components/checkbox-group/CheckboxGroup.client.js +57 -0
- package/dist/components/checkbox-group/CheckboxGroup.css +238 -0
- package/dist/components/checkbox-group/CheckboxGroup.js +16 -0
- package/dist/components/checkbox-group/CheckboxGroup.lazy.js +12 -0
- package/dist/components/checkbox-group/CheckboxGroup.module.css +238 -0
- package/dist/components/checkbox-group/CheckboxGroup.module.scss.js +15 -0
- package/dist/components/checkbox-group/CheckboxGroup.server.js +25 -0
- package/dist/components/checkbox-group/CheckboxGroup.view.js +100 -0
- package/dist/components/checkbox-group/index.js +4 -0
- package/dist/components/chip/Chip.js +4 -1
- package/dist/components/chip/Chip.view.js +4 -0
- package/dist/components/datePicker/DatePicker.js +4 -1
- package/dist/components/dialog/Dialog.js +8 -2
- package/dist/components/dialog/Dialog.view.js +25 -6
- package/dist/components/drawer/Drawer.client.js +0 -1
- package/dist/components/drawer/Drawer.js +4 -1
- package/dist/components/drawer/Drawer.view.js +14 -3
- package/dist/components/dynamic-list/DynamicList.client.js +1 -0
- package/dist/components/dynamic-list/DynamicList.js +4 -1
- package/dist/components/dynamic-list/DynamicList.view.js +18 -5
- package/dist/components/form/Form.client.js +4 -1
- package/dist/components/form/Form.js +4 -1
- package/dist/components/form/Form.view.js +3 -1
- package/dist/components/form/FormField.client.js +8 -2
- package/dist/components/form/FormField.js +4 -1
- package/dist/components/form/FormResponse.js +4 -1
- package/dist/components/headline/Headline.js +8 -2
- package/dist/components/icon/Icon.js +8 -2
- package/dist/components/image/Image.client.js +9 -5
- package/dist/components/image/Image.js +8 -2
- package/dist/components/image/Image.server.js +2 -1
- package/dist/components/image-text/ImageText.js +18 -8
- package/dist/components/input/Input.client.js +15 -2
- package/dist/components/input/Input.js +4 -1
- package/dist/components/input/Input.view.js +15 -6
- package/dist/components/input/InputValidation.js +6 -2
- package/dist/components/inputOTP/InputOTP.js +2 -1
- package/dist/components/link/Link.js +5 -3
- package/dist/components/link/Link.view.js +2 -1
- package/dist/components/list/List.js +52 -23
- package/dist/components/loading/Loading.js +4 -1
- package/dist/components/loading/Loading.view.js +25 -5
- package/dist/components/lottie/Lottie.js +9 -5
- package/dist/components/map/Map.js +62 -44
- package/dist/components/pagination/Pagination.js +4 -1
- package/dist/components/pagination/Pagination.view.js +3 -1
- package/dist/components/post-item/PostItem.js +4 -1
- package/dist/components/post-item/PostItemAuthor.js +4 -1
- package/dist/components/post-teaser/PostTeaser.js +4 -1
- package/dist/components/post-teaser/PostTeaser.view.js +4 -2
- package/dist/components/post-widget/PostWidget.js +5 -3
- package/dist/components/post-widget/PostWidget.view.js +9 -3
- package/dist/components/post-widget-carousel/PostWidgetCarousel.js +8 -2
- package/dist/components/post-widget-carousel/PostWidgetCarousel.view.js +2 -1
- package/dist/components/progressBar/ProgressBar.js +8 -2
- package/dist/components/progressBar/ProgressBar.view.js +4 -1
- package/dist/components/rating/Rating.client.js +6 -1
- package/dist/components/rating/Rating.js +4 -1
- package/dist/components/rich-text/RichText.client.js +52 -17
- package/dist/components/rich-text/RichText.js +8 -2
- package/dist/components/rich-text/RichText.server.js +3 -0
- package/dist/components/select/Select.client.js +149 -101
- package/dist/components/select/Select.js +8 -2
- package/dist/components/select/Select.view.js +35 -11
- package/dist/components/sidenav/SideNav.js +8 -2
- package/dist/components/slider/Slider.client.js +11 -2
- package/dist/components/slider/Slider.js +4 -1
- package/dist/components/slider/Slider.view.js +43 -5
- package/dist/components/snackbar/Snackbar.client.js +5 -1
- package/dist/components/snackbar/Snackbar.css +5 -1
- package/dist/components/snackbar/Snackbar.js +4 -1
- package/dist/components/snackbar/Snackbar.module.css +5 -1
- package/dist/components/snackbar/SnackbarProvider.js +8 -2
- package/dist/components/stepper/Stepper.client.js +6 -3
- package/dist/components/stepper/Stepper.js +4 -1
- package/dist/components/switch/Switch.js +4 -1
- package/dist/components/switch/Switch.view.js +1 -0
- package/dist/components/table/Table.js +1 -0
- package/dist/components/tabs/Tabs.client.js +1 -0
- package/dist/components/tabs/Tabs.js +8 -2
- package/dist/components/tabs/Tabs.view.js +8 -2
- package/dist/components/tooltip/Tooltip.client.js +126 -91
- package/dist/components/tooltip/Tooltip.js +10 -4
- package/dist/components/tooltip/Tooltip.view.js +1 -0
- package/dist/constants/project.js +1 -1
- package/dist/helpers/createIsland.js +1 -0
- package/dist/helpers/createLazyWrapper.js +1 -0
- package/dist/hooks/useGoogleMaps.js +0 -1
- package/dist/index.js +4 -0
- package/dist/theme.css +430 -9
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/RTE/RTE.d.ts +1 -1
- package/dist/types/components/RTE/RTE.lazy.d.ts +1 -1
- package/dist/types/components/avatar/Avatar.view.d.ts +1 -1
- package/dist/types/components/carousel/Carousel.view.d.ts +1 -1
- package/dist/types/components/checkbox/Checkbox.client.d.ts +4 -0
- package/dist/types/components/checkbox/Checkbox.d.ts +18 -0
- package/dist/types/components/checkbox/Checkbox.lazy.d.ts +19 -0
- package/dist/types/components/checkbox/Checkbox.model.d.ts +23 -0
- package/dist/types/components/checkbox/Checkbox.server.d.ts +3 -0
- package/dist/types/components/checkbox/Checkbox.view.d.ts +3 -0
- package/dist/types/components/checkbox/index.d.ts +2 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.client.d.ts +4 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.d.ts +4 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.lazy.d.ts +5 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.model.d.ts +38 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.server.d.ts +3 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.view.d.ts +3 -0
- package/dist/types/components/checkbox-group/index.d.ts +2 -0
- 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/dynamic-list/DynamicList.model.d.ts +1 -1
- package/dist/types/components/headline/Headline.model.d.ts +1 -1
- package/dist/types/components/input/Input.view.d.ts +1 -1
- package/dist/types/index.d.ts +2 -0
- package/package.json +29 -5
|
@@ -14,8 +14,16 @@ const SliderView = /* @__PURE__ */ __name(({
|
|
|
14
14
|
required,
|
|
15
15
|
disabled,
|
|
16
16
|
// Defaultwerte für min, max, step:
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/* istanbul ignore next */
|
|
18
|
+
min = (
|
|
19
|
+
/* istanbul ignore next */
|
|
20
|
+
0
|
|
21
|
+
),
|
|
22
|
+
/* istanbul ignore next */
|
|
23
|
+
max = (
|
|
24
|
+
/* istanbul ignore next */
|
|
25
|
+
100
|
|
26
|
+
),
|
|
19
27
|
step = 1,
|
|
20
28
|
marks = false,
|
|
21
29
|
valueLabelProps = {},
|
|
@@ -27,8 +35,23 @@ const SliderView = /* @__PURE__ */ __name(({
|
|
|
27
35
|
onChangeInternal
|
|
28
36
|
}) => {
|
|
29
37
|
var _a;
|
|
30
|
-
const clamped =
|
|
31
|
-
|
|
38
|
+
const clamped = (
|
|
39
|
+
/* istanbul ignore next */
|
|
40
|
+
internalValue < min ? (
|
|
41
|
+
/* istanbul ignore next */
|
|
42
|
+
min
|
|
43
|
+
) : (
|
|
44
|
+
/* istanbul ignore next */
|
|
45
|
+
internalValue > max ? (
|
|
46
|
+
/* istanbul ignore next */
|
|
47
|
+
max
|
|
48
|
+
) : internalValue
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
const pct = max > min ? (clamped - min) / (max - min) * 100 : (
|
|
52
|
+
/* istanbul ignore next */
|
|
53
|
+
0
|
|
54
|
+
);
|
|
32
55
|
let markPoints = [];
|
|
33
56
|
if (Array.isArray(marks)) {
|
|
34
57
|
markPoints = marks;
|
|
@@ -61,7 +84,22 @@ const SliderView = /* @__PURE__ */ __name(({
|
|
|
61
84
|
/* @__PURE__ */ jsx("div", { className: bem("rail") }),
|
|
62
85
|
/* @__PURE__ */ jsx("div", { className: bem("track"), style: { width: `${pct}%` } }),
|
|
63
86
|
markPoints.map((m) => {
|
|
64
|
-
const leftPct = max > min ? (
|
|
87
|
+
const leftPct = max > min ? (
|
|
88
|
+
/* istanbul ignore next */
|
|
89
|
+
((m.value < min ? (
|
|
90
|
+
/* istanbul ignore next */
|
|
91
|
+
min
|
|
92
|
+
) : (
|
|
93
|
+
/* istanbul ignore next */
|
|
94
|
+
m.value > max ? (
|
|
95
|
+
/* istanbul ignore next */
|
|
96
|
+
max
|
|
97
|
+
) : m.value
|
|
98
|
+
)) - min) / (max - min) * 100
|
|
99
|
+
) : (
|
|
100
|
+
/* istanbul ignore next */
|
|
101
|
+
0
|
|
102
|
+
);
|
|
65
103
|
return /* @__PURE__ */ jsx(
|
|
66
104
|
"div",
|
|
67
105
|
{
|
|
@@ -5,7 +5,11 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { memo, useState, useRef, useCallback, useEffect } from "react";
|
|
6
6
|
import { SnackbarView } from "./Snackbar.view.js";
|
|
7
7
|
function SnackbarClient({
|
|
8
|
-
|
|
8
|
+
/* istanbul ignore next */
|
|
9
|
+
open: openProp = (
|
|
10
|
+
/* istanbul ignore next */
|
|
11
|
+
false
|
|
12
|
+
),
|
|
9
13
|
autoHideDuration = 6e3,
|
|
10
14
|
onClose,
|
|
11
15
|
...rest
|
|
@@ -148,7 +148,11 @@
|
|
|
148
148
|
color: var(--color-black);
|
|
149
149
|
}
|
|
150
150
|
.prokodo-Snackbar--info {
|
|
151
|
-
background-color: var(--color-
|
|
151
|
+
background-color: var(--color-grey-500);
|
|
152
|
+
}
|
|
153
|
+
html[data-theme=dark] .prokodo-Snackbar--info {
|
|
154
|
+
background-color: var(--color-grey-300);
|
|
155
|
+
color: var(--color-grey-900);
|
|
152
156
|
}
|
|
153
157
|
.prokodo-Snackbar__message {
|
|
154
158
|
flex: 1 1;
|
|
@@ -5,7 +5,10 @@ import SnackbarServer from "./Snackbar.server.js";
|
|
|
5
5
|
const Snackbar = createIsland({
|
|
6
6
|
name: "Snackbar",
|
|
7
7
|
Server: SnackbarServer,
|
|
8
|
-
loadLazy:
|
|
8
|
+
loadLazy: (
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
/* @__PURE__ */ __name(() => import("./Snackbar.lazy.js"), "loadLazy")
|
|
11
|
+
)
|
|
9
12
|
});
|
|
10
13
|
export {
|
|
11
14
|
Snackbar
|
|
@@ -148,7 +148,11 @@
|
|
|
148
148
|
color: var(--color-black);
|
|
149
149
|
}
|
|
150
150
|
.prokodo-Snackbar--info {
|
|
151
|
-
background-color: var(--color-
|
|
151
|
+
background-color: var(--color-grey-500);
|
|
152
|
+
}
|
|
153
|
+
html[data-theme=dark] .prokodo-Snackbar--info {
|
|
154
|
+
background-color: var(--color-grey-300);
|
|
155
|
+
color: var(--color-grey-900);
|
|
152
156
|
}
|
|
153
157
|
.prokodo-Snackbar__message {
|
|
154
158
|
flex: 1 1;
|
|
@@ -6,8 +6,14 @@ const SnackbarProvider = createIsland({
|
|
|
6
6
|
name: "SnackbarProvider",
|
|
7
7
|
Server: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx(Fragment, { children }), "Server"),
|
|
8
8
|
// renders nothing on SSR
|
|
9
|
-
loadLazy:
|
|
10
|
-
|
|
9
|
+
loadLazy: (
|
|
10
|
+
/* istanbul ignore next */
|
|
11
|
+
/* @__PURE__ */ __name(() => import("./SnackbarProvider.lazy.js"), "loadLazy")
|
|
12
|
+
),
|
|
13
|
+
isInteractive: (
|
|
14
|
+
/* istanbul ignore next */
|
|
15
|
+
/* @__PURE__ */ __name(() => true, "isInteractive")
|
|
16
|
+
)
|
|
11
17
|
});
|
|
12
18
|
export {
|
|
13
19
|
SnackbarProvider
|
|
@@ -98,9 +98,12 @@ const StepperClient = forwardRef((props, ref) => {
|
|
|
98
98
|
(_c = (_b = (_a = steps == null ? void 0 : steps[i]) == null ? void 0 : _a.innerContainerProps) == null ? void 0 : _b.onBlur) == null ? void 0 : _c.call(_b, e);
|
|
99
99
|
}, "onBlur"),
|
|
100
100
|
// Capture the <div role="button"> element in stepRefs.current[i]
|
|
101
|
-
ref:
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
ref: (
|
|
102
|
+
/* istanbul ignore next */
|
|
103
|
+
/* @__PURE__ */ __name((el) => {
|
|
104
|
+
stepRefs.current[i] = el;
|
|
105
|
+
}, "ref")
|
|
106
|
+
)
|
|
104
107
|
}
|
|
105
108
|
};
|
|
106
109
|
}),
|
|
@@ -5,7 +5,10 @@ import StepperServer from "./Stepper.server.js";
|
|
|
5
5
|
const Stepper = createIsland({
|
|
6
6
|
name: "Stepper",
|
|
7
7
|
Server: StepperServer,
|
|
8
|
-
loadLazy:
|
|
8
|
+
loadLazy: (
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
/* @__PURE__ */ __name(() => import("./Stepper.lazy.js"), "loadLazy")
|
|
11
|
+
)
|
|
9
12
|
});
|
|
10
13
|
export {
|
|
11
14
|
Stepper
|
|
@@ -5,7 +5,10 @@ import SwitchServer from "./Switch.server.js";
|
|
|
5
5
|
const Switch = createIsland({
|
|
6
6
|
name: "Switch",
|
|
7
7
|
Server: SwitchServer,
|
|
8
|
-
loadLazy:
|
|
8
|
+
loadLazy: (
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
/* @__PURE__ */ __name(() => import("./Switch.lazy.js"), "loadLazy")
|
|
11
|
+
)
|
|
9
12
|
});
|
|
10
13
|
export {
|
|
11
14
|
Switch
|
|
@@ -52,6 +52,7 @@ const Table = /* @__PURE__ */ __name(({
|
|
|
52
52
|
"tr",
|
|
53
53
|
{
|
|
54
54
|
className: bem("body__row", {
|
|
55
|
+
/* istanbul ignore next */
|
|
55
56
|
"has-link": isString((_a = row == null ? void 0 : row.redirect) == null ? void 0 : _a.href)
|
|
56
57
|
}),
|
|
57
58
|
children: row == null ? void 0 : row.cells.filter((el) => el !== null).map((cell, b) => /* @__PURE__ */ createElement(
|
|
@@ -74,6 +74,7 @@ function TabsClient({
|
|
|
74
74
|
[disabled, isControlled, items, onChange]
|
|
75
75
|
);
|
|
76
76
|
const moveFocus = useCallback(
|
|
77
|
+
/* istanbul ignore next */
|
|
77
78
|
(currentIndex, direction) => {
|
|
78
79
|
if (!enabledIndices.length) return currentIndex;
|
|
79
80
|
const currentEnabledPos = enabledIndices.findIndex(
|
|
@@ -5,8 +5,14 @@ import TabsServer from "./Tabs.server.js";
|
|
|
5
5
|
const Tabs = createIsland({
|
|
6
6
|
name: "Tabs",
|
|
7
7
|
Server: TabsServer,
|
|
8
|
-
loadLazy:
|
|
9
|
-
|
|
8
|
+
loadLazy: (
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
/* @__PURE__ */ __name(() => import("./Tabs.lazy.js"), "loadLazy")
|
|
11
|
+
),
|
|
12
|
+
isInteractive: (
|
|
13
|
+
/* istanbul ignore next */
|
|
14
|
+
/* @__PURE__ */ __name(() => true, "isInteractive")
|
|
15
|
+
)
|
|
10
16
|
});
|
|
11
17
|
export {
|
|
12
18
|
Tabs
|
|
@@ -103,8 +103,14 @@ function TabsView({
|
|
|
103
103
|
},
|
|
104
104
|
tabClassName
|
|
105
105
|
),
|
|
106
|
-
onClick:
|
|
107
|
-
|
|
106
|
+
onClick: (
|
|
107
|
+
/* istanbul ignore next */
|
|
108
|
+
/* @__PURE__ */ __name((event) => _clientState == null ? void 0 : _clientState.onTabClick(index, event), "onClick")
|
|
109
|
+
),
|
|
110
|
+
onKeyDown: (
|
|
111
|
+
/* istanbul ignore next */
|
|
112
|
+
/* @__PURE__ */ __name((event) => _clientState == null ? void 0 : _clientState.onTabKeyDown(index, event), "onKeyDown")
|
|
113
|
+
),
|
|
108
114
|
children: [
|
|
109
115
|
/* @__PURE__ */ jsx("span", { className: bem("tabLabel"), children: item.label }),
|
|
110
116
|
item.badge ? /* @__PURE__ */ jsx(
|
|
@@ -204,7 +204,10 @@ function TooltipClient(props) {
|
|
|
204
204
|
if (anchor === "pointer")
|
|
205
205
|
lastPointer.current = { x: e.clientX, y: e.clientY };
|
|
206
206
|
scheduleOpen();
|
|
207
|
-
} :
|
|
207
|
+
} : (
|
|
208
|
+
/* istanbul ignore next */
|
|
209
|
+
triggerProps == null ? void 0 : triggerProps.onMouseEnter
|
|
210
|
+
),
|
|
208
211
|
onMouseLeave: openOnHover ? (e) => {
|
|
209
212
|
var _a, _b;
|
|
210
213
|
(_a = triggerProps == null ? void 0 : triggerProps.onMouseLeave) == null ? void 0 : _a.call(triggerProps, e);
|
|
@@ -212,31 +215,49 @@ function TooltipClient(props) {
|
|
|
212
215
|
if (nextTarget && ((_b = bubbleRef.current) == null ? void 0 : _b.contains(nextTarget))) return;
|
|
213
216
|
if (anchor === "pointer") lastPointer.current = null;
|
|
214
217
|
scheduleClose();
|
|
215
|
-
} :
|
|
218
|
+
} : (
|
|
219
|
+
/* istanbul ignore next */
|
|
220
|
+
triggerProps == null ? void 0 : triggerProps.onMouseLeave
|
|
221
|
+
),
|
|
216
222
|
onMouseMove: anchor === "pointer" ? (e) => {
|
|
217
223
|
var _a;
|
|
218
224
|
(_a = triggerProps == null ? void 0 : triggerProps.onMouseMove) == null ? void 0 : _a.call(triggerProps, e);
|
|
219
225
|
lastPointer.current = { x: e.clientX, y: e.clientY };
|
|
220
|
-
} :
|
|
226
|
+
} : (
|
|
227
|
+
/* istanbul ignore next */
|
|
228
|
+
triggerProps == null ? void 0 : triggerProps.onMouseMove
|
|
229
|
+
),
|
|
221
230
|
onFocus: openOnFocus ? (e) => {
|
|
222
231
|
var _a;
|
|
223
232
|
(_a = triggerProps == null ? void 0 : triggerProps.onFocus) == null ? void 0 : _a.call(triggerProps, e);
|
|
224
233
|
scheduleOpen();
|
|
225
|
-
} :
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
clearTimers();
|
|
236
|
-
setOpen(false);
|
|
237
|
-
(_c = (_b = e.currentTarget) == null ? void 0 : _b.blur) == null ? void 0 : _c.call(_b);
|
|
234
|
+
} : (
|
|
235
|
+
/* istanbul ignore next */
|
|
236
|
+
triggerProps == null ? void 0 : triggerProps.onFocus
|
|
237
|
+
),
|
|
238
|
+
onBlur: openOnFocus ? (
|
|
239
|
+
/* istanbul ignore next */
|
|
240
|
+
(e) => {
|
|
241
|
+
var _a;
|
|
242
|
+
(_a = triggerProps == null ? void 0 : triggerProps.onBlur) == null ? void 0 : _a.call(triggerProps, e);
|
|
243
|
+
scheduleClose();
|
|
238
244
|
}
|
|
239
|
-
|
|
245
|
+
) : (
|
|
246
|
+
/* istanbul ignore next */
|
|
247
|
+
triggerProps == null ? void 0 : triggerProps.onBlur
|
|
248
|
+
),
|
|
249
|
+
onKeyDown: (
|
|
250
|
+
/* istanbul ignore next */
|
|
251
|
+
/* @__PURE__ */ __name((e) => {
|
|
252
|
+
var _a, _b, _c;
|
|
253
|
+
(_a = triggerProps == null ? void 0 : triggerProps.onKeyDown) == null ? void 0 : _a.call(triggerProps, e);
|
|
254
|
+
if (e.key === "Escape") {
|
|
255
|
+
clearTimers();
|
|
256
|
+
setOpen(false);
|
|
257
|
+
(_c = (_b = e.currentTarget) == null ? void 0 : _b.blur) == null ? void 0 : _c.call(_b);
|
|
258
|
+
}
|
|
259
|
+
}, "onKeyDown")
|
|
260
|
+
)
|
|
240
261
|
}),
|
|
241
262
|
[
|
|
242
263
|
triggerProps,
|
|
@@ -261,79 +282,87 @@ function TooltipClient(props) {
|
|
|
261
282
|
),
|
|
262
283
|
[open, bubbleStyle, effectivePlacement, tooltipClassName]
|
|
263
284
|
);
|
|
264
|
-
const compute = useCallback(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
285
|
+
const compute = useCallback(
|
|
286
|
+
/* istanbul ignore next */
|
|
287
|
+
() => {
|
|
288
|
+
if (!portal || !open || disabled) return;
|
|
289
|
+
const triggerEl = triggerRef.current;
|
|
290
|
+
const bubbleEl = bubbleRef.current;
|
|
291
|
+
if (!triggerEl || !bubbleEl) return;
|
|
292
|
+
const anchorEl = triggerEl.querySelector("[data-tooltip-anchor]") ?? triggerEl;
|
|
293
|
+
const gutter = 8;
|
|
294
|
+
const arrowSize = 8;
|
|
295
|
+
const triggerRect = anchorEl.getBoundingClientRect();
|
|
296
|
+
const bubbleSize = {
|
|
297
|
+
w: bubbleEl.offsetWidth,
|
|
298
|
+
h: bubbleEl.offsetHeight
|
|
299
|
+
};
|
|
300
|
+
if (!bubbleSize.w || !bubbleSize.h) return;
|
|
301
|
+
const isMobile = window.innerWidth < mobileBreakpoint;
|
|
302
|
+
const preferred = isMobile && (placement === "left" || placement === "right") ? "top" : placement;
|
|
303
|
+
const ar = anchorEl.getBoundingClientRect();
|
|
304
|
+
const anchorX = ar.left + ar.width / 2;
|
|
305
|
+
const anchorY = ar.top + ar.height / 2;
|
|
306
|
+
const chosen = choosePlacement({
|
|
307
|
+
preferred,
|
|
308
|
+
anchorX,
|
|
309
|
+
anchorY,
|
|
310
|
+
triggerRect,
|
|
311
|
+
bubbleSize,
|
|
312
|
+
gutter,
|
|
313
|
+
offset,
|
|
314
|
+
arrowSize,
|
|
315
|
+
preventOverflow
|
|
316
|
+
});
|
|
317
|
+
const { x, y, arrowX, arrowY } = computeFixedPosition({
|
|
318
|
+
placement: chosen,
|
|
319
|
+
anchorX,
|
|
320
|
+
anchorY,
|
|
321
|
+
bubbleSize,
|
|
322
|
+
gutter,
|
|
323
|
+
offset,
|
|
324
|
+
arrowSize
|
|
325
|
+
});
|
|
326
|
+
setEffectivePlacement(chosen);
|
|
327
|
+
setBubbleStyle({
|
|
328
|
+
["--pk-tt-x"]: `${x}px`,
|
|
329
|
+
["--pk-tt-y"]: `${y}px`,
|
|
330
|
+
["--pk-tt-arrow-x"]: arrowX != null ? `${arrowX}px` : void 0,
|
|
331
|
+
["--pk-tt-arrow-y"]: arrowY != null ? `${arrowY}px` : void 0,
|
|
332
|
+
["--pk-tt-z"]: String(zIndex)
|
|
333
|
+
});
|
|
334
|
+
},
|
|
335
|
+
[
|
|
336
|
+
portal,
|
|
337
|
+
open,
|
|
338
|
+
disabled,
|
|
339
|
+
placement,
|
|
340
|
+
preventOverflow,
|
|
300
341
|
offset,
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
requestAnimationFrame(() => compute());
|
|
326
|
-
});
|
|
327
|
-
const onResize = /* @__PURE__ */ __name(() => compute(), "onResize");
|
|
328
|
-
const onScroll = /* @__PURE__ */ __name(() => compute(), "onScroll");
|
|
329
|
-
window.addEventListener("resize", onResize);
|
|
330
|
-
window.addEventListener("scroll", onScroll, true);
|
|
331
|
-
return () => {
|
|
332
|
-
cancelAnimationFrame(raf1);
|
|
333
|
-
window.removeEventListener("resize", onResize);
|
|
334
|
-
window.removeEventListener("scroll", onScroll, true);
|
|
335
|
-
};
|
|
336
|
-
}, [portal, open, compute]);
|
|
342
|
+
zIndex,
|
|
343
|
+
mobileBreakpoint
|
|
344
|
+
]
|
|
345
|
+
);
|
|
346
|
+
useLayoutEffect(
|
|
347
|
+
/* istanbul ignore next */
|
|
348
|
+
() => {
|
|
349
|
+
if (!portal || !open) return;
|
|
350
|
+
setBubbleStyle(void 0);
|
|
351
|
+
const raf1 = requestAnimationFrame(() => {
|
|
352
|
+
requestAnimationFrame(() => compute());
|
|
353
|
+
});
|
|
354
|
+
const onResize = /* @__PURE__ */ __name(() => compute(), "onResize");
|
|
355
|
+
const onScroll = /* @__PURE__ */ __name(() => compute(), "onScroll");
|
|
356
|
+
window.addEventListener("resize", onResize);
|
|
357
|
+
window.addEventListener("scroll", onScroll, true);
|
|
358
|
+
return () => {
|
|
359
|
+
cancelAnimationFrame(raf1);
|
|
360
|
+
window.removeEventListener("resize", onResize);
|
|
361
|
+
window.removeEventListener("scroll", onScroll, true);
|
|
362
|
+
};
|
|
363
|
+
},
|
|
364
|
+
[portal, open, compute]
|
|
365
|
+
);
|
|
337
366
|
const overlayRoot = typeof document !== "undefined" && portal ? getOverlayRoot(overlayRootId, zIndex) : null;
|
|
338
367
|
const portalOpen = open && Boolean(bubbleStyle);
|
|
339
368
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -357,10 +386,16 @@ function TooltipClient(props) {
|
|
|
357
386
|
"span",
|
|
358
387
|
{
|
|
359
388
|
ref: bubbleRef,
|
|
360
|
-
"aria-hidden": open === void 0 ? void 0 : !open,
|
|
361
389
|
role: "tooltip",
|
|
362
390
|
style: bubbleStyle,
|
|
363
|
-
|
|
391
|
+
"aria-hidden": (
|
|
392
|
+
/* istanbul ignore next */
|
|
393
|
+
open === void 0 ? void 0 : !open
|
|
394
|
+
),
|
|
395
|
+
className: (
|
|
396
|
+
/* istanbul ignore next */
|
|
397
|
+
bubbleStyle ? portalBubbleClassFinal : portalBubbleClassBase
|
|
398
|
+
),
|
|
364
399
|
onMouseEnter: openOnHover ? () => {
|
|
365
400
|
clearTimers();
|
|
366
401
|
setOpen(true);
|
|
@@ -5,11 +5,17 @@ import TooltipServer from "./Tooltip.server.js";
|
|
|
5
5
|
const Tooltip = createIsland({
|
|
6
6
|
name: "Tooltip",
|
|
7
7
|
Server: TooltipServer,
|
|
8
|
-
loadLazy:
|
|
8
|
+
loadLazy: (
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
/* @__PURE__ */ __name(() => import("./Tooltip.client.js"), "loadLazy")
|
|
11
|
+
),
|
|
9
12
|
// Hydrate only when you actually need JS timing/controlled state/etc.
|
|
10
|
-
isInteractive:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
isInteractive: (
|
|
14
|
+
/* istanbul ignore next */
|
|
15
|
+
/* @__PURE__ */ __name((p) => Boolean(
|
|
16
|
+
(p.portal ?? true) || p.preventOverflow || p.open !== void 0 || p.defaultOpen !== void 0 || typeof p.onOpenChange === "function" || typeof p.delay === "number" || typeof p.closeDelay === "number"
|
|
17
|
+
), "isInteractive")
|
|
18
|
+
)
|
|
13
19
|
});
|
|
14
20
|
export {
|
|
15
21
|
Tooltip
|
|
@@ -64,6 +64,7 @@ function TooltipView(props) {
|
|
|
64
64
|
...childProps.style ?? {},
|
|
65
65
|
...(triggerProps == null ? void 0 : triggerProps.style) ?? {},
|
|
66
66
|
// ✅ critical: prevent full-width triggers (global button resets, flex rules, etc.)
|
|
67
|
+
/* istanbul ignore next */
|
|
67
68
|
display: ((_a = triggerProps == null ? void 0 : triggerProps.style) == null ? void 0 : _a.display) ?? ((_b = childProps.style) == null ? void 0 : _b.display) ?? "inline-flex",
|
|
68
69
|
width: ((_c = triggerProps == null ? void 0 : triggerProps.style) == null ? void 0 : _c.width) ?? ((_d = childProps.style) == null ? void 0 : _d.width) ?? "max-content",
|
|
69
70
|
maxWidth: ((_e = triggerProps == null ? void 0 : triggerProps.style) == null ? void 0 : _e.maxWidth) ?? ((_f = childProps.style) == null ? void 0 : _f.maxWidth) ?? "max-content",
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,8 @@ import { Button } from "./components/button/Button.js";
|
|
|
9
9
|
import { Calendly } from "./components/calendly/Calendly.js";
|
|
10
10
|
import { Card } from "./components/card/Card.js";
|
|
11
11
|
import { Carousel } from "./components/carousel/Carousel.js";
|
|
12
|
+
import { Checkbox } from "./components/checkbox/Checkbox.js";
|
|
13
|
+
import { CheckboxGroup } from "./components/checkbox-group/CheckboxGroup.js";
|
|
12
14
|
import { Chip } from "./components/chip/Chip.js";
|
|
13
15
|
import { DatePicker } from "./components/datePicker/DatePicker.js";
|
|
14
16
|
import { Dialog } from "./components/dialog/Dialog.js";
|
|
@@ -62,6 +64,8 @@ export {
|
|
|
62
64
|
Calendly,
|
|
63
65
|
Card,
|
|
64
66
|
Carousel,
|
|
67
|
+
Checkbox,
|
|
68
|
+
CheckboxGroup,
|
|
65
69
|
Chip,
|
|
66
70
|
DatePicker,
|
|
67
71
|
Dialog,
|