@prokodo/ui 0.1.14 → 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/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.js +4 -1
- package/dist/components/button/Button.view.js +3 -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.js +4 -1
- package/dist/components/checkbox/Checkbox.view.js +4 -1
- package/dist/components/checkbox-group/CheckboxGroup.js +4 -1
- package/dist/components/checkbox-group/CheckboxGroup.view.js +4 -1
- 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 +23 -5
- 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.js +4 -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/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/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/package.json +19 -5
|
@@ -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",
|