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 CHANGED
@@ -1 +1 @@
1
- @layer components{._root_1sq1k_2{display:grid;grid-template-areas:"label" "input";width:100%;height:fit-content}._root_1sq1k_2:has(._label_1sq1k_8):has(._hint_1sq1k_8){grid-template-areas:"label" "input" "hint"}._root_1sq1k_2:not(:has(._label_1sq1k_8)):has(._hint_1sq1k_8){grid-template-areas:"input" "hint"}._root_1sq1k_2:not(._inline_1sq1k_14) ._hint_1sq1k_8{margin-top:var(--field-gap-assistive)}._root_1sq1k_2:not(._inline_1sq1k_14) ._label_1sq1k_8{margin-bottom:var(--field-gap-label)}._root_1sq1k_2 .field-input{align-self:center;grid-area:input}._root_1sq1k_2 .field-input.date-picker-wrapper{justify-self:start}._inline_1sq1k_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_1sq1k_14:has(._label_1sq1k_8):has(._hint_1sq1k_8){grid-template-areas:"input label" ". hint"}._inline_1sq1k_14:not(:has(._label_1sq1k_8)):has(._hint_1sq1k_8){grid-template-areas:"input ." ". hint"}._label_1sq1k_8{grid-area:label}._hint_1sq1k_8{grid-area:hint}._hint-max-length_1sq1k_46{justify-self:end}._visuallyHidden_1sq1k_49{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}}
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 w, jsx as b } from "react/jsx-runtime";
4
- import { createContext as C, useMemo as $, useId as A, useContext as L } from "react";
5
- import { Hint as M } from "./Hint.js";
6
- import { Label as R } from "./Label.js";
7
- import { c as S } from "./index-PAaZGbyz.js";
8
- import { f as T } from "./forwardRefWithAs-8eP3ZN15.js";
9
- const W = "_root_1sq1k_2", z = "_label_1sq1k_8", E = "_hint_1sq1k_8", G = "_inline_1sq1k_14", J = "_visuallyHidden_1sq1k_49", K = {
10
- root: W,
11
- label: z,
12
- hint: E,
13
- inline: G,
14
- "hint-max-length": "_hint-max-length_1sq1k_46",
15
- visuallyHidden: J
16
- }, h = S(K), y = C({
17
- getInputProps: (i) => i,
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 _(i) {
23
- const o = A();
24
- return i || o;
22
+ function f(n) {
23
+ const c = A();
24
+ return n || c;
25
25
  }
26
- function P() {
27
- return L(y);
26
+ function ee() {
27
+ return R(I);
28
28
  }
29
- const O = T((i, o) => {
29
+ const Q = k((n, c) => {
30
30
  const {
31
- children: I,
31
+ children: N,
32
32
  className: p,
33
- disabled: d,
34
- error: f,
35
- hideLabel: g,
36
- hint: D,
37
- hintProps: t,
38
- id: N,
39
- inline: q,
40
- label: F,
41
- labelProps: a,
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: c,
43
+ required: m,
44
44
  success: v,
45
45
  warning: x,
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 = $(
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(u) {
50
- const j = [u["aria-describedby"], l && s].filter(Boolean).join(" ") || void 0, B = [u["aria-labelledby"], r].filter(Boolean).join(" ");
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
- ...u,
53
- "aria-describedby": j,
54
- "aria-invalid": n === "danger" ? !0 : void 0,
55
- "aria-labelledby": B,
56
- disabled: d,
57
- id: m,
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: c
62
+ required: m
63
63
  };
64
64
  },
65
- hintID: s,
66
- labelID: r,
67
- variant: n
65
+ hintID: o,
66
+ labelID: s,
67
+ variant: t
68
68
  }),
69
- [s, r, n, l, d, m, e == null ? void 0 : e.max, c]
69
+ [o, s, t, r, a, u, h, e == null ? void 0 : e.max, m]
70
70
  );
71
- return /* @__PURE__ */ w("div", { ref: o, ...k, className: h("root", q && "inline", p), children: [
72
- /* @__PURE__ */ b(
73
- R,
71
+ return /* @__PURE__ */ y("div", { ref: c, ...w, className: d("root", j && "inline", p), children: [
72
+ /* @__PURE__ */ _(
73
+ T,
74
74
  {
75
- className: h("label", g && "visuallyHidden"),
76
- disabled: d,
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
- variant: n,
92
- ...t,
93
- children: l
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
- ) : null
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
- O.displayName = "Field";
92
+ Q.displayName = "Field";
99
93
  export {
100
- O as Field,
101
- y as FieldContext,
102
- _ as useDefaultID,
103
- P as useField
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 f, isValidElement as U, cloneElement as X, useState as Y, useEffect as Z } from "react";
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", c = {
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(c), O = ({ children: e, ...o }) => /* @__PURE__ */ t(i.Header.CloseButton, { className: ne("close-button"), ...o, children: e });
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(c), B = f(
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(c), A = ({
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(c), w = ({ children: e, ...o }) => /* @__PURE__ */ t(b, { as: "p", className: ce("asset-title"), lines: 2, variant: "heading-md-strong", ...o, children: e });
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(c), C = f(
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(c), T = ({
66
- children: e,
67
- ...o
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(c), D = ({ children: e }) => /* @__PURE__ */ t("div", { className: fe("root", "iframe-wrapper"), children: e });
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", d = {
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(d), q = f(
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(d), H = N(
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(d), I = N(
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(d), W = ({ children: e, className: o, ...s }) => /* @__PURE__ */ t("div", { className: h("footer-buttons", o), ...s, children: e });
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 = f(
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(d), F = f(
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(d), E = f(({ className: e, ...o }, s) => /* @__PURE__ */ t(i.Media, { className: ke("window-media", e), ref: s, ...o }));
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(d);
174
+ const Oe = r(f);
176
175
  function Ee(e) {
177
176
  const { onClose: o, setOpen: s, ...a } = e || {};
178
177
  return Q({
@@ -1,185 +1,198 @@
1
1
  "use client";
2
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 y } from "react";
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 { c as H } from "./index-PAaZGbyz.js";
7
- const I = "_list_1d12i_3", n = "_item_1d12i_13", C = "_page_1d12i_52", a = {
8
- list: I,
9
- item: n,
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: C,
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
- }, i = 5, x = 3;
17
- function v({ page: c, pageCount: e, rangeDisplay: h }) {
18
- return Y(() => {
19
- if (e <= h || e <= i + 1)
20
- return B(e, (b) => b + 1);
21
- const t = g(c, e), o = t === "before" ? B(i, (b) => b + 1) : [1], r = t === "center" ? B(x, (b) => b + c - 1) : [], w = t === "after" ? B(i, (b) => b + e - i + 1) : [e];
22
- return T([o, r, w], "-");
23
- }, [c, e, h]);
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(c, e) {
26
- return Array.from({ length: c }, (h, t) => e(t));
26
+ function B(e, r) {
27
+ return Array.from({ length: e }, (o, u) => r(u));
27
28
  }
28
- function g(c, e) {
29
- return c < i ? "before" : c >= i && c <= e - i + 1 ? "center" : c > e - i + 1 ? "after" : "center";
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 T(c, e) {
32
- return c.reduce((h, t, o) => {
33
- const r = [];
34
- return r.push(...h), r.push(...t), t.length && o < c.length - 1 && r.push(e), r;
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 m = H(a), ll = Z(
38
+ const i = I(v), el = H(
38
39
  ({
39
- "aria-label": c,
40
- buttonFirstProps: e,
41
- buttonLastProps: h,
42
- buttonNextProps: t,
43
- buttonPrevProps: o,
44
- dataTestId: r,
45
- getHref: w,
46
- listProps: b,
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: u,
49
- page: f,
50
- pageCount: P,
51
- rangeDisplay: G = 5,
50
+ onChange: m,
51
+ page: d,
52
+ pageCount: b,
53
+ rangeDisplay: q = 5,
52
54
  showEdgeControls: D = !1,
53
55
  size: _ = "lg",
54
- ...p
55
- }, q) => {
56
- const J = v({ page: f, pageCount: P, rangeDisplay: G }), K = M(null), O = M(null), $ = f === 1, z = f === P, R = f === 1, k = f === P, 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 = y(() => {
57
- R || u(1);
58
- }, [R, u]), S = y(() => {
59
- k || u(P);
60
- }, [k, P, u]), U = y(() => {
61
- if ($) return;
62
- const d = Math.max(f - 1, 1);
63
- u(d);
64
- }, [$, f, u]), V = y(() => {
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 d = Math.min(f + 1, P);
67
- u(d);
68
- }, [z, f, P, u]);
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(
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: m(
76
+ className: i(
75
77
  "item",
76
78
  `size-${_}`,
77
79
  (l == null ? void 0 : l.firstPage) && "with-text-right",
78
- R && "disabled-arrow"
80
+ y && "disabled-arrow"
79
81
  ),
80
- "data-testid": r ? `${r}-arrow-first` : void 0,
81
- disabled: R,
82
- onClick: Q,
82
+ "data-testid": c ? `${c}-arrow-first` : void 0,
83
+ disabled: y,
84
+ onClick: U,
83
85
  type: "button",
84
- ...e,
86
+ ...r,
85
87
  children: [
86
- /* @__PURE__ */ s(A, { className: m("icon"), name: "angle-double-left", size: "lg" }),
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__ */ N(
93
+ /* @__PURE__ */ s("li", { children: /* @__PURE__ */ $(
92
94
  "button",
93
95
  {
94
96
  "aria-label": L,
95
- className: m(
97
+ className: i(
96
98
  "item",
97
99
  `size-${_}`,
98
100
  (l == null ? void 0 : l.previousPage) && "with-text-right",
99
- $ && "disabled-arrow"
101
+ w && "disabled-arrow"
100
102
  ),
101
- "data-testid": r ? `${r}-arrow-prev` : void 0,
102
- disabled: $,
103
- onClick: U,
104
- ref: K,
103
+ "data-testid": c ? `${c}-arrow-prev` : void 0,
104
+ disabled: w,
105
+ onClick: W,
106
+ ref: Q,
105
107
  type: "button",
106
- ...o,
108
+ ...N,
107
109
  children: [
108
- /* @__PURE__ */ s(A, { className: m("icon"), name: "angle-left", size: "lg" }),
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
- J.map(
114
- (d, W) => d === "-" ? /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
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: m("item", `size-${_}`),
131
+ className: i("item", `size-${_}`),
119
132
  type: "button",
120
133
  children: "..."
121
134
  }
122
- ) }, `${W}-`) : /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
135
+ ) }, `${Y}-`) : /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
123
136
  "a",
124
137
  {
125
- "aria-current": d === f,
126
- className: m("item", "page", `size-${_}`),
127
- "data-testid": r ? `${r}-${d}` : void 0,
128
- href: w == null ? void 0 : w(d),
129
- onClick: (X) => {
130
- u && (X.preventDefault(), u(d));
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: d
145
+ children: f
133
146
  }
134
- ) }, d)
147
+ ) }, f)
135
148
  ),
136
- /* @__PURE__ */ s("li", { children: /* @__PURE__ */ N(
149
+ /* @__PURE__ */ s("li", { children: /* @__PURE__ */ $(
137
150
  "button",
138
151
  {
139
152
  "aria-label": F,
140
- className: m(
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": r ? `${r}-arrow-next` : void 0,
159
+ "data-testid": c ? `${c}-arrow-next` : void 0,
147
160
  disabled: z,
148
- onClick: V,
149
- ref: O,
161
+ onClick: X,
162
+ ref: S,
150
163
  type: "button",
151
- ...t,
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__ */ N(
171
+ D ? /* @__PURE__ */ s("li", { children: /* @__PURE__ */ $(
159
172
  "button",
160
173
  {
161
174
  "aria-label": E,
162
- className: m(
175
+ className: i(
163
176
  "item",
164
177
  `size-${_}`,
165
178
  (l == null ? void 0 : l.lastPage) && "with-text-left",
166
- k && "disabled-arrow"
179
+ R && "disabled-arrow"
167
180
  ),
168
- "data-testid": r ? `${r}-arrow-last` : void 0,
169
- disabled: k,
170
- onClick: S,
181
+ "data-testid": c ? `${c}-arrow-last` : void 0,
182
+ disabled: R,
183
+ onClick: V,
171
184
  type: "button",
172
- ...h,
185
+ ...o,
173
186
  children: [
174
187
  l != null && l.lastPage ? E : null,
175
- /* @__PURE__ */ s(A, { className: m("icon"), name: "angle-double-right", size: "lg" })
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
- ll.displayName = "Pagination";
195
+ el.displayName = "Pagination";
183
196
  export {
184
- ll as Pagination
197
+ el as Pagination
185
198
  };