@teamturing/react-kit 2.35.2 → 2.37.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/Chip/index.d.ts +1 -1
- package/dist/core/FormControl/FormControlTooltipIcon.d.ts +7 -0
- package/dist/core/FormControl/index.d.ts +5 -3
- package/dist/core/Tooltip/index.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +49 -6
- package/esm/core/Chip/index.js +7 -0
- package/esm/core/FormControl/FormControlTooltipIcon.js +25 -0
- package/esm/core/FormControl/index.js +25 -6
- package/package.json +2 -2
|
@@ -10,7 +10,7 @@ type Props = {
|
|
|
10
10
|
/**
|
|
11
11
|
* 색을 정의합니다.
|
|
12
12
|
*/
|
|
13
|
-
variant?: 'primary' | 'secondary' | 'outlined-primary' | 'outlined-neutral' | 'neutral' | 'red' | 'red-accent' | 'yellow' | 'green' | 'dim';
|
|
13
|
+
variant?: 'primary' | 'secondary' | 'outlined-primary' | 'outlined-neutral' | 'neutral' | 'red' | 'red-accent' | 'yellow' | 'green' | 'blue' | 'dim';
|
|
14
14
|
/**
|
|
15
15
|
* 텍스트 앞에 보여질 아이콘을 정의합니다.
|
|
16
16
|
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { StyledIconProps } from '../StyledIcon';
|
|
3
|
+
import { TooltipProps } from '../Tooltip';
|
|
4
|
+
type Props = {} & Partial<StyledIconProps> & Pick<TooltipProps, 'text' | 'direction'>;
|
|
5
|
+
declare const FormControlTooltipIcon: ({ text, direction, icon, size, color, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default FormControlTooltipIcon;
|
|
7
|
+
export type { Props as FormControlTooltipIconProps };
|
|
@@ -4,6 +4,7 @@ import { FormControlCaptionProps } from './FormControlCaption';
|
|
|
4
4
|
import { FormControlErrorMessageProps } from './FormControlErrorMessage';
|
|
5
5
|
import { FormControlLabelProps } from './FormControlLabel';
|
|
6
6
|
import { FormControlSuccessMessageProps } from './FormControlSuccessMessage';
|
|
7
|
+
import { FormControlTooltipIconProps } from './FormControlTooltipIcon';
|
|
7
8
|
type Props = {
|
|
8
9
|
/**
|
|
9
10
|
* `FormControl`의 Input 요소를 컨트롤하기 위한 ID입니다. `Label`, `Caption`과 연결짓기 위해 사용합니다.
|
|
@@ -18,7 +19,7 @@ type Props = {
|
|
|
18
19
|
*/
|
|
19
20
|
required?: boolean;
|
|
20
21
|
/**
|
|
21
|
-
* @default TextInput, Select, SearchSelectInput, Checkbox
|
|
22
|
+
* @default TextInput, Textarea, Select, SearchSelectInput, Checkbox, Radio, Switch
|
|
22
23
|
*
|
|
23
24
|
* FormControl이 허용하는 Input 컴포넌트를 추가로 정의합니다.
|
|
24
25
|
*/
|
|
@@ -45,7 +46,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
45
46
|
*/
|
|
46
47
|
required?: boolean | undefined;
|
|
47
48
|
/**
|
|
48
|
-
* @default TextInput, Select, SearchSelectInput, Checkbox
|
|
49
|
+
* @default TextInput, Textarea, Select, SearchSelectInput, Checkbox, Radio, Switch
|
|
49
50
|
*
|
|
50
51
|
* FormControl이 허용하는 Input 컴포넌트를 추가로 정의합니다.
|
|
51
52
|
*/
|
|
@@ -63,7 +64,8 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
63
64
|
SuccessMessage: ({ children }: {
|
|
64
65
|
children?: import("react").ReactNode;
|
|
65
66
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
TooltipIcon: ({ text, direction, icon, size, color, ...props }: PropsWithChildren<FormControlTooltipIconProps>) => import("react/jsx-runtime").JSX.Element;
|
|
66
68
|
};
|
|
67
69
|
export default _default;
|
|
68
70
|
export { FormControlContext };
|
|
69
|
-
export type { Props as FormControlProps, FormControlFieldProps, FormControlContextValue, FormControlCaptionProps, FormControlErrorMessageProps, FormControlLabelProps, FormControlSuccessMessageProps, };
|
|
71
|
+
export type { Props as FormControlProps, FormControlFieldProps, FormControlContextValue, FormControlCaptionProps, FormControlErrorMessageProps, FormControlLabelProps, FormControlSuccessMessageProps, FormControlTooltipIconProps, };
|
|
@@ -26,4 +26,4 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
26
26
|
children?: import("react").ReactNode;
|
|
27
27
|
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
28
28
|
export default _default;
|
|
29
|
-
export type { Props as
|
|
29
|
+
export type { Props as TooltipProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export type { EmptyStateProps } from './core/EmptyState';
|
|
|
32
32
|
export { default as Flash } from './core/Flash';
|
|
33
33
|
export type { FlashProps } from './core/Flash';
|
|
34
34
|
export { default as FormControl } from './core/FormControl';
|
|
35
|
-
export type { FormControlProps, FormControlFieldProps, FormControlCaptionProps, FormControlErrorMessageProps, FormControlLabelProps, FormControlSuccessMessageProps, } from './core/FormControl';
|
|
35
|
+
export type { FormControlProps, FormControlFieldProps, FormControlCaptionProps, FormControlErrorMessageProps, FormControlLabelProps, FormControlSuccessMessageProps, FormControlTooltipIconProps, } from './core/FormControl';
|
|
36
36
|
export { default as GradientText } from './core/GradientText';
|
|
37
37
|
export type { GradientTextProps } from './core/GradientText';
|
|
38
38
|
export { default as Grid } from './core/Grid';
|
|
@@ -84,7 +84,7 @@ export { default as ThemeProvider } from './core/ThemeProvider';
|
|
|
84
84
|
export { default as Toast } from './core/Toast';
|
|
85
85
|
export type { ToastProps } from './core/Toast';
|
|
86
86
|
export { default as Tooltip } from './core/Tooltip';
|
|
87
|
-
export type {
|
|
87
|
+
export type { TooltipProps } from './core/Tooltip';
|
|
88
88
|
export { default as View } from './core/View';
|
|
89
89
|
export type { ViewProps } from './core/View';
|
|
90
90
|
export { default as UnstyledButton } from './core/_UnstyledButton';
|
package/dist/index.js
CHANGED
|
@@ -17602,6 +17602,13 @@ const BaseChip = styled__default.default.span(({
|
|
|
17602
17602
|
color: theme.colors['icon/accent/green']
|
|
17603
17603
|
}
|
|
17604
17604
|
},
|
|
17605
|
+
'blue': {
|
|
17606
|
+
'backgroundColor': theme.colors['bg/accent/blue/subtlest'],
|
|
17607
|
+
'color': theme.colors['text/accent/blue'],
|
|
17608
|
+
'& svg': {
|
|
17609
|
+
color: theme.colors['icon/accent/blue']
|
|
17610
|
+
}
|
|
17611
|
+
},
|
|
17605
17612
|
'dim': {
|
|
17606
17613
|
'backgroundColor': theme.colors['dim'],
|
|
17607
17614
|
'color': theme.colors['text/inverse'],
|
|
@@ -37076,6 +37083,24 @@ const StyledText = styled__default.default(Text)`
|
|
|
37076
37083
|
animation: 170ms ${successMessageKeyframe} cubic-bezier(0.44, 0.74, 0.36, 1);
|
|
37077
37084
|
`;
|
|
37078
37085
|
|
|
37086
|
+
const FormControlTooltipIcon = ({
|
|
37087
|
+
text,
|
|
37088
|
+
direction,
|
|
37089
|
+
icon = SvgInfoInCircle,
|
|
37090
|
+
size = 16,
|
|
37091
|
+
color = 'icon/neutral',
|
|
37092
|
+
...props
|
|
37093
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Tooltip$1, {
|
|
37094
|
+
text: text,
|
|
37095
|
+
direction: direction,
|
|
37096
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(StyledIcon, {
|
|
37097
|
+
icon: icon,
|
|
37098
|
+
size: size,
|
|
37099
|
+
color: color,
|
|
37100
|
+
...props
|
|
37101
|
+
})
|
|
37102
|
+
});
|
|
37103
|
+
|
|
37079
37104
|
const FormControlContext = /*#__PURE__*/React.createContext({});
|
|
37080
37105
|
const FormControl = ({
|
|
37081
37106
|
children: propChildren,
|
|
@@ -37092,7 +37117,8 @@ const FormControl = ({
|
|
|
37092
37117
|
label: FormControlLabel,
|
|
37093
37118
|
caption: FormControlCaption,
|
|
37094
37119
|
errorMessage: FormControlErrorMessage,
|
|
37095
|
-
successMessage: FormControlSuccessMessage
|
|
37120
|
+
successMessage: FormControlSuccessMessage,
|
|
37121
|
+
tooltipIcon: FormControlTooltipIcon
|
|
37096
37122
|
}
|
|
37097
37123
|
});
|
|
37098
37124
|
const inputComponentCandidates = [TextInput$1, Textarea, Select$1, SearchSelectInput$1, Checkbox$1, Radio$1, Switch$1, ...additionalInputComponentCandidates];
|
|
@@ -37124,15 +37150,23 @@ const FormControl = ({
|
|
|
37124
37150
|
mt: 0.5
|
|
37125
37151
|
}
|
|
37126
37152
|
},
|
|
37127
|
-
children: [
|
|
37153
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs(View, {
|
|
37154
|
+
className: 'form_control__label_wrapper__horizontal',
|
|
37155
|
+
display: 'flex',
|
|
37156
|
+
alignItems: 'center',
|
|
37157
|
+
sx: {
|
|
37158
|
+
columnGap: 1
|
|
37159
|
+
},
|
|
37160
|
+
children: [relocatableComponentsObject.label, relocatableComponentsObject.tooltipIcon]
|
|
37161
|
+
}), relocatableComponentsObject.caption, relocatableComponentsObject.errorMessage, relocatableComponentsObject.successMessage]
|
|
37128
37162
|
})]
|
|
37129
37163
|
}) : /*#__PURE__*/jsxRuntimeExports.jsxs(View, {
|
|
37130
37164
|
ref: ref,
|
|
37131
37165
|
display: 'flex',
|
|
37132
37166
|
flexDirection: 'column',
|
|
37133
37167
|
sx: {
|
|
37134
|
-
'&
|
|
37135
|
-
mb: 1
|
|
37168
|
+
'& .form_control__label_wrapper__vertical': {
|
|
37169
|
+
mb: relocatableComponentsObject.label?.props.visuallyHidden ? 0 : 1
|
|
37136
37170
|
},
|
|
37137
37171
|
'& > span': {
|
|
37138
37172
|
mt: 1
|
|
@@ -37140,7 +37174,15 @@ const FormControl = ({
|
|
|
37140
37174
|
...sx
|
|
37141
37175
|
},
|
|
37142
37176
|
...props,
|
|
37143
|
-
children: [
|
|
37177
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs(View, {
|
|
37178
|
+
className: 'form_control__label_wrapper__vertical',
|
|
37179
|
+
display: 'flex',
|
|
37180
|
+
alignItems: 'center',
|
|
37181
|
+
sx: {
|
|
37182
|
+
columnGap: 1
|
|
37183
|
+
},
|
|
37184
|
+
children: [relocatableComponentsObject.label, relocatableComponentsObject.tooltipIcon]
|
|
37185
|
+
}), /*#__PURE__*/React.cloneElement(InputComponent, {
|
|
37144
37186
|
id,
|
|
37145
37187
|
disabled
|
|
37146
37188
|
}), relocatableComponentsObject.caption, relocatableComponentsObject.errorMessage, relocatableComponentsObject.successMessage]
|
|
@@ -37151,7 +37193,8 @@ var index$5 = Object.assign( /*#__PURE__*/React.forwardRef(FormControl), {
|
|
|
37151
37193
|
Label: FormControlLabel,
|
|
37152
37194
|
Caption: FormControlCaption,
|
|
37153
37195
|
ErrorMessage: FormControlErrorMessage,
|
|
37154
|
-
SuccessMessage: FormControlSuccessMessage
|
|
37196
|
+
SuccessMessage: FormControlSuccessMessage,
|
|
37197
|
+
TooltipIcon: FormControlTooltipIcon
|
|
37155
37198
|
});
|
|
37156
37199
|
|
|
37157
37200
|
const GradientText = styled__default.default(Text)`
|
package/esm/core/Chip/index.js
CHANGED
|
@@ -171,6 +171,13 @@ const BaseChip = styled.span(({
|
|
|
171
171
|
color: theme.colors['icon/accent/green']
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
|
+
'blue': {
|
|
175
|
+
'backgroundColor': theme.colors['bg/accent/blue/subtlest'],
|
|
176
|
+
'color': theme.colors['text/accent/blue'],
|
|
177
|
+
'& svg': {
|
|
178
|
+
color: theme.colors['icon/accent/blue']
|
|
179
|
+
}
|
|
180
|
+
},
|
|
174
181
|
'dim': {
|
|
175
182
|
'backgroundColor': theme.colors['dim'],
|
|
176
183
|
'color': theme.colors['text/inverse'],
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
import SvgInfoInCircle from '../../packages/icons/esm/InfoInCircle.js';
|
|
3
|
+
import StyledIcon from '../StyledIcon/index.js';
|
|
4
|
+
import Tooltip from '../Tooltip/index.js';
|
|
5
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
6
|
+
|
|
7
|
+
const FormControlTooltipIcon = ({
|
|
8
|
+
text,
|
|
9
|
+
direction,
|
|
10
|
+
icon = SvgInfoInCircle,
|
|
11
|
+
size = 16,
|
|
12
|
+
color = 'icon/neutral',
|
|
13
|
+
...props
|
|
14
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Tooltip, {
|
|
15
|
+
text: text,
|
|
16
|
+
direction: direction,
|
|
17
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(StyledIcon, {
|
|
18
|
+
icon: icon,
|
|
19
|
+
size: size,
|
|
20
|
+
color: color,
|
|
21
|
+
...props
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { FormControlTooltipIcon as default };
|
|
@@ -12,6 +12,7 @@ import FormControlCaption from './FormControlCaption.js';
|
|
|
12
12
|
import FormControlErrorMessage from './FormControlErrorMessage.js';
|
|
13
13
|
import FormControlLabel from './FormControlLabel.js';
|
|
14
14
|
import FormControlSuccessMessage from './FormControlSuccessMessage.js';
|
|
15
|
+
import FormControlTooltipIcon from './FormControlTooltipIcon.js';
|
|
15
16
|
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
16
17
|
|
|
17
18
|
const FormControlContext = /*#__PURE__*/createContext({});
|
|
@@ -30,7 +31,8 @@ const FormControl = ({
|
|
|
30
31
|
label: FormControlLabel,
|
|
31
32
|
caption: FormControlCaption,
|
|
32
33
|
errorMessage: FormControlErrorMessage,
|
|
33
|
-
successMessage: FormControlSuccessMessage
|
|
34
|
+
successMessage: FormControlSuccessMessage,
|
|
35
|
+
tooltipIcon: FormControlTooltipIcon
|
|
34
36
|
}
|
|
35
37
|
});
|
|
36
38
|
const inputComponentCandidates = [TextInput, Textarea, Select, SearchSelectInput, Checkbox, Radio, Switch, ...additionalInputComponentCandidates];
|
|
@@ -62,15 +64,23 @@ const FormControl = ({
|
|
|
62
64
|
mt: 0.5
|
|
63
65
|
}
|
|
64
66
|
},
|
|
65
|
-
children: [
|
|
67
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs(View, {
|
|
68
|
+
className: 'form_control__label_wrapper__horizontal',
|
|
69
|
+
display: 'flex',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
sx: {
|
|
72
|
+
columnGap: 1
|
|
73
|
+
},
|
|
74
|
+
children: [relocatableComponentsObject.label, relocatableComponentsObject.tooltipIcon]
|
|
75
|
+
}), relocatableComponentsObject.caption, relocatableComponentsObject.errorMessage, relocatableComponentsObject.successMessage]
|
|
66
76
|
})]
|
|
67
77
|
}) : /*#__PURE__*/jsxRuntimeExports.jsxs(View, {
|
|
68
78
|
ref: ref,
|
|
69
79
|
display: 'flex',
|
|
70
80
|
flexDirection: 'column',
|
|
71
81
|
sx: {
|
|
72
|
-
'&
|
|
73
|
-
mb: 1
|
|
82
|
+
'& .form_control__label_wrapper__vertical': {
|
|
83
|
+
mb: relocatableComponentsObject.label?.props.visuallyHidden ? 0 : 1
|
|
74
84
|
},
|
|
75
85
|
'& > span': {
|
|
76
86
|
mt: 1
|
|
@@ -78,7 +88,15 @@ const FormControl = ({
|
|
|
78
88
|
...sx
|
|
79
89
|
},
|
|
80
90
|
...props,
|
|
81
|
-
children: [
|
|
91
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs(View, {
|
|
92
|
+
className: 'form_control__label_wrapper__vertical',
|
|
93
|
+
display: 'flex',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
sx: {
|
|
96
|
+
columnGap: 1
|
|
97
|
+
},
|
|
98
|
+
children: [relocatableComponentsObject.label, relocatableComponentsObject.tooltipIcon]
|
|
99
|
+
}), /*#__PURE__*/cloneElement(InputComponent, {
|
|
82
100
|
id,
|
|
83
101
|
disabled
|
|
84
102
|
}), relocatableComponentsObject.caption, relocatableComponentsObject.errorMessage, relocatableComponentsObject.successMessage]
|
|
@@ -89,7 +107,8 @@ var index = Object.assign( /*#__PURE__*/forwardRef(FormControl), {
|
|
|
89
107
|
Label: FormControlLabel,
|
|
90
108
|
Caption: FormControlCaption,
|
|
91
109
|
ErrorMessage: FormControlErrorMessage,
|
|
92
|
-
SuccessMessage: FormControlSuccessMessage
|
|
110
|
+
SuccessMessage: FormControlSuccessMessage,
|
|
111
|
+
TooltipIcon: FormControlTooltipIcon
|
|
93
112
|
});
|
|
94
113
|
|
|
95
114
|
export { FormControlContext, index as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamturing/react-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.37.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": "
|
|
69
|
+
"gitHead": "6b66bf6e4f83bcc20016fe0c8054195745c3ba3d"
|
|
70
70
|
}
|