@teamturing/react-kit 2.53.1 → 2.53.3

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/index.js CHANGED
@@ -4206,7 +4206,7 @@ const Dialog = ({
4206
4206
  width: '100%',
4207
4207
  height: '100%',
4208
4208
  children: /*#__PURE__*/jsxRuntime.jsxs(BaseDialog, {
4209
- className: `rkt-dialog--${size}`,
4209
+ className: `trk-dialog--${size}`,
4210
4210
  ref: dialogRef,
4211
4211
  "aria-modal": 'true',
4212
4212
  role: 'dialog',
@@ -4748,11 +4748,12 @@ const FileItem = ({
4748
4748
  const FileIcon = fileType === 'image' ? icons.PictureIcon : fileType === 'video' ? icons.VideoIcon : icons.DocumentIcon;
4749
4749
  const [objectUrl, setObjectUrl] = React.useState('');
4750
4750
  React.useEffect(() => {
4751
- setObjectUrl(URL.createObjectURL(file));
4751
+ const url = URL.createObjectURL(file);
4752
+ setObjectUrl(url);
4752
4753
  return () => {
4753
- URL.revokeObjectURL(objectUrl);
4754
+ URL.revokeObjectURL(url);
4754
4755
  };
4755
- }, []);
4756
+ }, [file]);
4756
4757
  return /*#__PURE__*/jsxRuntime.jsx(BaseFile, {
4757
4758
  variant: variant,
4758
4759
  disabled: disabled,
@@ -4772,7 +4773,9 @@ const FileItem = ({
4772
4773
  height: 24
4773
4774
  }) : null, trailingAction]
4774
4775
  }) : variant === 'thumbnail' ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
4775
- children: [fileType === 'image' ? /*#__PURE__*/jsxRuntime.jsx("img", {
4776
+ children: [!objectUrl ? /*#__PURE__*/jsxRuntime.jsx("div", {
4777
+ className: 'file__thumbnail__empty'
4778
+ }) : fileType === 'image' ? /*#__PURE__*/jsxRuntime.jsx("img", {
4776
4779
  src: objectUrl
4777
4780
  }) : fileType === 'video' ? /*#__PURE__*/jsxRuntime.jsxs("div", {
4778
4781
  className: 'file__thumbnail__video',
@@ -4874,6 +4877,11 @@ const BaseFile = styled__default.default.div({
4874
4877
  pointerEvents: 'none',
4875
4878
  backgroundColor: 'bg/neutral'
4876
4879
  },
4880
+ '& > .file__thumbnail__empty': {
4881
+ width: '100%',
4882
+ height: '100%',
4883
+ backgroundColor: 'bg/neutral'
4884
+ },
4877
4885
  '& > img': {
4878
4886
  width: '100%',
4879
4887
  height: '100%',
@@ -94,7 +94,7 @@ const Dialog = ({
94
94
  width: '100%',
95
95
  height: '100%',
96
96
  children: /*#__PURE__*/jsxs(BaseDialog, {
97
- className: `rkt-dialog--${size}`,
97
+ className: `trk-dialog--${size}`,
98
98
  ref: dialogRef,
99
99
  "aria-modal": 'true',
100
100
  role: 'dialog',
@@ -23,11 +23,12 @@ const FileItem = ({
23
23
  const FileIcon = fileType === 'image' ? PictureIcon : fileType === 'video' ? VideoIcon : DocumentIcon;
24
24
  const [objectUrl, setObjectUrl] = useState('');
25
25
  useEffect(() => {
26
- setObjectUrl(URL.createObjectURL(file));
26
+ const url = URL.createObjectURL(file);
27
+ setObjectUrl(url);
27
28
  return () => {
28
- URL.revokeObjectURL(objectUrl);
29
+ URL.revokeObjectURL(url);
29
30
  };
30
- }, []);
31
+ }, [file]);
31
32
  return /*#__PURE__*/jsx(BaseFile, {
32
33
  variant: variant,
33
34
  disabled: disabled,
@@ -47,7 +48,9 @@ const FileItem = ({
47
48
  height: 24
48
49
  }) : null, trailingAction]
49
50
  }) : variant === 'thumbnail' ? /*#__PURE__*/jsxs(Fragment, {
50
- children: [fileType === 'image' ? /*#__PURE__*/jsx("img", {
51
+ children: [!objectUrl ? /*#__PURE__*/jsx("div", {
52
+ className: 'file__thumbnail__empty'
53
+ }) : fileType === 'image' ? /*#__PURE__*/jsx("img", {
51
54
  src: objectUrl
52
55
  }) : fileType === 'video' ? /*#__PURE__*/jsxs("div", {
53
56
  className: 'file__thumbnail__video',
@@ -149,6 +152,11 @@ const BaseFile = styled.div({
149
152
  pointerEvents: 'none',
150
153
  backgroundColor: 'bg/neutral'
151
154
  },
155
+ '& > .file__thumbnail__empty': {
156
+ width: '100%',
157
+ height: '100%',
158
+ backgroundColor: 'bg/neutral'
159
+ },
152
160
  '& > img': {
153
161
  width: '100%',
154
162
  height: '100%',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.53.1",
3
+ "version": "2.53.3",
4
4
  "description": "React components, hooks for create teamturing web application",
5
5
  "author": "Sungchang Park <psch300@gmail.com> (https://github.com/psch300)",
6
6
  "homepage": "https://github.com/weareteamturing/bombe#readme",
@@ -66,5 +66,5 @@
66
66
  "react-textarea-autosize": "^8.5.3",
67
67
  "styled-system": "^5.1.5"
68
68
  },
69
- "gitHead": "0b981b1312cf772c8bdd7aff43aa6f6e36620c87"
69
+ "gitHead": "8b463d17813eaa9bc4f255e2e829eb3feefa5428"
70
70
  }