@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.
- package/dist/components/Pagination/Pagination.d.ts +5 -1
- package/dist/components/Pagination/Pagination.js +32 -30
- package/dist/components/Text/Text.d.ts +2 -1
- package/dist/components/Text/Text.js +23 -13
- package/dist/scss/components/Pagination/_pagination.scss +1 -13
- package/dist/scss/components/Text/_text.scss +5 -0
- package/package.json +1 -1
|
@@ -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
|
|
2
|
-
import
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import d from "
|
|
6
|
-
import u from "
|
|
7
|
-
const
|
|
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:
|
|
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:
|
|
15
|
+
nextLabel: b = "Next",
|
|
16
|
+
selectLabel: p = "Select",
|
|
16
17
|
...o
|
|
17
18
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
const h = "pagination", { className: c, ...x } = _(o, "Pagination"), { id: m } = o;
|
|
20
|
+
return /* @__PURE__ */ N(
|
|
20
21
|
"div",
|
|
21
22
|
{
|
|
22
|
-
className:
|
|
23
|
-
...
|
|
23
|
+
className: s(`${i}-${h}`, { [`${c}__wrapper`]: c }, f),
|
|
24
|
+
...x,
|
|
24
25
|
...o,
|
|
25
26
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
27
|
+
/* @__PURE__ */ e(
|
|
28
|
+
u,
|
|
28
29
|
{
|
|
29
|
-
className:
|
|
30
|
-
onClick: () =>
|
|
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__ */
|
|
35
|
+
children: /* @__PURE__ */ e(d, {})
|
|
35
36
|
}
|
|
36
37
|
),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
38
|
+
/* @__PURE__ */ e(
|
|
39
|
+
P,
|
|
39
40
|
{
|
|
40
|
-
className: g === "inline" && `${
|
|
41
|
+
className: g === "inline" && `${i}--inline-pagination`,
|
|
42
|
+
"aria-label": p,
|
|
41
43
|
value: r,
|
|
42
|
-
onChange: (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__ */
|
|
48
|
+
children: t.map((a) => /* @__PURE__ */ e("option", { value: a, children: a }, a))
|
|
47
49
|
}
|
|
48
50
|
),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
51
|
+
/* @__PURE__ */ e(
|
|
52
|
+
u,
|
|
51
53
|
{
|
|
52
|
-
className: `${
|
|
53
|
-
onClick: () =>
|
|
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":
|
|
57
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
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
|
|
2
|
-
import { getCommonProps as
|
|
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
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
...
|
|
12
|
-
className:
|
|
13
|
-
...
|
|
14
|
-
children:
|
|
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
|
-
|
|
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 {
|