@teamturing/react-kit 2.73.2 → 2.74.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.
@@ -1,4 +1,5 @@
1
1
  import { ComponentType, HTMLProps, SVGProps } from 'react';
2
+ import { ResponsiveValue } from 'styled-system';
2
3
  import { SxProp } from '../../utils/styled-system';
3
4
  type Props = {
4
5
  file: File | Blob;
@@ -23,7 +24,11 @@ type Props = {
23
24
  * file 일 때의 icon을 결정합니다.
24
25
  */
25
26
  renderFileIcon?: (fileType: string, file: Props['file']) => ComponentType<SVGProps<SVGSVGElement>>;
27
+ /**
28
+ * 컴포넌트의 사이즈를 정의합니다. thumbnail variant에서만 적용됩니다.
29
+ */
30
+ size?: ResponsiveValue<'m' | 's'>;
26
31
  } & SxProp;
27
- declare const FileItem: ({ file, variant, disabled, loading, validationStatus, trailingAction, renderFileIcon, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
32
+ declare const FileItem: ({ file, variant, disabled, loading, validationStatus, trailingAction, size, renderFileIcon, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
28
33
  export default FileItem;
29
34
  export type { Props as FileItemProps };
package/dist/index.js CHANGED
@@ -6250,6 +6250,7 @@ const FileItem = ({
6250
6250
  loading,
6251
6251
  validationStatus,
6252
6252
  trailingAction,
6253
+ size = 'm',
6253
6254
  renderFileIcon = () => icons.DocumentIcon,
6254
6255
  ...props
6255
6256
  }) => {
@@ -6266,6 +6267,7 @@ const FileItem = ({
6266
6267
  }, [file]);
6267
6268
  return /*#__PURE__*/jsxRuntime.jsx(BaseFile, {
6268
6269
  variant: variant,
6270
+ size: size,
6269
6271
  disabled: disabled,
6270
6272
  validationStatus: validationStatus,
6271
6273
  trailingAction: trailingAction,
@@ -6361,9 +6363,6 @@ const BaseFile = /*#__PURE__*/styled__default.default.div.withConfig({
6361
6363
  'display': 'flex',
6362
6364
  'alignItems': 'center',
6363
6365
  'justifyContent': 'center',
6364
- 'width': utils.forcePixelValue(160),
6365
- 'maxWidth': utils.forcePixelValue(160),
6366
- 'aspectRatio': '16 / 9',
6367
6366
  'backgroundColor': theme.colors['bg/neutral'],
6368
6367
  'overflow': 'hidden',
6369
6368
  'borderRadius': 'xs',
@@ -6482,6 +6481,26 @@ const BaseFile = /*#__PURE__*/styled__default.default.div.withConfig({
6482
6481
  } : {})
6483
6482
  }
6484
6483
  }
6484
+ }), ({
6485
+ variant: propVariant
6486
+ }) => variant({
6487
+ prop: 'size',
6488
+ variants: {
6489
+ m: {
6490
+ ...(propVariant === 'thumbnail' ? {
6491
+ width: utils.forcePixelValue(160),
6492
+ maxWidth: utils.forcePixelValue(160),
6493
+ aspectRatio: '16 / 9'
6494
+ } : {})
6495
+ },
6496
+ s: {
6497
+ ...(propVariant === 'thumbnail' ? {
6498
+ width: utils.forcePixelValue(80),
6499
+ maxWidth: utils.forcePixelValue(80),
6500
+ aspectRatio: '1'
6501
+ } : {})
6502
+ }
6503
+ }
6485
6504
  }), sx);
6486
6505
 
6487
6506
  const Flash = ({
@@ -16,6 +16,7 @@ const FileItem = ({
16
16
  loading,
17
17
  validationStatus,
18
18
  trailingAction,
19
+ size = 'm',
19
20
  renderFileIcon = () => DocumentIcon,
20
21
  ...props
21
22
  }) => {
@@ -32,6 +33,7 @@ const FileItem = ({
32
33
  }, [file]);
33
34
  return /*#__PURE__*/jsx(BaseFile, {
34
35
  variant: variant,
36
+ size: size,
35
37
  disabled: disabled,
36
38
  validationStatus: validationStatus,
37
39
  trailingAction: trailingAction,
@@ -127,9 +129,6 @@ const BaseFile = /*#__PURE__*/styled.div.withConfig({
127
129
  'display': 'flex',
128
130
  'alignItems': 'center',
129
131
  'justifyContent': 'center',
130
- 'width': forcePixelValue(160),
131
- 'maxWidth': forcePixelValue(160),
132
- 'aspectRatio': '16 / 9',
133
132
  'backgroundColor': theme.colors['bg/neutral'],
134
133
  'overflow': 'hidden',
135
134
  'borderRadius': 'xs',
@@ -248,6 +247,26 @@ const BaseFile = /*#__PURE__*/styled.div.withConfig({
248
247
  } : {})
249
248
  }
250
249
  }
250
+ }), ({
251
+ variant: propVariant
252
+ }) => variant({
253
+ prop: 'size',
254
+ variants: {
255
+ m: {
256
+ ...(propVariant === 'thumbnail' ? {
257
+ width: forcePixelValue(160),
258
+ maxWidth: forcePixelValue(160),
259
+ aspectRatio: '16 / 9'
260
+ } : {})
261
+ },
262
+ s: {
263
+ ...(propVariant === 'thumbnail' ? {
264
+ width: forcePixelValue(80),
265
+ maxWidth: forcePixelValue(80),
266
+ aspectRatio: '1'
267
+ } : {})
268
+ }
269
+ }
251
270
  }), sx);
252
271
 
253
272
  export { FileItem as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.73.2",
3
+ "version": "2.74.0",
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",
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "@floating-ui/react": "^0.27.16",
57
57
  "@primer/behaviors": "^1.3.6",
58
- "@teamturing/icons": "^1.76.0",
58
+ "@teamturing/icons": "^1.77.0",
59
59
  "@teamturing/token-studio": "^1.17.0",
60
60
  "@teamturing/utils": "^1.6.1",
61
61
  "framer-motion": "^10.16.4",
@@ -65,5 +65,5 @@
65
65
  "react-textarea-autosize": "^8.5.3",
66
66
  "styled-system": "^5.1.5"
67
67
  },
68
- "gitHead": "427018a5d3c29ef27324f0b125a0175346b0e764"
68
+ "gitHead": "b096bdb9ffa2f75b160b773e60a1a2130989ff3c"
69
69
  }