@mailstep/design-system 0.6.2-beta.7 → 0.6.2-beta.8
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 +6 -6
- 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.es.js +23359 -19683
- package/ui/index.js +146 -85
- package/ui/index.umd.js +510 -484
- 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
|
@@ -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,10 +10,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
10
|
};
|
|
10
11
|
return __assign.apply(this, arguments);
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.getCustomTheme = exports.CustomStyles = void 0;
|
|
15
|
+
var baseStyles_1 = require("./baseStyles");
|
|
16
|
+
var system_1 = require("@xstyled/system");
|
|
14
17
|
// style object https://react-select.com/styles
|
|
15
|
-
|
|
18
|
+
exports.CustomStyles = __assign(__assign({}, baseStyles_1.baseStylesConfig), { control: function (styles, _a) {
|
|
16
19
|
var _b;
|
|
17
20
|
var selectProps = _a.selectProps, theme = _a.theme, isFocused = _a.isFocused, isDisabled = _a.isDisabled;
|
|
18
21
|
var colors = theme.colors;
|
|
@@ -28,7 +31,7 @@ export var CustomStyles = __assign(__assign({}, baseStylesConfig), { control: fu
|
|
|
28
31
|
}, multiValue: function (styles, state) {
|
|
29
32
|
var _a;
|
|
30
33
|
var theme = state.theme;
|
|
31
|
-
var base = (_a = baseStylesConfig.multiValue) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
34
|
+
var base = (_a = baseStyles_1.baseStylesConfig.multiValue) === null || _a === void 0 ? void 0 : _a.call(baseStyles_1.baseStylesConfig, styles, state);
|
|
32
35
|
return __assign(__assign({}, base), { fontSize: '9px', fontWeight: theme.textWeightSemiBold });
|
|
33
36
|
}, multiValueRemove: function (styles, _a) {
|
|
34
37
|
var _b;
|
|
@@ -37,7 +40,7 @@ export var CustomStyles = __assign(__assign({}, baseStylesConfig), { control: fu
|
|
|
37
40
|
}, placeholder: function (styles, state) {
|
|
38
41
|
var _a;
|
|
39
42
|
var theme = state.theme;
|
|
40
|
-
var base = (_a = baseStylesConfig.placeholder) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
43
|
+
var base = (_a = baseStyles_1.baseStylesConfig.placeholder) === null || _a === void 0 ? void 0 : _a.call(baseStyles_1.baseStylesConfig, styles, state);
|
|
41
44
|
return __assign(__assign({}, base), { fontSize: '14px', fontWeight: theme.textWeightSemiBold });
|
|
42
45
|
}, option: function (styles, _a) {
|
|
43
46
|
var isSelected = _a.isSelected, theme = _a.theme, isDisabled = _a.isDisabled, selectProps = _a.selectProps;
|
|
@@ -57,46 +60,47 @@ export var CustomStyles = __assign(__assign({}, baseStylesConfig), { control: fu
|
|
|
57
60
|
marginRight: '4px',
|
|
58
61
|
marginBottom: '2px',
|
|
59
62
|
lineHeight: '22px',
|
|
60
|
-
borderRadius: th.radius('ml')({ theme: selectProps === null || selectProps === void 0 ? void 0 : selectProps.systemTheme }),
|
|
63
|
+
borderRadius: system_1.th.radius('ml')({ theme: selectProps === null || selectProps === void 0 ? void 0 : selectProps.systemTheme }),
|
|
61
64
|
'&:hover': { backgroundColor: !isDisabled ? theme.colors.menuHoverBackgroundColor : undefined },
|
|
62
65
|
};
|
|
63
66
|
}, menu: function (styles, state) {
|
|
64
67
|
var _a;
|
|
65
|
-
var base = (_a = baseStylesConfig.menu) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
68
|
+
var base = (_a = baseStyles_1.baseStylesConfig.menu) === null || _a === void 0 ? void 0 : _a.call(baseStyles_1.baseStylesConfig, styles, state);
|
|
66
69
|
return __assign(__assign({}, base), { boxShadow: '0 2px 20px 0 rgba(0, 0, 0, 0.10);', marginTop: '-0', paddingTop: '0', borderRadius: '10px', zIndex: 3 });
|
|
67
70
|
}, dropdownIndicator: function (styles, state) {
|
|
68
71
|
var _a;
|
|
69
|
-
var base = (_a = baseStylesConfig.dropdownIndicator) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
72
|
+
var base = (_a = baseStyles_1.baseStylesConfig.dropdownIndicator) === null || _a === void 0 ? void 0 : _a.call(baseStyles_1.baseStylesConfig, styles, state);
|
|
70
73
|
var theme = state.theme, isFocused = state.isFocused;
|
|
71
74
|
return __assign(__assign({}, base), { color: isFocused ? theme.colors.inputTextColor : theme.colors.dropdownIndicatorColor, padding: '0px 5px 0px 0px', '@media (min-width: 1024px)': {
|
|
72
75
|
padding: '0px 5px 0px 1px',
|
|
73
76
|
} });
|
|
74
77
|
}, clearIndicator: function (styles, state) {
|
|
75
78
|
var _a;
|
|
76
|
-
var base = (_a = baseStylesConfig.clearIndicator) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
79
|
+
var base = (_a = baseStyles_1.baseStylesConfig.clearIndicator) === null || _a === void 0 ? void 0 : _a.call(baseStyles_1.baseStylesConfig, styles, state);
|
|
77
80
|
var theme = state.theme;
|
|
78
81
|
return __assign(__assign({}, base), { padding: theme.narrowIndicators ? '0px 0px 0px 2px' : '0px 4px' });
|
|
79
82
|
},
|
|
80
83
|
// invisible indicator separator
|
|
81
84
|
indicatorSeparator: function () { return ({ display: 'none' }); } });
|
|
82
|
-
|
|
83
|
-
var inputTextColor = th.color('blue2')({ theme: theme });
|
|
85
|
+
var getCustomTheme = function (theme, optionVariant, useFilterSubvariant) {
|
|
86
|
+
var inputTextColor = system_1.th.color('blue2')({ theme: theme });
|
|
84
87
|
var customColors = {
|
|
85
|
-
primary: th.color('red1')({ theme: theme }),
|
|
88
|
+
primary: system_1.th.color('red1')({ theme: theme }),
|
|
86
89
|
inputTextColor: inputTextColor,
|
|
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 }),
|
|
90
|
+
valueTextColor: system_1.th.color('gray')({ theme: theme }),
|
|
91
|
+
placeholderTextColor: system_1.th.color('lightGray3')({ theme: theme }),
|
|
92
|
+
optionTextColor: system_1.th.color('blue2')({ theme: theme }),
|
|
93
|
+
inputDisabledColor: system_1.th.color('lightGray1')({ theme: theme }),
|
|
91
94
|
inputBackgroundColor: "white",
|
|
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 }),
|
|
95
|
+
inputBorderColor: system_1.th.color('lightGray3')({ theme: theme }),
|
|
96
|
+
inputBorderHoverColor: system_1.th.color('gray5')({ theme: theme }),
|
|
97
|
+
activeOptionBackground: system_1.th.color('red20')({ theme: theme }),
|
|
98
|
+
menuBackgroundColor: system_1.th.color('white')({ theme: theme }),
|
|
99
|
+
menuHoverBackgroundColor: system_1.th.color('bgLightGray1')({ theme: theme }),
|
|
100
|
+
dropdownIndicatorColor: system_1.th.color('gray1')({ theme: theme }),
|
|
98
101
|
};
|
|
99
102
|
return function (reactSelectTheme) {
|
|
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 });
|
|
103
|
+
return __assign(__assign({}, reactSelectTheme), { colors: customColors, focusBoxShadow: null, height: useFilterSubvariant ? '32px' : '38px', textWeightRegular: system_1.th.fontWeight('regular')({ theme: theme }), textWeightSemiBold: system_1.th.fontWeight('semiBold')({ theme: theme }), textWeightBold: system_1.th.fontWeight('bold')({ theme: theme }), optionVariant: optionVariant, borderRadius: system_1.th.radius('lg')({ theme: theme }), font: system_1.th.font('primary')({ theme: theme }), narrowIndicators: !!useFilterSubvariant });
|
|
101
104
|
};
|
|
102
105
|
};
|
|
106
|
+
exports.getCustomTheme = getCustomTheme;
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStylesAndComponents = void 0;
|
|
4
|
+
var CustomComponents_1 = require("./CustomComponents");
|
|
5
|
+
var formStyles_1 = require("./formStyles");
|
|
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) {
|
|
6
9
|
if (style === void 0) { style = 'form'; }
|
|
7
10
|
if (optionVariant === void 0) { optionVariant = 'default'; }
|
|
8
11
|
if (multiLabelVariant === void 0) { multiLabelVariant = 'default'; }
|
|
9
12
|
if (containerVariant === void 0) { containerVariant = 'default'; }
|
|
10
|
-
var systemTheme = useTheme();
|
|
11
|
-
return useMemo(function () {
|
|
13
|
+
var systemTheme = (0, styled_components_1.useTheme)();
|
|
14
|
+
return (0, react_1.useMemo)(function () {
|
|
12
15
|
var components = {
|
|
13
|
-
ValueContainer: IconValueContainer,
|
|
16
|
+
ValueContainer: CustomComponents_1.IconValueContainer,
|
|
14
17
|
};
|
|
15
18
|
if (multiLabelVariant === 'count') {
|
|
16
|
-
components.MultiValue = CountMultiValue;
|
|
19
|
+
components.MultiValue = CustomComponents_1.CountMultiValue;
|
|
17
20
|
}
|
|
18
21
|
if (containerVariant === 'search') {
|
|
19
22
|
components.DropdownIndicator = null;
|
|
20
23
|
}
|
|
21
24
|
if (showResetGridButton || showSelectAllButton) {
|
|
22
|
-
components.Menu = ConnectedMenu;
|
|
25
|
+
components.Menu = CustomComponents_1.ConnectedMenu;
|
|
23
26
|
}
|
|
24
|
-
components.Input = CustomInput;
|
|
25
|
-
var themes =
|
|
26
|
-
var styles =
|
|
27
|
-
components.Option = ChevronOption;
|
|
28
|
-
components.DropdownIndicator = DropdownIndicator;
|
|
27
|
+
components.Input = CustomComponents_1.CustomInput;
|
|
28
|
+
var themes = (0, formStyles_1.getCustomTheme)(systemTheme, optionVariant, style == 'gridFilter');
|
|
29
|
+
var styles = formStyles_1.CustomStyles;
|
|
30
|
+
components.Option = CustomComponents_1.ChevronOption;
|
|
31
|
+
components.DropdownIndicator = CustomComponents_1.DropdownIndicator;
|
|
29
32
|
// performance reasons
|
|
30
33
|
if (useSimplifiedOptions)
|
|
31
|
-
components.Option = SimplifiedOption;
|
|
34
|
+
components.Option = CustomComponents_1.SimplifiedOption;
|
|
32
35
|
return [components, themes, styles];
|
|
33
36
|
}, [
|
|
34
37
|
multiLabelVariant,
|
|
@@ -41,3 +44,4 @@ export var useStylesAndComponents = function (style, optionVariant, multiLabelVa
|
|
|
41
44
|
optionVariant,
|
|
42
45
|
]);
|
|
43
46
|
};
|
|
47
|
+
exports.useStylesAndComponents = useStylesAndComponents;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,17 +1,42 @@
|
|
|
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
|
-
var
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
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) {
|
|
8
33
|
var disabled = _a.disabled;
|
|
9
34
|
return disabled
|
|
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;
|
|
35
|
+
? (0, styled_components_1.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;
|
|
11
36
|
}, function (_a) {
|
|
12
37
|
var $decorate = _a.$decorate;
|
|
13
38
|
return $decorate
|
|
14
|
-
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n text-decoration: underline;\n "], ["\n text-decoration: underline;\n "]))) : null;
|
|
39
|
+
? (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n text-decoration: underline;\n "], ["\n text-decoration: underline;\n "]))) : null;
|
|
15
40
|
});
|
|
16
|
-
|
|
41
|
+
exports.default = StyledLink;
|
|
17
42
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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.SimpleLink = void 0;
|
|
7
|
+
var SimpleLink_1 = __importDefault(require("./SimpleLink"));
|
|
8
|
+
exports.SimpleLink = SimpleLink_1.default;
|
|
9
|
+
exports.default = SimpleLink_1.default;
|
|
@@ -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++) {
|
|
@@ -54,15 +55,19 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
54
55
|
}
|
|
55
56
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
57
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
var
|
|
65
|
-
var
|
|
58
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
59
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60
|
+
};
|
|
61
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
63
|
+
var react_1 = require("react");
|
|
64
|
+
var react_select_1 = require("react-select");
|
|
65
|
+
var Select_1 = __importDefault(require("../Select"));
|
|
66
|
+
var omit_1 = __importDefault(require("lodash/fp/omit"));
|
|
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)();
|
|
66
71
|
var creatableFilterOption = function (option, rawInput) {
|
|
67
72
|
if ((option === null || option === void 0 ? void 0 : option.value) == CREATE)
|
|
68
73
|
return true;
|
|
@@ -79,27 +84,27 @@ var getOptionValue = function (selectedOption) {
|
|
|
79
84
|
return selectedOption.value;
|
|
80
85
|
}
|
|
81
86
|
};
|
|
82
|
-
var loadingMessage = function () { return i18n._({ id: 'components.dropdown.loading', message: 'Loading...' }); };
|
|
87
|
+
var loadingMessage = function () { return core_1.i18n._({ id: 'components.dropdown.loading', message: 'Loading...' }); };
|
|
83
88
|
var SingleSelect = function (props) {
|
|
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];
|
|
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 ? core_1.i18n._({ id: 'components.dropdown.notReact', message: 'Select related values first...' }) : _b, disabled = props.disabled, _c = props.placeholder, placeholder = _c === void 0 ? core_1.i18n._({ id: 'components.dropdown.placeholder', message: 'Select...' }) : _c, preload = props.preload, initialOptions = props.initialOptions, onCreateOption = props.onCreateOption, options = props.options, filterOption = props.filterOption;
|
|
90
|
+
var _d = (0, react_1.useState)(false), isCreating = _d[0], setIsCreating = _d[1];
|
|
86
91
|
var asAsync = !!loadOptions || !!onCreateOption;
|
|
87
|
-
var noOptionsMessage = useCallback(function (inputValue) {
|
|
92
|
+
var noOptionsMessage = (0, react_1.useCallback)(function (inputValue) {
|
|
88
93
|
return loadOptions && inputValue.length < asyncLoadMinChars
|
|
89
|
-
? i18n._({
|
|
94
|
+
? core_1.i18n._({
|
|
90
95
|
id: 'components.dropdown.writeMoreChars',
|
|
91
96
|
message: 'Write at least ${asyncLoadMinChars} characters.',
|
|
92
97
|
})
|
|
93
|
-
: i18n._({ id: 'components.dropdown.noOptions', message: 'No options' });
|
|
98
|
+
: core_1.i18n._({ id: 'components.dropdown.noOptions', message: 'No options' });
|
|
94
99
|
}, [loadOptions, asyncLoadMinChars]);
|
|
95
|
-
var handleLoadOptions = useCallback(function (inputValue) {
|
|
100
|
+
var handleLoadOptions = (0, react_1.useCallback)(function (inputValue) {
|
|
96
101
|
if (onCreateOption) {
|
|
97
102
|
if (!inputValue.trim())
|
|
98
103
|
return Promise.resolve(options || []);
|
|
99
104
|
return Promise.resolve(__spreadArray(__spreadArray([], (options || []), true), [
|
|
100
105
|
{
|
|
101
106
|
value: CREATE,
|
|
102
|
-
label: "".concat(inputValue, " (").concat(i18n._({ id: 'components.dropdown.newOption', message: 'new value' }), ")"),
|
|
107
|
+
label: "".concat(inputValue, " (").concat(core_1.i18n._({ id: 'components.dropdown.newOption', message: 'new value' }), ")"),
|
|
103
108
|
inputValue: inputValue,
|
|
104
109
|
},
|
|
105
110
|
], false));
|
|
@@ -111,14 +116,14 @@ var SingleSelect = function (props) {
|
|
|
111
116
|
return loadOptions(inputValue, false);
|
|
112
117
|
}
|
|
113
118
|
}, [onCreateOption, loadOptions, asyncLoadMinChars, options]);
|
|
114
|
-
var _e = useState(options || []), loadedDefaultOptions = _e[0], setLoadedDefaultOptions = _e[1];
|
|
115
|
-
useEffect(function () {
|
|
119
|
+
var _e = (0, react_1.useState)(options || []), loadedDefaultOptions = _e[0], setLoadedDefaultOptions = _e[1];
|
|
120
|
+
(0, react_1.useEffect)(function () {
|
|
116
121
|
if (loadOptions && preload && !props.value)
|
|
117
122
|
loadOptions('', false).then(setLoadedDefaultOptions);
|
|
118
123
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
119
124
|
}, [loadOptions]); // this is intentional
|
|
120
|
-
var _f = useState(null), storedSelectedOption = _f[0], setStoredSelectedOption = _f[1];
|
|
121
|
-
useEffect(function () {
|
|
125
|
+
var _f = (0, react_1.useState)(null), storedSelectedOption = _f[0], setStoredSelectedOption = _f[1];
|
|
126
|
+
(0, react_1.useEffect)(function () {
|
|
122
127
|
if (initialOptions && initialOptions.length) {
|
|
123
128
|
var selectedOption = initialOptions.find(function (option) { return option.value == props.value; }) || null;
|
|
124
129
|
setStoredSelectedOption(selectedOption);
|
|
@@ -129,7 +134,7 @@ var SingleSelect = function (props) {
|
|
|
129
134
|
// ignored because of props.value, this only finds option for initial value
|
|
130
135
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131
136
|
}, [initialOptions, setStoredSelectedOption]);
|
|
132
|
-
var handleChange = useCallback(function (option) { return __awaiter(void 0, void 0, void 0, function () {
|
|
137
|
+
var handleChange = (0, react_1.useCallback)(function (option) { return __awaiter(void 0, void 0, void 0, function () {
|
|
133
138
|
var value, newOption;
|
|
134
139
|
var _a, _b, _c, _d;
|
|
135
140
|
return __generator(this, function (_e) {
|
|
@@ -138,7 +143,7 @@ var SingleSelect = function (props) {
|
|
|
138
143
|
if (!(onCreateOption && (option === null || option === void 0 ? void 0 : option.value) == CREATE)) return [3 /*break*/, 4];
|
|
139
144
|
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];
|
|
140
145
|
props === null || props === void 0 ? void 0 : props.form.setFieldTouched(name, true, true);
|
|
141
|
-
props === null || props === void 0 ? void 0 : props.form.setFieldError(name, i18n._({ id: 'form.general.min2Chars', message: 'Minimal length is 2 characters.' }));
|
|
146
|
+
props === null || props === void 0 ? void 0 : props.form.setFieldError(name, core_1.i18n._({ id: 'form.general.min2Chars', message: 'Minimal length is 2 characters.' }));
|
|
142
147
|
return [2 /*return*/];
|
|
143
148
|
case 1:
|
|
144
149
|
setIsCreating(true);
|
|
@@ -170,7 +175,7 @@ var SingleSelect = function (props) {
|
|
|
170
175
|
}
|
|
171
176
|
});
|
|
172
177
|
}); }, [onCreateOption, loadOptions, onChange, onValueChange, props === null || props === void 0 ? void 0 : props.form, name]);
|
|
173
|
-
var handleBlur = useCallback(function (option) {
|
|
178
|
+
var handleBlur = (0, react_1.useCallback)(function (option) {
|
|
174
179
|
if (onBlur) {
|
|
175
180
|
onBlur({
|
|
176
181
|
target: {
|
|
@@ -184,7 +189,7 @@ var SingleSelect = function (props) {
|
|
|
184
189
|
var omitted = ['onValueChange', 'placeholder', 'options', 'loadOptions', 'asyncLoadMinChars'];
|
|
185
190
|
var displayLockedText = isLocked && !disabled;
|
|
186
191
|
var placeholderValue = displayLockedText ? lockedText : placeholder;
|
|
187
|
-
var defaultOptions = useMemo(function () {
|
|
192
|
+
var defaultOptions = (0, react_1.useMemo)(function () {
|
|
188
193
|
if (!asAsync)
|
|
189
194
|
return undefined; // relates only to asAsync true
|
|
190
195
|
var staticOptions = onCreateOption ? options : loadedDefaultOptions;
|
|
@@ -192,6 +197,6 @@ var SingleSelect = function (props) {
|
|
|
192
197
|
return staticOptions || undefined;
|
|
193
198
|
return staticOptions ? __spreadArray(__spreadArray([], staticOptions, true), [storedSelectedOption], false) : [storedSelectedOption];
|
|
194
199
|
}, [asAsync, loadedDefaultOptions, onCreateOption, options, storedSelectedOption]);
|
|
195
|
-
return (
|
|
200
|
+
return ((0, jsx_runtime_1.jsx)(Select_1.default, __assign({}, (0, omit_1.default)(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 })));
|
|
196
201
|
};
|
|
197
|
-
|
|
202
|
+
exports.default = SingleSelect;
|
|
@@ -1,2 +1,7 @@
|
|
|
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
|
+
var SingleSelect_1 = __importDefault(require("./SingleSelect"));
|
|
7
|
+
exports.default = SingleSelect_1.default;
|
|
@@ -1,3 +1,4 @@
|
|
|
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;
|
|
@@ -13,6 +14,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
14
|
};
|
|
14
15
|
return __assign.apply(this, arguments);
|
|
15
16
|
};
|
|
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
|
+
};
|
|
16
40
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
41
|
var t = {};
|
|
18
42
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -24,16 +48,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
48
|
}
|
|
25
49
|
return t;
|
|
26
50
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
53
|
+
var styled_components_1 = __importStar(require("@xstyled/styled-components"));
|
|
54
|
+
var styled_components_2 = require("@xstyled/styled-components");
|
|
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) {
|
|
31
56
|
var $marginLeft = _a.$marginLeft, $marginRight = _a.$marginRight;
|
|
32
57
|
return "calc(100% - ".concat($marginLeft || '0px', " - ").concat($marginRight || '0px', ")");
|
|
33
58
|
}, function (_a) {
|
|
34
59
|
var $spaceAround = _a.$spaceAround;
|
|
35
60
|
return $spaceAround
|
|
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'
|
|
61
|
+
? (0, styled_components_1.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'
|
|
37
62
|
? 1
|
|
38
63
|
: $spaceAround.marginRight, $spaceAround === true || typeof ($spaceAround === null || $spaceAround === void 0 ? void 0 : $spaceAround.marginBottom) === 'undefined'
|
|
39
64
|
? 2
|
|
@@ -41,14 +66,14 @@ var Wrapper = styled(x.div)(templateObject_3 || (templateObject_3 = __makeTempla
|
|
|
41
66
|
}, function (_a) {
|
|
42
67
|
var $spaceBetween = _a.$spaceBetween;
|
|
43
68
|
return $spaceBetween
|
|
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 "]))) : '';
|
|
69
|
+
? (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n "], ["\n display: flex;\n justify-content: space-between;\n "]))) : '';
|
|
45
70
|
});
|
|
46
71
|
var SpaceAroundWrap = function (_a) {
|
|
47
72
|
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"]);
|
|
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 (
|
|
73
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
74
|
+
var themeMarginLeft = typeof spaceAround !== 'boolean' && (spaceAround === null || spaceAround === void 0 ? void 0 : spaceAround.marginLeft) ? styled_components_2.th.space(spaceAround === null || spaceAround === void 0 ? void 0 : spaceAround.marginLeft)({ theme: theme }) : 0;
|
|
75
|
+
var themeMarginRight = typeof spaceAround !== 'boolean' && (spaceAround === null || spaceAround === void 0 ? void 0 : spaceAround.marginRight) ? styled_components_2.th.space(spaceAround === null || spaceAround === void 0 ? void 0 : spaceAround.marginRight)({ theme: theme }) : 0;
|
|
76
|
+
return ((0, jsx_runtime_1.jsx)(Wrapper, __assign({ "$spaceAround": spaceAround, "$spaceBetween": spaceBetween, "$marginRight": themeMarginRight, "$marginLeft": themeMarginLeft }, rest, { children: children })));
|
|
52
77
|
};
|
|
53
|
-
|
|
78
|
+
exports.default = SpaceAroundWrap;
|
|
54
79
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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.SpaceAroundWrap = void 0;
|
|
7
|
+
var SpaceAround_1 = __importDefault(require("./SpaceAround"));
|
|
8
|
+
exports.SpaceAroundWrap = SpaceAround_1.default;
|
|
9
|
+
exports.default = SpaceAround_1.default;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManyPages = exports.Default = void 0;
|
|
4
|
+
var __1 = require("../");
|
|
2
5
|
var meta = {
|
|
3
6
|
title: 'Elements/SpaceAround',
|
|
4
|
-
component: SpaceAroundWrap,
|
|
7
|
+
component: __1.SpaceAroundWrap,
|
|
5
8
|
tags: ['autodocs'],
|
|
6
9
|
argTypes: {},
|
|
7
10
|
};
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
exports.default = meta;
|
|
12
|
+
exports.Default = {
|
|
10
13
|
args: {
|
|
11
14
|
children: 'This is a content',
|
|
12
15
|
spaceBetween: false,
|
|
13
16
|
spaceAround: true,
|
|
14
17
|
},
|
|
15
18
|
};
|
|
16
|
-
|
|
19
|
+
exports.ManyPages = {
|
|
17
20
|
args: {
|
|
18
21
|
children: 'This is a content',
|
|
19
22
|
spaceBetween: true,
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Spinner = exports.appearanceToFontColorMap = exports.appearanceToColorMap = void 0;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var styles_1 = require("./styles");
|
|
6
|
+
exports.appearanceToColorMap = {
|
|
4
7
|
error: 'red1',
|
|
5
8
|
concept: 'bgLightGray1',
|
|
6
9
|
done: 'darkGreen',
|
|
@@ -10,7 +13,7 @@ export var appearanceToColorMap = {
|
|
|
10
13
|
warning: 'yellow1',
|
|
11
14
|
waiting: 'gray1',
|
|
12
15
|
};
|
|
13
|
-
|
|
16
|
+
exports.appearanceToFontColorMap = {
|
|
14
17
|
error: 'white',
|
|
15
18
|
concept: 'blue2',
|
|
16
19
|
done: 'white',
|
|
@@ -20,9 +23,10 @@ export var appearanceToFontColorMap = {
|
|
|
20
23
|
warning: 'blue2',
|
|
21
24
|
waiting: 'white',
|
|
22
25
|
};
|
|
23
|
-
|
|
26
|
+
var Spinner = function (_a) {
|
|
24
27
|
var _b = _a.variant, variant = _b === void 0 ? 'default' : _b, appearance = _a.appearance;
|
|
25
|
-
var color = appearance ? appearanceToFontColorMap[appearance] : 'blue2';
|
|
26
|
-
return (
|
|
28
|
+
var color = appearance ? exports.appearanceToFontColorMap[appearance] : 'blue2';
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.Svg, { viewBox: "22 22 44 44", "$variant": variant, children: (0, jsx_runtime_1.jsx)(styles_1.Circle, { cx: "44", cy: "44", r: "20.2", fill: "none", strokeWidth: "3.6", color: color }) }));
|
|
27
30
|
};
|
|
28
|
-
|
|
31
|
+
exports.Spinner = Spinner;
|
|
32
|
+
exports.default = exports.Spinner;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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.Spinner = void 0;
|
|
7
|
+
var Spinner_1 = __importDefault(require("./Spinner"));
|
|
8
|
+
exports.Spinner = Spinner_1.default;
|
|
9
|
+
exports.default = Spinner_1.default;
|