@true-engineering/true-react-common-ui-kit 2.6.0 → 3.0.0-alpha.0
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/dist/components/AccountInfo/AccountInfo.d.ts +2 -3
- package/dist/components/AccountInfo/AccountInfo.styles.d.ts +6 -64
- package/dist/components/AccountInfo/index.d.ts +1 -1
- package/dist/components/AddButton/AddButton.d.ts +2 -3
- package/dist/components/AddButton/AddButton.styles.d.ts +3 -28
- package/dist/components/AddButton/index.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -4
- package/dist/components/Button/Button.styles.d.ts +8 -150
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +3 -17
- package/dist/components/Checkbox/Checkbox.styles.d.ts +3 -50
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/CloseButton/CloseButton.d.ts +3 -5
- package/dist/components/CloseButton/CloseButton.styles.d.ts +3 -27
- package/dist/components/CloseButton/index.d.ts +1 -1
- package/dist/components/Colors/Colors.styles.d.ts +1 -32
- package/dist/components/Colors/index.d.ts +0 -1
- package/dist/components/CssBaseline/CssBaseline.d.ts +2 -4
- package/dist/components/CssBaseline/CssBaseline.styles.d.ts +3 -11
- package/dist/components/CssBaseline/index.d.ts +1 -1
- package/dist/components/DateInput/DateInput.d.ts +3 -3
- package/dist/components/DateInput/DateInput.styles.d.ts +6 -11
- package/dist/components/DateInput/index.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +5 -7
- package/dist/components/DatePicker/DatePicker.styles.d.ts +6 -33
- package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.d.ts +3 -3
- package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.d.ts +7 -69
- package/dist/components/DatePicker/components/DatePickerHeader/index.d.ts +1 -1
- package/dist/components/DatePicker/index.d.ts +2 -2
- package/dist/components/Description/Description.d.ts +2 -3
- package/dist/components/Description/Description.styles.d.ts +3 -24
- package/dist/components/Description/index.d.ts +1 -1
- package/dist/components/FiltersPane/FiltersPane.d.ts +6 -8
- package/dist/components/FiltersPane/FiltersPane.styles.d.ts +8 -56
- package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.d.ts +2 -4
- package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.styles.d.ts +15 -52
- package/dist/components/FiltersPane/components/FilterInterval/index.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterSelect/FilterSelect.d.ts +2 -4
- package/dist/components/FiltersPane/components/FilterSelect/FilterSelect.styles.d.ts +15 -124
- package/dist/components/FiltersPane/components/FilterSelect/index.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.d.ts +3 -1
- package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.styles.d.ts +3 -12
- package/dist/components/FiltersPane/components/FilterValueView/index.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.d.ts +5 -7
- package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.d.ts +26 -47
- package/dist/components/FiltersPane/components/FilterWithDates/index.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.d.ts +4 -6
- package/dist/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.styles.d.ts +7 -12
- package/dist/components/FiltersPane/components/FilterWithPeriod/index.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.d.ts +5 -6
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.d.ts +6 -96
- package/dist/components/FiltersPane/components/FilterWrapper/index.d.ts +1 -1
- package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.d.ts +2 -4
- package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.d.ts +10 -91
- package/dist/components/FiltersPane/components/FiltersPaneSearch/index.d.ts +1 -1
- package/dist/components/FiltersPane/helpers.d.ts +1 -1
- package/dist/components/FiltersPane/index.d.ts +1 -1
- package/dist/components/FiltersPane/types.d.ts +1 -1
- package/dist/components/Flag/Flag.d.ts +2 -3
- package/dist/components/Flag/Flag.styles.d.ts +3 -12
- package/dist/components/Flag/index.d.ts +1 -1
- package/dist/components/FlexibleTable/FlexibleTable.d.ts +2 -4
- package/dist/components/FlexibleTable/FlexibleTable.styles.d.ts +7 -101
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.d.ts +17 -0
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.d.ts +3 -0
- package/dist/components/FlexibleTable/components/FlexibleTableCell/index.d.ts +2 -0
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.d.ts +19 -0
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.styles.d.ts +6 -0
- package/dist/components/FlexibleTable/components/FlexibleTableRow/index.d.ts +2 -0
- package/dist/components/FlexibleTable/components/index.d.ts +2 -2
- package/dist/components/FlexibleTable/index.d.ts +2 -1
- package/dist/components/Icon/Icon.d.ts +2 -3
- package/dist/components/Icon/Icon.styles.d.ts +3 -8
- package/dist/components/Icon/icons-list.d.ts +1 -1
- package/dist/components/Icon/index.d.ts +1 -1
- package/dist/components/IncrementInput/IncrementInput.d.ts +3 -3
- package/dist/components/IncrementInput/IncrementInput.styles.d.ts +7 -61
- package/dist/components/IncrementInput/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +2 -4
- package/dist/components/Input/Input.styles.d.ts +6 -247
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/List/List.d.ts +2 -4
- package/dist/components/List/List.styles.d.ts +3 -39
- package/dist/components/List/index.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts +2 -4
- package/dist/components/Modal/Modal.styles.d.ts +6 -239
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/MoreMenu/MoreMenu.d.ts +2 -4
- package/dist/components/MoreMenu/MoreMenu.styles.d.ts +6 -54
- package/dist/components/MoreMenu/index.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +8 -8
- package/dist/components/MultiSelect/MultiSelect.styles.d.ts +7 -44
- package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.d.ts +4 -4
- package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.styles.d.ts +3 -62
- package/dist/components/MultiSelect/components/MultiSelectInput/index.d.ts +1 -1
- package/dist/components/MultiSelect/index.d.ts +2 -2
- package/dist/components/MultiSelect/types.d.ts +1 -1
- package/dist/components/MultiSelectList/MultiSelectList.d.ts +2 -4
- package/dist/components/MultiSelectList/MultiSelectList.styles.d.ts +13 -105
- package/dist/components/MultiSelectList/index.d.ts +1 -1
- package/dist/components/Notification/Notification.d.ts +4 -6
- package/dist/components/Notification/Notification.styles.d.ts +3 -37
- package/dist/components/Notification/index.d.ts +1 -1
- package/dist/components/Notification/types.d.ts +1 -1
- package/dist/components/PhoneInput/PhoneInput.d.ts +3 -3
- package/dist/components/PhoneInput/PhoneInput.styles.d.ts +9 -66
- package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.d.ts +2 -3
- package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.d.ts +7 -83
- package/dist/components/PhoneInput/components/PhoneInputCountryList/index.d.ts +1 -1
- package/dist/components/PhoneInput/index.d.ts +2 -2
- package/dist/components/RadioButton/RadioButton.d.ts +3 -4
- package/dist/components/RadioButton/RadioButton.styles.d.ts +3 -30
- package/dist/components/RadioButton/index.d.ts +1 -1
- package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +4 -4
- package/dist/components/SearchInput/SearchInput.d.ts +3 -4
- package/dist/components/SearchInput/SearchInput.styles.d.ts +7 -39
- package/dist/components/SearchInput/index.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +3 -4
- package/dist/components/Select/Select.styles.d.ts +33 -80
- package/dist/components/Select/components/SelectList/SelectList.d.ts +2 -4
- package/dist/components/Select/components/SelectList/SelectList.styles.d.ts +3 -57
- package/dist/components/Select/components/SelectList/index.d.ts +1 -1
- package/dist/components/Select/components/SelectListItem/SelectListItem.styles.d.ts +2 -2
- package/dist/components/Select/index.d.ts +2 -2
- package/dist/components/SmartInput/SmartInput.d.ts +2 -2
- package/dist/components/SmartInput/helpers.d.ts +2 -2
- package/dist/components/SmartInput/types.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts +2 -4
- package/dist/components/Switch/Switch.styles.d.ts +3 -62
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/TextArea/TextArea.d.ts +2 -4
- package/dist/components/TextArea/TextArea.styles.d.ts +3 -128
- package/dist/components/TextArea/index.d.ts +1 -1
- package/dist/components/TextWithInfo/TextWithInfo.d.ts +2 -3
- package/dist/components/TextWithInfo/TextWithInfo.styles.d.ts +3 -48
- package/dist/components/TextWithInfo/index.d.ts +1 -1
- package/dist/components/TextWithTooltip/TextWithTooltip.d.ts +2 -3
- package/dist/components/TextWithTooltip/TextWithTooltip.styles.d.ts +6 -14
- package/dist/components/TextWithTooltip/index.d.ts +1 -1
- package/dist/components/ThemedPreloader/ThemedPreloader.d.ts +2 -3
- package/dist/components/ThemedPreloader/ThemedPreloader.styles.d.ts +7 -14
- package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.d.ts +2 -4
- package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.d.ts +3 -43
- package/dist/components/ThemedPreloader/components/DotsPreloader/index.d.ts +1 -1
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.d.ts +2 -3
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.d.ts +3 -9
- package/dist/components/ThemedPreloader/components/SvgPreloader/index.d.ts +1 -1
- package/dist/components/ThemedPreloader/index.d.ts +2 -2
- package/dist/components/Toaster/Toaster.d.ts +4 -5
- package/dist/components/Toaster/Toaster.styles.d.ts +6 -45
- package/dist/components/Toaster/index.d.ts +1 -1
- package/dist/components/Toaster/types.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +2 -3
- package/dist/components/Tooltip/Tooltip.styles.d.ts +3 -35
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/phone.d.ts +3 -0
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/use-tweak-styles.d.ts +21 -2
- package/dist/index.d.ts +1 -1
- package/dist/theme/Provider.d.ts +11 -0
- package/dist/{theme.d.ts → theme/common.d.ts} +6 -10
- package/dist/theme/helpers.d.ts +10 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/types.d.ts +72 -0
- package/dist/true-react-common-ui-kit.js +2980 -2471
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +2912 -2403
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/dist/types.d.ts +4 -22
- package/package.json +2 -2
- package/src/components/AccountInfo/AccountInfo.styles.ts +5 -9
- package/src/components/AccountInfo/AccountInfo.tsx +13 -10
- package/src/components/AccountInfo/constants.ts +1 -1
- package/src/components/AccountInfo/index.ts +1 -1
- package/src/components/AddButton/AddButton.styles.ts +4 -4
- package/src/components/AddButton/AddButton.tsx +7 -6
- package/src/components/AddButton/index.ts +1 -1
- package/src/components/Button/Button.styles.ts +14 -9
- package/src/components/Button/Button.tsx +12 -19
- package/src/components/Button/index.ts +1 -1
- package/src/components/Checkbox/Checkbox.stories.tsx +5 -9
- package/src/components/Checkbox/Checkbox.styles.ts +8 -24
- package/src/components/Checkbox/Checkbox.tsx +3 -25
- package/src/components/Checkbox/index.ts +1 -1
- package/src/components/CloseButton/CloseButton.styles.ts +4 -5
- package/src/components/CloseButton/CloseButton.tsx +6 -8
- package/src/components/CloseButton/index.ts +1 -1
- package/src/components/Colors/Colors.styles.ts +3 -5
- package/src/components/Colors/Colors.tsx +3 -3
- package/src/components/Colors/index.ts +0 -1
- package/src/components/CssBaseline/CssBaseline.styles.ts +4 -5
- package/src/components/CssBaseline/CssBaseline.tsx +6 -8
- package/src/components/CssBaseline/index.ts +1 -1
- package/src/components/DateInput/DateInput.styles.ts +10 -6
- package/src/components/DateInput/DateInput.tsx +20 -7
- package/src/components/DateInput/index.ts +1 -1
- package/src/components/DatePicker/DatePicker.styles.ts +8 -14
- package/src/components/DatePicker/DatePicker.tsx +15 -16
- package/src/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.ts +30 -26
- package/src/components/DatePicker/components/DatePickerHeader/DatePickerHeader.tsx +17 -7
- package/src/components/DatePicker/components/DatePickerHeader/index.ts +1 -1
- package/src/components/DatePicker/index.ts +2 -2
- package/src/components/Description/Description.styles.ts +4 -5
- package/src/components/Description/Description.tsx +6 -6
- package/src/components/Description/index.ts +1 -1
- package/src/components/FiltersPane/FiltersPane.styles.ts +38 -22
- package/src/components/FiltersPane/FiltersPane.tsx +23 -18
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.styles.ts +23 -27
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.tsx +25 -12
- package/src/components/FiltersPane/components/FilterInterval/index.ts +1 -1
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.styles.ts +21 -26
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.tsx +27 -14
- package/src/components/FiltersPane/components/FilterSelect/index.ts +1 -1
- package/src/components/FiltersPane/components/FilterValueView/FilterValueView.styles.tsx +4 -4
- package/src/components/FiltersPane/components/FilterValueView/FilterValueView.tsx +6 -4
- package/src/components/FiltersPane/components/FilterValueView/index.tsx +1 -1
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.ts +33 -26
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +54 -25
- package/src/components/FiltersPane/components/FilterWithDates/index.ts +1 -1
- package/src/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.styles.ts +11 -7
- package/src/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.tsx +12 -9
- package/src/components/FiltersPane/components/FilterWithPeriod/index.ts +1 -1
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.ts +11 -6
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +28 -10
- package/src/components/FiltersPane/components/FilterWrapper/index.ts +1 -1
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.ts +31 -24
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.tsx +23 -10
- package/src/components/FiltersPane/components/FiltersPaneSearch/index.ts +1 -1
- package/src/components/FiltersPane/helpers.ts +1 -1
- package/src/components/FiltersPane/index.ts +1 -1
- package/src/components/FiltersPane/types.ts +1 -1
- package/src/components/Flag/Flag.styles.ts +4 -5
- package/src/components/Flag/Flag.tsx +3 -5
- package/src/components/Flag/index.ts +1 -1
- package/src/components/FlexibleTable/FlexibleTable.stories.tsx +12 -0
- package/src/components/FlexibleTable/FlexibleTable.styles.ts +10 -37
- package/src/components/FlexibleTable/FlexibleTable.tsx +19 -28
- package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.ts +28 -0
- package/src/components/FlexibleTable/components/{TableValue/TableValue.tsx → FlexibleTableCell/FlexibleTableCell.tsx} +11 -12
- package/src/components/FlexibleTable/components/FlexibleTableCell/index.ts +2 -0
- package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.styles.ts +19 -0
- package/src/components/FlexibleTable/components/{TableRow/TableRow.tsx → FlexibleTableRow/FlexibleTableRow.tsx} +24 -25
- package/src/components/FlexibleTable/components/FlexibleTableRow/index.ts +2 -0
- package/src/components/FlexibleTable/components/index.ts +2 -2
- package/src/components/FlexibleTable/index.ts +2 -1
- package/src/components/Icon/Icon.styles.ts +4 -4
- package/src/components/Icon/Icon.tsx +6 -7
- package/src/components/Icon/components/ComplexIconBoilerplate/ComplexIconBoilerplate.tsx +1 -1
- package/src/components/Icon/components/IconBolerplate/IconBoilerplate.tsx +1 -1
- package/src/components/Icon/helpers.ts +1 -1
- package/src/components/Icon/index.ts +1 -1
- package/src/components/IncrementInput/IncrementInput.styles.ts +12 -12
- package/src/components/IncrementInput/IncrementInput.tsx +59 -35
- package/src/components/IncrementInput/index.ts +1 -1
- package/src/components/Input/Input.styles.ts +8 -8
- package/src/components/Input/Input.tsx +10 -8
- package/src/components/Input/index.ts +1 -1
- package/src/components/List/List.styles.ts +4 -5
- package/src/components/List/List.tsx +3 -6
- package/src/components/List/index.ts +1 -1
- package/src/components/Modal/Modal.styles.ts +5 -7
- package/src/components/Modal/Modal.tsx +10 -8
- package/src/components/Modal/index.ts +1 -1
- package/src/components/MoreMenu/MoreMenu.styles.ts +5 -7
- package/src/components/MoreMenu/MoreMenu.tsx +10 -7
- package/src/components/MoreMenu/index.ts +1 -1
- package/src/components/MultiSelect/MultiSelect.styles.ts +11 -7
- package/src/components/MultiSelect/MultiSelect.tsx +24 -15
- package/src/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.styles.ts +4 -4
- package/src/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.tsx +7 -6
- package/src/components/MultiSelect/components/MultiSelectInput/index.ts +1 -1
- package/src/components/MultiSelect/index.ts +2 -2
- package/src/components/MultiSelect/types.ts +1 -1
- package/src/components/MultiSelectList/MultiSelectList.styles.ts +37 -29
- package/src/components/MultiSelectList/MultiSelectList.tsx +36 -17
- package/src/components/MultiSelectList/helpers.ts +1 -1
- package/src/components/MultiSelectList/index.ts +1 -1
- package/src/components/Notification/Notification.styles.ts +14 -9
- package/src/components/Notification/Notification.tsx +6 -9
- package/src/components/Notification/index.ts +1 -1
- package/src/components/Notification/types.ts +1 -1
- package/src/components/PhoneInput/PhoneInput.styles.ts +18 -13
- package/src/components/PhoneInput/PhoneInput.tsx +34 -17
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.ts +18 -15
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +16 -6
- package/src/components/PhoneInput/components/PhoneInputCountryList/index.ts +1 -1
- package/src/components/PhoneInput/index.ts +2 -2
- package/src/components/RadioButton/RadioButton.styles.ts +4 -4
- package/src/components/RadioButton/RadioButton.tsx +6 -6
- package/src/components/RadioButton/index.ts +1 -1
- package/src/components/SearchInput/SearchInput.styles.ts +28 -28
- package/src/components/SearchInput/SearchInput.tsx +12 -7
- package/src/components/SearchInput/index.ts +1 -1
- package/src/components/Select/Select.styles.ts +71 -23
- package/src/components/Select/Select.tsx +33 -34
- package/src/components/Select/components/SelectList/SelectList.styles.ts +4 -5
- package/src/components/Select/components/SelectList/SelectList.tsx +6 -7
- package/src/components/Select/components/SelectList/index.ts +1 -1
- package/src/components/Select/components/SelectListItem/SelectListItem.styles.ts +2 -2
- package/src/components/Select/components/SelectListItem/SelectListItem.tsx +1 -1
- package/src/components/Select/helpers.ts +3 -2
- package/src/components/Select/index.ts +2 -2
- package/src/components/SmartInput/SmartInput.stories.tsx +2 -2
- package/src/components/SmartInput/SmartInput.tsx +2 -2
- package/src/components/SmartInput/helpers.ts +2 -2
- package/src/components/SmartInput/types.ts +1 -1
- package/src/components/Switch/Switch.styles.ts +4 -4
- package/src/components/Switch/Switch.tsx +3 -6
- package/src/components/Switch/index.ts +1 -1
- package/src/components/TextArea/TextArea.styles.ts +4 -4
- package/src/components/TextArea/TextArea.tsx +3 -6
- package/src/components/TextArea/index.ts +1 -1
- package/src/components/TextWithInfo/TextWithInfo.styles.ts +4 -5
- package/src/components/TextWithInfo/TextWithInfo.tsx +6 -5
- package/src/components/TextWithInfo/index.ts +1 -1
- package/src/components/TextWithTooltip/TextWithTooltip.styles.ts +8 -6
- package/src/components/TextWithTooltip/TextWithTooltip.tsx +15 -9
- package/src/components/TextWithTooltip/index.ts +1 -1
- package/src/components/ThemedPreloader/ThemedPreloader.styles.ts +11 -6
- package/src/components/ThemedPreloader/ThemedPreloader.tsx +19 -11
- package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.ts +4 -4
- package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.tsx +3 -6
- package/src/components/ThemedPreloader/components/DotsPreloader/index.ts +1 -1
- package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.ts +4 -4
- package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +5 -6
- package/src/components/ThemedPreloader/components/SvgPreloader/index.ts +1 -1
- package/src/components/ThemedPreloader/index.ts +2 -2
- package/src/components/Toaster/Toaster.styles.ts +8 -7
- package/src/components/Toaster/Toaster.tsx +15 -9
- package/src/components/Toaster/index.ts +1 -1
- package/src/components/Toaster/types.ts +1 -1
- package/src/components/Tooltip/Tooltip.styles.ts +20 -16
- package/src/components/Tooltip/Tooltip.tsx +10 -6
- package/src/components/Tooltip/index.ts +1 -1
- package/src/helpers/index.ts +0 -1
- package/src/helpers/misc.ts +1 -1
- package/src/helpers/phone.ts +4 -1
- package/src/hooks/index.ts +0 -1
- package/src/hooks/use-tweak-styles.ts +56 -12
- package/src/index.ts +1 -1
- package/src/theme/Provider.tsx +21 -0
- package/src/{theme.ts → theme/common.ts} +6 -6
- package/src/theme/helpers.ts +74 -0
- package/src/theme/index.ts +4 -0
- package/src/theme/types.ts +137 -0
- package/src/types.ts +4 -82
- package/dist/components/FlexibleTable/components/TableRow/TableRow.d.ts +0 -28
- package/dist/components/FlexibleTable/components/TableRow/index.d.ts +0 -1
- package/dist/components/FlexibleTable/components/TableValue/TableValue.d.ts +0 -21
- package/dist/components/FlexibleTable/components/TableValue/index.d.ts +0 -1
- package/dist/components/IncrementInput/components/ChangeButton/ChangeButton.d.ts +0 -10
- package/dist/components/IncrementInput/components/ChangeButton/index.d.ts +0 -1
- package/dist/components/IncrementInput/components/index.d.ts +0 -1
- package/dist/helpers/deprecated.d.ts +0 -12
- package/dist/hooks/use-theme.d.ts +0 -9
- package/src/components/FlexibleTable/components/TableRow/index.ts +0 -1
- package/src/components/FlexibleTable/components/TableValue/index.ts +0 -1
- package/src/components/IncrementInput/components/ChangeButton/ChangeButton.tsx +0 -33
- package/src/components/IncrementInput/components/ChangeButton/index.ts +0 -1
- package/src/components/IncrementInput/components/index.ts +0 -1
- package/src/helpers/deprecated.ts +0 -23
- package/src/hooks/use-theme.ts +0 -32
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { colors } from '../../../../theme';
|
|
2
|
-
import {
|
|
1
|
+
import { colors, createThemedStyles, ITweakStyles } from '../../../../theme';
|
|
2
|
+
import { IButtonStyles } from '../../../Button';
|
|
3
|
+
import { IInputStyles } from '../../../Input';
|
|
4
|
+
import { innerTextButtonStyles } from '../../FiltersPane.styles';
|
|
3
5
|
|
|
4
|
-
export const
|
|
6
|
+
export const useStyles = createThemedStyles('FilterInterval', {
|
|
5
7
|
root: {
|
|
6
8
|
padding: 8,
|
|
7
9
|
background: colors.CLASSIC_WHITE,
|
|
@@ -30,35 +32,29 @@ export const styles = {
|
|
|
30
32
|
display: 'flex',
|
|
31
33
|
justifyContent: 'flex-end',
|
|
32
34
|
},
|
|
35
|
+
});
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
icon: {
|
|
40
|
-
padding: 0,
|
|
41
|
-
width: 24,
|
|
42
|
-
|
|
43
|
-
'&:last-child': {
|
|
44
|
-
paddingRight: 0,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
37
|
+
export const inputStyles: IInputStyles = {
|
|
38
|
+
input: {
|
|
39
|
+
minWidth: 120,
|
|
47
40
|
},
|
|
48
41
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
'&:hover, &:focus': {
|
|
54
|
-
color: colors.FONT_MEDIUM,
|
|
55
|
-
},
|
|
42
|
+
icon: {
|
|
43
|
+
padding: 0,
|
|
44
|
+
width: 24,
|
|
56
45
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
46
|
+
'&:last-child': {
|
|
47
|
+
paddingRight: 0,
|
|
60
48
|
},
|
|
61
49
|
},
|
|
62
50
|
};
|
|
63
51
|
|
|
64
|
-
export
|
|
52
|
+
export const clearButtonStyles = innerTextButtonStyles;
|
|
53
|
+
|
|
54
|
+
export type IFilterIntervalStyles = ITweakStyles<
|
|
55
|
+
typeof useStyles,
|
|
56
|
+
{
|
|
57
|
+
tweakInput: IInputStyles;
|
|
58
|
+
tweakClearButton: IButtonStyles;
|
|
59
|
+
}
|
|
60
|
+
>;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import { FC, useMemo } from 'react';
|
|
2
|
+
import { getTestId } from '@true-engineering/true-react-platform-helpers';
|
|
2
3
|
import { addDataAttributes } from '../../../../helpers';
|
|
3
|
-
import {
|
|
4
|
+
import { useTweakStyles } from '../../../../hooks';
|
|
4
5
|
import { ICommonProps } from '../../../../types';
|
|
5
6
|
import { Button } from '../../../Button';
|
|
6
7
|
import { NumberInput } from '../../../NumberInput';
|
|
7
8
|
import { getLocale, sortValues } from '../../helpers';
|
|
8
9
|
import { IFilterLocaleKey, IPartialFilterLocale } from '../../types';
|
|
9
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
useStyles,
|
|
12
|
+
IFilterIntervalStyles,
|
|
13
|
+
inputStyles,
|
|
14
|
+
clearButtonStyles,
|
|
15
|
+
} from './FilterInterval.styles';
|
|
10
16
|
|
|
11
|
-
export interface IFilterIntervalProps extends ICommonProps {
|
|
12
|
-
tweakStyles?: FilterIntervalStyles;
|
|
17
|
+
export interface IFilterIntervalProps extends ICommonProps<IFilterIntervalStyles> {
|
|
13
18
|
value?: Array<number | undefined>;
|
|
14
19
|
onChange: (value?: Array<number | undefined>) => void;
|
|
15
20
|
labelName: string;
|
|
16
|
-
|
|
17
21
|
localeKey?: IFilterLocaleKey;
|
|
18
22
|
locale?: IPartialFilterLocale;
|
|
19
23
|
withFieldNameInLabel?: boolean;
|
|
@@ -28,7 +32,6 @@ export interface IFilterIntervalProps extends ICommonProps {
|
|
|
28
32
|
max?: number;
|
|
29
33
|
maxLength?: number;
|
|
30
34
|
};
|
|
31
|
-
testId?: string;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
export const FilterInterval: FC<IFilterIntervalProps> = ({
|
|
@@ -45,7 +48,7 @@ export const FilterInterval: FC<IFilterIntervalProps> = ({
|
|
|
45
48
|
toInput,
|
|
46
49
|
testId,
|
|
47
50
|
}) => {
|
|
48
|
-
const
|
|
51
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
49
52
|
|
|
50
53
|
const translates = useMemo(() => getLocale(localeKey, locale), [localeKey, locale]);
|
|
51
54
|
|
|
@@ -69,9 +72,19 @@ export const FilterInterval: FC<IFilterIntervalProps> = ({
|
|
|
69
72
|
onChange(sortValues([value?.[0], v]));
|
|
70
73
|
};
|
|
71
74
|
|
|
72
|
-
const tweakInputStyles = useTweakStyles(
|
|
75
|
+
const tweakInputStyles = useTweakStyles({
|
|
76
|
+
innerStyles: inputStyles,
|
|
77
|
+
tweakStyles,
|
|
78
|
+
className: 'tweakInput',
|
|
79
|
+
currentComponentName: 'FilterInterval',
|
|
80
|
+
});
|
|
73
81
|
|
|
74
|
-
const tweakClearButtonStyles = useTweakStyles(
|
|
82
|
+
const tweakClearButtonStyles = useTweakStyles({
|
|
83
|
+
innerStyles: clearButtonStyles,
|
|
84
|
+
tweakStyles,
|
|
85
|
+
className: 'tweakClearButton',
|
|
86
|
+
currentComponentName: 'FilterInterval',
|
|
87
|
+
});
|
|
75
88
|
|
|
76
89
|
return (
|
|
77
90
|
<div className={classes.root} {...addDataAttributes(data)}>
|
|
@@ -92,7 +105,7 @@ export const FilterInterval: FC<IFilterIntervalProps> = ({
|
|
|
92
105
|
max={fromInput?.max}
|
|
93
106
|
maxLength={fromInput?.maxLength}
|
|
94
107
|
tweakStyles={tweakInputStyles}
|
|
95
|
-
testId={testId
|
|
108
|
+
testId={getTestId(testId, 'start')}
|
|
96
109
|
/>
|
|
97
110
|
{withFieldNameInLabel && (
|
|
98
111
|
<div className={classes.autosize}>
|
|
@@ -116,7 +129,7 @@ export const FilterInterval: FC<IFilterIntervalProps> = ({
|
|
|
116
129
|
max={toInput?.max}
|
|
117
130
|
maxLength={toInput?.maxLength}
|
|
118
131
|
tweakStyles={tweakInputStyles}
|
|
119
|
-
testId={testId
|
|
132
|
+
testId={getTestId(testId, 'end')}
|
|
120
133
|
/>
|
|
121
134
|
{withFieldNameInLabel && (
|
|
122
135
|
<div className={classes.autosize}>
|
|
@@ -130,7 +143,7 @@ export const FilterInterval: FC<IFilterIntervalProps> = ({
|
|
|
130
143
|
onClick={handleClear}
|
|
131
144
|
size="s"
|
|
132
145
|
view="text"
|
|
133
|
-
testId={testId
|
|
146
|
+
testId={getTestId(testId, 'clear-button')}
|
|
134
147
|
tweakStyles={tweakClearButtonStyles}
|
|
135
148
|
>
|
|
136
149
|
{translates.clear}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './FilterInterval';
|
|
2
|
-
export type {
|
|
2
|
+
export type { IFilterIntervalStyles } from './FilterInterval.styles';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { colors, helpers } from '../../../../theme';
|
|
2
|
-
import {
|
|
1
|
+
import { colors, createThemedStyles, helpers, ITweakStyles } from '../../../../theme';
|
|
2
|
+
import { IButtonStyles } from '../../../Button';
|
|
3
|
+
import { ISearchInputStyles } from '../../../SearchInput';
|
|
4
|
+
import { innerTextButtonStyles } from '../../FiltersPane.styles';
|
|
3
5
|
|
|
4
6
|
const ITEM_HEIGHT = 40;
|
|
5
7
|
const LIST_GAP = 12;
|
|
6
8
|
|
|
7
|
-
export const
|
|
9
|
+
export const useStyles = createThemedStyles('FilterSelect', {
|
|
8
10
|
root: {
|
|
9
|
-
width: ({ width }: { width: string | number }): string | number => width ?? 220,
|
|
10
11
|
background: colors.CLASSIC_WHITE,
|
|
11
12
|
},
|
|
12
13
|
|
|
@@ -114,30 +115,24 @@ export const styles = {
|
|
|
114
115
|
padding: 16,
|
|
115
116
|
fontSize: 14,
|
|
116
117
|
},
|
|
118
|
+
});
|
|
117
119
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
tweakClearButton: {
|
|
129
|
-
text: {
|
|
130
|
-
color: colors.GREY_ACTIVE,
|
|
131
|
-
|
|
132
|
-
'&:hover, &:focus': {
|
|
133
|
-
color: colors.FONT_MEDIUM,
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
'&:active': {
|
|
137
|
-
color: colors.FONT_MEDIUM,
|
|
138
|
-
},
|
|
120
|
+
export const searchInputStyles: ISearchInputStyles = {
|
|
121
|
+
tweakInput: {
|
|
122
|
+
inputWrapper: {
|
|
123
|
+
backgroundColor: 'transparent',
|
|
124
|
+
border: 'none',
|
|
125
|
+
height: 40,
|
|
139
126
|
},
|
|
140
127
|
},
|
|
141
128
|
};
|
|
142
129
|
|
|
143
|
-
export
|
|
130
|
+
export const clearButtonStyles = innerTextButtonStyles;
|
|
131
|
+
|
|
132
|
+
export type IFilterSelectStyles = ITweakStyles<
|
|
133
|
+
typeof useStyles,
|
|
134
|
+
{
|
|
135
|
+
tweakSearchInput: ISearchInputStyles;
|
|
136
|
+
tweakClearButton: IButtonStyles;
|
|
137
|
+
}
|
|
138
|
+
>;
|
|
@@ -3,7 +3,7 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { debounce } from 'ts-debounce';
|
|
4
4
|
import { isReactNodeNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
5
5
|
import { addDataAttributes } from '../../../../helpers';
|
|
6
|
-
import { useIsMounted,
|
|
6
|
+
import { useIsMounted, useTweakStyles } from '../../../../hooks';
|
|
7
7
|
import { ICommonProps } from '../../../../types';
|
|
8
8
|
import { Button } from '../../../Button';
|
|
9
9
|
import { Icon } from '../../../Icon';
|
|
@@ -12,10 +12,14 @@ import { SearchInput } from '../../../SearchInput';
|
|
|
12
12
|
import { ThemedPreloader } from '../../../ThemedPreloader';
|
|
13
13
|
import { defaultConvertFunction, getSelectLocale } from '../../helpers';
|
|
14
14
|
import { IFilterLocaleKey, ISelectLocale } from '../../types';
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
import {
|
|
16
|
+
useStyles,
|
|
17
|
+
IFilterSelectStyles,
|
|
18
|
+
searchInputStyles,
|
|
19
|
+
clearButtonStyles,
|
|
20
|
+
} from './FilterSelect.styles';
|
|
21
|
+
|
|
22
|
+
export interface IFilterSelectProps<Value> extends ICommonProps<IFilterSelectStyles> {
|
|
19
23
|
value?: Value;
|
|
20
24
|
onChange: (value?: Value) => void;
|
|
21
25
|
/**
|
|
@@ -42,7 +46,6 @@ export interface IFilterSelectProps<Value> extends ICommonProps {
|
|
|
42
46
|
* @default true
|
|
43
47
|
*/
|
|
44
48
|
hasClearButton?: boolean;
|
|
45
|
-
testId?: string;
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
export function FilterSelect<Value>({
|
|
@@ -51,7 +54,7 @@ export function FilterSelect<Value>({
|
|
|
51
54
|
value,
|
|
52
55
|
isSearchEnabled = false,
|
|
53
56
|
isGroupingEnabled = false,
|
|
54
|
-
width,
|
|
57
|
+
width = 220,
|
|
55
58
|
localeKey,
|
|
56
59
|
locale,
|
|
57
60
|
onChange,
|
|
@@ -64,9 +67,23 @@ export function FilterSelect<Value>({
|
|
|
64
67
|
hasClearButton = true,
|
|
65
68
|
testId,
|
|
66
69
|
}: IFilterSelectProps<Value>): JSX.Element {
|
|
67
|
-
const
|
|
70
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
71
|
+
|
|
72
|
+
const tweakSearchInputStyles = useTweakStyles({
|
|
73
|
+
innerStyles: searchInputStyles,
|
|
74
|
+
tweakStyles,
|
|
75
|
+
className: 'tweakSearchInput',
|
|
76
|
+
currentComponentName: 'FilterSelect',
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const tweakClearButtonStyles = useTweakStyles({
|
|
80
|
+
innerStyles: clearButtonStyles,
|
|
81
|
+
tweakStyles,
|
|
82
|
+
className: 'tweakClearButton',
|
|
83
|
+
currentComponentName: 'FilterSelect',
|
|
84
|
+
});
|
|
68
85
|
|
|
69
|
-
const
|
|
86
|
+
const isMounted = useIsMounted();
|
|
70
87
|
|
|
71
88
|
const translates = useMemo(() => getSelectLocale(localeKey, locale), [localeKey, locale]);
|
|
72
89
|
|
|
@@ -207,12 +224,8 @@ export function FilterSelect<Value>({
|
|
|
207
224
|
doFetchOptions();
|
|
208
225
|
}, []);
|
|
209
226
|
|
|
210
|
-
const tweakSearchInputStyles = useTweakStyles(componentStyles, tweakStyles, 'tweakSearchInput');
|
|
211
|
-
|
|
212
|
-
const tweakClearButtonStyles = useTweakStyles(componentStyles, tweakStyles, 'tweakClearButton');
|
|
213
|
-
|
|
214
227
|
return (
|
|
215
|
-
<div className={classes.root} {...addDataAttributes(data)}>
|
|
228
|
+
<div className={classes.root} style={{ width }} {...addDataAttributes(data)}>
|
|
216
229
|
{isSearchEnabled && (
|
|
217
230
|
<div className={classes.dropdownInput}>
|
|
218
231
|
<SearchInput
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './FilterSelect';
|
|
2
|
-
export type {
|
|
2
|
+
export type { IFilterSelectStyles } from './FilterSelect.styles';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createThemedStyles, ITweakStyles } from '../../../../theme';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const useStyles = createThemedStyles('FilterValueView', {
|
|
4
4
|
text: {
|
|
5
5
|
overflow: 'hidden',
|
|
6
6
|
textOverflow: 'ellipsis',
|
|
@@ -10,6 +10,6 @@ export const styles = {
|
|
|
10
10
|
count: {
|
|
11
11
|
whiteSpace: 'pre',
|
|
12
12
|
},
|
|
13
|
-
};
|
|
13
|
+
});
|
|
14
14
|
|
|
15
|
-
export type
|
|
15
|
+
export type IFilterValueViewStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { format } from 'date-fns';
|
|
3
|
-
import {
|
|
3
|
+
import { ICommonProps } from '../../../../types';
|
|
4
4
|
import { IMultiSelectListValues } from '../../../MultiSelectList';
|
|
5
5
|
import { DEFAULT_DATE_FORMAT } from '../../constants';
|
|
6
6
|
import { defaultConvertFunction, getLocale } from '../../helpers';
|
|
7
7
|
import { IDateRangeConfigItem, IFilterWithDatesValue, IPeriod } from '../../types';
|
|
8
8
|
import { IFilterWrapperProps } from '../FilterWrapper';
|
|
9
|
-
import {
|
|
9
|
+
import { IFilterValueViewStyles, useStyles } from './FilterValueView.styles';
|
|
10
10
|
|
|
11
11
|
export function FilterValueView<Values, Key extends keyof Values>({
|
|
12
12
|
locale,
|
|
13
13
|
localeKey,
|
|
14
14
|
filter,
|
|
15
15
|
value,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
tweakStyles,
|
|
17
|
+
}: Omit<IFilterWrapperProps<Values, Key>, 'onChange' | 'filtersPaneRef' | 'tweakStyles'> &
|
|
18
|
+
ICommonProps<IFilterValueViewStyles>): JSX.Element {
|
|
19
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
18
20
|
|
|
19
21
|
if (value === undefined || value === null) {
|
|
20
22
|
return <></>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './FilterValueView';
|
|
2
|
-
export type {
|
|
2
|
+
export type { IFilterValueViewStyles } from './FilterValueView.styles';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { colors } from '../../../../theme';
|
|
2
|
-
import {
|
|
1
|
+
import { colors, createThemedStyles, ITweakStyles } from '../../../../theme';
|
|
2
|
+
import { IButtonStyles } from '../../../Button';
|
|
3
|
+
import { IDatePickerStyles } from '../../../DatePicker';
|
|
4
|
+
import { innerTextButtonStyles } from '../../FiltersPane.styles';
|
|
3
5
|
|
|
4
|
-
export const
|
|
6
|
+
export const useStyles = createThemedStyles('FilterWithDates', {
|
|
5
7
|
root: {
|
|
6
8
|
background: colors.CLASSIC_WHITE,
|
|
7
9
|
position: 'relative',
|
|
@@ -27,34 +29,39 @@ export const styles = {
|
|
|
27
29
|
},
|
|
28
30
|
|
|
29
31
|
datepicker: {},
|
|
32
|
+
});
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
text: {
|
|
33
|
-
color: colors.GREY_ACTIVE,
|
|
34
|
+
export const clearButtonStyles = innerTextButtonStyles;
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
color: colors.FONT_MEDIUM,
|
|
37
|
-
},
|
|
36
|
+
export const backButtonStyles = innerTextButtonStyles;
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
const PICKER_TOP_MARGIN = 28;
|
|
39
|
+
const PICKER_WITH_BUTTONS_TOP_MARGIN = 60;
|
|
40
|
+
const START_PICKER_LEFT_MARGIN = -20;
|
|
41
|
+
const END_PICKER_LEFT_MARGIN = -170;
|
|
42
|
+
|
|
43
|
+
export const startDatePickerStyles: IDatePickerStyles = {
|
|
44
|
+
popper: { marginTop: PICKER_TOP_MARGIN, marginLeft: START_PICKER_LEFT_MARGIN },
|
|
45
|
+
};
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
export const startDatePickerWithButtonStyles: IDatePickerStyles = {
|
|
48
|
+
popper: { marginTop: PICKER_WITH_BUTTONS_TOP_MARGIN, marginLeft: START_PICKER_LEFT_MARGIN },
|
|
49
|
+
};
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
export const endDatePickerStyles: IDatePickerStyles = {
|
|
52
|
+
popper: { marginTop: PICKER_TOP_MARGIN, marginLeft: END_PICKER_LEFT_MARGIN },
|
|
53
|
+
};
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
55
|
+
export const endDatePickerWithButtonStyles: IDatePickerStyles = {
|
|
56
|
+
popper: { marginTop: PICKER_WITH_BUTTONS_TOP_MARGIN, marginLeft: END_PICKER_LEFT_MARGIN },
|
|
58
57
|
};
|
|
59
58
|
|
|
60
|
-
export type
|
|
59
|
+
export type IFilterWithDatesStyles = ITweakStyles<
|
|
60
|
+
typeof useStyles,
|
|
61
|
+
{
|
|
62
|
+
tweakClearButton: IButtonStyles;
|
|
63
|
+
tweakBackButton: IButtonStyles;
|
|
64
|
+
tweakStartDatePicker: IDatePickerStyles;
|
|
65
|
+
tweakEndDatePicker: IDatePickerStyles;
|
|
66
|
+
}
|
|
67
|
+
>;
|
|
@@ -2,9 +2,9 @@ import { useState, useMemo, useRef, FC } from 'react';
|
|
|
2
2
|
import { isAfter, isBefore } from 'date-fns';
|
|
3
3
|
import enUS from 'date-fns/locale/en-US';
|
|
4
4
|
import ru from 'date-fns/locale/ru';
|
|
5
|
-
import { getTestId } from '@true-engineering/true-react-platform-helpers';
|
|
5
|
+
import { getTestId, isNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
6
6
|
import { addDataAttributes } from '../../../../helpers';
|
|
7
|
-
import {
|
|
7
|
+
import { useTweakStyles } from '../../../../hooks';
|
|
8
8
|
import { ICommonProps } from '../../../../types';
|
|
9
9
|
import { Button } from '../../../Button';
|
|
10
10
|
import { DatePicker } from '../../../DatePicker';
|
|
@@ -16,20 +16,27 @@ import {
|
|
|
16
16
|
IFilterWithDatesValue,
|
|
17
17
|
IPartialFilterLocale,
|
|
18
18
|
} from '../../types';
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
import {
|
|
20
|
+
useStyles,
|
|
21
|
+
IFilterWithDatesStyles,
|
|
22
|
+
clearButtonStyles,
|
|
23
|
+
backButtonStyles,
|
|
24
|
+
startDatePickerWithButtonStyles,
|
|
25
|
+
startDatePickerStyles,
|
|
26
|
+
endDatePickerStyles,
|
|
27
|
+
endDatePickerWithButtonStyles,
|
|
28
|
+
} from './FilterWithDates.styles';
|
|
29
|
+
|
|
30
|
+
export interface IFilterWithDatesProps extends ICommonProps<IFilterWithDatesStyles> {
|
|
23
31
|
value?: IFilterWithDatesValue;
|
|
24
|
-
onChange: (val: IFilterWithDatesValue) => void;
|
|
25
32
|
localeKey?: IFilterLocaleKey;
|
|
26
33
|
locale?: IPartialFilterLocale;
|
|
27
|
-
onStartBtnSubmit?: () => void;
|
|
28
|
-
onEndBtnSubmit: () => void;
|
|
29
|
-
testId?: string;
|
|
30
34
|
isClearable?: boolean;
|
|
31
35
|
startPickerProps?: IFilterWithDateDatePickerProps;
|
|
32
36
|
endPickerProps?: IFilterWithDateDatePickerProps;
|
|
37
|
+
onChange(val: IFilterWithDatesValue): void;
|
|
38
|
+
onStartBtnSubmit?(): void;
|
|
39
|
+
onEndBtnSubmit(): void;
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
export const FilterWithDates: FC<IFilterWithDatesProps> = ({
|
|
@@ -46,22 +53,50 @@ export const FilterWithDates: FC<IFilterWithDatesProps> = ({
|
|
|
46
53
|
endPickerProps = DEFAULT_PICKER_PROPS,
|
|
47
54
|
isClearable = true,
|
|
48
55
|
}) => {
|
|
49
|
-
const
|
|
56
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
57
|
+
|
|
58
|
+
const tweakClearButtonStyles = useTweakStyles({
|
|
59
|
+
innerStyles: clearButtonStyles,
|
|
60
|
+
tweakStyles,
|
|
61
|
+
className: 'tweakClearButton',
|
|
62
|
+
currentComponentName: 'FilterWithDates',
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const tweakBackButtonStyles = useTweakStyles({
|
|
66
|
+
innerStyles: backButtonStyles,
|
|
67
|
+
tweakStyles,
|
|
68
|
+
className: 'tweakBackButton',
|
|
69
|
+
currentComponentName: 'FilterWithDates',
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const hasButtonsRow = isClearable || isNotEmpty(onStartBtnSubmit);
|
|
73
|
+
|
|
74
|
+
const tweakStartDatePickerStyles = useTweakStyles({
|
|
75
|
+
innerStyles: hasButtonsRow ? startDatePickerWithButtonStyles : startDatePickerStyles,
|
|
76
|
+
tweakStyles,
|
|
77
|
+
className: 'tweakStartDatePicker',
|
|
78
|
+
currentComponentName: 'FilterWithDates',
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const tweakEndDatePickerStyles = useTweakStyles({
|
|
82
|
+
innerStyles: hasButtonsRow ? endDatePickerWithButtonStyles : endDatePickerStyles,
|
|
83
|
+
tweakStyles,
|
|
84
|
+
className: 'tweakEndDatePicker',
|
|
85
|
+
currentComponentName: 'FilterWithDates',
|
|
86
|
+
});
|
|
50
87
|
|
|
51
88
|
const [isOpenFrom, setOpenFrom] = useState(false);
|
|
52
89
|
const [isOpenTo, setOpenTo] = useState(false);
|
|
90
|
+
|
|
91
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
92
|
+
|
|
53
93
|
const dateLocale = localeKey === 'ru' ? ru : enUS;
|
|
54
|
-
const translates = useMemo(() => getLocale(localeKey, locale), [localeKey, locale]);
|
|
55
94
|
|
|
56
|
-
|
|
57
|
-
// 60(old margin) - 32(buttons row) = 28;
|
|
58
|
-
const topPosition = !isClearable && onStartBtnSubmit === undefined ? 28 : 60;
|
|
95
|
+
const translates = useMemo(() => getLocale(localeKey, locale), [localeKey, locale]);
|
|
59
96
|
|
|
60
97
|
const handleClear = () => {
|
|
61
98
|
onEndBtnSubmit();
|
|
62
99
|
};
|
|
63
|
-
|
|
64
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
65
100
|
const isOpenCalendar = isOpenFrom || isOpenTo;
|
|
66
101
|
|
|
67
102
|
const handleFromSelected = (val: Date | null) => {
|
|
@@ -92,10 +127,6 @@ export const FilterWithDates: FC<IFilterWithDatesProps> = ({
|
|
|
92
127
|
}
|
|
93
128
|
};
|
|
94
129
|
|
|
95
|
-
const tweakClearButtonStyles = useTweakStyles(componentStyles, tweakStyles, 'tweakClearButton');
|
|
96
|
-
|
|
97
|
-
const tweakBackButtonStyles = useTweakStyles(componentStyles, tweakStyles, 'tweakBackButton');
|
|
98
|
-
|
|
99
130
|
return (
|
|
100
131
|
<div className={classes.root} {...addDataAttributes(data)}>
|
|
101
132
|
<div className={classes.container}>
|
|
@@ -107,8 +138,7 @@ export const FilterWithDates: FC<IFilterWithDatesProps> = ({
|
|
|
107
138
|
months={translates.months}
|
|
108
139
|
locale={dateLocale}
|
|
109
140
|
onChangeDate={handleChangeFrom}
|
|
110
|
-
|
|
111
|
-
topPosition={topPosition}
|
|
141
|
+
tweakStyles={tweakStartDatePickerStyles}
|
|
112
142
|
border="bottom"
|
|
113
143
|
testId={getTestId(testId, 'from')}
|
|
114
144
|
isClearable={isClearable}
|
|
@@ -123,8 +153,7 @@ export const FilterWithDates: FC<IFilterWithDatesProps> = ({
|
|
|
123
153
|
minDate={value?.from}
|
|
124
154
|
locale={dateLocale}
|
|
125
155
|
onChangeDate={handleChangeTo}
|
|
126
|
-
|
|
127
|
-
leftPosition={-170}
|
|
156
|
+
tweakStyles={tweakEndDatePickerStyles}
|
|
128
157
|
border="bottom"
|
|
129
158
|
testId={getTestId(testId, 'to')}
|
|
130
159
|
isClearable={isClearable}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './FilterWithDates';
|
|
2
|
-
export type {
|
|
2
|
+
export type { IFilterWithDatesStyles } from './FilterWithDates.styles';
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createThemedStyles, ITweakStyles } from '../../../../theme';
|
|
2
|
+
import { IFilterSelectStyles } from '../FilterSelect';
|
|
2
3
|
|
|
3
|
-
export const
|
|
4
|
+
export const useStyles = createThemedStyles('FilterWithPeriod', {
|
|
4
5
|
root: {},
|
|
5
6
|
|
|
6
7
|
main: {},
|
|
7
8
|
|
|
8
9
|
picker: {},
|
|
10
|
+
});
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
12
|
+
export const filterSelectStyles: IFilterSelectStyles = {
|
|
13
|
+
list: {
|
|
14
|
+
maxHeight: 'auto',
|
|
14
15
|
},
|
|
15
16
|
};
|
|
16
17
|
|
|
17
|
-
export type
|
|
18
|
+
export type IFilterWithPeriodStyles = ITweakStyles<
|
|
19
|
+
typeof useStyles,
|
|
20
|
+
{ tweakFilterSelect: IFilterSelectStyles }
|
|
21
|
+
>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useOnClickOutside, useTweakStyles } from '../../../../hooks';
|
|
3
3
|
import { ICommonProps } from '../../../../types';
|
|
4
4
|
import { PERIODS, PERIODS_GETTERS } from '../../constants';
|
|
5
5
|
import { getLocale } from '../../helpers';
|
|
@@ -13,17 +13,15 @@ import {
|
|
|
13
13
|
} from '../../types';
|
|
14
14
|
import { FilterSelect } from '../FilterSelect';
|
|
15
15
|
import { FilterWithDates } from '../FilterWithDates';
|
|
16
|
-
import {
|
|
16
|
+
import { useStyles, IFilterWithPeriodStyles, filterSelectStyles } from './FilterWithPeriod.styles';
|
|
17
17
|
|
|
18
|
-
export interface IFilterWithPeriodProps extends ICommonProps {
|
|
19
|
-
tweakStyles?: FilterWithPeriodStyles;
|
|
18
|
+
export interface IFilterWithPeriodProps extends ICommonProps<IFilterWithPeriodStyles> {
|
|
20
19
|
value?: IPeriod;
|
|
21
|
-
onChange: (period?: IPeriod) => void;
|
|
22
|
-
onClose?: () => void;
|
|
23
20
|
localeKey?: IFilterLocaleKey;
|
|
24
21
|
locale?: IPartialFilterLocale;
|
|
25
22
|
periods?: IPeriodsList;
|
|
26
|
-
|
|
23
|
+
onChange(period?: IPeriod): void;
|
|
24
|
+
onClose?(): void;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
export const FilterWithPeriod: FC<IFilterWithPeriodProps> = ({
|
|
@@ -36,7 +34,7 @@ export const FilterWithPeriod: FC<IFilterWithPeriodProps> = ({
|
|
|
36
34
|
tweakStyles,
|
|
37
35
|
testId,
|
|
38
36
|
}) => {
|
|
39
|
-
const
|
|
37
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
40
38
|
|
|
41
39
|
const translates = useMemo(() => getLocale(localeKey, locale), [localeKey, locale]);
|
|
42
40
|
|
|
@@ -129,7 +127,12 @@ export const FilterWithPeriod: FC<IFilterWithPeriodProps> = ({
|
|
|
129
127
|
setPeriod(value);
|
|
130
128
|
}, [value, value?.from, value?.to, value?.periodType]);
|
|
131
129
|
|
|
132
|
-
const tweakSelectStyles = useTweakStyles(
|
|
130
|
+
const tweakSelectStyles = useTweakStyles({
|
|
131
|
+
innerStyles: filterSelectStyles,
|
|
132
|
+
tweakStyles,
|
|
133
|
+
className: 'tweakFilterSelect',
|
|
134
|
+
currentComponentName: 'FilterWithPeriod',
|
|
135
|
+
});
|
|
133
136
|
|
|
134
137
|
return (
|
|
135
138
|
<div className={classes.root}>
|