@prokodo/ui 0.0.52 → 0.0.53

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 (156) hide show
  1. package/README.md +81 -81
  2. package/dist/components/accordion/Accordion.client.js +3 -1
  3. package/dist/components/accordion/Accordion.view.js +100 -81
  4. package/dist/components/animated/Animated.server.js +3 -1
  5. package/dist/components/animatedText/AnimatedText.client.js +1 -7
  6. package/dist/components/animatedText/AnimatedText.view.js +4 -1
  7. package/dist/components/avatar/Avatar.view.js +2 -2
  8. package/dist/components/base-link/BaseLink.view.js +1 -1
  9. package/dist/components/button/Button.server.js +1 -8
  10. package/dist/components/calendly/Calendly.client.js +63 -54
  11. package/dist/components/calendly/Calendly.server.js +3 -1
  12. package/dist/components/card/Card.client.js +2 -1
  13. package/dist/components/card/Card.effects.client.js +5 -1
  14. package/dist/components/card/Card.view.js +19 -2
  15. package/dist/components/carousel/Carousel.client.js +36 -12
  16. package/dist/components/chip/Chip.view.js +10 -6
  17. package/dist/components/datePicker/DatePicker.client.js +53 -37
  18. package/dist/components/datePicker/DatePicker.view.js +3 -1
  19. package/dist/components/dialog/Dialog.client.js +22 -14
  20. package/dist/components/dialog/Dialog.view.js +10 -2
  21. package/dist/components/drawer/Drawer.client.js +10 -2
  22. package/dist/components/drawer/Drawer.effects.client.js +7 -2
  23. package/dist/components/dynamic-list/DynamicList.client.js +8 -7
  24. package/dist/components/dynamic-list/DynamicList.server.js +10 -4
  25. package/dist/components/dynamic-list/DynamicList.view.js +1 -1
  26. package/dist/components/form/Form.client.js +16 -13
  27. package/dist/components/form/Form.view.js +8 -4
  28. package/dist/components/form/FormField.client.js +5 -5
  29. package/dist/components/form/FormField.server.js +3 -23
  30. package/dist/components/form/FormResponse.js +5 -1
  31. package/dist/components/grid/Grid.js +7 -2
  32. package/dist/components/grid/GridRow.js +12 -2
  33. package/dist/components/headline/Headline.js +3 -1
  34. package/dist/components/icon/Icon.js +8 -4
  35. package/dist/components/image-text/ImageText.js +5 -1
  36. package/dist/components/input/Input.client.js +52 -28
  37. package/dist/components/input/Input.view.js +92 -68
  38. package/dist/components/inputOTP/InputOTP.js +107 -90
  39. package/dist/components/label/Label.js +1 -8
  40. package/dist/components/link/Link.view.js +3 -1
  41. package/dist/components/list/List.js +94 -42
  42. package/dist/components/loading/Loading.client.js +15 -2
  43. package/dist/components/loading/Loading.server.js +8 -1
  44. package/dist/components/loading/Loading.view.js +30 -7
  45. package/dist/components/post-item/PostItem.client.js +18 -0
  46. package/dist/components/post-item/PostItem.js +7 -136
  47. package/dist/components/post-item/PostItem.lazy.js +14 -0
  48. package/dist/components/post-item/PostItem.module.scss.js +3 -1
  49. package/dist/components/post-item/PostItem.server.js +15 -0
  50. package/dist/components/post-item/PostItem.view.js +238 -0
  51. package/dist/components/post-item/PostItemAuthor.js +28 -22
  52. package/dist/components/post-teaser/PostTeaser.client.js +31 -0
  53. package/dist/components/post-teaser/PostTeaser.js +9 -169
  54. package/dist/components/post-teaser/PostTeaser.lazy.js +13 -0
  55. package/dist/components/post-teaser/PostTeaser.module.scss.js +3 -0
  56. package/dist/components/post-teaser/PostTeaser.server.js +23 -0
  57. package/dist/components/post-teaser/PostTeaser.view.js +252 -0
  58. package/dist/components/post-widget/PostWidget.client.js +9 -0
  59. package/dist/components/post-widget/PostWidget.js +11 -156
  60. package/dist/components/post-widget/PostWidget.lazy.js +13 -0
  61. package/dist/components/post-widget/PostWidget.module.scss.js +1 -0
  62. package/dist/components/post-widget/PostWidget.server.js +11 -0
  63. package/dist/components/post-widget/PostWidget.view.js +263 -0
  64. package/dist/components/post-widget-carousel/PostWidgetCarousel.client.js +9 -0
  65. package/dist/components/post-widget-carousel/PostWidgetCarousel.js +9 -160
  66. package/dist/components/post-widget-carousel/PostWidgetCarousel.lazy.js +13 -0
  67. package/dist/components/post-widget-carousel/PostWidgetCarousel.module.scss.js +3 -0
  68. package/dist/components/post-widget-carousel/PostWidgetCarousel.server.js +11 -0
  69. package/dist/components/post-widget-carousel/PostWidgetCarousel.view.js +244 -0
  70. package/dist/components/rich-text/RichText.client.js +7 -2
  71. package/dist/components/select/Select.view.js +132 -116
  72. package/dist/components/sidenav/SideNav.client.js +19 -18
  73. package/dist/components/sidenav/SideNav.server.js +8 -1
  74. package/dist/components/sidenav/SideNav.view.js +21 -3
  75. package/dist/components/skeleton/Skeleton.effects.client.js +3 -1
  76. package/dist/components/slider/Slider.client.js +56 -38
  77. package/dist/components/slider/Slider.view.js +1 -7
  78. package/dist/components/snackbar/SnackbarProvider.client.js +21 -22
  79. package/dist/components/stepper/Stepper.client.js +1 -8
  80. package/dist/components/switch/Switch.client.js +1 -6
  81. package/dist/components/switch/Switch.server.js +1 -3
  82. package/dist/components/table/Table.js +3 -1
  83. package/dist/components/table/TableCell.js +13 -1
  84. package/dist/components/teaser/Teaser.js +1 -5
  85. package/dist/constants/project.js +1 -1
  86. package/dist/helpers/createIsland.js +3 -1
  87. package/dist/helpers/createLazyWrapper.js +3 -1
  88. package/dist/helpers/date.js +21 -0
  89. package/dist/tsconfig.build.tsbuildinfo +1 -1
  90. package/dist/types/components/accordion/Accordion.model.d.ts +1 -1
  91. package/dist/types/components/animated/Animated.client.d.ts +2 -2
  92. package/dist/types/components/animated/Animated.model.d.ts +1 -1
  93. package/dist/types/components/button/Button.client.d.ts +1 -1
  94. package/dist/types/components/button/Button.d.ts +1 -1
  95. package/dist/types/components/button/Button.lazy.d.ts +1 -1
  96. package/dist/types/components/button/Button.server.d.ts +1 -1
  97. package/dist/types/components/button/Button.view.d.ts +1 -1
  98. package/dist/types/components/card/Card.effects.client.d.ts +1 -1
  99. package/dist/types/components/card/index.d.ts +1 -1
  100. package/dist/types/components/carousel/Carousel.d.ts +3 -0
  101. package/dist/types/components/carousel/Carousel.lazy.d.ts +3 -0
  102. package/dist/types/components/carousel/Carousel.model.d.ts +4 -0
  103. package/dist/types/components/dialog/Dialog.client.d.ts +1 -1
  104. package/dist/types/components/dialog/Dialog.model.d.ts +4 -4
  105. package/dist/types/components/dialog/Dialog.view.d.ts +2 -2
  106. package/dist/types/components/drawer/Drawer.client.d.ts +1 -1
  107. package/dist/types/components/drawer/Drawer.d.ts +1 -1
  108. package/dist/types/components/drawer/Drawer.effects.client.d.ts +1 -1
  109. package/dist/types/components/drawer/Drawer.lazy.d.ts +1 -1
  110. package/dist/types/components/drawer/Drawer.model.d.ts +6 -6
  111. package/dist/types/components/drawer/Drawer.server.d.ts +1 -1
  112. package/dist/types/components/drawer/Drawer.view.d.ts +2 -2
  113. package/dist/types/components/drawer/index.d.ts +1 -1
  114. package/dist/types/components/icon/IconList.d.ts +1 -1
  115. package/dist/types/components/icon/index.d.ts +1 -1
  116. package/dist/types/components/image/Image.model.d.ts +2 -2
  117. package/dist/types/components/link/Link.d.ts +1 -1
  118. package/dist/types/components/link/Link.model.d.ts +1 -1
  119. package/dist/types/components/link/Link.server.d.ts +1 -1
  120. package/dist/types/components/loading/index.d.ts +1 -1
  121. package/dist/types/components/post-item/PostItem.client.d.ts +4 -0
  122. package/dist/types/components/post-item/PostItem.d.ts +3 -2
  123. package/dist/types/components/post-item/PostItem.lazy.d.ts +5 -0
  124. package/dist/types/components/post-item/PostItem.model.d.ts +46 -6
  125. package/dist/types/components/post-item/PostItem.server.d.ts +3 -0
  126. package/dist/types/components/post-item/PostItem.view.d.ts +3 -0
  127. package/dist/types/components/post-item/PostItemAuthor.model.d.ts +5 -8
  128. package/dist/types/components/post-item/index.d.ts +2 -2
  129. package/dist/types/components/post-teaser/PostTeaser.client.d.ts +4 -0
  130. package/dist/types/components/post-teaser/PostTeaser.d.ts +3 -2
  131. package/dist/types/components/post-teaser/PostTeaser.lazy.d.ts +5 -0
  132. package/dist/types/components/post-teaser/PostTeaser.model.d.ts +49 -3
  133. package/dist/types/components/post-teaser/PostTeaser.server.d.ts +3 -0
  134. package/dist/types/components/post-teaser/PostTeaser.view.d.ts +3 -0
  135. package/dist/types/components/post-teaser/index.d.ts +1 -1
  136. package/dist/types/components/post-widget/PostWidget.client.d.ts +4 -0
  137. package/dist/types/components/post-widget/PostWidget.d.ts +13 -3
  138. package/dist/types/components/post-widget/PostWidget.lazy.d.ts +14 -0
  139. package/dist/types/components/post-widget/PostWidget.model.d.ts +53 -3
  140. package/dist/types/components/post-widget/PostWidget.server.d.ts +3 -0
  141. package/dist/types/components/post-widget/PostWidget.view.d.ts +3 -0
  142. package/dist/types/components/post-widget/index.d.ts +1 -1
  143. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.client.d.ts +3 -0
  144. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.d.ts +11 -3
  145. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.lazy.d.ts +12 -0
  146. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.model.d.ts +39 -0
  147. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.server.d.ts +3 -0
  148. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.view.d.ts +3 -0
  149. package/dist/types/components/post-widget-carousel/index.d.ts +1 -1
  150. package/dist/types/components/sidenav/index.d.ts +1 -1
  151. package/dist/types/components/skeleton/Skeleton.effects.client.d.ts +2 -2
  152. package/dist/types/helpers/createIsland.d.ts +1 -1
  153. package/dist/types/helpers/createLazyWrapper.d.ts +1 -1
  154. package/dist/types/helpers/date.d.ts +5 -0
  155. package/dist/ui.css +116 -35
  156. package/package.json +3 -2
