@true-engineering/true-react-common-ui-kit 4.0.0-alpha6 → 4.0.0-alpha62
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/README.md +12 -660
- package/dist/components/AccountInfo/AccountInfo.styles.d.ts +1 -1
- package/dist/components/AddButton/AddButton.d.ts +1 -0
- package/dist/components/AddButton/AddButton.styles.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.styles.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +3 -1
- package/dist/components/Checkbox/Checkbox.styles.d.ts +3 -2
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/types.d.ts +3 -0
- package/dist/components/CloseButton/CloseButton.styles.d.ts +1 -1
- package/dist/components/ControlWrapper/ControlWrapper.d.ts +10 -3
- package/dist/components/ControlWrapper/ControlWrapper.styles.d.ts +3 -2
- package/dist/components/ControlWrapper/constants.d.ts +1 -0
- package/dist/components/ControlWrapper/helpers.d.ts +4 -0
- package/dist/components/ControlWrapper/index.d.ts +3 -0
- package/dist/components/ControlWrapper/types.d.ts +14 -0
- package/dist/components/CssBaseline/CssBaseline.styles.d.ts +1 -1
- package/dist/components/DateInput/DateInput.d.ts +1 -3
- package/dist/components/DateInput/DateInput.styles.d.ts +1 -1
- package/dist/components/DateInput/constants.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +4 -4
- package/dist/components/DatePicker/DatePicker.styles.d.ts +1 -1
- package/dist/components/DatePicker/components/DatePickerBase/DatePickerBase.d.ts +5 -0
- package/dist/components/DatePicker/components/DatePickerBase/index.d.ts +1 -0
- package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.d.ts +1 -1
- package/dist/components/DatePicker/components/PopperContainer/PopperContainer.d.ts +2 -4
- package/dist/components/DatePicker/components/index.d.ts +1 -0
- package/dist/components/DatePicker/constants.d.ts +7 -2
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/types.d.ts +2 -2
- package/dist/components/Description/Description.styles.d.ts +1 -1
- package/dist/components/FileInput/FileInput.d.ts +1 -1
- package/dist/components/FileInput/FileInput.styles.d.ts +1 -1
- package/dist/components/FileItem/FileItem.styles.d.ts +1 -1
- package/dist/components/FileItem/constants.d.ts +3 -4
- package/dist/components/FileItem/helpers.d.ts +3 -2
- package/dist/components/FileItem/types.d.ts +1 -2
- package/dist/components/FiltersPane/FiltersPane.d.ts +7 -3
- package/dist/components/FiltersPane/FiltersPane.styles.d.ts +2 -2
- package/dist/components/FiltersPane/components/Filter/Filter.d.ts +3 -4
- package/dist/components/FiltersPane/components/Filter/helpers.d.ts +4 -0
- package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.d.ts +3 -11
- package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.styles.d.ts +3 -6
- package/dist/components/FiltersPane/components/FilterMultiSelect/FilterMultiSelect.d.ts +0 -1
- package/dist/components/FiltersPane/components/FilterSelect/FilterSelect.styles.d.ts +3 -6
- package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.d.ts +4 -3
- package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.d.ts +5 -11
- package/dist/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.d.ts +2 -3
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.d.ts +2 -2
- package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.d.ts +2 -1
- package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.d.ts +1 -1
- package/dist/components/FiltersPane/constants.d.ts +1 -1
- package/dist/components/FiltersPane/helpers.d.ts +1 -1
- package/dist/components/FiltersPane/index.d.ts +1 -0
- package/dist/components/FiltersPane/types.d.ts +8 -3
- package/dist/components/Flag/Flag.styles.d.ts +1 -1
- package/dist/components/FlexibleTable/FlexibleTable.d.ts +4 -2
- package/dist/components/FlexibleTable/FlexibleTable.styles.d.ts +2 -2
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.d.ts +4 -3
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.d.ts +1 -1
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.d.ts +2 -5
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.styles.d.ts +1 -1
- package/dist/components/FlexibleTable/helpers.d.ts +2 -2
- package/dist/components/FlexibleTable/types.d.ts +19 -11
- package/dist/components/FloatDocActions/FloatDocActions.d.ts +6 -0
- package/dist/components/FloatDocActions/FloatDocActions.styles.d.ts +8 -0
- package/dist/components/FloatDocActions/components/DocActions/DocActions.d.ts +12 -0
- package/dist/components/FloatDocActions/components/DocActions/DocActions.styles.d.ts +6 -0
- package/dist/components/FloatDocActions/components/DocActions/constants.d.ts +1 -0
- package/dist/components/FloatDocActions/components/DocActions/index.d.ts +4 -0
- package/dist/components/FloatDocActions/components/DocActions/types.d.ts +2 -0
- package/dist/components/FloatDocActions/components/index.d.ts +1 -0
- package/dist/components/FloatDocActions/constants.d.ts +1 -0
- package/dist/components/FloatDocActions/index.d.ts +3 -0
- package/dist/components/Icon/Icon.styles.d.ts +1 -1
- package/dist/components/Icon/icons/index.d.ts +31 -0
- package/dist/components/Icon/index.d.ts +1 -1
- package/dist/components/Icon/types.d.ts +7 -11
- package/dist/components/IconButton/IconButton.d.ts +1 -2
- package/dist/components/IconButton/IconButton.styles.d.ts +1 -1
- package/dist/components/IconButton/constants.d.ts +1 -1
- package/dist/components/IncrementInput/IncrementInput.styles.d.ts +1 -3
- package/dist/components/Input/Input.d.ts +3 -3
- package/dist/components/Input/Input.styles.d.ts +1 -1
- package/dist/components/Input/InputBase.d.ts +3 -3
- package/dist/components/List/List.d.ts +2 -1
- package/dist/components/List/List.styles.d.ts +3 -2
- package/dist/components/List/components/ListItem/ListItem.d.ts +2 -0
- package/dist/components/List/components/ListItem/ListItem.styles.d.ts +3 -2
- package/dist/components/List/index.d.ts +2 -1
- package/dist/components/List/types.d.ts +8 -0
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.styles.d.ts +1 -1
- package/dist/components/MoreMenu/MoreMenu.styles.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +0 -1
- package/dist/components/MultiSelect/MultiSelect.styles.d.ts +1 -1
- package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.styles.d.ts +1 -1
- package/dist/components/MultiSelectList/MultiSelectList.styles.d.ts +1 -1
- package/dist/components/MultiSelectList/constants.d.ts +1 -1
- package/dist/components/MultiSelectList/helpers.d.ts +1 -1
- package/dist/components/NewMoreMenu/NewMoreMenu.d.ts +5 -2
- package/dist/components/NewMoreMenu/NewMoreMenu.styles.d.ts +1 -1
- package/dist/components/Notification/Notification.styles.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +1 -2
- package/dist/components/NumberInput/helpers.d.ts +2 -2
- package/dist/components/PhoneInput/PhoneInput.styles.d.ts +1 -1
- package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.d.ts +1 -1
- package/dist/components/RadioButton/RadioButton.d.ts +3 -1
- package/dist/components/RadioButton/RadioButton.styles.d.ts +3 -2
- package/dist/components/RadioButton/index.d.ts +1 -0
- package/dist/components/RadioButton/types.d.ts +3 -0
- package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +3 -373
- package/dist/components/ScrollIntoViewIfNeeded/constants.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +2 -3
- package/dist/components/Select/Select.d.ts +3 -3
- package/dist/components/Select/Select.styles.d.ts +12 -22
- package/dist/components/Select/components/SelectList/SelectList.d.ts +8 -6
- package/dist/components/Select/components/SelectList/SelectList.styles.d.ts +3 -2
- package/dist/components/Select/components/SelectListItem/SelectListItem.d.ts +4 -3
- package/dist/components/Select/helpers.d.ts +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/types.d.ts +4 -0
- package/dist/components/Selector/Selector.d.ts +0 -1
- package/dist/components/Selector/Selector.styles.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.styles.d.ts +1 -1
- package/dist/components/SmartInput/SmartInput.d.ts +1 -1
- package/dist/components/Status/Status.styles.d.ts +3 -2
- package/dist/components/Status/constants.d.ts +0 -1
- package/dist/components/Status/index.d.ts +1 -0
- package/dist/components/Status/types.d.ts +5 -2
- package/dist/components/Switch/Switch.d.ts +3 -2
- package/dist/components/Switch/Switch.styles.d.ts +3 -2
- package/dist/components/Switch/types.d.ts +3 -0
- package/dist/components/TextArea/TextArea.d.ts +5 -6
- package/dist/components/TextArea/TextArea.styles.d.ts +5 -4
- package/dist/components/TextArea/index.d.ts +1 -1
- package/dist/components/TextArea/types.d.ts +4 -2
- package/dist/components/TextButton/TextButton.d.ts +1 -1
- package/dist/components/TextButton/TextButton.styles.d.ts +1 -1
- package/dist/components/TextWithInfo/TextWithInfo.styles.d.ts +1 -1
- package/dist/components/TextWithTooltip/TextWithTooltip.d.ts +2 -0
- package/dist/components/TextWithTooltip/TextWithTooltip.styles.d.ts +1 -1
- package/dist/components/ThemedPreloader/ThemedPreloader.styles.d.ts +1 -1
- package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.d.ts +1 -1
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.d.ts +1 -1
- package/dist/components/Toaster/Toaster.styles.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +3 -0
- package/dist/components/Tooltip/Tooltip.styles.d.ts +3 -2
- package/dist/components/Tooltip/types.d.ts +3 -0
- package/dist/components/WithMessages/WithMessages.d.ts +1 -1
- package/dist/components/WithMessages/WithMessages.styles.d.ts +1 -1
- package/dist/components/WithPopup/WithPopup.d.ts +11 -3
- package/dist/components/WithPopup/WithPopup.styles.d.ts +1 -1
- package/dist/components/WithPopup/types.d.ts +4 -4
- package/dist/components/WithTooltip/WithTooltip.d.ts +2 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/constants/phone-info.d.ts +1 -1
- package/dist/helpers/misc.d.ts +5 -3
- package/dist/helpers/phone.d.ts +1 -1
- package/dist/hooks/index.d.ts +8 -4
- package/dist/hooks/use-dropdown.d.ts +3 -3
- package/dist/hooks/use-intersection-ref.d.ts +9 -0
- package/dist/hooks/use-latest-ref.d.ts +2 -0
- package/dist/hooks/use-merge.d.ts +1 -0
- package/dist/hooks/use-mixed-styles.d.ts +3 -1
- package/dist/hooks/use-on-click-outside.d.ts +2 -2
- package/dist/hooks/use-resize-ref.d.ts +7 -0
- package/dist/hooks/use-tweak-styles.d.ts +8 -7
- package/dist/theme/Provider.d.ts +3 -10
- package/dist/theme/common.d.ts +34 -4
- package/dist/theme/helpers.d.ts +2 -9
- package/dist/theme/types.d.ts +13 -10
- package/dist/true-react-common-ui-kit.js +7874 -27363
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +1 -31620
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/dist/types.d.ts +9 -2
- package/package.json +36 -39
- package/src/components/AccountInfo/AccountInfo.stories.tsx +19 -27
- package/src/components/AccountInfo/AccountInfo.tsx +2 -3
- package/src/components/AddButton/AddButton.stories.tsx +14 -17
- package/src/components/AddButton/AddButton.tsx +3 -5
- package/src/components/Button/Button.stories.tsx +8 -26
- package/src/components/Button/Button.tsx +76 -77
- package/src/components/Checkbox/Checkbox.stories.tsx +27 -16
- package/src/components/Checkbox/Checkbox.styles.ts +3 -1
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Checkbox/types.ts +4 -0
- package/src/components/CloseButton/CloseButton.stories.tsx +5 -6
- package/src/components/CloseButton/CloseButton.tsx +2 -4
- package/src/components/Colors/Colors.stories.tsx +64 -3
- package/src/components/ControlWrapper/ControlWrapper.stories.tsx +46 -35
- package/src/components/ControlWrapper/ControlWrapper.styles.ts +15 -6
- package/src/components/ControlWrapper/ControlWrapper.tsx +73 -44
- package/src/components/ControlWrapper/constants.ts +11 -0
- package/src/components/ControlWrapper/helpers.ts +11 -0
- package/src/components/ControlWrapper/index.ts +3 -0
- package/src/components/ControlWrapper/types.ts +19 -0
- package/src/components/CssBaseline/CssBaseline.styles.ts +2 -0
- package/src/components/CssBaseline/CssBaseline.tsx +2 -3
- package/src/components/DateInput/DateInput.stories.tsx +13 -31
- package/src/components/DateInput/DateInput.tsx +61 -64
- package/src/components/DatePicker/DatePicker.stories.tsx +18 -42
- package/src/components/DatePicker/DatePicker.styles.ts +3 -1
- package/src/components/DatePicker/DatePicker.tsx +284 -256
- package/src/components/DatePicker/components/DatePickerBase/DatePickerBase.tsx +14 -0
- package/src/components/DatePicker/components/DatePickerBase/index.ts +1 -0
- package/src/components/DatePicker/components/PopperContainer/PopperContainer.tsx +4 -4
- package/src/components/DatePicker/components/index.ts +1 -0
- package/src/components/DatePicker/constants.ts +9 -3
- package/src/components/DatePicker/helpers.ts +1 -1
- package/src/components/DatePicker/index.ts +1 -0
- package/src/components/DatePicker/types.ts +6 -4
- package/src/components/Description/Description.stories.tsx +11 -16
- package/src/components/Description/Description.tsx +2 -3
- package/src/components/FileInput/FileInput.stories.tsx +59 -63
- package/src/components/FileInput/FileInput.tsx +87 -95
- package/src/components/FileItem/FileItem.stories.tsx +48 -48
- package/src/components/FileItem/FileItem.tsx +2 -4
- package/src/components/FileItem/constants.ts +3 -14
- package/src/components/FileItem/helpers.ts +3 -2
- package/src/components/FileItem/types.ts +1 -3
- package/src/components/FiltersPane/FiltersPane.stories.tsx +34 -28
- package/src/components/FiltersPane/FiltersPane.tsx +28 -19
- package/src/components/FiltersPane/components/Filter/Filter.tsx +36 -30
- package/src/components/FiltersPane/components/Filter/helpers.ts +18 -0
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.styles.ts +1 -2
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.tsx +7 -20
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.styles.ts +1 -2
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.tsx +22 -23
- package/src/components/FiltersPane/components/FilterValueView/FilterValueView.tsx +8 -5
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.ts +3 -3
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +9 -7
- package/src/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.tsx +4 -3
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +17 -12
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.ts +5 -0
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.tsx +19 -19
- package/src/components/FiltersPane/helpers.ts +3 -3
- package/src/components/FiltersPane/index.ts +1 -0
- package/src/components/FiltersPane/types.ts +12 -4
- package/src/components/Flag/Flag.stories.tsx +15 -20
- package/src/components/Flag/Flag.tsx +2 -2
- package/src/components/FlexibleTable/FlexibleTable.stories.tsx +47 -50
- package/src/components/FlexibleTable/FlexibleTable.styles.ts +5 -2
- package/src/components/FlexibleTable/FlexibleTable.tsx +43 -64
- package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.ts +1 -0
- package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.tsx +13 -7
- package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.tsx +15 -15
- package/src/components/FlexibleTable/types.ts +19 -11
- package/src/components/FloatDocActions/FloatDocActions.stories.tsx +111 -0
- package/src/components/FloatDocActions/FloatDocActions.styles.ts +12 -0
- package/src/components/FloatDocActions/FloatDocActions.tsx +34 -0
- package/src/components/FloatDocActions/components/DocActions/DocActions.styles.ts +29 -0
- package/src/components/FloatDocActions/components/DocActions/DocActions.tsx +43 -0
- package/src/components/FloatDocActions/components/DocActions/constants.ts +1 -0
- package/src/components/FloatDocActions/components/DocActions/index.ts +4 -0
- package/src/components/FloatDocActions/components/DocActions/types.ts +3 -0
- package/src/components/FloatDocActions/components/index.ts +1 -0
- package/src/components/FloatDocActions/constants.ts +1 -0
- package/src/components/FloatDocActions/index.ts +3 -0
- package/src/components/Icon/Icon.stories.tsx +80 -67
- package/src/components/Icon/Icon.styles.ts +1 -1
- package/src/components/Icon/Icon.tsx +17 -12
- package/src/components/Icon/icons/calendar.svg +1 -0
- package/src/components/Icon/icons/check.svg +1 -0
- package/src/components/Icon/icons/chevron-down-small.svg +1 -0
- package/src/components/Icon/icons/chevron-down.svg +1 -0
- package/src/components/Icon/icons/chevron-left.svg +1 -0
- package/src/components/Icon/icons/chevron-right.svg +1 -0
- package/src/components/Icon/icons/close-large.svg +1 -0
- package/src/components/Icon/icons/close-window.svg +1 -0
- package/src/components/Icon/icons/close.svg +1 -0
- package/src/components/Icon/icons/filter.svg +1 -0
- package/src/components/Icon/icons/index.ts +62 -0
- package/src/components/Icon/icons/information.svg +1 -0
- package/src/components/Icon/icons/menu.svg +1 -0
- package/src/components/Icon/icons/minus.svg +1 -0
- package/src/components/Icon/icons/plus.svg +1 -0
- package/src/components/Icon/icons/search.svg +1 -0
- package/src/components/Icon/icons/status-error.svg +1 -0
- package/src/components/Icon/icons/status-info.svg +1 -0
- package/src/components/Icon/icons/status-not-ok.svg +1 -0
- package/src/components/Icon/icons/status-ok.svg +1 -0
- package/src/components/Icon/icons/status-warning.svg +1 -0
- package/src/components/Icon/icons/trash-can.svg +1 -0
- package/src/components/Icon/index.ts +1 -1
- package/src/components/Icon/types.ts +7 -13
- package/src/components/IconButton/IconButton.stories.tsx +7 -12
- package/src/components/IconButton/IconButton.styles.ts +15 -13
- package/src/components/IconButton/IconButton.tsx +44 -48
- package/src/components/IconButton/constants.ts +1 -1
- package/src/components/IncrementInput/IncrementInput.stories.tsx +25 -23
- package/src/components/IncrementInput/IncrementInput.styles.ts +31 -39
- package/src/components/IncrementInput/IncrementInput.tsx +28 -25
- package/src/components/Input/Input.stories.tsx +38 -68
- package/src/components/Input/Input.styles.ts +5 -2
- package/src/components/Input/Input.tsx +29 -26
- package/src/components/Input/InputBase.tsx +172 -172
- package/src/components/List/List.stories.tsx +34 -17
- package/src/components/List/List.styles.ts +4 -2
- package/src/components/List/List.tsx +15 -7
- package/src/components/List/components/ListItem/ListItem.styles.ts +2 -1
- package/src/components/List/components/ListItem/ListItem.tsx +7 -5
- package/src/components/List/index.ts +2 -1
- package/src/components/List/types.ts +11 -0
- package/src/components/Modal/Modal.stories.tsx +50 -59
- package/src/components/Modal/Modal.tsx +3 -5
- package/src/components/MoreMenu/MoreMenu.stories.tsx +24 -15
- package/src/components/MoreMenu/MoreMenu.tsx +2 -4
- package/src/components/MultiSelect/MultiSelect.stories.tsx +23 -20
- package/src/components/MultiSelect/MultiSelect.tsx +2 -4
- package/src/components/MultiSelectList/MultiSelectList.tsx +15 -11
- package/src/components/MultiSelectList/helpers.ts +2 -2
- package/src/components/NewMoreMenu/NewMoreMenu.stories.tsx +51 -39
- package/src/components/NewMoreMenu/NewMoreMenu.tsx +29 -22
- package/src/components/Notification/Notification.stories.tsx +35 -34
- package/src/components/Notification/Notification.tsx +2 -3
- package/src/components/NumberInput/NumberInput.stories.tsx +32 -28
- package/src/components/NumberInput/NumberInput.tsx +91 -93
- package/src/components/PhoneInput/PhoneInput.stories.tsx +29 -55
- package/src/components/PhoneInput/PhoneInput.tsx +3 -4
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.stories.tsx +5 -11
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +1 -4
- package/src/components/RadioButton/RadioButton.stories.tsx +31 -21
- package/src/components/RadioButton/RadioButton.styles.ts +2 -1
- package/src/components/RadioButton/RadioButton.tsx +12 -5
- package/src/components/RadioButton/index.ts +1 -0
- package/src/components/RadioButton/types.ts +4 -0
- package/src/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.ts +15 -9
- package/src/components/SearchInput/SearchInput.stories.tsx +19 -14
- package/src/components/SearchInput/SearchInput.styles.ts +6 -12
- package/src/components/SearchInput/SearchInput.tsx +21 -24
- package/src/components/Select/CustomSelect.stories.tsx +29 -32
- package/src/components/Select/MultiSelect.stories.tsx +45 -45
- package/src/components/Select/Select.stories.tsx +45 -44
- package/src/components/Select/Select.styles.ts +5 -40
- package/src/components/Select/Select.tsx +62 -52
- package/src/components/Select/components/SelectList/SelectList.styles.ts +2 -1
- package/src/components/Select/components/SelectList/SelectList.tsx +13 -7
- package/src/components/Select/components/SelectListItem/SelectListItem.tsx +5 -2
- package/src/components/Select/index.ts +1 -1
- package/src/components/Select/types.ts +3 -0
- package/src/components/Selector/Selector.stories.tsx +25 -27
- package/src/components/Selector/Selector.tsx +5 -8
- package/src/components/Skeleton/Skeleton.stories.tsx +13 -12
- package/src/components/SmartInput/SmartInput.stories.tsx +23 -23
- package/src/components/SmartInput/SmartInput.tsx +85 -87
- package/src/components/Status/Status.stories.tsx +79 -28
- package/src/components/Status/Status.styles.ts +2 -37
- package/src/components/Status/Status.tsx +5 -4
- package/src/components/Status/constants.ts +0 -10
- package/src/components/Status/index.ts +1 -1
- package/src/components/Status/types.ts +7 -3
- package/src/components/Switch/Switch.stories.tsx +19 -26
- package/src/components/Switch/Switch.styles.ts +21 -13
- package/src/components/Switch/Switch.tsx +11 -6
- package/src/components/Switch/types.ts +5 -0
- package/src/components/TextArea/TextArea.stories.tsx +37 -26
- package/src/components/TextArea/TextArea.styles.ts +15 -8
- package/src/components/TextArea/TextArea.tsx +114 -83
- package/src/components/TextArea/index.ts +1 -1
- package/src/components/TextArea/types.ts +5 -5
- package/src/components/TextButton/TextButton.stories.tsx +8 -19
- package/src/components/TextButton/TextButton.styles.ts +1 -0
- package/src/components/TextButton/TextButton.tsx +68 -69
- package/src/components/TextWithInfo/TextWithInfo.stories.tsx +13 -21
- package/src/components/TextWithInfo/TextWithInfo.tsx +2 -4
- package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +26 -25
- package/src/components/TextWithTooltip/TextWithTooltip.tsx +7 -6
- package/src/components/ThemedPreloader/ThemedPreloader.stories.tsx +12 -23
- package/src/components/ThemedPreloader/ThemedPreloader.tsx +2 -4
- package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +4 -4
- package/src/components/Toaster/Toaster.stories.tsx +16 -14
- package/src/components/Toaster/Toaster.tsx +2 -4
- package/src/components/Tooltip/Tooltip.stories.tsx +15 -4
- package/src/components/Tooltip/Tooltip.styles.ts +2 -1
- package/src/components/Tooltip/Tooltip.tsx +12 -5
- package/src/components/Tooltip/types.ts +5 -0
- package/src/components/WithMessages/WithMessages.stories.tsx +16 -20
- package/src/components/WithMessages/WithMessages.tsx +41 -40
- package/src/components/WithPopup/WithPopup.stories.tsx +27 -26
- package/src/components/WithPopup/WithPopup.tsx +36 -15
- package/src/components/WithTooltip/WithTooltip.stories.tsx +28 -28
- package/src/components/WithTooltip/WithTooltip.tsx +4 -0
- package/src/components/index.ts +1 -1
- package/src/helpers/misc.ts +15 -7
- package/src/helpers/popper-helpers.ts +0 -1
- package/src/hooks/index.ts +8 -4
- package/src/hooks/use-intersection-ref.ts +48 -0
- package/src/hooks/use-latest-ref.ts +11 -0
- package/src/hooks/use-merge.ts +8 -0
- package/src/hooks/use-mixed-styles.ts +9 -11
- package/src/hooks/use-on-click-outside.ts +22 -14
- package/src/hooks/use-resize-ref.ts +35 -0
- package/src/hooks/use-tweak-styles.ts +18 -33
- package/src/theme/Provider.tsx +5 -17
- package/src/theme/common.ts +33 -36
- package/src/theme/helpers.ts +60 -50
- package/src/theme/types.ts +19 -15
- package/src/types.ts +17 -6
- package/dist/components/AccountInfo/AccountInfo.stories.d.ts +0 -6
- package/dist/components/AddButton/AddButton.stories.d.ts +0 -6
- package/dist/components/Button/Button.stories.d.ts +0 -6
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -8
- package/dist/components/CloseButton/CloseButton.stories.d.ts +0 -5
- package/dist/components/Colors/Colors.d.ts +0 -2
- package/dist/components/Colors/Colors.stories.d.ts +0 -5
- package/dist/components/Colors/Colors.styles.d.ts +0 -1
- package/dist/components/Colors/index.d.ts +0 -1
- package/dist/components/ControlWrapper/ControlWrapper.stories.d.ts +0 -6
- package/dist/components/DateInput/DateInput.stories.d.ts +0 -7
- package/dist/components/DatePicker/DatePicker.stories.d.ts +0 -7
- package/dist/components/Description/Description.stories.d.ts +0 -16
- package/dist/components/FileInput/FileInput.stories.d.ts +0 -7
- package/dist/components/FileItem/FileItem.stories.d.ts +0 -8
- package/dist/components/FiltersPane/FiltersPane.stories.d.ts +0 -31
- package/dist/components/Flag/Flag.stories.d.ts +0 -12
- package/dist/components/FlexibleTable/FlexibleTable.stories.d.ts +0 -19
- package/dist/components/Icon/Icon.stories.d.ts +0 -6
- package/dist/components/Icon/complexIcons/icons.d.ts +0 -10
- package/dist/components/Icon/complexIcons/index.d.ts +0 -1
- package/dist/components/Icon/components/ComplexIconBoilerplate/ComplexIconBoilerplate.d.ts +0 -6
- package/dist/components/Icon/components/ComplexIconBoilerplate/index.d.ts +0 -1
- package/dist/components/Icon/components/IconBolerplate/IconBoilerplate.d.ts +0 -6
- package/dist/components/Icon/components/IconBolerplate/index.d.ts +0 -1
- package/dist/components/Icon/components/index.d.ts +0 -2
- package/dist/components/Icon/helpers.d.ts +0 -6
- package/dist/components/Icon/icons-list.d.ts +0 -1
- package/dist/components/IconButton/IconButton.stories.d.ts +0 -6
- package/dist/components/IncrementInput/IncrementInput.stories.d.ts +0 -6
- package/dist/components/Input/Input.stories.d.ts +0 -25
- package/dist/components/List/List.stories.d.ts +0 -5
- package/dist/components/Modal/Modal.stories.d.ts +0 -29
- package/dist/components/MoreMenu/MoreMenu.stories.d.ts +0 -6
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts +0 -13
- package/dist/components/NewMoreMenu/NewMoreMenu.stories.d.ts +0 -12
- package/dist/components/Notification/Notification.stories.d.ts +0 -8
- package/dist/components/NumberInput/NumberInput.stories.d.ts +0 -7
- package/dist/components/PhoneInput/PhoneInput.stories.d.ts +0 -28
- package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.stories.d.ts +0 -5
- package/dist/components/RadioButton/RadioButton.stories.d.ts +0 -7
- package/dist/components/SearchInput/SearchInput.stories.d.ts +0 -7
- package/dist/components/Select/CustomSelect.stories.d.ts +0 -11
- package/dist/components/Select/MultiSelect.stories.d.ts +0 -15
- package/dist/components/Select/Select.stories.d.ts +0 -15
- package/dist/components/Selector/Selector.stories.d.ts +0 -7
- package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -6
- package/dist/components/SmartInput/SmartInput.stories.d.ts +0 -18
- package/dist/components/Status/Status.stories.d.ts +0 -6
- package/dist/components/Switch/Switch.stories.d.ts +0 -16
- package/dist/components/TextArea/TextArea.stories.d.ts +0 -17
- package/dist/components/TextButton/TextButton.stories.d.ts +0 -6
- package/dist/components/TextWithInfo/TextWithInfo.stories.d.ts +0 -12
- package/dist/components/TextWithTooltip/TextWithTooltip.stories.d.ts +0 -24
- package/dist/components/ThemedPreloader/ThemedPreloader.stories.d.ts +0 -17
- package/dist/components/Toaster/Toaster.stories.d.ts +0 -5
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -5
- package/dist/components/WithMessages/WithMessages.stories.d.ts +0 -7
- package/dist/components/WithPopup/WithPopup.stories.d.ts +0 -16
- package/dist/components/WithTooltip/WithTooltip.stories.d.ts +0 -6
- package/dist/style.css +0 -820
- package/src/components/Colors/Colors.styles.ts +0 -36
- package/src/components/Colors/Colors.tsx +0 -26
- package/src/components/Colors/index.ts +0 -1
- package/src/components/Flag/augment.d.ts +0 -1
- package/src/components/Flag/customFlags/augment.d.ts +0 -1
- package/src/components/Icon/complexIcons/augment.d.ts +0 -1
- package/src/components/Icon/complexIcons/icons.ts +0 -19
- package/src/components/Icon/complexIcons/index.ts +0 -1
- package/src/components/Icon/components/ComplexIconBoilerplate/ComplexIconBoilerplate.tsx +0 -16
- package/src/components/Icon/components/ComplexIconBoilerplate/index.ts +0 -1
- package/src/components/Icon/components/IconBolerplate/IconBoilerplate.tsx +0 -43
- package/src/components/Icon/components/IconBolerplate/index.ts +0 -1
- package/src/components/Icon/components/index.ts +0 -2
- package/src/components/Icon/helpers.tsx +0 -9
- package/src/components/Icon/icons-list.ts +0 -855
- package/src/vite-env.d.ts +0 -1
- /package/src/components/Icon/{complexIcons/avatarGreen.svg → icons/avatar.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileExcel.svg → icons/file-excel.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileImage.svg → icons/file-image.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileOther.svg → icons/file-other.svg} +0 -0
- /package/src/components/Icon/{complexIcons/filePdf.svg → icons/file-pdf.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileWord.svg → icons/file-word.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileXml.svg → icons/file-xml.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileZip.svg → icons/file-zip.svg} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DocActions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DEFAULT_TIMEOUT = 150;
|
|
@@ -1,86 +1,99 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { isArrayNotEmpty, isEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
3
|
+
import { useTheme } from '../../theme';
|
|
1
4
|
import { Icon } from './Icon';
|
|
2
|
-
import {
|
|
3
|
-
import { iconsList } from './icons-list';
|
|
5
|
+
import { iconsMap } from './icons';
|
|
4
6
|
import { IIconType } from './types';
|
|
5
7
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: 'Data Display/Icon',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const Default = () => (
|
|
8
|
+
const GalleryIcon: FC<{ type: IIconType }> = ({ type }) => (
|
|
13
9
|
<div
|
|
10
|
+
key={type}
|
|
14
11
|
style={{
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
width: 100,
|
|
13
|
+
height: 100,
|
|
14
|
+
margin: 1,
|
|
15
|
+
background: '#f7f7f7',
|
|
17
16
|
display: 'flex',
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// max: 200,
|
|
22
|
-
// step: 10,
|
|
23
|
-
// }),
|
|
24
|
-
// height: number('Container height', 40, {
|
|
25
|
-
// range: true,
|
|
26
|
-
// min: 0,
|
|
27
|
-
// max: 200,
|
|
28
|
-
// step: 10,
|
|
29
|
-
// }),
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
flexDirection: 'column',
|
|
30
20
|
}}
|
|
31
21
|
>
|
|
32
|
-
|
|
22
|
+
<div
|
|
23
|
+
style={{
|
|
24
|
+
width: 32,
|
|
25
|
+
height: 32,
|
|
26
|
+
margin: '10px 0',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
color: '#888',
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
<Icon type={type} />
|
|
33
|
+
</div>
|
|
34
|
+
<div
|
|
35
|
+
style={{
|
|
36
|
+
fontFamily: 'Arial',
|
|
37
|
+
fontSize: 13,
|
|
38
|
+
color: '#747679',
|
|
39
|
+
overflow: 'hidden',
|
|
40
|
+
padding: '0 5px',
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
{type}
|
|
44
|
+
</div>
|
|
33
45
|
</div>
|
|
34
46
|
);
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
const Story: FC = () => {
|
|
49
|
+
const theme = useTheme();
|
|
50
|
+
const notCustomizedIcons = Object.keys(iconsMap).filter((icon) =>
|
|
51
|
+
isEmpty(theme.icons?.[icon]),
|
|
52
|
+
) as IIconType[];
|
|
53
|
+
const customizedIcons = Object.keys(theme.icons ?? {}) as IIconType[];
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div>
|
|
57
|
+
{isArrayNotEmpty(notCustomizedIcons) && (
|
|
58
|
+
<div>
|
|
59
|
+
<h1>Китовые иконки</h1>
|
|
60
|
+
<div
|
|
61
|
+
style={{
|
|
62
|
+
display: 'flex',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
flexWrap: 'wrap',
|
|
65
|
+
width: '80vw',
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
{notCustomizedIcons.map((type) => (
|
|
69
|
+
<GalleryIcon type={type} key={type} />
|
|
70
|
+
))}
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
)}
|
|
74
|
+
<div>
|
|
75
|
+
<h1>Кастомизированные иконки</h1>
|
|
60
76
|
<div
|
|
61
77
|
style={{
|
|
62
|
-
width: 32,
|
|
63
|
-
height: 32,
|
|
64
|
-
margin: '10px 0',
|
|
65
78
|
display: 'flex',
|
|
66
79
|
alignItems: 'center',
|
|
67
|
-
|
|
80
|
+
flexWrap: 'wrap',
|
|
81
|
+
width: '80vw',
|
|
68
82
|
}}
|
|
69
83
|
>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
style={{
|
|
74
|
-
fontFamily: 'Arial',
|
|
75
|
-
fontSize: 13,
|
|
76
|
-
color: '#747679',
|
|
77
|
-
overflow: 'hidden',
|
|
78
|
-
padding: '0 5px',
|
|
79
|
-
}}
|
|
80
|
-
>
|
|
81
|
-
{type}
|
|
84
|
+
{customizedIcons.map((type) => (
|
|
85
|
+
<GalleryIcon type={type} key={type} />
|
|
86
|
+
))}
|
|
82
87
|
</div>
|
|
83
88
|
</div>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const meta = {
|
|
94
|
+
title: 'Data Display/Icon',
|
|
95
|
+
component: Story,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export default meta;
|
|
99
|
+
export const Default = {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { addDataAttributes, isEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
3
|
+
import { useTheme } from '../../theme';
|
|
4
4
|
import { ICommonProps } from '../../types';
|
|
5
|
-
import {
|
|
6
|
-
import { isComplexIcon } from './helpers';
|
|
5
|
+
import { iconsMap } from './icons';
|
|
7
6
|
import { IIconType } from './types';
|
|
8
|
-
import {
|
|
7
|
+
import { IIconStyles, useStyles } from './Icon.styles';
|
|
9
8
|
|
|
10
9
|
export interface IIconProps extends ICommonProps<IIconStyles> {
|
|
11
10
|
type: IIconType;
|
|
@@ -13,14 +12,20 @@ export interface IIconProps extends ICommonProps<IIconStyles> {
|
|
|
13
12
|
|
|
14
13
|
export const Icon: FC<IIconProps> = ({ type, data, testId, tweakStyles }) => {
|
|
15
14
|
const classes = useStyles({ theme: tweakStyles });
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
|
|
17
|
+
const icon = theme.icons?.[type] ?? iconsMap[type];
|
|
18
|
+
|
|
19
|
+
if (isEmpty(icon)) {
|
|
20
|
+
console.error(`Иконки ${type} не существует`);
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
16
23
|
|
|
17
24
|
return (
|
|
18
|
-
<div
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
)}
|
|
24
|
-
</div>
|
|
25
|
+
<div
|
|
26
|
+
className={classes.root}
|
|
27
|
+
{...addDataAttributes(data, testId)}
|
|
28
|
+
dangerouslySetInnerHTML={{ __html: icon }}
|
|
29
|
+
/>
|
|
25
30
|
);
|
|
26
31
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M6 12h3V9H6v3zm-2 4V7h12l.002 9H4zM16 4h-1V3c0-.552-.448-1-1-1s-1 .448-1 1v1H7V3c0-.552-.448-1-1-1s-1 .448-1 1v1H4c-1.103 0-2 .897-2 2v10c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V6c0-1.103-.897-2-2-2z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="m7.5 13.086 7.793-7.793a1 1 0 1 1 1.414 1.414l-8.5 8.5a1 1 0 0 1-1.414 0l-3.5-3.5a1 1 0 1 1 1.414-1.414L7.5 13.086Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M8.24512 8.84751L11.038 6.05461C11.4285 5.66409 12.0617 5.66409 12.4522 6.05461C12.8427 6.44514 12.8427 7.0783 12.4522 7.46883L8.95222 10.9688C8.5617 11.3593 7.92853 11.3593 7.53801 10.9688L4.03801 7.46883C3.64749 7.0783 3.64749 6.44514 4.03801 6.05461C4.42853 5.66409 5.0617 5.66409 5.45222 6.05461L8.24512 8.84751Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10.0029 11.6053L5.71004 7.31242C5.31951 6.9219 4.68635 6.9219 4.29582 7.31242C3.9053 7.70295 3.9053 8.33611 4.29582 8.72664L9.29582 13.7266C9.68635 14.1172 10.3195 14.1172 10.71 13.7266L15.71 8.72664C16.1006 8.33611 16.1006 7.70295 15.71 7.31242C15.3195 6.9219 14.6863 6.9219 14.2958 7.31242L10.0029 11.6053Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M8.41421 10L12.7071 5.70711C13.0976 5.31658 13.0976 4.68342 12.7071 4.29289C12.3166 3.90237 11.6834 3.90237 11.2929 4.29289L6.29289 9.29289C5.90237 9.68342 5.90237 10.3166 6.29289 10.7071L11.2929 15.7071C11.6834 16.0976 12.3166 16.0976 12.7071 15.7071C13.0976 15.3166 13.0976 14.6834 12.7071 14.2929L8.41421 10Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M11.5858 10L7.29289 5.70711C6.90237 5.31658 6.90237 4.68342 7.29289 4.29289C7.68342 3.90237 8.31658 3.90237 8.70711 4.29289L13.7071 9.29289C14.0976 9.68342 14.0976 10.3166 13.7071 10.7071L8.70711 15.7071C8.31658 16.0976 7.68342 16.0976 7.29289 15.7071C6.90237 15.3166 6.90237 14.6834 7.29289 14.2929L11.5858 10Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M6.102 4.709c-.446-.36-1.055-.373-1.415-.012-.39.39-.342 1.072.108 1.523l3.783 3.782-3.783 3.782-.096.108c-.36.446-.373 1.055-.012 1.415.39.391 1.072.342 1.523-.108l3.782-3.783 3.782 3.783.108.097c.446.358 1.055.372 1.415.011.39-.39.342-1.072-.108-1.523l-3.783-3.782L15.19 6.22l.097-.108c.358-.446.372-1.055.011-1.415-.39-.39-1.072-.342-1.523.108L9.992 8.588 6.21 4.805l-.108-.096Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="currentColor" d="M4.5 4.5l11 11m0-11l-11 11" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M11.985 10l2.407-2.293c.41-.39.41-1.023 0-1.414-.41-.39-1.074-.39-1.485 0L10.5 8.586 8.093 6.293c-.411-.39-1.075-.39-1.485 0-.41.391-.41 1.023 0 1.414L9.015 10l-2.407 2.293c-.41.391-.41 1.023 0 1.414.205.195.473.293.742.293s.538-.098.743-.293l2.407-2.293 2.407 2.293c.205.195.474.293.743.293s.537-.098.742-.293c.41-.391.41-1.023 0-1.414L11.985 10z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M12 11c1.306 0 2.417.834 2.829 2H17c.552 0 1 .448 1 1s-.448 1-1 1h-2.17c-.412 1.165-1.524 2-2.83 2s-2.418-.835-2.83-2H3c-.552 0-1-.448-1-1s.448-1 1-1h6.171c.412-1.166 1.523-2 2.829-2zM5 3c1.306 0 2.417.834 2.829 2H17c.552 0 1 .448 1 1s-.448 1-1 1H7.83C7.417 8.165 6.305 9 5 9 3.343 9 2 7.657 2 6s1.343-3 3-3z"></path></svg>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ISvgIcon } from '../types';
|
|
2
|
+
import avatar from './avatar.svg?raw';
|
|
3
|
+
import calendar from './calendar.svg?raw';
|
|
4
|
+
import check from './check.svg?raw';
|
|
5
|
+
import chevronDownSmall from './chevron-down-small.svg?raw';
|
|
6
|
+
import chevronDown from './chevron-down.svg?raw';
|
|
7
|
+
import chevronLeft from './chevron-left.svg?raw';
|
|
8
|
+
import chevronRight from './chevron-right.svg?raw';
|
|
9
|
+
import closeLarge from './close-large.svg?raw';
|
|
10
|
+
import closeWindow from './close-window.svg?raw';
|
|
11
|
+
import close from './close.svg?raw';
|
|
12
|
+
import fileExcel from './file-excel.svg?raw';
|
|
13
|
+
import fileImage from './file-image.svg?raw';
|
|
14
|
+
import fileOther from './file-other.svg?raw';
|
|
15
|
+
import filePdf from './file-pdf.svg?raw';
|
|
16
|
+
import fileWord from './file-word.svg?raw';
|
|
17
|
+
import fileXml from './file-xml.svg?raw';
|
|
18
|
+
import fileZip from './file-zip.svg?raw';
|
|
19
|
+
import filter from './filter.svg?raw';
|
|
20
|
+
import information from './information.svg?raw';
|
|
21
|
+
import menu from './menu.svg?raw';
|
|
22
|
+
import minus from './minus.svg?raw';
|
|
23
|
+
import plus from './plus.svg?raw';
|
|
24
|
+
import search from './search.svg?raw';
|
|
25
|
+
import statusError from './status-error.svg?raw';
|
|
26
|
+
import statusInfo from './status-info.svg?raw';
|
|
27
|
+
import statusNotOk from './status-not-ok.svg?raw';
|
|
28
|
+
import statusOk from './status-ok.svg?raw';
|
|
29
|
+
import statusWarning from './status-warning.svg?raw';
|
|
30
|
+
import trashCan from './trash-can.svg?raw';
|
|
31
|
+
|
|
32
|
+
export const iconsMap = {
|
|
33
|
+
avatar,
|
|
34
|
+
calendar,
|
|
35
|
+
check,
|
|
36
|
+
'chevron-down-small': chevronDownSmall,
|
|
37
|
+
'chevron-down': chevronDown,
|
|
38
|
+
'chevron-left': chevronLeft,
|
|
39
|
+
'chevron-right': chevronRight,
|
|
40
|
+
'close-large': closeLarge,
|
|
41
|
+
'close-window': closeWindow,
|
|
42
|
+
close,
|
|
43
|
+
'file-excel': fileExcel,
|
|
44
|
+
'file-image': fileImage,
|
|
45
|
+
'file-other': fileOther,
|
|
46
|
+
'file-pdf': filePdf,
|
|
47
|
+
'file-word': fileWord,
|
|
48
|
+
'file-xml': fileXml,
|
|
49
|
+
'file-zip': fileZip,
|
|
50
|
+
filter,
|
|
51
|
+
information,
|
|
52
|
+
menu,
|
|
53
|
+
minus,
|
|
54
|
+
plus,
|
|
55
|
+
search,
|
|
56
|
+
'status-error': statusError,
|
|
57
|
+
'status-info': statusInfo,
|
|
58
|
+
'status-not-ok': statusNotOk,
|
|
59
|
+
'status-ok': statusOk,
|
|
60
|
+
'status-warning': statusWarning,
|
|
61
|
+
'trash-can': trashCan,
|
|
62
|
+
} satisfies Record<string, ISvgIcon>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 8c-.552 0-1-.448-1-1s.448-1 1-1 1 .448 1 1-.448 1-1 1zm0 8c3.307 0 6-2.693 6-6 0-3.308-2.693-6-6-6-3.308 0-6 2.692-6 6 0 3.307 2.692 6 6 6zm0-14c2.122 0 4.157.843 5.657 2.343S18 7.878 18 10s-.843 4.157-2.343 5.657S12.122 18 10 18s-4.157-.843-5.657-2.343S2 12.122 2 10c0-4.418 3.582-8 8-8zm0 12c-.552 0-1-.448-1-1v-3c0-.552.448-1 1-1s1 .448 1 1v3c0 .552-.448 1-1 1z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="1 1 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M5.08154 9.02148C5.08154 8.77083 5.16211 8.55778 5.32324 8.38232C5.48438 8.20687 5.70817 8.11914 5.99463 8.11914C6.28109 8.11914 6.50667 8.20687 6.67139 8.38232C6.8361 8.55778 6.91846 8.77083 6.91846 9.02148C6.91846 9.27214 6.8361 9.47803 6.67139 9.63916C6.50667 9.80029 6.28109 9.88086 5.99463 9.88086C5.70817 9.88086 5.48438 9.80029 5.32324 9.63916C5.16211 9.47803 5.08154 9.27214 5.08154 9.02148ZM8.08154 9.02148C8.08154 8.77083 8.16211 8.55778 8.32324 8.38232C8.48438 8.20687 8.70817 8.11914 8.99463 8.11914C9.28109 8.11914 9.50667 8.20687 9.67139 8.38232C9.8361 8.55778 9.91846 8.77083 9.91846 9.02148C9.91846 9.27214 9.8361 9.47803 9.67139 9.63916C9.50667 9.80029 9.28109 9.88086 8.99463 9.88086C8.70817 9.88086 8.48438 9.80029 8.32324 9.63916C8.16211 9.47803 8.08154 9.27214 8.08154 9.02148ZM11.0815 9.02148C11.0815 8.77083 11.1621 8.55778 11.3232 8.38232C11.4844 8.20687 11.7082 8.11914 11.9946 8.11914C12.2811 8.11914 12.5067 8.20687 12.6714 8.38232C12.8361 8.55778 12.9185 8.77083 12.9185 9.02148C12.9185 9.27214 12.8361 9.47803 12.6714 9.63916C12.5067 9.80029 12.2811 9.88086 11.9946 9.88086C11.7082 9.88086 11.4844 9.80029 11.3232 9.63916C11.1621 9.47803 11.0815 9.27214 11.0815 9.02148Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M16 11H4a1 1 0 1 1 0-2h12a1 1 0 1 1 0 2Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M16 11h-5v5a1 1 0 1 1-2 0v-5H4a1 1 0 1 1 0-2h5V4a1 1 0 0 1 2 0v5h5a1 1 0 1 1 0 2Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M9 2c3.866 0 7 3.134 7 7 0 1.7-.606 3.259-1.614 4.472l2.589 2.59c.39.39.39 1.023 0 1.414-.39.39-1.024.39-1.414 0l-2.662-2.661C11.785 15.563 10.443 16 9 16c-3.866 0-7-3.134-7-7s3.134-7 7-7zm0 2C6.239 4 4 6.239 4 9s2.239 5 5 5 5-2.239 5-5-2.239-5-5-5z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0z"></path><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" stroke="none" d="M14 11H6c-.552 0-1-.448-1-1s.448-1 1-1h8c.552 0 1 .448 1 1s-.448 1-1 1z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0z"></path><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" stroke="none" d="M10 15c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1s1 .448 1 1v4c0 .552-.448 1-1 1zM10 7c-.552 0-1-.448-1-1s.448-1 1-1 1 .448 1 1-.448 1-1 1z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0z"></path><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" stroke="none" d="M11.414 10l2.293-2.293c.391-.391.391-1.023 0-1.414-.39-.391-1.023-.391-1.414 0L10 8.586 7.707 6.293c-.39-.391-1.023-.391-1.414 0-.39.391-.39 1.023 0 1.414L8.586 10l-2.293 2.293c-.39.391-.39 1.023 0 1.414.195.195.451.293.707.293.256 0 .512-.098.707-.293L10 11.414l2.293 2.293c.195.195.451.293.707.293.256 0 .512-.098.707-.293.391-.391.391-1.023 0-1.414L11.414 10z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0z"></path><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" stroke="none" d="M8.333 11.252l4.96-4.96c.39-.39 1.024-.39 1.414 0 .39.391.39 1.025 0 1.415L9.04 13.374c-.39.39-1.023.39-1.414 0L5.293 11.04c-.39-.39-.39-1.023 0-1.414.39-.39 1.024-.39 1.414 0l1.626 1.626z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0z"></path><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" stroke="none" d="M10 5c-.552 0-1 .448-1 1v4c0 .552.448 1 1 1s1-.448 1-1V6c0-.552-.448-1-1-1zM10 13c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M16 6v10c0 1.105-.895 2-2 2H6c-1.105 0-2-.895-2-2V6h12zM8 8c-.552 0-1 .448-1 1v6c0 .552.448 1 1 1s1-.448 1-1V9c0-.552-.448-1-1-1zm4 0c-.552 0-1 .448-1 1v6c0 .552.448 1 1 1s1-.448 1-1V9c0-.552-.448-1-1-1zm0-6l1 1h3c.552 0 1 .448 1 1s-.448 1-1 1H4c-.552 0-1-.448-1-1s.448-1 1-1h3l1-1h4z"></path></svg>
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { ReactElement
|
|
2
|
-
import {
|
|
3
|
-
import { iconsList } from './icons-list';
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { iconsMap } from './icons';
|
|
4
3
|
|
|
5
|
-
export
|
|
6
|
-
viewBox?: string;
|
|
7
|
-
paths?: Array<SVGAttributes<never>>;
|
|
8
|
-
circles?: Array<SVGAttributes<never>>;
|
|
9
|
-
rects?: Array<SVGAttributes<never>>;
|
|
10
|
-
}
|
|
4
|
+
export type ISvgIcon = string;
|
|
11
5
|
|
|
12
|
-
|
|
6
|
+
type IUiKitIconsMap = typeof iconsMap;
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
8
|
+
export interface IIconsMap extends IUiKitIconsMap {}
|
|
13
9
|
|
|
14
|
-
export type
|
|
15
|
-
|
|
16
|
-
export type IIconType = ICommonIcon | IComplexIcon;
|
|
10
|
+
export type IIconType = keyof IIconsMap;
|
|
17
11
|
|
|
18
12
|
export type IIcon = IIconType | ReactElement;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { complexIcons } from '../Icon/complexIcons';
|
|
1
|
+
import { type Meta } from '@storybook/react';
|
|
2
|
+
import { iconsMap, IIconType } from '../Icon';
|
|
4
3
|
import { IconButton } from './IconButton';
|
|
5
4
|
import { ICON_BUTTON_SIZES, ICON_BUTTON_VIEWS } from './constants';
|
|
6
5
|
|
|
7
|
-
const icons =
|
|
6
|
+
const icons = Object.keys(iconsMap) as IIconType[];
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
const meta: Meta<typeof IconButton> = {
|
|
10
9
|
title: 'Buttons/IconButton',
|
|
11
10
|
component: IconButton,
|
|
12
11
|
args: {
|
|
@@ -22,11 +21,7 @@ export default {
|
|
|
22
21
|
size: { options: ICON_BUTTON_SIZES, control: 'inline-radio' },
|
|
23
22
|
view: { options: ICON_BUTTON_VIEWS, control: 'inline-radio' },
|
|
24
23
|
},
|
|
25
|
-
|
|
26
|
-
controls: {
|
|
27
|
-
exclude: ['tweakStyles', 'testId', 'data'],
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
} as ComponentMeta<typeof IconButton>;
|
|
24
|
+
};
|
|
31
25
|
|
|
32
|
-
export
|
|
26
|
+
export default meta;
|
|
27
|
+
export const Default = {};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { ITweakStyles, animations, createThemedStyles } from '../../theme';
|
|
2
2
|
|
|
3
|
-
const BUTTON_SIZE_S = 24;
|
|
4
|
-
const BUTTON_SIZE_M = 32;
|
|
5
|
-
const ICON_SIZE = 20;
|
|
6
|
-
|
|
7
3
|
export const useStyles = createThemedStyles('IconButton', {
|
|
8
4
|
root: {
|
|
9
5
|
display: 'flex',
|
|
@@ -13,7 +9,7 @@ export const useStyles = createThemedStyles('IconButton', {
|
|
|
13
9
|
outline: 'none',
|
|
14
10
|
boxSizing: 'border-box',
|
|
15
11
|
transition: animations.defaultTransition,
|
|
16
|
-
transitionProperty: 'background-color, color, border-color',
|
|
12
|
+
transitionProperty: 'background-color, color, border-color, opacity, visibility',
|
|
17
13
|
border: 'none',
|
|
18
14
|
position: 'relative',
|
|
19
15
|
boxShadow: 'none',
|
|
@@ -29,6 +25,10 @@ export const useStyles = createThemedStyles('IconButton', {
|
|
|
29
25
|
'&:active': {
|
|
30
26
|
extend: 'active',
|
|
31
27
|
},
|
|
28
|
+
|
|
29
|
+
width: 'var(--icon-button-size)',
|
|
30
|
+
height: 'var(--icon-button-size)',
|
|
31
|
+
'--icon-button-icon-size': '20px',
|
|
32
32
|
},
|
|
33
33
|
|
|
34
34
|
'cancel-light': {},
|
|
@@ -55,8 +55,8 @@ export const useStyles = createThemedStyles('IconButton', {
|
|
|
55
55
|
icon: {
|
|
56
56
|
display: 'flex',
|
|
57
57
|
alignItems: 'center',
|
|
58
|
-
width:
|
|
59
|
-
height:
|
|
58
|
+
width: 'var(--icon-button-icon-size)',
|
|
59
|
+
height: 'var(--icon-button-icon-size)',
|
|
60
60
|
},
|
|
61
61
|
|
|
62
62
|
loader: {
|
|
@@ -66,18 +66,20 @@ export const useStyles = createThemedStyles('IconButton', {
|
|
|
66
66
|
top: '50%',
|
|
67
67
|
transform: 'translate(-50%, -50%)',
|
|
68
68
|
|
|
69
|
-
width:
|
|
70
|
-
height:
|
|
69
|
+
width: 'var(--icon-button-icon-size)',
|
|
70
|
+
height: 'var(--icon-button-icon-size)',
|
|
71
71
|
},
|
|
72
72
|
|
|
73
73
|
s: {
|
|
74
|
-
|
|
75
|
-
height: BUTTON_SIZE_S,
|
|
74
|
+
'--icon-button-size': '24px',
|
|
76
75
|
},
|
|
77
76
|
|
|
78
77
|
m: {
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
'--icon-button-size': '32px',
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
l: {
|
|
82
|
+
'--icon-button-size': '40px',
|
|
81
83
|
},
|
|
82
84
|
});
|
|
83
85
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import {
|
|
4
|
-
import { addDataAttributes } from '../../helpers';
|
|
3
|
+
import { addDataAttributes } from '@true-engineering/true-react-platform-helpers';
|
|
5
4
|
import { ICommonProps } from '../../types';
|
|
6
5
|
import { renderIcon, IIcon } from '../Icon';
|
|
7
6
|
import { ThemedPreloader } from '../ThemedPreloader';
|
|
@@ -24,51 +23,48 @@ export interface IIconButtonProps
|
|
|
24
23
|
isLoading?: boolean;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
export const IconButton = forwardRef<HTMLButtonElement, IIconButtonProps>(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const classes = useStyles({ theme: tweakStyles });
|
|
26
|
+
export const IconButton = forwardRef<HTMLButtonElement, IIconButtonProps>(function IconButton(
|
|
27
|
+
{
|
|
28
|
+
icon,
|
|
29
|
+
size = 'm',
|
|
30
|
+
view = 'cancel-light',
|
|
31
|
+
isDisabled = false,
|
|
32
|
+
isActive = false,
|
|
33
|
+
isLoading = false,
|
|
34
|
+
type = 'button',
|
|
35
|
+
testId,
|
|
36
|
+
tweakStyles,
|
|
37
|
+
data,
|
|
38
|
+
onClick,
|
|
39
|
+
...restProps
|
|
40
|
+
},
|
|
41
|
+
ref,
|
|
42
|
+
) {
|
|
43
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
46
44
|
|
|
47
|
-
|
|
45
|
+
const hasNoAction = isDisabled || isLoading;
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
);
|
|
47
|
+
return (
|
|
48
|
+
<button
|
|
49
|
+
ref={ref}
|
|
50
|
+
className={clsx(classes.root, classes[view], classes[size], {
|
|
51
|
+
[classes.disabled]: isDisabled,
|
|
52
|
+
[classes.active]: isActive,
|
|
53
|
+
[classes.loading]: isLoading,
|
|
54
|
+
})}
|
|
55
|
+
type={type}
|
|
56
|
+
disabled={isDisabled}
|
|
57
|
+
onClick={hasNoAction ? undefined : onClick}
|
|
58
|
+
{...restProps}
|
|
59
|
+
{...addDataAttributes(data, testId)}
|
|
60
|
+
>
|
|
61
|
+
{isLoading ? (
|
|
62
|
+
<span className={classes.loader}>
|
|
63
|
+
<ThemedPreloader type="default" useCurrentColor />
|
|
64
|
+
</span>
|
|
65
|
+
) : (
|
|
66
|
+
<span className={classes.icon}>{renderIcon(icon)}</span>
|
|
67
|
+
)}
|
|
68
|
+
</button>
|
|
69
|
+
);
|
|
70
|
+
});
|