welcome-ui 9.0.0-alpha.2 → 9.0.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 (111) hide show
  1. package/README.md +47 -3
  2. package/dist/2W3RN7C5-bkX-rIa3.js +61 -0
  3. package/dist/4I4MLMKD-BLxAidnq.js +43 -0
  4. package/dist/Accordion.js +6 -6
  5. package/dist/Alert.js +1 -1
  6. package/dist/AspectRatio.js +1 -1
  7. package/dist/Avatar.js +1 -1
  8. package/dist/{4CMBR7SL-Dhp8uJop.js → B7UTNDHN-BlIblHCu.js} +59 -59
  9. package/dist/Badge.js +1 -1
  10. package/dist/Breadcrumb.css +1 -1
  11. package/dist/Breadcrumb.js +27 -27
  12. package/dist/Button.js +2 -2
  13. package/dist/ButtonGroup.js +1 -1
  14. package/dist/Card.js +1 -1
  15. package/dist/Checkbox.css +1 -1
  16. package/dist/Checkbox.js +22 -22
  17. package/dist/CloseButton.js +3 -3
  18. package/dist/{SYRFVSLH-CHNUB1rW.js → DSAASPLT-BaaCUKsb.js} +7 -7
  19. package/dist/DatePicker.js +5 -5
  20. package/dist/DateTimePicker.js +2 -2
  21. package/dist/Drawer.css +1 -1
  22. package/dist/Drawer.js +67 -67
  23. package/dist/DropdownMenu.js +261 -259
  24. package/dist/Field.js +1 -1
  25. package/dist/FieldGroup.js +1 -1
  26. package/dist/FileDrop.js +194 -221
  27. package/dist/FileUpload.js +2 -2
  28. package/dist/GVVKDT6A-bET6V7Py.js +724 -0
  29. package/dist/Hint.js +1 -1
  30. package/dist/{Icon-BisRi8B3.js → Icon-EG7O4YwD.js} +1 -1
  31. package/dist/Icon.js +12 -12
  32. package/dist/InputText.js +1 -1
  33. package/dist/{ASMQKSDT-SH1qSiMi.js → KPUWHTQJ-D2TPji47.js} +30 -30
  34. package/dist/Label.js +3 -3
  35. package/dist/Link.css +1 -1
  36. package/dist/Link.js +27 -27
  37. package/dist/Loader.js +1 -1
  38. package/dist/Logo.js +1 -1
  39. package/dist/Modal.js +10 -10
  40. package/dist/{JC64G2H7-DPy9R0De.js → NI3IVY7K-Ztb3-XAv.js} +571 -571
  41. package/dist/{P4IRICAX-7kH4HzWI.js → NMGNQVTG-C6TqBngP.js} +5 -5
  42. package/dist/{LVA2YJMS-NUHCRwFZ.js → OE2EFRVA-C3721cM3.js} +316 -315
  43. package/dist/{ITI7HKP4-C5xLpoVY.js → OLVWQA7U-DysaSaZj.js} +59 -59
  44. package/dist/Pagination.css +1 -1
  45. package/dist/Pagination.js +81 -73
  46. package/dist/PasswordInput.js +17 -18
  47. package/dist/Popover.js +14 -14
  48. package/dist/{YV4JVR4I-CVFstk2K.js → RTNCFSKZ-qpPg689E.js} +75 -73
  49. package/dist/Radio.css +1 -1
  50. package/dist/Radio.js +29 -29
  51. package/dist/RadioGroup.js +21 -21
  52. package/dist/RadioTab.js +2 -2
  53. package/dist/{P2CTZE2T-D1TepwxQ.js → SBSPVDDI-DJKkC1eb.js} +43 -43
  54. package/dist/{NLEBE274-B4zy25kL.js → SQZLCNLX-CHDXnZ16.js} +16 -16
  55. package/dist/Search.js +2 -2
  56. package/dist/Select.js +170 -181
  57. package/dist/Slider.js +1 -1
  58. package/dist/Swiper.css +1 -1
  59. package/dist/Swiper.js +151 -151
  60. package/dist/{VGCJ63VH-CVhs4PYt.js → T22PY7TE-C1N0q8Kn.js} +109 -109
  61. package/dist/Table.js +1 -1
  62. package/dist/Tabs.js +303 -308
  63. package/dist/Tag.js +3 -3
  64. package/dist/Text.js +1 -1
  65. package/dist/Textarea.js +1 -1
  66. package/dist/TimePicker.js +2 -2
  67. package/dist/Toast.js +1 -1
  68. package/dist/Toggle.js +2 -2
  69. package/dist/Tooltip.js +72 -72
  70. package/dist/VariantIcon.js +3 -3
  71. package/dist/WelcomeLoader.js +1 -1
  72. package/dist/XCKGTAUF-DkxWCbaW.js +25 -0
  73. package/dist/Y67KZUMI-DFEgrUv2.js +15 -0
  74. package/dist/{AXB53BZF-BHeessqV.js → ZTXFEM5L-CkrIQCN1.js} +7 -7
  75. package/dist/{field-icon-size-Du58qHNC.js → field-icon-size-Z5NulTSk.js} +216 -224
  76. package/dist/{index-5rXezknO.js → index-BC2bF45u.js} +1 -1
  77. package/dist/{index-C8GsqBDe.js → index-BeetbagJ.js} +1 -1
  78. package/dist/{index-BJLXLdM3.js → index-Bt79XJ8R.js} +1 -1
  79. package/dist/{index-Dcq5gh3E.js → index-BtwrJ6N4.js} +1 -1
  80. package/dist/{index-DL4-ut3P.js → index-CCASZBtz.js} +1 -1
  81. package/dist/{index-lbUBMgHp.js → index-CPqDZeah.js} +2 -2
  82. package/dist/{index-CTgip19b.js → index-CQEPCbEE.js} +1 -1
  83. package/dist/{index-CnxSNAPH.js → index-Crpe9CvH.js} +1 -1
  84. package/dist/{index-CWVOLBDY.js → index-D5a8Oe6k.js} +1 -1
  85. package/dist/{index-C1jjVTAc.js → index-D8dq-I5s.js} +1 -1
  86. package/dist/{index-Cvtm6uuS.js → index-DkwTwo3z.js} +1 -1
  87. package/dist/{index-BG2aV9o8.js → index-DnO8yBVT.js} +1 -1
  88. package/dist/index.css +0 -0
  89. package/dist/tslib.es6-DpB4Y59c.js +683 -0
  90. package/dist/types/components/Pagination/index.d.ts +1 -2
  91. package/dist/types/components/Pagination/types.d.ts +5 -2
  92. package/dist/types/components/PasswordInput/ToggleButton.d.ts +1 -1
  93. package/dist/types/components/PasswordInput/types.d.ts +1 -1
  94. package/dist/types/components/Tabs/components/TabList/index.d.ts +1 -1
  95. package/dist/types/components/Tabs/index.d.ts +1 -1
  96. package/dist/types/components/Tabs/types.d.ts +1 -2
  97. package/dist/types/components/Tabs/utils.d.ts +1 -2
  98. package/dist/types/utils/index.d.ts +1 -0
  99. package/dist/types/utils/theme/index.d.ts +0 -0
  100. package/dist/types/utils/useForkRef.d.ts +7 -1
  101. package/dist/useForkRef-D807AV7D.js +22 -0
  102. package/dist/{utils-BNMgUIHQ.js → utils-BpbIqM56.js} +1 -1
  103. package/dist/utils.js +2 -2
  104. package/package.json +5 -5
  105. package/dist/BYC7LY2E-DbSoi9cN.js +0 -673
  106. package/dist/KUU7WJ55-CsIy9XMu.js +0 -61
  107. package/dist/MTZPJQMC-D_TnSwZf.js +0 -15
  108. package/dist/QYJ6MIDR-Dm7lYMh6.js +0 -43
  109. package/dist/X5NMLKT6-PeY306ft.js +0 -25
  110. package/dist/index--0U5Rubs.js +0 -644
  111. /package/dist/{index-PAaZGbyz.js → index-CdiHdiVB.js} +0 -0
