@teamturing/react-kit 2.65.1 → 2.67.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/Toast/index.d.ts +9 -3
- package/dist/index.js +15 -18
- package/esm/core/Dialog/index.js +4 -2
- package/esm/core/Drawer/index.js +4 -2
- package/esm/core/IconButton/index.js +2 -2
- package/esm/core/IconToggleButton/index.js +2 -2
- package/esm/core/Toast/index.js +7 -12
- package/package.json +2 -2
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { ComponentType, PropsWithChildren, SVGProps } from 'react';
|
|
2
2
|
import { ResponsiveValue } from 'styled-system';
|
|
3
|
+
type ToastVariantType = 'success' | 'warning';
|
|
3
4
|
type Props = {
|
|
4
5
|
/**
|
|
5
6
|
* 변주에 대해 정의합니다.
|
|
6
7
|
*/
|
|
7
|
-
variant?:
|
|
8
|
+
variant?: ToastVariantType;
|
|
9
|
+
/**
|
|
10
|
+
* 아이콘을 정의합니다.
|
|
11
|
+
* 기본값은 variant에 따라 결정됩니다.
|
|
12
|
+
*/
|
|
13
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
8
14
|
/**
|
|
9
15
|
* 크기 변화에 대한 행동을 정의합니다.
|
|
10
16
|
* 반응형 디자인이 적용됩니다.
|
|
11
17
|
*/
|
|
12
18
|
resizing?: ResponsiveValue<'hug' | 'fill'>;
|
|
13
19
|
};
|
|
14
|
-
declare const Toast: ({ variant, resizing, children }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare const Toast: ({ variant, icon: Icon, resizing, children, }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
|
|
15
21
|
export default Toast;
|
|
16
22
|
export type { Props as ToastProps };
|
package/dist/index.js
CHANGED
|
@@ -5249,8 +5249,8 @@ const BaseIconButton = /*#__PURE__*/styled__default.default(UnstyledButton).with
|
|
|
5249
5249
|
m: {
|
|
5250
5250
|
'p': 2,
|
|
5251
5251
|
'& svg': {
|
|
5252
|
-
width:
|
|
5253
|
-
height:
|
|
5252
|
+
width: 20,
|
|
5253
|
+
height: 20
|
|
5254
5254
|
}
|
|
5255
5255
|
},
|
|
5256
5256
|
s: {
|
|
@@ -5521,6 +5521,7 @@ const Dialog = ({
|
|
|
5521
5521
|
initialFocusRef,
|
|
5522
5522
|
sx
|
|
5523
5523
|
}, ref) => {
|
|
5524
|
+
const theme = styled.useTheme();
|
|
5524
5525
|
const handleDismiss = React.useCallback(() => onDismiss?.(), [onDismiss]);
|
|
5525
5526
|
const blanketRef = React.useRef(null);
|
|
5526
5527
|
const dialogRef = React.useRef(null);
|
|
@@ -5630,7 +5631,7 @@ const Dialog = ({
|
|
|
5630
5631
|
children: [/*#__PURE__*/jsxRuntime.jsx(View, {
|
|
5631
5632
|
sx: {
|
|
5632
5633
|
position: 'absolute',
|
|
5633
|
-
top: 3,
|
|
5634
|
+
top: utils.forcePixelValue(theme.space[3] + theme.space['0.5']),
|
|
5634
5635
|
right: 3
|
|
5635
5636
|
},
|
|
5636
5637
|
children: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
|
|
@@ -5780,6 +5781,7 @@ const Drawer = ({
|
|
|
5780
5781
|
initialFocusRef,
|
|
5781
5782
|
sx
|
|
5782
5783
|
}, ref) => {
|
|
5784
|
+
const theme = styled.useTheme();
|
|
5783
5785
|
const handleDismiss = React.useCallback(() => onDismiss?.(), [onDismiss]);
|
|
5784
5786
|
const blanketRef = React.useRef(null);
|
|
5785
5787
|
const drawerRef = React.useRef(null);
|
|
@@ -5893,7 +5895,7 @@ const Drawer = ({
|
|
|
5893
5895
|
children: [/*#__PURE__*/jsxRuntime.jsx(View, {
|
|
5894
5896
|
sx: {
|
|
5895
5897
|
position: 'absolute',
|
|
5896
|
-
top: 2,
|
|
5898
|
+
top: utils.forcePixelValue(theme.space[2] + theme.space['0.5']),
|
|
5897
5899
|
right: 5
|
|
5898
5900
|
},
|
|
5899
5901
|
children: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
|
|
@@ -6481,8 +6483,8 @@ const BaseIconToggleButton = /*#__PURE__*/styled__default.default(UnstyledButton
|
|
|
6481
6483
|
m: {
|
|
6482
6484
|
'p': 2,
|
|
6483
6485
|
'& svg': {
|
|
6484
|
-
width:
|
|
6485
|
-
height:
|
|
6486
|
+
width: 20,
|
|
6487
|
+
height: 20
|
|
6486
6488
|
}
|
|
6487
6489
|
},
|
|
6488
6490
|
s: {
|
|
@@ -7432,17 +7434,16 @@ const ThemeProvider = ({
|
|
|
7432
7434
|
|
|
7433
7435
|
const Toast = ({
|
|
7434
7436
|
variant = 'success',
|
|
7437
|
+
icon: Icon = variant === 'success' ? icons.CheckInCircleIcon : icons.ExclamationPointInCircleIcon,
|
|
7435
7438
|
resizing = 'hug',
|
|
7436
7439
|
children
|
|
7437
7440
|
}) => {
|
|
7438
|
-
const IconByVariant = {
|
|
7439
|
-
success: icons.CheckInCircleIcon,
|
|
7440
|
-
warning: icons.ExclamationPointInCircleIcon
|
|
7441
|
-
}[variant];
|
|
7442
7441
|
return /*#__PURE__*/jsxRuntime.jsxs(BaseToast, {
|
|
7443
7442
|
variant: variant,
|
|
7444
7443
|
resizing: resizing,
|
|
7445
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
7444
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
7445
|
+
className: 'toast__leading_icon'
|
|
7446
|
+
}), children]
|
|
7446
7447
|
});
|
|
7447
7448
|
};
|
|
7448
7449
|
const BaseToast = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
@@ -7462,11 +7463,7 @@ const BaseToast = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
|
7462
7463
|
'fontSize': theme.fontSizes.s,
|
|
7463
7464
|
'fontWeight': theme.fontWeights.medium,
|
|
7464
7465
|
'lineHeight': theme.lineHeights[2],
|
|
7465
|
-
'&
|
|
7466
|
-
margin: 0,
|
|
7467
|
-
display: 'inline-block'
|
|
7468
|
-
},
|
|
7469
|
-
'& svg': {
|
|
7466
|
+
'& .toast__leading_icon': {
|
|
7470
7467
|
width: 24,
|
|
7471
7468
|
minWidth: 24,
|
|
7472
7469
|
height: 24,
|
|
@@ -7478,12 +7475,12 @@ const BaseToast = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
|
7478
7475
|
prop: 'variant',
|
|
7479
7476
|
variants: {
|
|
7480
7477
|
success: {
|
|
7481
|
-
'&
|
|
7478
|
+
'& .toast__leading_icon': {
|
|
7482
7479
|
color: theme.colors['icon/success']
|
|
7483
7480
|
}
|
|
7484
7481
|
},
|
|
7485
7482
|
warning: {
|
|
7486
|
-
'&
|
|
7483
|
+
'& .toast__leading_icon': {
|
|
7487
7484
|
color: theme.colors['icon/warning']
|
|
7488
7485
|
}
|
|
7489
7486
|
}
|
package/esm/core/Dialog/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CloseIcon } from '@teamturing/icons';
|
|
2
|
+
import { forcePixelValue } from '@teamturing/utils';
|
|
2
3
|
import { AnimatePresence, cubicBezier } from 'framer-motion';
|
|
3
4
|
import { forwardRef, useCallback, useRef, useImperativeHandle, useEffect } from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
+
import styled, { useTheme } from 'styled-components';
|
|
5
6
|
import IconButton from '../IconButton/index.js';
|
|
6
7
|
import View from '../View/index.js';
|
|
7
8
|
import useFocusTrap from '../../hook/useFocusTrap.js';
|
|
@@ -26,6 +27,7 @@ const Dialog = ({
|
|
|
26
27
|
initialFocusRef,
|
|
27
28
|
sx
|
|
28
29
|
}, ref) => {
|
|
30
|
+
const theme = useTheme();
|
|
29
31
|
const handleDismiss = useCallback(() => onDismiss?.(), [onDismiss]);
|
|
30
32
|
const blanketRef = useRef(null);
|
|
31
33
|
const dialogRef = useRef(null);
|
|
@@ -135,7 +137,7 @@ const Dialog = ({
|
|
|
135
137
|
children: [/*#__PURE__*/jsx(View, {
|
|
136
138
|
sx: {
|
|
137
139
|
position: 'absolute',
|
|
138
|
-
top: 3,
|
|
140
|
+
top: forcePixelValue(theme.space[3] + theme.space['0.5']),
|
|
139
141
|
right: 3
|
|
140
142
|
},
|
|
141
143
|
children: /*#__PURE__*/jsx(IconButton, {
|
package/esm/core/Drawer/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CloseIcon } from '@teamturing/icons';
|
|
2
|
+
import { forcePixelValue } from '@teamturing/utils';
|
|
2
3
|
import { AnimatePresence, easeInOut } from 'framer-motion';
|
|
3
4
|
import { forwardRef, useCallback, useRef, useImperativeHandle, useEffect } from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
+
import styled, { useTheme } from 'styled-components';
|
|
5
6
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
6
7
|
import useFocusTrap from '../../hook/useFocusTrap.js';
|
|
7
8
|
import { sx } from '../../utils/styled-system/index.js';
|
|
@@ -28,6 +29,7 @@ const Drawer = ({
|
|
|
28
29
|
initialFocusRef,
|
|
29
30
|
sx
|
|
30
31
|
}, ref) => {
|
|
32
|
+
const theme = useTheme();
|
|
31
33
|
const handleDismiss = useCallback(() => onDismiss?.(), [onDismiss]);
|
|
32
34
|
const blanketRef = useRef(null);
|
|
33
35
|
const drawerRef = useRef(null);
|
|
@@ -141,7 +143,7 @@ const Drawer = ({
|
|
|
141
143
|
children: [/*#__PURE__*/jsx(View, {
|
|
142
144
|
sx: {
|
|
143
145
|
position: 'absolute',
|
|
144
|
-
top: 2,
|
|
146
|
+
top: forcePixelValue(theme.space[2] + theme.space['0.5']),
|
|
145
147
|
right: 5
|
|
146
148
|
},
|
|
147
149
|
children: /*#__PURE__*/jsx(IconButton, {
|
package/esm/core/Toast/index.js
CHANGED
|
@@ -6,17 +6,16 @@ import { variant } from '../../node_modules/@styled-system/variant/dist/index.es
|
|
|
6
6
|
|
|
7
7
|
const Toast = ({
|
|
8
8
|
variant = 'success',
|
|
9
|
+
icon: Icon = variant === 'success' ? CheckInCircleIcon : ExclamationPointInCircleIcon,
|
|
9
10
|
resizing = 'hug',
|
|
10
11
|
children
|
|
11
12
|
}) => {
|
|
12
|
-
const IconByVariant = {
|
|
13
|
-
success: CheckInCircleIcon,
|
|
14
|
-
warning: ExclamationPointInCircleIcon
|
|
15
|
-
}[variant];
|
|
16
13
|
return /*#__PURE__*/jsxs(BaseToast, {
|
|
17
14
|
variant: variant,
|
|
18
15
|
resizing: resizing,
|
|
19
|
-
children: [/*#__PURE__*/jsx(
|
|
16
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
17
|
+
className: 'toast__leading_icon'
|
|
18
|
+
}), children]
|
|
20
19
|
});
|
|
21
20
|
};
|
|
22
21
|
const BaseToast = /*#__PURE__*/styled.div.withConfig({
|
|
@@ -36,11 +35,7 @@ const BaseToast = /*#__PURE__*/styled.div.withConfig({
|
|
|
36
35
|
'fontSize': theme.fontSizes.s,
|
|
37
36
|
'fontWeight': theme.fontWeights.medium,
|
|
38
37
|
'lineHeight': theme.lineHeights[2],
|
|
39
|
-
'&
|
|
40
|
-
margin: 0,
|
|
41
|
-
display: 'inline-block'
|
|
42
|
-
},
|
|
43
|
-
'& svg': {
|
|
38
|
+
'& .toast__leading_icon': {
|
|
44
39
|
width: 24,
|
|
45
40
|
minWidth: 24,
|
|
46
41
|
height: 24,
|
|
@@ -52,12 +47,12 @@ const BaseToast = /*#__PURE__*/styled.div.withConfig({
|
|
|
52
47
|
prop: 'variant',
|
|
53
48
|
variants: {
|
|
54
49
|
success: {
|
|
55
|
-
'&
|
|
50
|
+
'& .toast__leading_icon': {
|
|
56
51
|
color: theme.colors['icon/success']
|
|
57
52
|
}
|
|
58
53
|
},
|
|
59
54
|
warning: {
|
|
60
|
-
'&
|
|
55
|
+
'& .toast__leading_icon': {
|
|
61
56
|
color: theme.colors['icon/warning']
|
|
62
57
|
}
|
|
63
58
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamturing/react-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.67.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": "4cbea2311c3a6e06924ab571b29c4d35de67f507"
|
|
69
69
|
}
|