@teamturing/react-kit 2.35.2 → 2.36.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/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 +42 -6
- package/esm/core/FormControl/FormControlTooltipIcon.js +25 -0
- package/esm/core/FormControl/index.js +25 -6
- package/package.json +2 -2
|
@@ -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
|
@@ -37076,6 +37076,24 @@ const StyledText = styled__default.default(Text)`
|
|
|
37076
37076
|
animation: 170ms ${successMessageKeyframe} cubic-bezier(0.44, 0.74, 0.36, 1);
|
|
37077
37077
|
`;
|
|
37078
37078
|
|
|
37079
|
+
const FormControlTooltipIcon = ({
|
|
37080
|
+
text,
|
|
37081
|
+
direction,
|
|
37082
|
+
icon = SvgInfoInCircle,
|
|
37083
|
+
size = 16,
|
|
37084
|
+
color = 'icon/neutral',
|
|
37085
|
+
...props
|
|
37086
|
+
}) => /*#__PURE__*/jsxRuntimeExports.jsx(Tooltip$1, {
|
|
37087
|
+
text: text,
|
|
37088
|
+
direction: direction,
|
|
37089
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(StyledIcon, {
|
|
37090
|
+
icon: icon,
|
|
37091
|
+
size: size,
|
|
37092
|
+
color: color,
|
|
37093
|
+
...props
|
|
37094
|
+
})
|
|
37095
|
+
});
|
|
37096
|
+
|
|
37079
37097
|
const FormControlContext = /*#__PURE__*/React.createContext({});
|
|
37080
37098
|
const FormControl = ({
|
|
37081
37099
|
children: propChildren,
|
|
@@ -37092,7 +37110,8 @@ const FormControl = ({
|
|
|
37092
37110
|
label: FormControlLabel,
|
|
37093
37111
|
caption: FormControlCaption,
|
|
37094
37112
|
errorMessage: FormControlErrorMessage,
|
|
37095
|
-
successMessage: FormControlSuccessMessage
|
|
37113
|
+
successMessage: FormControlSuccessMessage,
|
|
37114
|
+
tooltipIcon: FormControlTooltipIcon
|
|
37096
37115
|
}
|
|
37097
37116
|
});
|
|
37098
37117
|
const inputComponentCandidates = [TextInput$1, Textarea, Select$1, SearchSelectInput$1, Checkbox$1, Radio$1, Switch$1, ...additionalInputComponentCandidates];
|
|
@@ -37124,15 +37143,23 @@ const FormControl = ({
|
|
|
37124
37143
|
mt: 0.5
|
|
37125
37144
|
}
|
|
37126
37145
|
},
|
|
37127
|
-
children: [
|
|
37146
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs(View, {
|
|
37147
|
+
className: 'form_control__label_wrapper__horizontal',
|
|
37148
|
+
display: 'flex',
|
|
37149
|
+
alignItems: 'center',
|
|
37150
|
+
sx: {
|
|
37151
|
+
columnGap: 1
|
|
37152
|
+
},
|
|
37153
|
+
children: [relocatableComponentsObject.label, relocatableComponentsObject.tooltipIcon]
|
|
37154
|
+
}), relocatableComponentsObject.caption, relocatableComponentsObject.errorMessage, relocatableComponentsObject.successMessage]
|
|
37128
37155
|
})]
|
|
37129
37156
|
}) : /*#__PURE__*/jsxRuntimeExports.jsxs(View, {
|
|
37130
37157
|
ref: ref,
|
|
37131
37158
|
display: 'flex',
|
|
37132
37159
|
flexDirection: 'column',
|
|
37133
37160
|
sx: {
|
|
37134
|
-
'&
|
|
37135
|
-
mb: 1
|
|
37161
|
+
'& .form_control__label_wrapper__vertical': {
|
|
37162
|
+
mb: relocatableComponentsObject.label?.props.visuallyHidden ? 0 : 1
|
|
37136
37163
|
},
|
|
37137
37164
|
'& > span': {
|
|
37138
37165
|
mt: 1
|
|
@@ -37140,7 +37167,15 @@ const FormControl = ({
|
|
|
37140
37167
|
...sx
|
|
37141
37168
|
},
|
|
37142
37169
|
...props,
|
|
37143
|
-
children: [
|
|
37170
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs(View, {
|
|
37171
|
+
className: 'form_control__label_wrapper__vertical',
|
|
37172
|
+
display: 'flex',
|
|
37173
|
+
alignItems: 'center',
|
|
37174
|
+
sx: {
|
|
37175
|
+
columnGap: 1
|
|
37176
|
+
},
|
|
37177
|
+
children: [relocatableComponentsObject.label, relocatableComponentsObject.tooltipIcon]
|
|
37178
|
+
}), /*#__PURE__*/React.cloneElement(InputComponent, {
|
|
37144
37179
|
id,
|
|
37145
37180
|
disabled
|
|
37146
37181
|
}), relocatableComponentsObject.caption, relocatableComponentsObject.errorMessage, relocatableComponentsObject.successMessage]
|
|
@@ -37151,7 +37186,8 @@ var index$5 = Object.assign( /*#__PURE__*/React.forwardRef(FormControl), {
|
|
|
37151
37186
|
Label: FormControlLabel,
|
|
37152
37187
|
Caption: FormControlCaption,
|
|
37153
37188
|
ErrorMessage: FormControlErrorMessage,
|
|
37154
|
-
SuccessMessage: FormControlSuccessMessage
|
|
37189
|
+
SuccessMessage: FormControlSuccessMessage,
|
|
37190
|
+
TooltipIcon: FormControlTooltipIcon
|
|
37155
37191
|
});
|
|
37156
37192
|
|
|
37157
37193
|
const GradientText = styled__default.default(Text)`
|
|
@@ -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.36.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": "d14e82c45731d9641122e5888e468a0d91a80cd8"
|
|
70
70
|
}
|