@@ -1,21 +1,10 @@
1
1
  "use client";
2
- import { C as te, a as z, c as re, g as v, s as oe, i as x, d as se, e as ne } from "./P2CTZE2T-D1TepwxQ.js";
3
- import { P as ie, b as ae } from "./MTZPJQMC-D_TnSwZf.js";
4
- import { v as ue, c as ce, _ as L, i as le, ak as fe, al as de, M as B, am as C, d as pe, af as me, b as E, q as P, a as ve, p as U, D as ge, e as ye, f as Ce, g as R, W as Pe, an as Ie, l as Ee, n as Se } from "./LVA2YJMS-NUHCRwFZ.js";
5
- import { createContext as b, useRef as H, useEffect as V, useState as Fe, useCallback as we } from "react";
6
- import { f as xe, r as be } from "./4CMBR7SL-Dhp8uJop.js";
7
- import { jsx as Ke } from "react/jsx-runtime";
8
- b(
9
- void 0
10
- );
11
- var N = ue(
12
- [ae, z],
13
- [ie, te]
14
- ), je = N.useContext, qe = N.useProviderContext;
15
- b(
16
- void 0
17
- );
18
- b(!1);
2
+ import { c as te, g as v, s as re, i as w, a as z, d as oe, e as se, C as ne } from "./SBSPVDDI-DJKkC1eb.js";
3
+ import { c as ie, _ as L, i as ae, ak as ue, al as ce, M as B, am as C, o as le, af as fe, u as I, j as P, l as de, h as U, x as pe, d as me, p as ve, a as R, W as ge, an as ye, f as Ce, b as Pe, e as Ee } from "./OE2EFRVA-C3721cM3.js";
4
+ import { f as Ie, r as Se } from "./B7UTNDHN-BlIblHCu.js";
5
+ import { useRef as H, useEffect as V, useState as Fe, useCallback as xe, createContext as b } from "react";
6
+ import { jsx as we } from "react/jsx-runtime";
7
+ import { P as be, a as Ke } from "./Y67KZUMI-DFEgrUv2.js";
19
8
  var ke = "div";
