@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
package/ui/Blocks/Tabs/Tabs.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Tabs = void 0;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var styles_1 = require("./styles");
|
|
7
|
+
var Text_1 = require("../../Elements/Text");
|
|
8
|
+
var Icon_1 = require("../../Elements/Icon");
|
|
6
9
|
var Tab = function (_a) {
|
|
7
10
|
var tabDefinition = _a.tabDefinition, value = _a.value, isActive = _a.isActive, onTabSwitch = _a.onTabSwitch;
|
|
8
11
|
var icon = tabDefinition.icon, label = tabDefinition.label, badgeCount = tabDefinition.badgeCount;
|
|
9
|
-
var handleOnClick = useCallback(function () {
|
|
12
|
+
var handleOnClick = (0, react_1.useCallback)(function () {
|
|
10
13
|
onTabSwitch(value);
|
|
11
14
|
}, [onTabSwitch, value]);
|
|
12
|
-
return (
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTabWrapper, { children: (0, jsx_runtime_1.jsxs)(styles_1.Tab, { onClick: handleOnClick, active: isActive, children: [icon && ((0, jsx_runtime_1.jsx)(styles_1.StyledImageBox, { children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: icon }) })), (0, jsx_runtime_1.jsx)(Text_1.Text, { children: label }), isActive && badgeCount && badgeCount > 0 && ((0, jsx_runtime_1.jsx)(styles_1.RoundedWrap, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "medium", children: badgeCount }) }))] }) }));
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
var Tabs = function (_a) {
|
|
15
18
|
var tabsDefinition = _a.tabsDefinition, activeTab = _a.activeTab, onTabSwitch = _a.onTabSwitch, mb = _a.mb;
|
|
16
|
-
return (
|
|
17
|
-
return
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.TabPanel, { "$mb": mb, children: tabsDefinition.map(function (item, index) {
|
|
20
|
+
return (0, jsx_runtime_1.jsx)(Tab, { value: index, tabDefinition: item, isActive: index === activeTab, onTabSwitch: onTabSwitch }, index);
|
|
18
21
|
}) }));
|
|
19
22
|
};
|
|
23
|
+
exports.Tabs = Tabs;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTabs = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var useTabs = function (tabDefinitions) {
|
|
3
6
|
var index = tabDefinitions.map(function (item) { return item.default; }).indexOf(true);
|
|
4
7
|
var initialValue = index === -1 ? 0 : index;
|
|
5
|
-
var _a = useState(initialValue), activeTab = _a[0], setActiveTab = _a[1];
|
|
6
|
-
var onTabSwitch = useCallback(function (value) {
|
|
8
|
+
var _a = (0, react_1.useState)(initialValue), activeTab = _a[0], setActiveTab = _a[1];
|
|
9
|
+
var onTabSwitch = (0, react_1.useCallback)(function (value) {
|
|
7
10
|
setActiveTab(value);
|
|
8
11
|
}, []);
|
|
9
12
|
return { activeTab: activeTab, onTabSwitch: onTabSwitch };
|
|
10
13
|
};
|
|
14
|
+
exports.useTabs = useTabs;
|
package/ui/Blocks/Tabs/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTabs = exports.TabContent = void 0;
|
|
4
|
+
var Tabs_1 = require("./Tabs");
|
|
5
|
+
var TabContent_1 = require("./TabContent");
|
|
6
|
+
Object.defineProperty(exports, "TabContent", { enumerable: true, get: function () { return TabContent_1.TabContent; } });
|
|
7
|
+
var useTabs_1 = require("./hooks/useTabs");
|
|
8
|
+
Object.defineProperty(exports, "useTabs", { enumerable: true, get: function () { return useTabs_1.useTabs; } });
|
|
9
|
+
exports.default = Tabs_1.Tabs;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActiveTabWithIcon = exports.ActiveTabWithBadge = exports.ActiveTabWithBadgeAndIcon = void 0;
|
|
4
|
+
var Tabs_1 = require("../Tabs");
|
|
2
5
|
var meta = {
|
|
3
6
|
title: 'Blocks/Tabs',
|
|
4
|
-
component: Tabs,
|
|
7
|
+
component: Tabs_1.Tabs,
|
|
5
8
|
tags: ['autodocs'],
|
|
6
9
|
argTypes: {},
|
|
7
10
|
};
|
|
8
|
-
|
|
11
|
+
exports.default = meta;
|
|
9
12
|
var tabs = [
|
|
10
13
|
{
|
|
11
14
|
label: 'Main Tab',
|
|
@@ -21,21 +24,21 @@ var tabs = [
|
|
|
21
24
|
icon: 'box',
|
|
22
25
|
},
|
|
23
26
|
];
|
|
24
|
-
|
|
27
|
+
exports.ActiveTabWithBadgeAndIcon = {
|
|
25
28
|
args: {
|
|
26
29
|
tabsDefinition: tabs,
|
|
27
30
|
onTabSwitch: console.log,
|
|
28
31
|
activeTab: 0,
|
|
29
32
|
},
|
|
30
33
|
};
|
|
31
|
-
|
|
34
|
+
exports.ActiveTabWithBadge = {
|
|
32
35
|
args: {
|
|
33
36
|
tabsDefinition: tabs,
|
|
34
37
|
onTabSwitch: console.log,
|
|
35
38
|
activeTab: 1,
|
|
36
39
|
},
|
|
37
40
|
};
|
|
38
|
-
|
|
41
|
+
exports.ActiveTabWithIcon = {
|
|
39
42
|
args: {
|
|
40
43
|
tabsDefinition: tabs,
|
|
41
44
|
onTabSwitch: console.log,
|
package/ui/Blocks/Tabs/styles.js
CHANGED
|
@@ -1,18 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
4
|
return cooked;
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
exports.TabPanel = exports.Tab = exports.RoundedWrap = exports.StyledTabWrapper = exports.StyledImageBox = void 0;
|
|
31
|
+
var styled_components_1 = __importStar(require("@xstyled/styled-components"));
|
|
32
|
+
exports.StyledImageBox = (0, styled_components_1.default)(styled_components_1.x.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: 1em;\n"], ["\n margin-right: 1em;\n"])));
|
|
33
|
+
exports.StyledTabWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: baseline;\n"], ["\n display: flex;\n flex-direction: row;\n align-items: baseline;\n"])));
|
|
34
|
+
exports.RoundedWrap = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex !important;\n justify-content: center;\n align-items: center;\n height: 23px;\n background-color: ", ";\n border-radius: 29px;\n padding: 3px 10px;\n margin-left: 8px;\n"], ["\n display: flex !important;\n justify-content: center;\n align-items: center;\n height: 23px;\n background-color: ", ";\n border-radius: 29px;\n padding: 3px 10px;\n margin-left: 8px;\n"])), styled_components_1.th.color('lightGray7'));
|
|
35
|
+
var activeTab = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n position: relative;\n &:after {\n content: '';\n position: absolute;\n bottom: 2;\n left: 0;\n right: 0;\n background-color: ", ";\n height: 4px;\n border-radius: 6px 6px 0px 0px;\n }\n & > div {\n display: inline;\n color: ", ";\n }\n"], ["\n color: ", ";\n position: relative;\n &:after {\n content: '';\n position: absolute;\n bottom: 2;\n left: 0;\n right: 0;\n background-color: ", ";\n height: 4px;\n border-radius: 6px 6px 0px 0px;\n }\n & > div {\n display: inline;\n color: ", ";\n }\n"])), styled_components_1.th.color('red1'), styled_components_1.th.color('red1'), styled_components_1.th.color('typoPrimary'));
|
|
36
|
+
exports.Tab = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n padding: 0.6rem;\n transition: 200ms;\n color: ", ";\n font-weight: bold;\n font-size: 14px;\n height: 46px;\n letter-spacing: 0.03em;\n margin-top: 10px;\n min-width: 120px;\n & > div {\n display: none;\n }\n &:not(:last-child) {\n margin-right: 0.5rem;\n }\n\n :hover {\n color: ", ";\n }\n\n :active {\n ", "\n }\n\n ", "\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n padding: 0.6rem;\n transition: 200ms;\n color: ", ";\n font-weight: bold;\n font-size: 14px;\n height: 46px;\n letter-spacing: 0.03em;\n margin-top: 10px;\n min-width: 120px;\n & > div {\n display: none;\n }\n &:not(:last-child) {\n margin-right: 0.5rem;\n }\n\n :hover {\n color: ", ";\n }\n\n :active {\n ", "\n }\n\n ", "\n"])), styled_components_1.th.color('gray'), styled_components_1.th.color('typoPrimary'), activeTab, function (_a) {
|
|
11
37
|
var active = _a.active;
|
|
12
38
|
return (active ? activeTab : '');
|
|
13
39
|
});
|
|
14
|
-
|
|
40
|
+
exports.TabPanel = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n min-height: 3rem;\n display: flex;\n align-items: flex-end;\n overflow: auto;\n width: fit-content;\n position: relative;\n margin-bottom: ", ";\n &:after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ", ";\n height: 2px;\n }\n"], ["\n min-height: 3rem;\n display: flex;\n align-items: flex-end;\n overflow: auto;\n width: fit-content;\n position: relative;\n margin-bottom: ", ";\n &:after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ", ";\n height: 2px;\n }\n"])), function (_a) {
|
|
15
41
|
var _b = _a.$mb, $mb = _b === void 0 ? 0 : _b;
|
|
16
42
|
return $mb;
|
|
17
|
-
}, th.color('bgLightGray1'));
|
|
43
|
+
}, styled_components_1.th.color('bgLightGray1'));
|
|
18
44
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
package/ui/Blocks/Tabs/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
var styled_components_1 = require("@xstyled/styled-components");
|
|
5
|
+
var styled_components_2 = require("@xstyled/styled-components");
|
|
6
|
+
var Icon_1 = require("../Icon");
|
|
7
|
+
var styles_1 = require("./styles");
|
|
6
8
|
var alertBackgroundColor = {
|
|
7
9
|
success: 'green10',
|
|
8
10
|
info: 'blue10',
|
|
@@ -23,10 +25,10 @@ var alertIconMap = {
|
|
|
23
25
|
};
|
|
24
26
|
var Alert = function (props) {
|
|
25
27
|
var intent = props.intent, inline = props.inline, onClick = props.onClick, onClose = props.onClose, title = props.title, text = props.text, href = props.href, actionLabel = props.actionLabel, actionType = props.actionType, desc = props.desc, _a = props.closeAnywhere, closeAnywhere = _a === void 0 ? false : _a;
|
|
26
|
-
var theme = useTheme();
|
|
27
|
-
var bgColor = th.color(intent ? alertBackgroundColor[intent] : 'transparent')({ theme: theme });
|
|
28
|
-
var colorFill = th.color(intent ? alertColorFill[intent] : 'transparent')({ theme: theme });
|
|
28
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
29
|
+
var bgColor = styled_components_2.th.color(intent ? alertBackgroundColor[intent] : 'transparent')({ theme: theme });
|
|
30
|
+
var colorFill = styled_components_2.th.color(intent ? alertColorFill[intent] : 'transparent')({ theme: theme });
|
|
29
31
|
var icon = intent && alertIconMap[intent];
|
|
30
|
-
return (
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledAlert, { "$bgColor": bgColor, "$colorFill": colorFill, "$inline": inline, onClick: closeAnywhere ? onClose : undefined, children: [(0, jsx_runtime_1.jsxs)(styled_components_1.x.div, { display: "flex", alignItems: "center", children: [inline && (0, jsx_runtime_1.jsx)(styles_1.VerticalSeparator, { "$colorFill": colorFill }), icon && ((0, jsx_runtime_1.jsx)(styles_1.IconWrap, { children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: icon, size: "20px", fill: colorFill }) })), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(styles_1.Title, { children: title }), (0, jsx_runtime_1.jsxs)(styles_1.Text, { children: [" ", text] })] })] }), (0, jsx_runtime_1.jsxs)(styled_components_1.x.div, { display: "flex", alignItems: "center", children: [href && actionType === 'link' && ((0, jsx_runtime_1.jsx)(styles_1.LinkWrapper, { "$colorFill": colorFill, to: href, children: actionLabel !== null && actionLabel !== void 0 ? actionLabel : 'Link' })), onClick && actionType === 'button' && ((0, jsx_runtime_1.jsx)(styles_1.ActionButton, { "$colorFill": colorFill, onClick: onClick, children: actionLabel !== null && actionLabel !== void 0 ? actionLabel : 'Submit' })), onClose && !closeAnywhere && ((0, jsx_runtime_1.jsx)(styles_1.CloseBtn, { onClick: onClose, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: "close", size: "15px", fill: "gray" }) })), desc && (0, jsx_runtime_1.jsx)(styles_1.Description, { children: desc })] })] }));
|
|
31
33
|
};
|
|
32
|
-
|
|
34
|
+
exports.default = Alert;
|
|
@@ -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.Alert = void 0;
|
|
7
|
+
var Alert_1 = __importDefault(require("./Alert"));
|
|
8
|
+
exports.Alert = Alert_1.default;
|
|
9
|
+
exports.default = Alert_1.default;
|
|
@@ -1,40 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WithCloseAnywhere = exports.WithDescription = exports.DangerWithMessage = exports.DangerInline = exports.Danger = exports.Info = exports.Warning = exports.Success = void 0;
|
|
4
|
+
var __1 = require("../");
|
|
2
5
|
var meta = {
|
|
3
6
|
title: 'Elements/Alert',
|
|
4
|
-
component: Alert,
|
|
7
|
+
component: __1.Alert,
|
|
5
8
|
tags: ['autodocs'],
|
|
6
9
|
argTypes: {},
|
|
7
10
|
};
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
exports.default = meta;
|
|
12
|
+
exports.Success = {
|
|
10
13
|
args: {
|
|
11
14
|
intent: 'success',
|
|
12
15
|
title: 'alert',
|
|
13
16
|
text: 'text',
|
|
14
17
|
},
|
|
15
18
|
};
|
|
16
|
-
|
|
19
|
+
exports.Warning = {
|
|
17
20
|
args: {
|
|
18
21
|
intent: 'warning',
|
|
19
22
|
title: 'alert',
|
|
20
23
|
text: 'warning',
|
|
21
24
|
},
|
|
22
25
|
};
|
|
23
|
-
|
|
26
|
+
exports.Info = {
|
|
24
27
|
args: {
|
|
25
28
|
intent: 'info',
|
|
26
29
|
title: 'alert',
|
|
27
30
|
text: 'info',
|
|
28
31
|
},
|
|
29
32
|
};
|
|
30
|
-
|
|
33
|
+
exports.Danger = {
|
|
31
34
|
args: {
|
|
32
35
|
intent: 'danger',
|
|
33
36
|
title: 'alert',
|
|
34
37
|
text: 'danger',
|
|
35
38
|
},
|
|
36
39
|
};
|
|
37
|
-
|
|
40
|
+
exports.DangerInline = {
|
|
38
41
|
args: {
|
|
39
42
|
intent: 'danger',
|
|
40
43
|
title: 'alert',
|
|
@@ -42,7 +45,7 @@ export var DangerInline = {
|
|
|
42
45
|
inline: true,
|
|
43
46
|
},
|
|
44
47
|
};
|
|
45
|
-
|
|
48
|
+
exports.DangerWithMessage = {
|
|
46
49
|
args: {
|
|
47
50
|
intent: 'danger',
|
|
48
51
|
title: 'alert',
|
|
@@ -51,7 +54,7 @@ export var DangerWithMessage = {
|
|
|
51
54
|
inline: true,
|
|
52
55
|
},
|
|
53
56
|
};
|
|
54
|
-
|
|
57
|
+
exports.WithDescription = {
|
|
55
58
|
args: {
|
|
56
59
|
intent: 'danger',
|
|
57
60
|
title: 'alert',
|
|
@@ -61,7 +64,7 @@ export var WithDescription = {
|
|
|
61
64
|
desc: "This is an extra description."
|
|
62
65
|
},
|
|
63
66
|
};
|
|
64
|
-
|
|
67
|
+
exports.WithCloseAnywhere = {
|
|
65
68
|
args: {
|
|
66
69
|
intent: 'danger',
|
|
67
70
|
title: 'alert',
|
|
@@ -1,33 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
4
|
return cooked;
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Description = exports.CloseBtn = exports.ActionButton = exports.LinkWrapper = exports.Text = exports.Title = exports.IconWrap = exports.VerticalSeparator = exports.StyledAlert = void 0;
|
|
11
|
+
var Link_1 = require("../Link");
|
|
12
|
+
var styled_components_1 = require("@xstyled/styled-components");
|
|
13
|
+
var styled_components_2 = require("@xstyled/styled-components");
|
|
14
|
+
var styled_components_3 = __importDefault(require("styled-components"));
|
|
15
|
+
exports.StyledAlert = (0, styled_components_3.default)(styled_components_1.x.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n min-height: 48px;\n align-items: center;\n justify-content: space-between;\n border: ", ";\n border-radius: 8px;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n padding: 6px 5px 6px 5px;\n margin-bottom: 5px;\n position: relative;\n"], ["\n width: 100%;\n display: flex;\n min-height: 48px;\n align-items: center;\n justify-content: space-between;\n border: ", ";\n border-radius: 8px;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n padding: 6px 5px 6px 5px;\n margin-bottom: 5px;\n position: relative;\n"])), function (_a) {
|
|
10
16
|
var $inline = _a.$inline, $colorFill = _a.$colorFill;
|
|
11
17
|
return ($inline ? "solid 1px ".concat($colorFill) : 'none');
|
|
12
18
|
}, function (_a) {
|
|
13
19
|
var $bgColor = _a.$bgColor;
|
|
14
20
|
return $bgColor;
|
|
15
|
-
}, th('colors.textPrimary'), th('fonts.primary'));
|
|
16
|
-
|
|
21
|
+
}, (0, styled_components_2.th)('colors.textPrimary'), (0, styled_components_2.th)('fonts.primary'));
|
|
22
|
+
exports.VerticalSeparator = (0, styled_components_3.default)(styled_components_1.x.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 4px;\n height: 36px;\n border-radius: 94px;\n background-color: ", ";\n"], ["\n width: 4px;\n height: 36px;\n border-radius: 94px;\n background-color: ", ";\n"])), function (_a) {
|
|
17
23
|
var $colorFill = _a.$colorFill;
|
|
18
24
|
return $colorFill;
|
|
19
25
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
exports.IconWrap = (0, styled_components_3.default)(styled_components_1.x.div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin: 0 13px 0 9px;\n"], ["\n margin: 0 13px 0 9px;\n"])));
|
|
27
|
+
exports.Title = styled_components_3.default.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 18px;\n font-weight: 600;\n"], ["\n font-size: 14px;\n line-height: 18px;\n font-weight: 600;\n"])));
|
|
28
|
+
exports.Text = styled_components_3.default.span(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 20px;\n font-weight: 400;\n"], ["\n font-size: 14px;\n line-height: 20px;\n font-weight: 400;\n"])));
|
|
29
|
+
exports.LinkWrapper = (0, styled_components_3.default)(Link_1.Link)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-size: 14px;\n font-weight: 600;\n color: ", ";\n margin-right: 10px;\n"], ["\n font-size: 14px;\n font-weight: 600;\n color: ", ";\n margin-right: 10px;\n"])), function (_a) {
|
|
24
30
|
var $colorFill = _a.$colorFill;
|
|
25
31
|
return $colorFill;
|
|
26
32
|
});
|
|
27
|
-
|
|
33
|
+
exports.ActionButton = styled_components_3.default.button(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-right: 10px;\n font-size: 14px;\n font-weight: 600;\n color: ", ";\n border: none;\n background-color: transparent;\n cursor: pointer;\n"], ["\n margin-right: 10px;\n font-size: 14px;\n font-weight: 600;\n color: ", ";\n border: none;\n background-color: transparent;\n cursor: pointer;\n"])), function (_a) {
|
|
28
34
|
var $colorFill = _a.$colorFill;
|
|
29
35
|
return $colorFill;
|
|
30
36
|
});
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
exports.CloseBtn = styled_components_3.default.button(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n height: 30px;\n width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n border: none;\n margin-right: 5px;\n background-color: transparent;\n & :hover {\n cursor: pointer;\n }\n"], ["\n height: 30px;\n width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n border: none;\n margin-right: 5px;\n background-color: transparent;\n & :hover {\n cursor: pointer;\n }\n"])));
|
|
38
|
+
exports.Description = styled_components_3.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n position: absolute;\n top: 3px;\n right: 8px;\n color: ", ";\n font-size: 10px;\n"], ["\n position: absolute;\n top: 3px;\n right: 8px;\n color: ", ";\n font-size: 10px;\n"])), (0, styled_components_2.th)('colors.gray'));
|
|
33
39
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -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;
|
|
@@ -24,14 +25,20 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
25
|
}
|
|
25
26
|
return t;
|
|
26
27
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.Avatar = void 0;
|
|
33
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
34
|
+
var styled_components_1 = __importDefault(require("@xstyled/styled-components"));
|
|
35
|
+
var styled_components_2 = require("@xstyled/styled-components");
|
|
36
|
+
var Icon_1 = require("../Icon");
|
|
31
37
|
var defaultDimension = 100;
|
|
32
|
-
var StyledAvatarWrap =
|
|
33
|
-
|
|
38
|
+
var StyledAvatarWrap = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n overflow: hidden;\n color: ", ";\n background-color: ", ";\n width: ", ";\n height: ", ";\n :hover {\n background-color: ", ";\n }\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n overflow: hidden;\n color: ", ";\n background-color: ", ";\n width: ", ";\n height: ", ";\n :hover {\n background-color: ", ";\n }\n"])), function (props) { return (props.$colorFront ? styled_components_2.th.color(props.$colorFront) : 'auto'); }, function (props) { return (props.$colorBack ? styled_components_2.th.color(props.$colorBack) : 'auto'); }, function (props) { return "".concat(props.size, "px"); }, function (props) { return "".concat(props.size, "px"); }, function (props) { return (props.$hoverColorBack ? styled_components_2.th.color(props.$hoverColorBack) : 'auto'); });
|
|
39
|
+
var Avatar = function (_a) {
|
|
34
40
|
var src = _a.src, _b = _a.size, size = _b === void 0 ? defaultDimension : _b, colorFront = _a.colorFront, colorBack = _a.colorBack, className = _a.className, hoverColorBack = _a.hoverColorBack, rest = __rest(_a, ["src", "size", "colorFront", "colorBack", "className", "hoverColorBack"]);
|
|
35
|
-
return (
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(StyledAvatarWrap, __assign({ size: size || 34, className: className, "$colorBack": colorBack || 'neutral20', "$colorFront": colorFront || 'blue2', "$hoverColorBack": hoverColorBack || 'lightGray7' }, rest, { children: src ? (0, jsx_runtime_1.jsx)("img", { src: src, width: size, height: size }) : (0, jsx_runtime_1.jsx)(Icon_1.Profile, {}) })) }));
|
|
36
42
|
};
|
|
43
|
+
exports.Avatar = Avatar;
|
|
37
44
|
var templateObject_1;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Avatar = void 0;
|
|
4
|
+
var Avatar_1 = require("./Avatar");
|
|
5
|
+
var Avatar_2 = require("./Avatar");
|
|
6
|
+
Object.defineProperty(exports, "Avatar", { enumerable: true, get: function () { return Avatar_2.Avatar; } });
|
|
7
|
+
exports.default = Avatar_1.Avatar;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WithImage = exports.Default = void 0;
|
|
4
|
+
var Avatar_1 = require("../Avatar");
|
|
2
5
|
var image = 'data:image/png;base64,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';
|
|
3
6
|
var meta = {
|
|
4
7
|
title: 'Elements/Avatar',
|
|
5
|
-
component: Avatar,
|
|
8
|
+
component: Avatar_1.Avatar,
|
|
6
9
|
tags: ['autodocs'],
|
|
7
10
|
argTypes: {},
|
|
8
11
|
};
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
exports.default = meta;
|
|
13
|
+
exports.Default = {
|
|
11
14
|
args: {
|
|
12
15
|
size: 100,
|
|
13
16
|
},
|
|
14
17
|
};
|
|
15
|
-
|
|
18
|
+
exports.WithImage = {
|
|
16
19
|
args: {
|
|
17
20
|
size: 100,
|
|
18
21
|
src: image,
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,11 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
4
|
return cooked;
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
+
var styled_components_1 = __importStar(require("@xstyled/styled-components"));
|
|
32
|
+
var styled_components_2 = require("@xstyled/styled-components");
|
|
33
|
+
var Circle = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 2px;\n color: white;\n background-color: ", ";\n border-radius: 50%;\n width: ", ";\n height: ", ";\n\n .label {\n font-family: ", ";\n font-weight: 600;\n vertical-align: middle;\n text-align: center;\n font-size: ", ";\n }\n\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(", ");\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 2px;\n color: white;\n background-color: ", ";\n border-radius: 50%;\n width: ", ";\n height: ", ";\n\n .label {\n font-family: ", ";\n font-weight: 600;\n vertical-align: middle;\n text-align: center;\n font-size: ", ";\n }\n\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(", ");\n"])), function (_a) {
|
|
9
34
|
var color = _a.color;
|
|
10
35
|
return color;
|
|
11
36
|
}, function (_a) {
|
|
@@ -14,27 +39,27 @@ var Circle = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateOb
|
|
|
14
39
|
}, function (_a) {
|
|
15
40
|
var size = _a.size;
|
|
16
41
|
return size;
|
|
17
|
-
}, th('fonts.primary'), function (_a) {
|
|
42
|
+
}, (0, styled_components_2.th)('fonts.primary'), function (_a) {
|
|
18
43
|
var fontSize = _a.fontSize;
|
|
19
44
|
return "".concat(fontSize, "px");
|
|
20
45
|
}, function (_a) {
|
|
21
46
|
var topPosition = _a.topPosition;
|
|
22
47
|
return (topPosition ? '75%, -75%' : '50%, -50%');
|
|
23
48
|
});
|
|
24
|
-
var RelativeWrap =
|
|
49
|
+
var RelativeWrap = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n ", ";\n"], ["\n position: relative;\n ", ";\n"])), function (_a) {
|
|
25
50
|
var width = _a.width;
|
|
26
51
|
return width
|
|
27
|
-
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", ";\n "], ["\n width: ", ";\n "])), width) : '';
|
|
52
|
+
? (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", ";\n "], ["\n width: ", ";\n "])), width) : '';
|
|
28
53
|
});
|
|
29
54
|
var Badge = function (_a) {
|
|
30
55
|
var children = _a.children, _b = _a.color, color = _b === void 0 ? 'red2' : _b, _c = _a.size, size = _c === void 0 ? 6 : _c, _d = _a.fontSize, fontSize = _d === void 0 ? 10 : _d, label = _a.label, childWidth = _a.childWidth, topPosition = _a.topPosition;
|
|
31
|
-
var theme = useTheme();
|
|
32
|
-
var themeColor = th.color(color)({ theme: theme });
|
|
33
|
-
var themeSize = th.fontSize(size)({ theme: theme });
|
|
56
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
57
|
+
var themeColor = styled_components_2.th.color(color)({ theme: theme });
|
|
58
|
+
var themeSize = styled_components_2.th.fontSize(size)({ theme: theme });
|
|
34
59
|
if (!label || (typeof label === 'number' && label <= 0)) {
|
|
35
|
-
return
|
|
60
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
36
61
|
}
|
|
37
|
-
return (
|
|
62
|
+
return ((0, jsx_runtime_1.jsxs)(RelativeWrap, { width: childWidth, children: [(0, jsx_runtime_1.jsx)(Circle, { color: themeColor, size: themeSize, topPosition: topPosition, fontSize: fontSize, children: (0, jsx_runtime_1.jsx)("div", { className: "label", children: label }) }), children] }));
|
|
38
63
|
};
|
|
39
|
-
|
|
64
|
+
exports.default = Badge;
|
|
40
65
|
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.Badge = void 0;
|
|
7
|
+
var Badge_1 = __importDefault(require("./Badge"));
|
|
8
|
+
exports.Badge = Badge_1.default;
|
|
9
|
+
exports.default = Badge_1.default;
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
|
|
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.Colored = exports.Primary = void 0;
|
|
7
|
+
var Badge_1 = __importDefault(require("../Badge"));
|
|
2
8
|
var meta = {
|
|
3
9
|
title: 'Elements/Badge',
|
|
4
|
-
component:
|
|
10
|
+
component: Badge_1.default,
|
|
5
11
|
tags: ['autodocs'],
|
|
6
12
|
argTypes: {},
|
|
7
13
|
};
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
exports.default = meta;
|
|
15
|
+
exports.Primary = {
|
|
10
16
|
args: {
|
|
11
17
|
children: '😀',
|
|
12
18
|
size: 1,
|
|
13
19
|
childWidth: '30px',
|
|
14
20
|
},
|
|
15
21
|
};
|
|
16
|
-
|
|
22
|
+
exports.Colored = {
|
|
17
23
|
args: {
|
|
18
24
|
children: '😃',
|
|
19
25
|
label: '10',
|