@mailstep/design-system 0.2.0-beta.1 → 0.2.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +8 -0
- package/Blocks/ImageList/components/AddPhoto/index.js +68 -0
- package/Blocks/ImageList/components/AddPhoto/styles.d.ts +4 -0
- package/Blocks/ImageList/components/AddPhoto/styles.js +11 -0
- package/Blocks/ImageList/components/CloseButton/index.d.ts +7 -0
- package/Blocks/ImageList/components/CloseButton/index.js +7 -0
- package/Blocks/ImageList/components/CloseButton/styles.d.ts +3 -0
- package/Blocks/ImageList/components/CloseButton/styles.js +10 -0
- package/Blocks/ImageList/components/ImageElement/index.d.ts +10 -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 +14 -0
- package/Blocks/ImageList/types.js +1 -0
- package/Blocks/LightBox/LightBox.d.ts +3 -0
- package/Blocks/LightBox/LightBox.js +14 -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 +3 -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 +10 -0
- package/Blocks/Tabs/styles.js +18 -0
- package/Blocks/Tabs/types.d.ts +28 -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/AddPhoto.d.ts +3 -0
- package/Elements/Icon/icons/AddPhoto.js +13 -0
- package/Elements/Icon/icons/BarcodeScan.d.ts +3 -0
- package/Elements/Icon/icons/BarcodeScan.js +13 -0
- package/Elements/Icon/icons/Box.d.ts +3 -0
- package/Elements/Icon/icons/Box.js +13 -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/FlagEL.d.ts +3 -0
- package/Elements/Icon/icons/FlagEL.js +13 -0
- package/Elements/Icon/icons/FlagESP.d.ts +3 -0
- package/Elements/Icon/icons/FlagESP.js +13 -0
- package/Elements/Icon/icons/FlagITA.d.ts +3 -0
- package/Elements/Icon/icons/FlagITA.js +13 -0
- package/Elements/Icon/icons/FlagRUS.d.ts +3 -0
- package/Elements/Icon/icons/FlagRUS.js +13 -0
- package/Elements/Icon/icons/FlagSVK.d.ts +3 -0
- package/Elements/Icon/icons/FlagSVK.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/ImagePlaceholder.d.ts +3 -0
- package/Elements/Icon/icons/ImagePlaceholder.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/Inventory2.d.ts +3 -0
- package/Elements/Icon/icons/Inventory2.js +13 -0
- package/Elements/Icon/icons/Link.d.ts +3 -0
- package/Elements/Icon/icons/Link.js +13 -0
- package/Elements/Icon/icons/Logout1.d.ts +3 -0
- package/Elements/Icon/icons/Logout1.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/OpenBox.d.ts +3 -0
- package/Elements/Icon/icons/OpenBox.js +13 -0
- package/Elements/Icon/icons/Plus1.d.ts +3 -0
- package/Elements/Icon/icons/Plus1.js +13 -0
- package/Elements/Icon/icons/Product.d.ts +3 -0
- package/Elements/Icon/icons/Product.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/Puzzle1.d.ts +3 -0
- package/Elements/Icon/icons/Puzzle1.js +13 -0
- package/Elements/Icon/icons/Rack.d.ts +3 -0
- package/Elements/Icon/icons/Rack.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 +33 -0
- package/Elements/Icon/icons/index.js +33 -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 +23 -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 +3 -0
- package/Elements/Tag/index.js +3 -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 +12 -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 +64 -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 +17720 -0
- package/index.js +71 -0
- package/index.umd.js +2436 -0
- package/package.json +4 -8
- 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,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { statusToColors, statusToIcon } from './utils';
|
|
4
|
+
import { Portal } from '../../Elements/Portal';
|
|
5
|
+
import { Icon } from '../../Elements/Icon';
|
|
6
|
+
import { Container, Header, Status, StatusText, Wrapper, CloseBtn } from './styles';
|
|
7
|
+
export var CornerDialog = function (_a) {
|
|
8
|
+
var title = _a.title, children = _a.children, onClose = _a.onClose, statusToTitle = _a.statusToTitle, _b = _a.isOpen, isOpen = _b === void 0 ? true : _b, _intent = _a.intent;
|
|
9
|
+
var _c = useState(false), isMounted = _c[0], setIsMounted = _c[1];
|
|
10
|
+
useEffect(function () {
|
|
11
|
+
setIsMounted(true);
|
|
12
|
+
}, []);
|
|
13
|
+
var intent = _intent !== null && _intent !== void 0 ? _intent : 'info';
|
|
14
|
+
var _d = statusToColors[intent], fontColor = _d.fontColor, backgroundColor = _d.backgroundColor, fill = _d.fill;
|
|
15
|
+
if (!isOpen)
|
|
16
|
+
return null;
|
|
17
|
+
return (_jsx(Portal, { children: _jsxs(Container, { "$mounted": isMounted, children: [_jsxs(Status, { background: backgroundColor, children: [_jsx(Icon, { icon: statusToIcon[intent], fill: fill }), _jsx(StatusText, { fontColor: fontColor, children: statusToTitle[intent]() })] }), _jsx(Header, { children: title }), _jsx(CloseBtn, { onClick: onClose, children: _jsx(Icon, { icon: "close", size: "25px" }) }), _jsx(Wrapper, { children: children })] }) }));
|
|
18
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ title, children, onClose, statusToTitle, isOpen, intent: _intent, }: import("..").CornerDialogProps) => JSX.Element | null;
|
|
6
|
+
tags: string[];
|
|
7
|
+
argTypes: {};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const InfoCornerDialog: Story;
|
|
12
|
+
export declare const SuccessCornerDialog: Story;
|
|
13
|
+
export declare const ErrorCornerDialog: Story;
|
|
14
|
+
export declare const WarningCornerDialog: Story;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CornerDialog } from '../CornerDialog';
|
|
2
|
+
var meta = {
|
|
3
|
+
title: 'Blocks/CornerDialog',
|
|
4
|
+
component: CornerDialog,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
var statusToTitle = {
|
|
10
|
+
info: function () { return 'Info'; },
|
|
11
|
+
success: function () { return 'Success'; },
|
|
12
|
+
error: function () { return 'Error'; },
|
|
13
|
+
warning: function () { return 'Warning'; },
|
|
14
|
+
};
|
|
15
|
+
export var InfoCornerDialog = {
|
|
16
|
+
args: {
|
|
17
|
+
title: 'Info Title',
|
|
18
|
+
children: 'Info corner dialog content',
|
|
19
|
+
statusToTitle: statusToTitle,
|
|
20
|
+
intent: 'info',
|
|
21
|
+
isOpen: true,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export var SuccessCornerDialog = {
|
|
25
|
+
args: {
|
|
26
|
+
title: 'Success Title',
|
|
27
|
+
children: 'Success corner dialog content',
|
|
28
|
+
statusToTitle: statusToTitle,
|
|
29
|
+
intent: 'success',
|
|
30
|
+
isOpen: true,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export var ErrorCornerDialog = {
|
|
34
|
+
args: {
|
|
35
|
+
title: 'Error Title',
|
|
36
|
+
children: 'Error corner dialog content',
|
|
37
|
+
statusToTitle: statusToTitle,
|
|
38
|
+
intent: 'error',
|
|
39
|
+
isOpen: true,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
export var WarningCornerDialog = {
|
|
43
|
+
args: {
|
|
44
|
+
title: 'Warning Title',
|
|
45
|
+
children: 'Warning corner dialog content',
|
|
46
|
+
statusToTitle: statusToTitle,
|
|
47
|
+
intent: 'warning',
|
|
48
|
+
isOpen: true,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
2
|
+
$mounted: boolean;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const Header: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
5
|
+
export declare const Wrapper: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
6
|
+
export declare const Status: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
7
|
+
background: string;
|
|
8
|
+
}, never>;
|
|
9
|
+
export declare const CloseBtn: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
10
|
+
export declare const StatusText: import("styled-components").StyledComponent<"span", import("@xstyled/system").Theme, {
|
|
11
|
+
fontColor: string;
|
|
12
|
+
}, never>;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: fixed;\n z-index: 10;\n bottom: 3rem;\n right: 3rem;\n background: white;\n border-radius: 12px;\n box-shadow: cornerDialogShadow;\n width: 400px;\n padding: 50px 30px 30px;\n color: typoPrimary;\n transition: opacity 225ms linear;\n opacity: ", ";\n"], ["\n position: fixed;\n z-index: 10;\n bottom: 3rem;\n right: 3rem;\n background: white;\n border-radius: 12px;\n box-shadow: cornerDialogShadow;\n width: 400px;\n padding: 50px 30px 30px;\n color: typoPrimary;\n transition: opacity 225ms linear;\n opacity: ", ";\n"])), function (_a) {
|
|
7
|
+
var $mounted = _a.$mounted;
|
|
8
|
+
return ($mounted ? 1 : 0);
|
|
9
|
+
});
|
|
10
|
+
export var Header = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-bottom: 15px;\n color: typoPrimary;\n font-size: 18px;\n font-weight: bold;\n display: flex;\n align-items: center;\n"], ["\n margin-bottom: 15px;\n color: typoPrimary;\n font-size: 18px;\n font-weight: bold;\n display: flex;\n align-items: center;\n"])));
|
|
11
|
+
export var Wrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 14px;\n font-weight: 400;\n"], ["\n font-size: 14px;\n font-weight: 400;\n"])));
|
|
12
|
+
export var Status = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n padding: 6px 10px;\n text-transform: uppercase;\n border-radius: 12px 0 12px 0;\n background-color: ", ";\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n padding: 6px 10px;\n text-transform: uppercase;\n border-radius: 12px 0 12px 0;\n background-color: ", ";\n"])), function (_a) {
|
|
13
|
+
var background = _a.background;
|
|
14
|
+
return th.color(background);
|
|
15
|
+
});
|
|
16
|
+
export var CloseBtn = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n cursor: pointer;\n position: absolute;\n top: 12px;\n right: 12px;\n"], ["\n cursor: pointer;\n position: absolute;\n top: 12px;\n right: 12px;\n"])));
|
|
17
|
+
export var StatusText = styled.span(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: inline-block;\n margin-left: 6px;\n font-size: 14px;\n font-weight: 700;\n color: ", ";\n"], ["\n display: inline-block;\n margin-left: 6px;\n font-size: 14px;\n font-weight: 700;\n color: ", ";\n"])), function (_a) {
|
|
18
|
+
var fontColor = _a.fontColor;
|
|
19
|
+
return th.color(fontColor);
|
|
20
|
+
});
|
|
21
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactChild } from 'react';
|
|
2
|
+
export type Intent = 'success' | 'error' | 'warning' | 'info';
|
|
3
|
+
export interface CornerDialogProps {
|
|
4
|
+
title: JSX.Element | string;
|
|
5
|
+
children: ReactChild;
|
|
6
|
+
icon?: string;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
intent?: Intent;
|
|
10
|
+
statusToTitle: Record<Intent, () => string>;
|
|
11
|
+
}
|
|
12
|
+
export interface ColorProps {
|
|
13
|
+
fontColor: string;
|
|
14
|
+
backgroundColor: string;
|
|
15
|
+
fill: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export var statusToColors = {
|
|
2
|
+
info: { fontColor: 'gray1', backgroundColor: 'lightGray7', fill: 'gray1' },
|
|
3
|
+
success: { fontColor: 'white', backgroundColor: 'green', fill: 'white' },
|
|
4
|
+
error: { fontColor: 'white', backgroundColor: 'red1', fill: 'white' },
|
|
5
|
+
warning: { fontColor: 'blue2', backgroundColor: 'yellow1', fill: 'blue2' },
|
|
6
|
+
};
|
|
7
|
+
export var statusToIcon = {
|
|
8
|
+
info: 'info',
|
|
9
|
+
success: 'circleCheck',
|
|
10
|
+
error: 'circleX',
|
|
11
|
+
warning: 'circleTriangle',
|
|
12
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useRef } from 'react';
|
|
14
|
+
import { useDraggable } from 'react-use-draggable-scroll';
|
|
15
|
+
import LightBox, { useLightBox } from '../LightBox';
|
|
16
|
+
import { AddPhoto } from './components/AddPhoto';
|
|
17
|
+
import { ImageElement } from './components/ImageElement';
|
|
18
|
+
import { x } from '@xstyled/styled-components';
|
|
19
|
+
import { ImageListContainer } from './styles';
|
|
20
|
+
export var ImageList = function (_a) {
|
|
21
|
+
var onImageUpload = _a.onImageUpload, onImageRemove = _a.onImageRemove, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images, isDisabled = _a.isDisabled;
|
|
22
|
+
var ref = useRef();
|
|
23
|
+
var events = useDraggable(ref, { isMounted: !!(images === null || images === void 0 ? void 0 : images.length) }).events;
|
|
24
|
+
var _b = useLightBox(), isLightBoxOpen = _b.isLightBoxOpen, onCloseLightBox = _b.onCloseLightBox, onOpenLightBox = _b.onOpenLightBox, lightBoxData = _b.lightBoxData;
|
|
25
|
+
return (_jsxs(x.div, { display: "flex", alignItems: "flex-end", children: [_jsx(AddPhoto, { onImageUpload: onImageUpload, isDisabled: isDisabled }), images && (_jsx(ImageListContainer, __assign({ ref: ref }, events, { children: images.map(function (item, index) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
return (_jsx(ImageElement, { imageUrl: (_a = item.smallUrl) !== null && _a !== void 0 ? _a : item.url, onImageRemove: onImageRemove === null || onImageRemove === void 0 ? void 0 : onImageRemove(item.id), onOpenLightBox: onOpenLightBox(index), isDisabled: isDisabled }, (_b = item.id) !== null && _b !== void 0 ? _b : index));
|
|
28
|
+
}) }))), _jsx(LightBox, { initialSlide: lightBoxData === null || lightBoxData === void 0 ? void 0 : lightBoxData.initialSlide, isLightBoxOpen: isLightBoxOpen, onCloseLightBox: onCloseLightBox, lightBoxAction: lightBoxAction, lightBoxActionTitle: lightBoxActionTitle, images: images })] }));
|
|
29
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type ImageUploadProps } from '../../types';
|
|
3
|
+
interface AddPhotoProps {
|
|
4
|
+
onImageUpload?: (props: ImageUploadProps) => Promise<void>;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const AddPhoto: FC<AddPhotoProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
|
+
import { useCallback } from 'react';
|
|
39
|
+
import { Container, HiddenInput } from './styles';
|
|
40
|
+
import { AddPhoto as AddPhotoIcon } from '../../../../Elements/Icon/icons/AddPhoto';
|
|
41
|
+
export var AddPhoto = function (_a) {
|
|
42
|
+
var onImageUpload = _a.onImageUpload, isDisabled = _a.isDisabled;
|
|
43
|
+
var handleImageUpload = useCallback(function (event) {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
if (!((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b[0]))
|
|
46
|
+
return;
|
|
47
|
+
var reader = new FileReader();
|
|
48
|
+
reader.readAsDataURL(event.target.files[0]);
|
|
49
|
+
reader.onload = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
return __generator(this, function (_c) {
|
|
52
|
+
switch (_c.label) {
|
|
53
|
+
case 0: return [4 /*yield*/, (onImageUpload === null || onImageUpload === void 0 ? void 0 : onImageUpload({
|
|
54
|
+
base64image: (_a = reader.result) === null || _a === void 0 ? void 0 : _a.split(',').pop(),
|
|
55
|
+
base64WithDataDeclaration: reader.result,
|
|
56
|
+
file: (_b = event.target.files) === null || _b === void 0 ? void 0 : _b[0],
|
|
57
|
+
}))];
|
|
58
|
+
case 1:
|
|
59
|
+
_c.sent();
|
|
60
|
+
return [2 /*return*/];
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}); };
|
|
64
|
+
}, [onImageUpload]);
|
|
65
|
+
if (!onImageUpload)
|
|
66
|
+
return null;
|
|
67
|
+
return (_jsxs(Container, { isDisabled: isDisabled, children: [_jsx(HiddenInput, { disabled: isDisabled, onChange: handleImageUpload, type: "file", accept: "image/*" }), _jsx(AddPhotoIcon, { width: "36", height: "36" })] }));
|
|
68
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
2
|
+
isDisabled?: boolean | undefined;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const HiddenInput: import("styled-components").StyledComponent<"input", import("@xstyled/system").Theme, {}, never>;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n flex-shrink: 0;\n transition: all 0.2s linear;\n height: 85px !important;\n width: 85px !important;\n border-radius: ", ";\n border: ", ";\n border-color: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin-right: 15px;\n opacity: ", ";\n"], ["\n position: relative;\n flex-shrink: 0;\n transition: all 0.2s linear;\n height: 85px !important;\n width: 85px !important;\n border-radius: ", ";\n border: ", ";\n border-color: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin-right: 15px;\n opacity: ", ";\n"])), th.radius('lg'), th.border('mediumSlim'), th.color('red1'), function (_a) {
|
|
7
|
+
var isDisabled = _a.isDisabled;
|
|
8
|
+
return (isDisabled ? 0.6 : 1);
|
|
9
|
+
});
|
|
10
|
+
export var HiddenInput = styled.input(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n opacity: 0;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n"], ["\n opacity: 0;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n"])));
|
|
11
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from '../../../../Elements/Icon';
|
|
3
|
+
import { Container } from './styles';
|
|
4
|
+
export var CloseButton = function (_a) {
|
|
5
|
+
var onImageRemove = _a.onImageRemove, isDisabled = _a.isDisabled;
|
|
6
|
+
return (_jsx(Container, { onClick: !isDisabled ? onImageRemove : undefined, isDisabled: isDisabled, children: _jsx(Icon, { icon: "close", size: "22px", fill: isDisabled ? 'magenta60' : 'red1' }) }));
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n width: 30px;\n height: 30px;\n background-color: ", ";\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s linear;\n"], ["\n position: absolute;\n top: 0;\n right: 0;\n width: 30px;\n height: 30px;\n background-color: ", ";\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s linear;\n"])), function (_a) {
|
|
7
|
+
var isDisabled = _a.isDisabled;
|
|
8
|
+
return th.color(isDisabled ? 'bgLightGray1' : 'red20');
|
|
9
|
+
});
|
|
10
|
+
var templateObject_1;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
interface ImageElementProps {
|
|
3
|
+
label?: string;
|
|
4
|
+
onImageRemove?: () => void;
|
|
5
|
+
onOpenLightBox: () => void;
|
|
6
|
+
imageUrl: string | undefined;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const ImageElement: FC<ImageElementProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Image } from './styles';
|
|
3
|
+
import { ImageTag } from '../ImageTag';
|
|
4
|
+
import { CloseButton } from '../CloseButton';
|
|
5
|
+
import { x } from '@xstyled/styled-components';
|
|
6
|
+
export var ImageElement = function (_a) {
|
|
7
|
+
var label = _a.label, onImageRemove = _a.onImageRemove, isDisabled = _a.isDisabled, onOpenLightBox = _a.onOpenLightBox, imageUrl = _a.imageUrl;
|
|
8
|
+
if (!imageUrl)
|
|
9
|
+
return null;
|
|
10
|
+
return (_jsxs(x.div, { position: "relative", pr: "15px", pt: "15px", w: "100px", children: [_jsx(Image, { src: imageUrl, alt: "", width: "85px", height: "85px", onClick: onOpenLightBox }), onImageRemove && _jsx(CloseButton, { onImageRemove: onImageRemove, isDisabled: isDisabled }), _jsx(ImageTag, { label: label })] }));
|
|
11
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
7
|
+
export var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: ", ";\n"], ["\n border-radius: ", ";\n"])), th.radius('lg'));
|
|
8
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Tag from '../../../../Elements/Tag';
|
|
3
|
+
import { Container } from './styles';
|
|
4
|
+
export var ImageTag = function (_a) {
|
|
5
|
+
var label = _a.label;
|
|
6
|
+
if (!label)
|
|
7
|
+
return null;
|
|
8
|
+
return (_jsx(Container, { children: _jsx(Tag, { size: "small", color: "darkGreen", textColor: "white", children: _jsx("b", { children: label }) }) }));
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
@@ -0,0 +1,7 @@
|
|
|
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 from '@xstyled/styled-components';
|
|
6
|
+
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n bottom: 2px;\n left: 2px;\n"], ["\n position: absolute;\n bottom: 2px;\n left: 2px;\n"])));
|
|
7
|
+
var templateObject_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ImageListContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
@@ -0,0 +1,7 @@
|
|
|
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 from '@xstyled/styled-components';
|
|
6
|
+
export var ImageListContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n overflow-x: scroll;\n -ms-overflow-style: none;\n scrollbar-width: none;\n position: relative;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"], ["\n display: flex;\n overflow-x: scroll;\n -ms-overflow-style: none;\n scrollbar-width: none;\n position: relative;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"])));
|
|
7
|
+
var templateObject_1;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ImageData } from '../LightBox';
|
|
2
|
+
export interface ImageUploadProps {
|
|
3
|
+
base64image?: string;
|
|
4
|
+
base64WithDataDeclaration?: string;
|
|
5
|
+
file?: File;
|
|
6
|
+
}
|
|
7
|
+
export interface ImageListProps {
|
|
8
|
+
images: ImageData[] | undefined;
|
|
9
|
+
onImageUpload?: (props: ImageUploadProps) => Promise<void>;
|
|
10
|
+
onImageRemove?: (id?: string) => () => void;
|
|
11
|
+
lightBoxAction?: (id?: string) => () => Promise<void>;
|
|
12
|
+
lightBoxActionTitle?: string;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '../../Elements/Button';
|
|
3
|
+
import Modal from '../Modal';
|
|
4
|
+
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
5
|
+
import { Container, Image, ButtonContainer } from './styles';
|
|
6
|
+
export var LightBox = function (_a) {
|
|
7
|
+
var isLightBoxOpen = _a.isLightBoxOpen, onCloseLightBox = _a.onCloseLightBox, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images, _b = _a.initialSlide, initialSlide = _b === void 0 ? 0 : _b;
|
|
8
|
+
if (!(images === null || images === void 0 ? void 0 : images.length))
|
|
9
|
+
return null;
|
|
10
|
+
return (_jsx(Modal, { isShown: isLightBoxOpen, onClose: onCloseLightBox, mobileFullscreen: true, miniCloseBtn: true, withCloseIcon: true, children: _jsx(Swiper, { initialSlide: initialSlide, slidesPerView: 1, autoHeight: true, children: images.map(function (item) {
|
|
11
|
+
var _a;
|
|
12
|
+
return (_jsx(SwiperSlide, { children: _jsxs(Container, { children: [_jsx(Image, { src: (_a = item.originalUrl) !== null && _a !== void 0 ? _a : item.url, loading: "lazy", alt: "" }), !!item.withLightBoxAction && lightBoxAction && lightBoxActionTitle && (_jsx(ButtonContainer, { children: _jsx(Button, { onClick: lightBoxAction(item.id), appearance: "primaryLight", children: lightBoxActionTitle }) }))] }) }, item.id));
|
|
13
|
+
}) }) }));
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useModal } from '../../Modal';
|
|
3
|
+
export var useLightBox = function () {
|
|
4
|
+
var _a = useModal(), isOpen = _a.isOpen, onOpen = _a.onOpen, onClose = _a.onClose, data = _a.data;
|
|
5
|
+
var onOpenLightBox = useCallback(function (index) {
|
|
6
|
+
if (index === void 0) { index = 0; }
|
|
7
|
+
return function () {
|
|
8
|
+
onOpen({ initialSlide: index });
|
|
9
|
+
};
|
|
10
|
+
}, [onOpen]);
|
|
11
|
+
return {
|
|
12
|
+
onOpenLightBox: onOpenLightBox,
|
|
13
|
+
onCloseLightBox: onClose,
|
|
14
|
+
isLightBoxOpen: isOpen,
|
|
15
|
+
lightBoxData: data
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
2
|
+
export declare const Image: import("styled-components").StyledComponent<"img", import("@xstyled/system").Theme, {}, never>;
|
|
3
|
+
export declare const ButtonContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 from '@xstyled/styled-components';
|
|
6
|
+
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n position: relative;\n"], ["\n width: 100%;\n height: 100%;\n position: relative;\n"])));
|
|
7
|
+
export var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n"], ["\n width: 100%;\n height: 100%;\n"])));
|
|
8
|
+
export var ButtonContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: -60px;\n"], ["\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: -60px;\n"])));
|
|
9
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface LightBoxData {
|
|
2
|
+
initialSlide: number;
|
|
3
|
+
}
|
|
4
|
+
export type UseLightBoxHookType = () => {
|
|
5
|
+
onOpenLightBox: (index?: number) => () => void;
|
|
6
|
+
onCloseLightBox: () => void;
|
|
7
|
+
isLightBoxOpen: boolean;
|
|
8
|
+
lightBoxData?: LightBoxData;
|
|
9
|
+
};
|
|
10
|
+
export interface ImageData {
|
|
11
|
+
id: string;
|
|
12
|
+
url?: string;
|
|
13
|
+
smallUrl?: string;
|
|
14
|
+
originalUrl?: string;
|
|
15
|
+
withLightBoxAction?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface LightBoxProps {
|
|
18
|
+
images: ImageData[] | undefined;
|
|
19
|
+
isLightBoxOpen: boolean;
|
|
20
|
+
onCloseLightBox: () => void;
|
|
21
|
+
lightBoxAction?: (id?: string) => () => Promise<void>;
|
|
22
|
+
lightBoxActionTitle?: string;
|
|
23
|
+
initialSlide?: number;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useCallback, useMemo, useEffect } from 'react';
|
|
3
|
+
import { Icon } from '../../Elements/Icon';
|
|
4
|
+
import { DialogOverlay, DialogWindow, HeaderContainer, ButtonsContainer, ContentContainer, TitleContainer, CloseButton, H4, } from './styles';
|
|
5
|
+
import { x } from '@xstyled/styled-components';
|
|
6
|
+
import { Button } from '../../Elements/Button';
|
|
7
|
+
import { Portal } from '../../Elements/Portal';
|
|
8
|
+
import { useClickOutside } from './hooks/useClickOutside';
|
|
9
|
+
import { topSpaceMap, widthMap } from './utils';
|
|
10
|
+
export var Modal = memo(function (_a) {
|
|
11
|
+
var children = _a.children, _b = _a.isShown, isShown = _b === void 0 ? true : _b, onCancel = _a.onCancel, title = _a.title, titleIcon = _a.titleIcon, onConfirm = _a.onConfirm, confirmLabel = _a.confirmLabel, cancelLabel = _a.cancelLabel, isLoading = _a.isLoading, isConfirmDisabled = _a.isConfirmDisabled, _c = _a.width, width = _c === void 0 ? 'narrow' : _c, _d = _a.topSpace, topSpace = _d === void 0 ? 'default' : _d, onClose = _a.onClose, _e = _a.hasFooter, hasFooter = _e === void 0 ? true : _e, _f = _a.hasHeader, hasHeader = _f === void 0 ? true : _f, _g = _a.whiteBg, whiteBg = _g === void 0 ? false : _g, _h = _a.miniCloseBtn, miniCloseBtn = _h === void 0 ? false : _h, _j = _a.ignoreClickOutside, ignoreClickOutside = _j === void 0 ? false : _j, _k = _a.closeEverywhere, closeEverywhere = _k === void 0 ? false : _k, _l = _a.withCloseIcon, withCloseIcon = _l === void 0 ? true : _l, _m = _a.mobileFullscreen, mobileFullscreen = _m === void 0 ? false : _m, overlayColor = _a.overlayColor, minWidth = _a.minWidth, minHeight = _a.minHeight, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight;
|
|
12
|
+
var closeDialog = useCallback(function () {
|
|
13
|
+
if (onClose) {
|
|
14
|
+
onClose();
|
|
15
|
+
}
|
|
16
|
+
else if (onCancel) {
|
|
17
|
+
onCancel();
|
|
18
|
+
}
|
|
19
|
+
}, [onClose, onCancel]);
|
|
20
|
+
var dialogStyle = useMemo(function () { return ({ width: widthMap[width] }); }, [width]);
|
|
21
|
+
var dialogRef = useClickOutside({ onClose: closeDialog, ignoreClickOutside: ignoreClickOutside, closeCurrent: true, allowScrollbarClick: true });
|
|
22
|
+
var onDialogConfirmClick = useCallback(function () {
|
|
23
|
+
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(closeDialog);
|
|
24
|
+
}, [onConfirm, closeDialog]);
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
window.addEventListener('popstate', closeDialog);
|
|
27
|
+
return function () {
|
|
28
|
+
window.removeEventListener('popstate', closeDialog);
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
31
|
+
if (!isShown) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return (_jsx(Portal, { children: _jsx(DialogOverlay, { backgroundColor: overlayColor, children: _jsxs(DialogWindow, { ref: dialogRef, style: dialogStyle, "$whiteBg": whiteBg, "data-cy": "dialogWindow", onClick: closeEverywhere ? closeDialog : undefined, "$minWidth": minWidth, "$minHeight": minHeight, "$maxWidth": maxWidth, "$maxHeight": maxHeight, "$mobileFullscreen": mobileFullscreen, children: [title && hasHeader && (_jsx(HeaderContainer, { topSpace: topSpaceMap[topSpace], children: _jsxs(TitleContainer, { children: [titleIcon && (_jsx(x.div, { as: "span", className: "icon", children: typeof titleIcon === 'string' ? _jsx(Icon, { icon: titleIcon, fill: "blue2" }) : titleIcon })), _jsx(H4, { children: title })] }) })), _jsx(ContentContainer, { topSpace: topSpaceMap[topSpace], "$mobileFullscreen": mobileFullscreen, children: children }), hasFooter && (onCancel || onConfirm) && (_jsxs(ButtonsContainer, { children: [onCancel && (_jsx(Button, { type: "button", onClick: onCancel, isLoading: isLoading, "data-cy": "cancelBtn", appearance: "primaryLight", children: cancelLabel ? cancelLabel : 'Cancel' })), onConfirm && (_jsx(Button, { type: "button", onClick: onDialogConfirmClick, isLoading: isLoading, disabled: isConfirmDisabled, "data-cy": "submitBtn", children: confirmLabel ? confirmLabel : 'Submit' }))] })), hasHeader && !closeEverywhere && withCloseIcon && (_jsx(CloseButton, { onClick: closeDialog, "data-cy": "dialogCloseBtn", children: _jsx(Icon, { icon: "close", size: miniCloseBtn ? '20px' : '26px' }) }))] }) }) }));
|
|
35
|
+
});
|