@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/dist/components/ControlWrapper/ControlWrapper.d.ts +2 -0
- package/dist/true-react-common-ui-kit.js +3 -3
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +3 -3
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ControlWrapper/ControlWrapper.tsx +4 -3
- package/src/components/Input/InputBase.tsx +1 -0
package/package.json
CHANGED
|
@@ -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}
|