@teamturing/react-kit 2.38.4 → 2.38.6

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.
@@ -23,7 +23,8 @@ type Props = {
23
23
  focusTrapSettings?: Partial<FocusTrapHookSettings>;
24
24
  onOpen?: () => void;
25
25
  onClose?: () => void;
26
+ tabIndex?: number;
26
27
  };
27
- declare const OverlayPopper: ({ children: propChildren, renderOverlay, triggeredBy, placement, focusZoneSettings, focusTrapSettings, onOpen, onClose, }: Props) => import("react/jsx-runtime").JSX.Element;
28
+ declare const OverlayPopper: ({ children: propChildren, renderOverlay, triggeredBy, placement, focusZoneSettings, focusTrapSettings, onOpen, onClose, tabIndex, }: Props) => import("react/jsx-runtime").JSX.Element;
28
29
  export default OverlayPopper;
29
30
  export type { Props as OverlayPopperProps };
package/dist/index.js CHANGED
@@ -34876,7 +34876,8 @@ const OverlayPopper = ({
34876
34876
  focusZoneSettings,
34877
34877
  focusTrapSettings,
34878
34878
  onOpen,
34879
- onClose
34879
+ onClose,
34880
+ tabIndex
34880
34881
  }) => {
34881
34882
  const theme = styled.useTheme();
34882
34883
  const {
@@ -34906,6 +34907,12 @@ const OverlayPopper = ({
34906
34907
  const handleOverlayClose = () => {
34907
34908
  onClose?.();
34908
34909
  closeOverlay();
34910
+ const reference = refs.reference;
34911
+ if (reference.current) {
34912
+ setTimeout(() => {
34913
+ reference.current?.focus();
34914
+ }, 0);
34915
+ }
34909
34916
  };
34910
34917
  const delayedHandleOverlayClose = useDelayedFunction({
34911
34918
  func: handleOverlayClose,
@@ -34915,7 +34922,7 @@ const OverlayPopper = ({
34915
34922
  handleOverlayClose();
34916
34923
  };
34917
34924
  const defaultPopperProps = {
34918
- tabIndex: 0,
34925
+ tabIndex: tabIndex ?? 0,
34919
34926
  ...(triggeredBy === 'click' ? {
34920
34927
  onClick: handleOverlayToggle,
34921
34928
  onKeyDown: e => {
@@ -18,7 +18,8 @@ const OverlayPopper = ({
18
18
  focusZoneSettings,
19
19
  focusTrapSettings,
20
20
  onOpen,
21
- onClose
21
+ onClose,
22
+ tabIndex
22
23
  }) => {
23
24
  const theme = useTheme();
24
25
  const {
@@ -48,6 +49,12 @@ const OverlayPopper = ({
48
49
  const handleOverlayClose = () => {
49
50
  onClose?.();
50
51
  closeOverlay();
52
+ const reference = refs.reference;
53
+ if (reference.current) {
54
+ setTimeout(() => {
55
+ reference.current?.focus();
56
+ }, 0);
57
+ }
51
58
  };
52
59
  const delayedHandleOverlayClose = useDelayedFunction({
53
60
  func: handleOverlayClose,
@@ -57,7 +64,7 @@ const OverlayPopper = ({
57
64
  handleOverlayClose();
58
65
  };
59
66
  const defaultPopperProps = {
60
- tabIndex: 0,
67
+ tabIndex: tabIndex ?? 0,
61
68
  ...(triggeredBy === 'click' ? {
62
69
  onClick: handleOverlayToggle,
63
70
  onKeyDown: e => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.38.4",
3
+ "version": "2.38.6",
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": "d0b55af96ede1f4fc32a8a7949f3857eb207cdb5"
69
+ "gitHead": "c4375f833385857e93c4be725e19dc3611160da1"
70
70
  }