@true-engineering/true-react-common-ui-kit 4.0.0-alpha39 → 4.0.0-alpha40

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-alpha39",
3
+ "version": "4.0.0-alpha40",
4
4
  "description": "True Engineering React UI Kit with theming support",
5
5
  "author": "True Engineering (https://trueengineering.ru)",
6
6
  "keywords": [
@@ -47,6 +47,8 @@ export interface IControlWrapperProps extends ICommonProps<IControlWrapperStyles
47
47
  isLoading?: boolean;
48
48
  /** @default false */
49
49
  isDisabled?: boolean;
50
+ /** @default false */
51
+ isActive?: boolean;
50
52
  onClear?: (event: IClickHandlerEvent) => void;
51
53
  }
52
54
 
@@ -59,6 +61,7 @@ export const ControlWrapper: FC<IControlWrapperProps> = ({
59
61
  isRequired,
60
62
  isLoading,
61
63
  isFullWidth,
64
+ isActive,
62
65
  isDisabled,
63
66
  hasValue,
64
67
  size,
@@ -76,8 +79,6 @@ export const ControlWrapper: FC<IControlWrapperProps> = ({
76
79
  const hasClearButton = !isDisabled && !isLoading && hasValue && isNotEmpty(onClear);
77
80
  const hasControls = hasIcons || hasClearButton || isLoading;
78
81
 
79
- const isActive = isFocused || hasValue;
80
-
81
82
  const tweakPreloaderStyles = useTweakStyles({
82
83
  tweakStyles,
83
84
  className: 'tweakPreloader',
@@ -106,7 +107,7 @@ export const ControlWrapper: FC<IControlWrapperProps> = ({
106
107
  className={clsx(classes.label, {
107
108
  [classes.requiredLabel]: isRequired,
108
109
  [classes.disabledLabel]: isDisabled,
109
- [classes.activeLabel]: isActive,
110
+ [classes.activeLabel]: isFocused || hasValue || isActive,
110
111
  })}
111
112
  >
112
113
  {label}
@@ -229,6 +229,7 @@ export const InputBase = forwardRef<HTMLInputElement, IInputBaseProps>(
229
229
  label={label}
230
230
  isDisabled={isDisabled}
231
231
  isFocused={hasFocus}
232
+ isActive={hasPlaceholder}
232
233
  isInvalid={isInvalid}
233
234
  hasValue={hasValue}
234
235
  isFullWidth={!isAutoSized}