@phillips/seldon 1.188.0 → 1.189.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.d.ts +4 -0
- package/dist/components/Carousel/Carousel.js +25 -23
- package/dist/components/Carousel/Carousel.stories.d.ts +15 -0
- package/dist/components/ComposedModal/ComposedModal.d.ts +2 -12
- package/dist/components/ComposedModal/ComposedModal.js +39 -41
- package/package.json +1 -1
|
@@ -35,6 +35,10 @@ export interface CarouselProps extends ComponentProps<'div'> {
|
|
|
35
35
|
* The threshold for slides to be considered in view. A value of 0.1 means that 10% of the slide must be in view for it to be considered in view.
|
|
36
36
|
*/
|
|
37
37
|
inViewThreshold?: number;
|
|
38
|
+
/**
|
|
39
|
+
* The number of slides to scroll at once.
|
|
40
|
+
*/
|
|
41
|
+
slidesToScroll?: number;
|
|
38
42
|
}
|
|
39
43
|
type CarouselContextProps = {
|
|
40
44
|
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { WheelGesturesPlugin as
|
|
8
|
-
const
|
|
2
|
+
import { createContext as g, forwardRef as I, useEffect as n, useCallback as f } from "react";
|
|
3
|
+
import { getCommonProps as y } from "../../utils/index.js";
|
|
4
|
+
import V from "../../node_modules/classnames/index.js";
|
|
5
|
+
import A from "../../node_modules/embla-carousel-class-names/esm/embla-carousel-class-names.esm.js";
|
|
6
|
+
import R from "../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js";
|
|
7
|
+
import { WheelGesturesPlugin as S } from "../../node_modules/embla-carousel-wheel-gestures/dist/embla-carousel-wheel-gestures.esm.js";
|
|
8
|
+
const E = g(null), K = I(
|
|
9
9
|
({
|
|
10
10
|
loop: m = !1,
|
|
11
11
|
startIndex: u = 0,
|
|
@@ -17,9 +17,10 @@ const S = P(null), E = g(
|
|
|
17
17
|
disableDrag: o = !1,
|
|
18
18
|
disableNavigationDrag: h = null,
|
|
19
19
|
inViewThreshold: N = 0.99,
|
|
20
|
+
slidesToScroll: k = 1,
|
|
20
21
|
...t
|
|
21
|
-
},
|
|
22
|
-
const { className:
|
|
22
|
+
}, v) => {
|
|
23
|
+
const { className: C, ...b } = y(t, "Carousel");
|
|
23
24
|
let s = {};
|
|
24
25
|
switch (h) {
|
|
25
26
|
case "mobile":
|
|
@@ -34,20 +35,21 @@ const S = P(null), E = g(
|
|
|
34
35
|
default:
|
|
35
36
|
s = {};
|
|
36
37
|
}
|
|
37
|
-
const [
|
|
38
|
+
const [D, e] = R(
|
|
38
39
|
{
|
|
39
40
|
loop: m,
|
|
40
41
|
startIndex: u,
|
|
41
42
|
inViewThreshold: N,
|
|
42
|
-
...s
|
|
43
|
+
...s,
|
|
44
|
+
slidesToScroll: k
|
|
43
45
|
},
|
|
44
46
|
[
|
|
45
47
|
...x ? [
|
|
46
|
-
|
|
48
|
+
S({
|
|
47
49
|
forceWheelAxis: "x"
|
|
48
50
|
})
|
|
49
51
|
] : [],
|
|
50
|
-
|
|
52
|
+
A({
|
|
51
53
|
snapped: "carousel-item-in-view"
|
|
52
54
|
})
|
|
53
55
|
]
|
|
@@ -59,7 +61,7 @@ const S = P(null), E = g(
|
|
|
59
61
|
watchDrag: () => !0
|
|
60
62
|
});
|
|
61
63
|
}, [o, e]);
|
|
62
|
-
const
|
|
64
|
+
const P = f(
|
|
63
65
|
(r) => {
|
|
64
66
|
r.key === "ArrowLeft" ? (r.preventDefault(), e?.scrollPrev()) : r.key === "ArrowRight" && (r.preventDefault(), e?.scrollNext());
|
|
65
67
|
},
|
|
@@ -79,10 +81,10 @@ const S = P(null), E = g(
|
|
|
79
81
|
e.off("slidesInView", l);
|
|
80
82
|
};
|
|
81
83
|
}, [e, l]), /* @__PURE__ */ c(
|
|
82
|
-
|
|
84
|
+
E.Provider,
|
|
83
85
|
{
|
|
84
86
|
value: {
|
|
85
|
-
carouselRef:
|
|
87
|
+
carouselRef: D,
|
|
86
88
|
api: e,
|
|
87
89
|
scrollPrev: () => e?.scrollPrev(),
|
|
88
90
|
scrollNext: () => e?.scrollNext(),
|
|
@@ -94,13 +96,13 @@ const S = P(null), E = g(
|
|
|
94
96
|
children: /* @__PURE__ */ c(
|
|
95
97
|
"div",
|
|
96
98
|
{
|
|
97
|
-
ref:
|
|
98
|
-
onKeyDownCapture:
|
|
99
|
-
className:
|
|
99
|
+
ref: v,
|
|
100
|
+
onKeyDownCapture: P,
|
|
101
|
+
className: V(C, p),
|
|
100
102
|
role: "region",
|
|
101
103
|
"aria-roledescription": "carousel",
|
|
102
104
|
...t,
|
|
103
|
-
...
|
|
105
|
+
...b,
|
|
104
106
|
children: d
|
|
105
107
|
}
|
|
106
108
|
)
|
|
@@ -108,8 +110,8 @@ const S = P(null), E = g(
|
|
|
108
110
|
);
|
|
109
111
|
}
|
|
110
112
|
);
|
|
111
|
-
|
|
113
|
+
K.displayName = "Carousel";
|
|
112
114
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
+
E as CarouselContext,
|
|
116
|
+
K as default
|
|
115
117
|
};
|
|
@@ -45,3 +45,18 @@ export declare const CarouselWithDotsOverflow: {
|
|
|
45
45
|
argTypes: {};
|
|
46
46
|
};
|
|
47
47
|
export declare const ControlledCarousel: (props: CarouselProps & CarouselDotsProps) => import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare const CarouselWithMultipleItems: {
|
|
49
|
+
(props: CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
args: {
|
|
51
|
+
disableNavigationDrag: "desktop";
|
|
52
|
+
slidesToScroll: number;
|
|
53
|
+
};
|
|
54
|
+
argTypes: {
|
|
55
|
+
slidesToScroll: {
|
|
56
|
+
control: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
defaultValue: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ModalProps } from '../Modal/Modal';
|
|
3
|
-
export interface ModalButtonProps {
|
|
4
|
-
/**
|
|
5
|
-
* Callback click function for button
|
|
6
|
-
*/
|
|
7
|
-
onClick?: () => void | unknown;
|
|
8
|
-
/**
|
|
9
|
-
* Button label text
|
|
10
|
-
*/
|
|
11
|
-
buttonLabel?: string;
|
|
12
|
-
}
|
|
13
3
|
export interface ComposedModalProps extends Omit<ModalProps, 'onClose' | 'role' | 'style'> {
|
|
14
4
|
/**
|
|
15
5
|
* Title for Composed Modal
|
|
@@ -30,11 +20,11 @@ export interface ComposedModalProps extends Omit<ModalProps, 'onClose' | 'role'
|
|
|
30
20
|
/**
|
|
31
21
|
* Left Button Props
|
|
32
22
|
*/
|
|
33
|
-
secondaryButton?:
|
|
23
|
+
secondaryButton?: React.ReactNode;
|
|
34
24
|
/**
|
|
35
25
|
* Right Button Props
|
|
36
26
|
*/
|
|
37
|
-
primaryButton?:
|
|
27
|
+
primaryButton?: React.ReactNode;
|
|
38
28
|
/**
|
|
39
29
|
* Footer content for bottom of Viewings Details
|
|
40
30
|
*/
|
|
@@ -1,67 +1,65 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as o, jsx as s, Fragment as $ } from "react/jsx-runtime";
|
|
2
2
|
import g from "../../node_modules/classnames/index.js";
|
|
3
3
|
import { forwardRef as x } from "react";
|
|
4
|
-
import { getCommonProps as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import p from "../Text/Text.js";
|
|
11
|
-
const u = x(
|
|
4
|
+
import { getCommonProps as b, noOp as C } from "../../utils/index.js";
|
|
5
|
+
import M from "../Divider/Divider.js";
|
|
6
|
+
import y from "../Modal/Modal.js";
|
|
7
|
+
import { TextVariants as t } from "../Text/types.js";
|
|
8
|
+
import c from "../Text/Text.js";
|
|
9
|
+
const j = x(
|
|
12
10
|
({
|
|
13
|
-
children:
|
|
14
|
-
className:
|
|
15
|
-
overlayClassName:
|
|
16
|
-
isOpen:
|
|
17
|
-
onClose:
|
|
11
|
+
children: p,
|
|
12
|
+
className: n,
|
|
13
|
+
overlayClassName: u,
|
|
14
|
+
isOpen: f = !1,
|
|
15
|
+
onClose: h = C,
|
|
18
16
|
maxHeightValue: N = "60vh",
|
|
19
|
-
title:
|
|
20
|
-
footerContent:
|
|
21
|
-
secondaryButton:
|
|
22
|
-
primaryButton:
|
|
23
|
-
id:
|
|
24
|
-
...
|
|
17
|
+
title: r,
|
|
18
|
+
footerContent: m,
|
|
19
|
+
secondaryButton: d,
|
|
20
|
+
primaryButton: i,
|
|
21
|
+
id: e,
|
|
22
|
+
...l
|
|
25
23
|
}, _) => {
|
|
26
24
|
const {
|
|
27
25
|
className: a,
|
|
28
26
|
"data-testid": P,
|
|
29
|
-
|
|
30
|
-
} =
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
27
|
+
...v
|
|
28
|
+
} = b({ id: e, ...l }, "ComposedModal");
|
|
29
|
+
return /* @__PURE__ */ o(
|
|
30
|
+
y,
|
|
33
31
|
{
|
|
34
|
-
isOpen:
|
|
35
|
-
onClose:
|
|
36
|
-
...
|
|
37
|
-
|
|
38
|
-
className: g(`${a}`,
|
|
39
|
-
id:
|
|
32
|
+
isOpen: f,
|
|
33
|
+
onClose: h,
|
|
34
|
+
...l,
|
|
35
|
+
...v,
|
|
36
|
+
className: g(`${a}`, n),
|
|
37
|
+
id: e,
|
|
40
38
|
ref: _,
|
|
41
39
|
children: [
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */
|
|
40
|
+
r ? /* @__PURE__ */ s(c, { variant: t.heading3, className: `${a}__title`, children: r }) : null,
|
|
41
|
+
/* @__PURE__ */ s(
|
|
44
42
|
"div",
|
|
45
43
|
{
|
|
46
44
|
className: `${a}__body`,
|
|
47
45
|
style: { "--max-modal-body-height": N },
|
|
48
|
-
children:
|
|
46
|
+
children: p
|
|
49
47
|
}
|
|
50
48
|
),
|
|
51
|
-
(
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
(d || i || m) && /* @__PURE__ */ o($, { children: [
|
|
50
|
+
/* @__PURE__ */ s(M, { className: `${a}__divider`, id: `${e}-divider` }),
|
|
51
|
+
/* @__PURE__ */ o("div", { className: `${a}__btns-group`, children: [
|
|
52
|
+
d,
|
|
53
|
+
i
|
|
56
54
|
] }),
|
|
57
|
-
|
|
55
|
+
m && /* @__PURE__ */ s(c, { variant: t.heading5, className: `${a}__disclaimer`, children: m })
|
|
58
56
|
] })
|
|
59
57
|
]
|
|
60
58
|
}
|
|
61
59
|
);
|
|
62
60
|
}
|
|
63
61
|
);
|
|
64
|
-
|
|
62
|
+
j.displayName = "ComposedModal";
|
|
65
63
|
export {
|
|
66
|
-
|
|
64
|
+
j as default
|
|
67
65
|
};
|