@kolking/react-ui 1.8.19 → 1.9.0

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 (61) hide show
  1. package/dist/{Input-D46mAsdt.js → Input-BG84zXZH.js} +1 -1
  2. package/dist/Thumbnails-BlXFynlF.js +38 -0
  3. package/dist/ValidationTooltip-N4SQpl9r.js +32 -0
  4. package/dist/components/Avatar/Avatar.js +12 -12
  5. package/dist/components/Badge/Badge.js +28 -29
  6. package/dist/components/Button/Button.d.ts +1 -1
  7. package/dist/components/Dialog/Dialog.js +44 -44
  8. package/dist/components/Dialog/useDialog.d.ts +1 -1
  9. package/dist/components/Dialog/useDialog.js +21 -29
  10. package/dist/components/Fields/Checkbox.d.ts +1 -1
  11. package/dist/components/Fields/Checkbox.js +1 -1
  12. package/dist/components/Fields/Input.d.ts +1 -1
  13. package/dist/components/Fields/Input.js +2 -2
  14. package/dist/components/Fields/Numeric.js +34 -36
  15. package/dist/components/Fields/Radio.d.ts +1 -1
  16. package/dist/components/Fields/Radio.js +1 -1
  17. package/dist/components/Fields/Range.d.ts +1 -1
  18. package/dist/components/Fields/Range.js +33 -33
  19. package/dist/components/Fields/Select.d.ts +1 -1
  20. package/dist/components/Fields/Select.js +1 -1
  21. package/dist/components/Fields/Switch.d.ts +1 -1
  22. package/dist/components/Fields/Switch.js +1 -1
  23. package/dist/components/Fields/Textarea.d.ts +1 -1
  24. package/dist/components/Fields/Textarea.js +1 -1
  25. package/dist/components/Fields/ValidationTooltip.d.ts +1 -1
  26. package/dist/components/Fields/ValidationTooltip.js +1 -1
  27. package/dist/components/Fields/index.js +2 -2
  28. package/dist/components/Flex/Flex.d.ts +1 -1
  29. package/dist/components/Gallery/Gallery.d.ts +11 -0
  30. package/dist/components/Gallery/Gallery.js +48 -0
  31. package/dist/components/Gallery/GalleryItem.d.ts +12 -0
  32. package/dist/components/Gallery/GalleryItem.js +41 -0
  33. package/dist/components/Gallery/index.d.ts +2 -0
  34. package/dist/components/Gallery/index.js +6 -0
  35. package/dist/components/Icon/Icon.js +125 -122
  36. package/dist/components/Icon/icons.d.ts +1 -1
  37. package/dist/components/Icon/icons.js +4 -0
  38. package/dist/components/Lightbox/Lightbox.d.ts +12 -0
  39. package/dist/components/Lightbox/Lightbox.js +150 -0
  40. package/dist/components/Lightbox/Thumbnail.d.ts +7 -0
  41. package/dist/components/Lightbox/Thumbnail.js +26 -0
  42. package/dist/components/Lightbox/Thumbnails.d.ts +11 -0
  43. package/dist/components/Lightbox/Thumbnails.js +8 -0
  44. package/dist/components/Lightbox/index.d.ts +1 -0
  45. package/dist/components/Lightbox/index.js +4 -0
  46. package/dist/components/Menu/Menu.js +44 -45
  47. package/dist/components/Menu/MenuItem.js +33 -33
  48. package/dist/components/Popover/Popover.js +40 -41
  49. package/dist/components/Segmented/Segmented.js +43 -47
  50. package/dist/components/Tag/Tag.d.ts +1 -1
  51. package/dist/components/ToggleButton/ToggleButton.d.ts +1 -1
  52. package/dist/components/ToggleButton/ToggleGroup.js +42 -40
  53. package/dist/components/Tooltip/Tooltip.js +30 -31
  54. package/dist/index.d.ts +3 -1
  55. package/dist/index.js +71 -63
  56. package/dist/styles/style.css +1 -1
  57. package/dist/styles.module-D0C-vMZX.js +7 -0
  58. package/dist/utils/helpers.d.ts +3 -1
  59. package/dist/utils/helpers.js +30 -19
  60. package/package.json +31 -32
  61. package/dist/ValidationTooltip-D8d9O6Re.js +0 -31
@@ -2,7 +2,7 @@ import { jsxs as _, jsx as s } from "react/jsx-runtime";
2
2
  import u from "classnames";
3
3
  import h from "react";
4
4
  import { cssProps as m } from "./utils/helpers.js";
