@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.
Files changed (113) hide show
  1. package/dist/components/RTE/RTE.client.js +0 -1
  2. package/dist/components/RTE/RTE.js +4 -1
  3. package/dist/components/accordion/Accordion.js +8 -2
  4. package/dist/components/accordion/Accordion.view.js +1 -1
  5. package/dist/components/animated/Animated.client.js +13 -5
  6. package/dist/components/animated/Animated.js +8 -2
  7. package/dist/components/animatedText/AnimatedText.client.js +10 -2
  8. package/dist/components/animatedText/AnimatedText.js +8 -2
  9. package/dist/components/autocomplete/Autocomplete.client.js +5 -1
  10. package/dist/components/autocomplete/Autocomplete.js +4 -1
  11. package/dist/components/autocomplete/Autocomplete.view.js +13 -4
  12. package/dist/components/avatar/Avatar.js +4 -1
  13. package/dist/components/avatar/Avatar.view.js +19 -12
  14. package/dist/components/base-link/BaseLink.js +4 -1
  15. package/dist/components/base-link/BaseLink.view.js +3 -0
  16. package/dist/components/button/Button.js +4 -1
  17. package/dist/components/button/Button.view.js +3 -1
  18. package/dist/components/calendly/Calendly.js +8 -2
  19. package/dist/components/card/Card.js +11 -5
  20. package/dist/components/card/Card.view.js +22 -5
  21. package/dist/components/carousel/Carousel.client.js +140 -129
  22. package/dist/components/carousel/Carousel.js +8 -2
  23. package/dist/components/carousel/Carousel.view.js +10 -0
  24. package/dist/components/checkbox/Checkbox.js +4 -1
  25. package/dist/components/checkbox/Checkbox.view.js +4 -1
  26. package/dist/components/checkbox-group/CheckboxGroup.js +4 -1
  27. package/dist/components/checkbox-group/CheckboxGroup.view.js +4 -1
  28. package/dist/components/chip/Chip.js +4 -1
  29. package/dist/components/chip/Chip.view.js +4 -0
  30. package/dist/components/datePicker/DatePicker.js +4 -1
  31. package/dist/components/dialog/Dialog.js +8 -2
  32. package/dist/components/dialog/Dialog.view.js +23 -5
  33. package/dist/components/drawer/Drawer.client.js +0 -1
  34. package/dist/components/drawer/Drawer.js +4 -1
  35. package/dist/components/drawer/Drawer.view.js +14 -3
  36. package/dist/components/dynamic-list/DynamicList.client.js +1 -0
  37. package/dist/components/dynamic-list/DynamicList.js +4 -1
  38. package/dist/components/dynamic-list/DynamicList.view.js +18 -5
  39. package/dist/components/form/Form.client.js +4 -1
  40. package/dist/components/form/Form.js +4 -1
  41. package/dist/components/form/Form.view.js +3 -1
  42. package/dist/components/form/FormField.client.js +8 -2
  43. package/dist/components/form/FormField.js +4 -1
  44. package/dist/components/form/FormResponse.js +4 -1
  45. package/dist/components/headline/Headline.js +8 -2
  46. package/dist/components/icon/Icon.js +8 -2
  47. package/dist/components/image/Image.client.js +9 -5
  48. package/dist/components/image/Image.js +8 -2
  49. package/dist/components/image/Image.server.js +2 -1
  50. package/dist/components/image-text/ImageText.js +18 -8
  51. package/dist/components/input/Input.client.js +15 -2
  52. package/dist/components/input/Input.js +4 -1
  53. package/dist/components/input/Input.view.js +15 -6
  54. package/dist/components/input/InputValidation.js +6 -2
  55. package/dist/components/inputOTP/InputOTP.js +2 -1
  56. package/dist/components/link/Link.js +5 -3
  57. package/dist/components/link/Link.view.js +2 -1
  58. package/dist/components/list/List.js +52 -23
  59. package/dist/components/loading/Loading.js +4 -1
  60. package/dist/components/loading/Loading.view.js +25 -5
  61. package/dist/components/lottie/Lottie.js +9 -5
  62. package/dist/components/map/Map.js +62 -44
  63. package/dist/components/pagination/Pagination.js +4 -1
  64. package/dist/components/pagination/Pagination.view.js +3 -1
  65. package/dist/components/post-item/PostItem.js +4 -1
  66. package/dist/components/post-item/PostItemAuthor.js +4 -1
  67. package/dist/components/post-teaser/PostTeaser.js +4 -1
  68. package/dist/components/post-teaser/PostTeaser.view.js +4 -2
  69. package/dist/components/post-widget/PostWidget.js +5 -3
  70. package/dist/components/post-widget/PostWidget.view.js +9 -3
  71. package/dist/components/post-widget-carousel/PostWidgetCarousel.js +8 -2
  72. package/dist/components/post-widget-carousel/PostWidgetCarousel.view.js +2 -1
  73. package/dist/components/progressBar/ProgressBar.js +8 -2
  74. package/dist/components/progressBar/ProgressBar.view.js +4 -1
  75. package/dist/components/rating/Rating.client.js +6 -1
  76. package/dist/components/rating/Rating.js +4 -1
  77. package/dist/components/rich-text/RichText.client.js +52 -17
  78. package/dist/components/rich-text/RichText.js +8 -2
  79. package/dist/components/rich-text/RichText.server.js +3 -0
  80. package/dist/components/select/Select.client.js +149 -101
  81. package/dist/components/select/Select.js +8 -2
  82. package/dist/components/select/Select.view.js +35 -11
  83. package/dist/components/sidenav/SideNav.js +8 -2
  84. package/dist/components/slider/Slider.client.js +11 -2
  85. package/dist/components/slider/Slider.js +4 -1
  86. package/dist/components/slider/Slider.view.js +43 -5
  87. package/dist/components/snackbar/Snackbar.client.js +5 -1
  88. package/dist/components/snackbar/Snackbar.js +4 -1
  89. package/dist/components/snackbar/SnackbarProvider.js +8 -2
  90. package/dist/components/stepper/Stepper.client.js +6 -3
  91. package/dist/components/stepper/Stepper.js +4 -1
  92. package/dist/components/switch/Switch.js +4 -1
  93. package/dist/components/switch/Switch.view.js +1 -0
  94. package/dist/components/table/Table.js +1 -0
  95. package/dist/components/tabs/Tabs.client.js +1 -0
  96. package/dist/components/tabs/Tabs.js +8 -2
  97. package/dist/components/tabs/Tabs.view.js +8 -2
  98. package/dist/components/tooltip/Tooltip.client.js +126 -91
  99. package/dist/components/tooltip/Tooltip.js +10 -4
  100. package/dist/components/tooltip/Tooltip.view.js +1 -0
  101. package/dist/constants/project.js +1 -1
  102. package/dist/helpers/createIsland.js +1 -0
  103. package/dist/helpers/createLazyWrapper.js +1 -0
  104. package/dist/hooks/useGoogleMaps.js +0 -1
  105. package/dist/tsconfig.build.tsbuildinfo +1 -1
  106. package/dist/types/components/RTE/RTE.d.ts +1 -1
  107. package/dist/types/components/RTE/RTE.lazy.d.ts +1 -1
  108. package/dist/types/components/avatar/Avatar.view.d.ts +1 -1
  109. package/dist/types/components/carousel/Carousel.view.d.ts +1 -1
  110. package/dist/types/components/dynamic-list/DynamicList.model.d.ts +1 -1
  111. package/dist/types/components/headline/Headline.model.d.ts +1 -1
  112. package/dist/types/components/input/Input.view.d.ts +1 -1
  113. 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: /* @__PURE__ */ __name(() => import("./Tabs.lazy.js"), "loadLazy"),
