@phillips/seldon 1.171.0 → 1.171.1

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.
Files changed (60) hide show
  1. package/dist/components/Carousel/CarouselDot.d.ts +2 -3
  2. package/dist/components/Carousel/CarouselDot.test.d.ts +0 -0
  3. package/dist/components/Carousel/CarouselDots.test.d.ts +0 -0
  4. package/dist/components/Carousel/CarouselKeyboardNavigation.test.d.ts +1 -0
  5. package/dist/components/ComposedModal/ComposedModal.js +21 -20
  6. package/dist/components/Dropdown/Dropdown.d.ts +2 -2
  7. package/dist/components/Dropdown/Dropdown.js +19 -19
  8. package/dist/components/Grid/Grid.d.ts +6 -3
  9. package/dist/components/Grid/Grid.js +20 -18
  10. package/dist/components/GridItem/GridItem.d.ts +1 -2
  11. package/dist/components/GridItem/GridItem.js +29 -26
  12. package/dist/components/GridItem/GridItem.stories.d.ts +1 -1
  13. package/dist/components/Link/Link.d.ts +1 -1
  14. package/dist/components/Link/Link.js +24 -26
  15. package/dist/components/Link/Link.stories.d.ts +1 -1
  16. package/dist/components/Link/types.js +1 -3
  17. package/dist/components/LinkBlock/LinkBlock.d.ts +1 -1
  18. package/dist/components/LinkBlock/LinkBlock.js +16 -12
  19. package/dist/components/LinkBlock/LinkBlock.stories.d.ts +1 -1
  20. package/dist/components/LinkList/LinkList.d.ts +1 -2
  21. package/dist/components/LinkList/LinkList.js +21 -8
  22. package/dist/components/LinkList/LinkList.stories.d.ts +2 -2
  23. package/dist/components/Pagination/Pagination.d.ts +2 -2
  24. package/dist/components/Pagination/Pagination.js +98 -94
  25. package/dist/components/Pagination/Pagination.stories.d.ts +1 -1
  26. package/dist/components/PinchZoom/PinchZoom.d.ts +1 -2
  27. package/dist/components/PinchZoom/PinchZoom.js +54 -58
  28. package/dist/components/PinchZoom/PinchZoom.stories.d.ts +1 -1
  29. package/dist/components/Row/Row.d.ts +1 -2
  30. package/dist/components/Row/Row.js +31 -26
  31. package/dist/components/Row/Row.stories.d.ts +1 -1
  32. package/dist/components/Search/Search.d.ts +3 -2
  33. package/dist/components/Search/Search.js +160 -157
  34. package/dist/components/SplitPanel/SplitPanel.d.ts +1 -1
  35. package/dist/components/SplitPanel/SplitPanel.js +20 -21
  36. package/dist/components/SplitPanel/SplitPanel.stories.d.ts +1 -1
  37. package/dist/components/Text/Text.d.ts +1 -2
  38. package/dist/components/Text/Text.js +31 -34
  39. package/dist/components/Text/Text.stories.d.ts +1 -1
  40. package/dist/components/TextSymbol/TextSymbol.d.ts +1 -1
  41. package/dist/components/TextSymbol/TextSymbol.js +20 -7
  42. package/dist/components/TextSymbol/TextSymbol.stories.d.ts +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/patterns/HeroBanner/HeroBanner.d.ts +1 -1
  45. package/dist/patterns/HeroBanner/HeroBanner.js +30 -34
  46. package/dist/patterns/HeroBanner/HeroBanner.stories.d.ts +1 -1
  47. package/dist/patterns/LanguageSelector/LanguageSelector.js +66 -61
  48. package/dist/patterns/Social/Social.d.ts +1 -1
  49. package/dist/patterns/Social/Social.js +27 -23
  50. package/dist/patterns/Social/Social.stories.d.ts +1 -1
  51. package/dist/patterns/Subscribe/Subscribe.d.ts +2 -1
  52. package/dist/patterns/Subscribe/Subscribe.js +77 -62
  53. package/dist/patterns/Subscribe/Subscribe.stories.d.ts +1 -1
  54. package/dist/patterns/ViewingsList/StatefulViewingsList.d.ts +1 -1
  55. package/dist/patterns/ViewingsList/StatefulViewingsList.js +28 -31
  56. package/dist/patterns/ViewingsList/ViewingsList.d.ts +1 -1
  57. package/dist/patterns/ViewingsList/ViewingsList.js +40 -39
  58. package/dist/patterns/ViewingsList/ViewingsList.stories.d.ts +1 -1
  59. package/dist/utils/testUtils.d.ts +3 -0
  60. package/package.json +1 -1
