@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,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Success from
|
|
3
|
-
import Error from
|
|
4
|
-
import Warning from
|
|
5
|
-
import Information from
|
|
6
|
-
import Close from
|
|
7
|
-
import { forwardRef } from
|
|
8
|
-
import { StyledAlert, StyledAlertTitle, StyledAlertChildren, StyledBottomAction, } from
|
|
9
|
-
import Button from
|
|
2
|
+
import Success from '@lunit/design-system-icons/Success16';
|
|
3
|
+
import Error from '@lunit/design-system-icons/Error16';
|
|
4
|
+
import Warning from '@lunit/design-system-icons/Warning16';
|
|
5
|
+
import Information from '@lunit/design-system-icons/Information16';
|
|
6
|
+
import Close from '@lunit/design-system-icons/Close';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
import { StyledAlert, StyledAlertTitle, StyledAlertChildren, StyledBottomAction, } from './Alert.styled';
|
|
9
|
+
import Button from '../Button';
|
|
10
10
|
const MAPPED_ICON = {
|
|
11
11
|
success: _jsx(Success, { variant: "filled" }),
|
|
12
12
|
info: _jsx(Information, { variant: "filled" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,sCAAsC,CAAC;AAC3D,OAAO,KAAK,MAAM,oCAAoC,CAAC;AACvD,OAAO,OAAO,MAAM,sCAAsC,CAAC;AAC3D,OAAO,WAAW,MAAM,0CAA0C,CAAC;AACnE,OAAO,KAAK,MAAM,kCAAkC,CAAC;AACrD,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,WAAW,GAAG;IAClB,OAAO,EAAE,KAAC,OAAO,IAAC,OAAO,EAAC,QAAQ,GAAG;IACrC,IAAI,EAAE,KAAC,WAAW,IAAC,OAAO,EAAC,QAAQ,GAAG;IACtC,OAAO,EAAE,KAAC,OAAO,IAAC,OAAO,EAAC,QAAQ,GAAG;IACrC,KAAK,EAAE,KAAC,KAAK,IAAC,OAAO,EAAC,QAAQ,GAAG;CAClC,CAAC;AAEF,MAAM,KAAK,GAAG,UAAU,CAA6B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAClE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC5E,OAAO,CACL,MAAC,WAAW,IACV,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE;YACL,WAAW,EAAE,GAAG,EAAE,CAAC,CACjB,KAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],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C,gBAAgB,cAAE,KAAK,GAAoB,EACtD,KAAC,mBAAmB,cAAE,QAAQ,GAAuB,EACpD,YAAY,IAAI,KAAC,kBAAkB,cAAE,YAAY,GAAsB,IAC5D,CACf,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { Alert as MuiAlert, AlertTitle as MuiAlertTitle, styled
|
|
2
|
-
import { getBorderColor, getBackgroundColor, getIconColor
|
|
1
|
+
import { Alert as MuiAlert, AlertTitle as MuiAlertTitle, styled } from '@mui/material';
|
|
2
|
+
import { getBorderColor, getBackgroundColor, getIconColor } from './Alert.utils';
|
|
3
3
|
export const StyledAlert = styled(MuiAlert)(({ severity, theme }) => ({
|
|
4
|
-
|
|
5
|
-
display:
|
|
6
|
-
padding:
|
|
7
|
-
borderRadius:
|
|
4
|
+
'&.MuiAlert-root': {
|
|
5
|
+
display: 'flex',
|
|
6
|
+
padding: '12px',
|
|
7
|
+
borderRadius: '8px',
|
|
8
8
|
border: `1px solid ${getBorderColor(theme, severity)}`,
|
|
9
9
|
backgroundColor: getBackgroundColor(theme, severity),
|
|
10
|
-
boxShadow:
|
|
10
|
+
boxShadow: 'none',
|
|
11
11
|
},
|
|
12
|
-
|
|
13
|
-
padding:
|
|
14
|
-
marginRight:
|
|
15
|
-
fontSize:
|
|
12
|
+
'& .MuiAlert-icon': {
|
|
13
|
+
padding: '4px',
|
|
14
|
+
marginRight: '0',
|
|
15
|
+
fontSize: '20px',
|
|
16
16
|
color: `${getIconColor(theme, severity)} !important`,
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
width:
|
|
20
|
-
minHeight:
|
|
21
|
-
padding:
|
|
22
|
-
margin:
|
|
18
|
+
'& .MuiAlert-message': {
|
|
19
|
+
width: '100%',
|
|
20
|
+
minHeight: '28px',
|
|
21
|
+
padding: '4px 0 0',
|
|
22
|
+
margin: '0 8px 0 8px',
|
|
23
23
|
},
|
|
24
|
-
|
|
24
|
+
'& .MuiAlert-action': {
|
|
25
25
|
margin: 0,
|
|
26
26
|
padding: 0,
|
|
27
27
|
},
|
|
28
|
-
|
|
29
|
-
height:
|
|
30
|
-
width:
|
|
28
|
+
'& .MuiSvgIcon-root': {
|
|
29
|
+
height: '20px',
|
|
30
|
+
width: '20px',
|
|
31
31
|
},
|
|
32
32
|
}));
|
|
33
33
|
export const StyledAlertTitle = styled(MuiAlertTitle)(({ theme }) => ({
|
|
34
|
-
|
|
34
|
+
'&.MuiAlertTitle-root': {
|
|
35
35
|
marginTop: 0,
|
|
36
36
|
marginBottom: 8,
|
|
37
37
|
fontWeight: 700,
|
|
38
|
-
fontSize:
|
|
39
|
-
lineHeight:
|
|
38
|
+
fontSize: '14px',
|
|
39
|
+
lineHeight: '20px',
|
|
40
40
|
color: theme.palette.lunit_token.core.text_normal,
|
|
41
41
|
},
|
|
42
42
|
}));
|
|
43
|
-
export const StyledAlertChildren = styled(
|
|
43
|
+
export const StyledAlertChildren = styled('div')(({ theme }) => ({
|
|
44
44
|
color: theme.palette.lunit_token.core.text_normal,
|
|
45
45
|
}));
|
|
46
|
-
export const StyledBottomAction = styled(
|
|
47
|
-
marginTop:
|
|
46
|
+
export const StyledBottomAction = styled('div')({
|
|
47
|
+
marginTop: '12px',
|
|
48
48
|
});
|
|
49
49
|
//# sourceMappingURL=Alert.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.styled.js","sourceRoot":"","sources":["../../../src/components/Alert/Alert.styled.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Alert.styled.js","sourceRoot":"","sources":["../../../src/components/Alert/Alert.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAA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GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW;CAClD,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9C,SAAS,EAAE,MAAM;CAClB,CAAC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const getBackgroundColor = (theme, severity) => {
|
|
2
2
|
switch (severity) {
|
|
3
|
-
case
|
|
3
|
+
case 'info':
|
|
4
4
|
return theme.palette.lunit_token.component.alert_info_bg;
|
|
5
|
-
case
|
|
5
|
+
case 'warning':
|
|
6
6
|
return theme.palette.lunit_token.component.alert_warning_bg;
|
|
7
|
-
case
|
|
7
|
+
case 'error':
|
|
8
8
|
return theme.palette.lunit_token.component.alert_error_bg;
|
|
9
9
|
default:
|
|
10
10
|
return theme.palette.lunit_token.component.alert_success_bg;
|
|
@@ -12,11 +12,11 @@ export const getBackgroundColor = (theme, severity) => {
|
|
|
12
12
|
};
|
|
13
13
|
export const getBorderColor = (theme, severity) => {
|
|
14
14
|
switch (severity) {
|
|
15
|
-
case
|
|
15
|
+
case 'info':
|
|
16
16
|
return theme.palette.lunit_token.component.alert_info_border;
|
|
17
|
-
case
|
|
17
|
+
case 'warning':
|
|
18
18
|
return theme.palette.lunit_token.component.alert_warning_border;
|
|
19
|
-
case
|
|
19
|
+
case 'error':
|
|
20
20
|
return theme.palette.lunit_token.component.alert_error_border;
|
|
21
21
|
default:
|
|
22
22
|
return theme.palette.lunit_token.component.alert_success_border;
|
|
@@ -24,11 +24,11 @@ export const getBorderColor = (theme, severity) => {
|
|
|
24
24
|
};
|
|
25
25
|
export const getIconColor = (theme, severity) => {
|
|
26
26
|
switch (severity) {
|
|
27
|
-
case
|
|
27
|
+
case 'info':
|
|
28
28
|
return theme.palette.lunit_token.core.icon_info_02;
|
|
29
|
-
case
|
|
29
|
+
case 'warning':
|
|
30
30
|
return theme.palette.lunit_token.core.icon_warning_02;
|
|
31
|
-
case
|
|
31
|
+
case 'error':
|
|
32
32
|
return theme.palette.lunit_token.core.icon_error_02;
|
|
33
33
|
default:
|
|
34
34
|
return theme.palette.lunit_token.core.icon_success_02;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.utils.js","sourceRoot":"","sources":["../../../src/components/Alert/Alert.utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,
|
|
1
|
+
{"version":3,"file":"Alert.utils.js","sourceRoot":"","sources":["../../../src/components/Alert/Alert.utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAY,EAAE,QAAgC,EAAE,EAAE;IACnF,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,MAAM;YACT,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC;QAC3D,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,gBAAgB,CAAC;QAC9D,KAAK,OAAO;YACV,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC;QAC5D;YACE,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,gBAAgB,CAAC;IAChE,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAY,EAAE,QAAgC,EAAE,EAAE;IAC/E,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,MAAM;YACT,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,iBAAiB,CAAC;QAC/D,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,oBAAoB,CAAC;QAClE,KAAK,OAAO;YACV,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,kBAAkB,CAAC;QAChE;YACE,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,oBAAoB,CAAC;IACpE,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAY,EAAE,QAAgC,EAAE,EAAE;IAC7E,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,MAAM;YACT,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;QACrD,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC;QACxD,KAAK,OAAO;YACV,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC;QACtD;YACE,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC;IAC1D,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from
|
|
1
|
+
export { default } from './Alert';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from
|
|
3
|
-
import { CustomButton } from
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { CustomButton } from './Button.styled';
|
|
4
|
+
const GhostButton = forwardRef((props, ref) => {
|
|
5
|
+
const { size = 'small', icon, className, children, startIcon, hasIconOnly,
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
7
|
+
variant: _variant, ...restProps } = props;
|
|
8
|
+
return (_jsx(CustomButton, { ...restProps, ref: ref, className: `ghost ${className ? className : ''}`, kind: "ghost", color: props.color ?? 'primary', size: size, startIcon: startIcon || icon, hasIconOnly: hasIconOnly, children: !hasIconOnly && _jsx(_Fragment, { children: children }) }));
|
|
9
|
+
});
|
|
10
|
+
const OutlinedButton = forwardRef((props, ref) => {
|
|
11
|
+
const { size = 'small', icon, className, children, startIcon, hasIconOnly,
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
13
|
+
variant: _variant, ...restProps } = props;
|
|
14
|
+
return (_jsx(CustomButton, { ...restProps, ref: ref, className: `outlined ${className ? className : ''}`, kind: "outlined", color: props.color ?? 'primary', size: size, startIcon: startIcon || icon, hasIconOnly: hasIconOnly, children: !hasIconOnly && _jsx(_Fragment, { children: children }) }));
|
|
15
|
+
});
|
|
16
|
+
const ContainedButton = forwardRef((props, ref) => {
|
|
17
|
+
const { size = 'small', icon, className, children, startIcon, hasIconOnly,
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
19
|
+
variant: _variant, ...restProps } = props;
|
|
20
|
+
return (_jsx(CustomButton, { ...restProps, ref: ref, className: `${props.kind ?? 'contained'} ${className ? className : ''}`, kind: props.kind ?? 'contained', color: props.color ?? 'primary', size: size, startIcon: startIcon || icon, hasIconOnly: hasIconOnly, children: !hasIconOnly && _jsx(_Fragment, { children: children }) }));
|
|
21
|
+
});
|
|
4
22
|
const Button = forwardRef((props, ref) => {
|
|
5
23
|
const { kind, variant, icon, children, startIcon } = props;
|
|
6
24
|
const hasIconOnly = Boolean((startIcon || icon) && !children);
|
|
7
|
-
if (kind ===
|
|
25
|
+
if (kind === 'outlined' || variant === 'outlined') {
|
|
8
26
|
return _jsx(OutlinedButton, { ...props, ref: ref, hasIconOnly: hasIconOnly });
|
|
9
27
|
}
|
|
10
|
-
if (kind ===
|
|
28
|
+
if (kind === 'ghost' || variant === 'text' || variant === 'ghost') {
|
|
11
29
|
return _jsx(GhostButton, { ...props, ref: ref, hasIconOnly: hasIconOnly });
|
|
12
30
|
}
|
|
13
31
|
return (_jsx(ContainedButton, { ...props, kind: "contained", variant: "contained", ref: ref, hasIconOnly: hasIconOnly }));
|
|
@@ -17,17 +35,5 @@ const Button = forwardRef((props, ref) => {
|
|
|
17
35
|
* https://github.com/lunit-io/design-system/pull/143#issuecomment-1831127232
|
|
18
36
|
*/
|
|
19
37
|
});
|
|
20
|
-
const GhostButton = forwardRef((props, ref) => {
|
|
21
|
-
const { size = "small", icon, className, children, startIcon, hasIconOnly, variant, ...restProps } = props;
|
|
22
|
-
return (_jsx(CustomButton, { ...restProps, ref: ref, className: `ghost ${className ? className : ""}`, kind: "ghost", color: props.color ?? "primary", size: size, startIcon: startIcon || icon, hasIconOnly: hasIconOnly, children: !hasIconOnly && _jsx(_Fragment, { children: children }) }));
|
|
23
|
-
});
|
|
24
|
-
const OutlinedButton = forwardRef((props, ref) => {
|
|
25
|
-
const { size = "small", icon, className, children, startIcon, hasIconOnly, variant, ...restProps } = props;
|
|
26
|
-
return (_jsx(CustomButton, { ...restProps, ref: ref, className: `outlined ${className ? className : ""}`, kind: "outlined", color: props.color ?? "primary", size: size, startIcon: startIcon || icon, hasIconOnly: hasIconOnly, children: !hasIconOnly && _jsx(_Fragment, { children: children }) }));
|
|
27
|
-
});
|
|
28
|
-
const ContainedButton = forwardRef((props, ref) => {
|
|
29
|
-
const { size = "small", icon, className, children, startIcon, hasIconOnly, variant, ...restProps } = props;
|
|
30
|
-
return (_jsx(CustomButton, { ...restProps, ref: ref, className: `${props.kind ?? "contained"} ${className ? className : ""}`, kind: props.kind ?? "contained", color: props.color ?? "primary", size: size, startIcon: startIcon || icon, hasIconOnly: hasIconOnly, children: !hasIconOnly && _jsx(_Fragment, { children: children }) }));
|
|
31
|
-
});
|
|
32
38
|
export default Button;
|
|
33
39
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,MAAM,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,MAAM,WAAW,GAAG,UAAU,CAC5B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EACJ,IAAI,GAAG,OAAO,EACd,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW;IACX,6EAA6E;IAC7E,OAAO,EAAE,QAAQ,EACjB,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,KAAC,YAAY,OACP,SAAS,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAChD,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,SAAS,EAC/B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,IAAI,IAAI,EAC5B,WAAW,EAAE,WAAW,YAEvB,CAAC,WAAW,IAAI,4BAAG,QAAQ,GAAI,GACnB,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,cAAc,GAAG,UAAU,CAG/B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,MAAM,EACJ,IAAI,GAAG,OAAO,EACd,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW;IACX,6EAA6E;IAC7E,OAAO,EAAE,QAAQ,EACjB,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,KAAC,YAA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IAC3D,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE9D,IAAI,IAAI,KAAK,UAAU,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;QAClD,OAAO,KAAC,cAAc,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,GAAI,CAAC;IAC3E,CAAC;IAED,IAAI,IAAI,KAAK,OAAO,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QAClE,OAAO,KAAC,WAAW,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,GAAI,CAAC;IACxE,CAAC;IAED,OAAO,CACL,KAAC,eAAe,OACV,KAAK,EACT,IAAI,EAAC,WAAW,EAChB,OAAO,EAAC,WAAW,EACnB,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,WAAW,GACxB,CACH,CAAC;IAEF;;;;OAIG;AACL,CAAC,CAAe,CAAC;AAEjB,eAAe,MAAM,CAAC"}
|
|
@@ -1,187 +1,187 @@
|
|
|
1
|
-
import { styled } from
|
|
2
|
-
import { Button as MuiButton } from
|
|
3
|
-
import { PADDING_OF_FOCUS, OUTLINED_BORDER_WIDTH } from
|
|
4
|
-
import { getButtonPaddingBySizeAndKind } from
|
|
5
|
-
import { getIconButtonPaddingBySizeAndKind } from
|
|
6
|
-
import getHoverStyle from
|
|
7
|
-
const borderRadius =
|
|
1
|
+
import { styled } from '@mui/material/styles';
|
|
2
|
+
import { Button as MuiButton } from '@mui/material';
|
|
3
|
+
import { PADDING_OF_FOCUS, OUTLINED_BORDER_WIDTH } from './const';
|
|
4
|
+
import { getButtonPaddingBySizeAndKind } from './utils/getButtonPaddingBySizeAndKind';
|
|
5
|
+
import { getIconButtonPaddingBySizeAndKind } from './utils/getIconButtonPaddingBySizeAndKind';
|
|
6
|
+
import getHoverStyle from './utils/getHoverStyle';
|
|
7
|
+
const borderRadius = '8px';
|
|
8
8
|
export const sizeStyle = ({ size, kind, hasIconOnly, typography, selected = false, }) => ({
|
|
9
|
-
...(size ===
|
|
9
|
+
...(size === 'small' && {
|
|
10
10
|
...typography.button2,
|
|
11
11
|
padding: `${hasIconOnly
|
|
12
12
|
? getIconButtonPaddingBySizeAndKind({ kind, size, selected })
|
|
13
13
|
: getButtonPaddingBySizeAndKind({ kind, size, selected })}`,
|
|
14
|
-
minWidth:
|
|
15
|
-
height:
|
|
14
|
+
minWidth: '28px',
|
|
15
|
+
height: '28px',
|
|
16
16
|
}),
|
|
17
|
-
...(size ===
|
|
17
|
+
...(size === 'medium' && {
|
|
18
18
|
...typography.button2,
|
|
19
19
|
padding: `${hasIconOnly
|
|
20
20
|
? getIconButtonPaddingBySizeAndKind({ kind, size, selected })
|
|
21
21
|
: getButtonPaddingBySizeAndKind({ kind, size, selected })}`,
|
|
22
|
-
minWidth:
|
|
23
|
-
height:
|
|
22
|
+
minWidth: '36px',
|
|
23
|
+
height: '36px',
|
|
24
24
|
}),
|
|
25
|
-
...(size ===
|
|
25
|
+
...(size === 'large' && {
|
|
26
26
|
...typography.button1,
|
|
27
27
|
padding: `${hasIconOnly
|
|
28
28
|
? getIconButtonPaddingBySizeAndKind({ kind, size, selected })
|
|
29
29
|
: getButtonPaddingBySizeAndKind({ kind, size, selected })}`,
|
|
30
|
-
minWidth:
|
|
31
|
-
height:
|
|
30
|
+
minWidth: '44px',
|
|
31
|
+
height: '44px',
|
|
32
32
|
}),
|
|
33
33
|
});
|
|
34
34
|
export const kindStyle = ({ kind, color, lunit_token }) => ({
|
|
35
35
|
// kind: container
|
|
36
|
-
...(kind ===
|
|
37
|
-
color ===
|
|
36
|
+
...(kind === 'contained' &&
|
|
37
|
+
color === 'primary' && {
|
|
38
38
|
color: lunit_token.component.btn_primary_text_2,
|
|
39
39
|
backgroundColor: lunit_token.component.btn_primary_bg,
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
'&:hover': getHoverStyle(lunit_token.component.btn_primary_bg),
|
|
41
|
+
'&.Mui-disabled': {
|
|
42
42
|
opacity: 0.38,
|
|
43
|
-
border:
|
|
43
|
+
border: 'none',
|
|
44
44
|
color: lunit_token.component.btn_primary_text_2,
|
|
45
45
|
},
|
|
46
46
|
}),
|
|
47
|
-
...(kind ===
|
|
48
|
-
color ===
|
|
47
|
+
...(kind === 'contained' &&
|
|
48
|
+
color === 'secondary' && {
|
|
49
49
|
color: lunit_token.component.btn_secondary_text,
|
|
50
50
|
backgroundColor: lunit_token.component.btn_secondary_bg,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
'&:hover': getHoverStyle(lunit_token.component.btn_secondary_bg),
|
|
52
|
+
'&.Mui-disabled': {
|
|
53
53
|
opacity: 0.38,
|
|
54
|
-
border:
|
|
54
|
+
border: 'none',
|
|
55
55
|
color: lunit_token.component.btn_secondary_text,
|
|
56
56
|
},
|
|
57
57
|
}),
|
|
58
|
-
...(kind ===
|
|
59
|
-
color ===
|
|
58
|
+
...(kind === 'contained' &&
|
|
59
|
+
color === 'error' && {
|
|
60
60
|
color: lunit_token.component.btn_primary_text_2,
|
|
61
61
|
backgroundColor: lunit_token.component.btn_error_bg,
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
'&:hover': getHoverStyle(lunit_token.component.btn_error_bg),
|
|
63
|
+
'&.Mui-disabled': {
|
|
64
64
|
opacity: 0.38,
|
|
65
|
-
border:
|
|
65
|
+
border: 'none',
|
|
66
66
|
color: lunit_token.component.btn_primary_text_2,
|
|
67
67
|
},
|
|
68
68
|
}),
|
|
69
69
|
// kind: ghost
|
|
70
|
-
...(kind ===
|
|
71
|
-
color ===
|
|
70
|
+
...(kind === 'ghost' &&
|
|
71
|
+
color === 'primary' && {
|
|
72
72
|
color: lunit_token.component.btn_primary_text_1,
|
|
73
|
-
border:
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
border: 'none',
|
|
74
|
+
'&:hover': getHoverStyle('none'),
|
|
75
|
+
'&.Mui-disabled': {
|
|
76
76
|
opacity: 0.38,
|
|
77
|
-
border:
|
|
77
|
+
border: 'none',
|
|
78
78
|
color: lunit_token.component.btn_primary_text_1,
|
|
79
79
|
},
|
|
80
80
|
}),
|
|
81
|
-
...(kind ===
|
|
82
|
-
color ===
|
|
81
|
+
...(kind === 'ghost' &&
|
|
82
|
+
color === 'secondary' && {
|
|
83
83
|
color: lunit_token.component.btn_secondary_text,
|
|
84
|
-
border:
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
border: 'none',
|
|
85
|
+
'&:hover': getHoverStyle('none'),
|
|
86
|
+
'&.Mui-disabled': {
|
|
87
87
|
opacity: 0.38,
|
|
88
|
-
border:
|
|
88
|
+
border: 'none',
|
|
89
89
|
color: lunit_token.component.btn_secondary_text,
|
|
90
90
|
},
|
|
91
91
|
}),
|
|
92
|
-
...(kind ===
|
|
93
|
-
color ===
|
|
92
|
+
...(kind === 'ghost' &&
|
|
93
|
+
color === 'error' && {
|
|
94
94
|
color: lunit_token.component.btn_error_text,
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
'&:hover': getHoverStyle('none'),
|
|
96
|
+
'&.Mui-disabled': {
|
|
97
97
|
opacity: 0.38,
|
|
98
|
-
border:
|
|
98
|
+
border: 'none',
|
|
99
99
|
color: lunit_token.component.btn_error_text,
|
|
100
100
|
},
|
|
101
101
|
}),
|
|
102
102
|
// kind: outlined
|
|
103
|
-
...(kind ===
|
|
104
|
-
color ===
|
|
103
|
+
...(kind === 'outlined' &&
|
|
104
|
+
color === 'primary' && {
|
|
105
105
|
color: lunit_token.component.btn_primary_text_1,
|
|
106
106
|
border: `${OUTLINED_BORDER_WIDTH}px solid ${lunit_token.component.btn_primary_border}`,
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
'&:hover': getHoverStyle('none'),
|
|
108
|
+
'&:hover:before': {
|
|
109
109
|
content: "''",
|
|
110
|
-
position:
|
|
111
|
-
left:
|
|
112
|
-
top:
|
|
113
|
-
width:
|
|
114
|
-
height:
|
|
110
|
+
position: 'absolute',
|
|
111
|
+
left: '-1px',
|
|
112
|
+
top: '-1px',
|
|
113
|
+
width: 'calc(100% + 2px)',
|
|
114
|
+
height: 'calc(100% + 2px)',
|
|
115
115
|
zIndex: -1,
|
|
116
|
-
backgroundColor: lunit_token.core.
|
|
116
|
+
backgroundColor: lunit_token.core.status_hover,
|
|
117
117
|
borderRadius,
|
|
118
118
|
},
|
|
119
|
-
|
|
119
|
+
'&.Mui-disabled': {
|
|
120
120
|
opacity: 0.38,
|
|
121
121
|
color: lunit_token.component.btn_primary_text_1,
|
|
122
122
|
},
|
|
123
123
|
}),
|
|
124
|
-
...(kind ===
|
|
125
|
-
color ===
|
|
124
|
+
...(kind === 'outlined' &&
|
|
125
|
+
color === 'secondary' && {
|
|
126
126
|
color: lunit_token.component.btn_secondary_text,
|
|
127
127
|
border: `${OUTLINED_BORDER_WIDTH}px solid ${lunit_token.core.border_medium}`,
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
'&:hover': getHoverStyle('none'),
|
|
129
|
+
'&:hover:before': {
|
|
130
130
|
content: "''",
|
|
131
|
-
position:
|
|
132
|
-
left:
|
|
133
|
-
top:
|
|
134
|
-
width:
|
|
135
|
-
height:
|
|
131
|
+
position: 'absolute',
|
|
132
|
+
left: '-1px',
|
|
133
|
+
top: '-1px',
|
|
134
|
+
width: 'calc(100% + 2px)',
|
|
135
|
+
height: 'calc(100% + 2px)',
|
|
136
136
|
zIndex: -1,
|
|
137
|
-
backgroundColor: lunit_token.core.
|
|
137
|
+
backgroundColor: lunit_token.core.status_hover,
|
|
138
138
|
borderRadius,
|
|
139
139
|
},
|
|
140
|
-
|
|
140
|
+
'&.Mui-disabled': {
|
|
141
141
|
opacity: 0.38,
|
|
142
142
|
color: lunit_token.component.btn_secondary_text,
|
|
143
143
|
},
|
|
144
144
|
}),
|
|
145
145
|
});
|
|
146
146
|
export const commonStyle = ({ lunit_token }) => ({
|
|
147
|
-
fontWeight:
|
|
147
|
+
fontWeight: '500',
|
|
148
148
|
borderRadius,
|
|
149
|
-
textTransform:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
position:
|
|
149
|
+
textTransform: 'initial',
|
|
150
|
+
'&.Mui-focusVisible': {
|
|
151
|
+
'&::after': {
|
|
152
|
+
position: 'absolute',
|
|
153
153
|
width: `calc(100% + ${PADDING_OF_FOCUS}px)`,
|
|
154
154
|
height: `calc(100% + ${PADDING_OF_FOCUS}px)`,
|
|
155
155
|
content: '""',
|
|
156
|
-
borderRadius:
|
|
157
|
-
border: `1px solid ${lunit_token.core.
|
|
158
|
-
boxSizing:
|
|
156
|
+
borderRadius: '11px',
|
|
157
|
+
border: `1px solid ${lunit_token.core.status_focused}`,
|
|
158
|
+
boxSizing: 'border-box',
|
|
159
159
|
},
|
|
160
160
|
},
|
|
161
|
-
|
|
161
|
+
'&:hover:before': {
|
|
162
162
|
content: "''",
|
|
163
|
-
position:
|
|
163
|
+
position: 'absolute',
|
|
164
164
|
left: 0,
|
|
165
165
|
top: 0,
|
|
166
|
-
width:
|
|
167
|
-
height:
|
|
166
|
+
width: '100%',
|
|
167
|
+
height: '100%',
|
|
168
168
|
zIndex: -1,
|
|
169
|
-
backgroundColor: lunit_token.core.
|
|
169
|
+
backgroundColor: lunit_token.core.status_hover,
|
|
170
170
|
borderRadius,
|
|
171
171
|
},
|
|
172
172
|
});
|
|
173
173
|
export const iconStyle = ({ size, hasIconOnly, }) => ({
|
|
174
|
-
|
|
174
|
+
'& .MuiButton-startIcon': {
|
|
175
175
|
margin: 0,
|
|
176
|
-
marginRight: hasIconOnly ?
|
|
177
|
-
|
|
178
|
-
fontSize:
|
|
176
|
+
marginRight: hasIconOnly ? '0px' : size === 'large' ? '8px' : '4px',
|
|
177
|
+
'*:nth-of-type(1)': {
|
|
178
|
+
fontSize: '20px',
|
|
179
179
|
},
|
|
180
180
|
},
|
|
181
181
|
});
|
|
182
182
|
export const CustomButton = styled(MuiButton, {
|
|
183
183
|
shouldForwardProp: (prop) => {
|
|
184
|
-
return ![
|
|
184
|
+
return !['kind', 'hasIconOnly', 'variant'].includes(prop);
|
|
185
185
|
},
|
|
186
186
|
})(({ theme: { typography, palette: { lunit_token }, }, kind, size, color, hasIconOnly, }) => ({
|
|
187
187
|
...commonStyle({ lunit_token }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.styled.js","sourceRoot":"","sources":["../../../src/components/Button/Button.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,aAAa,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.styled.js","sourceRoot":"","sources":["../../../src/components/Button/Button.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAelD,MAAM,YAAY,GAAG,KAAK,CAAC;AAE3B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,QAAQ,GAAG,KAAK,GACA,EAAE,EAAE,CAAC,CAAC;IACtB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@@
|
|
|
1
|
-
export { default } from
|
|
1
|
+
export { default } from './Button';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { OUTLINED_BORDER_WIDTH } from
|
|
1
|
+
import { OUTLINED_BORDER_WIDTH } from '../const';
|
|
2
2
|
/**
|
|
3
3
|
* When kind is outlined,
|
|
4
4
|
* the padding value must include the border width of outlined.
|
|
5
5
|
* This function takes care of this.
|
|
6
6
|
*/
|
|
7
7
|
export const getButtonPaddingBySizeAndKind = ({ kind, size, selected = false, }) => {
|
|
8
|
-
if (size ===
|
|
9
|
-
return kind ===
|
|
8
|
+
if (size === 'small') {
|
|
9
|
+
return kind === 'outlined' && !selected
|
|
10
10
|
? `${4 - OUTLINED_BORDER_WIDTH}px ${8 - OUTLINED_BORDER_WIDTH}px`
|
|
11
|
-
:
|
|
11
|
+
: '4px 8px';
|
|
12
12
|
}
|
|
13
|
-
if (size ===
|
|
14
|
-
return kind ===
|
|
13
|
+
if (size === 'medium') {
|
|
14
|
+
return kind === 'outlined' && !selected
|
|
15
15
|
? `${8 - OUTLINED_BORDER_WIDTH}px ${12 - OUTLINED_BORDER_WIDTH}px`
|
|
16
|
-
:
|
|
16
|
+
: '8px 12px';
|
|
17
17
|
}
|
|
18
18
|
// size === "large"
|
|
19
|
-
return kind ===
|
|
19
|
+
return kind === 'outlined' && !selected
|
|
20
20
|
? `${10 - OUTLINED_BORDER_WIDTH}px ${12 - OUTLINED_BORDER_WIDTH}px`
|
|
21
|
-
:
|
|
21
|
+
: '10px 12px';
|
|
22
22
|
};
|
|
23
23
|
//# sourceMappingURL=getButtonPaddingBySizeAndKind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getButtonPaddingBySizeAndKind.js","sourceRoot":"","sources":["../../../../src/components/Button/utils/getButtonPaddingBySizeAndKind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAQjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,EAC5C,IAAI,EACJ,IAAI,EACJ,QAAQ,GAAG,KAAK,GACoB,EAAE,EAAE;IACxC,IAAI,IAAI,KAAK,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"getButtonPaddingBySizeAndKind.js","sourceRoot":"","sources":["../../../../src/components/Button/utils/getButtonPaddingBySizeAndKind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAQjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,EAC5C,IAAI,EACJ,IAAI,EACJ,QAAQ,GAAG,KAAK,GACoB,EAAE,EAAE;IACxC,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,OAAO,IAAI,KAAK,UAAU,IAAI,CAAC,QAAQ;YACrC,CAAC,CAAC,GAAG,CAAC,GAAG,qBAAqB,MAAM,CAAC,GAAG,qBAAqB,IAAI;YACjE,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC;IAED,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,IAAI,KAAK,UAAU,IAAI,CAAC,QAAQ;YACrC,CAAC,CAAC,GAAG,CAAC,GAAG,qBAAqB,MAAM,EAAE,GAAG,qBAAqB,IAAI;YAClE,CAAC,CAAC,UAAU,CAAC;IACjB,CAAC;IAED,mBAAmB;IACnB,OAAO,IAAI,KAAK,UAAU,IAAI,CAAC,QAAQ;QACrC,CAAC,CAAC,GAAG,EAAE,GAAG,qBAAqB,MAAM,EAAE,GAAG,qBAAqB,IAAI;QACnE,CAAC,CAAC,WAAW,CAAC;AAClB,CAAC,CAAC"}
|