@propellerads/pagination 3.1.1 → 3.1.3

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/index.js CHANGED
@@ -1,39 +1,39 @@
1
1
  import * as e from "react";
2
- import { createElement as t, useContext as n, useEffect as r, useRef as i, useState as a } from "react";
3
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
4
- import { actionColor as c, black as l, errorColor as u, gray50 as d, gray70 as f, spacing as p, successColor as m, warningColor as h, white as g } from "@propellerads/stylevariables";
5
- import _, { ThemeContext as v } from "styled-components";
6
- import y from "@propellerads/label";
7
- import b from "@propellerads/select";
2
+ import { createElement as t, forwardRef as n, useContext as r, useEffect as i, useRef as a, useState as o } from "react";
3
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
4
+ import { actionColor as l, black as u, errorColor as d, gray50 as f, gray70 as p, spacing as m, successColor as h, warningColor as g, white as _ } from "@propellerads/stylevariables";
5
+ import v, { ThemeContext as y } from "styled-components";
6
+ import b from "@propellerads/label";
7
+ import x from "@propellerads/select";
8
8
  //#region ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
9
- function x() {
9
+ function S() {
10
10
  return typeof window < "u";
11
11
  }
12
- function S(e) {
12
+ function C(e) {
13
13
  var t;
14
14
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
15
15
  }
16
- function C(e) {
17
- return x() ? e instanceof HTMLElement || e instanceof S(e).HTMLElement : !1;
16
+ function w(e) {
17
+ return S() ? e instanceof HTMLElement || e instanceof C(e).HTMLElement : !1;
18
18
  }
19
19
  //#endregion
20
20
  //#region ../../node_modules/@base-ui-components/utils/esm/useRefWithInit.js
21
- var w = {};
22
- function T(t, n) {
23
- let r = e.useRef(w);
24
- return r.current === w && (r.current = t(n)), r;
21
+ var T = {};
22
+ function E(t, n) {
23
+ let r = e.useRef(T);
24
+ return r.current === T && (r.current = t(n)), r;
25
25
  }
26
26
  //#endregion
27
27
  //#region ../../node_modules/@base-ui-components/utils/esm/useStableCallback.js
28
- var E = e[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)], D = E && E !== e.useLayoutEffect ? E : (e) => e();
29
- function O(e) {
30
- let t = T(k).current;
31
- return t.next = e, D(t.effect), t.trampoline;
28
+ var D = e[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)], O = D && D !== e.useLayoutEffect ? D : (e) => e();
29
+ function k(e) {
30
+ let t = E(A).current;
31
+ return t.next = e, O(t.effect), t.trampoline;
32
32
  }
33
- function k() {
33
+ function A() {
34
34
  let e = {
35
35
  next: void 0,
36
- callback: A,
36
+ callback: j,
37
37
  trampoline: (...t) => e.callback?.(...t),
38
38
  effect: () => {
39
39
  e.callback = e.next;
@@ -41,23 +41,23 @@ function k() {
41
41
  };
42
42
  return e;
43
43
  }
44
- function A() {
44
+ function j() {
45
45
  if (process.env.NODE_ENV !== "production") throw Error("Base UI: Cannot call an event handler while rendering.");
46
46
  }
47
47
  //#endregion
48
48
  //#region ../../node_modules/@base-ui-components/utils/esm/error.js
49
- var j;
50
- process.env.NODE_ENV !== "production" && (j = /* @__PURE__ */ new Set());
49
+ var M;
50
+ process.env.NODE_ENV !== "production" && (M = /* @__PURE__ */ new Set());
51
51
  function ee(...e) {
52
52
  if (process.env.NODE_ENV !== "production") {
53
53
  let t = e.join(" ");
54
- j.has(t) || (j.add(t), console.error(`Base UI: ${t}`));
54
+ M.has(t) || (M.add(t), console.error(`Base UI: ${t}`));
55
55
  }
56
56
  }
57
57
  var te = typeof document < "u" ? e.useLayoutEffect : () => {};
58
58
  //#endregion
59
59
  //#region ../../node_modules/@base-ui-components/utils/esm/mergeObjects.js
60
- function M(e, t) {
60
+ function N(e, t) {
61
61
  if (e && !t) return e;
62
62
  if (!e && t) return t;
63
63
  if (e || t) return {
@@ -67,50 +67,50 @@ function M(e, t) {
67
67
  }
68
68
  //#endregion
69
69
  //#region ../../node_modules/@base-ui-components/react/esm/merge-props/mergeProps.js
70
- var N = {};
71
- function P(e, t, n, r, i) {
72
- let a = { ...I(e, N) };
70
+ var P = {};
71
+ function ne(e, t, n, r, i) {
72
+ let a = { ...I(e, P) };
73
73
  return t && (a = F(a, t)), n && (a = F(a, n)), r && (a = F(a, r)), i && (a = F(a, i)), a;
74
74
  }
75
- function ne(e) {
76
- if (e.length === 0) return N;
77
- if (e.length === 1) return I(e[0], N);
78
- let t = { ...I(e[0], N) };
75
+ function re(e) {
76
+ if (e.length === 0) return P;
77
+ if (e.length === 1) return I(e[0], P);
78
+ let t = { ...I(e[0], P) };
79
79
  for (let n = 1; n < e.length; n += 1) t = F(t, e[n]);
80
80
  return t;
81
81
  }
82
82
  function F(e, t) {
83
- return ae(t) ? t(e) : re(e, t);
83
+ return oe(t) ? t(e) : ie(e, t);
84
84
  }
85
- function re(e, t) {
85
+ function ie(e, t) {
86
86
  if (!t) return e;
87
87
  for (let n in t) {
88
88
  let r = t[n];
89
89
  switch (n) {
90
90
  case "style":
91
- e[n] = M(e.style, r);
91
+ e[n] = N(e.style, r);
92
92
  break;
93
93
  case "className":
94
94
  e[n] = R(e.className, r);
95
95
  break;
96
- default: ie(n, r) ? e[n] = oe(e[n], r) : e[n] = r;
96
+ default: ae(n, r) ? e[n] = se(e[n], r) : e[n] = r;
97
97
  }
98
98
  }
99
99
  return e;
100
100
  }
101
- function ie(e, t) {
101
+ function ae(e, t) {
102
102
  let n = e.charCodeAt(0), r = e.charCodeAt(1), i = e.charCodeAt(2);
103
103
  return n === 111 && r === 110 && i >= 65 && i <= 90 && (typeof t == "function" || t === void 0);
104
104
  }
105
- function ae(e) {
105
+ function oe(e) {
106
106
  return typeof e == "function";
107
107
  }
108
108
  function I(e, t) {
109
- return ae(e) ? e(t) : e ?? N;
109
+ return oe(e) ? e(t) : e ?? P;
110
110
  }
111
- function oe(e, t) {
111
+ function se(e, t) {
112
112
  return t ? e ? (n) => {
113
- if (se(n)) {
113
+ if (ce(n)) {
114
114
  let r = n;
115
115
  L(r);
116
116
  let i = t(r);
@@ -128,7 +128,7 @@ function L(e) {
128
128
  function R(e, t) {
129
129
  return t ? e ? t + " " + e : t : e;
130
130
  }
131
- function se(e) {
131
+ function ce(e) {
132
132
  return typeof e == "object" && !!e && "nativeEvent" in e;
133
133
  }
134
134
  //#endregion
@@ -141,14 +141,14 @@ function z(e, ...t) {
141
141
  //#region ../../node_modules/@base-ui-components/react/esm/composite/root/CompositeRootContext.js
142
142
  var B = /* @__PURE__ */ e.createContext(void 0);
143
143
  process.env.NODE_ENV !== "production" && (B.displayName = "CompositeRootContext");
144
- function ce(t = !1) {
144
+ function le(t = !1) {
145
145
  let n = e.useContext(B);
146
146
  if (n === void 0 && !t) throw Error(process.env.NODE_ENV === "production" ? z(16) : "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");
147
147
  return n;
148
148
  }
149
149
  //#endregion
150
150
  //#region ../../node_modules/@base-ui-components/react/esm/utils/useFocusableWhenDisabled.js
151
- function le(t) {
151
+ function ue(t) {
152
152
  let { focusableWhenDisabled: n, disabled: r, composite: i = !1, tabIndex: a = 0, isNativeButton: o } = t, s = i && n !== !1, c = i && n === !1;
153
153
  return { props: e.useMemo(() => {
154
154
  let e = { onKeyDown(e) {
@@ -167,11 +167,11 @@ function le(t) {
167
167
  }
168
168
  //#endregion
169
169
  //#region ../../node_modules/@base-ui-components/react/esm/use-button/useButton.js
170
- function ue(t = {}) {
171
- let { disabled: n = !1, focusableWhenDisabled: r, tabIndex: i = 0, native: a = !0 } = t, o = e.useRef(null), s = ce(!0) !== void 0, c = O(() => {
170
+ function de(t = {}) {
171
+ let { disabled: n = !1, focusableWhenDisabled: r, tabIndex: i = 0, native: a = !0 } = t, o = e.useRef(null), s = le(!0) !== void 0, c = k(() => {
172
172
  let e = o.current;
173
173
  return !!(e?.tagName === "A" && e?.href);
174
- }), { props: l } = le({
174
+ }), { props: l } = ue({
175
175
  focusableWhenDisabled: r,
176
176
  disabled: n,
177
177
  composite: s,
@@ -185,7 +185,7 @@ function ue(t = {}) {
185
185
  }, [a]);
186
186
  let u = e.useCallback(() => {
187
187
  let e = o.current;
188
- de(e) && s && n && l.disabled === void 0 && e.disabled && (e.disabled = !1);
188
+ fe(e) && s && n && l.disabled === void 0 && e.disabled && (e.disabled = !1);
189
189
  }, [
190
190
  n,
191
191
  l.disabled,
@@ -194,7 +194,7 @@ function ue(t = {}) {
194
194
  return te(u, [u]), {
195
195
  getButtonProps: e.useCallback((e = {}) => {
196
196
  let { onClick: t, onMouseDown: r, onKeyUp: i, onKeyDown: o, onPointerDown: s, ...u } = e;
197
- return P({
197
+ return ne({
198
198
  type: a ? "button" : void 0,
199
199
  onClick(e) {
200
200
  if (n) {
@@ -228,28 +228,28 @@ function ue(t = {}) {
228
228
  a,
229
229
  c
230
230
  ]),
231
- buttonRef: O((e) => {
231
+ buttonRef: k((e) => {
232
232
  o.current = e, u();
233
233
  })
234
234
  };
235
235
  }
236
- function de(e) {
237
- return C(e) && e.tagName === "BUTTON";
236
+ function fe(e) {
237
+ return w(e) && e.tagName === "BUTTON";
238
238
  }
239
239
  //#endregion
240
240
  //#region ../../node_modules/@base-ui-components/utils/esm/useMergedRefs.js
241
241
  function V(e, t, n, r) {
242
- let i = T(H).current;
243
- return pe(i, e, t, n, r) && U(i, [
242
+ let i = E(H).current;
243
+ return me(i, e, t, n, r) && U(i, [
244
244
  e,
245
245
  t,
246
246
  n,
247
247
  r
248
248
  ]), i.callback;
249
249
  }
250
- function fe(e) {
251
- let t = T(H).current;
252
- return me(t, e) && U(t, e), t.callback;
250
+ function pe(e) {
251
+ let t = E(H).current;
252
+ return he(t, e) && U(t, e), t.callback;
253
253
  }
254
254
  function H() {
255
255
  return {
@@ -258,10 +258,10 @@ function H() {
258
258
  refs: []
259
259
  };
260
260
  }
261
- function pe(e, t, n, r, i) {
261
+ function me(e, t, n, r, i) {
262
262
  return e.refs[0] !== t || e.refs[1] !== n || e.refs[2] !== r || e.refs[3] !== i;
263
263
  }
264
- function me(e, t) {
264
+ function he(e, t) {
265
265
  return e.refs.length !== t.length || e.refs.some((e, n) => e !== t[n]);
266
266
  }
267
267
  function U(e, t) {
@@ -307,20 +307,20 @@ function U(e, t) {
307
307
  }
308
308
  //#endregion
309
309
  //#region ../../node_modules/@base-ui-components/utils/esm/reactVersion.js
310
- var he = parseInt(e.version, 10);
311
- function ge(e) {
312
- return he >= e;
310
+ var ge = parseInt(e.version, 10);
311
+ function _e(e) {
312
+ return ge >= e;
313
313
  }
314
314
  //#endregion
315
315
  //#region ../../node_modules/@base-ui-components/utils/esm/getReactElementRef.js
316
316
  function W(t) {
317
317
  if (!/* @__PURE__ */ e.isValidElement(t)) return null;
318
318
  let n = t, r = n.props;
319
- return (ge(19) ? r?.ref : n.ref) ?? null;
319
+ return (_e(19) ? r?.ref : n.ref) ?? null;
320
320
  }
321
321
  //#endregion
322
322
  //#region ../../node_modules/@base-ui-components/react/esm/utils/getStateAttributesProps.js
323
- function _e(e, t) {
323
+ function ve(e, t) {
324
324
  let n = {};
325
325
  for (let r in e) {
326
326
  let i = e[r];
@@ -335,40 +335,40 @@ function _e(e, t) {
335
335
  }
336
336
  //#endregion
337
337
  //#region ../../node_modules/@base-ui-components/react/esm/utils/resolveClassName.js
338
- function ve(e, t) {
338
+ function ye(e, t) {
339
339
  return typeof e == "function" ? e(t) : e;
340
340
  }
341
341
  //#endregion
342
342
  //#region ../../node_modules/@base-ui-components/react/esm/utils/resolveStyle.js
343
- function ye(e, t) {
343
+ function be(e, t) {
344
344
  return typeof e == "function" ? e(t) : e;
345
345
  }
346
346
  Object.freeze([]);
347
347
  var G = Object.freeze({});
348
348
  //#endregion
349
349
  //#region ../../node_modules/@base-ui-components/react/esm/utils/useRenderElement.js
350
- function be(e, t, n = {}) {
351
- let r = t.render, i = xe(t, n);
352
- return n.enabled === !1 ? null : Se(e, r, i, n.state ?? G);
350
+ function xe(e, t, n = {}) {
351
+ let r = t.render, i = Se(t, n);
352
+ return n.enabled === !1 ? null : Ce(e, r, i, n.state ?? G);
353
353
  }
354
- function xe(e, t = {}) {
355
- let { className: n, style: r, render: i } = e, { state: a = G, ref: o, props: s, stateAttributesMapping: c, enabled: l = !0 } = t, u = l ? ve(n, a) : void 0, d = l ? ye(r, a) : void 0, f = l ? _e(a, c) : G, p = l ? M(f, Array.isArray(s) ? ne(s) : s) ?? G : G;
356
- return typeof document < "u" && (l ? Array.isArray(o) ? p.ref = fe([
354
+ function Se(e, t = {}) {
355
+ let { className: n, style: r, render: i } = e, { state: a = G, ref: o, props: s, stateAttributesMapping: c, enabled: l = !0 } = t, u = l ? ye(n, a) : void 0, d = l ? be(r, a) : void 0, f = l ? ve(a, c) : G, p = l ? N(f, Array.isArray(s) ? re(s) : s) ?? G : G;
356
+ return typeof document < "u" && (l ? Array.isArray(o) ? p.ref = pe([
357
357
  p.ref,
358
358
  W(i),
359
359
  ...o
360
- ]) : p.ref = V(p.ref, W(i), o) : V(null, null)), l ? (u !== void 0 && (p.className = R(p.className, u)), d !== void 0 && (p.style = M(p.style, d)), p) : G;
360
+ ]) : p.ref = V(p.ref, W(i), o) : V(null, null)), l ? (u !== void 0 && (p.className = R(p.className, u)), d !== void 0 && (p.style = N(p.style, d)), p) : G;
361
361
  }
362
- function Se(t, n, r, i) {
362
+ function Ce(t, n, r, i) {
363
363
  if (n) {
364
364
  if (typeof n == "function") return n(r, i);
365
- let t = P(r, n.props);
365
+ let t = ne(r, n.props);
366
366
  return t.ref = r.ref, /* @__PURE__ */ e.cloneElement(n, t);
367
367
  }
368
- if (t && typeof t == "string") return Ce(t, r);
368
+ if (t && typeof t == "string") return we(t, r);
369
369
  throw Error(process.env.NODE_ENV === "production" ? z(8) : "Base UI: Render element or function are not defined.");
370
370
  }
371
- function Ce(n, r) {
371
+ function we(n, r) {
372
372
  return n === "button" ? /* @__PURE__ */ t("button", {
373
373
  type: "button",
374
374
  ...r,
@@ -382,12 +382,12 @@ function Ce(n, r) {
382
382
  //#endregion
383
383
  //#region ../../node_modules/@base-ui-components/react/esm/button/Button.js
384
384
  var K = /* @__PURE__ */ e.forwardRef(function(t, n) {
385
- let { render: r, className: i, disabled: a = !1, focusableWhenDisabled: o = !1, nativeButton: s = !0, ...c } = t, l = !!a, { getButtonProps: u, buttonRef: d } = ue({
385
+ let { render: r, className: i, disabled: a = !1, focusableWhenDisabled: o = !1, nativeButton: s = !0, ...c } = t, l = !!a, { getButtonProps: u, buttonRef: d } = de({
386
386
  disabled: l,
387
387
  focusableWhenDisabled: o,
388
388
  native: s
389
389
  });
390
- return be("button", t, {
390
+ return xe("button", t, {
391
391
  state: e.useMemo(() => ({ disabled: l }), [l]),
392
392
  ref: [n, d],
393
393
  props: [c, u]
@@ -396,33 +396,33 @@ var K = /* @__PURE__ */ e.forwardRef(function(t, n) {
396
396
  process.env.NODE_ENV !== "production" && (K.displayName = "Button");
397
397
  //#endregion
398
398
  //#region ../../node_modules/clsx/dist/clsx.mjs
399
- function q(e) {
399
+ function Te(e) {
400
400
  var t, n, r = "";
401
401
  if (typeof e == "string" || typeof e == "number") r += e;
402
402
  else if (typeof e == "object") if (Array.isArray(e)) {
403
403
  var i = e.length;
404
- for (t = 0; t < i; t++) e[t] && (n = q(e[t])) && (r && (r += " "), r += n);
404
+ for (t = 0; t < i; t++) e[t] && (n = Te(e[t])) && (r && (r += " "), r += n);
405
405
  } else for (n in e) e[n] && (r && (r += " "), r += n);
406
406
  return r;
407
407
  }
408
- function we() {
409
- for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = q(e)) && (r && (r += " "), r += t);
408
+ function Ee() {
409
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = Te(e)) && (r && (r += " "), r += t);
410
410
  return r;
411
411
  }
412
412
  //#endregion
413
413
  //#region ../../node_modules/class-variance-authority/dist/index.mjs
414
- var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De = (e, t) => (n) => {
415
- if (t?.variants == null) return Ee(e, n?.class, n?.className);
414
+ var De = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Oe = Ee, ke = (e, t) => (n) => {
415
+ if (t?.variants == null) return Oe(e, n?.class, n?.className);
416
416
  let { variants: r, defaultVariants: i } = t, a = Object.keys(r).map((e) => {
417
417
  let t = n?.[e], a = i?.[e];
418
418
  if (t === null) return null;
419
- let o = Te(t) || Te(a);
419
+ let o = De(t) || De(a);
420
420
  return r[e][o];
421
421
  }), o = n && Object.entries(n).reduce((e, t) => {
422
422
  let [n, r] = t;
423
423
  return r === void 0 || (e[n] = r), e;
424
424
  }, {});
425
- return Ee(e, a, t?.compoundVariants?.reduce((e, t) => {
425
+ return Oe(e, a, t?.compoundVariants?.reduce((e, t) => {
426
426
  let { class: n, className: r, ...a } = t;
427
427
  return Object.entries(a).every((e) => {
428
428
  let [t, n] = e;
@@ -439,19 +439,19 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
439
439
  r
440
440
  ] : e;
441
441
  }, []), n?.class, n?.className);
442
- }, Oe = (...e) => we(e), J = {
442
+ }, Ae = (...e) => Ee(e), q = {
443
443
  Primary: "primary",
444
444
  Secondary: "secondary",
445
445
  Ghost: "ghost",
446
446
  Inline: "inline",
447
447
  Link: "link",
448
448
  Plain: "plain"
449
- }, ke = {
449
+ }, je = {
450
450
  Action: "action",
451
451
  Danger: "danger",
452
452
  Success: "success",
453
453
  Light: "light"
454
- }, Ae = De("button", {
454
+ }, Me = ke("button", {
455
455
  variants: {
456
456
  variant: {
457
457
  primary: "button--primary",
@@ -497,13 +497,13 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
497
497
  startIcon: !1,
498
498
  endIcon: !1
499
499
  }
500
- }), Y = ({ variant: e = J.Primary, tone: t = ke.Action, isFullWidth: n = !1, isLoading: c = !1, isAsync: l = !1, isDisabled: u = !1, type: d = "button", className: f, onClick: p, icon: m, startIcon: h, endIcon: g, gtmAction: _, gtmLabel: v, children: y, ...b }) => {
501
- let [x, S] = a(!1), C = i(!0);
502
- r(() => () => {
503
- C.current = !1;
500
+ }), J = n(({ variant: e = q.Primary, tone: t = je.Action, isFullWidth: n = !1, isLoading: r = !1, isAsync: l = !1, isDisabled: u = !1, type: d = "button", className: f, onClick: p, icon: m, startIcon: h, endIcon: g, gtmAction: _, gtmLabel: v, children: y, ...b }, x) => {
501
+ let [S, C] = o(!1), w = a(!0);
502
+ i(() => () => {
503
+ w.current = !1;
504
504
  }, []);
505
- let w = c || x, T = async (e) => {
506
- if (w) {
505
+ let T = r || S, E = async (e) => {
506
+ if (T) {
507
507
  e.preventDefault();
508
508
  return;
509
509
  }
@@ -513,56 +513,61 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
513
513
  return;
514
514
  }
515
515
  try {
516
- S(!0), await p(e);
516
+ C(!0), await p(e);
517
517
  } finally {
518
- C.current && S(!1);
518
+ w.current && C(!1);
519
519
  }
520
520
  }
521
- }, E = /* @__PURE__ */ o("span", {
521
+ }, D = /* @__PURE__ */ s("span", {
522
522
  className: "button__spinner",
523
523
  "aria-hidden": "true"
524
- }), D = m !== void 0, O = h === void 0 && g !== void 0, k = w && !D && !O ? E : h, A = w && O ? E : g, j = D ? w ? E : m : y;
525
- return /* @__PURE__ */ s(K, {
524
+ }), O = m !== void 0, k = h === void 0 && g !== void 0, A = T && !O && !k ? D : h, j = T && k ? D : g, M = O ? T ? D : m : y;
525
+ return /* @__PURE__ */ c(K, {
526
526
  ...b,
527
+ ref: x,
527
528
  type: d,
528
529
  disabled: u,
529
- className: Oe("Button", Ae({
530
+ className: Ae("Button", Me({
530
531
  variant: e,
531
532
  tone: t,
532
- iconOnly: D,
533
+ iconOnly: O,
533
534
  fullWidth: n,
534
- loading: w,
535
- startIcon: k !== void 0,
536
- endIcon: A !== void 0
535
+ loading: T,
536
+ startIcon: A !== void 0,
537
+ endIcon: j !== void 0
537
538
  }), f),
538
- onClick: T,
539
- "aria-disabled": w || void 0,
540
- "aria-busy": w || void 0,
541
- "data-loading": w || void 0,
539
+ onClick: E,
540
+ "aria-disabled": T || void 0,
541
+ "aria-busy": T || void 0,
542
+ "data-loading": T || void 0,
542
543
  "gtm-action": _,
543
544
  "gtm-label": v,
544
545
  children: [
545
- k !== void 0 && /* @__PURE__ */ o("span", {
546
+ A !== void 0 && /* @__PURE__ */ s("span", {
546
547
  className: "button__icon",
547
548
  "aria-hidden": "true",
548
- children: k
549
+ children: A
549
550
  }),
550
- j,
551
- A !== void 0 && /* @__PURE__ */ o("span", {
551
+ M,
552
+ j !== void 0 && /* @__PURE__ */ s("span", {
552
553
  className: "button__icon",
553
554
  "aria-hidden": "true",
554
- children: A
555
+ children: j
555
556
  })
556
557
  ]
557
558
  });
558
- }, X = {
559
+ });
560
+ J.displayName = "Button";
561
+ //#endregion
562
+ //#region ../Icon/dist/index.js
563
+ var Y = {
559
564
  ExtraSmall: "extra-small",
560
565
  Small: "small",
561
566
  MediumSmall: "medium-small",
562
567
  Medium: "medium",
563
568
  Large: "large",
564
569
  ExtraLarge: "extra-large"
565
- }, Z = {
570
+ }, X = {
566
571
  Black: "black",
567
572
  White: "white",
568
573
  Blue: "blue",
@@ -571,108 +576,108 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
571
576
  Success: "success",
572
577
  Warning: "warning",
573
578
  Error: "error"
574
- }, je = {
575
- [X.ExtraSmall]: p * 3,
576
- [X.Small]: p * 4,
577
- [X.MediumSmall]: p * 5,
578
- [X.Medium]: p * 6,
579
- [X.Large]: p * 8,
580
- [X.ExtraLarge]: p * 16
581
- }, Me = _.svg`
579
+ }, Z = {
580
+ [Y.ExtraSmall]: m * 3,
581
+ [Y.Small]: m * 4,
582
+ [Y.MediumSmall]: m * 5,
583
+ [Y.Medium]: m * 6,
584
+ [Y.Large]: m * 8,
585
+ [Y.ExtraLarge]: m * 16
586
+ }, Ne = v.svg`
582
587
  display: inline-flex;
583
- width: ${(e) => je[e.$size]}px;
584
- height: ${(e) => je[e.$size]}px;
588
+ width: ${(e) => Z[e.$size]}px;
589
+ height: ${(e) => Z[e.$size]}px;
585
590
  fill: ${(e) => e.$color};
586
591
 
587
592
  &:hover {
588
593
  fill: ${(e) => e.$hoverColor};
589
594
  }
590
- `, Ne = {
591
- [Z.White]: () => g,
592
- [Z.Blue]: (e) => e?.actionColor?.main ?? c,
593
- [Z.Gray]: () => f,
594
- [Z.GrayDark]: () => d,
595
- [Z.Success]: (e) => e?.successColor?.main ?? m,
596
- [Z.Error]: (e) => e?.errorColor?.main ?? u,
597
- [Z.Warning]: (e) => e?.warningColor?.main ?? h,
598
- [Z.Black]: () => l
599
- }, Pe = (e) => e in Ne, Fe = (e, t) => Pe(t) ? Ne[t](e) : t, Q = ({ children: e, size: t = X.Medium, color: r = Z.Black, hoverColor: i, ...a }) => {
600
- let s = n(v);
601
- return /* @__PURE__ */ o(Me, {
595
+ `, Pe = {
596
+ [X.White]: () => _,
597
+ [X.Blue]: (e) => e?.actionColor?.main ?? l,
598
+ [X.Gray]: () => p,
599
+ [X.GrayDark]: () => f,
600
+ [X.Success]: (e) => e?.successColor?.main ?? h,
601
+ [X.Error]: (e) => e?.errorColor?.main ?? d,
602
+ [X.Warning]: (e) => e?.warningColor?.main ?? g,
603
+ [X.Black]: () => u
604
+ }, Fe = (e) => e in Pe, Ie = (e, t) => Fe(t) ? Pe[t](e) : t, Q = ({ children: e, size: t = Y.Medium, color: n = X.Black, hoverColor: i, ...a }) => {
605
+ let o = r(y);
606
+ return /* @__PURE__ */ s(Ne, {
602
607
  $size: t,
603
- $color: Fe(s, r),
604
- $hoverColor: Fe(s, i || r),
608
+ $color: Ie(o, n),
609
+ $hoverColor: Ie(o, i || n),
605
610
  viewBox: "0 0 24 24",
606
611
  ...a,
607
612
  children: e
608
613
  });
609
- }, Ie = (e) => /* @__PURE__ */ o(Q, {
614
+ }, Le = (e) => /* @__PURE__ */ s(Q, {
610
615
  ...e,
611
- children: /* @__PURE__ */ o("path", { d: "M14.71 15.88L10.83 12l3.88-3.88c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L8.71 11.3c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .38-.39.39-1.03 0-1.42z" })
612
- }), Le = (e) => /* @__PURE__ */ s(Q, {
616
+ children: /* @__PURE__ */ s("path", { d: "M14.71 15.88L10.83 12l3.88-3.88c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L8.71 11.3c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .38-.39.39-1.03 0-1.42z" })
617
+ }), Re = (e) => /* @__PURE__ */ c(Q, {
613
618
  ...e,
614
- children: [/* @__PURE__ */ o("path", {
619
+ children: [/* @__PURE__ */ s("path", {
615
620
  opacity: ".87",
616
621
  fill: "none",
617
622
  d: "M0 0h24v24H0V0z"
618
- }), /* @__PURE__ */ o("path", { d: "M17.7075 15.89L13.8175 12L17.7075 8.11C18.0975 7.72 18.0975 7.09 17.7075 6.7C17.3175 6.31 16.6875 6.31 16.2975 6.7L11.7075 11.29C11.3175 11.68 11.3175 12.31 11.7075 12.7L16.2975 17.3C16.6875 17.69 17.3175 17.69 17.7075 17.3C18.0875 16.91 18.0875 16.27 17.7075 15.89ZM6.9975 18C6.4475 18 5.9975 17.55 5.9975 17L5.9975 7C5.9975 6.45 6.4475 6 6.9975 6C7.5475 6 7.9975 6.45 7.9975 7L7.9975 17C7.9975 17.55 7.5475 18 6.9975 18Z" })]
619
- }), Re = (e) => /* @__PURE__ */ s(Q, {
623
+ }), /* @__PURE__ */ s("path", { d: "M17.7075 15.89L13.8175 12L17.7075 8.11C18.0975 7.72 18.0975 7.09 17.7075 6.7C17.3175 6.31 16.6875 6.31 16.2975 6.7L11.7075 11.29C11.3175 11.68 11.3175 12.31 11.7075 12.7L16.2975 17.3C16.6875 17.69 17.3175 17.69 17.7075 17.3C18.0875 16.91 18.0875 16.27 17.7075 15.89ZM6.9975 18C6.4475 18 5.9975 17.55 5.9975 17L5.9975 7C5.9975 6.45 6.4475 6 6.9975 6C7.5475 6 7.9975 6.45 7.9975 7L7.9975 17C7.9975 17.55 7.5475 18 6.9975 18Z" })]
624
+ }), ze = (e) => /* @__PURE__ */ c(Q, {
620
625
  ...e,
621
- children: [/* @__PURE__ */ o("path", {
626
+ children: [/* @__PURE__ */ s("path", {
622
627
  opacity: ".87",
623
628
  fill: "none",
624
629
  d: "M0 0h24v24H0V0z"
625
- }), /* @__PURE__ */ o("path", { d: "M6.29 8.11L10.18 12l-3.89 3.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41L7.7 6.7c-.39-.39-1.02-.39-1.41 0-.38.39-.38 1.03 0 1.41zM17 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1z" })]
626
- }), ze = (e) => /* @__PURE__ */ o(Q, {
630
+ }), /* @__PURE__ */ s("path", { d: "M6.29 8.11L10.18 12l-3.89 3.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41L7.7 6.7c-.39-.39-1.02-.39-1.41 0-.38.39-.38 1.03 0 1.41zM17 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1z" })]
631
+ }), Be = (e) => /* @__PURE__ */ s(Q, {
627
632
  ...e,
628
- children: /* @__PURE__ */ o("path", { d: "M9.29 15.88L13.17 12 9.29 8.12c-.39-.39-.39-1.02 0-1.41.39-.39 1.02-.39 1.41 0l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3c-.39.39-1.02.39-1.41 0-.38-.39-.39-1.03 0-1.42z" })
629
- }), Be = _.div`
633
+ children: /* @__PURE__ */ s("path", { d: "M9.29 15.88L13.17 12 9.29 8.12c-.39-.39-.39-1.02 0-1.41.39-.39 1.02-.39 1.41 0l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3c-.39.39-1.02.39-1.41 0-.38-.39-.39-1.03 0-1.42z" })
634
+ }), Ve = v.div`
630
635
  display: flex;
631
636
  align-items: center;
632
- `, Ve = _.div`
637
+ `, He = v.div`
633
638
  display: flex;
634
639
  align-items: center;
635
- margin-right: ${p * 9}px;
640
+ margin-right: ${m * 9}px;
636
641
 
637
642
  label {
638
- margin: 0 ${p * 3}px 0 0;
643
+ margin: 0 ${m * 3}px 0 0;
639
644
  }
640
645
 
641
646
  select {
642
647
  width: 66px;
643
648
  }
644
- `, He = _.div`
649
+ `, Ue = v.div`
645
650
  width: 70px;
646
- `, Ue = _.div`
647
- margin-right: ${p * 8}px;
648
- `, We = _.div`
651
+ `, We = v.div`
652
+ margin-right: ${m * 8}px;
653
+ `, Ge = v.div`
649
654
  display: flex;
650
- `, $ = _.div`
655
+ `, $ = v.div`
651
656
  &:not(:last-child) {
652
- margin-right: ${p * 2}px;
657
+ margin-right: ${m * 2}px;
653
658
  }
654
- `, Ge = (e, t, n) => {
659
+ `, Ke = (e, t, n) => {
655
660
  let r = e * (t - 1);
656
661
  return {
657
662
  from: r + 1,
658
663
  to: Math.min(r + e, n),
659
664
  total: n
660
665
  };
661
- }, Ke = ({ from: e, to: t, total: n }) => `${e}-${t} of ${n}`, qe = ({ pageIndex: e, perPage: t, pageSizes: n = [
666
+ }, qe = ({ from: e, to: t, total: n }) => `${e}-${t} of ${n}`, Je = ({ pageIndex: e, perPage: t, pageSizes: n = [
662
667
  10,
663
668
  20,
664
669
  50
665
- ], totalPages: r, totalItems: i, setPageSize: a, canNextPage: c, gotoPage: l, canPreviousPage: u, previousPageHandler: d, nextPageHandler: f, parentElementId: p, paginationAmount: m = "", labelPerPage: h = "" }) => {
670
+ ], totalPages: r, totalItems: i, setPageSize: a, canNextPage: o, gotoPage: l, canPreviousPage: u, previousPageHandler: d, nextPageHandler: f, parentElementId: p, paginationAmount: m = "", labelPerPage: h = "" }) => {
666
671
  let g = `${p}-pagination-select-per-page`, _ = n.map((e) => ({
667
672
  id: e,
668
673
  label: e,
669
674
  value: e
670
- })), v = _.find(({ value: e }) => e === t), x = Ge(t, e + 1, i), S = m || Ke(x);
671
- return /* @__PURE__ */ s(Be, { children: [
672
- /* @__PURE__ */ s(Ve, { children: [h && /* @__PURE__ */ o(y, {
675
+ })), v = _.find(({ value: e }) => e === t), y = Ke(t, e + 1, i), S = m || qe(y);
676
+ return /* @__PURE__ */ c(Ve, { children: [
677
+ /* @__PURE__ */ c(He, { children: [h && /* @__PURE__ */ s(b, {
673
678
  label: h,
674
679
  for: g
675
- }), /* @__PURE__ */ o(He, { children: /* @__PURE__ */ o(b, {
680
+ }), /* @__PURE__ */ s(Ue, { children: /* @__PURE__ */ s(x, {
676
681
  id: g,
677
682
  onChange: (e) => {
678
683
  e !== null && a(Number(e.value));
@@ -680,49 +685,49 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
680
685
  options: _,
681
686
  value: v
682
687
  }) })] }),
683
- /* @__PURE__ */ o(Ue, { children: S }),
684
- /* @__PURE__ */ s(We, { children: [
685
- /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(Y, {
686
- variant: J.Ghost,
687
- icon: /* @__PURE__ */ o(Le, {
688
- hoverColor: Z.Blue,
689
- color: Z.Gray
688
+ /* @__PURE__ */ s(We, { children: S }),
689
+ /* @__PURE__ */ c(Ge, { children: [
690
+ /* @__PURE__ */ s($, { children: /* @__PURE__ */ s(J, {
691
+ variant: q.Ghost,
692
+ icon: /* @__PURE__ */ s(Re, {
693
+ hoverColor: X.Blue,
694
+ color: X.Gray
690
695
  }),
691
696
  "aria-label": "First page",
692
697
  isDisabled: !u,
693
698
  id: `${p}-pagination-first-page-button`,
694
699
  onClick: () => l(0)
695
700
  }) }),
696
- /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(Y, {
697
- variant: J.Ghost,
698
- icon: /* @__PURE__ */ o(Ie, {
699
- hoverColor: Z.Blue,
700
- color: Z.Gray
701
+ /* @__PURE__ */ s($, { children: /* @__PURE__ */ s(J, {
702
+ variant: q.Ghost,
703
+ icon: /* @__PURE__ */ s(Le, {
704
+ hoverColor: X.Blue,
705
+ color: X.Gray
701
706
  }),
702
707
  "aria-label": "Previous page",
703
708
  isDisabled: !u,
704
709
  id: `${p}-pagination-previous-page-button`,
705
710
  onClick: d
706
711
  }) }),
707
- /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(Y, {
708
- variant: J.Ghost,
709
- icon: /* @__PURE__ */ o(ze, {
710
- hoverColor: Z.Blue,
711
- color: Z.Gray
712
+ /* @__PURE__ */ s($, { children: /* @__PURE__ */ s(J, {
713
+ variant: q.Ghost,
714
+ icon: /* @__PURE__ */ s(Be, {
715
+ hoverColor: X.Blue,
716
+ color: X.Gray
712
717
  }),
713
718
  "aria-label": "Next page",
714
- isDisabled: !c,
719
+ isDisabled: !o,
715
720
  id: `${p}-pagination-next-page-button`,
716
721
  onClick: f
717
722
  }) }),
718
- /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(Y, {
719
- variant: J.Ghost,
720
- icon: /* @__PURE__ */ o(Re, {
721
- hoverColor: Z.Blue,
722
- color: Z.Gray
723
+ /* @__PURE__ */ s($, { children: /* @__PURE__ */ s(J, {
724
+ variant: q.Ghost,
725
+ icon: /* @__PURE__ */ s(ze, {
726
+ hoverColor: X.Blue,
727
+ color: X.Gray
723
728
  }),
724
729
  "aria-label": "Last page",
725
- isDisabled: !c,
730
+ isDisabled: !o,
726
731
  id: `${p}-pagination-last-page-button`,
727
732
  onClick: () => l(r - 1)
728
733
  }) })
@@ -730,6 +735,6 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
730
735
  ] });
731
736
  };
732
737
  //#endregion
733
- export { qe as default };
738
+ export { Je as default };
734
739
 
735
740
  //# sourceMappingURL=index.js.map