@groupeactual/ui-kit 0.3.9 → 0.4.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.
@@ -9,7 +9,8 @@ interface Props {
9
9
  name: string;
10
10
  placeholder?: string;
11
11
  disabled?: boolean;
12
+ isValid?: boolean;
12
13
  endAdornment?: ReactNode;
13
14
  }
14
- declare const TextField: ({ name, value, error, onBlur, onChange, label, disabled, endAdornment, placeholder, ...props }: Omit<TextFieldProps, 'error'> & Props) => JSX.Element;
15
+ declare const TextField: ({ name, value, error, onBlur, onChange, label, disabled, endAdornment, isValid, placeholder, ...props }: Omit<TextFieldProps, 'error'> & Props) => JSX.Element;
15
16
  export default TextField;
package/dist/cjs/index.js CHANGED
@@ -50297,16 +50297,14 @@ var ActButton = styled$1(Button$1)(function (_a) {
50297
50297
  });
50298
50298
 
50299
50299
  var TextField = function (_a) {
50300
- 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, _b = _a.placeholder, placeholder = _b === void 0 ? '' : _b, props = __rest(_a, ["name", "value", "error", "onBlur", "onChange", "label", "disabled", "endAdornment", "placeholder"]);
50300
+ 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"]);
50301
50301
  var _c = React.useState(value), internalValue = _c[0], setInternalValue = _c[1];
50302
50302
  React.useEffect(function () {
50303
50303
  if (value !== internalValue) {
50304
50304
  setInternalValue(value);
50305
50305
  }
50306
50306
  }, [value]);
50307
- return (jsxRuntime.jsx(MuiTextField, __assign$1({ variant: "outlined", name: name, label: label, value: internalValue, placeholder: placeholder, onClick: function (e) { return e.stopPropagation(); }, InputLabelProps: {
50308
- shrink: true
50309
- }, InputProps: {
50307
+ 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(); }, InputProps: {
50310
50308
  endAdornment: endAdornment
50311
50309
  }, onChange: function (e) {
50312
50310
  setInternalValue(e.currentTarget.value);
@@ -50429,9 +50427,35 @@ var IconProvider = function (_a) {
50429
50427
  return (jsxRuntime.jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, { children: jsxRuntime.jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: getFontSize() }) })));
50430
50428
  };
50431
50429
 
50430
+ /******************************************************************************
50431
+ Copyright (c) Microsoft Corporation.
50432
+
50433
+ Permission to use, copy, modify, and/or distribute this software for any
50434
+ purpose with or without fee is hereby granted.
50435
+
50436
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
50437
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
50438
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
50439
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
50440
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
50441
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
50442
+ PERFORMANCE OF THIS SOFTWARE.
50443
+ ***************************************************************************** */
50444
+
50445
+ var __assign = function() {
50446
+ __assign = Object.assign || function __assign(t) {
50447
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
50448
+ s = arguments[i];
50449
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
50450
+ }
50451
+ return t;
50452
+ };
50453
+ return __assign.apply(this, arguments);
50454
+ };
50455
+
50432
50456
  /**
50433
50457
  * Do not edit directly
50434
- * Generated on Mon, 28 Nov 2022 20:36:57 GMT
50458
+ * Generated on Tue, 29 Nov 2022 10:20:00 GMT
50435
50459
  */
50436
50460
  var DefaultWebShadowAllContent = { "color": "#2727271f", "type": "dropShadow", "x": "0", "y": "2", "blur": "10", "spread": "0" };
50437
50461
  var DefaultSpacingXxs = "4";
@@ -50730,7 +50754,18 @@ var getMuiPalette = function (themeName) {
50730
50754
  palette[colorKey] = tokens[colorName];
50731
50755
  }
50732
50756
  });
50733
- return palette;
50757
+ var defaultPalette = {
50758
+ success: {
50759
+ main: tokens[themeName + 'ColorsGreenSuccess']
50760
+ },
50761
+ error: {
50762
+ main: tokens[themeName + 'ColorsRedError']
50763
+ },
50764
+ warning: {
50765
+ main: tokens[themeName + 'ColorsOrangeWarning']
50766
+ }
50767
+ };
50768
+ return __assign(__assign({}, palette), defaultPalette);
50734
50769
  };
50735
50770
  var getFontFamilies = function (themeName) {
50736
50771
  var designTokens = tokens;
@@ -50743,32 +50778,6 @@ var getFontFamilies = function (themeName) {
50743
50778
  return fontFamilies;
50744
50779
  };
50745
50780
 
50746
- /******************************************************************************
50747
- Copyright (c) Microsoft Corporation.
50748
-
50749
- Permission to use, copy, modify, and/or distribute this software for any
50750
- purpose with or without fee is hereby granted.
50751
-
50752
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
50753
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
50754
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
50755
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
50756
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
50757
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
50758
- PERFORMANCE OF THIS SOFTWARE.
50759
- ***************************************************************************** */
50760
-
50761
- var __assign = function() {
50762
- __assign = Object.assign || function __assign(t) {
50763
- for (var s, i = 1, n = arguments.length; i < n; i++) {
50764
- s = arguments[i];
50765
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
50766
- }
50767
- return t;
50768
- };
50769
- return __assign.apply(this, arguments);
50770
- };
50771
-
50772
50781
  var useMaterialThemeCss = function (muiTokens) {
50773
50782
  var muiCss = React.useMemo(function () {
50774
50783
  return {
@@ -50777,7 +50786,7 @@ var useMaterialThemeCss = function (muiTokens) {
50777
50786
  styleOverrides: {
50778
50787
  root: {
50779
50788
  fontWeight: 400,
50780
- fontSize: '10px',
50789
+ fontSize: '11px',
50781
50790
  lineHeight: '12px',
50782
50791
  color: muiTokens.palette.greyDark,
50783
50792
  '&.Mui-error': {
@@ -50792,11 +50801,11 @@ var useMaterialThemeCss = function (muiTokens) {
50792
50801
  fontSize: '14px',
50793
50802
  lineHeight: '18px',
50794
50803
  fontWeight: 400,
50795
- paddingTop: '8px',
50796
50804
  color: muiTokens.palette.greyXDark,
50797
50805
  '&::placeholder': {
50798
50806
  color: muiTokens.palette.greyDark,
50799
50807
  fontWeight: 400,
50808
+ lineHeight: '18px',
50800
50809
  fontSize: '14px'
50801
50810
  },
50802
50811
  '&.Mui-disabled': {
@@ -50818,12 +50827,18 @@ var useMaterialThemeCss = function (muiTokens) {
50818
50827
  }
50819
50828
  }
50820
50829
  },
50830
+ MuiSvgIcon: {
50831
+ styleOverrides: {
50832
+ colorSuccess: {
50833
+ color: muiTokens.palette.success.main
50834
+ }
50835
+ }
50836
+ },
50821
50837
  MuiInputLabel: {
50822
50838
  styleOverrides: {
50823
50839
  root: {
50824
- fontSize: '15px',
50840
+ fontSize: '16px',
50825
50841
  lineHeight: '16px',
50826
- paddingTop: '2px',
50827
50842
  fontWeight: 500,
50828
50843
  color: muiTokens.palette.greyXDark,
50829
50844
  '&.Mui-disabled': {