@phillips/seldon 1.57.0 → 1.58.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.
@@ -36,6 +36,10 @@ export interface PaginationProps extends Omit<ComponentProps<'div'>, 'onChange'>
36
36
  * Option next label
37
37
  */
38
38
  nextLabel?: string;
39
+ /**
40
+ * Option select aria-label
41
+ */
42
+ selectLabel?: string;
39
43
  }
40
44
  /**
41
45
  * ## Overview
@@ -46,5 +50,5 @@ export interface PaginationProps extends Omit<ComponentProps<'div'>, 'onChange'>
46
50
  *
47
51
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-pagination--overview)
48
52
  */
49
- declare const Pagination: ({ className, onChange, variant, options, value, isDisabled, previousLabel, nextLabel, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
53
+ declare const Pagination: ({ className, onChange, variant, options, value, isDisabled, previousLabel, nextLabel, selectLabel, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
50
54
  export default Pagination;
@@ -1,60 +1,62 @@
1
- import { jsxs as x, jsx as i } from "react/jsx-runtime";
2
- import c from "../../node_modules/classnames/index.js";
3
- import { getCommonProps as N, px as n } from "../../utils/index.js";
4
- import _ from "../Select/Select.js";
5
- import d from "../Button/Button.js";
6
- import u from "../../assets/chevronRight.svg.js";
7
- const S = ({
1
+ import { jsxs as N, jsx as e } from "react/jsx-runtime";
2
+ import s from "../../node_modules/classnames/index.js";
3
+ import { getCommonProps as _, px as i } from "../../utils/index.js";
4
+ import P from "../Select/Select.js";
5
+ import d from "../../assets/chevronRight.svg.js";
6
+ import u from "../IconButton/IconButton.js";
7
+ const y = ({
8
8
  className: f,
9
- onChange: e,
9
+ onChange: n,
10
10
  variant: g = "inline",
11
11
  options: t = [],
12
12
  value: r,
13
13
  isDisabled: l,
14
14
  previousLabel: $ = "Previous",
15
- nextLabel: p = "Next",
15
+ nextLabel: b = "Next",
16
+ selectLabel: p = "Select",
16
17
  ...o
17
18
  }) => {
18
- const b = "pagination", { className: s, ...h } = N(o, "Pagination"), { id: m } = o;
19
- return /* @__PURE__ */ x(
19
+ const h = "pagination", { className: c, ...x } = _(o, "Pagination"), { id: m } = o;
20
+ return /* @__PURE__ */ N(
20
21
  "div",
21
22
  {
22
- className: c(`${n}-${b}`, { [`${s}__wrapper`]: s }, f),
23
- ...h,
23
+ className: s(`${i}-${h}`, { [`${c}__wrapper`]: c }, f),
24
+ ...x,
24
25
  ...o,
25
26
  children: [
26
- /* @__PURE__ */ i(
27
- d,
27
+ /* @__PURE__ */ e(
28
+ u,
28
29
  {
29
- className: c(`${n}__pagination-button`, `${n}-left-arrow`),
30
- onClick: () => e(t.at(t.findIndex((a) => a === r) - 1) || ""),
30
+ className: s(`${i}__pagination-button`, `${i}-left-arrow`),
31
+ onClick: () => n(t.at(t.findIndex((a) => a === r) - 1) || ""),
31
32
  "data-testid": `${m}-previous-button`,
32
33
  isDisabled: l,
33
34
  "aria-label": $,
34
- children: /* @__PURE__ */ i(u, {})
35
+ children: /* @__PURE__ */ e(d, {})
35
36
  }
36
37
  ),
37
- /* @__PURE__ */ i(
38
- _,
38
+ /* @__PURE__ */ e(
39
+ P,
39
40
  {
40
- className: g === "inline" && `${n}--inline-pagination`,
41
+ className: g === "inline" && `${i}--inline-pagination`,
42
+ "aria-label": p,
41
43
  value: r,
42
- onChange: (a) => e(a == null ? void 0 : a.currentTarget.value, a),
44
+ onChange: (a) => n(a == null ? void 0 : a.currentTarget.value, a),
43
45
  "data-testid": `${m}-select-button`,
44
46
  hideLabel: !0,
45
47
  disabled: l,
46
- children: t.map((a) => /* @__PURE__ */ i("option", { value: a, children: a }, a))
48
+ children: t.map((a) => /* @__PURE__ */ e("option", { value: a, children: a }, a))
47
49
  }
48
50
  ),
49
- /* @__PURE__ */ i(
50
- d,
51
+ /* @__PURE__ */ e(
52
+ u,
51
53
  {
52
- className: `${n}__pagination-button`,
53
- onClick: () => e(t[(t.findIndex((a) => a === r) + 1) % t.length] || ""),
54
+ className: `${i}__pagination-button`,
55
+ onClick: () => n(t[(t.findIndex((a) => a === r) + 1) % t.length] || ""),
54
56
  "data-testid": `${m}-next-button`,
55
57
  isDisabled: l,
56
- "aria-label": p,
57
- children: /* @__PURE__ */ i(u, {})
58
+ "aria-label": b,
59
+ children: /* @__PURE__ */ e(d, {})
58
60
  }
59
61
  )
60
62
  ]
@@ -62,5 +64,5 @@ const S = ({
62
64
  );
63
65
  };
64
66
  export {
65
- S as default
67
+ y as default
66
68
  };
@@ -9,6 +9,7 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
9
9
  * The OOTB style to apply to the text
10
10
  */
11
11
  variant?: TextVariants;
12
+ superScript?: string;
12
13
  }
13
14
  /**
14
15
  * ## Overview
@@ -19,5 +20,5 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
19
20
  *
20
21
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-text--overview)
21
22
  */
22
- declare const Text: ({ children, className, element: CustomElement, variant, ...props }: TextProps) => import("react/jsx-runtime").JSX.Element;
23
+ declare const Text: ({ children, className, element: CustomElement, variant, superScript, ...props }: TextProps) => import("react/jsx-runtime").JSX.Element;
23
24
  export default Text;
@@ -1,20 +1,30 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { getCommonProps as c } from "../../utils/index.js";
1
+ import { jsxs as i, jsx as p } from "react/jsx-runtime";
2
+ import { getCommonProps as x } from "../../utils/index.js";
3
3
  import { TextVariants as f } from "./types.js";
4
- import { determineDefaultTextElement as i, determineTextClassName as p } from "./utils.js";
5
- import x from "../../node_modules/classnames/index.js";
6
- const b = ({ children: t, className: o, element: s, variant: e = f.body2, ...m }) => {
7
- const r = s || i(e), { className: a, ...n } = c(m, "Text");
8
- return /* @__PURE__ */ l(
9
- r,
4
+ import { determineDefaultTextElement as d, determineTextClassName as N } from "./utils.js";
5
+ import o from "../../node_modules/classnames/index.js";
6
+ const j = ({
7
+ children: r,
8
+ className: a,
9
+ element: n,
10
+ variant: e = f.body2,
11
+ superScript: m = "",
12
+ ...s
13
+ }) => {
14
+ const l = n || d(e), { className: t, ...c } = x(s, "Text");
15
+ return /* @__PURE__ */ i(
16
+ l,
10
17
  {
11
- ...n,
12
- className: x(a, o, p(e)),
13
- ...m,
14
- children: t
18
+ ...c,
19
+ className: o(t, a, N(e)),
20
+ ...s,
21
+ children: [
22
+ r,
23
+ m ? /* @__PURE__ */ p("span", { className: o(`${t}--super-script`), children: m }) : null
24
+ ]
15
25
  }
16
26
  );
17
27
  };
18
28
  export {
19
- b as default
29
+ j as default
20
30
  };
@@ -1,6 +1,7 @@
1
1
  @use '../../allPartials' as *;
2
2
 
3
3
  .#{$px}-pagination {
4
+ align-items: center;
4
5
  display: flex;
5
6
  flex-direction: row;
6
7
  gap: $spacing-md;
@@ -47,10 +48,6 @@
47
48
  }
48
49
 
49
50
  .#{$px}__pagination-button {
50
- background: none;
51
- flex-direction: row;
52
- padding: 0;
53
-
54
51
  svg {
55
52
  width: 2rem;
56
53
 
@@ -58,15 +55,6 @@
58
55
  width: 1rem;
59
56
  }
60
57
  }
61
-
62
- &:hover,
63
- &:focus {
64
- background: none;
65
- }
66
-
67
- &:disabled {
68
- border: none;
69
- }
70
58
  }
71
59
 
72
60
  .#{$px}-left-arrow {
@@ -27,3 +27,8 @@ h6.#{$px}-text {
27
27
  p.#{$px}-text {
28
28
  margin-bottom: $spacing-md;
29
29
  }
30
+ .#{$px}-text--super-script {
31
+ font-size: 60%;
32
+ margin-left: $spacing-xsm;
33
+ vertical-align: text-bottom;
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.57.0",
3
+ "version": "1.58.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"