5
- import { s as t, V as x } from "./ValidationTooltip-D8d9O6Re.js";
5
+ import { s as t, V as x } from "./ValidationTooltip-N4SQpl9r.js";
6
6
  const w = "styles_checkbox_pxrU4", v = "styles_radio_0QV8R", k = "styles_label_K65D1", g = "styles_input_j6Qji", N = {
7
7
  checkbox: w,
8
8
  radio: v,
@@ -0,0 +1,38 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import a from "classnames";
3
+ import { Thumbnail as g } from "./components/Lightbox/Thumbnail.js";
4
+ import { cssProps as u, htmlImage as _ } from "./utils/helpers.js";
5
+ const x = "Lightbox_lightbox_JQunO", p = "Lightbox_images_WFWsL", L = "Lightbox_thumbnails_jQSPH", f = "Lightbox_willhide_z2lO8", d = "Lightbox_content_UfCvB", v = "Lightbox_prev_qIKJt", T = "Lightbox_next_qZR61", j = "Lightbox_close_SgBu9", w = {
6
+ lightbox: x,
7
+ images: p,
8
+ thumbnails: L,
9
+ willhide: f,
10
+ content: d,
11
+ prev: v,
12
+ next: T,
13
+ close: j
14
+ }, F = ({
15
+ images: o,
16
+ selected: i,
17
+ className: n,
18
+ style: e,
19
+ imageSize: h,
20
+ objectFit: c,
21
+ renderImage: b = _,
22
+ onSelect: m,
23
+ ...r
24
+ }) => o.length <= 1 ? null : /* @__PURE__ */ s(
25
+ "ul",
26
+ {
27
+ ...r,
28
+ role: "listbox",
29
+ "data-lightbox-thumbnails": !0,
30
+ className: a(w.thumbnails, n),
31
+ style: { ...e, ...u({ thumbnailSize: h, thumbnailObjectFit: c }) },
32
+ children: o.map((l, t) => /* @__PURE__ */ s(g, { index: t, selected: t === i, onSelect: m, children: b({ ...l, alt: l.alt ?? `Thumbnail ${t + 1}` }) }, t))
33
+ }
34
+ );
35
+ export {
36
+ F as T,
37
+ w as s
38
+ };
@@ -0,0 +1,32 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import a from "classnames";
3
+ import { Tooltip as o } from "./components/Tooltip/Tooltip.js";
4
+ const p = "styles_input_a-JHN", c = "styles_wrapper_b3-VW", l = "styles_date_S0YpO", _ = "styles_time_3ywit", i = "styles_search_y6sAm", n = "styles_number_auDA-", y = "styles_textarea_KRYGO", m = "styles_select_qhElj", w = "styles_tooltip_tBrt4", u = "styles_range_tSqtV", d = "styles_wrapper_prefix_KI25W", f = "styles_wrapper_accessory_yZjv0", x = {
5
+ input: p,
6
+ wrapper: c,
7
+ date: l,
8
+ time: _,
9
+ search: i,
10
+ number: n,
11
+ textarea: y,
12
+ select: m,
13
+ tooltip: w,
14
+ range: u,
15
+ wrapper_prefix: d,
16
+ wrapper_accessory: f
17
+ }, V = ({ content: t, className: s, ...e }) => /* @__PURE__ */ r(
18
+ o,
19
+ {
20
+ placement: "top-start",
21
+ trigger: "hover focus click",
22
+ ...e,
23
+ content: t,
24
+ "data-tooltip-validation": !0,
25
+ disabled: !t || typeof t != "string",
26
+ className: a(x.tooltip, s)
27
+ }
28
+ );
29
+ export {
30
+ V,
31
+ x as s
32
+ };
@@ -4,47 +4,47 @@ import * as m from "react";
4
4
  import { forwardRef as S, useMemo as x, useState as A, useEffect as N, useCallback as E } from "react";
5
5
  import { cssProps as C } from "../../utils/helpers.js";
6
6
  import { getStringColor as k, getGravatarUri as M, getInitials as R } from "./helpers.js";
7
- const b = (a, t) => /* @__PURE__ */ m.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 50 50", ref: t, ...a }, /* @__PURE__ */ m.createElement("path", { fill: "currentColor", d: "M25 31c4.97 0 9-4.253 9-9.5S29.97 12 25 12s-9 4.253-9 9.5 4.03 9.5 9 9.5Zm19 19c0-8.837-8.507-15-19-15S6 41.163 6 50h38Z" })), j = S(b), y = "Avatar_avatar_PNlL5", I = "Avatar_image_Jwmxk", P = "Avatar_initials_i0r2T", e = {
7
+ const b = (a, e) => /* @__PURE__ */ m.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 50 50", ref: e, ...a }, /* @__PURE__ */ m.createElement("path", { fill: "currentColor", d: "M25 31c4.97 0 9-4.253 9-9.5S29.97 12 25 12s-9 4.253-9 9.5 4.03 9.5 9 9.5Zm19 19c0-8.837-8.507-15-19-15S6 41.163 6 50h38Z" })), j = S(b), y = "Avatar_avatar_PNlL5", I = "Avatar_image_Jwmxk", P = "Avatar_initials_i0r2T", r = {
8
8
  avatar: y,
9
9
  image: I,
10
10
  initials: P,
11
11
  default: "Avatar_default_v75Mg"
12
12
  }, J = ({
13
13
  size: a = 50,
14
- name: t,
14
+ name: e,
15
15
  email: o,
16
- src: c,
16
+ src: n,
17
17
  colorize: v,
18
18
  className: d,
19
19
  style: u,
20
20
  children: g,
21
21
  ...f
22
22
  }) => {
23
- const r = t == null ? void 0 : t.trim(), p = v && r ? k(r) : void 0, s = x(() => c || (o ? M(a, o) : void 0), [c, a, o]), [l, n] = A(s);
23
+ const t = e?.trim(), p = v && t ? k(t) : void 0, s = x(() => n || (o ? M(a, o) : void 0), [n, a, o]), [c, l] = A(s);
24
24
  N(() => {
25
- n(s);
25
+ l(s);
26
26
  }, [s]);
27
27
  const w = E(() => {
28
- n(void 0);
28
+ l(void 0);
29
29
  }, []);
30
30
  return /* @__PURE__ */ _(
31
31
  "div",
32
32
  {
33
33
  ...f,
34
34
  "data-avatar": !0,
35
- className: h(e.avatar, d),
35
+ className: h(r.avatar, d),
36
36
  style: { ...u, ...C({ size: a, backgroundColor: p }) },
37
37
  children: [
38
- l ? /* @__PURE__ */ i(
38
+ c ? /* @__PURE__ */ i(
39
39
  "img",
40
40
  {
41
41
  "data-avatar-image": !0,
42
- className: e.image,
43
- src: l,
44
- alt: r ?? "",
42
+ className: r.image,
43
+ src: c,
44
+ alt: t ?? "",
45
45
  onError: w
46
46
  }
47
- ) : r ? /* @__PURE__ */ i("span", { "data-avatar-initials": !0, className: e.initials, children: R(r) }) : /* @__PURE__ */ i(j, { "aria-hidden": !0, "data-avatar-default": !0, className: e.default }),
47
+ ) : t ? /* @__PURE__ */ i("span", { "data-avatar-initials": !0, className: r.initials, children: R(t) }) : /* @__PURE__ */ i(j, { "aria-hidden": !0, "data-avatar-default": !0, className: r.default }),
48
48
  g
49
49
  ]
50
50
  }
@@ -2,64 +2,63 @@ import { jsx as h } from "react/jsx-runtime";
2
2
  import { useRef as _, useLayoutEffect as w, useEffect as l } from "react";
3
3
  import E from "classnames";
4
4
  import { wrapNode as P, cssProps as H } from "../../utils/helpers.js";
5
- const M = "Badge_badge_-mEE7", k = "Badge_appear_LbxbS", x = "Badge_accent_BIYve", L = "Badge_gray_7jA-J", I = "Badge_brown_x1GS7", R = "Badge_red_zPgCR", S = "Badge_orange_EoLmF", X = "Badge_yellow_qvbb6", j = "Badge_green_XX-1c", v = "Badge_teal_VHoFK", C = "Badge_cyan_1ksBn", F = "Badge_blue_YulfT", K = "Badge_indigo_2KXUy", N = "Badge_purple_o55fQ", O = "Badge_pink_T5H--", g = {
5
+ const M = "Badge_badge_-mEE7", k = "Badge_appear_LbxbS", x = "Badge_accent_BIYve", L = "Badge_gray_7jA-J", v = "Badge_brown_x1GS7", I = "Badge_red_zPgCR", R = "Badge_orange_EoLmF", S = "Badge_yellow_qvbb6", X = "Badge_green_XX-1c", j = "Badge_teal_VHoFK", C = "Badge_cyan_1ksBn", F = "Badge_blue_YulfT", K = "Badge_indigo_2KXUy", N = "Badge_purple_o55fQ", O = "Badge_pink_T5H--", d = {
6
6
  badge: M,
7
7
  appear: k,
8
8
  accent: x,
9
9
  gray: L,
10
- brown: I,
11
- red: R,
12
- orange: S,
13
- yellow: X,
14
- green: j,
15
- teal: v,
10
+ brown: v,
11
+ red: I,
12
+ orange: R,
13
+ yellow: S,
14
+ green: X,
15
+ teal: j,
16
16
  cyan: C,
17
17
  blue: F,
18
18
  indigo: K,
19
19
  purple: N,
20
20
  pink: O
21
21
  };
22
- function T(a) {
23
- const n = _();
22
+ function T(o) {
23
+ const n = _(void 0);
24
24
  return l(() => {
25
- n.current = a;
25
+ n.current = o;
26
26
  }), n.current;
27
27
  }
28
28
  const A = ({
29
- size: a,
29
+ size: o,
30
30
  scheme: n = "red",
31
- placement: s = "top-right",
32
- value: o,
33
- maxValue: c = 99,
31
+ placement: a = "top-right",
32
+ value: r,
33
+ maxValue: s = 99,
34
34
  className: u,
35
35
  style: f,
36
36
  ...y
37
37
  }) => {
38
- const e = !o, p = T(e), t = _(null);
38
+ const e = !r, g = T(e), t = _(null);
39
39
  if (w(() => {
40
- var r;
41
- p && !e && ((r = t.current) == null || r.classList.add(g.appear));
42
- }, [p, e]), l(() => {
43
- if (!e && s && t.current) {
44
- const r = t.current.clientHeight, d = t.current.parentElement, i = d ? Math.min(
45
- parseInt(getComputedStyle(d).getPropertyValue("border-radius")),
46
- d.clientHeight / 2
47
- ) : 0, b = i * (1 - Math.sin(45 * Math.PI / 180)), m = (1 + Math.min(i / r, 1)) * (r / 4);
40
+ g && !e && t.current?.classList.add(d.appear);
41
+ }, [g, e]), l(() => {
42
+ if (!e && a && t.current) {
43
+ const i = t.current.clientHeight, c = t.current.parentElement, p = c ? Math.min(
44
+ parseInt(getComputedStyle(c).getPropertyValue("border-radius")),
45
+ c.clientHeight / 2
46
+ ) : 0, b = p * (1 - Math.sin(45 * Math.PI / 180)), m = (1 + Math.min(p / i, 1)) * (i / 4);
48
47
  t.current.style.setProperty("--offset", `${b - m}px`);
49
48
  }
50
- }, [e, s]), e)
49
+ }, [e, a]), e)
51
50
  return null;
52
- const B = typeof o == "number" && c > 0 && o > c;
51
+ const B = typeof r == "number" && s > 0 && r > s;
53
52
  return /* @__PURE__ */ h(
54
53
  "div",
55
54
  {
56
55
  ...y,
57
56
  ref: t,
58
57
  "data-badge": n,
59
- "data-placement": s,
60
- className: E(g.badge, g[n], u),
61
- style: { ...f, ...H({ size: a }) },
62
- children: P(B ? `${c}+` : o, "span")
58
+ "data-placement": a,
59
+ className: E(d.badge, d[n], u),
60
+ style: { ...f, ...H({ size: o }) },
61
+ children: P(B ? `${s}+` : r, "span")
63
62
  }
64
63
  );
65
64
  };
@@ -23,4 +23,4 @@ export declare const Button: <T extends React.ElementType = "button">(props: {
23
23
  title?: React.ReactNode;
24
24
  icon?: React.ReactElement;
25
25
  iconPosition?: "start" | "end";
26
- } & Omit<React.PropsWithoutRef<React.ComponentProps<T>>, "title" | "size" | "as" | "icon" | "scheme" | "minWidth" | "maxWidth" | "variant" | "busy" | "iconPosition"> & React.RefAttributes<unknown>) => React.ReactElement | null;
26
+ } & Omit<React.PropsWithoutRef<React.ComponentProps<T>>, "title" | "as" | "size" | "icon" | "scheme" | "minWidth" | "maxWidth" | "variant" | "busy" | "iconPosition"> & React.RefAttributes<unknown>) => React.ReactElement | null;
@@ -1,16 +1,16 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import h, { useState as x, useLayoutEffect as m, useContext as y } from "react";
2
+ import h, { useState as x, useLayoutEffect as m, useContext as p } from "react";
3
3
  import s from "classnames";
