@mailstep/design-system 0.6.2-beta.2 → 0.6.2-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/ui/Blocks/CommonGrid/CommonGrid.js +38 -33
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +33 -28
- package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +10 -8
- package/ui/Blocks/CommonGrid/StandardButtons.js +20 -11
- package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +26 -21
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +13 -8
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +48 -20
- package/ui/Blocks/CommonGrid/components/ActionHead/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +15 -10
- package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +19 -14
- package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +22 -17
- package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +50 -22
- package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ColumnTitle.js +13 -8
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +38 -9
- package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/DataCell.js +18 -13
- package/ui/Blocks/CommonGrid/components/DataRow.js +35 -30
- package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +59 -31
- package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +5 -1
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +41 -12
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/FilterDropdown.js +13 -8
- package/ui/Blocks/CommonGrid/components/FilterRow.js +20 -15
- package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +23 -17
- package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +15 -10
- package/ui/Blocks/CommonGrid/components/GridSelect/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/GroupRow.js +15 -10
- package/ui/Blocks/CommonGrid/components/HeadCell.js +19 -14
- package/ui/Blocks/CommonGrid/components/HeadRow.js +45 -17
- package/ui/Blocks/CommonGrid/components/IconList/IconList.js +18 -12
- package/ui/Blocks/CommonGrid/components/IconList/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +14 -12
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +24 -17
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +28 -23
- package/ui/Blocks/CommonGrid/components/NumberRange/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/NumberRange/types.js +2 -1
- package/ui/Blocks/CommonGrid/components/OversizedScroll.js +39 -11
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +12 -10
- package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/Resize.js +12 -7
- package/ui/Blocks/CommonGrid/components/Table.js +37 -9
- package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +40 -12
- package/ui/Blocks/CommonGrid/components/TablePagination/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +36 -30
- package/ui/Blocks/CommonGrid/components/TextRange/index.js +7 -2
- package/ui/Blocks/CommonGrid/components/TextRange/types.js +2 -1
- package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +41 -12
- package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.js +11 -4
- package/ui/Blocks/CommonGrid/components/gridCells/Date.js +13 -6
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +13 -6
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +16 -9
- package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +15 -8
- package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +15 -8
- package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +16 -9
- package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +9 -3
- package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +18 -11
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +20 -13
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +12 -5
- package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +11 -4
- package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.js +40 -10
- package/ui/Blocks/CommonGrid/components/gridCells/index.js +31 -14
- package/ui/Blocks/CommonGrid/components/icons/Edit.js +5 -3
- package/ui/Blocks/CommonGrid/components/icons/EyeOpen.js +5 -3
- package/ui/Blocks/CommonGrid/components/icons/Sorting.js +8 -3
- package/ui/Blocks/CommonGrid/components/utils.js +7 -3
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.js +10 -6
- package/ui/Blocks/CommonGrid/hooks/useColumnSizes.js +18 -13
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +12 -7
- package/ui/Blocks/CommonGrid/hooks/useFloatingButton.js +5 -3
- package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +11 -9
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.js +14 -7
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +8 -6
- package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.js +8 -3
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.js +8 -4
- package/ui/Blocks/CommonGrid/hooks/useUxReset.js +9 -4
- package/ui/Blocks/CommonGrid/index.js +51 -10
- package/ui/Blocks/CommonGrid/store/index.js +86 -77
- package/ui/Blocks/CommonGrid/store/migrateState.js +3 -1
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +24 -17
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +19 -12
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +15 -8
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +15 -8
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +15 -8
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +19 -12
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +17 -10
- package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +19 -12
- package/ui/Blocks/CommonGrid/storybook/utils/actions.js +11 -4
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +17 -11
- package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.js +10 -6
- package/ui/Blocks/CommonGrid/storybook/utils/utils.js +35 -26
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.js +17 -10
- package/ui/Blocks/CommonGrid/storybook/utils/withRouter.js +6 -4
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +3 -1
- package/ui/Blocks/CommonGrid/styles.js +39 -10
- package/ui/Blocks/CommonGrid/translations.js +5 -3
- package/ui/Blocks/CommonGrid/types.js +6 -3
- package/ui/Blocks/CommonGrid/utils/index.js +40 -23
- package/ui/Blocks/CornerDialog/CornerDialog.js +15 -11
- package/ui/Blocks/CornerDialog/index.js +4 -2
- package/ui/Blocks/CornerDialog/stories/CornerDialog.stories.js +10 -7
- package/ui/Blocks/CornerDialog/styles.js +35 -9
- package/ui/Blocks/CornerDialog/types.js +2 -1
- package/ui/Blocks/CornerDialog/utils.js +5 -2
- package/ui/Blocks/HidePrint/HidePrint.js +10 -5
- package/ui/Blocks/ImageList/ImageList.js +42 -15
- package/ui/Blocks/ImageList/components/AddPhoto/index.js +11 -7
- package/ui/Blocks/ImageList/components/AddPhoto/styles.js +29 -3
- package/ui/Blocks/ImageList/components/CloseButton/index.js +9 -5
- package/ui/Blocks/ImageList/components/CloseButton/styles.js +29 -3
- package/ui/Blocks/ImageList/components/ImageElement/index.js +11 -7
- package/ui/Blocks/ImageList/components/ImageElement/styles.js +29 -3
- package/ui/Blocks/ImageList/components/ImageTag/index.js +12 -5
- package/ui/Blocks/ImageList/components/ImageTag/styles.js +8 -2
- package/ui/Blocks/ImageList/index.js +4 -2
- package/ui/Blocks/ImageList/stories/ImageList.stories.js +9 -6
- package/ui/Blocks/ImageList/styles.js +8 -2
- package/ui/Blocks/ImageList/types.js +2 -1
- package/ui/Blocks/LightBox/LightBox.js +15 -8
- package/ui/Blocks/LightBox/hooks/useLightBox.js +9 -5
- package/ui/Blocks/LightBox/index.js +7 -3
- package/ui/Blocks/LightBox/stories/LightBox.stories.js +7 -4
- package/ui/Blocks/LightBox/styles.js +11 -5
- package/ui/Blocks/LightBox/types.js +2 -1
- package/ui/Blocks/Modal/Modal.js +20 -17
- package/ui/Blocks/Modal/hooks/useClickOutside.js +10 -6
- package/ui/Blocks/Modal/hooks/useModal.js +10 -6
- package/ui/Blocks/Modal/index.js +9 -4
- package/ui/Blocks/Modal/stories/Modal.stories.js +48 -42
- package/ui/Blocks/Modal/styles.js +46 -20
- package/ui/Blocks/Modal/types.js +2 -1
- package/ui/Blocks/Modal/utils.js +4 -1
- package/ui/Blocks/Popover/index.js +15 -10
- package/ui/Blocks/Tabs/TabContent.js +5 -1
- package/ui/Blocks/Tabs/Tabs.js +14 -10
- package/ui/Blocks/Tabs/hooks/useTabs.js +8 -4
- package/ui/Blocks/Tabs/index.js +9 -4
- package/ui/Blocks/Tabs/stories/Tabs.stories.js +9 -6
- package/ui/Blocks/Tabs/styles.js +34 -8
- package/ui/Blocks/Tabs/types.js +2 -1
- package/ui/Elements/Alert/Alert.js +12 -10
- package/ui/Elements/Alert/index.js +9 -3
- package/ui/Elements/Alert/stories/Alert.stories.js +14 -11
- package/ui/Elements/Alert/styles.js +20 -14
- package/ui/Elements/Alert/types.js +2 -1
- package/ui/Elements/Avatar/Avatar.js +14 -7
- package/ui/Elements/Avatar/index.js +7 -3
- package/ui/Elements/Avatar/stories/Avatar.stories.js +8 -5
- package/ui/Elements/Avatar/types.js +2 -1
- package/ui/Elements/Badge/Badge.js +38 -13
- package/ui/Elements/Badge/index.js +9 -3
- package/ui/Elements/Badge/stories/Badge.stories.js +11 -5
- package/ui/Elements/BorderedBox/BorderedBox.js +30 -5
- package/ui/Elements/BorderedBox/index.js +9 -3
- package/ui/Elements/BorderedBox/stories/BorderedBox.stories.js +7 -4
- package/ui/Elements/BorderedBox/types.js +2 -1
- package/ui/Elements/Button/Button.js +7 -5
- package/ui/Elements/Button/index.js +9 -3
- package/ui/Elements/Button/stories/Button.stories.js +16 -13
- package/ui/Elements/Button/styles.js +14 -8
- package/ui/Elements/Button/types.js +2 -1
- package/ui/Elements/Card/Card.js +20 -14
- package/ui/Elements/Card/index.js +12 -3
- package/ui/Elements/Card/stories/Card.stories.js +11 -8
- package/ui/Elements/Card/stories/CardComponent.stories.js +12 -6
- package/ui/Elements/Card/styles.js +38 -12
- package/ui/Elements/Card/types.js +2 -1
- package/ui/Elements/DatePicker/DatePicker.js +53 -25
- package/ui/Elements/DatePicker/Datetime/DateTime.js +31 -26
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +47 -20
- package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +6 -3
- package/ui/Elements/DatePicker/Datetime/types.js +2 -1
- package/ui/Elements/DatePicker/Datetime/views/DaysView.js +18 -13
- package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +14 -9
- package/ui/Elements/DatePicker/Datetime/views/YearsView.js +14 -9
- package/ui/Elements/DatePicker/index.js +7 -2
- package/ui/Elements/DatePicker/styles.js +29 -3
- package/ui/Elements/Dropdown/Dropdown.js +15 -10
- package/ui/Elements/Dropdown/index.js +9 -3
- package/ui/Elements/Dropdown/stories/Dropdown.stories.js +10 -4
- package/ui/Elements/Dropdown/types.js +2 -1
- package/ui/Elements/DropdownMenu/DropdownMenu.js +15 -8
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +32 -7
- package/ui/Elements/DropdownMenu/components/MenuItem.js +15 -10
- package/ui/Elements/DropdownMenu/components/MenuList.js +10 -5
- package/ui/Elements/DropdownMenu/index.js +5 -1
- package/ui/Elements/DropdownMenu/types.js +2 -1
- package/ui/Elements/DropdownSelect/DropdownSelect.js +50 -21
- package/ui/Elements/DropdownSelect/index.js +10 -3
- package/ui/Elements/ErrorMessage/ErrorMessage.js +34 -9
- package/ui/Elements/ErrorMessage/index.js +9 -3
- package/ui/Elements/ErrorMessage/stories/ErrorMessage.stories.js +11 -5
- package/ui/Elements/ErrorMessage/types.js +2 -1
- package/ui/Elements/HighlightBox/HighlightBox.js +38 -12
- package/ui/Elements/HighlightBox/index.js +7 -2
- package/ui/Elements/Icon/BadgeIcon.js +17 -10
- package/ui/Elements/Icon/Icon.js +245 -216
- package/ui/Elements/Icon/icons/AddPhoto.js +6 -2
- package/ui/Elements/Icon/icons/BarcodeScan.js +6 -2
- package/ui/Elements/Icon/icons/Box.js +6 -2
- package/ui/Elements/Icon/icons/Calendar.js +6 -2
- package/ui/Elements/Icon/icons/Cancel.js +6 -2
- package/ui/Elements/Icon/icons/CheckedBox.js +6 -2
- package/ui/Elements/Icon/icons/Company.js +6 -2
- package/ui/Elements/Icon/icons/Complaint.js +6 -2
- package/ui/Elements/Icon/icons/Consolidation.js +6 -2
- package/ui/Elements/Icon/icons/Dispatch.js +6 -2
- package/ui/Elements/Icon/icons/EmptyRack.js +6 -2
- package/ui/Elements/Icon/icons/Expeditions.js +6 -2
- package/ui/Elements/Icon/icons/FlagCZ.js +6 -2
- package/ui/Elements/Icon/icons/FlagEL.js +6 -2
- package/ui/Elements/Icon/icons/FlagESP.js +6 -2
- package/ui/Elements/Icon/icons/FlagITA.js +6 -2
- package/ui/Elements/Icon/icons/FlagRUS.js +6 -2
- package/ui/Elements/Icon/icons/FlagSVK.js +6 -2
- package/ui/Elements/Icon/icons/FlagUSA.js +6 -2
- package/ui/Elements/Icon/icons/Gift.js +6 -2
- package/ui/Elements/Icon/icons/Group.js +6 -2
- package/ui/Elements/Icon/icons/HamburgerMenu.js +6 -2
- package/ui/Elements/Icon/icons/HelpCircle1.js +6 -2
- package/ui/Elements/Icon/icons/ImagePlaceholder.js +6 -2
- package/ui/Elements/Icon/icons/Income.js +6 -2
- package/ui/Elements/Icon/icons/Info.js +6 -2
- package/ui/Elements/Icon/icons/Integrations.js +6 -2
- package/ui/Elements/Icon/icons/Inventory.js +6 -2
- package/ui/Elements/Icon/icons/Inventory2.js +6 -2
- package/ui/Elements/Icon/icons/Link.js +6 -2
- package/ui/Elements/Icon/icons/Location.js +6 -2
- package/ui/Elements/Icon/icons/Logout1.js +6 -2
- package/ui/Elements/Icon/icons/MakePhoto.js +6 -2
- package/ui/Elements/Icon/icons/MenuItems.js +6 -2
- package/ui/Elements/Icon/icons/MobileCancel.js +6 -2
- package/ui/Elements/Icon/icons/Notification2.js +6 -2
- package/ui/Elements/Icon/icons/OpenBox.js +6 -2
- package/ui/Elements/Icon/icons/Plus1.js +6 -2
- package/ui/Elements/Icon/icons/Print.js +6 -2
- package/ui/Elements/Icon/icons/Product.js +6 -2
- package/ui/Elements/Icon/icons/Products.js +6 -2
- package/ui/Elements/Icon/icons/Profile.js +6 -2
- package/ui/Elements/Icon/icons/Puzzle1.js +6 -2
- package/ui/Elements/Icon/icons/QRCode.js +6 -2
- package/ui/Elements/Icon/icons/Rack.js +6 -2
- package/ui/Elements/Icon/icons/Return.js +6 -2
- package/ui/Elements/Icon/icons/Rows.js +6 -2
- package/ui/Elements/Icon/icons/Settings2.js +6 -2
- package/ui/Elements/Icon/icons/ShoppingBag.js +6 -2
- package/ui/Elements/Icon/icons/ThreeDots.js +6 -2
- package/ui/Elements/Icon/icons/Transfer.js +6 -2
- package/ui/Elements/Icon/icons/Truck.js +6 -2
- package/ui/Elements/Icon/icons/TwoBoxes.js +6 -2
- package/ui/Elements/Icon/icons/TwoCheckedBoxes.js +6 -2
- package/ui/Elements/Icon/icons/TwoUsers.js +6 -2
- package/ui/Elements/Icon/icons/index.js +114 -55
- package/ui/Elements/Icon/index.js +26 -5
- package/ui/Elements/Icon/stories/BadgeIcon.stories.js +12 -6
- package/ui/Elements/Icon/stories/Icon.stories.js +12 -9
- package/ui/Elements/Icon/types.js +2 -1
- package/ui/Elements/Image/Image.js +6 -4
- package/ui/Elements/Image/index.js +9 -3
- package/ui/Elements/Image/stories/Image.stories.js +15 -9
- package/ui/Elements/Image/types.js +2 -1
- package/ui/Elements/Label/Label.js +35 -9
- package/ui/Elements/Label/index.js +8 -3
- package/ui/Elements/Label/stories/Label.stories.js +8 -5
- package/ui/Elements/Line/Line.js +10 -5
- package/ui/Elements/Line/index.js +9 -3
- package/ui/Elements/Line/stories/Line.stories.js +16 -10
- package/ui/Elements/Line/types.js +2 -1
- package/ui/Elements/Link/Link.js +39 -14
- package/ui/Elements/Link/index.js +9 -3
- package/ui/Elements/Link/stories/Link.stories.js +13 -10
- package/ui/Elements/Logo/Logo.js +30 -25
- package/ui/Elements/Logo/index.js +9 -3
- package/ui/Elements/Logo/stories/Logo.stories.js +24 -18
- package/ui/Elements/Logo/types.js +2 -1
- package/ui/Elements/MultiSelect/MultiSelect.js +9 -4
- package/ui/Elements/MultiSelect/index.js +7 -2
- package/ui/Elements/Pagination/Pagination.js +9 -7
- package/ui/Elements/Pagination/index.js +9 -3
- package/ui/Elements/Pagination/stories/Pagination.stories.js +8 -5
- package/ui/Elements/Pagination/styled.js +41 -12
- package/ui/Elements/Portal/index.js +14 -7
- package/ui/Elements/ProgressBar/ProgressBar.js +6 -4
- package/ui/Elements/ProgressBar/index.js +9 -3
- package/ui/Elements/ProgressBar/stories/ProgressBar.stories.js +12 -6
- package/ui/Elements/ProgressBar/styles.js +38 -12
- package/ui/Elements/Select/Select.js +25 -20
- package/ui/Elements/Select/index.js +7 -2
- package/ui/Elements/Select/styles.js +13 -7
- package/ui/Elements/Select/themes/CustomComponents.js +72 -37
- package/ui/Elements/Select/themes/baseStyles.js +12 -6
- package/ui/Elements/Select/themes/formStyles.js +27 -23
- package/ui/Elements/Select/themes/index.js +20 -16
- package/ui/Elements/Select/types.js +2 -1
- package/ui/Elements/SimpleLink/SimpleLink.js +31 -6
- package/ui/Elements/SimpleLink/index.js +9 -3
- package/ui/Elements/SingleSelect/SingleSelect.js +32 -27
- package/ui/Elements/SingleSelect/index.js +7 -2
- package/ui/Elements/SpaceAround/SpaceAround.js +36 -11
- package/ui/Elements/SpaceAround/index.js +9 -3
- package/ui/Elements/SpaceAround/stories/SpaceAround.stories.js +8 -5
- package/ui/Elements/SpaceAround/types.js +2 -1
- package/ui/Elements/Spinner/Spinner.js +12 -8
- package/ui/Elements/Spinner/index.js +9 -3
- package/ui/Elements/Spinner/stories/Spinner.stories.js +16 -13
- package/ui/Elements/Spinner/styles.js +33 -7
- package/ui/Elements/Spinner/types.js +2 -1
- package/ui/Elements/Tag/Tag.js +31 -6
- package/ui/Elements/Tag/index.js +10 -3
- package/ui/Elements/Tag/palletes.js +4 -1
- package/ui/Elements/Tag/stories/Tag.stories.js +21 -15
- package/ui/Elements/Tag/stories/components/predefinedTags.js +11 -6
- package/ui/Elements/Tag/types.js +2 -1
- package/ui/Elements/Text/Text.js +6 -4
- package/ui/Elements/Text/index.js +8 -2
- package/ui/Elements/Text/stories/Text.stories.js +15 -9
- package/ui/Elements/Text/types.js +2 -1
- package/ui/Elements/Toast/Toast.js +15 -10
- package/ui/Elements/Toast/index.js +9 -3
- package/ui/Elements/Toggle/Toggle.js +38 -13
- package/ui/Elements/Toggle/index.js +9 -3
- package/ui/Elements/Toggle/stories/Toggle.stories.js +13 -7
- package/ui/Elements/Toggle/types.js +2 -1
- package/ui/Elements/Typography/Typography.js +44 -28
- package/ui/Elements/Typography/index.js +19 -3
- package/ui/Elements/Typography/stories/Typography.stories.js +18 -15
- package/ui/Forms/Checkbox/Checkbox.js +11 -9
- package/ui/Forms/Checkbox/index.js +9 -3
- package/ui/Forms/Checkbox/stories/Checkbox.stories.js +13 -7
- package/ui/Forms/Checkbox/styles.js +32 -6
- package/ui/Forms/Checkbox/types.js +2 -1
- package/ui/Forms/Input/Input.js +20 -16
- package/ui/Forms/Input/index.js +6 -3
- package/ui/Forms/Input/stories/Input.stories.js +14 -11
- package/ui/Forms/Input/styles.js +46 -20
- package/ui/Forms/Input/types.js +2 -1
- package/ui/Forms/RadioButton/RadioButton.js +8 -6
- package/ui/Forms/RadioButton/index.js +9 -3
- package/ui/Forms/RadioButton/stories/RadioButton.stories.js +13 -7
- package/ui/Forms/RadioButton/styles.js +13 -7
- package/ui/Forms/RadioButton/types.js +2 -1
- package/ui/Forms/TextArea/TextArea.js +13 -8
- package/ui/Forms/TextArea/index.js +7 -2
- package/ui/Forms/TextArea/styles.js +39 -13
- package/ui/System/Fonts/index.js +14 -9
- package/ui/ThemeProvider/ThemeProvider.js +13 -7
- package/ui/ThemeProvider/index.js +25 -5
- package/ui/ThemeProvider/themes/default.js +3 -1
- package/ui/ThemeProvider/themes/index.js +12 -7
- package/ui/ThemeProvider/themes/light.js +3 -1
- package/ui/ThemeProvider/themes/mailwise.js +3 -1
- package/ui/ThemeProvider/types.js +2 -1
- package/ui/index.js +146 -85
- package/ui/index.umd.js +3878 -0
- package/ui/utils/CreateRgba/createRgba.js +12 -5
- package/ui/utils/CreateRgba/types.js +2 -1
- package/ui/utils/KeyPress/KeyPress.js +6 -4
- package/ui/utils/KeyPress/KeyPress.stories.js +12 -6
- package/ui/utils/KeyPress/index.js +7 -2
- package/ui/utils/KeyPress/types.js +2 -1
- package/ui/utils/index.js +13 -6
- package/ui/index.cjs.js +0 -3878
|
@@ -1,30 +1,36 @@
|
|
|
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.VariantGrid = exports.Disabled = exports.Checked = exports.Default = void 0;
|
|
7
|
+
var Toggle_1 = __importDefault(require("../Toggle"));
|
|
2
8
|
var meta = {
|
|
3
9
|
title: 'Elements/Toggle',
|
|
4
|
-
component:
|
|
10
|
+
component: Toggle_1.default,
|
|
5
11
|
tags: ['autodocs'],
|
|
6
12
|
argTypes: {},
|
|
7
13
|
};
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
exports.default = meta;
|
|
15
|
+
exports.Default = {
|
|
10
16
|
args: {
|
|
11
17
|
label: 'Label',
|
|
12
18
|
},
|
|
13
19
|
};
|
|
14
|
-
|
|
20
|
+
exports.Checked = {
|
|
15
21
|
args: {
|
|
16
22
|
label: 'Label',
|
|
17
23
|
checked: true,
|
|
18
24
|
},
|
|
19
25
|
};
|
|
20
|
-
|
|
26
|
+
exports.Disabled = {
|
|
21
27
|
args: {
|
|
22
28
|
label: 'Label',
|
|
23
29
|
checked: true,
|
|
24
30
|
disabled: true,
|
|
25
31
|
},
|
|
26
32
|
};
|
|
27
|
-
|
|
33
|
+
exports.VariantGrid = {
|
|
28
34
|
args: {
|
|
29
35
|
label: 'Label',
|
|
30
36
|
checked: true,
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -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,33 +10,48 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
10
|
};
|
|
10
11
|
return __assign.apply(this, arguments);
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.H7 = exports.H6 = exports.H5 = exports.H4 = exports.H3 = exports.H2 = exports.H1 = exports.Paragraph5 = exports.Paragraph4 = exports.Paragraph3 = exports.Paragraph2 = exports.Paragraph1 = exports.Text = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var Text_1 = require("../Text");
|
|
17
|
+
var Text = function (props) { return (0, jsx_runtime_1.jsx)(Text_1.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
18
|
+
exports.Text = Text;
|
|
19
|
+
exports.Text.defaultProps = { fontFamily: 'primary' };
|
|
16
20
|
// Paragraphs
|
|
17
|
-
|
|
18
|
-
Paragraph1
|
|
19
|
-
|
|
20
|
-
Paragraph2
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
var Paragraph1 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
22
|
+
exports.Paragraph1 = Paragraph1;
|
|
23
|
+
exports.Paragraph1.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '18px' };
|
|
24
|
+
var Paragraph2 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
25
|
+
exports.Paragraph2 = Paragraph2;
|
|
26
|
+
exports.Paragraph2.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '16px' };
|
|
27
|
+
var Paragraph3 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
28
|
+
exports.Paragraph3 = Paragraph3;
|
|
29
|
+
exports.Paragraph3.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '14px' };
|
|
30
|
+
var Paragraph4 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
31
|
+
exports.Paragraph4 = Paragraph4;
|
|
32
|
+
exports.Paragraph4.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '12px' };
|
|
33
|
+
var Paragraph5 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
34
|
+
exports.Paragraph5 = Paragraph5;
|
|
35
|
+
exports.Paragraph5.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '10px' };
|
|
27
36
|
// Headings
|
|
28
|
-
|
|
29
|
-
H1
|
|
30
|
-
|
|
31
|
-
H2
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
var H1 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
38
|
+
exports.H1 = H1;
|
|
39
|
+
exports.H1.defaultProps = { as: 'h1', fontFamily: 'heading', fontSize: '32px', mt: 2, mb: 2 };
|
|
40
|
+
var H2 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
41
|
+
exports.H2 = H2;
|
|
42
|
+
exports.H2.defaultProps = { as: 'h2', fontFamily: 'heading', fontSize: '24px', mt: 2, mb: 2 };
|
|
43
|
+
var H3 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
44
|
+
exports.H3 = H3;
|
|
45
|
+
exports.H3.defaultProps = { as: 'h3', fontFamily: 'heading', fontSize: '21px', mt: 2, mb: 2 };
|
|
46
|
+
var H4 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
47
|
+
exports.H4 = H4;
|
|
48
|
+
exports.H4.defaultProps = { as: 'h4', fontFamily: 'heading', fontSize: '18px', mt: 2, mb: 2 };
|
|
49
|
+
var H5 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
50
|
+
exports.H5 = H5;
|
|
51
|
+
exports.H5.defaultProps = { as: 'h5', fontFamily: 'heading', fontSize: '16px', mt: 2, mb: 2 };
|
|
52
|
+
var H6 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
53
|
+
exports.H6 = H6;
|
|
54
|
+
exports.H6.defaultProps = { as: 'h6', fontFamily: 'heading', fontSize: '14px', mt: 2, mb: 2 };
|
|
55
|
+
var H7 = function (props) { return (0, jsx_runtime_1.jsx)(exports.Text, __assign({}, props, { fontWeight: props.variant })); };
|
|
56
|
+
exports.H7 = H7;
|
|
57
|
+
exports.H7.defaultProps = { as: 'h6', fontFamily: 'heading', fontSize: '12px', mt: 2, mb: 2 };
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var Typography_1 = require("./Typography");
|
|
18
|
+
__exportStar(require("./Typography"), exports);
|
|
19
|
+
exports.default = Typography_1.Text;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.P5 = exports.P4 = exports.P3 = exports.P2 = exports.P1 = exports.Heading7 = exports.Heading6 = exports.Heading5 = exports.Heading4 = exports.Heading3 = exports.Heading2 = exports.Heading1 = void 0;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var __1 = require("../");
|
|
3
6
|
var meta = {
|
|
4
7
|
title: 'Elements/Typography',
|
|
5
8
|
tags: ['autodocs'],
|
|
6
9
|
argTypes: {},
|
|
7
10
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
exports.default = meta;
|
|
12
|
+
exports.Heading1 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.H1, { children: "Heading H1" }); } };
|
|
13
|
+
exports.Heading2 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.H2, { children: "Heading H2" }); } };
|
|
14
|
+
exports.Heading3 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.H3, { children: "Heading H3" }); } };
|
|
15
|
+
exports.Heading4 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.H4, { children: "Heading H4" }); } };
|
|
16
|
+
exports.Heading5 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.H5, { children: "Heading H5" }); } };
|
|
17
|
+
exports.Heading6 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.H6, { children: "Heading H6" }); } };
|
|
18
|
+
exports.Heading7 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.H7, { children: "Heading H7" }); } };
|
|
19
|
+
exports.P1 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.Paragraph1, { children: "Paragraph1" }); } };
|
|
20
|
+
exports.P2 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.Paragraph2, { children: "Paragraph1" }); } };
|
|
21
|
+
exports.P3 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.Paragraph3, { children: "Paragraph1" }); } };
|
|
22
|
+
exports.P4 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.Paragraph4, { children: "Paragraph1" }); } };
|
|
23
|
+
exports.P5 = { render: function () { return (0, jsx_runtime_1.jsx)(__1.Paragraph5, { children: "Paragraph1" }); } };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var styles_1 = require("./styles");
|
|
6
|
+
var styled_components_1 = require("@xstyled/styled-components");
|
|
5
7
|
var Checkbox = function (_a) {
|
|
6
8
|
var name = _a.name, label = _a.label, onChange = _a.onChange, checked = _a.checked, defaultChecked = _a.defaultChecked, _b = _a.size, size = _b === void 0 ? 4 : _b, className = _a.className, disabled = _a.disabled, inputRef = _a.inputRef, readOnly = _a.readOnly, _c = _a.minusIcon, minusIcon = _c === void 0 ? false : _c;
|
|
7
|
-
var theme = useTheme();
|
|
8
|
-
var themeSize = th.fontSize(size)({ theme: theme });
|
|
9
|
-
var id = useId();
|
|
10
|
-
return (
|
|
9
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
10
|
+
var themeSize = styled_components_1.th.fontSize(size)({ theme: theme });
|
|
11
|
+
var id = (0, react_1.useId)();
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.CheckboxWrap, { size: themeSize, className: className, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", ref: inputRef, name: name, checked: checked, defaultChecked: defaultChecked, disabled: disabled, onChange: onChange, value: "", readOnly: readOnly, "data-cy": name && "".concat(name, "Checkbox"), id: id }), (0, jsx_runtime_1.jsx)(styles_1.FakeInput, { size: themeSize, children: (0, jsx_runtime_1.jsx)(styles_1.CheckIcon, { icon: minusIcon ? 'minus' : 'check', size: themeSize }) }), label && (0, jsx_runtime_1.jsx)(styles_1.Label, { htmlFor: id, children: label })] }));
|
|
11
13
|
};
|
|
12
|
-
|
|
14
|
+
exports.default = (0, react_1.memo)(Checkbox);
|
|
@@ -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.Checkbox = void 0;
|
|
7
|
+
var Checkbox_1 = __importDefault(require("./Checkbox"));
|
|
8
|
+
exports.Checkbox = Checkbox_1.default;
|
|
9
|
+
exports.default = Checkbox_1.default;
|
|
@@ -1,32 +1,38 @@
|
|
|
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.CheckboxWithMinusIcon = exports.CheckboxDisabled = exports.CheckboxUnchecked = exports.CheckboxChecked = void 0;
|
|
7
|
+
var Checkbox_1 = __importDefault(require("../Checkbox"));
|
|
2
8
|
var meta = {
|
|
3
9
|
title: 'Forms/Checkbox',
|
|
4
|
-
component:
|
|
10
|
+
component: Checkbox_1.default,
|
|
5
11
|
tags: ['autodocs'],
|
|
6
12
|
argTypes: {},
|
|
7
13
|
};
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
exports.default = meta;
|
|
15
|
+
exports.CheckboxChecked = {
|
|
10
16
|
args: {
|
|
11
17
|
checked: true,
|
|
12
18
|
onChange: function () { return console.log('Clicked'); },
|
|
13
19
|
label: 'Checked',
|
|
14
20
|
},
|
|
15
21
|
};
|
|
16
|
-
|
|
22
|
+
exports.CheckboxUnchecked = {
|
|
17
23
|
args: {
|
|
18
24
|
checked: false,
|
|
19
25
|
label: 'Unchecked',
|
|
20
26
|
},
|
|
21
27
|
};
|
|
22
|
-
|
|
28
|
+
exports.CheckboxDisabled = {
|
|
23
29
|
args: {
|
|
24
30
|
checked: true,
|
|
25
31
|
label: 'Disabled',
|
|
26
32
|
disabled: true,
|
|
27
33
|
},
|
|
28
34
|
};
|
|
29
|
-
|
|
35
|
+
exports.CheckboxWithMinusIcon = {
|
|
30
36
|
args: {
|
|
31
37
|
checked: true,
|
|
32
38
|
label: 'Minus Icon',
|
|
@@ -1,10 +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
|
-
|
|
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.Label = exports.CheckboxWrap = exports.CheckIcon = exports.FakeInput = void 0;
|
|
31
|
+
var styled_components_1 = __importStar(require("@xstyled/styled-components"));
|
|
32
|
+
var Icon_1 = require("../../Elements/Icon");
|
|
33
|
+
exports.FakeInput = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", ";\n min-width: ", ";\n height: ", ";\n border-radius: md;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n transform: rotate(0);\n overflow: hidden;\n border: slim;\n border-color: lightGray5;\n\n input[type='checkbox']:not(:disabled):hover + & {\n border-color: gray1;\n }\n\n input[type='checkbox']:disabled + & {\n background-color: white;\n border-color: lightGray7;\n }\n\n input[type='checkbox']:checked:disabled + & {\n background-color: bgLightGray1;\n border-color: bgLightGray1;\n }\n\n input[type='checkbox']:checked:not(:disabled) + & {\n transform: rotate(0deg);\n background-color: red1;\n border-color: red1;\n }\n\n input[type='checkbox']:not(:checked):not(:disabled) + & {\n transform: rotate(90deg);\n background-color: white;\n border-color: lightGray5;\n }\n"], ["\n width: ", ";\n min-width: ", ";\n height: ", ";\n border-radius: md;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n transform: rotate(0);\n overflow: hidden;\n border: slim;\n border-color: lightGray5;\n\n input[type='checkbox']:not(:disabled):hover + & {\n border-color: gray1;\n }\n\n input[type='checkbox']:disabled + & {\n background-color: white;\n border-color: lightGray7;\n }\n\n input[type='checkbox']:checked:disabled + & {\n background-color: bgLightGray1;\n border-color: bgLightGray1;\n }\n\n input[type='checkbox']:checked:not(:disabled) + & {\n transform: rotate(0deg);\n background-color: red1;\n border-color: red1;\n }\n\n input[type='checkbox']:not(:checked):not(:disabled) + & {\n transform: rotate(90deg);\n background-color: white;\n border-color: lightGray5;\n }\n"])), function (_a) {
|
|
8
34
|
var size = _a.size;
|
|
9
35
|
return size;
|
|
10
36
|
}, function (_a) {
|
|
@@ -14,13 +40,13 @@ export var FakeInput = styled.div(templateObject_1 || (templateObject_1 = __make
|
|
|
14
40
|
var size = _a.size;
|
|
15
41
|
return size;
|
|
16
42
|
});
|
|
17
|
-
|
|
18
|
-
|
|
43
|
+
exports.CheckIcon = (0, styled_components_1.default)(Icon_1.Icon)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: lg;\n transition: all 200ms ease;\n & svg {\n width: 70% !important;\n }\n & path {\n fill: none;\n stroke: none;\n }\n\n input[type='checkbox']:not(:disabled):checked + ", " & {\n & path {\n stroke: white;\n fill: white;\n }\n }\n\n input[type='checkbox']:disabled:checked + ", " & {\n & path {\n fill: ", " !important;\n }\n }\n"], ["\n border-radius: lg;\n transition: all 200ms ease;\n & svg {\n width: 70% !important;\n }\n & path {\n fill: none;\n stroke: none;\n }\n\n input[type='checkbox']:not(:disabled):checked + ", " & {\n & path {\n stroke: white;\n fill: white;\n }\n }\n\n input[type='checkbox']:disabled:checked + ", " & {\n & path {\n fill: ", " !important;\n }\n }\n"])), exports.FakeInput, exports.FakeInput, styled_components_1.th.color('lightGray5'));
|
|
44
|
+
exports.CheckboxWrap = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n display: flex;\n align-items: center;\n overflow: hidden;\n\n input {\n margin: 0;\n width: ", ";\n height: ", ";\n z-index: 1;\n position: absolute;\n opacity: 0;\n top: 50%;\n transform: translateY(-50%);\n left: 0;\n cursor: pointer;\n }\n"], ["\n position: relative;\n display: flex;\n align-items: center;\n overflow: hidden;\n\n input {\n margin: 0;\n width: ", ";\n height: ", ";\n z-index: 1;\n position: absolute;\n opacity: 0;\n top: 50%;\n transform: translateY(-50%);\n left: 0;\n cursor: pointer;\n }\n"])), function (_a) {
|
|
19
45
|
var size = _a.size;
|
|
20
46
|
return size;
|
|
21
47
|
}, function (_a) {
|
|
22
48
|
var size = _a.size;
|
|
23
49
|
return size;
|
|
24
50
|
});
|
|
25
|
-
|
|
51
|
+
exports.Label = styled_components_1.default.label(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: 0;\n margin-left: 8px;\n font-size: 14px;\n"], ["\n margin: 0;\n margin-left: 8px;\n font-size: 14px;\n"])));
|
|
26
52
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/ui/Forms/Input/Input.js
CHANGED
|
@@ -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++) {
|
|
@@ -20,32 +21,34 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
21
|
}
|
|
21
22
|
return t;
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.Input = void 0;
|
|
26
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
var react_1 = require("react");
|
|
28
|
+
var styles_1 = require("./styles");
|
|
29
|
+
var Label_1 = require("../../Elements/Label");
|
|
30
|
+
var SpaceAround_1 = require("../../Elements/SpaceAround");
|
|
31
|
+
var ErrorMessage_1 = require("../../Elements/ErrorMessage");
|
|
32
|
+
var Icon_1 = require("../../Elements/Icon");
|
|
33
|
+
var Spinner_1 = require("../../Elements/Spinner");
|
|
31
34
|
var allowedInputTypes = ['text', 'number', 'password'];
|
|
32
|
-
|
|
35
|
+
var Input = function (_a) {
|
|
33
36
|
var _b = _a.appearance, appearance = _b === void 0 ? 'primary' : _b, type = _a.type, name = _a.name, label = _a.label, value = _a.value, icon = _a.icon, _c = _a.variant, variant = _c === void 0 ? 'default' : _c, disabled = _a.disabled, error = _a.error, _d = _a.isInvalid, isInvalid = _d === void 0 ? undefined : _d, _e = _a.spaceAround, spaceAround = _e === void 0 ? false : _e, inputRef = _a.inputRef, autoComplete = _a.autoComplete, isLoading = _a.isLoading, className = _a.className, suffix = _a.suffix, suffixOnClick = _a.suffixOnClick, errorAppearance = _a.errorAppearance, _f = _a.iconPlacement, iconPlacement = _f === void 0 ? 'left' : _f, iconOnClick = _a.iconOnClick, iconTooltip = _a.iconTooltip, big = _a.big, _g = _a.showArrowsController, showArrowsController = _g === void 0 ? false : _g, onClear = _a.onClear, alwaysShowClear = _a.alwaysShowClear, setNumber = _a.setNumber, onEnter = _a.onEnter, _h = _a.forceFocus, forceFocus = _h === void 0 ? false : _h, _j = _a.autoFocus, autoFocus = _j === void 0 ? false : _j, onBlur = _a.onBlur, _k = _a.asTextArea, asTextArea = _k === void 0 ? false : _k, rest = __rest(_a, ["appearance", "type", "name", "label", "value", "icon", "variant", "disabled", "error", "isInvalid", "spaceAround", "inputRef", "autoComplete", "isLoading", "className", "suffix", "suffixOnClick", "errorAppearance", "iconPlacement", "iconOnClick", "iconTooltip", "big", "showArrowsController", "onClear", "alwaysShowClear", "setNumber", "onEnter", "forceFocus", "autoFocus", "onBlur", "asTextArea"]);
|
|
34
37
|
var $isInvalid = isInvalid !== undefined ? isInvalid : !!error;
|
|
35
38
|
var $isClearable = !!onClear && (!!value || alwaysShowClear) && !disabled && !isLoading;
|
|
36
39
|
var $hasSuffix = !!suffix;
|
|
37
40
|
var checkIconPlacement = showArrowsController ? 'left' : iconPlacement;
|
|
38
|
-
var onAddItem = useCallback(function () { return setNumber && setNumber(function (base) { return base + 1; }); }, [setNumber]);
|
|
39
|
-
var onRemoveItem = useCallback(function () {
|
|
41
|
+
var onAddItem = (0, react_1.useCallback)(function () { return setNumber && setNumber(function (base) { return base + 1; }); }, [setNumber]);
|
|
42
|
+
var onRemoveItem = (0, react_1.useCallback)(function () {
|
|
40
43
|
setNumber && setNumber(function (base) { return (base > 1 ? base - 1 : 1); });
|
|
41
44
|
}, [setNumber]);
|
|
42
|
-
var internalRef = useRef();
|
|
45
|
+
var internalRef = (0, react_1.useRef)();
|
|
43
46
|
var ref = (inputRef || internalRef);
|
|
44
|
-
useEffect(function () {
|
|
47
|
+
(0, react_1.useEffect)(function () {
|
|
45
48
|
var _a;
|
|
46
49
|
forceFocus && !disabled && !isLoading && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.focus());
|
|
47
50
|
}, [disabled, forceFocus, isLoading]);
|
|
48
|
-
var handleBlur = useCallback(function (event) {
|
|
51
|
+
var handleBlur = (0, react_1.useCallback)(function (event) {
|
|
49
52
|
var _a, _b, _c, _d, _e;
|
|
50
53
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
51
54
|
// If the related target is not an input element or its input type is not included in the allowed input types, keep the focus on the input with forceFocus
|
|
@@ -55,10 +58,11 @@ export var Input = function (_a) {
|
|
|
55
58
|
(_e = event.target) === null || _e === void 0 ? void 0 : _e.focus();
|
|
56
59
|
}
|
|
57
60
|
}, [forceFocus, onBlur]);
|
|
58
|
-
var handleKeyDown = useCallback(function (event) {
|
|
61
|
+
var handleKeyDown = (0, react_1.useCallback)(function (event) {
|
|
59
62
|
if (event.key === 'Enter') {
|
|
60
63
|
onEnter === null || onEnter === void 0 ? void 0 : onEnter();
|
|
61
64
|
}
|
|
62
65
|
}, [onEnter]);
|
|
63
|
-
return (
|
|
66
|
+
return ((0, jsx_runtime_1.jsxs)(SpaceAround_1.SpaceAroundWrap, { spaceAround: spaceAround, className: className, children: [(0, jsx_runtime_1.jsxs)(styles_1.InputWrap, { children: [label && ((0, jsx_runtime_1.jsx)(Label_1.FieldLabel, { htmlFor: name, "$isInvalid": $isInvalid, children: label })), (0, jsx_runtime_1.jsxs)(styles_1.InputRow, { hasValue: !!value, "$isInvalid": $isInvalid, disabled: !!disabled, "$icon": icon, variant: variant, children: [(0, jsx_runtime_1.jsx)(styles_1.StyledInput, __assign({ autoFocus: autoFocus, className: "".concat(appearance, " ").concat(checkIconPlacement), type: type, name: name, "data-cy": "".concat(name, "Inp"), value: value, "$isInvalid": $isInvalid, "$isClearable": $isClearable, "$hasSuffix": $hasSuffix, disabled: disabled || isLoading, ref: ref, autoComplete: autoComplete, onKeyDown: handleKeyDown, big: big, onBlur: handleBlur, "$asTextArea": asTextArea, variant: variant }, rest)), icon && ((0, jsx_runtime_1.jsx)(styles_1.InputIcon, { right: showArrowsController ? false : iconPlacement === 'right', onClick: iconOnClick, children: (0, jsx_runtime_1.jsxs)(styles_1.Tooltip, { children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: icon }), iconTooltip && (0, jsx_runtime_1.jsx)("span", { children: iconTooltip })] }) })), showArrowsController && ((0, jsx_runtime_1.jsxs)(styles_1.IconsController, { children: [(0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { onClick: onAddItem, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: "goUp", fill: "gray1" }) }), (0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { onClick: onRemoveItem, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: "goDown", fill: "gray1" }) })] })), $isClearable && ((0, jsx_runtime_1.jsx)(styles_1.InputIcon, { right: true, onClick: onClear, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: "deleteX", size: "16px", fill: "lightGray3" }) })), suffix && !isLoading && ((0, jsx_runtime_1.jsx)(styles_1.Suffix, { onClick: suffixOnClick, "$isPointer": !!suffixOnClick, "$isInvalid": $isInvalid, children: suffix })), isLoading && ((0, jsx_runtime_1.jsx)(styles_1.InputIcon, { right: true, children: (0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { variant: "sm" }) }))] })] }), error && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { appearance: errorAppearance, children: error })] }));
|
|
64
67
|
};
|
|
68
|
+
exports.Input = Input;
|
package/ui/Forms/Input/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Input = void 0;
|
|
4
|
+
var Input_1 = require("./Input");
|
|
5
|
+
Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return Input_1.Input; } });
|
|
6
|
+
exports.default = Input_1.Input;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ForceFocus = exports.Password = exports.WithSuffix = exports.Loading = exports.WithIcon = exports.Disabled = exports.Grid = exports.Primary = void 0;
|
|
4
|
+
var Input_1 = require("../Input");
|
|
2
5
|
var meta = {
|
|
3
6
|
title: 'Forms/Input',
|
|
4
|
-
component: Input,
|
|
7
|
+
component: Input_1.Input,
|
|
5
8
|
argTypes: {}
|
|
6
9
|
};
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
exports.default = meta;
|
|
11
|
+
exports.Primary = {
|
|
9
12
|
args: {
|
|
10
13
|
type: 'text',
|
|
11
14
|
label: 'Primary Input',
|
|
@@ -13,7 +16,7 @@ export var Primary = {
|
|
|
13
16
|
defaultValue: "primary text"
|
|
14
17
|
},
|
|
15
18
|
};
|
|
16
|
-
|
|
19
|
+
exports.Grid = {
|
|
17
20
|
args: {
|
|
18
21
|
type: 'text',
|
|
19
22
|
label: 'Grid Input',
|
|
@@ -21,7 +24,7 @@ export var Grid = {
|
|
|
21
24
|
defaultValue: "grid text"
|
|
22
25
|
},
|
|
23
26
|
};
|
|
24
|
-
|
|
27
|
+
exports.Disabled = {
|
|
25
28
|
args: {
|
|
26
29
|
type: 'text',
|
|
27
30
|
label: 'Disabled Input',
|
|
@@ -29,7 +32,7 @@ export var Disabled = {
|
|
|
29
32
|
disabled: true
|
|
30
33
|
},
|
|
31
34
|
};
|
|
32
|
-
|
|
35
|
+
exports.WithIcon = {
|
|
33
36
|
args: {
|
|
34
37
|
type: 'text',
|
|
35
38
|
label: 'With Icon Input',
|
|
@@ -38,7 +41,7 @@ export var WithIcon = {
|
|
|
38
41
|
iconPlacement: 'left'
|
|
39
42
|
},
|
|
40
43
|
};
|
|
41
|
-
|
|
44
|
+
exports.Loading = {
|
|
42
45
|
args: {
|
|
43
46
|
type: 'text',
|
|
44
47
|
label: 'Loading Input',
|
|
@@ -46,21 +49,21 @@ export var Loading = {
|
|
|
46
49
|
isLoading: true
|
|
47
50
|
},
|
|
48
51
|
};
|
|
49
|
-
|
|
52
|
+
exports.WithSuffix = {
|
|
50
53
|
args: {
|
|
51
54
|
type: 'text',
|
|
52
55
|
suffix: "Eur",
|
|
53
56
|
label: "Input with a suffix"
|
|
54
57
|
},
|
|
55
58
|
};
|
|
56
|
-
|
|
59
|
+
exports.Password = {
|
|
57
60
|
args: {
|
|
58
61
|
type: 'password',
|
|
59
62
|
label: 'Password Input',
|
|
60
63
|
defaultValue: "Password text"
|
|
61
64
|
},
|
|
62
65
|
};
|
|
63
|
-
|
|
66
|
+
exports.ForceFocus = {
|
|
64
67
|
args: {
|
|
65
68
|
type: 'text',
|
|
66
69
|
label: 'Force Focus Input',
|