20
9
  function Ae(r) {
21
10
  return r.some((i) => !!i.rowId);
@@ -28,22 +17,22 @@ function he(r) {
28
17
  return r.key === "Shift" || r.key === "Control" || r.key === "Alt" || r.key === "Meta";
29
18
  }
30
19
  function O(r, i, l) {
31
- return E((e) => {
20
+ return I((e) => {
32
21
  var s;
33
22
  if (i == null || i(e), e.defaultPrevented || e.isPropagationStopped() || !P(e) || he(e) || _e(e)) return;
34
23
  const f = r.getState(), p = (s = v(r, f.activeId)) == null ? void 0 : s.element;
35
24
  if (!p) return;
36
- const n = e, { view: K } = n, w = L(n, ["view"]), c = l == null ? void 0 : l.current;
37
- p !== c && p.focus(), Ie(p, e.type, w) || e.preventDefault(), e.currentTarget.contains(p) && e.stopPropagation();
25
+ const n = e, { view: K } = n, x = L(n, ["view"]), c = l == null ? void 0 : l.current;
26
+ p !== c && p.focus(), ye(p, e.type, x) || e.preventDefault(), e.currentTarget.contains(p) && e.stopPropagation();
38
27
  });
39
28
  }
40
- function De(r) {
41
- return se(
42
- xe(be(ne(r)))
29
+ function Te(r) {
30
+ return oe(
31
+ Ie(Se(se(r)))
43
32
  );
44
33
  }
45
- function Te(r) {
46
- const [i, l] = Fe(!1), e = we(() => l(!0), []), s = r.useState(
34
+ function De(r) {
35
+ const [i, l] = Fe(!1), e = xe(() => l(!0), []), s = r.useState(
47
36
  (f) => v(r, f.activeId)
48
37
  );
49
38
  return V(() => {
@@ -51,7 +40,7 @@ function Te(r) {
51
40
  i && f && (l(!1), f.focus({ preventScroll: !0 }));
52
41
  }, [s, i]), e;
53
42
  }
54
- var Me = ce(
43
+ var Me = ie(
55
44
  function(i) {
56
45
  var l = i, {
57
46
  store: e,
@@ -64,25 +53,25 @@ var Me = ce(
64
53
  "focusOnMove",
65
54
  "moveOnKeyPress"
66
55
  ]);
67
- const K = re();
68
- e = e || K, le(
56
+ const K = te();
57
+ e = e || K, ae(
69
58
  e,
70
59
  process.env.NODE_ENV !== "production" && "Composite must receive a `store` prop or be wrapped in a CompositeProvider component."
71
60
  );
72
- const w = H(null), c = H(null), j = Te(e), S = e.useState("moves"), [, q] = fe(
61
+ const x = H(null), c = H(null), N = De(e), S = e.useState("moves"), [, W] = ue(
73
62
  s ? e.setBaseElement : null
74
63
  );
75
64
  V(() => {
76
65
  var t;
77
66
  if (!e || !S || !s || !f) return;
78
67
  const { activeId: o } = e.getState(), a = (t = v(e, o)) == null ? void 0 : t.element;
79
- a && de(a);
68
+ a && ce(a);
80
69
  }, [e, S, s, f]), B(() => {
81
70
  if (!e || !S || !s) return;
82
71
  const { baseElement: t, activeId: o } = e.getState();
83
72
  if (!(o === null) || !t) return;
84
73
  const u = c.current;
85
- c.current = null, u && C(u, { relatedTarget: t }), pe(t) || t.focus();
74
+ c.current = null, u && C(u, { relatedTarget: t }), le(t) || t.focus();
86
75
  }, [e, S, s]);
87
76
  const k = e.useState("activeId"), A = e.useState("virtualFocus");
88
77
  B(() => {
@@ -90,10 +79,10 @@ var Me = ce(
90
79
  if (!e || !s || !A) return;
91
80
  const o = c.current;
92
81
  if (c.current = null, !o) return;
93
- const u = ((t = v(e, k)) == null ? void 0 : t.element) || me(o);
82
+ const u = ((t = v(e, k)) == null ? void 0 : t.element) || fe(o);
94
83
  u !== o && C(o, { relatedTarget: u });
95
84
  }, [e, k, A, s]);
96
- const W = O(
85
+ const q = O(
97
86
  e,
98
87
  n.onKeyDownCapture,
99
88
  c
@@ -101,26 +90,26 @@ var Me = ce(
101
90
  e,
102
91
  n.onKeyUpCapture,
103
92
  c
104
- ), _ = n.onFocusCapture, J = E((t) => {
93
+ ), _ = n.onFocusCapture, J = I((t) => {
105
94
  if (_ == null || _(t), t.defaultPrevented || !e) return;
106
95
  const { virtualFocus: o } = e.getState();
107
96
  if (!o) return;
108
- const a = t.relatedTarget, u = oe(t.currentTarget);
97
+ const a = t.relatedTarget, u = re(t.currentTarget);
109
98
  P(t) && u && (t.stopPropagation(), c.current = a);
110
- }), h = n.onFocus, Q = E((t) => {
99
+ }), h = n.onFocus, Q = I((t) => {
111
100
  if (h == null || h(t), t.defaultPrevented || !s || !e) return;
112
101
  const { relatedTarget: o } = t, { virtualFocus: a } = e.getState();
113
- a ? P(t) && !x(e, o) && queueMicrotask(j) : P(t) && e.setActiveId(null);
114
- }), D = n.onBlurCapture, X = E((t) => {
102
+ a ? P(t) && !w(e, o) && queueMicrotask(N) : P(t) && e.setActiveId(null);
103
+ }), T = n.onBlurCapture, X = I((t) => {
115
104
  var o;
116
- if (D == null || D(t), t.defaultPrevented || !e) return;
105
+ if (T == null || T(t), t.defaultPrevented || !e) return;
117
106
  const { virtualFocus: a, activeId: u } = e.getState();
118
107
  if (!a) return;
119
- const m = (o = v(e, u)) == null ? void 0 : o.element, g = t.relatedTarget, F = x(e, g), d = c.current;
120
- c.current = null, P(t) && F ? (g === m ? d && d !== g && C(d, t) : m ? C(m, t) : d && C(d, t), t.stopPropagation()) : !x(e, t.target) && m && C(m, t);
121
- }), T = n.onKeyDown, Y = ve(p), Z = E((t) => {
108
+ const m = (o = v(e, u)) == null ? void 0 : o.element, g = t.relatedTarget, F = w(e, g), d = c.current;
109
+ c.current = null, P(t) && F ? (g === m ? d && d !== g && C(d, t) : m ? C(m, t) : d && C(d, t), t.stopPropagation()) : !w(e, t.target) && m && C(m, t);
110
+ }), D = n.onKeyDown, Y = de(p), Z = I((t) => {
122
111
  var o;
123
- if (T == null || T(t), t.defaultPrevented || !e || !P(t)) return;
112
+ if (D == null || D(t), t.nativeEvent.isComposing || t.defaultPrevented || !e || !P(t)) return;
124
113
  const { orientation: a, renderedItems: u, activeId: m } = e.getState(), g = v(e, m);
125
114
  if ((o = g == null ? void 0 : g.element) != null && o.isConnected) return;
126
115
  const F = a !== "horizontal", d = a !== "vertical", y = Ae(u);
@@ -128,8 +117,8 @@ var Me = ce(
128
117
  const M = {
129
118
  ArrowUp: (y || F) && (() => {
130
119
  if (y) {
131
- const I = De(u);
132
- return I == null ? void 0 : I.id;
120
+ const E = Te(u);
121
+ return E == null ? void 0 : E.id;
133
122
  }
134
123
  return e == null ? void 0 : e.last();
135
124
  }),
@@ -142,16 +131,16 @@ var Me = ce(
142
131
  PageDown: e.last
143
132
  }[t.key];
144
133
  if (M) {
145
- const I = M();
146
- if (I !== void 0) {
134
+ const E = M();
135
+ if (E !== void 0) {
147
136
  if (!Y(t)) return;
148
- t.preventDefault(), e.move(I);
137
+ t.preventDefault(), e.move(E);
149
138
  }
150
139
  }
151
140
  });
152
- n = ge(
141
+ n = pe(
153
142
  n,
154
- (t) => /* @__PURE__ */ Ke(z, { value: e, children: t }),
143
+ (t) => /* @__PURE__ */ we(z, { value: e, children: t }),
155
144
  [e]
156
145
  );
157
146
  const $ = e.useState((t) => {
@@ -159,11 +148,11 @@ var Me = ce(
159
148
  if (e && s && t.virtualFocus)
160
149
  return (o = v(e, t.activeId)) == null ? void 0 : o.id;
161
150
  });
162
- n = ye(R({
151
+ n = me(R({
163
152
  "aria-activedescendant": $
164
153
  }, n), {
165
- ref: Ce(w, q, n.ref),
166
- onKeyDownCapture: W,
154
+ ref: ve(x, W, n.ref),
155
+ onKeyDownCapture: q,
167
156
  onKeyUpCapture: G,
168
157
  onFocusCapture: J,
169
158
  onFocus: Q,
@@ -173,15 +162,26 @@ var Me = ce(
173
162
  const ee = e.useState(
174
163
  (t) => s && (t.virtualFocus || t.activeId === null)
175
164
  );
176
- return n = Pe(R({ focusable: ee }, n)), n;
165
+ return n = ge(R({ focusable: ee }, n)), n;
177
166
  }
178
167
  );
179
- Ee(function(i) {
168
+ Ce(function(i) {
180
169
  const l = Me(i);
181
- return Se(ke, l);
170
+ return Pe(ke, l);
182
171
  });
172
+ b(
173
+ void 0
174
+ );
175
+ var j = Ee(
176
+ [Ke, z],
177
+ [be, ne]
178
+ ), Ne = j.useContext, We = j.useProviderContext;
179
+ b(
180
+ void 0
181
+ );
182
+ b(!1);
183
183
  export {
184
- Me as a,
185
- je as b,
186
- qe as u
184
+ We as a,
185
+ Ne as b,
186
+ Me as u
187
187
  };
@@ -1 +1 @@
1
- @layer components{._list_1mb0d_2{list-style-type:none;padding:0;margin:0;display:flex;gap:var(--spacing-sm);align-items:center;flex-wrap:wrap}._item_1mb0d_11{color:var(--color, var(--color-neutral-90));background-color:var(--backgroundColor, var(--color-neutral-10));font-size:var(--font-size-xs);font-weight:var(--font-weight-bold);height:var(--height-elements-md);width:var(--height-elements-md);border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;text-decoration:none}._item_1mb0d_11:hover,._item_1mb0d_11:focus{--backgroundColor: var(--color-neutral-30)}._item_1mb0d_11:focus{--color: var(--color-neutral-90);outline:none!important}._arrow_1mb0d_32[aria-disabled=true]{pointer-events:none;cursor:not-allowed;--color: var(--color-beige-70);--backgroundColor: var(--color-beige-40)}._page_1mb0d_38[aria-current=true]{--backgroundColor: var(--color-neutral-90);--color: var(--color-neutral-10)}._page_1mb0d_38[aria-current=true]:hover,._page_1mb0d_38[aria-current=true]:focus{--backgroundColor: var(--color-neutral-90)}._dots_1mb0d_45{display:flex;justify-content:center;align-items:center}}
1
+ @layer components{._list_1jk7d_2{list-style-type:none;padding:0;margin:0;display:flex;gap:var(--spacing-sm);align-items:center;flex-wrap:wrap}._item_1jk7d_11{color:var(--color, var(--color-neutral-90));background-color:var(--backgroundColor, var(--color-neutral-10));font-size:var(--font-size-xs);font-weight:var(--font-weight-bold);height:var(--height-elements-md);width:var(--height-elements-md);border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;text-decoration:none}._item_1jk7d_11:not([disabled]):hover,._item_1jk7d_11:focus-visible{--backgroundColor: var(--color-neutral-30)}._item_1jk7d_11:focus-visible{--color: var(--color-neutral-90);outline:none!important}._disabled-arrow_1jk7d_32{cursor:not-allowed;--color: var(--color-beige-70);--backgroundColor: var(--color-beige-40)}._page_1jk7d_37[aria-current=true]{--backgroundColor: var(--color-neutral-90);--color: var(--color-neutral-10)}._page_1jk7d_37[aria-current=true]:hover,._page_1jk7d_37[aria-current=true]:focus-visible{--backgroundColor: var(--color-neutral-90)}._dots_1jk7d_44{display:flex;justify-content:center;align-items:center}}
@@ -1,99 +1,107 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as D } from "react/jsx-runtime";
3
- import { useMemo as E, forwardRef as j, useRef as x, useCallback as R } from "react";
4
- import "./Icon-BisRi8B3.js";
5
- import { L as P } from "./index-CWVOLBDY.js";
6
- import { R as z } from "./index-Dcq5gh3E.js";
7
- import { c as B } from "./index-PAaZGbyz.js";
8
- const G = "_list_1mb0d_2", L = "_item_1mb0d_11", M = "_arrow_1mb0d_32", q = "_page_1mb0d_38", y = "_dots_1mb0d_45", F = {
9
- list: G,
10
- item: L,
11
- arrow: M,
2
+ import { jsx as n, jsxs as M } from "react/jsx-runtime";
3
+ import { useMemo as y, forwardRef as z, useRef as h, useCallback as N } from "react";
4
+ import "./Icon-EG7O4YwD.js";
5
+ import { L as B } from "./index-D5a8Oe6k.js";
6
+ import { R as D } from "./index-BtwrJ6N4.js";
7
+ import { c as G } from "./index-CdiHdiVB.js";
8
+ const L = "_list_1jk7d_2", p = "_item_1jk7d_11", q = "_page_1jk7d_37", F = "_dots_1jk7d_44", J = {
9
+ list: L,
10
+ item: p,
11
+ "disabled-arrow": "_disabled-arrow_1jk7d_32",
12
12
  page: q,
13
- dots: y
14
- }, f = 5, J = 3;
15
- function K({ page: s, pageCount: r, rangeDisplay: n }) {
16
- return E(() => {
17
- if (r <= n || r <= f + 1)
18
- return a(r, (l) => l + 1);
19
- const i = O(s, r), t = i === "before" ? a(f, (l) => l + 1) : [1], o = i === "center" ? a(J, (l) => l + s - 1) : [], h = i === "after" ? a(f, (l) => l + r - f + 1) : [r];
20
- return Q([t, o, h], "-");
21
- }, [s, r, n]);
13
+ dots: F
14
+ }, c = 5, K = 3;
15
+ function O({ page: i, pageCount: t, rangeDisplay: d }) {
16
+ return y(() => {
17
+ if (t <= d || t <= c + 1)
18
+ return _(t, (s) => s + 1);
19
+ const r = Q(i, t), a = r === "before" ? _(c, (s) => s + 1) : [1], o = r === "center" ? _(K, (s) => s + i - 1) : [], l = r === "after" ? _(c, (s) => s + t - c + 1) : [t];
20
+ return S([a, o, l], "-");
21
+ }, [i, t, d]);
22
22
  }
23
- function a(s, r) {
24
- return Array.from({ length: s }, (n, i) => r(i));
23
+ function _(i, t) {
24
+ return Array.from({ length: i }, (d, r) => t(r));
25
25
  }
26
- function O(s, r) {
27
- return s < f ? "before" : s >= f && s <= r - f + 1 ? "center" : s > r - f + 1 ? "after" : "center";
26
+ function Q(i, t) {
27
+ return i < c ? "before" : i >= c && i <= t - c + 1 ? "center" : i > t - c + 1 ? "after" : "center";
28
28
  }
29
- function Q(s, r) {
30
- return s.reduce((n, i, t) => {
29
+ function S(i, t) {
30
+ return i.reduce((d, r, a) => {
31
31
  const o = [];
32
- return o.push(...n), o.push(...i), i.length && t < s.length - 1 && o.push(r), o;
32
+ return o.push(...d), o.push(...r), r.length && a < i.length - 1 && o.push(t), o;
33
33
  }, []);
34
34
  }
35
- const u = B(F), Z = j(
36
- ({ className: s, dataTestId: r, getHref: n, onChange: i, page: t, pageCount: o, rangeDisplay: h = 5, ...l }, w) => {
37
- const $ = K({ page: t, pageCount: o, rangeDisplay: h }), b = x(null), N = x(null), _ = t === 1, v = t === o, k = R(
38
- (c) => {
39
- var d;
40
- c.preventDefault();
41
- const m = t - 1;
42
- m === 1 && ((d = b.current) == null || d.focus()), i(m);
43
- },
44
- [t, i]
45
- ), A = R(
46
- (c) => {
47
- var d;
48
- c.preventDefault();
49
- const m = t + 1;
50
- m === o && ((d = N.current) == null || d.focus()), i(m);
51
- },
52
- [t, o, i]
53
- );
54
- return /* @__PURE__ */ e("nav", { className: s, "data-testid": r, ref: w, role: "navigation", ...l, children: /* @__PURE__ */ D("ol", { className: u("list"), children: [
55
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
56
- "a",
35
+ const f = G(J), H = z(
36
+ ({
37
+ "aria-label": i,
38
+ buttonNextProps: t,
39
+ buttonPrevProps: d,
40
+ dataTestId: r,
41
+ getHref: a,
42
+ listProps: o,
43
+ onChange: l,
44
+ page: s,
45
+ pageCount: m,
46
+ rangeDisplay: x = 5,
47
+ ...v
48
+ }, k) => {
49
+ const R = O({ page: s, pageCount: m, rangeDisplay: x }), j = h(null), w = h(null), u = s === 1, b = s === m, P = N(() => {
50
+ if (u) return;
51
+ const e = Math.max(s - 1, 1);
52
+ l(e);
53
+ }, [u, s, l]), $ = N(() => {
54
+ if (b) return;
55
+ const e = Math.min(s + 1, m);
56
+ l(e);
57
+ }, [b, s, m, l]);
58
+ return /* @__PURE__ */ n("nav", { "aria-label": i ?? "Pagination", "data-testid": r, ref: k, ...v, children: /* @__PURE__ */ M("ol", { className: f("list"), ...o, children: [
59
+ /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
60
+ "button",
57
61
  {
58
- "aria-disabled": _,
59
- className: u("item", "arrow"),
62
+ "aria-label": "Previous Page",
63
+ className: f("item", u && "disabled-arrow"),
60
64
  "data-testid": r ? `${r}-arrow-prev` : void 0,
61
- href: n ? n(_ ? t : t - 1) : "",
62
- onClick: _ ? void 0 : k,
63
- ref: b,
64
- children: /* @__PURE__ */ e(P, { size: "sm" })
65
+ disabled: u,
66
+ onClick: P,
67
+ ref: j,
68
+ type: "button",
69
+ ...d,
70
+ children: /* @__PURE__ */ n(B, { size: "sm" })
65
71
  }
66
72
  ) }),
67
- $.map(
68
- (c, m) => c === "-" ? /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("span", { className: u("dots"), children: "..." }) }, `${m}-`) : /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
73
+ R.map(
74
+ (e, A) => e === "-" ? /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("span", { className: f("dots"), children: "..." }) }, `${A}-`) : /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
69
75
  "a",
70
76
  {
71
- "aria-current": c === t,
72
- className: u("item", "page"),
73
- "data-testid": r ? `${r}-${c}` : void 0,
74
- href: n == null ? void 0 : n(c),
75
- onClick: (d) => {
76
- d.preventDefault(), i(c);
77
+ "aria-current": e === s,
78
+ className: f("item", "page"),
79
+ "data-testid": r ? `${r}-${e}` : void 0,
80
+ href: a == null ? void 0 : a(e),
81
+ onClick: (E) => {
82
+ l && (E.preventDefault(), l(e));
77
83
  },
78
- children: c
84
+ children: e
79
85
  }
80
- ) }, c)
86
+ ) }, e)
81
87
  ),
82
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
83
- "a",
88
+ /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
89
+ "button",
84
90
  {
85
- "aria-disabled": v,
86
- className: u("item", "arrow"),
91
+ "aria-label": "Next Page",
92
+ className: f("item", b && "disabled-arrow"),
87
93
  "data-testid": r ? `${r}-arrow-next` : void 0,
88
- href: n ? n(v ? t : t + 1) : "",
89
- onClick: v ? void 0 : A,
90
- ref: N,
91
- children: /* @__PURE__ */ e(z, { size: "sm" })
94
+ disabled: b,
95
+ onClick: $,
96
+ ref: w,
97
+ type: "button",
98
+ ...t,
99
+ children: /* @__PURE__ */ n(D, { size: "sm" })
92
100
  }
93
101
  ) })
94
102
  ] }) });
95
103
  }
96
104
  );
97
105
  export {
98
- Z as Pagination
106
+ H as Pagination
99
107
  };
@@ -1,48 +1,47 @@
1
1
  "use client";
2
2
  import { jsx as o } from "react/jsx-runtime";
3
- import { forwardRef as c, useState as p } from "react";
3
+ import { forwardRef as p, useState as c } from "react";
4
4
  import { InputText as m } from "./InputText.js";
5
5
  import { Button as l } from "./Button.js";
6
- import "./Icon-BisRi8B3.js";
7
- import { S as u, H as x } from "./index-5rXezknO.js";
8
- const f = ({ isHidden: e, onClick: t, title: a, ...s }) => /* @__PURE__ */ o(
6
+ import "./Icon-EG7O4YwD.js";
7
+ import { S as w, H as u } from "./index-BC2bF45u.js";
8
+ const x = ({ isHidden: s, onClick: t, ...a }) => /* @__PURE__ */ o(
9
9
  l,
10
10
  {
11
11
  "aria-controls": "password",
12
- "aria-expanded": !e,
12
+ "aria-expanded": !s,
13
13
  onClick: t,
14
14
  shape: "circle",
15
15
  size: "xs",
16
- title: a,
17
16
  variant: "ghost",
18
- ...s,
19
- children: e ? /* @__PURE__ */ o(u, {}) : /* @__PURE__ */ o(x, {})
17
+ ...a,
18
+ children: s ? /* @__PURE__ */ o(w, {}) : /* @__PURE__ */ o(u, {})
20
19
  }
21
- ), v = c(
22
- ({ title: e, ...t }, a) => {
23
- const [s, r] = p("password"), n = s === "password", i = () => {
24
- r(n ? "text" : "password");
20
+ ), H = p(
21
+ ({ toggleAriaLabel: s, ...t }, a) => {
22
+ const [r, n] = c("password"), e = r === "password", i = () => {
23
+ n(e ? "text" : "password");
25
24
  }, d = t["data-testid"] ? `${t["data-testid"]}-action` : void 0;
26
25
  return /* @__PURE__ */ o(
27
26
  m,
28
27
  {
29
28
  ...t,
30
29
  icon: /* @__PURE__ */ o(
31
- f,
30
+ x,
32
31
  {
32
+ "aria-label": s ?? (e ? "Show password" : "Hide password"),
33
33
  "data-testid": d,
34
- isHidden: n,
35
- onClick: i,
36
- title: e
34
+ isHidden: e,
35
+ onClick: i
37
36
  }
38
37
  ),
39
38
  iconPlacement: "right",
40
39
  ref: a,
41
- type: s
40
+ type: r
42
41
  }
43
42
  );
44
43
  }
45
44
  );
46
45
  export {
47
- v as PasswordInput
46
+ H as PasswordInput
48
47
  };
package/dist/Popover.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as u } from "react/jsx-runtime";
2
+ import { jsx as r, jsxs as _ } from "react/jsx-runtime";
3
3
  import { forwardRef as i } from "react";
4
- import { c as l } from "./index-PAaZGbyz.js";
4
+ import { c as l } from "./index-CdiHdiVB.js";
5
5
  import { Button as w } from "./Button.js";
6
- import "./Icon-BisRi8B3.js";
7
- import { C as f } from "./index-BJLXLdM3.js";
8
- import { d as P } from "./YV4JVR4I-CVFstk2K.js";
9
- import { P as g, f as C, g as b, h as x, i as H, j as N } from "./BYC7LY2E-DbSoi9cN.js";
6
+ import "./Icon-EG7O4YwD.js";
7
+ import { C as f } from "./index-Bt79XJ8R.js";
8
+ import { u as P } from "./RTNCFSKZ-qpPg689E.js";
9
+ import { P as g, f as C, g as b, h as x, i as H, j as N } from "./GVVKDT6A-bET6V7Py.js";
10
10
  import { f as p } from "./forwardRefWithAs-8eP3ZN15.js";
11
- import { P as $ } from "./QYJ6MIDR-Dm7lYMh6.js";
11
+ import { P as $ } from "./4I4MLMKD-BLxAidnq.js";
12
12
  const j = "_root_1ldto_2", S = "_title_1ldto_15", T = "_content_1ldto_27", B = "_arrow_1ldto_41", a = {
13
13
  root: j,
14
14
  title: S,
@@ -22,11 +22,11 @@ const j = "_root_1ldto_2", S = "_title_1ldto_15", T = "_content_1ldto_27", B = "
22
22
  "placement-right": "_placement-right_1ldto_52",
23
23
  "placement-left": "_placement-left_1ldto_55",
24
24
  "placement-bottom": "_placement-bottom_1ldto_58"
25
- }, L = l(a), _ = i(
25
+ }, L = l(a), d = i(
26
26
  ({ className: t, ...e }, o) => /* @__PURE__ */ r("div", { className: L("content", t), ref: o, ...e })
27
27
  ), m = l(a), R = ({ store: t }) => {
28
28
  const e = P(t, "currentPlacement"), [o] = e.split("-");
29
- return /* @__PURE__ */ r(g, { className: m("arrow"), store: t, children: /* @__PURE__ */ u(
29
+ return /* @__PURE__ */ r(g, { className: m("arrow"), store: t, children: /* @__PURE__ */ _(
30
30
  "svg",
31
31
  {
32
32
  className: m("arrow-item", o && `placement-${o}`),
@@ -37,17 +37,17 @@ const j = "_root_1ldto_2", S = "_title_1ldto_15", T = "_content_1ldto_27", B = "
37
37
  ]
38
38
  }
39
39
  ) });
40
- }, d = l(a), v = ({ children: t, className: e, onClose: o, store: n }) => {
40
+ }, u = l(a), v = ({ children: t, className: e, onClose: o, store: n }) => {
41
41
  const s = () => {
42
42
  o && o(), n == null || n.hide();
43
43
  }, { withCloseButton: c } = n;
44
- return /* @__PURE__ */ u("div", { className: d("content-wrapper", e), children: [
44
+ return /* @__PURE__ */ _("div", { className: u("content-wrapper", e), children: [
45
45
  /* @__PURE__ */ r(R, { store: n }),
46
46
  t,
47
47
  c ? /* @__PURE__ */ r(
48
48
  w,
49
49
  {
50
- className: d("close-button"),
50
+ className: u("close-button"),
51
51
  onClick: s,
52
52
  shape: "square",
53
53
  size: "xs",
@@ -95,7 +95,7 @@ const j = "_root_1ldto_2", S = "_title_1ldto_15", T = "_content_1ldto_27", B = "
95
95
  );
96
96
  }
97
97
  ), U = Object.assign(M, {
98
- Content: _,
98
+ Content: d,
99
99
  Title: h,
100
100
  Trigger: y
101
101
  }), V = ({
@@ -133,7 +133,7 @@ const j = "_root_1ldto_2", S = "_title_1ldto_15", T = "_content_1ldto_27", B = "
133
133
  );
134
134
  }
135
135
  ), Y = Object.assign(W, {
136
- Content: _,
136
+ Content: d,
137
137
  Title: h,
138
138
  Trigger: k
139
139
  });