@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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ITweakStyles, createThemedStyles } from '../../../../theme';
|
|
2
|
+
import { IFlexibleTableCellStyles } from '../FlexibleTableCell';
|
|
3
|
+
|
|
4
|
+
export const useStyles = createThemedStyles('FlexibleTableRow', {
|
|
5
|
+
root: {
|
|
6
|
+
position: 'relative',
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
active: {},
|
|
10
|
+
|
|
11
|
+
editable: {
|
|
12
|
+
cursor: 'pointer',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type IFlexibleTableRowStyles = ITweakStyles<
|
|
17
|
+
typeof useStyles,
|
|
18
|
+
{ tweakTableCell: IFlexibleTableCellStyles }
|
|
19
|
+
>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ReactNode, useState, memo } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { addDataAttributes } from '../../../../helpers';
|
|
4
|
+
import { useTweakStyles } from '../../../../hooks';
|
|
4
5
|
import { ICommonProps, IDataAttributes } from '../../../../types';
|
|
5
6
|
import { FlexibleTableConfigType, INestedComponent } from '../../types';
|
|
6
|
-
import
|
|
7
|
+
import FlexibleTableCell from '../FlexibleTableCell/FlexibleTableCell';
|
|
8
|
+
import { useStyles, IFlexibleTableRowStyles } from './FlexibleTableRow.styles';
|
|
7
9
|
|
|
8
10
|
// TODO: Заменить Record<string, any> на Record<string, unknown>
|
|
9
|
-
export interface
|
|
11
|
+
export interface IFlexibleTableRowProps<Values extends Record<string, any>>
|
|
12
|
+
extends Pick<ICommonProps<IFlexibleTableRowStyles>, 'tweakStyles'> {
|
|
10
13
|
item: Values;
|
|
11
14
|
uniqueField?: keyof Values;
|
|
12
15
|
isFirstColumnSticky?: boolean;
|
|
@@ -14,37 +17,33 @@ export interface ITableRowProps<Values extends Record<string, any>> extends ICom
|
|
|
14
17
|
config?: FlexibleTableConfigType<Values>;
|
|
15
18
|
enabledColumns?: Array<keyof Values>;
|
|
16
19
|
rowAttributes?: Array<keyof Values>;
|
|
17
|
-
expandableRowComponent
|
|
20
|
+
expandableRowComponent?(item: Values, isOpen: boolean, close: () => void): ReactNode;
|
|
18
21
|
// TODO: Заменить string на Generic Values[uniqueField]
|
|
19
|
-
onRowHover
|
|
20
|
-
onRowClick
|
|
21
|
-
// чтобы не перерендеривать стили для каждой строчки / ячейки
|
|
22
|
-
// TODO: Можно лучше через Classes
|
|
23
|
-
classes: {
|
|
24
|
-
root: string;
|
|
25
|
-
active: string;
|
|
26
|
-
editable: string;
|
|
27
|
-
cell: {
|
|
28
|
-
root: string;
|
|
29
|
-
sticky: string;
|
|
30
|
-
second: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
22
|
+
onRowHover?(id?: string): void;
|
|
23
|
+
onRowClick?(id: string): void;
|
|
33
24
|
}
|
|
34
25
|
|
|
35
|
-
function
|
|
26
|
+
function FlexibleTableRowInner<Values extends Record<string, any>>({
|
|
36
27
|
item,
|
|
37
28
|
uniqueField,
|
|
38
29
|
isFirstColumnSticky,
|
|
39
30
|
isActive,
|
|
40
31
|
config,
|
|
41
32
|
enabledColumns,
|
|
42
|
-
onRowHover,
|
|
43
|
-
onRowClick,
|
|
44
33
|
rowAttributes,
|
|
34
|
+
tweakStyles,
|
|
45
35
|
expandableRowComponent,
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
onRowHover,
|
|
37
|
+
onRowClick,
|
|
38
|
+
}: IFlexibleTableRowProps<Values>): JSX.Element {
|
|
39
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
40
|
+
|
|
41
|
+
const tweakTableCellStyles = useTweakStyles({
|
|
42
|
+
tweakStyles,
|
|
43
|
+
className: 'tweakTableCell',
|
|
44
|
+
currentComponentName: 'FlexibleTableRow',
|
|
45
|
+
});
|
|
46
|
+
|
|
48
47
|
const [isFocused, setFocused] = useState(false);
|
|
49
48
|
const [nestedComponent, setNestedComponent] = useState<INestedComponent>({
|
|
50
49
|
isOpen: false,
|
|
@@ -122,14 +121,14 @@ function TableRowInner<Values extends Record<string, any>>({
|
|
|
122
121
|
})}
|
|
123
122
|
>
|
|
124
123
|
{items.map((key, idx) => (
|
|
125
|
-
<
|
|
124
|
+
<FlexibleTableCell
|
|
126
125
|
columnName={key}
|
|
127
126
|
isSticky={isFirstColumnSticky && idx === 0}
|
|
128
127
|
isSecond={isFirstColumnSticky && idx === 1}
|
|
129
128
|
key={key as string}
|
|
130
129
|
item={item}
|
|
131
130
|
config={config}
|
|
132
|
-
|
|
131
|
+
tweakStyles={tweakTableCellStyles}
|
|
133
132
|
isFocusedRow={isFocused}
|
|
134
133
|
isNestedComponentExpanded={nestedComponent.isOpen && nestedComponent.cellKey === key}
|
|
135
134
|
isRowNestedComponentExpanded={
|
|
@@ -149,4 +148,4 @@ function TableRowInner<Values extends Record<string, any>>({
|
|
|
149
148
|
);
|
|
150
149
|
}
|
|
151
150
|
|
|
152
|
-
export const
|
|
151
|
+
export const FlexibleTableRow = memo(FlexibleTableRowInner) as typeof FlexibleTableRowInner;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './FlexibleTableRow';
|
|
2
|
+
export * from './FlexibleTableCell';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from './FlexibleTable';
|
|
2
2
|
export * from './types';
|
|
3
|
-
export type {
|
|
3
|
+
export type { IFlexibleTableStyles } from './FlexibleTable.styles';
|
|
4
|
+
export type { IFlexibleTableCellStyles, IFlexibleTableRowStyles } from './components';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const useStyles = createThemedStyles('Icon', {
|
|
4
4
|
root: {
|
|
5
5
|
display: 'flex',
|
|
6
6
|
alignItems: 'center',
|
|
7
7
|
},
|
|
8
|
-
};
|
|
8
|
+
});
|
|
9
9
|
|
|
10
|
-
export type
|
|
10
|
+
export type IIconStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { addDataTestId } from '@true-engineering/true-react-platform-helpers';
|
|
2
3
|
import { addDataAttributes } from '../../helpers';
|
|
3
|
-
import { useTheme } from '../../hooks';
|
|
4
4
|
import { ICommonProps } from '../../types';
|
|
5
5
|
import { ComplexIconBoilerplate, IconBoilerplate } from './components';
|
|
6
6
|
import { isComplexIcon } from './helpers';
|
|
7
7
|
import { IIconType } from './types';
|
|
8
|
-
import {
|
|
8
|
+
import { useStyles, IIconStyles } from './Icon.styles';
|
|
9
9
|
|
|
10
|
-
export interface IIconProps extends ICommonProps {
|
|
11
|
-
tweakStyles?: IconStyles;
|
|
10
|
+
export interface IIconProps extends ICommonProps<IIconStyles> {
|
|
12
11
|
type: IIconType;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
export const Icon: FC<IIconProps> = ({ type, data, tweakStyles }) => {
|
|
16
|
-
const
|
|
14
|
+
export const Icon: FC<IIconProps> = ({ type, data, testId, tweakStyles }) => {
|
|
15
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
17
16
|
|
|
18
17
|
return (
|
|
19
|
-
<div className={classes.root} {...addDataAttributes(data)}>
|
|
18
|
+
<div className={classes.root} {...addDataTestId(testId)} {...addDataAttributes(data)}>
|
|
20
19
|
{isComplexIcon(type) ? (
|
|
21
20
|
<ComplexIconBoilerplate type={type} />
|
|
22
21
|
) : (
|
|
@@ -6,4 +6,4 @@ export const isComplexIcon = (type: IIconType): type is IComplexIcon => type in
|
|
|
6
6
|
/**
|
|
7
7
|
* Эта функция позволяет корректно определить ключи в типе
|
|
8
8
|
*/
|
|
9
|
-
export const checkIcons = <P extends string>(ico: Record<P, ISvgIcon>) => ico;
|
|
9
|
+
export const checkIcons = <P extends string>(ico: Record<P, ISvgIcon>): Record<P, ISvgIcon> => ico;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { colors, dimensions } from '../../theme';
|
|
2
|
-
import {
|
|
1
|
+
import { colors, dimensions, ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
|
+
import { IInputStyles } from '../Input';
|
|
3
3
|
|
|
4
4
|
export const BUTTONS_WIDTH = 36;
|
|
5
5
|
export const BUTTONS_GAP = 2;
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const useStyles = createThemedStyles('IncrementInput', {
|
|
8
8
|
root: {
|
|
9
9
|
display: 'flex',
|
|
10
10
|
alignItems: 'center',
|
|
@@ -60,18 +60,18 @@ export const styles = {
|
|
|
60
60
|
},
|
|
61
61
|
|
|
62
62
|
errorButton: {},
|
|
63
|
+
});
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
paddingRight: BUTTONS_WIDTH + BUTTONS_GAP,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
controls: {
|
|
65
|
+
export const inputStyles: IInputStyles = {
|
|
66
|
+
input: {
|
|
67
|
+
'&:not($withControls)': {
|
|
72
68
|
paddingRight: BUTTONS_WIDTH + BUTTONS_GAP,
|
|
73
69
|
},
|
|
74
70
|
},
|
|
71
|
+
|
|
72
|
+
controls: {
|
|
73
|
+
paddingRight: BUTTONS_WIDTH + BUTTONS_GAP,
|
|
74
|
+
},
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
export type
|
|
77
|
+
export type IIncrementInputStyles = ITweakStyles<typeof useStyles, { tweakInput: IInputStyles }>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import
|
|
1
|
+
import { FC, useEffect } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { addDataTestId, isNumberInteger } from '@true-engineering/true-react-platform-helpers';
|
|
3
4
|
import { addDataAttributes, getNumberInRange, getNumberLength } from '../../helpers';
|
|
4
|
-
import {
|
|
5
|
+
import { useTweakStyles } from '../../hooks';
|
|
6
|
+
import { ICommonProps } from '../../types';
|
|
7
|
+
import { Icon } from '../Icon';
|
|
5
8
|
import { INumberInputProps, NumberInput } from '../NumberInput';
|
|
6
|
-
import {
|
|
7
|
-
import { IncrementInputStyles, styles } from './IncrementInput.styles';
|
|
9
|
+
import { useStyles, IIncrementInputStyles, inputStyles } from './IncrementInput.styles';
|
|
8
10
|
|
|
9
|
-
export interface IIncrementInputProps
|
|
10
|
-
tweakStyles
|
|
11
|
+
export interface IIncrementInputProps
|
|
12
|
+
extends Omit<INumberInputProps, 'canBeFloat' | 'precision' | 'tweakStyles'>,
|
|
13
|
+
ICommonProps<IIncrementInputStyles> {
|
|
11
14
|
step?: number;
|
|
12
15
|
}
|
|
13
16
|
|
|
@@ -19,14 +22,30 @@ export const IncrementInput: FC<IIncrementInputProps> = ({
|
|
|
19
22
|
step = 1,
|
|
20
23
|
intPartPrecision,
|
|
21
24
|
data,
|
|
25
|
+
testId,
|
|
22
26
|
tweakStyles,
|
|
27
|
+
isDisabled,
|
|
28
|
+
isReadonly,
|
|
29
|
+
isInvalid,
|
|
23
30
|
...props
|
|
24
31
|
}) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
const tweakInputStyles = useTweakStyles({
|
|
33
|
+
innerStyles: inputStyles,
|
|
34
|
+
tweakStyles,
|
|
35
|
+
className: 'tweakInput',
|
|
36
|
+
currentComponentName: 'IncrementInput',
|
|
37
|
+
});
|
|
28
38
|
|
|
29
|
-
const
|
|
39
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
40
|
+
|
|
41
|
+
const isIncreaseDisabled =
|
|
42
|
+
isDisabled ||
|
|
43
|
+
isReadonly ||
|
|
44
|
+
(intPartPrecision !== undefined && getNumberLength((value ?? 0) + step) > intPartPrecision) ||
|
|
45
|
+
(max !== undefined && value !== undefined && value >= max);
|
|
46
|
+
|
|
47
|
+
const isDecreaseDisabled =
|
|
48
|
+
isDisabled || isReadonly || (min !== undefined && value !== undefined ? value <= min : false);
|
|
30
49
|
|
|
31
50
|
const increment = (): void => {
|
|
32
51
|
onChange(getNumberInRange((value ?? 0) + step, min, max));
|
|
@@ -36,12 +55,19 @@ export const IncrementInput: FC<IIncrementInputProps> = ({
|
|
|
36
55
|
onChange(getNumberInRange((value ?? 0) - step, min, max));
|
|
37
56
|
};
|
|
38
57
|
|
|
39
|
-
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (!isNumberInteger(step)) {
|
|
60
|
+
console.error('Параметр step должен быть целым числом');
|
|
61
|
+
}
|
|
62
|
+
}, [step]);
|
|
40
63
|
|
|
41
64
|
return (
|
|
42
|
-
<div className={classes.root} {...addDataAttributes(data)}>
|
|
65
|
+
<div className={classes.root} {...addDataTestId(testId)} {...addDataAttributes(data)}>
|
|
43
66
|
<NumberInput
|
|
44
67
|
{...props}
|
|
68
|
+
isInvalid={isInvalid}
|
|
69
|
+
isDisabled={isDisabled}
|
|
70
|
+
isReadonly={isReadonly}
|
|
45
71
|
min={min}
|
|
46
72
|
max={max}
|
|
47
73
|
intPartPrecision={intPartPrecision}
|
|
@@ -50,30 +76,28 @@ export const IncrementInput: FC<IIncrementInputProps> = ({
|
|
|
50
76
|
tweakStyles={tweakInputStyles}
|
|
51
77
|
/>
|
|
52
78
|
<div className={classes.buttons}>
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(max !== undefined && value !== undefined && value >= max)
|
|
61
|
-
}
|
|
62
|
-
isInvalid={props.isInvalid}
|
|
79
|
+
<button
|
|
80
|
+
className={clsx(classes.button, {
|
|
81
|
+
[classes.disabledButton]: isIncreaseDisabled,
|
|
82
|
+
[classes.errorButton]: isInvalid,
|
|
83
|
+
})}
|
|
84
|
+
type="button"
|
|
85
|
+
disabled={isIncreaseDisabled}
|
|
63
86
|
onClick={increment}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
87
|
+
>
|
|
88
|
+
<Icon type="plus" />
|
|
89
|
+
</button>
|
|
90
|
+
<button
|
|
91
|
+
className={clsx(classes.button, {
|
|
92
|
+
[classes.disabledButton]: isDecreaseDisabled,
|
|
93
|
+
[classes.errorButton]: isInvalid,
|
|
94
|
+
})}
|
|
95
|
+
type="button"
|
|
96
|
+
disabled={isDecreaseDisabled}
|
|
74
97
|
onClick={decrement}
|
|
75
|
-
|
|
76
|
-
|
|
98
|
+
>
|
|
99
|
+
<Icon type="minus" />
|
|
100
|
+
</button>
|
|
77
101
|
</div>
|
|
78
102
|
</div>
|
|
79
103
|
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './IncrementInput';
|
|
2
|
-
export type {
|
|
2
|
+
export type { IIncrementInputStyles } from './IncrementInput.styles';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { dimensions } from '../../theme';
|
|
2
|
-
import {
|
|
1
|
+
import { dimensions, ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
|
+
import { IThemedPreloaderStyles } from '../ThemedPreloader';
|
|
3
3
|
|
|
4
4
|
const PADDING_X = 12;
|
|
5
5
|
export const AUTOSIZE_MAX_WIDTH = 480;
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const useStyles = createThemedStyles('Input', {
|
|
8
8
|
root: {
|
|
9
9
|
width: '100%',
|
|
10
10
|
boxSizing: 'border-box',
|
|
@@ -80,7 +80,6 @@ export const styles = {
|
|
|
80
80
|
|
|
81
81
|
unitsWrapper: {
|
|
82
82
|
extend: 'inputContent',
|
|
83
|
-
|
|
84
83
|
position: 'absolute',
|
|
85
84
|
left: 0,
|
|
86
85
|
height: '100%',
|
|
@@ -300,8 +299,9 @@ export const styles = {
|
|
|
300
299
|
loading: {},
|
|
301
300
|
|
|
302
301
|
withUnits: {},
|
|
302
|
+
});
|
|
303
303
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
304
|
+
export type IInputStyles = ITweakStyles<
|
|
305
|
+
typeof useStyles,
|
|
306
|
+
{ tweakPreloader: IThemedPreloaderStyles }
|
|
307
|
+
>;
|
|
@@ -20,16 +20,15 @@ import {
|
|
|
20
20
|
} from '@true-engineering/true-react-platform-helpers';
|
|
21
21
|
import { addDataAttributes } from '../../helpers';
|
|
22
22
|
import { renderIcon } from '../../helpers/snippets';
|
|
23
|
-
import {
|
|
23
|
+
import { useTweakStyles } from '../../hooks';
|
|
24
24
|
import { ICommonProps, IIcon } from '../../types';
|
|
25
25
|
import { Icon } from '../Icon';
|
|
26
26
|
import { ThemedPreloader } from '../ThemedPreloader';
|
|
27
27
|
import { DEFAULT_SIZE } from './constants';
|
|
28
28
|
import { IReactInputMaskProps } from './types';
|
|
29
|
-
import {
|
|
29
|
+
import { useStyles, IInputStyles } from './Input.styles';
|
|
30
30
|
|
|
31
|
-
export interface IInputProps extends ICommonProps
|
|
32
|
-
tweakStyles?: InputStyles;
|
|
31
|
+
export interface IInputProps extends ICommonProps<IInputStyles>, IReactInputMaskProps {
|
|
33
32
|
value?: string;
|
|
34
33
|
label?: ReactNode;
|
|
35
34
|
placeholder?: string;
|
|
@@ -81,7 +80,6 @@ export interface IInputProps extends ICommonProps, IReactInputMaskProps {
|
|
|
81
80
|
hasRequiredLabel?: boolean;
|
|
82
81
|
shouldFocusOnMount?: boolean;
|
|
83
82
|
maxLength?: number;
|
|
84
|
-
testId?: string;
|
|
85
83
|
tabIndex?: number;
|
|
86
84
|
shouldAlwaysShowPlaceholder?: boolean;
|
|
87
85
|
onChange(value: string, event: FormEvent<HTMLInputElement>): void;
|
|
@@ -139,7 +137,13 @@ export const Input = forwardRef<HTMLInputElement, IInputProps>(
|
|
|
139
137
|
},
|
|
140
138
|
ref,
|
|
141
139
|
) => {
|
|
142
|
-
const
|
|
140
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
141
|
+
|
|
142
|
+
const tweakPreloaderStyles = useTweakStyles({
|
|
143
|
+
tweakStyles,
|
|
144
|
+
className: 'tweakPreloader',
|
|
145
|
+
currentComponentName: 'Input',
|
|
146
|
+
});
|
|
143
147
|
|
|
144
148
|
const [isFocused, setFocused] = useState(false);
|
|
145
149
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
@@ -203,8 +207,6 @@ export const Input = forwardRef<HTMLInputElement, IInputProps>(
|
|
|
203
207
|
...addDataTestId(testId),
|
|
204
208
|
};
|
|
205
209
|
|
|
206
|
-
const tweakPreloaderStyles = useTweakStyles(componentStyles, tweakStyles, 'tweakPreloader');
|
|
207
|
-
|
|
208
210
|
return (
|
|
209
211
|
<div className={classes.root}>
|
|
210
212
|
<div
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { colors } from '../../theme';
|
|
2
|
-
import { ComponentStyles } from '../../types';
|
|
1
|
+
import { colors, ITweakStyles, createThemedStyles } from '../../theme';
|
|
3
2
|
|
|
4
3
|
const ITEM_HORIZONTAL_PADDING = 16;
|
|
5
4
|
const ICON_SIZE = 20;
|
|
6
5
|
const ICON_GAP = 12;
|
|
7
6
|
|
|
8
|
-
export const
|
|
7
|
+
export const useStyles = createThemedStyles('List', {
|
|
9
8
|
root: {
|
|
10
9
|
minWidth: 180,
|
|
11
10
|
backgroundColor: colors.CLASSIC_WHITE,
|
|
@@ -47,6 +46,6 @@ export const styles = {
|
|
|
47
46
|
},
|
|
48
47
|
|
|
49
48
|
content: {},
|
|
50
|
-
};
|
|
49
|
+
});
|
|
51
50
|
|
|
52
|
-
export type
|
|
51
|
+
export type IListStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -7,20 +7,17 @@ import {
|
|
|
7
7
|
} from '@true-engineering/true-react-platform-helpers';
|
|
8
8
|
import { addDataAttributes } from '../../helpers';
|
|
9
9
|
import { renderIcon } from '../../helpers/snippets';
|
|
10
|
-
import { useTheme } from '../../hooks';
|
|
11
10
|
import { ICommonProps } from '../../types';
|
|
12
11
|
import { IListItem } from './types';
|
|
13
|
-
import {
|
|
12
|
+
import { useStyles, IListStyles } from './List.styles';
|
|
14
13
|
|
|
15
|
-
export interface IListProps extends ICommonProps {
|
|
16
|
-
tweakStyles?: ListStyles;
|
|
14
|
+
export interface IListProps extends ICommonProps<IListStyles> {
|
|
17
15
|
items: IListItem[];
|
|
18
|
-
testId?: string;
|
|
19
16
|
onClick?(): void;
|
|
20
17
|
}
|
|
21
18
|
|
|
22
19
|
export const List: FC<IListProps> = ({ items, testId, data, tweakStyles, onClick }) => {
|
|
23
|
-
const
|
|
20
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
24
21
|
|
|
25
22
|
const handleItemClick = (item: IListItem) => {
|
|
26
23
|
item.onClick();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { rgba } from '../../helpers';
|
|
2
|
-
import { colors, dimensions } from '../../theme';
|
|
3
|
-
import {
|
|
2
|
+
import { colors, dimensions, ITweakStyles, createThemedStyles } from '../../theme';
|
|
3
|
+
import { ICloseButtonStyles } from '../CloseButton';
|
|
4
4
|
|
|
5
5
|
const VERTICAL_OVERLAY_PADDING = 50;
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ const MODAL_HORIZONTAL_PADDING_L = 40;
|
|
|
8
8
|
const MODAL_HORIZONTAL_PADDING_M = 36;
|
|
9
9
|
const MODAL_HORIZONTAL_PADDING_S = 26;
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const useStyles = createThemedStyles('Modal', {
|
|
12
12
|
root: {},
|
|
13
13
|
|
|
14
14
|
fixedPosition: {
|
|
@@ -298,8 +298,6 @@ export const styles = {
|
|
|
298
298
|
'modal-enter-active': { extend: 'animationStart' },
|
|
299
299
|
'modal-exit': { extend: 'animationStart' },
|
|
300
300
|
'modal-exit-active': { extend: 'animationEnd' },
|
|
301
|
+
});
|
|
301
302
|
|
|
302
|
-
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
export type ModalStyles = ComponentStyles<typeof styles>;
|
|
303
|
+
export type IModalStyles = ITweakStyles<typeof useStyles, { tweakCloseButton: ICloseButtonStyles }>;
|
|
@@ -8,14 +8,13 @@ import {
|
|
|
8
8
|
isReactNodeNotEmpty,
|
|
9
9
|
} from '@true-engineering/true-react-platform-helpers';
|
|
10
10
|
import { addDataAttributes } from '../../helpers';
|
|
11
|
-
import {
|
|
11
|
+
import { useTweakStyles } from '../../hooks';
|
|
12
12
|
import { ICommonProps } from '../../types';
|
|
13
13
|
import { CloseButton } from '../CloseButton';
|
|
14
14
|
import { IModalPosition, IModalTransitionProps } from './types';
|
|
15
|
-
import {
|
|
15
|
+
import { useStyles, IModalStyles } from './Modal.styles';
|
|
16
16
|
|
|
17
|
-
export interface IModalProps extends ICommonProps
|
|
18
|
-
tweakStyles?: ModalStyles;
|
|
17
|
+
export interface IModalProps extends ICommonProps<IModalStyles>, IModalTransitionProps {
|
|
19
18
|
title?: ReactNode;
|
|
20
19
|
size?: 'l' | 'm' | 's';
|
|
21
20
|
isFooterSticky?: boolean;
|
|
@@ -30,7 +29,6 @@ export interface IModalProps extends ICommonProps, IModalTransitionProps {
|
|
|
30
29
|
shouldBlockScroll?: boolean;
|
|
31
30
|
isOpen?: boolean;
|
|
32
31
|
zIndex?: number;
|
|
33
|
-
testId?: string;
|
|
34
32
|
onClose?(): void;
|
|
35
33
|
}
|
|
36
34
|
|
|
@@ -57,13 +55,17 @@ export const Modal: FC<IModalProps> = ({
|
|
|
57
55
|
onClose,
|
|
58
56
|
...restProps
|
|
59
57
|
}) => {
|
|
60
|
-
const
|
|
61
|
-
const { classes, componentStyles } = useTheme('Modal', styles, tweakStyles);
|
|
58
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
62
59
|
|
|
63
|
-
const tweakCloseButtonStyles = useTweakStyles(
|
|
60
|
+
const tweakCloseButtonStyles = useTweakStyles({
|
|
61
|
+
tweakStyles,
|
|
62
|
+
className: 'tweakCloseButton',
|
|
63
|
+
currentComponentName: 'Modal',
|
|
64
|
+
});
|
|
64
65
|
|
|
65
66
|
const [isClickOnOverlay, setIsClickOnOverlay] = useState(false);
|
|
66
67
|
|
|
68
|
+
const isModalOpen = restProps.in ?? isOpen;
|
|
67
69
|
const hasFooter = buttons !== undefined && buttons.length > 0;
|
|
68
70
|
const overlay = useRef<HTMLDivElement>(null);
|
|
69
71
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { rgba } from '../../helpers';
|
|
2
|
-
import { colors } from '../../theme';
|
|
3
|
-
import {
|
|
2
|
+
import { colors, ITweakStyles, createThemedStyles } from '../../theme';
|
|
3
|
+
import { IListStyles } from '../List';
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const useStyles = createThemedStyles('MoreMenu', {
|
|
6
6
|
root: {
|
|
7
7
|
position: 'relative',
|
|
8
8
|
},
|
|
@@ -63,8 +63,6 @@ export const styles = {
|
|
|
63
63
|
right: 0,
|
|
64
64
|
marginTop: 6,
|
|
65
65
|
},
|
|
66
|
+
});
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export type MoreMenuStyles = ComponentStyles<typeof styles>;
|
|
68
|
+
export type IMoreMenuStyles = ITweakStyles<typeof useStyles, { tweakList: IListStyles }>;
|