@elicecontents/content-ui 1.0.14 → 1.0.15

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,4 +1,5 @@
1
- interface EliceImageProps {
1
+ import React from 'react';
2
+ interface AdaptiveImageProps {
2
3
  src: string;
3
4
  alt: string;
4
5
  fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
@@ -6,6 +7,8 @@ interface EliceImageProps {
6
7
  height?: number;
7
8
  loading?: boolean;
8
9
  sx?: object;
10
+ icon?: React.ReactNode;
11
+ responsiveBreakpoint?: number;
9
12
  }
10
- declare const EliceImage: ({ src, alt, fit, width, height, loading, sx, }: EliceImageProps) => import("react/jsx-runtime").JSX.Element;
11
- export default EliceImage;
13
+ declare const AdaptiveImage: ({ src, alt, fit, width, height, loading, sx, icon, responsiveBreakpoint, }: AdaptiveImageProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default AdaptiveImage;
@@ -6,12 +6,15 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var React = require('react');
8
8
  var material = require('@mui/material');
9
+ var ZoomInIcon = require('@mui/icons-material/ZoomIn');
10
+ var useAIDTMediaQuery = require('../../hooks/useAIDTMediaQuery.js');
9
11
 
10
12
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
11
13
 
12
14
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
15
+ var ZoomInIcon__default = /*#__PURE__*/_interopDefaultCompat(ZoomInIcon);
13
16
 
14
- var EliceImage = function EliceImage(_ref) {
17
+ var AdaptiveImage = function AdaptiveImage(_ref) {
15
18
  var src = _ref.src,
16
19
  alt = _ref.alt,
17
20
  _ref$fit = _ref.fit,
@@ -22,43 +25,112 @@ var EliceImage = function EliceImage(_ref) {
22
25
  height = _ref$height === void 0 ? 300 : _ref$height,
23
26
  _ref$loading = _ref.loading,
24
27
  loading = _ref$loading === void 0 ? false : _ref$loading,
25
- sx = _ref.sx;
28
+ sx = _ref.sx,
29
+ _ref$icon = _ref.icon,
30
+ icon = _ref$icon === void 0 ? jsxRuntime.jsx(ZoomInIcon__default.default, {
31
+ fontSize: "large"
32
+ }) : _ref$icon,
33
+ _ref$responsiveBreakp = _ref.responsiveBreakpoint,
34
+ responsiveBreakpoint = _ref$responsiveBreakp === void 0 ? 600 : _ref$responsiveBreakp;
26
35
  var _React$useState = React__default.default.useState(false),
27
36
  _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
28
37
  imageLoaded = _React$useState2[0],
29
- setImageLoaded = _React$useState2[1]; // 이미지 로드 상태 관리
38
+ setImageLoaded = _React$useState2[1];
39
+ var _React$useState3 = React__default.default.useState(false),
40
+ _React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
41
+ open = _React$useState4[0],
42
+ setOpen = _React$useState4[1];
30
43
  var handleImageLoad = function handleImageLoad() {
31
44
  return setImageLoaded(true);
32
- }; // 이미지 로드 완료 시 로드 상태 변경
33
- return jsxRuntime.jsx(jsxRuntime.Fragment, {
34
- children: jsxRuntime.jsxs(material.Box, {
35
- sx: Object.assign({
36
- position: 'relative',
37
- width: '100%',
38
- maxWidth: width,
39
- minWidth: '50%',
40
- height: height
41
- }, sx),
42
- children: [jsxRuntime.jsx("img", {
43
- src: src,
44
- alt: alt,
45
- style: {
46
- objectFit: fit,
45
+ };
46
+ var _useAIDTMediaQuery = useAIDTMediaQuery.default(),
47
+ isTablet = _useAIDTMediaQuery.isTablet;
48
+ var isSmall = material.useMediaQuery("(max-width:".concat(responsiveBreakpoint, "px)")) || material.useMediaQuery("(max-height:".concat(responsiveBreakpoint, "px)")) || isTablet;
49
+ var handleOpen = function handleOpen() {
50
+ return setOpen(true);
51
+ };
52
+ var handleClose = function handleClose() {
53
+ return setOpen(false);
54
+ };
55
+ if (isSmall) {
56
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
57
+ children: [jsxRuntime.jsx(material.Box, {
58
+ sx: Object.assign({
59
+ display: 'flex',
60
+ justifyContent: 'center',
61
+ alignItems: 'center',
47
62
  width: '100%',
48
- height: '100%'
49
- },
50
- onLoad: handleImageLoad
51
- }), loading && !imageLoaded && jsxRuntime.jsx(material.CircularProgress, {
52
- size: 24,
53
- sx: {
54
- position: 'absolute',
55
- top: '50%',
56
- left: '50%',
57
- transform: 'translate(-50%, -50%)'
58
- }
63
+ height: 'auto',
64
+ minHeight: 48
65
+ }, sx),
66
+ children: jsxRuntime.jsx(material.IconButton, {
67
+ onClick: handleOpen,
68
+ children: icon
69
+ })
70
+ }), jsxRuntime.jsx(material.Dialog, {
71
+ open: open,
72
+ onClose: handleClose,
73
+ maxWidth: "md",
74
+ fullWidth: true,
75
+ children: jsxRuntime.jsxs(material.DialogContent, {
76
+ sx: {
77
+ display: 'flex',
78
+ justifyContent: 'center',
79
+ alignItems: 'center',
80
+ p: 2,
81
+ position: 'relative',
82
+ minHeight: 200
83
+ },
84
+ children: [!imageLoaded && jsxRuntime.jsx(material.CircularProgress, {
85
+ size: 24,
86
+ sx: {
87
+ position: 'absolute',
88
+ top: '50%',
89
+ left: '50%',
90
+ transform: 'translate(-50%, -50%)'
91
+ }
92
+ }), jsxRuntime.jsx("img", {
93
+ src: src,
94
+ alt: alt,
95
+ style: {
96
+ maxWidth: '100%',
97
+ maxHeight: '80vh',
98
+ objectFit: fit,
99
+ display: imageLoaded ? 'block' : 'none'
100
+ },
101
+ onLoad: handleImageLoad
102
+ })]
103
+ })
59
104
  })]
60
- })
105
+ });
106
+ }
107
+ return jsxRuntime.jsxs(material.Box, {
108
+ sx: Object.assign({
109
+ position: 'relative',
110
+ width: '100%',
111
+ maxWidth: width,
112
+ minWidth: '50%',
113
+ height: height
114
+ }, sx),
115
+ children: [jsxRuntime.jsx("img", {
116
+ src: src,
117
+ alt: alt,
118
+ style: {
119
+ objectFit: fit,
120
+ width: '100%',
121
+ height: '100%'
122
+ },
123
+ onLoad: handleImageLoad
124
+ }), loading && !imageLoaded && jsxRuntime.jsx(material.CircularProgress, {
125
+ size: 24,
126
+ sx: {
127
+ position: 'absolute',
128
+ top: '50%',
129
+ left: '50%',
130
+ transform: 'translate(-50%, -50%)'
131
+ }
132
+ })]
61
133
  });
62
134
  };
63
135
 
64
- exports.default = EliceImage;
136
+ exports.default = AdaptiveImage;
@@ -58,8 +58,6 @@ var EliceChatContainer = function EliceChatContainer(_ref) {
58
58
  _ref$isOnlyRecord = _ref.isOnlyRecord,
59
59
  isOnlyRecord = _ref$isOnlyRecord === void 0 ? false : _ref$isOnlyRecord;
60
60
  var theme = material.useTheme();
61
- var _useAIDTMediaQuery = useAIDTMediaQuery.default(),
62
- isTablet = _useAIDTMediaQuery.isTablet;
63
61
  var _useState = React.useState(content),
64
62
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
65
63
  inputValue = _useState2[0],
@@ -88,7 +86,6 @@ var EliceChatContainer = function EliceChatContainer(_ref) {
88
86
  }
89
87
  };
90
88
  return jsxRuntime.jsxs(StyledChatContainer, {
91
- isTablet: isTablet,
92
89
  theme: theme,
93
90
  height: height,
94
91
  backgroundImage: backgroundImage,
@@ -193,9 +190,11 @@ EliceChat.InputArea = function (_ref3) {
193
190
  var _useRecorder2 = RecorderContext.useRecorder(),
194
191
  recorderState = _useRecorder2.state,
195
192
  setIsRecording = _useRecorder2.setIsRecording;
193
+ var _useAIDTMediaQuery = useAIDTMediaQuery.default(),
194
+ isTablet = _useAIDTMediaQuery.isTablet,
195
+ isMiniTablet = _useAIDTMediaQuery.isMiniTablet;
196
196
  return jsxRuntime.jsx(material.Stack, {
197
- direction: "row",
198
- minHeight: "3.875rem",
197
+ direction: isMiniTablet ? "column" : "row",
199
198
  display: recorderState.isRecording ? "none" : "",
200
199
  bgcolor: theme.palette.grey[50],
201
200
  borderRadius: "1.125rem",
@@ -216,6 +215,7 @@ EliceChat.InputArea = function (_ref3) {
216
215
  flexGrow: 1,
217
216
  maxHeight: "14.625rem",
218
217
  children: jsxRuntime.jsx(StyledInput, {
218
+ isTablet: isTablet,
219
219
  disabled: isDisabled,
220
220
  value: value,
221
221
  onChange: onChange,
@@ -223,26 +223,39 @@ EliceChat.InputArea = function (_ref3) {
223
223
  theme: theme,
224
224
  multiline: true
225
225
  })
226
- }), onRecord && jsxRuntime.jsx(IconButton.default, {
227
- onClick: function onClick() {
228
- onRecord();
229
- setIsRecording(true);
230
- onTranscribingChange === null || onTranscribingChange === void 0 ? void 0 : onTranscribingChange(true);
231
- },
232
- children: jsxRuntime.jsx(Micro.default, {
233
- color: theme.palette.secondary.main
234
- })
235
- }), jsxRuntime.jsx(IconButton.default, {
236
- onClick: onReset,
237
- children: jsxRuntime.jsx(Reset.default, {
238
- color: theme.palette.secondary.main
239
- })
240
- }), jsxRuntime.jsx(IconButton.default, {
241
- onClick: onSend,
242
- disabled: !value.trim(),
243
- children: jsxRuntime.jsx(SendArrow.default, {
244
- color: theme.palette.secondary.main
245
- })
226
+ }), jsxRuntime.jsxs(material.Stack, {
227
+ direction: "row",
228
+ display: "flex",
229
+ justifyContent: isMiniTablet ? 'flex-end' : 'center',
230
+ gap: '0.625rem',
231
+ height: isTablet ? '3rem' : '3.5rem',
232
+ children: [onRecord && jsxRuntime.jsx(IconButton.default, {
233
+ width: isTablet ? '3rem' : '3.5rem',
234
+ height: isTablet ? '3rem' : '3.5rem',
235
+ onClick: function onClick() {
236
+ onRecord();
237
+ setIsRecording(true);
238
+ onTranscribingChange === null || onTranscribingChange === void 0 ? void 0 : onTranscribingChange(true);
239
+ },
240
+ children: jsxRuntime.jsx(Micro.default, {
241
+ color: theme.palette.secondary.main
242
+ })
243
+ }), jsxRuntime.jsx(IconButton.default, {
244
+ onClick: onReset,
245
+ width: isTablet ? '3rem' : '3.5rem',
246
+ height: isTablet ? '3rem' : '3.5rem',
247
+ children: jsxRuntime.jsx(Reset.default, {
248
+ color: theme.palette.secondary.main
249
+ })
250
+ }), jsxRuntime.jsx(IconButton.default, {
251
+ onClick: onSend,
252
+ width: isTablet ? '3rem' : '3.5rem',
253
+ height: isTablet ? '3rem' : '3.5rem',
254
+ disabled: !value.trim(),
255
+ children: jsxRuntime.jsx(SendArrow.default, {
256
+ color: theme.palette.secondary.main
257
+ })
258
+ })]
246
259
  })]
247
260
  })
248
261
  });
@@ -252,58 +265,64 @@ var StyledChatContainer = /*#__PURE__*/_styled__default.default(material.Stack,
252
265
  })("position:relative;max-height:100%;height:", function (_ref4) {
253
266
  var height = _ref4.height;
254
267
  return height !== null && height !== void 0 ? height : 'fit-content';
255
- }, ";min-width:", function (_ref5) {
256
- var isTablet = _ref5.isTablet;
257
- return isTablet ? '0' : '30rem';
258
- }, ";max-width:100%;border:2px solid ", function (_ref6) {
259
- var theme = _ref6.theme;
268
+ }, ";max-width:100%;border:2px solid ", function (_ref5) {
269
+ var theme = _ref5.theme;
260
270
  return theme.palette.grey[300];
261
- }, ";border-radius:1.5rem;padding:1.5rem;gap:1.75rem;", function (_ref7) {
262
- var backgroundImage = _ref7.backgroundImage;
271
+ }, ";border-radius:1.5rem;padding:1.5rem;gap:1.75rem;", function (_ref6) {
272
+ var backgroundImage = _ref6.backgroundImage;
263
273
  return backgroundImage && "\n background-image: url(".concat(backgroundImage, ");\n background-size: cover;\n background-position: center;\n ");
264
274
  }, ";");
265
275
  var StyledScrollBarStack = /*#__PURE__*/_styled__default.default(material.Stack, {
266
276
  target: "e1i7zt7"
267
- })("flex:1;overflow-y:auto;border-radius:1.125rem;padding-right:1rem;::-webkit-scrollbar{width:0.25rem;}::-webkit-scrollbar-track{background:", function (_ref8) {
268
- var theme = _ref8.theme;
277
+ })("flex:1;overflow-y:auto;border-radius:1.125rem;padding-right:1rem;::-webkit-scrollbar{width:0.25rem;}::-webkit-scrollbar-track{background:", function (_ref7) {
278
+ var theme = _ref7.theme;
269
279
  return theme.palette.grey[200];
270
- }, ";border-radius:0.5rem;}::-webkit-scrollbar-thumb{background:", function (_ref9) {
271
- var theme = _ref9.theme;
280
+ }, ";border-radius:0.5rem;}::-webkit-scrollbar-thumb{background:", function (_ref8) {
281
+ var theme = _ref8.theme;
272
282
  return theme.palette.primary.main;
273
- }, ";border-radius:0.5rem;}::-webkit-scrollbar-thumb:hover{background:", function (_ref10) {
274
- var theme = _ref10.theme;
283
+ }, ";border-radius:0.5rem;}::-webkit-scrollbar-thumb:hover{background:", function (_ref9) {
284
+ var theme = _ref9.theme;
275
285
  return theme.palette.secondary.main;
276
286
  }, ";}");
277
287
  var StyledInput = /*#__PURE__*/_styled__default.default(material.Input, {
278
288
  target: "e1i7zt6"
279
- })("width:100%;height:100%;border:none!important;background-color:transparent;font-size:1.375rem;font-weight:700;outline:none;resize:none;color:", function (_ref11) {
280
- var theme = _ref11.theme;
281
- return theme.palette.secondary.main;
282
- }, ";::placeholder{color:", function (_ref12) {
289
+ })("width:100%;height:100%;border:none!important;background-color:transparent;font-size:", function (_ref10) {
290
+ var isTablet = _ref10.isTablet;
291
+ return isTablet ? '0.5rem' : '1.2rem';
292
+ }, ";font-weight:", function (_ref11) {
293
+ var isTablet = _ref11.isTablet;
294
+ return isTablet ? 500 : 700;
295
+ }, ";outline:none;resize:none;max-height:67px;color:", function (_ref12) {
283
296
  var theme = _ref12.theme;
284
- return theme.palette.grey[300];
285
- }, ";}::before{border:none;}:hover{::before{border:none;}}::after{border-bottom:none!important;}::-webkit-scrollbar{width:0.25rem;}::-webkit-scrollbar-track{background:", function (_ref13) {
297
+ return theme.palette.secondary.main;
298
+ }, ";::placeholder{color:", function (_ref13) {
286
299
  var theme = _ref13.theme;
287
- return theme.palette.grey[200];
288
- }, ";border-radius:0.5rem;}::-webkit-scrollbar-thumb{background:", function (_ref14) {
300
+ return theme.palette.grey[300];
301
+ }, ";}::before{border:none;}:hover{::before{border:none;}}::after{border-bottom:none!important;}::-webkit-scrollbar{width:0.25rem;}::-webkit-scrollbar-track{background:", function (_ref14) {
289
302
  var theme = _ref14.theme;
290
- return theme.palette.primary.main;
291
- }, ";border-radius:0.5rem;}::-webkit-scrollbar-thumb:hover{background:", function (_ref15) {
303
+ return theme.palette.grey[200];
304
+ }, ";border-radius:0.5rem;}::-webkit-scrollbar-thumb{background:", function (_ref15) {
292
305
  var theme = _ref15.theme;
306
+ return theme.palette.primary.main;
307
+ }, ";border-radius:0.5rem;}::-webkit-scrollbar-thumb:hover{background:", function (_ref16) {
308
+ var theme = _ref16.theme;
293
309
  return theme.palette.secondary.main;
294
310
  }, ";}");
295
311
  var StyledMessage = /*#__PURE__*/_styled__default.default(material.Typography, {
296
312
  target: "e1i7zt5"
297
- })("color:", function (_ref16) {
298
- var isAssistant = _ref16.isAssistant,
299
- theme = _ref16.theme;
313
+ })("color:", function (_ref17) {
314
+ var isAssistant = _ref17.isAssistant,
315
+ theme = _ref17.theme;
300
316
  return isAssistant ? theme.palette.text.secondary : theme.palette.secondary.main;
301
- }, ";font-size:1rem;font-weight:", function (_ref17) {
302
- var isAssistant = _ref17.isAssistant;
317
+ }, ";font-size:", function (_ref18) {
318
+ var theme = _ref18.theme;
319
+ return theme.typography.body1.fontSize;
320
+ }, ";font-weight:", function (_ref19) {
321
+ var isAssistant = _ref19.isAssistant;
303
322
  return isAssistant ? 500 : 700;
304
- }, ";background-color:", function (_ref18) {
305
- var isAssistant = _ref18.isAssistant,
306
- theme = _ref18.theme;
323
+ }, ";background-color:", function (_ref20) {
324
+ var isAssistant = _ref20.isAssistant,
325
+ theme = _ref20.theme;
307
326
  return isAssistant ? theme.palette.grey[50] : theme.palette.primary.light;
308
327
  }, ";border-radius:1rem;white-space:pre-wrap;padding:0.75rem;margin-bottom:16px;");
309
328
  var EmptyMessageContainer = /*#__PURE__*/_styled__default.default(material.Stack, {
@@ -319,11 +338,11 @@ var EmptyMessageContainer = /*#__PURE__*/_styled__default.default(material.Stack
319
338
  var AIAvatarImage = /*#__PURE__*/_styled__default.default("img", {
320
339
  target: "e1i7zt3"
321
340
  })("production" === "production" ? {
322
- name: "1l4h0oe",
323
- styles: "width:120px;height:120px;flex-shrink:0"
341
+ name: "95o42w",
342
+ styles: "width:10rem;height:10rem;aspect-ratio:1/1;flex-shrink:0"
324
343
  } : {
325
- name: "1l4h0oe",
326
- styles: "width:120px;height:120px;flex-shrink:0",
344
+ name: "95o42w",
345
+ styles: "width:10rem;height:10rem;aspect-ratio:1/1;flex-shrink:0",
327
346
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
328
347
  });
329
348
  var RecordingOverlay = /*#__PURE__*/_styled__default.default(material.Box, {
@@ -348,17 +367,17 @@ var OverlayContent = /*#__PURE__*/_styled__default.default(material.Box, {
348
367
  });
349
368
  var OnlyRecordButton = /*#__PURE__*/_styled__default.default(material.Stack, {
350
369
  target: "e1i7zt0"
351
- })("color:", function (_ref19) {
352
- var theme = _ref19.theme;
370
+ })("color:", function (_ref21) {
371
+ var theme = _ref21.theme;
353
372
  return theme.palette.common.white;
354
- }, ";background:", function (_ref20) {
355
- var theme = _ref20.theme;
373
+ }, ";background:", function (_ref22) {
374
+ var theme = _ref22.theme;
356
375
  return theme.palette.common.red[900];
357
- }, ";&:hover{background:", function (_ref21) {
358
- var theme = _ref21.theme;
376
+ }, ";width:100%;flex-direction:row;display:flex;justify-content:center;align-items:center;border-radius:16px;height:55px;gap:8px;&:hover{background:", function (_ref23) {
377
+ var theme = _ref23.theme;
359
378
  return theme.palette.common.red[600];
360
- }, ";color:", function (_ref22) {
361
- var theme = _ref22.theme;
379
+ }, ";color:", function (_ref24) {
380
+ var theme = _ref24.theme;
362
381
  return theme.palette.common.red[900];
363
382
  }, ";}");
364
383
 
@@ -3,8 +3,8 @@ import type { ReactNode } from 'react';
3
3
  export interface EliceIconButtonProps extends IconButtonProps {
4
4
  children: ReactNode;
5
5
  backgroundColor?: string;
6
- width?: number;
7
- height?: number;
6
+ width?: number | string;
7
+ height?: number | string;
8
8
  borderRadius?: number;
9
9
  }
10
10
  declare const EliceIconButton: ({ children, disabled, backgroundColor, width, height, borderRadius, ...rest }: EliceIconButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -9,10 +9,11 @@ export interface EliceLayoutProps {
9
9
  allowPrev?: boolean;
10
10
  allowNext?: boolean;
11
11
  onlyPage?: boolean;
12
+ enableScrollTracking?: boolean;
12
13
  sx?: SxProps<Theme>;
13
14
  }
14
15
  type Alignment = "left" | "center" | "right";
15
- declare const EliceLayout: (({ children, onPrev, onNext, allowPrev, allowNext, backgroundImage, backgroundColor, onlyPage, sx }: EliceLayoutProps) => import("react/jsx-runtime").JSX.Element) & {
16
+ declare const EliceLayout: (({ children, onPrev, onNext, allowPrev, allowNext, backgroundImage, backgroundColor, onlyPage, enableScrollTracking, sx }: EliceLayoutProps) => import("react/jsx-runtime").JSX.Element) & {
16
17
  HeaderContainer: ({ children, sx }: {
17
18
  children: React.ReactNode;
18
19
  sx?: SxProps<Theme> | undefined;