@phillips/seldon 1.125.1 → 1.126.0

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.
@@ -1,77 +1,81 @@
1
- import { jsxs as k, Fragment as p, jsx as o } from "react/jsx-runtime";
2
- import f from "../../node_modules/classnames/index.js";
3
- import { getCommonProps as N, px as v } from "../../utils/index.js";
4
- import { ButtonVariants as P } from "./types.js";
5
- import { forwardRef as j, useState as y } from "react";
6
- const H = j(
1
+ import { jsxs as k, Fragment as $, jsx as o } from "react/jsx-runtime";
2
+ import v from "../../node_modules/classnames/index.js";
3
+ import { getCommonProps as b, px as P } from "../../utils/index.js";
4
+ import { ButtonVariants as j } from "./types.js";
5
+ import { forwardRef as y, useState as H } from "react";
6
+ const L = y(
7
7
  ({
8
- variant: s = P.primary,
9
- children: r,
8
+ variant: s = j.primary,
9
+ children: l,
10
10
  className: a,
11
- isIconLast: l = !1,
12
- type: $ = "button",
13
- isDisabled: b = !1,
11
+ isIconLast: i = !1,
12
+ type: x = "button",
13
+ isDisabled: n = !1,
14
14
  href: t,
15
- target: i,
16
- prefetch: m = "none",
17
- isSkeletonLoading: x,
18
- ...n
19
- }, d) => {
20
- const { className: e, ...c } = N(n, "Button"), [B, C] = y(!1);
15
+ target: m,
16
+ prefetch: d = "none",
17
+ isSkeletonLoading: B,
18
+ ...r
19
+ }, u) => {
20
+ const { className: e, ...c } = b(r, "Button"), [C, N] = H(!1);
21
21
  if (t) {
22
- const u = () => /* @__PURE__ */ k(p, { children: [
22
+ const f = () => /* @__PURE__ */ k($, { children: [
23
23
  /* @__PURE__ */ o("link", { "data-testid": "prefetch-link", rel: "prefetch", href: t }),
24
24
  /* @__PURE__ */ o("link", { "data-testid": "modulepreload-link", rel: "modulepreload", href: t })
25
25
  ] });
26
- return /* @__PURE__ */ k(p, { children: [
26
+ return /* @__PURE__ */ k($, { children: [
27
27
  /* @__PURE__ */ o(
28
28
  "a",
29
29
  {
30
30
  ...c,
31
- ref: d,
31
+ ref: u,
32
32
  href: t,
33
- className: f(
33
+ className: v(
34
34
  `${e}`,
35
35
  `${e}--${s}`,
36
36
  {
37
- [`${e}--icon-last`]: l
37
+ [`${e}--icon-last`]: i
38
38
  },
39
39
  a
40
40
  ),
41
- target: i,
42
- rel: i === "_blank" ? "noopener noreferrer" : void 0,
43
- onMouseOver: () => C(!0),
44
- onClick: n.onClick,
45
- children: r
41
+ target: m,
42
+ rel: m === "_blank" ? "noopener noreferrer" : void 0,
43
+ onMouseOver: () => {
44
+ n || N(!0);
45
+ },
46
+ onClick: (p) => {
47
+ n ? p.preventDefault() : r.onClick?.(p);
48
+ },
49
+ children: l
46
50
  }
47
51
  ),
48
- m === "intent" && B && /* @__PURE__ */ o(u, {}),
49
- m === "render" && /* @__PURE__ */ o(u, {})
52
+ d === "intent" && C && /* @__PURE__ */ o(f, {}),
53
+ d === "render" && /* @__PURE__ */ o(f, {})
50
54
  ] });
51
55
  } else
52
56
  return /* @__PURE__ */ o(
53
57
  "button",
54
58
  {
55
59
  ...c,
56
- ref: d,
57
- type: $,
58
- className: f(
60
+ ref: u,
61
+ type: x,
62
+ className: v(
59
63
  `${e}`,
60
64
  `${e}--${s}`,
61
65
  {
62
- [`${e}--icon-last`]: l,
63
- [`${v}-skeleton`]: x
66
+ [`${e}--icon-last`]: i,
67
+ [`${P}-skeleton`]: B
64
68
  },
65
69
  a
66
70
  ),
67
- disabled: b,
68
- ...n,
69
- children: r
71
+ disabled: n,
72
+ ...r,
73
+ children: l
70
74
  }
71
75
  );
72
76
  }
73
77
  );
74
- H.displayName = "Button";
78
+ L.displayName = "Button";
75
79
  export {
76
- H as default
80
+ L as default
77
81
  };
@@ -1,90 +1,94 @@
1
- import { jsxs as k, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as k, jsx as i } from "react/jsx-runtime";
2
2
  import { useMemo as B } from "react";
3
- import b from "../../node_modules/classnames/index.js";
4
- import { getCommonProps as T, px as u } from "../../utils/index.js";
3
+ import u from "../../node_modules/classnames/index.js";
4
+ import { getCommonProps as T, px as b } from "../../utils/index.js";
5
5
  import F from "../Select/Select.js";
6
6
  import x from "../../assets/chevronRight.svg.js";
7
- import y from "../IconButton/IconButton.js";
8
- import { ButtonVariants as P } from "../Button/types.js";
9
- import { determineOptionValue as i, findOptionFromSelectString as M } from "./utils.js";
7
+ import $ from "../IconButton/IconButton.js";
8
+ import { ButtonVariants as y } from "../Button/types.js";
9
+ import { determineOptionValue as f, findOptionFromSelectString as M } from "./utils.js";
10
10
  import { usePendingState as R } from "../../utils/hooks.js";
11
- const L = ({
12
- className: $,
13
- onChange: S,
14
- variant: j = "inline",
15
- options: a = [],
11
+ const Q = ({
12
+ className: P,
13
+ onChange: _,
14
+ variant: S = "inline",
15
+ options: o = [],
16
16
  value: g,
17
- isDisabled: m,
18
- previousLabel: C = "Previous",
19
- nextLabel: N = "Next",
17
+ isDisabled: c,
18
+ previousLabel: j = "Previous",
19
+ nextLabel: C = "Next",
20
20
  selectLabel: v = "Select",
21
21
  ...s
22
22
  }) => {
23
- const O = "pagination", { className: c, ...I } = T(s, "Pagination"), { id: p } = s, { pendingState: _, setPendingState: w } = R(i(g)), f = _ || g, d = (e, r) => {
24
- const l = i(e);
25
- w(l), S(l, r);
23
+ const N = "pagination", { className: a, ...O } = T(s, "Pagination"), { id: p } = s, { pendingState: I, setPendingState: w } = R(f(g)), l = I || g, d = (e, r) => {
24
+ const m = f(e);
25
+ w(m), _(m, r);
26
26
  }, [t, n] = B(() => {
27
- const e = a.findIndex((h) => i(h) === f) - 1, r = a.at(e) || "", l = (a.findIndex((h) => i(h) === f) + 1) % a.length, V = a[l];
27
+ const e = o.findIndex((h) => f(h) === l) - 1, r = o.at(e) || "", m = (o.findIndex((h) => f(h) === l) + 1) % o.length, V = o[m];
28
28
  return [r, V];
29
- }, [a, f]);
29
+ }, [o, l]);
30
30
  return /* @__PURE__ */ k(
31
31
  "div",
32
32
  {
33
- className: b(`${u}-${O}`, { [`${c}__wrapper`]: c }, $),
34
- ...I,
33
+ className: u(`${b}-${N}`, { [`${a}__wrapper`]: a }, P),
34
+ ...O,
35
35
  ...s,
36
36
  children: [
37
- /* @__PURE__ */ o(
38
- y,
37
+ /* @__PURE__ */ i(
38
+ $,
39
39
  {
40
- className: b(`${c}__button`, `${u}-left-arrow`),
40
+ className: u(`${a}__button`, `${b}-left-arrow`, {
41
+ [`${a}__button--is-disabled`]: c
42
+ }),
41
43
  onClick: (e) => {
42
44
  typeof t == "object" && t.href && e.preventDefault(), d(t);
43
45
  },
44
46
  "data-testid": `${p}-previous-button`,
45
- isDisabled: m,
46
- "aria-label": C,
47
- variant: P.primary,
47
+ isDisabled: c,
48
+ "aria-label": j,
49
+ variant: y.primary,
48
50
  href: typeof t == "object" && t.href ? t.href : void 0,
49
51
  prefetch: typeof t == "object" && t.prefetch ? t.prefetch : void 0,
50
- children: /* @__PURE__ */ o(x, {})
52
+ children: /* @__PURE__ */ i(x, {})
51
53
  }
52
54
  ),
53
- /* @__PURE__ */ o(
55
+ /* @__PURE__ */ i(
54
56
  F,
55
57
  {
56
- className: j === "inline" ? `${u}--inline-pagination` : void 0,
58
+ className: S === "inline" ? `${b}--inline-pagination` : void 0,
57
59
  "aria-label": v,
58
- value: f,
60
+ value: l,
59
61
  onChange: (e) => {
60
- const r = M(a, e?.currentTarget.value);
62
+ const r = M(o, e?.currentTarget.value);
61
63
  r && d(r, e);
62
64
  },
63
65
  "data-testid": `${p}-select-button`,
64
66
  hideLabel: !0,
65
67
  labelText: v,
66
- disabled: m,
68
+ disabled: c,
67
69
  showIcon: !1,
68
- children: a.map((e) => {
69
- const r = i(e);
70
- return /* @__PURE__ */ o("option", { value: r, children: typeof e == "string" || typeof e == "number" ? e : e.label }, r);
70
+ children: o.map((e) => {
71
+ const r = f(e);
72
+ return /* @__PURE__ */ i("option", { value: r, children: typeof e == "string" || typeof e == "number" ? e : e.label }, r);
71
73
  })
72
74
  }
73
75
  ),
74
- /* @__PURE__ */ o(
75
- y,
76
+ /* @__PURE__ */ i(
77
+ $,
76
78
  {
77
- className: `${c}__button`,
79
+ className: u(`${a}__button`, {
80
+ [`${a}__button--is-disabled`]: c
81
+ }),
78
82
  onClick: (e) => {
79
83
  typeof n == "object" && n.href && e.preventDefault(), d(n);
80
84
  },
81
85
  "data-testid": `${p}-next-button`,
82
- isDisabled: m,
83
- "aria-label": N,
84
- variant: P.primary,
86
+ isDisabled: c,
87
+ "aria-label": C,
88
+ variant: y.primary,
85
89
  href: typeof n == "object" && n.href ? n.href : void 0,
86
90
  prefetch: typeof n == "object" && n.prefetch ? n.prefetch : void 0,
87
- children: /* @__PURE__ */ o(x, {})
91
+ children: /* @__PURE__ */ i(x, {})
88
92
  }
89
93
  )
90
94
  ]
@@ -92,5 +96,5 @@ const L = ({
92
96
  );
93
97
  };
94
98
  export {
95
- L as default
99
+ Q as default
96
100
  };
@@ -11,6 +11,10 @@
11
11
  border: unset;
12
12
  }
13
13
 
14
+ &--is-disabled {
15
+ pointer-events: none;
16
+ }
17
+
14
18
  &:hover:not(:disabled) {
15
19
  background-color: inherit;
16
20
 
@@ -27,28 +31,20 @@
27
31
 
28
32
  appearance: none;
29
33
  border: none;
34
+ border-bottom: 1px solid $pure-black;
35
+ border-radius: 0;
30
36
  font-variation-settings: 'wght' 600;
31
- line-height: 1.75rem;
32
37
  margin-bottom: 0;
33
38
  outline: none;
34
- padding: 0 $spacing-xsm;
39
+ padding: 0 $spacing-micro $spacing-micro;
35
40
  text-align: center;
36
41
  text-align-last: center;
37
- text-decoration: underline;
38
- text-underline-offset: 6px;
39
-
40
- @include isHeaderDesktop {
41
- line-height: 2.5rem;
42
- text-underline-offset: 10px;
43
- }
44
42
 
45
43
  &:disabled {
46
- border: 1px solid $medium-gray;
44
+ border-color: transparent;
47
45
  margin: auto;
48
46
  max-height: 3.5rem;
49
47
  max-width: 5rem;
50
- padding: 0.5rem;
51
- text-decoration: none;
52
48
  }
53
49
 
54
50
  &:hover {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.125.1",
3
+ "version": "1.126.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"