@teamturing/react-kit 2.19.29 → 2.19.30

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,16 +8,18 @@ import { DialogHeaderTitleProps } from './DialogHeaderTitle';
8
8
  import { UnstyledDialogBodyProps } from './_UnstyledDialogBody';
9
9
  import { UnstyledDialogFooterProps } from './_UnstyledDialogFooter';
10
10
  import { UnstyledDialogHeaderProps } from './_UnstyledDialogHeader';
11
- type DialogSizeType = 'l' | 'm' | 's';
11
+ type DialogSizeType = 'full' | 'l' | 'm' | 's';
12
12
  type Props = {
13
13
  isOpen?: boolean;
14
14
  onDismiss?: () => void;
15
+ isOutsideClickDismissable?: boolean;
15
16
  size?: DialogSizeType;
16
17
  initialFocusRef?: RefObject<HTMLElement>;
17
18
  } & SxProp;
18
19
  declare const _default: import("react").ForwardRefExoticComponent<{
19
20
  isOpen?: boolean | undefined;
20
21
  onDismiss?: (() => void) | undefined;
22
+ isOutsideClickDismissable?: boolean | undefined;
21
23
  size?: DialogSizeType | undefined;
22
24
  initialFocusRef?: RefObject<HTMLElement> | undefined;
23
25
  } & SxProp & {
package/dist/index.js CHANGED
@@ -19002,6 +19002,7 @@ const Dialog = ({
19002
19002
  children,
19003
19003
  isOpen,
19004
19004
  onDismiss,
19005
+ isOutsideClickDismissable = true,
19005
19006
  size = 'm',
19006
19007
  initialFocusRef,
19007
19008
  sx
@@ -19030,13 +19031,13 @@ const Dialog = ({
19030
19031
  disabled: !isOpen
19031
19032
  });
19032
19033
  React.useEffect(() => {
19033
- if (isOpen) {
19034
+ if (isOpen && isOutsideClickDismissable) {
19034
19035
  document.addEventListener('click', handleOutsideClick);
19035
19036
  return () => {
19036
19037
  document.removeEventListener('click', handleOutsideClick);
19037
19038
  };
19038
19039
  }
19039
- }, [isOpen, handleOutsideClick]);
19040
+ }, [isOpen, isOutsideClickDismissable, handleOutsideClick]);
19040
19041
  return isOpen ? /*#__PURE__*/jsxRuntimeExports.jsxs(View, {
19041
19042
  sx: {
19042
19043
  position: 'fixed',
@@ -19077,6 +19078,12 @@ const Dialog = ({
19077
19078
  marginX: [0, 0, 'auto'],
19078
19079
  marginY: 'auto',
19079
19080
  borderRadius: ['none', 'none', 'l']
19081
+ } : size === 'full' ? {
19082
+ height: ['100%', '100%', 'calc(100vh - 40px)'],
19083
+ width: ['100%', '100%', 'calc(100vw - 40px)'],
19084
+ marginX: [0, 0, 'auto'],
19085
+ marginY: 'auto',
19086
+ borderRadius: ['none', 'none', 'l']
19080
19087
  } : {}),
19081
19088
  ...sx
19082
19089
  },
@@ -22,6 +22,7 @@ const Dialog = ({
22
22
  children,
23
23
  isOpen,
24
24
  onDismiss,
25
+ isOutsideClickDismissable = true,
25
26
  size = 'm',
26
27
  initialFocusRef,
27
28
  sx
@@ -50,13 +51,13 @@ const Dialog = ({
50
51
  disabled: !isOpen
51
52
  });
52
53
  useEffect(() => {
53
- if (isOpen) {
54
+ if (isOpen && isOutsideClickDismissable) {
54
55
  document.addEventListener('click', handleOutsideClick);
55
56
  return () => {
56
57
  document.removeEventListener('click', handleOutsideClick);
57
58
  };
58
59
  }
59
- }, [isOpen, handleOutsideClick]);
60
+ }, [isOpen, isOutsideClickDismissable, handleOutsideClick]);
60
61
  return isOpen ? /*#__PURE__*/jsxRuntimeExports.jsxs(View, {
61
62
  sx: {
62
63
  position: 'fixed',
@@ -97,6 +98,12 @@ const Dialog = ({
97
98
  marginX: [0, 0, 'auto'],
98
99
  marginY: 'auto',
99
100
  borderRadius: ['none', 'none', 'l']
101
+ } : size === 'full' ? {
102
+ height: ['100%', '100%', 'calc(100vh - 40px)'],
103
+ width: ['100%', '100%', 'calc(100vw - 40px)'],
104
+ marginX: [0, 0, 'auto'],
105
+ marginY: 'auto',
106
+ borderRadius: ['none', 'none', 'l']
100
107
  } : {}),
101
108
  ...sx
102
109
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.19.29",
3
+ "version": "2.19.30",
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",
@@ -65,5 +65,5 @@
65
65
  "react-textarea-autosize": "^8.5.3",
66
66
  "styled-system": "^5.1.5"
67
67
  },
68
- "gitHead": "1a074f05104380da3b4f6e89d94c4853870dd489"
68
+ "gitHead": "0efd1dddc8466518e381a7fa855f19f2a7e5a7b3"
69
69
  }