@teamturing/react-kit 2.58.0 → 2.58.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.
@@ -1,4 +1,4 @@
1
- import { ComponentType, HTMLProps, SVGProps } from 'react';
1
+ import { HTMLProps } from 'react';
2
2
  import { SxProp } from '../../utils/styled-system';
3
3
  type Props = {
4
4
  file: File | Blob;
@@ -19,11 +19,7 @@ type Props = {
19
19
  * 시각적인 후행 부분에 상호작용할 요소를 정의합니다.
20
20
  */
21
21
  trailingAction?: React.ReactElement<HTMLProps<HTMLButtonElement>>;
22
- /**
23
- * file 일 때의 icon을 결정합니다.
24
- */
25
- renderFileIcon?: (fileType: string, file: Props['file']) => ComponentType<SVGProps<SVGSVGElement>>;
26
22
  } & SxProp;
27
- declare const FileItem: ({ file, variant, disabled, loading, validationStatus, trailingAction, renderFileIcon, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
23
+ declare const FileItem: ({ file, variant, disabled, loading, validationStatus, trailingAction, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
28
24
  export default FileItem;
29
25
  export type { Props as FileItemProps };
@@ -8,7 +8,6 @@ type Props = {
8
8
  size?: ResponsiveValue<OverlaySizeType>;
9
9
  ignoreOutsideClickRefs?: RefObject<HTMLElement>[];
10
10
  dismissFocusRef?: RefObject<HTMLElement>;
11
- initialFocusRef?: RefObject<HTMLElement>;
12
11
  } & MaxHeightProps & SxProp & HTMLAttributes<HTMLElement>;
13
12
  declare const _default: import("react").ForwardRefExoticComponent<{
14
13
  isOpen?: boolean | undefined;
@@ -16,7 +15,6 @@ declare const _default: import("react").ForwardRefExoticComponent<{
16
15
  size?: ResponsiveValue<OverlaySizeType> | undefined;
17
16
  ignoreOutsideClickRefs?: RefObject<HTMLElement>[] | undefined;
18
17
  dismissFocusRef?: RefObject<HTMLElement> | undefined;
19
- initialFocusRef?: RefObject<HTMLElement> | undefined;
20
18
  } & MaxHeightProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxHeight<import("styled-system").TLengthStyledSystem>> & SxProp & HTMLAttributes<HTMLElement> & {
21
19
  children?: import("react").ReactNode;
22
20
  } & import("react").RefAttributes<HTMLDivElement>>;
package/dist/index.js CHANGED
@@ -1250,12 +1250,10 @@ var Grid$1 = Object.assign(Grid, {
1250
1250
  const StyledIcon = /*#__PURE__*/React.forwardRef(({
1251
1251
  icon: Icon,
1252
1252
  sx,
1253
- className,
1254
1253
  ...props
1255
1254
  }, ref) => /*#__PURE__*/jsxRuntime.jsx(View, {
1256
1255
  ref: ref,
1257
1256
  ...props,
1258
- className: `trk-styled_icon__wrapper ${className}`,
1259
1257
  color: props.color,
1260
1258
  sx: {
1261
1259
  '& svg': {
@@ -1878,7 +1876,6 @@ const Overlay = ({
1878
1876
  size = 'm',
1879
1877
  ignoreOutsideClickRefs = [],
1880
1878
  dismissFocusRef,
1881
- initialFocusRef,
1882
1879
  maxHeight = utils.forcePixelValue(600),
1883
1880
  ...props
1884
1881
  }, ref) => {
@@ -1906,10 +1903,6 @@ const Overlay = ({
1906
1903
  }
1907
1904
  }, [handleDismiss]);
1908
1905
  React.useEffect(() => {
1909
- if (initialFocusRef && initialFocusRef.current) {
1910
- initialFocusRef.current.focus();
1911
- return;
1912
- }
1913
1906
  if (overlayRef.current) {
1914
1907
  const firstItem = utils$1.iterateFocusableElements(overlayRef.current).next().value;
1915
1908
  firstItem?.focus();
@@ -6887,12 +6880,11 @@ const FileItem = ({
6887
6880
  loading,
6888
6881
  validationStatus,
6889
6882
  trailingAction,
6890
- renderFileIcon = () => icons.DocumentIcon,
6891
6883
  ...props
6892
6884
  }) => {
6893
6885
  const fileType = file.type.match('image/*') ? 'image' : file.type.match('video/*') ? 'video' : 'whatever';
6894
6886
  const fileName = 'name' in file ? file.name : '';
6895
- const FileIcon = fileType === 'image' ? icons.PictureIcon : fileType === 'video' ? icons.VideoIcon : renderFileIcon(fileType, file);
6887
+ const FileIcon = fileType === 'image' ? icons.PictureIcon : fileType === 'video' ? icons.VideoIcon : icons.DocumentIcon;
6896
6888
  const [objectUrl, setObjectUrl] = React.useState('');
6897
6889
  React.useEffect(() => {
6898
6890
  const url = URL.createObjectURL(file);
@@ -6904,6 +6896,7 @@ const FileItem = ({
6904
6896
  return /*#__PURE__*/jsxRuntime.jsx(BaseFile, {
6905
6897
  variant: variant,
6906
6898
  disabled: disabled,
6899
+ loading: disabled,
6907
6900
  validationStatus: validationStatus,
6908
6901
  trailingAction: trailingAction,
6909
6902
  ...props,
@@ -6930,7 +6923,7 @@ const FileItem = ({
6930
6923
  }), /*#__PURE__*/jsxRuntime.jsx(icons.VideoIcon, {})]
6931
6924
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
6932
6925
  className: 'file__thumbnail__whatever',
6933
- children: [/*#__PURE__*/jsxRuntime.jsx(FileIcon, {}), /*#__PURE__*/jsxRuntime.jsx("span", {
6926
+ children: [/*#__PURE__*/jsxRuntime.jsx(icons.DocumentIcon, {}), /*#__PURE__*/jsxRuntime.jsx("span", {
6934
6927
  title: fileName,
6935
6928
  children: fileName
6936
6929
  })]
@@ -1,4 +1,4 @@
1
- import { PictureIcon, VideoIcon, ExclamationPointInCircleIcon, DocumentIcon } from '@teamturing/icons';
1
+ import { ExclamationPointInCircleIcon, VideoIcon, DocumentIcon, PictureIcon } from '@teamturing/icons';
2
2
  import { forcePixelValue } from '@teamturing/utils';
3
3
  import { useState, useEffect } from 'react';
4
4
  import styled from 'styled-components';
@@ -16,12 +16,11 @@ const FileItem = ({
16
16
  loading,
17
17
  validationStatus,
18
18
  trailingAction,
19
- renderFileIcon = () => DocumentIcon,
20
19
  ...props
21
20
  }) => {
22
21
  const fileType = file.type.match('image/*') ? 'image' : file.type.match('video/*') ? 'video' : 'whatever';
23
22
  const fileName = 'name' in file ? file.name : '';
24
- const FileIcon = fileType === 'image' ? PictureIcon : fileType === 'video' ? VideoIcon : renderFileIcon(fileType, file);
23
+ const FileIcon = fileType === 'image' ? PictureIcon : fileType === 'video' ? VideoIcon : DocumentIcon;
25
24
  const [objectUrl, setObjectUrl] = useState('');
26
25
  useEffect(() => {
27
26
  const url = URL.createObjectURL(file);
@@ -33,6 +32,7 @@ const FileItem = ({
33
32
  return /*#__PURE__*/jsx(BaseFile, {
34
33
  variant: variant,
35
34
  disabled: disabled,
35
+ loading: disabled,
36
36
  validationStatus: validationStatus,
37
37
  trailingAction: trailingAction,
38
38
  ...props,
@@ -59,7 +59,7 @@ const FileItem = ({
59
59
  }), /*#__PURE__*/jsx(VideoIcon, {})]
60
60
  }) : /*#__PURE__*/jsxs("div", {
61
61
  className: 'file__thumbnail__whatever',
62
- children: [/*#__PURE__*/jsx(FileIcon, {}), /*#__PURE__*/jsx("span", {
62
+ children: [/*#__PURE__*/jsx(DocumentIcon, {}), /*#__PURE__*/jsx("span", {
63
63
  title: fileName,
64
64
  children: fileName
65
65
  })]
@@ -14,7 +14,6 @@ const Overlay = ({
14
14
  size = 'm',
15
15
  ignoreOutsideClickRefs = [],
16
16
  dismissFocusRef,
17
- initialFocusRef,
18
17
  maxHeight = forcePixelValue(600),
19
18
  ...props
20
19
  }, ref) => {
@@ -42,10 +41,6 @@ const Overlay = ({
42
41
  }
43
42
  }, [handleDismiss]);
44
43
  useEffect(() => {
45
- if (initialFocusRef && initialFocusRef.current) {
46
- initialFocusRef.current.focus();
47
- return;
48
- }
49
44
  if (overlayRef.current) {
50
45
  const firstItem = iterateFocusableElements(overlayRef.current).next().value;
51
46
  firstItem?.focus();
@@ -5,12 +5,10 @@ import { jsx } from 'react/jsx-runtime';
5
5
  const StyledIcon = /*#__PURE__*/forwardRef(({
6
6
  icon: Icon,
7
7
  sx,
8
- className,
9
8
  ...props
10
9
  }, ref) => /*#__PURE__*/jsx(View, {
11
10
  ref: ref,
12
11
  ...props,
13
- className: `trk-styled_icon__wrapper ${className}`,
14
12
  color: props.color,
15
13
  sx: {
16
14
  '& svg': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.58.0",
3
+ "version": "2.58.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",
@@ -55,9 +55,9 @@
55
55
  "dependencies": {
56
56
  "@floating-ui/react": "^0.27.16",
57
57
  "@primer/behaviors": "^1.3.6",
58
- "@teamturing/icons": "^1.59.0",
59
- "@teamturing/token-studio": "^1.16.2",
60
- "@teamturing/utils": "^1.5.0",
58
+ "@teamturing/icons": "^1.62.0",
59
+ "@teamturing/token-studio": "^1.16.3",
60
+ "@teamturing/utils": "^1.5.1",
61
61
  "framer-motion": "^10.16.4",
62
62
  "lodash.debounce": "^4.0.8",
63
63
  "lodash.throttle": "^4.1.1",
@@ -66,5 +66,5 @@
66
66
  "react-textarea-autosize": "^8.5.3",
67
67
  "styled-system": "^5.1.5"
68
68
  },
69
- "gitHead": "e841f08c6f9e085849f873896a2cdda34696e665"
69
+ "gitHead": "bd19fd9b373da3c0e0f5fcd3e2ed665fa361c67f"
70
70
  }