@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,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,20 +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
13
|
parameters: {
|
|
14
14
|
docs: { disable: true, hidden: true },
|
|
15
15
|
},
|
|
16
16
|
argTypes: {
|
|
17
|
-
onClose: { action:
|
|
17
|
+
onClose: { action: 'onClose' },
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -22,16 +22,18 @@ export default meta;
|
|
|
22
22
|
type Story = StoryObj<typeof Dialog>;
|
|
23
23
|
|
|
24
24
|
export const PassiveModal: Story = {
|
|
25
|
-
name:
|
|
26
|
-
render: function PassiveModalRender(_Story, context) {
|
|
25
|
+
name: 'Type: passive modal',
|
|
26
|
+
render: function PassiveModalRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
27
27
|
const classNameFromGlobal = context.globals.theme;
|
|
28
28
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
|
-
<div style={{ width:
|
|
32
|
-
<div
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
32
|
+
<div
|
|
33
|
+
ref={(ref) => {
|
|
34
|
+
setTarget(ref);
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
35
37
|
<Dialog
|
|
36
38
|
className={classNameFromGlobal}
|
|
37
39
|
isOpen={Boolean(target)}
|
|
@@ -39,8 +41,7 @@ export const PassiveModal: Story = {
|
|
|
39
41
|
type="passive"
|
|
40
42
|
title="Title area"
|
|
41
43
|
>
|
|
42
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
43
|
-
industry
|
|
44
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
44
45
|
</Dialog>
|
|
45
46
|
</div>
|
|
46
47
|
);
|
|
@@ -48,16 +49,18 @@ export const PassiveModal: Story = {
|
|
|
48
49
|
};
|
|
49
50
|
|
|
50
51
|
export const ActionModal: Story = {
|
|
51
|
-
name:
|
|
52
|
-
render: function ActionModalRender(_Story, context) {
|
|
52
|
+
name: 'Type: action modal',
|
|
53
|
+
render: function ActionModalRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
53
54
|
const classNameFromGlobal = context.globals.theme;
|
|
54
55
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
55
56
|
|
|
56
57
|
return (
|
|
57
|
-
<div style={{ width:
|
|
58
|
-
<div
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
59
|
+
<div
|
|
60
|
+
ref={(ref) => {
|
|
61
|
+
setTarget(ref);
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
61
64
|
<Dialog
|
|
62
65
|
className={classNameFromGlobal}
|
|
63
66
|
isOpen={Boolean(target)}
|
|
@@ -66,12 +69,7 @@ export const ActionModal: Story = {
|
|
|
66
69
|
title="Title area"
|
|
67
70
|
actions={
|
|
68
71
|
<>
|
|
69
|
-
<Button
|
|
70
|
-
kind="ghost"
|
|
71
|
-
color="secondary"
|
|
72
|
-
size="medium"
|
|
73
|
-
onClick={close}
|
|
74
|
-
>
|
|
72
|
+
<Button kind="ghost" color="secondary" size="medium" onClick={close}>
|
|
75
73
|
Cancel
|
|
76
74
|
</Button>
|
|
77
75
|
<Button kind="contained" size="medium" onClick={close}>
|
|
@@ -80,8 +78,7 @@ export const ActionModal: Story = {
|
|
|
80
78
|
</>
|
|
81
79
|
}
|
|
82
80
|
>
|
|
83
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
84
|
-
industry
|
|
81
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
85
82
|
</Dialog>
|
|
86
83
|
</div>
|
|
87
84
|
);
|
|
@@ -89,8 +86,8 @@ export const ActionModal: Story = {
|
|
|
89
86
|
};
|
|
90
87
|
|
|
91
88
|
export const NonModal: Story = {
|
|
92
|
-
name:
|
|
93
|
-
render: function NonModalRender(_Story, context) {
|
|
89
|
+
name: 'Type: non modal',
|
|
90
|
+
render: function NonModalRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
94
91
|
const classNameFromGlobal = context.globals.theme;
|
|
95
92
|
const [isOpen, setIsOpen] = useState(false);
|
|
96
93
|
function open() {
|
|
@@ -103,7 +100,7 @@ export const NonModal: Story = {
|
|
|
103
100
|
|
|
104
101
|
return (
|
|
105
102
|
<>
|
|
106
|
-
<Box sx={{ display:
|
|
103
|
+
<Box sx={{ display: 'flex', gap: '8px' }}>
|
|
107
104
|
<Button kind="contained" size="medium" onClick={open}>
|
|
108
105
|
Open to see Dialog
|
|
109
106
|
</Button>
|
|
@@ -121,12 +118,7 @@ export const NonModal: Story = {
|
|
|
121
118
|
title="Title area"
|
|
122
119
|
actions={
|
|
123
120
|
<>
|
|
124
|
-
<Button
|
|
125
|
-
kind="ghost"
|
|
126
|
-
color="secondary"
|
|
127
|
-
size="medium"
|
|
128
|
-
onClick={close}
|
|
129
|
-
>
|
|
121
|
+
<Button kind="ghost" color="secondary" size="medium" onClick={close}>
|
|
130
122
|
Cancel
|
|
131
123
|
</Button>
|
|
132
124
|
<Button kind="contained" size="medium" onClick={close}>
|
|
@@ -135,8 +127,7 @@ export const NonModal: Story = {
|
|
|
135
127
|
</>
|
|
136
128
|
}
|
|
137
129
|
>
|
|
138
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
139
|
-
industry
|
|
130
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
140
131
|
</Dialog>
|
|
141
132
|
</>
|
|
142
133
|
);
|
|
@@ -144,16 +135,18 @@ export const NonModal: Story = {
|
|
|
144
135
|
};
|
|
145
136
|
|
|
146
137
|
export const SmallFalse: Story = {
|
|
147
|
-
name:
|
|
148
|
-
render: function SmallFalseRender(_Story, context) {
|
|
138
|
+
name: 'Option: small false',
|
|
139
|
+
render: function SmallFalseRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
149
140
|
const classNameFromGlobal = context.globals.theme;
|
|
150
141
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
151
142
|
|
|
152
143
|
return (
|
|
153
|
-
<div style={{ width:
|
|
154
|
-
<div
|
|
155
|
-
|
|
156
|
-
|
|
144
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
145
|
+
<div
|
|
146
|
+
ref={(ref) => {
|
|
147
|
+
setTarget(ref);
|
|
148
|
+
}}
|
|
149
|
+
/>
|
|
157
150
|
<Dialog
|
|
158
151
|
className={classNameFromGlobal}
|
|
159
152
|
isOpen={Boolean(target)}
|
|
@@ -162,8 +155,7 @@ export const SmallFalse: Story = {
|
|
|
162
155
|
title="Title area"
|
|
163
156
|
size="medium"
|
|
164
157
|
>
|
|
165
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
166
|
-
industry
|
|
158
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
167
159
|
</Dialog>
|
|
168
160
|
</div>
|
|
169
161
|
);
|
|
@@ -171,16 +163,18 @@ export const SmallFalse: Story = {
|
|
|
171
163
|
};
|
|
172
164
|
|
|
173
165
|
export const WithTitleIcon: Story = {
|
|
174
|
-
name:
|
|
175
|
-
render: function WithTitleIconRender(_Story, context) {
|
|
166
|
+
name: 'Option: title icon',
|
|
167
|
+
render: function WithTitleIconRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
176
168
|
const classNameFromGlobal = context.globals.theme;
|
|
177
169
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
178
170
|
|
|
179
171
|
return (
|
|
180
|
-
<div style={{ width:
|
|
181
|
-
<div
|
|
182
|
-
|
|
183
|
-
|
|
172
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
173
|
+
<div
|
|
174
|
+
ref={(ref) => {
|
|
175
|
+
setTarget(ref);
|
|
176
|
+
}}
|
|
177
|
+
/>
|
|
184
178
|
<Dialog
|
|
185
179
|
className={classNameFromGlobal}
|
|
186
180
|
isOpen={Boolean(target)}
|
|
@@ -190,27 +184,16 @@ export const WithTitleIcon: Story = {
|
|
|
190
184
|
titleIcon={<Error color="error" variant="filled" />}
|
|
191
185
|
actions={
|
|
192
186
|
<>
|
|
193
|
-
<Button
|
|
194
|
-
kind="ghost"
|
|
195
|
-
color="secondary"
|
|
196
|
-
size="medium"
|
|
197
|
-
onClick={close}
|
|
198
|
-
>
|
|
187
|
+
<Button kind="ghost" color="secondary" size="medium" onClick={close}>
|
|
199
188
|
Cancel
|
|
200
189
|
</Button>
|
|
201
|
-
<Button
|
|
202
|
-
kind="contained"
|
|
203
|
-
color="error"
|
|
204
|
-
size="medium"
|
|
205
|
-
onClick={close}
|
|
206
|
-
>
|
|
190
|
+
<Button kind="contained" color="error" size="medium" onClick={close}>
|
|
207
191
|
Confirm
|
|
208
192
|
</Button>
|
|
209
193
|
</>
|
|
210
194
|
}
|
|
211
195
|
>
|
|
212
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
213
|
-
industry
|
|
196
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
214
197
|
</Dialog>
|
|
215
198
|
</div>
|
|
216
199
|
);
|
|
@@ -218,16 +201,18 @@ export const WithTitleIcon: Story = {
|
|
|
218
201
|
};
|
|
219
202
|
|
|
220
203
|
export const WithCustomStyle: Story = {
|
|
221
|
-
name:
|
|
222
|
-
render: function WithCustomStyleRender(_Story, context) {
|
|
204
|
+
name: 'Option: custom style',
|
|
205
|
+
render: function WithCustomStyleRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
223
206
|
const classNameFromGlobal = context.globals.theme;
|
|
224
207
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
225
208
|
|
|
226
209
|
return (
|
|
227
|
-
<div style={{ width:
|
|
228
|
-
<div
|
|
229
|
-
|
|
230
|
-
|
|
210
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
211
|
+
<div
|
|
212
|
+
ref={(ref) => {
|
|
213
|
+
setTarget(ref);
|
|
214
|
+
}}
|
|
215
|
+
/>
|
|
231
216
|
<Dialog
|
|
232
217
|
className={classNameFromGlobal}
|
|
233
218
|
isOpen={Boolean(target)}
|
|
@@ -235,15 +220,14 @@ export const WithCustomStyle: Story = {
|
|
|
235
220
|
onClose={close}
|
|
236
221
|
title="Title area"
|
|
237
222
|
sx={{
|
|
238
|
-
|
|
239
|
-
border:
|
|
240
|
-
borderRadius:
|
|
241
|
-
backgroundColor:
|
|
223
|
+
'& .dialog-title-wrapper': {
|
|
224
|
+
border: '4px dashed red',
|
|
225
|
+
borderRadius: '10px',
|
|
226
|
+
backgroundColor: 'green',
|
|
242
227
|
},
|
|
243
228
|
}}
|
|
244
229
|
>
|
|
245
|
-
Lorem Ipsum is simply dummy text of the a printing and typesetting
|
|
246
|
-
industry
|
|
230
|
+
Lorem Ipsum is simply dummy text of the a printing and typesetting industry
|
|
247
231
|
</Dialog>
|
|
248
232
|
</div>
|
|
249
233
|
);
|
|
@@ -251,16 +235,18 @@ export const WithCustomStyle: Story = {
|
|
|
251
235
|
};
|
|
252
236
|
|
|
253
237
|
export const WithScroll: Story = {
|
|
254
|
-
name:
|
|
255
|
-
render: function WithScrollRender(_Story, context) {
|
|
238
|
+
name: 'Option: with scroll',
|
|
239
|
+
render: function WithScrollRender(_Story: DialogProps, context: StoryContext<DialogProps>) {
|
|
256
240
|
const classNameFromGlobal = context.globals.theme;
|
|
257
241
|
const [target, setTarget] = useState<HTMLDivElement | null>(null);
|
|
258
242
|
|
|
259
243
|
return (
|
|
260
|
-
<div style={{ width:
|
|
261
|
-
<div
|
|
262
|
-
|
|
263
|
-
|
|
244
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
245
|
+
<div
|
|
246
|
+
ref={(ref) => {
|
|
247
|
+
setTarget(ref);
|
|
248
|
+
}}
|
|
249
|
+
/>
|
|
264
250
|
<Dialog
|
|
265
251
|
className={classNameFromGlobal}
|
|
266
252
|
isOpen={Boolean(target)}
|
|
@@ -269,61 +255,43 @@ export const WithScroll: Story = {
|
|
|
269
255
|
title="Title area"
|
|
270
256
|
actions={
|
|
271
257
|
<>
|
|
272
|
-
<Button
|
|
273
|
-
kind="ghost"
|
|
274
|
-
color="secondary"
|
|
275
|
-
size="medium"
|
|
276
|
-
onClick={close}
|
|
277
|
-
>
|
|
258
|
+
<Button kind="ghost" color="secondary" size="medium" onClick={close}>
|
|
278
259
|
Cancel
|
|
279
260
|
</Button>
|
|
280
|
-
<Button
|
|
281
|
-
kind="contained"
|
|
282
|
-
color="error"
|
|
283
|
-
size="medium"
|
|
284
|
-
onClick={close}
|
|
285
|
-
>
|
|
261
|
+
<Button kind="contained" color="error" size="medium" onClick={close}>
|
|
286
262
|
Confirm
|
|
287
263
|
</Button>
|
|
288
264
|
</>
|
|
289
265
|
}
|
|
290
266
|
>
|
|
291
|
-
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quis,
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
sit amet consectetur
|
|
319
|
-
deserunt reiciendis. Officia veniam consequuntur doloribus debitis
|
|
320
|
-
numquam ipsum autem, eos repellendus eligendi esse voluptatum natus,
|
|
321
|
-
cum optio? Unde! Lorem ipsum dolor sit amet consectetur adipisicing
|
|
322
|
-
elit. Quibusdam praesentium incidunt tempora quam aut nulla corrupti
|
|
323
|
-
ipsa voluptatem vitae soluta ex officia, explicabo, voluptate porro.
|
|
324
|
-
Eius mollitia veritatis corporis neque. Lorem Ipsum is simply dummy
|
|
325
|
-
text of the a printing and typesetting industry Lorem ipsum dolor sit
|
|
326
|
-
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
|
|
327
295
|
</Dialog>
|
|
328
296
|
</div>
|
|
329
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
|
```
|