@mailstep/design-system 0.2.0-beta.1 → 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,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: (props: import("..").TextProps) => 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 FontSize: Story;
|
|
13
|
+
export declare const FontWeight: Story;
|
|
14
|
+
export declare const VariantMedium: Story;
|
|
15
|
+
export declare const VariantSemibold: Story;
|
|
16
|
+
export declare const VariantBold: Story;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import Text from '../Text';
|
|
2
|
+
var meta = {
|
|
3
|
+
title: 'Elements/Text',
|
|
4
|
+
component: Text,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export var Default = {
|
|
10
|
+
args: {
|
|
11
|
+
children: 'This is a text',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export var FontSize = {
|
|
15
|
+
args: {
|
|
16
|
+
children: 'This is a text font-size 10',
|
|
17
|
+
fontSize: 10,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export var FontWeight = {
|
|
21
|
+
args: {
|
|
22
|
+
children: 'This is a text font-weight bold',
|
|
23
|
+
fontWeight: 'bold',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export var VariantMedium = {
|
|
27
|
+
args: {
|
|
28
|
+
children: 'This is a text font-weight bold',
|
|
29
|
+
variant: 'medium',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export var VariantSemibold = {
|
|
33
|
+
args: {
|
|
34
|
+
children: 'This is a text font-weight bold',
|
|
35
|
+
variant: 'semiBold',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export var VariantBold = {
|
|
39
|
+
args: {
|
|
40
|
+
children: 'This is a text font-weight bold',
|
|
41
|
+
variant: 'bold',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type TextProps = {
|
|
3
|
+
children?: string | number | JSX.Element | (JSX.Element | undefined)[];
|
|
4
|
+
fontSize?: number;
|
|
5
|
+
fontWeight?: string;
|
|
6
|
+
variant?: 'normal' | 'medium' | 'semiBold' | 'bold';
|
|
7
|
+
mt?: string | number;
|
|
8
|
+
mr?: string | number;
|
|
9
|
+
mb?: string | number;
|
|
10
|
+
ml?: string | number;
|
|
11
|
+
mx?: string | number;
|
|
12
|
+
my?: string | number;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ToastOptions } from 'react-toastify';
|
|
2
|
+
export type ToastType = 'info' | 'success' | 'error' | 'warning';
|
|
3
|
+
export type CustomToastProps = ToastOptions & {
|
|
4
|
+
closeToast?: () => void;
|
|
5
|
+
toastProps?: ToastOptions;
|
|
6
|
+
title?: string;
|
|
7
|
+
text?: string;
|
|
8
|
+
type: ToastType;
|
|
9
|
+
};
|
|
10
|
+
declare const Toast: ({ closeToast, title, text, type }: CustomToastProps) => JSX.Element;
|
|
11
|
+
export default Toast;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import styled from '@xstyled/styled-components';
|
|
7
|
+
import { th } from '@xstyled/styled-components';
|
|
8
|
+
import { Icon } from '../Icon';
|
|
9
|
+
var toastTitleMap = {
|
|
10
|
+
info: 'Info',
|
|
11
|
+
success: 'Success',
|
|
12
|
+
error: 'Error',
|
|
13
|
+
warning: 'Warning',
|
|
14
|
+
};
|
|
15
|
+
var Title = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: block;\n margin-bottom: 5px;\n line-height: 18px;\n font-weight: 700;\n color: ", ";\n"], ["\n display: block;\n margin-bottom: 5px;\n line-height: 18px;\n font-weight: 700;\n color: ", ";\n"])), th('colors.blue2'));
|
|
16
|
+
var Text = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n font-size: 12px;\n line-height: 18px;\n font-weight: 500;\n color: ", ";\n"], ["\n display: block;\n font-size: 12px;\n line-height: 18px;\n font-weight: 500;\n color: ", ";\n"])), th('colors.gray1'));
|
|
17
|
+
var ContentWrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"], ["\n display: flex;\n justify-content: space-between;\n"])));
|
|
18
|
+
var CloseWrapper = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: 15px;\n\n svg {\n cursor: pointer;\n }\n"], ["\n display: flex;\n align-items: center;\n margin-left: 15px;\n\n svg {\n cursor: pointer;\n }\n"])));
|
|
19
|
+
var Toast = function (_a) {
|
|
20
|
+
var closeToast = _a.closeToast, title = _a.title, text = _a.text, type = _a.type;
|
|
21
|
+
return (_jsxs(ContentWrapper, { children: [_jsxs("div", { children: [_jsx(Title, { children: title || toastTitleMap[type] }), text && _jsx(Text, { children: text })] }), _jsx(CloseWrapper, { children: _jsx("div", { onClick: closeToast, children: _jsx(Icon, { icon: "close" }) }) })] }));
|
|
22
|
+
};
|
|
23
|
+
export default Toast;
|
|
24
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -0,0 +1,52 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
import styled, { css } from '@xstyled/styled-components';
|
|
29
|
+
import { FieldLabel } from '../Label';
|
|
30
|
+
import { SpaceAroundWrap } from '../SpaceAround';
|
|
31
|
+
var StyledSpaceAroundWrap = styled(SpaceAroundWrap)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
32
|
+
var $labelPosition = _a.$labelPosition;
|
|
33
|
+
return ($labelPosition === 'left' ? 'display: flex; align-items: center; margin-top: 1rem' : '');
|
|
34
|
+
});
|
|
35
|
+
var StyledFieldLabel = styled(FieldLabel)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
36
|
+
var labelPosition = _a.labelPosition;
|
|
37
|
+
return (labelPosition === 'left' ? 'margin-bottom: 0; margin-right: 1rem;' : '');
|
|
38
|
+
});
|
|
39
|
+
var disabledStyles = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n opacity: 0.4;\n"], ["\n opacity: 0.4;\n"])));
|
|
40
|
+
var StyledToggle = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n aspect-ratio: 1 / 1;\n width: 100%;\n height: 100%;\n border-radius: 7px;\n background-color: lightGray5;\n border: 3px solid;\n border-color: lightGray5;\n position: relative;\n transition: all 100ms ease-out;\n\n ", "\n\n input:checked + & {\n background-color: red1;\n border-color: red1;\n\n & > span {\n transform: translate(75%, -50%);\n background-color: white;\n }\n }\n"], ["\n aspect-ratio: 1 / 1;\n width: 100%;\n height: 100%;\n border-radius: 7px;\n background-color: lightGray5;\n border: 3px solid;\n border-color: lightGray5;\n position: relative;\n transition: all 100ms ease-out;\n\n ", "\n\n input:checked + & {\n background-color: red1;\n border-color: red1;\n\n & > span {\n transform: translate(75%, -50%);\n background-color: white;\n }\n }\n"])), function (props) { return (props.disabled ? disabledStyles : ''); });
|
|
41
|
+
var StyledDot = styled.span(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n aspect-ratio: 1 / 1;\n background-color: white;\n border-radius: 50%;\n position: absolute;\n top: 50%;\n left: 10%;\n transform: translate(-20%, -50%);\n transition: all 100ms ease-out;\n"], ["\n aspect-ratio: 1 / 1;\n background-color: white;\n border-radius: 50%;\n position: absolute;\n top: 50%;\n left: 10%;\n transform: translate(-20%, -50%);\n transition: all 100ms ease-out;\n"])));
|
|
42
|
+
var HiddenInput = styled.input(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n opacity: 0;\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n border-radius: 7px;\n z-index: 1;\n margin: 0;\n\n ", "\n"], ["\n opacity: 0;\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n border-radius: 7px;\n z-index: 1;\n margin: 0;\n\n ", "\n"])), function (_a) {
|
|
43
|
+
var $enabled = _a.$enabled;
|
|
44
|
+
return ($enabled ? 'cursor: pointer;' : '');
|
|
45
|
+
});
|
|
46
|
+
var Wrapper = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: relative;\n border-radius: 8px;\n overflow: hidden;\n flex-shrink: 0;\n &[data-appearance='primary'] {\n width: 24px;\n height: 14px;\n ", " {\n height: 10px;\n }\n }\n &[data-appearance='grid'] {\n width: 28px;\n height: 16px;\n ", " {\n height: 12px;\n }\n }\n"], ["\n position: relative;\n border-radius: 8px;\n overflow: hidden;\n flex-shrink: 0;\n &[data-appearance='primary'] {\n width: 24px;\n height: 14px;\n ", " {\n height: 10px;\n }\n }\n &[data-appearance='grid'] {\n width: 28px;\n height: 16px;\n ", " {\n height: 12px;\n }\n }\n"])), StyledDot, StyledDot);
|
|
47
|
+
var Toggle = function (_a) {
|
|
48
|
+
var onChange = _a.onChange, label = _a.label, name = _a.name, checked = _a.checked, defaultChecked = _a.defaultChecked, _b = _a.spaceAround, spaceAround = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.labelPosition, labelPosition = _d === void 0 ? 'default' : _d, _e = _a.variant, variant = _e === void 0 ? 'primary' : _e, _f = _a.spaceBetween, spaceBetween = _f === void 0 ? false : _f, rest = __rest(_a, ["onChange", "label", "name", "checked", "defaultChecked", "spaceAround", "disabled", "labelPosition", "variant", "spaceBetween"]);
|
|
49
|
+
return (_jsxs(StyledSpaceAroundWrap, { spaceBetween: spaceBetween, spaceAround: spaceAround, "$labelPosition": labelPosition, children: [label && (_jsx(StyledFieldLabel, { htmlFor: name, labelPosition: labelPosition, children: label })), _jsxs(Wrapper, { "data-appearance": variant, children: [_jsx(HiddenInput, { name: name, type: "checkbox", checked: checked, "$enabled": !disabled, defaultChecked: defaultChecked, onChange: !disabled ? onChange : undefined, disabled: disabled, "data-cy": "".concat(name, "Switch") }), _jsx(StyledToggle, __assign({ active: !!checked, disabled: disabled }, rest, { children: _jsx(StyledDot, {}) }))] })] }));
|
|
50
|
+
};
|
|
51
|
+
export default Toggle;
|
|
52
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ onChange, label, name, checked, defaultChecked, spaceAround, disabled, labelPosition, variant, spaceBetween, ...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 Checked: Story;
|
|
13
|
+
export declare const Disabled: Story;
|
|
14
|
+
export declare const VariantGrid: Story;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Toggle from '../Toggle';
|
|
2
|
+
var meta = {
|
|
3
|
+
title: 'Elements/Toggle',
|
|
4
|
+
component: Toggle,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export var Default = {
|
|
10
|
+
args: {
|
|
11
|
+
label: 'Label',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export var Checked = {
|
|
15
|
+
args: {
|
|
16
|
+
label: 'Label',
|
|
17
|
+
checked: true,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export var Disabled = {
|
|
21
|
+
args: {
|
|
22
|
+
label: 'Label',
|
|
23
|
+
checked: true,
|
|
24
|
+
disabled: true,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export var VariantGrid = {
|
|
28
|
+
args: {
|
|
29
|
+
label: 'Label',
|
|
30
|
+
checked: true,
|
|
31
|
+
variant: 'grid',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
type SpaceAroundProps = {
|
|
3
|
+
marginTop?: number;
|
|
4
|
+
marginRight?: number;
|
|
5
|
+
marginBottom?: number;
|
|
6
|
+
marginLeft?: number;
|
|
7
|
+
};
|
|
8
|
+
type SpaceAround = boolean | SpaceAroundProps;
|
|
9
|
+
export type Props = {
|
|
10
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
label?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
checked?: boolean;
|
|
14
|
+
defaultChecked?: boolean;
|
|
15
|
+
spaceAround?: SpaceAround;
|
|
16
|
+
spaceBetween?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
labelPosition?: 'default' | 'left';
|
|
19
|
+
variant?: 'primary' | 'grid';
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { TextProps as BaseTextProps } from '../Text';
|
|
2
|
+
export declare const Text: {
|
|
3
|
+
(props: BaseTextProps): JSX.Element;
|
|
4
|
+
defaultProps: {
|
|
5
|
+
fontFamily: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const Paragraph1: {
|
|
9
|
+
(props: BaseTextProps): JSX.Element;
|
|
10
|
+
defaultProps: {
|
|
11
|
+
as: string;
|
|
12
|
+
fontFamily: string;
|
|
13
|
+
fontSize: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const Paragraph2: {
|
|
17
|
+
(props: BaseTextProps): JSX.Element;
|
|
18
|
+
defaultProps: {
|
|
19
|
+
as: string;
|
|
20
|
+
fontFamily: string;
|
|
21
|
+
fontSize: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const Paragraph3: {
|
|
25
|
+
(props: BaseTextProps): JSX.Element;
|
|
26
|
+
defaultProps: {
|
|
27
|
+
as: string;
|
|
28
|
+
fontFamily: string;
|
|
29
|
+
fontSize: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const Paragraph4: {
|
|
33
|
+
(props: BaseTextProps): JSX.Element;
|
|
34
|
+
defaultProps: {
|
|
35
|
+
as: string;
|
|
36
|
+
fontFamily: string;
|
|
37
|
+
fontSize: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare const Paragraph5: {
|
|
41
|
+
(props: BaseTextProps): JSX.Element;
|
|
42
|
+
defaultProps: {
|
|
43
|
+
as: string;
|
|
44
|
+
fontFamily: string;
|
|
45
|
+
fontSize: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare const H1: {
|
|
49
|
+
(props: BaseTextProps): JSX.Element;
|
|
50
|
+
defaultProps: {
|
|
51
|
+
as: string;
|
|
52
|
+
fontFamily: string;
|
|
53
|
+
fontSize: string;
|
|
54
|
+
mt: number;
|
|
55
|
+
mb: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export declare const H2: {
|
|
59
|
+
(props: BaseTextProps): JSX.Element;
|
|
60
|
+
defaultProps: {
|
|
61
|
+
as: string;
|
|
62
|
+
fontFamily: string;
|
|
63
|
+
fontSize: string;
|
|
64
|
+
mt: number;
|
|
65
|
+
mb: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export declare const H3: {
|
|
69
|
+
(props: BaseTextProps): JSX.Element;
|
|
70
|
+
defaultProps: {
|
|
71
|
+
as: string;
|
|
72
|
+
fontFamily: string;
|
|
73
|
+
fontSize: string;
|
|
74
|
+
mt: number;
|
|
75
|
+
mb: number;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare const H4: {
|
|
79
|
+
(props: BaseTextProps): JSX.Element;
|
|
80
|
+
defaultProps: {
|
|
81
|
+
as: string;
|
|
82
|
+
fontFamily: string;
|
|
83
|
+
fontSize: string;
|
|
84
|
+
mt: number;
|
|
85
|
+
mb: number;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export declare const H5: {
|
|
89
|
+
(props: BaseTextProps): JSX.Element;
|
|
90
|
+
defaultProps: {
|
|
91
|
+
as: string;
|
|
92
|
+
fontFamily: string;
|
|
93
|
+
fontSize: string;
|
|
94
|
+
mt: number;
|
|
95
|
+
mb: number;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export declare const H6: {
|
|
99
|
+
(props: BaseTextProps): JSX.Element;
|
|
100
|
+
defaultProps: {
|
|
101
|
+
as: string;
|
|
102
|
+
fontFamily: string;
|
|
103
|
+
fontSize: string;
|
|
104
|
+
mt: number;
|
|
105
|
+
mb: number;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
export declare const H7: {
|
|
109
|
+
(props: BaseTextProps): JSX.Element;
|
|
110
|
+
defaultProps: {
|
|
111
|
+
as: string;
|
|
112
|
+
fontFamily: string;
|
|
113
|
+
fontSize: string;
|
|
114
|
+
mt: number;
|
|
115
|
+
mb: number;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Text as BaseText } from '../Text';
|
|
14
|
+
export var Text = function (props) { return _jsx(BaseText, __assign({}, props, { fontWeight: props.variant })); };
|
|
15
|
+
Text.defaultProps = { fontFamily: 'primary' };
|
|
16
|
+
// Paragraphs
|
|
17
|
+
export var Paragraph1 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
18
|
+
Paragraph1.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '18px' };
|
|
19
|
+
export var Paragraph2 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
20
|
+
Paragraph2.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '16px' };
|
|
21
|
+
export var Paragraph3 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
22
|
+
Paragraph3.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '14px' };
|
|
23
|
+
export var Paragraph4 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
24
|
+
Paragraph4.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '12px' };
|
|
25
|
+
export var Paragraph5 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
26
|
+
Paragraph5.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '10px' };
|
|
27
|
+
// Headings
|
|
28
|
+
export var H1 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
29
|
+
H1.defaultProps = { as: 'h1', fontFamily: 'heading', fontSize: '32px', mt: 2, mb: 2 };
|
|
30
|
+
export var H2 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
31
|
+
H2.defaultProps = { as: 'h2', fontFamily: 'heading', fontSize: '24px', mt: 2, mb: 2 };
|
|
32
|
+
export var H3 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
33
|
+
H3.defaultProps = { as: 'h3', fontFamily: 'heading', fontSize: '21px', mt: 2, mb: 2 };
|
|
34
|
+
export var H4 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
35
|
+
H4.defaultProps = { as: 'h4', fontFamily: 'heading', fontSize: '18px', mt: 2, mb: 2 };
|
|
36
|
+
export var H5 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
37
|
+
H5.defaultProps = { as: 'h5', fontFamily: 'heading', fontSize: '16px', mt: 2, mb: 2 };
|
|
38
|
+
export var H6 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
39
|
+
H6.defaultProps = { as: 'h6', fontFamily: 'heading', fontSize: '14px', mt: 2, mb: 2 };
|
|
40
|
+
export var H7 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
41
|
+
H7.defaultProps = { as: 'h6', fontFamily: 'heading', fontSize: '12px', mt: 2, mb: 2 };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
tags: string[];
|
|
5
|
+
argTypes: {};
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof meta>;
|
|
9
|
+
export declare const Heading1: Story;
|
|
10
|
+
export declare const Heading2: Story;
|
|
11
|
+
export declare const Heading3: Story;
|
|
12
|
+
export declare const Heading4: Story;
|
|
13
|
+
export declare const Heading5: Story;
|
|
14
|
+
export declare const Heading6: Story;
|
|
15
|
+
export declare const Heading7: Story;
|
|
16
|
+
export declare const P1: Story;
|
|
17
|
+
export declare const P2: Story;
|
|
18
|
+
export declare const P3: Story;
|
|
19
|
+
export declare const P4: Story;
|
|
20
|
+
export declare const P5: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { H1, H2, H3, H4, H5, H6, H7, Paragraph1, Paragraph2, Paragraph3, Paragraph4, Paragraph5 } from '../';
|
|
3
|
+
var meta = {
|
|
4
|
+
title: 'Elements/Typography',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export var Heading1 = { render: function () { return _jsx(H1, { children: "Heading H1" }); } };
|
|
10
|
+
export var Heading2 = { render: function () { return _jsx(H2, { children: "Heading H2" }); } };
|
|
11
|
+
export var Heading3 = { render: function () { return _jsx(H3, { children: "Heading H3" }); } };
|
|
12
|
+
export var Heading4 = { render: function () { return _jsx(H4, { children: "Heading H4" }); } };
|
|
13
|
+
export var Heading5 = { render: function () { return _jsx(H5, { children: "Heading H5" }); } };
|
|
14
|
+
export var Heading6 = { render: function () { return _jsx(H6, { children: "Heading H6" }); } };
|
|
15
|
+
export var Heading7 = { render: function () { return _jsx(H7, { children: "Heading H7" }); } };
|
|
16
|
+
export var P1 = { render: function () { return _jsx(Paragraph1, { children: "Paragraph1" }); } };
|
|
17
|
+
export var P2 = { render: function () { return _jsx(Paragraph2, { children: "Paragraph1" }); } };
|
|
18
|
+
export var P3 = { render: function () { return _jsx(Paragraph3, { children: "Paragraph1" }); } };
|
|
19
|
+
export var P4 = { render: function () { return _jsx(Paragraph4, { children: "Paragraph1" }); } };
|
|
20
|
+
export var P5 = { render: function () { return _jsx(Paragraph5, { children: "Paragraph1" }); } };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CheckboxProps } from './types';
|
|
3
|
+
declare const _default: import("react").MemoExoticComponent<({ name, label, onChange, checked, defaultChecked, size, className, disabled, inputRef, readOnly, minusIcon, }: CheckboxProps) => JSX.Element>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { CheckboxWrap, CheckIcon, FakeInput, Label } from './styles';
|
|
4
|
+
import { th, useTheme } from '@xstyled/styled-components';
|
|
5
|
+
var Checkbox = function (_a) {
|
|
6
|
+
var name = _a.name, label = _a.label, onChange = _a.onChange, checked = _a.checked, defaultChecked = _a.defaultChecked, _b = _a.size, size = _b === void 0 ? 4 : _b, className = _a.className, disabled = _a.disabled, inputRef = _a.inputRef, readOnly = _a.readOnly, _c = _a.minusIcon, minusIcon = _c === void 0 ? false : _c;
|
|
7
|
+
var theme = useTheme();
|
|
8
|
+
var themeSize = th.fontSize(size)({ theme: theme });
|
|
9
|
+
return (_jsxs(CheckboxWrap, { size: themeSize, className: className, children: [_jsx("input", { type: "checkbox", ref: inputRef, name: name, checked: checked, defaultChecked: defaultChecked, disabled: disabled, onChange: onChange, value: "", readOnly: readOnly, "data-cy": name && "".concat(name, "Checkbox") }), _jsx(FakeInput, { size: themeSize, children: _jsx(CheckIcon, { icon: minusIcon ? 'minus' : 'check', size: themeSize }) }), label && _jsx(Label, { children: label })] }));
|
|
10
|
+
};
|
|
11
|
+
export default memo(Checkbox);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").MemoExoticComponent<({ name, label, onChange, checked, defaultChecked, size, className, disabled, inputRef, readOnly, minusIcon, }: import("../types").CheckboxProps) => JSX.Element>;
|
|
6
|
+
tags: string[];
|
|
7
|
+
argTypes: {};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const CheckboxChecked: Story;
|
|
12
|
+
export declare const CheckboxUnchecked: Story;
|
|
13
|
+
export declare const CheckboxDisabled: Story;
|
|
14
|
+
export declare const CheckboxWithMinusIcon: Story;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Checkbox from '../Checkbox';
|
|
2
|
+
var meta = {
|
|
3
|
+
title: 'Forms/Checkbox',
|
|
4
|
+
component: Checkbox,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export var CheckboxChecked = {
|
|
10
|
+
args: {
|
|
11
|
+
checked: true,
|
|
12
|
+
onChange: function () { },
|
|
13
|
+
label: 'Checked',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export var CheckboxUnchecked = {
|
|
17
|
+
args: {
|
|
18
|
+
checked: false,
|
|
19
|
+
label: 'Unchecked',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export var CheckboxDisabled = {
|
|
23
|
+
args: {
|
|
24
|
+
checked: true,
|
|
25
|
+
label: 'Disabled',
|
|
26
|
+
disabled: true,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export var CheckboxWithMinusIcon = {
|
|
30
|
+
args: {
|
|
31
|
+
checked: true,
|
|
32
|
+
label: 'Minus Icon',
|
|
33
|
+
minusIcon: true,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const FakeInput: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
3
|
+
size: string | number;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const CheckIcon: import("styled-components").StyledComponent<({ icon, fill, style, size, className, secondaryColor, fixedWidth, spinning, }: import("../../Elements/Icon").IconProps) => JSX.Element, import("@xstyled/system").Theme, {
|
|
6
|
+
size: string | number;
|
|
7
|
+
}, never>;
|
|
8
|
+
export declare const CheckboxWrap: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
9
|
+
size: string | number;
|
|
10
|
+
}, never>;
|
|
11
|
+
export declare const Label: import("styled-components").StyledComponent<"span", import("@xstyled/system").Theme, {}, never>;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 styled, { th } from '@xstyled/styled-components';
|
|
6
|
+
import { Icon } from '../../Elements/Icon';
|
|
7
|
+
export var FakeInput = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", ";\n min-width: ", ";\n height: ", ";\n border-radius: md;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n transform: rotate(0);\n overflow: hidden;\n border: slim;\n border-color: lightGray5;\n\n input[type='checkbox']:not(:disabled):hover + & {\n border-color: gray1;\n }\n\n input[type='checkbox']:disabled + & {\n background-color: white;\n border-color: lightGray7;\n }\n\n input[type='checkbox']:checked:disabled + & {\n background-color: bgLightGray1;\n border-color: bgLightGray1;\n }\n\n input[type='checkbox']:checked:not(:disabled) + & {\n transform: rotate(0deg);\n background-color: red1;\n border-color: red1;\n }\n\n input[type='checkbox']:not(:checked):not(:disabled) + & {\n transform: rotate(90deg);\n background-color: white;\n border-color: lightGray5;\n }\n"], ["\n width: ", ";\n min-width: ", ";\n height: ", ";\n border-radius: md;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n transform: rotate(0);\n overflow: hidden;\n border: slim;\n border-color: lightGray5;\n\n input[type='checkbox']:not(:disabled):hover + & {\n border-color: gray1;\n }\n\n input[type='checkbox']:disabled + & {\n background-color: white;\n border-color: lightGray7;\n }\n\n input[type='checkbox']:checked:disabled + & {\n background-color: bgLightGray1;\n border-color: bgLightGray1;\n }\n\n input[type='checkbox']:checked:not(:disabled) + & {\n transform: rotate(0deg);\n background-color: red1;\n border-color: red1;\n }\n\n input[type='checkbox']:not(:checked):not(:disabled) + & {\n transform: rotate(90deg);\n background-color: white;\n border-color: lightGray5;\n }\n"])), function (_a) {
|
|
8
|
+
var size = _a.size;
|
|
9
|
+
return size;
|
|
10
|
+
}, function (_a) {
|
|
11
|
+
var size = _a.size;
|
|
12
|
+
return size;
|
|
13
|
+
}, function (_a) {
|
|
14
|
+
var size = _a.size;
|
|
15
|
+
return size;
|
|
16
|
+
});
|
|
17
|
+
export var CheckIcon = styled(Icon)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: lg;\n transition: all 200ms ease;\n & svg {\n width: 70% !important;\n }\n & path {\n fill: none;\n stroke: none;\n }\n\n input[type='checkbox']:not(:disabled):checked + ", " & {\n & path {\n stroke: white;\n fill: white;\n }\n }\n\n input[type='checkbox']:disabled:checked + ", " & {\n & path {\n fill: ", " !important;\n }\n }\n"], ["\n border-radius: lg;\n transition: all 200ms ease;\n & svg {\n width: 70% !important;\n }\n & path {\n fill: none;\n stroke: none;\n }\n\n input[type='checkbox']:not(:disabled):checked + ", " & {\n & path {\n stroke: white;\n fill: white;\n }\n }\n\n input[type='checkbox']:disabled:checked + ", " & {\n & path {\n fill: ", " !important;\n }\n }\n"])), FakeInput, FakeInput, th.color('lightGray5'));
|
|
18
|
+
export var CheckboxWrap = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n display: flex;\n align-items: center;\n overflow: hidden;\n\n input {\n margin: 0;\n width: ", ";\n height: ", ";\n z-index: 1;\n position: absolute;\n opacity: 0;\n top: 50%;\n transform: translateY(-50%);\n left: 0;\n cursor: pointer;\n }\n"], ["\n position: relative;\n display: flex;\n align-items: center;\n overflow: hidden;\n\n input {\n margin: 0;\n width: ", ";\n height: ", ";\n z-index: 1;\n position: absolute;\n opacity: 0;\n top: 50%;\n transform: translateY(-50%);\n left: 0;\n cursor: pointer;\n }\n"])), function (_a) {
|
|
19
|
+
var size = _a.size;
|
|
20
|
+
return size;
|
|
21
|
+
}, function (_a) {
|
|
22
|
+
var size = _a.size;
|
|
23
|
+
return size;
|
|
24
|
+
});
|
|
25
|
+
export var Label = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: 0;\n margin-left: 8px;\n font-size: 14px;\n"], ["\n margin: 0;\n margin-left: 8px;\n font-size: 14px;\n"])));
|
|
26
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChangeEvent, RefObject } from 'react';
|
|
2
|
+
export type CheckboxProps = {
|
|
3
|
+
name?: string;
|
|
4
|
+
label?: string | JSX.Element;
|
|
5
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
defaultChecked?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
color?: string;
|
|
10
|
+
unsetColor?: string;
|
|
11
|
+
size?: number;
|
|
12
|
+
className?: string;
|
|
13
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
minusIcon?: boolean;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { InputProps } from './types';
|
|
2
|
+
export declare const Input: ({ appearance, type, name, label, value, icon, disabled, error, isInvalid, spaceAround, inputRef, autoComplete, isLoading, className, suffix, suffixOnClick, errorAppearance, iconPlacement, iconOnClick, iconTooltip, big, showArrowsController, onClear, alwaysShowClear, setNumber, onEnter, forceFocus, autoFocus, onBlur, ...rest }: InputProps) => JSX.Element;
|