@mailstep/design-system 0.6.2-beta.2 → 0.6.2-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/package.json +1 -1
- package/ui/Blocks/CommonGrid/CommonGrid.js +38 -33
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +33 -28
- package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +10 -8
- package/ui/Blocks/CommonGrid/StandardButtons.js +20 -11
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +26 -21
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +13 -8
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +48 -20
- package/ui/Blocks/CommonGrid/components/ActionHead/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +15 -10
- package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +19 -14
- package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +22 -17
- package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +50 -22
- package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ColumnTitle.js +13 -8
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +38 -9
- package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/DataCell.js +18 -13
- package/ui/Blocks/CommonGrid/components/DataRow.js +35 -30
- package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +59 -31
- package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +5 -1
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +41 -12
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/FilterDropdown.js +13 -8
- package/ui/Blocks/CommonGrid/components/FilterRow.js +20 -15
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +23 -17
- package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +15 -10
- package/ui/Blocks/CommonGrid/components/GridSelect/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/GroupRow.js +15 -10
- package/ui/Blocks/CommonGrid/components/HeadCell.js +19 -14
- package/ui/Blocks/CommonGrid/components/HeadRow.js +45 -17
- package/ui/Blocks/CommonGrid/components/IconList/IconList.js +18 -12
- package/ui/Blocks/CommonGrid/components/IconList/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +14 -12
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +24 -17
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +28 -23
- package/ui/Blocks/CommonGrid/components/NumberRange/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/NumberRange/types.js +2 -1
- package/ui/Blocks/CommonGrid/components/OversizedScroll.js +39 -11
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +12 -10
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/Resize.js +12 -7
- package/ui/Blocks/CommonGrid/components/Table.js +37 -9
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +40 -12
- package/ui/Blocks/CommonGrid/components/TablePagination/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +36 -30
- package/ui/Blocks/CommonGrid/components/TextRange/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/TextRange/types.js +2 -1
- package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +41 -12
- package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.js +11 -4
- package/ui/Blocks/CommonGrid/components/gridCells/Date.js +13 -6
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +13 -6
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +16 -9
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +15 -8
- package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +15 -8
- package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +16 -9
- package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +9 -3
- package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +18 -11
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +20 -13
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +12 -5
- package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +11 -4
- package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.js +40 -10
- package/ui/Blocks/CommonGrid/components/gridCells/index.js +31 -14
- package/ui/Blocks/CommonGrid/components/icons/Edit.js +5 -3
- package/ui/Blocks/CommonGrid/components/icons/EyeOpen.js +5 -3
- package/ui/Blocks/CommonGrid/components/icons/Sorting.js +8 -3
- package/ui/Blocks/CommonGrid/components/utils.js +7 -3
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.js +10 -6
- package/ui/Blocks/CommonGrid/hooks/useColumnSizes.js +18 -13
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +12 -7
- package/ui/Blocks/CommonGrid/hooks/useFloatingButton.js +5 -3
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +11 -9
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.js +14 -7
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +8 -6
- package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.js +8 -3
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.js +8 -4
- package/ui/Blocks/CommonGrid/hooks/useUxReset.js +9 -4
- package/ui/Blocks/CommonGrid/index.js +51 -10
- package/ui/Blocks/CommonGrid/store/index.js +86 -77
- package/ui/Blocks/CommonGrid/store/migrateState.js +3 -1
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +24 -17
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +19 -12
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +15 -8
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +15 -8
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +15 -8
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +19 -12
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +17 -10
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +19 -12
- package/ui/Blocks/CommonGrid/storybook/utils/actions.js +11 -4
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +17 -11
- package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.js +10 -6
- package/ui/Blocks/CommonGrid/storybook/utils/utils.js +35 -26
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.js +17 -10
- package/ui/Blocks/CommonGrid/storybook/utils/withRouter.js +6 -4
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +3 -1
- package/ui/Blocks/CommonGrid/styles.js +39 -10
- package/ui/Blocks/CommonGrid/translations.js +5 -3
- package/ui/Blocks/CommonGrid/types.js +6 -3
- package/ui/Blocks/CommonGrid/utils/index.js +40 -23
- package/ui/Blocks/CornerDialog/CornerDialog.js +15 -11
- package/ui/Blocks/CornerDialog/index.js +4 -2
- package/ui/Blocks/CornerDialog/stories/CornerDialog.stories.js +10 -7
- package/ui/Blocks/CornerDialog/styles.js +35 -9
- package/ui/Blocks/CornerDialog/types.js +2 -1
- package/ui/Blocks/CornerDialog/utils.js +5 -2
- package/ui/Blocks/HidePrint/HidePrint.js +10 -5
- package/ui/Blocks/ImageList/ImageList.js +42 -15
- package/ui/Blocks/ImageList/components/AddPhoto/index.js +11 -7
- package/ui/Blocks/ImageList/components/AddPhoto/styles.js +29 -3
- package/ui/Blocks/ImageList/components/CloseButton/index.js +9 -5
- package/ui/Blocks/ImageList/components/CloseButton/styles.js +29 -3
- package/ui/Blocks/ImageList/components/ImageElement/index.js +11 -7
- package/ui/Blocks/ImageList/components/ImageElement/styles.js +29 -3
- package/ui/Blocks/ImageList/components/ImageTag/index.js +12 -5
- package/ui/Blocks/ImageList/components/ImageTag/styles.js +8 -2
- package/ui/Blocks/ImageList/index.js +4 -2
- package/ui/Blocks/ImageList/stories/ImageList.stories.js +9 -6
- package/ui/Blocks/ImageList/styles.js +8 -2
- package/ui/Blocks/ImageList/types.js +2 -1
- package/ui/Blocks/LightBox/LightBox.js +15 -8
- package/ui/Blocks/LightBox/hooks/useLightBox.js +9 -5
- package/ui/Blocks/LightBox/index.js +7 -3
- package/ui/Blocks/LightBox/stories/LightBox.stories.js +7 -4
- package/ui/Blocks/LightBox/styles.js +11 -5
- package/ui/Blocks/LightBox/types.js +2 -1
- package/ui/Blocks/Modal/Modal.js +20 -17
- package/ui/Blocks/Modal/hooks/useClickOutside.js +10 -6
- package/ui/Blocks/Modal/hooks/useModal.js +10 -6
- package/ui/Blocks/Modal/index.js +9 -4
- package/ui/Blocks/Modal/stories/Modal.stories.js +48 -42
- package/ui/Blocks/Modal/styles.js +46 -20
- package/ui/Blocks/Modal/types.js +2 -1
- package/ui/Blocks/Modal/utils.js +4 -1
- package/ui/Blocks/Popover/index.js +15 -10
- package/ui/Blocks/Tabs/TabContent.js +5 -1
- package/ui/Blocks/Tabs/Tabs.js +14 -10
- package/ui/Blocks/Tabs/hooks/useTabs.js +8 -4
- package/ui/Blocks/Tabs/index.js +9 -4
- package/ui/Blocks/Tabs/stories/Tabs.stories.js +9 -6
- package/ui/Blocks/Tabs/styles.js +34 -8
- package/ui/Blocks/Tabs/types.js +2 -1
- package/ui/Elements/Alert/Alert.js +12 -10
- package/ui/Elements/Alert/index.js +9 -3
- package/ui/Elements/Alert/stories/Alert.stories.js +14 -11
- package/ui/Elements/Alert/styles.js +20 -14
- package/ui/Elements/Alert/types.js +2 -1
- package/ui/Elements/Avatar/Avatar.js +14 -7
- package/ui/Elements/Avatar/index.js +7 -3
- package/ui/Elements/Avatar/stories/Avatar.stories.js +8 -5
- package/ui/Elements/Avatar/types.js +2 -1
- package/ui/Elements/Badge/Badge.js +38 -13
- package/ui/Elements/Badge/index.js +9 -3
- package/ui/Elements/Badge/stories/Badge.stories.js +11 -5
- package/ui/Elements/BorderedBox/BorderedBox.js +30 -5
- package/ui/Elements/BorderedBox/index.js +9 -3
- package/ui/Elements/BorderedBox/stories/BorderedBox.stories.js +7 -4
- package/ui/Elements/BorderedBox/types.js +2 -1
- package/ui/Elements/Button/Button.js +7 -5
- package/ui/Elements/Button/index.js +9 -3
- package/ui/Elements/Button/stories/Button.stories.js +16 -13
- package/ui/Elements/Button/styles.js +14 -8
- package/ui/Elements/Button/types.js +2 -1
- package/ui/Elements/Card/Card.js +20 -14
- package/ui/Elements/Card/index.js +12 -3
- package/ui/Elements/Card/stories/Card.stories.js +11 -8
- package/ui/Elements/Card/stories/CardComponent.stories.js +12 -6
- package/ui/Elements/Card/styles.js +38 -12
- package/ui/Elements/Card/types.js +2 -1
- package/ui/Elements/DatePicker/DatePicker.js +53 -25
- package/ui/Elements/DatePicker/Datetime/DateTime.js +31 -26
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +47 -20
- package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +6 -3
- package/ui/Elements/DatePicker/Datetime/types.js +2 -1
- package/ui/Elements/DatePicker/Datetime/views/DaysView.js +18 -13
- package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +14 -9
- package/ui/Elements/DatePicker/Datetime/views/YearsView.js +14 -9
- package/ui/Elements/DatePicker/index.js +7 -2
- package/ui/Elements/DatePicker/styles.js +29 -3
- package/ui/Elements/Dropdown/Dropdown.js +15 -10
- package/ui/Elements/Dropdown/index.js +9 -3
- package/ui/Elements/Dropdown/stories/Dropdown.stories.js +10 -4
- package/ui/Elements/Dropdown/types.js +2 -1
- package/ui/Elements/DropdownMenu/DropdownMenu.js +15 -8
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +32 -7
- package/ui/Elements/DropdownMenu/components/MenuItem.js +15 -10
- package/ui/Elements/DropdownMenu/components/MenuList.js +10 -5
- package/ui/Elements/DropdownMenu/index.js +5 -1
- package/ui/Elements/DropdownMenu/types.js +2 -1
- package/ui/Elements/DropdownSelect/DropdownSelect.js +50 -21
- package/ui/Elements/DropdownSelect/index.js +10 -3
- package/ui/Elements/ErrorMessage/ErrorMessage.js +34 -9
- package/ui/Elements/ErrorMessage/index.js +9 -3
- package/ui/Elements/ErrorMessage/stories/ErrorMessage.stories.js +11 -5
- package/ui/Elements/ErrorMessage/types.js +2 -1
- package/ui/Elements/HighlightBox/HighlightBox.js +38 -12
- package/ui/Elements/HighlightBox/index.js +7 -2
- package/ui/Elements/Icon/BadgeIcon.js +17 -10
- package/ui/Elements/Icon/Icon.js +245 -216
- package/ui/Elements/Icon/icons/AddPhoto.js +6 -2
- package/ui/Elements/Icon/icons/BarcodeScan.js +6 -2
- package/ui/Elements/Icon/icons/Box.js +6 -2
- package/ui/Elements/Icon/icons/Calendar.js +6 -2
- package/ui/Elements/Icon/icons/Cancel.js +6 -2
- package/ui/Elements/Icon/icons/CheckedBox.js +6 -2
- package/ui/Elements/Icon/icons/Company.js +6 -2
- package/ui/Elements/Icon/icons/Complaint.js +6 -2
- package/ui/Elements/Icon/icons/Consolidation.js +6 -2
- package/ui/Elements/Icon/icons/Dispatch.js +6 -2
- package/ui/Elements/Icon/icons/EmptyRack.js +6 -2
- package/ui/Elements/Icon/icons/Expeditions.js +6 -2
- package/ui/Elements/Icon/icons/FlagCZ.js +6 -2
- package/ui/Elements/Icon/icons/FlagEL.js +6 -2
- package/ui/Elements/Icon/icons/FlagESP.js +6 -2
- package/ui/Elements/Icon/icons/FlagITA.js +6 -2
- package/ui/Elements/Icon/icons/FlagRUS.js +6 -2
- package/ui/Elements/Icon/icons/FlagSVK.js +6 -2
- package/ui/Elements/Icon/icons/FlagUSA.js +6 -2
- package/ui/Elements/Icon/icons/Gift.js +6 -2
- package/ui/Elements/Icon/icons/Group.js +6 -2
- package/ui/Elements/Icon/icons/HamburgerMenu.js +6 -2
- package/ui/Elements/Icon/icons/HelpCircle1.js +6 -2
- package/ui/Elements/Icon/icons/ImagePlaceholder.js +6 -2
- package/ui/Elements/Icon/icons/Income.js +6 -2
- package/ui/Elements/Icon/icons/Info.js +6 -2
- package/ui/Elements/Icon/icons/Integrations.js +6 -2
- package/ui/Elements/Icon/icons/Inventory.js +6 -2
- package/ui/Elements/Icon/icons/Inventory2.js +6 -2
- package/ui/Elements/Icon/icons/Link.js +6 -2
- package/ui/Elements/Icon/icons/Location.js +6 -2
- package/ui/Elements/Icon/icons/Logout1.js +6 -2
- package/ui/Elements/Icon/icons/MakePhoto.js +6 -2
- package/ui/Elements/Icon/icons/MenuItems.js +6 -2
- package/ui/Elements/Icon/icons/MobileCancel.js +6 -2
- package/ui/Elements/Icon/icons/Notification2.js +6 -2
- package/ui/Elements/Icon/icons/OpenBox.js +6 -2
- package/ui/Elements/Icon/icons/Plus1.js +6 -2
- package/ui/Elements/Icon/icons/Print.js +6 -2
- package/ui/Elements/Icon/icons/Product.js +6 -2
- package/ui/Elements/Icon/icons/Products.js +6 -2
- package/ui/Elements/Icon/icons/Profile.js +6 -2
- package/ui/Elements/Icon/icons/Puzzle1.js +6 -2
- package/ui/Elements/Icon/icons/QRCode.js +6 -2
- package/ui/Elements/Icon/icons/Rack.js +6 -2
- package/ui/Elements/Icon/icons/Return.js +6 -2
- package/ui/Elements/Icon/icons/Rows.js +6 -2
- package/ui/Elements/Icon/icons/Settings2.js +6 -2
- package/ui/Elements/Icon/icons/ShoppingBag.js +6 -2
- package/ui/Elements/Icon/icons/ThreeDots.js +6 -2
- package/ui/Elements/Icon/icons/Transfer.js +6 -2
- package/ui/Elements/Icon/icons/Truck.js +6 -2
- package/ui/Elements/Icon/icons/TwoBoxes.js +6 -2
- package/ui/Elements/Icon/icons/TwoCheckedBoxes.js +6 -2
- package/ui/Elements/Icon/icons/TwoUsers.js +6 -2
- package/ui/Elements/Icon/icons/index.js +114 -55
- package/ui/Elements/Icon/index.js +26 -5
- package/ui/Elements/Icon/stories/BadgeIcon.stories.js +12 -6
- package/ui/Elements/Icon/stories/Icon.stories.js +12 -9
- package/ui/Elements/Icon/types.js +2 -1
- package/ui/Elements/Image/Image.js +6 -4
- package/ui/Elements/Image/index.js +9 -3
- package/ui/Elements/Image/stories/Image.stories.js +15 -9
- package/ui/Elements/Image/types.js +2 -1
- package/ui/Elements/Label/Label.js +35 -9
- package/ui/Elements/Label/index.js +8 -3
- package/ui/Elements/Label/stories/Label.stories.js +8 -5
- package/ui/Elements/Line/Line.js +10 -5
- package/ui/Elements/Line/index.js +9 -3
- package/ui/Elements/Line/stories/Line.stories.js +16 -10
- package/ui/Elements/Line/types.js +2 -1
- package/ui/Elements/Link/Link.js +39 -14
- package/ui/Elements/Link/index.js +9 -3
- package/ui/Elements/Link/stories/Link.stories.js +13 -10
- package/ui/Elements/Logo/Logo.js +30 -25
- package/ui/Elements/Logo/index.js +9 -3
- package/ui/Elements/Logo/stories/Logo.stories.js +24 -18
- package/ui/Elements/Logo/types.js +2 -1
- package/ui/Elements/MultiSelect/MultiSelect.js +9 -4
- package/ui/Elements/MultiSelect/index.js +7 -2
- package/ui/Elements/Pagination/Pagination.js +9 -7
- package/ui/Elements/Pagination/index.js +9 -3
- package/ui/Elements/Pagination/stories/Pagination.stories.js +8 -5
- package/ui/Elements/Pagination/styled.js +41 -12
- package/ui/Elements/Portal/index.js +14 -7
- package/ui/Elements/ProgressBar/ProgressBar.js +6 -4
- package/ui/Elements/ProgressBar/index.js +9 -3
- package/ui/Elements/ProgressBar/stories/ProgressBar.stories.js +12 -6
- package/ui/Elements/ProgressBar/styles.js +38 -12
- package/ui/Elements/Select/Select.js +25 -20
- package/ui/Elements/Select/index.js +7 -2
- package/ui/Elements/Select/styles.js +13 -7
- package/ui/Elements/Select/themes/CustomComponents.js +72 -37
- package/ui/Elements/Select/themes/baseStyles.js +12 -6
- package/ui/Elements/Select/themes/formStyles.js +27 -23
- package/ui/Elements/Select/themes/index.js +20 -16
- package/ui/Elements/Select/types.js +2 -1
- package/ui/Elements/SimpleLink/SimpleLink.js +31 -6
- package/ui/Elements/SimpleLink/index.js +9 -3
- package/ui/Elements/SingleSelect/SingleSelect.js +32 -27
- package/ui/Elements/SingleSelect/index.js +7 -2
- package/ui/Elements/SpaceAround/SpaceAround.js +36 -11
- package/ui/Elements/SpaceAround/index.js +9 -3
- package/ui/Elements/SpaceAround/stories/SpaceAround.stories.js +8 -5
- package/ui/Elements/SpaceAround/types.js +2 -1
- package/ui/Elements/Spinner/Spinner.js +12 -8
- package/ui/Elements/Spinner/index.js +9 -3
- package/ui/Elements/Spinner/stories/Spinner.stories.js +16 -13
- package/ui/Elements/Spinner/styles.js +33 -7
- package/ui/Elements/Spinner/types.js +2 -1
- package/ui/Elements/Tag/Tag.js +31 -6
- package/ui/Elements/Tag/index.js +10 -3
- package/ui/Elements/Tag/palletes.js +4 -1
- package/ui/Elements/Tag/stories/Tag.stories.js +21 -15
- package/ui/Elements/Tag/stories/components/predefinedTags.js +11 -6
- package/ui/Elements/Tag/types.js +2 -1
- package/ui/Elements/Text/Text.js +6 -4
- package/ui/Elements/Text/index.js +8 -2
- package/ui/Elements/Text/stories/Text.stories.js +15 -9
- package/ui/Elements/Text/types.js +2 -1
- package/ui/Elements/Toast/Toast.js +15 -10
- package/ui/Elements/Toast/index.js +9 -3
- package/ui/Elements/Toggle/Toggle.js +38 -13
- package/ui/Elements/Toggle/index.js +9 -3
- package/ui/Elements/Toggle/stories/Toggle.stories.js +13 -7
- package/ui/Elements/Toggle/types.js +2 -1
- package/ui/Elements/Typography/Typography.js +44 -28
- package/ui/Elements/Typography/index.js +19 -3
- package/ui/Elements/Typography/stories/Typography.stories.js +18 -15
- package/ui/Forms/Checkbox/Checkbox.js +11 -9
- package/ui/Forms/Checkbox/index.js +9 -3
- package/ui/Forms/Checkbox/stories/Checkbox.stories.js +13 -7
- package/ui/Forms/Checkbox/styles.js +32 -6
- package/ui/Forms/Checkbox/types.js +2 -1
- package/ui/Forms/Input/Input.js +20 -16
- package/ui/Forms/Input/index.js +6 -3
- package/ui/Forms/Input/stories/Input.stories.js +14 -11
- package/ui/Forms/Input/styles.js +46 -20
- package/ui/Forms/Input/types.js +2 -1
- package/ui/Forms/RadioButton/RadioButton.js +8 -6
- package/ui/Forms/RadioButton/index.js +9 -3
- package/ui/Forms/RadioButton/stories/RadioButton.stories.js +13 -7
- package/ui/Forms/RadioButton/styles.js +13 -7
- package/ui/Forms/RadioButton/types.js +2 -1
- package/ui/Forms/TextArea/TextArea.js +13 -8
- package/ui/Forms/TextArea/index.js +7 -2
- package/ui/Forms/TextArea/styles.js +39 -13
- package/ui/System/Fonts/index.js +14 -9
- package/ui/ThemeProvider/ThemeProvider.js +13 -7
- package/ui/ThemeProvider/index.js +25 -5
- package/ui/ThemeProvider/themes/default.js +3 -1
- package/ui/ThemeProvider/themes/index.js +12 -7
- package/ui/ThemeProvider/themes/light.js +3 -1
- package/ui/ThemeProvider/themes/mailwise.js +3 -1
- package/ui/ThemeProvider/types.js +2 -1
- package/ui/index.js +146 -85
- package/ui/index.umd.js +3878 -0
- package/ui/utils/CreateRgba/createRgba.js +12 -5
- package/ui/utils/CreateRgba/types.js +2 -1
- package/ui/utils/KeyPress/KeyPress.js +6 -4
- package/ui/utils/KeyPress/KeyPress.stories.js +12 -6
- package/ui/utils/KeyPress/index.js +7 -2
- package/ui/utils/KeyPress/types.js +2 -1
- package/ui/utils/index.js +13 -6
- package/ui/index.cjs.js +0 -3878
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ImageTag = void 0;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
var Tag_1 = __importDefault(require("../../../../Elements/Tag"));
|
|
9
|
+
var styles_1 = require("./styles");
|
|
10
|
+
var ImageTag = function (_a) {
|
|
5
11
|
var label = _a.label;
|
|
6
12
|
if (!label)
|
|
7
13
|
return null;
|
|
8
|
-
return (
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.Container, { children: (0, jsx_runtime_1.jsx)(Tag_1.default, { size: "small", color: "darkGreen", textColor: "white", children: (0, jsx_runtime_1.jsx)("b", { children: label }) }) }));
|
|
9
15
|
};
|
|
16
|
+
exports.ImageTag = ImageTag;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
4
|
return cooked;
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Container = void 0;
|
|
11
|
+
var styled_components_1 = __importDefault(require("@xstyled/styled-components"));
|
|
12
|
+
exports.Container = styled_components_1.default.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
13
|
var templateObject_1;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __assign = (this && this.__assign) || function () {
|
|
2
3
|
__assign = Object.assign || function(t) {
|
|
3
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -9,32 +10,34 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
10
|
};
|
|
10
11
|
return __assign.apply(this, arguments);
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ImageListWithItemDescription = exports.ImageListDisabled = exports.ImageListDefault = void 0;
|
|
15
|
+
var ImageList_1 = require("../ImageList");
|
|
13
16
|
var meta = {
|
|
14
17
|
title: 'Blocks/ImageList',
|
|
15
|
-
component: ImageList,
|
|
18
|
+
component: ImageList_1.ImageList,
|
|
16
19
|
tags: ['autodocs'],
|
|
17
20
|
argTypes: {},
|
|
18
21
|
};
|
|
19
|
-
|
|
22
|
+
exports.default = meta;
|
|
20
23
|
var images = [
|
|
21
24
|
{ id: '1', smallUrl: 'https://picsum.photos/200/300', url: 'https://picsum.photos/400/400' },
|
|
22
25
|
{ id: '1', smallUrl: 'https://picsum.photos/200/300', url: 'https://picsum.photos/400/400' },
|
|
23
26
|
];
|
|
24
|
-
|
|
27
|
+
exports.ImageListDefault = {
|
|
25
28
|
args: {
|
|
26
29
|
images: images,
|
|
27
30
|
isDisabled: false,
|
|
28
31
|
onImageRemove: function (id) { return function () { return null; }; }
|
|
29
32
|
},
|
|
30
33
|
};
|
|
31
|
-
|
|
34
|
+
exports.ImageListDisabled = {
|
|
32
35
|
args: {
|
|
33
36
|
images: images,
|
|
34
37
|
isDisabled: true,
|
|
35
38
|
},
|
|
36
39
|
};
|
|
37
|
-
|
|
40
|
+
exports.ImageListWithItemDescription = {
|
|
38
41
|
args: {
|
|
39
42
|
images: images.map(function (img) { return (__assign(__assign({}, img), { label: 'Lorem Ipsum', date: '24.12.2024', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur explicabo harum' })); }),
|
|
40
43
|
},
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
4
|
return cooked;
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ImageListContainer = void 0;
|
|
11
|
+
var styled_components_1 = __importDefault(require("@xstyled/styled-components"));
|
|
12
|
+
exports.ImageListContainer = styled_components_1.default.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
13
|
var templateObject_1;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LightBox = void 0;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
var Button_1 = require("../../Elements/Button");
|
|
9
|
+
var Modal_1 = __importDefault(require("../Modal"));
|
|
10
|
+
var react_1 = require("swiper/react");
|
|
11
|
+
var styles_1 = require("./styles");
|
|
12
|
+
var LightBox = function (_a) {
|
|
7
13
|
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
14
|
if (!(images === null || images === void 0 ? void 0 : images.length))
|
|
9
15
|
return null;
|
|
10
|
-
return (
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(Modal_1.default, { isShown: isLightBoxOpen, onClose: onCloseLightBox, variant: "mobileFullscreen", top: "10px", children: (0, jsx_runtime_1.jsx)(react_1.Swiper, { initialSlide: initialSlide, slidesPerView: 1, autoHeight: true, children: images.map(function (item) {
|
|
11
17
|
var _a;
|
|
12
|
-
return (
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(styles_1.Container, { children: [(0, jsx_runtime_1.jsx)(styles_1.Image, { src: (_a = item.originalUrl) !== null && _a !== void 0 ? _a : item.url, loading: "lazy", alt: "" }), (item.date || item.description) && ((0, jsx_runtime_1.jsxs)(styles_1.Description, { children: [item.date, " ", item.description] })), !!item.withLightBoxAction && lightBoxAction && lightBoxActionTitle && ((0, jsx_runtime_1.jsx)(styles_1.ButtonContainer, { children: (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: lightBoxAction(item.id), appearance: "primaryLight", children: lightBoxActionTitle }) }))] }) }, item.id));
|
|
13
19
|
}) }) }));
|
|
14
20
|
};
|
|
21
|
+
exports.LightBox = LightBox;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLightBox = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var Modal_1 = require("../../Modal");
|
|
6
|
+
var useLightBox = function () {
|
|
7
|
+
var _a = (0, Modal_1.useModal)(), isOpen = _a.isOpen, onOpen = _a.onOpen, onClose = _a.onClose, data = _a.data;
|
|
8
|
+
var onOpenLightBox = (0, react_1.useCallback)(function (index) {
|
|
6
9
|
if (index === void 0) { index = 0; }
|
|
7
10
|
return function () {
|
|
8
11
|
onOpen({ initialSlide: index });
|
|
@@ -15,3 +18,4 @@ export var useLightBox = function () {
|
|
|
15
18
|
lightBoxData: data
|
|
16
19
|
};
|
|
17
20
|
};
|
|
21
|
+
exports.useLightBox = useLightBox;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLightBox = void 0;
|
|
4
|
+
var LightBox_1 = require("./LightBox");
|
|
5
|
+
var useLightBox_1 = require("./hooks/useLightBox");
|
|
6
|
+
Object.defineProperty(exports, "useLightBox", { enumerable: true, get: function () { return useLightBox_1.useLightBox; } });
|
|
7
|
+
exports.default = LightBox_1.LightBox;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LightBoxDefault = void 0;
|
|
4
|
+
var LightBox_1 = require("../LightBox");
|
|
2
5
|
var meta = {
|
|
3
6
|
title: 'Blocks/LightBox',
|
|
4
|
-
component: LightBox,
|
|
7
|
+
component: LightBox_1.LightBox,
|
|
5
8
|
tags: ['autodocs'],
|
|
6
9
|
argTypes: {},
|
|
7
10
|
};
|
|
8
|
-
|
|
11
|
+
exports.default = meta;
|
|
9
12
|
var images = [
|
|
10
13
|
{ id: '1', smallUrl: 'https://picsum.photos/200/300', url: 'https://picsum.photos/400/400', date: '1.12.2024', description: 'Lorem ipsum' },
|
|
11
14
|
{ id: '2', smallUrl: 'https://picsum.photos/200/300', url: 'https://picsum.photos/400/400', description: 'Lorem ipsum' },
|
|
12
15
|
{ id: '3', smallUrl: 'https://picsum.photos/200/300', url: 'https://picsum.photos/400/400', date: '1.12.2024' },
|
|
13
16
|
{ id: '3', smallUrl: 'https://picsum.photos/200/300', url: 'https://picsum.photos/400/400' },
|
|
14
17
|
];
|
|
15
|
-
|
|
18
|
+
exports.LightBoxDefault = {
|
|
16
19
|
args: {
|
|
17
20
|
images: images,
|
|
18
21
|
isLightBoxOpen: true
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
4
|
return cooked;
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Description = exports.ButtonContainer = exports.Image = exports.Container = void 0;
|
|
11
|
+
var styled_components_1 = __importDefault(require("@xstyled/styled-components"));
|
|
12
|
+
exports.Container = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n position: relative;\n display: flex;\n"], ["\n width: 100%;\n height: 100%;\n position: relative;\n display: flex;\n"])));
|
|
13
|
+
exports.Image = styled_components_1.default.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n"], ["\n width: 100%;\n height: 100%;\n"])));
|
|
14
|
+
exports.ButtonContainer = styled_components_1.default.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"])));
|
|
15
|
+
exports.Description = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: 10px;\n position: absolute;\n width: 100%;\n bottom: 0px;\n background: rgba(255, 255, 255, 0.8);\n"], ["\n padding: 10px;\n position: absolute;\n width: 100%;\n bottom: 0px;\n background: rgba(255, 255, 255, 0.8);\n"])));
|
|
10
16
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/ui/Blocks/Modal/Modal.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Modal = void 0;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var Icon_1 = require("../../Elements/Icon");
|
|
7
|
+
var Typography_1 = require("../../Elements/Typography");
|
|
8
|
+
var styles_1 = require("./styles");
|
|
9
|
+
var styled_components_1 = require("@xstyled/styled-components");
|
|
10
|
+
var Button_1 = require("../../Elements/Button");
|
|
11
|
+
var Portal_1 = require("../../Elements/Portal");
|
|
12
|
+
var useClickOutside_1 = require("./hooks/useClickOutside");
|
|
13
|
+
var utils_1 = require("./utils");
|
|
14
|
+
exports.Modal = (0, react_1.memo)(function (_a) {
|
|
12
15
|
var children = _a.children, _b = _a.isShown, isShown = _b === void 0 ? true : _b, onExtraAction = _a.onExtraAction, onCancel = _a.onCancel, title = _a.title, titleIcon = _a.titleIcon, onConfirm = _a.onConfirm, confirmLabel = _a.confirmLabel, cancelLabel = _a.cancelLabel, extraActionLabel = _a.extraActionLabel, isLoading = _a.isLoading, isConfirmDisabled = _a.isConfirmDisabled, _c = _a.width, width = _c === void 0 ? 'narrow' : _c, onClose = _a.onClose, _d = _a.hasFooter, hasFooter = _d === void 0 ? true : _d, _e = _a.hasHeader, hasHeader = _e === void 0 ? true : _e, background = _a.background, _f = _a.ignoreClickOutside, ignoreClickOutside = _f === void 0 ? false : _f, _g = _a.closeEverywhere, closeEverywhere = _g === void 0 ? false : _g, _h = _a.withCloseIcon, withCloseIcon = _h === void 0 ? true : _h, overlayColor = _a.overlayColor, minWidth = _a.minWidth, minHeight = _a.minHeight, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, _j = _a.variant, variant = _j === void 0 ? 'compact' : _j, top = _a.top;
|
|
13
|
-
var closeDialog = useCallback(function () {
|
|
16
|
+
var closeDialog = (0, react_1.useCallback)(function () {
|
|
14
17
|
if (onClose) {
|
|
15
18
|
onClose();
|
|
16
19
|
}
|
|
@@ -18,12 +21,12 @@ export var Modal = memo(function (_a) {
|
|
|
18
21
|
onCancel();
|
|
19
22
|
}
|
|
20
23
|
}, [onClose, onCancel]);
|
|
21
|
-
var dialogStyle = useMemo(function () { return ({ width: widthMap[width] }); }, [width]);
|
|
22
|
-
var dialogRef = useClickOutside({ onClose: closeDialog, ignoreClickOutside: ignoreClickOutside, closeCurrent: true, allowScrollbarClick: true });
|
|
23
|
-
var onDialogConfirmClick = useCallback(function () {
|
|
24
|
+
var dialogStyle = (0, react_1.useMemo)(function () { return ({ width: utils_1.widthMap[width] }); }, [width]);
|
|
25
|
+
var dialogRef = (0, useClickOutside_1.useClickOutside)({ onClose: closeDialog, ignoreClickOutside: ignoreClickOutside, closeCurrent: true, allowScrollbarClick: true });
|
|
26
|
+
var onDialogConfirmClick = (0, react_1.useCallback)(function () {
|
|
24
27
|
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(closeDialog);
|
|
25
28
|
}, [onConfirm, closeDialog]);
|
|
26
|
-
useEffect(function () {
|
|
29
|
+
(0, react_1.useEffect)(function () {
|
|
27
30
|
window.addEventListener('popstate', closeDialog);
|
|
28
31
|
return function () {
|
|
29
32
|
window.removeEventListener('popstate', closeDialog);
|
|
@@ -32,5 +35,5 @@ export var Modal = memo(function (_a) {
|
|
|
32
35
|
if (!isShown) {
|
|
33
36
|
return null;
|
|
34
37
|
}
|
|
35
|
-
return (
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(Portal_1.Portal, { children: (0, jsx_runtime_1.jsx)(styles_1.DialogOverlay, { backgroundColor: overlayColor, children: (0, jsx_runtime_1.jsxs)(styles_1.DialogWindow, { ref: dialogRef, style: dialogStyle, "$backgroundColor": background, top: top, "data-cy": "dialogWindow", onClick: closeEverywhere ? closeDialog : undefined, "$minWidth": minWidth, "$minHeight": minHeight, "$maxWidth": maxWidth, "$maxHeight": maxHeight, variant: variant, children: [title && hasHeader && ((0, jsx_runtime_1.jsx)(styles_1.HeaderContainer, { variant: variant, children: (0, jsx_runtime_1.jsxs)(styles_1.TitleContainer, { children: [titleIcon && ((0, jsx_runtime_1.jsx)(styled_components_1.x.div, { as: "span", className: "icon", children: typeof titleIcon === 'string' ? (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: titleIcon, fill: "blue2" }) : titleIcon })), variant == 'default' ? ((0, jsx_runtime_1.jsx)(Typography_1.H2, { mt: 0, mb: 0, variant: "bold", children: title })) : ((0, jsx_runtime_1.jsx)(Typography_1.H5, { mt: 0, mb: 0, variant: "bold", children: title }))] }) })), withCloseIcon && ((0, jsx_runtime_1.jsx)(styles_1.CloseButton, { onClick: closeDialog, "data-cy": "dialogCloseBtn", children: (0, jsx_runtime_1.jsx)(Icon_1.Cancel, { width: "11px", height: "11px" }) })), (0, jsx_runtime_1.jsx)(styles_1.ContentContainer, { variant: variant, children: children }), hasFooter && (onExtraAction || onCancel || onConfirm) && ((0, jsx_runtime_1.jsxs)(styles_1.ButtonsContainer, { hasSpaceBetween: !!onExtraAction, children: [onExtraAction && ((0, jsx_runtime_1.jsx)(Button_1.Button, { type: "button", onClick: onExtraAction, isLoading: isLoading, "data-cy": "extraActionBtn", appearance: "ghostDanger", children: extraActionLabel })), (0, jsx_runtime_1.jsxs)(styles_1.ButtonsWrapper, { hasExtraAction: !!onExtraAction, hasBothButtons: !!onCancel && !!onConfirm, children: [onCancel && ((0, jsx_runtime_1.jsx)(Button_1.Button, { type: "button", onClick: onCancel, isLoading: isLoading, "data-cy": "cancelBtn", appearance: "primaryLight", children: cancelLabel ? cancelLabel : 'Cancel' })), onConfirm && ((0, jsx_runtime_1.jsx)(Button_1.Button, { type: "button", onClick: onDialogConfirmClick, isLoading: isLoading, disabled: isConfirmDisabled, "data-cy": "submitBtn", children: confirmLabel ? confirmLabel : 'Submit' }))] })] }))] }) }) }));
|
|
36
39
|
});
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useClickOutside = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var useClickOutside = function (_a) {
|
|
3
6
|
var onClose = _a.onClose, parentRef = _a.parentRef, _b = _a.ignoreClickOutside, ignoreClickOutside = _b === void 0 ? false : _b, _c = _a.closeCurrent, closeCurrent = _c === void 0 ? false : _c, _d = _a.allowScrollbarClick, allowScrollbarClick = _d === void 0 ? false : _d;
|
|
4
|
-
var elementRef = useRef(null);
|
|
7
|
+
var elementRef = (0, react_1.useRef)(null);
|
|
5
8
|
var onCloseModal = !ignoreClickOutside ? onClose : undefined;
|
|
6
|
-
var handleClickOutside = useCallback(function (e) {
|
|
9
|
+
var handleClickOutside = (0, react_1.useCallback)(function (e) {
|
|
7
10
|
var _a;
|
|
8
11
|
var ignoreEvent = allowScrollbarClick && e.offsetX > e.target.clientWidth;
|
|
9
12
|
if (!ignoreEvent &&
|
|
@@ -13,12 +16,12 @@ export var useClickOutside = function (_a) {
|
|
|
13
16
|
closeCurrent ? e.target.contains(elementRef.current) && (onCloseModal === null || onCloseModal === void 0 ? void 0 : onCloseModal()) : onCloseModal === null || onCloseModal === void 0 ? void 0 : onCloseModal();
|
|
14
17
|
}
|
|
15
18
|
}, [allowScrollbarClick, parentRef, closeCurrent, onCloseModal]);
|
|
16
|
-
var keyPress = useCallback(function (e) {
|
|
19
|
+
var keyPress = (0, react_1.useCallback)(function (e) {
|
|
17
20
|
if (e.key === 'Escape') {
|
|
18
21
|
onCloseModal === null || onCloseModal === void 0 ? void 0 : onCloseModal();
|
|
19
22
|
}
|
|
20
23
|
}, [onCloseModal]);
|
|
21
|
-
useEffect(function () {
|
|
24
|
+
(0, react_1.useEffect)(function () {
|
|
22
25
|
document.addEventListener('mousedown', handleClickOutside);
|
|
23
26
|
document.addEventListener('keydown', keyPress);
|
|
24
27
|
return function () {
|
|
@@ -28,3 +31,4 @@ export var useClickOutside = function (_a) {
|
|
|
28
31
|
}, [handleClickOutside, keyPress]);
|
|
29
32
|
return elementRef;
|
|
30
33
|
};
|
|
34
|
+
exports.useClickOutside = useClickOutside;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useModal = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var useModal = function (initialState) {
|
|
3
6
|
if (initialState === void 0) { initialState = false; }
|
|
4
|
-
var _a = useState(initialState), isOpen = _a[0], setIsOpen = _a[1];
|
|
5
|
-
var _b = useState(), data = _b[0], setData = _b[1];
|
|
6
|
-
var onClose = useCallback(function () {
|
|
7
|
+
var _a = (0, react_1.useState)(initialState), isOpen = _a[0], setIsOpen = _a[1];
|
|
8
|
+
var _b = (0, react_1.useState)(), data = _b[0], setData = _b[1];
|
|
9
|
+
var onClose = (0, react_1.useCallback)(function () {
|
|
7
10
|
setIsOpen(false);
|
|
8
11
|
setData(undefined);
|
|
9
12
|
}, []);
|
|
10
|
-
var onOpen = useCallback(function (data) {
|
|
13
|
+
var onOpen = (0, react_1.useCallback)(function (data) {
|
|
11
14
|
data && setData(data);
|
|
12
15
|
setIsOpen(true);
|
|
13
16
|
}, []);
|
|
14
17
|
return { isOpen: isOpen, onClose: onClose, onOpen: onOpen, data: data };
|
|
15
18
|
};
|
|
19
|
+
exports.useModal = useModal;
|
package/ui/Blocks/Modal/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useClickOutside = exports.useModal = void 0;
|
|
4
|
+
var Modal_1 = require("./Modal");
|
|
5
|
+
var useModal_1 = require("./hooks/useModal");
|
|
6
|
+
Object.defineProperty(exports, "useModal", { enumerable: true, get: function () { return useModal_1.useModal; } });
|
|
7
|
+
var useClickOutside_1 = require("./hooks/useClickOutside");
|
|
8
|
+
Object.defineProperty(exports, "useClickOutside", { enumerable: true, get: function () { return useClickOutside_1.useClickOutside; } });
|
|
9
|
+
exports.default = Modal_1.Modal;
|
|
@@ -1,43 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ModalWithCustomOverlayColor = exports.ModalWithDisabledConfirm = exports.ModalAutoWidth = exports.ModalMediumWidth = exports.ModalMediumLargeWidth = exports.ModalWideWidth = exports.ModalWithCustomLabels = exports.ModalWithoutHeaderAndFooter = exports.ModalWithoutFooter = exports.ModalWithoutHeader = exports.ModalWithCustomBackground = exports.ModalLoading = exports.ModalWithIconInTitle = exports.ModalWithoutCloseButton = exports.ModalWithCloseAndConfirmBtns = exports.ModalTopPosition = exports.MobileFullscreen = exports.Compact = exports.Default = void 0;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
var __1 = __importDefault(require("../"));
|
|
3
9
|
var meta = {
|
|
4
10
|
title: 'Blocks/Modal',
|
|
5
|
-
component:
|
|
11
|
+
component: __1.default,
|
|
6
12
|
tags: ['autodocs'],
|
|
7
13
|
argTypes: {},
|
|
8
14
|
};
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
exports.default = meta;
|
|
16
|
+
exports.Default = {
|
|
11
17
|
args: {
|
|
12
18
|
title: 'Modal default version',
|
|
13
|
-
children:
|
|
19
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed condimentum id eros ac consequat." }),
|
|
14
20
|
variant: 'default',
|
|
15
21
|
},
|
|
16
22
|
};
|
|
17
|
-
|
|
23
|
+
exports.Compact = {
|
|
18
24
|
args: {
|
|
19
25
|
title: 'Modal title',
|
|
20
|
-
children:
|
|
26
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal compact version" }),
|
|
21
27
|
variant: 'compact',
|
|
22
28
|
},
|
|
23
29
|
};
|
|
24
|
-
|
|
30
|
+
exports.MobileFullscreen = {
|
|
25
31
|
args: {
|
|
26
|
-
children:
|
|
32
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Mobile full screen version without title" }),
|
|
27
33
|
variant: 'mobileFullscreen',
|
|
28
34
|
},
|
|
29
35
|
};
|
|
30
|
-
|
|
36
|
+
exports.ModalTopPosition = {
|
|
31
37
|
args: {
|
|
32
38
|
title: 'Modal default version',
|
|
33
|
-
children:
|
|
39
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed condimentum id eros ac consequat." }),
|
|
34
40
|
variant: 'default',
|
|
35
41
|
top: '0',
|
|
36
42
|
},
|
|
37
43
|
};
|
|
38
|
-
|
|
44
|
+
exports.ModalWithCloseAndConfirmBtns = {
|
|
39
45
|
args: {
|
|
40
|
-
children:
|
|
46
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal with narrow width" }),
|
|
41
47
|
title: 'Modal title',
|
|
42
48
|
width: 'narrow',
|
|
43
49
|
withCloseIcon: true,
|
|
@@ -46,60 +52,60 @@ export var ModalWithCloseAndConfirmBtns = {
|
|
|
46
52
|
onExtraAction: undefined,
|
|
47
53
|
},
|
|
48
54
|
};
|
|
49
|
-
|
|
55
|
+
exports.ModalWithoutCloseButton = {
|
|
50
56
|
args: {
|
|
51
57
|
title: 'Note',
|
|
52
|
-
children: (
|
|
58
|
+
children: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur explicabo harum, inventore natus qui repellendus suscipit vitae. Alias aliquam earum et ipsa labore, laboriosam maxime numquam odio recusandae, repellat, voluptas." })),
|
|
53
59
|
width: 'narrow',
|
|
54
60
|
withCloseIcon: false,
|
|
55
61
|
onClose: function () { return console.log('Close'); },
|
|
56
62
|
onConfirm: undefined,
|
|
57
63
|
},
|
|
58
64
|
};
|
|
59
|
-
|
|
65
|
+
exports.ModalWithIconInTitle = {
|
|
60
66
|
args: {
|
|
61
|
-
children:
|
|
67
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal with icon" }),
|
|
62
68
|
title: 'Modal title',
|
|
63
69
|
width: 'narrow',
|
|
64
70
|
titleIcon: 'info',
|
|
65
71
|
},
|
|
66
72
|
};
|
|
67
|
-
|
|
73
|
+
exports.ModalLoading = {
|
|
68
74
|
args: {
|
|
69
|
-
children:
|
|
75
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal with loading" }),
|
|
70
76
|
title: 'Modal title',
|
|
71
77
|
width: 'narrow',
|
|
72
78
|
isLoading: true,
|
|
73
79
|
},
|
|
74
80
|
};
|
|
75
|
-
|
|
81
|
+
exports.ModalWithCustomBackground = {
|
|
76
82
|
args: {
|
|
77
|
-
children:
|
|
83
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal with white background" }),
|
|
78
84
|
title: 'Modal title',
|
|
79
85
|
width: 'narrow',
|
|
80
86
|
background: 'blue',
|
|
81
87
|
},
|
|
82
88
|
};
|
|
83
|
-
|
|
89
|
+
exports.ModalWithoutHeader = {
|
|
84
90
|
args: {
|
|
85
|
-
children:
|
|
91
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "This is content of the Modal without header" }),
|
|
86
92
|
title: 'Modal title',
|
|
87
93
|
width: 'narrow',
|
|
88
94
|
hasHeader: false,
|
|
89
95
|
},
|
|
90
96
|
};
|
|
91
|
-
|
|
97
|
+
exports.ModalWithoutFooter = {
|
|
92
98
|
args: {
|
|
93
|
-
children:
|
|
99
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal without footer" }),
|
|
94
100
|
title: 'Modal title',
|
|
95
101
|
width: 'narrow',
|
|
96
102
|
hasFooter: false,
|
|
97
103
|
onClose: function () { return console.log('Close'); },
|
|
98
104
|
},
|
|
99
105
|
};
|
|
100
|
-
|
|
106
|
+
exports.ModalWithoutHeaderAndFooter = {
|
|
101
107
|
args: {
|
|
102
|
-
children:
|
|
108
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal without header and footer" }),
|
|
103
109
|
title: 'Modal title',
|
|
104
110
|
width: 'narrow',
|
|
105
111
|
hasHeader: false,
|
|
@@ -107,9 +113,9 @@ export var ModalWithoutHeaderAndFooter = {
|
|
|
107
113
|
onClose: function () { return console.log('Close'); },
|
|
108
114
|
},
|
|
109
115
|
};
|
|
110
|
-
|
|
116
|
+
exports.ModalWithCustomLabels = {
|
|
111
117
|
args: {
|
|
112
|
-
children:
|
|
118
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal with custom labels" }),
|
|
113
119
|
title: 'Modal title',
|
|
114
120
|
width: 'narrow',
|
|
115
121
|
onClose: function () { return console.log('Close'); },
|
|
@@ -118,37 +124,37 @@ export var ModalWithCustomLabels = {
|
|
|
118
124
|
cancelLabel: 'Custom cancel',
|
|
119
125
|
},
|
|
120
126
|
};
|
|
121
|
-
|
|
127
|
+
exports.ModalWideWidth = {
|
|
122
128
|
args: {
|
|
123
|
-
children:
|
|
129
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal with wide width" }),
|
|
124
130
|
title: 'Modal title',
|
|
125
131
|
width: 'wide',
|
|
126
132
|
},
|
|
127
133
|
};
|
|
128
|
-
|
|
134
|
+
exports.ModalMediumLargeWidth = {
|
|
129
135
|
args: {
|
|
130
|
-
children:
|
|
136
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal with mediumLarge width" }),
|
|
131
137
|
title: 'Modal title',
|
|
132
138
|
width: 'mediumLarge',
|
|
133
139
|
},
|
|
134
140
|
};
|
|
135
|
-
|
|
141
|
+
exports.ModalMediumWidth = {
|
|
136
142
|
args: {
|
|
137
|
-
children:
|
|
143
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal with medium width" }),
|
|
138
144
|
title: 'Modal title',
|
|
139
145
|
width: 'medium',
|
|
140
146
|
},
|
|
141
147
|
};
|
|
142
|
-
|
|
148
|
+
exports.ModalAutoWidth = {
|
|
143
149
|
args: {
|
|
144
|
-
children:
|
|
150
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal with auto width" }),
|
|
145
151
|
title: 'Modal title',
|
|
146
152
|
width: 'auto',
|
|
147
153
|
},
|
|
148
154
|
};
|
|
149
|
-
|
|
155
|
+
exports.ModalWithDisabledConfirm = {
|
|
150
156
|
args: {
|
|
151
|
-
children:
|
|
157
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal with disabled confirm" }),
|
|
152
158
|
title: 'Modal title',
|
|
153
159
|
width: 'narrow',
|
|
154
160
|
onClose: function () { return console.log('Close'); },
|
|
@@ -156,9 +162,9 @@ export var ModalWithDisabledConfirm = {
|
|
|
156
162
|
isConfirmDisabled: true,
|
|
157
163
|
},
|
|
158
164
|
};
|
|
159
|
-
|
|
165
|
+
exports.ModalWithCustomOverlayColor = {
|
|
160
166
|
args: {
|
|
161
|
-
children:
|
|
167
|
+
children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Modal with custom overlay color" }),
|
|
162
168
|
title: 'Modal title',
|
|
163
169
|
width: 'narrow',
|
|
164
170
|
onClose: function () { return console.log('Close Modal with custom overlay color'); },
|