@@ -1,101 +1,105 @@
1
1
  import { jsxs as k, jsx as i } from "react/jsx-runtime";
2
- import { useMemo as B } from "react";
2
+ import { forwardRef as B, useMemo as T } from "react";
3
3
  import u from "../../node_modules/classnames/index.js";
4
- import { getCommonProps as R, px as b } from "../../utils/index.js";
5
- import T from "../Select/Select.js";
4
+ import { getCommonProps as F, px as b } from "../../utils/index.js";
5
+ import M from "../Select/Select.js";
6
6
  import x from "../IconButton/IconButton.js";
7
7
  import { ButtonVariants as $ } from "../Button/types.js";
8
- import { determineOptionValue as f, findOptionFromSelectString as F } from "./utils.js";
9
- import { usePendingState as M } from "../../utils/hooks.js";
8
+ import { determineOptionValue as f, findOptionFromSelectString as W } from "./utils.js";
9
+ import { usePendingState as q } from "../../utils/hooks.js";
10
10
  import y from "../Icon/Icon.js";
11
- const Q = ({
12
- className: P,
13
- onChange: _,
14
- variant: j = "inline",
15
- options: r = [],
16
- value: g,
17
- isDisabled: c,
18
- previousLabel: C = "Previous",
19
- nextLabel: S = "Next",
20
- selectLabel: v = "Select",
21
- ...d
22
- }) => {
23
- const I = "pagination", { className: a, ...N } = R(d, "Pagination"), { id: l } = d, { pendingState: O, setPendingState: w } = M(f(g)), s = O || g, p = (e, o) => {
24
- const m = f(e);
25
- w(m), _(m, o);
26
- }, [t, n] = B(() => {
27
- const e = r.findIndex((h) => f(h) === s) - 1, o = r.at(e) || "", m = (r.findIndex((h) => f(h) === s) + 1) % r.length, V = r[m];
28
- return [o, V];
29
- }, [r, s]);
30
- return /* @__PURE__ */ k(
31
- "div",
32
- {
33
- className: u(`${b}-${I}`, { [`${a}__wrapper`]: a }, P),
34
- ...N,
35
- ...d,
36
- children: [
37
- /* @__PURE__ */ i(
38
- x,
39
- {
40
- className: u(`${a}__button`, `${b}-left-arrow`, {
41
- [`${a}__button--is-disabled`]: c
42
- }),
43
- onClick: (e) => {
44
- typeof t == "object" && t.href && e.preventDefault(), p(t);
45
- },
46
- "data-testid": `${l}-previous-button`,
47
- isDisabled: c,
48
- "aria-label": C,
49
- variant: $.primary,
50
- href: typeof t == "object" && t.href ? t.href : void 0,
51
- prefetch: typeof t == "object" && t.prefetch ? t.prefetch : void 0,
52
- children: /* @__PURE__ */ i(y, { icon: "ChevronRight" })
53
- }
54
- ),
55
- /* @__PURE__ */ i(
56
- T,
57
- {
58
- className: j === "inline" ? `${b}--inline-pagination` : void 0,
59
- "aria-label": v,
60
- value: s,
61
- onChange: (e) => {
62
- const o = F(r, e?.currentTarget.value);
63
- o && p(o, e);
64
- },
65
- "data-testid": `${l}-select-button`,
66
- hideLabel: !0,
67
- labelText: v,
68
- disabled: c,
69
- showIcon: !1,
70
- id: `${l}-select-button`,
71
- children: r.map((e) => {
72
- const o = f(e);
73
- return /* @__PURE__ */ i("option", { value: o, children: typeof e == "string" || typeof e == "number" ? e : e.label }, o);
74
- })
75
- }
76
- ),
77
- /* @__PURE__ */ i(
78
- x,
79
- {
80
- className: u(`${a}__button`, {
81
- [`${a}__button--is-disabled`]: c
82
- }),
83
- onClick: (e) => {
84
- typeof n == "object" && n.href && e.preventDefault(), p(n);
85
- },
86
- "data-testid": `${l}-next-button`,
87
- isDisabled: c,
88
- "aria-label": S,
89
- variant: $.primary,
90
- href: typeof n == "object" && n.href ? n.href : void 0,
91
- prefetch: typeof n == "object" && n.prefetch ? n.prefetch : void 0,
92
- children: /* @__PURE__ */ i(y, { icon: "ChevronRight" })
93
- }
94
- )
95
- ]
96
- }
97
- );
98
- };
11
+ const z = B(
12
+ ({
13
+ className: P,
14
+ onChange: _,
15
+ variant: j = "inline",
16
+ options: r = [],
17
+ value: g,
18
+ isDisabled: c,
19
+ previousLabel: C = "Previous",
20
+ nextLabel: N = "Next",
21
+ selectLabel: v = "Select",
22
+ ...m
23
+ }, S) => {
24
+ const I = "pagination", { className: a, ...O } = F(m, "Pagination"), { id: l } = m, { pendingState: w, setPendingState: R } = q(f(g)), s = w || g, p = (e, o) => {
25
+ const d = f(e);
26
+ R(d), _(d, o);
27
+ }, [t, n] = T(() => {
28
+ const e = r.findIndex((h) => f(h) === s) - 1, o = r.at(e) || "", d = (r.findIndex((h) => f(h) === s) + 1) % r.length, V = r[d];
29
+ return [o, V];
30
+ }, [r, s]);
31
+ return /* @__PURE__ */ k(
32
+ "div",
33
+ {
34
+ ref: S,
35
+ className: u(`${b}-${I}`, { [`${a}__wrapper`]: a }, P),
36
+ ...O,
37
+ ...m,
38
+ children: [
39
+ /* @__PURE__ */ i(
40
+ x,
41
+ {
42
+ className: u(`${a}__button`, `${b}-left-arrow`, {
43
+ [`${a}__button--is-disabled`]: c
44
+ }),
45
+ onClick: (e) => {
46
+ typeof t == "object" && t.href && e.preventDefault(), p(t);
47
+ },
48
+ "data-testid": `${l}-previous-button`,
49
+ isDisabled: c,
50
+ "aria-label": C,
51
+ variant: $.primary,
52
+ href: typeof t == "object" && t.href ? t.href : void 0,
53
+ prefetch: typeof t == "object" && t.prefetch ? t.prefetch : void 0,
54
+ children: /* @__PURE__ */ i(y, { icon: "ChevronRight" })
55
+ }
56
+ ),
57
+ /* @__PURE__ */ i(
58
+ M,
59
+ {
60
+ className: j === "inline" ? `${b}--inline-pagination` : void 0,
61
+ "aria-label": v,
62
+ value: s,
63
+ onChange: (e) => {
64
+ const o = W(r, e?.currentTarget.value);
65
+ o && p(o, e);
66
+ },
67
+ "data-testid": `${l}-select-button`,
68
+ hideLabel: !0,
69
+ labelText: v,
70
+ disabled: c,
71
+ showIcon: !1,
72
+ id: `${l}-select-button`,
73
+ children: r.map((e) => {
74
+ const o = f(e);
75
+ return /* @__PURE__ */ i("option", { value: o, children: typeof e == "string" || typeof e == "number" ? e : e.label }, o);
76
+ })
77
+ }
78
+ ),
79
+ /* @__PURE__ */ i(
80
+ x,
81
+ {
82
+ className: u(`${a}__button`, {
83
+ [`${a}__button--is-disabled`]: c
84
+ }),
85
+ onClick: (e) => {
86
+ typeof n == "object" && n.href && e.preventDefault(), p(n);
87
+ },
88
+ "data-testid": `${l}-next-button`,
89
+ isDisabled: c,
90
+ "aria-label": N,
91
+ variant: $.primary,
92
+ href: typeof n == "object" && n.href ? n.href : void 0,
93
+ prefetch: typeof n == "object" && n.prefetch ? n.prefetch : void 0,
94
+ children: /* @__PURE__ */ i(y, { icon: "ChevronRight" })
95
+ }
96
+ )
97
+ ]
98
+ }
99
+ );
100
+ }
101
+ );
102
+ z.displayName = "Pagination";
99
103
  export {
100
- Q as default
104
+ z as default
101
105
  };
