@soul-refiner/design-system 1.0.1 → 1.0.2
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/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/media/common.d.ts +6 -0
- package/dist/components/media/common.js +1 -0
- package/dist/components/media/index.d.ts +4 -2
- package/dist/components/media/index.js +2 -1
- package/dist/components/media/video/index.d.ts +2 -2
- package/dist/components/media/video/index.js +1 -1
- package/dist/components/media/video/video.d.ts +9 -60
- package/dist/components/media/video/video.js +27 -161
- package/dist/components/media/video-player/index.d.ts +2 -0
- package/dist/components/media/video-player/index.js +1 -0
- package/dist/components/media/video-player/video.d.ts +59 -0
- package/dist/components/media/video-player/video.js +165 -0
- package/package.json +1 -1
- /package/dist/components/media/{video → video-player}/playlist-item.d.ts +0 -0
- /package/dist/components/media/{video → video-player}/playlist-item.js +0 -0
|
@@ -5,7 +5,7 @@ export * from './editor';
|
|
|
5
5
|
export * from './feedback';
|
|
6
6
|
export * from './iconography';
|
|
7
7
|
export * from './input';
|
|
8
|
-
export * from './media/video';
|
|
8
|
+
export * from './media/video-player';
|
|
9
9
|
export * from './navigation';
|
|
10
10
|
export * from './surfaces';
|
|
11
11
|
export * from './table';
|
package/dist/components/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export * from './editor';
|
|
|
5
5
|
export * from './feedback';
|
|
6
6
|
export * from './iconography';
|
|
7
7
|
export * from './input';
|
|
8
|
-
export * from './media/video';
|
|
8
|
+
export * from './media/video-player';
|
|
9
9
|
export * from './navigation';
|
|
10
10
|
export * from './surfaces';
|
|
11
11
|
export * from './table';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { Video } from './video';
|
|
2
|
+
export type { VideoProps } from './video';
|
|
3
|
+
export { VideoPlayer } from './video-player';
|
|
4
|
+
export type { VideoPlayerProps } from './video-player';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Video } from './video';
|
|
2
|
+
export { VideoPlayer } from './video-player';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { Video } from './video';
|
|
2
|
+
export type { VideoProps } from './video';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Video } from './video';
|
|
@@ -1,64 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { Subtitle } from '../common';
|
|
3
|
+
export interface VideoProps {
|
|
4
|
+
controls?: boolean;
|
|
5
|
+
loop?: boolean;
|
|
6
|
+
muted?: boolean;
|
|
7
|
+
playsInline?: boolean;
|
|
6
8
|
src: string;
|
|
7
|
-
subtitles
|
|
8
|
-
|
|
9
|
+
subtitles?: Subtitle[];
|
|
10
|
+
style?: React.CSSProperties;
|
|
9
11
|
thumbnail: string;
|
|
10
|
-
title: string;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
id: string;
|
|
14
|
-
label: string;
|
|
15
|
-
locale: string;
|
|
16
|
-
src: string;
|
|
17
|
-
}
|
|
18
|
-
export interface VideoPlayerProps {
|
|
19
|
-
/**
|
|
20
|
-
* @param activeIndex the media item from the playlist currently playing
|
|
21
|
-
*/
|
|
22
|
-
activeIndex: number;
|
|
23
|
-
/**
|
|
24
|
-
* @param orientation the orientation of the player
|
|
25
|
-
*/
|
|
26
|
-
orientation: 'horizontal' | 'vertical';
|
|
27
|
-
/**
|
|
28
|
-
* @param onPipChange when the pip changes
|
|
29
|
-
*/
|
|
30
|
-
onPipChange?: (pip: boolean) => void;
|
|
31
|
-
/**
|
|
32
|
-
* @param onProgress the handler as the video progresses
|
|
33
|
-
*/
|
|
34
|
-
onProgress: (progress: {
|
|
35
|
-
playedSeconds: number;
|
|
36
|
-
loadedSeconds: number;
|
|
37
|
-
}) => void;
|
|
38
|
-
/**
|
|
39
|
-
* @param pip picture in picture is enabled
|
|
40
|
-
*/
|
|
41
|
-
pip?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* @param playlist the media items in the player
|
|
44
|
-
*/
|
|
45
|
-
playlist: MediaItem[];
|
|
46
|
-
/**
|
|
47
|
-
* @param subtitle the video player's subtitle
|
|
48
|
-
*/
|
|
49
|
-
subtitle: string;
|
|
50
|
-
/**
|
|
51
|
-
* @param title the video player's title
|
|
52
|
-
*/
|
|
53
|
-
title: string;
|
|
54
|
-
/**
|
|
55
|
-
* @param setMediaItem sets the index of the item to be played
|
|
56
|
-
*/
|
|
57
|
-
setMediaItem: (index: number) => void;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* ReactPlayer props reference -> https://www.npmjs.com/package/react-player#props
|
|
61
|
-
* HLS Option props reference -> https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning
|
|
62
|
-
*/
|
|
63
|
-
export declare const VideoPlayer: ({ activeIndex, pip, playlist, onPipChange, onProgress, orientation, setMediaItem, subtitle, title, }: VideoPlayerProps) => React.JSX.Element | null;
|
|
64
|
-
export {};
|
|
13
|
+
export declare const Video: ({ controls, loop, playsInline, src, subtitles, style, thumbnail, }: VideoProps) => React.JSX.Element;
|
|
@@ -1,165 +1,31 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import Image from 'next/image';
|
|
4
2
|
import ReactPlayer from 'react-player';
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import { H, P } from '../../atoms/typography';
|
|
8
|
-
import { Button } from '../../actions/button';
|
|
9
|
-
import { PlaylistItem } from './playlist-item';
|
|
10
|
-
/**
|
|
11
|
-
* ReactPlayer props reference -> https://www.npmjs.com/package/react-player#props
|
|
12
|
-
* HLS Option props reference -> https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning
|
|
13
|
-
*/
|
|
14
|
-
export const VideoPlayer = ({ activeIndex, pip, playlist, onPipChange, onProgress, orientation, setMediaItem, subtitle, title, }) => {
|
|
15
|
-
const [showingAll, setShowingAll] = React.useState(false);
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
export const Video = ({ controls = true, loop = false, playsInline, src, subtitles, style, thumbnail, }) => {
|
|
16
5
|
const ref = React.useRef(null);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
kind: 'subtitles',
|
|
43
|
-
label: subtitle.label,
|
|
44
|
-
src: subtitle.src,
|
|
45
|
-
srcLang: subtitle.locale,
|
|
46
|
-
})),
|
|
47
|
-
},
|
|
48
|
-
}, controls: true, height: "100%", light: React.createElement(Image, { alt: `thumbnail for ${title}`, layout: "fill", objectFit: "contain", priority: true, src: mediaItem.thumbnail }), onDisablePIP: () => onPipChange && onPipChange(false), onEnablePIP: () => onPipChange && onPipChange(true), onProgress: onProgress, onReady: handleReady, pip: pip, playing: true, ref: ref, style: {
|
|
49
|
-
backgroundColor: 'var(--color-grey-0)',
|
|
50
|
-
maxHeight: 720,
|
|
51
|
-
maxWidth: 1280,
|
|
52
|
-
minHeight: 480,
|
|
53
|
-
overflow: 'hidden',
|
|
54
|
-
position: 'relative',
|
|
55
|
-
}, url: mediaItem.src, width: "100%" }),
|
|
56
|
-
orientation === 'horizontal' && (React.createElement(Side, null,
|
|
57
|
-
React.createElement(Box, { "$dir": "column", "$gap": 4 },
|
|
58
|
-
React.createElement(H, { as: "h2", "$bold": true, "$color": "white", "$fontSize": 28, "$lineHeight": 36 }, title),
|
|
59
|
-
React.createElement(P, { as: "h3", "$bold": true, "$color": "grey-8" }, subtitle)),
|
|
60
|
-
React.createElement(Box, { "$align": "center", "$justify": "space-between", sx: "padding: 8px 0px 8px 14px;" },
|
|
61
|
-
React.createElement(P, { "$color": "grey-8", "$fontSize": 14, "$lineHeight": 20, "$semiBold": true }, "All lessons")),
|
|
62
|
-
React.createElement(HorizontalPlaylistWrapper, null, playlist.map((playlistItem, index) => (React.createElement(PlaylistItem, { key: playlistItem.id, duration: playlistItem.duration, onClick: () => setMediaItem(index), progress: playlistItem.progress, shortDescription: playlistItem.shortDescription, thumbnail: playlistItem.thumbnail, title: playlistItem.title })))))),
|
|
63
|
-
orientation === 'vertical' && (React.createElement(Box, { "$dir": "column", "$gap": 24 },
|
|
64
|
-
React.createElement(Box, { "$align": "center", "$justify": "space-between", sx: "padding: 8px 0px; margin: 0px 24px; border-bottom: 1px solid var(--color-grey-3);" },
|
|
65
|
-
React.createElement(P, { "$color": "grey-8", "$fontSize": 14, "$lineHeight": 20, "$semiBold": true }, "All lessons"),
|
|
66
|
-
React.createElement(Button, { onClick: toggleShowingAll, size: "small", sx: "background-color: var(--color-grey-2); border-color: var(--color-grey-8); color: var(--color-grey-8);", type: "text" }, showingAll ? 'Collapse' : 'View all')),
|
|
67
|
-
React.createElement(VerticalPlaylistWrapper, { "$showingAll": showingAll }, playlist.map((playlistItem, index) => (React.createElement(PlaylistItem, { key: playlistItem.id, duration: playlistItem.duration, onClick: () => setMediaItem(index), progress: playlistItem.progress, shortDescription: playlistItem.shortDescription, thumbnail: playlistItem.thumbnail, title: playlistItem.title })))))))));
|
|
6
|
+
return (React.createElement(ReactPlayer, { config: {
|
|
7
|
+
file: {
|
|
8
|
+
attributes: {
|
|
9
|
+
crossOrigin: 'true',
|
|
10
|
+
},
|
|
11
|
+
forceHLS: true,
|
|
12
|
+
hlsOptions: {
|
|
13
|
+
autoStartLoad: true,
|
|
14
|
+
},
|
|
15
|
+
tracks: subtitles?.map((subtitle) => ({
|
|
16
|
+
kind: 'subtitles',
|
|
17
|
+
label: subtitle.label,
|
|
18
|
+
src: subtitle.src,
|
|
19
|
+
srcLang: subtitle.locale,
|
|
20
|
+
})),
|
|
21
|
+
},
|
|
22
|
+
}, controls: controls, height: "100%", light: thumbnail ? (React.createElement(Image, { alt: "thumbnail for trailer", layout: "fill", objectFit: "contain", priority: true, src: thumbnail })) : undefined, loop: loop, pip: false, playsinline: playsInline, playing: true, ref: ref, style: {
|
|
23
|
+
backgroundColor: 'var(--color-grey-0)',
|
|
24
|
+
maxHeight: 720,
|
|
25
|
+
maxWidth: 1280,
|
|
26
|
+
minHeight: 480,
|
|
27
|
+
overflow: 'hidden',
|
|
28
|
+
position: 'relative',
|
|
29
|
+
...(style || {}),
|
|
30
|
+
}, url: src, width: "100%" }));
|
|
68
31
|
};
|
|
69
|
-
const Wrapper = styled.div `
|
|
70
|
-
display: flex;
|
|
71
|
-
justify-content: center;
|
|
72
|
-
background-color: var(--color-grey-0);
|
|
73
|
-
|
|
74
|
-
img {
|
|
75
|
-
object-fit: cover !important;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
${({ $orientation }) => $orientation === 'vertical' ? 'max-width: 960px; height: max-content;' : ''}
|
|
79
|
-
`;
|
|
80
|
-
const InnerWrapper = styled.div `
|
|
81
|
-
max-width: 2284px;
|
|
82
|
-
flex: 1;
|
|
83
|
-
display: flex;
|
|
84
|
-
justify-content: flex-end;
|
|
85
|
-
${({ $orientation }) => $orientation === 'vertical'
|
|
86
|
-
? `
|
|
87
|
-
flex-direction: column;
|
|
88
|
-
gap: 24px;
|
|
89
|
-
justify-content: flex-start;`
|
|
90
|
-
: `
|
|
91
|
-
& > div:first-of-type {
|
|
92
|
-
flex: 5;
|
|
93
|
-
aspect-ratio: 1280 / 720;
|
|
94
|
-
}
|
|
95
|
-
& > div:last-of-type {
|
|
96
|
-
flex: 3;
|
|
97
|
-
}`}
|
|
98
|
-
`;
|
|
99
|
-
const Side = styled.div `
|
|
100
|
-
position: relative;
|
|
101
|
-
box-sizing: border-box;
|
|
102
|
-
display: flex;
|
|
103
|
-
flex-direction: column;
|
|
104
|
-
padding: 24px;
|
|
105
|
-
gap: 24px;
|
|
106
|
-
`;
|
|
107
|
-
const HorizontalPlaylistWrapper = styled.div `
|
|
108
|
-
display: flex;
|
|
109
|
-
flex-direction: column;
|
|
110
|
-
gap: 24px;
|
|
111
|
-
max-height: 548px;
|
|
112
|
-
overflow-y: auto;
|
|
113
|
-
overflow-x: hidden;
|
|
114
|
-
padding-right: 24px;
|
|
115
|
-
|
|
116
|
-
&::-webkit-scrollbar-track {
|
|
117
|
-
box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
118
|
-
-webkit-box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
119
|
-
border-radius: 4px;
|
|
120
|
-
background-color: var(--color-grey-2);
|
|
121
|
-
margin: 40px 0px 15px 0px;
|
|
122
|
-
}
|
|
123
|
-
&::-webkit-scrollbar {
|
|
124
|
-
width: 8px;
|
|
125
|
-
border-radius: 4px;
|
|
126
|
-
}
|
|
127
|
-
&::-webkit-scrollbar-thumb {
|
|
128
|
-
border-radius: 4px;
|
|
129
|
-
background-color: var(--color-grey-6);
|
|
130
|
-
opacity: 30%;
|
|
131
|
-
}
|
|
132
|
-
`;
|
|
133
|
-
const VerticalPlaylistWrapper = styled.div `
|
|
134
|
-
display: flex;
|
|
135
|
-
flex-direction: column;
|
|
136
|
-
gap: 24px;
|
|
137
|
-
padding: 0px 12px 48px 24px;
|
|
138
|
-
margin-right: 24px;
|
|
139
|
-
max-height: 350px;
|
|
140
|
-
overflow-y: scroll;
|
|
141
|
-
overflow-x: hidden;
|
|
142
|
-
|
|
143
|
-
&::-webkit-scrollbar-track {
|
|
144
|
-
box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
145
|
-
-webkit-box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
146
|
-
border-radius: 4px;
|
|
147
|
-
background-color: var(--color-grey-2);
|
|
148
|
-
margin: 40px 0px 15px 0px;
|
|
149
|
-
}
|
|
150
|
-
&::-webkit-scrollbar {
|
|
151
|
-
width: 8px;
|
|
152
|
-
border-radius: 4px;
|
|
153
|
-
}
|
|
154
|
-
&::-webkit-scrollbar-thumb {
|
|
155
|
-
border-radius: 4px;
|
|
156
|
-
background-color: var(--color-grey-6);
|
|
157
|
-
opacity: 30%;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
${({ $showingAll }) => $showingAll
|
|
161
|
-
? `
|
|
162
|
-
max-height: unset;
|
|
163
|
-
overflow-y: visible;`
|
|
164
|
-
: ''}
|
|
165
|
-
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { VideoPlayer } from './video';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Subtitle } from '../common';
|
|
3
|
+
interface MediaItem {
|
|
4
|
+
id: string;
|
|
5
|
+
duration: number;
|
|
6
|
+
progress?: number;
|
|
7
|
+
src: string;
|
|
8
|
+
subtitles: Subtitle[];
|
|
9
|
+
shortDescription: string;
|
|
10
|
+
thumbnail: string;
|
|
11
|
+
title: string;
|
|
12
|
+
}
|
|
13
|
+
export interface VideoPlayerProps {
|
|
14
|
+
/**
|
|
15
|
+
* @param activeIndex the media item from the playlist currently playing
|
|
16
|
+
*/
|
|
17
|
+
activeIndex: number;
|
|
18
|
+
/**
|
|
19
|
+
* @param orientation the orientation of the player
|
|
20
|
+
*/
|
|
21
|
+
orientation: 'horizontal' | 'vertical';
|
|
22
|
+
/**
|
|
23
|
+
* @param onPipChange when the pip changes
|
|
24
|
+
*/
|
|
25
|
+
onPipChange?: (pip: boolean) => void;
|
|
26
|
+
/**
|
|
27
|
+
* @param onProgress the handler as the video progresses
|
|
28
|
+
*/
|
|
29
|
+
onProgress: (progress: {
|
|
30
|
+
playedSeconds: number;
|
|
31
|
+
loadedSeconds: number;
|
|
32
|
+
}) => void;
|
|
33
|
+
/**
|
|
34
|
+
* @param pip picture in picture is enabled
|
|
35
|
+
*/
|
|
36
|
+
pip?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @param playlist the media items in the player
|
|
39
|
+
*/
|
|
40
|
+
playlist: MediaItem[];
|
|
41
|
+
/**
|
|
42
|
+
* @param subtitle the video player's subtitle
|
|
43
|
+
*/
|
|
44
|
+
subtitle: string;
|
|
45
|
+
/**
|
|
46
|
+
* @param title the video player's title
|
|
47
|
+
*/
|
|
48
|
+
title: string;
|
|
49
|
+
/**
|
|
50
|
+
* @param setMediaItem sets the index of the item to be played
|
|
51
|
+
*/
|
|
52
|
+
setMediaItem: (index: number) => void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* ReactPlayer props reference -> https://www.npmjs.com/package/react-player#props
|
|
56
|
+
* HLS Option props reference -> https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning
|
|
57
|
+
*/
|
|
58
|
+
export declare const VideoPlayer: ({ activeIndex, pip, playlist, onPipChange, onProgress, orientation, setMediaItem, subtitle, title, }: VideoPlayerProps) => React.JSX.Element | null;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import ReactPlayer from 'react-player';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import { Box } from '../../atoms/box';
|
|
7
|
+
import { H, P } from '../../atoms/typography';
|
|
8
|
+
import { Button } from '../../actions/button';
|
|
9
|
+
import { PlaylistItem } from './playlist-item';
|
|
10
|
+
/**
|
|
11
|
+
* ReactPlayer props reference -> https://www.npmjs.com/package/react-player#props
|
|
12
|
+
* HLS Option props reference -> https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning
|
|
13
|
+
*/
|
|
14
|
+
export const VideoPlayer = ({ activeIndex, pip, playlist, onPipChange, onProgress, orientation, setMediaItem, subtitle, title, }) => {
|
|
15
|
+
const [showingAll, setShowingAll] = React.useState(false);
|
|
16
|
+
const ref = React.useRef(null);
|
|
17
|
+
const mediaItem = playlist?.[activeIndex];
|
|
18
|
+
const handleReady = () => {
|
|
19
|
+
const currTime = ref?.current?.getCurrentTime();
|
|
20
|
+
if (currTime === 0 && mediaItem?.progress !== 0) {
|
|
21
|
+
ref.current.seekTo(mediaItem.progress);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const toggleShowingAll = () => setShowingAll((prev) => !prev);
|
|
25
|
+
if (!mediaItem)
|
|
26
|
+
return null;
|
|
27
|
+
return (React.createElement(Wrapper, { "$orientation": orientation },
|
|
28
|
+
React.createElement(InnerWrapper, { "$orientation": orientation },
|
|
29
|
+
orientation === 'vertical' && (React.createElement(Box, { "$dir": "column", "$gap": 4, sx: "margin: 24px;" },
|
|
30
|
+
React.createElement(H, { as: "h2", "$bold": true, "$color": "white", "$fontSize": 28, "$lineHeight": 36 }, title),
|
|
31
|
+
React.createElement(P, { as: "h3", "$bold": true, "$color": "grey-8" }, subtitle))),
|
|
32
|
+
React.createElement(ReactPlayer, { config: {
|
|
33
|
+
file: {
|
|
34
|
+
attributes: {
|
|
35
|
+
crossOrigin: 'true',
|
|
36
|
+
},
|
|
37
|
+
forceHLS: true,
|
|
38
|
+
hlsOptions: {
|
|
39
|
+
autoStartLoad: true,
|
|
40
|
+
},
|
|
41
|
+
tracks: mediaItem.subtitles.map((subtitle) => ({
|
|
42
|
+
kind: 'subtitles',
|
|
43
|
+
label: subtitle.label,
|
|
44
|
+
src: subtitle.src,
|
|
45
|
+
srcLang: subtitle.locale,
|
|
46
|
+
})),
|
|
47
|
+
},
|
|
48
|
+
}, controls: true, height: "100%", light: React.createElement(Image, { alt: `thumbnail for ${title}`, layout: "fill", objectFit: "contain", priority: true, src: mediaItem.thumbnail }), onDisablePIP: () => onPipChange && onPipChange(false), onEnablePIP: () => onPipChange && onPipChange(true), onProgress: onProgress, onReady: handleReady, pip: pip, playing: true, ref: ref, style: {
|
|
49
|
+
backgroundColor: 'var(--color-grey-0)',
|
|
50
|
+
maxHeight: 720,
|
|
51
|
+
maxWidth: 1280,
|
|
52
|
+
minHeight: 480,
|
|
53
|
+
overflow: 'hidden',
|
|
54
|
+
position: 'relative',
|
|
55
|
+
}, url: mediaItem.src, width: "100%" }),
|
|
56
|
+
orientation === 'horizontal' && (React.createElement(Side, null,
|
|
57
|
+
React.createElement(Box, { "$dir": "column", "$gap": 4 },
|
|
58
|
+
React.createElement(H, { as: "h2", "$bold": true, "$color": "white", "$fontSize": 28, "$lineHeight": 36 }, title),
|
|
59
|
+
React.createElement(P, { as: "h3", "$bold": true, "$color": "grey-8" }, subtitle)),
|
|
60
|
+
React.createElement(Box, { "$align": "center", "$justify": "space-between", sx: "padding: 8px 0px 8px 14px;" },
|
|
61
|
+
React.createElement(P, { "$color": "grey-8", "$fontSize": 14, "$lineHeight": 20, "$semiBold": true }, "All lessons")),
|
|
62
|
+
React.createElement(HorizontalPlaylistWrapper, null, playlist.map((playlistItem, index) => (React.createElement(PlaylistItem, { key: playlistItem.id, duration: playlistItem.duration, onClick: () => setMediaItem(index), progress: playlistItem.progress, shortDescription: playlistItem.shortDescription, thumbnail: playlistItem.thumbnail, title: playlistItem.title })))))),
|
|
63
|
+
orientation === 'vertical' && (React.createElement(Box, { "$dir": "column", "$gap": 24 },
|
|
64
|
+
React.createElement(Box, { "$align": "center", "$justify": "space-between", sx: "padding: 8px 0px; margin: 0px 24px; border-bottom: 1px solid var(--color-grey-3);" },
|
|
65
|
+
React.createElement(P, { "$color": "grey-8", "$fontSize": 14, "$lineHeight": 20, "$semiBold": true }, "All lessons"),
|
|
66
|
+
React.createElement(Button, { onClick: toggleShowingAll, size: "small", sx: "background-color: var(--color-grey-2); border-color: var(--color-grey-8); color: var(--color-grey-8);", type: "text" }, showingAll ? 'Collapse' : 'View all')),
|
|
67
|
+
React.createElement(VerticalPlaylistWrapper, { "$showingAll": showingAll }, playlist.map((playlistItem, index) => (React.createElement(PlaylistItem, { key: playlistItem.id, duration: playlistItem.duration, onClick: () => setMediaItem(index), progress: playlistItem.progress, shortDescription: playlistItem.shortDescription, thumbnail: playlistItem.thumbnail, title: playlistItem.title })))))))));
|
|
68
|
+
};
|
|
69
|
+
const Wrapper = styled.div `
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
background-color: var(--color-grey-0);
|
|
73
|
+
|
|
74
|
+
img {
|
|
75
|
+
object-fit: cover !important;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
${({ $orientation }) => $orientation === 'vertical' ? 'max-width: 960px; height: max-content;' : ''}
|
|
79
|
+
`;
|
|
80
|
+
const InnerWrapper = styled.div `
|
|
81
|
+
max-width: 2284px;
|
|
82
|
+
flex: 1;
|
|
83
|
+
display: flex;
|
|
84
|
+
justify-content: flex-end;
|
|
85
|
+
${({ $orientation }) => $orientation === 'vertical'
|
|
86
|
+
? `
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: 24px;
|
|
89
|
+
justify-content: flex-start;`
|
|
90
|
+
: `
|
|
91
|
+
& > div:first-of-type {
|
|
92
|
+
flex: 5;
|
|
93
|
+
aspect-ratio: 1280 / 720;
|
|
94
|
+
}
|
|
95
|
+
& > div:last-of-type {
|
|
96
|
+
flex: 3;
|
|
97
|
+
}`}
|
|
98
|
+
`;
|
|
99
|
+
const Side = styled.div `
|
|
100
|
+
position: relative;
|
|
101
|
+
box-sizing: border-box;
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
padding: 24px;
|
|
105
|
+
gap: 24px;
|
|
106
|
+
`;
|
|
107
|
+
const HorizontalPlaylistWrapper = styled.div `
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
gap: 24px;
|
|
111
|
+
max-height: 548px;
|
|
112
|
+
overflow-y: auto;
|
|
113
|
+
overflow-x: hidden;
|
|
114
|
+
padding-right: 24px;
|
|
115
|
+
|
|
116
|
+
&::-webkit-scrollbar-track {
|
|
117
|
+
box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
118
|
+
-webkit-box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
119
|
+
border-radius: 4px;
|
|
120
|
+
background-color: var(--color-grey-2);
|
|
121
|
+
margin: 40px 0px 15px 0px;
|
|
122
|
+
}
|
|
123
|
+
&::-webkit-scrollbar {
|
|
124
|
+
width: 8px;
|
|
125
|
+
border-radius: 4px;
|
|
126
|
+
}
|
|
127
|
+
&::-webkit-scrollbar-thumb {
|
|
128
|
+
border-radius: 4px;
|
|
129
|
+
background-color: var(--color-grey-6);
|
|
130
|
+
opacity: 30%;
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
133
|
+
const VerticalPlaylistWrapper = styled.div `
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-direction: column;
|
|
136
|
+
gap: 24px;
|
|
137
|
+
padding: 0px 12px 48px 24px;
|
|
138
|
+
margin-right: 24px;
|
|
139
|
+
max-height: 350px;
|
|
140
|
+
overflow-y: scroll;
|
|
141
|
+
overflow-x: hidden;
|
|
142
|
+
|
|
143
|
+
&::-webkit-scrollbar-track {
|
|
144
|
+
box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
145
|
+
-webkit-box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
146
|
+
border-radius: 4px;
|
|
147
|
+
background-color: var(--color-grey-2);
|
|
148
|
+
margin: 40px 0px 15px 0px;
|
|
149
|
+
}
|
|
150
|
+
&::-webkit-scrollbar {
|
|
151
|
+
width: 8px;
|
|
152
|
+
border-radius: 4px;
|
|
153
|
+
}
|
|
154
|
+
&::-webkit-scrollbar-thumb {
|
|
155
|
+
border-radius: 4px;
|
|
156
|
+
background-color: var(--color-grey-6);
|
|
157
|
+
opacity: 30%;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
${({ $showingAll }) => $showingAll
|
|
161
|
+
? `
|
|
162
|
+
max-height: unset;
|
|
163
|
+
overflow-y: visible;`
|
|
164
|
+
: ''}
|
|
165
|
+
`;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|