@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,20 +1,19 @@
|
|
|
1
1
|
import { ReactNode, useMemo, MouseEvent } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import {
|
|
4
|
+
addDataTestId,
|
|
4
5
|
isNotEmpty,
|
|
5
6
|
isReactNodeNotEmpty,
|
|
6
7
|
isStringNotEmpty,
|
|
7
8
|
} from '@true-engineering/true-react-platform-helpers';
|
|
8
|
-
import { useTheme } from '../../../../hooks';
|
|
9
9
|
import { ICommonProps } from '../../../../types';
|
|
10
10
|
import { ScrollIntoViewIfNeeded } from '../../../ScrollIntoViewIfNeeded';
|
|
11
11
|
import { ALL_OPTION_INDEX, DEFAULT_OPTION_INDEX } from '../../constants';
|
|
12
12
|
import { IMultipleSelectValue } from '../../types';
|
|
13
13
|
import { SelectListItem } from '../SelectListItem';
|
|
14
|
-
import {
|
|
14
|
+
import { useStyles, ISelectListStyles } from './SelectList.styles';
|
|
15
15
|
|
|
16
|
-
export interface ISelectListProps<Value> extends ICommonProps {
|
|
17
|
-
tweakStyles?: SelectListStyles;
|
|
16
|
+
export interface ISelectListProps<Value> extends ICommonProps<ISelectListStyles> {
|
|
18
17
|
options: Value[];
|
|
19
18
|
focusedIndex?: number;
|
|
20
19
|
activeValue?: Value | Value[];
|
|
@@ -22,7 +21,6 @@ export interface ISelectListProps<Value> extends ICommonProps {
|
|
|
22
21
|
isLoading?: boolean;
|
|
23
22
|
loadingLabel?: ReactNode;
|
|
24
23
|
defaultOptionLabel?: string;
|
|
25
|
-
testId?: string;
|
|
26
24
|
allOptionsLabel?: string;
|
|
27
25
|
areAllOptionsSelected?: boolean;
|
|
28
26
|
shouldScrollToList?: boolean;
|
|
@@ -56,7 +54,8 @@ export function SelectList<Value>({
|
|
|
56
54
|
convertValueToReactNode = convertValueToString,
|
|
57
55
|
convertValueToId,
|
|
58
56
|
}: ISelectListProps<Value>): JSX.Element {
|
|
59
|
-
const
|
|
57
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
58
|
+
|
|
60
59
|
const isMultiSelect = isNotEmpty(onToggleCheckbox);
|
|
61
60
|
const multiSelectValue = activeValue as IMultipleSelectValue<Value> | undefined;
|
|
62
61
|
const selectedOptionsCount = multiSelectValue?.length ?? 0;
|
|
@@ -93,7 +92,7 @@ export function SelectList<Value>({
|
|
|
93
92
|
{isReactNodeNotEmpty(customListHeader) && (
|
|
94
93
|
<div className={classes.listHeader}>{customListHeader}</div>
|
|
95
94
|
)}
|
|
96
|
-
<div className={classes.list}
|
|
95
|
+
<div className={classes.list} {...addDataTestId(testId)}>
|
|
97
96
|
{isLoading ? (
|
|
98
97
|
<div className={clsx(classes.cell, classes.loading)}>{loadingLabel}</div>
|
|
99
98
|
) : (
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './SelectList';
|
|
2
|
-
export type {
|
|
2
|
+
export type { ISelectListStyles } from './SelectList.styles';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ICheckboxStyles } from '../../../Checkbox';
|
|
2
2
|
import { CELL_PADDING } from '../SelectList/SelectList.styles';
|
|
3
3
|
|
|
4
|
-
export const checkboxStyles:
|
|
4
|
+
export const checkboxStyles: ICheckboxStyles = {
|
|
5
5
|
root: {
|
|
6
6
|
padding: CELL_PADDING,
|
|
7
7
|
width: '100%',
|
|
@@ -14,7 +14,7 @@ export interface ISelectListItemProps {
|
|
|
14
14
|
isActive?: boolean;
|
|
15
15
|
isFocused?: boolean;
|
|
16
16
|
children: ReactNode;
|
|
17
|
-
classes: Classes<'cellWithCheckbox' | 'cell' | 'focused' | 'active' | 'disabled'>;
|
|
17
|
+
classes: Classes<'cellWithCheckbox' | 'cell' | 'focused' | 'active' | 'disabled'>; // TODO: !!!
|
|
18
18
|
onOptionSelect(index: number, event: MouseEvent<HTMLElement>): void;
|
|
19
19
|
onToggleCheckbox?(index: number, isSelected: boolean): void;
|
|
20
20
|
}
|
|
@@ -7,9 +7,10 @@ export const defaultIsOptionDisabled = <Value>(option: Value): boolean =>
|
|
|
7
7
|
option !== null &&
|
|
8
8
|
((option as { isDisabled?: boolean })?.isDisabled ?? false);
|
|
9
9
|
|
|
10
|
-
export const defaultConvertFunction = (v: unknown)
|
|
10
|
+
export const defaultConvertFunction = (v: unknown): string | undefined =>
|
|
11
|
+
v === undefined ? undefined : String(v);
|
|
11
12
|
|
|
12
|
-
export const defaultCompareFunction = <Value>(v1: Value, v2: Value) => v1 === v2;
|
|
13
|
+
export const defaultCompareFunction = <Value>(v1: Value, v2: Value): boolean => v1 === v2;
|
|
13
14
|
|
|
14
15
|
export const getDefaultConvertToIdFunction =
|
|
15
16
|
<Value>(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './Select';
|
|
2
2
|
export * from './types';
|
|
3
|
-
export type {
|
|
4
|
-
export type {
|
|
3
|
+
export type { ISelectStyles } from './Select.styles';
|
|
4
|
+
export type { ISelectListStyles } from './components';
|
|
@@ -2,10 +2,10 @@ import { useState } from 'react';
|
|
|
2
2
|
import { ComponentStory } from '@storybook/react';
|
|
3
3
|
import { IInputProps } from '../Input';
|
|
4
4
|
import { SmartInput } from './SmartInput';
|
|
5
|
-
import {
|
|
5
|
+
import { ISmartType } from './types';
|
|
6
6
|
|
|
7
7
|
const types: Array<IInputProps['type']> = ['text', 'password', 'email', 'number'];
|
|
8
|
-
const smartTypes:
|
|
8
|
+
const smartTypes: ISmartType[] = ['default', 'agencyName', 'surname', 'name', 'email'];
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
title: 'Inputs/SmartInput',
|
|
@@ -2,11 +2,11 @@ import { useState, useEffect, forwardRef, FormEvent, ClipboardEvent } from 'reac
|
|
|
2
2
|
import { Input, IInputProps } from '../Input';
|
|
3
3
|
import { CharactersMap, SMART_INPUT_REGEX_MAP, TransliterationMap } from './constants';
|
|
4
4
|
import { transformCaseSensitive } from './helpers';
|
|
5
|
-
import {
|
|
5
|
+
import { ISmartType } from './types';
|
|
6
6
|
|
|
7
7
|
export interface ISmartInputProps extends IInputProps {
|
|
8
8
|
isUpperCase?: boolean;
|
|
9
|
-
smartType?:
|
|
9
|
+
smartType?: ISmartType;
|
|
10
10
|
regExp?: RegExp;
|
|
11
11
|
onChange: (value: string) => void;
|
|
12
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const useStyles = createThemedStyles('Switch', {
|
|
4
4
|
root: {
|
|
5
5
|
display: 'flex',
|
|
6
6
|
alignItems: 'center',
|
|
@@ -70,6 +70,6 @@ export const styles = {
|
|
|
70
70
|
labelRight: {
|
|
71
71
|
marginLeft: 12,
|
|
72
72
|
},
|
|
73
|
-
};
|
|
73
|
+
});
|
|
74
74
|
|
|
75
|
-
export type
|
|
75
|
+
export type ISwitchStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -2,13 +2,11 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { addDataTestId, isReactNodeNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
4
4
|
import { addDataAttributes } from '../../helpers';
|
|
5
|
-
import { useTheme } from '../../hooks';
|
|
6
5
|
import { ICommonProps } from '../../types';
|
|
7
6
|
import { ISwitchState } from './types';
|
|
8
|
-
import {
|
|
7
|
+
import { useStyles, ISwitchStyles } from './Switch.styles';
|
|
9
8
|
|
|
10
|
-
export interface ISwitchProps<V extends string> extends ICommonProps {
|
|
11
|
-
tweakStyles?: SwitchStyles;
|
|
9
|
+
export interface ISwitchProps<V extends string> extends ICommonProps<ISwitchStyles> {
|
|
12
10
|
children?: ReactNode;
|
|
13
11
|
value: V;
|
|
14
12
|
isChecked: boolean;
|
|
@@ -22,7 +20,6 @@ export interface ISwitchProps<V extends string> extends ICommonProps {
|
|
|
22
20
|
* @default `primary`
|
|
23
21
|
*/
|
|
24
22
|
color?: 'primary' | 'secondary';
|
|
25
|
-
testId?: string;
|
|
26
23
|
onChange(state: ISwitchState<V>): void;
|
|
27
24
|
}
|
|
28
25
|
|
|
@@ -39,7 +36,7 @@ export const Switch = <V extends string>({
|
|
|
39
36
|
testId,
|
|
40
37
|
onChange,
|
|
41
38
|
}: ISwitchProps<V>): JSX.Element => {
|
|
42
|
-
const
|
|
39
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
43
40
|
|
|
44
41
|
const handleChange = () => onChange({ name: value, isEnabled: !isChecked });
|
|
45
42
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
2
|
|
|
3
3
|
const PADDING_X = 12;
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const useStyles = createThemedStyles('TextArea', {
|
|
6
6
|
root: {
|
|
7
7
|
width: '100%',
|
|
8
8
|
height: '100%',
|
|
@@ -148,6 +148,6 @@ export const styles = {
|
|
|
148
148
|
paddingTop: 4,
|
|
149
149
|
paddingLeft: 13,
|
|
150
150
|
},
|
|
151
|
-
};
|
|
151
|
+
});
|
|
152
152
|
|
|
153
|
-
export type
|
|
153
|
+
export type ITextAreaStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -10,12 +10,10 @@ import {
|
|
|
10
10
|
} from 'react';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
12
|
import { addDataAttributes, trimStringToMaxLength } from '../../helpers';
|
|
13
|
-
import { useTheme } from '../../hooks';
|
|
14
13
|
import { ICommonProps } from '../../types';
|
|
15
|
-
import {
|
|
14
|
+
import { useStyles, ITextAreaStyles } from './TextArea.styles';
|
|
16
15
|
|
|
17
|
-
export interface ITextAreaProps extends ICommonProps {
|
|
18
|
-
tweakStyles?: TextAreaStyles;
|
|
16
|
+
export interface ITextAreaProps extends ICommonProps<ITextAreaStyles> {
|
|
19
17
|
value?: string;
|
|
20
18
|
label?: string;
|
|
21
19
|
placeholder?: string;
|
|
@@ -33,7 +31,6 @@ export interface ITextAreaProps extends ICommonProps {
|
|
|
33
31
|
shouldTrimAfterMaxLength?: boolean;
|
|
34
32
|
maxLength?: number;
|
|
35
33
|
rows?: number;
|
|
36
|
-
testId?: string;
|
|
37
34
|
onChange(value: string, event?: FormEvent<HTMLTextAreaElement>): void;
|
|
38
35
|
onFocus?(event: FocusEvent<HTMLTextAreaElement>): void;
|
|
39
36
|
onBlur?(event: FocusEvent<HTMLTextAreaElement>): void;
|
|
@@ -68,7 +65,7 @@ export const TextArea: FC<ITextAreaProps> = ({
|
|
|
68
65
|
onFocus,
|
|
69
66
|
onBlur,
|
|
70
67
|
}) => {
|
|
71
|
-
const
|
|
68
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
72
69
|
const [isFocused, setFocused] = useState(false);
|
|
73
70
|
const ref = useRef<HTMLTextAreaElement>(null);
|
|
74
71
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './TextArea';
|
|
2
|
-
export type {
|
|
2
|
+
export type { ITextAreaStyles } from './TextArea.styles';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { colors } from '../../theme';
|
|
2
|
-
import { ComponentStyles } from '../../types';
|
|
1
|
+
import { colors, ITweakStyles, createThemedStyles } from '../../theme';
|
|
3
2
|
|
|
4
|
-
export const
|
|
3
|
+
export const useStyles = createThemedStyles('TextWithInfo', {
|
|
5
4
|
root: {
|
|
6
5
|
display: 'inline-block',
|
|
7
6
|
height: 40,
|
|
@@ -55,6 +54,6 @@ export const styles = {
|
|
|
55
54
|
},
|
|
56
55
|
},
|
|
57
56
|
},
|
|
58
|
-
};
|
|
57
|
+
});
|
|
59
58
|
|
|
60
|
-
export type
|
|
59
|
+
export type ITextWithInfoStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
+
import { addDataTestId } from '@true-engineering/true-react-platform-helpers';
|
|
3
4
|
import { addDataAttributes } from '../../helpers';
|
|
4
|
-
import { useTheme } from '../../hooks';
|
|
5
5
|
import { ICommonProps } from '../../types';
|
|
6
6
|
import { Icon } from '../Icon';
|
|
7
7
|
import { TextWithTooltip } from '../TextWithTooltip';
|
|
8
|
-
import {
|
|
8
|
+
import { useStyles, ITextWithInfoStyles } from './TextWithInfo.styles';
|
|
9
9
|
|
|
10
|
-
export interface ITextWithInfoProps extends ICommonProps {
|
|
11
|
-
tweakStyles?: TextWithInfoStyles;
|
|
10
|
+
export interface ITextWithInfoProps extends ICommonProps<ITextWithInfoStyles> {
|
|
12
11
|
text: string;
|
|
13
12
|
isSelected?: boolean;
|
|
14
13
|
textTooltip?: string;
|
|
@@ -25,14 +24,16 @@ export const TextWithInfo: FC<ITextWithInfoProps> = ({
|
|
|
25
24
|
info,
|
|
26
25
|
textTooltip,
|
|
27
26
|
onClick,
|
|
27
|
+
testId,
|
|
28
28
|
data,
|
|
29
29
|
tweakStyles,
|
|
30
30
|
}) => {
|
|
31
|
-
const
|
|
31
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
<div
|
|
35
35
|
className={clsx(classes.root, isSelected && classes.selected)}
|
|
36
|
+
{...addDataTestId(testId)}
|
|
36
37
|
{...addDataAttributes(data)}
|
|
37
38
|
>
|
|
38
39
|
<div className={classes.container}>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './TextWithInfo';
|
|
2
|
-
export type {
|
|
2
|
+
export type { ITextWithInfoStyles } from './TextWithInfo.styles';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
|
+
import { ITooltipStyles } from '../Tooltip';
|
|
2
3
|
|
|
3
|
-
export const
|
|
4
|
+
export const useStyles = createThemedStyles('TextWithTooltip', {
|
|
4
5
|
root: {
|
|
5
6
|
position: 'relative',
|
|
6
7
|
},
|
|
@@ -12,8 +13,9 @@ export const styles = {
|
|
|
12
13
|
clickable: {
|
|
13
14
|
cursor: 'pointer',
|
|
14
15
|
},
|
|
16
|
+
});
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
export type ITextWithTooltipStyles = ITweakStyles<
|
|
19
|
+
typeof useStyles,
|
|
20
|
+
{ tweakTooltip: ITooltipStyles }
|
|
21
|
+
>;
|
|
@@ -3,14 +3,14 @@ import { Styles } from 'react-jss';
|
|
|
3
3
|
import { Portal } from 'react-overlays';
|
|
4
4
|
import usePopper, { Modifier, Placement } from 'react-overlays/usePopper';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
+
import { addDataTestId } from '@true-engineering/true-react-platform-helpers';
|
|
6
7
|
import { addDataAttributes } from '../../helpers';
|
|
7
|
-
import { useOnClickOutsideWithRef,
|
|
8
|
+
import { useOnClickOutsideWithRef, useTweakStyles } from '../../hooks';
|
|
8
9
|
import { ICommonProps } from '../../types';
|
|
9
10
|
import { ITooltipProps, Tooltip } from '../Tooltip';
|
|
10
|
-
import {
|
|
11
|
+
import { useStyles, ITextWithTooltipStyles } from './TextWithTooltip.styles';
|
|
11
12
|
|
|
12
|
-
export interface ITextWithTooltipProps extends ICommonProps {
|
|
13
|
-
tweakStyles?: TextWithTooltipStyles;
|
|
13
|
+
export interface ITextWithTooltipProps extends ICommonProps<ITextWithTooltipStyles> {
|
|
14
14
|
children: ReactNode;
|
|
15
15
|
tooltipText: ITooltipProps['text'];
|
|
16
16
|
tooltipView?: ITooltipProps['view'];
|
|
@@ -37,17 +37,24 @@ export const TextWithTooltip: FC<ITextWithTooltipProps> = ({
|
|
|
37
37
|
shouldRenderInBody = true,
|
|
38
38
|
mouseEventType = 'hover',
|
|
39
39
|
hoverDelay,
|
|
40
|
+
testId,
|
|
40
41
|
data,
|
|
41
42
|
tweakStyles,
|
|
42
43
|
}) => {
|
|
43
|
-
const
|
|
44
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
44
45
|
|
|
45
|
-
const
|
|
46
|
-
|
|
46
|
+
const tweakTooltipStyles = useTweakStyles({
|
|
47
|
+
tweakStyles,
|
|
48
|
+
className: 'tweakTooltip',
|
|
49
|
+
currentComponentName: 'TextWithTooltip',
|
|
50
|
+
});
|
|
47
51
|
|
|
48
52
|
const [isTooltipVisible, setIsTooltipVisible] = useState(false);
|
|
49
53
|
const [tooltipTimeout, setTooltipTimeout] = useState<ReturnType<typeof setTimeout>>();
|
|
50
54
|
|
|
55
|
+
const root = useRef<HTMLDivElement>(null);
|
|
56
|
+
const tooltip = useRef<HTMLDivElement>(null);
|
|
57
|
+
|
|
51
58
|
const hasDelay = hoverDelay !== undefined;
|
|
52
59
|
|
|
53
60
|
const handleMouseEnter = () => {
|
|
@@ -108,8 +115,6 @@ export const TextWithTooltip: FC<ITextWithTooltipProps> = ({
|
|
|
108
115
|
|
|
109
116
|
const shouldShowTooltip = tooltipText !== undefined && tooltipText !== null && !isDisabled;
|
|
110
117
|
|
|
111
|
-
const tweakTooltipStyles = useTweakStyles(componentStyles, tweakStyles, 'tweakTooltip');
|
|
112
|
-
|
|
113
118
|
return (
|
|
114
119
|
<div
|
|
115
120
|
className={clsx(
|
|
@@ -117,6 +122,7 @@ export const TextWithTooltip: FC<ITextWithTooltipProps> = ({
|
|
|
117
122
|
mouseEventType === 'click' && shouldShowTooltip && classes.clickable,
|
|
118
123
|
)}
|
|
119
124
|
{...(shouldShowTooltip ? props : undefined)}
|
|
125
|
+
{...addDataTestId(testId)}
|
|
120
126
|
{...addDataAttributes(data)}
|
|
121
127
|
ref={root}
|
|
122
128
|
>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './TextWithTooltip';
|
|
2
|
-
export type {
|
|
2
|
+
export type { ITextWithTooltipStyles } from './TextWithTooltip.styles';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
|
+
import { IDotsPreloaderStyles, ISvgPreloaderStyles } from './components';
|
|
2
3
|
|
|
3
|
-
export const
|
|
4
|
+
export const useStyles = createThemedStyles('ThemedPreloader', {
|
|
4
5
|
root: {
|
|
5
6
|
display: 'flex',
|
|
6
7
|
},
|
|
@@ -14,8 +15,12 @@ export const styles = {
|
|
|
14
15
|
currentColor: {
|
|
15
16
|
color: 'currentColor',
|
|
16
17
|
},
|
|
18
|
+
});
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
export type IThemedPreloaderStyles = ITweakStyles<
|
|
21
|
+
typeof useStyles,
|
|
22
|
+
{
|
|
23
|
+
tweakDotsPreloader: IDotsPreloaderStyles;
|
|
24
|
+
tweakSvgPreloader: ISvgPreloaderStyles;
|
|
25
|
+
}
|
|
26
|
+
>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
+
import { addDataTestId } from '@true-engineering/true-react-platform-helpers';
|
|
3
4
|
import { addDataAttributes } from '../../helpers';
|
|
4
|
-
import {
|
|
5
|
+
import { useTweakStyles } from '../../hooks';
|
|
5
6
|
import { ICommonProps } from '../../types';
|
|
6
7
|
import { SvgPreloader, DotsPreloader } from './components';
|
|
7
8
|
import { IPreloaderSvgType } from './types';
|
|
8
|
-
import {
|
|
9
|
+
import { useStyles, IThemedPreloaderStyles } from './ThemedPreloader.styles';
|
|
9
10
|
|
|
10
|
-
export interface IThemedPreloaderProps extends ICommonProps {
|
|
11
|
-
tweakStyles?: ThemedPreloaderStyles;
|
|
11
|
+
export interface IThemedPreloaderProps extends ICommonProps<IThemedPreloaderStyles> {
|
|
12
12
|
/**
|
|
13
13
|
* @default `default`
|
|
14
14
|
*/
|
|
@@ -20,27 +20,35 @@ export const ThemedPreloader: FC<IThemedPreloaderProps> = ({
|
|
|
20
20
|
type = 'default',
|
|
21
21
|
useCurrentColor = false,
|
|
22
22
|
data,
|
|
23
|
+
testId,
|
|
23
24
|
tweakStyles,
|
|
24
25
|
}) => {
|
|
25
|
-
const
|
|
26
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
-
componentStyles,
|
|
28
|
+
const tweakDotsPreloaderStyles = useTweakStyles({
|
|
29
29
|
tweakStyles,
|
|
30
|
-
'
|
|
31
|
-
|
|
30
|
+
className: 'tweakDotsPreloader',
|
|
31
|
+
currentComponentName: 'ThemedPreloader',
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const tweakSvgPreloaderStyles = useTweakStyles({
|
|
35
|
+
tweakStyles,
|
|
36
|
+
className: 'tweakSvgPreloader',
|
|
37
|
+
currentComponentName: 'ThemedPreloader',
|
|
38
|
+
});
|
|
32
39
|
|
|
33
40
|
return (
|
|
34
41
|
<div
|
|
35
42
|
className={clsx(classes.root, classes[type], {
|
|
36
43
|
[classes.currentColor]: useCurrentColor,
|
|
37
44
|
})}
|
|
45
|
+
{...addDataTestId(testId)}
|
|
38
46
|
{...addDataAttributes(data)}
|
|
39
47
|
>
|
|
40
48
|
{type === 'dots' ? (
|
|
41
|
-
<DotsPreloader tweakStyles={
|
|
49
|
+
<DotsPreloader tweakStyles={tweakDotsPreloaderStyles} />
|
|
42
50
|
) : (
|
|
43
|
-
<SvgPreloader type={type} tweakStyles={
|
|
51
|
+
<SvgPreloader type={type} tweakStyles={tweakSvgPreloaderStyles} />
|
|
44
52
|
)}
|
|
45
53
|
</div>
|
|
46
54
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createThemedStyles, ITweakStyles } from '../../../../theme';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const useStyles = createThemedStyles('DotsPreloader', {
|
|
4
4
|
root: {
|
|
5
5
|
display: 'flex',
|
|
6
6
|
gap: 4,
|
|
@@ -49,6 +49,6 @@ export const styles = {
|
|
|
49
49
|
extend: 'fadedDot',
|
|
50
50
|
animationDelay: '180ms',
|
|
51
51
|
},
|
|
52
|
-
};
|
|
52
|
+
});
|
|
53
53
|
|
|
54
|
-
export type
|
|
54
|
+
export type IDotsPreloaderStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { useTheme } from '../../../../hooks';
|
|
3
2
|
import { ICommonProps } from '../../../../types';
|
|
4
|
-
import {
|
|
3
|
+
import { useStyles, IDotsPreloaderStyles } from './DotsPreloader.styles';
|
|
5
4
|
|
|
6
|
-
export
|
|
7
|
-
tweakStyles?: DotsPreloaderStyles;
|
|
8
|
-
}
|
|
5
|
+
export type IDotsPreloaderProps = Pick<ICommonProps<IDotsPreloaderStyles>, 'tweakStyles'>;
|
|
9
6
|
|
|
10
7
|
export const DotsPreloader: FC<IDotsPreloaderProps> = ({ tweakStyles }) => {
|
|
11
|
-
const
|
|
8
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
12
9
|
|
|
13
10
|
return (
|
|
14
11
|
<div className={classes.root}>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { DotsPreloader } from './DotsPreloader';
|
|
2
|
-
export type {
|
|
2
|
+
export type { IDotsPreloaderStyles } from './DotsPreloader.styles';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createThemedStyles, ITweakStyles } from '../../../../theme';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const useStyles = createThemedStyles('SvgPreloader', {
|
|
4
4
|
root: {
|
|
5
5
|
display: 'flex',
|
|
6
6
|
width: '100%',
|
|
7
7
|
height: '100%',
|
|
8
8
|
},
|
|
9
|
-
};
|
|
9
|
+
});
|
|
10
10
|
|
|
11
|
-
export type
|
|
11
|
+
export type ISvgPreloaderStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { FC, useContext } from 'react';
|
|
2
|
-
import { ThemeContext
|
|
2
|
+
import { ThemeContext } from '../../../../theme';
|
|
3
3
|
import { ICommonProps } from '../../../../types';
|
|
4
4
|
import { IPreloaderSvgType } from '../../types';
|
|
5
5
|
import { DefaultPreloader } from '../DefaultPreloader';
|
|
6
|
-
import {
|
|
6
|
+
import { useStyles, ISvgPreloaderStyles } from './SvgPreloader.styles';
|
|
7
7
|
|
|
8
|
-
export interface ISvgPreloaderProps extends ICommonProps {
|
|
8
|
+
export interface ISvgPreloaderProps extends Pick<ICommonProps<ISvgPreloaderStyles>, 'tweakStyles'> {
|
|
9
9
|
type: IPreloaderSvgType;
|
|
10
|
-
tweakStyles?: SvgPreloaderStyles;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
export const SvgPreloader: FC<ISvgPreloaderProps> = ({ type = 'default', tweakStyles }) => {
|
|
14
|
-
const
|
|
13
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
14
|
+
|
|
15
15
|
const { theme } = useContext(ThemeContext);
|
|
16
16
|
const PreloaderIcon = theme.preloaders?.[type] ?? DefaultPreloader;
|
|
17
|
-
|
|
18
17
|
const isInlineSvg = typeof PreloaderIcon === 'string';
|
|
19
18
|
|
|
20
19
|
return isInlineSvg ? (
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './SvgPreloader';
|
|
2
|
-
export type {
|
|
2
|
+
export type { ISvgPreloaderStyles } from './SvgPreloader.styles';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './ThemedPreloader';
|
|
2
2
|
export * from './types';
|
|
3
|
-
export type {
|
|
4
|
-
export type {
|
|
3
|
+
export type { IThemedPreloaderStyles } from './ThemedPreloader.styles';
|
|
4
|
+
export type { IDotsPreloaderStyles, ISvgPreloaderStyles } from './components';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { colors } from '../../theme';
|
|
2
|
-
import {
|
|
1
|
+
import { colors, ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
|
+
import { ICloseButtonStyles } from '../CloseButton';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const useStyles = createThemedStyles('Toaster', {
|
|
5
5
|
root: {
|
|
6
6
|
borderRadius: 8,
|
|
7
7
|
position: 'relative',
|
|
@@ -52,8 +52,9 @@ export const styles = {
|
|
|
52
52
|
width: 32,
|
|
53
53
|
height: 32,
|
|
54
54
|
},
|
|
55
|
+
});
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
export type IToasterStyles = ITweakStyles<
|
|
58
|
+
typeof useStyles,
|
|
59
|
+
{ tweakCloseButton: ICloseButtonStyles }
|
|
60
|
+
>;
|