@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
package/dist/types.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import { Styles } from 'react-jss';
|
|
3
2
|
import { Modifier, Placement } from 'react-overlays/usePopper';
|
|
4
|
-
import type {
|
|
3
|
+
import type { IIconType } from './components';
|
|
5
4
|
export interface IDataAttributes {
|
|
6
5
|
[key: string]: unknown;
|
|
7
6
|
}
|
|
8
|
-
export interface ICommonProps {
|
|
7
|
+
export interface ICommonProps<TweakStyles> {
|
|
9
8
|
data?: IDataAttributes;
|
|
9
|
+
testId?: string;
|
|
10
|
+
tweakStyles?: TweakStyles;
|
|
10
11
|
}
|
|
11
12
|
export interface IDropdownWithPopperOptions {
|
|
12
13
|
shouldUsePopper?: boolean;
|
|
@@ -19,22 +20,3 @@ export interface IDropdownWithPopperOptions {
|
|
|
19
20
|
flipOptions?: Record<string, any>;
|
|
20
21
|
}
|
|
21
22
|
export declare type IIcon = IIconType | ReactElement;
|
|
22
|
-
export declare type ComponentStyles<StyleSheet, Props = unknown> = Partial<Styles<keyof StyleSheet, Props>>;
|
|
23
|
-
export declare type ComponentName = 'AccountInfo' | 'AddButton' | 'Button' | 'CloseButton' | 'Checkbox' | 'CssBaseline' | 'Colors' | 'DateInput' | 'DatePicker' | 'DatePickerHeader' | 'Description' | 'DotsPreloader' | 'SvgPreloader' | 'FiltersPane' | 'FilterInterval' | 'FilterSelect' | 'FilterWithDates' | 'FilterWithPeriod' | 'FilterWrapper' | 'FilterValueView' | 'FiltersPaneSearch' | 'Flag' | 'FlexibleTable' | 'Icon' | 'IncrementInput' | 'Input' | 'List' | 'Modal' | 'MoreMenu' | 'MultiSelect' | 'MultiSelectInput' | 'MultiSelectList' | 'Notification' | 'PhoneInput' | 'PhoneInputCountryList' | 'RadioButton' | 'SearchInput' | 'Select' | 'SelectList' | 'ScrollIntoViewIfNeeded' | 'Switch' | 'TextArea' | 'TextWithInfo' | 'TextWithTooltip' | 'ThemedPreloader' | 'Tooltip' | 'Toaster';
|
|
24
|
-
export declare type UiKitAnimations = Record<string, any>;
|
|
25
|
-
export declare type UiKitHelpers = Record<string, Styles | (() => Styles)>;
|
|
26
|
-
export interface UiKitTheme {
|
|
27
|
-
name: string;
|
|
28
|
-
components?: Partial<Record<ComponentName, ComponentStyles<any, any>>>;
|
|
29
|
-
/**
|
|
30
|
-
* Для переопределения иконок, которые есть в UiKit
|
|
31
|
-
*/
|
|
32
|
-
icons?: Partial<Record<ICommonIcon, ISvgIcon>>;
|
|
33
|
-
complexIcons?: Partial<Record<IComplexIcon, string>>;
|
|
34
|
-
preloaders?: Partial<Record<IPreloaderSvgType, string>>;
|
|
35
|
-
animations?: UiKitAnimations;
|
|
36
|
-
colors?: Record<string, string>;
|
|
37
|
-
dimensions?: Record<string, number>;
|
|
38
|
-
boxShadows?: Record<string, string>;
|
|
39
|
-
helpers?: UiKitHelpers;
|
|
40
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@true-engineering/true-react-common-ui-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.0",
|
|
4
4
|
"description": "True Engineering React UI Kit with theming support",
|
|
5
5
|
"author": "True Engineering (https://trueengineering.ru)",
|
|
6
6
|
"keywords": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"types-check": "tsc --noEmit"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@true-engineering/true-react-platform-helpers": "0.0.
|
|
45
|
+
"@true-engineering/true-react-platform-helpers": "0.0.6",
|
|
46
46
|
"clsx": "1.2.1",
|
|
47
47
|
"country-flag-icons": "1.5.5",
|
|
48
48
|
"date-fns": "2.29.3",
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { animations } from '../../theme';
|
|
2
|
-
import {
|
|
1
|
+
import { animations, createThemedStyles, ITweakStyles } from '../../theme';
|
|
2
|
+
import { IListStyles } from '../List';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const styles = {
|
|
4
|
+
export const useStyles = createThemedStyles('AccountInfo', {
|
|
7
5
|
root: {
|
|
8
6
|
display: 'flex',
|
|
9
7
|
},
|
|
@@ -48,8 +46,6 @@ export const styles = {
|
|
|
48
46
|
},
|
|
49
47
|
|
|
50
48
|
...animations.slideUp,
|
|
49
|
+
});
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export type AccountInfoStyles = ComponentStyles<typeof styles>;
|
|
51
|
+
export type IAccountInfoStyles = ITweakStyles<typeof useStyles, { tweakList: IListStyles }>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { FC, ReactNode, useRef, useState, MouseEvent } from 'react';
|
|
2
2
|
import { CSSTransition } from 'react-transition-group';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { addDataTestId } from '@true-engineering/true-react-platform-helpers';
|
|
4
5
|
import { addDataAttributes } from '../../helpers';
|
|
5
|
-
import { useOnClickOutsideWithRef,
|
|
6
|
+
import { useOnClickOutsideWithRef, useTweakStyles } from '../../hooks';
|
|
6
7
|
import { ICommonProps } from '../../types';
|
|
7
8
|
import { Icon } from '../Icon';
|
|
8
9
|
import { IListProps, List } from '../List';
|
|
9
10
|
import { ANIMATION_TIMEOUT } from './constants';
|
|
10
|
-
import {
|
|
11
|
+
import { useStyles, IAccountInfoStyles } from './AccountInfo.styles';
|
|
11
12
|
|
|
12
|
-
export interface IAccountInfoProps extends ICommonProps {
|
|
13
|
-
tweakStyles?: AccountInfoStyles;
|
|
13
|
+
export interface IAccountInfoProps extends ICommonProps<IAccountInfoStyles> {
|
|
14
14
|
avatar?: ReactNode;
|
|
15
15
|
accountName: ReactNode;
|
|
16
16
|
options: IListProps['items'];
|
|
@@ -18,15 +18,20 @@ export interface IAccountInfoProps extends ICommonProps {
|
|
|
18
18
|
|
|
19
19
|
export const AccountInfo: FC<IAccountInfoProps> = ({
|
|
20
20
|
data,
|
|
21
|
+
testId,
|
|
21
22
|
avatar,
|
|
22
23
|
tweakStyles,
|
|
23
24
|
accountName,
|
|
24
25
|
options,
|
|
25
26
|
}) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
28
|
+
|
|
29
|
+
const tweakListStyles = useTweakStyles({
|
|
30
|
+
tweakStyles,
|
|
31
|
+
className: 'tweakList',
|
|
32
|
+
currentComponentName: 'AccountInfo',
|
|
29
33
|
});
|
|
34
|
+
|
|
30
35
|
const nameRef = useRef<HTMLDivElement>(null);
|
|
31
36
|
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
32
37
|
|
|
@@ -39,10 +44,8 @@ export const AccountInfo: FC<IAccountInfoProps> = ({
|
|
|
39
44
|
|
|
40
45
|
useOnClickOutsideWithRef(dropdownRef, () => setIsMenuOpen(false), nameRef);
|
|
41
46
|
|
|
42
|
-
const tweakListStyles = useTweakStyles(componentStyles, tweakStyles, 'tweakList');
|
|
43
|
-
|
|
44
47
|
return (
|
|
45
|
-
<div className={classes.root} {...
|
|
48
|
+
<div className={classes.root} {...addDataTestId(testId)} {...addDataAttributes(data)}>
|
|
46
49
|
{avatar ?? (
|
|
47
50
|
<div className={classes.avatarIcon}>
|
|
48
51
|
<Icon type="avatar" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ANIMATION_TIMEOUT = 150;
|
|
1
|
+
export const ANIMATION_TIMEOUT = 150; // такой же тайминг должен быть в стилях анимации
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './AccountInfo';
|
|
2
|
-
export type {
|
|
2
|
+
export type { IAccountInfoStyles } from './AccountInfo.styles';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createThemedStyles, ITweakStyles } from '../../theme';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const useStyles = createThemedStyles('AddButton', {
|
|
4
4
|
root: {
|
|
5
5
|
display: 'flex',
|
|
6
6
|
alignItems: 'center',
|
|
@@ -29,6 +29,6 @@ export const styles = {
|
|
|
29
29
|
fullWidth: {
|
|
30
30
|
width: '100%',
|
|
31
31
|
},
|
|
32
|
-
};
|
|
32
|
+
});
|
|
33
33
|
|
|
34
|
-
export type
|
|
34
|
+
export type IAddButtonStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -1,13 +1,12 @@
|
|
|
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
|
-
import {
|
|
7
|
+
import { useStyles, IAddButtonStyles } from './AddButton.styles';
|
|
8
8
|
|
|
9
|
-
export interface IAddButtonProps extends ICommonProps {
|
|
10
|
-
tweakStyles?: AddButtonStyles;
|
|
9
|
+
export interface IAddButtonProps extends ICommonProps<IAddButtonStyles> {
|
|
11
10
|
text: string;
|
|
12
11
|
type?: 'submit' | 'button';
|
|
13
12
|
isDisabled?: boolean;
|
|
@@ -23,9 +22,10 @@ export const AddButton: FC<IAddButtonProps> = ({
|
|
|
23
22
|
onClick,
|
|
24
23
|
isFullWidth,
|
|
25
24
|
data,
|
|
25
|
+
testId,
|
|
26
26
|
tweakStyles,
|
|
27
27
|
}) => {
|
|
28
|
-
const
|
|
28
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
31
|
<button
|
|
@@ -37,10 +37,11 @@ export const AddButton: FC<IAddButtonProps> = ({
|
|
|
37
37
|
)}
|
|
38
38
|
onClick={!isDisabled ? onClick : undefined}
|
|
39
39
|
disabled={isDisabled}
|
|
40
|
+
{...addDataTestId(testId)}
|
|
40
41
|
{...addDataAttributes(data)}
|
|
41
42
|
>
|
|
42
43
|
<div className={classes.icon}>
|
|
43
|
-
<Icon type=
|
|
44
|
+
<Icon type="plus" />
|
|
44
45
|
</div>
|
|
45
46
|
<div>{text}</div>
|
|
46
47
|
</button>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './AddButton';
|
|
2
|
-
export type {
|
|
2
|
+
export type { IAddButtonStyles } from './AddButton.styles';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createThemedStyles, ITweakStyles } from '../../theme';
|
|
2
|
+
import { IThemedPreloaderStyles } from '../ThemedPreloader';
|
|
3
|
+
import { IButtonSize } from './types';
|
|
3
4
|
|
|
4
|
-
export const
|
|
5
|
+
export const useStyles = createThemedStyles('Button', {
|
|
5
6
|
root: {
|
|
6
7
|
display: 'flex',
|
|
7
8
|
justifyContent: 'center',
|
|
@@ -180,12 +181,10 @@ export const styles = {
|
|
|
180
181
|
},
|
|
181
182
|
|
|
182
183
|
disabled: {},
|
|
184
|
+
});
|
|
183
185
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
export const dotsPreloaderStyles: ThemedPreloaderStyles = {
|
|
188
|
-
tweakPreloaderComponent: {
|
|
186
|
+
const dotsPreloaderStyles: IThemedPreloaderStyles = {
|
|
187
|
+
tweakDotsPreloader: {
|
|
189
188
|
fadedDot: {
|
|
190
189
|
width: 6,
|
|
191
190
|
height: 6,
|
|
@@ -193,4 +192,10 @@ export const dotsPreloaderStyles: ThemedPreloaderStyles = {
|
|
|
193
192
|
},
|
|
194
193
|
};
|
|
195
194
|
|
|
196
|
-
export
|
|
195
|
+
export const getPreloaderStyles = (size: IButtonSize): IThemedPreloaderStyles | undefined =>
|
|
196
|
+
size === 's' || size === 'm' ? dotsPreloaderStyles : undefined;
|
|
197
|
+
|
|
198
|
+
export type IButtonStyles = ITweakStyles<
|
|
199
|
+
typeof useStyles,
|
|
200
|
+
{ tweakPreloader: IThemedPreloaderStyles }
|
|
201
|
+
>;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode, ButtonHTMLAttributes, MouseEvent, forwardRef } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import merge from 'lodash-es/merge';
|
|
4
3
|
import { addDataTestId, isReactNodeNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
5
4
|
import { addDataAttributes } from '../../helpers';
|
|
6
5
|
import { renderIcon } from '../../helpers/snippets';
|
|
7
|
-
import {
|
|
6
|
+
import { useTweakStyles } from '../../hooks';
|
|
8
7
|
import { ICommonProps, IIcon } from '../../types';
|
|
9
|
-
import { ThemedPreloader, IThemedPreloaderProps
|
|
8
|
+
import { ThemedPreloader, IThemedPreloaderProps } from '../ThemedPreloader';
|
|
10
9
|
import { IButtonSize, IButtonView } from './types';
|
|
11
|
-
import {
|
|
10
|
+
import { useStyles, IButtonStyles, getPreloaderStyles } from './Button.styles';
|
|
12
11
|
|
|
13
|
-
export interface IButtonProps extends ICommonProps {
|
|
14
|
-
tweakStyles?: ButtonStyles;
|
|
12
|
+
export interface IButtonProps extends ICommonProps<IButtonStyles> {
|
|
15
13
|
children?: ReactNode;
|
|
16
14
|
/**
|
|
17
15
|
* @default `button`
|
|
@@ -60,7 +58,6 @@ export interface IButtonProps extends ICommonProps {
|
|
|
60
58
|
* @default `dots`
|
|
61
59
|
*/
|
|
62
60
|
preloaderType?: IThemedPreloaderProps['type'];
|
|
63
|
-
testId?: string;
|
|
64
61
|
onClick?(event: MouseEvent<HTMLButtonElement>): void | Promise<void>;
|
|
65
62
|
onMouseDown?(event: MouseEvent<HTMLButtonElement>): void | Promise<void>;
|
|
66
63
|
}
|
|
@@ -89,18 +86,14 @@ export const Button = forwardRef<HTMLButtonElement, IButtonProps>(
|
|
|
89
86
|
},
|
|
90
87
|
ref,
|
|
91
88
|
) => {
|
|
92
|
-
const
|
|
89
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
93
90
|
|
|
94
|
-
const tweakPreloaderStyles =
|
|
95
|
-
()
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
tweakStyles?.tweakPreloader,
|
|
101
|
-
) as ThemedPreloaderStyles,
|
|
102
|
-
[tweakStyles?.tweakPreloader, size],
|
|
103
|
-
);
|
|
91
|
+
const tweakPreloaderStyles = useTweakStyles({
|
|
92
|
+
innerStyles: getPreloaderStyles(size),
|
|
93
|
+
tweakStyles,
|
|
94
|
+
className: 'tweakPreloader',
|
|
95
|
+
currentComponentName: 'Button',
|
|
96
|
+
});
|
|
104
97
|
|
|
105
98
|
const hasIcon = isReactNodeNotEmpty(icon);
|
|
106
99
|
const hasChildren = isReactNodeNotEmpty(children);
|
|
@@ -6,18 +6,12 @@ export default {
|
|
|
6
6
|
component: Checkbox,
|
|
7
7
|
args: {
|
|
8
8
|
value: 'value',
|
|
9
|
-
size: 18,
|
|
10
|
-
alignItems: 'center',
|
|
11
9
|
labelPosition: 'right',
|
|
12
10
|
isReadonly: false,
|
|
13
11
|
isInvalid: false,
|
|
14
12
|
isDisabled: false,
|
|
15
13
|
isSemiChecked: false,
|
|
16
14
|
},
|
|
17
|
-
argTypes: {
|
|
18
|
-
value: { control: 'text' },
|
|
19
|
-
alignItems: { control: 'inline-radio', options: ['top', 'center'] },
|
|
20
|
-
},
|
|
21
15
|
parameters: {
|
|
22
16
|
controls: {
|
|
23
17
|
exclude: ['data', 'tweakStyles', 'testId', 'onSelect'],
|
|
@@ -26,7 +20,9 @@ export default {
|
|
|
26
20
|
} as ComponentMeta<typeof Checkbox>;
|
|
27
21
|
|
|
28
22
|
export const Default: ComponentStory<typeof Checkbox> = (args) => (
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
23
|
+
<div style={{ width: 200 }}>
|
|
24
|
+
<Checkbox {...args} onSelect={(value) => console.log('Value was selected', value)}>
|
|
25
|
+
<div>Some text</div>
|
|
26
|
+
</Checkbox>
|
|
27
|
+
</div>
|
|
32
28
|
);
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ICheckboxProps } from './Checkbox';
|
|
1
|
+
import { createThemedStyles, ITweakStyles } from '../../theme';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
size: NonNullable<ICheckboxProps<unknown>['size']>;
|
|
6
|
-
alignItems: NonNullable<ICheckboxProps<unknown>['alignItems']>;
|
|
7
|
-
textMargin: ICheckboxProps<unknown>['textMargin'];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const styles = {
|
|
3
|
+
export const useStyles = createThemedStyles('Checkbox', {
|
|
11
4
|
root: {
|
|
12
5
|
cursor: 'pointer',
|
|
13
6
|
display: 'flex',
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
gap: 14,
|
|
8
|
+
width: 'fit-content',
|
|
16
9
|
},
|
|
17
10
|
|
|
18
11
|
disabled: {
|
|
@@ -28,18 +21,15 @@ export const styles = {
|
|
|
28
21
|
},
|
|
29
22
|
|
|
30
23
|
children: {
|
|
31
|
-
maxWidth: 'calc(100% - 32px)',
|
|
32
24
|
display: 'flex',
|
|
33
25
|
alignItems: 'center',
|
|
34
26
|
},
|
|
35
27
|
|
|
36
28
|
check: {
|
|
37
|
-
width:
|
|
38
|
-
height:
|
|
29
|
+
width: 18,
|
|
30
|
+
height: 18,
|
|
39
31
|
borderRadius: 2,
|
|
40
32
|
flexShrink: 0,
|
|
41
|
-
marginRight: ({ size, textMargin }: IStyleProps): number =>
|
|
42
|
-
textMargin !== undefined ? textMargin : size - 4,
|
|
43
33
|
display: 'flex',
|
|
44
34
|
alignItems: 'center',
|
|
45
35
|
justifyContent: 'center',
|
|
@@ -50,13 +40,7 @@ export const styles = {
|
|
|
50
40
|
|
|
51
41
|
labelPositionLeft: {
|
|
52
42
|
flexDirection: 'row-reverse',
|
|
53
|
-
|
|
54
|
-
'& $check': {
|
|
55
|
-
marginRight: 0,
|
|
56
|
-
marginLeft: ({ size, textMargin }: IStyleProps): number =>
|
|
57
|
-
textMargin !== undefined ? textMargin : size - 4,
|
|
58
|
-
},
|
|
59
43
|
},
|
|
60
|
-
};
|
|
44
|
+
});
|
|
61
45
|
|
|
62
|
-
export type
|
|
46
|
+
export type ICheckboxStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -6,13 +6,11 @@ import {
|
|
|
6
6
|
isReactNodeNotEmpty,
|
|
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 {
|
|
11
|
+
import { useStyles, ICheckboxStyles } from './Checkbox.styles';
|
|
13
12
|
|
|
14
|
-
export interface ICheckboxProps<V> extends ICommonProps {
|
|
15
|
-
tweakStyles?: CheckboxStyles;
|
|
13
|
+
export interface ICheckboxProps<V> extends ICommonProps<ICheckboxStyles> {
|
|
16
14
|
children?: ReactNode;
|
|
17
15
|
isChecked?: boolean;
|
|
18
16
|
isSemiChecked?: boolean;
|
|
@@ -20,23 +18,10 @@ export interface ICheckboxProps<V> extends ICommonProps {
|
|
|
20
18
|
isReadonly?: boolean;
|
|
21
19
|
isInvalid?: boolean;
|
|
22
20
|
value: V;
|
|
23
|
-
/**
|
|
24
|
-
* @default 18
|
|
25
|
-
*/
|
|
26
|
-
size?: number;
|
|
27
|
-
/**
|
|
28
|
-
* @default `center`
|
|
29
|
-
*/
|
|
30
|
-
alignItems?: 'top' | 'center';
|
|
31
|
-
/**
|
|
32
|
-
* @default `size - 4px`
|
|
33
|
-
*/
|
|
34
|
-
textMargin?: number;
|
|
35
21
|
/**
|
|
36
22
|
* @default `right`
|
|
37
23
|
*/
|
|
38
24
|
labelPosition?: 'right' | 'left';
|
|
39
|
-
testId?: string;
|
|
40
25
|
onSelect(value: { value: V; isSelected: boolean }): void;
|
|
41
26
|
}
|
|
42
27
|
|
|
@@ -46,9 +31,6 @@ export function Checkbox<V>({
|
|
|
46
31
|
isReadonly,
|
|
47
32
|
isChecked = false,
|
|
48
33
|
value,
|
|
49
|
-
size = 18,
|
|
50
|
-
alignItems = 'center',
|
|
51
|
-
textMargin,
|
|
52
34
|
data,
|
|
53
35
|
testId,
|
|
54
36
|
isSemiChecked,
|
|
@@ -56,11 +38,7 @@ export function Checkbox<V>({
|
|
|
56
38
|
tweakStyles,
|
|
57
39
|
onSelect,
|
|
58
40
|
}: ICheckboxProps<V>): JSX.Element {
|
|
59
|
-
const
|
|
60
|
-
size,
|
|
61
|
-
alignItems,
|
|
62
|
-
textMargin,
|
|
63
|
-
});
|
|
41
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
64
42
|
|
|
65
43
|
const [isSelected, setIsSelected] = useState(false);
|
|
66
44
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './Checkbox';
|
|
2
|
-
export type {
|
|
2
|
+
export type { ICheckboxStyles } from './Checkbox.styles';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { rgba } from '../../helpers';
|
|
2
|
-
import { colors } from '../../theme';
|
|
3
|
-
import { ComponentStyles } from '../../types';
|
|
2
|
+
import { colors, createThemedStyles, ITweakStyles } from '../../theme';
|
|
4
3
|
|
|
5
|
-
export const
|
|
4
|
+
export const useStyles = createThemedStyles('CloseButton', {
|
|
6
5
|
root: {
|
|
7
6
|
width: 40,
|
|
8
7
|
height: 40,
|
|
@@ -29,6 +28,6 @@ export const styles = {
|
|
|
29
28
|
backgroundColor: rgba(colors.FONT_DISABLED, 0.5),
|
|
30
29
|
},
|
|
31
30
|
},
|
|
32
|
-
};
|
|
31
|
+
});
|
|
33
32
|
|
|
34
|
-
export type
|
|
33
|
+
export type ICloseButtonStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -1,15 +1,13 @@
|
|
|
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 { Icon } from '../Icon';
|
|
6
|
-
import {
|
|
6
|
+
import { useStyles, ICloseButtonStyles } from './CloseButton.styles';
|
|
7
7
|
|
|
8
|
-
export interface ICloseButtonProps extends ICommonProps {
|
|
9
|
-
tweakStyles?: CloseButtonStyles;
|
|
10
|
-
testId?: string;
|
|
11
|
-
onClose?: () => void;
|
|
8
|
+
export interface ICloseButtonProps extends ICommonProps<ICloseButtonStyles> {
|
|
12
9
|
iconType?: 'close' | 'close-large' | 'close-window';
|
|
10
|
+
onClose?(): void;
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
export const CloseButton: FC<ICloseButtonProps> = ({
|
|
@@ -19,14 +17,14 @@ export const CloseButton: FC<ICloseButtonProps> = ({
|
|
|
19
17
|
iconType = 'close',
|
|
20
18
|
onClose,
|
|
21
19
|
}) => {
|
|
22
|
-
const
|
|
20
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
23
21
|
|
|
24
22
|
return (
|
|
25
23
|
<button
|
|
26
24
|
type="button"
|
|
27
25
|
className={classes.root}
|
|
28
26
|
onClick={onClose}
|
|
29
|
-
|
|
27
|
+
{...addDataTestId(testId)}
|
|
30
28
|
{...addDataAttributes(data)}
|
|
31
29
|
>
|
|
32
30
|
<Icon type={iconType} />
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './CloseButton';
|
|
2
|
-
export type {
|
|
2
|
+
export type { ICloseButtonStyles } from './CloseButton.styles';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createThemedStyles } from '../../theme';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const useStyles = createThemedStyles({
|
|
4
4
|
root: {
|
|
5
5
|
display: 'flex',
|
|
6
6
|
flexWrap: 'wrap',
|
|
@@ -33,6 +33,4 @@ export const styles = {
|
|
|
33
33
|
fontWeight: 'bold',
|
|
34
34
|
padding: [0, 6, 6],
|
|
35
35
|
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export type ColorsStyles = ComponentStyles<typeof styles>;
|
|
36
|
+
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FC, useContext } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ThemeContext } from '../../theme';
|
|
3
|
+
import { useStyles } from './Colors.styles';
|
|
4
4
|
|
|
5
5
|
// TODO: А зачем нужен то этот компонент кроме как ради сторис?????? мб его толкьо в сторис оформить?
|
|
6
6
|
|
|
7
7
|
export const Colors: FC = () => {
|
|
8
|
-
const
|
|
8
|
+
const classes = useStyles();
|
|
9
9
|
const { theme } = useContext(ThemeContext);
|
|
10
10
|
const { colors = {} } = theme;
|
|
11
11
|
|
|
@@ -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('CssBaseline', {
|
|
5
4
|
'@global html, body': {
|
|
6
5
|
fontFamily: 'Arial, sans-serif',
|
|
7
6
|
color: colors.FONT_MAIN,
|
|
@@ -10,6 +9,6 @@ export const styles = {
|
|
|
10
9
|
},
|
|
11
10
|
|
|
12
11
|
root: {},
|
|
13
|
-
};
|
|
12
|
+
});
|
|
14
13
|
|
|
15
|
-
export type
|
|
14
|
+
export type ICssBaselineStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -1,15 +1,13 @@
|
|
|
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
|
-
import {
|
|
5
|
+
import { useStyles, ICssBaselineStyles } from './CssBaseline.styles';
|
|
6
6
|
|
|
7
|
-
export
|
|
8
|
-
tweakStyles?: CssBaselineStyles;
|
|
9
|
-
}
|
|
7
|
+
export type ICssBaselineProps = ICommonProps<ICssBaselineStyles>;
|
|
10
8
|
|
|
11
|
-
export const CssBaseline: FC<ICssBaselineProps> = ({ data, tweakStyles }) => {
|
|
12
|
-
const
|
|
9
|
+
export const CssBaseline: FC<ICssBaselineProps> = ({ data, testId, tweakStyles }) => {
|
|
10
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
13
11
|
|
|
14
|
-
return <div className={classes.root} {...addDataAttributes(data)} />;
|
|
12
|
+
return <div className={classes.root} {...addDataTestId(testId)} {...addDataAttributes(data)} />;
|
|
15
13
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './CssBaseline';
|
|
2
|
-
export type {
|
|
2
|
+
export type { ICssBaselineStyles } from './CssBaseline.styles';
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITweakStyles, createThemedStyles } from '../../theme';
|
|
2
|
+
import { IInputStyles } from '../Input';
|
|
2
3
|
|
|
3
|
-
export const
|
|
4
|
+
export const useStyles = createThemedStyles('DateInput', {
|
|
4
5
|
root: {
|
|
5
6
|
width: '100%',
|
|
6
7
|
height: '100%',
|
|
7
8
|
cursor: 'pointer',
|
|
8
9
|
position: 'relative',
|
|
9
10
|
},
|
|
11
|
+
});
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
export type IDateInputStyles = ITweakStyles<
|
|
14
|
+
typeof useStyles,
|
|
15
|
+
{
|
|
16
|
+
tweakInput: IInputStyles;
|
|
17
|
+
}
|
|
18
|
+
>;
|