welcome-ui 10.1.2 → 10.1.5
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.css +1 -1
- package/dist/Field.js +68 -74
- package/dist/FloatingActionBar.css +1 -0
- package/dist/FloatingActionBar.js +25 -0
- package/dist/Modal.js +20 -21
- package/dist/Pagination.js +109 -96
- package/dist/Swiper.js +277 -262
- package/dist/Tag.js +10 -9
- package/dist/theme.css +1 -1
- package/dist/types/components/Field/types.d.ts +3 -3
- package/dist/types/components/FloatingActionBar/index.d.ts +2 -0
- package/dist/types/components/FloatingActionBar/types.d.ts +5 -0
- package/dist/types/components/Label/types.d.ts +0 -1
- package/dist/types/components/Modal/Assets/Dialog.d.ts +2 -5
- package/dist/types/components/Modal/Assets/index.d.ts +1 -4
- package/dist/types/components/Modal/index.d.ts +1 -4
- package/dist/types/components/Pagination/types.d.ts +1 -0
- package/dist/types/components/Radio/types.d.ts +1 -1
- package/dist/types/components/Swiper/components/SwiperSlides.d.ts +1 -1
- package/dist/types/components/Swiper/index.d.ts +2 -0
- package/dist/types/components/Swiper/types.d.ts +1 -0
- package/dist/types/theme/generated/variables.d.ts +1 -1
- package/package.json +1 -1
package/dist/Field.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.
|
|
1
|
+
@layer components{._root_13hug_2{display:grid;grid-template-areas:"label" "input";width:100%;height:fit-content}._root_13hug_2:has(._label_13hug_8):has(._hint_13hug_8){grid-template-areas:"label" "input" "hint"}._root_13hug_2:not(:has(._label_13hug_8)):has(._hint_13hug_8){grid-template-areas:"input" "hint"}._root_13hug_2:not(._inline_13hug_14) ._hint_13hug_8{margin-top:var(--field-gap-assistive)}._root_13hug_2:not(._inline_13hug_14) ._label_13hug_8{margin-bottom:var(--field-gap-label)}._root_13hug_2 .field-input{align-self:center;grid-area:input}._root_13hug_2 .field-input.date-picker-wrapper{justify-self:start}._inline_13hug_14{grid-template-areas:"input label";grid-template-columns:min-content 1fr;height:fit-content;grid-row-gap:var(--field-gap-assistive);grid-column-gap:var(--field-gap-label)}._inline_13hug_14:has(._label_13hug_8):has(._hint_13hug_8){grid-template-areas:"input label" ". hint"}._inline_13hug_14:not(:has(._label_13hug_8)):has(._hint_13hug_8){grid-template-areas:"input ." ". hint"}._label_13hug_8{grid-area:label}._hint_13hug_8{grid-area:hint;display:flex;gap:var(--field-gap-label)}._hint-max-length_13hug_48{margin-left:auto}._visuallyHidden_13hug_51{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}}
|
package/dist/Field.js
CHANGED
|
@@ -1,104 +1,98 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Field.css';
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { Hint as
|
|
6
|
-
import { Label as
|
|
7
|
-
import { c as
|
|
8
|
-
import { f as
|
|
9
|
-
const
|
|
10
|
-
root:
|
|
11
|
-
label:
|
|
12
|
-
hint:
|
|
13
|
-
inline:
|
|
14
|
-
"hint-max-length": "_hint-max-
|
|
15
|
-
visuallyHidden:
|
|
16
|
-
},
|
|
17
|
-
getInputProps: (
|
|
3
|
+
import { jsxs as y, jsx as _ } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as $, useMemo as q, useId as A, useContext as R } from "react";
|
|
5
|
+
import { Hint as S } from "./Hint.js";
|
|
6
|
+
import { Label as T } from "./Label.js";
|
|
7
|
+
import { c as W } from "./index-PAaZGbyz.js";
|
|
8
|
+
import { f as k } from "./forwardRefWithAs-8eP3ZN15.js";
|
|
9
|
+
const z = "_root_13hug_2", E = "_label_13hug_8", G = "_hint_13hug_8", J = "_inline_13hug_14", K = "_visuallyHidden_13hug_51", O = {
|
|
10
|
+
root: z,
|
|
11
|
+
label: E,
|
|
12
|
+
hint: G,
|
|
13
|
+
inline: J,
|
|
14
|
+
"hint-max-length": "_hint-max-length_13hug_48",
|
|
15
|
+
visuallyHidden: K
|
|
16
|
+
}, d = W(O), I = $({
|
|
17
|
+
getInputProps: (n) => n,
|
|
18
18
|
hintID: "",
|
|
19
19
|
labelID: "",
|
|
20
20
|
variant: void 0
|
|
21
21
|
});
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
return
|
|
22
|
+
function f(n) {
|
|
23
|
+
const c = A();
|
|
24
|
+
return n || c;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function ee() {
|
|
27
|
+
return R(I);
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const Q = k((n, c) => {
|
|
30
30
|
const {
|
|
31
|
-
children:
|
|
31
|
+
children: N,
|
|
32
32
|
className: p,
|
|
33
|
-
disabled:
|
|
34
|
-
error:
|
|
35
|
-
hideLabel:
|
|
36
|
-
hint:
|
|
37
|
-
hintProps:
|
|
38
|
-
id:
|
|
39
|
-
inline:
|
|
40
|
-
label:
|
|
41
|
-
labelProps:
|
|
33
|
+
disabled: u,
|
|
34
|
+
error: g,
|
|
35
|
+
hideLabel: D,
|
|
36
|
+
hint: F,
|
|
37
|
+
hintProps: l,
|
|
38
|
+
id: H,
|
|
39
|
+
inline: j,
|
|
40
|
+
label: B,
|
|
41
|
+
labelProps: i,
|
|
42
42
|
maxLength: e,
|
|
43
|
-
required:
|
|
43
|
+
required: m,
|
|
44
44
|
success: v,
|
|
45
45
|
warning: x,
|
|
46
|
-
...
|
|
47
|
-
} =
|
|
46
|
+
...w
|
|
47
|
+
} = n, t = g ? "danger" : v ? "success" : x ? "warning" : void 0, r = g ?? x ?? v ?? F, a = e ? `${new Intl.NumberFormat().format(e.count)} / ${new Intl.NumberFormat().format(e.max)}` : void 0, s = f(i == null ? void 0 : i.id), o = f(l == null ? void 0 : l.id), h = f(H), C = q(
|
|
48
48
|
() => ({
|
|
49
|
-
getInputProps(
|
|
50
|
-
const
|
|
49
|
+
getInputProps(b) {
|
|
50
|
+
const L = [b["aria-describedby"], (r || a) && o].filter(Boolean).join(" ") || void 0, M = [b["aria-labelledby"], s].filter(Boolean).join(" ");
|
|
51
51
|
return {
|
|
52
|
-
...
|
|
53
|
-
"aria-describedby":
|
|
54
|
-
"aria-invalid":
|
|
55
|
-
"aria-labelledby":
|
|
56
|
-
disabled:
|
|
57
|
-
id:
|
|
52
|
+
...b,
|
|
53
|
+
"aria-describedby": L,
|
|
54
|
+
"aria-invalid": t === "danger" ? !0 : void 0,
|
|
55
|
+
"aria-labelledby": M,
|
|
56
|
+
disabled: u,
|
|
57
|
+
id: h,
|
|
58
58
|
/**
|
|
59
59
|
* pass maxCount to children for block form
|
|
60
60
|
*/
|
|
61
61
|
maxLength: e == null ? void 0 : e.max,
|
|
62
|
-
required:
|
|
62
|
+
required: m
|
|
63
63
|
};
|
|
64
64
|
},
|
|
65
|
-
hintID:
|
|
66
|
-
labelID:
|
|
67
|
-
variant:
|
|
65
|
+
hintID: o,
|
|
66
|
+
labelID: s,
|
|
67
|
+
variant: t
|
|
68
68
|
}),
|
|
69
|
-
[s,
|
|
69
|
+
[o, s, t, r, a, u, h, e == null ? void 0 : e.max, m]
|
|
70
70
|
);
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
|
|
71
|
+
return /* @__PURE__ */ y("div", { ref: c, ...w, className: d("root", j && "inline", p), children: [
|
|
72
|
+
/* @__PURE__ */ _(
|
|
73
|
+
T,
|
|
74
74
|
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
htmlFor: m,
|
|
78
|
-
id: r,
|
|
79
|
-
required: c,
|
|
80
|
-
variant: n,
|
|
81
|
-
...a,
|
|
82
|
-
children: F
|
|
83
|
-
}
|
|
84
|
-
),
|
|
85
|
-
/* @__PURE__ */ b(y.Provider, { value: H, children: I }),
|
|
86
|
-
l ? /* @__PURE__ */ b(
|
|
87
|
-
M,
|
|
88
|
-
{
|
|
89
|
-
className: h("hint", !!e && "hint-max-length"),
|
|
75
|
+
disabled: u,
|
|
76
|
+
htmlFor: h,
|
|
90
77
|
id: s,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
78
|
+
required: m,
|
|
79
|
+
variant: t,
|
|
80
|
+
...i,
|
|
81
|
+
className: d("label", D && "visuallyHidden", i == null ? void 0 : i.className),
|
|
82
|
+
children: B
|
|
94
83
|
}
|
|
95
|
-
)
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ _(I.Provider, { value: C, children: N }),
|
|
86
|
+
r || a ? /* @__PURE__ */ y(S, { className: d("hint"), id: o, variant: t, ...l, children: [
|
|
87
|
+
r,
|
|
88
|
+
a ? /* @__PURE__ */ _("span", { className: d("hint-max-length"), children: a }) : null
|
|
89
|
+
] }) : null
|
|
96
90
|
] });
|
|
97
91
|
});
|
|
98
|
-
|
|
92
|
+
Q.displayName = "Field";
|
|
99
93
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
Q as Field,
|
|
95
|
+
I as FieldContext,
|
|
96
|
+
f as useDefaultID,
|
|
97
|
+
ee as useField
|
|
104
98
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{._container_1la8g_2{display:inline-flex;align-items:center;gap:var(--floating-action-bar-gap-items)}._container_1la8g_2>*{flex-shrink:0}._floating-action-bar_1la8g_10{display:flex;justify-content:center;padding:var(--floating-action-bar-padding-block) var(--floating-action-bar-padding-inline);border-radius:var(--floating-action-bar-border-radius);border:var(--floating-action-bar-border-width) solid var(--floating-action-bar-color-border);background:var(--floating-action-bar-color-background);box-shadow:var(--elevation-30);overflow-x:auto;overflow-y:hidden}}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import './FloatingActionBar.css';
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
|
+
import { c as e } from "./index-PAaZGbyz.js";
|
|
5
|
+
import { f as l } from "./forwardRefWithAs-8eP3ZN15.js";
|
|
6
|
+
import "react";
|
|
7
|
+
const m = "_container_1la8g_2", f = {
|
|
8
|
+
container: m,
|
|
9
|
+
"floating-action-bar": "_floating-action-bar_1la8g_10"
|
|
10
|
+
}, t = e(f), b = l(
|
|
11
|
+
({ as: o = "div", children: n, className: r, dataTestId: i, ...s }, c) => /* @__PURE__ */ a(
|
|
12
|
+
o,
|
|
13
|
+
{
|
|
14
|
+
className: t("floating-action-bar", r),
|
|
15
|
+
"data-testid": i,
|
|
16
|
+
role: "toolbar",
|
|
17
|
+
...s,
|
|
18
|
+
ref: c,
|
|
19
|
+
children: /* @__PURE__ */ a("div", { className: t("container"), children: n })
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
export {
|
|
24
|
+
b as FloatingActionBar
|
|
25
|
+
};
|
package/dist/Modal.js
CHANGED
|
@@ -3,7 +3,7 @@ import './Modal.css';
|
|
|
3
3
|
import { jsx as t, jsxs as _ } from "react/jsx-runtime";
|
|
4
4
|
import { b as K } from "./Q3KUZPD7-CfUCRwV-.js";
|
|
5
5
|
import { D as L, u as Q } from "./2S4Q4M35-BtTn_beR.js";
|
|
6
|
-
import { forwardRef as
|
|
6
|
+
import { forwardRef as c, isValidElement as U, cloneElement as X, useState as Y, useEffect as Z } from "react";
|
|
7
7
|
import { Window as i } from "./Window.js";
|
|
8
8
|
import { c as r } from "./index-PAaZGbyz.js";
|
|
9
9
|
import { f as N } from "./forwardRefWithAs-8eP3ZN15.js";
|
|
@@ -13,7 +13,7 @@ import { Text as b } from "./Text.js";
|
|
|
13
13
|
import { Checkbox as ee } from "./Checkbox.js";
|
|
14
14
|
import { Field as oe } from "./Field.js";
|
|
15
15
|
import { D as se } from "./GYHYTZZN-Xp0fZyyw.js";
|
|
16
|
-
const te = "_root_1sqpb_3", ae = "_hideOnInteractOutside_1sqpb_19", re = "_dialog_1sqpb_130",
|
|
16
|
+
const te = "_root_1sqpb_3", ae = "_hideOnInteractOutside_1sqpb_19", re = "_dialog_1sqpb_130", d = {
|
|
17
17
|
root: te,
|
|
18
18
|
"asset-backdrop": "_asset-backdrop_1sqpb_8",
|
|
19
19
|
hideOnInteractOutside: ae,
|
|
@@ -24,9 +24,9 @@ const te = "_root_1sqpb_3", ae = "_hideOnInteractOutside_1sqpb_19", re = "_dialo
|
|
|
24
24
|
"asset-content": "_asset-content_1sqpb_97",
|
|
25
25
|
dialog: re,
|
|
26
26
|
"close-button": "_close-button_1sqpb_172"
|
|
27
|
-
}, ne = r(
|
|
27
|
+
}, ne = r(d), O = ({ children: e, ...o }) => /* @__PURE__ */ t(i.Header.CloseButton, { className: ne("close-button"), ...o, children: e });
|
|
28
28
|
O.displayName = "AssetModal.Close";
|
|
29
|
-
const le = r(
|
|
29
|
+
const le = r(d), B = c(
|
|
30
30
|
({ hideOnInteractOutside: e, ...o }, s) => /* @__PURE__ */ t(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
@@ -43,15 +43,15 @@ const le = r(c), B = f(
|
|
|
43
43
|
)
|
|
44
44
|
);
|
|
45
45
|
B.displayName = "AssetModal.Backdrop";
|
|
46
|
-
const ie = r(
|
|
46
|
+
const ie = r(d), A = ({
|
|
47
47
|
children: e,
|
|
48
48
|
className: o,
|
|
49
49
|
...s
|
|
50
50
|
}) => /* @__PURE__ */ t("div", { className: ie("root", "asset-content", o), ...s, children: e });
|
|
51
51
|
A.displayName = "AssetModal.Content";
|
|
52
|
-
const ce = r(
|
|
52
|
+
const ce = r(d), w = ({ children: e, ...o }) => /* @__PURE__ */ t(b, { as: "p", className: ce("asset-title"), lines: 2, variant: "heading-md-strong", ...o, children: e });
|
|
53
53
|
w.displayName = "AssetModal.Title";
|
|
54
|
-
const M = r(
|
|
54
|
+
const M = r(d), C = c(
|
|
55
55
|
({ children: e, customContent: o, subtitle: s, title: a, ...n }, l) => /* @__PURE__ */ _("div", { className: M("root", "asset-wrapper"), ref: l, ...n, children: [
|
|
56
56
|
e,
|
|
57
57
|
/* @__PURE__ */ _("div", { className: M("root", "asset-title-wrapper"), children: [
|
|
@@ -62,12 +62,11 @@ const M = r(c), C = f(
|
|
|
62
62
|
] })
|
|
63
63
|
);
|
|
64
64
|
C.displayName = "AssetModal.AssetWithTitle";
|
|
65
|
-
const de = r(
|
|
66
|
-
children: e,
|
|
67
|
-
|
|
68
|
-
}) => /* @__PURE__ */ t("div", { className: de("root", "dialog"), ...o, children: e });
|
|
65
|
+
const de = r(d), T = c(
|
|
66
|
+
({ children: e, className: o, ...s }, a) => /* @__PURE__ */ t("div", { className: de("root", "dialog", o), ref: a, ...s, children: e })
|
|
67
|
+
);
|
|
69
68
|
T.displayName = "AssetModal";
|
|
70
|
-
const fe = r(
|
|
69
|
+
const fe = r(d), D = ({ children: e }) => /* @__PURE__ */ t("div", { className: fe("root", "iframe-wrapper"), children: e });
|
|
71
70
|
D.displayName = "AssetModal.Iframe";
|
|
72
71
|
const _e = Object.assign(T, {
|
|
73
72
|
AssetWithTitle: C,
|
|
@@ -75,7 +74,7 @@ const _e = Object.assign(T, {
|
|
|
75
74
|
Content: A,
|
|
76
75
|
Iframe: D,
|
|
77
76
|
Title: w
|
|
78
|
-
}), me = "_root_f1ife_4", pe = "_body_f1ife_50", ue = "_header_f1ife_50", be = "_footer_f1ife_53", he = "_scrollable_f1ife_59", Ne = "_content_f1ife_65", ye = "_close_f1ife_65", ge = "_fullscreen_f1ife_68", we = "_backdrop_f1ife_102", xe = "_hideOnInteractOutside_f1ife_113",
|
|
77
|
+
}), me = "_root_f1ife_4", pe = "_body_f1ife_50", ue = "_header_f1ife_50", be = "_footer_f1ife_53", he = "_scrollable_f1ife_59", Ne = "_content_f1ife_65", ye = "_close_f1ife_65", ge = "_fullscreen_f1ife_68", we = "_backdrop_f1ife_102", xe = "_hideOnInteractOutside_f1ife_113", f = {
|
|
79
78
|
root: me,
|
|
80
79
|
body: pe,
|
|
81
80
|
header: ue,
|
|
@@ -98,7 +97,7 @@ const _e = Object.assign(T, {
|
|
|
98
97
|
"variant-full": "_variant-full_f1ife_169",
|
|
99
98
|
"footer-checkbox": "_footer-checkbox_f1ife_176",
|
|
100
99
|
"footer-buttons": "_footer-buttons_f1ife_179"
|
|
101
|
-
}, Me = r(
|
|
100
|
+
}, Me = r(f), q = c(
|
|
102
101
|
({ backdrop: e, hideOnInteractOutside: o, ...s }, a) => e === !0 ? /* @__PURE__ */ t(
|
|
103
102
|
"div",
|
|
104
103
|
{
|
|
@@ -109,7 +108,7 @@ const _e = Object.assign(T, {
|
|
|
109
108
|
) : U(e) ? X(e, { ref: a, ...s }) : null
|
|
110
109
|
);
|
|
111
110
|
q.displayName = "Modal.Backdrop";
|
|
112
|
-
const g = r(
|
|
111
|
+
const g = r(f), H = N(
|
|
113
112
|
({ as: e = "section", children: o, className: s, iconName: a, subtitle: n, title: l, ...m }, y) => {
|
|
114
113
|
const p = !!(a || l);
|
|
115
114
|
return /* @__PURE__ */ _(e, { className: g("body", s), ref: y, ...m, children: [
|
|
@@ -123,7 +122,7 @@ const g = r(d), H = N(
|
|
|
123
122
|
}
|
|
124
123
|
);
|
|
125
124
|
H.displayName = "Modal.Body";
|
|
126
|
-
const v = r(
|
|
125
|
+
const v = r(f), I = N(
|
|
127
126
|
({ children: e, className: o, withClosingButton: s = !0, ...a }, n) => /* @__PURE__ */ _(
|
|
128
127
|
"div",
|
|
129
128
|
{
|
|
@@ -138,7 +137,7 @@ const v = r(d), I = N(
|
|
|
138
137
|
)
|
|
139
138
|
);
|
|
140
139
|
I.displayName = "Modal.Content";
|
|
141
|
-
const h = r(
|
|
140
|
+
const h = r(f), W = ({ children: e, className: o, ...s }) => /* @__PURE__ */ t("div", { className: h("footer-buttons", o), ...s, children: e });
|
|
142
141
|
W.displayName = "Modal.Footer.Buttons";
|
|
143
142
|
const z = ({
|
|
144
143
|
checked: e,
|
|
@@ -147,14 +146,14 @@ const z = ({
|
|
|
147
146
|
...a
|
|
148
147
|
}) => /* @__PURE__ */ t(oe, { className: h("footer-checkbox"), ...a, inline: !0, label: s, children: /* @__PURE__ */ t(ee, { checked: e, onChange: o }) });
|
|
149
148
|
z.displayName = "Modal.Footer.Checkbox";
|
|
150
|
-
const S =
|
|
149
|
+
const S = c(
|
|
151
150
|
({ children: e, className: o, variant: s = "right", ...a }, n) => /* @__PURE__ */ t("footer", { className: h("footer", o), ref: n, ...a, children: e ? /* @__PURE__ */ t("div", { className: h("footer-children-wrapper", `variant-${s}`), children: e }) : null })
|
|
152
151
|
);
|
|
153
152
|
S.displayName = "Modal.Footer";
|
|
154
153
|
const ve = Object.assign(S, {
|
|
155
154
|
Buttons: W,
|
|
156
155
|
Checkbox: z
|
|
157
|
-
}), $e = r(
|
|
156
|
+
}), $e = r(f), F = c(
|
|
158
157
|
({ children: e, className: o, ...s }, a) => /* @__PURE__ */ t(i.Header, { className: $e("header", o), ref: a, ...s, children: e })
|
|
159
158
|
);
|
|
160
159
|
F.displayName = "Modal.Header";
|
|
@@ -170,9 +169,9 @@ const j = N(
|
|
|
170
169
|
)
|
|
171
170
|
);
|
|
172
171
|
j.displayName = "Modal.Trigger";
|
|
173
|
-
const ke = r(
|
|
172
|
+
const ke = r(f), E = c(({ className: e, ...o }, s) => /* @__PURE__ */ t(i.Media, { className: ke("window-media", e), ref: s, ...o }));
|
|
174
173
|
E.displayName = "Modal.WindowMedia";
|
|
175
|
-
const Oe = r(
|
|
174
|
+
const Oe = r(f);
|
|
176
175
|
function Ee(e) {
|
|
177
176
|
const { onClose: o, setOpen: s, ...a } = e || {};
|
|
178
177
|
return Q({
|
package/dist/Pagination.js
CHANGED
|
@@ -1,185 +1,198 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Pagination.css';
|
|
3
|
-
import { jsx as s, jsxs as
|
|
4
|
-
import { useMemo as
|
|
3
|
+
import { jsx as s, jsxs as $ } from "react/jsx-runtime";
|
|
4
|
+
import { useMemo as p, forwardRef as H, useRef as M, useCallback as k } from "react";
|
|
5
5
|
import { Icon as A } from "./Icon.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { Text as n } from "./Text.js";
|
|
7
|
+
import { c as I } from "./index-PAaZGbyz.js";
|
|
8
|
+
const C = "_list_1d12i_3", a = "_item_1d12i_13", x = "_page_1d12i_52", v = {
|
|
9
|
+
list: C,
|
|
10
|
+
item: a,
|
|
10
11
|
"disabled-arrow": "_disabled-arrow_1d12i_43",
|
|
11
|
-
page:
|
|
12
|
+
page: x,
|
|
12
13
|
"with-text-left": "_with-text-left_1d12i_72",
|
|
13
14
|
"with-text-right": "_with-text-right_1d12i_72",
|
|
14
15
|
"size-lg": "_size-lg_1d12i_75",
|
|
15
16
|
"size-md": "_size-md_1d12i_90"
|
|
16
|
-
},
|
|
17
|
-
function
|
|
18
|
-
return
|
|
19
|
-
if (
|
|
20
|
-
return B(
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
}, [
|
|
17
|
+
}, P = 5, g = 3;
|
|
18
|
+
function T({ page: e, pageCount: r, rangeDisplay: o }) {
|
|
19
|
+
return p(() => {
|
|
20
|
+
if (r <= o || r <= P + 1)
|
|
21
|
+
return B(r, (t) => t + 1);
|
|
22
|
+
const u = ll(e, r), N = u === "before" ? B(P, (t) => t + 1) : [1], h = u === "center" ? B(g, (t) => t + e - 1) : [], c = u === "after" ? B(P, (t) => t + r - P + 1) : [r];
|
|
23
|
+
return rl([N, h, c], "-");
|
|
24
|
+
}, [e, r, o]);
|
|
24
25
|
}
|
|
25
|
-
function B(
|
|
26
|
-
return Array.from({ length:
|
|
26
|
+
function B(e, r) {
|
|
27
|
+
return Array.from({ length: e }, (o, u) => r(u));
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
29
|
+
function ll(e, r) {
|
|
30
|
+
return e < P ? "before" : e >= P && e <= r - P + 1 ? "center" : e > r - P + 1 ? "after" : "center";
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
33
|
-
const
|
|
34
|
-
return
|
|
32
|
+
function rl(e, r) {
|
|
33
|
+
return e.reduce((o, u, N) => {
|
|
34
|
+
const h = [];
|
|
35
|
+
return h.push(...o), h.push(...u), u.length && N < e.length - 1 && h.push(r), h;
|
|
35
36
|
}, []);
|
|
36
37
|
}
|
|
37
|
-
const
|
|
38
|
+
const i = I(v), el = H(
|
|
38
39
|
({
|
|
39
|
-
"aria-label":
|
|
40
|
-
buttonFirstProps:
|
|
41
|
-
buttonLastProps:
|
|
42
|
-
buttonNextProps:
|
|
43
|
-
buttonPrevProps:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
"aria-label": e,
|
|
41
|
+
buttonFirstProps: r,
|
|
42
|
+
buttonLastProps: o,
|
|
43
|
+
buttonNextProps: u,
|
|
44
|
+
buttonPrevProps: N,
|
|
45
|
+
condensed: h = !1,
|
|
46
|
+
dataTestId: c,
|
|
47
|
+
getHref: t,
|
|
48
|
+
listProps: G,
|
|
47
49
|
navigationTexts: l,
|
|
48
|
-
onChange:
|
|
49
|
-
page:
|
|
50
|
-
pageCount:
|
|
51
|
-
rangeDisplay:
|
|
50
|
+
onChange: m,
|
|
51
|
+
page: d,
|
|
52
|
+
pageCount: b,
|
|
53
|
+
rangeDisplay: q = 5,
|
|
52
54
|
showEdgeControls: D = !1,
|
|
53
55
|
size: _ = "lg",
|
|
54
|
-
...
|
|
55
|
-
},
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
|
|
60
|
-
}, [
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
}, [
|
|
56
|
+
...J
|
|
57
|
+
}, K) => {
|
|
58
|
+
const O = T({ page: d, pageCount: b, rangeDisplay: q }), Q = M(null), S = M(null), w = d === 1, z = d === b, y = d === 1, R = d === b, 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", U = k(() => {
|
|
59
|
+
y || m(1);
|
|
60
|
+
}, [y, m]), V = k(() => {
|
|
61
|
+
R || m(b);
|
|
62
|
+
}, [R, b, m]), W = k(() => {
|
|
63
|
+
if (w) return;
|
|
64
|
+
const f = Math.max(d - 1, 1);
|
|
65
|
+
m(f);
|
|
66
|
+
}, [w, d, m]), X = k(() => {
|
|
65
67
|
if (z) return;
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
}, [z,
|
|
69
|
-
return /* @__PURE__ */ s("nav", { "aria-label":
|
|
70
|
-
D ? /* @__PURE__ */ s("li", { children: /* @__PURE__ */
|
|
68
|
+
const f = Math.min(d + 1, b);
|
|
69
|
+
m(f);
|
|
70
|
+
}, [z, d, b, m]);
|
|
71
|
+
return /* @__PURE__ */ s("nav", { "aria-label": e ?? "Pagination", "data-testid": c, ref: K, ...J, children: /* @__PURE__ */ $("ol", { className: i("list"), ...G, children: [
|
|
72
|
+
D ? /* @__PURE__ */ s("li", { children: /* @__PURE__ */ $(
|
|
71
73
|
"button",
|
|
72
74
|
{
|
|
73
75
|
"aria-label": j,
|
|
74
|
-
className:
|
|
76
|
+
className: i(
|
|
75
77
|
"item",
|
|
76
78
|
`size-${_}`,
|
|
77
79
|
(l == null ? void 0 : l.firstPage) && "with-text-right",
|
|
78
|
-
|
|
80
|
+
y && "disabled-arrow"
|
|
79
81
|
),
|
|
80
|
-
"data-testid":
|
|
81
|
-
disabled:
|
|
82
|
-
onClick:
|
|
82
|
+
"data-testid": c ? `${c}-arrow-first` : void 0,
|
|
83
|
+
disabled: y,
|
|
84
|
+
onClick: U,
|
|
83
85
|
type: "button",
|
|
84
|
-
...
|
|
86
|
+
...r,
|
|
85
87
|
children: [
|
|
86
|
-
/* @__PURE__ */ s(A, { className:
|
|
88
|
+
/* @__PURE__ */ s(A, { className: i("icon"), name: "angle-double-left", size: "lg" }),
|
|
87
89
|
l != null && l.firstPage ? j : null
|
|
88
90
|
]
|
|
89
91
|
}
|
|
90
92
|
) }) : null,
|
|
91
|
-
/* @__PURE__ */ s("li", { children: /* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ s("li", { children: /* @__PURE__ */ $(
|
|
92
94
|
"button",
|
|
93
95
|
{
|
|
94
96
|
"aria-label": L,
|
|
95
|
-
className:
|
|
97
|
+
className: i(
|
|
96
98
|
"item",
|
|
97
99
|
`size-${_}`,
|
|
98
100
|
(l == null ? void 0 : l.previousPage) && "with-text-right",
|
|
99
|
-
|
|
101
|
+
w && "disabled-arrow"
|
|
100
102
|
),
|
|
101
|
-
"data-testid":
|
|
102
|
-
disabled:
|
|
103
|
-
onClick:
|
|
104
|
-
ref:
|
|
103
|
+
"data-testid": c ? `${c}-arrow-prev` : void 0,
|
|
104
|
+
disabled: w,
|
|
105
|
+
onClick: W,
|
|
106
|
+
ref: Q,
|
|
105
107
|
type: "button",
|
|
106
|
-
...
|
|
108
|
+
...N,
|
|
107
109
|
children: [
|
|
108
|
-
/* @__PURE__ */ s(A, { className:
|
|
110
|
+
/* @__PURE__ */ s(A, { className: i("icon"), name: "angle-left", size: "lg" }),
|
|
109
111
|
l != null && l.previousPage ? L : null
|
|
110
112
|
]
|
|
111
113
|
}
|
|
112
114
|
) }),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
+
h ? /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
|
|
116
|
+
n,
|
|
117
|
+
{
|
|
118
|
+
"aria-label": `Page ${d} of ${b}`,
|
|
119
|
+
as: "span",
|
|
120
|
+
className: "inline",
|
|
121
|
+
"data-testid": c ? `${c}-range` : void 0,
|
|
122
|
+
role: "status",
|
|
123
|
+
variant: `body-${_}`,
|
|
124
|
+
children: `${d} / ${b}`
|
|
125
|
+
}
|
|
126
|
+
) }) : O.map(
|
|
127
|
+
(f, Y) => f === "-" ? /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
|
|
115
128
|
"button",
|
|
116
129
|
{
|
|
117
130
|
"aria-label": "Collapsed Pages",
|
|
118
|
-
className:
|
|
131
|
+
className: i("item", `size-${_}`),
|
|
119
132
|
type: "button",
|
|
120
133
|
children: "..."
|
|
121
134
|
}
|
|
122
|
-
) }, `${
|
|
135
|
+
) }, `${Y}-`) : /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
|
|
123
136
|
"a",
|
|
124
137
|
{
|
|
125
|
-
"aria-current":
|
|
126
|
-
className:
|
|
127
|
-
"data-testid":
|
|
128
|
-
href:
|
|
129
|
-
onClick: (
|
|
130
|
-
|
|
138
|
+
"aria-current": f === d,
|
|
139
|
+
className: i("item", "page", `size-${_}`),
|
|
140
|
+
"data-testid": c ? `${c}-${f}` : void 0,
|
|
141
|
+
href: t == null ? void 0 : t(f),
|
|
142
|
+
onClick: (Z) => {
|
|
143
|
+
m && (Z.preventDefault(), m(f));
|
|
131
144
|
},
|
|
132
|
-
children:
|
|
145
|
+
children: f
|
|
133
146
|
}
|
|
134
|
-
) },
|
|
147
|
+
) }, f)
|
|
135
148
|
),
|
|
136
|
-
/* @__PURE__ */ s("li", { children: /* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ s("li", { children: /* @__PURE__ */ $(
|
|
137
150
|
"button",
|
|
138
151
|
{
|
|
139
152
|
"aria-label": F,
|
|
140
|
-
className:
|
|
153
|
+
className: i(
|
|
141
154
|
"item",
|
|
142
155
|
`size-${_}`,
|
|
143
156
|
(l == null ? void 0 : l.nextPage) && "with-text-left",
|
|
144
157
|
z && "disabled-arrow"
|
|
145
158
|
),
|
|
146
|
-
"data-testid":
|
|
159
|
+
"data-testid": c ? `${c}-arrow-next` : void 0,
|
|
147
160
|
disabled: z,
|
|
148
|
-
onClick:
|
|
149
|
-
ref:
|
|
161
|
+
onClick: X,
|
|
162
|
+
ref: S,
|
|
150
163
|
type: "button",
|
|
151
|
-
...
|
|
164
|
+
...u,
|
|
152
165
|
children: [
|
|
153
166
|
l != null && l.nextPage ? F : null,
|
|
154
167
|
/* @__PURE__ */ s(A, { name: "angle-right", size: "lg" })
|
|
155
168
|
]
|
|
156
169
|
}
|
|
157
170
|
) }),
|
|
158
|
-
D ? /* @__PURE__ */ s("li", { children: /* @__PURE__ */
|
|
171
|
+
D ? /* @__PURE__ */ s("li", { children: /* @__PURE__ */ $(
|
|
159
172
|
"button",
|
|
160
173
|
{
|
|
161
174
|
"aria-label": E,
|
|
162
|
-
className:
|
|
175
|
+
className: i(
|
|
163
176
|
"item",
|
|
164
177
|
`size-${_}`,
|
|
165
178
|
(l == null ? void 0 : l.lastPage) && "with-text-left",
|
|
166
|
-
|
|
179
|
+
R && "disabled-arrow"
|
|
167
180
|
),
|
|
168
|
-
"data-testid":
|
|
169
|
-
disabled:
|
|
170
|
-
onClick:
|
|
181
|
+
"data-testid": c ? `${c}-arrow-last` : void 0,
|
|
182
|
+
disabled: R,
|
|
183
|
+
onClick: V,
|
|
171
184
|
type: "button",
|
|
172
|
-
...
|
|
185
|
+
...o,
|
|
173
186
|
children: [
|
|
174
187
|
l != null && l.lastPage ? E : null,
|
|
175
|
-
/* @__PURE__ */ s(A, { className:
|
|
188
|
+
/* @__PURE__ */ s(A, { className: i("icon"), name: "angle-double-right", size: "lg" })
|
|
176
189
|
]
|
|
177
190
|
}
|
|
178
191
|
) }) : null
|
|
179
192
|
] }) });
|
|
180
193
|
}
|
|
181
194
|
);
|
|
182
|
-
|
|
195
|
+
el.displayName = "Pagination";
|
|
183
196
|
export {
|
|
184
|
-
|
|
197
|
+
el as Pagination
|
|
185
198
|
};
|