welcome-ui 10.1.2 → 10.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Field.js CHANGED
@@ -14,44 +14,44 @@ const W = "_root_1sq1k_2", z = "_label_1sq1k_8", E = "_hint_1sq1k_8", G = "_inli
14
14
  "hint-max-length": "_hint-max-length_1sq1k_46",
15
15
  visuallyHidden: J
16
16
  }, h = S(K), y = C({
17
- getInputProps: (i) => i,
17
+ getInputProps: (n) => n,
18
18
  hintID: "",
19
19
  labelID: "",
20
20
  variant: void 0
21
21
  });
22
- function _(i) {
22
+ function _(n) {
23
23
  const o = A();
24
- return i || o;
24
+ return n || o;
25
25
  }
26
26
  function P() {
27
27
  return L(y);
28
28
  }
29
- const O = T((i, o) => {
29
+ const O = T((n, o) => {
30
30
  const {
31
31
  children: I,
32
- className: p,
32
+ className: N,
33
33
  disabled: d,
34
34
  error: f,
35
35
  hideLabel: g,
36
36
  hint: D,
37
- hintProps: t,
38
- id: N,
37
+ hintProps: a,
38
+ id: p,
39
39
  inline: q,
40
40
  label: F,
41
- labelProps: a,
41
+ labelProps: i,
42
42
  maxLength: e,
43
43
  required: c,
44
44
  success: v,
45
45
  warning: x,
46
46
  ...k
47
- } = i, n = f ? "danger" : v ? "success" : x ? "warning" : void 0, l = f ?? x ?? v ?? D ?? (e ? `${new Intl.NumberFormat().format(e.count)} / ${new Intl.NumberFormat().format(e.max)}` : void 0), r = _(a == null ? void 0 : a.id), s = _(t == null ? void 0 : t.id), m = _(N), H = $(
47
+ } = n, t = f ? "danger" : v ? "success" : x ? "warning" : void 0, l = f ?? x ?? v ?? D ?? (e ? `${new Intl.NumberFormat().format(e.count)} / ${new Intl.NumberFormat().format(e.max)}` : void 0), s = _(i == null ? void 0 : i.id), r = _(a == null ? void 0 : a.id), m = _(p), H = $(
48
48
  () => ({
49
49
  getInputProps(u) {
50
- const j = [u["aria-describedby"], l && s].filter(Boolean).join(" ") || void 0, B = [u["aria-labelledby"], r].filter(Boolean).join(" ");
50
+ const j = [u["aria-describedby"], l && r].filter(Boolean).join(" ") || void 0, B = [u["aria-labelledby"], s].filter(Boolean).join(" ");
51
51
  return {
52
52
  ...u,
53
53
  "aria-describedby": j,
54
- "aria-invalid": n === "danger" ? !0 : void 0,
54
+ "aria-invalid": t === "danger" ? !0 : void 0,
55
55
  "aria-labelledby": B,
56
56
  disabled: d,
57
57
  id: m,
@@ -62,23 +62,23 @@ const O = T((i, o) => {
62
62
  required: c
63
63
  };
64
64
  },
65
- hintID: s,
66
- labelID: r,
67
- variant: n
65
+ hintID: r,
66
+ labelID: s,
67
+ variant: t
68
68
  }),
69
- [s, r, n, l, d, m, e == null ? void 0 : e.max, c]
69
+ [r, s, t, l, d, m, e == null ? void 0 : e.max, c]
70
70
  );
71
- return /* @__PURE__ */ w("div", { ref: o, ...k, className: h("root", q && "inline", p), children: [
71
+ return /* @__PURE__ */ w("div", { ref: o, ...k, className: h("root", q && "inline", N), children: [
72
72
  /* @__PURE__ */ b(
73
73
  R,
74
74
  {
75
- className: h("label", g && "visuallyHidden"),
76
75
  disabled: d,
77
76
  htmlFor: m,
78
- id: r,
77
+ id: s,
79
78
  required: c,
80
- variant: n,
81
- ...a,
79
+ variant: t,
80
+ ...i,
81
+ className: h("label", g && "visuallyHidden", i == null ? void 0 : i.className),
82
82
  children: F
83
83
  }
84
84
  ),
@@ -87,9 +87,9 @@ const O = T((i, o) => {
87
87
  M,
88
88
  {
89
89
  className: h("hint", !!e && "hint-max-length"),
90
- id: s,
91
- variant: n,
92
- ...t,
90
+ id: r,
91
+ variant: t,
92
+ ...a,
93
93
  children: l
94
94
  }
95
95
  ) : null
package/dist/Swiper.js CHANGED
@@ -1,88 +1,88 @@
1
1
  "use client";
2
2
  import './Swiper.css';
3
- import { jsx as E } from "react/jsx-runtime";
4
- import { a as H, g as fo, c as K } from "./index-PAaZGbyz.js";
5
- import { useEffect as T, useLayoutEffect as uo, useState as F, useRef as Z, Children as co, cloneElement as po, createContext as mo, useContext as ko, useMemo as oo, useCallback as R } from "react";
3
+ import { jsx as W } from "react/jsx-runtime";
4
+ import { a as G, g as fo, c as K } from "./index-PAaZGbyz.js";
5
+ import { useEffect as j, useLayoutEffect as uo, useState as A, useRef as Z, Children as co, cloneElement as po, createContext as mo, useContext as ko, useMemo as oo, useCallback as F } from "react";
6
6
  import { Button as io } from "./Button.js";
7
7
  import { Icon as lo } from "./Icon.js";
8
8
  var Y, no;
9
9
  function xo() {
10
10
  if (no) return Y;
11
11
  no = 1;
12
- var r = "Expected a function", t = NaN, n = "[object Symbol]", s = /^\s+|\s+$/g, c = /^[-+]0x[0-9a-f]+$/i, f = /^0b[01]+$/i, o = /^0o[0-7]+$/i, d = parseInt, x = typeof H == "object" && H && H.Object === Object && H, a = typeof self == "object" && self && self.Object === Object && self, C = x || a || Function("return this")(), S = Object.prototype, j = S.toString, $ = Math.max, y = Math.min, P = function() {
13
- return C.Date.now();
12
+ var r = "Expected a function", n = NaN, i = "[object Symbol]", t = /^\s+|\s+$/g, a = /^[-+]0x[0-9a-f]+$/i, b = /^0b[01]+$/i, e = /^0o[0-7]+$/i, c = parseInt, m = typeof G == "object" && G && G.Object === Object && G, d = typeof self == "object" && self && self.Object === Object && self, g = m || d || Function("return this")(), y = Object.prototype, E = y.toString, I = Math.max, $ = Math.min, h = function() {
13
+ return g.Date.now();
14
14
  };
15
- function N(e, b, h) {
16
- var m, v, L, O, i, u, g = 0, _ = !1, w = !1, z = !0;
17
- if (typeof e != "function")
15
+ function N(o, f, k) {
16
+ var v, P, B, O, l, p, u = 0, L = !1, z = !1, S = !0;
17
+ if (typeof o != "function")
18
18
  throw new TypeError(r);
19
- b = A(b) || 0, p(h) && (_ = !!h.leading, w = "maxWait" in h, L = w ? $(A(h.maxWait) || 0, b) : L, z = "trailing" in h ? !!h.trailing : z);
20
- function V(l) {
21
- var W = m, B = v;
22
- return m = v = void 0, g = l, O = e.apply(B, W), O;
19
+ f = C(f) || 0, w(k) && (L = !!k.leading, z = "maxWait" in k, B = z ? I(C(k.maxWait) || 0, f) : B, S = "trailing" in k ? !!k.trailing : S);
20
+ function V(s) {
21
+ var T = v, R = P;
22
+ return v = P = void 0, u = s, O = o.apply(R, T), O;
23
23
  }
24
- function J(l) {
25
- return g = l, i = setTimeout(q, b), _ ? V(l) : O;
24
+ function J(s) {
25
+ return u = s, l = setTimeout(q, f), L ? V(s) : O;
26
26
  }
27
- function ro(l) {
28
- var W = l - u, B = l - g, to = b - W;
29
- return w ? y(to, L - B) : to;
27
+ function ro(s) {
28
+ var T = s - p, R = s - u, to = f - T;
29
+ return z ? $(to, B - R) : to;
30
30
  }
31
- function D(l) {
32
- var W = l - u, B = l - g;
33
- return u === void 0 || W >= b || W < 0 || w && B >= L;
31
+ function D(s) {
32
+ var T = s - p, R = s - u;
33
+ return p === void 0 || T >= f || T < 0 || z && R >= B;
34
34
  }
35
35
  function q() {
36
- var l = P();
37
- if (D(l))
38
- return ao(l);
39
- i = setTimeout(q, ro(l));
36
+ var s = h();
37
+ if (D(s))
38
+ return ao(s);
39
+ l = setTimeout(q, ro(s));
40
40
  }
41
- function ao(l) {
42
- return i = void 0, z && m ? V(l) : (m = v = void 0, O);
41
+ function ao(s) {
42
+ return l = void 0, S && v ? V(s) : (v = P = void 0, O);
43
43
  }
44
44
  function go() {
45
- i !== void 0 && clearTimeout(i), g = 0, m = u = v = i = void 0;
45
+ l !== void 0 && clearTimeout(l), u = 0, v = p = P = l = void 0;
46
46
  }
47
47
  function so() {
48
- return i === void 0 ? O : ao(P());
48
+ return l === void 0 ? O : ao(h());
49
49
  }
50
50
  function Q() {
51
- var l = P(), W = D(l);
52
- if (m = arguments, v = this, u = l, W) {
53
- if (i === void 0)
54
- return J(u);
55
- if (w)
56
- return i = setTimeout(q, b), V(u);
51
+ var s = h(), T = D(s);
52
+ if (v = arguments, P = this, p = s, T) {
53
+ if (l === void 0)
54
+ return J(p);
55
+ if (z)
56
+ return l = setTimeout(q, f), V(p);
57
57
  }
58
- return i === void 0 && (i = setTimeout(q, b)), O;
58
+ return l === void 0 && (l = setTimeout(q, f)), O;
59
59
  }
60
60
  return Q.cancel = go, Q.flush = so, Q;
61
61
  }
62
- function p(e) {
63
- var b = typeof e;
64
- return !!e && (b == "object" || b == "function");
62
+ function w(o) {
63
+ var f = typeof o;
64
+ return !!o && (f == "object" || f == "function");
65
65
  }
66
- function M(e) {
67
- return !!e && typeof e == "object";
66
+ function _(o) {
67
+ return !!o && typeof o == "object";
68
68
  }
69
- function I(e) {
70
- return typeof e == "symbol" || M(e) && j.call(e) == n;
69
+ function M(o) {
70
+ return typeof o == "symbol" || _(o) && E.call(o) == i;
71
71
  }
72
- function A(e) {
73
- if (typeof e == "number")
74
- return e;
75
- if (I(e))
76
- return t;
77
- if (p(e)) {
78
- var b = typeof e.valueOf == "function" ? e.valueOf() : e;
79
- e = p(b) ? b + "" : b;
72
+ function C(o) {
73
+ if (typeof o == "number")
74
+ return o;
75
+ if (M(o))
76
+ return n;
77
+ if (w(o)) {
78
+ var f = typeof o.valueOf == "function" ? o.valueOf() : o;
79
+ o = w(f) ? f + "" : f;
80
80
  }
81
- if (typeof e != "string")
82
- return e === 0 ? e : +e;
83
- e = e.replace(s, "");
84
- var h = f.test(e);
85
- return h || o.test(e) ? d(e.slice(2), h ? 2 : 8) : c.test(e) ? t : +e;
81
+ if (typeof o != "string")
82
+ return o === 0 ? o : +o;
83
+ o = o.replace(t, "");
84
+ var k = b.test(o);
85
+ return k || e.test(o) ? c(o.slice(2), k ? 2 : 8) : a.test(o) ? n : +o;
86
86
  }
87
87
  return Y = N, Y;
88
88
  }
@@ -1874,27 +1874,32 @@ const wo = /* @__PURE__ */ fo(ho), yo = {
1874
1874
  transparent var(--pattern-grid-size)
1875
1875
  )`
1876
1876
  }, vo = Object.entries(yo).reduce(
1877
- (r, [t, n]) => {
1878
- if (t.startsWith("--breakpoint-")) {
1879
- const s = t.replace("--breakpoint-", "");
1880
- r[s] = n;
1877
+ (r, [n, i]) => {
1878
+ if (n.startsWith("--breakpoint-")) {
1879
+ const t = n.replace("--breakpoint-", "");
1880
+ r[t] = i;
1881
1881
  }
1882
1882
  return r;
1883
1883
  },
1884
1884
  {}
1885
1885
  );
1886
1886
  function zo() {
1887
- return Object.entries(vo).reduce((r, [t, n]) => (r[t] = Number(n.replace("px", "")), r), {});
1887
+ return Object.entries(vo).reduce((r, [n, i]) => (r[n] = Number(i.replace("px", "")), r), {});
1888
1888
  }
1889
- const So = typeof window > "u" ? T : uo;
1889
+ const So = typeof window > "u" ? j : uo;
1890
1890
  function _o() {
1891
- const [r, t] = F({ height: void 0, width: void 0 });
1891
+ const [r, n] = A({ height: void 0, width: void 0 }), i = ({ height: t, width: a }) => {
1892
+ let b;
1893
+ clearTimeout(b), b = setTimeout(() => {
1894
+ n({ height: t, width: a });
1895
+ }, 300);
1896
+ };
1892
1897
  return So(() => {
1893
- t({ height: window.innerHeight, width: window.innerWidth });
1894
- function n() {
1895
- t({ height: window.innerHeight, width: window.innerWidth });
1896
- }
1897
- return window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
1898
+ const t = new ResizeObserver(([a]) => {
1899
+ const { blockSize: b, inlineSize: e } = a.contentBoxSize[0];
1900
+ i({ height: b, width: e });
1901
+ });
1902
+ return t.observe(document.documentElement), () => t.disconnect();
1898
1903
  }, []), r;
1899
1904
  }
1900
1905
  const Po = "_root_103s3_3", Lo = "_container_103s3_9", Io = "_arrow_103s3_74", U = {
@@ -1913,145 +1918,146 @@ const Po = "_root_103s3_3", Lo = "_container_103s3_9", Io = "_arrow_103s3_74", U
1913
1918
  "arrow-background": "_arrow-background_103s3_101"
1914
1919
  }, Oo = K(U), Vo = ({
1915
1920
  children: r,
1916
- className: t,
1917
- placement: n = "side",
1918
- size: s = "md",
1919
- variant: c,
1920
- ...f
1921
+ className: n,
1922
+ placement: i = "side",
1923
+ size: t = "md",
1924
+ variant: a,
1925
+ ...b
1921
1926
  }) => {
1922
1927
  const {
1923
- navigation: { desktop: o, goNext: d, isNextDisabled: x, mobile: a }
1928
+ navigation: { desktop: e, goNext: c, isNextDisabled: m, mobile: d }
1924
1929
  } = eo();
1925
- return /* @__PURE__ */ E(
1930
+ return /* @__PURE__ */ W(
1926
1931
  io,
1927
1932
  {
1928
1933
  "aria-label": "Next slide",
1929
1934
  className: Oo(
1930
1935
  "arrow",
1931
- o && "arrow-desktop",
1932
- a && "arrow-mobile",
1933
- n === "side" && "arrow-placement-side",
1934
- n === "side" && "arrow-placement-side-right",
1935
- t
1936
+ e && "arrow-desktop",
1937
+ d && "arrow-mobile",
1938
+ i === "side" && "arrow-placement-side",
1939
+ i === "side" && "arrow-placement-side-right",
1940
+ n
1936
1941
  ),
1937
- disabled: x,
1938
- onClick: d,
1939
- size: s,
1940
- variant: c ?? "secondary",
1941
- ...f,
1942
- children: r ?? /* @__PURE__ */ E(lo, { name: "angle-right-b" })
1942
+ disabled: m,
1943
+ onClick: c,
1944
+ size: t,
1945
+ variant: a ?? "secondary",
1946
+ ...b,
1947
+ children: r ?? /* @__PURE__ */ W(lo, { name: "angle-right-b" })
1943
1948
  }
1944
1949
  );
1945
- }, Wo = K(U), jo = ({
1950
+ }, To = K(U), jo = ({
1946
1951
  children: r,
1947
- className: t,
1948
- placement: n = "side",
1949
- size: s = "md",
1950
- variant: c,
1951
- ...f
1952
+ className: n,
1953
+ placement: i = "side",
1954
+ size: t = "md",
1955
+ variant: a,
1956
+ ...b
1952
1957
  }) => {
1953
1958
  const {
1954
- navigation: { desktop: o, goPrev: d, isPrevDisabled: x, mobile: a }
1959
+ navigation: { desktop: e, goPrev: c, isPrevDisabled: m, mobile: d }
1955
1960
  } = eo();
1956
- return /* @__PURE__ */ E(
1961
+ return /* @__PURE__ */ W(
1957
1962
  io,
1958
1963
  {
1959
1964
  "aria-label": "Previous slide",
1960
- className: Wo(
1965
+ className: To(
1961
1966
  "arrow",
1962
- o && "arrow-mobile",
1963
- a && "arrow-desktop",
1964
- n === "side" && "arrow-placement-side",
1965
- n === "side" && "arrow-placement-side-left",
1966
- t
1967
+ e && "arrow-mobile",
1968
+ d && "arrow-desktop",
1969
+ i === "side" && "arrow-placement-side",
1970
+ i === "side" && "arrow-placement-side-left",
1971
+ n
1967
1972
  ),
1968
- disabled: x,
1969
- onClick: d,
1970
- size: s,
1971
- variant: c ?? "secondary",
1972
- ...f,
1973
- children: r ?? /* @__PURE__ */ E(lo, { name: "angle-left-b" })
1973
+ disabled: m,
1974
+ onClick: c,
1975
+ size: t,
1976
+ variant: a ?? "secondary",
1977
+ ...b,
1978
+ children: r ?? /* @__PURE__ */ W(lo, { name: "angle-left-b" })
1974
1979
  }
1975
1980
  );
1976
- }, No = (r, t) => {
1977
- const n = Z();
1978
- T(() => {
1979
- n.current = r;
1980
- }, [r]), T(() => {
1981
- function s() {
1982
- n.current();
1981
+ }, No = (r, n) => {
1982
+ const i = Z();
1983
+ j(() => {
1984
+ i.current = r;
1985
+ }, [r]), j(() => {
1986
+ function t() {
1987
+ i.current();
1983
1988
  }
1984
- if (t !== null) {
1985
- const c = setInterval(s, t);
1986
- return () => clearInterval(c);
1989
+ if (n !== null) {
1990
+ const a = setInterval(t, n);
1991
+ return () => clearInterval(a);
1987
1992
  }
1988
- }, [t]);
1989
- }, G = (r, t) => {
1990
- if (t === 0)
1993
+ }, [n]);
1994
+ }, H = (r, n) => {
1995
+ if (n === 0)
1991
1996
  return `${100 / r}%`;
1992
- const s = t * (r === 1 ? 4 : 2) / 16;
1993
- return `calc(${100 / r}% - ${s}rem)`;
1994
- }, To = K(U), Eo = ({ children: r }) => {
1997
+ const t = n * (r === 1 ? 4 : 2) / 16;
1998
+ return `calc(${100 / r}% - ${t}rem)`;
1999
+ }, Co = K(U), Wo = ({ children: r, className: n }) => {
1995
2000
  const {
1996
2001
  slides: {
1997
- currentPage: t,
1998
- currentSlidesPerView: n,
1999
- expandOnLargeScreens: s,
2000
- gap: c,
2001
- handleScroll: f,
2002
- id: o,
2003
- isLastPage: d,
2004
- length: x,
2005
- perView: a,
2006
- ref: C,
2007
- setLength: S
2002
+ currentPage: i,
2003
+ currentSlidesPerView: t,
2004
+ expandOnLargeScreens: a,
2005
+ gap: b,
2006
+ handleScroll: e,
2007
+ id: c,
2008
+ isLastPage: m,
2009
+ length: d,
2010
+ perView: g,
2011
+ ref: y,
2012
+ setLength: E
2008
2013
  }
2009
- } = eo(), j = co.toArray(r);
2010
- T(() => {
2011
- S(j.length);
2012
- }, [j.length, S]);
2013
- const $ = co.map(j, (y, P) => {
2014
- const N = `${o}-${P}`, p = P + 1, M = Math.ceil(p / n) - 1, I = d ? x - p >= n : M !== t;
2015
- return typeof y == "object" && y && "props" in y ? po(y, {
2016
- ...y.props,
2017
- "aria-hidden": I,
2018
- "aria-label": `${p} of ${x}`,
2014
+ } = eo(), I = co.toArray(r);
2015
+ j(() => {
2016
+ E(I.length);
2017
+ }, [I.length, E]);
2018
+ const $ = co.map(I, (h, N) => {
2019
+ const w = `${c}-${N}`, _ = N + 1, M = Math.ceil(_ / t) - 1, C = m ? d - _ >= t : M !== i;
2020
+ return typeof h == "object" && h && "props" in h ? po(h, {
2021
+ ...h.props,
2022
+ "aria-hidden": C,
2023
+ "aria-label": `${_} of ${d}`,
2019
2024
  "aria-roledescription": "slide",
2020
- id: N,
2021
- key: N
2022
- }) : y;
2025
+ id: w,
2026
+ key: w
2027
+ }) : h;
2023
2028
  });
2024
- return /* @__PURE__ */ E(
2029
+ return /* @__PURE__ */ W(
2025
2030
  "ul",
2026
2031
  {
2027
- className: To(
2032
+ className: Co(
2028
2033
  "container",
2029
- a.mobile && "container-mobile",
2030
- a.desktop && "container-desktop",
2031
- a.tablet && "container-tablet",
2032
- a.desktop && s && "container-full-width"
2034
+ g.mobile && "container-mobile",
2035
+ g.desktop && "container-desktop",
2036
+ g.tablet && "container-tablet",
2037
+ g.desktop && a && "container-full-width",
2038
+ n
2033
2039
  ),
2034
- onScroll: f,
2035
- ref: C,
2040
+ onScroll: e,
2041
+ ref: y,
2036
2042
  style: {
2037
- "--slideDesktop": a.desktop,
2038
- "--slideMobile": a.mobile,
2039
- "--slideTablet": a.tablet,
2040
- "--slideWidthDesktop": G(a.desktop, c),
2041
- "--slideWidthMobile": G(a.mobile, c),
2042
- "--slideWidthTablet": G(a.tablet, c),
2043
- "--slideWithDesktopFullWidth": G(a.desktop + 2, c),
2044
- "--spaceBetween": `${c / 16}rem`
2043
+ "--slideDesktop": g.desktop,
2044
+ "--slideMobile": g.mobile,
2045
+ "--slideTablet": g.tablet,
2046
+ "--slideWidthDesktop": H(g.desktop, b),
2047
+ "--slideWidthMobile": H(g.mobile, b),
2048
+ "--slideWidthTablet": H(g.tablet, b),
2049
+ "--slideWithDesktopFullWidth": H(g.desktop + 2, b),
2050
+ "--spaceBetween": `${b / 16}rem`
2045
2051
  },
2046
2052
  children: $
2047
2053
  }
2048
2054
  );
2049
- }, Co = K(U), bo = mo(null), eo = () => {
2055
+ }, Eo = K(U), bo = mo(null), eo = () => {
2050
2056
  const r = ko(bo);
2051
2057
  if (!r)
2052
2058
  throw new Error("Swiper components must be used within a Swiper component");
2053
2059
  return r;
2054
- }, k = {
2060
+ }, x = {
2055
2061
  autoplay: { duration: 5e3, enabled: !1, loop: !1 },
2056
2062
  navigation: { desktop: !0, mobile: !0 },
2057
2063
  slides: {
@@ -2063,154 +2069,163 @@ const Po = "_root_103s3_3", Lo = "_container_103s3_9", Io = "_arrow_103s3_74", U
2063
2069
  perView: { desktop: 1, mobile: 1, tablet: 1 }
2064
2070
  }
2065
2071
  }, $o = {
2066
- autoplay: k.autoplay,
2067
- navigation: k.navigation,
2072
+ autoplay: x.autoplay,
2073
+ navigation: x.navigation,
2068
2074
  slides: {
2069
- alignment: k.slides.alignment,
2070
- currentSlidesPerView: k.slides.perView.desktop,
2071
- expandOnLargeScreens: k.slides.expandOnLargeScreens,
2072
- gap: k.slides.gap,
2073
- id: k.slides.id,
2074
- initialIndex: k.slides.initialIndex,
2075
- perView: k.slides.perView
2075
+ alignment: x.slides.alignment,
2076
+ currentPage: 0,
2077
+ currentSlidesPerView: x.slides.perView.desktop,
2078
+ expandOnLargeScreens: x.slides.expandOnLargeScreens,
2079
+ gap: x.slides.gap,
2080
+ id: x.slides.id,
2081
+ initialIndex: x.slides.initialIndex,
2082
+ perView: x.slides.perView,
2083
+ setCurrentPage: () => {
2084
+ }
2076
2085
  }
2077
- }, Ao = (r = k) => {
2078
- var a;
2079
- const t = {
2080
- autoplay: { ...k.autoplay, ...r.autoplay },
2081
- navigation: { ...k.navigation, ...r.navigation },
2086
+ }, Ao = (r = x) => {
2087
+ var y;
2088
+ const [n, i] = A(0), t = {
2089
+ autoplay: { ...x.autoplay, ...r.autoplay },
2090
+ navigation: { ...x.navigation, ...r.navigation },
2082
2091
  slides: {
2083
- ...k.slides,
2092
+ ...x.slides,
2084
2093
  ...r.slides,
2085
2094
  perView: {
2086
- ...k.slides.perView,
2087
- ...(a = r.slides) == null ? void 0 : a.perView
2095
+ ...x.slides.perView,
2096
+ ...(y = r.slides) == null ? void 0 : y.perView
2088
2097
  }
2089
2098
  }
2090
2099
  }, {
2091
- autoplay: n,
2092
- navigation: s,
2093
- slides: { expandOnLargeScreens: c, perView: f }
2094
- } = t, { width: o } = _o(), d = zo(), x = oo(() => o <= d.md ? f.mobile : o <= d.lg ? f.tablet : o >= d["4xl"] && c ? f.desktop + 2 : f.desktop, [o, d, c, f]);
2100
+ autoplay: a,
2101
+ navigation: b,
2102
+ slides: { expandOnLargeScreens: e, perView: c }
2103
+ } = t, { width: m } = _o(), d = zo(), g = oo(() => m <= d.md ? c.mobile : m <= d.lg ? c.tablet : m >= d["4xl"] && e ? c.desktop + 2 : c.desktop, [m, d, e, c]);
2095
2104
  return {
2096
- autoplay: n,
2097
- navigation: s,
2105
+ autoplay: a,
2106
+ navigation: b,
2098
2107
  slides: {
2099
2108
  alignment: t.slides.alignment,
2100
- currentSlidesPerView: x,
2109
+ currentPage: n,
2110
+ currentSlidesPerView: g,
2101
2111
  expandOnLargeScreens: t.slides.expandOnLargeScreens,
2102
2112
  gap: t.slides.gap,
2103
2113
  id: t.slides.id,
2104
2114
  initialIndex: t.slides.initialIndex,
2105
- perView: f
2115
+ perView: c,
2116
+ setCurrentPage: i
2106
2117
  }
2107
2118
  };
2108
2119
  }, X = ({
2109
2120
  children: r,
2110
- className: t,
2111
- store: n = $o,
2112
- ...s
2121
+ className: n,
2122
+ store: i = $o,
2123
+ ...t
2113
2124
  }) => {
2114
- const { autoplay: c, navigation: f, slides: o } = n, [d, x] = F(0), a = Z(), C = Z(!1), [S, j] = F(0), [$, y] = F(!1), [P, N] = F(!1), p = Math.ceil(S / o.currentSlidesPerView) || 1, M = d === 0, I = d === p - 1, A = o.alignment === "center" ? (
2115
- // if centeredSlides is true, we calculate which number is the middle page
2116
- Math.floor(p / 2)
2117
- ) : (
2118
- // if centeredSlides is false, we calculate on which page the number in firstSlideToShow props is
2119
- Math.ceil(o.initialIndex / o.currentSlidesPerView) - 1
2120
- ), e = R(() => {
2121
- const i = a == null ? void 0 : a.current;
2122
- if (i && !c.enabled) {
2123
- const { offsetWidth: u, scrollLeft: g, scrollWidth: _ } = i, w = !(g > o.gap), z = !(_ - (g + u) > o.gap);
2124
- y(w), N(z);
2125
+ const { autoplay: a, navigation: b, slides: e } = i, { currentPage: c, setCurrentPage: m } = e, d = Z(), g = Z(!1), [y, E] = A(0), [I, $] = A(!1), [h, N] = A(!1), w = Math.ceil(y / e.currentSlidesPerView) || 1, _ = F(() => {
2126
+ const l = d == null ? void 0 : d.current;
2127
+ if (l && !a.enabled) {
2128
+ const { offsetWidth: p, scrollLeft: u, scrollWidth: L } = l, z = !(u > e.gap), S = !(L - (u + p) > e.gap);
2129
+ $(z), N(S);
2125
2130
  } else
2126
- y(!1), N(!1);
2127
- }, [c.enabled, o.gap]), b = R(() => {
2128
- var u, g;
2129
- const i = a == null ? void 0 : a.current;
2130
- if (i) {
2131
- const { children: _, offsetWidth: w, scrollLeft: z, scrollWidth: V } = i, J = (g = (u = _ == null ? void 0 : _[0]) == null ? void 0 : u.getBoundingClientRect()) == null ? void 0 : g.width, D = !(V - (z + w) > o.gap) ? p - 1 : Math.round(z / ((J + o.gap) * o.currentSlidesPerView));
2132
- D !== d && x(D);
2131
+ $(!1), N(!1);
2132
+ }, [a.enabled, e.gap]), M = F(() => {
2133
+ var p, u;
2134
+ const l = d == null ? void 0 : d.current;
2135
+ if (l) {
2136
+ const { children: L, offsetWidth: z, scrollLeft: S, scrollWidth: V } = l, J = (u = (p = L == null ? void 0 : L[0]) == null ? void 0 : p.getBoundingClientRect()) == null ? void 0 : u.width, D = !(V - (S + z) > e.gap) ? w - 1 : Math.round(S / ((J + e.gap) * e.currentSlidesPerView));
2137
+ D !== c && m(D);
2133
2138
  }
2134
- }, [p, d, o.currentSlidesPerView, a, x, o.gap]), h = oo(
2139
+ }, [w, c, e.currentSlidesPerView, d, m, e.gap]), C = oo(
2135
2140
  () => wo(() => {
2136
- e(), b();
2141
+ _(), M();
2137
2142
  }, 100),
2138
- [e, b]
2139
- ), m = R(
2140
- (i, u = !1) => {
2141
- var w, z, V;
2142
- const g = a == null ? void 0 : a.current, _ = (V = (z = (w = g == null ? void 0 : g.children) == null ? void 0 : w[0]) == null ? void 0 : z.getBoundingClientRect()) == null ? void 0 : V.width;
2143
- g == null || g.scrollTo({
2143
+ [_, M]
2144
+ ), o = F(
2145
+ (l, p = !1) => {
2146
+ var z, S, V;
2147
+ const u = d == null ? void 0 : d.current, L = (V = (S = (z = u == null ? void 0 : u.children) == null ? void 0 : z[0]) == null ? void 0 : S.getBoundingClientRect()) == null ? void 0 : V.width;
2148
+ u == null || u.scrollTo({
2144
2149
  // We don't want to have a scroll effect when we first render the swiper
2145
- behavior: u ? "auto" : "smooth",
2146
- left: i * (_ + o.gap) * o.currentSlidesPerView,
2150
+ behavior: p ? "auto" : "smooth",
2151
+ left: l * (L + e.gap) * e.currentSlidesPerView,
2147
2152
  top: 0
2148
2153
  });
2149
2154
  },
2150
- [o.currentSlidesPerView, o.gap, a]
2151
- ), v = R(() => {
2152
- c.enabled && c.loop && I ? m(0) : m(d + 1);
2153
- }, [d, m, I, c.enabled, c.loop]), L = R(() => {
2154
- M && c.enabled && c.loop ? m(p - 1) : m(d - 1);
2155
- }, [p, d, m, M, c.enabled, c.loop]);
2155
+ [e.currentSlidesPerView, e.gap, d]
2156
+ ), f = c === 0, k = c === w - 1, v = F(() => {
2157
+ a.enabled && a.loop && k ? o(0) : o(c + 1);
2158
+ }, [c, o, k, a.enabled, a.loop]), P = F(() => {
2159
+ f && a.enabled && a.loop ? o(w - 1) : o(c - 1);
2160
+ }, [w, c, o, f, a.enabled, a.loop]);
2156
2161
  No(
2157
2162
  () => {
2158
- c.enabled && v();
2163
+ a.enabled && v();
2159
2164
  },
2160
- c.enabled ? c.duration : null
2161
- ), T(() => {
2162
- const i = (u) => {
2163
- u.code === "ArrowLeft" && L(), u.code === "ArrowRight" && v();
2165
+ a.enabled ? a.duration : null
2166
+ ), j(() => {
2167
+ const l = (p) => {
2168
+ p.code === "ArrowLeft" && P(), p.code === "ArrowRight" && v();
2164
2169
  };
2165
- return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
2166
- }, [L, v]), T(() => {
2167
- S > 0 && !C.current && (m(A, !0), C.current = !0);
2168
- }, [S]), T(() => {
2169
- e();
2170
- }, [e, r]);
2170
+ return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
2171
+ }, [P, v]);
2172
+ const B = e.alignment === "center" ? (
2173
+ // if centeredSlides is true, we calculate which number is the middle page
2174
+ Math.floor(w / 2)
2175
+ ) : (
2176
+ // if centeredSlides is false, we calculate on which page the number in firstSlideToShow props is
2177
+ Math.ceil(e.initialIndex / e.currentSlidesPerView) - 1
2178
+ );
2179
+ j(() => {
2180
+ y > 0 && !g.current && (o(B, !0), g.current = !0);
2181
+ }, [y]), j(() => {
2182
+ _();
2183
+ }, [_, r]), j(() => {
2184
+ g.current && o(c);
2185
+ }, [c, o]);
2171
2186
  const O = oo(
2172
2187
  () => ({
2173
2188
  navigation: {
2174
2189
  goNext: v,
2175
- goPrev: L,
2176
- isNextDisabled: P,
2177
- isPrevDisabled: $,
2178
- ...f
2190
+ goPrev: P,
2191
+ isNextDisabled: h,
2192
+ isPrevDisabled: I,
2193
+ ...b
2179
2194
  },
2180
2195
  slides: {
2181
- alignment: o.alignment,
2182
- currentPage: d,
2183
- currentSlidesPerView: o.currentSlidesPerView,
2184
- expandOnLargeScreens: o.expandOnLargeScreens,
2185
- gap: o.gap,
2186
- handleScroll: h,
2187
- id: o.id,
2188
- initialIndex: o.initialIndex,
2189
- isLastPage: I,
2190
- length: S,
2191
- perView: o.perView,
2192
- ref: a,
2193
- setLength: j
2196
+ alignment: e.alignment,
2197
+ currentPage: c,
2198
+ currentSlidesPerView: e.currentSlidesPerView,
2199
+ expandOnLargeScreens: e.expandOnLargeScreens,
2200
+ gap: e.gap,
2201
+ handleScroll: C,
2202
+ id: e.id,
2203
+ initialIndex: e.initialIndex,
2204
+ isLastPage: k,
2205
+ length: y,
2206
+ perView: e.perView,
2207
+ ref: d,
2208
+ setLength: E
2194
2209
  }
2195
2210
  }),
2196
2211
  [
2197
2212
  v,
2198
- L,
2199
2213
  P,
2200
- $,
2201
- f,
2202
- d,
2203
2214
  h,
2204
2215
  I,
2205
- S,
2206
- o
2216
+ b,
2217
+ c,
2218
+ C,
2219
+ k,
2220
+ y,
2221
+ e
2207
2222
  ]
2208
2223
  );
2209
- return /* @__PURE__ */ E(bo.Provider, { value: O, children: /* @__PURE__ */ E("div", { className: Co("root", t), ...s, children: r }) });
2224
+ return /* @__PURE__ */ W(bo.Provider, { value: O, children: /* @__PURE__ */ W("div", { className: Eo("root", n), ...t, children: r }) });
2210
2225
  };
2211
2226
  X.PrevButton = jo;
2212
2227
  X.NextButton = Vo;
2213
- X.Slides = Eo;
2228
+ X.Slides = Wo;
2214
2229
  X.displayName = "Swiper";
2215
2230
  export {
2216
2231
  X as Swiper,
package/dist/Tag.js CHANGED
@@ -5,12 +5,12 @@ import w from "react";
5
5
  import { Icon as s } from "./Icon.js";
6
6
  import { c as R } from "./index-PAaZGbyz.js";
7
7
  import { f as C } from "./forwardRefWithAs-8eP3ZN15.js";
8
- const S = "_root_4kt6z_7", N = "_disabled_4kt6z_51", q = "_ai_4kt6z_68", x = "_removeButton_4kt6z_71", y = "_hasRemoveAction_4kt6z_364", A = "_isSquare_4kt6z_370", T = {
8
+ const S = "_root_4kt6z_7", y = "_disabled_4kt6z_51", N = "_ai_4kt6z_68", q = "_removeButton_4kt6z_71", x = "_hasRemoveAction_4kt6z_364", A = "_isSquare_4kt6z_370", T = {
9
9
  root: S,
10
- disabled: N,
10
+ disabled: y,
11
11
  "variant-dash": "_variant-dash_4kt6z_56",
12
- ai: q,
13
- removeButton: x,
12
+ ai: N,
13
+ removeButton: q,
14
14
  "variant-brand": "_variant-brand_4kt6z_74",
15
15
  "variant-light-brand": "_variant-light-brand_4kt6z_89",
16
16
  "variant-dark-brand": "_variant-dark-brand_4kt6z_96",
@@ -40,7 +40,7 @@ const S = "_root_4kt6z_7", N = "_disabled_4kt6z_51", q = "_ai_4kt6z_68", x = "_r
40
40
  "variant-dark-violet": "_variant-dark-violet_4kt6z_328",
41
41
  "size-md": "_size-md_4kt6z_350",
42
42
  "size-lg": "_size-lg_4kt6z_357",
43
- hasRemoveAction: y,
43
+ hasRemoveAction: x,
44
44
  isSquare: A
45
45
  }, k = R(T);
46
46
  function j(a) {
@@ -63,9 +63,9 @@ const $ = C((a, d) => {
63
63
  size: c = "lg",
64
64
  variant: l = "warm",
65
65
  ...h
66
- } = a, u = j(o) === 1 && !r, f = (n) => {
66
+ } = a, u = j(o) === 1 && !r, p = (n) => {
67
67
  n.stopPropagation(), !i && (t != null && t.onClick && t.onClick(n), r && r());
68
- }, p = (n) => {
68
+ }, f = (n) => {
69
69
  i || v && v(n);
70
70
  };
71
71
  return /* @__PURE__ */ b(
@@ -81,7 +81,7 @@ const $ = C((a, d) => {
81
81
  i && "disabled",
82
82
  z
83
83
  ),
84
- onClick: p,
84
+ onClick: f,
85
85
  ref: d,
86
86
  ...h,
87
87
  children: [
@@ -92,9 +92,10 @@ const $ = C((a, d) => {
92
92
  {
93
93
  "aria-label": "remove tag",
94
94
  disabled: i,
95
+ type: "button",
95
96
  ...t,
96
97
  className: k("removeButton", t == null ? void 0 : t.className),
97
- onClick: f,
98
+ onClick: p,
98
99
  children: /* @__PURE__ */ e(s, { name: "times", size: "md" })
99
100
  }
100
101
  ) : null
@@ -1,6 +1,6 @@
1
- import { HTMLAttributes } from 'react';
1
+ import { ComponentProps, HTMLAttributes } from 'react';
2
2
  import { HintProps } from '../Hint/types';
3
- import { LabelProps } from '../Label/types';
3
+ import { Label } from '../Label';
4
4
  export interface FieldOptions extends VariantProps {
5
5
  children: React.ReactNode;
6
6
  disabled?: boolean;
@@ -13,7 +13,7 @@ export interface FieldOptions extends VariantProps {
13
13
  */
14
14
  inline?: boolean;
15
15
  label: React.ReactNode;
16
- labelProps?: LabelProps;
16
+ labelProps?: ComponentProps<typeof Label>;
17
17
  /**
18
18
  * The maximum number of characters allowed in the input field. If provided, a character count will be displayed on hint on the right side.
19
19
  */
@@ -1,7 +1,6 @@
1
1
  import { ComponentPropsWithRef } from 'react';
2
2
  export type LabelProps = ComponentPropsWithRef<'label'> & LabelOptions;
3
3
  interface LabelOptions {
4
- children: React.ReactNode;
5
4
  disabled?: boolean;
6
5
  required?: boolean;
7
6
  variant?: 'danger' | 'success' | 'warning';
@@ -8,4 +8,4 @@ export interface RadioOptions {
8
8
  value?: string;
9
9
  variant?: 'danger' | 'default';
10
10
  }
11
- export type RadioProps = ComponentPropsWithRef<'input'> & Omit<LabelProps, 'children'> & RadioOptions;
11
+ export type RadioProps = ComponentPropsWithRef<'input'> & LabelProps & RadioOptions;
@@ -1,2 +1,2 @@
1
1
  import { SwiperSlidesProps } from '../types';
2
- export declare const SwiperSlides: ({ children }: SwiperSlidesProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const SwiperSlides: ({ children, className }: SwiperSlidesProps) => import("react/jsx-runtime").JSX.Element;
@@ -41,6 +41,7 @@ export declare const useSwiper: (options?: UseSwiperOptions) => {
41
41
  };
42
42
  slides: {
43
43
  alignment: "center" | "default";
44
+ currentPage: number;
44
45
  currentSlidesPerView: number;
45
46
  expandOnLargeScreens: boolean;
46
47
  gap: number;
@@ -51,6 +52,7 @@ export declare const useSwiper: (options?: UseSwiperOptions) => {
51
52
  mobile: number;
52
53
  tablet: number;
53
54
  };
55
+ setCurrentPage: React.Dispatch<React.SetStateAction<number>>;
54
56
  };
55
57
  };
56
58
  export declare const Swiper: SwiperComponent;
@@ -15,6 +15,7 @@ export type SwiperPrevButtonProps = Omit<ButtonProps, 'aria-label' | 'disabled'
15
15
  export type SwiperProps = ComponentProps<'div'> & SwiperOptions;
16
16
  export type SwiperSlidesProps = {
17
17
  children: ReactNode;
18
+ className?: string;
18
19
  };
19
20
  export interface UseSwiperOptions {
20
21
  /** If true the swiper will automatically transition between slides */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "welcome-ui",
3
- "version": "10.1.2",
3
+ "version": "10.1.4",
4
4
  "description": "Customizable design system with react, typescript, tailwindcss and ariakit.",
5
5
  "files": [
6
6
  "dist"