@kolking/react-ui 1.8.20 → 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 (43) hide show
  1. package/dist/Thumbnails-BlXFynlF.js +38 -0
  2. package/dist/components/Avatar/Avatar.js +12 -12
  3. package/dist/components/Badge/Badge.js +28 -29
  4. package/dist/components/Button/Button.d.ts +1 -1
  5. package/dist/components/Dialog/Dialog.js +44 -44
  6. package/dist/components/Dialog/useDialog.d.ts +1 -1
  7. package/dist/components/Dialog/useDialog.js +21 -29
  8. package/dist/components/Fields/Numeric.js +34 -36
  9. package/dist/components/Fields/Range.d.ts +1 -1
  10. package/dist/components/Fields/Range.js +33 -33
  11. package/dist/components/Flex/Flex.d.ts +1 -1
  12. package/dist/components/Gallery/Gallery.d.ts +11 -0
  13. package/dist/components/Gallery/Gallery.js +48 -0
  14. package/dist/components/Gallery/GalleryItem.d.ts +12 -0
  15. package/dist/components/Gallery/GalleryItem.js +41 -0
  16. package/dist/components/Gallery/index.d.ts +2 -0
  17. package/dist/components/Gallery/index.js +6 -0
  18. package/dist/components/Icon/Icon.js +125 -122
  19. package/dist/components/Icon/icons.d.ts +1 -1
  20. package/dist/components/Icon/icons.js +4 -0
  21. package/dist/components/Lightbox/Lightbox.d.ts +12 -0
  22. package/dist/components/Lightbox/Lightbox.js +150 -0
  23. package/dist/components/Lightbox/Thumbnail.d.ts +7 -0
  24. package/dist/components/Lightbox/Thumbnail.js +26 -0
  25. package/dist/components/Lightbox/Thumbnails.d.ts +11 -0
  26. package/dist/components/Lightbox/Thumbnails.js +8 -0
  27. package/dist/components/Lightbox/index.d.ts +1 -0
  28. package/dist/components/Lightbox/index.js +4 -0
  29. package/dist/components/Menu/Menu.js +44 -45
  30. package/dist/components/Menu/MenuItem.js +33 -33
  31. package/dist/components/Popover/Popover.js +40 -41
  32. package/dist/components/Segmented/Segmented.js +43 -47
  33. package/dist/components/Tag/Tag.d.ts +1 -1
  34. package/dist/components/ToggleButton/ToggleButton.d.ts +1 -1
  35. package/dist/components/ToggleButton/ToggleGroup.js +42 -40
  36. package/dist/components/Tooltip/Tooltip.js +30 -31
  37. package/dist/index.d.ts +3 -1
  38. package/dist/index.js +71 -63
  39. package/dist/styles/style.css +1 -1
  40. package/dist/styles.module-D0C-vMZX.js +7 -0
  41. package/dist/utils/helpers.d.ts +3 -1
  42. package/dist/utils/helpers.js +30 -19
  43. package/package.json +31 -32
@@ -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
+ };
@@ -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
  };
@@ -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-BG84zXZH.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
  };