@@ -45,10 +45,12 @@ function CalendlyClient(props) {
45
45
  if (Boolean(hideDetails)) p.set("hide_landing_page_details", "1");
46
46
  if (Boolean(hideEventTypeDetails)) p.set("hide_event_type_details", "1");
47
47
  if (Boolean(hideCookieSettings)) p.set("hide_gdpr_banner", "1");
48
- if (isString(colors.background)) p.set("background_color", format(colors == null ? void 0 : colors.background));
48
+ if (isString(colors.background))
49
+ p.set("background_color", format(colors == null ? void 0 : colors.background));
49
50
  if (isString(colors.text)) p.set("text_color", format(colors.text));
50
51
  if (isString(colors.button)) p.set("primary_color", format(colors.button));
51
- if (isString(data == null ? void 0 : data.utm_campaign)) p.set("utm_campaign", (data == null ? void 0 : data.utm_campaign) ?? "");
52
+ if (isString(data == null ? void 0 : data.utm_campaign))
53
+ p.set("utm_campaign", (data == null ? void 0 : data.utm_campaign) ?? "");
52
54
  if (isString(data == null ? void 0 : data.utm_source)) p.set("utm_source", (data == null ? void 0 : data.utm_source) ?? "");
53
55
  return calendlyId ? `https://calendly.com/${calendlyId}?${p.toString()}` : "";
54
56
  }, [
@@ -59,48 +61,51 @@ function CalendlyClient(props) {
59
61
  hideEventTypeDetails,
60
62
  hideCookieSettings
61
63
  ]);
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 {
64
+ const tryInit = useCallback(
65
+ (attempt = 0) => {
66
+ const host = calendlyRef.current;
67
+ if (!host) return;
68
+ if (didInitRef.current) return;
69
+ if (host.dataset.initialized === "1") return;
70
+ if (widgetInitialized) return;
71
+ if (!calendlyId) {
72
+ setError("Calendly ID missing.");
73
+ return;
80
74
  }
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");
75
+ if (!dataUrl) {
76
+ setError("Calendly URL could not be built.");
77
+ return;
94
78
  }
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]);
79
+ if (window.Calendly) {
80
+ try {
81
+ host.innerHTML = "";
82
+ } catch {
83
+ }
84
+ host.setAttribute("data-url", dataUrl);
85
+ window.Calendly.initInlineWidget({
86
+ url: dataUrl,
87
+ parentElement: host,
88
+ prefill: safePrefill()
89
+ });
90
+ setWidgetInitialized(true);
91
+ didInitRef.current = true;
92
+ host.dataset.initialized = "1";
93
+ setWidgetInitialized(true);
94
+ if (process.env.NODE_ENV !== "production" && !devWarnedTwice) {
95
+ devWarnedTwice = true;
96
+ console.debug("[Calendly] widget initialized");
97
+ }
98
+ return;
99
+ }
100
+ if (attempt < 10) {
101
+ setTimeout(() => tryInit(attempt + 1), 100);
102
+ } else {
103
+ console.warn("Calendly widget failed to load.");
104
+ setError("Calendly widget failed to load.");
105
+ }
106
+ },
107
+ [dataUrl, safePrefill, widgetInitialized, calendlyId]
108
+ );
104
109
  const onAnimate = useCallback(
105
110
  (visible) => {
106
111
  visibleRef.current = visible;
@@ -109,18 +114,21 @@ function CalendlyClient(props) {
109
114
  },
110
115
  [scriptLoaded, widgetInitialized, tryInit]
111
116
  );
112
- useEffect(() => () => {
113
- const host = calendlyRef.current;
114
- if (host) {
115
- try {
116
- host.innerHTML = "";
117
- delete host.dataset.initialized;
118
- } catch {
117
+ useEffect(
118
+ () => () => {
119
+ const host = calendlyRef.current;
120
+ if (host) {
121
+ try {
122
+ host.innerHTML = "";
123
+ delete host.dataset.initialized;
124
+ } catch {
125
+ }
119
126
  }
120
- }
121
- didInitRef.current = false;
122
- setWidgetInitialized(false);
123
- }, []);
127
+ didInitRef.current = false;
128
+ setWidgetInitialized(false);
129
+ },
130
+ []
131
+ );
124
132
  useEffect(() => {
125
133
  if (scriptAlreadyLoaded || typeof document === "undefined") {
126
134
  setScriptLoaded(true);
@@ -138,7 +146,8 @@ function CalendlyClient(props) {
138
146
  };
139
147
  document.body.appendChild(s);
140
148
  const watchdog = window.setTimeout(() => {
141
- if (!scriptAlreadyLoaded) setError("Calendly script did not load (timeout).");
149
+ if (!scriptAlreadyLoaded)
150
+ setError("Calendly script did not load (timeout).");
142
151
  }, 8e3);
143
152
  return () => clearTimeout(watchdog);
144
153
  }, []);
@@ -2,7 +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({ ...rest }) {
5
+ function CalendlyServer({
6
+ ...rest
7
+ }) {
6
8
  rest == null ? true : delete rest.hideCookieSettings;
7
9
  return /* @__PURE__ */ jsx(CalendlyView, { ...rest });
8
10
  }
@@ -20,7 +20,8 @@ function CardClient({
20
20
  }, [onClick]);
21
21
  const handleKey = useCallback(
22
22
  (e) => {
23
- if (e.code === "Enter" && typeof onClick === "function" && !Boolean(disabled)) onClick();
23
+ if (e.code === "Enter" && typeof onClick === "function" && !Boolean(disabled))
24
+ onClick();
24
25
  onKeyDown == null ? void 0 : onKeyDown(e);
25
26
  },
26
27
  [onClick, onKeyDown, disabled]
@@ -2,7 +2,11 @@
2
2
  var __defProp = Object.defineProperty;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
4
  import { useEffect } from "react";
5
- function CardEffectsLoader({ useReveal, useHighlight, useGradient }) {
5
+ function CardEffectsLoader({
6
+ useReveal,
7
+ useHighlight,
8
+ useGradient
9
+ }) {
6
10
  useEffect(() => {
7
11
  if (Boolean(useReveal) || Boolean(useHighlight) || Boolean(useGradient)) {
8
12
  void import("./Card.effects.module.scss.js");
@@ -75,7 +75,17 @@ function CardView({
75
75
  ...skeletonProps
76
76
  }
77
77
  ),
78
- /* @__PURE__ */ jsx("div", { className: bem("content", { "has-link": Boolean(redirect == null ? void 0 : redirect.href) }, contentClassName), children }),
78
+ /* @__PURE__ */ jsx(
79
+ "div",
80
+ {
81
+ className: bem(
82
+ "content",
83
+ { "has-link": Boolean(redirect == null ? void 0 : redirect.href) },
84
+ contentClassName
85
+ ),
86
+ children
87
+ }
88
+ ),
79
89
  Boolean(gradiant) && /* @__PURE__ */ jsx(
80
90
  "div",
81
91
  {
@@ -112,7 +122,14 @@ function CardView({
112
122
  }
113
123
  ) : innerCard;
114
124
  if (animated) {
115
- return /* @__PURE__ */ jsx(Animated, { animation: customAnimation, ...animatedProps, children: content });
125
+ return /* @__PURE__ */ jsx(
126
+ Animated,
127
+ {
128
+ animation: customAnimation,
129
+ ...animatedProps,
130
+ children: content
131
+ }
132
+ );
116
133
  }
117
134
  return content;
118
135
  }
@@ -17,6 +17,7 @@ function CarouselClient(props) {
17
17
  ref,
18
18
  autoplay,
19
19
  enableControl,
20
+ enableDots = true,
20
21
  itemsToShow = 1,
21
22
  className,
22
23
  classNameControls,
@@ -26,6 +27,8 @@ function CarouselClient(props) {
26
27
  classNameDots,
27
28
  classNameDot,
28
29
  classNameDotActive,
30
+ prevButton,
31
+ nextButton,
29
32
  responsive,
30
33
  onKeyDown,
31
34
  onMouseEnter,
@@ -114,19 +117,16 @@ function CarouselClient(props) {
114
117
  const offset = -current * (100 / effectiveItemsToShow);
115
118
  return `translateX(${offset}%)`;
116
119
  }, "getTransformValue");
117
- if (num === 0) return /* @__PURE__ */ jsx(Skeleton, { height: "200px", variant: "rectangular", width: "100%" });
120
+ if (num === 0)
121
+ return /* @__PURE__ */ jsx(Skeleton, { height: "200px", variant: "rectangular", width: "100%" });
118
122
  return /* @__PURE__ */ jsxs(
119
123
  "div",
120
124
  {
121
125
  ...rest,
122
126
  ref: setHostRef,
127
+ className: bem(void 0, { "is-active": mouseActive }, className),
123
128
  role: "button",
124
129
  tabIndex: 0,
125
- className: bem(
126
- void 0,
127
- { "is-active": mouseActive },
128
- className
129
- ),
130
130
  onKeyDown: /* @__PURE__ */ __name((e) => {
131
131
  onKeyDown == null ? void 0 : onKeyDown(e);
132
132
  switch (e.key) {
@@ -202,18 +202,32 @@ function CarouselClient(props) {
202
202
  Button,
203
203
  {
204
204
  "aria-label": "previous",
205
- className: bem("button", void 0, classNameButtons),
206
- iconProps: { name: "ArrowLeft01Icon", size: "md", color: "white" },
207
205
  variant: "outlined",
206
+ ...prevButton,
207
+ className: bem(
208
+ "button",
209
+ void 0,
210
+ `${classNameButtons} ${(prevButton == null ? void 0 : prevButton.className) ?? ""}`
211
+ ),
212
+ iconProps: {
213
+ name: "ArrowLeft01Icon",
214
+ size: "md",
215
+ color: "white",
216
+ ...prevButton == null ? void 0 : prevButton.iconProps
217
+ },
208
218
  onClick: /* @__PURE__ */ __name(() => slide(PREV), "onClick")
209
219
  }
210
220
  ),
211
- /* @__PURE__ */ jsx("span", { className: bem("dots", void 0, classNameDots), children: childrenArr.map((_, i) => {
221
+ enableDots && /* @__PURE__ */ jsx("span", { className: bem("dots", void 0, classNameDots), children: childrenArr.map((_, i) => {
212
222
  const active = i === (current - effectiveItemsToShow + num) % num;
213
223
  return /* @__PURE__ */ jsx(
214
224
  "button",
215
225
  {
216
- className: bem("dots__dot", { "is-active": active }, `${classNameDot} ${active ? classNameDotActive ?? "" : ""}`),
226
+ className: bem(
227
+ "dots__dot",
228
+ { "is-active": active },
229
+ `${classNameDot} ${active ? classNameDotActive ?? "" : ""}`
230
+ ),
217
231
  onClick: /* @__PURE__ */ __name(() => slideTo(i), "onClick"),
218
232
  onKeyDown: /* @__PURE__ */ __name((e) => e.key === "Enter" && slideTo(i), "onKeyDown")
219
233
  },
@@ -224,9 +238,19 @@ function CarouselClient(props) {
224
238
  Button,
225
239
  {
226
240
  "aria-label": "next",
227
- className: bem("button", void 0, classNameButtons),
228
- iconProps: { name: "ArrowRight01Icon", size: "md", color: "white" },
229
241
  variant: "outlined",
242
+ ...nextButton,
243
+ className: bem(
244
+ "button",
245
+ void 0,
246
+ `${classNameButtons} ${(nextButton == null ? void 0 : nextButton.className) ?? ""}`
247
+ ),
248
+ iconProps: {
249
+ name: "ArrowRight01Icon",
250
+ size: "md",
251
+ color: "white",
252
+ ...nextButton == null ? void 0 : nextButton.iconProps
253
+ },
230
254
  onClick: /* @__PURE__ */ __name(() => slide(NEXT), "onClick")
231
255
  }
232
256
  )
@@ -24,12 +24,16 @@ function ChipView({
24
24
  ...rest,
25
25
  role: "button",
26
26
  tabIndex: isClickable ? 0 : -1,
27
- className: bem(void 0, {
28
- [variant]: true,
29
- "has-icon": typeof onDelete === "function",
30
- "is-clickable": isClickable,
31
- [`${variant}--${color}`]: true
32
- }, className),
27
+ className: bem(
28
+ void 0,
29
+ {
30
+ [variant]: true,
31
+ "has-icon": typeof onDelete === "function",
32
+ "is-clickable": isClickable,
33
+ [`${variant}--${color}`]: true
34
+ },
35
+ className
36
+ ),
33
37
  onClick,
34
38
  onKeyDown,
35
39
  children: [
@@ -43,45 +43,61 @@ const DatePickerClient = /* @__PURE__ */ __name(({
43
43
  if (incoming) setError(void 0);
44
44
  }
45
45
  }, [value, unit]);
46
- const emitRaw = useCallback((raw) => {
47
- if (raw === "") {
48
- if (date !== null) setDate(null);
46
+ const emitRaw = useCallback(
47
+ (raw) => {
48
+ if (raw === "") {
49
+ if (date !== null) setDate(null);
50
+ if (isString(error)) setError(void 0);
51
+ onValidate == null ? void 0 : onValidate(name, void 0);
52
+ onChange == null ? void 0 : onChange(null);
53
+ return;
54
+ }
55
+ const parsed = dayjs(raw, fmt, true);
56
+ const year = parsed.isValid() ? parsed.year() : dayjs(raw).year();
57
+ if (!parsed.isValid() || year > 9999 || year < 100) {
58
+ const msg = withTime ? "Invalid date/time format." : "Invalid date format.";
59
+ setError(msg);
60
+ onValidate == null ? void 0 : onValidate(name, msg);
61
+ onChange == null ? void 0 : onChange(null);
62
+ return;
63
+ }
64
+ if (!isNull(minDate) && parsed.isBefore(dayjs(minDate), unit)) {
65
+ const msg = (translations == null ? void 0 : translations.minDate) ?? (dayjs(minDate).isSame(dayjs(), unit) ? withTime ? "Date/time cannot be in the past." : "Date cannot be in the past." : `Must be ≥ ${dayjs(minDate).format(fmt)}`);
66
+ setError(msg);
67
+ onValidate == null ? void 0 : onValidate(name, msg);
68
+ onChange == null ? void 0 : onChange(null);
69
+ return;
70
+ }
71
+ if (!isNull(maxDate) && parsed.isAfter(dayjs(maxDate), unit)) {
72
+ const msg = (translations == null ? void 0 : translations.maxDate) ?? (dayjs(maxDate).isSame(dayjs(), unit) ? withTime ? "Date/time cannot be in the future." : "Date cannot be in the future." : `Must be ≤ ${dayjs(maxDate).format(fmt)}`);
73
+ setError(msg);
74
+ onValidate == null ? void 0 : onValidate(name, msg);
75
+ onChange == null ? void 0 : onChange(null);
76
+ return;
77
+ }
78
+ const snapped = withTime ? parsed.minute(
79
+ Math.round(parsed.minute() / Math.max(1, minuteStep)) * Math.max(1, minuteStep)
80
+ ) : parsed;
81
+ if (!sameByUnit(date, snapped, unit)) setDate(snapped);
49
82
  if (isString(error)) setError(void 0);
50
83
  onValidate == null ? void 0 : onValidate(name, void 0);
51
- onChange == null ? void 0 : onChange(null);
52
- return;
53
- }
54
- const parsed = dayjs(raw, fmt, true);
55
- const year = parsed.isValid() ? parsed.year() : dayjs(raw).year();
56
- if (!parsed.isValid() || year > 9999 || year < 100) {
57
- const msg = withTime ? "Invalid date/time format." : "Invalid date format.";
58
- setError(msg);
59
- onValidate == null ? void 0 : onValidate(name, msg);
60
- onChange == null ? void 0 : onChange(null);
61
- return;
62
- }
63
- if (!isNull(minDate) && parsed.isBefore(dayjs(minDate), unit)) {
64
- const msg = (translations == null ? void 0 : translations.minDate) ?? (dayjs(minDate).isSame(dayjs(), unit) ? withTime ? "Date/time cannot be in the past." : "Date cannot be in the past." : `Must be ≥ ${dayjs(minDate).format(fmt)}`);
65
- setError(msg);
66
- onValidate == null ? void 0 : onValidate(name, msg);
67
- onChange == null ? void 0 : onChange(null);
68
- return;
69
- }
70
- if (!isNull(maxDate) && parsed.isAfter(dayjs(maxDate), unit)) {
71
- const msg = (translations == null ? void 0 : translations.maxDate) ?? (dayjs(maxDate).isSame(dayjs(), unit) ? withTime ? "Date/time cannot be in the future." : "Date cannot be in the future." : `Must be ≤ ${dayjs(maxDate).format(fmt)}`);
72
- setError(msg);
73
- onValidate == null ? void 0 : onValidate(name, msg);
74
- onChange == null ? void 0 : onChange(null);
75
- return;
76
- }
77
- const snapped = withTime ? parsed.minute(
78
- Math.round(parsed.minute() / Math.max(1, minuteStep)) * Math.max(1, minuteStep)
79
- ) : parsed;
80
- if (!sameByUnit(date, snapped, unit)) setDate(snapped);
81
- if (isString(error)) setError(void 0);
82
- onValidate == null ? void 0 : onValidate(name, void 0);
83
- onChange == null ? void 0 : onChange(snapped);
84
- }, [date, error, fmt, maxDate, minDate, minuteStep, name, onChange, onValidate, translations, unit, withTime]);
84
+ onChange == null ? void 0 : onChange(snapped);
85
+ },
86
+ [
87
+ date,
88
+ error,
89
+ fmt,
90
+ maxDate,
91
+ minDate,
92
+ minuteStep,
93
+ name,
94
+ onChange,
95
+ onValidate,
96
+ translations,
97
+ unit,
98
+ withTime
99
+ ]
100
+ );
85
101
  return /* @__PURE__ */ jsx(
86
102
  DatePickerView,
87
103
  {
@@ -29,7 +29,9 @@ function DatePickerView({
29
29
  const computedStep = withTime ? Math.max(1, minuteStep) * 60 : void 0;
30
30
  const { step: _ignored, ...restWithoutStep } = rest;
31
31
  const handleInput = /* @__PURE__ */ __name((e) => {
32
- onChangeInput == null ? void 0 : onChangeInput(e.currentTarget.value);
32
+ onChangeInput == null ? void 0 : onChangeInput(
33
+ e.currentTarget.value
34
+ );
33
35
  }, "handleInput");
34
36
  const handleChange = /* @__PURE__ */ __name((e) => {
35
37
  onChangeInput == null ? void 0 : onChangeInput(e.currentTarget.value);
@@ -5,7 +5,13 @@ import { jsx } from "react/jsx-runtime";
5
5
  import { forwardRef, useRef, useState, useCallback, useEffect, useImperativeHandle } from "react";
6
6
  import { DialogView } from "./Dialog.view.js";
7
7
  const FADE_DURATION = 300;
8
- function DialogClient({ open = false, closeOnBackdropClick = true, onChange, onClose, ...props }, ref) {
8
+ function DialogClient({
9
+ open = false,
10
+ closeOnBackdropClick = true,
11
+ onChange,
12
+ onClose,
13
+ ...props
14
+ }, ref) {
9
15
  const triggerRef = useRef(null);
10
16
  const closeButtonRef = useRef(null);
11
17
  const containerRef = useRef(null);
@@ -20,20 +26,22 @@ function DialogClient({ open = false, closeOnBackdropClick = true, onChange, onC
20
26
  (_a = closeButtonRef.current) == null ? void 0 : _a.focus();
21
27
  }
22
28
  }, [isOpen]);
23
- const closeDialog = useCallback((reson) => {
24
- setIsOpen(false);
25
- onClose == null ? void 0 : onClose();
26
- setTimeout(() => {
27
- var _a;
28
- onChange == null ? void 0 : onChange({}, reson ?? "backdropClick", false);
29
- (_a = triggerRef.current) == null ? void 0 : _a.focus();
30
- }, FADE_DURATION);
31
- }, [onChange, onClose]);
32
- useImperativeHandle(
33
- ref,
34
- () => ({ openDialog, closeDialog }),
35
- [openDialog, closeDialog]
29
+ const closeDialog = useCallback(
30
+ (reson) => {
31
+ setIsOpen(false);
32
+ onClose == null ? void 0 : onClose();
33
+ setTimeout(() => {
34
+ var _a;
35
+ onChange == null ? void 0 : onChange({}, reson ?? "backdropClick", false);
36
+ (_a = triggerRef.current) == null ? void 0 : _a.focus();
37
+ }, FADE_DURATION);
38
+ },
39
+ [onChange, onClose]
36
40
  );
41
+ useImperativeHandle(ref, () => ({ openDialog, closeDialog }), [
42
+ openDialog,
43
+ closeDialog
44
+ ]);
37
45
  useEffect(() => {
38
46
  if (open) openDialog();
39
47
  }, [open, openDialog]);
@@ -73,7 +73,11 @@ function DialogView({
73
73
  ...closeButtonProps,
74
74
  ref: closeButtonRef,
75
75
  "aria-label": (closeButtonProps == null ? void 0 : closeButtonProps["aria-label"]) ?? (translations == null ? void 0 : translations.close),
76
- className: bem("header__button", void 0, closeButtonProps == null ? void 0 : closeButtonProps.className),
76
+ className: bem(
77
+ "header__button",
78
+ void 0,
79
+ closeButtonProps == null ? void 0 : closeButtonProps.className
80
+ ),
77
81
  onClick: onClose,
78
82
  onKeyDown: onCloseKeyDown,
79
83
  children: [
@@ -83,7 +87,11 @@ function DialogView({
83
87
  name: "Cancel01Icon",
84
88
  size: "xs",
85
89
  ...closeButtonProps == null ? void 0 : closeButtonProps.iconProps,
86
- className: bem("header__button__icon", void 0, (_a = closeButtonProps == null ? void 0 : closeButtonProps.iconProps) == null ? void 0 : _a.className)
90
+ className: bem(
91
+ "header__button__icon",
92
+ void 0,
93
+ (_a = closeButtonProps == null ? void 0 : closeButtonProps.iconProps) == null ? void 0 : _a.className
94
+ )
87
95
  }
88
96
  ),
89
97
  (closeButtonProps == null ? void 0 : closeButtonProps.title) ?? (translations == null ? void 0 : translations.close) ?? "Close"
@@ -4,7 +4,12 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { forwardRef, useRef, useState, useLayoutEffect, useEffect, useCallback, useImperativeHandle } from "react";
6
6
  import { DrawerView } from "./Drawer.view.js";
7
- function DrawerClient({ open = false, closeOnBackdropClick = true, onChange, ...props }, ref) {
7
+ function DrawerClient({
8
+ open = false,
9
+ closeOnBackdropClick = true,
10
+ onChange,
11
+ ...props
12
+ }, ref) {
8
13
  const triggerRef = useRef(null);
9
14
  const closeButtonRef = useRef(null);
10
15
  const containerRef = useRef(null);
@@ -96,7 +101,10 @@ function DrawerClient({ open = false, closeOnBackdropClick = true, onChange, ...
96
101
  });
97
102
  });
98
103
  }, []);
99
- useImperativeHandle(ref, () => ({ openDrawer, closeDrawer }), [openDrawer, closeDrawer]);
104
+ useImperativeHandle(ref, () => ({ openDrawer, closeDrawer }), [
105
+ openDrawer,
106
+ closeDrawer
107
+ ]);
100
108
  if (!mounted) return null;
101
109
  return /* @__PURE__ */ jsx(
102
110
  DrawerView,
@@ -42,7 +42,8 @@ const DrawerEffectsLoader = /* @__PURE__ */ __name(({
42
42
  if (!container) return;
43
43
  if (isOpen) {
44
44
  lastFocused.current = document.activeElement ?? null;
45
- if (!container.hasAttribute("tabindex")) container.setAttribute("tabindex", "-1");
45
+ if (!container.hasAttribute("tabindex"))
46
+ container.setAttribute("tabindex", "-1");
46
47
  const first = (closeButtonRef == null ? void 0 : closeButtonRef.current) ?? container.querySelector(FOCUSABLE) ?? container;
47
48
  first.focus({ preventScroll: true });
48
49
  } else {
@@ -60,7 +61,11 @@ const DrawerEffectsLoader = /* @__PURE__ */ __name(({
60
61
  return;
61
62
  }
62
63
  if (e.key !== "Tab") return;
63
- const nodes = Array.from(container.querySelectorAll(FOCUSABLE)).filter((el) => !Boolean(el.hasAttribute("inert")) && !isString(el.getAttribute("aria-hidden")));
64
+ const nodes = Array.from(
65
+ container.querySelectorAll(FOCUSABLE)
66
+ ).filter(
67
+ (el) => !Boolean(el.hasAttribute("inert")) && !isString(el.getAttribute("aria-hidden"))
68
+ );
64
69
  const [first] = nodes;
65
70
  const last = nodes.at(-1);
66
71
  if (!first || !last) return;
@@ -14,9 +14,7 @@ function DynamicListClient({
14
14
  ...props
15
15
  }) {
16
16
  const isSingle = fields.length === 1;
17
- const [items, setItems] = useState(
18
- () => controlledItems ?? []
19
- );
17
+ const [items, setItems] = useState(() => controlledItems ?? []);
20
18
  useEffect(() => {
21
19
  if (controlledItems !== void 0) {
22
20
  setItems(controlledItems);
@@ -62,10 +60,13 @@ function DynamicListClient({
62
60
  const handleAdd = useCallback(
63
61
  (e) => {
64
62
  var _a;
65
- const empty = isSingle ? "" : fields.reduce((obj, f) => {
66
- obj[(f == null ? void 0 : f.name) ?? ""] = "";
67
- return obj;
68
- }, {});
63
+ const empty = isSingle ? "" : fields.reduce(
64
+ (obj, f) => {
65
+ obj[(f == null ? void 0 : f.name) ?? ""] = "";
66
+ return obj;
67
+ },
68
+ {}
69
+ );
69
70
  const next = [...items, empty];
70
71
  setItems(next);
71
72
  (_a = buttonAddProps == null ? void 0 : buttonAddProps.onClick) == null ? void 0 : _a.call(buttonAddProps, e);
@@ -4,10 +4,16 @@ import { jsx } from "react/jsx-runtime";
4
4
  import { DynamicListView } from "./DynamicList.view.js";
5
5
  function DynamicListServer(props) {
6
6
  const { buttonDeleteProps, ...rest } = props;
7
- return /* @__PURE__ */ jsx(DynamicListView, { ...rest, buttonDeleteProps: {
8
- ...buttonDeleteProps,
9
- onClick: void 0
10
- } });
7
+ return /* @__PURE__ */ jsx(
8
+ DynamicListView,
9
+ {
10
+ ...rest,
11
+ buttonDeleteProps: {
12
+ ...buttonDeleteProps,
13
+ onClick: void 0
14
+ }
15
+ }
16
+ );
11
17
  }
12
18
  __name(DynamicListServer, "DynamicListServer");
13
19
  export {
@@ -70,8 +70,8 @@ function DynamicListView({
70
70
  "data-index": idx,
71
71
  disabled: disabled ?? (field == null ? void 0 : field.disabled),
72
72
  id: `${name}-${idx}-${field.name}`,
73
- name: single ? `${name}[${idx}]` : `${name}[${idx}].${field.name}`,
74
73
  required: required ?? (field == null ? void 0 : field.required),
74
+ name: single ? `${name}[${idx}]` : `${name}[${idx}].${field.name}`,
75
75
  value: single ? item : item[(field == null ? void 0 : field.name) ?? ""]
76
76
  },
77
77
  field.name