@propellerads/pagination 3.1.3 → 3.1.4

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.css CHANGED
@@ -1,2 +1,2 @@
1
- .button{--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-fg:var(--color-dark-inversion);--button-fg-hover:var(--button-fg);--button-contour:transparent;--button-ring:var(--button-accent);--button-ring-width:var(--space-2);--button-height:36px;box-sizing:border-box;height:var(--button-height);padding-inline:var(--space-16);justify-content:center;align-items:center;gap:var(--space-8);margin:var(--space-0);padding-block:var(--space-0);border-radius:var(--radius-8);background-color:var(--button-bg);box-shadow:inset 0 0 0 var(--space-1) var(--button-contour);color:var(--button-fg);outline:var(--button-ring-width) solid transparent;outline-offset:var(--space-1);font:var(--font-text);font-family:var(--font-family);text-align:center;white-space:nowrap;-webkit-user-select:none;user-select:none;cursor:pointer;--button-press:var(--duration-200);transition:background-color var(--duration-200) var(--ease-flat), box-shadow var(--duration-200) var(--ease-flat), color var(--duration-200) var(--ease-flat), outline-color var(--duration-200) var(--ease-flat), transform var(--button-press) var(--ease-enter);border:0;text-decoration:none;display:inline-flex}.button:hover{background-color:var(--button-bg-hover);color:var(--button-fg-hover)}.button:active{--button-press:var(--duration-100);transform:translateY(var(--space-1))}.button--loading:active{transform:none}.button:focus-visible{outline-color:var(--button-ring)}.button--icon{width:var(--button-height);padding-inline:var(--space-0)}.button--start-icon{padding-inline-start:var(--space-12)}.button--end-icon{padding-inline-end:var(--space-12)}.button--tone-action,.button--tone-danger,.button--tone-success{--button-accent-on:var(--color-light)}.button--tone-action{--button-accent:var(--color-action)}.button--tone-danger{--button-accent:var(--color-danger)}.button--tone-success{--button-accent:var(--color-success)}.button--tone-light{--button-accent:var(--color-light);--button-accent-on:var(--color-dark)}.button--primary{--button-bg:var(--button-accent);--button-bg-hover:color-mix(in srgb, var(--over-deepen), var(--button-accent));--button-fg:var(--button-accent-on)}.button--secondary,.button--ghost{--button-fg:var(--button-accent);--button-bg-hover:color-mix(in srgb, var(--button-accent) var(--opacity-tint), transparent)}.button--ghost,.button--inline{gap:var(--space-4)}.button--secondary{--button-contour:var(--button-accent)}.button--inline{--button-bg:transparent;--button-fg:var(--button-accent);--button-fg-hover:color-mix(in srgb, var(--over-deepen), var(--button-accent));height:auto;min-height:0;padding:var(--space-0);line-height:inherit;vertical-align:baseline;--inline-ring-start:calc(var(--space-4) + var(--space-2));--inline-ring-end:calc(var(--space-4) + var(--space-2));outline:none;position:relative}.button--inline.button--icon{--inline-ring-start:var(--space-4);--inline-ring-end:var(--space-4)}.button--inline.button--start-icon{--inline-ring-start:var(--space-4)}.button--inline.button--end-icon{--inline-ring-end:var(--space-4)}.button--inline:after{content:"";inset:calc(-1 * var(--space-4)) calc(-1 * var(--inline-ring-end)) calc(-1 * var(--space-4)) calc(-1 * var(--inline-ring-start));border-radius:var(--radius-8);box-shadow:0 0 0 var(--button-ring-width) transparent;transition:box-shadow var(--duration-200) var(--ease-flat);position:absolute}.button--inline:focus-visible:after{box-shadow:0 0 0 var(--button-ring-width) var(--button-ring)}.button--inline.button--icon{width:auto}.button--link{--button-bg:transparent;--button-fg:var(--button-accent);line-height:inherit}.button--link:hover{background-color:#0000;text-decoration:underline}.button--link:active{background-color:#0000}.button--plain{--button-bg:transparent;--button-fg:inherit;height:auto;min-height:var(--button-height);font:inherit;text-align:inherit;white-space:inherit}.button--plain:hover,.button--plain:active{background-color:#0000}.button__icon{flex:none;justify-content:center;align-items:center;display:inline-flex}.button--full-width{width:100%}.button:disabled,.button[data-disabled]{--button-bg-hover:var(--button-bg);--button-fg-hover:var(--button-fg);opacity:var(--opacity-disabled);cursor:not-allowed}.button--loading{cursor:progress}.button__spinner{box-sizing:border-box;border:var(--space-2) solid currentColor;opacity:.7;border-inline-start-color:#0000;border-radius:50%;flex:none;width:16px;height:16px;animation:.6s linear infinite button-spin}@media (prefers-reduced-motion:reduce){.button__spinner{animation-duration:2s}.button:active{transform:none}}@keyframes button-spin{to{transform:rotate(360deg)}}
1
+ .button{--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-fg:var(--color-dark-inversion);--button-fg-hover:var(--button-fg);--button-contour:transparent;--button-ring:var(--button-accent);--button-ring-width:var(--space-2);--button-height:36px;box-sizing:border-box;height:var(--button-height);padding-inline:var(--space-16);justify-content:center;align-items:center;gap:var(--space-8);margin:var(--space-0);padding-block:var(--space-0);border-radius:var(--radius-8);background-color:var(--button-bg);box-shadow:inset 0 0 0 var(--space-1) var(--button-contour);color:var(--button-fg);outline:var(--button-ring-width) solid transparent;outline-offset:var(--space-1);font:var(--font-text);font-family:var(--font-family);text-align:center;white-space:nowrap;-webkit-user-select:none;user-select:none;cursor:pointer;--button-press:var(--duration-200);transition:background-color var(--duration-200) var(--ease-flat), box-shadow var(--duration-200) var(--ease-flat), color var(--duration-200) var(--ease-flat), outline-color var(--duration-200) var(--ease-flat), transform var(--button-press) var(--ease-enter);border:0;text-decoration:none;display:inline-flex}.button:hover{background-color:var(--button-bg-hover);color:var(--button-fg-hover)}.button:active{--button-press:var(--duration-100);transform:translateY(var(--space-1))}.button--loading:active,.button:disabled:active,.button[data-disabled]:active{transform:none}.button:focus-visible{outline-color:var(--button-ring)}.button--icon{width:var(--button-height);padding-inline:var(--space-0)}.button--start-icon{padding-inline-start:var(--space-12)}.button--end-icon{padding-inline-end:var(--space-12)}.button--tone-action,.button--tone-danger,.button--tone-success{--button-accent-on:var(--color-light)}.button--tone-action{--button-accent:var(--color-action)}.button--tone-danger{--button-accent:var(--color-danger)}.button--tone-success{--button-accent:var(--color-success)}.button--tone-light{--button-accent:var(--color-light);--button-accent-on:var(--color-dark)}.button--quiet{--button-accent:var(--color-quiet)}.button--primary{--button-bg:var(--button-accent);--button-bg-hover:color-mix(in srgb, var(--over-deepen), var(--button-accent));--button-fg:var(--button-accent-on);--button-contour:color-mix(in srgb, var(--color-light-inversion) 20%, transparent)}.button--secondary,.button--ghost{--button-fg:var(--button-accent);--button-bg-hover:color-mix(in srgb, var(--button-accent) var(--opacity-tint), transparent)}.button--ghost,.button--inline{gap:var(--space-4)}.button--secondary{--button-contour:var(--button-accent)}.button--inline{--button-bg:transparent;--button-fg:var(--button-accent);--button-fg-hover:color-mix(in srgb, var(--over-deepen), var(--button-accent));height:auto;min-height:0;padding:var(--space-0);line-height:inherit;vertical-align:baseline;--inline-ring-start:calc(var(--space-4) + var(--space-2));--inline-ring-end:calc(var(--space-4) + var(--space-2));outline:none;position:relative}.button--inline.button--icon{--inline-ring-start:var(--space-4);--inline-ring-end:var(--space-4)}.button--inline.button--start-icon{--inline-ring-start:var(--space-4)}.button--inline.button--end-icon{--inline-ring-end:var(--space-4)}.button--inline:after{content:"";inset:calc(-1 * var(--space-4)) calc(-1 * var(--inline-ring-end)) calc(-1 * var(--space-4)) calc(-1 * var(--inline-ring-start));border-radius:var(--radius-8);box-shadow:0 0 0 var(--button-ring-width) transparent;transition:box-shadow var(--duration-200) var(--ease-flat);position:absolute}.button--inline:focus-visible:after{box-shadow:0 0 0 var(--button-ring-width) var(--button-ring)}.button--inline.button--icon{width:auto}.button--link{--button-bg:transparent;--button-fg:var(--button-accent);line-height:inherit}.button--link:hover{background-color:#0000;text-decoration:underline}.button--link:active{background-color:#0000}.button--plain{--button-bg:transparent;--button-fg:inherit;height:auto;min-height:var(--button-height);font:inherit;text-align:inherit;white-space:inherit}.button--plain:hover,.button--plain:active{background-color:#0000}.button__icon{flex:none;justify-content:center;align-items:center;display:inline-flex}.button--full-width{width:100%}.button:disabled,.button[data-disabled]{--button-bg-hover:var(--button-bg);--button-fg-hover:var(--button-fg);opacity:var(--opacity-disabled);cursor:not-allowed}.button--loading{cursor:progress}.button__spinner{box-sizing:border-box;border:var(--space-2) solid currentColor;opacity:.7;border-inline-start-color:#0000;border-radius:50%;flex:none;width:16px;height:16px;animation:.6s linear infinite button-spin}@media (prefers-reduced-motion:reduce){.button__spinner{animation-duration:2s}.button:active{transform:none}}@keyframes button-spin{to{transform:rotate(360deg)}}
2
2
  /*$vite$:1*/
package/dist/index.js CHANGED
@@ -4,36 +4,36 @@ import { jsx as s, jsxs as c } from "react/jsx-runtime";
4
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
5
  import v, { ThemeContext as y } from "styled-components";
6
6
  import b from "@propellerads/label";
7
- import x from "@propellerads/select";
7
+ import ee from "@propellerads/select";
8
8
  //#region ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
9
- function S() {
9
+ function x() {
10
10
  return typeof window < "u";
11
11
  }
12
- function C(e) {
12
+ function S(e) {
13
13
  var t;
14
14
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
15
15
  }
16
- function w(e) {
17
- return S() ? e instanceof HTMLElement || e instanceof C(e).HTMLElement : !1;
16
+ function C(e) {
17
+ return x() ? e instanceof HTMLElement || e instanceof S(e).HTMLElement : !1;
18
18
  }
19
19
  //#endregion
20
20
  //#region ../../node_modules/@base-ui-components/utils/esm/useRefWithInit.js
21
- var T = {};
22
- function E(t, n) {
23
- let r = e.useRef(T);
24
- return r.current === T && (r.current = t(n)), r;
21
+ var w = {};
22
+ function T(t, n) {
23
+ let r = e.useRef(w);
24
+ return r.current === w && (r.current = t(n)), r;
25
25
  }
26
26
  //#endregion
27
27
  //#region ../../node_modules/@base-ui-components/utils/esm/useStableCallback.js
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;
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;
32
32
  }
33
- function A() {
33
+ function k() {
34
34
  let e = {
35
35
  next: void 0,
36
- callback: j,
36
+ callback: A,
37
37
  trampoline: (...t) => e.callback?.(...t),
38
38
  effect: () => {
39
39
  e.callback = e.next;
@@ -41,17 +41,17 @@ function A() {
41
41
  };
42
42
  return e;
43
43
  }
44
- function j() {
44
+ function A() {
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 M;
50
- process.env.NODE_ENV !== "production" && (M = /* @__PURE__ */ new Set());
51
- function ee(...e) {
49
+ var j;
50
+ process.env.NODE_ENV !== "production" && (j = /* @__PURE__ */ new Set());
51
+ function M(...e) {
52
52
  if (process.env.NODE_ENV !== "production") {
53
53
  let t = e.join(" ");
54
- M.has(t) || (M.add(t), console.error(`Base UI: ${t}`));
54
+ j.has(t) || (j.add(t), console.error(`Base UI: ${t}`));
55
55
  }
56
56
  }
57
57
  var te = typeof document < "u" ? e.useLayoutEffect : () => {};
@@ -168,7 +168,7 @@ function ue(t) {
168
168
  //#endregion
169
169
  //#region ../../node_modules/@base-ui-components/react/esm/use-button/useButton.js
170
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(() => {
171
+ let { disabled: n = !1, focusableWhenDisabled: r, tabIndex: i = 0, native: a = !0 } = t, o = e.useRef(null), s = le(!0) !== void 0, c = O(() => {
172
172
  let e = o.current;
173
173
  return !!(e?.tagName === "A" && e?.href);
174
174
  }), { props: l } = ue({
@@ -181,7 +181,7 @@ function de(t = {}) {
181
181
  process.env.NODE_ENV !== "production" && e.useEffect(() => {
182
182
  if (!o.current) return;
183
183
  let e = o.current.tagName === "BUTTON";
184
- a ? e || ee("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`.") : e && ee("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.");
184
+ a ? e || M("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`.") : e && M("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.");
185
185
  }, [a]);
186
186
  let u = e.useCallback(() => {
187
187
  let e = o.current;
@@ -228,18 +228,18 @@ function de(t = {}) {
228
228
  a,
229
229
  c
230
230
  ]),
231
- buttonRef: k((e) => {
231
+ buttonRef: O((e) => {
232
232
  o.current = e, u();
233
233
  })
234
234
  };
235
235
  }
236
236
  function fe(e) {
237
- return w(e) && e.tagName === "BUTTON";
237
+ return C(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 = E(H).current;
242
+ let i = T(H).current;
243
243
  return me(i, e, t, n, r) && U(i, [
244
244
  e,
245
245
  t,
@@ -248,7 +248,7 @@ function V(e, t, n, r) {
248
248
  ]), i.callback;
249
249
  }
250
250
  function pe(e) {
251
- let t = E(H).current;
251
+ let t = T(H).current;
252
252
  return he(t, e) && U(t, e), t.callback;
253
253
  }
254
254
  function H() {
@@ -471,6 +471,10 @@ var De = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Oe = Ee, ke
471
471
  true: "button--icon",
472
472
  false: ""
473
473
  },
474
+ quiet: {
475
+ true: "button--quiet",
476
+ false: ""
477
+ },
474
478
  fullWidth: {
475
479
  true: "button--full-width",
476
480
  false: ""
@@ -492,12 +496,13 @@ var De = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Oe = Ee, ke
492
496
  variant: "primary",
493
497
  tone: "action",
494
498
  iconOnly: !1,
499
+ quiet: !1,
495
500
  fullWidth: !1,
496
501
  loading: !1,
497
502
  startIcon: !1,
498
503
  endIcon: !1
499
504
  }
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) => {
505
+ }), J = n(({ variant: e = q.Primary, tone: t = je.Action, isFullWidth: n = !1, isLoading: r = !1, isAsync: l = !1, isDisabled: u = !1, isQuiet: d = !1, type: f = "button", className: p, onClick: m, icon: h, startIcon: g, endIcon: _, gtmAction: v, gtmLabel: y, children: b, ...ee }, x) => {
501
506
  let [S, C] = o(!1), w = a(!0);
502
507
  i(() => () => {
503
508
  w.current = !1;
@@ -507,13 +512,13 @@ var De = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Oe = Ee, ke
507
512
  e.preventDefault();
508
513
  return;
509
514
  }
510
- if (p !== void 0) {
515
+ if (m !== void 0) {
511
516
  if (!l) {
512
- p(e);
517
+ m(e);
513
518
  return;
514
519
  }
515
520
  try {
516
- C(!0), await p(e);
521
+ C(!0), await m(e);
517
522
  } finally {
518
523
  w.current && C(!1);
519
524
  }
@@ -521,27 +526,28 @@ var De = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Oe = Ee, ke
521
526
  }, D = /* @__PURE__ */ s("span", {
522
527
  className: "button__spinner",
523
528
  "aria-hidden": "true"
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;
529
+ }), O = h !== void 0, k = g === void 0 && _ !== void 0, A = T && !O && !k ? D : g, j = T && k ? D : _, M = O ? T ? D : h : b;
525
530
  return /* @__PURE__ */ c(K, {
526
- ...b,
531
+ ...ee,
527
532
  ref: x,
528
- type: d,
533
+ type: f,
529
534
  disabled: u,
530
535
  className: Ae("Button", Me({
531
536
  variant: e,
532
537
  tone: t,
533
538
  iconOnly: O,
539
+ quiet: d,
534
540
  fullWidth: n,
535
541
  loading: T,
536
542
  startIcon: A !== void 0,
537
543
  endIcon: j !== void 0
538
- }), f),
544
+ }), p),
539
545
  onClick: E,
540
546
  "aria-disabled": T || void 0,
541
547
  "aria-busy": T || void 0,
542
548
  "data-loading": T || void 0,
543
- "gtm-action": _,
544
- "gtm-label": v,
549
+ "gtm-action": v,
550
+ "gtm-label": y,
545
551
  children: [
546
552
  A !== void 0 && /* @__PURE__ */ s("span", {
547
553
  className: "button__icon",
@@ -672,12 +678,12 @@ var Y = {
672
678
  id: e,
673
679
  label: e,
674
680
  value: e
675
- })), v = _.find(({ value: e }) => e === t), y = Ke(t, e + 1, i), S = m || qe(y);
681
+ })), v = _.find(({ value: e }) => e === t), y = Ke(t, e + 1, i), x = m || qe(y);
676
682
  return /* @__PURE__ */ c(Ve, { children: [
677
683
  /* @__PURE__ */ c(He, { children: [h && /* @__PURE__ */ s(b, {
678
684
  label: h,
679
685
  for: g
680
- }), /* @__PURE__ */ s(Ue, { children: /* @__PURE__ */ s(x, {
686
+ }), /* @__PURE__ */ s(Ue, { children: /* @__PURE__ */ s(ee, {
681
687
  id: g,
682
688
  onChange: (e) => {
683
689
  e !== null && a(Number(e.value));
@@ -685,7 +691,7 @@ var Y = {
685
691
  options: _,
686
692
  value: v
687
693
  }) })] }),
688
- /* @__PURE__ */ s(We, { children: S }),
694
+ /* @__PURE__ */ s(We, { children: x }),
689
695
  /* @__PURE__ */ c(Ge, { children: [
690
696
  /* @__PURE__ */ s($, { children: /* @__PURE__ */ s(J, {
691
697
  variant: q.Ghost,