@mailstep/design-system 0.2.0-beta.0 → 0.2.0-beta.2
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/Blocks/CornerDialog/CornerDialog.d.ts +2 -0
- package/Blocks/CornerDialog/CornerDialog.js +18 -0
- package/Blocks/CornerDialog/index.d.ts +3 -0
- package/Blocks/CornerDialog/index.js +2 -0
- package/Blocks/CornerDialog/stories/CornerDialog.stories.d.ts +14 -0
- package/Blocks/CornerDialog/stories/CornerDialog.stories.js +50 -0
- package/Blocks/CornerDialog/styles.d.ts +12 -0
- package/Blocks/CornerDialog/styles.js +21 -0
- package/Blocks/CornerDialog/types.d.ts +16 -0
- package/Blocks/CornerDialog/types.js +1 -0
- package/Blocks/CornerDialog/utils.d.ts +3 -0
- package/Blocks/CornerDialog/utils.js +12 -0
- package/Blocks/ImageList/ImageList.d.ts +3 -0
- package/Blocks/ImageList/ImageList.js +29 -0
- package/Blocks/ImageList/components/AddPhoto/index.d.ts +7 -0
- package/Blocks/ImageList/components/AddPhoto/index.js +63 -0
- package/Blocks/ImageList/components/AddPhoto/styles.d.ts +2 -0
- package/Blocks/ImageList/components/AddPhoto/styles.js +8 -0
- package/Blocks/ImageList/components/CloseButton/index.d.ts +6 -0
- package/Blocks/ImageList/components/CloseButton/index.js +7 -0
- package/Blocks/ImageList/components/CloseButton/styles.d.ts +1 -0
- package/Blocks/ImageList/components/CloseButton/styles.js +7 -0
- package/Blocks/ImageList/components/ImageElement/index.d.ts +9 -0
- package/Blocks/ImageList/components/ImageElement/index.js +11 -0
- package/Blocks/ImageList/components/ImageElement/styles.d.ts +2 -0
- package/Blocks/ImageList/components/ImageElement/styles.js +8 -0
- package/Blocks/ImageList/components/ImageTag/index.d.ts +6 -0
- package/Blocks/ImageList/components/ImageTag/index.js +9 -0
- package/Blocks/ImageList/components/ImageTag/styles.d.ts +1 -0
- package/Blocks/ImageList/components/ImageTag/styles.js +7 -0
- package/Blocks/ImageList/index.d.ts +5 -0
- package/Blocks/ImageList/index.js +2 -0
- package/Blocks/ImageList/styles.d.ts +1 -0
- package/Blocks/ImageList/styles.js +7 -0
- package/Blocks/ImageList/types.d.ts +12 -0
- package/Blocks/ImageList/types.js +1 -0
- package/Blocks/LightBox/LightBox.d.ts +3 -0
- package/Blocks/LightBox/LightBox.js +15 -0
- package/Blocks/LightBox/hooks/useLightBox.d.ts +2 -0
- package/Blocks/LightBox/hooks/useLightBox.js +17 -0
- package/Blocks/LightBox/index.d.ts +4 -0
- package/Blocks/LightBox/index.js +3 -0
- package/Blocks/LightBox/styles.d.ts +3 -0
- package/Blocks/LightBox/styles.js +9 -0
- package/Blocks/LightBox/types.d.ts +24 -0
- package/Blocks/LightBox/types.js +1 -0
- package/Blocks/Modal/Modal.d.ts +3 -0
- package/Blocks/Modal/Modal.js +35 -0
- package/Blocks/Modal/hooks/useClickOutside.d.ts +3 -0
- package/Blocks/Modal/hooks/useClickOutside.js +30 -0
- package/Blocks/Modal/hooks/useModal.d.ts +2 -0
- package/Blocks/Modal/hooks/useModal.js +15 -0
- package/Blocks/Modal/index.d.ts +5 -0
- package/Blocks/Modal/index.js +4 -0
- package/Blocks/Modal/stories/Modal.stories.d.ts +26 -0
- package/Blocks/Modal/stories/Modal.stories.js +146 -0
- package/Blocks/Modal/styles.d.ts +22 -0
- package/Blocks/Modal/styles.js +45 -0
- package/Blocks/Modal/types.d.ts +45 -0
- package/Blocks/Modal/types.js +1 -0
- package/Blocks/Modal/utils.d.ts +3 -0
- package/Blocks/Modal/utils.js +11 -0
- package/Blocks/Tabs/TabContent.d.ts +2 -0
- package/Blocks/Tabs/TabContent.js +4 -0
- package/Blocks/Tabs/Tabs.d.ts +2 -0
- package/Blocks/Tabs/Tabs.js +19 -0
- package/Blocks/Tabs/hooks/useTabs.d.ts +2 -0
- package/Blocks/Tabs/hooks/useTabs.js +10 -0
- package/Blocks/Tabs/index.d.ts +5 -0
- package/Blocks/Tabs/index.js +4 -0
- package/Blocks/Tabs/stories/Tabs.stories.d.ts +13 -0
- package/Blocks/Tabs/stories/Tabs.stories.js +44 -0
- package/Blocks/Tabs/styles.d.ts +8 -0
- package/Blocks/Tabs/styles.js +15 -0
- package/Blocks/Tabs/types.d.ts +27 -0
- package/Blocks/Tabs/types.js +1 -0
- package/Elements/Alert/Alert.d.ts +3 -0
- package/Elements/Alert/Alert.js +32 -0
- package/Elements/Alert/index.d.ts +3 -0
- package/Elements/Alert/index.js +3 -0
- package/Elements/Alert/stories/Alert.stories.d.ts +17 -0
- package/Elements/Alert/stories/Alert.stories.js +73 -0
- package/Elements/Alert/styles.d.ts +44 -0
- package/Elements/Alert/styles.js +33 -0
- package/Elements/Alert/types.d.ts +18 -0
- package/Elements/Alert/types.js +1 -0
- package/Elements/Avatar/Avatar.d.ts +2 -0
- package/Elements/Avatar/Avatar.js +37 -0
- package/Elements/Avatar/index.d.ts +3 -0
- package/Elements/Avatar/index.js +3 -0
- package/Elements/Avatar/stories/Avatar.stories.d.ts +12 -0
- package/Elements/Avatar/stories/Avatar.stories.js +20 -0
- package/Elements/Avatar/types.d.ts +8 -0
- package/Elements/Avatar/types.js +1 -0
- package/Elements/Badge/Badge.d.ts +12 -0
- package/Elements/Badge/Badge.js +40 -0
- package/Elements/Badge/index.d.ts +3 -0
- package/Elements/Badge/index.js +3 -0
- package/Elements/Badge/stories/Badge.stories.d.ts +12 -0
- package/Elements/Badge/stories/Badge.stories.js +24 -0
- package/Elements/BorderedBox/BorderedBox.d.ts +3 -0
- package/Elements/BorderedBox/BorderedBox.js +35 -0
- package/Elements/BorderedBox/index.d.ts +3 -0
- package/Elements/BorderedBox/index.js +3 -0
- package/Elements/BorderedBox/stories/BorderedBox.stories.d.ts +11 -0
- package/Elements/BorderedBox/stories/BorderedBox.stories.js +13 -0
- package/Elements/BorderedBox/types.d.ts +6 -0
- package/Elements/BorderedBox/types.js +1 -0
- package/Elements/Button/Button.d.ts +3 -0
- package/Elements/Button/Button.js +30 -0
- package/Elements/Button/index.d.ts +5 -0
- package/Elements/Button/index.js +3 -0
- package/Elements/Button/stories/Button.stories.d.ts +20 -0
- package/Elements/Button/stories/Button.stories.js +70 -0
- package/Elements/Button/styles.d.ts +19 -0
- package/Elements/Button/styles.js +48 -0
- package/Elements/Button/types.d.ts +22 -0
- package/Elements/Button/types.js +1 -0
- package/Elements/Card/Card.d.ts +6 -0
- package/Elements/Card/Card.js +45 -0
- package/Elements/Card/index.d.ts +3 -0
- package/Elements/Card/index.js +3 -0
- package/Elements/Card/stories/Card.stories.d.ts +15 -0
- package/Elements/Card/stories/Card.stories.js +43 -0
- package/Elements/Card/stories/CardComponent.stories.d.ts +12 -0
- package/Elements/Card/stories/CardComponent.stories.js +27 -0
- package/Elements/Card/styles.d.ts +14 -0
- package/Elements/Card/styles.js +34 -0
- package/Elements/Card/types.d.ts +21 -0
- package/Elements/Card/types.js +1 -0
- package/Elements/Dropdown/Dropdown.d.ts +3 -0
- package/Elements/Dropdown/Dropdown.js +28 -0
- package/Elements/Dropdown/index.d.ts +3 -0
- package/Elements/Dropdown/index.js +3 -0
- package/Elements/Dropdown/stories/Dropdown.stories.d.ts +11 -0
- package/Elements/Dropdown/stories/Dropdown.stories.js +14 -0
- package/Elements/Dropdown/types.d.ts +10 -0
- package/Elements/Dropdown/types.js +1 -0
- package/Elements/ErrorMessage/ErrorMessage.d.ts +3 -0
- package/Elements/ErrorMessage/ErrorMessage.js +17 -0
- package/Elements/ErrorMessage/index.d.ts +3 -0
- package/Elements/ErrorMessage/index.js +3 -0
- package/Elements/ErrorMessage/stories/ErrorMessage.stories.d.ts +12 -0
- package/Elements/ErrorMessage/stories/ErrorMessage.stories.js +19 -0
- package/Elements/ErrorMessage/types.d.ts +5 -0
- package/Elements/ErrorMessage/types.js +1 -0
- package/Elements/Icon/BadgeIcon.d.ts +6 -0
- package/Elements/Icon/BadgeIcon.js +51 -0
- package/Elements/Icon/Icon.d.ts +8 -0
- package/Elements/Icon/Icon.js +245 -0
- package/Elements/Icon/icons/Complaint.d.ts +3 -0
- package/Elements/Icon/icons/Complaint.js +13 -0
- package/Elements/Icon/icons/Expeditions.d.ts +3 -0
- package/Elements/Icon/icons/Expeditions.js +13 -0
- package/Elements/Icon/icons/FlagCZ.d.ts +3 -0
- package/Elements/Icon/icons/FlagCZ.js +13 -0
- package/Elements/Icon/icons/FlagUSA.d.ts +3 -0
- package/Elements/Icon/icons/FlagUSA.js +13 -0
- package/Elements/Icon/icons/HamburgerMenu.d.ts +3 -0
- package/Elements/Icon/icons/HamburgerMenu.js +13 -0
- package/Elements/Icon/icons/HelpCircle1.d.ts +3 -0
- package/Elements/Icon/icons/HelpCircle1.js +13 -0
- package/Elements/Icon/icons/Income.d.ts +3 -0
- package/Elements/Icon/icons/Income.js +13 -0
- package/Elements/Icon/icons/Inventory.d.ts +3 -0
- package/Elements/Icon/icons/Inventory.js +13 -0
- package/Elements/Icon/icons/MenuItems.d.ts +3 -0
- package/Elements/Icon/icons/MenuItems.js +13 -0
- package/Elements/Icon/icons/MobileCancel.d.ts +3 -0
- package/Elements/Icon/icons/MobileCancel.js +13 -0
- package/Elements/Icon/icons/Notification2.d.ts +3 -0
- package/Elements/Icon/icons/Notification2.js +13 -0
- package/Elements/Icon/icons/Plus1.d.ts +3 -0
- package/Elements/Icon/icons/Plus1.js +13 -0
- package/Elements/Icon/icons/Products.d.ts +3 -0
- package/Elements/Icon/icons/Products.js +13 -0
- package/Elements/Icon/icons/Profile.d.ts +3 -0
- package/Elements/Icon/icons/Profile.js +13 -0
- package/Elements/Icon/icons/Return.d.ts +3 -0
- package/Elements/Icon/icons/Return.js +13 -0
- package/Elements/Icon/icons/Settings2.d.ts +3 -0
- package/Elements/Icon/icons/Settings2.js +13 -0
- package/Elements/Icon/icons/Transfer.d.ts +3 -0
- package/Elements/Icon/icons/Transfer.js +13 -0
- package/Elements/Icon/icons/index.d.ts +17 -0
- package/Elements/Icon/icons/index.js +17 -0
- package/Elements/Icon/index.d.ts +6 -0
- package/Elements/Icon/index.js +5 -0
- package/Elements/Icon/stories/BadgeIcon.stories.d.ts +24 -0
- package/Elements/Icon/stories/BadgeIcon.stories.js +18 -0
- package/Elements/Icon/stories/Icon.stories.d.ts +16 -0
- package/Elements/Icon/stories/Icon.stories.js +48 -0
- package/Elements/Icon/types.d.ts +22 -0
- package/Elements/Icon/types.js +1 -0
- package/Elements/Image/Image.d.ts +3 -0
- package/Elements/Image/Image.js +26 -0
- package/Elements/Image/index.d.ts +3 -0
- package/Elements/Image/index.js +3 -0
- package/Elements/Image/stories/Image.stories.d.ts +14 -0
- package/Elements/Image/stories/Image.stories.js +36 -0
- package/Elements/Image/types.d.ts +18 -0
- package/Elements/Image/types.js +1 -0
- package/Elements/Label/Label.d.ts +6 -0
- package/Elements/Label/Label.js +17 -0
- package/Elements/Label/index.d.ts +3 -0
- package/Elements/Label/index.js +3 -0
- package/Elements/Label/stories/Label.stories.d.ts +13 -0
- package/Elements/Label/stories/Label.stories.js +20 -0
- package/Elements/Line/Line.d.ts +3 -0
- package/Elements/Line/Line.js +25 -0
- package/Elements/Line/index.d.ts +3 -0
- package/Elements/Line/index.js +3 -0
- package/Elements/Line/stories/Line.stories.d.ts +16 -0
- package/Elements/Line/stories/Line.stories.js +41 -0
- package/Elements/Line/types.d.ts +12 -0
- package/Elements/Line/types.js +1 -0
- package/Elements/Link/Link.d.ts +29 -0
- package/Elements/Link/Link.js +56 -0
- package/Elements/Link/index.d.ts +3 -0
- package/Elements/Link/index.js +3 -0
- package/Elements/Link/stories/Link.stories.d.ts +42 -0
- package/Elements/Link/stories/Link.stories.js +63 -0
- package/Elements/Logo/Logo.d.ts +3 -0
- package/Elements/Logo/Logo.js +84 -0
- package/Elements/Logo/index.d.ts +3 -0
- package/Elements/Logo/index.js +3 -0
- package/Elements/Logo/stories/Logo.stories.d.ts +34 -0
- package/Elements/Logo/stories/Logo.stories.js +112 -0
- package/Elements/Logo/types.d.ts +10 -0
- package/Elements/Logo/types.js +1 -0
- package/Elements/Pagination/Pagination.d.ts +8 -0
- package/Elements/Pagination/Pagination.js +35 -0
- package/Elements/Pagination/index.d.ts +3 -0
- package/Elements/Pagination/index.js +3 -0
- package/Elements/Pagination/stories/Pagination.stories.d.ts +12 -0
- package/Elements/Pagination/stories/Pagination.stories.js +22 -0
- package/Elements/Pagination/styled.d.ts +15 -0
- package/Elements/Pagination/styled.js +26 -0
- package/Elements/Paragraph/Paragraph.d.ts +2 -0
- package/Elements/Paragraph/Paragraph.js +3 -0
- package/Elements/Paragraph/index.d.ts +3 -0
- package/Elements/Paragraph/index.js +3 -0
- package/Elements/Paragraph/stories/Paragraph.stories.d.ts +17 -0
- package/Elements/Paragraph/stories/Paragraph.stories.js +34 -0
- package/Elements/Portal/index.d.ts +5 -0
- package/Elements/Portal/index.js +14 -0
- package/Elements/ProgressBar/ProgressBar.d.ts +9 -0
- package/Elements/ProgressBar/ProgressBar.js +9 -0
- package/Elements/ProgressBar/index.d.ts +3 -0
- package/Elements/ProgressBar/index.js +3 -0
- package/Elements/ProgressBar/stories/ProgressBar.stories.d.ts +18 -0
- package/Elements/ProgressBar/stories/ProgressBar.stories.js +27 -0
- package/Elements/ProgressBar/styles.d.ts +9 -0
- package/Elements/ProgressBar/styles.js +19 -0
- package/Elements/SimpleLink/SimpleLink.d.ts +19 -0
- package/Elements/SimpleLink/SimpleLink.js +17 -0
- package/Elements/SimpleLink/index.d.ts +3 -0
- package/Elements/SimpleLink/index.js +3 -0
- package/Elements/SpaceAround/SpaceAround.d.ts +3 -0
- package/Elements/SpaceAround/SpaceAround.js +54 -0
- package/Elements/SpaceAround/index.d.ts +4 -0
- package/Elements/SpaceAround/index.js +3 -0
- package/Elements/SpaceAround/stories/SpaceAround.stories.d.ts +12 -0
- package/Elements/SpaceAround/stories/SpaceAround.stories.js +22 -0
- package/Elements/SpaceAround/types.d.ts +14 -0
- package/Elements/SpaceAround/types.js +1 -0
- package/Elements/Spinner/Spinner.d.ts +14 -0
- package/Elements/Spinner/Spinner.js +28 -0
- package/Elements/Spinner/index.d.ts +3 -0
- package/Elements/Spinner/index.js +3 -0
- package/Elements/Spinner/stories/Spinner.stories.d.ts +19 -0
- package/Elements/Spinner/stories/Spinner.stories.js +56 -0
- package/Elements/Spinner/styles.d.ts +4 -0
- package/Elements/Spinner/styles.js +20 -0
- package/Elements/Spinner/types.d.ts +7 -0
- package/Elements/Spinner/types.js +1 -0
- package/Elements/Tag/Tag.d.ts +3 -0
- package/Elements/Tag/Tag.js +59 -0
- package/Elements/Tag/index.d.ts +4 -0
- package/Elements/Tag/index.js +4 -0
- package/Elements/Tag/palletes.d.ts +5 -0
- package/Elements/Tag/palletes.js +10 -0
- package/Elements/Tag/stories/Tag.stories.d.ts +19 -0
- package/Elements/Tag/stories/Tag.stories.js +72 -0
- package/Elements/Tag/stories/components/predefinedTags.d.ts +2 -0
- package/Elements/Tag/stories/components/predefinedTags.js +8 -0
- package/Elements/Tag/types.d.ts +17 -0
- package/Elements/Tag/types.js +1 -0
- package/Elements/Text/Text.d.ts +3 -0
- package/Elements/Text/Text.js +15 -0
- package/Elements/Text/index.d.ts +3 -0
- package/Elements/Text/index.js +2 -0
- package/Elements/Text/stories/Text.stories.d.ts +16 -0
- package/Elements/Text/stories/Text.stories.js +43 -0
- package/Elements/Text/types.d.ts +13 -0
- package/Elements/Text/types.js +1 -0
- package/Elements/Toast/Toast.d.ts +11 -0
- package/Elements/Toast/Toast.js +24 -0
- package/Elements/Toast/index.d.ts +4 -0
- package/Elements/Toast/index.js +3 -0
- package/Elements/Toggle/Toggle.d.ts +3 -0
- package/Elements/Toggle/Toggle.js +52 -0
- package/Elements/Toggle/index.d.ts +3 -0
- package/Elements/Toggle/index.js +3 -0
- package/Elements/Toggle/stories/Toggle.stories.d.ts +14 -0
- package/Elements/Toggle/stories/Toggle.stories.js +33 -0
- package/Elements/Toggle/types.d.ts +21 -0
- package/Elements/Toggle/types.js +1 -0
- package/Elements/Typography/Typography.d.ts +117 -0
- package/Elements/Typography/Typography.js +41 -0
- package/Elements/Typography/index.d.ts +3 -0
- package/Elements/Typography/index.js +3 -0
- package/Elements/Typography/stories/Typography.stories.d.ts +20 -0
- package/Elements/Typography/stories/Typography.stories.js +20 -0
- package/Forms/Checkbox/Checkbox.d.ts +4 -0
- package/Forms/Checkbox/Checkbox.js +11 -0
- package/Forms/Checkbox/index.d.ts +3 -0
- package/Forms/Checkbox/index.js +3 -0
- package/Forms/Checkbox/stories/Checkbox.stories.d.ts +14 -0
- package/Forms/Checkbox/stories/Checkbox.stories.js +35 -0
- package/Forms/Checkbox/styles.d.ts +11 -0
- package/Forms/Checkbox/styles.js +26 -0
- package/Forms/Checkbox/types.d.ts +16 -0
- package/Forms/Checkbox/types.js +1 -0
- package/Forms/Input/Input.d.ts +2 -0
- package/Forms/Input/Input.js +60 -0
- package/Forms/Input/index.d.ts +5 -0
- package/Forms/Input/index.js +3 -0
- package/Forms/Input/stories/Input.stories.d.ts +17 -0
- package/Forms/Input/stories/Input.stories.js +71 -0
- package/Forms/Input/styles.d.ts +31 -0
- package/Forms/Input/styles.js +57 -0
- package/Forms/Input/types.d.ts +49 -0
- package/Forms/Input/types.js +1 -0
- package/Forms/RadioButton/RadioButton.d.ts +3 -0
- package/Forms/RadioButton/RadioButton.js +29 -0
- package/Forms/RadioButton/index.d.ts +3 -0
- package/Forms/RadioButton/index.js +3 -0
- package/Forms/RadioButton/stories/RadioButton.stories.d.ts +14 -0
- package/Forms/RadioButton/stories/RadioButton.stories.js +38 -0
- package/Forms/RadioButton/styles.d.ts +10 -0
- package/Forms/RadioButton/styles.js +15 -0
- package/Forms/RadioButton/types.d.ts +12 -0
- package/Forms/RadioButton/types.js +1 -0
- package/ThemeProvider/ThemeProvider.d.ts +3 -0
- package/ThemeProvider/ThemeProvider.js +8 -0
- package/ThemeProvider/index.d.ts +5 -0
- package/ThemeProvider/index.js +5 -0
- package/ThemeProvider/themes/default.d.ts +142 -0
- package/ThemeProvider/themes/default.js +144 -0
- package/ThemeProvider/themes/index.d.ts +351 -0
- package/ThemeProvider/themes/index.js +9 -0
- package/ThemeProvider/themes/light.d.ts +3 -0
- package/ThemeProvider/themes/light.js +7 -0
- package/ThemeProvider/themes/mailwise.d.ts +207 -0
- package/ThemeProvider/themes/mailwise.js +214 -0
- package/ThemeProvider/types.d.ts +50 -0
- package/ThemeProvider/types.js +1 -0
- package/index.d.ts +71 -0
- package/index.es.js +17500 -0
- package/index.js +71 -0
- package/index.umd.js +2427 -0
- package/package.json +1 -5
- package/style.css +1 -0
- package/utils/CreateRgba/createRgba.d.ts +3 -0
- package/utils/CreateRgba/createRgba.js +16 -0
- package/utils/CreateRgba/types.d.ts +1 -0
- package/utils/CreateRgba/types.js +1 -0
- package/utils/KeyPress/KeyPress.d.ts +3 -0
- package/utils/KeyPress/KeyPress.js +17 -0
- package/utils/KeyPress/KeyPress.stories.d.ts +10 -0
- package/utils/KeyPress/KeyPress.stories.js +18 -0
- package/utils/KeyPress/index.d.ts +2 -0
- package/utils/KeyPress/index.js +2 -0
- package/utils/KeyPress/types.d.ts +6 -0
- package/utils/KeyPress/types.js +1 -0
- package/utils/index.d.ts +8 -0
- package/utils/index.js +7 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Alert } from '../';
|
|
2
|
+
var meta = {
|
|
3
|
+
title: 'Elements/Alert',
|
|
4
|
+
component: Alert,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export var Success = {
|
|
10
|
+
args: {
|
|
11
|
+
intent: 'success',
|
|
12
|
+
title: 'alert',
|
|
13
|
+
text: 'text',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export var Warning = {
|
|
17
|
+
args: {
|
|
18
|
+
intent: 'warning',
|
|
19
|
+
title: 'alert',
|
|
20
|
+
text: 'warning',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export var Info = {
|
|
24
|
+
args: {
|
|
25
|
+
intent: 'info',
|
|
26
|
+
title: 'alert',
|
|
27
|
+
text: 'info',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export var Danger = {
|
|
31
|
+
args: {
|
|
32
|
+
intent: 'danger',
|
|
33
|
+
title: 'alert',
|
|
34
|
+
text: 'danger',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export var DangerInline = {
|
|
38
|
+
args: {
|
|
39
|
+
intent: 'danger',
|
|
40
|
+
title: 'alert',
|
|
41
|
+
text: 'danger',
|
|
42
|
+
inline: true,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export var DangerWithMessage = {
|
|
46
|
+
args: {
|
|
47
|
+
intent: 'danger',
|
|
48
|
+
title: 'alert',
|
|
49
|
+
text: 'This is a text content',
|
|
50
|
+
onClick: console.log,
|
|
51
|
+
inline: true,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export var WithDescription = {
|
|
55
|
+
args: {
|
|
56
|
+
intent: 'danger',
|
|
57
|
+
title: 'alert',
|
|
58
|
+
text: 'This is a text content',
|
|
59
|
+
onClick: console.log,
|
|
60
|
+
inline: true,
|
|
61
|
+
desc: "This is an extra description."
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
export var WithCloseAnywhere = {
|
|
65
|
+
args: {
|
|
66
|
+
intent: 'danger',
|
|
67
|
+
title: 'alert',
|
|
68
|
+
text: 'This is a text content',
|
|
69
|
+
closeAnywhere: true,
|
|
70
|
+
onClose: function () { return console.log('Close'); },
|
|
71
|
+
inline: true,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledAlert: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, any, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme> & {
|
|
3
|
+
$inline?: boolean | undefined;
|
|
4
|
+
$colorFill: React.ReactText;
|
|
5
|
+
$bgColor: React.ReactText;
|
|
6
|
+
}, "color">;
|
|
7
|
+
export declare const VerticalSeparator: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, any, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme> & {
|
|
8
|
+
$colorFill?: import("react").ReactText | undefined;
|
|
9
|
+
}, "color">;
|
|
10
|
+
export declare const IconWrap: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, any, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme>, "color">;
|
|
11
|
+
export declare const Title: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
12
|
+
export declare const Text: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
13
|
+
export declare const LinkWrapper: import("styled-components").StyledComponent<{
|
|
14
|
+
(props: {
|
|
15
|
+
as?: any;
|
|
16
|
+
children?: import("react").ReactNode;
|
|
17
|
+
to?: string | Function | {
|
|
18
|
+
pathname?: string | undefined;
|
|
19
|
+
search?: string | undefined;
|
|
20
|
+
hash?: string | undefined;
|
|
21
|
+
state?: object | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
target?: string | undefined;
|
|
24
|
+
color?: string | undefined;
|
|
25
|
+
size: number | "inherit";
|
|
26
|
+
disabled?: boolean | undefined;
|
|
27
|
+
onClick?: Function | undefined;
|
|
28
|
+
}): JSX.Element;
|
|
29
|
+
defaultProps: {
|
|
30
|
+
to: string;
|
|
31
|
+
color: string;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
size: number;
|
|
34
|
+
padding: string;
|
|
35
|
+
replace: boolean;
|
|
36
|
+
};
|
|
37
|
+
}, any, {
|
|
38
|
+
$colorFill: string;
|
|
39
|
+
}, never>;
|
|
40
|
+
export declare const ActionButton: import("styled-components").StyledComponent<"button", any, {
|
|
41
|
+
$colorFill: React.ReactText;
|
|
42
|
+
}, never>;
|
|
43
|
+
export declare const CloseBtn: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
44
|
+
export declare const Description: import("styled-components").StyledComponent<"div", any, import("@xstyled/util").Props<import("@xstyled/system").Theme>, never>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { Link } from '../Link';
|
|
6
|
+
import { x } from '@xstyled/styled-components';
|
|
7
|
+
import { th } from '@xstyled/styled-components';
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
export var StyledAlert = styled(x.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n min-height: 48px;\n align-items: center;\n justify-content: space-between;\n border: ", ";\n border-radius: 8px;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n padding: 6px 5px 6px 5px;\n margin-bottom: 5px;\n position: relative;\n"], ["\n width: 100%;\n display: flex;\n min-height: 48px;\n align-items: center;\n justify-content: space-between;\n border: ", ";\n border-radius: 8px;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n padding: 6px 5px 6px 5px;\n margin-bottom: 5px;\n position: relative;\n"])), function (_a) {
|
|
10
|
+
var $inline = _a.$inline, $colorFill = _a.$colorFill;
|
|
11
|
+
return ($inline ? "solid 1px ".concat($colorFill) : 'none');
|
|
12
|
+
}, function (_a) {
|
|
13
|
+
var $bgColor = _a.$bgColor;
|
|
14
|
+
return $bgColor;
|
|
15
|
+
}, th('colors.textPrimary'), th('fonts.primary'));
|
|
16
|
+
export var VerticalSeparator = styled(x.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 4px;\n height: 36px;\n border-radius: 94px;\n background-color: ", ";\n"], ["\n width: 4px;\n height: 36px;\n border-radius: 94px;\n background-color: ", ";\n"])), function (_a) {
|
|
17
|
+
var $colorFill = _a.$colorFill;
|
|
18
|
+
return $colorFill;
|
|
19
|
+
});
|
|
20
|
+
export var IconWrap = styled(x.div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin: 0 13px 0 9px;\n"], ["\n margin: 0 13px 0 9px;\n"])));
|
|
21
|
+
export var Title = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 18px;\n font-weight: 600;\n"], ["\n font-size: 14px;\n line-height: 18px;\n font-weight: 600;\n"])));
|
|
22
|
+
export var Text = styled.span(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 20px;\n font-weight: 400;\n"], ["\n font-size: 14px;\n line-height: 20px;\n font-weight: 400;\n"])));
|
|
23
|
+
export var LinkWrapper = styled(Link)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-size: 14px;\n font-weight: 600;\n color: ", ";\n margin-right: 10px;\n"], ["\n font-size: 14px;\n font-weight: 600;\n color: ", ";\n margin-right: 10px;\n"])), function (_a) {
|
|
24
|
+
var $colorFill = _a.$colorFill;
|
|
25
|
+
return $colorFill;
|
|
26
|
+
});
|
|
27
|
+
export var ActionButton = styled.button(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-right: 10px;\n font-size: 14px;\n font-weight: 600;\n color: ", ";\n border: none;\n background-color: transparent;\n cursor: pointer;\n"], ["\n margin-right: 10px;\n font-size: 14px;\n font-weight: 600;\n color: ", ";\n border: none;\n background-color: transparent;\n cursor: pointer;\n"])), function (_a) {
|
|
28
|
+
var $colorFill = _a.$colorFill;
|
|
29
|
+
return $colorFill;
|
|
30
|
+
});
|
|
31
|
+
export var CloseBtn = styled.button(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n height: 30px;\n width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n border: none;\n margin-right: 5px;\n background-color: transparent;\n & :hover {\n cursor: pointer;\n }\n"], ["\n height: 30px;\n width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n border: none;\n margin-right: 5px;\n background-color: transparent;\n & :hover {\n cursor: pointer;\n }\n"])));
|
|
32
|
+
export var Description = styled.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n position: absolute;\n top: 3px;\n right: 8px;\n color: ", ";\n font-size: 10px;\n"], ["\n position: absolute;\n top: 3px;\n right: 8px;\n color: ", ";\n font-size: 10px;\n"])), th('colors.gray'));
|
|
33
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type AlertProps = {
|
|
3
|
+
intent?: 'success' | 'info' | 'warning' | 'danger';
|
|
4
|
+
inline?: boolean;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
title?: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
closeAnywhere?: boolean;
|
|
10
|
+
href?: string;
|
|
11
|
+
actionLabel?: React.ReactElement | string;
|
|
12
|
+
actionType?: 'link' | 'button';
|
|
13
|
+
desc?: string;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
export interface IAlert {
|
|
17
|
+
(props: AlertProps): JSX.Element;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
28
|
+
import styled from '@xstyled/styled-components';
|
|
29
|
+
import { th } from '@xstyled/styled-components';
|
|
30
|
+
import { Profile } from '../Icon';
|
|
31
|
+
var defaultDimension = 100;
|
|
32
|
+
var StyledAvatarWrap = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n overflow: hidden;\n color: ", ";\n background-color: ", ";\n width: ", ";\n height: ", ";\n :hover {\n background-color: ", ";\n }\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n overflow: hidden;\n color: ", ";\n background-color: ", ";\n width: ", ";\n height: ", ";\n :hover {\n background-color: ", ";\n }\n"])), function (props) { return (props.$colorFront ? th.color(props.$colorFront) : 'auto'); }, function (props) { return (props.$colorBack ? th.color(props.$colorBack) : 'auto'); }, function (props) { return "".concat(props.size, "px"); }, function (props) { return "".concat(props.size, "px"); }, function (props) { return (props.$hoverColorBack ? th.color(props.$hoverColorBack) : 'auto'); });
|
|
33
|
+
export var Avatar = function (_a) {
|
|
34
|
+
var src = _a.src, _b = _a.size, size = _b === void 0 ? defaultDimension : _b, colorFront = _a.colorFront, colorBack = _a.colorBack, className = _a.className, hoverColorBack = _a.hoverColorBack, rest = __rest(_a, ["src", "size", "colorFront", "colorBack", "className", "hoverColorBack"]);
|
|
35
|
+
return (_jsx(_Fragment, { children: _jsx(StyledAvatarWrap, __assign({ size: size || 34, className: className, "$colorBack": colorBack || 'neutral20', "$colorFront": colorFront || 'blue2', "$hoverColorBack": hoverColorBack || 'lightGray7' }, rest, { children: src ? _jsx("img", { src: src, width: size, height: size }) : _jsx(Profile, {}) })) }));
|
|
36
|
+
};
|
|
37
|
+
var templateObject_1;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ src, size, colorFront, colorBack, className, hoverColorBack, ...rest }: import("../types").Props) => JSX.Element;
|
|
6
|
+
tags: string[];
|
|
7
|
+
argTypes: {};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const Default: Story;
|
|
12
|
+
export declare const WithImage: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Avatar } from '../Avatar';
|
|
2
|
+
var image = 'data:image/png;base64,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';
|
|
3
|
+
var meta = {
|
|
4
|
+
title: 'Elements/Avatar',
|
|
5
|
+
component: Avatar,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {},
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export var Default = {
|
|
11
|
+
args: {
|
|
12
|
+
size: 100,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
export var WithImage = {
|
|
16
|
+
args: {
|
|
17
|
+
size: 100,
|
|
18
|
+
src: image,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type Props = {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
label?: string | number | JSX.Element;
|
|
5
|
+
color?: string;
|
|
6
|
+
size?: string | number;
|
|
7
|
+
childWidth?: string | number;
|
|
8
|
+
topPosition?: boolean;
|
|
9
|
+
fontSize?: number;
|
|
10
|
+
};
|
|
11
|
+
declare const Badge: ({ children, color, size, fontSize, label, childWidth, topPosition }: Props) => JSX.Element;
|
|
12
|
+
export default Badge;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import styled, { css, useTheme } from '@xstyled/styled-components';
|
|
7
|
+
import { th } from '@xstyled/styled-components';
|
|
8
|
+
var Circle = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 2px;\n color: white;\n background-color: ", ";\n border-radius: 50%;\n width: ", ";\n height: ", ";\n\n .label {\n font-family: ", ";\n font-weight: 600;\n vertical-align: middle;\n text-align: center;\n font-size: ", ";\n }\n\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(", ");\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 2px;\n color: white;\n background-color: ", ";\n border-radius: 50%;\n width: ", ";\n height: ", ";\n\n .label {\n font-family: ", ";\n font-weight: 600;\n vertical-align: middle;\n text-align: center;\n font-size: ", ";\n }\n\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(", ");\n"])), function (_a) {
|
|
9
|
+
var color = _a.color;
|
|
10
|
+
return color;
|
|
11
|
+
}, function (_a) {
|
|
12
|
+
var size = _a.size;
|
|
13
|
+
return size;
|
|
14
|
+
}, function (_a) {
|
|
15
|
+
var size = _a.size;
|
|
16
|
+
return size;
|
|
17
|
+
}, th('fonts.primary'), function (_a) {
|
|
18
|
+
var fontSize = _a.fontSize;
|
|
19
|
+
return "".concat(fontSize, "px");
|
|
20
|
+
}, function (_a) {
|
|
21
|
+
var topPosition = _a.topPosition;
|
|
22
|
+
return (topPosition ? '75%, -75%' : '50%, -50%');
|
|
23
|
+
});
|
|
24
|
+
var RelativeWrap = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n ", ";\n"], ["\n position: relative;\n ", ";\n"])), function (_a) {
|
|
25
|
+
var width = _a.width;
|
|
26
|
+
return width
|
|
27
|
+
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", ";\n "], ["\n width: ", ";\n "])), width) : '';
|
|
28
|
+
});
|
|
29
|
+
var Badge = function (_a) {
|
|
30
|
+
var children = _a.children, _b = _a.color, color = _b === void 0 ? 'red2' : _b, _c = _a.size, size = _c === void 0 ? 6 : _c, _d = _a.fontSize, fontSize = _d === void 0 ? 10 : _d, label = _a.label, childWidth = _a.childWidth, topPosition = _a.topPosition;
|
|
31
|
+
var theme = useTheme();
|
|
32
|
+
var themeColor = th.color(color)({ theme: theme });
|
|
33
|
+
var themeSize = th.fontSize(size)({ theme: theme });
|
|
34
|
+
if (!label || (typeof label === 'number' && label <= 0)) {
|
|
35
|
+
return _jsx(_Fragment, { children: children });
|
|
36
|
+
}
|
|
37
|
+
return (_jsxs(RelativeWrap, { width: childWidth, children: [_jsx(Circle, { color: themeColor, size: themeSize, topPosition: topPosition, fontSize: fontSize, children: _jsx("div", { className: "label", children: label }) }), children] }));
|
|
38
|
+
};
|
|
39
|
+
export default Badge;
|
|
40
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ children, color, size, fontSize, label, childWidth, topPosition }: import("../Badge").Props) => JSX.Element;
|
|
6
|
+
tags: string[];
|
|
7
|
+
argTypes: {};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const Primary: Story;
|
|
12
|
+
export declare const Colored: Story;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Badge from '../Badge';
|
|
2
|
+
var meta = {
|
|
3
|
+
title: 'Elements/Badge',
|
|
4
|
+
component: Badge,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export var Primary = {
|
|
10
|
+
args: {
|
|
11
|
+
children: '😀',
|
|
12
|
+
size: 1,
|
|
13
|
+
childWidth: '30px',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export var Colored = {
|
|
17
|
+
args: {
|
|
18
|
+
children: '😃',
|
|
19
|
+
label: '10',
|
|
20
|
+
size: 4,
|
|
21
|
+
color: 'darkGreen',
|
|
22
|
+
childWidth: '50px',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
import styled, { x } from '@xstyled/styled-components';
|
|
29
|
+
var StyledBox = styled(x.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n padding: 3;\n border: slim;\n border-color: lightGray3;\n border-radius: md;\n"], ["\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n padding: 3;\n border: slim;\n border-color: lightGray3;\n border-radius: md;\n"])));
|
|
30
|
+
var BorderedBox = function (_a) {
|
|
31
|
+
var children = _a.children, className = _a.className, id = _a.id, rest = __rest(_a, ["children", "className", "id"]);
|
|
32
|
+
return (_jsx(StyledBox, __assign({ id: id, className: className }, rest, { children: children })));
|
|
33
|
+
};
|
|
34
|
+
export default BorderedBox;
|
|
35
|
+
var templateObject_1;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ children, className, id, ...rest }: import("../types").BorderedBoxProps) => JSX.Element;
|
|
6
|
+
tags: string[];
|
|
7
|
+
argTypes: {};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BorderedBox } from '../';
|
|
2
|
+
var meta = {
|
|
3
|
+
title: 'Elements/BorderedBox',
|
|
4
|
+
component: BorderedBox,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export var Default = {
|
|
10
|
+
args: {
|
|
11
|
+
children: 'content of inner box with border <br /> and new line',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { StyledButton, LoadingIconWrapper, StyledIcon, StyledWrapper } from './styles';
|
|
25
|
+
import { Spinner } from '../Spinner';
|
|
26
|
+
var Button = function (_a) {
|
|
27
|
+
var isLoading = _a.isLoading, loadingText = _a.loadingText, icon = _a.icon, _b = _a.appearance, appearance = _b === void 0 ? 'primary' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.sizing, sizing = _d === void 0 ? 'normal' : _d, buttonRef = _a.buttonRef, onClick = _a.onClick, _e = _a.fullWidth, fullWidth = _e === void 0 ? false : _e, props = __rest(_a, ["isLoading", "loadingText", "icon", "appearance", "disabled", "sizing", "buttonRef", "onClick", "fullWidth"]);
|
|
28
|
+
return (_jsx(StyledButton, __assign({}, props, { onClick: !disabled && !isLoading ? onClick : undefined, "data-appearance": appearance, "data-sizing": sizing, disabled: disabled, ref: buttonRef, fullWidth: fullWidth, children: _jsxs(StyledWrapper, { children: [icon && (typeof icon === 'string' ? _jsx(StyledIcon, { "$addMargin": !!props.children, icon: icon }) : icon), isLoading ? (_jsxs(_Fragment, { children: [_jsx(LoadingIconWrapper, { "$addMargin": !!loadingText || !!props.children, children: _jsx(Spinner, { variant: "sm" }) }), loadingText || loadingText === '' ? loadingText : 'Loading'] })) : (props.children)] }) })));
|
|
29
|
+
};
|
|
30
|
+
export default Button;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ isLoading, loadingText, icon, appearance, disabled, sizing, buttonRef, onClick, fullWidth, ...props }: import("../types").Props) => JSX.Element;
|
|
6
|
+
tags: string[];
|
|
7
|
+
argTypes: {};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const Primary: Story;
|
|
12
|
+
export declare const PrimaryLight: Story;
|
|
13
|
+
export declare const Secondary: Story;
|
|
14
|
+
export declare const Success: Story;
|
|
15
|
+
export declare const Large: Story;
|
|
16
|
+
export declare const Small: Story;
|
|
17
|
+
export declare const DisabledPrimary: Story;
|
|
18
|
+
export declare const DisabledSecondary: Story;
|
|
19
|
+
export declare const Loading: Story;
|
|
20
|
+
export declare const WithIcon: Story;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Button } from '../';
|
|
2
|
+
var meta = {
|
|
3
|
+
title: 'Elements/Button',
|
|
4
|
+
component: Button,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export var Primary = {
|
|
10
|
+
args: {
|
|
11
|
+
children: 'Primary',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export var PrimaryLight = {
|
|
15
|
+
args: {
|
|
16
|
+
children: 'Primary Light',
|
|
17
|
+
appearance: 'primaryLight',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export var Secondary = {
|
|
21
|
+
args: {
|
|
22
|
+
children: 'Secondary',
|
|
23
|
+
appearance: 'secondary',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export var Success = {
|
|
27
|
+
args: {
|
|
28
|
+
children: 'Success',
|
|
29
|
+
appearance: 'success',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export var Large = {
|
|
33
|
+
args: {
|
|
34
|
+
children: 'Large',
|
|
35
|
+
sizing: 'large',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export var Small = {
|
|
39
|
+
args: {
|
|
40
|
+
children: 'Small',
|
|
41
|
+
sizing: 'normal',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export var DisabledPrimary = {
|
|
45
|
+
args: {
|
|
46
|
+
children: 'Disabled',
|
|
47
|
+
disabled: true,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
export var DisabledSecondary = {
|
|
51
|
+
args: {
|
|
52
|
+
children: 'Disabled',
|
|
53
|
+
disabled: true,
|
|
54
|
+
appearance: 'secondary',
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
export var Loading = {
|
|
58
|
+
args: {
|
|
59
|
+
appearance: 'secondary',
|
|
60
|
+
loadingText: 'Loading...',
|
|
61
|
+
isLoading: true,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
export var WithIcon = {
|
|
65
|
+
args: {
|
|
66
|
+
label: 'Button',
|
|
67
|
+
children: 'Small',
|
|
68
|
+
icon: 'coffee',
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledWrapper: import("styled-components").StyledComponent<"span", import("@xstyled/system").Theme, {}, never>;
|
|
3
|
+
export declare const LoadingIconWrapper: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
4
|
+
$addMargin: boolean;
|
|
5
|
+
}, never>;
|
|
6
|
+
export declare const StyledIcon: import("styled-components").StyledComponent<({ icon, fill, style, size, className, secondaryColor, fixedWidth, spinning, }: import("../Icon").IconProps) => JSX.Element, import("@xstyled/system").Theme, {
|
|
7
|
+
$addMargin: boolean;
|
|
8
|
+
}, never>;
|
|
9
|
+
export declare const StyledButton: import("styled-components").StyledComponent<"button", import("@xstyled/system").Theme, {
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
columnAlign?: boolean | undefined;
|
|
12
|
+
children?: any;
|
|
13
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
14
|
+
fullWidth: boolean;
|
|
15
|
+
mt?: string | number | undefined;
|
|
16
|
+
mr?: string | number | undefined;
|
|
17
|
+
mb?: string | number | undefined;
|
|
18
|
+
ml?: string | number | undefined;
|
|
19
|
+
}, never>;
|