@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
|
@@ -2,21 +2,19 @@ import { FC, MouseEvent, useRef, useState } from 'react';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { addDataTestId, getTestId } from '@true-engineering/true-react-platform-helpers';
|
|
4
4
|
import { addDataAttributes } from '../../helpers';
|
|
5
|
-
import {
|
|
5
|
+
import { useTweakStyles, useOnClickOutsideWithRef } from '../../hooks';
|
|
6
6
|
import { ICommonProps } from '../../types';
|
|
7
7
|
import { Icon } from '../Icon';
|
|
8
8
|
import { IListItem, List } from '../List';
|
|
9
|
-
import {
|
|
9
|
+
import { useStyles, IMoreMenuStyles } from './MoreMenu.styles';
|
|
10
10
|
|
|
11
|
-
export interface IMoreMenuProps extends ICommonProps {
|
|
12
|
-
tweakStyles?: MoreMenuStyles;
|
|
11
|
+
export interface IMoreMenuProps extends ICommonProps<IMoreMenuStyles> {
|
|
13
12
|
items: IListItem[];
|
|
14
13
|
isDisabled?: boolean;
|
|
15
14
|
/**
|
|
16
15
|
* @default true
|
|
17
16
|
*/
|
|
18
17
|
hasDefaultStateBackground?: boolean;
|
|
19
|
-
testId?: string;
|
|
20
18
|
onMenuOpen?(): void;
|
|
21
19
|
onMenuClose?(): void;
|
|
22
20
|
}
|
|
@@ -31,8 +29,13 @@ export const MoreMenu: FC<IMoreMenuProps> = ({
|
|
|
31
29
|
onMenuOpen,
|
|
32
30
|
onMenuClose,
|
|
33
31
|
}) => {
|
|
34
|
-
const
|
|
35
|
-
|
|
32
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
33
|
+
|
|
34
|
+
const tweakListStyles = useTweakStyles({
|
|
35
|
+
tweakStyles,
|
|
36
|
+
className: 'tweakList',
|
|
37
|
+
currentComponentName: 'MoreMenu',
|
|
38
|
+
});
|
|
36
39
|
|
|
37
40
|
const [isMenuShown, setIsMenuShown] = useState(false);
|
|
38
41
|
const list = useRef<HTMLDivElement>(null);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './MoreMenu';
|
|
2
|
-
export type {
|
|
2
|
+
export type { IMoreMenuStyles } from './MoreMenu.styles';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
|
+
import { IMultiSelectListStyles } from '../MultiSelectList';
|
|
2
3
|
|
|
3
|
-
export const
|
|
4
|
+
export const useStyles = createThemedStyles('MultiSelect', {
|
|
4
5
|
root: {
|
|
5
6
|
position: 'relative',
|
|
6
7
|
boxSizing: 'border-box',
|
|
@@ -44,12 +45,15 @@ export const styles = {
|
|
|
44
45
|
left: {},
|
|
45
46
|
|
|
46
47
|
right: {},
|
|
48
|
+
});
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
50
|
+
export const multiSelectListStyles: IMultiSelectListStyles = {
|
|
51
|
+
root: {
|
|
52
|
+
width: '100%',
|
|
52
53
|
},
|
|
53
54
|
};
|
|
54
55
|
|
|
55
|
-
export type
|
|
56
|
+
export type IMultiSelectStyles = ITweakStyles<
|
|
57
|
+
typeof useStyles,
|
|
58
|
+
{ tweakMultiSelectList: IMultiSelectListStyles }
|
|
59
|
+
>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { useRef, useState } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import {
|
|
3
|
+
import { addDataTestId } from '@true-engineering/true-react-platform-helpers';
|
|
4
|
+
import { addDataAttributes } from '../../helpers';
|
|
5
|
+
import { useOnClickOutside, useTweakStyles } from '../../hooks';
|
|
6
|
+
import { ICommonProps } from '../../types';
|
|
4
7
|
import {
|
|
5
8
|
MultiSelectList,
|
|
6
9
|
IMultiSelectListValues,
|
|
@@ -8,21 +11,20 @@ import {
|
|
|
8
11
|
IMultiSelectLocaleKey,
|
|
9
12
|
} from '../MultiSelectList';
|
|
10
13
|
import { MultiSelectInput } from './components';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
14
|
+
import { IHorizontalCornerConnection } from './types';
|
|
15
|
+
import { useStyles, IMultiSelectStyles, multiSelectListStyles } from './MultiSelect.styles';
|
|
13
16
|
|
|
14
|
-
export interface IMultiSelectProps<Value = string> {
|
|
15
|
-
tweakStyles?: MultiSelectStyles;
|
|
17
|
+
export interface IMultiSelectProps<Value = string> extends ICommonProps<IMultiSelectStyles> {
|
|
16
18
|
value?: IMultiSelectListValues<Value>;
|
|
17
|
-
corners?:
|
|
19
|
+
corners?: IHorizontalCornerConnection;
|
|
18
20
|
isInvalid?: boolean;
|
|
19
21
|
isRequired?: boolean;
|
|
20
22
|
isDisabled?: boolean;
|
|
21
23
|
placeholder?: string;
|
|
22
24
|
localeKey?: IMultiSelectLocaleKey;
|
|
23
25
|
locale?: IMultiSelectLocale;
|
|
24
|
-
onChange
|
|
25
|
-
fetchOptions
|
|
26
|
+
onChange(value?: IMultiSelectListValues<Value>): void;
|
|
27
|
+
fetchOptions(value?: string, page?: number): Promise<Value[]>;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
export function MultiSelect<Value = string>({
|
|
@@ -34,12 +36,23 @@ export function MultiSelect<Value = string>({
|
|
|
34
36
|
placeholder = '',
|
|
35
37
|
localeKey,
|
|
36
38
|
locale,
|
|
39
|
+
testId,
|
|
40
|
+
data,
|
|
37
41
|
onChange,
|
|
38
42
|
fetchOptions,
|
|
39
43
|
tweakStyles,
|
|
40
44
|
}: IMultiSelectProps<Value>): JSX.Element {
|
|
41
|
-
const
|
|
45
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
46
|
+
|
|
47
|
+
const tweakMultiSelectListStyles = useTweakStyles({
|
|
48
|
+
innerStyles: multiSelectListStyles,
|
|
49
|
+
tweakStyles,
|
|
50
|
+
className: 'tweakMultiSelectList',
|
|
51
|
+
currentComponentName: 'MultiSelect',
|
|
52
|
+
});
|
|
53
|
+
|
|
42
54
|
const [isOpen, setIsOpen] = useState(false);
|
|
55
|
+
|
|
43
56
|
const ref = useRef(null);
|
|
44
57
|
|
|
45
58
|
const handleOnClose = () => {
|
|
@@ -48,12 +61,6 @@ export function MultiSelect<Value = string>({
|
|
|
48
61
|
|
|
49
62
|
useOnClickOutside(ref, handleOnClose, classes.root);
|
|
50
63
|
|
|
51
|
-
const tweakMultiSelectListStyles = useTweakStyles(
|
|
52
|
-
componentStyles,
|
|
53
|
-
tweakStyles,
|
|
54
|
-
'tweakMultiSelectList',
|
|
55
|
-
);
|
|
56
|
-
|
|
57
64
|
return (
|
|
58
65
|
<div
|
|
59
66
|
className={clsx(
|
|
@@ -64,6 +71,8 @@ export function MultiSelect<Value = string>({
|
|
|
64
71
|
isRequired && classes.required,
|
|
65
72
|
isDisabled && classes.disabled,
|
|
66
73
|
)}
|
|
74
|
+
{...addDataTestId(testId)}
|
|
75
|
+
{...addDataAttributes(data)}
|
|
67
76
|
>
|
|
68
77
|
{/* Input */}
|
|
69
78
|
<MultiSelectInput
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITweakStyles, createThemedStyles } from '../../../../theme';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const useStyles = createThemedStyles('MultiSelectInput', {
|
|
4
4
|
root: {
|
|
5
5
|
display: 'flex',
|
|
6
6
|
justifyContent: 'center',
|
|
@@ -68,6 +68,6 @@ export const styles = {
|
|
|
68
68
|
},
|
|
69
69
|
|
|
70
70
|
indicatorDisabled: {},
|
|
71
|
-
};
|
|
71
|
+
});
|
|
72
72
|
|
|
73
|
-
export type
|
|
73
|
+
export type IMultiSelectInputStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { useTheme } from '../../../../hooks';
|
|
4
3
|
import { ICommonProps } from '../../../../types';
|
|
5
|
-
import { Icon, IMultiSelectListValues } from '../../../index';
|
|
6
|
-
import {
|
|
4
|
+
import { Icon, IMultiSelectInputStyles, IMultiSelectListValues } from '../../../index';
|
|
5
|
+
import { useStyles } from './MultiSelectInput.styles';
|
|
7
6
|
|
|
8
|
-
export interface IMultiSelectInputProps<Value>
|
|
7
|
+
export interface IMultiSelectInputProps<Value>
|
|
8
|
+
extends Pick<ICommonProps<IMultiSelectInputStyles>, 'tweakStyles'> {
|
|
9
9
|
value?: IMultiSelectListValues<Value>;
|
|
10
10
|
isOpen: boolean;
|
|
11
11
|
isDisabled: boolean;
|
|
12
12
|
placeholder: string;
|
|
13
|
-
onToggle
|
|
13
|
+
onToggle(state: boolean): void;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function MultiSelectInput<Value>({
|
|
@@ -18,9 +18,10 @@ export function MultiSelectInput<Value>({
|
|
|
18
18
|
isOpen,
|
|
19
19
|
isDisabled = false,
|
|
20
20
|
placeholder = '',
|
|
21
|
+
tweakStyles,
|
|
21
22
|
onToggle,
|
|
22
23
|
}: IMultiSelectInputProps<Value>): ReactElement | null {
|
|
23
|
-
const
|
|
24
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
24
25
|
|
|
25
26
|
const value = v?.include;
|
|
26
27
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './MultiSelectInput';
|
|
2
|
-
export type {
|
|
2
|
+
export type { IMultiSelectInputStyles } from './MultiSelectInput.styles';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './MultiSelect';
|
|
2
2
|
export * from './types';
|
|
3
|
-
export type {
|
|
4
|
-
export type {
|
|
3
|
+
export type { IMultiSelectStyles } from './MultiSelect.styles';
|
|
4
|
+
export type { IMultiSelectInputStyles } from './components';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type IHorizontalCornerConnection = 'full' | 'left' | 'right';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { colors, helpers } from '../../theme';
|
|
2
|
-
import {
|
|
1
|
+
import { colors, helpers, ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
|
+
import { IButtonStyles } from '../Button';
|
|
3
|
+
import { ICheckboxStyles } from '../Checkbox';
|
|
4
|
+
import { ISearchInputStyles } from '../SearchInput';
|
|
3
5
|
|
|
4
6
|
const ITEM_HEIGHT = 40;
|
|
5
7
|
const TOP_GAP = 12;
|
|
6
8
|
|
|
7
|
-
export const
|
|
9
|
+
export const useStyles = createThemedStyles('MultiSelectList', {
|
|
8
10
|
root: {
|
|
9
|
-
width: ({ width }: { width: number | string }): string | number => width ?? 220,
|
|
10
11
|
background: colors.CLASSIC_WHITE,
|
|
11
12
|
},
|
|
12
13
|
|
|
@@ -85,40 +86,47 @@ export const styles = {
|
|
|
85
86
|
padding: 16,
|
|
86
87
|
fontSize: 14,
|
|
87
88
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
export const searchInputStyles: ISearchInputStyles = {
|
|
92
|
+
tweakInput: {
|
|
93
|
+
inputWrapper: {
|
|
94
|
+
backgroundColor: 'transparent',
|
|
95
|
+
border: 'none',
|
|
96
|
+
height: 40,
|
|
96
97
|
},
|
|
97
98
|
},
|
|
99
|
+
};
|
|
98
100
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
export const checkboxStyles: ICheckboxStyles = {
|
|
102
|
+
root: {
|
|
103
|
+
padding: [11, 16],
|
|
104
|
+
},
|
|
103
105
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
},
|
|
106
|
+
children: {
|
|
107
|
+
marginRight: 'auto',
|
|
107
108
|
},
|
|
109
|
+
};
|
|
108
110
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
export const clearButtonStyles: IButtonStyles = {
|
|
112
|
+
text: {
|
|
113
|
+
color: colors.GREY_ACTIVE,
|
|
112
114
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
'&:hover, &:focus': {
|
|
116
|
+
color: colors.FONT_MEDIUM,
|
|
117
|
+
},
|
|
116
118
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
},
|
|
119
|
+
'&:active': {
|
|
120
|
+
color: colors.FONT_MEDIUM,
|
|
120
121
|
},
|
|
121
122
|
},
|
|
122
123
|
};
|
|
123
124
|
|
|
124
|
-
export type
|
|
125
|
+
export type IMultiSelectListStyles = ITweakStyles<
|
|
126
|
+
typeof useStyles,
|
|
127
|
+
{
|
|
128
|
+
tweakSearchInput: ISearchInputStyles;
|
|
129
|
+
tweakCheckbox: ICheckboxStyles;
|
|
130
|
+
tweakClearButton: IButtonStyles;
|
|
131
|
+
}
|
|
132
|
+
>;
|
|
@@ -2,7 +2,7 @@ import { useEffect, useState, useMemo, useRef, useCallback, ReactNode } from 're
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { debounce } from 'ts-debounce';
|
|
4
4
|
import { addDataAttributes } from '../../helpers';
|
|
5
|
-
import { useIsMounted,
|
|
5
|
+
import { useIsMounted, useTweakStyles } from '../../hooks';
|
|
6
6
|
import { ICommonProps } from '../../types';
|
|
7
7
|
import { Button } from '../Button';
|
|
8
8
|
import { Checkbox, ICheckboxProps } from '../Checkbox';
|
|
@@ -11,10 +11,15 @@ import { ThemedPreloader } from '../ThemedPreloader';
|
|
|
11
11
|
import { DEFAULT_LOCALE, MultiSelectLocales } from './constants';
|
|
12
12
|
import { defaultConvertFunction, getLocale } from './helpers';
|
|
13
13
|
import { IMultiSelectListValues, IMultiSelectLocale, IMultiSelectLocaleKey } from './types';
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
import {
|
|
15
|
+
useStyles,
|
|
16
|
+
IMultiSelectListStyles,
|
|
17
|
+
checkboxStyles,
|
|
18
|
+
searchInputStyles,
|
|
19
|
+
clearButtonStyles,
|
|
20
|
+
} from './MultiSelectList.styles';
|
|
21
|
+
|
|
22
|
+
export interface IMultiSelectListProps<Value, Option> extends ICommonProps<IMultiSelectListStyles> {
|
|
18
23
|
value?: Value;
|
|
19
24
|
isSearchEnabled?: boolean;
|
|
20
25
|
width?: number | string;
|
|
@@ -31,7 +36,6 @@ export interface IMultiSelectListProps<Value, Option> extends ICommonProps {
|
|
|
31
36
|
checkboxPosition?: 'left' | 'right';
|
|
32
37
|
pageSize?: number;
|
|
33
38
|
searchMaxLength?: number;
|
|
34
|
-
testId?: string;
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
export function MultiSelectList<Value extends IMultiSelectListValues<Option>, Option = string>({
|
|
@@ -39,7 +43,7 @@ export function MultiSelectList<Value extends IMultiSelectListValues<Option>, Op
|
|
|
39
43
|
tweakStyles,
|
|
40
44
|
data,
|
|
41
45
|
isSearchEnabled = false,
|
|
42
|
-
width,
|
|
46
|
+
width = 220,
|
|
43
47
|
localeKey = DEFAULT_LOCALE,
|
|
44
48
|
locale = MultiSelectLocales[localeKey],
|
|
45
49
|
onChange,
|
|
@@ -56,18 +60,28 @@ export function MultiSelectList<Value extends IMultiSelectListValues<Option>, Op
|
|
|
56
60
|
testId,
|
|
57
61
|
}: IMultiSelectListProps<Value, Option>): JSX.Element {
|
|
58
62
|
const isMounted = useIsMounted();
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
const tweakCheckboxStyles = useTweakStyles(componentStyles, tweakStyles, 'tweakCheckbox');
|
|
63
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
62
64
|
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
const tweakCheckboxStyles = useTweakStyles({
|
|
66
|
+
innerStyles: checkboxStyles,
|
|
67
|
+
tweakStyles,
|
|
68
|
+
className: 'tweakCheckbox',
|
|
69
|
+
currentComponentName: 'MultiSelectList',
|
|
70
|
+
});
|
|
66
71
|
|
|
67
|
-
const
|
|
72
|
+
const tweakSearchInputStyles = useTweakStyles({
|
|
73
|
+
innerStyles: searchInputStyles,
|
|
74
|
+
tweakStyles,
|
|
75
|
+
className: 'tweakSearchInput',
|
|
76
|
+
currentComponentName: 'MultiSelectList',
|
|
77
|
+
});
|
|
68
78
|
|
|
69
|
-
const
|
|
70
|
-
|
|
79
|
+
const tweakClearButtonStyles = useTweakStyles({
|
|
80
|
+
innerStyles: clearButtonStyles,
|
|
81
|
+
tweakStyles,
|
|
82
|
+
className: 'tweakClearButton',
|
|
83
|
+
currentComponentName: 'MultiSelectList',
|
|
84
|
+
});
|
|
71
85
|
|
|
72
86
|
const [keyCursorOn, setKeyCursorOn] = useState(0);
|
|
73
87
|
const [searchValue, setSearchValue] = useState('');
|
|
@@ -82,6 +96,11 @@ export function MultiSelectList<Value extends IMultiSelectListValues<Option>, Op
|
|
|
82
96
|
|
|
83
97
|
const observer = useRef<IntersectionObserver>();
|
|
84
98
|
|
|
99
|
+
const chosenValues = value?.include;
|
|
100
|
+
|
|
101
|
+
const translates = useMemo(() => getLocale(localeKey, locale), [localeKey, locale]);
|
|
102
|
+
const chosenValuesIds = useMemo(() => chosenValues?.map(getValueId), [getValueId, chosenValues]);
|
|
103
|
+
|
|
85
104
|
const unchosenOptions = useMemo(
|
|
86
105
|
() => allOptions.filter((v) => !chosenValuesIds?.includes(getValueId(v))),
|
|
87
106
|
[getValueId, allOptions, chosenValuesIds],
|
|
@@ -310,7 +329,7 @@ export function MultiSelectList<Value extends IMultiSelectListValues<Option>, Op
|
|
|
310
329
|
const shouldShowOptionsList = !isLoading && allOptions.length !== 0;
|
|
311
330
|
|
|
312
331
|
return (
|
|
313
|
-
<div className={classes.root} {...addDataAttributes(data)}>
|
|
332
|
+
<div className={classes.root} style={{ width }} {...addDataAttributes(data)}>
|
|
314
333
|
{isSearchEnabled && (
|
|
315
334
|
<div className={classes.dropdownInput}>
|
|
316
335
|
<SearchInput
|
|
@@ -2,7 +2,7 @@ import merge from 'lodash-es/merge';
|
|
|
2
2
|
import { DEFAULT_LOCALE, MultiSelectLocales } from './constants';
|
|
3
3
|
import type { IMultiSelectLocale, IMultiSelectLocaleKey } from './types';
|
|
4
4
|
|
|
5
|
-
export const defaultConvertFunction = (val: unknown) => String(val);
|
|
5
|
+
export const defaultConvertFunction = (val: unknown): string => String(val);
|
|
6
6
|
|
|
7
7
|
export const getLocale = (
|
|
8
8
|
key: IMultiSelectLocaleKey = DEFAULT_LOCALE,
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { NotificationType } from './types';
|
|
1
|
+
import { ITweakStyles, createThemedStyles } from '../../theme';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
type: NotificationType;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const styles = {
|
|
3
|
+
export const useStyles = createThemedStyles('Notification', {
|
|
9
4
|
root: {
|
|
10
5
|
display: 'flex',
|
|
11
6
|
},
|
|
@@ -45,6 +40,16 @@ export const styles = {
|
|
|
45
40
|
withText: {},
|
|
46
41
|
|
|
47
42
|
withTitle: {},
|
|
48
|
-
};
|
|
49
43
|
|
|
50
|
-
|
|
44
|
+
error: {},
|
|
45
|
+
|
|
46
|
+
info: {},
|
|
47
|
+
|
|
48
|
+
warning: {},
|
|
49
|
+
|
|
50
|
+
ok: {},
|
|
51
|
+
|
|
52
|
+
'not-ok': {},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export type INotificationStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -6,15 +6,13 @@ import {
|
|
|
6
6
|
isStringNotEmpty,
|
|
7
7
|
} from '@true-engineering/true-react-platform-helpers';
|
|
8
8
|
import { addDataAttributes } from '../../helpers';
|
|
9
|
-
import { useTheme } from '../../hooks';
|
|
10
9
|
import { ICommonProps } from '../../types';
|
|
11
10
|
import { Icon } from '../Icon';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
11
|
+
import { INotificationType } from './types';
|
|
12
|
+
import { useStyles, INotificationStyles } from './Notification.styles';
|
|
14
13
|
|
|
15
|
-
export interface INotificationProps extends ICommonProps {
|
|
16
|
-
|
|
17
|
-
type: NotificationType;
|
|
14
|
+
export interface INotificationProps extends ICommonProps<INotificationStyles> {
|
|
15
|
+
type: INotificationType;
|
|
18
16
|
/**
|
|
19
17
|
* @default true
|
|
20
18
|
*/
|
|
@@ -25,7 +23,6 @@ export interface INotificationProps extends ICommonProps {
|
|
|
25
23
|
* @default `s`
|
|
26
24
|
*/
|
|
27
25
|
size?: 's' | 'm' | 'l';
|
|
28
|
-
testId?: string;
|
|
29
26
|
children?: ReactNode;
|
|
30
27
|
}
|
|
31
28
|
|
|
@@ -40,14 +37,14 @@ export const Notification: FC<INotificationProps> = ({
|
|
|
40
37
|
data,
|
|
41
38
|
tweakStyles,
|
|
42
39
|
}) => {
|
|
43
|
-
const
|
|
40
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
44
41
|
|
|
45
42
|
const hasText = isStringNotEmpty(text);
|
|
46
43
|
const hasTitle = isStringNotEmpty(title);
|
|
47
44
|
|
|
48
45
|
return (
|
|
49
46
|
<div
|
|
50
|
-
className={clsx(classes.root, classes[size], {
|
|
47
|
+
className={clsx(classes.root, classes[size], classes[type], {
|
|
51
48
|
[classes.inline]: !isFullWidth,
|
|
52
49
|
[classes.withTitle]: hasTitle,
|
|
53
50
|
[classes.withText]: hasText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type INotificationType = 'error' | 'info' | 'warning' | 'ok' | 'not-ok';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { colors, dimensions } from '../../theme';
|
|
2
|
-
import {
|
|
1
|
+
import { colors, dimensions, ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
|
+
import { IInputStyles } from '../Input';
|
|
3
|
+
import { IPhoneInputCountryListStyles } from './components';
|
|
3
4
|
|
|
4
5
|
const COUNTRY_SELECT_WIDTH = 80;
|
|
5
6
|
|
|
6
|
-
export const
|
|
7
|
+
export const useStyles = createThemedStyles('PhoneInput', {
|
|
7
8
|
root: {
|
|
8
9
|
width: '100%',
|
|
9
10
|
position: 'relative',
|
|
@@ -67,18 +68,22 @@ export const styles = {
|
|
|
67
68
|
left: -1,
|
|
68
69
|
zIndex: 3,
|
|
69
70
|
},
|
|
71
|
+
});
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
label: {
|
|
77
|
-
marginLeft: COUNTRY_SELECT_WIDTH,
|
|
78
|
-
},
|
|
73
|
+
export const inputStyles: IInputStyles = {
|
|
74
|
+
inputWrapper: {
|
|
75
|
+
paddingLeft: COUNTRY_SELECT_WIDTH,
|
|
79
76
|
},
|
|
80
77
|
|
|
81
|
-
|
|
78
|
+
label: {
|
|
79
|
+
marginLeft: COUNTRY_SELECT_WIDTH,
|
|
80
|
+
},
|
|
82
81
|
};
|
|
83
82
|
|
|
84
|
-
export type
|
|
83
|
+
export type IPhoneInputStyles = ITweakStyles<
|
|
84
|
+
typeof useStyles,
|
|
85
|
+
{
|
|
86
|
+
tweakInput: IInputStyles;
|
|
87
|
+
tweakCountryList: IPhoneInputCountryListStyles;
|
|
88
|
+
}
|
|
89
|
+
>;
|