@lunit/design-system 2.1.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 +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 +249 -265
- 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 -79
- 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 +4 -39
- 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 -34
- 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 +22 -26
- 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 +18 -24
- 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 +6 -5
- 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 +7 -8
- 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 +9 -15
- package/src/stories/components/Alert/Alert.stories.tsx +39 -46
- 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 -124
- 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 -60
- package/src/stories/components/TextField/TextFieldDocs.mdx +8 -12
- package/src/stories/components/TextField/TextFieldMulti.stories.tsx +39 -58
- package/src/stories/components/TextField/TextFieldSingle.stories.tsx +74 -121
- package/src/stories/components/TextField/TextFieldSize.stories.tsx +35 -56
- package/src/stories/components/Toast/Toast.stories.tsx +39 -49
- package/src/stories/components/ToggleButton/Basic.stories.tsx +237 -235
- package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +10 -14
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +144 -203
- 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 -73
- 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
- package/tsconfig.json +0 -1
- package/src/stories/components/ToggleButton/Group.stories.tsx +0 -221
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { StoryFn, Meta } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StoryFn, Meta } from '@storybook/react-webpack5';
|
|
3
3
|
|
|
4
|
-
import DatePicker from
|
|
4
|
+
import DatePicker from '@/components/DatePicker';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
title:
|
|
7
|
+
title: 'Components/DatePicker',
|
|
8
8
|
component: DatePicker,
|
|
9
9
|
} as Meta<typeof DatePicker>;
|
|
10
10
|
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import { Box } from
|
|
3
|
-
import Error from
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import Error from '@lunit/design-system-icons/Error';
|
|
4
4
|
|
|
5
|
-
import Button from
|
|
6
|
-
import Dialog from
|
|
5
|
+
import Button from '@/components/Button';
|
|
6
|
+
import Dialog, { DialogProps } from '@/components/Dialog';
|
|
7
7
|
|
|
8
|
-
import type { Meta, StoryObj } from
|
|
8
|
+
import type { Meta, StoryObj, StoryContext } from '@storybook/react-webpack5';
|
|
9
9
|
|
|
10
10
|
const meta: Meta<typeof Dialog> = {
|
|
11
|
-
title:
|
|
11
|
+
title: 'components/Dialog',
|
|
12
12
|
component: Dialog,
|
|
13
|
-
tags: ["autodocs"],
|
|
14
13
|
parameters: {
|
|
15
14
|
docs: { disable: true, hidden: true },
|
|
16
15
|
},
|
|
17
16
|
argTypes: {
|
|
18
|
-
onClose: { action:
|
|
17
|
+
onClose: { action: 'onClose' },
|
|
19
18
|
},
|
|
20
19
|
};
|
|
21
20
|
|
|
@@ -23,14 +22,18 @@ export default meta;
|
|
|
23
22
|
type Story = StoryObj<typeof Dialog>;
|
|
24
23
|
|
|
25
24
|
export const PassiveModal: Story = {
|
|
26
|
-
name:
|
|
27
|
-
render: function PassiveModalRender(_Story, context) {
|
|
25
|
+
name: 'Type: passive modal',
|
|
26
|
+
render: function PassiveModalRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
28
27
|
const classNameFromGlobal = context.globals.theme;
|
|
29
28
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
30
29
|
|
|
31
30
|
return (
|
|
32
|
-
<div style={{ width:
|
|
33
|
-
<div
|
|
31
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
32
|
+
<div
|
|
33
|
+
ref={(ref) => {
|
|
34
|
+
setTarget(ref);
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
34
37
|
<Dialog
|
|
35
38
|
className={classNameFromGlobal}
|
|
36
39
|
isOpen={Boolean(target)}
|
|
@@ -38,8 +41,7 @@ export const PassiveModal: Story = {
|
|
|
38
41
|
type="passive"
|
|
39
42
|
title="Title area"
|
|
40
43
|
>
|
|
41
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
42
|
-
industry
|
|
44
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
43
45
|
</Dialog>
|
|
44
46
|
</div>
|
|
45
47
|
);
|
|
@@ -47,14 +49,18 @@ export const PassiveModal: Story = {
|
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
export const ActionModal: Story = {
|
|
50
|
-
name:
|
|
51
|
-
render: function ActionModalRender(_Story, context) {
|
|
52
|
+
name: 'Type: action modal',
|
|
53
|
+
render: function ActionModalRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
52
54
|
const classNameFromGlobal = context.globals.theme;
|
|
53
55
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
54
56
|
|
|
55
57
|
return (
|
|
56
|
-
<div style={{ width:
|
|
57
|
-
<div
|
|
58
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
59
|
+
<div
|
|
60
|
+
ref={(ref) => {
|
|
61
|
+
setTarget(ref);
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
58
64
|
<Dialog
|
|
59
65
|
className={classNameFromGlobal}
|
|
60
66
|
isOpen={Boolean(target)}
|
|
@@ -63,12 +69,7 @@ export const ActionModal: Story = {
|
|
|
63
69
|
title="Title area"
|
|
64
70
|
actions={
|
|
65
71
|
<>
|
|
66
|
-
<Button
|
|
67
|
-
kind="ghost"
|
|
68
|
-
color="secondary"
|
|
69
|
-
size="medium"
|
|
70
|
-
onClick={close}
|
|
71
|
-
>
|
|
72
|
+
<Button kind="ghost" color="secondary" size="medium" onClick={close}>
|
|
72
73
|
Cancel
|
|
73
74
|
</Button>
|
|
74
75
|
<Button kind="contained" size="medium" onClick={close}>
|
|
@@ -77,8 +78,7 @@ export const ActionModal: Story = {
|
|
|
77
78
|
</>
|
|
78
79
|
}
|
|
79
80
|
>
|
|
80
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
81
|
-
industry
|
|
81
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
82
82
|
</Dialog>
|
|
83
83
|
</div>
|
|
84
84
|
);
|
|
@@ -86,8 +86,8 @@ export const ActionModal: Story = {
|
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
export const NonModal: Story = {
|
|
89
|
-
name:
|
|
90
|
-
render: function NonModalRender(_Story, context) {
|
|
89
|
+
name: 'Type: non modal',
|
|
90
|
+
render: function NonModalRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
91
91
|
const classNameFromGlobal = context.globals.theme;
|
|
92
92
|
const [isOpen, setIsOpen] = useState(false);
|
|
93
93
|
function open() {
|
|
@@ -100,7 +100,7 @@ export const NonModal: Story = {
|
|
|
100
100
|
|
|
101
101
|
return (
|
|
102
102
|
<>
|
|
103
|
-
<Box sx={{ display:
|
|
103
|
+
<Box sx={{ display: 'flex', gap: '8px' }}>
|
|
104
104
|
<Button kind="contained" size="medium" onClick={open}>
|
|
105
105
|
Open to see Dialog
|
|
106
106
|
</Button>
|
|
@@ -118,12 +118,7 @@ export const NonModal: Story = {
|
|
|
118
118
|
title="Title area"
|
|
119
119
|
actions={
|
|
120
120
|
<>
|
|
121
|
-
<Button
|
|
122
|
-
kind="ghost"
|
|
123
|
-
color="secondary"
|
|
124
|
-
size="medium"
|
|
125
|
-
onClick={close}
|
|
126
|
-
>
|
|
121
|
+
<Button kind="ghost" color="secondary" size="medium" onClick={close}>
|
|
127
122
|
Cancel
|
|
128
123
|
</Button>
|
|
129
124
|
<Button kind="contained" size="medium" onClick={close}>
|
|
@@ -132,8 +127,7 @@ export const NonModal: Story = {
|
|
|
132
127
|
</>
|
|
133
128
|
}
|
|
134
129
|
>
|
|
135
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
136
|
-
industry
|
|
130
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
137
131
|
</Dialog>
|
|
138
132
|
</>
|
|
139
133
|
);
|
|
@@ -141,14 +135,18 @@ export const NonModal: Story = {
|
|
|
141
135
|
};
|
|
142
136
|
|
|
143
137
|
export const SmallFalse: Story = {
|
|
144
|
-
name:
|
|
145
|
-
render: function SmallFalseRender(_Story, context) {
|
|
138
|
+
name: 'Option: small false',
|
|
139
|
+
render: function SmallFalseRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
146
140
|
const classNameFromGlobal = context.globals.theme;
|
|
147
141
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
148
142
|
|
|
149
143
|
return (
|
|
150
|
-
<div style={{ width:
|
|
151
|
-
<div
|
|
144
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
145
|
+
<div
|
|
146
|
+
ref={(ref) => {
|
|
147
|
+
setTarget(ref);
|
|
148
|
+
}}
|
|
149
|
+
/>
|
|
152
150
|
<Dialog
|
|
153
151
|
className={classNameFromGlobal}
|
|
154
152
|
isOpen={Boolean(target)}
|
|
@@ -157,8 +155,7 @@ export const SmallFalse: Story = {
|
|
|
157
155
|
title="Title area"
|
|
158
156
|
size="medium"
|
|
159
157
|
>
|
|
160
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
161
|
-
industry
|
|
158
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
162
159
|
</Dialog>
|
|
163
160
|
</div>
|
|
164
161
|
);
|
|
@@ -166,14 +163,18 @@ export const SmallFalse: Story = {
|
|
|
166
163
|
};
|
|
167
164
|
|
|
168
165
|
export const WithTitleIcon: Story = {
|
|
169
|
-
name:
|
|
170
|
-
render: function WithTitleIconRender(_Story, context) {
|
|
166
|
+
name: 'Option: title icon',
|
|
167
|
+
render: function WithTitleIconRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
171
168
|
const classNameFromGlobal = context.globals.theme;
|
|
172
169
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
173
170
|
|
|
174
171
|
return (
|
|
175
|
-
<div style={{ width:
|
|
176
|
-
<div
|
|
172
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
173
|
+
<div
|
|
174
|
+
ref={(ref) => {
|
|
175
|
+
setTarget(ref);
|
|
176
|
+
}}
|
|
177
|
+
/>
|
|
177
178
|
<Dialog
|
|
178
179
|
className={classNameFromGlobal}
|
|
179
180
|
isOpen={Boolean(target)}
|
|
@@ -183,27 +184,16 @@ export const WithTitleIcon: Story = {
|
|
|
183
184
|
titleIcon={<Error color="error" variant="filled" />}
|
|
184
185
|
actions={
|
|
185
186
|
<>
|
|
186
|
-
<Button
|
|
187
|
-
kind="ghost"
|
|
188
|
-
color="secondary"
|
|
189
|
-
size="medium"
|
|
190
|
-
onClick={close}
|
|
191
|
-
>
|
|
187
|
+
<Button kind="ghost" color="secondary" size="medium" onClick={close}>
|
|
192
188
|
Cancel
|
|
193
189
|
</Button>
|
|
194
|
-
<Button
|
|
195
|
-
kind="contained"
|
|
196
|
-
color="error"
|
|
197
|
-
size="medium"
|
|
198
|
-
onClick={close}
|
|
199
|
-
>
|
|
190
|
+
<Button kind="contained" color="error" size="medium" onClick={close}>
|
|
200
191
|
Confirm
|
|
201
192
|
</Button>
|
|
202
193
|
</>
|
|
203
194
|
}
|
|
204
195
|
>
|
|
205
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
206
|
-
industry
|
|
196
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
207
197
|
</Dialog>
|
|
208
198
|
</div>
|
|
209
199
|
);
|
|
@@ -211,14 +201,18 @@ export const WithTitleIcon: Story = {
|
|
|
211
201
|
};
|
|
212
202
|
|
|
213
203
|
export const WithCustomStyle: Story = {
|
|
214
|
-
name:
|
|
215
|
-
render: function WithCustomStyleRender(_Story, context) {
|
|
204
|
+
name: 'Option: custom style',
|
|
205
|
+
render: function WithCustomStyleRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
216
206
|
const classNameFromGlobal = context.globals.theme;
|
|
217
207
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
218
208
|
|
|
219
209
|
return (
|
|
220
|
-
<div style={{ width:
|
|
221
|
-
<div
|
|
210
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
211
|
+
<div
|
|
212
|
+
ref={(ref) => {
|
|
213
|
+
setTarget(ref);
|
|
214
|
+
}}
|
|
215
|
+
/>
|
|
222
216
|
<Dialog
|
|
223
217
|
className={classNameFromGlobal}
|
|
224
218
|
isOpen={Boolean(target)}
|
|
@@ -226,15 +220,14 @@ export const WithCustomStyle: Story = {
|
|
|
226
220
|
onClose={close}
|
|
227
221
|
title="Title area"
|
|
228
222
|
sx={{
|
|
229
|
-
|
|
230
|
-
border:
|
|
231
|
-
borderRadius:
|
|
232
|
-
backgroundColor:
|
|
223
|
+
'& .dialog-title-wrapper': {
|
|
224
|
+
border: '4px dashed red',
|
|
225
|
+
borderRadius: '10px',
|
|
226
|
+
backgroundColor: 'green',
|
|
233
227
|
},
|
|
234
228
|
}}
|
|
235
229
|
>
|
|
236
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
237
|
-
industry
|
|
230
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
238
231
|
</Dialog>
|
|
239
232
|
</div>
|
|
240
233
|
);
|
|
@@ -242,14 +235,18 @@ export const WithCustomStyle: Story = {
|
|
|
242
235
|
};
|
|
243
236
|
|
|
244
237
|
export const WithScroll: Story = {
|
|
245
|
-
name:
|
|
246
|
-
render: function WithScrollRender(_Story, context) {
|
|
238
|
+
name: 'Option: with scroll',
|
|
239
|
+
render: function WithScrollRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
247
240
|
const classNameFromGlobal = context.globals.theme;
|
|
248
241
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
249
242
|
|
|
250
243
|
return (
|
|
251
|
-
<div style={{ width:
|
|
252
|
-
<div
|
|
244
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
245
|
+
<div
|
|
246
|
+
ref={(ref) => {
|
|
247
|
+
setTarget(ref);
|
|
248
|
+
}}
|
|
249
|
+
/>
|
|
253
250
|
<Dialog
|
|
254
251
|
className={classNameFromGlobal}
|
|
255
252
|
isOpen={Boolean(target)}
|
|
@@ -258,61 +255,43 @@ export const WithScroll: Story = {
|
|
|
258
255
|
title="Title area"
|
|
259
256
|
actions={
|
|
260
257
|
<>
|
|
261
|
-
<Button
|
|
262
|
-
kind="ghost"
|
|
263
|
-
color="secondary"
|
|
264
|
-
size="medium"
|
|
265
|
-
onClick={close}
|
|
266
|
-
>
|
|
258
|
+
<Button kind="ghost" color="secondary" size="medium" onClick={close}>
|
|
267
259
|
Cancel
|
|
268
260
|
</Button>
|
|
269
|
-
<Button
|
|
270
|
-
kind="contained"
|
|
271
|
-
color="error"
|
|
272
|
-
size="medium"
|
|
273
|
-
onClick={close}
|
|
274
|
-
>
|
|
261
|
+
<Button kind="contained" color="error" size="medium" onClick={close}>
|
|
275
262
|
Confirm
|
|
276
263
|
</Button>
|
|
277
264
|
</>
|
|
278
265
|
}
|
|
279
266
|
>
|
|
280
|
-
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quis,
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
sit amet consectetur
|
|
308
|
-
deserunt reiciendis. Officia veniam consequuntur doloribus debitis
|
|
309
|
-
numquam ipsum autem, eos repellendus eligendi esse voluptatum natus,
|
|
310
|
-
cum optio? Unde! Lorem ipsum dolor sit amet consectetur adipisicing
|
|
311
|
-
elit. Quibusdam praesentium incidunt tempora quam aut nulla corrupti
|
|
312
|
-
ipsa voluptatem vitae soluta ex officia, explicabo, voluptate porro.
|
|
313
|
-
Eius mollitia veritatis corporis neque. Lorem Ipsum is simply dummy
|
|
314
|
-
text of the a printing and typesetting industry Lorem ipsum dolor sit
|
|
315
|
-
amet consectetur
|
|
267
|
+
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quis, suscipit at. Atque enim,
|
|
268
|
+
hic architecto sequi libero deserunt dolores omnis, cumque dignissimos ab animi.
|
|
269
|
+
Recusandae saepe facere error tempore quasi. Lorem ipsum dolor sit amet consectetur
|
|
270
|
+
adipisicing elit. Consectetur eius commodi deserunt reiciendis. Officia veniam
|
|
271
|
+
consequuntur doloribus debitis numquam ipsum autem, eos repellendus eligendi esse
|
|
272
|
+
voluptatum natus, cum optio? Unde! Lorem ipsum dolor sit amet consectetur adipisicing
|
|
273
|
+
elit. Quibusdam praesentium incidunt tempora quam aut nulla corrupti ipsa voluptatem vitae
|
|
274
|
+
soluta ex officia, explicabo, voluptate porro. Eius mollitia veritatis corporis neque.
|
|
275
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry Lorem ipsum
|
|
276
|
+
dolor sit amet consectetur Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quis,
|
|
277
|
+
suscipit at. Atque enim, hic architecto sequi libero deserunt dolores omnis, cumque
|
|
278
|
+
dignissimos ab animi. Recusandae saepe facere error tempore quasi. Lorem ipsum dolor sit
|
|
279
|
+
amet consectetur adipisicing elit. Consectetur eius commodi deserunt reiciendis. Officia
|
|
280
|
+
veniam consequuntur doloribus debitis numquam ipsum autem, eos repellendus eligendi esse
|
|
281
|
+
voluptatum natus, cum optio? Unde! Lorem ipsum dolor sit amet consectetur adipisicing
|
|
282
|
+
elit. Quibusdam praesentium incidunt tempora quam aut nulla corrupti ipsa voluptatem vitae
|
|
283
|
+
soluta ex officia, explicabo, voluptate porro. Eius mollitia veritatis corporis neque.
|
|
284
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry Lorem ipsum
|
|
285
|
+
dolor sit amet consectetur Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quis,
|
|
286
|
+
suscipit at. Atque enim, hic architecto sequi libero deserunt dolores omnis, cumque
|
|
287
|
+
dignissimos ab animi. Recusandae saepe facere error tempore quasi. Lorem ipsum dolor sit
|
|
288
|
+
amet consectetur adipisicing elit. Consectetur eius commodi deserunt reiciendis. Officia
|
|
289
|
+
veniam consequuntur doloribus debitis numquam ipsum autem, eos repellendus eligendi esse
|
|
290
|
+
voluptatum natus, cum optio? Unde! Lorem ipsum dolor sit amet consectetur adipisicing
|
|
291
|
+
elit. Quibusdam praesentium incidunt tempora quam aut nulla corrupti ipsa voluptatem vitae
|
|
292
|
+
soluta ex officia, explicabo, voluptate porro. Eius mollitia veritatis corporis neque.
|
|
293
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry Lorem ipsum
|
|
294
|
+
dolor sit amet consectetur
|
|
316
295
|
</Dialog>
|
|
317
296
|
</div>
|
|
318
297
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Canvas, Stories, Controls, Meta, Story } from
|
|
2
|
-
import { Error } from
|
|
1
|
+
import { Canvas, Stories, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import { Error } from '@lunit/design-system-icons';
|
|
3
3
|
|
|
4
|
-
import Dialog from
|
|
5
|
-
import * as DialogStories from
|
|
4
|
+
import Dialog from '@/components/Dialog';
|
|
5
|
+
import * as DialogStories from './Dialog.stories';
|
|
6
6
|
|
|
7
7
|
<Meta name="Dialog Docs" of={DialogStories} />
|
|
8
8
|
|
|
@@ -16,9 +16,9 @@ Dialogs are rendered in a [Portal](https://react.dev/reference/react-dom/createP
|
|
|
16
16
|
### Basic Dialog
|
|
17
17
|
|
|
18
18
|
```tsx
|
|
19
|
-
import { Dialog } from
|
|
19
|
+
import { Dialog } from '@lunit/design-system';
|
|
20
20
|
// or
|
|
21
|
-
import Dialog from
|
|
21
|
+
import Dialog from '@lunit/design-system/Dialog';
|
|
22
22
|
|
|
23
23
|
<Dialog />;
|
|
24
24
|
```
|
|
@@ -124,13 +124,7 @@ The `actions` prop sets the actions of the Dialog. <br />
|
|
|
124
124
|
You can pass any component to the actions prop only when the type of the modal is action.
|
|
125
125
|
|
|
126
126
|
```tsx
|
|
127
|
-
<Dialog
|
|
128
|
-
isOpen={true}
|
|
129
|
-
onClose={close}
|
|
130
|
-
type="action"
|
|
131
|
-
title="Title area"
|
|
132
|
-
actions={actionsChildren}
|
|
133
|
-
>
|
|
127
|
+
<Dialog isOpen={true} onClose={close} type="action" title="Title area" actions={actionsChildren}>
|
|
134
128
|
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
135
129
|
</Dialog>
|
|
136
130
|
```
|