@phillips/seldon 1.89.1 → 1.91.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/Carousel/Carousel.js +49 -44
- package/dist/components/ContentPeek/ContentPeek.d.ts +9 -0
- package/dist/components/ContentPeek/ContentPeek.js +51 -45
- package/dist/components/ContentPeek/ContentPeek.stories.d.ts +3 -0
- package/dist/components/ContentPeek/utils.d.ts +4 -0
- package/dist/components/ContentPeek/utils.js +4 -0
- package/dist/components/Video/Video.d.ts +10 -3
- package/dist/components/Video/Video.js +28 -23
- package/dist/components/Video/Video.stories.d.ts +1 -1
- package/dist/node_modules/exenv/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,90 +1,95 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { WheelGesturesPlugin as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as h, forwardRef as k, useEffect as m, useCallback as i } from "react";
|
|
3
|
+
import { getCommonProps as A } from "../../utils/index.js";
|
|
4
|
+
import R from "../../node_modules/classnames/index.js";
|
|
5
|
+
import b from "../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js";
|
|
6
|
+
import { WheelGesturesPlugin as E } from "../../node_modules/embla-carousel-wheel-gestures/dist/embla-carousel-wheel-gestures.esm.js";
|
|
7
|
+
const K = h(null), W = k(
|
|
8
8
|
({
|
|
9
|
-
loop:
|
|
9
|
+
loop: w = !1,
|
|
10
10
|
startIndex: x = 0,
|
|
11
|
-
onSlideChange:
|
|
12
|
-
className:
|
|
13
|
-
children:
|
|
14
|
-
columnGap:
|
|
15
|
-
useWheelGestures:
|
|
16
|
-
disableDrag:
|
|
11
|
+
onSlideChange: s,
|
|
12
|
+
className: d,
|
|
13
|
+
children: N,
|
|
14
|
+
columnGap: P,
|
|
15
|
+
useWheelGestures: v = !1,
|
|
16
|
+
disableDrag: o = !1,
|
|
17
17
|
...t
|
|
18
|
-
},
|
|
18
|
+
}, I) => {
|
|
19
19
|
var c, f;
|
|
20
|
-
const { className:
|
|
20
|
+
const { className: y, ...C } = A(t, "Carousel"), [D, e] = b(
|
|
21
21
|
{
|
|
22
|
-
loop:
|
|
23
|
-
startIndex: x
|
|
22
|
+
loop: w,
|
|
23
|
+
startIndex: x,
|
|
24
|
+
inViewThreshold: 0.99
|
|
24
25
|
},
|
|
25
26
|
[
|
|
26
|
-
...
|
|
27
|
-
|
|
27
|
+
...v ? [
|
|
28
|
+
E({
|
|
28
29
|
forceWheelAxis: "x"
|
|
29
30
|
})
|
|
30
31
|
] : []
|
|
31
32
|
]
|
|
32
33
|
);
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
m(() => {
|
|
35
|
+
o ? e == null || e.reInit({
|
|
35
36
|
watchDrag: () => !1
|
|
36
37
|
}) : e == null || e.reInit({
|
|
37
38
|
watchDrag: () => !0
|
|
38
39
|
});
|
|
39
|
-
}, [
|
|
40
|
-
const
|
|
40
|
+
}, [o, e]);
|
|
41
|
+
const V = i(
|
|
41
42
|
(r) => {
|
|
42
43
|
r.key === "ArrowLeft" ? (r.preventDefault(), e == null || e.scrollPrev()) : r.key === "ArrowRight" && (r.preventDefault(), e == null || e.scrollNext());
|
|
43
44
|
},
|
|
44
45
|
[e]
|
|
45
|
-
), l =
|
|
46
|
+
), l = i(
|
|
46
47
|
(r) => {
|
|
47
|
-
|
|
48
|
+
var u;
|
|
49
|
+
if (!r)
|
|
50
|
+
return;
|
|
51
|
+
const n = (u = r.slidesInView()) == null ? void 0 : u[0];
|
|
52
|
+
n !== void 0 && (s == null || s(n));
|
|
48
53
|
},
|
|
49
|
-
[
|
|
54
|
+
[s]
|
|
50
55
|
);
|
|
51
|
-
return
|
|
56
|
+
return m(() => {
|
|
52
57
|
if (e)
|
|
53
|
-
return
|
|
54
|
-
e
|
|
58
|
+
return e.on("slidesInView", l), () => {
|
|
59
|
+
e.off("slidesInView", l);
|
|
55
60
|
};
|
|
56
|
-
}, [e, l]), /* @__PURE__ */
|
|
57
|
-
|
|
61
|
+
}, [e, l]), /* @__PURE__ */ a(
|
|
62
|
+
K.Provider,
|
|
58
63
|
{
|
|
59
64
|
value: {
|
|
60
|
-
carouselRef:
|
|
65
|
+
carouselRef: D,
|
|
61
66
|
api: e,
|
|
62
67
|
scrollPrev: () => e == null ? void 0 : e.scrollPrev(),
|
|
63
68
|
scrollNext: () => e == null ? void 0 : e.scrollNext(),
|
|
64
69
|
canScrollPrev: (c = e == null ? void 0 : e.canScrollPrev()) != null ? c : !1,
|
|
65
70
|
canScrollNext: (f = e == null ? void 0 : e.canScrollNext()) != null ? f : !1,
|
|
66
|
-
columnGap:
|
|
67
|
-
onSlideChange:
|
|
71
|
+
columnGap: P,
|
|
72
|
+
onSlideChange: s
|
|
68
73
|
},
|
|
69
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ a(
|
|
70
75
|
"div",
|
|
71
76
|
{
|
|
72
|
-
ref:
|
|
73
|
-
onKeyDownCapture:
|
|
74
|
-
className:
|
|
77
|
+
ref: I,
|
|
78
|
+
onKeyDownCapture: V,
|
|
79
|
+
className: R(y, d),
|
|
75
80
|
role: "region",
|
|
76
81
|
"aria-roledescription": "carousel",
|
|
77
82
|
...t,
|
|
78
|
-
...
|
|
79
|
-
children:
|
|
83
|
+
...C,
|
|
84
|
+
children: N
|
|
80
85
|
}
|
|
81
86
|
)
|
|
82
87
|
}
|
|
83
88
|
);
|
|
84
89
|
}
|
|
85
90
|
);
|
|
86
|
-
|
|
91
|
+
W.displayName = "Carousel";
|
|
87
92
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
K as CarouselContext,
|
|
94
|
+
W as default
|
|
90
95
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { HeightUnits } from './utils';
|
|
2
3
|
export interface ContentPeekProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
/**
|
|
4
5
|
* Unique id for component testing
|
|
@@ -20,6 +21,14 @@ export interface ContentPeekProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
20
21
|
* Maximum height of the content when collapsed
|
|
21
22
|
*/
|
|
22
23
|
maxHeight?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Used to set a minimum height for the content before enabling the Peek functionality. Defaults to the same value as maxHeight if not provided.
|
|
26
|
+
*/
|
|
27
|
+
minHeightThreshold?: number;
|
|
28
|
+
/**
|
|
29
|
+
* The unit used for setting height values. Defaults to 'px'.
|
|
30
|
+
*/
|
|
31
|
+
heightUnits?: HeightUnits;
|
|
23
32
|
}
|
|
24
33
|
/**
|
|
25
34
|
* ## Overview
|
|
@@ -1,55 +1,61 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { getCommonProps as
|
|
5
|
-
import
|
|
6
|
-
import { ButtonVariants as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
1
|
+
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as P, useState as i, useRef as b, useEffect as k, useCallback as R } from "react";
|
|
3
|
+
import d from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { getCommonProps as w } from "../../utils/index.js";
|
|
5
|
+
import E from "../Button/Button.js";
|
|
6
|
+
import { ButtonVariants as M } from "../Button/types.js";
|
|
7
|
+
import O from "../Collapsible/Collapsible.js";
|
|
8
|
+
import S from "../Collapsible/CollapsibleContent.js";
|
|
9
|
+
import j from "../Collapsible/CollapsibleTrigger.js";
|
|
10
|
+
import B from "../../assets/plus.svg.js";
|
|
11
|
+
import I from "../../assets/minus.svg.js";
|
|
12
|
+
import { HeightUnits as L } from "./utils.js";
|
|
13
|
+
const U = P(
|
|
13
14
|
({
|
|
14
|
-
className:
|
|
15
|
-
children:
|
|
16
|
-
contentExpandText:
|
|
17
|
-
contentCollapseText:
|
|
18
|
-
maxHeight:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
className: p,
|
|
16
|
+
children: m,
|
|
17
|
+
contentExpandText: u = "Read More",
|
|
18
|
+
contentCollapseText: v = "Read Less",
|
|
19
|
+
maxHeight: s = 480,
|
|
20
|
+
minHeightThreshold: a,
|
|
21
|
+
heightUnits: C = L.px,
|
|
22
|
+
...t
|
|
23
|
+
}, g) => {
|
|
24
|
+
const { className: e, ...y } = w(t, "ContentPeek"), [r, N] = i(!1), [c, $] = i(!1), n = b(null);
|
|
25
|
+
k(() => {
|
|
26
|
+
if (n.current) {
|
|
27
|
+
const l = a != null ? a : s;
|
|
28
|
+
$(n.current.scrollHeight > l);
|
|
29
|
+
}
|
|
30
|
+
}, [m, s, a]);
|
|
31
|
+
const x = R(() => {
|
|
32
|
+
N((l) => !l);
|
|
27
33
|
}, []);
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
34
|
+
return /* @__PURE__ */ f(
|
|
35
|
+
O,
|
|
30
36
|
{
|
|
31
|
-
id:
|
|
32
|
-
open:
|
|
33
|
-
onOpenChange:
|
|
34
|
-
className:
|
|
37
|
+
id: t == null ? void 0 : t.id,
|
|
38
|
+
open: r,
|
|
39
|
+
onOpenChange: x,
|
|
40
|
+
className: d(e, p),
|
|
35
41
|
style: {
|
|
36
|
-
"--content-peek-max-height": `${
|
|
42
|
+
"--content-peek-max-height": `${s}${C}`
|
|
37
43
|
},
|
|
38
|
-
ref:
|
|
39
|
-
...
|
|
40
|
-
...
|
|
44
|
+
ref: g,
|
|
45
|
+
...y,
|
|
46
|
+
...t,
|
|
41
47
|
children: [
|
|
42
|
-
/* @__PURE__ */ o(
|
|
43
|
-
|
|
48
|
+
/* @__PURE__ */ o(S, { className: `${e}-content`, ref: n, forceMount: !0, children: m }),
|
|
49
|
+
c ? /* @__PURE__ */ o(
|
|
44
50
|
"div",
|
|
45
51
|
{
|
|
46
|
-
className:
|
|
47
|
-
[`${e}-overlay--expanded`]:
|
|
48
|
-
[`${e}-overlay--gradient`]:
|
|
52
|
+
className: d(`${e}-overlay`, {
|
|
53
|
+
[`${e}-overlay--expanded`]: r,
|
|
54
|
+
[`${e}-overlay--gradient`]: c && !r
|
|
49
55
|
}),
|
|
50
|
-
children: /* @__PURE__ */ o("div", { className: `${e}-overlay-trigger-wrapper`, children: /* @__PURE__ */ o(
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
children: /* @__PURE__ */ o("div", { className: `${e}-overlay-trigger-wrapper`, children: /* @__PURE__ */ o(j, { asChild: !0, className: `${e}-overlay-trigger`, children: /* @__PURE__ */ f(E, { variant: M.secondary, children: [
|
|
57
|
+
r ? /* @__PURE__ */ o(I, {}) : /* @__PURE__ */ o(B, {}),
|
|
58
|
+
r ? v : u
|
|
53
59
|
] }) }) })
|
|
54
60
|
}
|
|
55
61
|
) : null
|
|
@@ -58,7 +64,7 @@ const j = N(
|
|
|
58
64
|
);
|
|
59
65
|
}
|
|
60
66
|
);
|
|
61
|
-
|
|
67
|
+
U.displayName = "ContentPeek";
|
|
62
68
|
export {
|
|
63
|
-
|
|
69
|
+
U as default
|
|
64
70
|
};
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
1
|
+
import { default as React, ComponentProps } from 'react';
|
|
2
2
|
export interface VideoProps extends ComponentProps<'div'> {
|
|
3
3
|
/**
|
|
4
4
|
* Aspect ratio of the video
|
|
5
|
-
* Defaults to 1.777 (16/9)
|
|
6
5
|
*/
|
|
7
6
|
aspectRatio?: number;
|
|
8
7
|
/**
|
|
9
8
|
* The url of the video source
|
|
10
9
|
*/
|
|
11
10
|
videoSource: string;
|
|
11
|
+
/**
|
|
12
|
+
* The ref to the iframe
|
|
13
|
+
*/
|
|
14
|
+
iframeRef?: React.Ref<HTMLIFrameElement>;
|
|
15
|
+
/**
|
|
16
|
+
* The class name for the iframe
|
|
17
|
+
*/
|
|
18
|
+
iframeClassName?: string;
|
|
12
19
|
}
|
|
13
20
|
/**
|
|
14
21
|
* ## Overview
|
|
@@ -19,5 +26,5 @@ export interface VideoProps extends ComponentProps<'div'> {
|
|
|
19
26
|
*
|
|
20
27
|
* [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-video--overview)
|
|
21
28
|
*/
|
|
22
|
-
declare const Video:
|
|
29
|
+
declare const Video: React.ForwardRefExoticComponent<Omit<VideoProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
30
|
export default Video;
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"data-testid":
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import { getCommonProps as N } from "../../utils/index.js";
|
|
4
|
+
import t from "../../node_modules/classnames/index.js";
|
|
5
|
+
const u = p(
|
|
6
|
+
({ aspectRatio: s, className: m, videoSource: i, iframeRef: d, iframeClassName: l, ...e }, c) => {
|
|
7
|
+
const { className: r, "data-testid": a, ...f } = N(e, "Video"), n = {
|
|
8
|
+
className: t(r, m),
|
|
9
|
+
"data-testid": a,
|
|
10
|
+
style: { "--aspect-ratio": s },
|
|
11
|
+
...f,
|
|
12
|
+
...e
|
|
13
|
+
};
|
|
14
|
+
return /* @__PURE__ */ o("div", { ...n, ref: c, children: /* @__PURE__ */ o(
|
|
15
|
+
"iframe",
|
|
16
|
+
{
|
|
17
|
+
ref: d,
|
|
18
|
+
"data-testid": `${a}-iframe`,
|
|
19
|
+
className: t(`${r}__iframe`, l),
|
|
20
|
+
src: i,
|
|
21
|
+
allowFullScreen: !0,
|
|
22
|
+
allow: "encrypted-media",
|
|
23
|
+
referrerPolicy: "no-referrer"
|
|
24
|
+
}
|
|
25
|
+
) });
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
u.displayName = "Video";
|
|
24
29
|
export {
|
|
25
30
|
u as default
|
|
26
31
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VideoProps } from './Video';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: (
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<Omit<VideoProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
5
|
};
|
|
6
6
|
export default meta;
|
|
7
7
|
export declare const Playground: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as e } from "../../../../_virtual/
|
|
1
|
+
import { __module as e } from "../../../../_virtual/index6.js";
|
|
2
2
|
import { __require as o } from "./cjs/react-is.production.min.js";
|
|
3
3
|
import { __require as t } from "./cjs/react-is.development.js";
|
|
4
4
|
var r;
|