@lunit/design-system 2.2.0 → 2.2.3
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/.babelrc.json +1 -1
- package/README.md +22 -21
- package/dist/cjs/components/Alert/index.js +1 -1
- package/dist/cjs/components/Alert/index.js.map +1 -1
- package/dist/cjs/components/Button/index.js +1 -1
- package/dist/cjs/components/Button/index.js.map +1 -1
- package/dist/cjs/components/Checkbox/index.js +1 -1
- package/dist/cjs/components/Checkbox/index.js.map +1 -1
- package/dist/cjs/components/Chip/index.js +1 -1
- package/dist/cjs/components/Chip/index.js.map +1 -1
- package/dist/cjs/components/DataTable/index.js.map +1 -1
- package/dist/cjs/components/DatePicker/index.js.map +1 -1
- package/dist/cjs/components/Dialog/index.js +1 -1
- package/dist/cjs/components/Dialog/index.js.map +1 -1
- package/dist/cjs/components/Dropdown/index.js +1 -1
- package/dist/cjs/components/Dropdown/index.js.map +1 -1
- package/dist/cjs/components/FormLabel/index.js.map +1 -1
- package/dist/cjs/components/Radio/index.js +1 -1
- package/dist/cjs/components/Radio/index.js.map +1 -1
- package/dist/cjs/components/RadioGroup/index.js.map +1 -1
- package/dist/cjs/components/TextField/index.js +1 -1
- package/dist/cjs/components/TextField/index.js.map +1 -1
- package/dist/cjs/components/Toggle/index.js +1 -1
- package/dist/cjs/components/Toggle/index.js.map +1 -1
- package/dist/cjs/components/ToggleButton/index.js +1 -1
- package/dist/cjs/components/ToggleButton/index.js.map +1 -1
- package/dist/cjs/components/Tooltip/index.js.map +1 -1
- package/dist/cjs/components/Typography/index.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/components/Alert/Alert.js +8 -8
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Alert/Alert.styled.js +26 -26
- package/dist/components/Alert/Alert.styled.js.map +1 -1
- package/dist/components/Alert/Alert.utils.js +9 -9
- package/dist/components/Alert/Alert.utils.js.map +1 -1
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/Button/Button.js +23 -17
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.styled.js +88 -88
- package/dist/components/Button/Button.styled.js.map +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/utils/getButtonPaddingBySizeAndKind.js +9 -9
- package/dist/components/Button/utils/getButtonPaddingBySizeAndKind.js.map +1 -1
- package/dist/components/Button/utils/getHoverStyle.js +1 -1
- package/dist/components/Button/utils/getHoverStyle.js.map +1 -1
- package/dist/components/Button/utils/getIconButtonPaddingBySizeAndKind.js +6 -12
- package/dist/components/Button/utils/getIconButtonPaddingBySizeAndKind.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +9 -9
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Chip/Chip.js +29 -26
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip/Chip.styled.js +52 -52
- package/dist/components/Chip/Chip.styled.js.map +1 -1
- package/dist/components/Chip/consts.js +5 -5
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/DataTable/DataTable.js +1 -1
- package/dist/components/DataTable/index.js +1 -1
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/Dialog/Dialog.js +18 -18
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dialog/Dialog.styled.js +90 -90
- package/dist/components/Dialog/Dialog.styled.js.map +1 -1
- package/dist/components/Dialog/components/DialogAction.js +6 -6
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +23 -21
- package/dist/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.styled.js +85 -86
- package/dist/components/Dropdown/Dropdown.styled.js.map +1 -1
- package/dist/components/Dropdown/DropdownItem.js +14 -14
- package/dist/components/Dropdown/DropdownItem.js.map +1 -1
- package/dist/components/Dropdown/index.js +2 -2
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/FormLabel/FormLabel.js +1 -1
- package/dist/components/FormLabel/FormLabel.styled.js +2 -2
- package/dist/components/FormLabel/FormLabel.styled.js.map +1 -1
- package/dist/components/FormLabel/index.js +1 -1
- package/dist/components/Radio/Radio.js +8 -8
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/TextField/TextField.js +8 -8
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/TextField.style.js +112 -112
- package/dist/components/TextField/TextField.style.js.map +1 -1
- package/dist/components/TextField/TextFieldIcon.js +2 -2
- package/dist/components/TextField/TextFieldIcon.js.map +1 -1
- package/dist/components/TextField/index.js +1 -1
- package/dist/components/Toast/Toast.js +13 -13
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/Toast.styled.js +26 -26
- package/dist/components/Toast/Toast.utils.js +3 -3
- package/dist/components/Toast/Toast.utils.js.map +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toggle/Toggle.js +3 -4
- package/dist/components/Toggle/Toggle.js.map +1 -1
- package/dist/components/Toggle/Toggle.styled.js +30 -30
- package/dist/components/Toggle/Toggle.styled.js.map +1 -1
- package/dist/components/Toggle/index.js +1 -1
- package/dist/components/ToggleButton/ToggleButton.js +6 -6
- package/dist/components/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.styled.js +20 -20
- package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
- package/dist/components/ToggleButton/index.js +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.js +2 -2
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.js.map +1 -1
- package/dist/components/ToggleButtonGroup/index.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Typography/Typography.js +1 -1
- package/dist/components/Typography/Typography.js.map +1 -1
- package/dist/components/Typography/index.js +1 -1
- package/dist/foundation/Elevation/index.js +27 -27
- package/dist/foundation/Elevation/utils.js +1 -1
- package/dist/foundation/Elevation/utils.js.map +1 -1
- package/dist/foundation/Typography/index.js +35 -35
- package/dist/foundation/Typography/index.js.map +1 -1
- package/dist/foundation/Typography/tokens.js +136 -136
- package/dist/foundation/Typography/tokens.js.map +1 -1
- package/dist/foundation/colors/base/blue.js +12 -12
- package/dist/foundation/colors/base/green.js +12 -12
- package/dist/foundation/colors/base/grey.js +28 -28
- package/dist/foundation/colors/base/index.js +11 -11
- package/dist/foundation/colors/base/lunitGreen.js +11 -11
- package/dist/foundation/colors/base/lunitTeal.js +12 -12
- package/dist/foundation/colors/base/magenta.js +12 -12
- package/dist/foundation/colors/base/opacity.js +4 -4
- package/dist/foundation/colors/base/orange.js +12 -12
- package/dist/foundation/colors/base/purple.js +12 -12
- package/dist/foundation/colors/base/red.js +12 -12
- package/dist/foundation/colors/base/yellow.js +12 -12
- package/dist/foundation/colors/index.js +119 -121
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/foundation/colors/token/component.js +184 -212
- package/dist/foundation/colors/token/component.js.map +1 -1
- package/dist/foundation/colors/token/core.js +112 -133
- package/dist/foundation/colors/token/core.js.map +1 -1
- package/dist/foundation/colors/token/index.js +2 -2
- package/dist/foundation/index.js +5 -5
- package/dist/index.js +20 -20
- package/dist/theme.js +6 -6
- package/dist/types/components/Alert/Alert.d.ts +2 -2
- package/dist/types/components/Alert/Alert.styled.d.ts +1 -2
- package/dist/types/components/Alert/Alert.types.d.ts +2 -2
- package/dist/types/components/Alert/Alert.utils.d.ts +1 -1
- package/dist/types/components/Alert/index.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Button/Button.styled.d.ts +226 -227
- package/dist/types/components/Button/Button.types.d.ts +16 -16
- package/dist/types/components/Button/index.d.ts +1 -1
- package/dist/types/components/Button/utils/getButtonPaddingBySizeAndKind.d.ts +4 -4
- package/dist/types/components/Button/utils/getHoverStyle.d.ts +2 -1
- package/dist/types/components/Button/utils/getIconButtonPaddingBySizeAndKind.d.ts +4 -4
- package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/components/Checkbox/index.d.ts +1 -1
- package/dist/types/components/Chip/Chip.d.ts +1 -1
- package/dist/types/components/Chip/Chip.styled.d.ts +6 -7
- package/dist/types/components/Chip/Chip.types.d.ts +15 -14
- package/dist/types/components/Chip/index.d.ts +1 -1
- package/dist/types/components/DataTable/index.d.ts +1 -1
- package/dist/types/components/DatePicker/index.d.ts +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +11 -11
- package/dist/types/components/Dialog/Dialog.styled.d.ts +3 -4
- package/dist/types/components/Dialog/components/DialogAction.d.ts +2 -2
- package/dist/types/components/Dialog/index.d.ts +2 -2
- package/dist/types/components/Dropdown/Dropdown.d.ts +2 -2
- package/dist/types/components/Dropdown/Dropdown.styled.d.ts +3 -4
- package/dist/types/components/Dropdown/Dropdown.types.d.ts +5 -5
- package/dist/types/components/Dropdown/DropdownItem.d.ts +3 -3
- package/dist/types/components/Dropdown/index.d.ts +3 -3
- package/dist/types/components/FormLabel/FormLabel.d.ts +1 -1
- package/dist/types/components/FormLabel/index.d.ts +1 -1
- package/dist/types/components/Radio/Radio.d.ts +1 -1
- package/dist/types/components/Radio/index.d.ts +1 -1
- package/dist/types/components/RadioGroup/index.d.ts +1 -1
- package/dist/types/components/TextField/TextField.d.ts +2 -2
- package/dist/types/components/TextField/TextField.style.d.ts +3 -4
- package/dist/types/components/TextField/TextField.types.d.ts +6 -6
- package/dist/types/components/TextField/TextFieldIcon.d.ts +2 -2
- package/dist/types/components/TextField/index.d.ts +2 -2
- package/dist/types/components/Toast/Toast.d.ts +2 -2
- package/dist/types/components/Toast/Toast.types.d.ts +3 -3
- package/dist/types/components/Toast/Toast.utils.d.ts +1 -1
- package/dist/types/components/Toast/index.d.ts +2 -2
- package/dist/types/components/Toggle/Toggle.d.ts +1 -1
- package/dist/types/components/Toggle/Toggle.styled.d.ts +2 -2
- package/dist/types/components/Toggle/Toggle.types.d.ts +3 -3
- package/dist/types/components/Toggle/index.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -3
- package/dist/types/components/ToggleButton/ToggleButton.types.d.ts +10 -10
- package/dist/types/components/ToggleButton/index.d.ts +1 -1
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
- package/dist/types/components/ToggleButtonGroup/index.d.ts +1 -1
- package/dist/types/components/Tooltip/index.d.ts +1 -1
- package/dist/types/components/Typography/Typography.d.ts +6 -6
- package/dist/types/components/Typography/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/foundation/Elevation/index.d.ts +22 -22
- package/dist/types/foundation/Typography/index.d.ts +78 -78
- package/dist/types/foundation/Typography/tokens.d.ts +69 -69
- package/dist/types/foundation/colors/base/index.d.ts +11 -11
- package/dist/types/foundation/colors/index.d.ts +13 -20
- package/dist/types/foundation/colors/token/component.d.ts +1 -1
- package/dist/types/foundation/colors/token/core.d.ts +1 -1
- package/dist/types/foundation/colors/token/index.d.ts +2 -2
- package/dist/types/foundation/colors/types.d.ts +0 -7
- package/dist/types/foundation/index.d.ts +4 -11
- package/dist/types/foundation/spacing.d.ts +1 -1
- package/dist/types/index.d.ts +20 -20
- package/dist/types/theme.d.ts +1 -1
- package/package.json +9 -11
- package/src/components/Alert/Alert.styled.ts +39 -49
- package/src/components/Alert/Alert.tsx +10 -16
- package/src/components/Alert/Alert.types.ts +2 -2
- package/src/components/Alert/Alert.utils.ts +13 -22
- package/src/components/Alert/index.ts +1 -1
- package/src/components/Button/Button.styled.ts +98 -101
- package/src/components/Button/Button.tsx +71 -69
- package/src/components/Button/Button.types.ts +19 -21
- package/src/components/Button/index.ts +1 -1
- package/src/components/Button/utils/getButtonPaddingBySizeAndKind.ts +13 -13
- package/src/components/Button/utils/getHoverStyle.ts +4 -2
- package/src/components/Button/utils/getIconButtonPaddingBySizeAndKind.ts +10 -19
- package/src/components/Checkbox/Checkbox.tsx +13 -25
- package/src/components/Checkbox/index.ts +1 -1
- package/src/components/Chip/Chip.styled.ts +69 -72
- package/src/components/Chip/Chip.tsx +33 -55
- package/src/components/Chip/Chip.types.ts +17 -25
- package/src/components/Chip/consts.ts +5 -5
- package/src/components/Chip/index.ts +1 -1
- package/src/components/DataTable/DataTable.tsx +2 -2
- package/src/components/DataTable/index.ts +1 -1
- package/src/components/DatePicker/DatePicker.tsx +2 -2
- package/src/components/DatePicker/index.ts +1 -1
- package/src/components/Dialog/Dialog.styled.ts +112 -114
- package/src/components/Dialog/Dialog.tsx +41 -46
- package/src/components/Dialog/components/DialogAction.tsx +8 -8
- package/src/components/Dialog/index.ts +3 -3
- package/src/components/Dropdown/Dropdown.styled.tsx +88 -89
- package/src/components/Dropdown/Dropdown.tsx +29 -30
- package/src/components/Dropdown/Dropdown.types.ts +5 -6
- package/src/components/Dropdown/DropdownItem.tsx +18 -29
- package/src/components/Dropdown/index.ts +3 -7
- package/src/components/FormLabel/FormLabel.styled.ts +3 -3
- package/src/components/FormLabel/FormLabel.tsx +3 -3
- package/src/components/FormLabel/index.ts +1 -1
- package/src/components/Radio/Radio.tsx +12 -29
- package/src/components/Radio/index.ts +1 -1
- package/src/components/RadioGroup/index.ts +1 -1
- package/src/components/TextField/TextField.style.ts +123 -132
- package/src/components/TextField/TextField.tsx +50 -62
- package/src/components/TextField/TextField.types.ts +6 -9
- package/src/components/TextField/TextFieldIcon.tsx +4 -7
- package/src/components/TextField/index.ts +2 -2
- package/src/components/Toast/Toast.styled.ts +26 -26
- package/src/components/Toast/Toast.tsx +14 -28
- package/src/components/Toast/Toast.types.ts +3 -8
- package/src/components/Toast/Toast.utils.ts +5 -8
- package/src/components/Toast/index.tsx +2 -2
- package/src/components/Toggle/Toggle.styled.ts +31 -32
- package/src/components/Toggle/Toggle.tsx +5 -11
- package/src/components/Toggle/Toggle.types.ts +3 -3
- package/src/components/Toggle/index.ts +1 -1
- package/src/components/ToggleButton/ToggleButton.styled.ts +47 -49
- package/src/components/ToggleButton/ToggleButton.tsx +91 -97
- package/src/components/ToggleButton/ToggleButton.types.ts +10 -10
- package/src/components/ToggleButton/index.ts +1 -1
- package/src/components/ToggleButtonGroup/ToggleButtonGroup.tsx +3 -8
- package/src/components/ToggleButtonGroup/index.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +2 -2
- package/src/components/Tooltip/index.ts +1 -1
- package/src/components/Typography/Typography.tsx +7 -10
- package/src/components/Typography/index.ts +1 -1
- package/src/components/index.ts +2 -2
- package/src/foundation/Elevation/index.ts +27 -27
- package/src/foundation/Elevation/utils.ts +14 -8
- package/src/foundation/Typography/index.ts +58 -57
- package/src/foundation/Typography/tokens.ts +138 -138
- package/src/foundation/colors/base/blue.ts +12 -12
- package/src/foundation/colors/base/green.ts +12 -12
- package/src/foundation/colors/base/grey.ts +28 -28
- package/src/foundation/colors/base/index.ts +11 -11
- package/src/foundation/colors/base/lunitGreen.ts +11 -11
- package/src/foundation/colors/base/lunitTeal.ts +12 -12
- package/src/foundation/colors/base/magenta.ts +12 -12
- package/src/foundation/colors/base/opacity.ts +4 -4
- package/src/foundation/colors/base/orange.ts +12 -12
- package/src/foundation/colors/base/purple.ts +12 -12
- package/src/foundation/colors/base/red.ts +12 -12
- package/src/foundation/colors/base/yellow.ts +12 -12
- package/src/foundation/colors/index.ts +119 -120
- package/src/foundation/colors/token/component.ts +185 -213
- package/src/foundation/colors/token/core.ts +113 -134
- package/src/foundation/colors/token/index.ts +2 -2
- package/src/foundation/colors/types.ts +0 -7
- package/src/foundation/index.ts +8 -8
- package/src/foundation/spacing.ts +1 -1
- package/src/index.ts +20 -20
- package/src/stories/GettingStarted.mdx +6 -6
- package/src/stories/components/Alert/Alert.stories.tsx +38 -45
- package/src/stories/components/Button/BasicButton.stories.tsx +68 -59
- package/src/stories/components/Button/ButtonDocs.mdx +17 -41
- package/src/stories/components/Button/Color.stories.tsx +28 -51
- package/src/stories/components/Button/IconButton.stories.tsx +40 -47
- package/src/stories/components/Button/Kind.stories.tsx +100 -213
- package/src/stories/components/CheckBox/BasicCheckbox.stories.tsx +52 -71
- package/src/stories/components/CheckBox/CheckboxDocs.mdx +6 -6
- package/src/stories/components/Chip/Chip.stories.tsx +75 -75
- package/src/stories/components/Chip/ChipDocs.mdx +12 -13
- package/src/stories/components/DataTable/DataTable.stories.tsx +4 -4
- package/src/stories/components/DatePicker/DatePicker.stories.tsx +4 -4
- package/src/stories/components/Dialog/Dialog.stories.tsx +103 -135
- package/src/stories/components/Dialog/DialogDocs.mdx +7 -13
- package/src/stories/components/Dropdown/Dropdown.stories.tsx +96 -82
- package/src/stories/components/Dropdown/DropdownDocs.mdx +275 -0
- package/src/stories/components/Dropdown/DropdownExamples.stories.tsx +40 -47
- package/src/stories/components/Dropdown/DropdownItem.stories.tsx +113 -98
- package/src/stories/components/SelectControl/RadioGroup.stories.tsx +17 -30
- package/src/stories/components/SelectControl/RadioStatus.stories.tsx +16 -23
- package/src/stories/components/SelectControl/Toggle.stories.tsx +33 -78
- package/src/stories/components/TextField/BasicTextField.stories.tsx +44 -53
- package/src/stories/components/TextField/TextFieldDocs.mdx +8 -12
- package/src/stories/components/TextField/TextFieldMulti.stories.tsx +39 -55
- package/src/stories/components/TextField/TextFieldSingle.stories.tsx +74 -118
- package/src/stories/components/TextField/TextFieldSize.stories.tsx +35 -55
- package/src/stories/components/Toast/Toast.stories.tsx +35 -50
- package/src/stories/components/ToggleButton/Basic.stories.tsx +115 -152
- package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +10 -14
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +141 -200
- package/src/stories/components/ToggleButton/WithIcon.stories.tsx +87 -107
- package/src/stories/components/Tooltip/Tooltip.stories.tsx +4 -4
- package/src/stories/foundation/Elevation/Elevation.stories.tsx +48 -54
- package/src/stories/foundation/Elevation/styled.ts +3 -3
- package/src/stories/foundation/Typography/Typography.mdx +9 -13
- package/src/stories/foundation/Typography/Typography.stories.tsx +25 -41
- package/src/stories/foundation/Typography/TypographyGroup.tsx +14 -25
- package/src/stories/foundation/Typography/const.ts +13 -19
- package/src/stories/foundation/colors/ColorSystem.tsx +42 -40
- package/src/stories/foundation/colors/Colors.stories.tsx +40 -41
- package/src/stories/foundation/colors/Docs.mdx +73 -77
- package/src/stories/foundation/colors/Mui.stories.tsx +6 -8
- package/src/stories/foundation/colors/Token.inComponent.stories.tsx +81 -71
- package/src/stories/foundation/colors/TokenPaletteTable.stories.tsx +7 -7
- package/src/stories/foundation/colors/TokenPaletteTable.tsx +23 -49
- package/src/stories/foundation/colors/styled.ts +26 -26
- package/src/theme.ts +6 -6
- package/src/types.d.ts +1 -1
- package/tsconfig.build.json +1 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import MuiTextField from
|
|
2
|
-
import { styled } from
|
|
1
|
+
import MuiTextField from '@mui/material/TextField';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
3
|
|
|
4
|
-
import type { ColorToken } from
|
|
5
|
-
import type {
|
|
6
|
-
import type { TextFieldProps, TextFieldSize } from
|
|
4
|
+
import type { ColorToken } from '@/foundation/colors/types';
|
|
5
|
+
import type { TypographyVariants } from '@mui/material/styles';
|
|
6
|
+
import type { TextFieldProps, TextFieldSize } from './TextField.types';
|
|
7
7
|
|
|
8
|
-
type BaseTextFieldProps = Omit<TextFieldProps,
|
|
8
|
+
type BaseTextFieldProps = Omit<TextFieldProps, 'size'> & {
|
|
9
9
|
textFieldSize: TextFieldSize;
|
|
10
10
|
hasLeftIcon?: boolean;
|
|
11
11
|
hasRightIcon?: boolean;
|
|
@@ -22,36 +22,27 @@ const getSinglelineTextFieldPaddingByIconAndSize = ({
|
|
|
22
22
|
size,
|
|
23
23
|
hasLeftIcon,
|
|
24
24
|
hasRightIcon,
|
|
25
|
-
}: Pick<
|
|
26
|
-
GetTextFieldPaddingBySizeParams,
|
|
27
|
-
"size" | "hasLeftIcon" | "hasRightIcon"
|
|
28
|
-
>) => {
|
|
25
|
+
}: Pick<GetTextFieldPaddingBySizeParams, 'size' | 'hasLeftIcon' | 'hasRightIcon'>) => {
|
|
29
26
|
switch (size) {
|
|
30
|
-
case
|
|
31
|
-
return `4px ${hasRightIcon ?
|
|
32
|
-
|
|
33
|
-
}`;
|
|
34
|
-
case
|
|
35
|
-
return `
|
|
36
|
-
hasLeftIcon ? "12px" : "16px"
|
|
37
|
-
}`;
|
|
38
|
-
case "large":
|
|
39
|
-
return `10px ${hasRightIcon ? "12px" : "16px"} 10px ${
|
|
40
|
-
hasLeftIcon ? "12px" : "16px"
|
|
41
|
-
}`;
|
|
27
|
+
case 'small':
|
|
28
|
+
return `4px ${hasRightIcon ? '8px' : '12px'} 4px ${hasLeftIcon ? '8px' : '12px'}`;
|
|
29
|
+
case 'medium':
|
|
30
|
+
return `8px ${hasRightIcon ? '12px' : '16px'} 8px ${hasLeftIcon ? '12px' : '16px'}`;
|
|
31
|
+
case 'large':
|
|
32
|
+
return `10px ${hasRightIcon ? '12px' : '16px'} 10px ${hasLeftIcon ? '12px' : '16px'}`;
|
|
42
33
|
}
|
|
43
34
|
};
|
|
44
35
|
|
|
45
36
|
const getMultilineTextFieldPaddingByIconAndSize = ({
|
|
46
37
|
size,
|
|
47
|
-
}: Pick<GetTextFieldPaddingBySizeParams,
|
|
38
|
+
}: Pick<GetTextFieldPaddingBySizeParams, 'size'>) => {
|
|
48
39
|
switch (size) {
|
|
49
|
-
case
|
|
50
|
-
return
|
|
51
|
-
case
|
|
52
|
-
return
|
|
53
|
-
case
|
|
54
|
-
return
|
|
40
|
+
case 'small':
|
|
41
|
+
return '4px 4px 4px 12px';
|
|
42
|
+
case 'medium':
|
|
43
|
+
return '8px 4px 8px 16px';
|
|
44
|
+
case 'large':
|
|
45
|
+
return '10px 4px 10px 16px';
|
|
55
46
|
}
|
|
56
47
|
};
|
|
57
48
|
|
|
@@ -71,85 +62,85 @@ const getTextFieldPaddingBySize = ({
|
|
|
71
62
|
};
|
|
72
63
|
|
|
73
64
|
const commonStyle = ({ lunit_token }: { lunit_token: ColorToken }) => ({
|
|
74
|
-
|
|
75
|
-
borderRadius:
|
|
65
|
+
'& .MuiOutlinedInput-root': {
|
|
66
|
+
borderRadius: '8px',
|
|
76
67
|
|
|
77
|
-
|
|
78
|
-
border:
|
|
68
|
+
'& fieldset': {
|
|
69
|
+
border: 'none',
|
|
79
70
|
},
|
|
80
|
-
|
|
71
|
+
'&.Mui-error fieldset': {
|
|
81
72
|
border: `1px solid ${lunit_token.component.textfield_border_error}`,
|
|
82
73
|
},
|
|
83
|
-
|
|
84
|
-
border: `1px solid ${lunit_token.core.
|
|
74
|
+
'&.Mui-focused fieldset': {
|
|
75
|
+
border: `1px solid ${lunit_token.core.status_focused}`,
|
|
85
76
|
},
|
|
86
|
-
|
|
77
|
+
'&.Mui-error.Mui-focused fieldset': {
|
|
87
78
|
border: `2px solid ${lunit_token.component.textfield_border_error}`,
|
|
88
79
|
},
|
|
89
|
-
|
|
80
|
+
'&.Mui-disabled': {
|
|
90
81
|
opacity: 0.38,
|
|
91
|
-
|
|
82
|
+
'&:hover::before': {
|
|
92
83
|
backgroundColor: lunit_token.component.textfield_bg,
|
|
93
84
|
},
|
|
94
85
|
},
|
|
95
|
-
|
|
86
|
+
'& input, textarea': {
|
|
96
87
|
padding: 0,
|
|
97
|
-
textOverflow:
|
|
98
|
-
|
|
88
|
+
textOverflow: 'ellipsis',
|
|
89
|
+
'&::placeholder': {
|
|
99
90
|
color: lunit_token.core.text_light,
|
|
100
91
|
opacity: 1,
|
|
101
92
|
WebkitTextFillColor: lunit_token.core.text_light,
|
|
102
93
|
},
|
|
103
94
|
},
|
|
104
|
-
|
|
105
|
-
height:
|
|
106
|
-
overflowY:
|
|
107
|
-
|
|
108
|
-
width:
|
|
95
|
+
'& textarea': {
|
|
96
|
+
height: '100% !important',
|
|
97
|
+
overflowY: 'scroll !important',
|
|
98
|
+
'&::-webkit-scrollbar': {
|
|
99
|
+
width: '6px',
|
|
109
100
|
},
|
|
110
|
-
|
|
111
|
-
borderRadius:
|
|
101
|
+
'&::-webkit-scrollbar-thumb': {
|
|
102
|
+
borderRadius: '6px',
|
|
112
103
|
backgroundColor: lunit_token.component.scrollbars_bg,
|
|
113
104
|
},
|
|
114
105
|
},
|
|
115
106
|
background: lunit_token.component.textfield_bg,
|
|
116
107
|
color: lunit_token.core.text_normal,
|
|
117
|
-
|
|
118
|
-
position:
|
|
108
|
+
'&:hover': {
|
|
109
|
+
position: 'relative',
|
|
119
110
|
zIndex: 0,
|
|
120
111
|
backgroundColor: lunit_token.component.textfield_bg,
|
|
121
112
|
},
|
|
122
|
-
|
|
113
|
+
'&:hover::before': {
|
|
123
114
|
content: '""',
|
|
124
|
-
position:
|
|
115
|
+
position: 'absolute',
|
|
125
116
|
top: 0,
|
|
126
117
|
left: 0,
|
|
127
|
-
width:
|
|
128
|
-
height:
|
|
118
|
+
width: '100%',
|
|
119
|
+
height: '100%',
|
|
129
120
|
zIndex: -1,
|
|
130
|
-
backgroundColor: lunit_token.core.
|
|
131
|
-
borderRadius:
|
|
121
|
+
backgroundColor: lunit_token.core.status_hover,
|
|
122
|
+
borderRadius: '8px',
|
|
132
123
|
},
|
|
133
|
-
|
|
134
|
-
|
|
124
|
+
'&.Mui-focused': {
|
|
125
|
+
'&:hover::before': {
|
|
135
126
|
backgroundColor: lunit_token.component.textfield_bg,
|
|
136
127
|
},
|
|
137
128
|
},
|
|
138
129
|
},
|
|
139
|
-
|
|
140
|
-
|
|
130
|
+
'& .MuiFormHelperText-root': {
|
|
131
|
+
'&.Mui-disabled': {
|
|
141
132
|
opacity: 0.38,
|
|
142
133
|
},
|
|
143
|
-
|
|
134
|
+
'&.Mui-error': {
|
|
144
135
|
color: lunit_token.core.text_error,
|
|
145
136
|
},
|
|
146
137
|
},
|
|
147
|
-
|
|
148
|
-
|
|
138
|
+
'& .MuiInputBase-input': {
|
|
139
|
+
'&:-webkit-autofill, &:-webkit-autofill:active, &:-webkit-autofill:focus, &:-webkit-autofill:hover, &:-webkit-autofill:focus-visible, &:-webkit-autofill:focus-within, &:-webkit-autofill:target, &:-webkit-autofill:first-line':
|
|
149
140
|
{
|
|
150
|
-
border:
|
|
151
|
-
borderRadius:
|
|
152
|
-
backgroundColor:
|
|
141
|
+
border: 'none',
|
|
142
|
+
borderRadius: '0px',
|
|
143
|
+
backgroundColor: 'transparent',
|
|
153
144
|
color: lunit_token.core.text_normal,
|
|
154
145
|
/**
|
|
155
146
|
* the background color and text color are not changed color, background css tag.
|
|
@@ -159,8 +150,8 @@ const commonStyle = ({ lunit_token }: { lunit_token: ColorToken }) => ({
|
|
|
159
150
|
* reference: https://css-tricks.com/almanac/pseudo-selectors/a/autofill/
|
|
160
151
|
*/
|
|
161
152
|
WebkitTextFillColor: lunit_token.core.text_normal,
|
|
162
|
-
WebkitBoxShadow:
|
|
163
|
-
WebkitTransition:
|
|
153
|
+
WebkitBoxShadow: '0 0 0px 1000px transparent inset',
|
|
154
|
+
WebkitTransition: 'background-color 5000s ease-in-out 0s',
|
|
164
155
|
/**
|
|
165
156
|
* textfield flash cursor color
|
|
166
157
|
*
|
|
@@ -178,111 +169,111 @@ const sizeStyle = ({
|
|
|
178
169
|
hasRightIcon,
|
|
179
170
|
typography,
|
|
180
171
|
multiline,
|
|
181
|
-
}: Pick<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
...(textFieldSize ===
|
|
186
|
-
|
|
172
|
+
}: Pick<BaseTextFieldProps, 'textFieldSize' | 'hasLeftIcon' | 'hasRightIcon' | 'multiline'> & {
|
|
173
|
+
lunit_token: ColorToken;
|
|
174
|
+
typography: TypographyVariants;
|
|
175
|
+
}) => ({
|
|
176
|
+
...(textFieldSize === 'small' && {
|
|
177
|
+
'& .MuiInputBase-root': {
|
|
187
178
|
padding: getTextFieldPaddingBySize({
|
|
188
179
|
size: textFieldSize,
|
|
189
180
|
hasLeftIcon,
|
|
190
181
|
hasRightIcon,
|
|
191
182
|
multiline,
|
|
192
183
|
}),
|
|
193
|
-
|
|
184
|
+
'& input, textarea': {
|
|
194
185
|
...typography.body2_14_regular,
|
|
195
186
|
},
|
|
196
|
-
|
|
197
|
-
height:
|
|
187
|
+
'& input': {
|
|
188
|
+
height: '20px',
|
|
198
189
|
},
|
|
199
|
-
|
|
200
|
-
minHeight:
|
|
201
|
-
paddingRight:
|
|
190
|
+
'& textarea': {
|
|
191
|
+
minHeight: '92px',
|
|
192
|
+
paddingRight: '2px',
|
|
202
193
|
},
|
|
203
194
|
},
|
|
204
|
-
|
|
195
|
+
'& .MuiFormHelperText-root': {
|
|
205
196
|
...typography.body2_14_regular,
|
|
206
197
|
color: lunit_token.core.text_medium,
|
|
207
198
|
margin: 0,
|
|
208
|
-
marginTop:
|
|
209
|
-
paddingLeft:
|
|
199
|
+
marginTop: '4px',
|
|
200
|
+
paddingLeft: '4px',
|
|
210
201
|
|
|
211
|
-
|
|
202
|
+
'&.Mui-disabled': {
|
|
212
203
|
color: lunit_token.core.text_medium,
|
|
213
204
|
opacity: 0.38,
|
|
214
205
|
},
|
|
215
|
-
|
|
206
|
+
'&.Mui-error': {
|
|
216
207
|
color: lunit_token.core.text_error,
|
|
217
208
|
},
|
|
218
209
|
},
|
|
219
210
|
}),
|
|
220
|
-
...(textFieldSize ===
|
|
221
|
-
|
|
211
|
+
...(textFieldSize === 'medium' && {
|
|
212
|
+
'& .MuiInputBase-root': {
|
|
222
213
|
padding: getTextFieldPaddingBySize({
|
|
223
214
|
size: textFieldSize,
|
|
224
215
|
hasLeftIcon,
|
|
225
216
|
hasRightIcon,
|
|
226
217
|
multiline,
|
|
227
218
|
}),
|
|
228
|
-
|
|
219
|
+
'& input, textarea': {
|
|
229
220
|
...typography.body2_14_regular,
|
|
230
221
|
},
|
|
231
|
-
|
|
232
|
-
height:
|
|
222
|
+
'& input': {
|
|
223
|
+
height: '20px',
|
|
233
224
|
},
|
|
234
|
-
|
|
235
|
-
minHeight:
|
|
236
|
-
paddingRight:
|
|
225
|
+
'& textarea': {
|
|
226
|
+
minHeight: '84px',
|
|
227
|
+
paddingRight: '6px',
|
|
237
228
|
},
|
|
238
229
|
},
|
|
239
|
-
|
|
230
|
+
'& .MuiFormHelperText-root': {
|
|
240
231
|
...typography.body2_14_regular,
|
|
241
232
|
color: lunit_token.core.text_medium,
|
|
242
233
|
margin: 0,
|
|
243
|
-
marginTop:
|
|
244
|
-
paddingLeft:
|
|
234
|
+
marginTop: '4px',
|
|
235
|
+
paddingLeft: '4px',
|
|
245
236
|
|
|
246
|
-
|
|
237
|
+
'&.Mui-disabled': {
|
|
247
238
|
color: lunit_token.core.text_medium,
|
|
248
239
|
opacity: 0.38,
|
|
249
240
|
},
|
|
250
|
-
|
|
241
|
+
'&.Mui-error': {
|
|
251
242
|
color: lunit_token.core.text_error,
|
|
252
243
|
},
|
|
253
244
|
},
|
|
254
245
|
}),
|
|
255
|
-
...(textFieldSize ===
|
|
256
|
-
|
|
246
|
+
...(textFieldSize === 'large' && {
|
|
247
|
+
'& .MuiInputBase-root': {
|
|
257
248
|
padding: getTextFieldPaddingBySize({
|
|
258
249
|
size: textFieldSize,
|
|
259
250
|
hasLeftIcon,
|
|
260
251
|
hasRightIcon,
|
|
261
252
|
multiline,
|
|
262
253
|
}),
|
|
263
|
-
|
|
254
|
+
'& input, textarea': {
|
|
264
255
|
...typography.body1_16_regular,
|
|
265
256
|
},
|
|
266
|
-
|
|
267
|
-
height:
|
|
257
|
+
'& input': {
|
|
258
|
+
height: '24px',
|
|
268
259
|
},
|
|
269
|
-
|
|
270
|
-
minHeight:
|
|
271
|
-
paddingRight:
|
|
260
|
+
'& textarea': {
|
|
261
|
+
minHeight: '80px',
|
|
262
|
+
paddingRight: '6px',
|
|
272
263
|
},
|
|
273
264
|
},
|
|
274
|
-
|
|
265
|
+
'& .MuiFormHelperText-root': {
|
|
275
266
|
...typography.body1_16_regular,
|
|
276
267
|
color: lunit_token.core.text_medium,
|
|
277
268
|
margin: 0,
|
|
278
|
-
marginTop:
|
|
279
|
-
paddingLeft:
|
|
269
|
+
marginTop: '4px',
|
|
270
|
+
paddingLeft: '4px',
|
|
280
271
|
|
|
281
|
-
|
|
272
|
+
'&.Mui-disabled': {
|
|
282
273
|
color: lunit_token.core.text_medium,
|
|
283
274
|
opacity: 0.38,
|
|
284
275
|
},
|
|
285
|
-
|
|
276
|
+
'&.Mui-error': {
|
|
286
277
|
color: lunit_token.core.text_error,
|
|
287
278
|
},
|
|
288
279
|
},
|
|
@@ -292,15 +283,15 @@ const sizeStyle = ({
|
|
|
292
283
|
const BaseTextField = styled(MuiTextField, {
|
|
293
284
|
shouldForwardProp: (prop: string) =>
|
|
294
285
|
![
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
286
|
+
'leftIconSx',
|
|
287
|
+
'rightIconSx',
|
|
288
|
+
'leftIcon',
|
|
289
|
+
'rightIcon',
|
|
290
|
+
'textFieldSize',
|
|
291
|
+
'hasLeftIcon',
|
|
292
|
+
'hasRightIcon',
|
|
293
|
+
'onLeftIconClick',
|
|
294
|
+
'onRightIconClick',
|
|
304
295
|
].includes(prop),
|
|
305
296
|
})<BaseTextFieldProps>(
|
|
306
297
|
({
|
|
@@ -322,20 +313,20 @@ const BaseTextField = styled(MuiTextField, {
|
|
|
322
313
|
typography,
|
|
323
314
|
multiline,
|
|
324
315
|
}),
|
|
325
|
-
})
|
|
316
|
+
}),
|
|
326
317
|
);
|
|
327
318
|
|
|
328
|
-
const IconWrapper = styled(
|
|
329
|
-
display:
|
|
330
|
-
alignItems:
|
|
331
|
-
justifyContent:
|
|
332
|
-
minWidth:
|
|
333
|
-
minHeight:
|
|
334
|
-
margin:
|
|
319
|
+
const IconWrapper = styled('div')(({ theme }) => ({
|
|
320
|
+
display: 'flex',
|
|
321
|
+
alignItems: 'center',
|
|
322
|
+
justifyContent: 'center',
|
|
323
|
+
minWidth: '28px',
|
|
324
|
+
minHeight: '28px',
|
|
325
|
+
margin: '-4px 0',
|
|
335
326
|
|
|
336
|
-
|
|
337
|
-
width:
|
|
338
|
-
height:
|
|
327
|
+
'& svg': {
|
|
328
|
+
width: '20px',
|
|
329
|
+
height: '20px',
|
|
339
330
|
color: theme.palette.lunit_token.core.text_normal,
|
|
340
331
|
},
|
|
341
332
|
}));
|
|
@@ -1,76 +1,64 @@
|
|
|
1
|
-
import React, { forwardRef } from
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
2
|
|
|
3
|
-
import TextFieldIcon from
|
|
4
|
-
import { BaseTextField } from
|
|
3
|
+
import TextFieldIcon from './TextFieldIcon';
|
|
4
|
+
import { BaseTextField } from './TextField.style';
|
|
5
5
|
|
|
6
|
-
import type {
|
|
7
|
-
TextFieldProps,
|
|
8
|
-
MultiTextFieldProps,
|
|
9
|
-
SingleTextFieldProps,
|
|
10
|
-
} from "./TextField.types";
|
|
6
|
+
import type { TextFieldProps, MultiTextFieldProps, SingleTextFieldProps } from './TextField.types';
|
|
11
7
|
|
|
12
|
-
const SingleTextField = forwardRef<HTMLDivElement, SingleTextFieldProps>(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = props;
|
|
8
|
+
const SingleTextField = forwardRef<HTMLDivElement, SingleTextFieldProps>((props, ref) => {
|
|
9
|
+
const {
|
|
10
|
+
size = 'small',
|
|
11
|
+
leftIcon,
|
|
12
|
+
rightIcon,
|
|
13
|
+
leftIconSx,
|
|
14
|
+
rightIconSx,
|
|
15
|
+
onLeftIconClick,
|
|
16
|
+
onRightIconClick,
|
|
17
|
+
InputProps,
|
|
18
|
+
...restProps
|
|
19
|
+
} = props;
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
);
|
|
21
|
+
return (
|
|
22
|
+
<BaseTextField
|
|
23
|
+
variant="outlined"
|
|
24
|
+
{...restProps}
|
|
25
|
+
ref={ref}
|
|
26
|
+
textFieldSize={size}
|
|
27
|
+
hasLeftIcon={Boolean(leftIcon)}
|
|
28
|
+
hasRightIcon={Boolean(rightIcon)}
|
|
29
|
+
InputProps={{
|
|
30
|
+
...{
|
|
31
|
+
startAdornment: leftIcon && (
|
|
32
|
+
<TextFieldIcon
|
|
33
|
+
sx={{ marginRight: '4px', ...leftIconSx }}
|
|
34
|
+
icon={leftIcon}
|
|
35
|
+
onIconClick={onLeftIconClick}
|
|
36
|
+
/>
|
|
37
|
+
),
|
|
38
|
+
endAdornment: rightIcon && (
|
|
39
|
+
<TextFieldIcon
|
|
40
|
+
sx={{ marginLeft: '4px', ...rightIconSx }}
|
|
41
|
+
icon={rightIcon}
|
|
42
|
+
onIconClick={onRightIconClick}
|
|
43
|
+
/>
|
|
44
|
+
),
|
|
45
|
+
},
|
|
46
|
+
...InputProps,
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
});
|
|
57
51
|
|
|
58
52
|
const MultiTextField = forwardRef<HTMLDivElement, MultiTextFieldProps>(
|
|
59
|
-
({ size =
|
|
53
|
+
({ size = 'small', ...restProps }, ref) => {
|
|
60
54
|
return (
|
|
61
|
-
<BaseTextField
|
|
62
|
-
variant="outlined"
|
|
63
|
-
{...restProps}
|
|
64
|
-
ref={ref}
|
|
65
|
-
textFieldSize={size}
|
|
66
|
-
multiline
|
|
67
|
-
/>
|
|
55
|
+
<BaseTextField variant="outlined" {...restProps} ref={ref} textFieldSize={size} multiline />
|
|
68
56
|
);
|
|
69
|
-
}
|
|
57
|
+
},
|
|
70
58
|
);
|
|
71
59
|
|
|
72
60
|
const TextField = forwardRef<HTMLDivElement, TextFieldProps>((props, ref) => {
|
|
73
|
-
const { rows, size, multiline = false,
|
|
61
|
+
const { rows, size, multiline = false, ...restProps } = props;
|
|
74
62
|
|
|
75
63
|
return multiline ? (
|
|
76
64
|
<MultiTextField {...restProps} ref={ref} size={size} rows={rows} />
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import type { SxProps } from
|
|
1
|
+
import type { SxProps } from '@mui/material';
|
|
2
2
|
import type {
|
|
3
3
|
TextFieldProps as MuiTextFieldProps,
|
|
4
4
|
OutlinedTextFieldProps,
|
|
5
|
-
} from
|
|
5
|
+
} from '@mui/material/TextField';
|
|
6
6
|
|
|
7
|
-
import type { JSX } from
|
|
7
|
+
import type { JSX } from 'react';
|
|
8
8
|
|
|
9
|
-
export type TextFieldSize =
|
|
9
|
+
export type TextFieldSize = 'small' | 'medium' | 'large';
|
|
10
10
|
export interface BaseTextFieldProps
|
|
11
|
-
extends Omit<
|
|
12
|
-
OutlinedTextFieldProps,
|
|
13
|
-
"size" | "value" | "helperText" | "variant"
|
|
14
|
-
> {
|
|
11
|
+
extends Omit<OutlinedTextFieldProps, 'size' | 'value' | 'helperText' | 'variant'> {
|
|
15
12
|
/**
|
|
16
13
|
* The design system TextField has only on kind, which is "contained"
|
|
17
14
|
Below are all return same kind "contained"
|
|
@@ -20,7 +17,7 @@ export interface BaseTextFieldProps
|
|
|
20
17
|
<TextField variant="filled" />
|
|
21
18
|
<TextField variant="standard" />
|
|
22
19
|
*/
|
|
23
|
-
variant?: MuiTextFieldProps[
|
|
20
|
+
variant?: MuiTextFieldProps['variant'];
|
|
24
21
|
value?: string;
|
|
25
22
|
helperText?: string;
|
|
26
23
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { type JSX } from
|
|
1
|
+
import React, { type JSX } from 'react';
|
|
2
2
|
|
|
3
|
-
import { IconWrapper } from
|
|
3
|
+
import { IconWrapper } from './TextField.style';
|
|
4
4
|
|
|
5
|
-
import type { SxProps } from
|
|
5
|
+
import type { SxProps } from '@mui/material';
|
|
6
6
|
|
|
7
7
|
interface TextFieldProps {
|
|
8
8
|
sx?: SxProps;
|
|
@@ -12,10 +12,7 @@ interface TextFieldProps {
|
|
|
12
12
|
|
|
13
13
|
const TextFieldIcon = ({ sx, icon, onIconClick }: TextFieldProps) => {
|
|
14
14
|
return (
|
|
15
|
-
<IconWrapper
|
|
16
|
-
sx={{ cursor: onIconClick ? "pointer" : "auto", ...sx }}
|
|
17
|
-
onClick={onIconClick}
|
|
18
|
-
>
|
|
15
|
+
<IconWrapper sx={{ cursor: onIconClick ? 'pointer' : 'auto', ...sx }} onClick={onIconClick}>
|
|
19
16
|
{icon}
|
|
20
17
|
</IconWrapper>
|
|
21
18
|
);
|