@groupeactual/ui-kit 0.4.2 → 0.4.4
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/cjs/components/Form/TextField/TextField.d.ts +2 -1
- package/dist/cjs/index.js +22 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Form/TextField/TextField.d.ts +2 -1
- package/dist/esm/index.js +22 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/Form/TextField/TextField.tsx +25 -4
|
@@ -11,6 +11,7 @@ interface Props {
|
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
isValid?: boolean;
|
|
13
13
|
endAdornment?: ReactNode;
|
|
14
|
+
maxLength?: number;
|
|
14
15
|
}
|
|
15
|
-
declare const TextField: ({ name, value, error, onBlur, onChange, label, disabled, endAdornment, isValid, placeholder, ...props }: Omit<TextFieldProps, 'error'> & Props) => JSX.Element;
|
|
16
|
+
declare const TextField: ({ name, value, error, onBlur, onChange, label, disabled, endAdornment, isValid, placeholder, maxLength, ...props }: Omit<TextFieldProps, 'error'> & Props) => JSX.Element;
|
|
16
17
|
export default TextField;
|
package/dist/cjs/index.js
CHANGED
|
@@ -50472,21 +50472,22 @@ var ActButton = styled$1(Button$1)(function (_a) {
|
|
|
50472
50472
|
});
|
|
50473
50473
|
|
|
50474
50474
|
var TextField = function (_a) {
|
|
50475
|
-
var name = _a.name, value = _a.value, error = _a.error, onBlur = _a.onBlur, onChange = _a.onChange, label = _a.label, disabled = _a.disabled, endAdornment = _a.endAdornment; _a.isValid; var _b = _a.placeholder, placeholder = _b === void 0 ? '' : _b, props = __rest(_a, ["name", "value", "error", "onBlur", "onChange", "label", "disabled", "endAdornment", "isValid", "placeholder"]);
|
|
50475
|
+
var name = _a.name, value = _a.value, error = _a.error, onBlur = _a.onBlur, onChange = _a.onChange, label = _a.label, disabled = _a.disabled, endAdornment = _a.endAdornment; _a.isValid; var _b = _a.placeholder, placeholder = _b === void 0 ? '' : _b, maxLength = _a.maxLength, props = __rest(_a, ["name", "value", "error", "onBlur", "onChange", "label", "disabled", "endAdornment", "isValid", "placeholder", "maxLength"]);
|
|
50476
50476
|
var _c = React.useState(value), internalValue = _c[0], setInternalValue = _c[1];
|
|
50477
50477
|
React.useEffect(function () {
|
|
50478
50478
|
if (value !== internalValue) {
|
|
50479
50479
|
setInternalValue(value);
|
|
50480
50480
|
}
|
|
50481
50481
|
}, [value]);
|
|
50482
|
-
return (jsxRuntime.jsx(MuiTextField, __assign$1({ variant: "outlined", name: name, label: label, value: internalValue, placeholder: placeholder, InputLabelProps: { shrink: true }, onClick: function (e) { return e.stopPropagation(); },
|
|
50483
|
-
endAdornment: endAdornment
|
|
50484
|
-
}, onChange: function (e) {
|
|
50482
|
+
return (jsxRuntime.jsx(MuiTextField, __assign$1({ variant: "outlined", name: name, label: label, value: internalValue, placeholder: placeholder, FormHelperTextProps: { component: 'div' }, InputLabelProps: { shrink: true }, onClick: function (e) { return e.stopPropagation(); }, onChange: function (e) {
|
|
50485
50483
|
setInternalValue(e.currentTarget.value);
|
|
50486
50484
|
onChange(e);
|
|
50487
50485
|
}, onBlur: function (e) {
|
|
50488
50486
|
onBlur(e);
|
|
50489
|
-
}, error: !!error,
|
|
50487
|
+
}, error: !!error, disabled: disabled, InputProps: { endAdornment: endAdornment }, inputProps: { maxLength: maxLength } }, props, { helperText: jsxRuntime.jsxs("div", __assign$1({ style: { display: 'table', width: '100%' } }, { children: [(error || props.helperText) && (jsxRuntime.jsx("div", __assign$1({ style: {
|
|
50488
|
+
display: maxLength ? 'table-cell' : '',
|
|
50489
|
+
float: 'left'
|
|
50490
|
+
} }, { children: error || props.helperText }))), maxLength && (jsxRuntime.jsxs("div", __assign$1({ style: { display: 'table-cell', float: 'right' } }, { children: [internalValue.length, "/", maxLength, " caract."] })))] })) })));
|
|
50490
50491
|
};
|
|
50491
50492
|
|
|
50492
50493
|
var Checkbox = function (_a) {
|
|
@@ -50962,6 +50963,9 @@ var useMaterialThemeCss = function (muiTokens) {
|
|
|
50962
50963
|
root: {
|
|
50963
50964
|
fontWeight: 400,
|
|
50964
50965
|
fontSize: '11px',
|
|
50966
|
+
marginLeft: '8px',
|
|
50967
|
+
marginRight: '8px',
|
|
50968
|
+
marginTop: '5px',
|
|
50965
50969
|
lineHeight: '12px',
|
|
50966
50970
|
color: muiTokens.palette.greyDark,
|
|
50967
50971
|
'&.Mui-error': {
|
|
@@ -50971,22 +50975,29 @@ var useMaterialThemeCss = function (muiTokens) {
|
|
|
50971
50975
|
}
|
|
50972
50976
|
},
|
|
50973
50977
|
MuiOutlinedInput: {
|
|
50978
|
+
defaultProps: {
|
|
50979
|
+
notched: true
|
|
50980
|
+
},
|
|
50974
50981
|
styleOverrides: {
|
|
50975
50982
|
input: {
|
|
50976
50983
|
fontSize: '14px',
|
|
50977
50984
|
lineHeight: '18px',
|
|
50978
50985
|
fontWeight: 400,
|
|
50986
|
+
padding: '12px 14px',
|
|
50987
|
+
height: '18px',
|
|
50979
50988
|
color: muiTokens.palette.greyXDark,
|
|
50980
50989
|
'&::placeholder': {
|
|
50981
|
-
color: muiTokens.palette.greyDark,
|
|
50990
|
+
color: "".concat(muiTokens.palette.greyDark, " !important"),
|
|
50991
|
+
opacity: 1 + ' !important',
|
|
50982
50992
|
fontWeight: 400,
|
|
50983
50993
|
lineHeight: '18px',
|
|
50984
50994
|
fontSize: '14px'
|
|
50985
50995
|
},
|
|
50986
50996
|
'&.Mui-disabled': {
|
|
50987
50997
|
backgroundColor: muiTokens.palette.greyXLight,
|
|
50988
|
-
color: muiTokens.palette.
|
|
50989
|
-
borderColor: muiTokens.palette.greyLightDefaultborder
|
|
50998
|
+
color: muiTokens.palette.greyDark,
|
|
50999
|
+
borderColor: muiTokens.palette.greyLightDefaultborder,
|
|
51000
|
+
WebkitTextFillColor: muiTokens.palette.greyDark
|
|
50990
51001
|
}
|
|
50991
51002
|
},
|
|
50992
51003
|
root: {
|
|
@@ -51012,9 +51023,11 @@ var useMaterialThemeCss = function (muiTokens) {
|
|
|
51012
51023
|
MuiInputLabel: {
|
|
51013
51024
|
styleOverrides: {
|
|
51014
51025
|
root: {
|
|
51015
|
-
fontSize: '
|
|
51026
|
+
fontSize: '16px',
|
|
51016
51027
|
lineHeight: '16px',
|
|
51028
|
+
height: '16px',
|
|
51017
51029
|
fontWeight: 500,
|
|
51030
|
+
transform: 'translate(14px, -7px) scale(0.75)',
|
|
51018
51031
|
color: muiTokens.palette.greyXDark,
|
|
51019
51032
|
'&.Mui-disabled': {
|
|
51020
51033
|
color: muiTokens.palette.greyXDark
|