@teamturing/react-kit 2.56.3 → 2.57.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.
@@ -8,6 +8,7 @@ type Props = {
8
8
  size?: ResponsiveValue<OverlaySizeType>;
9
9
  ignoreOutsideClickRefs?: RefObject<HTMLElement>[];
10
10
  dismissFocusRef?: RefObject<HTMLElement>;
11
+ initialFocusRef?: RefObject<HTMLElement>;
11
12
  } & MaxHeightProps & SxProp & HTMLAttributes<HTMLElement>;
12
13
  declare const _default: import("react").ForwardRefExoticComponent<{
13
14
  isOpen?: boolean | undefined;
@@ -15,6 +16,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
15
16
  size?: ResponsiveValue<OverlaySizeType> | undefined;
16
17
  ignoreOutsideClickRefs?: RefObject<HTMLElement>[] | undefined;
17
18
  dismissFocusRef?: RefObject<HTMLElement> | undefined;
19
+ initialFocusRef?: RefObject<HTMLElement> | undefined;
18
20
  } & MaxHeightProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxHeight<import("styled-system").TLengthStyledSystem>> & SxProp & HTMLAttributes<HTMLElement> & {
19
21
  children?: import("react").ReactNode;
20
22
  } & import("react").RefAttributes<HTMLDivElement>>;
package/dist/index.js CHANGED
@@ -1876,6 +1876,7 @@ const Overlay = ({
1876
1876
  size = 'm',
1877
1877
  ignoreOutsideClickRefs = [],
1878
1878
  dismissFocusRef,
1879
+ initialFocusRef,
1879
1880
  maxHeight = utils.forcePixelValue(600),
1880
1881
  ...props
1881
1882
  }, ref) => {
@@ -1903,6 +1904,10 @@ const Overlay = ({
1903
1904
  }
1904
1905
  }, [handleDismiss]);
1905
1906
  React.useEffect(() => {
1907
+ if (initialFocusRef && initialFocusRef.current) {
1908
+ initialFocusRef.current.focus();
1909
+ return;
1910
+ }
1906
1911
  if (overlayRef.current) {
1907
1912
  const firstItem = utils$1.iterateFocusableElements(overlayRef.current).next().value;
1908
1913
  firstItem?.focus();
@@ -6897,7 +6902,6 @@ const FileItem = ({
6897
6902
  return /*#__PURE__*/jsxRuntime.jsx(BaseFile, {
6898
6903
  variant: variant,
6899
6904
  disabled: disabled,
6900
- loading: disabled,
6901
6905
  validationStatus: validationStatus,
6902
6906
  trailingAction: trailingAction,
6903
6907
  ...props,
@@ -33,7 +33,6 @@ const FileItem = ({
33
33
  return /*#__PURE__*/jsx(BaseFile, {
34
34
  variant: variant,
35
35
  disabled: disabled,
36
- loading: disabled,
37
36
  validationStatus: validationStatus,
38
37
  trailingAction: trailingAction,
39
38
  ...props,
@@ -14,6 +14,7 @@ const Overlay = ({
14
14
  size = 'm',
15
15
  ignoreOutsideClickRefs = [],
16
16
  dismissFocusRef,
17
+ initialFocusRef,
17
18
  maxHeight = forcePixelValue(600),
18
19
  ...props
19
20
  }, ref) => {
@@ -41,6 +42,10 @@ const Overlay = ({
41
42
  }
42
43
  }, [handleDismiss]);
43
44
  useEffect(() => {
45
+ if (initialFocusRef && initialFocusRef.current) {
46
+ initialFocusRef.current.focus();
47
+ return;
48
+ }
44
49
  if (overlayRef.current) {
45
50
  const firstItem = iterateFocusableElements(overlayRef.current).next().value;
46
51
  firstItem?.focus();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.56.3",
3
+ "version": "2.57.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",
@@ -66,5 +66,5 @@
66
66
  "react-textarea-autosize": "^8.5.3",
67
67
  "styled-system": "^5.1.5"
68
68
  },
69
- "gitHead": "fe653415d2cb08f26ba83ea2dc6f4ba72b67db61"
69
+ "gitHead": "2b676d45d4e06d8f6345da9f2e69c2afe80320f5"
70
70
  }