@@ -1,7 +1,7 @@
1
1
  import { PaginationProps } from './Pagination';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ className, onChange, variant, options, value, isDisabled, previousLabel, nextLabel, selectLabel, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
4
+ component: import('react').ForwardRefExoticComponent<Omit<PaginationProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
5
5
  };
6
6
  export default meta;
7
7
  interface StoryProps extends PaginationProps {
@@ -1,4 +1,3 @@
1
- import { FC } from 'react';
2
1
  export interface PinchZoomProps extends React.HTMLAttributes<HTMLDivElement> {
3
2
  /**
4
3
  * Function to call when the zoom changes.
@@ -38,5 +37,5 @@ export interface PinchZoomProps extends React.HTMLAttributes<HTMLDivElement> {
38
37
  *
39
38
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-pinchzoom--overview)
40
39
  */
41
- declare const PinchZoom: FC<PinchZoomProps>;
40
+ declare const PinchZoom: import('react').ForwardRefExoticComponent<PinchZoomProps & import('react').RefAttributes<HTMLElement>>;
42
41
  export default PinchZoom;
@@ -1,63 +1,59 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
- import { useState as X, useRef as h, useEffect as w, useCallback as C, isValidElement as E, cloneElement as $ } from "react";
3
- import { getCommonProps as k } from "../../utils/index.js";
4
- import { TransformWrapper as z, TransformComponent as M } from "../../node_modules/react-zoom-pan-pinch/dist/index.esm.js";
2
+ import { forwardRef as X, useState as h, useRef as C, useEffect as E, useCallback as $, isValidElement as k, cloneElement as z } from "react";
3
+ import { getCommonProps as M } from "../../utils/index.js";
4
+ import { TransformWrapper as R, TransformComponent as g } from "../../node_modules/react-zoom-pan-pinch/dist/index.esm.js";
5
5
  import d from "../../node_modules/classnames/index.js";
6
- const g = ({
7
- onZoomChange: s,
8
- onAtLeftEdge: m,
9
- onAtRightEdge: l,
10
- children: e,
11
- maxZoom: u = 10,
12
- className: b,
13
- isZoomReset: n = !1,
14
- ...i
15
- }) => {
16
- const { className: o, ...P } = k(i, "PinchZoom"), [t, r] = X(!1), c = h(null);
17
- w(() => {
18
- n && (c.current?.resetTransform(), r(!1), s?.(!1));
19
- }, [n, s]);
20
- const N = C(
21
- (x) => {
22
- const { state: a, instance: f } = x;
23
- a.scale > 0.99 && a.scale < 1.01 ? (r(!1), s?.(!1)) : (r(!0), s?.(!0));
24
- const S = Math.abs(a.positionX - (f.bounds?.maxPositionX ?? 0)) < 0.01, T = Math.abs(a.positionX - (f.bounds?.minPositionX ?? 0)) < 0.01;
25
- m?.(S), l?.(T);
26
- },
27
- [s, m, l]
28
- );
29
- return /* @__PURE__ */ p(
30
- z,
31
- {
32
- maxScale: u,
33
- onTransformed: N,
34
- minScale: 1,
35
- disablePadding: !0,
36
- doubleClick: {
37
- mode: t ? "reset" : "toggle"
6
+ const j = X(
7
+ ({ onZoomChange: s, onAtLeftEdge: m, onAtRightEdge: l, children: e, maxZoom: u = 10, className: b, isZoomReset: n = !1, ...i }, P) => {
8
+ const { className: o, ...N } = M(i, "PinchZoom"), [t, r] = h(!1), c = C(null);
9
+ E(() => {
10
+ n && (c.current?.resetTransform(), r(!1), s?.(!1));
11
+ }, [n, s]);
12
+ const w = $(
13
+ (x) => {
14
+ const { state: a, instance: f } = x;
15
+ a.scale > 0.99 && a.scale < 1.01 ? (r(!1), s?.(!1)) : (r(!0), s?.(!0));
16
+ const S = Math.abs(a.positionX - (f.bounds?.maxPositionX ?? 0)) < 0.01, T = Math.abs(a.positionX - (f.bounds?.minPositionX ?? 0)) < 0.01;
17
+ m?.(S), l?.(T);
38
18
  },
39
- wheel: {
40
- smoothStep: 0.01
41
- },
42
- panning: {
43
- disabled: !t
44
- },
45
- ref: c,
46
- children: /* @__PURE__ */ p(
47
- M,
48
- {
49
- wrapperProps: { ...P, ...i },
50
- wrapperClass: d(o, b, {
51
- [`${o}-zoomed`]: t
52
- }),
53
- contentClass: `${o}-content`,
54
- children: E(e) ? $(e, { className: d(`${o}-child`, e?.props?.className) }) : e
55
- }
56
- )
57
- }
58
- );
59
- };
60
- g.displayName = "PinchZoom";
19
+ [s, m, l]
20
+ );
21
+ return /* @__PURE__ */ p(
22
+ R,
23
+ {
24
+ maxScale: u,
25
+ onTransformed: w,
26
+ minScale: 1,
27
+ disablePadding: !0,
28
+ doubleClick: {
29
+ mode: t ? "reset" : "toggle"
30
+ },
31
+ wheel: {
32
+ smoothStep: 0.01
33
+ },
34
+ panning: {
35
+ disabled: !t
36
+ },
37
+ ref: c,
38
+ children: /* @__PURE__ */ p(
39
+ g,
40
+ {
41
+ wrapperProps: { ...N, ...i },
42
+ wrapperClass: d(o, b, {
43
+ [`${o}-zoomed`]: t
44
+ }),
45
+ contentClass: `${o}-content`,
46
+ children: k(e) ? z(e, {
47
+ className: d(`${o}-child`, e?.props?.className),
48
+ ref: P
49
+ }) : e
50
+ }
51
+ )
52
+ }
53
+ );
54
+ }
55
+ );
56
+ j.displayName = "PinchZoom";
61
57
  export {
62
- g as default
58
+ j as default
63
59
  };
@@ -1,7 +1,7 @@
1
1
  import { PinchZoomProps } from './PinchZoom';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: import('react').FC<PinchZoomProps>;
4
+ component: import('react').ForwardRefExoticComponent<PinchZoomProps & import('react').RefAttributes<HTMLElement>>;
5
5
  };
6
6
  export default meta;
7
7
  export declare const Playground: {
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { PaddingTokens } from '../../utils';
3
2
  export interface RowProps extends React.HTMLAttributes<HTMLElement> {
4
3
  /**
@@ -22,5 +21,5 @@ export interface RowProps extends React.HTMLAttributes<HTMLElement> {
22
21
  *
23
22
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-layouts-row--overview)
24
23
  */
25
- declare const Row: ({ children, element: CustomElement, padding, className, ...props }: RowProps) => import("react/jsx-runtime").JSX.Element;
24
+ declare const Row: import('react').ForwardRefExoticComponent<RowProps & import('react').RefAttributes<HTMLElement>>;
26
25
  export default Row;
@@ -1,29 +1,34 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { getCommonProps as p, generatePaddingClassName as e, PaddingTokens as m } from "../../utils/index.js";
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { forwardRef as f } from "react";
3
+ import { getCommonProps as i, generatePaddingClassName as m, PaddingTokens as e } from "../../utils/index.js";
3
4
  import C from "../../node_modules/classnames/index.js";
4
- const g = ({
5
- children: s,
6
- element: n,
7
- padding: o = { top: m.lg, bottom: m.lg },
8
- className: a,
9
- ...t
10
- }) => {
11
- const { className: r, ...l } = p(t, "Row");
12
- return /* @__PURE__ */ c(
13
- n || "section",
14
- {
15
- ...l,
16
- className: C(
17
- r,
18
- o.top && e(o.top, "start"),
19
- o.bottom && e(o.bottom, "end"),
20
- a
21
- ),
22
- ...t,
23
- children: s
24
- }
25
- );
26
- };
5
+ const N = f(
6
+ ({
7
+ children: s,
8
+ element: a,
9
+ padding: o = { top: e.lg, bottom: e.lg },
10
+ className: r,
11
+ ...t
12
+ }, n) => {
13
+ const { className: l, ...c } = i(t, "Row");
14
+ return /* @__PURE__ */ p(
15
+ a || "section",
16
+ {
17
+ ref: n,
18
+ ...c,
19
+ className: C(
20
+ l,
21
+ o.top && m(o.top, "start"),
22
+ o.bottom && m(o.bottom, "end"),
23
+ r
24
+ ),
25
+ ...t,
26
+ children: s
27
+ }
28
+ );
29
+ }
30
+ );
31
+ N.displayName = "Row";
27
32
  export {
28
- g as default
33
+ N as default
29
34
  };
@@ -1,7 +1,7 @@
1
1
  import { RowProps } from './Row';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ children, element: CustomElement, padding, className, ...props }: RowProps) => import("react/jsx-runtime").JSX.Element;
4
+ component: import('react').ForwardRefExoticComponent<RowProps & import('react').RefAttributes<HTMLElement>>;
5
5
  };
6
6
  export default meta;
7
7
  export declare const Playground: {
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { SearchResultsProps } from './SearchResults/SearchResults';
3
2
  export interface SearchProps extends React.HTMLAttributes<HTMLDivElement> {
4
3
  /**
@@ -44,5 +43,7 @@ export interface SearchProps extends React.HTMLAttributes<HTMLDivElement> {
44
43
  */
45
44
  invalidText?: string;
46
45
  }
47
- declare const Search: ({ onSearch, onCancel, searchResults, state, defaultValue, className, placeholder, searchButtonText, loadingText, invalidText, getAllResultsText, getAllResultsLink, ...props }: React.PropsWithChildren<SearchProps>) => import("react/jsx-runtime").JSX.Element;
46
+ declare const Search: import('react').ForwardRefExoticComponent<SearchProps & {
47
+ children?: import('react').ReactNode | undefined;
48
+ } & import('react').RefAttributes<HTMLDivElement>>;
48
49
  export default Search;