welcome-ui 10.0.0-alpha.1 → 10.0.0-alpha.11
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/README.md +1 -1
- package/dist/2W3RN7C5-DMC82gDP.js +61 -0
- package/dist/4I4MLMKD-BO6Lcy7s.js +150 -0
- package/dist/Accordion.js +20 -18
- package/dist/Alert.css +1 -1
- package/dist/Alert.js +93 -87
- package/dist/AspectRatio.js +2 -1
- package/dist/Avatar.js +14 -12
- package/dist/{B7UTNDHN-BlIblHCu.js → B7UTNDHN-BghjolIs.js} +30 -30
- package/dist/Badge.js +2 -1
- package/dist/Breadcrumb.css +1 -1
- package/dist/Breadcrumb.js +175 -154
- package/dist/Button.css +1 -1
- package/dist/Button.js +43 -41
- package/dist/ButtonGroup.js +7 -5
- package/dist/Card.css +1 -1
- package/dist/Card.js +68 -15
- package/dist/Checkbox.js +32 -30
- package/dist/CloseButton.css +1 -1
- package/dist/CloseButton.js +15 -13
- package/dist/{CustomPopper-vwbOQq72.js → CustomPopper-C1wIDHbM.js} +5 -4
- package/dist/{DSAASPLT-BaaCUKsb.js → DSAASPLT-Fx1kuAsk.js} +3 -3
- package/dist/DatePicker.js +96 -91
- package/dist/DateTimePicker.js +21 -20
- package/dist/Drawer.js +141 -96
- package/dist/DropdownMenu.css +1 -1
- package/dist/DropdownMenu.js +902 -462
- package/dist/Field.css +1 -1
- package/dist/Field.js +50 -50
- package/dist/FieldGroup.js +9 -7
- package/dist/FileDrop.css +1 -1
- package/dist/FileDrop.js +433 -398
- package/dist/FileUpload.js +44 -41
- package/dist/GVVKDT6A-CF9ejW_c.js +619 -0
- package/dist/Hint.js +10 -8
- package/dist/Icon.css +1 -1
- package/dist/Icon.js +36 -22
- package/dist/InputText.css +1 -1
- package/dist/InputText.js +59 -57
- package/dist/{KPUWHTQJ-D2TPji47.js → KPUWHTQJ-Dv3cAqjP.js} +33 -31
- package/dist/Label.js +9 -7
- package/dist/Link.css +1 -1
- package/dist/Link.js +54 -49
- package/dist/Loader.js +13 -11
- package/dist/Logo.js +21 -13
- package/dist/Modal.js +153 -113
- package/dist/{NI3IVY7K-Ztb3-XAv.js → NI3IVY7K-Dy240mkD.js} +53 -53
- package/dist/{NMGNQVTG-C6TqBngP.js → NMGNQVTG-DRO2uXZT.js} +8 -8
- package/dist/{OE2EFRVA-C3721cM3.js → OE2EFRVA-Dg1R6gaC.js} +186 -170
- package/dist/{OLVWQA7U-DysaSaZj.js → OLVWQA7U-Dia3UUnG.js} +51 -51
- package/dist/Pagination.css +1 -1
- package/dist/Pagination.js +157 -76
- package/dist/PasswordInput.js +20 -17
- package/dist/Popover.js +89 -72
- package/dist/{RTNCFSKZ-qpPg689E.js → RTNCFSKZ-BywELldk.js} +47 -47
- package/dist/Radio.css +1 -1
- package/dist/Radio.js +39 -40
- package/dist/RadioGroup.js +29 -27
- package/dist/RadioTab.js +3 -2
- package/dist/{SBSPVDDI-DJKkC1eb.js → SBSPVDDI-CmtnvvUX.js} +42 -42
- package/dist/SQZLCNLX-Dg4KKdNJ.js +83 -0
- package/dist/Search.css +1 -1
- package/dist/Search.js +136 -129
- package/dist/Select.css +1 -1
- package/dist/Select.js +259 -257
- package/dist/Slider.js +67 -62
- package/dist/Stepper.js +34 -27
- package/dist/StickyNote.css +1 -0
- package/dist/StickyNote.js +49 -0
- package/dist/Swiper.js +53 -51
- package/dist/{T22PY7TE-C1N0q8Kn.js → T22PY7TE-gLuJpoOm.js} +46 -46
- package/dist/Table.js +34 -21
- package/dist/Tabs.js +165 -156
- package/dist/Tag.css +1 -1
- package/dist/Tag.js +67 -62
- package/dist/Text.js +5 -3
- package/dist/Textarea.css +1 -1
- package/dist/Textarea.js +26 -17
- package/dist/TimePicker.js +53 -51
- package/dist/Toast.css +1 -1
- package/dist/Toast.js +275 -165
- package/dist/Toggle.js +17 -15
- package/dist/Tooltip.css +1 -1
- package/dist/Tooltip.js +120 -129
- package/dist/VariantIcon.js +8 -6
- package/dist/VisuallyHidden.js +9 -7
- package/dist/WelcomeLoader.js +4 -3
- package/dist/XCKGTAUF-CJwwVibW.js +25 -0
- package/dist/{Y67KZUMI-DFEgrUv2.js → Y67KZUMI-BwLWwpNF.js} +5 -5
- package/dist/{ZTXFEM5L-CkrIQCN1.js → ZTXFEM5L-WGHY_jqg.js} +3 -3
- package/dist/{downshift.esm-D_6pHXkq.js → downshift.esm-xtYanIDi.js} +1 -1
- package/dist/scss/breakpoints.scss +9 -0
- package/dist/scss/text-ellipsis.scss +5 -0
- package/dist/scss/texts.scss +108 -0
- package/dist/theme.css +1 -1
- package/dist/theme.js +1 -0
- package/dist/{tslib.es6-DpB4Y59c.js → tslib.es6-C80jYMbM.js} +1 -1
- package/dist/types/components/Alert/components/Buttons.d.ts +3 -0
- package/dist/types/components/Alert/components/Title.d.ts +5 -0
- package/dist/types/components/Alert/index.d.ts +7 -3
- package/dist/types/components/Alert/types.d.ts +3 -9
- package/dist/types/components/Breadcrumb/Item.d.ts +2 -2
- package/dist/types/components/Breadcrumb/index.d.ts +1 -1
- package/dist/types/components/Breadcrumb/types.d.ts +6 -3
- package/dist/types/components/Card/Body.d.ts +2 -3
- package/dist/types/components/Card/Footer.d.ts +6 -0
- package/dist/types/components/Card/Header.d.ts +5 -0
- package/dist/types/components/Card/index.d.ts +7 -8
- package/dist/types/components/Card/types.d.ts +16 -3
- package/dist/types/components/Checkbox/index.d.ts +1 -2
- package/dist/types/components/Checkbox/types.d.ts +3 -1
- package/dist/types/components/DateTimePickerCommon/CustomHeader.d.ts +4 -1
- package/dist/types/components/DateTimePickerCommon/CustomPopper.d.ts +6 -3
- package/dist/types/components/Drawer/AssetDrawer/Header.d.ts +4 -1
- package/dist/types/components/Drawer/AssetDrawer/IconBlock.d.ts +4 -1
- package/dist/types/components/Drawer/AssetDrawer/types.d.ts +3 -0
- package/dist/types/components/Drawer/components/Backdrop.d.ts +1 -1
- package/dist/types/components/Drawer/components/Close.d.ts +4 -1
- package/dist/types/components/Drawer/components/Title.d.ts +4 -1
- package/dist/types/components/Drawer/index.d.ts +13 -4
- package/dist/types/components/DropdownMenu/Action.d.ts +2 -0
- package/dist/types/components/DropdownMenu/Group.d.ts +4 -0
- package/dist/types/components/DropdownMenu/Item.d.ts +7 -0
- package/dist/types/components/DropdownMenu/Search.d.ts +2 -0
- package/dist/types/components/DropdownMenu/Submenu.d.ts +4 -0
- package/dist/types/components/DropdownMenu/index.d.ts +11 -0
- package/dist/types/components/DropdownMenu/types.d.ts +26 -5
- package/dist/types/components/FileDrop/components/FilePreview.d.ts +4 -1
- package/dist/types/components/FileDrop/components/Message.d.ts +4 -1
- package/dist/types/components/FileDrop/types.d.ts +2 -0
- package/dist/types/components/Icon/icons.d.ts +6 -6
- package/dist/types/components/Icon/types.d.ts +2 -0
- package/dist/types/components/Loader/index.d.ts +4 -1
- package/dist/types/components/Modal/Assets/AssetContent.d.ts +4 -1
- package/dist/types/components/Modal/Assets/AssetTitle.d.ts +4 -1
- package/dist/types/components/Modal/Assets/CloseButton.d.ts +4 -1
- package/dist/types/components/Modal/Assets/Dialog.d.ts +4 -1
- package/dist/types/components/Modal/Assets/Iframe.d.ts +4 -1
- package/dist/types/components/Modal/Assets/index.d.ts +16 -4
- package/dist/types/components/Modal/components/Close.d.ts +4 -1
- package/dist/types/components/Modal/components/Content.d.ts +1 -1
- package/dist/types/components/Modal/index.d.ts +17 -5
- package/dist/types/components/Modal/types.d.ts +1 -1
- package/dist/types/components/Pagination/types.d.ts +11 -0
- package/dist/types/components/PasswordInput/ToggleButton.d.ts +4 -1
- package/dist/types/components/Popover/Arrow.d.ts +4 -1
- package/dist/types/components/Popover/ContentWrapper.d.ts +4 -1
- package/dist/types/components/Radio/types.d.ts +1 -1
- package/dist/types/components/RadioGroup/index.d.ts +4 -1
- package/dist/types/components/Stepper/index.d.ts +8 -2
- package/dist/types/components/StickyNote/components/Button.d.ts +5 -0
- package/dist/types/components/StickyNote/components/Title.d.ts +5 -0
- package/dist/types/components/StickyNote/index.d.ts +11 -0
- package/dist/types/components/StickyNote/index.test.d.ts +1 -0
- package/dist/types/components/StickyNote/types.d.ts +15 -0
- package/dist/types/components/Swiper/index.d.ts +4 -1
- package/dist/types/components/Table/index.d.ts +20 -5
- package/dist/types/components/Tabs/components/ActiveBar/index.d.ts +4 -1
- package/dist/types/components/Tag/types.d.ts +4 -2
- package/dist/types/components/Textarea/types.d.ts +1 -0
- package/dist/types/components/Toast/components/Growl.d.ts +2 -0
- package/dist/types/components/Toast/index.d.ts +8 -2
- package/dist/types/components/Toast/types.d.ts +8 -9
- package/dist/types/components/Tooltip/types.d.ts +1 -1
- package/dist/types/theme/types.d.ts +255 -218
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/{utils-DileZjMm.js → utils-BD597oo6.js} +1 -1
- package/dist/utils.js +3 -2
- package/package.json +3 -2
- package/dist/2W3RN7C5-bkX-rIa3.js +0 -61
- package/dist/4I4MLMKD-BLxAidnq.js +0 -43
- package/dist/GVVKDT6A-bET6V7Py.js +0 -724
- package/dist/SQZLCNLX-CHDXnZ16.js +0 -82
- package/dist/XCKGTAUF-DkxWCbaW.js +0 -25
- package/dist/index.css +0 -0
- package/dist/types/components/Icon/Icon.d.ts +0 -2
- package/dist/types/utils/theme/index.d.ts +0 -0
- /package/dist/{index-CdiHdiVB.js → index-PAaZGbyz.js} +0 -0
- /package/dist/types/components/Icon/{Icon.test.d.ts → index.test.d.ts} +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { c as te, g as v, s as re, i as
|
|
3
|
-
import { c as ie, _ as L, i as ae,
|
|
4
|
-
import { f as Ie, r as Se } from "./B7UTNDHN-
|
|
5
|
-
import { useRef as H, useEffect as V, useState as Fe, useCallback as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { P as be,
|
|
8
|
-
var
|
|
9
|
-
function
|
|
2
|
+
import { c as te, g as v, s as re, i as x, a as z, d as oe, e as se, C as ne } from "./SBSPVDDI-CmtnvvUX.js";
|
|
3
|
+
import { c as ie, _ as L, i as ae, am as ue, an as ce, m as M, ao as C, t as le, ah as fe, u as I, j as P, p as de, h as U, k as pe, d as me, v as ve, a as R, Z as ge, ap as ye, f as Ce, b as Pe, e as Ee } from "./OE2EFRVA-Dg1R6gaC.js";
|
|
4
|
+
import { f as Ie, r as Se } from "./B7UTNDHN-BghjolIs.js";
|
|
5
|
+
import { useRef as H, useEffect as V, useState as Fe, useCallback as we, createContext as b } from "react";
|
|
6
|
+
import { jsx as xe } from "react/jsx-runtime";
|
|
7
|
+
import { P as be, b as Ke } from "./Y67KZUMI-BwLWwpNF.js";
|
|
8
|
+
var he = "div";
|
|
9
|
+
function ke(r) {
|
|
10
10
|
return r.some((i) => !!i.rowId);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Ae(r) {
|
|
13
13
|
const i = r.target;
|
|
14
14
|
return i && !U(i) ? !1 : r.key.length === 1 && !r.ctrlKey && !r.metaKey;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function _e(r) {
|
|
17
17
|
return r.key === "Shift" || r.key === "Control" || r.key === "Alt" || r.key === "Meta";
|
|
18
18
|
}
|
|
19
19
|
function O(r, i, l) {
|
|
20
20
|
return I((e) => {
|
|
21
21
|
var s;
|
|
22
|
-
if (i == null || i(e), e.defaultPrevented || e.isPropagationStopped() || !P(e) ||
|
|
22
|
+
if (i == null || i(e), e.defaultPrevented || e.isPropagationStopped() || !P(e) || _e(e) || Ae(e)) return;
|
|
23
23
|
const f = r.getState(), p = (s = v(r, f.activeId)) == null ? void 0 : s.element;
|
|
24
24
|
if (!p) return;
|
|
25
|
-
const n = e, { view: K } = n,
|
|
26
|
-
p !== c && p.focus(), ye(p, e.type,
|
|
25
|
+
const n = e, { view: K } = n, w = L(n, ["view"]), c = l == null ? void 0 : l.current;
|
|
26
|
+
p !== c && p.focus(), ye(p, e.type, w) || e.preventDefault(), e.currentTarget.contains(p) && e.stopPropagation();
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
function Te(r) {
|
|
@@ -32,7 +32,7 @@ function Te(r) {
|
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
34
|
function De(r) {
|
|
35
|
-
const [i, l] = Fe(!1), e =
|
|
35
|
+
const [i, l] = Fe(!1), e = we(() => l(!0), []), s = r.useState(
|
|
36
36
|
(f) => v(r, f.activeId)
|
|
37
37
|
);
|
|
38
38
|
return V(() => {
|
|
@@ -40,7 +40,7 @@ function De(r) {
|
|
|
40
40
|
i && f && (l(!1), f.focus({ preventScroll: !0 }));
|
|
41
41
|
}, [s, i]), e;
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var Be = ie(
|
|
44
44
|
function(i) {
|
|
45
45
|
var l = i, {
|
|
46
46
|
store: e,
|
|
@@ -58,7 +58,7 @@ var Me = ie(
|
|
|
58
58
|
e,
|
|
59
59
|
process.env.NODE_ENV !== "production" && "Composite must receive a `store` prop or be wrapped in a CompositeProvider component."
|
|
60
60
|
);
|
|
61
|
-
const
|
|
61
|
+
const w = H(null), c = H(null), N = De(e), S = e.useState("moves"), [, q] = ue(
|
|
62
62
|
s ? e.setBaseElement : null
|
|
63
63
|
);
|
|
64
64
|
V(() => {
|
|
@@ -66,55 +66,55 @@ var Me = ie(
|
|
|
66
66
|
if (!e || !S || !s || !f) return;
|
|
67
67
|
const { activeId: o } = e.getState(), a = (t = v(e, o)) == null ? void 0 : t.element;
|
|
68
68
|
a && ce(a);
|
|
69
|
-
}, [e, S, s, f]),
|
|
69
|
+
}, [e, S, s, f]), M(() => {
|
|
70
70
|
if (!e || !S || !s) return;
|
|
71
71
|
const { baseElement: t, activeId: o } = e.getState();
|
|
72
72
|
if (!(o === null) || !t) return;
|
|
73
73
|
const u = c.current;
|
|
74
74
|
c.current = null, u && C(u, { relatedTarget: t }), le(t) || t.focus();
|
|
75
75
|
}, [e, S, s]);
|
|
76
|
-
const
|
|
77
|
-
|
|
76
|
+
const h = e.useState("activeId"), k = e.useState("virtualFocus");
|
|
77
|
+
M(() => {
|
|
78
78
|
var t;
|
|
79
|
-
if (!e || !s || !
|
|
79
|
+
if (!e || !s || !k) return;
|
|
80
80
|
const o = c.current;
|
|
81
81
|
if (c.current = null, !o) return;
|
|
82
|
-
const u = ((t = v(e,
|
|
82
|
+
const u = ((t = v(e, h)) == null ? void 0 : t.element) || fe(o);
|
|
83
83
|
u !== o && C(o, { relatedTarget: u });
|
|
84
|
-
}, [e,
|
|
85
|
-
const
|
|
84
|
+
}, [e, h, k, s]);
|
|
85
|
+
const G = O(
|
|
86
86
|
e,
|
|
87
87
|
n.onKeyDownCapture,
|
|
88
88
|
c
|
|
89
|
-
),
|
|
89
|
+
), W = O(
|
|
90
90
|
e,
|
|
91
91
|
n.onKeyUpCapture,
|
|
92
92
|
c
|
|
93
|
-
),
|
|
94
|
-
if (
|
|
93
|
+
), A = n.onFocusCapture, Z = I((t) => {
|
|
94
|
+
if (A == null || A(t), t.defaultPrevented || !e) return;
|
|
95
95
|
const { virtualFocus: o } = e.getState();
|
|
96
96
|
if (!o) return;
|
|
97
97
|
const a = t.relatedTarget, u = re(t.currentTarget);
|
|
98
98
|
P(t) && u && (t.stopPropagation(), c.current = a);
|
|
99
|
-
}),
|
|
100
|
-
if (
|
|
99
|
+
}), _ = n.onFocus, J = I((t) => {
|
|
100
|
+
if (_ == null || _(t), t.defaultPrevented || !s || !e) return;
|
|
101
101
|
const { relatedTarget: o } = t, { virtualFocus: a } = e.getState();
|
|
102
|
-
a ? P(t) && !
|
|
103
|
-
}), T = n.onBlurCapture,
|
|
102
|
+
a ? P(t) && !x(e, o) && queueMicrotask(N) : P(t) && e.setActiveId(null);
|
|
103
|
+
}), T = n.onBlurCapture, Q = I((t) => {
|
|
104
104
|
var o;
|
|
105
105
|
if (T == null || T(t), t.defaultPrevented || !e) return;
|
|
106
106
|
const { virtualFocus: a, activeId: u } = e.getState();
|
|
107
107
|
if (!a) return;
|
|
108
|
-
const m = (o = v(e, u)) == null ? void 0 : o.element, g = t.relatedTarget, F =
|
|
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()) : !
|
|
110
|
-
}), D = n.onKeyDown,
|
|
108
|
+
const m = (o = v(e, u)) == null ? void 0 : o.element, g = t.relatedTarget, F = x(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()) : !x(e, t.target) && m && C(m, t);
|
|
110
|
+
}), D = n.onKeyDown, X = de(p), Y = I((t) => {
|
|
111
111
|
var o;
|
|
112
112
|
if (D == null || D(t), t.nativeEvent.isComposing || t.defaultPrevented || !e || !P(t)) return;
|
|
113
113
|
const { orientation: a, renderedItems: u, activeId: m } = e.getState(), g = v(e, m);
|
|
114
114
|
if ((o = g == null ? void 0 : g.element) != null && o.isConnected) return;
|
|
115
|
-
const F = a !== "horizontal", d = a !== "vertical", y =
|
|
115
|
+
const F = a !== "horizontal", d = a !== "vertical", y = ke(u);
|
|
116
116
|
if ((t.key === "ArrowLeft" || t.key === "ArrowRight" || t.key === "Home" || t.key === "End") && U(t.currentTarget)) return;
|
|
117
|
-
const
|
|
117
|
+
const B = {
|
|
118
118
|
ArrowUp: (y || F) && (() => {
|
|
119
119
|
if (y) {
|
|
120
120
|
const E = Te(u);
|
|
@@ -130,17 +130,17 @@ var Me = ie(
|
|
|
130
130
|
PageUp: e.first,
|
|
131
131
|
PageDown: e.last
|
|
132
132
|
}[t.key];
|
|
133
|
-
if (
|
|
134
|
-
const E =
|
|
133
|
+
if (B) {
|
|
134
|
+
const E = B();
|
|
135
135
|
if (E !== void 0) {
|
|
136
|
-
if (!
|
|
136
|
+
if (!X(t)) return;
|
|
137
137
|
t.preventDefault(), e.move(E);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
n = pe(
|
|
142
142
|
n,
|
|
143
|
-
(t) => /* @__PURE__ */
|
|
143
|
+
(t) => /* @__PURE__ */ xe(z, { value: e, children: t }),
|
|
144
144
|
[e]
|
|
145
145
|
);
|
|
146
146
|
const $ = e.useState((t) => {
|
|
@@ -151,13 +151,13 @@ var Me = ie(
|
|
|
151
151
|
n = me(R({
|
|
152
152
|
"aria-activedescendant": $
|
|
153
153
|
}, n), {
|
|
154
|
-
ref: ve(
|
|
155
|
-
onKeyDownCapture:
|
|
156
|
-
onKeyUpCapture:
|
|
157
|
-
onFocusCapture:
|
|
158
|
-
onFocus:
|
|
159
|
-
onBlurCapture:
|
|
160
|
-
onKeyDown:
|
|
154
|
+
ref: ve(w, q, n.ref),
|
|
155
|
+
onKeyDownCapture: G,
|
|
156
|
+
onKeyUpCapture: W,
|
|
157
|
+
onFocusCapture: Z,
|
|
158
|
+
onFocus: J,
|
|
159
|
+
onBlurCapture: Q,
|
|
160
|
+
onKeyDown: Y
|
|
161
161
|
});
|
|
162
162
|
const ee = e.useState(
|
|
163
163
|
(t) => s && (t.virtualFocus || t.activeId === null)
|
|
@@ -166,8 +166,8 @@ var Me = ie(
|
|
|
166
166
|
}
|
|
167
167
|
);
|
|
168
168
|
Ce(function(i) {
|
|
169
|
-
const l =
|
|
170
|
-
return Pe(
|
|
169
|
+
const l = Be(i);
|
|
170
|
+
return Pe(he, l);
|
|
171
171
|
});
|
|
172
172
|
b(
|
|
173
173
|
void 0
|
|
@@ -175,13 +175,13 @@ b(
|
|
|
175
175
|
var j = Ee(
|
|
176
176
|
[Ke, z],
|
|
177
177
|
[be, ne]
|
|
178
|
-
), Ne = j.useContext,
|
|
178
|
+
), Ne = j.useContext, qe = j.useProviderContext;
|
|
179
179
|
b(
|
|
180
180
|
void 0
|
|
181
181
|
);
|
|
182
182
|
b(!1);
|
|
183
183
|
export {
|
|
184
|
-
|
|
184
|
+
qe as a,
|
|
185
185
|
Ne as b,
|
|
186
|
-
|
|
186
|
+
Be as u
|
|
187
187
|
};
|
package/dist/Pagination.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.
|
|
1
|
+
@layer components{._list_uyk8e_3{list-style-type:none;padding:0;margin:0;display:flex;gap:var(--components-dimensions-pagination-gap-pages);align-items:center;flex-wrap:wrap}._item_uyk8e_13{color:var(--color, var(--components-colors-pagination-color-icon-unchecked-pressed));background-color:var(--backgroundColor, var(--components-colors-pagination-color-background-unchecked-default));font-size:var(--components-dimensions-pagination-start-padding-inline-trailing-md);font-weight:var(--font-weight-semi-bold);border-radius:var(--components-dimensions-pagination-border-radius);display:flex;align-items:center;justify-content:center;cursor:pointer;text-decoration:none;border-color:var(--borderColor, var(--components-colors-pagination-color-border-unchecked-default));border-width:var(--borderWidth, var(--components-dimensions-pagination-border-width-unchecked));border-style:solid;box-shadow:var(--elevation-10)}._item_uyk8e_13:not([disabled]):not([aria-current=true]):hover,._item_uyk8e_13:not([disabled]):not([aria-current=true]):focus-visible{background-color:var(--components-colors-pagination-color-background-unchecked-hover);border-color:var(--components-colors-pagination-color-border-unchecked-hover);box-shadow:var(--elevation-20);outline:none!important}._item_uyk8e_13:not([disabled]):not([aria-current=true]):active{background-color:var(--components-colors-pagination-color-background-unchecked-pressed);border-color:var(--components-colors-pagination-color-border-unchecked-pressed)}._item_uyk8e_13._disabled-arrow_uyk8e_43,._item_uyk8e_13[disabled]{cursor:not-allowed;color:var(--components-colors-pagination-color-text-unchecked-disabled);background:repeating-linear-gradient(-45deg,var(--color-neutral-30),var(--color-neutral-30) 1.75px,var(--color-background-warm-stronger) 3.75px,var(--color-background-warm-stronger) 3.25px) padding-box;box-shadow:none;border:0}._page_uyk8e_52[aria-current=true]{background-color:var(--components-colors-pagination-color-background-checked-default);border-color:var(--components-colors-pagination-color-border-checked-default);border-width:var(--components-dimensions-pagination-border-width-checked);color:var(--components-colors-pagination-color-text-checked-default)}._page_uyk8e_52[aria-current=true]:hover,._page_uyk8e_52[aria-current=true]:focus-visible{background-color:var(--components-colors-pagination-color-background-checked-hover);border-color:var(--components-colors-pagination-color-border-checked-hover);color:var(--components-colors-pagination-color-text-checked-hover);outline:none!important}._page_uyk8e_52[aria-current=true]:active{background-color:var(--components-colors-pagination-color-background-checked-pressed);border-color:var(--components-colors-pagination-color-border-checked-pressed);color:var(--components-colors-pagination-color-text-checked-pressed)}._with-text-left_uyk8e_72,._with-text-right_uyk8e_72{gap:var(--components-dimensions-pagination-gap-content)}._size-lg_uyk8e_75{font-size:var(--font-size-md);height:var(--components-dimensions-pagination-size-max-height-lg);width:var(--components-dimensions-pagination-size-min-height-lg)}._size-lg_uyk8e_75._with-text-right_uyk8e_72{padding-left:var(--components-dimensions-pagination-start-padding-inline-leading-lg);padding-right:var(--components-dimensions-pagination-end-padding-inline-leading-lg);width:auto}._size-lg_uyk8e_75._with-text-left_uyk8e_72{padding-left:var(--components-dimensions-pagination-start-padding-inline-trailing-lg);padding-right:var(--components-dimensions-pagination-end-padding-inline-trailing-lg);width:auto}._size-md_uyk8e_90{font-size:var(--font-size-sm);height:var(--components-dimensions-pagination-size-max-height-md);width:var(--components-dimensions-pagination-size-min-height-md)}._size-md_uyk8e_90._with-text-right_uyk8e_72{padding-left:var(--components-dimensions-pagination-start-padding-inline-leading-md);padding-right:var(--components-dimensions-pagination-end-padding-inline-leading-md);width:auto}._size-md_uyk8e_90._with-text-left_uyk8e_72{padding-left:var(--components-dimensions-pagination-start-padding-inline-trailing-md);padding-right:var(--components-dimensions-pagination-end-padding-inline-trailing-md);width:auto}}
|
package/dist/Pagination.js
CHANGED
|
@@ -1,105 +1,186 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
import './Pagination.css';
|
|
3
|
+
import { jsx as s, jsxs as N } from "react/jsx-runtime";
|
|
4
|
+
import { useMemo as Y, forwardRef as Z, useRef as M, useCallback as R } from "react";
|
|
5
|
+
import { Icon as A } from "./Icon.js";
|
|
6
|
+
import { c as H } from "./index-PAaZGbyz.js";
|
|
7
|
+
const I = "_list_uyk8e_3", n = "_item_uyk8e_13", C = "_page_uyk8e_52", a = {
|
|
8
|
+
list: I,
|
|
9
|
+
item: n,
|
|
10
|
+
"disabled-arrow": "_disabled-arrow_uyk8e_43",
|
|
11
|
+
page: C,
|
|
12
|
+
"with-text-left": "_with-text-left_uyk8e_72",
|
|
13
|
+
"with-text-right": "_with-text-right_uyk8e_72",
|
|
14
|
+
"size-lg": "_size-lg_uyk8e_75",
|
|
15
|
+
"size-md": "_size-md_uyk8e_90"
|
|
16
|
+
}, h = 5, x = 3;
|
|
17
|
+
function v({ page: c, pageCount: e, rangeDisplay: P }) {
|
|
18
|
+
return Y(() => {
|
|
19
|
+
if (e <= P || e <= h + 1)
|
|
20
|
+
return B(e, (b) => b + 1);
|
|
21
|
+
const u = g(c, e), o = u === "before" ? B(h, (b) => b + 1) : [1], r = u === "center" ? B(x, (b) => b + c - 1) : [], w = u === "after" ? B(h, (b) => b + e - h + 1) : [e];
|
|
22
|
+
return T([o, r, w], "-");
|
|
23
|
+
}, [c, e, P]);
|
|
20
24
|
}
|
|
21
|
-
function
|
|
22
|
-
return Array.from({ length:
|
|
25
|
+
function B(c, e) {
|
|
26
|
+
return Array.from({ length: c }, (P, u) => e(u));
|
|
23
27
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
28
|
+
function g(c, e) {
|
|
29
|
+
return c < h ? "before" : c >= h && c <= e - h + 1 ? "center" : c > e - h + 1 ? "after" : "center";
|
|
26
30
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
+
function T(c, e) {
|
|
32
|
+
return c.reduce((P, u, o) => {
|
|
33
|
+
const r = [];
|
|
34
|
+
return r.push(...P), r.push(...u), u.length && o < c.length - 1 && r.push(e), r;
|
|
31
35
|
}, []);
|
|
32
36
|
}
|
|
33
|
-
const
|
|
37
|
+
const m = H(a), ll = Z(
|
|
34
38
|
({
|
|
35
|
-
"aria-label":
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
"aria-label": c,
|
|
40
|
+
buttonFirstProps: e,
|
|
41
|
+
buttonLastProps: P,
|
|
42
|
+
buttonNextProps: u,
|
|
43
|
+
buttonPrevProps: o,
|
|
38
44
|
dataTestId: r,
|
|
39
|
-
getHref:
|
|
40
|
-
listProps:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
getHref: w,
|
|
46
|
+
listProps: b,
|
|
47
|
+
navigationTexts: l,
|
|
48
|
+
onChange: d,
|
|
49
|
+
page: f,
|
|
50
|
+
pageCount: _,
|
|
51
|
+
rangeDisplay: G = 5,
|
|
52
|
+
showEdgeControls: D = !1,
|
|
53
|
+
size: i = "lg",
|
|
54
|
+
...p
|
|
55
|
+
}, q) => {
|
|
56
|
+
const J = v({ page: f, pageCount: _, rangeDisplay: G }), K = M(null), O = M(null), k = f === 1, y = f === _, $ = f === 1, z = f === _, j = (l == null ? void 0 : l.firstPage) || "First Page", E = (l == null ? void 0 : l.lastPage) || "Last Page", F = (l == null ? void 0 : l.nextPage) || "Next Page", L = (l == null ? void 0 : l.previousPage) || "Previous Page", Q = R(() => {
|
|
57
|
+
$ || d(1);
|
|
58
|
+
}, [$, d]), S = R(() => {
|
|
59
|
+
z || d(_);
|
|
60
|
+
}, [z, _, d]), U = R(() => {
|
|
61
|
+
if (k) return;
|
|
62
|
+
const t = Math.max(f - 1, 1);
|
|
63
|
+
d(t);
|
|
64
|
+
}, [k, f, d]), V = R(() => {
|
|
65
|
+
if (y) return;
|
|
66
|
+
const t = Math.min(f + 1, _);
|
|
67
|
+
d(t);
|
|
68
|
+
}, [y, f, _, d]);
|
|
69
|
+
return /* @__PURE__ */ s("nav", { "aria-label": c ?? "Pagination", "data-testid": r, ref: q, ...p, children: /* @__PURE__ */ N("ol", { className: m("list"), ...b, children: [
|
|
70
|
+
D ? /* @__PURE__ */ s("li", { children: /* @__PURE__ */ N(
|
|
58
71
|
"button",
|
|
59
72
|
{
|
|
60
|
-
"aria-label":
|
|
61
|
-
className:
|
|
73
|
+
"aria-label": j,
|
|
74
|
+
className: m(
|
|
75
|
+
"item",
|
|
76
|
+
`size-${i}`,
|
|
77
|
+
(l == null ? void 0 : l.firstPage) && "with-text-right",
|
|
78
|
+
$ && "disabled-arrow"
|
|
79
|
+
),
|
|
80
|
+
"data-testid": r ? `${r}-arrow-first` : void 0,
|
|
81
|
+
disabled: $,
|
|
82
|
+
onClick: Q,
|
|
83
|
+
type: "button",
|
|
84
|
+
...e,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ s(A, { className: m("icon"), name: "angle-double-left", size: "lg" }),
|
|
87
|
+
l != null && l.firstPage ? j : null
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
) }) : null,
|
|
91
|
+
/* @__PURE__ */ s("li", { children: /* @__PURE__ */ N(
|
|
92
|
+
"button",
|
|
93
|
+
{
|
|
94
|
+
"aria-label": L,
|
|
95
|
+
className: m(
|
|
96
|
+
"item",
|
|
97
|
+
`size-${i}`,
|
|
98
|
+
(l == null ? void 0 : l.previousPage) && "with-text-right",
|
|
99
|
+
k && "disabled-arrow"
|
|
100
|
+
),
|
|
62
101
|
"data-testid": r ? `${r}-arrow-prev` : void 0,
|
|
63
|
-
disabled:
|
|
64
|
-
onClick:
|
|
65
|
-
ref:
|
|
102
|
+
disabled: k,
|
|
103
|
+
onClick: U,
|
|
104
|
+
ref: K,
|
|
66
105
|
type: "button",
|
|
67
|
-
...
|
|
68
|
-
children:
|
|
106
|
+
...o,
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ s(A, { className: m("icon"), name: "angle-left", size: "lg" }),
|
|
109
|
+
l != null && l.previousPage ? L : null
|
|
110
|
+
]
|
|
69
111
|
}
|
|
70
112
|
) }),
|
|
71
|
-
|
|
72
|
-
(
|
|
113
|
+
J.map(
|
|
114
|
+
(t, W) => t === "-" ? /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
|
|
115
|
+
"button",
|
|
116
|
+
{
|
|
117
|
+
"aria-label": "Collapsed Pages",
|
|
118
|
+
className: m("item", `size-${i}`),
|
|
119
|
+
type: "button",
|
|
120
|
+
...u,
|
|
121
|
+
children: "..."
|
|
122
|
+
}
|
|
123
|
+
) }, `${W}-`) : /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
|
|
73
124
|
"a",
|
|
74
125
|
{
|
|
75
|
-
"aria-current":
|
|
76
|
-
className:
|
|
77
|
-
"data-testid": r ? `${r}-${
|
|
78
|
-
href:
|
|
79
|
-
onClick: (
|
|
80
|
-
|
|
126
|
+
"aria-current": t === f,
|
|
127
|
+
className: m("item", "page", `size-${i}`),
|
|
128
|
+
"data-testid": r ? `${r}-${t}` : void 0,
|
|
129
|
+
href: w == null ? void 0 : w(t),
|
|
130
|
+
onClick: (X) => {
|
|
131
|
+
d && (X.preventDefault(), d(t));
|
|
81
132
|
},
|
|
82
|
-
children:
|
|
133
|
+
children: t
|
|
83
134
|
}
|
|
84
|
-
) },
|
|
135
|
+
) }, t)
|
|
85
136
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ s("li", { children: /* @__PURE__ */ N(
|
|
87
138
|
"button",
|
|
88
139
|
{
|
|
89
|
-
"aria-label":
|
|
90
|
-
className:
|
|
140
|
+
"aria-label": F,
|
|
141
|
+
className: m(
|
|
142
|
+
"item",
|
|
143
|
+
`size-${i}`,
|
|
144
|
+
(l == null ? void 0 : l.nextPage) && "with-text-left",
|
|
145
|
+
y && "disabled-arrow"
|
|
146
|
+
),
|
|
91
147
|
"data-testid": r ? `${r}-arrow-next` : void 0,
|
|
92
|
-
disabled:
|
|
93
|
-
onClick:
|
|
94
|
-
ref:
|
|
148
|
+
disabled: y,
|
|
149
|
+
onClick: V,
|
|
150
|
+
ref: O,
|
|
151
|
+
type: "button",
|
|
152
|
+
...u,
|
|
153
|
+
children: [
|
|
154
|
+
l != null && l.nextPage ? F : null,
|
|
155
|
+
/* @__PURE__ */ s(A, { name: "angle-right", size: "lg" })
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
) }),
|
|
159
|
+
D ? /* @__PURE__ */ s("li", { children: /* @__PURE__ */ N(
|
|
160
|
+
"button",
|
|
161
|
+
{
|
|
162
|
+
"aria-label": E,
|
|
163
|
+
className: m(
|
|
164
|
+
"item",
|
|
165
|
+
`size-${i}`,
|
|
166
|
+
(l == null ? void 0 : l.lastPage) && "with-text-left",
|
|
167
|
+
z && "disabled-arrow"
|
|
168
|
+
),
|
|
169
|
+
"data-testid": r ? `${r}-arrow-last` : void 0,
|
|
170
|
+
disabled: z,
|
|
171
|
+
onClick: S,
|
|
95
172
|
type: "button",
|
|
96
|
-
...
|
|
97
|
-
children:
|
|
173
|
+
...P,
|
|
174
|
+
children: [
|
|
175
|
+
l != null && l.lastPage ? E : null,
|
|
176
|
+
/* @__PURE__ */ s(A, { className: m("icon"), name: "angle-double-right", size: "lg" })
|
|
177
|
+
]
|
|
98
178
|
}
|
|
99
|
-
) })
|
|
179
|
+
) }) : null
|
|
100
180
|
] }) });
|
|
101
181
|
}
|
|
102
182
|
);
|
|
183
|
+
ll.displayName = "Pagination";
|
|
103
184
|
export {
|
|
104
|
-
|
|
185
|
+
ll as Pagination
|
|
105
186
|
};
|
package/dist/PasswordInput.js
CHANGED
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as c, useState as
|
|
4
|
-
import { InputText as
|
|
3
|
+
import { forwardRef as c, useState as l } from "react";
|
|
4
|
+
import { InputText as u } from "./InputText.js";
|
|
5
5
|
import { Button as w } from "./Button.js";
|
|
6
6
|
import { Icon as n } from "./Icon.js";
|
|
7
|
-
const
|
|
7
|
+
const d = ({ isHidden: a, onClick: t, ...e }) => /* @__PURE__ */ o(
|
|
8
8
|
w,
|
|
9
9
|
{
|
|
10
10
|
"aria-controls": "password",
|
|
11
|
-
"aria-expanded": !
|
|
11
|
+
"aria-expanded": !a,
|
|
12
12
|
onClick: t,
|
|
13
13
|
size: "sm",
|
|
14
14
|
variant: "tertiary",
|
|
15
|
-
...
|
|
16
|
-
children:
|
|
15
|
+
...e,
|
|
16
|
+
children: a ? /* @__PURE__ */ o(n, { name: "eye" }) : /* @__PURE__ */ o(n, { name: "eye-slash" })
|
|
17
17
|
}
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
);
|
|
19
|
+
d.displayName = "PasswordInput.ToggleButton";
|
|
20
|
+
const y = c(
|
|
21
|
+
({ toggleAriaLabel: a, ...t }, e) => {
|
|
22
|
+
const [r, i] = l("password"), s = r === "password", p = () => {
|
|
23
|
+
i(s ? "text" : "password");
|
|
24
|
+
}, m = t["data-testid"] ? `${t["data-testid"]}-action` : void 0;
|
|
25
|
+
return /* @__PURE__ */ o(u, { ...t, ref: e, type: r, children: /* @__PURE__ */ o(
|
|
26
|
+
d,
|
|
25
27
|
{
|
|
26
|
-
"aria-label":
|
|
27
|
-
"data-testid":
|
|
28
|
+
"aria-label": a ?? (s ? "Show password" : "Hide password"),
|
|
29
|
+
"data-testid": m,
|
|
28
30
|
isHidden: s,
|
|
29
|
-
onClick:
|
|
31
|
+
onClick: p
|
|
30
32
|
}
|
|
31
33
|
) });
|
|
32
34
|
}
|
|
33
35
|
);
|
|
36
|
+
y.displayName = "PasswordInput";
|
|
34
37
|
export {
|
|
35
|
-
|
|
38
|
+
y as PasswordInput
|
|
36
39
|
};
|