@true-engineering/true-react-common-ui-kit 4.0.0-alpha1 → 4.0.0-alpha2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@true-engineering/true-react-common-ui-kit",
3
- "version": "4.0.0-alpha1",
3
+ "version": "4.0.0-alpha2",
4
4
  "description": "True Engineering React UI Kit with theming support",
5
5
  "author": "True Engineering (https://trueengineering.ru)",
6
6
  "keywords": [
@@ -49,7 +49,7 @@ export const inputStyles: IInputStyles = {
49
49
  paddingRight: 0,
50
50
  },
51
51
  },
52
- }
52
+ },
53
53
  };
54
54
 
55
55
  export const clearButtonStyles = cloneDeep(innerTextButtonStyles);
@@ -7,7 +7,12 @@ import { Button } from '../../../Button';
7
7
  import { NumberInput } from '../../../NumberInput';
8
8
  import { getLocale, sortValues } from '../../helpers';
9
9
  import { IFilterLocaleKey, IPartialFilterLocale } from '../../types';
10
- import { clearButtonStyles, IFilterIntervalStyles, inputStyles, useStyles } from './FilterInterval.styles';
10
+ import {
11
+ clearButtonStyles,
12
+ IFilterIntervalStyles,
13
+ inputStyles,
14
+ useStyles,
15
+ } from './FilterInterval.styles';
11
16
 
12
17
  export interface IFilterIntervalProps extends ICommonProps<IFilterIntervalStyles> {
13
18
  value?: Array<number | undefined>;
@@ -72,7 +72,7 @@ export const inputStyles: IInputStyles = {
72
72
  controls: {
73
73
  paddingRight: BUTTONS_WIDTH + BUTTONS_GAP,
74
74
  },
75
- }
75
+ },
76
76
  };
77
77
 
78
78
  export type IIncrementInputStyles = ITweakStyles<typeof useStyles, { tweakInput: IInputStyles }>;
@@ -1,44 +1,31 @@
1
- import { colors, createThemedStyles, dimensions, ITweakStyles } from '../../theme';
2
1
  import { IInputStyles } from '../Input';
3
2
 
4
- const { Z_INDEX } = dimensions;
3
+ export const inputStyles: IInputStyles = {
4
+ tweakControlWrapper: {
5
+ endIcon: {
6
+ position: 'absolute',
7
+ width: 40,
8
+ left: 0,
5
9
 
6
- export const useStyles = createThemedStyles('SearchInput', {
7
- root: {
8
- position: 'relative',
9
- },
10
+ '&:last-child': {
11
+ paddingRight: 0,
12
+ },
10
13
 
11
- icon: {
12
- display: 'flex',
13
- alignItems: 'center',
14
- position: 'absolute',
15
- left: 12,
16
- height: '100%',
17
- width: 20,
18
- color: colors.GREY_ACTIVE,
19
- zIndex: Z_INDEX.CONTROL_FOCUS + 1,
20
- },
21
- });
14
+ '&:not($activeIcon)': {
15
+ pointerEvents: 'none',
16
+ },
17
+ },
22
18
 
23
- export const inputStyles: IInputStyles = {
24
- tweakControlWrapper: {
25
19
  controlWrapper: {
26
20
  borderColor: 'transparent',
27
- borderRadius: 18,
28
- paddingLeft: 0,
29
- transitionProperty: 'background-color, border-color',
30
- },
31
-
32
- focused: {
33
- backgroundColor: colors.CLASSIC_WHITE,
34
- borderColor: colors.BORDER_MAIN,
35
21
  },
36
22
  },
37
-
38
23
  inputContent: {
39
24
  fontSize: 14,
40
25
  paddingLeft: 44,
41
26
  },
42
27
  };
43
28
 
44
- export type ISearchInputStyles = ITweakStyles<typeof useStyles, { tweakInput: IInputStyles }>;
29
+ export interface ISearchInputStyles {
30
+ tweakInput?: IInputStyles;
31
+ }
@@ -1,11 +1,9 @@
1
1
  import { FC } from 'react';
2
- import { addDataTestId, getTestId } from '@true-engineering/true-react-platform-helpers';
3
- import { addDataAttributes } from '../../helpers';
2
+ import { getTestId } from '@true-engineering/true-react-platform-helpers';
4
3
  import { useTweakStyles } from '../../hooks';
5
4
  import { ICommonProps } from '../../types';
6
- import { Icon } from '../Icon';
7
5
  import { IInputProps, Input } from '../Input';
8
- import { inputStyles, ISearchInputStyles, useStyles } from './SearchInput.styles';
6
+ import { inputStyles, ISearchInputStyles } from './SearchInput.styles';
9
7
 
10
8
  export type ISearchInputProps = Omit<
11
9
  IInputProps,
@@ -15,15 +13,13 @@ export type ISearchInputProps = Omit<
15
13
 
16
14
  export const SearchInput: FC<ISearchInputProps> = ({
17
15
  isClearable = true,
18
- tweakStyles,
19
16
  placeholder,
20
17
  value,
21
18
  testId,
19
+ tweakStyles,
22
20
  data,
23
21
  ...props
24
22
  }) => {
25
- const classes = useStyles({ theme: tweakStyles });
26
-
27
23
  const tweakInputStyles = useTweakStyles({
28
24
  innerStyles: inputStyles,
29
25
  tweakStyles,
@@ -32,18 +28,14 @@ export const SearchInput: FC<ISearchInputProps> = ({
32
28
  });
33
29
 
34
30
  return (
35
- <div className={classes.root} {...addDataTestId(testId)} {...addDataAttributes(data)}>
36
- <div className={classes.icon}>
37
- <Icon type="search" />
38
- </div>
39
- <Input
40
- value={value}
41
- placeholder={placeholder}
42
- isClearable={isClearable}
43
- testId={getTestId(testId, 'input')}
44
- tweakStyles={tweakInputStyles}
45
- {...props}
46
- />
47
- </div>
31
+ <Input
32
+ value={value}
33
+ placeholder={placeholder}
34
+ icon="search"
35
+ isClearable={isClearable}
36
+ testId={getTestId(testId, 'input')}
37
+ tweakStyles={tweakInputStyles}
38
+ {...props}
39
+ />
48
40
  );
49
41
  };