4
- import { useFloating as N, useInteractions as L, useDismiss as E, useRole as S, useMergeRefs as k, FloatingPortal as M, FloatingOverlay as O, FloatingFocusManager as Q, useId as j } from "@floating-ui/react";
5
- import { cssProps as q } from "../../utils/helpers.js";
6
- import { DialogContext as d } from "./DialogContext.js";
7
- import { Button as w } from "../Button/Button.js";
8
- import { Heading as B } from "../Heading/Heading.js";
9
- import { Icon as G } from "../Icon/Icon.js";
10
- const H = "Dialog_overlay_C98Qt", J = "Dialog_dialog_G3gxL", P = "Dialog_title_2pDPQ", V = "Dialog_footer_N-aEV", z = "Dialog_close_JSEkn", r = {
11
- overlay: H,
12
- dialog: J,
13
- title: P,
4
+ import { useFloating as N, useInteractions as P, useDismiss as L, useRole as E, useMergeRefs as S, FloatingPortal as k, FloatingOverlay as M, FloatingFocusManager as O, useId as Q } from "@floating-ui/react";
5
+ import { cssProps as j } from "../../utils/helpers.js";
6
+ import { DialogContext as c } from "./DialogContext.js";
7
+ import { Button as q } from "../Button/Button.js";
8
+ import { Heading as w } from "../Heading/Heading.js";
9
+ import { Icon as B } from "../Icon/Icon.js";
10
+ const G = "Dialog_overlay_C98Qt", H = "Dialog_dialog_G3gxL", J = "Dialog_title_2pDPQ", V = "Dialog_footer_N-aEV", z = "Dialog_close_JSEkn", i = {
11
+ overlay: G,
12
+ dialog: H,
13
+ title: J,
14
14
  footer: V,
15
15
  close: z
16
16
  }, oo = h.forwardRef(
@@ -19,73 +19,73 @@ const H = "Dialog_overlay_C98Qt", J = "Dialog_dialog_G3gxL", P = "Dialog_title_2
19
19
  size: e,
20
20
  width: a,
21
21
  lockScroll: l = !0,
22
- style: i,
23
- className: v,
24
- children: D,
25
- setTriggerProps: n,
26
- requestClose: u,
27
- ..._
28
- }, p) => {
29
- const [f, b] = x(), { refs: F, context: c } = N({
22
+ style: r,
23
+ className: y,
24
+ children: v,
25
+ setTriggerProps: d,
26
+ requestClose: g,
27
+ ...D
28
+ }, _) => {
29
+ const [u, b] = x(), { refs: F, context: n } = N({
30
30
  open: o,
31
- onOpenChange: u
32
- }), { getFloatingProps: C, getReferenceProps: g } = L([
33
- E(c),
34
- S(c, { role: "dialog" })
31
+ onOpenChange: g
32
+ }), { getFloatingProps: C, getReferenceProps: f } = P([
33
+ L(n),
34
+ E(n, { role: "dialog" })
35
35
  ]);
36
36
  m(() => {
37
- n == null || n(g());
38
- }, [n, g]);
39
- const I = k([F.setFloating, p]), R = document.querySelector("[data-floating-root]") ?? document.body;
40
- return o ? /* @__PURE__ */ t(d.Provider, { value: { labelId: f, setLabelId: b, requestClose: u }, children: /* @__PURE__ */ t(M, { root: R, children: /* @__PURE__ */ t(
41
- O,
37
+ d?.(f());
38
+ }, [d, f]);
39
+ const I = S([F.setFloating, _]), R = document.querySelector("[data-floating-root]") ?? document.body;
40
+ return o ? /* @__PURE__ */ t(c.Provider, { value: { labelId: u, setLabelId: b, requestClose: g }, children: /* @__PURE__ */ t(k, { root: R, children: /* @__PURE__ */ t(
41
+ M,
42
42
  {
43
43
  "data-floating-root": !0,
44
44
  "data-dialog-overlay": !0,
45
45
  lockScroll: l,
46
- className: r.overlay,
47
- children: /* @__PURE__ */ t(Q, { context: c, children: /* @__PURE__ */ t(
46
+ className: i.overlay,
47
+ children: /* @__PURE__ */ t(O, { context: n, children: /* @__PURE__ */ t(
48
48
  "div",
49
49
  {
50
- ...C(_),
50
+ ...C(D),
51
51
  ref: I,
52
52
  "data-dialog": !0,
53
53
  "data-open": o,
54
- "aria-labelledby": f,
55
- className: s(r.dialog, v),
56
- style: { ...i, ...q({ size: e, width: a }) },
57
- children: D
54
+ "aria-labelledby": u,
55
+ className: s(i.dialog, y),
56
+ style: { ...r, ...j({ size: e, width: a }) },
57
+ children: v
58
58
  }
59
59
  ) })
60
60
  }
61
61
  ) }) }) : null;
62
62
  }
63
63
  ), to = ({ className: o, children: e, ...a }) => {
64
- const l = j(), { setLabelId: i } = y(d);
65
- return m(() => (i(l), () => i(void 0)), [l, i]), /* @__PURE__ */ t(
66
- B,
64
+ const l = Q(), { setLabelId: r } = p(c);
65
+ return m(() => (r(l), () => r(void 0)), [l, r]), /* @__PURE__ */ t(
66
+ w,
67
67
  {
68
68
  as: "h4",
69
69
  ...a,
70
70
  id: l,
71
71
  "data-dialog-title": !0,
72
72
  title: e,
73
- className: s(r.title, o)
73
+ className: s(i.title, o)
74
74
  }
75
75
  );
76
- }, eo = (o) => /* @__PURE__ */ t("div", { ...o, "data-dialog-content": !0 }), ao = ({ className: o, ...e }) => /* @__PURE__ */ t("div", { ...e, "data-dialog-footer": !0, className: s(r.footer, o) }), lo = ({ className: o, ...e }) => {
77
- const { requestClose: a } = y(d);
76
+ }, eo = (o) => /* @__PURE__ */ t("div", { ...o, "data-dialog-content": !0 }), ao = ({ className: o, ...e }) => /* @__PURE__ */ t("div", { ...e, "data-dialog-footer": !0, className: s(i.footer, o) }), lo = ({ className: o, ...e }) => {
77
+ const { requestClose: a } = p(c);
78
78
  return /* @__PURE__ */ t(
79
- w,
79
+ q,
80
80
  {
81
81
  type: "button",
82
82
  variant: "tertiary",
83
83
  "aria-label": "close dialog",
84
- icon: /* @__PURE__ */ t(G, { name: "close" }),
84
+ icon: /* @__PURE__ */ t(B, { name: "close" }),
85
85
  onClick: a,
86
86
  ...e,
87
87
  "data-dialog-close": !0,
88
- className: s(r.close, o)
88
+ className: s(i.close, o)
89
89
  }
90
90
  );
91
91
  };
@@ -7,7 +7,7 @@ export type DialogOptions<T, R> = {
7
7
  export type DialogType<T, R> = ReturnType<typeof useDialog<T, R>>;
8
8
  export declare function useDialog<T, R>(options?: DialogOptions<T, R>): {
9
9
  props: {
10
- ref: import('react').RefObject<HTMLDivElement>;
10
+ ref: import('react').RefObject<HTMLDivElement | null>;
11
11
  open: boolean;
12
12
  setTriggerProps: import('react').Dispatch<import('react').SetStateAction<{}>>;
13
13
  requestClose: () => void;
@@ -1,40 +1,32 @@
1
- import { useRef as l, useState as f, useCallback as o } from "react";
2
- function T(r, a) {
3
- const c = r ? Math.max(
4
- ...getComputedStyle(r).transitionDuration.split(",").map((t) => parseFloat(t) * 1e3)
5
- ) : 0;
6
- setTimeout(a, c);
7
- }
8
- function v(r) {
9
- const a = l(null), c = l(r), t = l(!1), [D, b] = f({}), [h, p] = f((r == null ? void 0 : r.defaultOpen) ?? !1), [w, d] = f();
10
- c.current = r;
11
- const g = o((e) => {
12
- var n, s;
13
- t.current || (p(!0), d(e), (s = (n = c.current) == null ? void 0 : n.onShow) == null || s.call(n, e));
14
- }, []), u = o((e) => {
15
- var n;
16
- t.current || (t.current = !0, (n = a.current) == null || n.setAttribute("data-open", "false"), T(a.current, () => {
17
- var s, C, i, y;
18
- e !== void 0 ? (C = (s = c.current) == null ? void 0 : s.onConfirm) == null || C.call(s, e) : (y = (i = c.current) == null ? void 0 : i.onCancel) == null || y.call(i), p(!1), d(void 0), t.current = !1;
1
+ import { useRef as u, useState as a, useCallback as t } from "react";
2
+ import { afterTransition as y } from "../../utils/helpers.js";
3
+ function h(s) {
4
+ const c = u(null), n = u(s), r = u(!1), [g, d] = a({}), [m, f] = a(s?.defaultOpen ?? !1), [C, i] = a();
5
+ n.current = s;
6
+ const l = t((e) => {
7
+ r.current || (f(!0), i(e), n.current?.onShow?.(e));
8
+ }, []), o = t((e) => {
9
+ r.current || (r.current = !0, c.current?.setAttribute("data-open", "false"), y(c.current, () => {
10
+ e !== void 0 ? n.current?.onConfirm?.(e) : n.current?.onCancel?.(), f(!1), i(void 0), r.current = !1;
19
11
  }));
20
- }, []), m = o(() => u(), [u]), O = o((e) => u(e), [u]), S = o(async (e) => {
21
- t.current = !0;
12
+ }, []), p = t(() => o(), [o]), b = t((e) => o(e), [o]), w = t(async (e) => {
13
+ r.current = !0;
22
14
  try {
23
15
  return await e;
24
16
  } finally {
25
- t.current = !1;
17
+ r.current = !1;
26
18
  }
27
19
  }, []);
28
20
  return {
29
- props: { ref: a, open: h, setTriggerProps: b, requestClose: m },
30
- trigger: { ...D, onClick: g },
31
- data: w,
32
- show: g,
33
- cancel: m,
34
- confirm: O,
35
- preventClose: S
21
+ props: { ref: c, open: m, setTriggerProps: d, requestClose: p },
22
+ trigger: { ...g, onClick: l },
23
+ data: C,
24
+ show: l,
25
+ cancel: p,
26
+ confirm: b,
27
+ preventClose: w
36
28
  };
37
29
  }
38
30
  export {
39
- v as useDialog
31
+ h as useDialog
40
32
  };
@@ -6,7 +6,7 @@ export type CheckboxProps = BaseInputProps & {
6
6
  };
7
7
  export declare const Checkbox: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
8
8
  size?: "xs" | "sm" | "md" | "lg" | "xl";
9
- error?: string;
9
+ error?: string | boolean;
10
10
  } & {
11
11
  label?: React.ReactNode;
12
12
  indeterminate?: boolean;
@@ -2,7 +2,7 @@ import { jsxs as h, jsx as a } from "react/jsx-runtime";
2
2
  import i from "classnames";
3
3
  import p, { useRef as x, useImperativeHandle as b, useEffect as k } from "react";
4
4
  import { cssProps as R } from "../../utils/helpers.js";
5
- import { I as y, s as l } from "../../Input-D46mAsdt.js";
5
+ import { I as y, s as l } from "../../Input-BG84zXZH.js";
6
6
  const q = p.forwardRef(
7
7
  ({ size: c, error: n, label: t, className: u, style: f, required: m, indeterminate: r, ...o }, d) => {
8
8
  const s = o.checked, e = x(null);
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  export type BaseInputProps<T = React.InputHTMLAttributes<HTMLInputElement>> = Omit<T, 'size'> & {
3
3
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
- error?: string;
4
+ error?: string | boolean;
5
5
  };
6
6
  export type InputProps = Omit<BaseInputProps, 'prefix'> & {
7
7
  wrapperType?: string;
@@ -2,8 +2,8 @@ import "react/jsx-runtime";
2
2
  import "classnames";
3
3
  import "react";
4
4
  import "../../utils/helpers.js";
5
- import "../../ValidationTooltip-D8d9O6Re.js";
6
- import { I as a } from "../../Input-D46mAsdt.js";
5
+ import "../../ValidationTooltip-N4SQpl9r.js";
6
+ import { I as a } from "../../Input-BG84zXZH.js";
7
7
  export {
8
8
  a as Input
9
9
  };
@@ -1,56 +1,54 @@
1
- import { jsxs as f, jsx as a } from "react/jsx-runtime";
2
- import y from "classnames";
3
- import _, { useRef as h, useImperativeHandle as v, useCallback as s } from "react";
4
- import { Icon as i } from "../Icon/Icon.js";
5
- import { Button as o } from "../Button/Button.js";
1
+ import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
+ import b from "classnames";
3
+ import f, { useRef as y, useImperativeHandle as _, useCallback as a } from "react";
4
+ import { Icon as c } from "../Icon/Icon.js";
5
+ import { Button as s } from "../Button/Button.js";
6
6
  import "../../utils/helpers.js";
7
- import { I as w } from "../../Input-D46mAsdt.js";
8
- const E = "styles_numeric_dzUSE", R = "styles_increase_5S-Jo", g = "styles_decrease_j8UR6", c = {
9
- numeric: E,
10
- increase: R,
11
- decrease: g
12
- }, C = _.forwardRef(
13
- ({ labelIncrease: l = "increase", labelDecrease: d = "decrease", className: u, ...n }, m) => {
14
- const e = h(null);
15
- v(m, () => e.current);
16
- const p = s(() => {
17
- var r, t;
18
- (r = e.current) == null || r.stepUp(), (t = e.current) == null || t.dispatchEvent(new Event("change", { bubbles: !0 }));
19
- }, []), b = s(() => {
20
- var r, t;
21
- (r = e.current) == null || r.stepDown(), (t = e.current) == null || t.dispatchEvent(new Event("change", { bubbles: !0 }));
7
+ import { I as h } from "../../Input-BG84zXZH.js";
8
+ const v = "styles_numeric_dzUSE", w = "styles_increase_5S-Jo", E = "styles_decrease_j8UR6", t = {
9
+ numeric: v,
10
+ increase: w,
11
+ decrease: E
12
+ }, k = f.forwardRef(
13
+ ({ labelIncrease: i = "increase", labelDecrease: o = "decrease", className: l, ...n }, d) => {
14
+ const e = y(null);
15
+ _(d, () => e.current);
16
+ const u = a(() => {
17
+ e.current?.stepUp(), e.current?.dispatchEvent(new Event("change", { bubbles: !0 }));
18
+ }, []), m = a(() => {
19
+ e.current?.stepDown(), e.current?.dispatchEvent(new Event("change", { bubbles: !0 }));
22
20
  }, []);
23
- return /* @__PURE__ */ f(
24
- w,
21
+ return /* @__PURE__ */ p(
22
+ h,
25
23
  {
26
24
  ...n,
27
25
  ref: e,
28
26
  type: "number",
29
27
  wrapperType: "numeric",
30
- className: y(c.numeric, u),
28
+ className: b(t.numeric, l),
31
29
  children: [
32
- /* @__PURE__ */ a(
33
- o,
30
+ /* @__PURE__ */ r(
31
+ s,
34
32
  {
35
33
  type: "button",
36
34
  variant: "secondary",
37
- "aria-label": l,
35
+ "aria-label": i,
38
36
  disabled: n.disabled || n.readOnly,
39
- className: c.increase,
40
- icon: /* @__PURE__ */ a(i, { name: "triangle-up" }),
41
- onClick: p
37
+ className: t.increase,
38
+ icon: /* @__PURE__ */ r(c, { name: "triangle-up" }),
39
+ onClick: u
42
40
  }
43
41
  ),
44
- /* @__PURE__ */ a(
45
- o,
42
+ /* @__PURE__ */ r(
43
+ s,
46
44
  {
47
45
  type: "button",
48
46
  variant: "secondary",
49
- "aria-label": d,
47
+ "aria-label": o,
50
48
  disabled: n.disabled || n.readOnly,
51
- className: c.decrease,
52
- icon: /* @__PURE__ */ a(i, { name: "triangle-down" }),
53
- onClick: b
49
+ className: t.decrease,
50
+ icon: /* @__PURE__ */ r(c, { name: "triangle-down" }),
51
+ onClick: m
54
52
  }
55
53
  )
56
54
  ]
@@ -59,5 +57,5 @@ const E = "styles_numeric_dzUSE", R = "styles_increase_5S-Jo", g = "styles_decre
59
57
  }
60
58
  );
61
59
  export {
62
- C as Numeric
60
+ k as Numeric
63
61
  };
@@ -5,7 +5,7 @@ export type RadioProps = BaseInputProps & {
5
5
  };
6
6
  export declare const Radio: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
7
7
  size?: "xs" | "sm" | "md" | "lg" | "xl";
8
- error?: string;
8
+ error?: string | boolean;
9
9
  } & {
10
10
  label?: React.ReactNode;
11
11
  } & React.RefAttributes<HTMLInputElement>>;
@@ -2,7 +2,7 @@ import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
2
  import c from "classnames";
3
3
  import f from "react";
4
4
  import { cssProps as n } from "../../utils/helpers.js";
5
- import { I as u, s as t } from "../../Input-D46mAsdt.js";
5
+ import { I as u, s as t } from "../../Input-BG84zXZH.js";
6
6
  const j = f.forwardRef(
7
7
  ({ size: r, error: e, label: a, className: s, style: d, required: i, ...m }, l) => /* @__PURE__ */ p(
8
8
  "label",
@@ -10,7 +10,7 @@ export type RangeProps = Omit<BaseInputProps, 'min' | 'max' | 'value' | 'default
10
10
  defaultValue?: number;
11
11
  ticks?: TickMarksProps['ticks'];
12
12
  };
13
- export declare const Range: React.ForwardRefExoticComponent<Omit<BaseInputProps, "max" | "min" | "defaultValue" | "value"> & {
13
+ export declare const Range: React.ForwardRefExoticComponent<Omit<BaseInputProps, "defaultValue" | "value" | "max" | "min"> & {
14
14
  min?: number;
15
15
  max?: number;
16
16
  value?: number;