9
- isInteractive: /* @__PURE__ */ __name(() => true, "isInteractive")
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: /* @__PURE__ */ __name((event) => _clientState == null ? void 0 : _clientState.onTabClick(index, event), "onClick"),
107
- onKeyDown: /* @__PURE__ */ __name((event) => _clientState == null ? void 0 : _clientState.onTabKeyDown(index, event), "onKeyDown"),
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
- } : triggerProps == null ? void 0 : triggerProps.onMouseEnter,
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
- } : triggerProps == null ? void 0 : triggerProps.onMouseLeave,
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
- } : triggerProps == null ? void 0 : triggerProps.onMouseMove,
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
- } : triggerProps == null ? void 0 : triggerProps.onFocus,
226
- onBlur: openOnFocus ? (e) => {
227
- var _a;
228
- (_a = triggerProps == null ? void 0 : triggerProps.onBlur) == null ? void 0 : _a.call(triggerProps, e);
229
- scheduleClose();
230
- } : triggerProps == null ? void 0 : triggerProps.onBlur,
231
- onKeyDown: /* @__PURE__ */ __name((e) => {
232
- var _a, _b, _c;
233
- (_a = triggerProps == null ? void 0 : triggerProps.onKeyDown) == null ? void 0 : _a.call(triggerProps, e);
234
- if (e.key === "Escape") {
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
- }, "onKeyDown")
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
- if (!portal || !open || disabled) return;
266
- const triggerEl = triggerRef.current;
267
- const bubbleEl = bubbleRef.current;
268
- if (!triggerEl || !bubbleEl) return;
269
- const anchorEl = triggerEl.querySelector("[data-tooltip-anchor]") ?? triggerEl;
270
- const gutter = 8;
271
- const arrowSize = 8;
272
- const triggerRect = anchorEl.getBoundingClientRect();
273
- const bubbleSize = {
274
- w: bubbleEl.offsetWidth,
275
- h: bubbleEl.offsetHeight
276
- };
277
- if (!bubbleSize.w || !bubbleSize.h) return;
278
- const isMobile = window.innerWidth < mobileBreakpoint;
279
- const preferred = isMobile && (placement === "left" || placement === "right") ? "top" : placement;
280
- const ar = anchorEl.getBoundingClientRect();
281
- const anchorX = ar.left + ar.width / 2;
282
- const anchorY = ar.top + ar.height / 2;
283
- const chosen = choosePlacement({
284
- preferred,
285
- anchorX,
286
- anchorY,
287
- triggerRect,
288
- bubbleSize,
289
- gutter,
290
- offset,
291
- arrowSize,
292
- preventOverflow
293
- });
294
- const { x, y, arrowX, arrowY } = computeFixedPosition({
295
- placement: chosen,
296
- anchorX,
297
- anchorY,
298
- bubbleSize,
299
- gutter,
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
- arrowSize
302
- });
303
- setEffectivePlacement(chosen);
304
- setBubbleStyle({
305
- ["--pk-tt-x"]: `${x}px`,
306
- ["--pk-tt-y"]: `${y}px`,
307
- ["--pk-tt-arrow-x"]: arrowX != null ? `${arrowX}px` : void 0,
308
- ["--pk-tt-arrow-y"]: arrowY != null ? `${arrowY}px` : void 0,
309
- ["--pk-tt-z"]: String(zIndex)
310
- });
311
- }, [
312
- portal,
313
- open,
314
- disabled,
315
- placement,
316
- preventOverflow,
317
- offset,
318
- zIndex,
319
- mobileBreakpoint
320
- ]);
321
- useLayoutEffect(() => {
322
- if (!portal || !open) return;
323
- setBubbleStyle(void 0);
324
- const raf1 = requestAnimationFrame(() => {
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
- className: bubbleStyle ? portalBubbleClassFinal : portalBubbleClassBase,
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: /* @__PURE__ */ __name(() => import("./Tooltip.client.js"), "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: /* @__PURE__ */ __name((p) => Boolean(
11
- (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"
12
- ), "isInteractive")
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",
@@ -1,4 +1,4 @@
1
- const PROKODO_UI_VERSION = "0.1.14";
1
+ const PROKODO_UI_VERSION = "0.1.15";
2
2
  export {
3
3
  PROKODO_UI_VERSION
4
4
  };
@@ -12,6 +12,7 @@ function createIsland({
12
12
  name,
13
13
  Server,
14
14
  loadLazy,
15
+ /* istanbul ignore next */
15
16
  isInteractive: customInteractive
16
17
  }) {
17
18
  const LazyComp = lazy(() => loadLazy().then((m) => ({ default: m.default })));
@@ -9,6 +9,7 @@ function createLazyWrapper({
9
9
  Server,
10
10
  hydrateOnVisible = false,
11
11
  ioOptions,
12
+ /* istanbul ignore next */
12
13
  isInteractive: customInteractive
13
14
  }) {
14
15
  const LazyWrapper = /* @__PURE__ */ __name(({
@@ -15,7 +15,6 @@ const useGoogleMaps = /* @__PURE__ */ __name((apiKey, reload) => {
15
15
  setLoaded(true);
16
16
  }).catch((err) => {
17
17
  console.error("Error loading Google Maps", err);
18
- throw new Error("Error loading Google Map: ", err);
19
18
  });
20
19
  }, "loader");
21
20
  void loader();