@@ -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;
@@ -1,54 +1,54 @@
1
- import { jsxs as _, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
2
  import N from "classnames";
3
3
  import R, { useRef as x, useState as T, useEffect as j, useCallback as P } from "react";
4
4
  import { cssProps as V, wrapNode as A } from "../../utils/helpers.js";
5
- import { V as E } from "../../ValidationTooltip-N4SQpl9r.js";
6
- const J = "styles_range_j9iED", D = "styles_range_thumb_6aftN", F = "styles_range_wrapper_LTcAf", H = "styles_range_track_HdlJx", L = "styles_ticks_YaeJb", n = {
7
- range: J,
8
- range_thumb: D,
9
- range_wrapper: F,
10
- range_track: H,
11
- ticks: L
5
+ import { V as C } from "../../ValidationTooltip-N4SQpl9r.js";
6
+ const E = "styles_range_j9iED", J = "styles_range_thumb_6aftN", D = "styles_range_wrapper_LTcAf", F = "styles_range_track_HdlJx", H = "styles_ticks_YaeJb", s = {
7
+ range: E,
8
+ range_thumb: J,
9
+ range_wrapper: D,
10
+ range_track: F,
11
+ ticks: H
12
12
  };
13
- function f(r, t, e, s) {
14
- r == null || r.style.setProperty("--progress", `${(s - t) / (e - t)}`);
13
+ function _(a, r, t, n) {
14
+ a?.style.setProperty("--progress", `${(n - r) / (t - r)}`);
15
15
  }
16
- const M = ({ ticks: r }) => {
17
- const t = typeof r == "number" ? [...Array(r)] : r;
18
- return t.length < 2 ? null : /* @__PURE__ */ a("ul", { "data-range-ticks": !0, className: n.ticks, children: t.map((e, s) => /* @__PURE__ */ a("li", { children: e !== void 0 && /* @__PURE__ */ a("small", { children: e }) }, s)) });
19
- }, B = R.forwardRef(
20
- ({ size: r, height: t, error: e, ticks: s, className: m, style: y, children: u, onChange: c, ...i }, h) => {
21
- const { min: l = 0, max: o = 100, defaultValue: v = 50, value: p = v } = i, d = x(null), [k, b] = T(null);
16
+ const L = ({ ticks: a }) => {
17
+ const r = typeof a == "number" ? [...Array(a)] : a;
18
+ return r.length < 2 ? null : /* @__PURE__ */ e("ul", { "data-range-ticks": !0, className: s.ticks, children: r.map((t, n) => /* @__PURE__ */ e("li", { children: t !== void 0 && /* @__PURE__ */ e("small", { children: t }) }, n)) });
19
+ }, z = R.forwardRef(
20
+ ({ size: a, height: r, error: t, ticks: n, className: f, style: h, children: d, onChange: u, ...c }, y) => {
21
+ const { min: l = 0, max: o = 100, defaultValue: v = 50, value: g = v } = c, i = x(null), [k, b] = T(null);
22
22
  j(() => {
23
- f(d.current, l, o, p);
24
- }, [l, o, p]);
23
+ _(i.current, l, o, g);
24
+ }, [l, o, g]);
25
25
  const w = P(
26
- (g) => {
27
- f(d.current, l, o, parseFloat(g.currentTarget.value)), c == null || c(g);
26
+ (m) => {
27
+ _(i.current, l, o, parseFloat(m.currentTarget.value)), u?.(m);
28
28
  },
29
- [l, o, c]
29
+ [l, o, u]
30
30
  );
31
- return /* @__PURE__ */ _(
31
+ return /* @__PURE__ */ p(
32
32
  "div",
33
33
  {
34
- ref: d,
34
+ ref: i,
35
35
  "data-range": !0,
36
- "data-disabled": i.disabled,
37
- "data-invalid": e ? !0 : void 0,
38
- className: N(n.range, m),
39
- style: { ...y, ...V({ size: r, height: t }) },
36
+ "data-disabled": c.disabled,
37
+ "data-invalid": t ? !0 : void 0,
38
+ className: N(s.range, f),
39
+ style: { ...h, ...V({ size: a, height: r }) },
40
40
  children: [
41
- /* @__PURE__ */ _("div", { "data-range-wrapper": !0, className: n.range_wrapper, children: [
42
- /* @__PURE__ */ a("div", { "data-range-track": !0, className: n.range_track }),
43
- /* @__PURE__ */ a("div", { ref: b, "data-range-thumb": !0, className: n.range_thumb, children: u !== void 0 && A(u, "small") }),
44
- /* @__PURE__ */ a(E, { content: e, placement: "top", anchor: k, children: /* @__PURE__ */ a("input", { ...i, ref: h, type: "range", onChange: w }) })
41
+ /* @__PURE__ */ p("div", { "data-range-wrapper": !0, className: s.range_wrapper, children: [
42
+ /* @__PURE__ */ e("div", { "data-range-track": !0, className: s.range_track }),
43
+ /* @__PURE__ */ e("div", { ref: b, "data-range-thumb": !0, className: s.range_thumb, children: d !== void 0 && A(d, "small") }),
44
+ /* @__PURE__ */ e(C, { content: t, placement: "top", anchor: k, children: /* @__PURE__ */ e("input", { ...c, ref: y, type: "range", onChange: w }) })
45
45
  ] }),
46
- s !== void 0 && /* @__PURE__ */ a(M, { ticks: s })
46
+ n !== void 0 && /* @__PURE__ */ e(L, { ticks: n })
47
47
  ]
48
48
  }
49
49
  );
50
50
  }
51
51
  );
52
52
  export {
53
- B as Range
53
+ z as Range
54
54
  };
@@ -19,4 +19,4 @@ export declare const Flex: <T extends React.ElementType = "div">(props: {
19
19
  wrap?: React.CSSProperties["flexWrap"];
20
20
  marginStart?: React.CSSProperties["marginBlockStart"];
21
21
  marginEnd?: React.CSSProperties["marginBlockEnd"];
22
- } & Omit<React.PropsWithoutRef<React.ComponentProps<T>>, "direction" | "as" | "align" | "wrap" | "justify" | "marginStart" | "marginEnd" | "gap"> & React.RefAttributes<unknown>) => React.ReactElement | null;
22
+ } & Omit<React.PropsWithoutRef<React.ComponentProps<T>>, "as" | "align" | "wrap" | "justify" | "marginStart" | "marginEnd" | "direction" | "gap"> & React.RefAttributes<unknown>) => React.ReactElement | null;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { CompositeProps } from '@floating-ui/react';
3
+ export type GalleryProps = React.HTMLAttributes<HTMLDivElement> & Omit<CompositeProps, 'cols'> & {
4
+ cols?: number | 'auto';
5
+ gap?: React.CSSProperties['gap'];
6
+ itemSize?: React.CSSProperties['width'];
7
+ objectFit?: React.CSSProperties['objectFit'];
8
+ marginStart?: React.CSSProperties['marginBlockStart'];
9
+ marginEnd?: React.CSSProperties['marginBlockEnd'];
10
+ };
11
+ export declare const Gallery: ({ gap, loop, cols, itemSize, objectFit: imageObjectFit, marginStart, marginEnd, className, style, children, ...props }: GalleryProps) => import("react/jsx-runtime").JSX.Element;