@mailstep/design-system 0.6.2-beta.3 → 0.6.2-beta.5
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 +5 -4
- package/ui/Blocks/CommonGrid/CommonGrid.js +33 -38
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +28 -33
- package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +8 -10
- package/ui/Blocks/CommonGrid/StandardButtons.js +11 -20
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +21 -26
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +8 -13
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +20 -48
- package/ui/Blocks/CommonGrid/components/ActionHead/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +10 -15
- package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +14 -19
- package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +17 -22
- package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +22 -50
- package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/ColumnTitle.js +8 -13
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +9 -38
- package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/DataCell.js +13 -18
- package/ui/Blocks/CommonGrid/components/DataRow.js +30 -35
- package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +31 -59
- package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +1 -5
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +12 -41
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/FilterDropdown.js +8 -13
- package/ui/Blocks/CommonGrid/components/FilterRow.js +15 -20
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +17 -23
- package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +10 -15
- package/ui/Blocks/CommonGrid/components/GridSelect/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/GroupRow.js +10 -15
- package/ui/Blocks/CommonGrid/components/HeadCell.js +14 -19
- package/ui/Blocks/CommonGrid/components/HeadRow.js +17 -45
- package/ui/Blocks/CommonGrid/components/IconList/IconList.js +12 -18
- package/ui/Blocks/CommonGrid/components/IconList/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +12 -14
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +17 -24
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +23 -28
- package/ui/Blocks/CommonGrid/components/NumberRange/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/NumberRange/types.js +1 -2
- package/ui/Blocks/CommonGrid/components/OversizedScroll.js +11 -39
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +10 -12
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/Resize.js +7 -12
- package/ui/Blocks/CommonGrid/components/Table.js +9 -37
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +12 -40
- package/ui/Blocks/CommonGrid/components/TablePagination/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +30 -36
- package/ui/Blocks/CommonGrid/components/TextRange/index.js +2 -7
- package/ui/Blocks/CommonGrid/components/TextRange/types.js +1 -2
- package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +12 -41
- package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.js +4 -11
- package/ui/Blocks/CommonGrid/components/gridCells/Date.js +6 -13
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +6 -13
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +9 -16
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +8 -15
- package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +8 -15
- package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +9 -16
- package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +3 -9
- package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +11 -18
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +13 -20
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +5 -12
- package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +4 -11
- package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.js +10 -40
- package/ui/Blocks/CommonGrid/components/gridCells/index.js +14 -31
- package/ui/Blocks/CommonGrid/components/icons/Edit.js +3 -5
- package/ui/Blocks/CommonGrid/components/icons/EyeOpen.js +3 -5
- package/ui/Blocks/CommonGrid/components/icons/Sorting.js +3 -8
- package/ui/Blocks/CommonGrid/components/utils.js +3 -7
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.js +6 -10
- package/ui/Blocks/CommonGrid/hooks/useColumnSizes.js +13 -18
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +7 -12
- package/ui/Blocks/CommonGrid/hooks/useFloatingButton.js +3 -5
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +9 -11
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.js +7 -14
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +6 -8
- package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.js +3 -8
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.js +4 -8
- package/ui/Blocks/CommonGrid/hooks/useUxReset.js +4 -9
- package/ui/Blocks/CommonGrid/index.js +10 -51
- package/ui/Blocks/CommonGrid/store/index.js +77 -86
- package/ui/Blocks/CommonGrid/store/migrateState.js +1 -3
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +17 -24
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +12 -19
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +8 -15
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +8 -15
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +8 -15
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +12 -19
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +10 -17
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +12 -19
- package/ui/Blocks/CommonGrid/storybook/utils/actions.js +4 -11
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +11 -17
- package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.js +6 -10
- package/ui/Blocks/CommonGrid/storybook/utils/utils.js +26 -35
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.js +10 -17
- package/ui/Blocks/CommonGrid/storybook/utils/withRouter.js +4 -6
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +1 -3
- package/ui/Blocks/CommonGrid/styles.js +10 -39
- package/ui/Blocks/CommonGrid/translations.js +3 -5
- package/ui/Blocks/CommonGrid/types.js +3 -6
- package/ui/Blocks/CommonGrid/utils/index.js +23 -40
- package/ui/Blocks/CornerDialog/CornerDialog.js +11 -15
- package/ui/Blocks/CornerDialog/index.js +2 -4
- package/ui/Blocks/CornerDialog/stories/CornerDialog.stories.js +7 -10
- package/ui/Blocks/CornerDialog/styles.js +9 -35
- package/ui/Blocks/CornerDialog/types.js +1 -2
- package/ui/Blocks/CornerDialog/utils.js +2 -5
- package/ui/Blocks/HidePrint/HidePrint.js +5 -10
- package/ui/Blocks/ImageList/ImageList.js +15 -42
- package/ui/Blocks/ImageList/components/AddPhoto/index.js +7 -11
- package/ui/Blocks/ImageList/components/AddPhoto/styles.js +3 -29
- package/ui/Blocks/ImageList/components/CloseButton/index.js +5 -9
- package/ui/Blocks/ImageList/components/CloseButton/styles.js +3 -29
- package/ui/Blocks/ImageList/components/ImageElement/index.js +7 -11
- package/ui/Blocks/ImageList/components/ImageElement/styles.js +3 -29
- package/ui/Blocks/ImageList/components/ImageTag/index.js +5 -12
- package/ui/Blocks/ImageList/components/ImageTag/styles.js +2 -8
- package/ui/Blocks/ImageList/index.js +2 -4
- package/ui/Blocks/ImageList/stories/ImageList.stories.js +6 -9
- package/ui/Blocks/ImageList/styles.js +2 -8
- package/ui/Blocks/ImageList/types.js +1 -2
- package/ui/Blocks/LightBox/LightBox.js +8 -15
- package/ui/Blocks/LightBox/hooks/useLightBox.js +5 -9
- package/ui/Blocks/LightBox/index.js +3 -7
- package/ui/Blocks/LightBox/stories/LightBox.stories.js +4 -7
- package/ui/Blocks/LightBox/styles.js +5 -11
- package/ui/Blocks/LightBox/types.js +1 -2
- package/ui/Blocks/Modal/Modal.js +17 -20
- package/ui/Blocks/Modal/hooks/useClickOutside.js +6 -10
- package/ui/Blocks/Modal/hooks/useModal.js +6 -10
- package/ui/Blocks/Modal/index.js +4 -9
- package/ui/Blocks/Modal/stories/Modal.stories.js +42 -48
- package/ui/Blocks/Modal/styles.js +20 -46
- package/ui/Blocks/Modal/types.js +1 -2
- package/ui/Blocks/Modal/utils.js +1 -4
- package/ui/Blocks/Popover/index.js +10 -15
- package/ui/Blocks/Tabs/TabContent.js +1 -5
- package/ui/Blocks/Tabs/Tabs.js +10 -14
- package/ui/Blocks/Tabs/hooks/useTabs.js +4 -8
- package/ui/Blocks/Tabs/index.js +4 -9
- package/ui/Blocks/Tabs/stories/Tabs.stories.js +6 -9
- package/ui/Blocks/Tabs/styles.js +8 -34
- package/ui/Blocks/Tabs/types.js +1 -2
- package/ui/Elements/Alert/Alert.js +10 -12
- package/ui/Elements/Alert/index.js +3 -9
- package/ui/Elements/Alert/stories/Alert.stories.js +11 -14
- package/ui/Elements/Alert/styles.js +14 -20
- package/ui/Elements/Alert/types.js +1 -2
- package/ui/Elements/Avatar/Avatar.js +7 -14
- package/ui/Elements/Avatar/index.js +3 -7
- package/ui/Elements/Avatar/stories/Avatar.stories.js +5 -8
- package/ui/Elements/Avatar/types.js +1 -2
- package/ui/Elements/Badge/Badge.js +13 -38
- package/ui/Elements/Badge/index.js +3 -9
- package/ui/Elements/Badge/stories/Badge.stories.js +5 -11
- package/ui/Elements/BorderedBox/BorderedBox.js +5 -30
- package/ui/Elements/BorderedBox/index.js +3 -9
- package/ui/Elements/BorderedBox/stories/BorderedBox.stories.js +4 -7
- package/ui/Elements/BorderedBox/types.js +1 -2
- package/ui/Elements/Button/Button.js +5 -7
- package/ui/Elements/Button/index.js +3 -9
- package/ui/Elements/Button/stories/Button.stories.js +13 -16
- package/ui/Elements/Button/styles.js +8 -14
- package/ui/Elements/Button/types.js +1 -2
- package/ui/Elements/Card/Card.js +14 -20
- package/ui/Elements/Card/index.js +3 -12
- package/ui/Elements/Card/stories/Card.stories.js +8 -11
- package/ui/Elements/Card/stories/CardComponent.stories.js +6 -12
- package/ui/Elements/Card/styles.js +12 -38
- package/ui/Elements/Card/types.js +1 -2
- package/ui/Elements/DatePicker/DatePicker.js +25 -53
- package/ui/Elements/DatePicker/Datetime/DateTime.js +26 -31
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +20 -47
- package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +3 -6
- package/ui/Elements/DatePicker/Datetime/types.js +1 -2
- package/ui/Elements/DatePicker/Datetime/views/DaysView.js +13 -18
- package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +9 -14
- package/ui/Elements/DatePicker/Datetime/views/YearsView.js +9 -14
- package/ui/Elements/DatePicker/index.js +2 -7
- package/ui/Elements/DatePicker/styles.js +3 -29
- package/ui/Elements/Dropdown/Dropdown.js +10 -15
- package/ui/Elements/Dropdown/index.js +3 -9
- package/ui/Elements/Dropdown/stories/Dropdown.stories.js +4 -10
- package/ui/Elements/Dropdown/types.js +1 -2
- package/ui/Elements/DropdownMenu/DropdownMenu.js +8 -15
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +7 -32
- package/ui/Elements/DropdownMenu/components/MenuItem.js +10 -15
- package/ui/Elements/DropdownMenu/components/MenuList.js +5 -10
- package/ui/Elements/DropdownMenu/index.js +1 -5
- package/ui/Elements/DropdownMenu/types.js +1 -2
- package/ui/Elements/DropdownSelect/DropdownSelect.js +21 -50
- package/ui/Elements/DropdownSelect/index.js +3 -10
- package/ui/Elements/ErrorMessage/ErrorMessage.js +9 -34
- package/ui/Elements/ErrorMessage/index.js +3 -9
- package/ui/Elements/ErrorMessage/stories/ErrorMessage.stories.js +5 -11
- package/ui/Elements/ErrorMessage/types.js +1 -2
- package/ui/Elements/HighlightBox/HighlightBox.js +12 -38
- package/ui/Elements/HighlightBox/index.js +2 -7
- package/ui/Elements/Icon/BadgeIcon.js +10 -17
- package/ui/Elements/Icon/Icon.js +216 -245
- package/ui/Elements/Icon/icons/AddPhoto.js +2 -6
- package/ui/Elements/Icon/icons/BarcodeScan.js +2 -6
- package/ui/Elements/Icon/icons/Box.js +2 -6
- package/ui/Elements/Icon/icons/Calendar.js +2 -6
- package/ui/Elements/Icon/icons/Cancel.js +2 -6
- package/ui/Elements/Icon/icons/CheckedBox.js +2 -6
- package/ui/Elements/Icon/icons/Company.js +2 -6
- package/ui/Elements/Icon/icons/Complaint.js +2 -6
- package/ui/Elements/Icon/icons/Consolidation.js +2 -6
- package/ui/Elements/Icon/icons/Dispatch.js +2 -6
- package/ui/Elements/Icon/icons/EmptyRack.js +2 -6
- package/ui/Elements/Icon/icons/Expeditions.js +2 -6
- package/ui/Elements/Icon/icons/FlagCZ.js +2 -6
- package/ui/Elements/Icon/icons/FlagEL.js +2 -6
- package/ui/Elements/Icon/icons/FlagESP.js +2 -6
- package/ui/Elements/Icon/icons/FlagITA.js +2 -6
- package/ui/Elements/Icon/icons/FlagRUS.js +2 -6
- package/ui/Elements/Icon/icons/FlagSVK.js +2 -6
- package/ui/Elements/Icon/icons/FlagUSA.js +2 -6
- package/ui/Elements/Icon/icons/Gift.js +2 -6
- package/ui/Elements/Icon/icons/Group.js +2 -6
- package/ui/Elements/Icon/icons/HamburgerMenu.js +2 -6
- package/ui/Elements/Icon/icons/HelpCircle1.js +2 -6
- package/ui/Elements/Icon/icons/ImagePlaceholder.js +2 -6
- package/ui/Elements/Icon/icons/Income.js +2 -6
- package/ui/Elements/Icon/icons/Info.js +2 -6
- package/ui/Elements/Icon/icons/Integrations.js +2 -6
- package/ui/Elements/Icon/icons/Inventory.js +2 -6
- package/ui/Elements/Icon/icons/Inventory2.js +2 -6
- package/ui/Elements/Icon/icons/Link.js +2 -6
- package/ui/Elements/Icon/icons/Location.js +2 -6
- package/ui/Elements/Icon/icons/Logout1.js +2 -6
- package/ui/Elements/Icon/icons/MakePhoto.js +2 -6
- package/ui/Elements/Icon/icons/MenuItems.js +2 -6
- package/ui/Elements/Icon/icons/MobileCancel.js +2 -6
- package/ui/Elements/Icon/icons/Notification2.js +2 -6
- package/ui/Elements/Icon/icons/OpenBox.js +2 -6
- package/ui/Elements/Icon/icons/Plus1.js +2 -6
- package/ui/Elements/Icon/icons/Print.js +2 -6
- package/ui/Elements/Icon/icons/Product.js +2 -6
- package/ui/Elements/Icon/icons/Products.js +2 -6
- package/ui/Elements/Icon/icons/Profile.js +2 -6
- package/ui/Elements/Icon/icons/Puzzle1.js +2 -6
- package/ui/Elements/Icon/icons/QRCode.js +2 -6
- package/ui/Elements/Icon/icons/Rack.js +2 -6
- package/ui/Elements/Icon/icons/Return.js +2 -6
- package/ui/Elements/Icon/icons/Rows.js +2 -6
- package/ui/Elements/Icon/icons/Settings2.js +2 -6
- package/ui/Elements/Icon/icons/ShoppingBag.js +2 -6
- package/ui/Elements/Icon/icons/ThreeDots.js +2 -6
- package/ui/Elements/Icon/icons/Transfer.js +2 -6
- package/ui/Elements/Icon/icons/Truck.js +2 -6
- package/ui/Elements/Icon/icons/TwoBoxes.js +2 -6
- package/ui/Elements/Icon/icons/TwoCheckedBoxes.js +2 -6
- package/ui/Elements/Icon/icons/TwoUsers.js +2 -6
- package/ui/Elements/Icon/icons/index.js +55 -114
- package/ui/Elements/Icon/index.js +5 -26
- package/ui/Elements/Icon/stories/BadgeIcon.stories.js +6 -12
- package/ui/Elements/Icon/stories/Icon.stories.js +9 -12
- package/ui/Elements/Icon/types.js +1 -2
- package/ui/Elements/Image/Image.js +4 -6
- package/ui/Elements/Image/index.js +3 -9
- package/ui/Elements/Image/stories/Image.stories.js +9 -15
- package/ui/Elements/Image/types.js +1 -2
- package/ui/Elements/Label/Label.js +9 -35
- package/ui/Elements/Label/index.js +3 -8
- package/ui/Elements/Label/stories/Label.stories.js +5 -8
- package/ui/Elements/Line/Line.js +5 -10
- package/ui/Elements/Line/index.js +3 -9
- package/ui/Elements/Line/stories/Line.stories.js +10 -16
- package/ui/Elements/Line/types.js +1 -2
- package/ui/Elements/Link/Link.js +14 -39
- package/ui/Elements/Link/index.js +3 -9
- package/ui/Elements/Link/stories/Link.stories.js +10 -13
- package/ui/Elements/Logo/Logo.js +25 -30
- package/ui/Elements/Logo/index.js +3 -9
- package/ui/Elements/Logo/stories/Logo.stories.js +18 -24
- package/ui/Elements/Logo/types.js +1 -2
- package/ui/Elements/MultiSelect/MultiSelect.js +4 -9
- package/ui/Elements/MultiSelect/index.js +2 -7
- package/ui/Elements/Pagination/Pagination.js +7 -9
- package/ui/Elements/Pagination/index.js +3 -9
- package/ui/Elements/Pagination/stories/Pagination.stories.js +5 -8
- package/ui/Elements/Pagination/styled.js +12 -41
- package/ui/Elements/Portal/index.js +7 -14
- package/ui/Elements/ProgressBar/ProgressBar.js +4 -6
- package/ui/Elements/ProgressBar/index.js +3 -9
- package/ui/Elements/ProgressBar/stories/ProgressBar.stories.js +6 -12
- package/ui/Elements/ProgressBar/styles.js +12 -38
- package/ui/Elements/Select/Select.js +20 -25
- package/ui/Elements/Select/index.js +2 -7
- package/ui/Elements/Select/styles.js +7 -13
- package/ui/Elements/Select/themes/CustomComponents.js +37 -72
- package/ui/Elements/Select/themes/baseStyles.js +6 -12
- package/ui/Elements/Select/themes/formStyles.js +23 -27
- package/ui/Elements/Select/themes/index.js +16 -20
- package/ui/Elements/Select/types.js +1 -2
- package/ui/Elements/SimpleLink/SimpleLink.js +6 -31
- package/ui/Elements/SimpleLink/index.js +3 -9
- package/ui/Elements/SingleSelect/SingleSelect.js +27 -32
- package/ui/Elements/SingleSelect/index.js +2 -7
- package/ui/Elements/SpaceAround/SpaceAround.js +11 -36
- package/ui/Elements/SpaceAround/index.js +3 -9
- package/ui/Elements/SpaceAround/stories/SpaceAround.stories.js +5 -8
- package/ui/Elements/SpaceAround/types.js +1 -2
- package/ui/Elements/Spinner/Spinner.js +8 -12
- package/ui/Elements/Spinner/index.js +3 -9
- package/ui/Elements/Spinner/stories/Spinner.stories.js +13 -16
- package/ui/Elements/Spinner/styles.js +7 -33
- package/ui/Elements/Spinner/types.js +1 -2
- package/ui/Elements/Tag/Tag.js +6 -31
- package/ui/Elements/Tag/index.js +3 -10
- package/ui/Elements/Tag/palletes.js +1 -4
- package/ui/Elements/Tag/stories/Tag.stories.js +15 -21
- package/ui/Elements/Tag/stories/components/predefinedTags.js +6 -11
- package/ui/Elements/Tag/types.js +1 -2
- package/ui/Elements/Text/Text.js +4 -6
- package/ui/Elements/Text/index.js +2 -8
- package/ui/Elements/Text/stories/Text.stories.js +9 -15
- package/ui/Elements/Text/types.js +1 -2
- package/ui/Elements/Toast/Toast.js +10 -15
- package/ui/Elements/Toast/index.js +3 -9
- package/ui/Elements/Toggle/Toggle.js +13 -38
- package/ui/Elements/Toggle/index.js +3 -9
- package/ui/Elements/Toggle/stories/Toggle.stories.js +7 -13
- package/ui/Elements/Toggle/types.js +1 -2
- package/ui/Elements/Typography/Typography.js +28 -44
- package/ui/Elements/Typography/index.js +3 -19
- package/ui/Elements/Typography/stories/Typography.stories.js +15 -18
- package/ui/Forms/Checkbox/Checkbox.js +9 -11
- package/ui/Forms/Checkbox/index.js +3 -9
- package/ui/Forms/Checkbox/stories/Checkbox.stories.js +7 -13
- package/ui/Forms/Checkbox/styles.js +6 -32
- package/ui/Forms/Checkbox/types.js +1 -2
- package/ui/Forms/Input/Input.js +16 -20
- package/ui/Forms/Input/index.js +3 -6
- package/ui/Forms/Input/stories/Input.stories.js +11 -14
- package/ui/Forms/Input/styles.js +20 -46
- package/ui/Forms/Input/types.js +1 -2
- package/ui/Forms/RadioButton/RadioButton.js +6 -8
- package/ui/Forms/RadioButton/index.js +3 -9
- package/ui/Forms/RadioButton/stories/RadioButton.stories.js +7 -13
- package/ui/Forms/RadioButton/styles.js +7 -13
- package/ui/Forms/RadioButton/types.js +1 -2
- package/ui/Forms/TextArea/TextArea.js +8 -13
- package/ui/Forms/TextArea/index.js +2 -7
- package/ui/Forms/TextArea/styles.js +13 -39
- package/ui/System/Fonts/index.js +9 -14
- package/ui/ThemeProvider/ThemeProvider.js +7 -13
- package/ui/ThemeProvider/index.js +5 -25
- package/ui/ThemeProvider/themes/default.js +1 -3
- package/ui/ThemeProvider/themes/index.js +7 -12
- package/ui/ThemeProvider/themes/light.js +1 -3
- package/ui/ThemeProvider/themes/mailwise.js +1 -3
- package/ui/ThemeProvider/types.js +1 -2
- package/ui/index.es.js +19551 -23227
- package/ui/index.js +85 -146
- package/ui/index.umd.js +484 -510
- package/ui/utils/CreateRgba/createRgba.js +5 -12
- package/ui/utils/CreateRgba/types.js +1 -2
- package/ui/utils/KeyPress/KeyPress.js +4 -6
- package/ui/utils/KeyPress/KeyPress.stories.js +6 -12
- package/ui/utils/KeyPress/index.js +2 -7
- package/ui/utils/KeyPress/types.js +1 -2
- package/ui/utils/index.js +6 -13
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10,12 +9,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
9
|
};
|
|
11
10
|
return __assign.apply(this, arguments);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var baseStyles_1 = require("./baseStyles");
|
|
16
|
-
var system_1 = require("@xstyled/system");
|
|
12
|
+
import { baseStylesConfig } from './baseStyles.js';
|
|
13
|
+
import { th } from '@xstyled/system';
|
|
17
14
|
// style object https://react-select.com/styles
|
|
18
|
-
|
|
15
|
+
export var CustomStyles = __assign(__assign({}, baseStylesConfig), { control: function (styles, _a) {
|
|
19
16
|
var _b;
|
|
20
17
|
var selectProps = _a.selectProps, theme = _a.theme, isFocused = _a.isFocused, isDisabled = _a.isDisabled;
|
|
21
18
|
var colors = theme.colors;
|
|
@@ -31,7 +28,7 @@ exports.CustomStyles = __assign(__assign({}, baseStyles_1.baseStylesConfig), { c
|
|
|
31
28
|
}, multiValue: function (styles, state) {
|
|
32
29
|
var _a;
|
|
33
30
|
var theme = state.theme;
|
|
34
|
-
var base = (_a =
|
|
31
|
+
var base = (_a = baseStylesConfig.multiValue) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
35
32
|
return __assign(__assign({}, base), { fontSize: '9px', fontWeight: theme.textWeightSemiBold });
|
|
36
33
|
}, multiValueRemove: function (styles, _a) {
|
|
37
34
|
var _b;
|
|
@@ -40,7 +37,7 @@ exports.CustomStyles = __assign(__assign({}, baseStyles_1.baseStylesConfig), { c
|
|
|
40
37
|
}, placeholder: function (styles, state) {
|
|
41
38
|
var _a;
|
|
42
39
|
var theme = state.theme;
|
|
43
|
-
var base = (_a =
|
|
40
|
+
var base = (_a = baseStylesConfig.placeholder) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
44
41
|
return __assign(__assign({}, base), { fontSize: '14px', fontWeight: theme.textWeightSemiBold });
|
|
45
42
|
}, option: function (styles, _a) {
|
|
46
43
|
var isSelected = _a.isSelected, theme = _a.theme, isDisabled = _a.isDisabled, selectProps = _a.selectProps;
|
|
@@ -60,47 +57,46 @@ exports.CustomStyles = __assign(__assign({}, baseStyles_1.baseStylesConfig), { c
|
|
|
60
57
|
marginRight: '4px',
|
|
61
58
|
marginBottom: '2px',
|
|
62
59
|
lineHeight: '22px',
|
|
63
|
-
borderRadius:
|
|
60
|
+
borderRadius: th.radius('ml')({ theme: selectProps === null || selectProps === void 0 ? void 0 : selectProps.systemTheme }),
|
|
64
61
|
'&:hover': { backgroundColor: !isDisabled ? theme.colors.menuHoverBackgroundColor : undefined },
|
|
65
62
|
};
|
|
66
63
|
}, menu: function (styles, state) {
|
|
67
64
|
var _a;
|
|
68
|
-
var base = (_a =
|
|
65
|
+
var base = (_a = baseStylesConfig.menu) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
69
66
|
return __assign(__assign({}, base), { boxShadow: '0 2px 20px 0 rgba(0, 0, 0, 0.10);', marginTop: '-0', paddingTop: '0', borderRadius: '10px', zIndex: 3 });
|
|
70
67
|
}, dropdownIndicator: function (styles, state) {
|
|
71
68
|
var _a;
|
|
72
|
-
var base = (_a =
|
|
69
|
+
var base = (_a = baseStylesConfig.dropdownIndicator) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
73
70
|
var theme = state.theme, isFocused = state.isFocused;
|
|
74
71
|
return __assign(__assign({}, base), { color: isFocused ? theme.colors.inputTextColor : theme.colors.dropdownIndicatorColor, padding: '0px 5px 0px 0px', '@media (min-width: 1024px)': {
|
|
75
72
|
padding: '0px 5px 0px 1px',
|
|
76
73
|
} });
|
|
77
74
|
}, clearIndicator: function (styles, state) {
|
|
78
75
|
var _a;
|
|
79
|
-
var base = (_a =
|
|
76
|
+
var base = (_a = baseStylesConfig.clearIndicator) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
80
77
|
var theme = state.theme;
|
|
81
78
|
return __assign(__assign({}, base), { padding: theme.narrowIndicators ? '0px 0px 0px 2px' : '0px 4px' });
|
|
82
79
|
},
|
|
83
80
|
// invisible indicator separator
|
|
84
81
|
indicatorSeparator: function () { return ({ display: 'none' }); } });
|
|
85
|
-
var getCustomTheme = function (theme, optionVariant, useFilterSubvariant) {
|
|
86
|
-
var inputTextColor =
|
|
82
|
+
export var getCustomTheme = function (theme, optionVariant, useFilterSubvariant) {
|
|
83
|
+
var inputTextColor = th.color('blue2')({ theme: theme });
|
|
87
84
|
var customColors = {
|
|
88
|
-
primary:
|
|
85
|
+
primary: th.color('red1')({ theme: theme }),
|
|
89
86
|
inputTextColor: inputTextColor,
|
|
90
|
-
valueTextColor:
|
|
91
|
-
placeholderTextColor:
|
|
92
|
-
optionTextColor:
|
|
93
|
-
inputDisabledColor:
|
|
87
|
+
valueTextColor: th.color('gray')({ theme: theme }),
|
|
88
|
+
placeholderTextColor: th.color('lightGray3')({ theme: theme }),
|
|
89
|
+
optionTextColor: th.color('blue2')({ theme: theme }),
|
|
90
|
+
inputDisabledColor: th.color('lightGray1')({ theme: theme }),
|
|
94
91
|
inputBackgroundColor: "white",
|
|
95
|
-
inputBorderColor:
|
|
96
|
-
inputBorderHoverColor:
|
|
97
|
-
activeOptionBackground:
|
|
98
|
-
menuBackgroundColor:
|
|
99
|
-
menuHoverBackgroundColor:
|
|
100
|
-
dropdownIndicatorColor:
|
|
92
|
+
inputBorderColor: th.color('lightGray3')({ theme: theme }),
|
|
93
|
+
inputBorderHoverColor: th.color('gray5')({ theme: theme }),
|
|
94
|
+
activeOptionBackground: th.color('red20')({ theme: theme }),
|
|
95
|
+
menuBackgroundColor: th.color('white')({ theme: theme }),
|
|
96
|
+
menuHoverBackgroundColor: th.color('bgLightGray1')({ theme: theme }),
|
|
97
|
+
dropdownIndicatorColor: th.color('gray1')({ theme: theme }),
|
|
101
98
|
};
|
|
102
99
|
return function (reactSelectTheme) {
|
|
103
|
-
return __assign(__assign({}, reactSelectTheme), { colors: customColors, focusBoxShadow: null, height: useFilterSubvariant ? '32px' : '38px', textWeightRegular:
|
|
100
|
+
return __assign(__assign({}, reactSelectTheme), { colors: customColors, focusBoxShadow: null, height: useFilterSubvariant ? '32px' : '38px', textWeightRegular: th.fontWeight('regular')({ theme: theme }), textWeightSemiBold: th.fontWeight('semiBold')({ theme: theme }), textWeightBold: th.fontWeight('bold')({ theme: theme }), optionVariant: optionVariant, borderRadius: th.radius('lg')({ theme: theme }), font: th.font('primary')({ theme: theme }), narrowIndicators: !!useFilterSubvariant });
|
|
104
101
|
};
|
|
105
102
|
};
|
|
106
|
-
exports.getCustomTheme = getCustomTheme;
|
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var styled_components_1 = require("@xstyled/styled-components");
|
|
7
|
-
var react_1 = require("react");
|
|
8
|
-
var useStylesAndComponents = function (style, optionVariant, multiLabelVariant, containerVariant, useSimplifiedOptions, showSelectAllButton, showResetGridButton) {
|
|
1
|
+
import { SimplifiedOption, IconValueContainer, CountMultiValue, ChevronOption, DropdownIndicator, CustomInput, ConnectedMenu, } from './CustomComponents.js';
|
|
2
|
+
import { getCustomTheme as getFormCustomTheme, CustomStyles as FormCustomStyles } from './formStyles.js';
|
|
3
|
+
import { useTheme } from '@xstyled/styled-components';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
export var useStylesAndComponents = function (style, optionVariant, multiLabelVariant, containerVariant, useSimplifiedOptions, showSelectAllButton, showResetGridButton) {
|
|
9
6
|
if (style === void 0) { style = 'form'; }
|
|
10
7
|
if (optionVariant === void 0) { optionVariant = 'default'; }
|
|
11
8
|
if (multiLabelVariant === void 0) { multiLabelVariant = 'default'; }
|
|
12
9
|
if (containerVariant === void 0) { containerVariant = 'default'; }
|
|
13
|
-
var systemTheme =
|
|
14
|
-
return
|
|
10
|
+
var systemTheme = useTheme();
|
|
11
|
+
return useMemo(function () {
|
|
15
12
|
var components = {
|
|
16
|
-
ValueContainer:
|
|
13
|
+
ValueContainer: IconValueContainer,
|
|
17
14
|
};
|
|
18
15
|
if (multiLabelVariant === 'count') {
|
|
19
|
-
components.MultiValue =
|
|
16
|
+
components.MultiValue = CountMultiValue;
|
|
20
17
|
}
|
|
21
18
|
if (containerVariant === 'search') {
|
|
22
19
|
components.DropdownIndicator = null;
|
|
23
20
|
}
|
|
24
21
|
if (showResetGridButton || showSelectAllButton) {
|
|
25
|
-
components.Menu =
|
|
22
|
+
components.Menu = ConnectedMenu;
|
|
26
23
|
}
|
|
27
|
-
components.Input =
|
|
28
|
-
var themes = (
|
|
29
|
-
var styles =
|
|
30
|
-
components.Option =
|
|
31
|
-
components.DropdownIndicator =
|
|
24
|
+
components.Input = CustomInput;
|
|
25
|
+
var themes = getFormCustomTheme(systemTheme, optionVariant, style == 'gridFilter');
|
|
26
|
+
var styles = FormCustomStyles;
|
|
27
|
+
components.Option = ChevronOption;
|
|
28
|
+
components.DropdownIndicator = DropdownIndicator;
|
|
32
29
|
// performance reasons
|
|
33
30
|
if (useSimplifiedOptions)
|
|
34
|
-
components.Option =
|
|
31
|
+
components.Option = SimplifiedOption;
|
|
35
32
|
return [components, themes, styles];
|
|
36
33
|
}, [
|
|
37
34
|
multiLabelVariant,
|
|
@@ -44,4 +41,3 @@ var useStylesAndComponents = function (style, optionVariant, multiLabelVariant,
|
|
|
44
41
|
optionVariant,
|
|
45
42
|
]);
|
|
46
43
|
};
|
|
47
|
-
exports.useStylesAndComponents = useStylesAndComponents;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,42 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
3
|
return cooked;
|
|
5
4
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
var react_router_dom_1 = require("react-router-dom");
|
|
31
|
-
var styled_components_1 = __importStar(require("@xstyled/styled-components"));
|
|
32
|
-
var StyledLink = (0, styled_components_1.default)(react_router_dom_1.Link)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: inherit;\n cursor: pointer;\n\n :visited {\n color: inherit;\n }\n :hover {\n color: inherit;\n }\n :active {\n color: inherit;\n }\n :focus {\n outline: none;\n }\n\n ", "\n\n ", "\n"], ["\n color: inherit;\n cursor: pointer;\n\n :visited {\n color: inherit;\n }\n :hover {\n color: inherit;\n }\n :active {\n color: inherit;\n }\n :focus {\n outline: none;\n }\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
5
|
+
import { Link as ReactLink } from 'react-router-dom';
|
|
6
|
+
import styled, { css } from '@xstyled/styled-components';
|
|
7
|
+
var StyledLink = styled(ReactLink)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: inherit;\n cursor: pointer;\n\n :visited {\n color: inherit;\n }\n :hover {\n color: inherit;\n }\n :active {\n color: inherit;\n }\n :focus {\n outline: none;\n }\n\n ", "\n\n ", "\n"], ["\n color: inherit;\n cursor: pointer;\n\n :visited {\n color: inherit;\n }\n :hover {\n color: inherit;\n }\n :active {\n color: inherit;\n }\n :focus {\n outline: none;\n }\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
33
8
|
var disabled = _a.disabled;
|
|
34
9
|
return disabled
|
|
35
|
-
?
|
|
10
|
+
? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n pointer-events: none;\n opacity: 0.5;\n "], ["\n pointer-events: none;\n opacity: 0.5;\n "]))) : null;
|
|
36
11
|
}, function (_a) {
|
|
37
12
|
var $decorate = _a.$decorate;
|
|
38
13
|
return $decorate
|
|
39
|
-
?
|
|
14
|
+
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n text-decoration: underline;\n "], ["\n text-decoration: underline;\n "]))) : null;
|
|
40
15
|
});
|
|
41
|
-
|
|
16
|
+
export default StyledLink;
|
|
42
17
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SimpleLink = void 0;
|
|
7
|
-
var SimpleLink_1 = __importDefault(require("./SimpleLink"));
|
|
8
|
-
exports.SimpleLink = SimpleLink_1.default;
|
|
9
|
-
exports.default = SimpleLink_1.default;
|
|
1
|
+
import SimpleLink from './SimpleLink.js';
|
|
2
|
+
export { SimpleLink };
|
|
3
|
+
export default SimpleLink;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -55,19 +54,15 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
55
54
|
}
|
|
56
55
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
57
56
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
var
|
|
67
|
-
var nanoid_1 = require("nanoid");
|
|
68
|
-
var core_1 = require("@lingui/core");
|
|
69
|
-
var CREATE = "_create_".concat((0, nanoid_1.nanoid)(), "_");
|
|
70
|
-
var defaultFilterOption = (0, react_select_1.createFilter)();
|
|
57
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
58
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
59
|
+
import { createFilter } from 'react-select';
|
|
60
|
+
import Select from '../Select/index.js';
|
|
61
|
+
import omit from 'lodash/fp/omit';
|
|
62
|
+
import { nanoid } from 'nanoid';
|
|
63
|
+
import { i18n } from '@lingui/core';
|
|
64
|
+
var CREATE = "_create_".concat(nanoid(), "_");
|
|
65
|
+
var defaultFilterOption = createFilter();
|
|
71
66
|
var creatableFilterOption = function (option, rawInput) {
|
|
72
67
|
if ((option === null || option === void 0 ? void 0 : option.value) == CREATE)
|
|
73
68
|
return true;
|
|
@@ -84,27 +79,27 @@ var getOptionValue = function (selectedOption) {
|
|
|
84
79
|
return selectedOption.value;
|
|
85
80
|
}
|
|
86
81
|
};
|
|
87
|
-
var loadingMessage = function () { return
|
|
82
|
+
var loadingMessage = function () { return i18n._({ id: 'components.dropdown.loading', message: 'Loading...' }); };
|
|
88
83
|
var SingleSelect = function (props) {
|
|
89
|
-
var name = props.name, onChange = props.onChange, onBlur = props.onBlur, onValueChange = props.onValueChange, loadOptions = props.loadOptions, _a = props.asyncLoadMinChars, asyncLoadMinChars = _a === void 0 ? 0 : _a, isLocked = props.isLocked, _b = props.lockedText, lockedText = _b === void 0 ?
|
|
90
|
-
var _d =
|
|
84
|
+
var name = props.name, onChange = props.onChange, onBlur = props.onBlur, onValueChange = props.onValueChange, loadOptions = props.loadOptions, _a = props.asyncLoadMinChars, asyncLoadMinChars = _a === void 0 ? 0 : _a, isLocked = props.isLocked, _b = props.lockedText, lockedText = _b === void 0 ? i18n._({ id: 'components.dropdown.notReact', message: 'Select related values first...' }) : _b, disabled = props.disabled, _c = props.placeholder, placeholder = _c === void 0 ? i18n._({ id: 'components.dropdown.placeholder', message: 'Select...' }) : _c, preload = props.preload, initialOptions = props.initialOptions, onCreateOption = props.onCreateOption, options = props.options, filterOption = props.filterOption;
|
|
85
|
+
var _d = useState(false), isCreating = _d[0], setIsCreating = _d[1];
|
|
91
86
|
var asAsync = !!loadOptions || !!onCreateOption;
|
|
92
|
-
var noOptionsMessage =
|
|
87
|
+
var noOptionsMessage = useCallback(function (inputValue) {
|
|
93
88
|
return loadOptions && inputValue.length < asyncLoadMinChars
|
|
94
|
-
?
|
|
89
|
+
? i18n._({
|
|
95
90
|
id: 'components.dropdown.writeMoreChars',
|
|
96
91
|
message: 'Write at least ${asyncLoadMinChars} characters.',
|
|
97
92
|
})
|
|
98
|
-
:
|
|
93
|
+
: i18n._({ id: 'components.dropdown.noOptions', message: 'No options' });
|
|
99
94
|
}, [loadOptions, asyncLoadMinChars]);
|
|
100
|
-
var handleLoadOptions =
|
|
95
|
+
var handleLoadOptions = useCallback(function (inputValue) {
|
|
101
96
|
if (onCreateOption) {
|
|
102
97
|
if (!inputValue.trim())
|
|
103
98
|
return Promise.resolve(options || []);
|
|
104
99
|
return Promise.resolve(__spreadArray(__spreadArray([], (options || []), true), [
|
|
105
100
|
{
|
|
106
101
|
value: CREATE,
|
|
107
|
-
label: "".concat(inputValue, " (").concat(
|
|
102
|
+
label: "".concat(inputValue, " (").concat(i18n._({ id: 'components.dropdown.newOption', message: 'new value' }), ")"),
|
|
108
103
|
inputValue: inputValue,
|
|
109
104
|
},
|
|
110
105
|
], false));
|
|
@@ -116,14 +111,14 @@ var SingleSelect = function (props) {
|
|
|
116
111
|
return loadOptions(inputValue, false);
|
|
117
112
|
}
|
|
118
113
|
}, [onCreateOption, loadOptions, asyncLoadMinChars, options]);
|
|
119
|
-
var _e =
|
|
120
|
-
|
|
114
|
+
var _e = useState(options || []), loadedDefaultOptions = _e[0], setLoadedDefaultOptions = _e[1];
|
|
115
|
+
useEffect(function () {
|
|
121
116
|
if (loadOptions && preload && !props.value)
|
|
122
117
|
loadOptions('', false).then(setLoadedDefaultOptions);
|
|
123
118
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
124
119
|
}, [loadOptions]); // this is intentional
|
|
125
|
-
var _f =
|
|
126
|
-
|
|
120
|
+
var _f = useState(null), storedSelectedOption = _f[0], setStoredSelectedOption = _f[1];
|
|
121
|
+
useEffect(function () {
|
|
127
122
|
if (initialOptions && initialOptions.length) {
|
|
128
123
|
var selectedOption = initialOptions.find(function (option) { return option.value == props.value; }) || null;
|
|
129
124
|
setStoredSelectedOption(selectedOption);
|
|
@@ -134,7 +129,7 @@ var SingleSelect = function (props) {
|
|
|
134
129
|
// ignored because of props.value, this only finds option for initial value
|
|
135
130
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
136
131
|
}, [initialOptions, setStoredSelectedOption]);
|
|
137
|
-
var handleChange =
|
|
132
|
+
var handleChange = useCallback(function (option) { return __awaiter(void 0, void 0, void 0, function () {
|
|
138
133
|
var value, newOption;
|
|
139
134
|
var _a, _b, _c, _d;
|
|
140
135
|
return __generator(this, function (_e) {
|
|
@@ -143,7 +138,7 @@ var SingleSelect = function (props) {
|
|
|
143
138
|
if (!(onCreateOption && (option === null || option === void 0 ? void 0 : option.value) == CREATE)) return [3 /*break*/, 4];
|
|
144
139
|
if (!((option === null || option === void 0 ? void 0 : option.inputValue) && ((_b = (_a = option === null || option === void 0 ? void 0 : option.inputValue) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.length) < 2)) return [3 /*break*/, 1];
|
|
145
140
|
props === null || props === void 0 ? void 0 : props.form.setFieldTouched(name, true, true);
|
|
146
|
-
props === null || props === void 0 ? void 0 : props.form.setFieldError(name,
|
|
141
|
+
props === null || props === void 0 ? void 0 : props.form.setFieldError(name, i18n._({ id: 'form.general.min2Chars', message: 'Minimal length is 2 characters.' }));
|
|
147
142
|
return [2 /*return*/];
|
|
148
143
|
case 1:
|
|
149
144
|
setIsCreating(true);
|
|
@@ -175,7 +170,7 @@ var SingleSelect = function (props) {
|
|
|
175
170
|
}
|
|
176
171
|
});
|
|
177
172
|
}); }, [onCreateOption, loadOptions, onChange, onValueChange, props === null || props === void 0 ? void 0 : props.form, name]);
|
|
178
|
-
var handleBlur =
|
|
173
|
+
var handleBlur = useCallback(function (option) {
|
|
179
174
|
if (onBlur) {
|
|
180
175
|
onBlur({
|
|
181
176
|
target: {
|
|
@@ -189,7 +184,7 @@ var SingleSelect = function (props) {
|
|
|
189
184
|
var omitted = ['onValueChange', 'placeholder', 'options', 'loadOptions', 'asyncLoadMinChars'];
|
|
190
185
|
var displayLockedText = isLocked && !disabled;
|
|
191
186
|
var placeholderValue = displayLockedText ? lockedText : placeholder;
|
|
192
|
-
var defaultOptions =
|
|
187
|
+
var defaultOptions = useMemo(function () {
|
|
193
188
|
if (!asAsync)
|
|
194
189
|
return undefined; // relates only to asAsync true
|
|
195
190
|
var staticOptions = onCreateOption ? options : loadedDefaultOptions;
|
|
@@ -197,6 +192,6 @@ var SingleSelect = function (props) {
|
|
|
197
192
|
return staticOptions || undefined;
|
|
198
193
|
return staticOptions ? __spreadArray(__spreadArray([], staticOptions, true), [storedSelectedOption], false) : [storedSelectedOption];
|
|
199
194
|
}, [asAsync, loadedDefaultOptions, onCreateOption, options, storedSelectedOption]);
|
|
200
|
-
return ((
|
|
195
|
+
return (_jsx(Select, __assign({}, omit(omitted, props), { filterOption: (filterOption || creatableFilterOption), disabled: disabled || isLocked, onChange: handleChange, onBlur: handleBlur, placeholder: placeholderValue, loadingMessage: loadingMessage, noOptionsMessage: noOptionsMessage, loadOptions: asAsync ? handleLoadOptions : undefined, containerVariant: asAsync ? 'search' : undefined, defaultOptions: defaultOptions, options: !asAsync ? options : undefined, isLoading: isCreating || props.isLoading })));
|
|
201
196
|
};
|
|
202
|
-
|
|
197
|
+
export default SingleSelect;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var SingleSelect_1 = __importDefault(require("./SingleSelect"));
|
|
7
|
-
exports.default = SingleSelect_1.default;
|
|
1
|
+
import SingleSelect from './SingleSelect.js';
|
|
2
|
+
export default SingleSelect;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
3
|
return cooked;
|
|
@@ -14,29 +13,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
13
|
};
|
|
15
14
|
return __assign.apply(this, arguments);
|
|
16
15
|
};
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
16
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
41
17
|
var t = {};
|
|
42
18
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -48,17 +24,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
48
24
|
}
|
|
49
25
|
return t;
|
|
50
26
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var
|
|
55
|
-
var Wrapper = (0, styled_components_1.default)(styled_components_1.x.div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", ";\n position: relative;\n box-sizing: border-box;\n ", ";\n ", ";\n"], ["\n width: ", ";\n position: relative;\n box-sizing: border-box;\n ", ";\n ", ";\n"])), function (_a) {
|
|
27
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
import styled, { x, css, useTheme } from '@xstyled/styled-components';
|
|
29
|
+
import { th } from '@xstyled/styled-components';
|
|
30
|
+
var Wrapper = styled(x.div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", ";\n position: relative;\n box-sizing: border-box;\n ", ";\n ", ";\n"], ["\n width: ", ";\n position: relative;\n box-sizing: border-box;\n ", ";\n ", ";\n"])), function (_a) {
|
|
56
31
|
var $marginLeft = _a.$marginLeft, $marginRight = _a.$marginRight;
|
|
57
32
|
return "calc(100% - ".concat($marginLeft || '0px', " - ").concat($marginRight || '0px', ")");
|
|
58
33
|
}, function (_a) {
|
|
59
34
|
var $spaceAround = _a.$spaceAround;
|
|
60
35
|
return $spaceAround
|
|
61
|
-
?
|
|
36
|
+
? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n "], ["\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n "])), $spaceAround === true || typeof ($spaceAround === null || $spaceAround === void 0 ? void 0 : $spaceAround.marginTop) === 'undefined' ? 1 : $spaceAround.marginTop, $spaceAround === true || typeof ($spaceAround === null || $spaceAround === void 0 ? void 0 : $spaceAround.marginRight) === 'undefined'
|
|
62
37
|
? 1
|
|
63
38
|
: $spaceAround.marginRight, $spaceAround === true || typeof ($spaceAround === null || $spaceAround === void 0 ? void 0 : $spaceAround.marginBottom) === 'undefined'
|
|
64
39
|
? 2
|
|
@@ -66,14 +41,14 @@ var Wrapper = (0, styled_components_1.default)(styled_components_1.x.div)(templa
|
|
|
66
41
|
}, function (_a) {
|
|
67
42
|
var $spaceBetween = _a.$spaceBetween;
|
|
68
43
|
return $spaceBetween
|
|
69
|
-
?
|
|
44
|
+
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n "], ["\n display: flex;\n justify-content: space-between;\n "]))) : '';
|
|
70
45
|
});
|
|
71
46
|
var SpaceAroundWrap = function (_a) {
|
|
72
47
|
var children = _a.children, _b = _a.spaceBetween, spaceBetween = _b === void 0 ? false : _b, _c = _a.spaceAround, spaceAround = _c === void 0 ? true : _c, rest = __rest(_a, ["children", "spaceBetween", "spaceAround"]);
|
|
73
|
-
var theme =
|
|
74
|
-
var themeMarginLeft = typeof spaceAround !== 'boolean' && (spaceAround === null || spaceAround === void 0 ? void 0 : spaceAround.marginLeft) ?
|
|
75
|
-
var themeMarginRight = typeof spaceAround !== 'boolean' && (spaceAround === null || spaceAround === void 0 ? void 0 : spaceAround.marginRight) ?
|
|
76
|
-
return ((
|
|
48
|
+
var theme = useTheme();
|
|
49
|
+
var themeMarginLeft = typeof spaceAround !== 'boolean' && (spaceAround === null || spaceAround === void 0 ? void 0 : spaceAround.marginLeft) ? th.space(spaceAround === null || spaceAround === void 0 ? void 0 : spaceAround.marginLeft)({ theme: theme }) : 0;
|
|
50
|
+
var themeMarginRight = typeof spaceAround !== 'boolean' && (spaceAround === null || spaceAround === void 0 ? void 0 : spaceAround.marginRight) ? th.space(spaceAround === null || spaceAround === void 0 ? void 0 : spaceAround.marginRight)({ theme: theme }) : 0;
|
|
51
|
+
return (_jsx(Wrapper, __assign({ "$spaceAround": spaceAround, "$spaceBetween": spaceBetween, "$marginRight": themeMarginRight, "$marginLeft": themeMarginLeft }, rest, { children: children })));
|
|
77
52
|
};
|
|
78
|
-
|
|
53
|
+
export default SpaceAroundWrap;
|
|
79
54
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SpaceAroundWrap = void 0;
|
|
7
|
-
var SpaceAround_1 = __importDefault(require("./SpaceAround"));
|
|
8
|
-
exports.SpaceAroundWrap = SpaceAround_1.default;
|
|
9
|
-
exports.default = SpaceAround_1.default;
|
|
1
|
+
import SpaceAroundWrap from './SpaceAround.js';
|
|
2
|
+
export { SpaceAroundWrap };
|
|
3
|
+
export default SpaceAroundWrap;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ManyPages = exports.Default = void 0;
|
|
4
|
-
var __1 = require("../");
|
|
1
|
+
import { SpaceAroundWrap } from '../index.js';
|
|
5
2
|
var meta = {
|
|
6
3
|
title: 'Elements/SpaceAround',
|
|
7
|
-
component:
|
|
4
|
+
component: SpaceAroundWrap,
|
|
8
5
|
tags: ['autodocs'],
|
|
9
6
|
argTypes: {},
|
|
10
7
|
};
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export default meta;
|
|
9
|
+
export var Default = {
|
|
13
10
|
args: {
|
|
14
11
|
children: 'This is a content',
|
|
15
12
|
spaceBetween: false,
|
|
16
13
|
spaceAround: true,
|
|
17
14
|
},
|
|
18
15
|
};
|
|
19
|
-
|
|
16
|
+
export var ManyPages = {
|
|
20
17
|
args: {
|
|
21
18
|
children: 'This is a content',
|
|
22
19
|
spaceBetween: true,
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
var styles_1 = require("./styles");
|
|
6
|
-
exports.appearanceToColorMap = {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Svg, Circle } from './styles.js';
|
|
3
|
+
export var appearanceToColorMap = {
|
|
7
4
|
error: 'red1',
|
|
8
5
|
concept: 'bgLightGray1',
|
|
9
6
|
done: 'darkGreen',
|
|
@@ -13,7 +10,7 @@ exports.appearanceToColorMap = {
|
|
|
13
10
|
warning: 'yellow1',
|
|
14
11
|
waiting: 'gray1',
|
|
15
12
|
};
|
|
16
|
-
|
|
13
|
+
export var appearanceToFontColorMap = {
|
|
17
14
|
error: 'white',
|
|
18
15
|
concept: 'blue2',
|
|
19
16
|
done: 'white',
|
|
@@ -23,10 +20,9 @@ exports.appearanceToFontColorMap = {
|
|
|
23
20
|
warning: 'blue2',
|
|
24
21
|
waiting: 'white',
|
|
25
22
|
};
|
|
26
|
-
var Spinner = function (_a) {
|
|
23
|
+
export var Spinner = function (_a) {
|
|
27
24
|
var _b = _a.variant, variant = _b === void 0 ? 'default' : _b, appearance = _a.appearance;
|
|
28
|
-
var color = appearance ?
|
|
29
|
-
return ((
|
|
25
|
+
var color = appearance ? appearanceToFontColorMap[appearance] : 'blue2';
|
|
26
|
+
return (_jsx(Svg, { viewBox: "22 22 44 44", "$variant": variant, children: _jsx(Circle, { cx: "44", cy: "44", r: "20.2", fill: "none", strokeWidth: "3.6", color: color }) }));
|
|
30
27
|
};
|
|
31
|
-
|
|
32
|
-
exports.default = exports.Spinner;
|
|
28
|
+
export default Spinner;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Spinner = void 0;
|
|
7
|
-
var Spinner_1 = __importDefault(require("./Spinner"));
|
|
8
|
-
exports.Spinner = Spinner_1.default;
|
|
9
|
-
exports.default = Spinner_1.default;
|
|
1
|
+
import Spinner from './Spinner.js';
|
|
2
|
+
export { Spinner };
|
|
3
|
+
export default Spinner;
|