@true-engineering/true-react-common-ui-kit 4.0.0-alpha7 → 4.0.0-alpha71
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 -720
- 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 +3 -5
- 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 +6 -6
- 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.d.ts +2 -2
- 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/helpers.d.ts +0 -3
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/types.d.ts +3 -5
- 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 +4 -2
- package/dist/components/FiltersPane/FiltersPane.styles.d.ts +2 -2
- package/dist/components/FiltersPane/components/Filter/Filter.d.ts +1 -2
- package/dist/components/FiltersPane/components/Filter/helpers.d.ts +1 -0
- package/dist/components/FiltersPane/components/FilterDateSingle/FilterDateSingle.d.ts +15 -0
- package/dist/components/FiltersPane/components/FilterDateSingle/FilterDateSingle.styles.d.ts +11 -0
- package/dist/components/FiltersPane/components/FilterDateSingle/index.d.ts +2 -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 +6 -5
- package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.d.ts +5 -15
- package/dist/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.d.ts +1 -2
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.d.ts +2 -2
- package/dist/components/FiltersPane/components/FilterWrapper/helpers.d.ts +1 -1
- 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/components/index.d.ts +1 -0
- 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 +15 -5
- package/dist/components/Flag/Flag.d.ts +2 -2
- package/dist/components/Flag/Flag.styles.d.ts +1 -1
- package/dist/components/FlexibleTable/FlexibleTable.d.ts +1 -1
- package/dist/components/FlexibleTable/FlexibleTable.styles.d.ts +2 -2
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.d.ts +5 -4
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.d.ts +1 -1
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.d.ts +1 -3
- 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.d.ts +2 -2
- 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.d.ts +2 -2
- 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.d.ts +3 -3
- 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.d.ts +2 -2
- package/dist/components/PhoneInput/PhoneInput.styles.d.ts +1 -1
- package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.d.ts +2 -2
- 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 +3 -4
- package/dist/components/Select/Select.d.ts +5 -5
- 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 -7
- package/dist/components/Skeleton/Skeleton.d.ts +2 -2
- 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.d.ts +2 -2
- package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.d.ts +1 -1
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.d.ts +2 -2
- 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 +4 -2
- 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 -5
- 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 -1
- package/dist/hooks/use-mixed-styles.d.ts +3 -3
- package/dist/hooks/use-on-click-outside.d.ts +2 -2
- package/dist/hooks/use-resize-ref.d.ts +8 -0
- package/dist/hooks/use-tweak-styles.d.ts +8 -7
- package/dist/theme/Provider.d.ts +3 -13
- package/dist/theme/common.d.ts +34 -4
- package/dist/theme/helpers.d.ts +3 -16
- package/dist/theme/index.d.ts +0 -2
- package/dist/theme/types.d.ts +13 -11
- package/dist/true-react-common-ui-kit.js +10366 -30803
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +1 -32520
- 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 +3 -4
- package/src/components/AddButton/AddButton.stories.tsx +14 -17
- package/src/components/AddButton/AddButton.tsx +4 -6
- 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 +8 -6
- 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 +3 -5
- 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 +71 -46
- 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 +3 -4
- package/src/components/DateInput/DateInput.stories.tsx +13 -31
- package/src/components/DateInput/DateInput.tsx +66 -67
- package/src/components/DatePicker/DatePicker.stories.tsx +18 -42
- package/src/components/DatePicker/DatePicker.styles.ts +3 -1
- package/src/components/DatePicker/DatePicker.tsx +290 -263
- 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/DatePickerHeader/DatePickerHeader.tsx +3 -3
- 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 -13
- package/src/components/DatePicker/index.ts +1 -0
- package/src/components/DatePicker/types.ts +6 -6
- package/src/components/Description/Description.stories.tsx +11 -16
- package/src/components/Description/Description.tsx +3 -4
- 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 +3 -5
- 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 +72 -52
- package/src/components/FiltersPane/FiltersPane.tsx +20 -12
- package/src/components/FiltersPane/components/Filter/Filter.tsx +32 -15
- package/src/components/FiltersPane/components/Filter/helpers.ts +4 -4
- package/src/components/FiltersPane/components/FilterDateSingle/FilterDateSingle.styles.ts +34 -0
- package/src/components/FiltersPane/components/FilterDateSingle/FilterDateSingle.tsx +103 -0
- package/src/components/FiltersPane/components/FilterDateSingle/index.ts +2 -0
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.styles.ts +1 -2
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.tsx +8 -21
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.styles.ts +1 -2
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.tsx +23 -24
- package/src/components/FiltersPane/components/FilterValueView/FilterValueView.tsx +62 -93
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.ts +2 -26
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +10 -45
- package/src/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.tsx +5 -4
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +7 -9
- package/src/components/FiltersPane/components/FilterWrapper/helpers.ts +1 -1
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.ts +5 -0
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.tsx +20 -20
- package/src/components/FiltersPane/components/index.ts +1 -0
- package/src/components/FiltersPane/constants.ts +2 -0
- package/src/components/FiltersPane/helpers.ts +3 -3
- package/src/components/FiltersPane/index.ts +1 -0
- package/src/components/FiltersPane/types.ts +24 -6
- package/src/components/Flag/Flag.stories.tsx +15 -20
- package/src/components/Flag/Flag.tsx +5 -5
- package/src/components/FlexibleTable/FlexibleTable.stories.tsx +47 -50
- package/src/components/FlexibleTable/FlexibleTable.styles.ts +5 -2
- package/src/components/FlexibleTable/FlexibleTable.tsx +32 -53
- package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.ts +1 -0
- package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.tsx +16 -10
- package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.tsx +14 -12
- 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 +42 -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 +18 -13
- 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 +34 -29
- 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 +170 -174
- package/src/components/List/List.stories.tsx +34 -17
- package/src/components/List/List.styles.ts +4 -2
- package/src/components/List/List.tsx +16 -8
- package/src/components/List/components/ListItem/ListItem.styles.ts +4 -1
- package/src/components/List/components/ListItem/ListItem.tsx +9 -7
- 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 +4 -6
- package/src/components/MoreMenu/MoreMenu.stories.tsx +24 -15
- package/src/components/MoreMenu/MoreMenu.tsx +3 -5
- package/src/components/MultiSelect/MultiSelect.stories.tsx +23 -20
- package/src/components/MultiSelect/MultiSelect.tsx +3 -5
- package/src/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.tsx +3 -4
- package/src/components/MultiSelectList/MultiSelectList.tsx +16 -12
- package/src/components/MultiSelectList/helpers.ts +2 -2
- package/src/components/NewMoreMenu/NewMoreMenu.stories.tsx +51 -39
- package/src/components/NewMoreMenu/NewMoreMenu.tsx +30 -25
- package/src/components/Notification/Notification.stories.tsx +37 -34
- package/src/components/Notification/Notification.tsx +12 -21
- 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 +8 -10
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.stories.tsx +5 -11
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +4 -7
- package/src/components/RadioButton/RadioButton.stories.tsx +31 -21
- package/src/components/RadioButton/RadioButton.styles.ts +2 -1
- package/src/components/RadioButton/RadioButton.tsx +13 -6
- 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 +24 -28
- 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 +68 -56
- package/src/components/Select/components/SelectList/SelectList.styles.ts +2 -1
- package/src/components/Select/components/SelectList/SelectList.tsx +14 -8
- 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 +29 -27
- package/src/components/Selector/Selector.styles.ts +31 -133
- package/src/components/Selector/Selector.tsx +37 -53
- package/src/components/Skeleton/Skeleton.stories.tsx +13 -12
- package/src/components/Skeleton/Skeleton.tsx +3 -3
- 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 +6 -5
- 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 +12 -7
- 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 +3 -5
- package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +26 -25
- package/src/components/TextWithTooltip/TextWithTooltip.tsx +8 -7
- package/src/components/ThemedPreloader/ThemedPreloader.stories.tsx +12 -23
- package/src/components/ThemedPreloader/ThemedPreloader.tsx +3 -5
- package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.tsx +3 -3
- package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +7 -7
- package/src/components/Toaster/Toaster.stories.tsx +16 -14
- package/src/components/Toaster/Toaster.tsx +3 -5
- package/src/components/Tooltip/Tooltip.stories.tsx +15 -4
- package/src/components/Tooltip/Tooltip.styles.ts +2 -1
- package/src/components/Tooltip/Tooltip.tsx +13 -6
- 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 +8 -5
- 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 -5
- package/src/hooks/use-intersection-ref.ts +48 -0
- package/src/hooks/use-latest-ref.ts +11 -0
- package/src/hooks/use-on-click-outside.ts +22 -14
- package/src/hooks/use-resize-ref.ts +42 -0
- package/src/hooks/use-tweak-styles.ts +14 -51
- package/src/theme/Provider.tsx +4 -21
- package/src/theme/common.ts +33 -36
- package/src/theme/helpers.ts +50 -40
- package/src/theme/index.ts +0 -2
- package/src/theme/types.ts +20 -16
- package/src/types.ts +21 -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/dist/theme/create-themed-styles.d.ts +0 -2
- package/dist/theme/true-jss/ThemedStylesManager.d.ts +0 -18
- package/dist/theme/true-jss/TweakStylesManager.d.ts +0 -34
- package/dist/theme/true-jss/index.d.ts +0 -2
- package/dist/theme/true-jss/jss-context.d.ts +0 -9
- 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/theme/create-themed-styles.ts +0 -78
- package/src/theme/true-jss/ThemedStylesManager.ts +0 -92
- package/src/theme/true-jss/TweakStylesManager.ts +0 -157
- package/src/theme/true-jss/index.ts +0 -2
- package/src/theme/true-jss/jss-context.tsx +0 -34
- 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
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { type Meta } from '@storybook/react';
|
|
3
|
+
import { ITextWithTooltipProps, TextWithTooltip } from './TextWithTooltip';
|
|
3
4
|
|
|
4
5
|
const positions = [
|
|
5
6
|
'top',
|
|
@@ -19,18 +20,7 @@ const positions = [
|
|
|
19
20
|
'auto-end',
|
|
20
21
|
];
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
title: 'Data Display/TextWithTooltip',
|
|
24
|
-
component: TextWithTooltip,
|
|
25
|
-
argTypes: {
|
|
26
|
-
tooltipPosition: { control: 'select', options: positions },
|
|
27
|
-
tooltipView: { control: 'inline-radio', options: ['tooltip', 'hint'] },
|
|
28
|
-
tooltipType: { control: 'inline-radio', options: ['info', 'error'] },
|
|
29
|
-
mouseEventType: { control: 'inline-radio', options: ['hover', 'click'] },
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const Template: ComponentStory<typeof TextWithTooltip> = (args) => (
|
|
23
|
+
const Story: FC<ITextWithTooltipProps> = (args) => (
|
|
34
24
|
<div
|
|
35
25
|
style={{
|
|
36
26
|
display: 'flex',
|
|
@@ -44,15 +34,26 @@ const Template: ComponentStory<typeof TextWithTooltip> = (args) => (
|
|
|
44
34
|
</div>
|
|
45
35
|
);
|
|
46
36
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
37
|
+
const meta: Meta<typeof Story> = {
|
|
38
|
+
title: 'Data Display/TextWithTooltip',
|
|
39
|
+
component: Story,
|
|
40
|
+
args: {
|
|
41
|
+
children: 'Наведи на меня - появится тултип',
|
|
42
|
+
tooltipText: 'Текст тултипа',
|
|
43
|
+
tooltipPosition: 'top',
|
|
44
|
+
tooltipView: 'tooltip',
|
|
45
|
+
tooltipType: 'info',
|
|
46
|
+
isDisabled: false,
|
|
47
|
+
mouseEventType: 'hover',
|
|
48
|
+
shouldRenderInBody: true,
|
|
49
|
+
},
|
|
50
|
+
argTypes: {
|
|
51
|
+
tooltipPosition: { control: 'select', options: positions },
|
|
52
|
+
tooltipView: { control: 'inline-radio', options: ['tooltip', 'hint'] },
|
|
53
|
+
tooltipType: { control: 'inline-radio', options: ['info', 'error'] },
|
|
54
|
+
mouseEventType: { control: 'inline-radio', options: ['hover', 'click'] },
|
|
55
|
+
},
|
|
58
56
|
};
|
|
57
|
+
|
|
58
|
+
export default meta;
|
|
59
|
+
export const Default = {};
|
|
@@ -2,12 +2,11 @@ import { CSSProperties, FC, ReactNode, useEffect, useRef, useState } from 'react
|
|
|
2
2
|
import { Portal } from 'react-overlays';
|
|
3
3
|
import usePopper, { Modifier, Placement } from 'react-overlays/usePopper';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import {
|
|
6
|
-
import { addDataAttributes } from '../../helpers';
|
|
5
|
+
import { addDataAttributes } from '@true-engineering/true-react-platform-helpers';
|
|
7
6
|
import { useOnClickOutsideWithRef, useTweakStyles } from '../../hooks';
|
|
8
7
|
import { ICommonProps } from '../../types';
|
|
9
8
|
import { ITooltipProps, Tooltip } from '../Tooltip';
|
|
10
|
-
import {
|
|
9
|
+
import { ITextWithTooltipStyles, useStyles } from './TextWithTooltip.styles';
|
|
11
10
|
|
|
12
11
|
export interface ITextWithTooltipProps extends ICommonProps<ITextWithTooltipStyles> {
|
|
13
12
|
children: ReactNode;
|
|
@@ -18,10 +17,11 @@ export interface ITextWithTooltipProps extends ICommonProps<ITextWithTooltipStyl
|
|
|
18
17
|
tooltipType?: ITooltipProps['type'];
|
|
19
18
|
/** @default 'top' */
|
|
20
19
|
tooltipPosition?: Placement;
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
20
|
/** @default [] */
|
|
23
21
|
tooltipModifiers?: Array<Partial<Modifier<any, any>>>;
|
|
24
22
|
tooltipOffsetOptions?: Record<string, unknown>;
|
|
23
|
+
/** @default 'undefined' */
|
|
24
|
+
tooltipSize?: ITooltipProps['size'];
|
|
25
25
|
/** @default 'hover' */
|
|
26
26
|
mouseEventType?: 'hover' | 'click';
|
|
27
27
|
hoverDelay?: number;
|
|
@@ -40,6 +40,7 @@ export const TextWithTooltip: FC<ITextWithTooltipProps> = ({
|
|
|
40
40
|
tooltipType = 'info',
|
|
41
41
|
tooltipModifiers = [],
|
|
42
42
|
tooltipOffsetOptions,
|
|
43
|
+
tooltipSize,
|
|
43
44
|
isDisabled = false,
|
|
44
45
|
shouldRenderInBody = true,
|
|
45
46
|
mouseEventType = 'hover',
|
|
@@ -48,7 +49,7 @@ export const TextWithTooltip: FC<ITextWithTooltipProps> = ({
|
|
|
48
49
|
data,
|
|
49
50
|
tweakStyles,
|
|
50
51
|
}) => {
|
|
51
|
-
const classes = useStyles({
|
|
52
|
+
const classes = useStyles({ tweakStyles });
|
|
52
53
|
|
|
53
54
|
const tweakTooltipStyles = useTweakStyles({
|
|
54
55
|
tweakStyles,
|
|
@@ -129,8 +130,7 @@ export const TextWithTooltip: FC<ITextWithTooltipProps> = ({
|
|
|
129
130
|
mouseEventType === 'click' && shouldShowTooltip && classes.clickable,
|
|
130
131
|
)}
|
|
131
132
|
{...(shouldShowTooltip ? props : undefined)}
|
|
132
|
-
{...
|
|
133
|
-
{...addDataAttributes(data)}
|
|
133
|
+
{...addDataAttributes(data, testId)}
|
|
134
134
|
ref={root}
|
|
135
135
|
>
|
|
136
136
|
{shouldShowTooltip && (
|
|
@@ -145,6 +145,7 @@ export const TextWithTooltip: FC<ITextWithTooltipProps> = ({
|
|
|
145
145
|
view={tooltipView}
|
|
146
146
|
type={tooltipType}
|
|
147
147
|
text={tooltipText}
|
|
148
|
+
size={tooltipSize}
|
|
148
149
|
tweakStyles={tweakTooltipStyles}
|
|
149
150
|
/>
|
|
150
151
|
</div>
|
|
@@ -1,41 +1,30 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type Meta } from '@storybook/react';
|
|
3
3
|
import { colors } from '../../theme';
|
|
4
4
|
import { IThemedPreloaderProps, ThemedPreloader } from './ThemedPreloader';
|
|
5
5
|
|
|
6
|
-
interface
|
|
6
|
+
interface IThemedPreloaderCustomProps extends IThemedPreloaderProps {
|
|
7
7
|
currentColor: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
currentColor,
|
|
12
|
-
...args
|
|
13
|
-
}) => (
|
|
10
|
+
const Story: FC<IThemedPreloaderCustomProps> = ({ currentColor, ...args }) => (
|
|
14
11
|
<div style={{ color: currentColor }}>
|
|
15
12
|
<ThemedPreloader {...args} />
|
|
16
13
|
</div>
|
|
17
14
|
);
|
|
18
15
|
|
|
19
|
-
|
|
16
|
+
const meta: Meta<typeof Story> = {
|
|
20
17
|
title: 'Feedback/ThemedPreloader',
|
|
21
|
-
component:
|
|
18
|
+
component: Story,
|
|
19
|
+
args: {
|
|
20
|
+
type: 'dots',
|
|
21
|
+
useCurrentColor: false,
|
|
22
|
+
currentColor: colors.GREEN_FOCUS,
|
|
23
|
+
},
|
|
22
24
|
argTypes: {
|
|
23
25
|
type: { options: ['default', 'logo', 'dots'], control: 'inline-radio' },
|
|
24
26
|
},
|
|
25
27
|
};
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
export const Default = Template.bind({});
|
|
32
|
-
Default.args = {
|
|
33
|
-
type: 'dots',
|
|
34
|
-
useCurrentColor: false,
|
|
35
|
-
currentColor: colors.GREEN_FOCUS,
|
|
36
|
-
};
|
|
37
|
-
Default.parameters = {
|
|
38
|
-
controls: {
|
|
39
|
-
exclude: ['data'],
|
|
40
|
-
},
|
|
41
|
-
};
|
|
29
|
+
export default meta;
|
|
30
|
+
export const Default = {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FC } 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 { useTweakStyles } from '../../hooks';
|
|
6
5
|
import { ICommonProps } from '../../types';
|
|
7
6
|
import { SvgPreloader, DotsPreloader } from './components';
|
|
@@ -22,7 +21,7 @@ export const ThemedPreloader: FC<IThemedPreloaderProps> = ({
|
|
|
22
21
|
testId,
|
|
23
22
|
tweakStyles,
|
|
24
23
|
}) => {
|
|
25
|
-
const classes = useStyles({
|
|
24
|
+
const classes = useStyles({ tweakStyles });
|
|
26
25
|
|
|
27
26
|
const tweakDotsPreloaderStyles = useTweakStyles({
|
|
28
27
|
tweakStyles,
|
|
@@ -41,8 +40,7 @@ export const ThemedPreloader: FC<IThemedPreloaderProps> = ({
|
|
|
41
40
|
className={clsx(classes.root, classes[type], {
|
|
42
41
|
[classes.currentColor]: useCurrentColor,
|
|
43
42
|
})}
|
|
44
|
-
{...
|
|
45
|
-
{...addDataAttributes(data)}
|
|
43
|
+
{...addDataAttributes(data, testId)}
|
|
46
44
|
>
|
|
47
45
|
{type === 'dots' ? (
|
|
48
46
|
<DotsPreloader tweakStyles={tweakDotsPreloaderStyles} />
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ITweakStylesProps } from '../../../../types';
|
|
3
3
|
import { useStyles, IDotsPreloaderStyles } from './DotsPreloader.styles';
|
|
4
4
|
|
|
5
|
-
export type IDotsPreloaderProps =
|
|
5
|
+
export type IDotsPreloaderProps = ITweakStylesProps<IDotsPreloaderStyles>;
|
|
6
6
|
|
|
7
7
|
export const DotsPreloader: FC<IDotsPreloaderProps> = ({ tweakStyles }) => {
|
|
8
|
-
const classes = useStyles({
|
|
8
|
+
const classes = useStyles({ tweakStyles });
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<div className={classes.root}>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { FC
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { useTheme } from '../../../../theme';
|
|
3
|
+
import { ITweakStylesProps } from '../../../../types';
|
|
4
4
|
import { IPreloaderSvgType } from '../../types';
|
|
5
5
|
import { DefaultPreloader } from '../DefaultPreloader';
|
|
6
|
-
import {
|
|
6
|
+
import { ISvgPreloaderStyles, useStyles } from './SvgPreloader.styles';
|
|
7
7
|
|
|
8
|
-
export interface ISvgPreloaderProps extends
|
|
8
|
+
export interface ISvgPreloaderProps extends ITweakStylesProps<ISvgPreloaderStyles> {
|
|
9
9
|
type: IPreloaderSvgType;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const SvgPreloader: FC<ISvgPreloaderProps> = ({ type = 'default', tweakStyles }) => {
|
|
13
|
-
const classes = useStyles({
|
|
13
|
+
const classes = useStyles({ tweakStyles });
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const theme = useTheme();
|
|
16
16
|
const PreloaderIcon = theme.preloaders?.[type] ?? DefaultPreloader;
|
|
17
17
|
const isInlineSvg = typeof PreloaderIcon === 'string';
|
|
18
18
|
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { type Meta } from '@storybook/react';
|
|
2
3
|
import { Button } from '../Button';
|
|
3
|
-
import { Toaster } from './Toaster';
|
|
4
|
+
import { IToasterProps, Toaster } from './Toaster';
|
|
5
|
+
import { IToasterType } from './types';
|
|
4
6
|
|
|
5
|
-
const types = ['error', 'info', 'warning', 'ok', 'not-ok'];
|
|
7
|
+
const types: IToasterType[] = ['error', 'info', 'warning', 'ok', 'not-ok'];
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
const Story: FC<IToasterProps> = (args) => (
|
|
10
|
+
<Toaster {...args} onTimeEnd={() => console.log(1)} onClose={() => alert('closed')}>
|
|
11
|
+
<Button size="m">Нажмите</Button>
|
|
12
|
+
</Toaster>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const meta: Meta<typeof Story> = {
|
|
8
16
|
title: 'Feedback/Toaster',
|
|
9
|
-
component:
|
|
17
|
+
component: Story,
|
|
10
18
|
args: {
|
|
11
19
|
title: 'Произошла очень страшная ошибка',
|
|
12
20
|
text: 'Мы даже не знаем, чем вам помочь!',
|
|
@@ -18,13 +26,7 @@ export default {
|
|
|
18
26
|
argTypes: {
|
|
19
27
|
type: { control: 'inline-radio', options: types },
|
|
20
28
|
},
|
|
21
|
-
|
|
22
|
-
controls: { exclude: ['onTimeEnd', 'onClose', 'data', 'tweakStyles'] },
|
|
23
|
-
},
|
|
24
|
-
} as ComponentMeta<typeof Toaster>;
|
|
29
|
+
};
|
|
25
30
|
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
<Button size="m">Нажмите</Button>
|
|
29
|
-
</Toaster>
|
|
30
|
-
);
|
|
31
|
+
export default meta;
|
|
32
|
+
export const Default = {};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { FC, ReactNode, useEffect } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
addDataAttributes,
|
|
5
5
|
isEmpty,
|
|
6
6
|
isNotEmpty,
|
|
7
7
|
isReactNodeNotEmpty,
|
|
8
8
|
} from '@true-engineering/true-react-platform-helpers';
|
|
9
|
-
import { addDataAttributes } from '../../helpers';
|
|
10
9
|
import { useTweakStyles } from '../../hooks';
|
|
11
10
|
import { ICommonProps } from '../../types';
|
|
12
11
|
import { Icon } from '../Icon';
|
|
@@ -48,7 +47,7 @@ export const Toaster: FC<IToasterProps> = ({
|
|
|
48
47
|
onClose,
|
|
49
48
|
onTimeEnd,
|
|
50
49
|
}) => {
|
|
51
|
-
const classes = useStyles({
|
|
50
|
+
const classes = useStyles({ tweakStyles });
|
|
52
51
|
|
|
53
52
|
const tweakCloseButtonStyles = useTweakStyles({
|
|
54
53
|
tweakStyles,
|
|
@@ -70,8 +69,7 @@ export const Toaster: FC<IToasterProps> = ({
|
|
|
70
69
|
<div
|
|
71
70
|
className={classes.root}
|
|
72
71
|
onClick={shouldCloseOnClick ? onClose : undefined}
|
|
73
|
-
{...
|
|
74
|
-
{...addDataAttributes(data)}
|
|
72
|
+
{...addDataAttributes(data, testId)}
|
|
75
73
|
>
|
|
76
74
|
<div className={clsx(classes.iconContainer, classes[type])}>
|
|
77
75
|
<Icon type={`status-${type}`} />
|
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Meta } from '@storybook/react';
|
|
2
|
+
import { IExtendableProps } from '../../types';
|
|
2
3
|
import { Tooltip } from './Tooltip';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
const SIZES = ['micro'] as const;
|
|
6
|
+
|
|
7
|
+
declare module './types' {
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
9
|
+
export interface ITooltipSizes extends IExtendableProps<typeof SIZES> {}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof Tooltip> = {
|
|
5
13
|
title: 'Data Display/Tooltip',
|
|
6
14
|
component: Tooltip,
|
|
7
15
|
args: {
|
|
8
16
|
text: 'Tooltip Text',
|
|
9
17
|
view: 'tooltip',
|
|
10
18
|
type: 'info',
|
|
19
|
+
size: undefined,
|
|
11
20
|
},
|
|
12
21
|
argTypes: {
|
|
13
22
|
text: { control: 'text' },
|
|
14
23
|
view: { control: 'inline-radio', options: ['tooltip', 'hint'] },
|
|
15
24
|
type: { control: 'inline-radio', options: ['info', 'error'] },
|
|
25
|
+
size: { options: [undefined, ...SIZES], control: 'inline-radio' },
|
|
16
26
|
},
|
|
17
|
-
}
|
|
27
|
+
};
|
|
18
28
|
|
|
19
|
-
export
|
|
29
|
+
export default meta;
|
|
30
|
+
export const Default = {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { rgba } from '../../helpers';
|
|
2
2
|
import { colors, createThemedStyles, dimensions, ITweakStyles } from '../../theme';
|
|
3
|
+
import { ITooltipSizes } from './types';
|
|
3
4
|
|
|
4
5
|
export const useStyles = createThemedStyles('Tooltip', {
|
|
5
6
|
root: {
|
|
@@ -48,4 +49,4 @@ export const useStyles = createThemedStyles('Tooltip', {
|
|
|
48
49
|
},
|
|
49
50
|
});
|
|
50
51
|
|
|
51
|
-
export type ITooltipStyles = ITweakStyles<typeof useStyles>;
|
|
52
|
+
export type ITooltipStyles = ITweakStyles<typeof useStyles, ITooltipSizes>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import {
|
|
4
|
-
import { addDataAttributes } from '../../helpers';
|
|
3
|
+
import { addDataAttributes, isNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
5
4
|
import { ICommonProps } from '../../types';
|
|
5
|
+
import { ITooltipSize } from './types';
|
|
6
6
|
import { useStyles, ITooltipStyles } from './Tooltip.styles';
|
|
7
7
|
|
|
8
8
|
export interface ITooltipProps extends ICommonProps<ITooltipStyles> {
|
|
@@ -11,23 +11,30 @@ export interface ITooltipProps extends ICommonProps<ITooltipStyles> {
|
|
|
11
11
|
view?: 'tooltip' | 'hint' | 'custom';
|
|
12
12
|
/** @default 'info' */
|
|
13
13
|
type?: 'info' | 'error';
|
|
14
|
+
/** @default 'undefined' */
|
|
15
|
+
size?: ITooltipSize;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export const Tooltip: FC<ITooltipProps> = ({
|
|
17
19
|
text,
|
|
18
20
|
view = 'tooltip',
|
|
19
21
|
type = 'info',
|
|
22
|
+
size,
|
|
20
23
|
data,
|
|
21
24
|
testId,
|
|
22
25
|
tweakStyles,
|
|
23
26
|
}) => {
|
|
24
|
-
const classes = useStyles({
|
|
27
|
+
const classes = useStyles({ tweakStyles });
|
|
25
28
|
|
|
26
29
|
return (
|
|
27
30
|
<div
|
|
28
|
-
className={clsx(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
className={clsx(
|
|
32
|
+
classes.root,
|
|
33
|
+
classes[view],
|
|
34
|
+
classes[type],
|
|
35
|
+
isNotEmpty(size) && classes[size],
|
|
36
|
+
)}
|
|
37
|
+
{...addDataAttributes(data, testId)}
|
|
31
38
|
>
|
|
32
39
|
{text}
|
|
33
40
|
</div>
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { doNothing } from '@true-engineering/true-react-platform-helpers';
|
|
2
|
-
import {
|
|
3
|
+
import { type Meta } from '@storybook/react';
|
|
3
4
|
import { IInputProps, Input } from '../Input';
|
|
4
|
-
import { WithMessages } from './WithMessages';
|
|
5
|
+
import { IWithMessagesProps, WithMessages } from './WithMessages';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
title: 'WithMessages',
|
|
8
|
-
component: WithMessages,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const Template: ComponentStory<typeof WithMessages> = ({ controlsDirection, ...args }) => {
|
|
7
|
+
const Story: FC<IWithMessagesProps> = ({ controlsDirection, ...args }) => {
|
|
12
8
|
let groupPlacement: Array<IInputProps['groupPlacement']> = [];
|
|
9
|
+
|
|
13
10
|
if (controlsDirection === 'horizontal') {
|
|
14
11
|
groupPlacement = ['left', 'right'];
|
|
15
12
|
}
|
|
16
13
|
if (controlsDirection === 'vertical') {
|
|
17
14
|
groupPlacement = ['top', 'bottom'];
|
|
18
15
|
}
|
|
16
|
+
|
|
19
17
|
return (
|
|
20
18
|
<WithMessages {...args} controlsDirection={controlsDirection}>
|
|
21
19
|
<Input value="value" groupPlacement={groupPlacement[0]} onChange={doNothing} />
|
|
@@ -24,17 +22,15 @@ const Template: ComponentStory<typeof WithMessages> = ({ controlsDirection, ...a
|
|
|
24
22
|
);
|
|
25
23
|
};
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Default.argTypes = {
|
|
36
|
-
controlsDirection: {
|
|
37
|
-
options: [undefined, 'horizontal', 'vertical'],
|
|
38
|
-
control: 'radio',
|
|
25
|
+
const meta: Meta<typeof Story> = {
|
|
26
|
+
title: 'Data Display/WithMessages',
|
|
27
|
+
component: Story,
|
|
28
|
+
args: {
|
|
29
|
+
infoMessage: 'Message Info',
|
|
30
|
+
errorMessage: 'Error Text',
|
|
31
|
+
controlsDirection: undefined,
|
|
39
32
|
},
|
|
40
33
|
};
|
|
34
|
+
|
|
35
|
+
export default meta;
|
|
36
|
+
export const Default = {};
|
|
@@ -15,45 +15,46 @@ export interface IWithMessagesProps extends ICommonProps<IWithMessagesStyles> {
|
|
|
15
15
|
controlsDirection?: 'horizontal' | 'vertical';
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export const WithMessages = forwardRef<HTMLDivElement, IWithMessagesProps>(
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
export const WithMessages = forwardRef<HTMLDivElement, IWithMessagesProps>(function WithMessages(
|
|
19
|
+
{ children, infoMessage, errorMessage, controlsDirection, tweakStyles, testId, data },
|
|
20
|
+
ref,
|
|
21
|
+
) {
|
|
22
|
+
const classes = useStyles({ tweakStyles });
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
const shouldShowError = isReactNodeNotEmpty(errorMessage);
|
|
25
|
+
const shouldShowInfo = isReactNodeNotEmpty(infoMessage) && !shouldShowError;
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
);
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
ref={ref}
|
|
30
|
+
className={classes.withMessages}
|
|
31
|
+
data-invalid={shouldShowError ? true : undefined}
|
|
32
|
+
{...addDataAttributes(data, testId)}
|
|
33
|
+
>
|
|
34
|
+
{isReactNodeNotEmpty(children) && (
|
|
35
|
+
<div
|
|
36
|
+
className={clsx(classes.children, {
|
|
37
|
+
[classes.horizontal]: controlsDirection === 'horizontal',
|
|
38
|
+
[classes.vertical]: controlsDirection === 'vertical',
|
|
39
|
+
})}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</div>
|
|
43
|
+
)}
|
|
44
|
+
{(shouldShowError || shouldShowInfo) && (
|
|
45
|
+
<div className={classes.message}>
|
|
46
|
+
{shouldShowError && (
|
|
47
|
+
<div className={classes.error} {...addDataTestId(testId, 'error')}>
|
|
48
|
+
{errorMessage}
|
|
49
|
+
</div>
|
|
50
|
+
)}
|
|
51
|
+
{shouldShowInfo && (
|
|
52
|
+
<div className={classes.info} {...addDataTestId(testId, 'info')}>
|
|
53
|
+
{infoMessage}
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { doNothing } from '@true-engineering/true-react-platform-helpers';
|
|
2
|
-
import {
|
|
3
|
+
import { type Meta } from '@storybook/react';
|
|
4
|
+
import { excludeStorybookParams } from '../../helpers';
|
|
3
5
|
import { Button } from '../Button';
|
|
4
6
|
import { IListItem, List } from '../List';
|
|
5
7
|
import { Tooltip } from '../Tooltip';
|
|
6
|
-
import { WithPopup } from './WithPopup';
|
|
8
|
+
import { IWithPopupProps, WithPopup } from './WithPopup';
|
|
7
9
|
|
|
8
10
|
const positions = [
|
|
9
11
|
undefined,
|
|
@@ -21,15 +23,6 @@ const positions = [
|
|
|
21
23
|
'left-end',
|
|
22
24
|
];
|
|
23
25
|
|
|
24
|
-
export default {
|
|
25
|
-
title: 'Data Display/WithPopup',
|
|
26
|
-
component: WithPopup,
|
|
27
|
-
argTypes: {
|
|
28
|
-
placement: { control: 'select', options: positions },
|
|
29
|
-
eventType: { control: 'inline-radio', options: ['hover', 'click'] },
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
26
|
const items: IListItem[] = [
|
|
34
27
|
{
|
|
35
28
|
item: 'Copy',
|
|
@@ -45,7 +38,7 @@ const items: IListItem[] = [
|
|
|
45
38
|
},
|
|
46
39
|
];
|
|
47
40
|
|
|
48
|
-
const
|
|
41
|
+
const Story: FC<IWithPopupProps> = (args) => (
|
|
49
42
|
<div
|
|
50
43
|
style={{
|
|
51
44
|
display: 'flex',
|
|
@@ -83,19 +76,27 @@ const Template: ComponentStory<typeof WithPopup> = (args) => (
|
|
|
83
76
|
</div>
|
|
84
77
|
);
|
|
85
78
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
79
|
+
const meta: Meta<typeof Story> = {
|
|
80
|
+
title: 'Data Display/WithPopup',
|
|
81
|
+
component: Story,
|
|
82
|
+
args: {
|
|
83
|
+
canBeFlipped: true,
|
|
84
|
+
isDisabled: false,
|
|
85
|
+
shouldRenderInBody: true,
|
|
86
|
+
shouldHideOnScroll: false,
|
|
87
|
+
shouldStopPropagation: true,
|
|
88
|
+
shouldShowArrow: false,
|
|
89
|
+
},
|
|
90
|
+
argTypes: {
|
|
91
|
+
placement: { control: 'select', options: positions },
|
|
92
|
+
eventType: { control: 'inline-radio', options: ['hover', 'click'] },
|
|
93
|
+
},
|
|
94
|
+
parameters: {
|
|
95
|
+
controls: {
|
|
96
|
+
exclude: excludeStorybookParams(['trigger', 'middlewares', 'children', 'eventType']),
|
|
97
|
+
},
|
|
100
98
|
},
|
|
101
99
|
};
|
|
100
|
+
|
|
101
|
+
export default meta;
|
|
102
|
+
export const Default = {};
|