@teamturing/react-kit 2.72.0 → 2.73.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.
- package/dist/core/Dialog/index.d.ts +2 -0
- package/dist/index.js +44 -9
- package/esm/core/Dialog/index.js +45 -10
- package/package.json +2 -2
|
@@ -18,6 +18,7 @@ type Props = {
|
|
|
18
18
|
size?: DialogSizeType;
|
|
19
19
|
initialFocusRef?: RefObject<HTMLElement>;
|
|
20
20
|
motionProps?: DialogMotionProps;
|
|
21
|
+
blanketMotionProps?: DialogMotionProps;
|
|
21
22
|
} & SxProp;
|
|
22
23
|
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
23
24
|
isOpen?: boolean | undefined;
|
|
@@ -26,6 +27,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
26
27
|
size?: DialogSizeType | undefined;
|
|
27
28
|
initialFocusRef?: RefObject<HTMLElement> | undefined;
|
|
28
29
|
motionProps?: Partial<Pick<HTMLMotionProps<"div">, "transition" | "initial" | "animate" | "exit">> | undefined;
|
|
30
|
+
blanketMotionProps?: Partial<Pick<HTMLMotionProps<"div">, "transition" | "initial" | "animate" | "exit">> | undefined;
|
|
29
31
|
} & SxProp & {
|
|
30
32
|
children?: import("react").ReactNode;
|
|
31
33
|
} & import("react").RefAttributes<HTMLDivElement>> & {
|
package/dist/index.js
CHANGED
|
@@ -5643,6 +5643,21 @@ const DEFAULT_MOTION_PROPS = {
|
|
|
5643
5643
|
ease: framerMotion.cubicBezier(0.5, 1, 0.89, 1)
|
|
5644
5644
|
}
|
|
5645
5645
|
};
|
|
5646
|
+
const DEFAULT_BLANKET_MOTION_PROPS = {
|
|
5647
|
+
initial: {
|
|
5648
|
+
opacity: 0
|
|
5649
|
+
},
|
|
5650
|
+
animate: {
|
|
5651
|
+
opacity: 1
|
|
5652
|
+
},
|
|
5653
|
+
exit: {
|
|
5654
|
+
opacity: 0
|
|
5655
|
+
},
|
|
5656
|
+
transition: {
|
|
5657
|
+
duration: 0.25,
|
|
5658
|
+
ease: framerMotion.cubicBezier(0.5, 1, 0.89, 1)
|
|
5659
|
+
}
|
|
5660
|
+
};
|
|
5646
5661
|
const Dialog = ({
|
|
5647
5662
|
children,
|
|
5648
5663
|
isOpen,
|
|
@@ -5651,6 +5666,7 @@ const Dialog = ({
|
|
|
5651
5666
|
size = 'm',
|
|
5652
5667
|
initialFocusRef,
|
|
5653
5668
|
motionProps,
|
|
5669
|
+
blanketMotionProps,
|
|
5654
5670
|
sx
|
|
5655
5671
|
}, ref) => {
|
|
5656
5672
|
const theme = styled.useTheme();
|
|
@@ -5688,8 +5704,24 @@ const Dialog = ({
|
|
|
5688
5704
|
}
|
|
5689
5705
|
}, [isOpen, isOutsideClickDismissable, handleOutsideClick]);
|
|
5690
5706
|
return /*#__PURE__*/jsxRuntime.jsx(framerMotion.AnimatePresence, {
|
|
5691
|
-
children: isOpen ? /*#__PURE__*/jsxRuntime.
|
|
5692
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
5707
|
+
children: isOpen ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
5708
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(MotionView, {
|
|
5709
|
+
initial: blanketMotionProps?.initial ?? DEFAULT_BLANKET_MOTION_PROPS.initial,
|
|
5710
|
+
animate: blanketMotionProps?.animate ?? DEFAULT_BLANKET_MOTION_PROPS.animate,
|
|
5711
|
+
exit: blanketMotionProps?.exit ?? DEFAULT_BLANKET_MOTION_PROPS.exit,
|
|
5712
|
+
transition: blanketMotionProps?.transition ?? DEFAULT_BLANKET_MOTION_PROPS.transition,
|
|
5713
|
+
sx: {
|
|
5714
|
+
position: 'fixed',
|
|
5715
|
+
top: 0,
|
|
5716
|
+
right: 0,
|
|
5717
|
+
bottom: 0,
|
|
5718
|
+
left: 0,
|
|
5719
|
+
zIndex: 9999
|
|
5720
|
+
},
|
|
5721
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Blanket$1, {
|
|
5722
|
+
ref: blanketRef
|
|
5723
|
+
})
|
|
5724
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MotionView, {
|
|
5693
5725
|
initial: motionProps?.initial ?? DEFAULT_MOTION_PROPS.initial,
|
|
5694
5726
|
animate: motionProps?.animate ?? DEFAULT_MOTION_PROPS.animate,
|
|
5695
5727
|
exit: motionProps?.exit ?? DEFAULT_MOTION_PROPS.exit,
|
|
@@ -5700,14 +5732,16 @@ const Dialog = ({
|
|
|
5700
5732
|
right: 0,
|
|
5701
5733
|
bottom: 0,
|
|
5702
5734
|
left: 0,
|
|
5703
|
-
zIndex: 9999
|
|
5735
|
+
zIndex: 9999,
|
|
5736
|
+
pointerEvents: 'none'
|
|
5704
5737
|
},
|
|
5705
|
-
children:
|
|
5706
|
-
ref: blanketRef
|
|
5707
|
-
}), /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
5738
|
+
children: /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
5708
5739
|
display: 'flex',
|
|
5709
5740
|
width: '100%',
|
|
5710
5741
|
height: '100%',
|
|
5742
|
+
sx: {
|
|
5743
|
+
pointerEvents: 'none'
|
|
5744
|
+
},
|
|
5711
5745
|
children: /*#__PURE__*/jsxRuntime.jsxs(BaseDialog, {
|
|
5712
5746
|
className: `trk-dialog--${size}`,
|
|
5713
5747
|
ref: dialogRef,
|
|
@@ -5769,8 +5803,8 @@ const Dialog = ({
|
|
|
5769
5803
|
children: children
|
|
5770
5804
|
})]
|
|
5771
5805
|
})
|
|
5772
|
-
})
|
|
5773
|
-
})
|
|
5806
|
+
})
|
|
5807
|
+
})]
|
|
5774
5808
|
}) : null
|
|
5775
5809
|
});
|
|
5776
5810
|
};
|
|
@@ -5793,7 +5827,8 @@ const BaseDialog = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
|
5793
5827
|
backgroundColor: theme.colors['surface'],
|
|
5794
5828
|
outline: 'none',
|
|
5795
5829
|
overflow: 'hidden',
|
|
5796
|
-
margin: 'auto'
|
|
5830
|
+
margin: 'auto',
|
|
5831
|
+
pointerEvents: 'auto'
|
|
5797
5832
|
}), sx);
|
|
5798
5833
|
var index$8 = Object.assign( /*#__PURE__*/React.forwardRef(Dialog), {
|
|
5799
5834
|
UnstyledHeader: UnstyledDialogHeader,
|
package/esm/core/Dialog/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import DialogHeaderTitle from './DialogHeaderTitle.js';
|
|
|
17
17
|
import UnstyledDialogBody from './_UnstyledDialogBody.js';
|
|
18
18
|
import UnstyledDialogFooter from './_UnstyledDialogFooter.js';
|
|
19
19
|
import UnstyledDialogHeader from './_UnstyledDialogHeader.js';
|
|
20
|
-
import { jsx,
|
|
20
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
21
21
|
|
|
22
22
|
const DEFAULT_MOTION_PROPS = {
|
|
23
23
|
initial: {
|
|
@@ -40,6 +40,21 @@ const DEFAULT_MOTION_PROPS = {
|
|
|
40
40
|
ease: cubicBezier(0.5, 1, 0.89, 1)
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
+
const DEFAULT_BLANKET_MOTION_PROPS = {
|
|
44
|
+
initial: {
|
|
45
|
+
opacity: 0
|
|
46
|
+
},
|
|
47
|
+
animate: {
|
|
48
|
+
opacity: 1
|
|
49
|
+
},
|
|
50
|
+
exit: {
|
|
51
|
+
opacity: 0
|
|
52
|
+
},
|
|
53
|
+
transition: {
|
|
54
|
+
duration: 0.25,
|
|
55
|
+
ease: cubicBezier(0.5, 1, 0.89, 1)
|
|
56
|
+
}
|
|
57
|
+
};
|
|
43
58
|
const Dialog = ({
|
|
44
59
|
children,
|
|
45
60
|
isOpen,
|
|
@@ -48,6 +63,7 @@ const Dialog = ({
|
|
|
48
63
|
size = 'm',
|
|
49
64
|
initialFocusRef,
|
|
50
65
|
motionProps,
|
|
66
|
+
blanketMotionProps,
|
|
51
67
|
sx
|
|
52
68
|
}, ref) => {
|
|
53
69
|
const theme = useTheme();
|
|
@@ -85,8 +101,24 @@ const Dialog = ({
|
|
|
85
101
|
}
|
|
86
102
|
}, [isOpen, isOutsideClickDismissable, handleOutsideClick]);
|
|
87
103
|
return /*#__PURE__*/jsx(AnimatePresence, {
|
|
88
|
-
children: isOpen ? /*#__PURE__*/
|
|
89
|
-
children: /*#__PURE__*/
|
|
104
|
+
children: isOpen ? /*#__PURE__*/jsxs(Fragment, {
|
|
105
|
+
children: [/*#__PURE__*/jsx(MotionView, {
|
|
106
|
+
initial: blanketMotionProps?.initial ?? DEFAULT_BLANKET_MOTION_PROPS.initial,
|
|
107
|
+
animate: blanketMotionProps?.animate ?? DEFAULT_BLANKET_MOTION_PROPS.animate,
|
|
108
|
+
exit: blanketMotionProps?.exit ?? DEFAULT_BLANKET_MOTION_PROPS.exit,
|
|
109
|
+
transition: blanketMotionProps?.transition ?? DEFAULT_BLANKET_MOTION_PROPS.transition,
|
|
110
|
+
sx: {
|
|
111
|
+
position: 'fixed',
|
|
112
|
+
top: 0,
|
|
113
|
+
right: 0,
|
|
114
|
+
bottom: 0,
|
|
115
|
+
left: 0,
|
|
116
|
+
zIndex: 9999
|
|
117
|
+
},
|
|
118
|
+
children: /*#__PURE__*/jsx(Blanket, {
|
|
119
|
+
ref: blanketRef
|
|
120
|
+
})
|
|
121
|
+
}), /*#__PURE__*/jsx(MotionView, {
|
|
90
122
|
initial: motionProps?.initial ?? DEFAULT_MOTION_PROPS.initial,
|
|
91
123
|
animate: motionProps?.animate ?? DEFAULT_MOTION_PROPS.animate,
|
|
92
124
|
exit: motionProps?.exit ?? DEFAULT_MOTION_PROPS.exit,
|
|
@@ -97,14 +129,16 @@ const Dialog = ({
|
|
|
97
129
|
right: 0,
|
|
98
130
|
bottom: 0,
|
|
99
131
|
left: 0,
|
|
100
|
-
zIndex: 9999
|
|
132
|
+
zIndex: 9999,
|
|
133
|
+
pointerEvents: 'none'
|
|
101
134
|
},
|
|
102
|
-
children:
|
|
103
|
-
ref: blanketRef
|
|
104
|
-
}), /*#__PURE__*/jsx(View, {
|
|
135
|
+
children: /*#__PURE__*/jsx(View, {
|
|
105
136
|
display: 'flex',
|
|
106
137
|
width: '100%',
|
|
107
138
|
height: '100%',
|
|
139
|
+
sx: {
|
|
140
|
+
pointerEvents: 'none'
|
|
141
|
+
},
|
|
108
142
|
children: /*#__PURE__*/jsxs(BaseDialog, {
|
|
109
143
|
className: `trk-dialog--${size}`,
|
|
110
144
|
ref: dialogRef,
|
|
@@ -166,8 +200,8 @@ const Dialog = ({
|
|
|
166
200
|
children: children
|
|
167
201
|
})]
|
|
168
202
|
})
|
|
169
|
-
})
|
|
170
|
-
})
|
|
203
|
+
})
|
|
204
|
+
})]
|
|
171
205
|
}) : null
|
|
172
206
|
});
|
|
173
207
|
};
|
|
@@ -190,7 +224,8 @@ const BaseDialog = /*#__PURE__*/styled.div.withConfig({
|
|
|
190
224
|
backgroundColor: theme.colors['surface'],
|
|
191
225
|
outline: 'none',
|
|
192
226
|
overflow: 'hidden',
|
|
193
|
-
margin: 'auto'
|
|
227
|
+
margin: 'auto',
|
|
228
|
+
pointerEvents: 'auto'
|
|
194
229
|
}), sx);
|
|
195
230
|
var index = Object.assign( /*#__PURE__*/forwardRef(Dialog), {
|
|
196
231
|
UnstyledHeader: UnstyledDialogHeader,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamturing/react-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.73.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",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"react-textarea-autosize": "^8.5.3",
|
|
66
66
|
"styled-system": "^5.1.5"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "b803956a45b587b87b805a0eff212037d35d29fa"
|
|
69
69
|
}
|