@elicecontents/content-ui 1.0.21 → 1.0.22

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.
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
- import { type ButtonProps } from '@mui/material';
2
+ import { type ButtonProps, SxProps } from '@mui/material';
3
3
  export interface EliceButtonProps extends ButtonProps {
4
4
  children?: React.ReactNode;
5
5
  textColor?: string;
6
6
  bgColor?: string;
7
+ sx?: SxProps;
7
8
  }
8
9
  declare const EliceButton: React.ForwardRefExoticComponent<Omit<EliceButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
9
10
  export default EliceButton;
@@ -15,7 +15,8 @@ var EliceButton = React.forwardRef(function (_a, ref) {
15
15
  disabled = _a.disabled,
16
16
  textColor = _a.textColor,
17
17
  bgColor = _a.bgColor,
18
- rest = tslib.__rest(_a, ["children", "variant", "disabled", "textColor", "bgColor"]);
18
+ sx = _a.sx,
19
+ rest = tslib.__rest(_a, ["children", "variant", "disabled", "textColor", "bgColor", "sx"]);
19
20
  var theme = material.useTheme();
20
21
  var _useAIDTMediaQuery = useAIDTMediaQuery.default(),
21
22
  isMiniTablet = _useAIDTMediaQuery.isMiniTablet;
@@ -25,7 +26,7 @@ var EliceButton = React.forwardRef(function (_a, ref) {
25
26
  ref: ref,
26
27
  variant: variant,
27
28
  disabled: disabled,
28
- sx: {
29
+ sx: Object.assign({
29
30
  width: 'fit-content',
30
31
  height: isMiniTablet ? '42px' : '56px',
31
32
  borderRadius: isMiniTablet ? '12px' : '16px',
@@ -33,7 +34,7 @@ var EliceButton = React.forwardRef(function (_a, ref) {
33
34
  color: resolvedColor,
34
35
  backgroundColor: resolvedBgColor,
35
36
  fontFamily: 'inherit'
36
- }
37
+ }, sx)
37
38
  }, rest, {
38
39
  children: jsxRuntime.jsx(material.Typography, {
39
40
  variant: "buttoninput",
@@ -21,6 +21,7 @@ var BaseInput = require('./base-input/BaseInput.js');
21
21
  var Modal = require('./Modal/Modal.js');
22
22
  var RecorderChat = require('./recorder-chat/RecorderChat.js');
23
23
  var VideoPlayer = require('./video/VideoPlayer.js');
24
+ var VideoV2 = require('./video/VideoV2.js');
24
25
  var Recorder = require('./recorder/Recorder.js');
25
26
  var Audio = require('./audio/Audio.js');
26
27
  var SoundVisualizer = require('./sound-visualizer/SoundVisualizer.js');
@@ -51,6 +52,7 @@ exports.BaseInput = BaseInput.default;
51
52
  exports.EliceModal = Modal.default;
52
53
  exports.EliceRecorderChat = RecorderChat.default;
53
54
  exports.EliceVideoPlayer = VideoPlayer.default;
55
+ exports.EliceVideoV2 = VideoV2.EliceVideoV2;
54
56
  exports.EliceRecorder = Recorder.default;
55
57
  exports.EliceAudioPlayer = Audio.default;
56
58
  exports.SoundVisualizer = SoundVisualizer.SoundVisualizer;
@@ -0,0 +1,20 @@
1
+ interface VideoV2Props {
2
+ source: {
3
+ src: string;
4
+ type?: string;
5
+ }[];
6
+ textTrack?: {
7
+ src: string;
8
+ lang: string;
9
+ label?: string;
10
+ default?: boolean;
11
+ }[];
12
+ options?: {
13
+ autoplay?: boolean;
14
+ controls?: boolean;
15
+ poster?: string;
16
+ playbackRates?: number[];
17
+ };
18
+ }
19
+ export declare function EliceVideoV2({ source, textTrack, options: _options, }: VideoV2Props): import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var react = require('@emotion/react');
6
+ var material = require('@mui/material');
7
+ var defu$1 = require('defu');
8
+ var videojs = require('video.js');
9
+
10
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
11
+
12
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
13
+ var videojs__default = /*#__PURE__*/_interopDefaultCompat(videojs);
14
+
15
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
16
+ var DEFAULT_OPTIONS = {
17
+ autoplay: false,
18
+ controls: true,
19
+ poster: "",
20
+ playbackRates: [0.5, 1, 1.5]
21
+ };
22
+ var VideoWrapper = material.styled('div')(function (_ref2) {
23
+ var theme = _ref2.theme;
24
+ return {
25
+ width: '100%',
26
+ height: 'auto',
27
+ boxShadow: theme.shadows[1],
28
+ '--theme-primary-color': theme.palette.primary.main,
29
+ '--theme-secondary-color': theme.palette.secondary.main
30
+ };
31
+ });
32
+ var defu = defu$1.createDefu(function (object, key, currentValue) {
33
+ if (Array.isArray(object[key])) {
34
+ object[key] = currentValue;
35
+ return true;
36
+ }
37
+ });
38
+ var _ref = "production" === "production" ? {
39
+ name: "59xsct",
40
+ styles: "@import url('https://cdn.jsdelivr.net/npm/video.js@8.22.0/dist/video-js.min.css');{}.video-js.elice-video{font-size:var(--fluid-size);font-family:Pretendard,Arial,sans-serif;& .vjs-progress-control{position:absolute;bottom:2.55em;height:0.5em;left:0;width:100%;&>.vjs-slider{margin:0;&>.vjs-play-progress{background-color:var(--theme-primary-color);}}}& .vjs-big-play-button{width:2em;height:1.5em;margin-top:-0.75em;margin-left:-1em;background-color:transparent;&::before{width:100%;height:100%;content:'';background-color:var(--theme-secondary-color);opacity:0.4;border-radius:0.3em;position:absolute;top:0;left:0;}}& .vjs-volume-bar{margin:1.5em 0.45em 1.2em;}& .vjs-control.vjs-button{width:3em;padding:0 0.5em;&>*::before{font-size:calc(var(--fluid-size) * 1.5);line-height:calc(var(--fluid-size) * 3.25);}}& .vjs-playback-rate{& .vjs-menu{left:-0.5em;}& .vjs-playback-rate-value{font-size:calc(var(--fluid-size) * 0.8);line-height:calc(var(--fluid-size) * 3.25);}& .vjs-menu-item{font-size:calc(var(--fluid-size) * 1);line-height:calc(var(--fluid-size) * 1.4);}}& .vjs-menu.vjs-lock-showing .vjs-menu-item{margin-block:0;}& .vjs-time-control{font-size:calc(var(--fluid-size) * 0.8);line-height:calc(var(--fluid-size) * 3.25);}& .vjs-current-time,& .vjs-duration,& .vjs-time-divider{display:block;font-family:Pretendard,Arial,sans-serif;}& .vjs-time-divider{width:auto;min-width:0;padding:0;}& .vjs-remaining-time{display:none;}& .vjs-playback-rate{display:block;}& .vjs-volume-level{background-color:var(--theme-primary-color);color:var(--theme-primary-color);}& .vjs-load-progress{background-color:var(--theme-secondary-color);opacity:0.5;}& .vjs-playback-rate{margin-left:auto;}}"
41
+ } : {
42
+ name: "59xsct",
43
+ styles: "@import url('https://cdn.jsdelivr.net/npm/video.js@8.22.0/dist/video-js.min.css');{}.video-js.elice-video{font-size:var(--fluid-size);font-family:Pretendard,Arial,sans-serif;& .vjs-progress-control{position:absolute;bottom:2.55em;height:0.5em;left:0;width:100%;&>.vjs-slider{margin:0;&>.vjs-play-progress{background-color:var(--theme-primary-color);}}}& .vjs-big-play-button{width:2em;height:1.5em;margin-top:-0.75em;margin-left:-1em;background-color:transparent;&::before{width:100%;height:100%;content:'';background-color:var(--theme-secondary-color);opacity:0.4;border-radius:0.3em;position:absolute;top:0;left:0;}}& .vjs-volume-bar{margin:1.5em 0.45em 1.2em;}& .vjs-control.vjs-button{width:3em;padding:0 0.5em;&>*::before{font-size:calc(var(--fluid-size) * 1.5);line-height:calc(var(--fluid-size) * 3.25);}}& .vjs-playback-rate{& .vjs-menu{left:-0.5em;}& .vjs-playback-rate-value{font-size:calc(var(--fluid-size) * 0.8);line-height:calc(var(--fluid-size) * 3.25);}& .vjs-menu-item{font-size:calc(var(--fluid-size) * 1);line-height:calc(var(--fluid-size) * 1.4);}}& .vjs-menu.vjs-lock-showing .vjs-menu-item{margin-block:0;}& .vjs-time-control{font-size:calc(var(--fluid-size) * 0.8);line-height:calc(var(--fluid-size) * 3.25);}& .vjs-current-time,& .vjs-duration,& .vjs-time-divider{display:block;font-family:Pretendard,Arial,sans-serif;}& .vjs-time-divider{width:auto;min-width:0;padding:0;}& .vjs-remaining-time{display:none;}& .vjs-playback-rate{display:block;}& .vjs-volume-level{background-color:var(--theme-primary-color);color:var(--theme-primary-color);}& .vjs-load-progress{background-color:var(--theme-secondary-color);opacity:0.5;}& .vjs-playback-rate{margin-left:auto;}}",
44
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
45
+ };
46
+ function EliceVideoV2(_ref3) {
47
+ var source = _ref3.source,
48
+ textTrack = _ref3.textTrack,
49
+ _options = _ref3.options;
50
+ var options = defu(_options !== null && _options !== void 0 ? _options : {}, DEFAULT_OPTIONS);
51
+ var videoRef = React__default.default.useRef(null);
52
+ var playerRef = React__default.default.useRef(null);
53
+ React__default.default.useEffect(function () {
54
+ if (!videoRef.current) return;
55
+ var player = videojs__default.default(videoRef.current, Object.assign(Object.assign({}, options), {
56
+ disablePictureInPicture: true,
57
+ fluid: true
58
+ }));
59
+ playerRef.current = player;
60
+ return function () {
61
+ if (playerRef.current) {
62
+ playerRef.current.dispose();
63
+ playerRef.current = null;
64
+ }
65
+ };
66
+ }, []);
67
+ return jsxRuntime.jsxs(VideoWrapper, {
68
+ children: [jsxRuntime.jsx(react.Global, {
69
+ styles: _ref
70
+ }), jsxRuntime.jsxs("video", {
71
+ ref: videoRef,
72
+ className: "video-js elice-video vjs-default-skin",
73
+ children: [source.map(function (srcInfo) {
74
+ return jsxRuntime.jsx("source", {
75
+ src: srcInfo.src,
76
+ type: srcInfo.type
77
+ }, srcInfo.src);
78
+ }), textTrack === null || textTrack === void 0 ? void 0 : textTrack.map(function (track) {
79
+ return jsxRuntime.jsx("track", {
80
+ src: track.src,
81
+ kind: "subtitles",
82
+ srcLang: track.lang,
83
+ label: track.label,
84
+ "default": track["default"]
85
+ }, track.src);
86
+ })]
87
+ })]
88
+ });
89
+ }
90
+
91
+ exports.EliceVideoV2 = EliceVideoV2;
@@ -1,2 +1,3 @@
1
1
  export { default as EliceVideoPlayer } from './VideoPlayer';
2
+ export { EliceVideoV2 } from './VideoV2';
2
3
  export type { EliceVideoPlayerProps } from './VideoPlayer';
@@ -1,7 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var VideoPlayer = require('./VideoPlayer.js');
4
+ var VideoV2 = require('./VideoV2.js');
4
5
 
5
6
 
6
7
 
7
8
  exports.EliceVideoPlayer = VideoPlayer.default;
9
+ exports.EliceVideoV2 = VideoV2.EliceVideoV2;
package/cjs/index.js CHANGED
@@ -22,6 +22,7 @@ var BaseInput = require('./components/base-input/BaseInput.js');
22
22
  var Modal = require('./components/Modal/Modal.js');
23
23
  var RecorderChat = require('./components/recorder-chat/RecorderChat.js');
24
24
  var VideoPlayer = require('./components/video/VideoPlayer.js');
25
+ var VideoV2 = require('./components/video/VideoV2.js');
25
26
  var Recorder = require('./components/recorder/Recorder.js');
26
27
  var Audio = require('./components/audio/Audio.js');
27
28
  var SoundVisualizer = require('./components/sound-visualizer/SoundVisualizer.js');
@@ -85,6 +86,7 @@ exports.BaseInput = BaseInput.default;
85
86
  exports.EliceModal = Modal.default;
86
87
  exports.EliceRecorderChat = RecorderChat.default;
87
88
  exports.EliceVideoPlayer = VideoPlayer.default;
89
+ exports.EliceVideoV2 = VideoV2.EliceVideoV2;
88
90
  exports.EliceRecorder = Recorder.default;
89
91
  exports.EliceAudioPlayer = Audio.default;
90
92
  exports.SoundVisualizer = SoundVisualizer.SoundVisualizer;
@@ -1,3 +1,3 @@
1
1
  import type { CreateAIDTThemeProps } from '../types/theme.types';
2
- declare const createAIDTTheme: ({ paletteMode, palettePublisher, paletteSubject, paletteLevel, typographyFontFamily, }: CreateAIDTThemeProps) => import("@mui/material").Theme;
2
+ declare const createAIDTTheme: ({ paletteMode, palettePublisher, paletteSubject, paletteLevel, typographyType, typographyFontFamily, }: CreateAIDTThemeProps) => import("@mui/material").Theme;
3
3
  export { createAIDTTheme };
@@ -17,6 +17,8 @@ var createAIDTTheme = function createAIDTTheme(_ref) {
17
17
  paletteSubject = _ref$paletteSubject === void 0 ? 'korean' : _ref$paletteSubject,
18
18
  _ref$paletteLevel = _ref.paletteLevel,
19
19
  paletteLevel = _ref$paletteLevel === void 0 ? 'elementary' : _ref$paletteLevel,
20
+ _ref$typographyType = _ref.typographyType,
21
+ typographyType = _ref$typographyType === void 0 ? 'Default' : _ref$typographyType,
20
22
  _ref$typographyFontFa = _ref.typographyFontFamily,
21
23
  typographyFontFamily = _ref$typographyFontFa === void 0 ? 'pretendard' : _ref$typographyFontFa;
22
24
  var themeColors = AIDTTheme.getThemeColors(palettePublisher, paletteSubject, paletteLevel);
@@ -38,7 +40,7 @@ var createAIDTTheme = function createAIDTTheme(_ref) {
38
40
  grey: gray.gray
39
41
  },
40
42
  breakpoints: breakpoints.AIDTBreakpoints,
41
- typography: typography.createAIDTTypography(typographyFontFamily),
43
+ typography: typography.createAIDTTypography(typographyFontFamily, typographyType),
42
44
  components: {
43
45
  MuiCssBaseline: {
44
46
  styleOverrides: {
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { PaletteMode, PaletteOptions, Theme } from '@mui/material';
3
3
  import type { TypographyFontFamilyType } from '../typography';
4
+ import { TYPOGRAPHY_STYLES_MAP } from '../typography/TypographyType';
4
5
  export interface TypographyVariantsExtension {
5
6
  pagination: React.CSSProperties;
6
7
  buttoninput: React.CSSProperties;
@@ -62,6 +63,7 @@ export interface CreateAIDTThemeProps {
62
63
  palettePublisher?: AIDTPalettePublisher;
63
64
  paletteSubject?: AIDTPaletteSubject;
64
65
  paletteLevel?: AIDTPaletteLevel;
66
+ typographyType?: keyof typeof TYPOGRAPHY_STYLES_MAP;
65
67
  typographyFontFamily: TypographyFontFamilyType;
66
68
  }
67
69
  export type CreateAIDTTheme = (props?: CreateAIDTThemeProps) => Theme;
@@ -0,0 +1,239 @@
1
+ export declare const TYPOGRAPHY_STYLES_MAP: {
2
+ Default: {
3
+ h1: {
4
+ fontSize: string;
5
+ fontWeight: number;
6
+ lineHeight: string;
7
+ "@media (max-width:1200px)": {
8
+ fontSize: string;
9
+ };
10
+ "@media (max-width:768px)": {
11
+ fontSize: string;
12
+ };
13
+ };
14
+ subtitle1: {
15
+ fontSize: string;
16
+ fontWeight: number;
17
+ lineHeight: string;
18
+ "@media (max-width:1200px)": {
19
+ fontSize: string;
20
+ };
21
+ "@media (max-width:768px)": {
22
+ fontSize: string;
23
+ };
24
+ };
25
+ subtitle2: {
26
+ fontSize: string;
27
+ fontWeight: number;
28
+ lineHeight: string;
29
+ "@media (max-width:1200px)": {
30
+ fontSize: string;
31
+ };
32
+ "@media (max-width:768px)": {
33
+ fontSize: string;
34
+ };
35
+ };
36
+ subtitle3: {
37
+ fontSize: string;
38
+ fontWeight: number;
39
+ lineHeight: string;
40
+ "@media (max-width:1200px)": {
41
+ fontSize: string;
42
+ };
43
+ "@media (max-width:768px)": {
44
+ fontSize: string;
45
+ };
46
+ };
47
+ body1: {
48
+ fontSize: string;
49
+ fontWeight: number;
50
+ lineHeight: string;
51
+ "@media (max-width:1200px)": {
52
+ fontSize: string;
53
+ };
54
+ "@media (max-width:768px)": {
55
+ fontSize: string;
56
+ };
57
+ };
58
+ buttoninput: {
59
+ fontSize: string;
60
+ fontWeight: number;
61
+ lineHeight: string;
62
+ "@media (max-width:1200px)": {
63
+ fontSize: string;
64
+ };
65
+ "@media (max-width:768px)": {
66
+ fontSize: string;
67
+ };
68
+ };
69
+ pagination: {
70
+ fontSize: string;
71
+ fontWeight: number;
72
+ lineHeight: string;
73
+ "@media (max-width:1200px)": {
74
+ fontSize: string;
75
+ };
76
+ "@media (max-width:768px)": {
77
+ fontSize: string;
78
+ };
79
+ };
80
+ };
81
+ Fluid: {
82
+ h1: {
83
+ fontSize: string;
84
+ fontWeight: number;
85
+ lineHeight: string;
86
+ "@media (max-width:1200px)": {
87
+ fontSize: string;
88
+ };
89
+ "@media (max-width:768px)": {
90
+ fontSize: string;
91
+ };
92
+ };
93
+ subtitle1: {
94
+ fontSize: string;
95
+ fontWeight: number;
96
+ lineHeight: string;
97
+ "@media (max-width:1200px)": {
98
+ fontSize: string;
99
+ };
100
+ "@media (max-width:768px)": {
101
+ fontSize: string;
102
+ };
103
+ };
104
+ subtitle2: {
105
+ fontSize: string;
106
+ fontWeight: number;
107
+ lineHeight: string;
108
+ "@media (max-width:1200px)": {
109
+ fontSize: string;
110
+ };
111
+ "@media (max-width:768px)": {
112
+ fontSize: string;
113
+ };
114
+ };
115
+ subtitle3: {
116
+ fontSize: string;
117
+ fontWeight: number;
118
+ lineHeight: string;
119
+ "@media (max-width:1200px)": {
120
+ fontSize: string;
121
+ };
122
+ "@media (max-width:768px)": {
123
+ fontSize: string;
124
+ };
125
+ };
126
+ body1: {
127
+ fontSize: string;
128
+ fontWeight: number;
129
+ lineHeight: string;
130
+ "@media (max-width:1200px)": {
131
+ fontSize: string;
132
+ };
133
+ "@media (max-width:768px)": {
134
+ fontSize: string;
135
+ };
136
+ };
137
+ buttoninput: {
138
+ fontSize: string;
139
+ fontWeight: number;
140
+ lineHeight: string;
141
+ "@media (max-width:1200px)": {
142
+ fontSize: string;
143
+ };
144
+ "@media (max-width:768px)": {
145
+ fontSize: string;
146
+ };
147
+ };
148
+ pagination: {
149
+ fontSize: string;
150
+ fontWeight: number;
151
+ lineHeight: string;
152
+ "@media (max-width:1200px)": {
153
+ fontSize: string;
154
+ };
155
+ "@media (max-width:768px)": {
156
+ fontSize: string;
157
+ };
158
+ };
159
+ };
160
+ TypeG: {
161
+ h1: {
162
+ fontSize: string;
163
+ fontWeight: number;
164
+ lineHeight: string;
165
+ "@media (max-width:1200px)": {
166
+ fontSize: string;
167
+ };
168
+ "@media (max-width:768px)": {
169
+ fontSize: string;
170
+ };
171
+ };
172
+ h2: {
173
+ fontSize: string;
174
+ fontWeight: number;
175
+ lineHeight: string;
176
+ "@media (max-width:1200px)": {
177
+ fontSize: string;
178
+ };
179
+ "@media (max-width:768px)": {
180
+ fontSize: string;
181
+ };
182
+ };
183
+ subtitle1: {
184
+ fontSize: string;
185
+ fontWeight: number;
186
+ lineHeight: string;
187
+ "@media (max-width:1200px)": {
188
+ fontSize: string;
189
+ };
190
+ "@media (max-width:768px)": {
191
+ fontSize: string;
192
+ };
193
+ };
194
+ subtitle2: {
195
+ fontSize: string;
196
+ fontWeight: number;
197
+ lineHeight: string;
198
+ "@media (max-width:1200px)": {
199
+ fontSize: string;
200
+ };
201
+ "@media (max-width:768px)": {
202
+ fontSize: string;
203
+ };
204
+ };
205
+ subtitle3: {
206
+ fontSize: string;
207
+ fontWeight: number;
208
+ lineHeight: string;
209
+ "@media (max-width:1200px)": {
210
+ fontSize: string;
211
+ };
212
+ "@media (max-width:768px)": {
213
+ fontSize: string;
214
+ };
215
+ };
216
+ buttoninput: {
217
+ fontSize: string;
218
+ fontWeight: number;
219
+ lineHeight: string;
220
+ "@media (max-width:1200px)": {
221
+ fontSize: string;
222
+ };
223
+ "@media (max-width:768px)": {
224
+ fontSize: string;
225
+ };
226
+ };
227
+ pagination: {
228
+ fontSize: string;
229
+ fontWeight: number;
230
+ lineHeight: string;
231
+ "@media (max-width:1200px)": {
232
+ fontSize: string;
233
+ };
234
+ "@media (max-width:768px)": {
235
+ fontSize: string;
236
+ };
237
+ };
238
+ };
239
+ };